Skip to main content
BMJ Open logoLink to BMJ Open
. 2026 Oct 8;16(10):e121354. doi: 10.1136/bmjopen-2026-121354

Machine-learning model for distinguishing cytomegalovirus infection status in hospitalised patients with systemic lupus erythematosus: a retrospective cohort study with temporal validation

Ling Qin 1,0,1, Junxian Hong 1,2,3,4,0,1, Jiaxuan Liu 5,6,0,1, Shuang Zhou 2, Jinjing Liu 2,*, Wei Cao 1,✉, Quansheng Wu 5,6, Xiaofeng Zeng 2, Taisheng Li 1,7
PMCID: PMC13656159  PMID: 42849944

Abstract

Abstract

Objectives

To develop and temporally evaluate a machine-learning model to distinguish among no active cytomegalovirus (CMV) infection, CMV viraemia and CMV disease in hospitalised patients with systemic lupus erythematosus.

Design

Single-centre, retrospective, observational study with temporal validation.

Setting

A tertiary referral hospital in Beijing, China. The derivation cohort comprised patients admitted between March 2012 and October 2023, and the temporal validation cohort comprised patients admitted between November 2023 and January 2025.

Participants

A total of 1749 hospitalised patients with systemic lupus erythematosus (SLE) were included: 1519 in the derivation cohort and 230 in the temporal validation cohort.

Main outcome measures

CMV infection status was categorised as no active infection (Class 0), CMV viraemia (Class 1) or CMV disease (Class 2). Model performance was evaluated using the area under the receiver operating characteristic curve (AUROC) with 95% CIs and decision curve analysis.

Results

A total of 1749 hospitalised patients were included, comprising 1519 patients in the derivation cohort and 230 in the temporally separated validation cohort. A random forest model with six variables (CD4+ T cell count, SLEDAI-2K, haemoglobin, C-reactive protein, neutrophil count and serum ferritin) achieved the best overall performance. In the temporal validation cohort (n=230), the model achieved area under the receiver operating characteristic curve (AUROC) of 0.90 (95% CI 0.80 to 0.98) for distinguishing CMV disease from no active CMV infection, 0.72 (95% CI 0.46 to 0.95) for distinguishing CMV disease from CMV viraemia and 0.65 (95% CI 0.57 to 0.74) for distinguishing CMV viraemia from no active CMV infection. In exploratory analyses restricted to the training cohort, CD4+T cell count cut-offs selected using the Youden index were 308 cells/µL for distinguishing Class 0 from Class 1 and 171 cells/µL for comparisons involving CMV disease.

Conclusions

The model discriminated CMV disease from no active CMV infection more reliably than it discriminated CMV viraemia. Given the retrospective single-centre design and the small number of CMV disease events in the temporal validation cohort, the model could be considered exploratory and requires prospective multicentre validation before clinical use.

Keywords: Machine Learning, INFECTIOUS DISEASES, Rheumatology


STRENGTHS AND LIMITATIONS OF THIS STUDY.

  • This single-centre retrospective cohort study included hospitalised patients with systemic lupus erythematosus and evaluated routinely available clinical, laboratory and lymphocyte-subset variables.

  • Four machine-learning algorithms were compared, and predictor selection incorporated the Boruta algorithm and repeated feature-importance assessment.

  • Model performance was assessed in a held-out internal test set and a temporally separated cohort from the same institution.

  • Requiring lymphocyte-subset testing for study inclusion may have introduced selection bias and may limit applicability to unselected hospitalised patients with systemic lupus erythematosus.

  • The single-centre setting and the small number of cytomegalovirus disease events in the temporal validation cohort limited the precision and external generalisability of the model estimates.

Introduction

Cytomegalovirus (CMV) infection causes life-threatening complications in 5%–10% of patients with systemic lupus erythematosus (SLE), with immunosuppressive therapy increasing susceptibility to CMV reactivation.1–5 Distinguishing CMV viraemia and CMV disease from SLE disease spectrum is challenging, as CMV often remains asymptomatic until advanced stages yet worsens outcomes via flares or multi-organ damage, while its manifestations mimic active SLE.1 6–8 CMV activation also precipitates other co-infections, and mortality in SLE patients with active CMV ranges 13%–44%, emphasising the need for early identification.5 9–12

Previous studies in patients with SLE have primarily examined clinical risk factors for CMV infection or associations between lymphocyte subsets and CMV status, often in relatively small cohorts. These studies have provided important clinical and aetiological insights, but an explainable multiclass model integrating routinely available clinical variables with immune-cell profiles has not been temporally evaluated for distinguishing no active CMV infection, CMV viraemia and CMV disease in hospitalised patients with SLE.13 14 Cellular immunity is central to the control of CMV replication. In patients with SLE, a retrospective pilot study reported an inverse association between peripheral CD4+T cell count and CMV disease, suggesting that CD4+T cell lymphopenia may indicate impaired antiviral immune reserve.15 In addition, a prospective study of patients with active SLE receiving intensive immunosuppressive therapy found that impaired CMV-specific cell-mediated immunity after treatment was associated with subsequent clinically significant CMV infection.16 Peripheral total CD4+T cell count does not directly measure CMV-specific immunity; however, it is routinely available and may serve as a pragmatic marker of overall host immune status. These findings provide a clinical and biological rationale for evaluating CD4+T cell count together with other lymphocyte subsets.

Artificial intelligence (AI) has emerged as a powerful data exploration tool in progression evaluation for multiple diseases and conditions.17–21 Specifically, machine learning (ML) can learn from large-scale data, select significant features and establish classifying models.19 22 To enhance model efficiency and interpretability, feature selection was performed using the Boruta algorithm, which identifies all relevant features by comparing them with permuted shadow features.23

Therefore, we developed machine-learning models incorporating clinical characteristics, laboratory measurements and lymphocyte subsets to distinguish concurrent CMV infection status. We compared multiple algorithms, developed models with different numbers of predictors and evaluated their performance in a held-out test set and a temporally separated cohort from the same institution.13 16 24

Methods

