Skip to main content

Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

  • Article
  • Published:

Reliable deep learning in anomalous diffusion against out-of-distribution dynamics

A Publisher Correction to this article was published on 28 October 2024

This article has been updated

Abstract

Anomalous diffusion plays a crucial rule in understanding molecular-level dynamics by offering valuable insights into molecular interactions, mobility states and the physical properties of systems across both biological and materials sciences. Deep-learning techniques have recently outperformed conventional statistical methods in anomalous diffusion recognition. However, deep-learning networks are typically trained by data with limited distribution, which inevitably fail to recognize unknown diffusion models and misinterpret dynamics when confronted with out-of-distribution (OOD) scenarios. In this work, we present a general framework for evaluating deep-learning-based OOD dynamics-detection methods. We further develop a baseline approach that achieves robust OOD dynamics detection as well as accurate recognition of in-distribution anomalous diffusion. We demonstrate that this method enables a reliable characterization of complex behaviors across a wide range of experimentally diverse systems, including nicotinic acetylcholine receptors in membranes, fluorescent beads in dextran solutions and silver nanoparticles undergoing active endocytosis.

This is a preview of subscription content, access via your institution

Access options

Buy this article

USD 39.95

Prices may be subject to local taxes which are calculated during checkout

Fig. 1: OOD dynamics detection for anomalous diffusion recognition.
Fig. 2: Results of OOD dynamics detection.
Fig. 3: Evaluation for OOD dynamics detection with enhancement.
Fig. 4: Analysis for OOD dynamics detection.

Similar content being viewed by others

Data availability

The data that support the findings of this work are available on Code Ocean at https://doi.org/10.24433/CO.6518632.v1 (ref. 50). Source data are provided with this paper.

Code availability

Our reproduction code and the relevant documentation are available on Code Ocean at https://doi.org/10.24433/CO.6518632.v1 (ref. 50).

Change history

