Qianqian Lu, Tingting Li, Jie Chen, Huanhuan Ba, Yuan Zhang, Jiajia Li, Jinling Yin, Kangxiao Ma, Huanqing Liu, Juan Jin
A regularized Time Series Transformer can provide highly accurate, patient-specific CD4 trajectory forecasts in a real-world HIV cohort. The interpretable integration of clinical features offered a transparent framework for understanding immune recovery. This work demonstrated the potential of modern sequence models to complement conventional tools and support individualized HIV care.
BACKGROUND: Accurate prediction of CD4+ T-cell trajectories is essential for monitoring HIV treatment efficacy and guiding clinical decisions. Conventional statistical methods provide population-level insights but struggle to capture nonlinear, patient-specific temporal patterns in real-world data.
METHODS: We developed a Time Series Transformer integrating multi-head self-attention with static patient characteristics. Historical 12-month CD4 measurements were jointly modeled with treatment regimen, demographics, and baseline clinical parameters within an encoder-decoder framework (4 layers, 8 heads, d_model=128). The model was trained and internally validated on a retrospective cohort of 5,436 HIV patients with CD4 measurements spanning up to 24 months post-ART, using patient-level data splitting.
RESULTS: On the test set, the model achieved an MAE of 5.36 cells/μL, RMSE of 6.94 cells/μL, and R² of 0.9990 for 6-month forecasts. Performance was consistent across patient subgroups, with unbiased, approximately normal error distributions. Feature importance analysis identified baseline CD4, treatment regimen, and time to ART initiation as dominant predictors, aligning with clinical knowledge.
CONCLUSIONS: A regularized Time Series Transformer can provide highly accurate, patient-specific CD4 trajectory forecasts in a real-world HIV cohort. The interpretable integration of clinical features offered a transparent framework for understanding immune recovery. This work demonstrated the potential of modern sequence models to complement conventional tools and support individualized HIV care.