{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,3,21]],"date-time":"2026-03-21T18:42:48Z","timestamp":1774118568774,"version":"3.50.1"},"reference-count":42,"publisher":"MDPI AG","issue":"8","license":[{"start":{"date-parts":[[2025,8,4]],"date-time":"2025-08-04T00:00:00Z","timestamp":1754265600000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":["Computation"],"abstract":"<jats:p>Social media platforms have emerged as valuable sources for mental health research, enabling the detection of conditions such as depression through analyses of user-generated posts. This manuscript offers practical, step-by-step guidance for applying machine learning and deep learning methods to mental health detection on social media. Key topics include strategies for handling heterogeneous and imbalanced datasets, advanced text preprocessing, robust model evaluation, and the use of appropriate metrics beyond accuracy. Real-world examples illustrate each stage of the process, and an emphasis is placed on transparency, reproducibility, and ethical best practices. While the present work focuses on text-based analysis, we discuss the limitations of this approach\u2014including label inconsistency and a lack of clinical validation\u2014and highlight the need for future research to integrate multimodal signals and gold-standard psychometric assessments. By sharing these frameworks and lessons, this manuscript aims to support the development of more reliable, generalizable, and ethically responsible models for mental health detection and early intervention.<\/jats:p>","DOI":"10.3390\/computation13080186","type":"journal-article","created":{"date-parts":[[2025,8,4]],"date-time":"2025-08-04T10:48:08Z","timestamp":1754304488000},"page":"186","update-policy":"https:\/\/doi.org\/10.3390\/mdpi_crossmark_policy","source":"Crossref","is-referenced-by-count":7,"title":["Employing Machine Learning and Deep Learning Models for Mental Illness Detection"],"prefix":"10.3390","volume":"13","author":[{"given":"Yeyubei","family":"Zhang","sequence":"first","affiliation":[{"name":"School of Engineering and Applied Science, University of Pennsylvania, Philadelphia, PA 19104, USA"}]},{"given":"Zhongyan","family":"Wang","sequence":"additional","affiliation":[{"name":"Center for Data Science, New York University, New York, NY 10012, USA"}]},{"given":"Zhanyi","family":"Ding","sequence":"additional","affiliation":[{"name":"Center for Data Science, New York University, New York, NY 10012, USA"}]},{"given":"Yexin","family":"Tian","sequence":"additional","affiliation":[{"name":"College of Computing, Georgia Institute of Technology, Atlanta, GA 30332, USA"}]},{"given":"Jianglai","family":"Dai","sequence":"additional","affiliation":[{"name":"Department of EECS, University of California, Berkeley, Berkeley, CA 94720, USA"}]},{"given":"Xiaorui","family":"Shen","sequence":"additional","affiliation":[{"name":"Khoury College of Computer Science, Northeastern University, Seattle, WA 98109, USA"}]},{"given":"Yunchong","family":"Liu","sequence":"additional","affiliation":[{"name":"School of Engineering and Applied Science, University of Pennsylvania, Philadelphia, PA 19104, USA"}]},{"ORCID":"https:\/\/orcid.org\/0009-0006-2525-9379","authenticated-orcid":false,"given":"Yuchen","family":"Cao","sequence":"additional","affiliation":[{"name":"Khoury College of Computer Science, Northeastern University, Seattle, WA 98109, USA"}]}],"member":"1968","published-online":{"date-parts":[[2025,8,4]]},"reference":[{"key":"ref_1","unstructured":"WHO (2025, February 09). Mental Disorders. Available online: https:\/\/www.who.int\/news-room\/fact-sheets\/detail\/mental-disorders."},{"key":"ref_2","doi-asserted-by":"crossref","unstructured":"American Psychiatric Association (2013). Diagnostic and Statistical Manual of Mental Disorders, American Psychiatric Publishing. [5th ed.].","DOI":"10.1176\/appi.books.9780890425596"},{"key":"ref_3","unstructured":"World Health Organization (1992). International Statistical Classification of Diseases and Related Health Problems, 10th Revision (ICD-10), World Health Organization."},{"key":"ref_4","doi-asserted-by":"crossref","unstructured":"De Choudhury, M., Counts, S., and Horvitz, E. (2013, January 2\u20134). Social media as a measurement tool of depression in populations. Proceedings of the 5th Annual ACM Web Science Conference, Paris, France.","DOI":"10.1145\/2464464.2464480"},{"key":"ref_5","first-page":"43","article-title":"Detecting depression and mental illness on social media: An integrative review","volume":"18","author":"Guntuku","year":"2017","journal-title":"Curr. Opin. Psychol."},{"key":"ref_6","doi-asserted-by":"crossref","first-page":"611","DOI":"10.1089\/cyber.2019.0746","article-title":"Social Media Markers to Identify Fathers at Risk of Postpartum Depression: A Machine Learning Approach","volume":"23","author":"Shatte","year":"2020","journal-title":"Cyberpsychology Behav. Soc. Netw."},{"key":"ref_7","doi-asserted-by":"crossref","unstructured":"Yazdavar, A.H., Mahdavinejad, M.S., Bajaj, G., Romine, W., Sheth, A., Monadjemi, A.H., Thirunarayan, K., Meddar, J.M., Myers, A., and Pathak, J. (2020). Multimodal mental health analysis in social media. PLoS ONE, 15.","DOI":"10.1371\/journal.pone.0226248"},{"key":"ref_8","doi-asserted-by":"crossref","first-page":"67","DOI":"10.35566\/jbds\/caoyc","article-title":"Machine Learning Approaches for Depression Detection on Social Media: A Systematic Review of Biases and Methodological Challenges","volume":"5","author":"Cao","year":"2025","journal-title":"J. Behav. Data Sci."},{"key":"ref_9","doi-asserted-by":"crossref","first-page":"63","DOI":"10.1177\/0002716215570866","article-title":"Is Bigger Always Better? Potential Biases of Big Data Derived from Social Network Sites","volume":"659","author":"Hargittai","year":"2015","journal-title":"Ann. Am. Acad. Political Soc. Sci."},{"key":"ref_10","doi-asserted-by":"crossref","first-page":"102716","DOI":"10.1016\/j.artmed.2023.102716","article-title":"Depression Detection for Twitter Users Using Sentiment Analysis in English and Arabic Tweets","volume":"147","author":"Helmy","year":"2024","journal-title":"Artif. Intell. Med."},{"key":"ref_11","doi-asserted-by":"crossref","unstructured":"Xu, S., Cao, Y., Wang, Z., and Tian, Y. (2025). Fraud Detection in Online Transactions: Toward Hybrid Supervised\u2013Unsupervised Learning Pipelines. Preprints, 2025051101.","DOI":"10.20944\/preprints202505.1101.v1"},{"key":"ref_12","doi-asserted-by":"crossref","unstructured":"Liu, Y., Shen, X., Zhang, Y., Wang, Z., Tian, Y., Dai, J., and Cao, Y. (2025). A Systematic Review of Machine Learning Approaches for Detecting Deceptive Activities on Social Media: Methods, Challenges, and Biases. Int. J. Data Sci. Anal.","DOI":"10.1007\/s41060-025-00850-8"},{"key":"ref_13","unstructured":"Bird, S., Klein, E., and Loper, E. (2009). Natural Language Processing with Python, O\u2019Reilly Media Inc."},{"key":"ref_14","doi-asserted-by":"crossref","first-page":"146","DOI":"10.1080\/00437956.1954.11659520","article-title":"Distributional Structure","volume":"10","author":"Harris","year":"1954","journal-title":"Word"},{"key":"ref_15","doi-asserted-by":"crossref","first-page":"11","DOI":"10.1108\/eb026526","article-title":"A Statistical Interpretation of Term Specificity and Its Application in Retrieval","volume":"28","author":"Jones","year":"1972","journal-title":"J. Doc."},{"key":"ref_16","unstructured":"Mikolov, T., Chen, K., Corrado, G., and Dean, J. (2013, January 2\u20134). Efficient Estimation of Word Representations in Vector Space. Proceedings of the International Conference on Learning Representations (ICLR), Scottsdale, AZ, USA."},{"key":"ref_17","doi-asserted-by":"crossref","unstructured":"Pennington, J., Socher, R., and Manning, C.D. (2014, January 25\u201329). GloVe: Global Vectors for Word Representation. Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP), Doha, Qatar.","DOI":"10.3115\/v1\/D14-1162"},{"key":"ref_18","unstructured":"Bojanowski, P., Grave, E., Joulin, A., and Mikolov, T. (August, January 30). Enriching Word Vectors with Subword Information. Proceedings of the Transactions of the Association for Computational Linguistics, Vancouver, BC, Canada."},{"key":"ref_19","doi-asserted-by":"crossref","unstructured":"Hosmer, D.W., and Lemeshow, S. (2000). Applied Logistic Regression, John Wiley & Sons, Inc.. [2nd ed.].","DOI":"10.1002\/0471722146"},{"key":"ref_20","doi-asserted-by":"crossref","unstructured":"Cortes, C., and Vapnik, V.N. (1995). Support-Vector Networks, Springer.","DOI":"10.1023\/A:1022627411411"},{"key":"ref_21","unstructured":"Bishop, C.M. (2006). Pattern Recognition and Machine Learning, Springer."},{"key":"ref_22","unstructured":"Breiman, L., Friedman, J.H., Olshen, R.A., and Stone, C.J. (1984). Classification and Regression Trees, Wadsworth & Brooks\/Cole Advanced Books & Software."},{"key":"ref_23","doi-asserted-by":"crossref","unstructured":"Breiman, L. (2001). Random Forests, Springer.","DOI":"10.1023\/A:1010933404324"},{"key":"ref_24","doi-asserted-by":"crossref","unstructured":"Tan, L., Liu, X., Liu, D., Liu, S., Wu, W., and Jiang, H. (2024). An improved dung beetle optimizer for random forest optimization. arXiv.","DOI":"10.1109\/ICFTIC64248.2024.10913252"},{"key":"ref_25","doi-asserted-by":"crossref","first-page":"1189","DOI":"10.1214\/aos\/1013203451","article-title":"Greedy function approximation: A gradient boosting machine","volume":"29","author":"Friedman","year":"2001","journal-title":"Ann. Stat."},{"key":"ref_26","unstructured":"Ke, G., Meng, Q., Finley, T., Wang, T., Chen, W., Ma, W., Ye, Q., and Liu, T.Y. (2017, January 4\u20139). LightGBM: A highly efficient gradient boosting decision tree. Proceedings of the 31st International Conference on Neural Information Processing Systems (NIPS), Long Beach, CA, USA."},{"key":"ref_27","doi-asserted-by":"crossref","unstructured":"Tian, Y., Xu, S., Cao, Y., Wang, Z., and Wei, Z. (2025). An Empirical Comparison of Machine Learning and Deep Learning Models for Automated Fake News Detection. Mathematics, 13.","DOI":"10.20944\/preprints202506.0122.v1"},{"key":"ref_28","unstructured":"Huang, T., Cui, Z., Du, C., and Chiang, C.E. (2025). CL-ISR: A Contrastive Learning and Implicit Stance Reasoning Framework for Misleading Text Detection on Social Media. arXiv."},{"key":"ref_29","unstructured":"Lan, Z., Chen, M., Goodman, S., Gimpel, K., Sharma, P., and Soricut, R. (2020). ALBERT: A Lite BERT for Self-supervised Learning of Language Representations. arXiv."},{"key":"ref_30","unstructured":"Devlin, J., Chang, M.W., Lee, K., and Toutanova, K. (2019). BERT: Pre-training of deep bidirectional transformers for language understanding. arXiv."},{"key":"ref_31","doi-asserted-by":"crossref","unstructured":"Cho, K., van Merrienboer, B., Gulcehre, C., Bahdanau, D., Bougares, F., Schwenk, H., and Bengio, Y. (2014, January 25\u201329). Learning phrase representations using RNN encoder-decoder for statistical machine translation. Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (EMNLP), Doha, Qatar.","DOI":"10.3115\/v1\/D14-1179"},{"key":"ref_32","doi-asserted-by":"crossref","unstructured":"Wang, Y., Guo, Y., Wei, Z., Huang, Y., and Liu, X. (2019, January 8\u201311). Traffic Flow Prediction Based on Deep Neural Networks. Proceedings of the 2019 International Conference on Data Mining Workshops (ICDMW), Beijing, China.","DOI":"10.1109\/ICDMW.2019.00040"},{"key":"ref_33","doi-asserted-by":"crossref","first-page":"663","DOI":"10.1136\/bmjqs-2023-016996","article-title":"Diagnostic error in mental health: A review","volume":"33","author":"Bradford","year":"2024","journal-title":"BMJ Qual. Saf."},{"key":"ref_34","first-page":"37","article-title":"Evaluation: From precision, recall and F-measure to ROC, informedness, markedness and correlation","volume":"2","author":"Powers","year":"2011","journal-title":"J. Mach. Learn. Technol."},{"key":"ref_35","doi-asserted-by":"crossref","unstructured":"Davis, J., and Goadrich, M. (2006, January 25\u201329). The relationship between Precision-Recall and ROC curves. Proceedings of the 23rd International Conference on Machine Learning, Pittsburgh, PA, USA.","DOI":"10.1145\/1143844.1143874"},{"key":"ref_36","doi-asserted-by":"crossref","unstructured":"Zhang, Z., Wang, X., Zhang, X., and Zhang, J. (2024). Simultaneously detecting spatiotemporal changes with penalized Poisson regression models. arXiv.","DOI":"10.1016\/j.csda.2025.108240"},{"key":"ref_37","doi-asserted-by":"crossref","unstructured":"Xu, S., Tian, Y., Cao, Y., Wang, Z., and Wei, Z. (2025). Benchmarking Machine Learning and Deep Learning Models for Fake News Detection Using News Headlines. Preprints, 2025061183.","DOI":"10.20944\/preprints202506.1183.v1"},{"key":"ref_38","doi-asserted-by":"crossref","first-page":"10","DOI":"10.1016\/j.specom.2015.03.004","article-title":"A review of depression and suicide risk assessment using speech analysis","volume":"71","author":"Cummins","year":"2015","journal-title":"Speech Commun."},{"key":"ref_39","doi-asserted-by":"crossref","unstructured":"Al Hanai, T., Ghassemi, M.M., and Glass, J.R. (2018, January 2\u20136). Detecting depression with audio\/text sequence modeling of interviews. Proceedings of the Interspeech, Hyderabad, India.","DOI":"10.21437\/Interspeech.2018-2522"},{"key":"ref_40","unstructured":"Valstar, M., Gratch, J., Schuller, B., Ringeval, F., Lalanne, D., Torres Torres, M., Scherer, S., Stratou, G., Cowie, R., and Pantic, M. (2016, January 15\u201319). Avec 2016: Depression, mood, and emotion recognition workshop and challenge. Proceedings of the 6th International Workshop on Audio\/Visual Emotion Challenge, Amsterdam, The Netherlands."},{"key":"ref_41","doi-asserted-by":"crossref","first-page":"103","DOI":"10.1016\/j.cmpb.2018.04.012","article-title":"Automated EEG-based screening of depression using deep convolutional neural network","volume":"161","author":"Acharya","year":"2015","journal-title":"Comput. Methods Programs Biomed."},{"key":"ref_42","doi-asserted-by":"crossref","first-page":"031001","DOI":"10.1088\/1741-2552\/ab0ab5","article-title":"Deep learning for electroencephalogram (EEG) classification tasks: A review","volume":"16","author":"Craik","year":"2019","journal-title":"J. Neural Eng."}],"container-title":["Computation"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/www.mdpi.com\/2079-3197\/13\/8\/186\/pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,10,9]],"date-time":"2025-10-09T18:22:23Z","timestamp":1760034143000},"score":1,"resource":{"primary":{"URL":"https:\/\/www.mdpi.com\/2079-3197\/13\/8\/186"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2025,8,4]]},"references-count":42,"journal-issue":{"issue":"8","published-online":{"date-parts":[[2025,8]]}},"alternative-id":["computation13080186"],"URL":"https:\/\/doi.org\/10.3390\/computation13080186","relation":{},"ISSN":["2079-3197"],"issn-type":[{"value":"2079-3197","type":"electronic"}],"subject":[],"published":{"date-parts":[[2025,8,4]]}}}