Skip to main content
Frontiers in Medicine logoLink to Frontiers in Medicine
. 2026 Jul 9;13:1858126. doi: 10.3389/fmed.2026.1858126

Precise discrimination of mycobacterial pulmonary diseases via multimodal machine learning integrating chest CT and clinical markers

Yangyi Jin 1,†, Jindun Ding 2,†, Jinsheng Ouyang 3, Zhiye Yao 4,5, Liping Wang 4,*, Ruisong Xu 4,*, Xuewen Jin 2,*
PMCID: PMC13435664  PMID: 42553647

Abstract

Introduction

Differentiating Mycobacterium tuberculosis lung disease (MTB-LD) from nontuberculous mycobacterial lung disease (NTM-LD) remains clinically challenging because of overlapping symptoms and imaging features, as well as the slow turnaround of conventional culture-based diagnostics.

Methods

This retrospective study enrolled 102 patients with microbiologically confirmed mycobacterial lung disease, including 53 patients with MTB-LD and 49 patients with NTM-LD. We developed and validated an interpretable multimodal machine-learning framework integrating clinical symptoms, hematological biomarkers, and high-resolution computed tomography (HRCT) features. Three representative classifiers, including k-nearest neighbors, logistic regression, and random forest, were used to evaluate the discriminative contribution of different feature modalities.

Results

Multimodal integration of HRCT, clinical, and laboratory features showed better discriminative performance than single-modality approaches. Among the three representative classifiers, the random forest model achieved the best hold-out test performance, with an AUC of 0.92, sensitivity of 0.89, specificity of 0.93, and F1-score of 0.90. Key predictive contributors included cystic bronchiectasis, tree-in-bud sign, fever, and selected laboratory biomarkers.

Discussion

These findings suggest that routinely available multimodal clinical data may provide preliminary decision support for MTB-LD/NTM-LD differentiation. However, the proposed framework should be regarded as an exploratory decision-support tool, and external validation is required before clinical implementation.

Keywords: machine learning, multimodal data integration, nontuberculous mycobacterial lung disease, pulmonary tuberculosis, rapid diagnostic differentiation

1. Introduction

Mycobacterial lung diseases, including Mycobacterium tuberculosis lung disease (MTB-LD) and nontuberculous mycobacterial lung disease (NTM-LD), are major infectious pulmonary conditions globally (1). Tuberculosis (TB) remains a critical public health challenge, while the incidence of NTM-LD has been rising, particularly among immunocompromised individuals due to factors such as aging, chronic diseases, and the widespread use of immunosuppressive therapies (2, 3). In China, the increasing rates of NTM isolation further highlight the underreported burden of this disease (4). MTB-LD and NTM-LD share overlapping symptoms such as chronic cough, fever, night sweats, weight loss, and pulmonary damage (5). Chest CT often shows similar features, including cavitation, bronchiectasis, and tree-in-bud opacities (6). However, treatment paradigms diverge fundamentally: MTB-LD responds to standard anti-tuberculosis therapy, whereas NTM-LD often requires prolonged, species-specific antibiotic regimens and may not always necessitate treatment (7). Accurate and timely discrimination between these two entities is therefore critical for appropriate patient management and outcomes.

Conventional diagnostic approaches remain inadequate for this purpose. Acid-fast bacilli smear microscopy cannot differentiate MTB from NTM, and culture-based methods, although the gold standard, are hampered by slow turnaround times (weeks), high cost, and technical demands (8–10). Nucleic acid amplification tests offer improved speed but are not universally available and may yield false positives or negatives (11, 12). Radiological diagnosis, even by experienced clinicians, is subjective and prone to inter-observer variability, often leading to misclassification and inappropriate treatment (13, 14). These limitations underscore the urgent need for rapid, accurate, and accessible diagnostic tools.

Recent advances in artificial intelligence and machine learning have shown promise in medical imaging-based diagnosis of pulmonary infectious diseases, particularly tuberculosis screening and CT-based pulmonary lesion analysis (15–17). Several studies have further applied radiomics, machine learning, or deep learning to chest CT or chest radiography for differentiating MTB-LD from NTM-LD (18–22). Nevertheless, these efforts have predominantly relied on unimodal imaging data, overlooking the complementary value of clinical symptoms, laboratory biomarkers, and immunological indicators that are routinely collected in clinical practice (23). A diagnostic approach that integrates multimodal data, such as demographics, symptoms, hematological and inflammatory markers, and high-resolution CT (HRCT) features, could more comprehensively capture the complex pathophysiology underlying these diseases and improve classification accuracy. Given that several HRCT findings have already been reported to differ between MTB-LD and NTM-LD, this study focused on determining whether established radiological patterns could provide added discriminative value when integrated with routinely available clinical symptoms and laboratory biomarkers.

In this study, we aimed to develop and validate an interpretable multimodal machine-learning framework to evaluate the diagnostic contribution of routinely available HRCT features, clinical symptoms, and laboratory biomarkers for differentiating MTB-LD from NTM-LD. Moreover, we used representative classifiers to examine whether multimodal integration provides more robust discrimination than single-modality data.

2. Materials and methods

2.1. Study population

This retrospective study enrolled patients diagnosed with mycobacterial lung disease at Yuhuan People’s Hospital, Zhejiang Province, China, between January 2019 and December 2022. The cohort comprised 53 patients with Mycobacterium tuberculosis lung disease (MTB-LD) and 49 patients with nontuberculous mycobacterial lung disease (NTM-LD), all confirmed by microbiological evidence. The study protocol received approval from the Institutional Ethics Committee of the People’s Hospital of Yuhuan (Approval No. 2023-012). The research was conducted in strict adherence to relevant guidelines and regulations, and informed consent was obtained from all participants and/or their legal guardians.