References

  1. Kindermann, F. et al. Nonergodic diffusion of single atoms in a periodic potential. Nat. Phys. 13, 137–141 (2017).

    Article  Google Scholar 

  2. Zhang, Y. & Hess, H. Chemically-powered swimming and diffusion in the microscopic world. Nat. Rev. Chem. 5, 500–510 (2021).

    Article  Google Scholar 

  3. Bronstein, I. et al. Transient anomalous diffusion of telomeres in the nucleus of mammalian cells. Phys. Rev. Lett. 103, 018102 (2009).

    Article  Google Scholar 

  4. Rempel, A., Waddington, E., Wettlaufer, J. & Worster, M. Possible displacement of the climate signal in ancient ice by premelting and anomalous diffusion. Nature 411, 568–571 (2001).

    Article  Google Scholar 

  5. Poletayev, A. D., Dawson, J. A., Islam, M. S. & Lindenberg, A. M. Defect-driven anomalous transport in fast-ion conducting solid electrolytes. Nat. Mater. 21, 1066–1073 (2022).

    Article  Google Scholar 

  6. Scalas, E. The application of continuous-time random walks in finance and economics. Phys. A 362, 225–239 (2006).

    Article  MathSciNet  Google Scholar 

  7. Chechkin, A. V., Seno, F., Metzler, R. & Sokolov, I. M. Brownian yet non-Gaussian diffusion: from superstatistics to subordination of diffusing diffusivities. Phys. Rev. X 7, 021002 (2017).

    Google Scholar 

  8. Krapf, D. Mechanisms underlying anomalous diffusion in the plasma membrane. Curr. Top. Membr. 75, 167–207 (2015).

    Article  Google Scholar 

  9. Weiss, M., Elsner, M., Kartberg, F. & Nilsson, T. Anomalous subdiffusion is a measure for cytoplasmic crowding in living cells. Biophys. J. 87, 3518–3524 (2004).

    Article  Google Scholar 

  10. Sokolov, I. M. & Klafter, J. From diffusion to anomalous diffusion: a century after Einstein’s Brownian motion. Chaos 15, 26103 (2005).

    Article  MathSciNet  Google Scholar 

  11. Metzler, R., Jeon, J.-H., Cherstvy, A. G. & Barkai, E. Anomalous diffusion models and their properties: non-stationarity, non-ergodicity and ageing at the centenary of single particle tracking. Phys. Chem. Chem. Phys. 16, 24128–24164 (2014).

    Article  Google Scholar 

  12. Mandelbrot, B. B. & van Ness, J. W. Fractional Brownian motions, fractional noises and applications. SIAM Rev. 10, 422–437 (1968).

    Article  MathSciNet  Google Scholar 

  13. Scher, H. & Montroll, E. W. Anomalous transit-time dispersion in amorphous solids. Phys. Rev. B 12, 2455 (1975).

    Article  Google Scholar 

  14. Klafter, J. & Zumofen, G. Lévy statistics in a Hamiltonian system. Phys. Rev. E 49, 4873 (1994).

    Article  Google Scholar 

  15. Lim, S. C. & Muniandy, S. V. Self-similar Gaussian processes for modeling anomalous diffusion. Phys. Rev. E 66, 021114 (2002).

    Article  Google Scholar 

  16. Massignan, P. et al. Nonergodic subdiffusion from Brownian motion in an inhomogeneous medium. Phys. Rev. Lett. 112, 150603 (2014).

    Article  Google Scholar 

  17. Sokolov, I. M. Models of anomalous diffusion in crowded environments. Soft Matter 8, 9043–9052 (2012).

    Article  Google Scholar 

  18. Mangalam, M., Metzler, R. & Kelty-Stephen, D. G. Ergodic characterization of nonergodic anomalous diffusion processes. Phys. Rev. Res. 5, 023144 (2023).

    Article  Google Scholar 

  19. Ślęzak, J., Metzler, R., & Magdziarz, M. Codifference can detect ergodicity breaking and non-Gaussianity. New J. Phys. 21, 053008 (2019).

    Article  MathSciNet  Google Scholar 

  20. Magdziarz, M., Weron, A., Burnecki, K. & Klafter, J. Fractional Brownian motion versus the continuous-time random walk: a simple test for subdiffusive dynamics. Phys. Rev. Lett. 103, 180602 (2009).

    Article  Google Scholar 

  21. Li, J. Role of ergodicity, aging and Gaussianity in resolving the origins of biomolecule subdiffusion. Phys. Chem. Chem. Phys. 24, 16050–16057 (2022).

    Article  Google Scholar 

  22. Muñoz-Gil, G. et al. Objective comparison of methods to decode anomalous diffusion. Nat. Commun. 12, 6253 (2021).

    Article  Google Scholar 

  23. Seckler, H. & Metzler, R. Bayesian deep learning for error estimation in the analysis of anomalous diffusion. Nat. Commun. 13, 6717 (2022).

    Article  Google Scholar 

  24. Muñoz-Gil, G., i Corominas, G. G. & Lewenstein, M. Unsupervised learning of anomalous diffusion data: an anomaly detection approach. J. Phys. A 54, 504001 (2021).

    Article  MathSciNet  Google Scholar 

  25. Hendrycks, D., Mazeika, M. & Dietterich, T. Deep anomaly detection with outlier exposure. In Proc. International Conference on Learning Representations (ICLR, 2019).

  26. Hendrycks, D. & Gimpel, K. A baseline for detecting misclassified and out-of-distribution examples in neural networks. In Proc. International Conference on Learning Representations (ICLR, 2016).

  27. Yang, J. et al. OpenOOD: benchmarking generalized out-of-distribution detection. Adv. Neural Inf. Process. Syst. 35, 32598–32611 (2022).

    Google Scholar 

  28. Zhang, H., Cisse, M., Dauphin, Y. N. & Lopez-Paz, D. Mixup: beyond empirical risk minimization. In Proc. International Conference on Learning Representations (ICLR, 2018).

  29. Kristiadi, A., Hein, M. & Hennig, P. Being Bayesian, even just a bit, fixes overconfidence in ReLu networks. In Proc. 37th International Conference on Machine Learning 5436–5446 (PMLR, 2020).

  30. Firbas, N., Garibo-i-Orts, Ò., Garcia-March, M. Á. & Conejero, J. A. Characterization of anomalous diffusion through convolutional transformers. J. Phys. A 56, 014001 (2023).

    Article  MathSciNet  Google Scholar 

  31. Elston, T. C. A macroscopic description of biomolecular transport. J. Math. Biol. 41, 189–206 (2000).

    Article  MathSciNet  Google Scholar 

  32. Maizón, H. B. & Barrantes, F. J. A deep learning-based approach to model anomalous diffusion of membrane proteins: the case of the nicotinic acetylcholine receptor. Brief. Bioinform. 23, bbab435 (2022).

    Article  Google Scholar 

  33. Qu, X. et al. Semantic segmentation of anomalous diffusion using deep convolutional networks. Phys. Rev. Res. 6, 013054 (2024).

    Article  Google Scholar 

  34. Sinai, Y. G. The limiting behavior of a one-dimensional random walk in a random medium. Theory Probab. Appl. 27, 256–268 (1983).

    Article  Google Scholar 

  35. Uhlenbeck, G. E. & Ornstein, L. S. On the theory of the Brownian motion. Phys. Rev. 36, 823–841 (1930).

    Article  Google Scholar 

  36. Ernst, D., Hellmann, M., Köhler, J. & Weiss, M. Fractional Brownian motion in crowded fluids. Soft Matter 8, 4886–4889 (2012).

    Article  Google Scholar 

  37. Zaburdaev, V., Denisov, S. & Klafter, J. Lévy walks. Rev. Mod. Phys. 87, 483 (2015).

    Article  Google Scholar 

  38. Guarnieri, D. et al. Transport across the cell-membrane dictates nanoparticle fate and toxicity: a new paradigm in nanotoxicology. Nanoscale 6, 10264–10273 (2014).

    Article  Google Scholar 

  39. Krapf, D. et al. Spectral content of a single non-Brownian trajectory. Phys. Rev. X 9, 011019 (2019).

    Google Scholar 

  40. Balcerek, M., Burnecki, K., Thapa, S., Wyłomańska, A. & Chechkin, A. Fractional Brownian motion with random hurst exponent: accelerating diffusion and persistence transitions. Chaos 32, 093114 (2022).

  41. Jin, H., Heller, D. A. & Strano, M. S. Single-particle tracking of endocytosis and exocytosis of single-walled carbon nanotubes in NIH-3T3 cells. Nano Lett. 8, 1577–1585 (2008).

    Article  Google Scholar 

  42. Miller, J. How many participants? How many trials? Maximizing the power of reaction time studies. Behav. Res. Methods 56, 2398–2421 (2024).

    Article  Google Scholar 

  43. He, K., Zhang, X., Ren, S. & Sun, J. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition 770–778 (IEEE, 2016).

  44. Daxberger, E. et al. Laplace redux-effortless Bayesian deep learning. In 35th Conference on Neural Information Processing Systems 20089–20103 (NeurIPS, 2021).

  45. Ritter, H., Botev, A. & Barber, D. A scalable Laplace approximation for neural networks. In Proc. International Conference on Learning Representations (ICLR, 2018).

  46. Ruff, L. et al. Deep one-class classification. In Proc. International Conference on Learning Representations Vol. 80, 4393–4402 (ICLR, 2018).

  47. Golan, Y. & Sherman, E. Resolving mixed mechanisms of protein subdiffusion at the t cell plasma membrane. Nat. Commun. 8, 15851 (2017).

    Article  Google Scholar 

  48. Sha, H., Li, H., Zhang, Y. & Hou, S. Deep learning-enhanced single-molecule spectrum imaging. APL Photon. 8, 096102 (2023).

  49. Hou, S., Exell, J. & Welsher, K. Real-time 3D single molecule tracking. Nat. Commun. 11, 3607 (2020).

    Article  Google Scholar 

  50. Xiao, F. Reliable deep learning in anomalous diffusion against out-of-distribution dynamics. Code Ocean https://doi.org/10.24433/CO.6518632.v1 (2024).

