Related Experiment Video
Updated: May 13, 2026

Implementation of a Real-Time Psychosis Risk Detection and Alerting System Based on Electronic Health Records using CogStack
Published on: May 15, 2020
From symptom tracking to prevention - A transformer-based dynamic model for predicting mild cognitive impairment risk
Yirui Chen1, Siyi Kong2, Tianyun Wang1
1College of Public Health, Tianjin University of Traditional Chinese Medicine, Tianjin, China.
Abstract:
Depression in older adults is closely associated with an increased risk of mild cognitive impairment (MCI), yet existing prediction models often rely on cross-sectional data and fail to capture temporal changes in depressive symptoms. This study aimed to develop and validate a transformer-based dynamic prediction model for MCI risk in older adults with depression using longitudinal data. Data were obtained from the China Health and Retirement Longitudinal Study. A total of 2119 older adults with depressive symptoms were included. A sliding-window time-series framework was constructed using longitudinal follow-up data, and 394 key features were retained after feature screening and missing-data processing. An optimized transformer model incorporating dynamic positional encoding, multi-head self-attention, and gated feedforward networks was developed to model temporal associations between depressive symptom trajectories and subsequent MCI risk. Model performance was compared with that of Extreme Gradient Boosting and support vector machine. External validation was further conducted using data from the Chinese Longitudinal Healthy Longevity Survey. On the test set, the optimized transformer model achieved an accuracy of 0.816 and an area under the receiver operating characteristic curve (AUC) of 0.851, outperforming Extreme Gradient Boosting (AUC = 0.807) and support vector machine (AUC = 0.776). The transformer model also showed superior precision (0.892), specificity (0.841), sensitivity (0.801), and F1 score (0.844), indicating a stronger ability to identify high-risk individuals and capture long-term temporal dependencies in depressive symptom patterns. In external validation using the Chinese Longitudinal Healthy Longevity Survey dataset, the model maintained good generalizability, with an F1 score of 0.783 and an AUC of 0.821. The proposed transformer-based dynamic model demonstrated strong predictive performance and generalizability for identifying MCI risk in older adults with depression. By incorporating longitudinal depressive symptom trajectories, this approach provides a potentially useful tool for early screening, risk stratification, and preventive intervention in aging populations.
