Abstract
Background
Influenza A (IAV) and B (IBV) viruses are the primary etiologic agents driving seasonal influenza epidemics and global pandemics. Early prediction plays a crucial role in epidemic control and reducing mortality rates. Complete blood count (CBC), a widely used clinical tool, provides rapid and non-invasive hematological biomarkers that offer diagnostic value during the pre-pathogen confirmation phase. This study proposes a machine-learning (ML) algorithm leveraging CBC parameters to distinguish IAV and IBV from other infections. This approach may complement nucleic acid tests and antigen assays, enabling timely interventions and reducing diagnostic delays.
Methods
This study retrospectively collected CBC data from patients presenting with influenza-like symptoms at Chongqing Emergency Medical Center, Chongqing, China. Patient records meeting inclusion criteria between January 1, 2023, and December 31, 2023, were compiled into a model development dataset, which was subsequently partitioned into training and internal validation subsets at an 8:2 ratio. An independent external validation cohort was collected from January 1, 2024, to February 29, 2024. We employed various machine learning (ML)-based models, using 25 features, to predict the incidence of influenza A and B and calculated the Shapley Additive Explanation (SHAP) values.
Results
The study cohort comprised 3,106 patients (453 influenza-positive cases, 14.6%; 2,653 negative controls, 85.4%). From this population, 2,925 eligible cases were allocated to the model development dataset, stratified into training (n = 2,340) and internal validation (n = 585) subsets through an 8:2 split. An independent external validation cohort containing 181 patients was collected. In the external validation, the ensemble model using voting with adaptive boosting (ADB) and the Extreme Gradient Boosting (XGB) achieved an area under the receiver operating characteristics curve (AUROC) of 0.810. SHAP analysis identified the top five hematologic parameters with dominant predictive influence in the RF model: MON%, LYM, WBC, RBC, and NEU/MON.
Conclusions
This analysis establishes RF and ADB-XGB model as the optimal CBC-based machine learning framework for discriminating influenza A and B infections. The model’s operational simplicity enables rapid triage implementation in resource-constrained emergency departments, particularly valuable when molecular confirmation (RT-PCR) is unavailable.
Supplementary Information
The online version contains supplementary material available at 10.1186/s12879-025-11502-4.
Keywords: Early prediction, Influenza, Complete blood count, Machine learning
Introduction
Influenza, an acute respiratory viral infection affecting all demographics, is associated with substantial mortality across pandemic, epidemic, and sporadic transmission scenarios. Global surveillance data indicate an annual infection rate approaching 10% of the world’s population, with influenza-attributable deaths estimated at 500,000 cases [1, 2]. The World Health Organization (WHO) and agencies like the U.S. CDC consistently recognize influenza as an ongoing public health issue, emphasizing its global impact and burden [3].
The Orthomyxoviridae family encompasses four influenza types (A-D), of which types A and B are responsible for the greatest disease burden in human populations [4]. Influenza A viruses (IAV) have precipitated four major pandemics in modern history: the 1918 H1N1 (“Spanish flu”), 1957 H2N2 (“Asian flu”), 1968 H3N2 (“Hong Kong flu”), and 2009 H1N1 pandemic. During the 2009 pandemic, nearly one-quarter of confirmed cases developed secondary complications including viral pneumonia and bacterial co-infections, which constituted primary drivers of ICU admissions and fatal outcomes [5].
IAV demonstrates particular clinical severity in pediatric and geriatric populations. Pediatric infections may manifest as severe complications including interstitial pneumonia, acute encephalopathy, and fulminant myocarditis, with mortality rates exceeding 2% in untreated cases [6]. Elderly patients (> 65 years) experience elevated risks due to prevalent comorbidities such as chronic obstructive pulmonary disease (COPD), congestive heart failure, and diabetes mellitus, where influenza infection acts as a decompensating trigger for hospitalization and mortality [7]. Influenza B virus (IBV), while phylogenetically distinct from IAV, remains a significant contributor to global influenza morbidity. Although IBV strains (containing two antigenically distinct lineages - Victoria and Yamagata) are generally considered less epidemiologically dynamic than IAV, surveillance data from 2000 to 2018 reveal IBV accounted for 23.4% of laboratory-confirmed influenza cases worldwide [8]. Notably, IBV has demonstrated epidemic potential comparable to seasonal IAV (H1N1/H3N2) in specific outbreaks, with surveillance systems documenting comparable caseloads during peak transmission seasons [9].
Influenza A and B persist as critical global health priorities despite their epidemiologic ubiquity, demanding sustained intervention to mitigate their substantial public health burden [10]. These viral pathogens present unique diagnostic challenges that necessitate methodologies balancing operational feasibility with clinical precision. Current diagnostic strategies integrate clinical symptom evaluation (e.g., pyrexia, productive cough), rapid antigen detection tests (RADTs), and nucleic acid amplification tests (NAATs), though each modality carries inherent limitations. While clinical manifestations facilitate initial suspicion, their nonspecific nature—shared with numerous respiratory pathogens—severely limits differential diagnostic utility [11]. RADTs, though providing results within 15–30 min, suffer from suboptimal sensitivity and cost-effectiveness barriers in resource-limited settings [12]. Conversely, NAATs achieve diagnostic gold-standard accuracy (98-99.8% specificity) through polymerase chain reaction (PCR) methodologies, yet their reliance on specialized instrumentation, biosafety-certified laboratories, and trained molecular biologists renders them impractical for frontline acute care management, particularly during seasonal epidemic surges or emerging pandemic scenarios [13]. Therefore, new methods are needed to enable the early diagnosis of influenza in diverse healthcare settings.
In recent years, the massive accumulation of medical data and advancements in computer technology have provided opportunities for the early diagnosis of Influenza A and Influenza B [14]. Machine learning, a key branch of artificial intelligence, has developed powerful analytical capabilities, enabling it to automatically learn from data and predict the unknown, revealing complex relationships more effectively than traditional models. In recent years, the application of machine learning in disease screening, diagnosis, prognosis prediction, and risk analysis has achieved significant results [15, 16]. Researchers such as Edna Marquez have studied the use of machine learning techniques as an alternative to viral nucleic acid testing for the diagnosis of influenza A. By analyzing patients’ symptoms and demographic data, they found that ensemble learning methods, such as random forests, excel in distinguishing patients positive for influenza A.
These machine learning technologies not only enhance the accuracy of diagnosis but also help reduce reliance on the more costly nucleic acid tests. However, a limitation of this study is that it excludes children under 7 years old, who are actually a high-risk group for influenza [17]. The latest research by Tian-Hoe Tan and others focuses on the potential complications that elderly patients (aged over 65) may experience after contracting influenza A/B, such as pneumonia, sepsis, or septic shock. By applying machine learning algorithms, the study aims to predict the probability of these patients developing severe complications and integrates the developed prediction models into hospital information systems to assist doctors in making clinical decisions in real-time [18]. In China, the application of AI in the diagnosis and risk prediction of influenza A/B is relatively limited. Existing research primarily focuses on predicting influenza trends and quantifying the spread of the flu [19]. In the medical field, research on the early prediction and risk assessment of influenza A/B needs to be further strengthened.
This study develops a machine learning model using routine blood test data (CBC) to predict Influenza A/B early. By analyzing cost-effective and widely available blood markers, we aim to simplify diagnosis, reduce costs, and improve treatment speed, offering a practical alternative to complex lab tests.
Methods
Study population
This secondary analysis utilized retrospective clinical data collected between 2021 and 2024 at Chongqing Emergency Medical Center, encompassing both inpatient and outpatient populations. The study correlated archived CBC profiles with confirmatory influenza A/B nucleic acid test results. The inclusion criteria were: 1) Presentation with influenza-like illness, such as fever, cough, sore throat, muscle aches all over the body, or headache, etc.;2) Completion of RT-PCR testing for influenza A/B virus; 3) Availability of contemporaneous CBC results.All data were de-identified and anonymized.
Outcome
Laboratory-confirmed outcomes were established through molecular diagnostic testing, with classification determined as follows: (1) Positive cases: RT-PCR detection of influenza A viral RNA, influenza B viral RNA, or co-infection with both subtypes. (2) Negative controls: Absence of detectable influenza A/B nucleic acids via RT-PCR, with cycle threshold (Ct) values > 40 across all target genes. This binary classification schema aligns with 2024 WHO Influenza Surveillance Guidelines (Version 3.2), which define positivity thresholds as Ct ≤ 38 for matrix gene targets with characteristic amplification curves [20]. All indeterminate results (Ct 38–40) underwent repeat testing and were excluded from final analysis to maintain diagnostic certainty.
Dataset
The study compiled CBC parameters as predictive variables, with all hematological measurements obtained within a ± 24-hour window relative to influenza A/B nucleic acid testing. The dataset encompasses 22 clinically validated biomarkers. Full variable specifications with collection protocols and measurement units are cataloged in Supplemental Table 1, adhering to ISO 15189:2024 hematological testing standards. Temporal alignment of CBC draws with molecular testing ensured biological plausibility of observed correlations.
Data preprocessing and modeling
The study initially extracted CBC records from the Hospital Information System (HIS), selecting for each patient the temporally closest CBC result relative to their influenza nucleic acid test timestamp. Following data acquisition, we implemented rigorous quality control measures, including comprehensive missing value detection across all hematological parameters and the systematic exclusion of records with incomplete or clinically implausible values according to predefined criteria. This process ensured dataset integrity while maintaining biological relevance. Subsequently, advanced feature engineering was performed, primarily focusing on the creation of novel derived features, thereby enhancing the predictive potential of the original CBC parameters while preserving clinical interpretability.
The dataset was temporally partitioned into a modeling cohort (January-December 2023) for algorithm development and an external validation cohort (January-February 2024) for generalizability testing, with the modeling cohort further randomly split into training and internal validation sets (8:2 ratio). Considering the imbalance between positive and negative cases, we employed the Synthetic Minority Over-sampling Technique (SMOTE) to up-sample the positive data during the model update process. SMOTE creates synthetic samples for the underrepresented class (positive) by interpolating between neighboring data points, which in turn enriches the variety within the training dataset.
Eight machine learning algorithms—the Extreme Gradient Boosting (XGB), Logistic Regression (LR), Light Gradient Boosting Machine (LightGBM), RandomForest (RF), AdaBoost (ADB), Gradient Boosting Decision Tree (GBDT), Gaussian Naive Bayes (GNB) and Support Vector Machine (SVM)—were systematically implemented and optimized via grid search to predict influenza A/B risk using CBC parameters. To optimize our predictive framework, we implemented an ensemble methodology leveraging the top-performing trio from eight candidate models through exhaustive combination analysis. Each constituent model underwent systematic hyperparameter optimization via grid search algorithms. By fine-tuning these parameters, we enhanced the predictive performance and stability of the individual models, which contributed to the overall effectiveness of the ensemble. To improve predictive accuracy and ensure broader applicability, we adopted an ensemble approach centered around stacking and voting methodologies. Stacking involves integrating predictions from various models to construct a meta-model, capitalizing on the unique advantages of each individual base model [21, 22].
To enhance the model’s generalization and minimize overfitting risks, we utilized a five-fold cross-validation strategy. The dataset was randomly shuffled and stratified to maintain the original distribution of positive and negative cases across all folds. In each iteration, the model was trained on four of the five folds and validated on the remaining fold, repeating this process five times in total. This stratified method enabled the model to learn effectively from the imbalanced dataset while preserving the representativeness of the validation data.
Validation and explanation
The models was evaluated on an independent external dataset that was reserved exclusively for performance assessment. The predictive performance of all implemented models (XGB, LR, LightGBM, RF, ADB, GBDT, GNB, SVM and ensemble models) was rigorously evaluated across validation sets using seven clinical metrics (AUC-ROC, accuracy, sensitivity, specificity, PPV, NPV, F1-score), with AUC-ROC serving as the primary selection criterion for identifying the optimal model. Subsequently, the Shapley Additive Explanations (SHAP) framework was applied to deconstruct the decision-making process of the optimal model, providing feature contributions [23–25].
Statistical analysis
Categorical data, expressed in terms of frequencies and proportions, were subjected to the Chi-square test or Fisher’s exact test to determine their statistical importance. For normally distributed quantitative variables, comparisons were made using the t-test, and the results are presented as average values plus or minus the standard error of the mean. In the case of variables that did not follow a normal distribution, the Mann–Whitney U test was utilized for analysis. A significance level of 0.05 or less was considered indicative of statistical significance. We used Python 3.11.5 as the programming language for model construction and employed Matplotlib for visualizing the analysis results to provide an intuitive display. All statistical analyses were conducted in the Beckman Coulter DxAI platform (https://www.xsmartanalysis.com/beckman/login/).
Results
Patient characteristics
The modeling cohort consisted of 2,925 clinically evaluated patients (436 influenza-positive cases [14.91%] vs. 2,489 negative controls [85.09%]), with demographic analysis revealing an elderly-skewed population (median age = 67 years, IQR:46–78) characteristic of the source hospital’s emergency care service profile. As quantitatively detailed in Table 1, baseline parameters included demographics, clinical indicators and comorbidity burden.
Table 1.
Demographics and background conditions of the study populations
| Characteristics | ALL (N = 2925) |
Negative Patient (N = 2489, 85.09%) |
Positive Patient (N = 436, 14.91%) |
|---|---|---|---|
| Female, No, % | 1322 (45.20%) | 1123 (45.12%) | 199 (45.64%) |
| Male, No, % | 1603 (54.80%) | 1366 (54.88%) | 237 (54.36%) |
| Age, median, y | 67 (46–78) | 67 (46–78) | 65 (41–77) |
| Background conditions No. (%) | |||
| Outpatient | 99 (3.38%) | 62 (2.49%) | 37 (8.49%) |
| Inpatient | 2826 (96.62%) | 2427 (97.51%) | 399 (91.51%) |
| Fever | 321 (10.97%) | 237 (9.52%) | 84 (19.27%) |
| Hypertension | 84 (2.87%) | 80 (3.21%) | 4 (0.92%) |
| Diabetes | 79 | 73 (2.93%) | 9 (2.06%) |
| Heart Disease | 181 | 162 (6.51) | 19 (4.36%) |
| Kidney Disease | 29 (0.99%) | 25 (1.00%) | 4 (0.92%) |
| Liver Disease | 9 (0.31%) | 8 (0.32%) | 1 (0.23%) |
| Pulmonary Disease | 981 33.54%) | 881 (35.40%) | 100 (22.94%) |
Data preprocessing and modeling
The 2,925-patient cohort was partitioned into training (n = 2,340) and internal validation (n = 585) sets at an 8:2 ratio, with an independent external validation cohort of 181 patients (25 positive [13.8%] vs. 156 negative [86.2%]). The comparative analysis of baseline characteristics (Table 2) revealed that most variables exhibited no statistically significant disparities among the training, internal validation, and external validation cohorts, with significant discrepancies observed only in a few hematological parameters including white blood cell count (WBC), monocyte percentage (MON%), lymphocyte count (LYM), and hematocrit (HCT) level (P < 0.05).
Table 2.
Comparison of baseline characteristics between training set, internal validation set, and external validation set
| Variables | Training Set (n = 2340) |
Internal Validation Set(n = 585) | External Validation Set (n = 181) |
P Value |
|---|---|---|---|---|
| WBC,×10^9/L | 7.67(5.56,10.90) | 7.77(5.55,10.26) | 9.21 (6.49,13.05) | <0.05* |
| NEU,×10^9/L | 5.88(3.96, 9.13) | 6.06(4.07, 8.55) | 7.83 (5.16, 11.52) | 0.62 |
| NEU%,% | 79.65(70.00, 86.7) | 78.60(70.70, 85.80) | 84.30 (77.30, 89.90) | 0.31 |
| EOS,×10^9/L | 0.03(0.01, 0.10) | 0.04(0.01, 0.10) | 0.02 (0.00, 0.08) | 0.13 |
| EOS%,% | 0.40(0.10, 1.30) | 0.40(0.10, 1.50) | 0.20 (0.00, 1.00) | 0.09 |
| MON,×10^9/L | 0.48(0.34, 0.67) | 0.48(0.34, 0.65) | 0.52 (0.32, 0.75) | 0.97 |
| MON%,% | 6.20(4.50, 8.30) | 6.50(4.50, 8.60) | 5.40 (3.60,7.80) | <0.05* |
| BASO,×10^9/L | 0.02(0.01, 0.03) | 0.02(0.01, 0.03) | 0.02 (0.01,0.03) | 0.96 |
| BASO%,% | 0.20(0.10, 0.40) | 0.20(0.10, 0.40) | 0.20 (0.10, 0.30) | 0.57 |
| LYM,×10^9/L | 0.91(0.59, 1.36) | 0.93(0.64, 1.32) | 0.79 (0.52, 1.24) | <0.05* |
| LYM%,% | 12.10(7.10, 19.90) | 12.60(7.80, 19.40) | 8.50 (5.30, 14.90) | 0.34 |
| RBC,×10^12/L | 4.23(3.72,4.66) | 4.25(3.70,4.69) | 4.01 (3.29,4.61) | 0.82 |
| HBG, g/L | 127.00(111.00,140.00) | 127.00(108.00,142.00) | 115.00 (92.00,136.00) | 0.94 |
| MCV, fL | 91.50(88.20, 94.60) | 91.90(88.10, 95.10) | 90.90 (87.20, 94.90) | 0.47 |
| MCH, pg | 30.20(29.00, 31.30) | 30.20(28.90, 31.50) | 29.40 (28.10, 30.50) | 0.49 |
| MCHC, g/L | 329.00(322.00,336.00) | 328.00(321.00,336.00) | 322.00 (312.00,331.00) | 0.43 |
| RDW,% | 13.10(12.50, 14.00) | 13.10(12.50, 13.90) | 13.30 (12.90, 14.80) | 0.27 |
| PLT,×10^9/L | 192.00(150.00,243.00) | 189.00(150.00,241.00) | 185.00 (131.00,251.00) | 0.51 |
| MPV,% | 10.20(9.50, 11.10) | 10.30(9.50, 11.10) | 10.60 (9.60, 11.30) | 0.79 |
| PDW | 15.80(11.60, 16.30) | 15.80(11.90, 16.30) | 15.80 (12.50, 16.40) | 0.53 |
| HCT,% | 38.70(33.70, 42.30) | 38.70(33.60, 42.60) | 36.10 (29.80, 41.50) | <0.05* |
| PCT,% | 0.20(0.16, 0.24) | 0.19(0.16, 0.24) | 0.20 (0.15, 0.251) | 0.42 |
Continuous variables of each group are presented as the mean ± SEM/Median [interquartile range]. Student’s t-test was used to compare the normally distributed continuous variables; Mann–Whitney U test is used to compare non-normally distributed continuous variables
*P < 0.05
To address class imbalance during the study, we implemented the Synthetic Minority Over-sampling Technique (SMOTE), while three novel ratio-based features (NEU/WBC, NEU/LYM, and NEU/MON) were derived through feature engineering to enhance data representation [26].
Classification results
Table 3 presents the five-fold cross-validation of various ML models usingAUROC, accuracy, sensitivity, specificity, PPV, NPV and F1-score as evaluation metrics. The structure of the models is illustrated in Fig. 1. Regarding AUROC, the RF model provided the best performance when only a single model was considered in the internal validation: 0.861 (SD, 0.017) AUROC, 0.834 (0.012) accuracy, 0.466 (0.043) sensitivity, 0.930 (0.011) specificity, 0.639 (0.043) PPV, 0.869 (0.009) NPV, and 0.538 (0.038) F1-score. In the external validation, the AUROC for RF was 0.752 (95% CI: 0.640–0.863). To further improve the prediction performance, we investigated the ensemble approach, including both stacking and voting, utilizing a possible combination of the top three single models (RF, ADB, XGB). The ensemble model using voting approach of the ADB and XGB provided better performance: 0.861 (SD, 0.017) AUROC. 0.851 (0.013) accuracy, 0.492 (0.043) sensitivity, 0.942 (0.010) specificity, 0.685 (0.047) PPV, 0.879 (0.014) NPV, and 0.573 (0.039) FI-score. In the external validation, the AUROC for ADB-XGB was 0.810 (95% CI: 0.732–0.888). Therefore, RF and an ensemble model (ADB-XGB) have been proposed as the best models to predict the incidence of influenza A and B.
Table 3.
Performance evaluation of ML models
| Model | AUC | Accuracy(SD) | Sensitivity(SD) | Specificity(SD) | PPV(SD) | NPV(SD) | F1-score(SD) |
|---|---|---|---|---|---|---|---|
| XGB | 0.820(0.014) | 0.819(0.007) | 0.516(0.013) | 0.897(0.009) | 0.564(0.030) | 0.878(0.005) | 0.538(0.018) |
| LR | 0.747(0.015) | 0.683(0.025) | 0.713(0.024) | 0.674(0.033) | 0.378(0.013) | 0.894(0.013) | 0.493(0.012) |
| LightGBM | 0.690(0.061) | 0.650(0.058) | 0.685(0.019) | 0.641(0.078) | 0.337(0.055) | 0.888(0.008) | 0.448(0.045) |
| RF | 0.839(0.016) | 0.834 (0.012) | 0.466(0.043) | 0.930(0.011) | 0.639 (0.043) | 0.869 (0.009) | 0.538 (0.038) |
| ADB | 0.809(0.011) | 0.741(0.013) | 0.734(0.008) | 0.743(0.018) | 0.417(0.027) | 0.918(0.006) | 0.531(0.019) |
| GBDT | 0.746(0.066) | 0.723(0.086) | 0.507(0.224) | 0.777(0.157) | 0.507(0.240) | 0.867(0.027) | 0.405(0.104) |
| GNB | 0.735(0.019) | 0.679(0.027) | 0.691(0.061) | 0.676(0.047) | 0.362(0.028) | 0.893(0.015) | 0.473(0.019) |
| SVM | 0.567(0.102) | 0.559(0.153) | 0.546(0.293) | 0.566(0.265) | NaN(NaN) | 0.832(0.032) | NaN(NaN) |
| XGB + RF | 0.861(0.017) | 0.851(0.013) | 0.492(0.043) | 0.942(0.010) | 0.685(0.047) | 0.879(0.014) | 0.573(0.039) |
| XGB + ADB | 0.863(0.015) | 0.847(0.015) | 0.445(0.040) | 0.950(0.010) | 0.695(0.047) | 0.870(0.016) | 0.543(0.037) |
| RF + ADB | 0.851(0.017 | 0.831(0.016) | 0.305(0.041) | 0.966(0.008) | 0.696(0.059) | 0.845(0.016) | 0.424(0.046) |
| ALL | 0.860(0.018) | 0.846(0.016) | 0.406(0.050) | 0.958(0.009) | 0.712(0.058) | 0.863(0.015) | 0.517(0.050) |
ALL includes XGB + ADB + RF
Fig. 1.
AUROC of Eight Single and Ensemble Models During Internal and External Validation. 1a and 1b represent the AUROC of the eight individual models and ensemble models in the internal validation set. 1c and 1 d represent the AUROC of the RF model and the ADB&XGB model in the external validation set
Model interpretation
Figure 2 presents the SHAP-based interpretability analysis of the constructed RF model, identifying the five most influential features for Influenza A and B prediction ranked by importance: MON%, LYM, WBC, RBC, NEU/MON. Most are directly linked to immune system activity, capturing key physiological alterations during influenza virus infection. This finding underscores the model’s biological plausibility, as these hematological markers align with established clinical knowledge about immune responses to viral pathogens, thereby validating their critical utility in influenza prediction.
Fig. 2.
Feature importance ranking generated by SHAP analysis in the RF model
Discussion
We established an early prediction model for Influenza A and B by utilizing complete blood count (CBC) parameters obtained from regional healthcare facilities, thereby developing a customized diagnostic tool optimized for local clinical environments. The model leverages routinely available hematological indicators to deliver accessible and timely influenza risk evaluation, offering particular value for resource-limited medical institutions where advanced virological testing capabilities may be constrained [27].
In current clinical practice, the diagnosis of Influenza A and B primarily relies on nucleic acid testing, which, despite its diagnostic utility, is constrained by prolonged testing durations, reliance on specialized equipment, and the necessity for skilled technicians, coupled with elevated costs [28, 29]. While antigen-based assays remain widely adopted, they exhibit suboptimal sensitivity and specificity, with outcomes heavily contingent on sample quality—improper collection practices frequently resulting in false-negative results [17]. In contrast, complete blood count (CBC) analysis represents a routinely accessible diagnostic tool across healthcare settings, often serving as a foundational component of patient evaluations. Leveraging CBC data through machine learning approaches to preliminarily stratify patients’ risks for Influenza A and B infections could markedly expedite diagnostic timelines, reduce financial burdens, and align with health economic principles. Simultaneously, we explored the integration of fusion models alongside traditional single-model approaches, aiming to improve predictive performance through ensemble learning. Notably, the ADB-XGB ensemble model demonstrated superior performance compared to the RF model, achieving a higher AUC-ROC (0.863 vs. 0.839). Consequently, this study aims to optimize the predictive accuracy of commonly performed laboratory tests, such as CBC, to identify Influenza A and B infections with enhanced efficiency.
We also has several limitations. Although eight single models and four ensemble models were evaluated, their overall performance remains suboptimal. The best-performing models, RF and ADB-XGB, achieved AUCs of 0.839 and 0.863 in the internal validation cohort, but their AUROC values decreased to 0.765 and 0.810, respectively, in the external validation cohort. The decline in external validation performance may be attributed to the smaller sample size, as data collection coincided with the post-peak phase of influenza A and B, resulting in fewer positive cases. Additionally, the feature space was limited to CBC parameters; although age and gender were tested, they did not enhance model performance. The model’s performance with age and gender included is presented in Supplementary Figs. 1 and 2. While the RF model showed a modest AUC improvement in the internal validation set (0.855 vs. 0.839) upon adding these covariates, its performance declined in the external validation set (0.752 vs. 0.765). This divergence in generalizability led us to exclude age and gender from the final model. We attribute the observed divergence in model performance—where age and gender covariates improved internal validation AUC but reduced external validation AUC —to their weak, population-specific correlations with disease progression. While these variables may capture marginal signal in the training cohort due to local demographic biases, their inconsistent associations across populations likely introduced noise rather than generalizable biological insights, ultimately compromising model robustness. This suggests the internal gains reflect overfitting to cohort-specific patterns rather than clinically meaningful relationships, justifying their exclusion from the final model. The exclusion of other clinical features was necessitated by incomplete outpatient records. Future research should prioritize larger, more diverse cohorts, expanded feature inclusion (e.g., comorbidities, vital signs), and exploration of ensemble methods to strengthen predictive accuracy and clinical applicability [17–30]. Moreover, other common respiratory viruses—including rhinovirus, parainfluenza virus, coronavirus, adenovirus, and respiratory syncytial virus (RSV)—can manifest with similar hematologic profiles. Before deploying the proposed ML models clinically, particularly for the early detection of IAV and IBV, it is crucial to assess and exclude potential cross-reactivity with these other viruses. However, given that many patients in the hospitals from which we collected data, the majority underwent testing only for IAV and IBV, we cannot rule out interference from other viruses in this study.
This study developed ML models for Influenza A and B using CBC parameters, offering clinicians a cost-effective, efficient, and accessible diagnostic tool, particularly valuable in resource-constrained healthcare settings. The model demonstrates significant potential to streamline diagnoses and reduce medical expenditures. Future efforts should prioritize larger patient cohorts, incorporation of additional clinical features (e.g., comorbidities, vital signs), and exploration of to enhance predictive accuracy. Close collaboration with clinicians will be critical to ensure successful implementation and widespread adoption of this tool in real-world practice, ultimately improving patient care and healthcare system efficiency [31].
Conclusion
Early diagnosis of influenza A and B remains clinically challenging, especially in emergency departments and healthcare facilities with limited access to nucleic acid testing. However, given that complete blood count (CBC) is routinely available in most clinical settings, machine learning models leveraging CBC data offer a practical solution to augment clinicians’ capacity for timely influenza detection. This approach bridges diagnostic gaps in resource-constrained environments while maintaining operational feasibility.
Supplementary Information
Acknowledgements
Not applicable.
Abbreviations
- CBC
Complete blood count
- LightGBM
Light Gradient Boosting Machine
- XGB
Extreme Gradient Boosting
- GBDT
Gradient Boosting Decision Tree
- RF
Random Forest
- ADB
AdaBoost
- SVM
Support Vector Machine
- LR
Logistic Regression
- GNB
Gaussian Naive Bayes
- AUROC
Area under the receiver operating characteristic
- SHAP
Shapley Additive Explanations
- IAV
Influenza A Virus
- IBV
Influenza B virus
- PPV
Positive predictive value
- NPV
Negative predictive value
- MCHC
Mean Corpuscular Hemoglobin Concentration
- RDW
Red Cell Distribution Width
- MCH
Mean Corpuscular Hemoglobin
- MCV
Mean Corpuscular Volume
- PLT
Platelet Count
- WBC
White Blood Cell Count
- NEU
Neutrophil Count
- NEU%
Neutrophils Percentage
- EOS
Direct Eosinophil Count
- EOS%
Eosinophils Percentage
- MON
Monocyte Count
- MON%
Monocytes Percentage
- BASO
Direct Basophil Count
- BASO%
Basophils Percentage
- LYM
Lymphocyte Count
- LYM%
Lymphocyte Percentage
- RBC
Red Blood Cell Count
- HGB
Hemoglobin
- HCT
Hematocrit
- PCT
Plateletcrit
Authors’ contributions
XFH: Conceptualization, Data Curation, Methodology, Software, Writing- Original draft preparation, Writing- Reviewing and Editing. CMD and HJC: Conceptualization, case data collection and article design. XL and QYJ: Conceptualization, Methodology. QM, SLC and HPF: Data Curation, Methodology, Software. SSZ and WL: Overall planning. All authors contributed to the article and approved the submitted version.
Funding
This work was supported by the Science and Technology Research Project of the Chongqing Municipal Education Commission (grant number: KJZD-M202300101 and KJQN202400119) and Chongqing public health key specialty(discipline) project (grant number: GWZDZK202401).
Data availability
The datasets used and/or analysed during the current study are available from the corresponding author on reasonable request.
Declarations
Ethics approval and consent to participate
This study involving human participants was approved by the Ethics Committee of Chongqing Emergency Medical Center (Approval Ethics Review No. RS202410). The requirement for informed consent was waived by the Ethics Committee of Chongqing Emergency Medical Center, as the study utilized only pre-existing, de-identified data and did not involve the collection of new samples or any intervention on the participants. The research was conducted in strict accordance with the ethical guidelines of the Helsinki Declaration.
Consent for the publication
Not applicable.
Competing interests
The authors declare no competing interests.
Footnotes
Publisher’s Note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Contributor Information
Shenshen Zhi, Email: 179394047@qq.com.
Wei Li, Email: liwei0111@cqu.edu.cn.
References
- 1.Brody H. Influenza. Nature. 2019;573(7774):S49. 10.1038/d41586-019-02750-x. [DOI] [PubMed] [Google Scholar]
- 2.Javanian M, Barary M, Ghebrehewet S, Koppolu V, Vasigala V, Ebrahimpour S. A brief review of influenza virus infection. J Med Virol. 2021;93(8):4638–46. 10.1002/jmv.26990. Epub 2021 Apr 14. PMID: 33792930. [DOI] [PubMed] [Google Scholar]
- 3.Blanchet Zumofen MH, Frimpter J, Hansen SA. Impact of influenza and influenza-Like illness on work productivity outcomes: A systematic literature. Rev Pharmacoeconomics. 2023;41(3):253–73. 10.1007/s40273-022-01224-9. Epub 2022 Dec 14. PMID: 36515814; PMCID: PMC9748403. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 4.Lycett SJ, Duchatel F, Digard P. A brief history of bird flu. Philos Trans R Soc Lond B Biol Sci. 2019;374(1775): 20180257. 10.1098/rstb.2018.0257. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 5.Zhang X, Lin H, Dong L, Xia Q. Recapitulating influenza virus infection and facilitating antiviral and neuroprotective screening in tractable brain organoids. Theranostics. 2022;12(12):5317–29. 10.7150/thno.75123. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 6.Nayak J, Hoy G, Gordon A. Influenza in children. Cold Spring Harb Perspect Med. 2021;11(1): a038430. 10.1101/cshperspect.a038430. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 7.Roberts NJ Jr., Krilov LR. The continued threat of influenza A viruses. Viruses. 2022;14(5): 883. 10.3390/v14050883. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 8.Zaraket H, Hurt AC, Clinch B, Barr I, Lee N. Burden of influenza B virus infection and considerations for clinical management. Antiviral Res. 2021;185: 104970. 10.1016/j.antiviral.2020.104970. [DOI] [PubMed] [Google Scholar]
- 9.Tsybalova LM, Stepanova LA, Ramsay ES, Vasin AV. Influenza B. prospects for the development of cross-protective vaccines. Viruses. 2022;14(6): 1323. 10.3390/v14061323. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 10.Abed Y, Saim-Mamoun A, Boivin G. Fitness of influenza A and B viruses with reduced susceptibility to baloxavir: a mini-review. Rev Med Virol. 2021;31(3): e2175. 10.1002/rmv.2175. [DOI] [PubMed] [Google Scholar]
- 11.Bai Y, Tao X. Comparison of COVID-19 and influenza characteristics. J Zhejiang Univ Sci B. 2021;22(2):87–98. 10.1631/jzus.B2000479. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 12.Domnich A, Orsi A, Ricucci V, De Pace V, Massaro E, Ogliastro M, et al. Real-world performance of SARS-CoV-2 rapid antigen testing through the Alpha-, Delta- and Omicron-dominant waves of the COVID-19 pandemic. Int J Infect Dis. 2023;135:18–20. Epub 2023 Aug 2. PMID: 37536389. [DOI] [PubMed] [Google Scholar]
- 13.Peaper DR, Branson B, Parwani V, Ulrich A, Shapiro MJ, Clemons C, et al. Clinical impact of rapid influenza PCR in the adult emergency department on patient management, ED length of stay, and nosocomial infection rate. Influenza Other Respir Viruses. 2021;15(2):254–61. 10.1111/irv.12800. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 14.Shibue K. Artificial intelligence and machine learning in clinical medicine. N Engl J Med. 2023;388(25):2398. 10.1056/NEJMc2305287. [DOI] [PubMed] [Google Scholar]
- 15.Swanson K, Wu E, Zhang A, Alizadeh AA, Zou J. From patterns to patients: advances in clinical machine learning for cancer diagnosis, prognosis, and treatment. Cell. 2023;186(8):1772–91. 10.1016/j.cell.2023.01.035. Epub 2023 Mar 10. PMID: 36905928. [DOI] [PubMed] [Google Scholar]
- 16.Peiffer-Smadja N, Rawson TM, Ahmad R, Buchard A, Georgiou P, Lescure FX et al. Machine learning for clinical decision support in infectious diseases: a narrative review of current applications. Clin Microbiol Infect. 2020;26(5):584–595. 10.1016/j.cmi.2019.09.009. [DOI] [PubMed]
- 17.Marquez E, Barrón-Palma EV, Rodríguez K, Savage J, Sanchez-Sandoval AL. Supervised machine learning methods for seasonal influenza diagnosis. Diagnostics. 2023;13(21):3352. 10.3390/diagnostics13213352. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 18.Tan TH, Hsu CC, Chen CJ, Hsu SL, Liu TL, Lin HJ, et al. Predicting outcomes in older ED patients with influenza in real time using a big data-driven and machine learning approach to the hospital information system. BMC Geriatr. 2021;21(1):280. 10.1186/s12877-021-02229-3. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 19.Huang WJ, Cheng YH, Tan MJ, Liu J, Li XY, Zeng XX. Epidemiological and virological surveillance of influenza viruses in China during 2020–2021. Infect Dis Poverty. 2022;11(1):74. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 20.Valenzuela-Sánchez F, Valenzuela-Méndez B, Rodríguez-Gutiérrez JF, Estella Á. Latest developments in early diagnosis and specific treatment of severe influenza infection. J Intensive Med. 2023;4(2):160–74. PMID: 38681787; PMCID: PMC11043645. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 21.Lee H, Hwang SH, Park S, Choi Y, Lee S, Park J, et al. Prediction model for type 2 diabetes mellitus and its association with mortality using machine learning in three independent cohorts from South Korea, Japan, and the UK: a model development and validation study. EClinMed. 2025;80:103069. 10.1016/j.eclinm.2025.103069. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 22.Hwang SH, Lee H, Lee JH, Lee M, Koyanagi A, Smith L, et al. Machine Learning-Based Prediction for Incident Hypertension Based on Regular Health Checkup Data. Derivation and Validation in 2 Independent Nationwide Cohorts in South Korea and Japan. J Med Internet Res. 2024;26. 10.2196/52794. PMID: 39499554; PMCID: PMC11576616. [DOI] [PMC free article] [PubMed]
- 23.Nemati S, Holder A, Razmi F, Stanley MD, Clifford GD, Buchman TG. An interpretable machine learning model for accurate prediction of sepsis in the ICU. Crit Care Med. 2018;46(4):547–53. PMID: 29286945; PMCID: PMC5851825. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 24.Wang D, Li J, Sun Y, Ding X, Zhang X, Liu S, et al. A machine learning model for accurate prediction of sepsis in ICU patients. Front Public Health. 2021;9:754348. 10.3389/fpubh.2021.754348. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 25.Dablain D, Krawczyk B, Chawla NV. Deepsmote: fusing deep learning and SMOTE for imbalanced data. IEEE Trans Neural Netw Learn Syst. 2023;34(9):6390–404. 10.1109/TNNLS.2021.3136503. [DOI] [PubMed] [Google Scholar]
- 26.Borkenhagen LK, Allen MW, Runstadler JA. Influenza virus genotype to phenotype predictions through machine learning: a systematic review. Emerg Microbes Infect. 2021;10(1):1896–907. PMID: 34498543; PMCID: PMC8462836. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 27.Clark TW, Lindsley K, Wigmosta TB, Bhagat A, Hemmert RB, Uyei J, et al. Rapid multiplex PCR for respiratory viruses reduces time to result and improves clinical care: results of a systematic review and meta-analysis. J Infect. 2023;86(5):462–75. Epub 2023 Mar 9. PMID: 36906153. [DOI] [PubMed] [Google Scholar]
- 28.Courtney SJ, Stromberg ZR, Kubicek-Sutherland JZ. Nucleic acid-based sensing techniques for diagnostics and surveillance of influenza. Biosensors. 2021;11(2): 47. 10.3390/bios11020047. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 29.Uyeki TM, Influenza. 10.7326/AITC202111160. Ann Intern Med. 2021;174(11):ITC161–76. Epub 2021 Nov 9. PMID: 34748378. [DOI] [PubMed] [Google Scholar]
- 30.Shah SAW, Palomar DP, Barr I, Poon LLM, Quadeer AA, McKay MR. Seasonal antigenic prediction of influenza A H3N2 using machine learning. Nat Commun. 2024;15(1): 3833. 10.1038/s41467-024-47862-9. [DOI] [PMC free article] [PubMed] [Google Scholar]
- 31.Yang L, Zhang T, Han X, Yang J, Sun Y, Ma L, et al. Influenza epidemic trend surveillance and prediction based on search engine data: deep learning model study. J Med Internet Res. 2023;25: e45085. 10.2196/45085. [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Supplementary Materials
Data Availability Statement
The datasets used and/or analysed during the current study are available from the corresponding author on reasonable request.


