Patients with autoimmune diseases are at increased risk of developing psychological conditions such as anxiety and depression. Timely detection of these mental health disorders is essential for effective intervention, yet remains difficult due to the overlap and subtle presentation of symptoms. In this study, we propose a machine learning (ML) framework for early prediction of anxiety and depression in autoimmune patients using routine clinical and demographic features in primary care. We develop an XGBoost-based model enhanced with custom loss functions specifically designed to handle class imbalance and semantic similarity between mental health outcomes. Experimental results demonstrate that the proposed penalty terms improve standard XGBoost performance in identifying minority classes and minimizing confusion between similar categories, by reaching a maximum statistically significant macro-Recall gain of 4.03% (p<0.05) for the Logit Distance Exponential Penalty term. This work contributes to developing data-driven tools for mental health risk assessment, with potential applications in personalized care and digital screening for vulnerable clinical populations.

Mental health risk prediction in autoimmune patients in primary care: A class-sensitive machine learning approach / Di Cosmo, M., Campanella, S., Bernardini, M., Mancini, A., Palma, L.. - In: SMART HEALTH. - ISSN 2352-6483. - 39:(2026). [10.1016/j.smhl.2026.100634]

Mental health risk prediction in autoimmune patients in primary care: A class-sensitive machine learning approach

Di Cosmo M.
Primo
;
Campanella S.
;
Bernardini M.;Mancini A.;Palma L.
Ultimo
2026-01-01

Abstract

Patients with autoimmune diseases are at increased risk of developing psychological conditions such as anxiety and depression. Timely detection of these mental health disorders is essential for effective intervention, yet remains difficult due to the overlap and subtle presentation of symptoms. In this study, we propose a machine learning (ML) framework for early prediction of anxiety and depression in autoimmune patients using routine clinical and demographic features in primary care. We develop an XGBoost-based model enhanced with custom loss functions specifically designed to handle class imbalance and semantic similarity between mental health outcomes. Experimental results demonstrate that the proposed penalty terms improve standard XGBoost performance in identifying minority classes and minimizing confusion between similar categories, by reaching a maximum statistically significant macro-Recall gain of 4.03% (p<0.05) for the Logit Distance Exponential Penalty term. This work contributes to developing data-driven tools for mental health risk assessment, with potential applications in personalized care and digital screening for vulnerable clinical populations.
2026
Autoimmune diseases; Decision support system; Electronic health record; Machine learning; Mental disorders; Primary care
File in questo prodotto:
File Dimensione Formato  
Di Cosmo_Mental-health-risk-prediction_2026.pdf

accesso aperto

Tipologia: Versione editoriale (versione pubblicata con il layout dell'editore)
Licenza d'uso: Creative commons
Dimensione 1.36 MB
Formato Adobe PDF
1.36 MB Adobe PDF Visualizza/Apri

I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/11566/364253
Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus 2
  • ???jsp.display-item.citation.isi??? 1
social impact