- Open Access
Characterizing Nonlinear Dynamics by Contrastive Cartography
PRX Life 3, 033022 – Published 11 September, 2025
DOI: https://doi.org/10.1103/jc9p-m3rn
Abstract
The qualitative study of dynamical systems using bifurcation theory is key to understanding systems from biological clocks and neurons to physical phase transitions. Data generated from such systems can feature complex transients, an unknown number of attractors, and stochasticity. Characterization of these often-complicated behaviors remains challenging. Making an analogy to bifurcation analysis, which specifies that useful dynamical features are often invariant to coordinate transformations, we leverage contrastive learning to devise a generic tool to discover dynamical classes from stochastic trajectory data. By providing a model-free trajectory analysis tool, this method automatically recovers the dynamical phase diagram of known models and provides a “map” of dynamical behaviors for a large ensemble of dynamical systems. The method thus provides a way to characterize and compare dynamical trajectories without governing equations or prior knowledge of target behavior. We additionally show that the same strategy can be used to characterize the stochastic motion of bacteria, establishing that this approach can be used as a stand-alone analysis tool or as a component of a broader data-driven analysis framework for dynamical data.
Physics Subject Headings (PhySH)
Article Text
Supplemental Material
References (85)
- S. H. Strogatz, Nonlinear Dynamics and Chaos, 3rd ed. (Chapman & Hall/CRC, Philadelphia, PA, 2024)
- E. M. Izhikevich, Dynamical Systems in Neuroscience: The Geometry of Excitability and Bursting (The MIT Press, Cambridge, MA, 2006).
- Y. A. Kuznetsov, Elements of Applied Bifurcation Theory (Springer International Publishing, Cham, 2023).
- J. D. Meiss, Differential Dynamical Systems (Society for Industrial and Applied Mathematics, Philadelphia, PA, 2007).
- W. Gilpin, Generative learning for nonlinear dynamics, Nat. Rev. Phys. 6, 194 (2024).
- S. L. Brunton, J. L. Proctor, and J. N. Kutz, Discovering governing equations from data by sparse identification of nonlinear dynamical systems, Proc. Natl. Acad. Sci. USA 113, 3932 (2016).
- R. Supekar, B. Song, A. Hastewell, G. P. T. Choi, A. Mietke, and J. Dunkel, Learning hydrodynamic equations for active matter from particle simulations and experiments, Proc. Natl. Acad. Sci. USA 120, e2206994120 (2023).
- M. Schmidt and H. Lipson, Distilling free-form natural laws from experimental data, Science 324, 81 (2009).
- P. Y. Lu, S. Kim, and M. Soljačić, Extracting interpretable physical parameters from spatiotemporal systems using unsupervised learning, Phys. Rev. X 10, 031056 (2020).
- A. Frishman and P. Ronceray, Learning force fields from stochastic trajectories, Phys. Rev. X 10, 021009 (2020).
- T. Kadeethum, D. O'Malley, J. N. Fuhg, Y. Choi, J. Lee, H. S. Viswanathan, and N. Bouklas, A framework for data-driven solution and parameter estimation of PDEs using conditional generative adversarial networks, Nat. Comput. Sci. 1, 819 (2021).
- M. J. Falk, F. D. Roach, W. Gilpin, and A. Murugan, Curiosity-driven search for novel nonequilibrium behaviors, Phys. Rev. Res. 6, 033052 (2024).
- M. Fruchart, R. Hanai, P. B. Littlewood, and V. Vitelli, Non-reciprocal phase transitions, Nature (London) 592, 363 (2021).
- U. C. Täuber, Critical Dynamics: A Field Theory Approach to Equilibrium and Non-equilibrium Scaling Behavior (Cambridge University Press, Cambridge, UK, 2014).
- M. B. Elowitz and S. Leibler, A synthetic oscillatory network of transcriptional regulators, Nature (London) 403, 335 (2000).
- U. Alon, An Introduction to Systems Biology: Design Principles of Biological Circuits, 2nd ed. (CRC Press, Boca Raton, FL, 2020).
- L. Dai, D. Vorselen, K. S. Korolev, and J. Gore, Generic indicators for loss of resilience before a tipping point leading to population collapse, Science 336, 1175 (2012).
- V. Dakos, B. Matthews, A. P. Hendry, J. Levine, N. Loeuille, J. Norberg, P. Nosil, M. Scheffer, and L. De Meester, Ecosystem tipping points in an evolving world, Nat. Ecol. Evol. 3, 355 (2019).
- S. Brunton and J. Kutz, Data-Driven Science and Engineering: Machine Learning, Dynamical Systems, and Control (Cambridge University Press, Cambridge, UK, 2022).
- P. Welch, The use of fast Fourier transform for the estimation of power spectra: A method based on time averaging over short, modified periodograms, IEEE Trans. Audio Electroacoust. 15, 70 (1967).
- D. A. Dickey and W. A. Fuller, Distribution of the estimators for autoregressive time series with a unit root, J. Am. Stat. Assoc. 74, 427 (1979).
- A. L. Hutchison, M. Maienschein-Cline, A. H. Chiang, S. M. A. Tabei, H. Gudjonson, N. Bahroos, R. Allada, and A. R. Dinner, Improved statistical methods enable greater sensitivity in rhythm detection for genome-wide data, PLoS Comput. Biol. 11, e1004094 (2015).
- F. C. Hoppensteadt and E. M. Izhikevich, in Weakly Connected Neural Networks, edited by J. E. Marsden, L. Sirovich, and F. John, Applied Mathematical Sciences Vol. 126 (Springer, New York, 1997).
- E. M. Izhikevich, Neural excitability, spiking and bursting, Int. J. Bifurcat. Chaos 10, 1171 (2000).
- A. Hastings, K. C. Abbott, K. Cuddington, T. Francis, G. Gellner, Y.-C. Lai, A. Morozov, S. Petrovskii, K. Scranton, and M. L. Zeeman, Transient phenomena in ecology, Science 361, eaat6412 (2018).
- D. Koch, A. Nandan, G. Ramesan, I. Tyukin, A. Gorban, and A. Koseska, Ghost channels and ghost cycles guiding long transients in dynamical systems, Phys. Rev. Lett. 133, 047202 (2024).
- C. Kwon, P. Ao, and D. J. Thouless, Structure of stochastic dynamics near fixed points, Proc. Natl. Acad. Sci. USA 102, 13029 (2005).
- L. Billings and I. B. Schwartz, Identifying almost invariant sets in stochastic dynamical systems, Chaos 18, 023122 (2008).
- J. E. Chung, J. F. Magland, A. H. Barnett, V. M. Tolosa, A. C. Tooker, K. Y. Lee, K. G. Shah, S. H. Felix, L. M. Frank, and L. F. Greengard, A fully automated approach to spike sorting, Neuron 95, 1381 (2017).
- A. C. Costa, T. Ahamed, and G. J. Stephens, Adaptive, locally linear models of complex dynamics, Proc. Natl. Acad. Sci. USA 116, 1501 (2019).
- N. Romeo, A. Hastewell, A. Mietke, and J. Dunkel, Learning developmental mode dynamics from single-cell trajectories, eLife 10, e68679 (2021).
- A. E. Cohen, A. D. Hastewell, S. Pradhan, S. W. Flavell, and J. Dunkel, Schrödinger dynamics and Berry phase of undulatory locomotion, Phys. Rev. Lett. 130, 258402 (2023).
- A. B. Wiltschko, M. J. Johnson, G. Iurilli, R. E. Peterson, J. M. Katon, S. L. Pashkovski, V. E. Abraira, R. P. Adams, and S. R. Datta, Mapping sub-second structure in mouse behavior, Neuron 88, 1121 (2015).
- G. Sridhar, M. Vergassola, J. C. Marques, M. B. Orger, A. C. Costa, and C. Wyart, Uncovering multiscale structure in the variability of larval zebrafish navigation, Proc. Natl. Acad. Sci. USA 121, e2410254121 (2024).
- M. S. Schmitt, M. Koch-Janusz, M. Fruchart, D. S. Seara, M. Rust, and V. Vitelli, Information theory for data-driven model reduction in physics and biology, arXiv:2312.06608.
- P. Conti, J. Kneifl, A. Manzoni, A. Frangi, J. Fehr, S. L. Brunton, and J. N. Kutz, VENI, VINDy, VICI: A variational reduced-order modeling framework with uncertainty quantification, arXiv:2405.20905.
- K. Zeng, C. E. P. De Jesús, A. J. Fox, and M. D. Graham, Autoencoders for discovering manifold dimension and coordinates in data from complex dynamical systems, Mach. Learn.: Sci. Technol. 5, 025053 (2024).
- S. R. Achar, F. X. P. Bourassa, T. J. Rademaker, A. Lee, T. Kondo, E. Salazar-Cavazos, J. S. Davies, N. Taylor, P. François, and G. Altan-Bonnet, Universal antigen encoding of T cell activation from high-dimensional cytokine dynamics, Science 376, 880 (2022).
- G. J. Berman, D. M. Choi, W. Bialek, and J. W. Shaevitz, Mapping the stereotyped behaviour of freely moving fruit flies, J. R. Soc. Interface. 11, 20140672 (2014).
- O. Yair, R. Talmon, R. R. Coifman, and I. G. Kevrekidis, Reconstruction of normal forms by learning informed observation geometries from data, Proc. Natl. Acad. Sci. USA 114, E7865 (2017).
- A. van den Oord, Y. Li, and O. Vinyals, Representation learning with contrastive predictive coding, arXiv:1807.03748.
- T. Chen, S. Kornblith, M. Norouzi, and G. Hinton, A simple framework for contrastive learning of visual representations, arXiv:2002.05709.
- Y.-S. Chuang, R. Dangovski, H. Luo, Y. Zhang, S. Chang, M. Soljačić, S.-W. Li, W. tau Yih, Y. Kim, and J. Glass, DiffCSE: Difference-based contrastive learning for sentence embeddings, arXiv:2204.10298.
- C. Loh, T. Christensen, R. Dangovski, S. Kim, and M. Soljačić, Surrogate- and invariance-boosted contrastive learning for data-scarce applications in science, Nat. Commun. 13, 4223 (2022).
- C. Rackauckas and Q. Nie, DifferentialEquations.jl—A performant and feature-rich ecosystem for solving differential equations in Julia, J. Open Res. Softw. 5, 15 (2017).
- See Supplemental Material at http://link.aps.org/supplemental/10.1103/jc9p-m3rn for implementation details, benchmarks and additional use cases.
- A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, A. Desmaison, A. Köpf, E. Yang, Z. DeVito, M. Raison, A. Tejani, S. Chilamkurthy, B. Steiner, L. Fang, J. Bai, and S. Chintala, PyTorch: An imperative style, high-performance deep learning library, arXiv:1912.01703.
- F. Mezzadri, How to generate random matrices from the classical compact groups, NOTICES of the AMS 54, 592 (2007).
- D. P. Kingma and J. Ba, Adam: A method for stochastic optimization, arXiv:1412.6980.
- D. E. Gökmen, Z. Ringel, S. D. Huber, and M. Koch-Janusz, Symmetries and phase diagrams with real-space mutual information neural estimation, Phys. Rev. E 104, 064106 (2021).
- K. A. Murphy and D. S. Bassett, Machine-learning optimized measurements of chaotic dynamical systems via the information bottleneck, Phys. Rev. Lett. 132, 197201 (2024).
- R. Jiang, P. Y. Lu, E. Orlova, and R. Willett, Training neural operators to preserve invariant measures of chaotic attractors, in Advances in Neural Information Processing Systems, edited by A. Oh, T. Naumann, A. Globerson, K. Saenko, M. Hardt, and S. Levine (Curran Associates, New York, 2023), Vol. 36, pp. 27645–27669.
- R. FitzHugh, Impulses and physiological states in theoretical models of nerve membrane, Biophys. J. 1, 445 (1961).
- J. Nagumo, S. Arimoto, and S. Yoshizawa, An active pulse transmission line simulating nerve axon, Proc. IRE 50, 2061 (1962).
- F. Takens, Detecting strange attractors in turbulence, in Dynamical Systems and Turbulence, Warwick 1980, edited by D. Rand and L.-S. Young (Springer, Berlin, 1981), Vol. 898, pp. 366–381.
- M. Hoffmann, M. Scherer, T. Hempel, A. Mardt, B. de Silva, B. E. Husic, S. Klus, H. Wu, N. Kutz, S. L. Brunton, and F. Noé, Deeptime: A Python library for machine learning dynamical models from time series data, Mach. Learn.: Sci. Technol. 3, 015009 (2022).
- J. J. Tyson, Modeling the cell division cycle: cdc2 and cyclin interactions, Proc. Natl. Acad. Sci. USA 88, 7328 (1991).
- D. Martin, D. Seara, Y. Avni, M. Fruchart, and V. Vitelli, The transition to collective motion in nonreciprocal active matter: Coarse graining agent-based models into fluctuating hydrodynamics, (2024) arXiv:2307.08251.
- J. M. G. Vilar, H. Y. Kueh, N. Barkai, and S. Leibler, Mechanisms of noise-resistance in genetic oscillators, Proc. Natl. Acad. Sci. USA 99, 5988 (2002).
- P. Gaspard, G. Nicolis, A. Provata, and S. Tasaki, Spectral signature of the pitchfork bifurcation: Liouville equation approach, Phys. Rev. E 51, 74 (1995).
- K. P. Murphy, Probabilistic Machine Learning: An Introduction (MIT Press, Cambridge, MA, 2022).
- V. John and G. Matthies, Higher-order finite element discretizations in a benchmark problem for incompressible flows, Int. J. Numer. Methods Fluids 37, 885 (2001).
- I. A. Baratta, J. P. Dean, J. S. Dokken, M. Habera, J. S. Hale, C. N. Richardson, M. E. Rognes, M. W. Scroggs, N. Sime, and G. N. Wells, DOLFINx: The next generation FEniCS problem solving environment (2023), doi:10.5281/zenodo.10447666.
- M. S. Alnaes, A. Logg, K. B. Ølgaard, M. E. Rognes, and G. N. Wells, Unified form language: A domain-specific language for weak formulations of partial differential equations, ACM Trans. Math. Softw. 40, 1 (2014).
- M. W. Scroggs, I. A. Baratta, C. N. Richardson, and G. N. Wells, Basix: A runtime finite element basis evaluation library, J. Open Source Softw. 7, 3982 (2022).
- M. W. Scroggs, J. S. Dokken, C. N. Richardson, and G. N. Wells, Construction of arbitrary order finite element degree-of-freedom maps on polygonal and polyhedral cell meshes, ACM Trans. Math. Softw. 48, 1 (2022).
- P. J. Schmid, Dynamic mode decomposition of numerical and experimental data, J. Fluid Mech. 656, 5 (2010).
- P. Breiding and S. Timme, Homotopycontinuation.jl: A package for homotopy continuation in Julia, arXiv:1711.10911.
- L. van der Maaten and G. Hinton, Visualizing data using t-SNE, J. Mach. Learn. Res. 9, 2579 (2008).
- G. Datseris, K. Luiz Rossi, and A. Wagemakers, Framework for global stability analysis of dynamical systems, Chaos 33, 073151 (2023).
- L. McInnes, J. Healy, and J. Melville, UMAP: Uniform manifold approximation and projection for dimension reduction, arXiv:1802.03426.
- L. N. Trefethen, A. E. Trefethen, S. C. Reddy, and T. A. Driscoll, Hydrodynamic stability without eigenvalues, Science 261, 578 (1993).
- R. Sciammas, Y. Li, A. Warmflash, Y. Song, A. R. Dinner, and H. Singh, An incoherent regulatory network architecture that orchestrates B cell diversification in response to antigen signaling, Mol. Syst. Biol. 7, 495 (2011).
- W. Gilpin, Chaos as an interpretable benchmark for forecasting and data-driven modelling, arXiv:2110.05266.
- M. Christ, N. Braun, J. Neuffer, and A. W. Kempa-Liehr, Time series feature extraction on basis of scalable hypothesis tests (tsfresh—a Python package), Neurocomputing 307, 72 (2018).
- Y. S. Dufour, S. Gillet, N. W. Frankel, D. B. Weibel, and T. Emonet, Direct correlation between motile behavior and protein abundance in single cells, PLoS Comput. Biol. 12, e1005041 (2016).
- C. Chi, J. Weare, and A. R. Dinner, Sampling parameters of ordinary differential equations with langevin dynamics that satisfy constraints, arXiv:2408.15505.
- M. Scheffer, J. Bascompte, W. A. Brock, V. Brovkin, S. R. Carpenter, V. Dakos, H. Held, E. H. Van Nes, M. Rietkerk, and G. Sugihara, Early-warning signals for critical transitions, Nature (London) 461, 53 (2009).
- T. M. Bury, R. I. Sujith, I. Pavithran, M. Scheffer, T. M. Lenton, M. Anand, and C. T. Bauch, Deep learning for early warning signals of tipping points, Proc. Natl. Acad. Sci. USA 118, e2106140118 (2021).
- Y. Huang, S. Bathiany, P. Ashwin, and N. Boers, Deep learning for predicting rate-induced tipping, Nat. Mach. Intell. 6, 1556 (2024).
- P. J. Baddoo, B. Herrmann, B. J. McKeon, J. Nathan Kutz, and S. L. Brunton, Physics-informed dynamic mode decomposition, Proc. Roy. Soc. A 479, 20220576 (2023).
- Y. Lebel, T. Milo, A. Bar, A. Mayo, and U. Alon, Excitable dynamics of flares and relapses in autoimmune diseases, iScience 26, 108084 (2023).
- P. Mehta, A twenty-first century statistical physics of life, arXiv:2410.20506.
- Code is available at https://github.com/NicoRomeo/DynCarto.
- Trajectory datasets are available at Zenodo (2025), doi:10.5281/zenodo.16763216.