This retrospective cohort study was approved by institutional review boards at Peking Union Medical College Hospital (PUMCH) with a waiver of informed consent (Ethics Number: I-25PJ2191). We followed the Transparent Reporting of a Multivariable Prediction Model for Individual Prognosis or Diagnosis plus Artificial Intelligence (TRIPOD+AI) reporting to guide the development and evaluation of our models.25 26

Study population

We reviewed SLE admissions to PUMCH for the derivation and validation cohort (March 2012 to January 2025) as shown in eFigure 1online supplemental eFigure 1. The unit of analysis was the individual patient. For patients with more than one eligible hospitalisation during the study period, only the first eligible hospitalisation was included. The inclusion criteria were: (1) diagnosis of SLE27–30; (2) age ≥14 years; (3) availability of complete medical records and lymphocyte subset results at admission; and (4) having undergone treatment for SLE. The exclusion criteria included: (1) presence of active non-CMV infection only and (2) history of organ transplantation or HIV infection.

CMV detection

The CMV DNA detection procedure has been described previously.15 CMV DNA testing was performed in serum samples at the same central laboratory of Department of Infectious Diseases, Peking Union Medical College Hospital. Human CMV DNA was detected using a human CMV nucleic acid detection kit (PCR-fluorescent probe method; Sansure Biotech, Hunan, China), based on real-time fluorescent quantitative PCR (polymerase chain reaction). A sample was considered positive for CMV DNA when the target gene cycle threshold value was ≤39. The quantitative range of the assay was 4.00×102 to 4.00×109 copies/mL; values below 4.00×102 copies/mL were considered below the limit of detection.

Outcome and predictors

The primary outcome of interest was the CMV infection status during hospitalisation. Class 0 comprised patients without detectable serum CMV DNA and without clinically diagnosed CMV disease. Class 1 comprised patients with detectable serum CMV DNA but without symptoms or end-organ manifestations attributable to CMV. Class 2 comprised patients with detectable CMV DNA and a compatible CMV syndrome or CMV end-organ disease, including pneumonia, gastrointestinal disease, hepatitis or retinitis.31 Model variables included SLEDAI-2K score, lymphocyte subset results, and results from standard laboratory tests.32 Descriptive statistics (Mann-Whitney U tests for age, disease duration, SLEDAI-2K, lymphocyte subset results and laboratory test results, and χ2 for categorical variables) were used to compare patients with different primary outcomes or in different cohorts.

Sample size

This retrospective study included all eligible patients during the prespecified study periods, and no formal a priori sample-size calculation was performed. Because the outcome was multiclass and the analysis used machine-learning algorithms, a conventional events-per-variable calculation was not considered a definitive measure of sample-size adequacy. We therefore report the numbers of participants and outcome events in each dataset and the 95% CIs around performance estimates.

Machine learning model development

Data were split longitudinally into (1) temporal derivation (March 2012 to October 2023) and (2) temporal validation (November 2023 to January 2025). Several ML algorithms, including random forest (RF), extreme gradient boosting (XGB), multi-layer perceptron (MLP) and support vector machine (SVM), were compared through cross-validation with grid search.33 34 Then Boruta was used for variable selection.23 The feature importance derived from random forest model and the mean absolute SHapley Additive exPlanations (MA-SHAP) values were evaluated to assess feature importance.17 As baseline models, we developed three models for different scenarios using the 2-, 4- or 6-variable sets, respectively. The approach is illustrated in online supplemental eFigure 1 and explained in the online supplemental eMethods.

Logistic regression

Separate univariable logistic regression models were fitted in the training set using CD4+T cell count as the sole predictor for each pairwise classifying task. For each model, the predicted-probability threshold maximising the Youden index was identified.35 Because the fitted probability was monotonic with respect to CD4+T cell count, the corresponding CD4+T cell count was derived from the fitted logistic equation. These training-set cut-offs were considered exploratory and were not independently validated.

Prototype web calculator interface

The three fitted classifying models were implemented in a prototype web interface using Gradio. The interface returns estimated probabilities for the three concurrent CMV-status categories. The underlying models were evaluated in the internal test and temporal validation datasets. The interface itself did not undergo independent usability, prospective or clinical-impact validation and should not be considered a clinical decision-support tool.

Statistical analysis

Data processing and analysis were performed via Python with scikit-learn, pandas and numpy packages.36 The missing data were imputed with the median of the feature values. Descriptive analysis involved the Shapiro-Wilk test to assess the normality of continuous data. Normally distributed continuous data are presented as the mean (SD), whereas non-normally distributed data are reported as the median (IQR) (M (IQR)). Continuous variables were compared between two groups using the Mann-Whitney U test and across three CMV-status groups using the Kruskal-Wallis test. Categorical variables were compared using the χ² test or Fisher’s exact test, as appropriate. Where post-hoc pairwise comparisons were performed, p values were adjusted for multiple comparisons using the Bonferroni method.

Patient and public involvement

Patients or the public were not involved in the design, or conduct, or reporting, or dissemination plans of our research. This was a retrospective analysis of existing clinical data.

Results

Study population

