Back to all papers

Development and validation of machine learning diagnostic models integrating clinical, CT, and laboratory features to differentiate lung cancer from pulmonary tuberculosis in patients with solitary pulmonary nodules: a single-center retrospective study.

July 20, 2026pubmed logopapers

Authors

Li Y,Wu W,Xu H,Ma J,Bao M,Zhu J,Chen S

Affiliations (6)

  • Department of Medical Oncology, Shanghai Pulmonary Hospital, School of Medicine, Tongji University, Shanghai, China.
  • School of Medicine, Tongji University, Shanghai, China.
  • Department of Radiology, Tongren Hospital, Shanghai Jiao Tong University School of Medicine, Shanghai, China.
  • Clinic and Research Center of Tuberculosis, Shanghai Pulmonary Hospital, School of Medicine, Tongji University, Shanghai, China.
  • Department of Thoracic Surgery, Shanghai Pulmonary Hospital, School of Medicine, Tongji University, Shanghai, China.
  • Innovation and Incubation Center (IIC), Shanghai Pulmonary Hospital, School of Medicine, Tongji University, Shanghai, China.

Abstract

Differentiating lung cancer from pulmonary tuberculosis in patients with solitary pulmonary nodules (SPNs) remains clinically challenging, particularly in tuberculosis-endemic settings, because these two conditions may show overlapping computed tomography (CT) morphological features. This study aimed to develop and internally validate machine learning (ML) diagnostic models integrating these routinely available variables and to identify stable discriminative features using feature-importance analyses. This single-center retrospective diagnostic prediction model development and internal validation study included adult patients with CT-detected SPNs measuring ≤3 cm and a definitive diagnosis of primary lung cancer or pulmonary tuberculosis between May 2020 and June 2024. Candidate predictors were extracted from baseline clinical information, tuberculosis-related tests, manually assessed CT morphological features, circulating tumor cell indicators, routine laboratory tests, and blood gas analysis variables obtained within 7 days before surgery or biopsy. Variables with more than 5% missingness were excluded, and 72 variables were retained before least absolute shrinkage and selection operator (LASSO) feature selection. The dataset was randomly divided into training and validation sets in a stratified 7:3 ratio. Seven ML models were subsequently constructed, including logistic regression (LR), random forest (RF), extra trees (ET), radial basis function support vector machine (RBF-SVM), k-nearest neighbors (KNN), multilayer perceptron (MLP), and gradient boosting decision tree (GBDT). Model performance was evaluated using the area under the curve (AUC) for the receiver operating characteristic (ROC) curve, sensitivity, specificity, and balanced accuracy. Permutation importance and SHapley Additive exPlanations (SHAP) analyses were further performed to assess model interpretability. A total of 431 patients were included, comprising 168 patients with pathologically confirmed lung cancer and 263 patients with pulmonary tuberculosis. The median age was 60.00 years (interquartile range, 53.00-67.00 years), 277 patients (64.3%) were male, 349 patients (81.0%) had solid nodules, and 277 patients (64.3%) had positive QuantiFERON-TB (QFT) results. After missingness filtering, 72 variables were retained, and 29 features were selected by LASSO for model development. Among the seven models, the RBF-SVM model achieved the highest validation AUC of 0.803, with a sensitivity of 0.686, specificity of 0.734, and balanced accuracy of 0.710. The ET model showed comparable validation performance, with an AUC of 0.791, whereas LR achieved the highest balanced accuracy of 0.711. Cross-model interpretability analyses identified nodule type and age as the most stable core features. ML models integrating routine clinical, manually assessed CT, and laboratory features showed moderate discriminative performance for differentiating lung cancer from pulmonary tuberculosis in patients with SPNs. The RBF-SVM model achieved the highest validation AUC, and cross-model interpretability analyses identified nodule type and age as stable discriminative features.

Topics

Journal Article

Ready to Sharpen Your Edge?

Subscribe to join 11k+ peers who rely on RadAI Slice. Get the essential weekly briefing that empowers you to navigate the future of radiology.

We respect your privacy. Unsubscribe at any time.