Patients were included if they had a pathogen-confirmed diagnosis of either MTB-LD or NTM-LD via sputum culture or molecular diagnostic methods, and if pulmonary lesions were documented by radiological imaging. Exclusion criteria were concurrent infection with both MTB and NTM, co-infection with other confirmed pulmonary pathogens (such as fungi or common bacteria) that could render imaging interpretation indeterminate, or incomplete essential clinical data.

This was an exploratory retrospective machine-learning study. The sample size was determined by all eligible microbiologically confirmed MTB-LD and NTM-LD cases available at the study institution during the predefined study period, rather than by a formal prospective sample-size calculation. After applying these criteria, 102 eligible patients were retained in the final analytic cohort.

2.2. Data collection and feature definition

We developed a standardized data extraction form to systematically collect multidimensional information from all enrolled patients. Data categories included demographics (age and sex), clinical symptoms and signs (cough, sputum production, low-grade fever, night sweats, weight loss), and laboratory results including complete blood count, inflammatory markers, and carcinoembryonic antigen (CEA). All laboratory assays followed standardized clinical protocols. Chest high-resolution computed tomography (HRCT) features were also recorded.

Key radiological manifestations were extracted, covering lesion distribution and the presence or characteristics of cavities, bronchiectasis, nodules, tree-in-bud sign, and pleural effusion. To ensure analytical consistency, imaging features were defined according to established radiological criteria. Cystic bronchiectasis referred to clustered, thin-walled, air-filled cystic structures. Cylindrical bronchiectasis was identified by the signet ring sign on axial images (bronchial diameter equal to or greater than the adjacent pulmonary artery) or parallel tram-track lines on longitudinal sections. Tree-in-bud sign meant centrilobular, branching, or clustered micronodular opacities resembling budding twigs. A cavity was an air-filled space within the lung parenchyma; thin-walled cavities had wall thickness of 3 mm or less with smooth regular inner margins and lucent interior, whereas thick-walled cavities had wall thickness greater than 3 mm, irregular walls, and were often surrounded by consolidation or infiltration. Air bronchogram described branching lucencies representing patent airways within areas of consolidation, indicating alveolar filling with exudate. Consolidation was a relatively homogeneous region of increased parenchymal attenuation obscuring vascular margins. Patchy opacities were ill-defined areas of increased attenuation, which could be ground-glass or consolidative in density. A nodule was a discrete rounded opacity of 3 cm or less in diameter, which could be solid, subsolid (part-solid or pure ground-glass), or mixed density. Calcification was defined as focal high-attenuation lesions with sharp margins, which might appear punctate, laminated, nodular, or popcorn-like.

HRCT features were extracted according to predefined radiological criteria from the available retrospective imaging records. Because this was a retrospective study, the dataset contained the final recorded imaging features rather than independent paired reader-level annotations from multiple radiologists. Therefore, formal inter-observer agreement analysis using Cohen’s Kappa could not be validly reconstructed from the existing dataset.

2.3. Statistical analysis

Statistical analyses were performed using SPSS version 26.0. Baseline characteristics were compared between the MTB-LD and NTM-LD groups. Categorical variables were presented as counts and percentages. Continuous variables were expressed as mean ± standard deviation after normality assessment using the Shapiro–Wilk test. For normally distributed data with homogeneous variance, independent samples t-tests were used; non-normally distributed data were analyzed with the Mann–Whitney U test. Statistical significance was set at a two-tailed p value less than 0.05. Features that showed significant differences in univariate analysis were further examined in multivariate logistic regression to characterize factors associated with disease classification. The univariate and multivariate analyses were used to describe group-level differences and to support clinical interpretation of variables of clinical interest. These analyses were not interpreted as independent evidence of model generalizability.

2.4. ML model construction and validation

2.4.1. Data preprocessing

Classification models were developed using Python 3.10 and the scikit-learn library (version 1.0.2) to differentiate MTB-LD from NTM-LD. The overall modeling workflow, illustrated in Figure 1, consisted of three main stages: data preprocessing, model building with hyperparameter tuning, and performance evaluation with output generation.

Figure 1.

Flowchart diagram with two main vertical columns. The left column outlines research participant recruitment, screening, eligibility determination, grouping, data collection, statistical analysis, and database establishment. The right column details machine learning workflow steps: loading data, preprocessing, applying multiple models, performing hyperparameter tuning, selecting best sets, evaluating model performance, and saving results.

Study workflow diagram.

We initially collected 28 features covering demographic information, laboratory parameters, and radiological signs. Data preprocessing involved missing value imputation: variables with minimal missing data were imputed by replacing continuous missing values with the median of the respective feature and categorical missing values with the mode (most frequent category). For feature scaling, all continuous features were standardized using Z-score normalization (mean of 0, standard deviation of 1) to enhance model performance and reduce scale-dependent bias. Categorical variables such as sex and location were transformed into sparse binary vectors using one-hot encoding. After preprocessing, we constructed the feature matrix X and target vector y, where MTB-LD cases were labeled as 1 and NTM-LD cases as 0. After the predefined preprocessing procedure, the final feature matrix used for machine-learning model construction contained no missing entries.

This work was revised according to TRIPOD+AI principles for prediction model studies (24). Because this study used manually extracted CT features rather than an end-to-end medical imaging AI system, relevant CLAIM items related to imaging feature definition and interpretation were also considered (Supplementary Table S14) (25). CONSORT-AI was not used because the present study was not a randomized clinical trial evaluating an AI intervention (26).

2.4.2. Model construction and hyperparameter optimization

Three representative classifiers were used not as an exhaustive algorithm benchmark, but as analytical tools to evaluate the discriminative contribution of different feature modalities. KNN, Logistic Regression, and Random Forest were selected to represent distance-based, regularized linear, and nonlinear ensemble learning strategies, respectively. This selection allowed us to examine whether multimodal integration consistently improved MTB-LD/NTM-LD discrimination under different modeling assumptions while maintaining interpretability in a small structured dataset.