The derivation cohort included 1519 patients (1331 (87.6%) female and 188 (12.4%) male), comprising 1020 patients with no active CMV infection, 422 with CMV viraemia and 77 with CMV disease. Baseline characteristics of the training and test sets are summarised in table 1. Characteristics according to CMV status in the derivation cohort are reported in online supplemental file eTable 1. Compared with Class 0, patients in Class 1 and Class 2 are slightly older (median (IQR) age, 33.79 (26.07, 46.11) vs 34.24 (26.24, 48.74) vs 38.81 (27.26, 54.20) years; p<0.05), and exhibited higher neutrophil count, but lower haemoglobin level. Patients in Class 1 had the highest SLEDAI-2K score among the three classes (9.00 (4.00, 14.00) vs 12.00 (6.00, 17.00) vs 8.00 (3.00, 13.00); p<0.001), while Class 2 had the lowest platelet count (228.00 (166.75, 294.00) vs 231.00 (163.00, 310.75) vs 208.00 (127.00, 256.00); p<0.05). Moreover, for lymphocyte subsets, patients in Class 2 showed the lowest lymphocyte count compared with Class 0 and Class 1 (960.00 (585.75, 1543.75) vs 620.00 (367.50, 1067.50) vs 369.00 (202.50, 583.00); p<0.001), as well as lowest cell counts in T cell, B cell, NK cell, CD4+T cell, CD8+T cell subsets, CD4/CD8 ratio, CD28+% in CD4+T cells and CD28+% in CD8+T cells, but highest CD38+% in CD8+T cells and HLADR+% in CD8+T cells. Regarding inflammatory markers, patients in Class 1 and Class 2 usually had higher CRP, ESR (erythrocyte sedimentation rate), fibrinogen, and serum ferritin. In organ involvement, patients in Class 2 had most cardiac or pulmonary events (285 (27.94%) vs 168 (39.81%) vs 37 (48.05%); p<0.001), while patients in Class 1 experienced most clinical involvement in gastrointestinal, mucocutaneous, musculoskeletal, haematologic, serosal systems and systemic symptoms events in the three classes. The proportion of patients with recorded immunosuppressant or immunomodulator use during the previous 6 months was highest in Class 2 (54.9% in Class 0, 57.6% in Class 1 and 80.5% in Class 2; p<0.001). In the training cohort, CMV viraemia and CMV disease occurred in 337 (27.7%) and 62 (5.1%) patients, respectively. In the test cohort, CMV viraemia and CMV disease occurred in 85 (28.0%) and 15 (5.0%) patients. In the temporal validation cohort, 97 patients (42.1%) had CMV viraemia without CMV disease (Class 1), and 8 patients (3.5%) had CMV disease (Class 2). Characteristics according to CMV status in the temporal validation cohort and comparisons between the derivation and temporal validation cohorts are reported in online supplemental eTable 2 and eTable 3, respectively.

Table 1. Baseline characteristics of all patients in the derivation cohort.

Median (IQR) or n (%)
Characteristics Training cohort
(n=1215)
Test cohort
(n=304)
P value
Demographic information
 Age, years 34.12 (26.02, 47.08) 34.03 (26.93, 47.72) 0.818
 Sex, No (%) 0.422
 Male 155 (12.76) 33 (10.86)
 Female 1060 (87.24) 271 (89.14)
Clinical assessment
 SLE duration, months 43.50 (6.00, 108.00) 37.50 (6.00, 118.75) 0.853
 CMV infection status 0.991
 No active infection 816 (67.16) 204 (67.11)
 CMV viraemia 337 (27.74) 85 (27.96)
 CMV disease 62 (5.10) 15 (4.93)
 SLEDAI-2K score 10.00 (5.00, 15.00) 9.00 (5.00, 15.00) 0.859
Laboratory testing
 Complete blood count
 White blood cell count, /μL 6100.00 (4405.00, 8030.00) 6100.00 (4880.00, 8717.50) 0.090
 Neutrophil count, /μL 8.18 (5.45, 11.57) 8.58 (5.90, 12.54) 0.087
 Haemoglobin, g/L 93.00 (70.00, 110.00) 89.50 (70.00, 106.00) 0.202
 Platelet count 10ˆ9 /L 225.00 (163.00, 292.00) 233.50 (162.75, 314.25) 0.181
Lymphocyte subsets
 Lymphocyte count, /μL 812.00 (501.50, 1317.50) 812.00 (455.00, 1280.25) 0.781
 B cell count, /μL 80.00 (35.50, 175.00) 80.00 (33.75, 184.25) 0.865
 NK cell count, /μL 32.00 (16.00, 63.00) 32.00 (15.00, 59.25) 0.444
 T cell count, /μL 662.50 (418.00, 1058.50) 662.50 (387.75, 1034.50) 0.755
 CD4+T cell count, /μL 271.00 (157.50, 492.50) 271.00 (145.00, 460.75) 0.742
 CD8+T cell count, /μL 323.50 (198.00, 532.00) 323.50 (190.50, 537.25) 0.903
 CD4/CD8 ratio 0.82 (0.51, 1.26) 0.83 (0.52, 1.31) 0.860
 CD28+% in CD4+T cells 95.80 (90.20, 98.50) 95.80 (90.28, 98.40) 0.635
 CD28+% in CD8+T cells 53.60 (38.45, 70.75) 53.60 (38.42, 69.90) 0.982
 CD38+% in CD8+T cells 70.90 (56.20, 82.10) 70.05 (51.75, 81.93) 0.378
 HLADR+% in CD8+T cells 48.50 (29.75, 63.90) 48.50 (32.18, 65.48) 0.714
Inflammatory markers
 CRP, mg/L 6.19 (1.63, 23.72) 5.78 (1.27, 22.94) 0.657
 ESR, mm/h 39.00 (16.00, 71.00) 40.00 (21.75, 67.00) 0.394
 Fibrinogen, g/L 3.20 (2.42, 4.05) 3.26 (2.60, 4.03) 0.542
 Serum ferritin, ng/mL 354.00 (205.50, 494.50) 354.00 (174.75, 408.75) 0.240
Organ involvement
 Cardiac/pulmonary 384 (31.60) 106 (34.87) 0.308
 Gastrointestinal 161 (13.25) 41 (13.49) 0.989
 Neurological 251 (20.66) 63 (20.72) 1.000
 Renal 704 (57.94) 173 (56.91) 0.794
 Mucocutaneous 439 (36.13) 94 (30.92) 0.102
 Musculoskeletal 203 (16.71) 46 (15.13) 0.564
 Hematologic 514 (42.30) 127 (41.78) 0.919
 Serosal systems 137 (11.28) 38 (12.50) 0.619
 Systemic symptoms 336 (27.65) 77 (25.41) 0.100
Medication history
 Glucocorticoid pulse therapy 359 (29.64) 87 (28.62) 0.569
 Hydroxychloroquine (HCQ) in the past 6 months 523 (43.15) 131 (43.09) 0.686
 Immunosuppressants/immunomodulators in the past 6 months* 690 (56.79) 175 (57.57) 0.858
 Biological agents or JAK inhibitors in the past 6 months† 46 (3.79) 17 (5.59) 0.211
