Explainable AI–Driven Comparative Analysis of Machine Learning Models for Predicting HIV Viral Nonsuppression in Ugandan Patients: Retrospective Cross-Sectional Study
Open Access
- 6 January 2026
- journal article
- Published by JMIR Publications Inc. in JMIR AI
- Vol. 5, e68196
Abstract
Background: HIV viral suppression is essential for improving health outcomes and reducing transmission rates among people living with HIV. In Uganda, where HIV/AIDS is a major public health concern, machine learning (ML) models can predict viral suppression effectively. However, the limited use of explainable artificial intelligence (XAI) methods affects model transparency and clinical utility. Objective: This study aimed to develop and compare ML models for predicting viral nonsuppression in Ugandan people living with HIV on antiretroviral therapy (ART), and then systematically apply comprehensive XAI techniques to the best-performing model to identify key predictors and demonstrate interpretability at both population and individual patient levels. Methods: We retrospectively analyzed clinical and demographic data from 1101 Ugandan people living with HIV on ART at the HIV clinic in Muyembe Health Centre IV between June 2016 and April 2018, focusing on predicting viral nonsuppression (viral load >1000 copies per milliliter). The dataset was divided into model-building (training: 80%) and validation (test: 20%) sets. To address class imbalance, the synthetic minority over-sampling technique was applied. For global explanation, 8 ML algorithms—logistic regression, stacked ensemble, random forest, support vector machines, extreme gradient boosting (XGBoost), k-nearest neighbors, naïve Bayes, and artificial neural networks—were compared. Model performance was evaluated using metrics such as accuracy, precision, recall, F1-score, Cohen κ, and area under the curve (AUC). For local explanation, individual conditional expectation plots, Shapley Additive Explanations (SHAP), breakdown, and SHAP force plots were used to provide insights into predictions for individual patients. Results: The XGBoost ensemble model demonstrated superior performance with an accuracy of 0.89, precision of 0.59, recall of 0.65, and AUC of 0.80. The model achieved high specificity (0.93) and moderate sensitivity, yielding a Cohen κ of 0.55 and F1-score of 0.62, indicating good discriminative ability for viral nonsuppression prediction. SHAP feature importance analysis identified adherence assessment over the preceding 3 months as the most influential predictor of viral nonsuppression, followed by age group, urban residence, and duration on ART. Local SHAP consistently demonstrated that poor adherence was the primary driver of both correctly identified nonsuppressed cases and false positive predictions, reinforcing adherence as the critical determinant of treatment outcomes. Conclusions: The XGBoost model demonstrated optimal performance for predicting viral nonsuppression among Ugandan people living with HIV on ART, achieving an AUC of 0.80. Comprehensive XAI analysis identified adherence assessment as the primary predictor, followed by age group, residence type, and ART duration. XAI methods provided transparent interpretation of model predictions at both population and individual patient levels, enabling identification of key risk factors for targeted clinical interventions in resource-limited settings.Keywords
All Related Versions
This publication has 40 references indexed in Scilit:
- The association between adherence to antiretroviral therapy and viral suppression under dolutegravir‐based regimens: an observational cohort study from UgandaJournal of the International AIDS Society, 2024
- The enlightening role of explainable artificial intelligence in medical & healthcare domains: A systematic literature reviewComputers in Biology and Medicine, 2023
- Essential properties and explanation effectiveness of explainable artificial intelligence in healthcare: A systematic reviewHeliyon, 2023
- Application of explainable artificial intelligence for healthcare: A systematic review of the last decade (2011–2022)Computer Methods and Programs in Biomedicine, 2022
- Applying machine learning and predictive modeling to retention and viral suppression in South African HIV treatment cohortsScientific Reports, 2022
- Explainable Artificial Intelligence in Genomic Sequence for Healthcare Systems Prediction2022
- Incidences and factors associated with viral suppression or rebound among HIV patients on combination antiretroviral therapy from three counties in KenyaInternational Journal of Infectious Diseases, 2020
- Random forest machine learning algorithm predicts virologic outcomes among HIV infected adults in Lausanne, Switzerland using electronically monitored combined antiretroviral treatment adherenceAIDS Care, 2020
- ART adherence and viral suppression are high among most non‐pregnant individuals with early‐stage, asymptomatic HIV infection: an observational study from Uganda and South AfricaJournal of the International AIDS Society, 2019
- Ensemble Learning2017