Using machine learning algorithms based on laboratory indicators to establish a diagnostic model for lung cancer Authors: Jie Wu, Lu Zhang, Zheng Zhang, Shuo Gao, Seng Wang, Xuewen Zheng, Xuejing Xu, Hai Ding, Han Shen, Hong Yan Published: 2026 ABSTRACT AbstractBackgroundLung cancer remains one of the leading causes of cancer-related mortality worldwide. Current diagnostic strategies rely primarily on imaging examinations and histopathological biopsy, which are invasive and unsuitable for longitudinal monitoring. Therefore, there is an urgent need for non-invasive and efficient predictive models to facilitate early detection and disease staging. This study aimed to compare multiple machine learning algorithms and identify the optimal model for distinguishing benign pulmonary nodules from early- and advanced-stage lung cancer.MethodsBetween January 2024 and September 2025, a total of 1,238 patients with pulmonary nodules were registered at Nanjing Drum Tower Hospital, including 951 patients with lung cancer and 287 patients with benign pulmonary nodules. In addition, 250 healthy individuals were enrolled as a control group. Clinical characteristics, including age, sex, and routine laboratory indicators, were collected for model development. Five machine learning algorithms were constructed and evaluated. Model performance was assessed using the area under the receiver operating characteristic curve (AUC), accuracy, sensitivity, and precision. Model interpretability was further explored using SHapley Additive exPlanations (SHAP).ResultsAmong the evaluated algorithms, the eXtreme Gradient Boosting (XGBoost) model demonstrated the best overall performance and was selected as the final predictive model. Correlation and differential analyses identified 60, 37, 25, 17, 12, and 17 informative features across six comparison groups: healthy vs. benign, healthy vs. early-stage lung cancer, healthy vs. advanced-stage lung cancer, benign vs. early-stage lung cancer, benign vs. advanced-stage lung cancer, and early vs. advanced-stage lung cancer, respectively. The corresponding AUC values were 0.999, 0.962, 0.970, 0.663, 0.926, and 0.713. SHAP analysis further elucidated the relative importance and directional effects of individual clinical features on model predictions.ConclusionThe XGBoost-based models demonstrated comparatively better performance in comparisons involving healthy controls and in distinguishing benign pulmonary disease from advanced-stage lung cancer. This approach may assist clinicians in early identification, risk stratification, and timely intervention for patients with pulmonary nodules, potentially contributing to reduced lung cancer–related mortality.Supplementary InformationThe online version contains supplementary material available at https://doi.org/10.1186/s12885-026-16239-0.Keywords: Machine learning, Laboratory indicators, Lung cancer, Early diagnosis Introduction Lung cancer is one of the most common and lethal malignancies worldwide, accounting for 18.7% of all cancer-related deaths [1]. In 2020, approximately 2.2 million new cases and 1.8 million deaths [2] were reported globally, and the overall five-year survival rate remains below 20% [3]. Lung cancer is broadly classified into non-small cell lung cancer (NSCLC) and small cell lung cancer (SCLC) [4]. NSCLC accounts for nearly 80% of all cases [5] and is further divided into adenocarcinoma, squamous cell carcinoma, and large cell carcinoma. Because early-stage NSCLC is often asymptomatic, diagnosis frequently occurs at advanced stages when typical symptoms such as cough, chest pain, dyspnea, and weight loss have already appeared [6]. Low-dose computed tomography (LDCT) has been shown to reduce lung cancer mortality by enabling earlier detection; however, it remains associated with the risk of radiation exposure [7]. Imaging combined with histopathological biopsy is considered the diagnostic gold standard, but this approach is invasive and unsuitable for continuous disease monitoring. In recent years, serum biomarkers have gained attention due to their convenience, non-invasiveness, and cost-effectiveness [8]. Numerous diagnostic models based on tumor markers and non-coding RNAs have been reported [9–11]. Nevertheless, no single serum biomarker has demonstrated sufficient specificity or sensitivity for reliable lung cancer detection [12]. To address these limitations, machine learning (ML) techniques have been increasingly applied in oncology. Algorithms such as support vector machines (SVMs), random forests, and logistic regression can capture complex, non-linear associations in clinical data and thus facilitate accurate predictive modeling [13–16]. By integrating routinely collected admission data into ML models, clinicians may obtain timely, non-invasive, and clinically interpretable decision support. In this study, we systematically explored and validated five machine learning algorithms using routine laboratory data from patients with pulmonary nodules. Our objective was to develop a clinically applicable decision support system capable of distinguishing benign from malignant nodules and identifying lung cancer at an early stage, thereby improving diagnostic accuracy and supporting timely clinical intervention. Methods Research subjects A total of 951 patients with lung cancer, staged according to the 8th edition of the American Joint Committee on Cancer (AJCC) staging system [17], and 287 patients with benign pulmonary nodules diagnosed at Nanjing Drum Tower Hospital between January 2024 and September 2025 were retrospectively enrolled in this study. In addition, 250 healthy individuals were included as a control group (Fig. 1). Diagnostic model construction flow chart Inclusion and exclusion criteria: Lung cancer group: Included patients with pathologically confirmed lung cancer. Exclusion criteria were a history of other malignancies, prior treatment, or incomplete clinical data. Lung cancer group: Included patients with pathologically confirmed lung cancer. Exclusion criteria were a history of other malignancies, prior treatment, or incomplete clinical data. Benign pulmonary diseases: Included patients with pathologically confirmed benign lung disease. Exclusion criteria were a history of lung cancer or other malignancies, suspicion of malignancy, or incomplete data. Benign pulmonary diseases: Included patients with pathologically confirmed benign lung disease. Exclusion criteria were a history of lung cancer or other malignancies, suspicion of malignancy, or incomplete data. Healthy controls: Included individuals without lung nodules, masses, or suspicious lesions on chest radiography or CT, and without a history of cancer. Cases with incomplete data were excluded. Healthy controls: Included individuals without lung nodules, masses, or suspicious lesions on chest radiography or CT, and without a history of cancer. Cases with incomplete data were excluded. Clinical characteristics and routine laboratory test parameters were collected from all participants. NCLC was classified into stages I, IIA, IIB, III, and IV [18]; 41 cases of SCLC were classified into limited-stage. Stage I, Stage IIA, and limited-stage lung cancer were classified as early-stage lung cancer (790 cases). Based on disease status, patients were stratified into six comparison groups: (1) healthy vs. benign lung disease, (2) healthy vs. early-stage lung cancer (stages I–IIA), (3) healthy vs. advanced lung cancer (stages IIB–IV), (4) benign vs. early-stage lung cancer, (5) benign vs. advanced lung cancer, and (6) early-stage vs. advanced lung cancer. Predictive indicators for each comparison were screened, and corresponding diagnostic models were subsequently developed. Experimental design Figure 1 presents the overall workflow for constructing predictive models to distinguish lung cancer, benign pulmonary diseases, and healthy individuals. The entire dataset (n = 1,488) was randomly split into a e data split into training and test sets in a 7:3 ratio using stratified sampling to preserve class proportions. All feature selection, model training, and hyperparameter tuning were performed exclusively on the training set. Feature selection was conducted using the Least Absolute Shrinkage and Selection Operator (LASSO) with 10-fold cross-validation, retaining features with non-zero coefficients (Supplementary Fig. 1–2). Five machine learning algorithms—Extreme Gradient Boosting (XGBoost), Logistic Regression (LR), Decision Tree, Artificial Neural Network (ANN), and Random Forest (RF)—were implemented to construct predictive models, which were then trained using five-fold cross-validation on the training set. In each fold, LASSO feature selection and model fitting were applied to the training subset, while the validation subset was used for performance evaluation, with hyperparameters optimized via grid search within the cross-validation loop. The algorithm achieving the highest mean area under the receiver operating characteristic curve (AUC) and accuracy across the five folds was selected as the optimal model, which was XGBoost. This final model was retrained on the full training set using the optimal hyperparameters and then evaluated on the test sets to report final performance metrics, including AUC, accuracy, sensitivity, and specificity. Additionally, SHapley Additive exPlanations (SHAP) were used to identify and rank key clinical features contributing to model predictions. Statistical analysis Normally distributed continuous variables are presented as mean ± standard deviation (SD), whereas non-normally distributed variables are expressed as median with interquartile range (IQR; Q25–Q75). Categorical variables are summarized as frequencies and percentages. Comparisons between groups were performed using the independent-samples t test for normally distributed variables, the Mann–Whitney U test for non-normally distributed variables, and the chi-square test for categorical variables. All statistical tests were two-sided, and a P value < 0.05 was considered statistically significant. Data storage and management were performed using Microsoft Excel 2016, and statistical analyses were conducted using SPSS software (version 26.0). The XGBoost algorithm was employed to construct diagnostic and predictive models for lung cancer. Model performance was comprehensively evaluated using multiple metrics: calibration curves were used to assess the agreement between predicted and observed probabilities; receiver operating characteristic (ROC) curves were generated to evaluate discriminative ability; confusion matrices were used to visualize classification performance; precision–recall (PR) curves were applied to assess model performance under class imbalance. Results Analysis of general clinical characteristics of subjects As shown in Table 1, the distribution of sex differed significantly among patients with lung cancer, patients with benign pulmonary diseases, and healthy controls (P < 0.001). The mean age of patients with lung cancer was significantly higher than that of patients with benign pulmonary diseases and healthy controls (P < 0.001). In addition, patients with benign pulmonary diseases were significantly older than healthy controls (P < 0.001). The model incorporates 65 characteristic variables into the study, including two basic characteristic parameters (age and gender) and routine laboratory test data upon admission, covering blood routine, coagulation, biochemical indicators, and four tumor markers for lung cancer. Intergroup differential analyses were performed to identify discriminative indicators (Supplementary Table 1). Table 1Analysis of general clinical characteristics of serum samplesCharacteristicsLung CancerBenign pulmonary diseasesHealthy peopleχ2 p Age(56, 69.5)*^55.84 ± 11.32(44, 56)*-< 0.001Gender (N%) Man432 (45.4%)136 (47.5%)155 (60.5%)17.9047< 0.001 Woman519 (54.6%)151 (52.5%)95 (39.5%)Compared with healthy people, *P < 0.001; compared with patients with benign pulmonary disease, ^P < 0.001 Analysis of general clinical characteristics of serum samples Compared with healthy people, *P < 0.001; compared with patients with benign pulmonary disease, ^P < 0.001 Feature selection for six grouping models In the training set, after using LASSO regression to eliminate multicollinearity, 60 (healthy group vs. benign group), 37 (healthy group vs. early-stage lung cancer group), 25 (healthy group vs. advanced-stage lung cancer group), 17 (benign group vs. early-stage lung cancer group), 12 (benign group vs. advanced-stage lung cancer group), and 17 (early-stage lung cancer group vs. advanced-stage lung cancer group) indicators were identified in the six comparison groups and used as model inputs for subsequent training (Supplementary Tables 1–2). Prediction of lung cancer model based on machine learning The AUC values of models constructed using different machine learning algorithms across the six comparison groups is summarized in Fig. 2. Among the five evaluated algorithms, ANN and XGBoost demonstrated relatively high discriminative performance. However, as shown in Table 2, the XGBoost model achieved higher mean AUC values, accuracy, specificity, and overall correctness during cross-validation, indicating superior and more stable predictive performance. Comparison of the ROC for five machine learning algorithms. A ROC curve of the diagnostic model of health-benign pulmonary disease group; (B) ROC curve of the diagnostic model of health-early-stage lung cancer group; (C) ROC curve of the diagnostic model of health-advanced lung cancer group; (D) ROC curve of the diagnostic model of benign pulmonary disease-early-stage lung cancer group; (E) ROC curve of the diagnostic model of benign pulmonary disease-advanced lung cancer group; (F) ROC curve of the diagnostic model of early-stage-advanced lung cancer group Table 2Comparison of the parameters of models for the prediction of six groupsGroupVariablesAUCSensitivity (%)Specificity (%)Youden indexAccuracy (%)F1PR AUCalthy-BenignLogistic Regression0.99696.77495.6520.92496.2960.9680.997Decision Tree0.99293.54895.6520.89294.4440.9510.994Random Forest0.99696.77491.3040.88194.4440.9520.997XGBoost0.99996.77495.6520.92496.2960.9680.999ANN0.99496.77495.6520.92496.2960.9680.996Healthy-Early-Lung cancerLogistic Regression0.94596.34178.2610.74692.3810.9520.971Decision Tree0.95996.34195.6520.92096.1900.9750.987Random Forest0.96798.78086.9570.85796.1900.9760.987XGBoost0.96297.56191.3040.88996.1900.9760.979ANN0.97598.78086.9570.85796.1900.9760.991Healthy-Advanced-Lung cancerLogistic Regression0.91772.22295.8330.68185.7140.8130.856Decision Tree0.83072.22295.8330.68185.7140.8130.870Random Forest0.95477.77895.8330.73688.0950.8480.885XGBoost0.97094.44495.8330.90395.2380.9440.936ANN0.95472.22295.8330.68185.7140.8130.885Benign-Early-Lung cancerLogistic Regression0.61985.18518.5190.03768.5190.8020.848Decision Tree0.49979.01222.2220.01264.8150.7710.712Random Forest0.597100.0000.0000.00075.0000.8570.833XGBoost0.66388.88918.5190.07471.2960.8230.868ANN0.63288.8893.704-0.07467.5930.8040.851Benign-Advanced-Lung cancerLogistic Regression0.94578.57193.5480.72188.8890.8150.911Decision Tree0.84178.57183.8710.62482.2220.7330.812Random Forest0.91578.57196.7740.75391.1110.8460.893XGBoost0.92685.71496.7740.82593.3330.8890.882ANN0.93364.28693.5480.57884.4440.7200.894Early-Lung cancer-Advanced-Lung cancerLogistic Regression0.78833.33395.0000.28385.2630.4170.494Decision Tree0.51826.66795.0000.21784.2110.3480.341Random Forest0.75333.33397.5000.30887.3680.4550.487XGBoost0.71333.33397.5000.30887.3680.4550.484ANN0.77626.66796.2500.22985.2630.3640.389 Comparison of the parameters of models for the prediction of six groups Healthy-Advanced-Lung cancer Using five-fold cross-validation, the XGBoost model for distinguishing healthy individuals from patients with benign pulmonary disease exhibited excellent discrimination, with an AUC of 0.999 (Fig. 3) The model achieved an accuracy of 96.296%, sensitivity of 96.744%, specificity of 95.652%, an F1 score of 0.968, and a precision–recall (PR) AUC of 0.999 (Table 2). Similarly, the model differentiating healthy controls from patients with early-stage lung cancer demonstrated strong performance, with an AUC of 0.962, accuracy of 96.190%, sensitivity of 97.561%, specificity of 91.304%, an F1 score of 0.976, and a PR AUC of 0.979. The healthy vs. advanced-stage lung cancer model also showed high discriminative ability (AUC = 0.970), achieving an accuracy of 95.238%, sensitivity of 94.444%, specificity of 95.833%, an F1 score of 0.944, and a PR AUC of 0.936. ROC curve of five diagnostic models. A ROC curve of the diagnostic model of health - benign pulmonary disease group; (B) ROC curve of the diagnostic model of health - early-stage lung cancer group; (C) ROC curve of the diagnostic model of health - advanced lung cancer group; (D) ROC curve of the diagnostic model of benign pulmonary disease-early-stage lung cancer group; (E) ROC curve of the diagnostic model of benign pulmonary disease - advanced lung cancer group; (F) ROC curve of the diagnostic model of early-stage lung cancer - advanced lung cancer group In contrast, the model distinguishing benign pulmonary disease from early-stage lung cancer demonstrated limited discriminative performance, with an AUC of 0.663. This model achieved an accuracy of 71.296%, sensitivity of 88.889%, specificity of 18.519%, an F1 score of 0.823, and a PR AUC of 0.868. The benign vs. advanced-stage lung cancer model exhibited improved performance, with an AUC of 0.926, accuracy of 93.333%, sensitivity of 85.714%, specificity of 96.774%, an F1 score of 0.889, and a PR AUC of 0.882. Finally, the model distinguishing early- from advanced-stage lung cancer yielded a moderate discriminative ability, with an AUC of 0.713. This model achieved an accuracy of 87.368%, relatively low sensitivity (33.333%), high specificity (97.500%), an F1 score of 0.455, and a PR AUC of 0.484. To further interpret the contribution of individual features in the XGBoost-based prediction models, SHAP [19, 20] was applied. SHAP, derived from Shapley values, provides both global and local interpretability of machine learning models. Figure 4 presents violin plots of SHAP values for each feature, illustrating the relationship between feature levels and their contributions to model predictions. Higher absolute SHAP values indicate greater influence on the model output, with red dots representing higher feature values and blue dots representing lower values. SHAP-based feature importance. The colors represent the feature values: red for larger values and blue for smaller values. A The health-benign pulmonary disease group; (B) The health-early-stage lung cancer group; (C) The health-advanced lung cancer group; (D) The benign pulmonary disease-early-stage lung cancer group; (E) The benign pulmonary disease-advanced lung cancer group; (F) The early-stage-advanced lung cancer group In the healthy vs. benign pulmonary disease group (Fig. 4A), elevated prothrombin time (PT), older age, and increased mean platelet volume (MPV) were identified as key contributors. In the healthy vs. early-stage lung cancer group (Fig. 4B), older age, PT, MPV, and carcinoembryonic antigen (CEA) were the primary predictive features. For the healthy vs. advanced-stage lung cancer group (Fig. 4C), important predictors included older age, PT, MPV, international normalized ratio (INR), cytokeratin 19 fragment (CYFRA 21 − 1), cholesterol (CHOL), neuron-specific enolase (NSE), and a lower albumin–globulin ratio (A/G). Within diseased groups, in the benign pulmonary disease vs. early-stage lung cancer group (Fig. 4D), older age, elevated blood potassium, NSE, triglycerides (TG), and glucose (GLU), as well as lower gamma-glutamyl transferase (GGT), mean corpuscular hemoglobin (MCH), and CHOL, were major contributors. In the benign vs. advanced-stage lung cancer group (Fig. 4E), CYFRA 21 − 1, NSE, D-dimer, and age, together with lower. high-density lipoprotein cholesterol (HDL-C) and MPV were the most discriminative features. Finally, in the early- vs. advanced-stage lung cancer group (Fig. 4F), larger values of carbohydrate antigen 125 (CA125), NSE, PT, and fibrinogen (FIB), as well as lower A/G, albumin (ALB), HDL-C, and MPV, were identified as key contributors. Discussion Constructing a biomarker-based model for lung cancer prediction is crucial for understanding disease onset and progression. In the present study, five diagnostic and predictive models were developed by integrating routine laboratory parameters with serum tumor markers using the XGBoost algorithm. SHapley Additive exPlanations (SHAP) were subsequently applied to identify the most influential features among numerous clinical variables associated with benign pulmonary disease, early-stage lung cancer, and advanced-stage lung cancer. This approach provides clinicians with a data-driven tool for identifying high-risk individuals, potentially facilitating early intervention and improving clinical outcomes. Lung cancer remains one of the leading causes of cancer-related mortality worldwide, and prognosis is highly dependent on disease stage at diagnosis. Early detection remains challenging because many patients are asymptomatic in the initial stages [3]. While imaging combined with histopathological biopsy represents the diagnostic gold standard, these methods are invasive and unsuitable for longitudinal monitoring. Differentiating malignant tumors from benign pulmonary nodules continues to be a major clinical challenge, underscoring the urgent need for non-invasive diagnostic tools. In the present cohort, significant age differences were observed between patients with lung cancer and those with benign pulmonary disease, between lung cancer patients and healthy controls, and between benign pulmonary disease patients and healthy controls (P < 0.001). Healthy individuals were generally younger than patients in both disease groups. Consistent with previous findings [21], lung cancer risk increases markedly with age. Significant differences in sex distribution were also observed among lung cancer patients, benign disease patients, and healthy controls (P < 0.001), potentially reflecting factors such as secondhand smoke exposure, genetic susceptibility (e.g., CYP1A1 and TP53 mutations), familial risk, and hormone-related influences including menstrual cycle characteristics, age at menarche and menopause, and parity [21, 22]. Serum tumor markers demonstrated stage-dependent associations. CYFRA21-1, a fragment of cytokeratin 19, is overexpressed in lung, colorectal, and bladder cancers, particularly squamous cell carcinoma [23, 24]. Neuron-specific enolase (NSE), the predominant enolase isoenzyme in neurons and neuroendocrine tissues, is elevated in neuronal injury and serves as a well-established marker for small-cell lung cancer [25, 26]. Carcinoembryonic antigen (CEA), widely expressed in multiple tumors including lung cancer, was significantly associated with early-stage disease (P < 0.05) [27–29]. Our findings suggest that elevated CYFRA21-1, NSE, and CEA are associated with lung cancer stage and progression, supporting their value for early detection and intervention (P < 0.05). CA125 levels differed significantly among healthy controls, patients with benign pulmonary disease, and patients with advanced-stage lung cancer, correlating with disease progression (P < 0.05) [30–32]. Inflammatory cells, such as neutrophils and lymphocytes, play critical roles in tumor-associated immune responses. Neutrophils reflect systemic inflammation, while lymphocytes represent cellular immune surveillance [33]. Tumor-associated neutrophil infiltration is associated with immunotherapy resistance and poor prognosis [34–36]. Lymphocytes, particularly cytotoxic T cells, restrict tumor progression through immune regulation [33, 37]. Monocytes (MONO) exhibit both pro- and anti-inflammatory functions and can either promote or suppress tumor progression depending on the cancer type [38]. Neutrophils, reflecting systemic inflammation, were significantly elevated in patients with lung cancer or benign pulmonary disease compared with healthy controls (P < 0.05), whereas lymphocyte counts, indicative of cellular immune surveillance, were reduced (P < 0.05). CRP, an acute-phase protein, is a well-established marker of systemic inflammation [39]. C-reactive protein (CRP), an acute-phase protein, was elevated in patients with lung cancer and positively associated with disease risk (P < 0.05), consistent with its role as a systemic inflammation marker in multiple cancers [39, 40]. Markers of hematologic and coagulation function were also affected. Red blood cell count, hemoglobin, and hematocrit were significantly lower in lung cancer patients compared with healthy controls (P < 0.05), consistent with tumor-associated bone marrow suppression [41, 42]. Conversely, platelet count and mean platelet volume (MPV) were elevated, whereas platelet distribution width (PDW) was reduced in patients with lung cancer or benign pulmonary disease (P < 0.05), reflecting tumor-associated hypercoagulability and poor prognosis [43–46]. D-dimer levels were higher in patients with benign pulmonary disease and lung cancer compared with healthy individuals (P < 0.05), consistent with malignancy-related hypercoagulable states [47, 48]. Activated partial thromboplastin time (APTT) was shortened in lung cancer patients (P < 0.05), further indicating a prethrombotic state [49, 50]. Nutritional and metabolic parameters showed significant associations with disease. Serum albumin (ALB) was reduced, whereas globulin (GLO) was elevated in patients with lung cancer or benign pulmonary disease (P < 0.05), resulting in a decreased albumin-to-globulin ratio (A/G) that may reflect systemic inflammation and tumor microenvironment alterations [51, 52]. Hyperglycemia and dyslipidemia, characterized by elevated glucose and reduced triglycerides and HDL-C, were observed in lung cancer patients (P < 0.05), consistent with the tumor-promoting effects of metabolic dysregulation [53, 54]. Adenosine deaminase (ADA) levels were significantly higher in lung cancer patients compared with benign disease patients and healthy controls (P < 0.05), corroborating previous findings of increased ADA activity in tumor tissues [55]. Despite the encouraging findings, several limitations should be acknowledged. This study was conducted as a single-center retrospective analysis with a total of 1,488 cases, including 446 cases in the independent test set, which may limit the generalizability of the results. Although five-fold cross-validation was applied to mitigate overfitting, further validation in large-scale, multicenter cohorts and through external datasets is warranted to confirm the robustness and clinical applicability of the proposed model. In addition, to balance cost-effectiveness and screening efficiency, only four lung cancer–related tumor markers were included, which may have constrained the model’s discriminatory performance. Future prospective studies incorporating a broader spectrum of tumor markers are needed to refine the modeling strategy and further enhance diagnostic accuracy. Besides, predictive performance was not uniform across all six comparison tasks. The model performed best in comparisons involving healthy controls and also showed good discrimination between benign pulmonary disease and advanced-stage lung cancer. In contrast, discrimination between benign pulmonary disease and early-stage lung cancer was limited, and the distinction between early- and advanced-stage lung cancer was only moderate. Therefore, the present model may be most useful as an auxiliary tool for distinguishing healthy individuals from lung cancer and for selected benign/malignant comparisons. Overall, these results support the utility of combining routine laboratory parameters with tumor markers in a machine learning–based predictive model, providing insights into lung cancer onset and progression and facilitating identification of high-risk individuals for early intervention. Conclusion This study developed predictive models for benign pulmonary disease as well as early- and advanced-stage lung cancer based on routine clinical laboratory parameters using the XGBoost algorithm, resulting in six distinct comparison models. The XGBoost-based models demonstrated comparatively better performance in comparisons involving healthy controls and in distinguishing benign pulmonary disease from advanced-stage lung cancer, whereas performance in other classification tasks was more limited. The application of SHAP enabled interpretable insights into the contribution of individual features, enhancing the clinical interpretability of the XGBoost models. This approach is particularly suitable for predicting lung disease status in real-world clinical scenarios and may facilitate the identification of high-risk patients, supporting early intervention. Consequently, the use of such models has the potential to improve early detection of lung cancer and reduce associated healthcare costs. Supplementary Information Supplementary Material 1. Acknowledgements This study was supported by the Nanjing Science and Technology Development Project Key Project (ZKX23023), Nanjing Drum Tower Hospital Clinical Research Project (2022-LCYJ-MS-28), Key Project supported by Medical Science and technology development Foundation, Nanjing Department of Health (YKK24106) and Project of China Hospital Reform and Development Research Institute, Nanjing University (NDYGN2024036). Authors’ contributions Jie Wu: Writing - Original Draft, Formal analysis, Data curation. Lu Zhang: Investigation, Formal analysis, Data curation. Zheng Zhang: Validation, Methodology, Formal analysis. Shuo Gao: Conceptualization. Seng Wang: Review & editing. Xuewen Zheng: Data curation. Xuejing Xu: Supervision, Resources. Hai Ding: Data Curation, Supervision, Resources. Han Shen: Supervision, Project administration, Funding acquisition. Hong Yan: Funding acquisition, Supervision. Data availability The data sets generated or analyzed during this study are available from the corresponding author upon reasonable request. Declarations Ethics approval and consent to participate Our research adheres to the Declaration of Helsinki. This retrospective study was approved by the Institutional Review Board of Nanjing Drum Tower Hospital, Nanjing, China (Approval No. 2023-318-01). The requirement for informed consent was waived by the ethics committee due to the retrospective nature of the study. 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. Jie Wu and Lu Zhang contributed equally to this work and share first authorship. Contributor Information Hai Ding, Email: sea00god@sina.com. Han Shen, Email: shenhan10366@sina.com. Hong Yan, Email: yanhong@njmu.edu.cn. References Associated Data Supplementary Materials Supplementary Material 1. Data Availability Statement The data sets generated or analyzed during this study are available from the corresponding author upon reasonable request.