A Density-Based Contrastive Loss and Explainable Machine Learning Study of Sex-Specific Suicide Risk inOlder Adults in Sweden
2025 (English)Independent thesis Advanced level (degree of Master (Two Years)), 20 credits / 30 HE credits
Student thesis
Abstract [en]
Predicting suicide is challenging as the outcome is rare. In this thesis, data from 1,448,228 individuals aged 75 years or older (56.6% women and 43.4% men) who had in- or outpatient visits, only 1,386 suicides(0.010%) were observed between 2007 and 2018. Moreover, the characteristics of suicide cases overlapped substantially with those of non-suicide cases.
Using a prospective 90-day window, we trained and compared several sex-specific machine-learning models. Coupled with explainableartificial intelligence (xAI), the models revealed both protective andrisk factors for suicide, overall and by sex.
We implemented a TabTransformer encoder with the proposed novel Density-Based Contrastive Loss (DBCL) that up-weights anchor–positive pairs located in regions of high class overlap, thereby driving the learned embeddings away from ambiguous zones. xAI inspection highlighted that multiple previous attempts and advanced age are overall strong predictors. Living alone and any psychiatric diagnosis were female-specific risks, whereas unmarried status and high-risk manual occupations dominated in males. Integrated into a triplet-lossframework, DBCL improved the downstream F1-score of an attachedmultilayer perceptron by approximately 10% compared with a stan-dard triplet loss.
The DBCL-enhanced TabTransformer increased predictive performance and, through xAI, constructed transparent models that highlight protective and risk factors, offering actionable insights for suicide prevention in older adults.
Place, publisher, year, edition, pages
2025.
Keywords [en]
Suicide Prediction, Elderly Suicide, Machine Learning, Contrastive Learning, Density-Based Contrastive Loss (DBCL), Swedish National Health Registers, Imbalanced Data Classification, Explainable AI (XAI), TabTransformer
National Category
Computer Vision and Learning Systems
Identifiers
URN: urn:nbn:se:hh:diva-57155OAI: oai:DiVA.org:hh-57155DiVA, id: diva2:1988683
External cooperation
Statistikkonsulterna AB
Subject / course
Computer science and engineering
Educational program
Computer Science and Engineering, 300 credits
Supervisors
Examiners
2025-08-252025-08-122025-10-01Bibliographically approved