The k-nearest neighbors (KNN) model is based on distance metrics. Key hyperparameters tuned included the number of neighbors with values of 3, 5, 7, or 9, and the weight function weights set to either uniform or distance. Logistic regression (LR) is a linear model with L2 regularization to control overfitting. The regularization strength C was tuned among 0.001, 0.1, 1, and 10. We selected the limited-memory Broyden-Fletcher-Goldfarb-Shanno (L-BFGS) algorithm for its balance of convergence efficiency and computational performance. Random forest (RF), originally introduced by Breiman, is an ensemble learning method that can model nonlinear relationships and interactions among predictors (27). Hyperparameters tuned included the number of trees n_estimators (10 or 20), the maximum tree depth max_depth (5, 10, or no constraint), and the minimum number of samples required to split an internal node, min_samples_split (2, 4, or 5).

For hyperparameter tuning, we implemented a comprehensive grid search with GridSearchCV. Hyperparameter combinations were exhaustively evaluated using stratified 5-fold cross-validation to preserve class distribution proportions within each fold. The area under the receiver operating characteristic curve (AUC) served as the primary optimization metric, supplemented by the F1-score to account for potential class imbalance and to balance precision and recall. For each model type, the top four hyperparameter configurations yielding the highest mean cross-validated AUC were retained as candidate models. This top-N approach allowed us to assess model stability and hyperparameter sensitivity. Cross-validation results were used for hyperparameter optimization and candidate-model selection during the model-development stage. Final model comparison was based primarily on hold-out test-set performance rather than tuning-stage cross-validation AUC.

2.4.3. Model evaluation and output

The final selected models (based on cross-validation performance) were evaluated on the hold-out test set. Performance metrics derived from the confusion matrix included:

Sensitivity(Recall):TP/(TP+FN)
Specificity:TN/(TN+FP)
Accuracy:(TP+TN)/(TP+TN+FP+FN)

Area Under the ROC Curve (AUC): Reflecting the model’s overall discriminative ability across all classification thresholds.

Mean F1-scores and AUC values for each model type were calculated and presented in structured tables. We also performed feature importance analysis, such as examining coefficients for LR or using permutation importance or Gini importance for RF, to enhance model interpretability. For hold-out test performance, 95% confidence intervals were estimated for AUC, sensitivity, specificity, accuracy, and F1-score using stratified bootstrap resampling of the hold-out test set. Given the exploratory single-center design and limited sample size, both point estimates and confidence intervals were interpreted cautiously, and model precision requires confirmation in larger external validation cohorts. The finalized models and their evaluation results were saved in structured formats, including serialized model objects and performance reports, for documentation and potential future validation.

2.4.4. Model stability assessment and calibration assessment

To assess potential overfitting and model stability, learning curve analysis was performed for the Random Forest model across three feature modalities: integrated multimodal features, laboratory biomarkers alone, and clinical symptoms alone. Training sample fractions were progressively increased from 20 to 100%, and the corresponding training and validation AUC values were recorded. The training-validation AUC gap was used as an additional indicator of overfitting risk. This analysis was designed to evaluate whether the integrated multimodal feature set provided more stable validation performance than single-modality feature sets.

Calibration analysis was performed for the final integrated-feature Random Forest model. Calibration curves were generated by comparing predicted probabilities with observed outcome proportions across probability bins. Brier score, calibration intercept, calibration slope, and expected calibration error were calculated to evaluate the reliability of predicted probabilities in addition to discrimination performance.

3. Results and discussion

3.1. Distinct clinical, laboratory, and imaging profiles

The study cohort comprised 102 patients with microbiologically confirmed mycobacterial lung disease (53 MTB-LD, 49 NTM-LD). Demographic analysis (Table 1) revealed no significant difference in age distribution between groups (median 56 vs. 61 years, p = 0.678). However, gender composition differed significantly: MTB-LD predominantly affected males (64.2%, 34/53), while NTM-LD showed a female predominance (71.4%, 35/49; p < 0.001). Fever was significantly more frequent in MTB-LD (39.6% vs. 2.0%; p < 0.001), consistent with the more acute systemic inflammatory response characteristic of tuberculosis. Residential distribution also varied significantly between groups (p < 0.001), suggesting possible regional exposure factors influencing infection type (Supplementary Table S1). Other symptoms such as cough, hemoptysis, and dyspnea did not differ significantly, underscoring the overlapping clinical presentation of these two diseases. In addition, laboratory analysis revealed distinct inflammatory and hematological profiles (Supplementary Table S2). The NTM-LD group exhibited significantly higher neutrophil counts (p = 0.024) but lower levels of acute-phase reactants including fibrinogen (p = 0.001), D-dimer (p = 0.010), and procalcitonin (p = 0.035). C-reactive protein levels were also lower in NTM-LD, although the difference did not reach statistical significance (p = 0.626). These findings suggest that NTM-LD is characterized by a chronic, indolent inflammatory state with a prominent neutrophilic component but a blunted acute-phase response, whereas MTB-LD drives a more robust systemic inflammatory reaction. CEA levels did not differ significantly between the MTB-LD and NTM-LD groups (2.0760 ± 1.4856 vs. 1.5330 ± 0.9107, p = 0.087). Therefore, although CEA contributed to model prediction, it should not be interpreted as a significantly different standalone biomarker in univariate analysis.

Table 1.

Comparison of clinical and laboratory symptoms between the MTB and NTM groups.

Characteristic Participants with MTB (n = 53) Participants with NTM (n = 49) p value
Age (years) 53 (24–84) 49 (34–80) 0.678
Sex <0.001
 Male 34/53 14/49 –
 Female 19/53 35/49 –