*

The immunosuppressive agents used in the past 6 months included cyclophosphamide (CTX), mycophenolate mofetil (MMF), tacrolimus (TAC/FK506), cyclosporine (CsA), methotrexate (MTX), leflunomide (LEF), azathioprine (AZA), Tripterygium wilfordii Hook F. extract (T2), aulfasalazine (SASP) and thalidomide (THD).

†

The biological agents used in the past 6 months included rituximab (RTX), belimumab, tocilizumab (TCZ), tumour necrosis factor inhibitors (TNFi), and cytotoxic T-lymphocyte-associated antigen 4 inhibitors (CTLA4 inhibitors). Janus kinase (JAK) inhibitors included tofacitinib, baricitinib and upadacitinib.

CMV, cytomegalovirus ; CRP, C-reactive protein; HGB, hemoglobin; NEUT, neutrophil; SF, serum ferritin; SLE, systemic lupus erythematosus.

Model features and relevant importance

With cross-validation with grid search among RF, XGB, MLP and SVM algorithms, RF models exhibited the best performance (AUROC=0.78 (range 0.75–0.80)) compared with XGB (AUROC=0.74 (range 0.71–0.78)), MLP (AUROC=0.71 (range 0.66–0.74)) and SVM (AUROC=0.73 (range 0.69–0.78)) as listed in (online supplemental eFigure 1). The top 17 variables screened by Boruta were ranked by importance scoring and MA-SHAP value as summarised in figure 1. The CD4+T cell count, lymphocyte count, and T cell count were identified as the strongest variables in the ML model. Given the strong correlations among lymphocyte subsets (online supplemental eFigure 2) and high discriminatory power in the principal component analysis for the training cohort (online supplemental eFigure 3 and eTable 4), CD4+T cell count was finally selected as the best lymphocyte subset for further feature combination (online supplemental eTable 5). Considering clinical utility in SLE management, three feature sets were defined as below: (1) CD4+SLEDAI-2K; (2) CD4+SLEDAI-2K+CRP+ HGB (hemoglobin); and (3) CD4+SLEDAI-2K+CRP+HGB+NEUT+ SF (CD4+Full set). The final CD4+Full model included six predictors and was developed using 62 CMV disease events, corresponding to approximately 10.33 events per predictor. This estimate is reported as a descriptive indicator of the available event information.

Figure 1. Feature ranking and cross-validated model performance for the random forest model. (A) Feature ranking according to random forest importance. (B) Feature ranking according to mean absolute SHAP values. Bars represent the relative importance of each feature, ranked from highest to lowest. The line indicates the AUROC obtained by sequentially adding features according to their ranking, and the shaded area indicates the range from the minimum to maximum AUROC across cross-validation folds. AUROC, area under the receiver operating characteristic curve; CD4+, CD4+T cell count; CRP, C-reactive protein; ESR, erythrocyte sedimentation rate; FIB, fibrinogen; HGB, haemoglobin; LY, lymphocyte count; NEUT, neutrophil count; NK, natural killer cell count; SF, serum ferritin; SHAP, SHapley Additive exPlanations; T, total T cell count.

Figure 1

Model performance

Table 2 reports pairwise discrimination for the three models in the training, test and temporal validation cohorts. Figure 2 presents the corresponding pairwise ROC curves. In the training cohort, all models showed the strongest discrimination between no active CMV infection (Class 0) and CMV disease (Class 2), with AUROCs ranging from 0.89 to 0.95. Discrimination was lower between CMV viraemia (Class 1) and CMV disease (AUROCs 0.83–0.90) and between no active CMV infection and CMV viraemia (AUROCs 0.73–0.82). Performance was attenuated in the test and temporal validation cohorts, particularly for comparisons involving CMV viraemia. In the temporal validation cohort, the full model achieved AUROCs of 0.65 (95% CI 0.57 to 0.74), 0.90 (95% CI 0.80 to 0.98) and 0.72 (95% CI 0.46 to 0.95) for Class 0 vs Class 1, Class 0 vs Class 2 and Class 1 vs Class 2, respectively (online supplemental eTable 6). Overall, the models discriminated CMV disease from no active CMV infection more reliably than they discriminated CMV viraemia. The addition of clinical variables generally improved performance in the training cohort, although the improvement was not consistent across all comparisons in the test and validation cohorts. Decision-curve analyses for the held-out test and temporal validation cohorts are presented in online supplemental eFigure 4; the corresponding threshold ranges are summarised in online supplemental eTable 7.

Table 2. Pairwise model discrimination in the training, internal test and temporal validation cohorts.

Model AUROC CD4+SLEDAI-2K CD4+SLEDAI-2K
+CRP+HGB
CD4+SLEDAI-2K
+CRP+HGB+NEUT+SF
In training cohort
 Class 0 vs Class 1 0.73 (0.70 to 0.77) 0.77 (0.73 to 0.80) 0.82 (0.79 to 0.85)
 Class 0 vs Class 2 0.89 (0.84 to 0.94) 0.92 (0.88 to 0.96) 0.95 (0.92 to 0.97)
 Class 1 vs Class 2 0.83 (0.76 to 0.89) 0.84 (0.78 to 0.90) 0.90 (0.85 to 0.94)
In test cohort
 Class 0 vs Class 1 0.63 (0.54 to 0.70) 0.67 (0.59 to 0.75) 0.67 (0.59 to 0.75)
 Class 0 vs Class 2 0.81 (0.61 to 0.95) 0.84 (0.69 to 0.95) 0.82 (0.64 to 0.94)
 Class 1 vs Class 2 0.75 (0.54 to 0.90) 0.73 (0.57 to 0.87) 0.70 (0.51 to 0.86)
