Abstract Body

Background

Machine learning (ML) with longitudinal data can identify people living with HIV (PLHIV) at risk of unsuppressed viral load (uVL) before failure occurs. By modeling dynamic relationships between repeated viral load measurements and other patient factors, we intend to capture the critical temporal patterns often overlooked in previous research. Early detection enables timely interventions, improving retention, adherence, and outcomes. This study set out to develop ML models to predict uVL and rebound up to 6 months ahead among PLHIV on antiretroviral therapy (ART) in Rwanda

Methods

We analyzed viral load (VL) data from Rwanda’s Case-Based Surveillance (CBS) system (Jan 2020–July 2025), covering 94.3% of PLHIV on ART in Rwanda. Models tested: Categorical Boosting (CatBoost), Extreme Gradient Boosting (XGBoost), Light Gradient Boosting Machine (LightGBM), and Random Forest. Models used repeated stratified k-fold cross-validation, Optuna tuning, and multiple performance metrics. The study received ethical approvals from the Rwanda National Ethics Committee (RNEC)

Results

We analyzed 158,134 PLHIV (65.4% female; median age 45 years, IQR: 36–54). Geographically, 24.8% resided in Kigali City, 22.1% Eastern, 21.8% Western, 18.1% Southern, and 11.6% Northern Province. Most were married/cohabiting (59%) and 55% employed. Overall, 97.3% were virally suppressed. LightGBM, the best-performing model, guided feature selection (model usage + permutation importance using recall), retaining 16 predictors for multivariable logistic regression. Clinical stability (aOR = 0.11, 95% CI: 0.10–0.11) and higher time-weighted VL suppression (aOR = 0.19, 95% CI: 0.17–0.20) were protective. Shorter VL turnaround (aOR = 0.007, 95% CI: 0.003–0.015) and better adherence (aOR = 0.07, 95% CI: 0.05–0.11) were also associated with lower odds. In contrast, enhanced counselling (aOR = 5.69, 95% CI: 5.38–6.02), VL switches (aOR = 23.55, 95% CI: 19.61–28.27), advanced WHO stage (aOR = 2.07, 95% CI: 1.93–2.22), and frequent visits (aOR = 2.28, 95% CI: 2.11–2.46) were associated with higher odds of unsuppression. Table 1 shows model metrics; LightGBM performed best

Conclusions

ML models using longitudinal VL and clinical data can predict uVL up to 6 months before occurrence. LightGBM outperformed other models. Integrating ML into HIV monitoring can shift care from reactive to preventive, improving program effectiveness and outcomes.

Table or Figure