Fever 21/53 1/49 <0.001
Complete blood count, CBC
 Neutrophils (*109/L) 4.6547 ± 1.7354 5.1122 ± 6.5381 0.024
Inflammatory biomarkers
 Fibrinogen (g/L) 4.6362 ± 1.7189 3.5192 ± 1.1506 0.001
 D-dimer (mg/L) 0.9765 ± 1.7020 0.5184 ± 0.6834 0.010
 C-reactive protein (mg/L) 34.8188 ± 38.9774 18.0150 ± 36.1604 0.626
 Procalcitonin (ng/mL) 0.0929 ± 0.1278 0.0550 ± 0.0444 0.035
Tumor markers
 Carcinoembryonic antigen, CEA (ng/mL) 2.0760 ± 1.4856 1.5330 ± 0.9107 0.087

Radiological evaluation revealed distinct imaging patterns that were broadly consistent with previous CT-based comparisons of NTM-PD and pulmonary tuberculosis (18, 19, 28), as shown in Figure 2 and Supplementary Table S3. Bronchiectasis was significantly more prevalent in the NTM-LD group (93.9% vs. 17.0%, p < 0.001), with cystic bronchiectasis being the most specific feature—exclusively observed in NTM-LD (44.9% vs. 0%, p < 0.001)—characterized by clustered, thin-walled cysts with a “grape-like” appearance across all lung zones (Figure 2A, red box). Cylindrical bronchiectasis, frequently accompanied by the “signet-ring sign,” was also significantly more common in NTM-LD (91.8% vs. 17.0%, p < 0.001; Figure 2B, red box). The tree-in-bud sign, indicative of small-airway infection, was similarly more frequent in NTM-LD (91.8% vs. 56.6%, p < 0.001; Figure 2A, blue box; Figure 2C, red box). Cavities in NTM-LD were predominantly thin-walled with smooth margins (77.6% vs. 60.4%, p = 0.001; Figure 2C, blue box), whereas MTB-LD was characterized by thick-walled cavities with irregular borders and surrounding consolidation (Figure 2D, blue box). In contrast, MTB-LD exhibited a distinct set of features, including pleural effusion (18.9% vs. 2.0%, p = 0.006; Figure 2F, blue box) and calcifications (39.6% vs. 18.4%, p = 0.019), which typically appeared as punctate or “popcorn-like” opacities (Figure 2E, blue box; Figure 2F, red box), consistent with post-tuberculous fibrocalcific healing. No significant intergroup differences were observed for consolidation, air bronchograms, patchy opacities, or mediastinal lymphadenopathy (p > 0.05). These imaging findings are broadly consistent with previously reported radiological differences between NTM-LD and MTB-LD and should therefore be interpreted as confirmation of established imaging phenotypes in this cohort rather than as newly discovered CT signs.

Figure 2.

Six-panel medical illustration showing annotated chest CT scans with close-ups, each labeled A to F, highlighting different pulmonary and thoracic abnormalities including saccular and columnar bronchiectasis, nodules, cavities, tree-in-bud sign, calcification, mediastinal lymphadenopathy, and pleural effusion. Enlarged regions clarify the identified pathologies for each panel.

Comparative chest CT imaging features of mycobacterial lung diseases. (A) (Axial): Diffuse airway changes in NTM-LD: Red: Cystic bronchiectasis (thin-walled clusters), consolidation/air bronchograms; Blue: Tree-in-bud sign, patchy opacities. (B) (Coronal): Bronchial dilation and nodules: Red: Cylindrical bronchiectasis (“signet-ring” sign); Blue: Peripheral nodules (2–3 cm). (C) (Sagittal): Airway/cavitary lesions: Red: Tree-in-bud sign + cylindrical bronchiectasis; Blue: Thin-walled cavity (smooth margins). (D) (Axial): Nodular/cavitary pathology: Red: Large nodules (≥3 cm, irregular); Blue: Thick-walled cavity + consolidation. (E) (Coronal): Mediastinal/calcified lesions: Red: Mediastinal lymphadenopathy; Blue: Punctate calcifications (bronchovascular). (F) (Axial): Pleural/calcification features: Red: “Popcorn” calcification (parenchymal); Blue: Pleural effusion + pneumothorax.

Collectively, these imaging patterns delineate two distinct phenotypes. The NTM-LD phenotype is characterized by female predominance, pan-lobar cystic bronchiectasis, tree-in-bud sign, thin-walled cavities, and peripheral large nodules—features reflecting chronic airway destruction and small-airway involvement. In contrast, the MTB-LD phenotype is defined by male predominance, acute fever, thick-walled cavities, pleural effusion, and calcifications, consistent with a more aggressive inflammatory process and subsequent fibrotic healing. Cystic bronchiectasis (exclusive to NTM-LD) and pleural effusion (predominantly in MTB-LD) emerged as the most specific radiological discriminators. These imaging-derived phenotypes directly informed the feature selection and interpretability of our machine learning models.

3.2. Predictive contribution of different feature modalities

To evaluate which routinely available clinical data modalities were most informative for differentiating MTB-LD from NTM-LD, we trained three representative machine-learning classifiers, including KNN, LR, and RF, using three feature modalities: (1) integrated CT-clinical features, (2) laboratory biomarkers alone, and (3) clinical symptom variables alone. These classifiers were used as analytical tools to evaluate the discriminative contribution of different feature sets rather than as an exhaustive benchmark of all possible machine-learning algorithms. Model optimization was performed using stratified 5-fold cross-validation with grid search, with AUC as the primary optimization metric and F1-score as a supplementary metric. Detailed hyperparameter-tuning results for KNN and LR are provided in Figure 3 and Supplementary Tables S4–S9.

Figure 3.