In validation cohort
 Class 0 vs Class 1 0.60 (0.51 to 0.69) 0.63 (0.54 to 0.72) 0.65 (0.57 to 0.74)
 Class 0 vs Class 2 0.82 (0.66 to 0.95) 0.77 (0.65 to 0.91) 0.90 (0.80 to 0.98)
 Class 1 vs Class 2 0.57 (0.21 to 0.91) 0.52 (0.14 to 0.89) 0.72 (0.46 to 0.95)

AUROC, area under the receiver operating characteristic curve; CD4+, CD4+T cell count; CRP, C-reactive protein; HGB, hemoglobin; SLEDAI, Systemic Lupus Erythematosus Disease Activity Index.

Figure 2. Pairwise receiver operating characteristic (ROC) curves for discrimination of CMV status across the training, test and validation cohorts. Class 0 indicates no active CMV infection; Class 1 indicates CMV viraemia without CMV end-organ disease; and Class 2 indicates CMV disease. Rows represent the training cohort (n=1215), held-out test cohort (n=304) and temporal validation cohort (n=230), respectively. Columns show pairwise comparisons of Class 0 vs Class 1, Class 0 vs Class 2, and Class 1 vs Class 2, respectively. The dark blue-grey line represents the CD4+SLEDAI-2K model (CD4+T cell count and SLEDAI-2K); the light blue line represents the CD4+SLEDAI-2K+CRP+ HGB model; and the orange line represents the CD4+Full model (CD4+T cell count, SLEDAI-2K, C-reactive protein, haemoglobin, neutrophil count, and serum ferritin). Shaded areas indicate 95% CIs for the ROC curves. Values in each panel are AUROCs with 95% CIs. The ROC analyses were conducted separately for each pairwise comparison. AUROC, area under the receiver operating characteristic curve; CD4+, CD4+T cell count; CMV, cytomegalovirus; CRP, C-reactive protein; HGB, hemoglobin.

Figure 2

In exploratory analyses restricted to the training cohort, separate univariable logistic regression models were fitted using CD4+T cell count as the sole predictor (online supplemental eTable 8). The Youden-index-based CD4+T cell count cut-offs were 308 cells/µL for Class 0 vs Class 1 and 171 cells/µL for comparisons of Class 0 vs Class 2 and Class 1 vs Class 2. For Class 0 vs Class 1, the 308 cells/µL cut-off had a sensitivity of 71.8% and specificity of 50.5%. For comparisons involving Class 2, the 171 cells/µL cut-off had a sensitivity of 80.0%, with specificity of 77.9% for Class 0 vs Class 2 and 63.5% for Class 1 vs Class 2. These cut-offs were not independently validated.

Discussion

In this study, we developed a random-forest model incorporating CD4+T cell count, SLEDAI-2K and routine laboratory variables to discriminate concurrent CMV status among hospitalised patients with SLE. The model showed better discrimination for CMV disease than for CMV viraemia, but its performance was less consistent in the held-out test and temporal validation cohorts. The temporally separated cohort was derived from the same institution and should not be regarded as geographical external validation.

SLE patients are at high risk of CMV reactivation due to their immune dysregulation and long-term immunosuppressive therapy, and CMV co-infection significantly increases mortality in this population.11 37 Previous studies on CMV infection status discrimination primarily focused on those receiving bone marrow or organ transplantation but failed to develop effective classifying models.36 38 39 Our study extends previous association-based research by evaluating multiclass models integrating disease activity, routine laboratory measurements and lymphocyte subsets in a relatively large single-centre cohort. Of note, we have incorporated comprehensive variables including disease activity features (eg, SLEDAI-2K), routine laboratory tests (eg, CRP, HGB), and lymphocyte subsets (eg, CD4+), enabling an innovative exploration of links between immune status and infection status in this population.

The RF model was finally selected to construct the classifying model. To mitigate possible redundancy, we used the Boruta method to systematically identify the most influential predictors of CMV-related events in SLE population.23 Boruta is a powerful feature selection algorithm. Built on random forests as its base model, it effectively captures complex, non-linear relationships within the data. Its robustness comes from comparing original features against randomly permuted “shadow” features, allowing it to distinguish truly informative variables from those whose importance arises merely from data distribution or random noise. This makes Boruta particularly reliable for identifying features with genuine classifying power.

Our study identified CD4+T cell count as the most critical predictor, surpassing medication history in feature importance. Although CD4+T cell count was the most informative predictor in the feature-screening analyses, it should not be interpreted as a treatment-independent biological determinant of CMV status. Reduced CD4+T cell counts may reflect the combined effects of SLE activity, underlying immune dysregulation, recent or cumulative immunosuppressive treatment and concurrent infection-related immune perturbation. Treatment variables recorded during the previous 6 months were evaluated during candidate-feature screening but were not retained in the final six-variable model because of their limited incremental predictive contribution (eTable 9). This does not exclude residual treatment-related confounding, because cumulative dose, treatment timing, treatment intensity and treatment indication were incompletely captured. We therefore interpret CD4+T cell count as a composite marker of net host immune status rather than a causal or treatment-independent predictor. CD4+level is known to be closely associated with variable risks and types of opportunistic infections typically in HIV infection.40 41 When it drops below 50 cells/µL in HIV patients, the risk of opportunistic infections reaches 86.7%.42 Our findings support further evaluation of CD4+T cell count as an accessible marker associated with concurrent CMV status in hospitalised patients with SLE. The exploratory training-set cut-offs require independent prospective validation and should not currently be used as clinical decision thresholds.

Meanwhile, the feature selection process also confirmed CRP, HGB, SLEDAI-2K, and other relevant predictors, consistent with previous studies. For example, previous studies had reported CRP as a predictor for CMV disease, while other studies found that longer SLE disease duration and higher steroid doses were associated with disease activities of CMV and/or other infection.43 However, severity of infection and inflammatory markers often overlap with SLE activity itself, complicating discrimination between CMV-related changes and SLE progression.6 Therefore, CD4+T cell count and lymphocyte subset markers may reflect authentic immune competence and viral control.

