Abstract
Machine learning (ML) is becoming a tool of choice to analyze high-dimensional datasets pertaining to mental health. Given the rapid integration of ML into research and clinical settings, this article provides a functional overview of a common ML pipeline used for the assessment and prediction of psychiatric disorders. Developing such a construct entails building a data infrastructure, collecting and preprocessing data, training and testing models and interpreting their results. Practical considerations pertaining to data management and preprocessing are first presented. We then describe considerations and best practices for model selection on the basis of the psychiatric disorder and the data modalities available for analysis. A critical analysis of existing works utilizing ML methods for psychiatric disorder assessment, prediction and causal associations is also provided. Last, future ML trends in psychiatry are highlighted. To reinforce learning, the Supplementary Note links to an interactive Jupyter Notebook that offers practical examples and hands-on interaction with a sample dataset.
This is a preview of subscription content, access via your institution
Access options
Subscribe to this journal
Receive 12 digital issues and online access to articles
$79.00 per year
only $6.58 per issue
Buy this article
- Purchase on SpringerLink
- Instant access to the full article PDF.
USD 39.95
Prices may be subject to local taxes which are calculated during checkout







Similar content being viewed by others
References
Kendler, K. S. The phenomenology of major depression and the representativeness and nature of DSM criteria. Am. J. Psychiatry 173, 771–780 (2016).
Cai, N. et al. Minimal phenotyping yields genome-wide association signals of low specificity for major depression. Nat. Genet. 52, 437–447 (2020).
Monrad-krohn, G. H. Dysprosody or altered melody of language. Brain 70, 405–415 (1947).
Kraepelin, E. Manic-Depressive Insanity and Paranoia (E. & S. Livingstone, 1921).
Wasserzug, Y. et al. Development and validation of a machine learning-based vocal predictive model for major depressive disorder. J. Affect. Disord. 325, 627–632 (2023).
Insel, T. Digital mental health care: five lessons from act 1 and a preview of acts 2–5. NPJ Digit. Med. 6, 1–3 (2023).
Sequeira, L. et al. Mobile and wearable technology for monitoring depressive symptoms in children and adolescents: a scoping review. J. Affect. Disord. 265, 314–324 (2020).
Yarkoni, T. & Westfall, J. Choosing prediction over explanation in psychology: lessons from machine learning. Perspect. Psychol. Sci. 12, 1100–1122 (2017).
Shmueli, G. To explain or to predict? Stat. Sci. 25, 289 – 310 (2010).
Nobile, M. et al. The influence of family structure, the TPH2 G-703T and the 5-HTTLPR serotonergic genes upon affective problems in children aged 10–14 years. J. Child Psychol. Psychiatry 50, 317–325 (2009).
Marino, C. et al. No evidence for association and linkage disequilibrium between dyslexia and markers of four dopamine-related genes. Eur. Child Adolesc. Psychiatry 12, 198–202 (2003).
Spatola, C. A. M. et al. Gene–environment interactions in panic disorder and CO2 sensitivity: effects of events occurring early in life. Am. J. Med. Genet. B 156B, 79–88 (2011).
Breiman, L. Statistical modeling: the two cultures (with comments and a rejoinder by the author). Stat. Sci. 16, 199–231 (2001).
Rajula, H. S. R., Verlato, G., Manchia, M., Antonucci, N. & Fanos, V. Comparison of conventional statistical methods with machine learning in medicine: diagnosis, drug development, and treatment. Medicina 56, 455 (2020).
Iyortsuun, N. K., Kim, S. H., Jhon, M., Yang, H. J. & Pant, S. A review of machine learning and deep learning approaches on mental health diagnosis. Healthcare 11, 285 (2023).
Amann, J. et al. Explainability for artificial intelligence in healthcare: a multidisciplinary perspective. BMC Med. Inform. Decis. Mak. 20, 310 (2020).
Adadi, A. & Berrada, M. in Embedded Systems and Artificial Intelligence (eds Bhateja, V. et al.) 327–337 (Springer, 2020); https://doi.org/10.1007/978-981-15-0947-6_31
Vyas, D. A., Eisenstein, L. G. & Jones, D. S. Hidden in plain sight: reconsidering the use of race correction in clinical algorithms. N. Engl. J. Med. 383, 874–882 (2020).
Glaz, A. L. et al. Machine learning and natural language processing in mental health: systematic review. J. Med. Internet Res. 23, e15708 (2021).
Zantvoort, K., Scharfenberger, J., Boß, L., Lehr, D. & Funk, B. Finding the best match—a case study on the (text-)feature and model choice in digital mental health interventions. J. Healthc. Inform. Res. 7, 447–479 (2023).
Shatte, A. B., Hutchinson, D. M. & Teague, S. J. Machine learning in mental health: a scoping review of methods and applications. Psychol. Med. 49, 1426–1448 (2019).
Dwyer, D. B., Falkai, P. & Koutsouleris, N. Machine learning approaches for clinical psychology and psychiatry. Annu. Rev. Clin. Psychol. 14, 91–118 (2018).
Manan, S. & Seneviratne, O. MentalHealthAI: Utilizing personal health device data to optimize psychiatry treatment. AMIA Annu. Symp. Proc. 2023, 641–652 (2024).
Davenport, T. & Kalakota, R. The potential for artificial intelligence in healthcare. Future Healthc. J. 6, 94–98 (2019).
Bishop, C. M. Pattern Recognition and Machine Learning 1st edn (Springer, 2006).
Minaeva, O. et al. Screening for depression in daily life: development and external validation of a prediction model based on actigraphy and experience sampling method. J. Med. Internet Res. 22, e22634 (2020).
Volkers, A. C. et al. Motor activity and autonomic cardiac functioning in major depressive disorder. J. Affect. Disord. 76, 23–30 (2003).
Finazzi, M. et al. Motor activity and depression severity in adolescent outpatients. Neuropsychobiology 61, 33–40 (2009).
Komorowski, M., Marshall, D. C., Salciccioli, J. D. & Crutain, Y. in Secondary Analysis of Electronic Health Records 185–203 (Springer, 2016); https://doi.org/10.1007/978-3-319-43742-2_15
Verma, A. A. et al. Implementing machine learning in medicine. CMAJ 193, E1351–E1357 (2021).
Software as a Medical Device (SaMD) (FDA, 2018); https://www.fda.gov/medical-devices/digital-health-center-excellence/software-medical-device-samd
Zhang, A., Xing, L., Zou, J. & Wu, J. C. Shifting machine learning for healthcare from development to deployment and from models to data. Nat. Biomed. Eng. 6, 1330–1345 (2022).
Murdoch, B. Privacy and artificial intelligence: challenges for protecting health information in a new era. BMC Med. Ethics 22, 122 (2021).
Rajkomar, A., Dean, J. & Kohane, I. Machine learning in medicine. N. Engl. J. Med. 380, 1347–1358 (2019).
Yan, W.-J., Ruan, Q.-N. & Jiang, K. Challenges for artificial intelligence in recognizing mental disorders. Diagnostics 13, 2 (2022).
Starke, G., Schmidt, B. S., De Clercq, E. & Elger, B. S. Explainability as fig leaf? An exploration of experts’ ethical expectations towards machine learning in psychiatry. AI Ethics 3, 303–314 (2023).
Chandler, C., Foltz, P. W. & Elvevåg, B. Using machine learning in psychiatry: the need to establish a framework that nurtures trustworthiness. Schizophr. Bull. 46, 11–14 (2019).
Ronneberger, O., Fischer, P. & Brox, T. In Medical Image Computing and Computer-Assisted Intervention (eds Navab, N. et al.) 234–241 (Springer, 2015).
Vaswani, A. et al. Attention is all you need. Adv. Neural Inf. Proc. Syst. 30, 1–11 (2017).
Solenov, D., Brieler, J. & Scherrer, J. The potential of quantum computing and machine learning to advance clinical research and change the practice of medicine. MO Med. 115, 463–467 (2018).
Lu, J. et al. Prediction of depression severity based on transformer encoder and CNN model. In Proc. 2022 13th International Symposium on Chinese Spoken Language Processing (ISCSLP) 339–343 (IEEE, 2022).
Gour, N. et al. Transformers for autonomous recognition of psychiatric dysfunction via raw and imbalanced EEG signals. Brain Inform. 10, 25 (2023).
Wang, J. et al. Unobtrusive health monitoring in private spaces: the smart home. Sensors 21, 864 (2021).
Zanardi, R. et al. Precision psychiatry in clinical practice. Int. J. Psychiatry Clin. Pract. 25, 19–27 (2021).
Welch, V. et al. Use of mobile and wearable artificial intelligence in child and adolescent psychiatry: scoping review. J. Med. Internet Res. 24, e33560 (2022).
Masdeu, J. C. Neuroimaging in psychiatric disorders. Neurotherapeutics 8, 93–102 (2011).
Acknowledgments
We acknowledge the Canadian Institutes of Health Research (CIHR) and the Natural Sciences and Engineering Research Council (NSERC) for providing funding for this work and the Centre for Addiction and Mental Health (CAMH) for providing resources that helped inform the writing of this article.‘deep learning.’
Author information
Authors and Affiliations
Contributions
C.L. contributed to the writing of the ‘ML in mental healthcare’, ‘ML in healthcare settings’ and ‘Data-based learning tools’ sections, and the Supplementary Information. He also co-developed the Jupyter Notebook, contributed to the revisions and organized the contributions of the other authors. M.A. contributed to the writing of the ‘ML in mental healthcare’, ‘ML in healthcare settings’ and ‘Outlook’ sections, and the Supplementary Information. T.P. contributed to the writing of the ‘ML in mental healthcare’, ‘ML in healthcare settings’ and ‘Outlook’ sections, and the Supplementary Information. He also co-developed the Jupyter Notebook and aided in revising various manuscript drafts. D.K. contributed the figures and provided major edits throughout the document. P.S. and J.S. contributed to drafting the manuscript and provided insights in the review process. M.B. contributed to the conceptualization and drafting of the manuscript and critically reviewed it throughout the review process.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Peer review
Peer review information
Nature Mental Health thanks Peter Falkai, Manpreet Singh and the other, anonymous, reviewer(s) for their contribution to the peer review of this work.
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–8, Table 1 and Discussion.
Supplementary Note
Interactive Jupyter Notebook.
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.
About this article
Cite this article
Lucasius, C., Ali, M., Patel, T. et al. A procedural overview of why, when and how to use machine learning for psychiatry. Nat. Mental Health 3, 8–18 (2025). https://doi.org/10.1038/s44220-024-00367-2
Received:
Accepted:
Published:
Version of record:
Issue date:
DOI: https://doi.org/10.1038/s44220-024-00367-2