Three grouped bar charts labeled A, B, and C compare AUC values of machine learning models using different input features. Chart A shows highest AUCs for integrated CT and clinical features, with KNN, LR, and RF models all performing near 1.0. Chart B presents moderate AUCs for symptom-only features, with RF models outperforming KNN and LR. Chart C shows the lowest AUCs for biomarkers, with RF models again achieving higher values than KNN and LR. Each chart displays subgroups for different model settings.

Cross-validation AUC values of representative classifiers during hyperparameter tuning across different feature modalities. Panel (A) shows AUC values based on integrated CT-clinical features, panel (B) shows AUC values based on clinical symptom variables, and panel (C) shows AUC values based on laboratory biomarkers. These results reflect optimization-stage cross-validation performance and should be distinguished from the final hold-out test-set results.

During hyperparameter tuning, KNN models showed clear sensitivity to the number of neighbors and weighting schemes. When integrated CT-clinical features were used, KNN achieved high cross-validation AUC values, with mean AUCs ranging from 0.9726 to 0.9760 across the top configurations (Supplementary Table S5). In contrast, KNN performance was lower when restricted to laboratory biomarkers alone, with mean AUCs ranging from 0.7381 to 0.7641 (Supplementary Table S6). KNN models using clinical symptom variables showed intermediate cross-validation performance, with mean AUCs ranging from 0.8046 to 0.8213 (Supplementary Table S4). These results suggest that integrated CT-clinical information provided more discriminative structure for distance-based classification than either symptom-only or laboratory-only data.

A similar modality-dependent pattern was observed for LR. Integrated CT-clinical features produced near-perfect or perfect cross-validation performance under selected regularization settings, with mean AUC values ranging from 0.9834 to 1.0000 (Supplementary Table S8). However, these optimization-stage results should be interpreted cautiously because near-perfect cross-validation performance in a small dataset may reflect feature separation or model saturation rather than true external generalizability. In comparison, LR models based on clinical symptom variables showed lower cross-validation AUCs ranging from 0.8042 to 0.8659 (Supplementary Table S7), while laboratory-biomarker-only LR models showed weaker discrimination, with mean AUCs ranging from 0.7392 to 0.7729 (Supplementary Table S9). The near-perfect cross-validation performance of Logistic Regression and the high cross-validation AUC of KNN should not be interpreted as evidence of near-perfect diagnostic generalizability. These results may reflect strong feature separation caused by highly discriminative CT features, correlated predictors, or model saturation in a small dataset. Therefore, these tuning-stage results were used only to guide model optimization, whereas final model comparison relied on hold-out test-set performance.

For the RF model, the final hold-out test evaluation showed that the integrated-feature model achieved the best overall performance among the three representative classifiers, with an AUC of 0.92, sensitivity of 0.89, specificity of 0.93, accuracy of 0.903, and F1-score of 0.90. Importantly, this hold-out test performance should be distinguished from the cross-validation AUC values reported during hyperparameter tuning for KNN and LR. Therefore, the high cross-validation AUCs of KNN and LR were used to guide model optimization, whereas final model comparison was based on hold-out test-set performance. The separated training, cross-validation, and hold-out test performance of representative classifiers, together with the corresponding 95% confidence intervals for hold-out test metrics, is provided in Supplementary Table S11.

Feature-importance analysis of the RF model identified cystic bronchiectasis, CEA, tree-in-bud sign, fibrinogen, and fever as important contributors to model prediction, consistent with the clinical and radiological phenotypes described in Section 3.1. Overall, the main finding of this section is not that one algorithm universally outperformed all others, but that multimodal integration of CT, clinical, and laboratory information provided stronger discriminatory information than single-modality feature sets. This conclusion was further supported by the RF learning-curve analysis across three feature modalities, in which the integrated multimodal feature set showed higher and more stable validation AUC than laboratory-only or symptom-only feature sets (Supplementary Table S10).

3.3. Model stability, calibration, and clinical interpretability

To further evaluate model stability, learning curve analysis was performed for the Random Forest model across three feature modalities: integrated multimodal features, laboratory biomarkers alone, and clinical symptoms alone (Supplementary Table S10). For the integrated multimodal model, validation AUC increased progressively with increasing training sample size, while the training-validation AUC gap decreased from 0.245 to 0.044. Laboratory-only models showed moderate improvement in validation AUC but remained below the integrated model, whereas symptom-only models showed the lowest validation AUC across training fractions. These findings suggest that multimodal integration provided not only better discrimination but also more stable validation performance than single-modality data, although external validation remains necessary.

Calibration analysis further showed acceptable agreement between predicted probabilities and observed outcomes for the final integrated-feature Random Forest model. The model achieved a Brier score of 0.131, calibration intercept of 0.03, calibration slope of 0.89, and expected calibration error of 0.041 (Supplementary Table S12). Calibration-bin analysis also showed that the observed MTB-LD proportions increased consistently with predicted probability strata (Supplementary Table S13).

Comprehensive evaluation using confusion matrices and performance metrics (Figure 4) confirmed that model efficacy is primarily driven by feature-set richness and algorithm-pathology compatibility. The RF model demonstrated robust generalization with integrated CT-clinical features, achieving a sensitivity of 0.89, specificity of 0.93, and AUC of 0.92 (Figure 4A). Its ability to capture nonlinear interactions, such as the combined effect of cystic bronchiectasis (Gini = 0.32) and CEA (Gini = 0.28), effectively decoded the chronic airway destruction characteristic of NTM-LD. Logistic Regression showed apparent model saturation during hyperparameter tuning, with near-perfect or perfect cross-validation performance under selected regularization settings (Supplementary Table S8). However, its hold-out test performance decreased, suggesting that optimization-stage performance was overly optimistic. KNN displayed specificity deficits (0.81) attributable to high-dimensional distance metric distortion. When restricted to laboratory biomarkers alone, LR showed weaker cross-validation performance, with mean AUC values ranging from 0.7392 to 0.7729 (Supplementary Table S9), further supporting the complementary value of imaging features, while RF performance declined by 8.7% (AUC = 0.84), underscoring the indispensable role of imaging features. In the hold-out test comparison shown in Figure 4C, symptom-only models showed lower performance than integrated-feature models, reflecting the absence of pathognomonic symptoms in NTM-LD. Accordingly, training-stage and tuning-stage performance were not used as the primary evidence of model effectiveness; instead, learning-curve analysis, calibration assessment, and hold-out test performance were jointly considered to evaluate model stability and clinical interpretability.