A consistent finding across the held-out test and temporal validation cohorts was that discrimination was stronger for CMV disease (Class 2) than for asymptomatic CMV viraemia (Class 1). The lower discrimination for CMV viraemia may partly reflect clinical and immunological overlap between asymptomatic viral replication and no active CMV infection. CMV viraemia may be transient or asymptomatic, whereas CMV disease is more likely to be accompanied by organ involvement and more pronounced systemic and immunological abnormalities. Nevertheless, the modest discrimination for CMV viraemia may also reflect limitations of the available predictors and study design. The model should therefore not be interpreted as a screening test for CMV viraemia or subclinical CMV infection. Its good discrimination for CMV disease remains hypothesis-generating and requires prospective validation.

To facilitate clinical implementation, the three fitted models in a prototype web interface demonstrated how model inputs and outputs could be presented (figure 3). Although the underlying models were evaluated in the held-out test and temporal validation datasets, the interface itself has not undergone usability, prospective or clinical-impact validation and should not be considered a clinical decision-support tool.

Figure 3. Prototype web interface implementing the three concurrent CMV-status distinguishing models. The underlying models were evaluated in the held-out test and temporal validation datasets, but the interface itself was not independently prospectively or clinically validated and is not a clinical decision-support tool. CD4+, CD4+T cell count; CMV, cytomegalovirus; CRP, C-reactive protein;

Figure 3

Implications for clinical practice

The model may help identify phenotypes associated with concurrent CMV disease, but its clinical role remains uncertain. It should not replace virological testing, clinical assessment or established diagnostic procedures, and it should not be used to guide antiviral treatment. Prospective multicentre studies are required to determine whether model-assisted assessment improves diagnostic or patient-important outcomes.

Limitations

Our study has several limitations inherent to its design. First, the retrospective design did not allow the temporal sequence between CMV replication, laboratory abnormalities and lymphocyte-subset changes to be established consistently. Some predictors may therefore represent consequences of concurrent CMV disease rather than antecedent risk factors, and the models should be interpreted as concurrent classification models rather than models for predicting future CMV infection. Second, lymphocyte-subset testing and CMV testing were not routinely performed in all hospitalised patients with SLE. Requiring available lymphocyte-subset results may have introduced selection bias, while clinically indicated CMV testing may have introduced verification bias and misclassification of unrecognised asymptomatic viraemia. Third, cumulative immunosuppressant doses, precise treatment timing, treatment intensity and treatment indication were not consistently available; residual treatment-related confounding therefore cannot be excluded. Fourth, the study was conducted at a single tertiary referral hospital, and the temporal validation cohort contained only eight CMV disease events. Performance estimates involving Class 2 were consequently imprecise, and prospective geographical external validation with more CMV disease events is required.44–46

Conclusion

We developed and temporally evaluated a machine-learning model for distinguishing concurrent CMV status among hospitalised patients with SLE. The model discriminated CMV disease from no active CMV infection more reliably than it discriminated CMV viraemia. Given the retrospective single-centre design, potential selection and verification biases, and the small number of CMV disease events in the temporal validation cohort, the model and the exploratory CD4+T cell cut-offs are not ready for clinical use. Prospective multicentre validation is required to determine their reproducibility and clinical utility.

Supplementary material

online supplemental file 1
bmjopen-16-10-s001.pdf (1.7MB, pdf)
DOI: 10.1136/bmjopen-2026-121354

Acknowledgements

The AI-driven simulations and model training were performed on the robotic AI-Scientist platform of Chinese Academy of Sciences.

Footnotes

Funding: This work was supported by National High-Level Hospital Clinical Research Funding (Grant number 2022-PUMCH-B117 to WC), National Excellent Young Physicians Program of the High-level Medical Talents Program, National Health Commission of China (to WC) and Beijing Municipal Science & Technology Commission, Administrative Commission of Zhongguancun Science Park (Grant number Z251100003625025 to QW).