Download references

Acknowledgements

This work was supported by grants from the National Natural Science Foundation of China (grant nos. 62031023 and 62331011), and the Shenzhen Science and Technology Project (grant no. GXWD20220818170353009).

Author information

Authors and Affiliations

Authors

Contributions

X.F. conducted the experiments, analyzed the results and wrote the paper, with feedback from all authors. H.S. and S. Hou led the construction of optical system. Y.Z. and X.J. supervised the project. X.F., H.S. and Z.Y. proposed the initial idea. Y.S. took part in the experiments. Y.J. took part in the code design. S.L. and S. Han contributed to the results analysis.

Corresponding authors

Correspondence to Yongbing Zhang or Xiangyang Ji.

Ethics declarations

Competing interests

The authors declare no competing interests.

Peer review

Peer review information

Nature Computational Science thanks Damian G. Kelty-Stephen, Diego Krapf and Gorka Muñoz-Gil for their contribution to the peer review of this work. Primary Handling Editor: Jie Pan, in collaboration with the Nature Computational Science team.

Additional information

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary information

Supplementary Information

Supplementary Figs. 1–11, Tables 1–5, Algorithm 1 and Notes 1–8.

Reporting Summary

Source data

Source Data Fig. 2

Statistical source data.

Source Data Fig. 3

Statistical source data.

Source Data Fig. 4

Statistical source data.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Feng, X., Sha, H., Zhang, Y. et al. Reliable deep learning in anomalous diffusion against out-of-distribution dynamics. Nat Comput Sci 4, 761–772 (2024). https://doi.org/10.1038/s43588-024-00703-7

Download citation

  • Received:

  • Accepted:

  • Published:

  • Version of record:

  • Issue date:

  • DOI: https://doi.org/10.1038/s43588-024-00703-7

This article is cited by

Search

Quick links

Nature Briefing AI and Robotics

Sign up for the Nature Briefing: AI and Robotics newsletter — what matters in AI and robotics research, free to your inbox weekly.

Get the most important science stories of the day, free in your inbox. Sign up for Nature Briefing: AI and Robotics