Figure 4.

Three radar charts labeled A, B, and C compare KNN, logistic regression, and random forest algorithms by sensitivity, specificity, accuracy, F1-score, and AUC, using red, blue, and orange lines. Below, three confusion matrices labeled D, E, and F show model prediction accuracy using color intensity and numbers, with a color scale ranging from blue to red indicating quantity.

Multidimensional performance profiling and misclassification patterns. (A–C) Radar plots comparing classifier performance (KNN, LR, RF) across five metrics (AUC, F1-score, Sensitivity, Specificity, Accuracy) for: Integrated imaging-clinical features (A); Laboratory biomarkers (B); Clinical symptoms only (C). (D–F) Corresponding confusion matrices demonstrating test-set classification performance and error distributions for models in (A–C): Integrated features (D); Laboratory variables (E); Symptom features (F). Color gradient indicates sample density (red: high density; blue: low density). Final models were optimized using stratified 5-fold cross-validation and then evaluated on the hold-out test set.

Misdiagnosis profiling revealed distinct failure patterns. RF errors predominantly occurred at borderline CEA values (3.5–5.0 ng/mL), where biomarker overlap between the two diseases was most pronounced—a “diagnostic twilight” zone (Figure 4E). LR misclassified 87.5% of NTM cases by over-relying on the absence of fever while neglecting imaging markers. Laboratory-only models further demonstrated that LR tended to misclassify anemic patients (hemoglobin < 110 g/L), whereas RF over-focused on CEA, leading to 83% of errors in CEA-normal patients.

Clinical translation: based on these findings, we propose a tiered diagnostic framework. Initial screening using clinical symptoms combined with CRP (>15 mg/L) or hemoglobin (<115 g/L) thresholds maximizes sensitivity. In patients with suggestive findings, chest CT is required to identify structural abnormalities such as cystic bronchiectasis and tree-in-bud sign. In tertiary settings, the full RF model with integrated CT-clinical features provides optimal performance (AUC = 0.92). In resource-limited environments, laboratory biomarkers may provide limited preliminary screening information, but their discriminative performance was clearly lower than that of integrated CT-clinical models. Therefore, CT-based structural assessment remains necessary for reliable MTB-LD/NTM-LD differentiation.

3.4. Comparison and limitations

The central finding of this study is not that one specific algorithm universally outperformed others, but that multimodal integration of HRCT features, clinical symptoms, and laboratory biomarkers provided stronger discriminatory information than single-modality data for differentiating MTB-LD from NTM-LD. The primary contribution of this study lies in demonstrating the added value of multimodal integration of established HRCT features, clinical symptoms, and laboratory biomarkers, rather than in proposing novel radiological markers.

Unlike previous studies that focused on tuberculosis versus non-infectious mimics or relied solely on CT imaging (20, 28, 29), our approach captures fine-grained MTB-NTM distinctions through multimodal data integration. By incorporating clinical and laboratory features, our RF model achieved a higher AUC (0.92) compared to prior CT-only models (AUC 0.84–0.87), representing a clinically meaningful improvement.

Several limitations should be acknowledged. The retrospective, single-center design and relatively small sample size (n = 102) limit generalizability. We did not aim to conduct an exhaustive comparison of all machine-learning algorithms. Given the limited sample size, adding more flexible models such as SVM or boosting-based methods with additional hyperparameter searches may increase model-selection bias. Future multicenter studies with larger datasets should systematically evaluate SVM, gradient boosting, and deep learning approaches. Although 95% confidence intervals were added for hold-out test metrics, the relatively small hold-out test sample size still limits the precision of performance estimates. Therefore, the reported metrics should be regarded as preliminary and hypothesis-generating. NTM species were analyzed collectively without subspecies stratification, despite known differences in clinical presentation and imaging features among Mycobacterium avium complex, M. abscessus, and other species. Manual HRCT feature extraction may introduce inter-observer variability, which could be mitigated by deep learning-based automated extraction (29). Finally, reliance on non-microbiological features means the model captures proxy signals rather than direct pathogen identification; thus, it should serve as a decision-support tool complementing, not replacing, microbiological confirmation.

4. Conclusion

This study developed an interpretable multimodal machine-learning framework to evaluate the diagnostic contribution of routinely available HRCT features, clinical symptoms, and laboratory biomarkers for differentiating MTB-LD from NTM-LD. The primary objective was not to conduct an exhaustive benchmark of machine-learning algorithms, but to determine which clinically accessible data modalities provide the most useful discriminatory information. Across representative classifiers, multimodal integration of HRCT, clinical, and laboratory features showed better discriminative performance than single-modality approaches, supporting the complementary value of imaging and non-imaging clinical information. Among the three representative classifiers, the Random Forest model achieved the best hold-out test performance, with an AUC of 0.92, sensitivity of 0.89, specificity of 0.93, and F1-score of 0.90. Key contributors included established radiological patterns, such as cystic bronchiectasis and tree-in-bud sign, together with fever and selected laboratory biomarkers. These findings suggest that multimodal clinical data may provide a useful basis for preliminary decision support in MTB-LD/NTM-LD differentiation. However, given the retrospective single-center design, limited sample size, and absence of external validation, the proposed framework should be regarded as an exploratory decision-support tool rather than a replacement for microbiological confirmation.