Prepublication history and additional supplemental material for this paper are available online. To view these files, please visit the journal online (https://doi.org/10.1136/bmjopen-2026-121354).

Provenance and peer review: Not commissioned; externally peer reviewed.

Patient consent for publication: Not applicable.

Patient and public involvement: Patients and/or the public were not involved in the design, or conduct, or reporting, or dissemination plans of this research.

Data availability free text: Data are available upon reasonable request. Deidentified participant data will be made available to researchers whose proposed use of the data has been approved by an independent review committee. Requests should be directed to the corresponding author (wcao_pumch@163.com).

Ethics approval: This study involves human participants and was approved by the Institutional Review Board of Peking Union Medical College Hospital (Ethics Number: I-25PJ2191). The study was granted a waiver of informed consent due to its retrospective nature.

Data availability statement

Data are available upon reasonable request.

References

  • 1.Takizawa Y, Inokuma S, Tanaka Y, et al. Clinical characteristics of cytomegalovirus infection in rheumatic diseases: multicentre survey in a large patient population. Rheumatology . 2008;47:1373–8. doi: 10.1093/rheumatology/ken231. [DOI] [PubMed] [Google Scholar]
  • 2.Kaul A, Gordon C, Crow MK, et al. Systemic lupus erythematosus. Nat Rev Dis Primers . 2016;2:16039. doi: 10.1038/nrdp.2016.39. [DOI] [PubMed] [Google Scholar]
  • 3.Sebastiani GD, Iuliano A, Canofari C, et al. Cytomegalovirus infection in Systemic Lupus Erythematosus: report of four cases challenging the management of the disease, and literature review. Lupus. 2019;28:432–7. doi: 10.1177/0961203319825570. [DOI] [PubMed] [Google Scholar]
  • 4.Mageau A, Sacré K, Perozziello A, et al. Septic shock among patients with systemic lupus erythematosus: Short and long-term outcome. Analysis of a French nationwide database. J Infect. 2019;78:432–8. doi: 10.1016/j.jinf.2019.04.005. [DOI] [PubMed] [Google Scholar]
  • 5.Sumethkul K, Kitumnuaypong T, Bupparenoo P, et al. CMV infection in active systemic lupus erythematosus: clinical characteristics, prognosis and treatment outcomes. BMC Rheumatol . 2025;9:134. doi: 10.1186/s41927-025-00592-x. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6.Jung J-Y, Suh C-H. Infection in systemic lupus erythematosus, similarities, and differences with lupus flare. Korean J Intern Med. 2017;32:429–38. doi: 10.3904/kjim.2016.234. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.Chen Y, Zhang L, Liu Y, et al. Clinical features and prognosis of systemic lupus erythematosus complicated by active cytomegalovirus infection: a retrospective cohort study. Front Immunol. 2024;15 doi: 10.3389/fimmu.2024.1323923. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 8.Janahi EMA, Das S, Bhattacharya SN, et al. Cytomegalovirus aggravates the autoimmune phenomenon in systemic autoimmune diseases. Microb Pathog. 2018;120:132–9. doi: 10.1016/j.micpath.2018.04.041. [DOI] [PubMed] [Google Scholar]
  • 9.Tsai WP, Chen MH, Lee MH, et al. Cytomegalovirus infection causes morbidity and mortality in patients with autoimmune diseases, particularly systemic lupus: in a Chinese population in Taiwan. Rheumatol Int. 2012;32:2901–8. doi: 10.1007/s00296-011-2131-4. [DOI] [PubMed] [Google Scholar]
  • 10.Shaharir SS, Hussein H, Rajalingham S, et al. Damage in the Multiethnic Malaysian Systemic Lupus Erythematosus (SLE) Cohort: Comparison with Other Cohorts Worldwide. PLoS ONE. 2016;11:e0166270. doi: 10.1371/journal.pone.0166270. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 11.Cui J, Yan W, Xie H, et al. Cytomegalovirus antigenemia in patients with autoimmune and non-autoimmune diseases in Beijing: A 10-year single hospital experience. PLoS ONE. 2019;14:e0221793. doi: 10.1371/journal.pone.0221793. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12.Maksimowicz-McKinnon K, Zhou J, Hudy J, et al. Subclinical CMV viremia is associated with increased nosocomial infections and prolonged hospitalization in patients with systemic autoimmune diseases. Journal of Clinical Virology. 2021;140:104849. doi: 10.1016/j.jcv.2021.104849. [DOI] [PubMed] [Google Scholar]
  • 13.Qin L, Qiu Z, Hsieh E, et al. Association between lymphocyte subsets and cytomegalovirus infection status among patients with systemic lupus erythematosus: A pilot study. Medicine (Baltimore) 2019;98:e16997. doi: 10.1097/MD.0000000000016997. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Su R, Li Z, Wang Y, et al. Imbalance between Th17 and regulatory T cells in patients with systemic lupus erythematosus combined EBV/CMV viraemia. Clin Exp Rheumatol. 2020;38:864–73. [PubMed] [Google Scholar]
  • 15.Shi X, Y, Liu X. Analysis of peripheral blood lymphocyte subsets in patients with different cytomegalovirus infection status. Beijing Med. 2024;46 doi: 10.15932/j.0253-9713.2024.03.002. [DOI] [Google Scholar]
  • 16.Bruminhent J, Autto S, Rotjanapan P, et al. A Prospective Study of Cytomegalovirus-Specific Cell-Mediated Immune Monitoring and Cytomegalovirus Infection in Patients With Active Systemic Lupus Erythematosus Receiving Immunosuppressants. Open Forum Infect Dis. 2021;8:ofab248. doi: 10.1093/ofid/ofab248. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17.Lundberg S, Lee SI. A unified approach to interpreting model predictions. ArXiv E-Prints. 2017 doi: 10.48550/arXiv.1705.07874. Preprint. [DOI]
  • 18.Haug CJ, Drazen JM. Artificial Intelligence and Machine Learning in Clinical Medicine, 2023. N Engl J Med. 2023;388:1201–8. doi: 10.1056/NEJMra2302038. [DOI] [PubMed] [Google Scholar]
  • 19.Vazquez Guillamet MC, Zhang J, Bewley A, et al. Integrating Nonindividual Patient Features in Machine Learning Models of Hospital-Onset Bacteremia. JAMA Netw Open . 2025;8:e2518815. doi: 10.1001/jamanetworkopen.2025.18815. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 20.Yuan X, Xu Q, Du F, et al. Development and validation of a model to predict cognitive impairment in traumatic brain injury patients: a prospective observational study. eClinicalMedicine. 2025;80:103023. doi: 10.1016/j.eclinm.2024.103023. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 21.Zeng D, Li H, Car J, et al. Transforming Chinese cohort studies through artificial intelligence: a new era of population health research. BMJ. 2025;391:e082568. doi: 10.1136/bmj-2024-082568. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 22.Hansen L, Bernstorff M, Enevoldsen K, et al. Predicting Diagnostic Progression to Schizophrenia or Bipolar Disorder via Machine Learning. JAMA Psychiatry. 2025;82:459. doi: 10.1001/jamapsychiatry.2024.4702. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 23.Kursa MB, Rudnicki WR. Feature Selection with the Boruta Package. J Stat Soft. 2010;36 doi: 10.18637/jss.v036.i11. [DOI] [Google Scholar]
  • 24.Nawata M, Seta N, Yamada M, et al. Possible triggering effect of cytomegalovirus infection on systemic lupus erythematosus. Scand J Rheumatol. 2001;30:360–2. doi: 10.1080/030097401317148570. [DOI] [PubMed] [Google Scholar]
  • 25.Collins GS, Moons KGM, Dhiman P, et al. TRIPOD+AI statement: updated guidance for reporting clinical prediction models that use regression or machine learning methods. BMJ. 2024;385:e078378. doi: 10.1136/bmj-2023-078378. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 26.Cohen JF, Bossuyt PMM. TRIPOD+AI: an updated reporting guideline for clinical prediction models. BMJ. 2024;385:q824. doi: 10.1136/bmj.q824. [DOI] [PubMed] [Google Scholar]
  • 27.Zhao J, Zhang S, Wang Q, et al. 2025 Chinese guidelines for the diagnosis and treatment of systemic lupus erythematosus. Rheumatology and Immunology Research. 2025;6:120–48. doi: 10.1515/rir-2025-0017. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 28.Lu W, Zhong Y, Weng C, et al. Utility of the ACR-1997, SLICC-2012 and EULAR/ACR-2019 classification criteria for systemic lupus erythematosus: a single-centre retrospective study. Lupus Sci Med. 2022;9:e000718. doi: 10.1136/lupus-2022-000718. [DOI] [Google Scholar]
  • 29.Hahn BH, McMahon MA, Wilkinson A, et al. American College of Rheumatology guidelines for screening, treatment, and management of lupus nephritis. Arthritis Care & Research. 2012;64:797–808. doi: 10.1002/acr.21664. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 30.Fanouriakis A, Kostopoulou M, Alunno A, et al. 2019 update of the EULAR recommendations for the management of systemic lupus erythematosus. Ann Rheum Dis. 2019;78:736–45. doi: 10.1136/annrheumdis-2019-215089. [DOI] [PubMed] [Google Scholar]
  • 31.Ljungman P, Boeckh M, Hirsch HH, et al. Definitions of Cytomegalovirus Infection and Disease in Transplant Patients for Use in Clinical Trials: Table 1. Clin Infect Dis. 2017;64:87–91. doi: 10.1093/cid/ciw668. [DOI] [PubMed] [Google Scholar]
  • 32.Yee C-S, Farewell VT, Isenberg DA, et al. The use of Systemic Lupus Erythematosus Disease Activity Index-2000 to define active disease and minimal clinically meaningful change based on data from a large cohort of systemic lupus erythematosus patients. Rheumatology (Oxford) 2011;50:982–8. doi: 10.1093/rheumatology/keq376. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 33.Chen T, Guestrin C. XGBoost: a scalable tree boosting system. Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining; 2016. pp. 785–94. [DOI] [Google Scholar]
  • 34.Pedregosa F, Varoquaux G, Gramfort A, et al. Scikit-learn: machine learning in python. J Mach Learn Res. 2011 [Google Scholar]
  • 35.Fluss R, Faraggi D, Reiser B. Estimation of the Youden Index and its Associated Cutoff Point. Biometrical J. 2005;47:458–72. doi: 10.1002/bimj.200410135. [DOI] [PubMed] [Google Scholar]
  • 36.Xia J, Li X, Gui G, et al. Early immune surveillance to predict cytomegalovirus outcomes after allogeneic hematopoietic stem cell transplantation. Front Cell Infect Microbiol. 2022;12:954420. doi: 10.3389/fcimb.2022.954420. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 37.Gerard L, Leport C, Flandre P, et al. Cytomegalovirus (CMV) Viremia and the CD4+ Lymphocyte Count as Predictors of CMV Disease in Patients Infected with Human Immunodeficiency Virus. Clinical Infectious Diseases. 1997;24:836–40. doi: 10.1093/clinids/24.5.836. [DOI] [PubMed] [Google Scholar]
  • 38.Park KH, Ryu JH, Bae H, et al. Delayed NK Cell Reconstitution and Reduced NK Activity Increased the Risks of CMV Disease in Allogeneic-Hematopoietic Stem Cell Transplantation. Int J Mol Sci. 2020;21:3663. doi: 10.3390/ijms21103663. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 39.Camargo JF, Wieder ED, Kimble E, et al. Deep functional immunophenotyping predicts risk of cytomegalovirus reactivation after hematopoietic cell transplantation. Blood. 2019;133:867–77. doi: 10.1182/blood-2018-10-878918. [DOI] [PubMed] [Google Scholar]
  • 40.McCune JM. The dynamics of CD4+ T-cell depletion in HIV disease. Nature. 2001;410:974–9. doi: 10.1038/35073648. [DOI] [PubMed] [Google Scholar]
  • 41.Guo F-P, Li Y-J, Qiu Z-F, et al. Baseline Naive CD4+ T-cell Level Predicting Immune Reconstitution in Treated HIV-infected Late Presenters. Chin Med J (Engl) 2016;129:2683–90. doi: 10.4103/0366-6999.193460. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 42.Mou T, Gao K-C, Chen X, et al. Clinical events associated with poor CD4+ T-cell recovery in people living with HIV following ART: A systematic review and meta-analysis. J Infect. 2025;90:106414. doi: 10.1016/j.jinf.2025.106414. [DOI] [PubMed] [Google Scholar]
  • 43.Liu XC, Zeng XQ, Zhou BT. Clinical Features and Risk Factors of Systemic Lupus Erythematosus Complicated with Cytomegalovirus Infection. Zhongguo Yi Xue Ke Xue Yuan Xue Bao. 2020;42:749–54. doi: 10.3881/j.issn.1000-503X.12267. [DOI] [PubMed] [Google Scholar]
  • 44.Al Mana H, Yassine HM, Younes NN, et al. The Current Status of Cytomegalovirus (CMV) Prevalence in the MENA Region: A Systematic Review. Pathogens. 2019;8:213. doi: 10.3390/pathogens8040213. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 45.Zuhair M, Smit GSA, Wallis G, et al. Estimation of the worldwide seroprevalence of cytomegalovirus: A systematic review and meta‐analysis. Rev Med Virol. 2019;29:e2034. doi: 10.1002/rmv.2034. [DOI] [PubMed] [Google Scholar]
  • 46.Huang Y-C, Hsiao F-Y, Guan S-T, et al. Ten-year epidemiology and risk factors of cytomegalovirus infection in hematopoietic stem cell transplantation patients in Taiwan. J Microbiol Immunol Infect. 2024;57:365–74. doi: 10.1016/j.jmii.2024.02.005. [DOI] [PubMed] [Google Scholar]

Associated Data

    This section collects any data citations, data availability statements, or supplementary materials included in this article.

    Supplementary Materials

    online supplemental file 1
    bmjopen-16-10-s001.pdf (1.7MB, pdf)
    DOI: 10.1136/bmjopen-2026-121354

    Data Availability Statement

    Data are available upon reasonable request.


    Articles from BMJ Open are provided here courtesy of BMJ Publishing Group

    RESOURCES