Funding Statement

The author(s) declared that financial support was received for this work and/or its publication. This work is supported by Zhejiang Provincial Taizhou Municipal Science and Technology Program Project, Grant No. 23ywb152.

Edited by: Wenlin Yang, University of Florida, United States

Reviewed by: Danendra Rakha Putra Respati, Diponegoro University, Indonesia

Fei Zhang, Tsinghua University, China

Abbreviations: MTB-LD, Mycobacterium tuberculosis lung disease; NTM-LD, Nontuberculous mycobacterial lung disease; KNN, K-nearest neighbors; LR, Logistic regression; RF, Random forest; AI, Artificial intelligence; ML, Machine learning; AUC, Area under the ROC curve; TP, True positives; FP, False positives; TN, True negatives; FN, False negatives.

Data availability statement

The original contributions presented in the study are included in the article/Supplementary material, further inquiries can be directed to the corresponding authors.

Author contributions

YJ: Data curation, Formal analysis, Methodology, Writing – original draft. JD: Data curation, Formal analysis, Methodology, Writing – original draft. JO: Data curation, Formal analysis, Methodology, Writing – original draft. ZY: Data curation, Formal analysis, Writing – review & editing, Software. LW: Data curation, Formal analysis, Writing – original draft, Writing – review & editing, Conceptualization, Project administration. RX: Formal analysis, Supervision, Writing – original draft, Writing – review & editing, Conceptualization, Project administration. XJ: Conceptualization, Supervision, Writing – review & editing, Funding acquisition, Resources.

Conflict of interest

The author(s) declared that this work was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Correction note

This article has been corrected with minor changes. These changes do not impact the scientific content of the article.

Generative AI statement

The author(s) declared that Generative AI was not used in the creation of this manuscript.

Any alternative text (alt text) provided alongside figures in this article has been generated by Frontiers with the support of artificial intelligence and reasonable efforts have been made to ensure accuracy, including review by the authors wherever possible. If you identify any issues, please contact us.

Publisher’s note

All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.

Supplementary material

The Supplementary material for this article can be found online at: https://www.frontiersin.org/articles/10.3389/fmed.2026.1858126/full#supplementary-material

References

  • 1.World Health Organization. Global Tuberculosis Report 2022. Geneva: World Health Organization; (2022). [Google Scholar]
  • 2.Gopalaswamy R, Shanmugam S, Mondal R, Subbian S. Of tuberculosis and non-tuberculous mycobacterial infections: a comparative analysis of epidemiology, diagnosis and treatment. J Biomed Sci. (2020) 27:74. doi: 10.1186/s12929-020-00667-6, [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 3.Zhou L, Xu D, Liu H, Wan K, Wang R, Yang Z. Trends in the prevalence and antibiotic resistance of non-tuberculous mycobacteria in mainland China, 2000–2019: systematic review and meta-analysis. Front Public Health. (2020) 8:295. doi: 10.3389/fpubh.2020.00295, [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 4.Cowman S, van Ingen J, Griffith DE, Loebinger MR. Non-tuberculous mycobacterial pulmonary disease. Eur Respir J. (2019) 54:1900250. doi: 10.1183/13993003.00250-2019, [DOI] [PubMed] [Google Scholar]
  • 5.Kendall BA, Varley CD, Choi D, Cassidy PM, Hedberg K, Ware MA, et al. Distinguishing tuberculosis from nontuberculous mycobacteria lung disease, Oregon, USA. Emerg Infect Dis. (2011) 17:506–9. doi: 10.3201/eid1703.101164, [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 6.Feng Y, Guo J, Luo S, Zhang Z. Phenotyping nontuberculous mycobacterial lung disease: comparative analysis of clinical and imaging features in a TB-endemic setting. Infect Drug Resist. (2025) 18:3527–34. doi: 10.2147/IDR.S529466, [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.Cowman S, Burns K, Benson S, Wilson R, Loebinger MR. The antimicrobial susceptibility of non-tuberculous mycobacteria. J Infect. (2016) 72:324–31. doi: 10.1016/j.jinf.2015.12.007, [DOI] [PubMed] [Google Scholar]
  • 8.Daley CL, Iaccarino JM, Lange C, Cambau E, Wallace RJ, Jr, Andrejak C, et al. Treatment of nontuberculous mycobacterial pulmonary disease: an official ATS/ERS/ESCMID/IDSA clinical practice guideline. Clin Infect Dis. (2020) 71:905–13. doi: 10.1093/cid/ciaa1125, [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9.Dettmer S, Heiß-Neumann M, Wege S, You S-H, Cho Y, Kim B, et al. Synthetic temporal bone CT generation from UTE-MRI using a cycleGAN-based deep learning model: advancing beyond CT-MR imaging fusion. Eur Radiol. (2025) 35:38–48. doi: 10.1007/s00330-024-10967-2 [DOI] [PubMed] [Google Scholar]
  • 10.Chu H-Q, Li B, Zhao L, Huang D-D, Zhang Z-M, Xu J-F, et al. Chest imaging comparison between non-tuberculous and tuberculosis mycobacteria in sputum acid-fast bacilli smear-positive patients. Eur Rev Med Pharmacol Sci. (2015) 19:2429–39. doi: 10.1183/13993003.congress-2015.pa2674, [DOI] [PubMed] [Google Scholar]
  • 11.Wang C, Yan D, Huang J, Zhao J, Liu G, Liu Y, et al. The clinical application of metagenomic next-generation sequencing in infectious diseases at a tertiary hospital in China. Front Cell Infect Microbiol. (2022) 12:957073. doi: 10.3389/fcimb.2022.957073, [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12.Zhou X, Wu H, Ruan Q, Jiang N, Chen X, Shen Y, et al. Clinical evaluation of diagnosis efficacy of active Mycobacterium tuberculosis complex infection via metagenomic next-generation sequencing of direct clinical samples. Front Cell Infect Microbiol. (2019) 9:351. doi: 10.3389/fcimb.2019.00351, [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 13.Wang J, Xu H, Wang X, Yu Y, Guo J, Zhang Y, et al. Rapid diagnosis of non-tuberculous mycobacterial pulmonary diseases by metagenomic next-generation sequencing in non-referral hospitals. Front Cell Infect Microbiol. (2022) 12:1083497. doi: 10.3389/fcimb.2022.1083497, [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 14.Kim C, Park SH, Oh SY, Kim SS, Jo KW, Shim TS, et al. Comparison of chest CT findings in nontuberculous mycobacterial diseases vs. Mycobacterium tuberculosis lung disease in HIV-negative patients with cavities. PLoS One. (2017) 12:e0174240. doi: 10.1371/journal.pone.0174240, [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 15.Lakhani P, Sundaram B. Deep learning at chest radiography: automated classification of pulmonary tuberculosis by using convolutional neural networks. Radiology. (2017) 284:574–82. doi: 10.1148/radiol.2017162326, [DOI] [PubMed] [Google Scholar]
  • 16.Hwang EJ, Park S, Jin KN, Kim JI, Choi SY, Lee JH, et al. Development and validation of a deep learning-based automatic detection algorithm for active pulmonary tuberculosis on chest radiographs. Clin Infect Dis. (2019) 69:739–47. doi: 10.1093/cid/ciy967, [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17.Rahman T, Khandakar A, Kadir MA, Islam KR, Islam KF, Mazhar R, et al. Reliable tuberculosis detection using chest X-ray with deep learning, segmentation and visualization. IEEE Access. (2020) 8:191586–601. doi: 10.1109/ACCESS.2020.3031384 [DOI] [Google Scholar]
  • 18.Yan Q, Wang W, Zhao W, Zuo L, Wang D, Chai X, et al. Differentiating nontuberculous mycobacterium pulmonary disease from pulmonary tuberculosis through the analysis of the cavity features in CT images using radiomics. BMC Pulm Med. (2022) 22:4. doi: 10.1186/s12890-021-01766-2, [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 19.Zhou L, Wang Y, Zhu W, Zhao Y, Yu Y, Hu Q, et al. A retrospective study differentiating nontuberculous mycobacterial pulmonary disease from pulmonary tuberculosis on computed tomography using radiomics and machine learning algorithms. Ann Med. (2024) 56:2401613. doi: 10.1080/07853890.2024.2401613, [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 20.Xing Z, Ding W, Zhang S, Zhong L, Wang L, Wang J, et al. Machine learning-based differentiation of nontuberculous mycobacteria lung disease and pulmonary tuberculosis using CT images. Biomed Res Int. (2020) 2020:6287545. doi: 10.1155/2020/6287545, [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 21.Wang L, Ding W, Mo Y, Shi D, Zhang S, Zhong L, et al. Distinguishing nontuberculous mycobacteria from Mycobacterium tuberculosis lung disease from CT images using a deep learning framework. Eur J Nucl Med Mol Imaging. (2021) 48:4293–306. doi: 10.1007/s00259-021-05437-y [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 22.Park M, Lee Y, Kim S, Kim YJ, Kim SY, Kim Y, et al. Distinguishing nontuberculous mycobacterial lung disease and Mycobacterium tuberculosis lung disease on X-ray images using deep transfer learning. BMC Infect Dis. (2023) 23:32. doi: 10.1186/s12879-023-07996-5, [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 23.Liu Q, Pan X, An H, Du J, Li X, Sun W, et al. Building a model for the differential diagnosis of non-tuberculous mycobacterial lung disease and pulmonary tuberculosis: a case-control study based on immunological and radiological features. Int Immunopharmacol. (2023) 124:111064. doi: 10.1016/j.intimp.2023.111064, [DOI] [PubMed] [Google Scholar]
  • 24.Collins GS, Moons KGM, Dhiman P, Riley RD, Beam AL, Van Calster B, 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]
  • 25.Mongan J, Moy L, Kahn CE, Jr. Checklist for artificial intelligence in medical imaging (CLAIM): a guide for authors and reviewers. Radiol Artif Intell. (2020) 2:e200029. doi: 10.1148/ryai.2020200029, [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 26.Liu X, Cruz Rivera S, Moher D, Calvert MJ, Denniston AK, SPIRIT-AI and CONSORT-AI Working Group . Reporting guidelines for clinical trial reports for interventions involving artificial intelligence: the CONSORT-AI extension. Nat Med. (2020) 26:1364–74. doi: 10.1038/s41591-020-1034-x, [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 27.Breiman L. Random forests. Mach Learn. (2001) 45:5–32. doi: 10.1023/A:1010933404324 [DOI] [Google Scholar]
  • 28.Zhang F, Han H, Li M, Tian T, Zhang G, Yang Z, et al. Revolutionizing diagnosis of pulmonary Mycobacterium tuberculosis based on CT: a systematic review of imaging analysis through deep learning. Front Microbiol. (2025) 15:1510026. doi: 10.3389/fmicb.2024.1510026, [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 29.Li X, Zhou Y, Du P, Lang G, Xu M, Wu W. A deep learning system that generates quantitative CT reports for diagnosing pulmonary tuberculosis. Appl Intell. (2021) 51:4082–93. doi: 10.1007/s10489-020-02051-1 [DOI] [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 original contributions presented in the study are included in the article/Supplementary material, further inquiries can be directed to the corresponding authors.


Articles from Frontiers in Medicine are provided here courtesy of Frontiers Media SA

RESOURCES