Preprint
Article

This version is not peer-reviewed.

Molecular Epidemiology of Drug-Resistant Mycobacterium tuberculosis in Rural South Africa: An Interpretable Machine-Learning Analysis of Routine Diagnostic Data

Submitted:

19 October 2026

Posted:

20 October 2026

You are already at the latest version

Abstract
Drug-resistant tuberculosis (DR-TB) remains a major challenge to tuberculosis control, particularly in high-burden settings such as South Africa. Routine molecular diagnostic assays generate quantitative cycle threshold (Ct)-derived measurements from established resistance-associated targets; however, the extent to which these routinely generated data can be computationally characterized to distinguish molecular resistance profiles remains insufficiently explored. This study evaluated Ct-derived molecular markers associated with first- and second-line anti-tuberculosis drug-resistance classifications among Mycobacterium tuberculosis isolates from rural Eastern Cape, South Africa, using interpretable statistical modelling and machine-learning approaches. A retrospective analytical study was conducted using 2430 culture-confirmed M. tuberculosis specimens obtained from the National Health Laboratory Service. Ct-derived measurements for katG, inhA, gyrA, and rrs were analyzed using logistic regression, decision tree, random forest, extra trees, gradient boosting, support vector machine, extreme gradient boosting (XGBoost), and a multilayer perceptron neural network. Binary classification models were evaluated for isoniazid (INH), ethionamide (ETH), fluoroquinolones (FLQ), amikacin (AMK), capreomycin (CAP), and kanamycin (KAN), as well as multiclass resistance-profile classification. Among evaluable isolates, molecular resistance classifications were observed in 72.2% for INH, 31.1% for ETH, 13.2% for FLQ, and 6.9% each for AMK, CAP, and KAN. Random forest achieved the highest performance for five of the six binary classifications, whereas extra trees performed best for CAP. ROC-AUC values ranged from 0.994 to 1.000, with classification accuracies of 98.0–99.7%. Random forest also achieved the highest multiclass accuracy (98.4%), weighted F1-score (98.3%), and weighted ROC-AUC (0.999). Permutation feature importance predominantly identified katG-derived Ct measurements for INH, inhA for ETH, gyrA for FLQ, and rrs for AMK, CAP, and KAN, consistent with established molecular resistance relationships. The very high discriminatory performance should be interpreted in the context of the shared molecular-diagnostic origin of the Ct-derived predictors and resistance classifications, and therefore does not establish independent prediction of phenotypic resistance or the discovery of novel genetic determinants. Rather, these findings demonstrate that interpretable computational approaches can characterise and rank resistance-associated patterns embedded within routinely generated molecular diagnostic data, with potential utility for secondary analysis and molecular surveillance. Independent validation using phenotypic drug-susceptibility testing and/or genomic reference data is required to determine whether these approaches provide incremental predictive or clinical value beyond the underlying molecular assay.
Keywords: 
;  ;  ;  ;  ;  ;  ;  

1. Introduction

Tuberculosis (TB), caused by Mycobacterium tuberculosis, remains a major global public health challenge despite the availability of effective treatment for several decades [1,2]. According to the World Health Organization (WHO), an estimated 10.8 million people developed TB, and approximately 1.25 million died from the disease in 2023, with drug-resistant tuberculosis (DR-TB) continuing to threaten progress towards the End TB Strategy [3]. The emergence and transmission of multidrug-resistant TB (MDR-TB), pre-extensively drug-resistant TB (pre-XDR-TB), and extensively drug-resistant TB (XDR-TB) have complicated treatment, increased healthcare costs, and contributed to poorer treatment outcomes, particularly in low- and middle-income countries with high burdens of TB and HIV [3,4].
South Africa remains among the countries with a high burden of TB and continues to experience substantial drug-resistant disease [4,5]. Within South Africa, the Eastern Cape Province faces persistent challenges associated with socioeconomic inequalities, HIV co-infection, barriers to healthcare access, delayed diagnosis, and ongoing community transmission [6,7]. These challenges may be amplified in rural settings where access to specialised diagnostic and clinical services can be constrained. Strengthening the use of routinely generated laboratory information for resistance surveillance is therefore particularly relevant in such settings [4,8].
Drug resistance in M. tuberculosis is primarily associated with chromosomal mutations that alter antimicrobial targets, interfere with prodrug activation, or modify other biological pathways involved in drug susceptibility [9,10,11,12,13]. Mutations in katG are well-established determinants of high-level isoniazid resistance through impaired activation of the isoniazid prodrug, whereas mutations in the inhA promoter region are associated with reduced isoniazid susceptibility and may confer cross-resistance to ethionamide [14,15]. Fluoroquinolone resistance is predominantly associated with mutations within the quinolone resistance-determining region of gyrA, while mutations in rrs, which encodes 16S ribosomal RNA, are associated with resistance to second-line injectable agents, including amikacin, kanamycin, and capreomycin [16]. These established molecular relationships form the biological basis for targeted molecular drug-resistance assays.
Rapid molecular diagnostic technologies have transformed TB diagnosis by enabling simultaneous detection of M. tuberculosis and resistance-associated molecular targets directly from clinical specimens [17,18]. Molecular assays may also generate quantitative cycle threshold (Ct)-derived measurements during amplification, in addition to the categorical information used in routine assay interpretation [3,19,20]. Although Ct measurements primarily reflect amplification dynamics within the diagnostic process, their quantitative variation may provide opportunities for secondary analytical characterisation of patterns within routinely generated molecular diagnostic datasets [21,22]. However, the extent to which these Ct-derived measurements can be computationally characterised and ranked across molecular resistance classifications remains insufficiently explored, particularly in high-burden, resource-constrained settings.
Advances in artificial intelligence and machine learning (ML) have expanded opportunities for analysing complex biomedical and molecular datasets [23,24,25,26]. Algorithms such as random forest, gradient boosting, support vector machine, and extreme gradient boosting (XGBoost) can model nonlinear relationships and interactions among multiple variables [25,26,27]. Ensemble approaches can also provide measures of feature importance that facilitate the interpretation of the relative contributions of individual predictors [23,27,28,29]. Deep-learning approaches offer further possibilities for modelling complex data structures, although their application to routine molecular TB diagnostic data remains comparatively limited, particularly in resource-constrained settings [23,25,30].
Much of the existing computational literature on TB drug resistance has focused on whole-genome sequencing and on predicting independently measured resistance phenotypes [23,24,27,28,30]. Although whole-genome sequencing enables comprehensive characterization of resistance-associated variants, its routine implementation may be constrained in high-burden settings by cost, specialized infrastructure requirements, and the need for bioinformatics capacity [25]. Routinely generated molecular diagnostic data, therefore, represent a potentially valuable source for secondary epidemiological and computational analysis. However, an important methodological distinction must be maintained when both predictor variables and resistance classifications originate from the same molecular diagnostic process. In such circumstances, high classification performance may reflect recovery of information already encoded within the assay rather than independent prediction of an external resistance phenotype. Consequently, computational models based on these data should not, without independent validation, be interpreted as discovering novel resistance determinants or demonstrating additional clinical predictive value beyond the underlying molecular assay.
Against this background, the present study evaluated routinely generated Ct-derived molecular measurements associated with first- and second-line anti-tuberculosis drug-resistance classifications among M. tuberculosis isolates from rural Eastern Cape, South Africa. The study integrated logistic regression, supervised machine-learning algorithms, a multilayer perceptron neural network, multiclass resistance-profile classification, and permutation-based feature importance to characterise molecular resistance patterns and quantify the relative contribution of Ct-derived measurements from established resistance-associated targets. The analysis included molecular classifications for isoniazid, ethionamide, fluoroquinolones, amikacin, capreomycin, and kanamycin.
The contribution of this study lies not in identifying novel genetic determinants of drug resistance, but in examining how interpretable computational approaches characterise and rank information embedded within routinely generated molecular diagnostic data. Specifically, the study compares the performance of multiple computational approaches, examines patterns across binary and multiclass molecular resistance classifications, and evaluates the relative importance of Ct-derived measurements from katG, inhA, gyrA, and rrs. These analyses provide an opportunity to assess the secondary analytical value of routine molecular diagnostic data for describing resistance-associated patterns in a rural, high-burden setting.
Accordingly, the findings are interpreted as a computational characterization of molecular resistance-associated signatures rather than an independent prediction of phenotypic drug resistance. The analysis does not establish novel causal mechanisms of resistance or demonstrate that machine learning provides clinical information beyond that of the underlying molecular diagnostic assay. Independent validation against phenotypic drug-susceptibility testing and/or genomic reference data would be required to determine whether Ct-derived computational models provide incremental predictive or clinical value. Within these boundaries, the present study provides evidence on the potential use of routinely generated molecular diagnostic data for secondary analysis and molecular resistance surveillance in a resource-constrained, high-TB-burden setting.

2. Materials and Methods

2.1. Study Design

This retrospective analytical study integrated conventional statistical modeling, supervised machine learning, a multilayer perceptron neural network, multiclass classification, and model-interpretability approaches to characterize Ct-derived molecular patterns associated with first- and second-line anti-tuberculosis drug-resistance classifications among Mycobacterium tuberculosis isolates from rural Eastern Cape Province, South Africa. The analytical framework combined interpretable logistic regression with multiple machine-learning algorithms to evaluate the discriminatory contribution and relative importance of routinely generated molecular diagnostic measurements across resistance classifications. Because both the Ct-derived predictors and resistance classifications originated from routine molecular diagnostic testing, the analyses were designed to characterize relationships within the molecular diagnostic data rather than to independently predict phenotypic drug resistance.

2.2. Study Setting and Data Source

Laboratory records were obtained from the National Health Laboratory Service (NHLS), which provides routine diagnostic services to public healthcare facilities across the Eastern Cape Province. The study included culture-confirmed M. tuberculosis specimens submitted from rural healthcare facilities between January 2022 and December 2024. Molecular diagnostic data were generated during routine laboratory testing using standardized molecular drug-susceptibility assays designed to detect resistance-associated targets for first- and second-line anti-tuberculosis drugs. The extracted laboratory dataset contained Ct-derived measurements for established resistance-associated molecular targets, corresponding molecular resistance classifications, and demographic and laboratory variables. The Ct-derived measurements and resistance classifications were therefore generated within the same routine molecular diagnostic framework. No independent phenotypic drug-susceptibility testing outcome was available for the present analysis.

2.3. Study Population

The unit of analysis was the individual culture-positive M. tuberculosis specimen. Eligible specimens included culture-confirmed M. tuberculosis isolates with valid molecular drug-susceptibility test results, available Ct-derived molecular measurements, and sufficient laboratory information for analysis. Specimens with missing, invalid, or uninterpretable resistance classifications were excluded only from the corresponding drug-specific analyses to maximize data utilization across resistance outcomes. Duplicate laboratory records representing the same testing episode were identified and removed during data preprocessing. Following data-quality assessment and application of the eligibility criteria, 2430 culture-positive M. tuberculosis specimens were retained from an initial dataset of 2627 laboratory records.

2.4. Variables Included in the Analysis

The primary predictor variables comprised quantitative Ct-derived molecular measurements generated during routine molecular drug-susceptibility testing, including INHA_CT_VALUE, KATG_CT_VALUE, GYRA1_CT_VALUE, GYRA2_CT_VALUE, GYRA3_CT_VALUE, and RRS_CT_VALUE. Binary detection indicators corresponding to each molecular target were also included. Demographic and laboratory covariates incorporated into the models included patient age, year of diagnosis, referring district, microscopy result, and culture confirmation result. The primary outcomes were molecular resistance classifications for isoniazid (INH), ethionamide (ETH), fluoroquinolones (FLQ), amikacin (AMK), capreomycin (CAP), and kanamycin (KAN). For each binary classification, resistant (R) and low-level resistant (LR) results were combined into a single resistance-associated category, whereas susceptible (S) isolates constituted the reference category. Specimens with missing, invalid, or uninterpretable classifications for a specific drug were excluded only from the corresponding drug-specific analysis. In addition to the binary classifications, a multiclass resistance-profile variable was constructed to characterise overall patterns within the molecular diagnostic data. Five mutually exclusive profiles were defined: (i) no reported resistance, (ii) INH-only resistance, (iii) combined INH and ETH resistance, (iv) FLQ-containing resistance, and (v) injectable-containing resistance. This multiclass outcome enabled simultaneous computational characterisation of more complex molecular resistance profiles.

2.5. Data Preprocessing

Data preprocessing was performed before model development to improve data quality and consistency and to minimise potential analytical bias. The preprocessing pipeline included removal of duplicate records, exclusion of invalid or incomplete laboratory results, verification of molecular resistance classifications, standardisation of continuous variables where required, and encoding of categorical variables for machine-learning analyses. Drug-specific datasets were generated by retaining specimens with complete observations for the corresponding molecular resistance classification and required predictor variables. Following data-cleaning and quality-assurance procedures, the final analytical dataset comprised 2430 culture-positive M. tuberculosis specimens with complete predictor information for at least one drug-resistance classification.

2.6. Statistical Analysis

Statistical analyses were performed using IBM SPSS Statistics for Windows, version 29.0 (IBM Corp., Armonk, NY, USA), for data management and descriptive analyses. Machine-learning analyses were conducted using Python version 3.11 (Python Software Foundation, Wilmington, DE, USA) with Scikit-learn, XGBoost, NumPy, Pandas, Matplotlib, and Seaborn libraries. Data were examined for completeness, duplicate records, inconsistencies, and invalid observations before analysis. Continuous variables were summarised using means and standard deviations or medians and interquartile ranges, as appropriate. Categorical variables were summarised using frequencies and percentages. The distributions of molecular resistance classifications for INH, ETH, FLQ, AMK, CAP, and KAN were calculated, along with the distribution of multiclass resistance profiles. Binary logistic regression was fitted as an interpretable baseline statistical model to evaluate associations between Ct-derived molecular measurements and corresponding resistance classifications. Logistic regression performance was subsequently compared with that of more complex machine-learning algorithms to assess differences in discrimination and classification performance within the molecular diagnostic dataset.
For computational modelling, the dataset was randomly partitioned into 75% training and 25% independent hold-out test sets using a fixed random seed of 42. Eight algorithms were evaluated: logistic regression, decision tree, random forest, extra trees, gradient boosting, support vector machine, extreme gradient boosting (XGBoost), and a multilayer perceptron (MLP) neural network. Hyperparameters were optimised using GridSearchCV with stratified cross-validation within the training data. The selected parameter configurations were subsequently refitted using the complete training dataset and evaluated on the hold-out test dataset. Binary classification performance was evaluated using accuracy, area under the receiver operating characteristic curve (ROC-AUC), sensitivity, specificity, precision, F1-score, balanced accuracy, and confusion matrices. Multiclass resistance-profile classification was evaluated using overall accuracy, balanced accuracy, weighted precision, weighted recall, weighted F1-score, one-versus-rest weighted ROC-AUC, and confusion matrices. The reported performance measures quantify the algorithms' ability to reproduce and discriminate among molecular resistance classifications within the available diagnostic dataset. Because the Ct-derived predictors and resistance classifications originated from the same molecular diagnostic framework, these measures were not interpreted as independent estimates of phenotypic drug resistance. Permutation feature importance was applied to the best-performing model for each resistance classification to assess the relative contribution of individual predictors. Importance was quantified as the mean reduction in model performance after randomly permuting each feature, with corresponding standard deviations calculated across repeated permutations. Features that produced larger reductions in model performance were interpreted as contributing more strongly to discriminating the corresponding molecular resistance classification. Feature importance was interpreted as a measure of predictive contribution within the dataset, not as evidence of biological causality or the discovery of novel determinants of resistance.

2.7. Machine-Learning Model Development

Following preprocessing, the analytical dataset was randomly partitioned into training (75%) and independent hold-out testing (25%) sets using a fixed random seed of 42. The training dataset was used for model development and hyperparameter optimization, whereas the test dataset was reserved for final model evaluation. Eight algorithms were evaluated: logistic regression, decision tree, random forest, extra trees, gradient boosting, support vector machine, XGBoost, and an MLP neural network. Hyperparameters were optimized using GridSearchCV with stratified cross-validation within the training dataset. Separate drug-specific binary classification models were developed for each molecular resistance outcome, together with a multiclass resistance-profile classifier. Following hyperparameter optimization, the selected parameter configuration for each algorithm was refitted using the complete training dataset and evaluated on the independent hold-out test dataset. The analytical workflow, therefore, evaluated the extent to which different computational approaches could discriminate molecular resistance classifications from routinely generated Ct-derived and associated laboratory data. Model performance was interpreted in the context of the shared molecular-diagnostic origin of the predictors and outcome classifications (Figure 1).
The workflow includes data preprocessing, partitioning into training (75%) and hold-out test (25%) datasets, hyperparameter optimization using stratified cross-validation, development of binary and multiclass classification models, and final evaluation on the hold-out test dataset.

2.8. Model Evaluation

Model performance was evaluated on the independent hold-out test dataset using complementary discrimination and classification metrics, selected based on the type of classification task. Multiple performance measures were used rather than accuracy alone because the prevalence of resistance classifications differed substantially across drugs. For the drug-specific binary models, performance was assessed using accuracy, ROC-AUC, sensitivity, specificity, precision, F1-score, balanced accuracy, and confusion matrices. Accuracy represented the overall proportion of correctly classified observations. Sensitivity represented the proportion of molecularly classified resistant isolates correctly identified by the model, whereas specificity represented the proportion of molecularly classified susceptible isolates correctly identified. Precision represented the proportion of model-classified resistant observations that corresponded to the molecular resistance classification, and the F1-score summarised precision and sensitivity. Balanced accuracy was included to account for differences in class distribution, whereas ROC-AUC quantified discrimination between molecularly classified resistant and susceptible observations across classification thresholds. For the multiclass model, performance was evaluated using overall accuracy, balanced accuracy, weighted precision, weighted recall, weighted F1-score, and one-versus-rest weighted ROC-AUC. Weighted measures summarised performance across resistance-profile classes while accounting for differences in class size.
Confusion matrices were generated for both binary and multiclass models to characterize correct and incorrect classifications. For binary models, the matrices describe true-positive, true-negative, false-positive, and false-negative classifications relative to the molecular diagnostic resistance labels. For the multiclass model, confusion matrices were used to examine the distribution of correctly and incorrectly classified resistance profiles and identify patterns of misclassification. Final performance estimates were obtained from the hold-out test dataset. Importantly, although this test set was independent of model training and hyperparameter optimization, it did not constitute an independent biological reference standard because both the predictor variables and resistance labels were derived from the same molecular diagnostic framework. Consequently, high test-set performance was interpreted as evidence of strong discrimination within the routine molecular dataset rather than validation against phenotypic drug susceptibility.
Figure 2. Model evaluation workflow for binary and multiclass molecular drug-resistance classification.
Figure 2. Model evaluation workflow for binary and multiclass molecular drug-resistance classification.
Preprints 239121 g002
Binary models were evaluated using accuracy, ROC-AUC, sensitivity, specificity, precision, F1-score, balanced accuracy, and confusion matrices. In contrast, multiclass models were assessed using overall accuracy, balanced accuracy, weighted precision, weighted recall, weighted F1-score, one-versus-rest weighted ROC-AUC, and confusion matrices. Performance reflects discrimination of molecular resistance classifications within the routine diagnostic dataset and does not represent independent validation against phenotypic drug-susceptibility testing.

2.9. Identification and Ranking of Ct-Derived Molecular Predictors

Permutation feature importance was performed to improve the interpretability of the best-performing models. This approach estimates the reduction in model performance that occurs when the values of an individual predictor are randomly permuted while the remaining predictors are left unchanged. For each resistance classification, predictor importance was summarised using the mean permutation importance and corresponding standard deviation across repeated permutations. Variables associated with the largest reduction in model performance were considered the most influential model-ranked predictors for discriminating the corresponding molecular resistance classification. Because permutation feature importance quantifies predictive contribution rather than biological causality, the identified Ct-derived features were interpreted as resistance-associated molecular predictors within the diagnostic dataset rather than genetic drivers or causal mechanisms of drug resistance. Furthermore, because these Ct-derived features and resistance classifications originated from the same molecular diagnostic process, their ranking was interpreted as characterizing information embedded in the assay rather than as demonstrating independent clinical predictive value.

2.10. Ethical Considerations

Ethical approval for the original study was obtained from the Walter Sisulu University Faculty of Health Sciences Research Ethics Committee (Ref: WSU HREC 282/2025, approved 14 October 2025; and REC_120209_020, approved 17 December 2025). The Eastern Cape Department of Health granted administrative permission to access routine DR-TB programme data (Ref: EC_202510_025, approved 20 October 2025; and EC_202512_015, approved 19 January 2026). The present study constituted a secondary analysis of anonymized routinely collected laboratory data and involved no direct patient contact, specimen collection, or access to personally identifiable information. Accordingly, the requirement for individual informed consent was waived by the Walter Sisulu University Faculty of Health Sciences Research Ethics Committee. All analyses were conducted in accordance with the Declaration of Helsinki and applicable South African ethical guidelines governing research involving routinely collected health data.

3. Results

3.1. Characteristics and Distribution of Molecular Resistance Classifications

A total of 2627 laboratory records were initially available for assessment. Following data-quality evaluation and removal of missing, duplicate, invalid, or otherwise ineligible records, 2430 culture-confirmed Mycobacterium tuberculosis specimens (92.5%) were retained for analysis. The final dataset included Ct-derived molecular measurements for inhA, katG, gyrA1–3, and rrs, together with demographic and laboratory variables. GridSearchCV with stratified cross-validation was used for hyperparameter optimization, and the final model's performance was evaluated on a 25% hold-out test set not used during training. Binary classification models were optimized using ROC-AUC, whereas multiclass models were optimized using the weighted F1-score to account for class imbalance (Table 1).
Among the six binary molecular resistance classifications, INH resistance was the most prevalent, occurring in 1741 of 2413 evaluable specimens (72.2%). ETH resistance was identified in 755 of 2430 specimens (31.1%), whereas FLQ resistance occurred in 315 of 2395 specimens (13.2%). Molecular resistance classifications for AMK, CAP, and KAN were each observed in 166 specimens, corresponding to 6.9% of the respective evaluable samples (Table 2).
For multiclass resistance-profile classification, the largest category comprised INH-only resistance (868/2430; 35.7%), followed by specimens with no reported resistance (649/2430; 26.7%) and combined INH and ETH resistance (518/2430; 21.3%). FLQ-containing and injectable-containing resistance profiles accounted for 9.4% and 6.8% of specimens, respectively (Table 3).

3.2. Performance of Binary Machine-Learning Classification Models

Among the eight algorithms evaluated, ensemble tree-based methods achieved the strongest discrimination of the molecular resistance classifications across all six drug-specific outcomes (Table 4). Random Forest was the best-performing model for five outcomes—INH, ETH, FLQ, AMK, and KAN—whereas Extra Trees achieved the highest performance for CAP.
For INH, Random Forest achieved an accuracy of 98.3%, ROC-AUC of 0.999, sensitivity of 99.8%, specificity of 94.6%, precision of 98.0%, F1-score of 0.989, and balanced accuracy of 97.2%. Within the hold-out test set, one molecularly classified resistant specimen was incorrectly classified as susceptible, whereas nine molecularly classified susceptible specimens were incorrectly classified as resistant. For FLQ, Random Forest achieved the highest overall discrimination, with an accuracy of 99.7%, ROC-AUC of 1.000, sensitivity of 97.5%, specificity of 100%, precision of 100%, F1-score of 0.987, and balanced accuracy of 98.7%. Two molecularly classified resistant specimens were incorrectly classified in the hold-out test set. Random Forest also demonstrated strong discrimination for ETH, with an accuracy of 98.0%, ROC-AUC of 0.999, sensitivity of 94.7%, specificity of 99.5%, precision of 98.9%, F1-score of 0.968, and balanced accuracy of 97.1%. For the injectable-drug classifications, Random Forest produced identical performance estimates for AMK and KAN: accuracy of 98.7%, ROC-AUC of 0.999, sensitivity of 83.3%, specificity of 99.8%, precision of 97.2%, F1-score of 0.897, and balanced accuracy of 91.6%. Extra Trees achieved the strongest performance for CAP, with an accuracy of 98.7%, ROC-AUC of 0.994, sensitivity of 80.5%, specificity of 100%, precision of 100%, F1-score of 0.892, and balanced accuracy of 90.2%. Overall, the ensemble tree-based models showed very high discrimination of the molecular resistance classifications, with ROC-AUC values ranging from 0.994 to 1.000. These performance estimates represent discrimination within the routine molecular diagnostic dataset and should not be interpreted as independent validation against phenotypic drug-susceptibility testing.

3.3. Multiclass Molecular Resistance-Profile Classification

Performance varied across the multiclass classification algorithms (Table 5). Random Forest achieved the highest overall performance, with an accuracy of 98.4%, a balanced accuracy of 97.2%, a weighted precision of 98.4%, a weighted recall of 98.4%, a weighted F1-score of 98.3%, and a weighted one-versus-rest ROC-AUC of 0.999. Extra Trees ranked second, achieving 96.7% accuracy, followed by Gradient Boosting at 94.4% and Decision Tree at 89.3%. Logistic Regression, Support Vector Machine, MLP neural network, and XGBoost achieved lower overall classification accuracies, ranging from 60.5% to 70.1%. The Random Forest confusion matrix demonstrated high classification performance across all five molecular resistance-profile categories. Correct classification rates were 100% for specimens with no reported resistance, 99.5% for INH-only resistance, 96.9% for combined INH and ETH resistance, 96.5% for FLQ-containing resistance, and 92.9% for injectable-containing resistance. Misclassification was, therefore, limited across the molecular resistance-profile categories.

3.4. Permutation-Based Importance of Ct-Derived Molecular Predictors

Permutation-based feature importance identified distinct Ct-derived molecular measurements that contributed most strongly to discriminating each resistance classification (Table 6).
For INH, KATG_CT_VALUE had the highest permutation importance (0.1201), substantially exceeding INHA_CT_VALUE (0.0084) and GYRA3_CT_VALUE (0.0083). For ETH, INHA_CT_VALUE showed the greatest contribution (0.1148), followed by KATG_CT_VALUE (0.0146) and GYRA3_CT_VALUE (0.0145).
For FLQ, GYRA3_CT_VALUE had the highest permutation importance (0.0107), followed by GYRA2_CT_VALUE (0.0084) and RRS_CT_VALUE (0.0064). For AMK and KAN, RRS_CT_VALUE showed the greatest contribution (0.1159), followed by GYRA3_CT_VALUE (0.0168) and INHA_CT_VALUE (0.0061). Similarly, for CAP, RRS_CT_VALUE had the highest permutation importance (0.0542), followed by GYRA3_CT_VALUE (0.0069) and KATG_CT_VALUE (0.0059). Across the drug-specific models, quantitative Ct-derived measurements generally contributed more strongly to model discrimination than the corresponding binary detection indicators. Within the present analytical framework, this finding indicates that quantitative amplification measurements contained information used by the models to discriminate the molecular resistance classifications beyond that represented by the binary detection indicators included as predictors. However, because both Ct-derived measurements and resistance classifications originated from the same molecular diagnostic process, this finding should not be interpreted as demonstrating incremental clinical value beyond the underlying diagnostic assay.

3.5. Overall Ranking of Ct-Derived Molecular Predictors

Comparison of permutation feature importance across the best-performing models showed that discrimination among molecular resistance classifications was driven primarily by a small subset of Ct-derived measurements. KATG_CT_VALUE was the highest-ranked predictor for INH classification, INHA_CT_VALUE for ETH, GYRA3_CT_VALUE for FLQ, and RRS_CT_VALUE for AMK, CAP, and KAN. Secondary predictors generally showed substantially lower permutation importance values. These rankings were consistent with established relationships between the molecular targets and corresponding drug-resistance classifications. Importantly, the feature-importance analysis quantifies the contribution of individual variables to model discrimination and does not establish biological causality, identify novel genetic determinants, or demonstrate independent prediction of phenotypic resistance. The results should therefore be interpreted as a computational characterization of resistance-associated molecular patterns contained within the routine diagnostic dataset rather than as evidence of newly identified genetic drivers.

4. Discussion

This study integrated interpretable logistic regression, supervised machine learning, a multilayer perceptron neural network, multiclass resistance-profile classification, and permutation-based feature importance to characterize Ct-derived molecular patterns associated with first- and second-line anti-tuberculosis drug-resistance classifications among Mycobacterium tuberculosis isolates from rural Eastern Cape, South Africa. Ensemble tree-based algorithms demonstrated very high discrimination across the molecular resistance classifications. At the same time, permutation feature importance consistently ranked katG, inhA, gyrA, and rrs-derived Ct measurements among the most influential features for INH, ETH, FLQ, and second-line injectable resistance classifications, respectively. These findings should be interpreted in the context of the study design. The Ct-derived predictors and resistance classifications were generated within the same targeted molecular diagnostic framework. Consequently, the high discrimination observed in this study primarily demonstrates the ability of computational models to recover and characterize resistance-associated information embedded within routine molecular diagnostic data. It does not constitute independent prediction of phenotypic drug resistance, discovery of novel genetic determinants, or evidence that machine learning provides additional clinical information beyond the underlying molecular assay. Nevertheless, the findings demonstrate how interpretable computational approaches can quantify, rank, and summarise established resistance-associated molecular patterns within large routine diagnostic datasets.

4.1. Ct-Derived Molecular Signatures Reflect Established Resistance-Associated Relationships

Permutation-based feature importance demonstrated that a relatively small number of Ct-derived molecular measurements strongly contributed to discriminating among the corresponding resistance classifications. These patterns were biologically coherent and broadly consistent with established molecular mechanisms of M. tuberculosis drug resistance. Previous genomic and machine-learning studies have similarly demonstrated that established resistance-associated loci contribute substantially to computational classification of drug resistance [26,28,30,31,32,33]. The exceptionally high ROC-AUC values observed for Random Forest and Extra Trees require cautious interpretation. Although these results demonstrate strong internal discrimination, the resistance labels were derived from the same molecular diagnostic framework that generated the Ct-derived predictor variables. Therefore, the near-perfect performance is likely, at least partly, to reflect the strong correspondence between assay-generated quantitative signals and the resistance classifications encoded by the diagnostic process. The results should consequently not be interpreted in the same manner as models trained to predict independently measured phenotypic drug susceptibility. This distinction is particularly important when interpreting feature importance. Permutation-based importance identifies variables that contribute strongly to model classification but does not establish biological causality. The present results, therefore, demonstrate that the computational models recovered established resistance-associated molecular relationships rather than identifying previously unknown genetic mechanisms.

4.2. katG-Derived Ct Measurements and Isoniazid Resistance Classification

KATG_CT_VALUE was the highest-ranked feature for discrimination of INH resistance classifications. This finding is consistent with the established role of katG mutations, particularly the Ser315Thr substitution, in high-level isoniazid resistance [37,38,39]. katG encodes the catalase-peroxidase enzyme required to activate isoniazid from its prodrug form. Mutations that reduce catalase-peroxidase activity can impair drug activation and contribute to resistance [40,41]. Previous genomic and computational studies have consistently identified katG as one of the most informative molecular features associated with INH resistance [26,27,30,42].
Although inhA-derived measurements also contributed to INH classification, their permutation importance was substantially lower than that of katG. This pattern is consistent with established molecular epidemiology in which katG mutations account for a substantial proportion of high-level INH resistance. In contrast, inhA promoter mutations are commonly associated with lower-level resistance [43]. The present analysis, therefore, provides computational characterization of this established relationship within routine Eastern Cape molecular diagnostic data. Importantly, the prominence of katG should not be interpreted as the discovery of a new molecular determinant; rather, it demonstrates that the model strongly recovered information corresponding to an established resistance-associated target.

4.3. InhA-Derived Ct Measurements and Ethionamide Resistance Classification

For ETH, INHA_CT_VALUE showed the highest permutation importance. This pattern is biologically consistent with the established relationship between inhA-associated resistance mechanisms and reduced susceptibility to isoniazid and ethionamide [44]. Alterations affecting the inhA promoter can increase enoyl-acyl carrier protein reductase expression and contribute to cross-resistance between isoniazid and ethionamide. Previous molecular and computational investigations have similarly identified inhA-associated variants among informative features for resistance classification [26,28,45]. The ranking of inhA-derived Ct measurements in the present analysis, therefore, demonstrates concordance between the computational feature-importance results and established molecular knowledge. However, because the ETH resistance classifications and Ct-derived predictors originated from the routine molecular diagnostic process, these findings cannot establish that Ct measurements independently predict phenotypic ethionamide susceptibility or provide additional therapeutic information beyond the assay itself. Accordingly, the principal contribution of this finding is the demonstration that interpretable machine-learning approaches can recover and quantify established inhA-associated patterns within routinely collected molecular diagnostic data. Determining whether quantitative Ct information provides incremental value beyond conventional assay interpretation would require comparison with an independent reference standard, particularly phenotypic drug-susceptibility testing.

4.4. gyrA-Derived Ct Measurements and Fluoroquinolone Resistance Classification

FLQ resistance classifications were most strongly associated with gyrA-derived Ct measurements, particularly GYRA3_CT_VALUE and GYRA2_CT_VALUE. This finding is consistent with the central role of mutations within the quinolone resistance-determining region of gyrA in fluoroquinolone resistance. Mutations affecting codons 90, 91, and 94 are among the best-established molecular mechanisms of FLQ resistance in M. tuberculosis [46,48]. Previous genomic machine-learning studies have likewise identified gyrA variants as highly informative features for FLQ resistance classification [26,28,30,42]. Explainable machine-learning approaches have also demonstrated that established resistance-associated loci can be recovered through feature-ranking procedures [34,35,36]. The prominence of gyrA-derived measurements in the present models, therefore, supports the biological coherence of the computational analysis. However, it should not be regarded as independent confirmation of phenotypic FLQ resistance because the molecular resistance labels were generated within the same diagnostic framework. Rather, the analysis demonstrates that the models effectively captured the established gyrA-associated information encoded within routine molecular diagnostic data. The very high FLQ classification performance, including an ROC-AUC of 1.000 for the best-performing model, should be interpreted as evidence of strong internal discrimination among molecular resistance classifications, rather than as evidence that machine learning independently predicts phenotypic FLQ resistance or improves clinical decision-making beyond the underlying assay.

4.5. rrs-Derived Ct Measurements and Injectable-Drug Resistance Classification

RRS_CT_VALUE was the highest-ranked Ct-derived feature for AMK, KAN, and CAP resistance classifications. This pattern is consistent with the established role of mutations in the rrs, particularly in the 1400 region, in conferring resistance to second-line injectable agents [46,50,51]. The similarity in feature-importance patterns between AMK and KAN is also biologically plausible, given the recognized cross-resistance associated with rrs mutations. Previous genomic and computational studies have demonstrated that established resistance-associated loci contribute strongly to the classification of second-line drug resistance [26,28,30,42]. As with the other drug-specific analyses, however, the prominence of rrs-derived Ct measurements should be interpreted as recovery of established resistance-associated information rather than discovery of a novel molecular mechanism. Furthermore, the high classification performance cannot establish an independent prediction of phenotypic resistance because phenotypic DST was not available as an external reference standard. These findings nevertheless illustrate the ability of permutation-based feature importance to quantify the relative contribution of molecular measurements within routine diagnostic datasets and to provide transparent interpretation of otherwise complex machine-learning models.

4.6. Ensemble Machine Learning Demonstrated the Strongest Internal Classification Performance

Random Forest and Extra Trees consistently demonstrated stronger classification performance than logistic regression, support vector machine, XGBoost, and the MLP neural network. This suggests that ensemble tree-based methods were particularly well suited to the structured relationships in the present molecular diagnostic dataset. Several methodological characteristics may contribute to this performance. Tree-based ensemble algorithms can accommodate nonlinear relationships, interactions among predictors, and heterogeneous feature distributions without imposing the linearity assumptions of conventional regression models. Previous studies using genomic resistance data have similarly reported strong performance of ensemble approaches for TB resistance classification [26,28]. The poorer performance of the MLP neural network compared with Random Forest and Extra Trees may reflect the moderate sample size and the relatively structured feature space. Deep learning methods generally derive greater benefit from substantially larger and more complex datasets, whereas ensemble tree-based approaches can perform effectively on moderate-sized tabular datasets. However, the superiority of ensemble algorithms in this study should be understood as their ability to reproduce the molecular resistance classifications available in this dataset. It does not demonstrate superiority for predicting an independent resistance phenotype. Furthermore, because the predictors include quantitative measurements derived from established resistance-associated targets, the very high performance of the tree-based models may reflect their ability to efficiently reconstruct relationships already embedded in the molecular assay. An important methodological contribution of the study is therefore the combination of classification modelling with permutation-based interpretability. Rather than relying solely on overall performance metrics, feature-importance analysis enabled examination of which Ct-derived measurements contributed most strongly to classification and demonstrated that these rankings broadly corresponded to established molecular resistance relationships.

4.7. Implications for Molecular Surveillance and Rural Eastern Cape

The findings demonstrate the potential value of routinely generated molecular diagnostic data as a resource for secondary analytical and epidemiological purposes. Routine laboratory systems generate large volumes of quantitative molecular information that may be underutilized once the immediate diagnostic interpretation is complete. Computational analysis of these data may assist in describing resistance-associated patterns, monitoring their distribution over time and place, and identifying changes that warrant further epidemiological investigation. This potential application is particularly relevant in high-burden and resource-constrained settings such as the rural Eastern Cape, where routine diagnostic datasets may provide an accessible source of information to strengthen molecular surveillance, because the present analysis used existing laboratory data; similar analytical approaches could potentially be incorporated into surveillance systems without requiring additional specimen collection. However, the present findings do not establish that Ct-derived machine-learning models should currently be used as clinical decision-support tools or to modify treatment independently of validated diagnostic results. Before such applications can be considered, the models would require prospective and external validation against independent reference standards, particularly phenotypic DST, together with assessment of calibration, generalisability, clinical utility, and performance across different diagnostic platforms and populations.
Future studies could also determine whether quantitative Ct-derived measurements provide incremental information beyond the categorical resistance results already produced by molecular assays. Such studies should directly compare models based on routine demographic and laboratory variables, categorical molecular assay outputs, and models incorporating quantitative Ct measurements. This would provide a more rigorous assessment of whether Ct-derived information contributes additional discriminatory value beyond standard assay interpretation.

5. Strengths and Limitations

5.1. Strengths

This study has several strengths. First, it applied an integrated analytical framework that combined logistic regression, multiple supervised machine-learning algorithms, an MLP neural network, multiclass classification, and permutation-based feature importance to a large, routine molecular diagnostic dataset from rural South Africa. Second, the analysis included 2430 culture-confirmed M. tuberculosis specimens generated through routine NHLS diagnostic services, providing substantial empirical data on molecular resistance classifications in a high-burden setting. Third, eight computational approaches were compared using standardized hyperparameter optimization and a hold-out test set, enabling systematic assessment of internal classification performance. Fourth, the permutation feature-importance-enhanced model improved transparency by quantifying the relative contribution of individual Ct-derived molecular measurements. Finally, the use of routinely generated laboratory data illustrates the potential value of existing diagnostic information for secondary molecular surveillance and epidemiological analysis.

5.2. Limitations

Several important limitations should be considered. First, the principal predictors and resistance classifications were derived from the same targeted molecular diagnostic framework. Consequently, the very high discrimination observed in the machine-learning models is likely, at least in part, to reflect information already encoded in the molecular assay. The models, therefore, cannot be interpreted as independently predicting phenotypic drug resistance or as demonstrating incremental clinical value beyond the underlying diagnostic test. Second, phenotypic drug-susceptibility testing was not available as an independent reference standard. This prevented assessment of whether the Ct-derived models accurately predict phenotypically confirmed resistance and limits conclusions regarding their potential clinical utility. Third, the study analyzed targeted Ct-derived molecular measurements rather than whole-genome sequencing data. The feature-importance findings, therefore, represent model-ranked molecular signatures associated with the predefined assay targets and cannot identify novel, rare, or non-targeted resistance-conferring variants or establish causal genetic mechanisms. Fourth, the retrospective laboratory-based design limited the availability of detailed patient-level information, including HIV status, previous TB treatment, treatment regimens, adherence, and clinical outcomes. The relationship between the identified molecular patterns and patient outcomes could therefore not be assessed.
Fifth, the analysis was restricted to the rural Eastern Cape and has not undergone external geographic or platform validation. Although a 25% hold-out test set was reserved for final model evaluation, this represents internal validation because it originated from the same underlying dataset and diagnostic system. External validation using independent populations, diagnostic platforms, and settings is required before generalisability can be established. Finally, the present analysis did not directly quantify the incremental value of Ct-derived measurements beyond the standard categorical outputs of the molecular diagnostic assay. Future studies should formally compare models with and without quantitative Ct information and validate any incremental improvement against an independent reference standard.

6. Recommendations

  • Strengthen secondary use of routine molecular diagnostic data for surveillance. Routinely generated Ct-derived and categorical molecular information should be further evaluated for population-level surveillance, temporal monitoring, and epidemiological characterization of resistance-associated patterns.
  • Prioritize independent phenotypic validation. Future studies should link Ct-derived molecular measurements with phenotypic DST to determine whether computational models provide predictive information beyond the resistance classifications generated by the molecular assay.
  • Evaluate incremental value explicitly. Future modeling should compare baseline clinical and laboratory variables, categorical molecular assay outputs, and quantitative Ct-derived measurements to determine whether Ct information provides measurable additional discrimination, calibration, or clinical utility.
  • Undertake multicentre and external validation. Models should be evaluated using independent datasets from other provinces, populations, and molecular diagnostic platforms before broader implementation is considered.
  • Integrate genomic and clinical outcome data. Where feasible, future studies should integrate routine molecular diagnostics with whole-genome sequencing, phenotypic DST, treatment information, and clinical outcomes to comprehensively investigate resistance mechanisms and assess the translational relevance of computationally identified patterns.

7. Conclusions

This study demonstrates that interpretable machine-learning approaches can effectively characterize molecular resistance-associated patterns within routinely generated Ct-derived diagnostic data from Mycobacterium tuberculosis specimens in rural Eastern Cape, South Africa. Ensemble tree-based models showed very high discrimination of molecular resistance classifications. At the same time, permutation feature importance consistently ranked katG-, inhA-, gyrA-, and rrs-derived Ct measurements as the most influential features for INH, ETH, FLQ, and second-line injectable resistance classifications, respectively. These patterns are consistent with established molecular mechanisms of TB drug resistance. However, because the Ct-derived predictors and resistance classifications originated from the same targeted molecular diagnostic framework, the high model performance should not be interpreted as independent prediction of phenotypic resistance, discovery of novel genetic determinants, or evidence of additional clinical utility beyond the underlying assay. Rather, the study demonstrates the value of interpretable computational approaches for characterizing, ranking, and summarizing resistance-associated information embedded within routinely collected molecular diagnostic data. Routine molecular diagnostic datasets may therefore represent a valuable resource for secondary analysis and molecular resistance surveillance in high-burden, resource-constrained settings. Future studies incorporating independent phenotypic DST, genomic sequencing, external populations, and clinical outcomes are required to determine whether quantitative Ct-derived modelling provides incremental predictive or clinical value beyond existing molecular diagnostic interpretation.

Author Contributions

Kamvelihle Sabisa: Conceptualization, Methodology, Validation, Investigation, Writing – Original Draft. Ncomeka Sineke: Conceptualization, Methodology, Validation, Writing – Review & Editing. Kelvin Tafadzwa Mpofu: Formal Analysis, Data Curation, Validation, Writing – Review & Editing. Ntandazo Dlatu: Conceptualization, Methodology, Validation, Writing – Review & Editing. Teke Apalata: Funding Acquisition, Writing – Review & Editing. Lindiwe Modest Faye: Conceptualization, Methodology, Supervision, Writing – Review & Editing, Final Approval. All authors have read and approved the final version of the manuscript.

Funding

The authors state that no external funding was received for the conduct of this research. This study was supported by internal operational funds from the School of Pathology, and Article Processing Charges (APC) were covered by the School of Public Health at Walter Sisulu University.

Institutional Review Board Statement

Ethical approval for the original study was obtained from the Walter Sisulu University Faculty of Health Sciences Research Ethics Committee (Ref: WSU HREC 282/2025, approved 14 October 2025; and REC_120209_020, approved 17 December 2025). The Eastern Cape Department of Health granted administrative permission to access routine DR-TB programme data (Ref: EC_202510_025, approved 20 October 2025; and EC_202512_015, approved 19 January 2026). All analyses were conducted in accordance with the Declaration of Helsinki and applicable South African ethical guidelines governing research involving routinely collected health data.

Data Availability Statement

To protect patient privacy and comply with national data protection regulations, individual-level health records used in this study are restricted by the Walter Sisulu University Research Ethics and Biosafety Committee and the Eastern Cape Department of Health. De-identified data may be made available to qualified researchers upon reasonable request to the corresponding author. Data release is contingent upon evaluation by the relevant ethics review boards, execution of a standard data-sharing agreement, and adherence to established legal and ethical frameworks.

Acknowledgments

The authors express their sincere gratitude to the Honors and Master’s students at the School of Pathology and Laboratory Medicine, CSIR, as well as the Walter Sisulu University TB Research Group, for their valuable assistance with data collection. We also thank all colleagues and collaborators for their ongoing support and contributions, which facilitated the completion of this study.
Generative AI Statement: The authors declare that no generative AI tools or artificial intelligence technologies were used in the writing, data analysis, or preparation of this manuscript.

Conflicts of Interest

The authors declare that the research was conducted without any commercial, financial, or personal relationships that could be construed as a potential conflict of interest.

References

  1. World Health Organization. Global Tuberculosis Report 2020: Executive Summary; World Health Organization: Geneva, Switzerland, 2020. [Google Scholar]
  2. Floyd, K.; Glaziou, P.; Zumla, A.; Raviglione, M. The global tuberculosis epidemic and progress in care, prevention, and research: An overview in year 3 of the End TB era. Lancet Respir. Med. 2018, 6, 299–314. [Google Scholar] [CrossRef] [PubMed]
  3. World Health Organization. WHO Consolidated Guidelines on Tuberculosis. Module 6: Tuberculosis and Comorbidities; World Health Organization: Geneva, Switzerland, 2024. [Google Scholar]
  4. Naidoo, K.; Perumal, R.; Cox, H.; Mathema, B.; Loveday, M.; Ismail, N.; Omar, S.V.; Georghiou, S.B.; Daftary, A.; O'Donnell, M.; et al. The epidemiology, transmission, diagnosis, and management of drug-resistant tuberculosis—Lessons from the South African experience. Lancet Infect. Dis. 2024, 24, e559–e575. [Google Scholar] [CrossRef] [PubMed]
  5. Cox, H.; Dickson-Hall, L.; Jassat, W.; Moshabela, M.; Kielmann, K.; Grant, A.; Nicol, M.; Black, J.; Mlisana, K.; Vanleeuw, L.; et al. Drug-resistant tuberculosis in South Africa: History, progress and opportunities for achieving universal access to diagnosis and effective treatment. S. Afr. Health Rev. 2017, 2017, 157–167. [Google Scholar]
  6. Faye, L.M.; Hosu, M.C.; Apalata, T. Drug-resistant tuberculosis in rural Eastern Cape, South Africa: A study of patients’ characteristics in selected healthcare facilities. Int. J. Environ. Res. Public Health 2024, 21, 1594. [Google Scholar] [CrossRef] [PubMed]
  7. Mokhethi, N.P. Exploring barriers to TB contact tracing and screening: Health service providers’ perspective. Doctoral dissertation, University of the Western Cape, Bellville, South Africa, 2023. [Google Scholar]
  8. Hosu, M.C.; Tsuro, U.; Dlatu, N.; Faye, L.M.; Apalata, T. Strengthening clinical governance and public health interventions to improve drug-resistant tuberculosis outcomes in rural South Africa. Healthcare 2025, 13, 2093. [Google Scholar] [CrossRef] [PubMed]
  9. Gygli, S.M.; Borrell, S.; Trauner, A.; Gagneux, S. Antimicrobial resistance in Mycobacterium tuberculosis: Mechanistic and evolutionary perspectives. FEMS Microbiol. Rev. 2017, 41, 354–373. [Google Scholar] [CrossRef] [PubMed]
  10. Hameed, H.A.; Islam, M.M.; Chhotaray, C.; Wang, C.; Liu, Y.; Tan, Y.; Li, X.; Tan, S.; Delorme, V.; Yew, W.W.; et al. Molecular targets related drug resistance mechanisms in MDR-, XDR-, and TDR-Mycobacterium tuberculosis strains. Front. Cell. Infect. Microbiol. 2018, 8, 114. [Google Scholar] [CrossRef] [PubMed]
  11. Omoteso, O.A.; Fadaka, A.O.; Walker, R.B.; Khamanga, S.M. Innovative strategies for combating multidrug-resistant tuberculosis: Advances in drug delivery systems and treatment. Microorganisms 2025, 13, 722. [Google Scholar] [CrossRef] [PubMed]
  12. Gagneux, S. Ecology and evolution of Mycobacterium tuberculosis. Nat. Rev. Microbiol. 2018, 16, 202–213. [Google Scholar] [CrossRef] [PubMed]
  13. Gopalaswamy, R.; Subbian, S. The power of resistance: Mechanisms of antimicrobial resistance in Mycobacterium tuberculosis and its impact on tuberculosis management. Clin. Microbiol. Rev. 2026, 39, e0019425. [Google Scholar] [CrossRef] [PubMed]
  14. Dookie, N.; Rambaran, S.; Padayatchi, N.; Mahomed, S.; Naidoo, K. Evolution of drug resistance in Mycobacterium tuberculosis: A review on the molecular determinants of resistance and implications for personalized care. J. Antimicrob. Chemother. 2018, 73, 1138–1151. [Google Scholar] [CrossRef] [PubMed]
  15. Sheikh, B.A.; Bhat, B.A.; Mehraj, U.; Mir, W.; Hamadani, S.; Mir, M.A. Development of new therapeutics to meet the current challenge of drug resistant tuberculosis. Curr. Pharm. Biotechnol. 2021, 22, 480–500. [Google Scholar] [CrossRef]
  16. Deshpande, A.; Likhar, R.; Khan, T.; Omri, A. Decoding drug resistance in Mycobacterium tuberculosis complex: Genetic insights and future challenges. Expert Rev. Anti-Infect. Ther. 2024, 22, 511–527. [Google Scholar] [CrossRef] [PubMed]
  17. Bartolomeu-Gonçalves, G.; Souza, J.M.D.; Fernandes, B.T.; Spoladori, L.F.A.; Correia, G.F.; Castro, I.M.D.; Borges, P.H.G.; Silva-Rodrigues, G.; Tavares, E.R.; Yamauchi, L.M.; et al. Tuberculosis diagnosis: Current, ongoing, and future approaches. Diseases 2024, 12, 202. [Google Scholar] [CrossRef] [PubMed]
  18. Wu, X.; Tan, G.; Sun, C.; Wang, Y.; Yang, J.; Wu, C.; Hu, C.; Yu, F. Targeted next-generation sequencing—A promising approach in the diagnosis of Mycobacterium tuberculosis and drug resistance. Infection 2025, 53, 967–979. [Google Scholar] [CrossRef] [PubMed]
  19. Pillay, S.; Davies, G.R.; Chaplin, M.; De Vos, M.; Schumacher, S.G.; Warren, R.; Steingart, K.R.; Theron, G. Xpert MTB/XDR for detection of pulmonary tuberculosis and resistance to isoniazid, fluoroquinolones, ethionamide, and amikacin. Cochrane Database Syst. Rev. 2021, (6). [Google Scholar] [CrossRef]
  20. Martin-Higuera, M.C.; Rivas, G.; Rolo, M.; Muñoz-Gallego, I.; Lopez-Roa, P. Xpert MTB/RIF Ultra CT value provides a rapid measure of sputum bacillary burden and predicts smear status in patients with pulmonary tuberculosis. Sci. Rep. 2023, 13, 1591. [Google Scholar] [CrossRef] [PubMed]
  21. Lange, B.; Khan, P.; Kalmambetova, G.; Al-Darraji, H.A.; Alland, D.; Antonenka, U.; Brown, T.; Balcells, M.E.; Blakemore, R.; Denkinger, C.M.; et al. Diagnostic accuracy of the Xpert® MTB/RIF cycle threshold level to predict smear positivity: A meta-analysis. Int. J. Tuberc. Lung Dis. 2017, 21, 493–502. [Google Scholar] [CrossRef] [PubMed]
  22. Singh, M.; Pujar, G.V.; Kumar, S.A.; Bhagyalalitha, M.; Akshatha, H.S.; Abuhaija, B.; Alsoud, A.R.; Abualigah, L.; Beeraka, N.M.; Gandomi, A.H. Evolution of machine learning in tuberculosis diagnosis: A review of deep learning-based medical applications. Electronics 2022, 11, 2634. [Google Scholar] [CrossRef]
  23. Kavvas, E.S.; Catoiu, E.; Mih, N.; Yurkovich, J.T.; Seif, Y.; Dillon, N.; Heckmann, D.; Anand, A.; Yang, L.; Nizet, V.; et al. Machine learning and structural analysis of Mycobacterium tuberculosis pan-genome identifies genetic signatures of antibiotic resistance. Nat. Commun. 2018, 9, 4306. [Google Scholar] [CrossRef] [PubMed]
  24. Ezewudo, M.; Borens, A.; Chiner-Oms, Á.; Miotto, P.; Chindelevitch, L.; Starks, A.M.; Hanna, D.; Liwski, R.; Zignol, M.; Gilpin, C.; et al. Integrating standardized whole genome sequence analysis with a global Mycobacterium tuberculosis antibiotic resistance knowledgebase. Sci. Rep. 2018, 8, 15382. [Google Scholar] [CrossRef] [PubMed]
  25. Sharma, A.; Machado, E.; Lima, K.V.B.; Suffys, P.N.; Conceição, E.C. Tuberculosis drug resistance profiling based on machine learning: A literature review. Braz. J. Infect. Dis. 2022, 26, 102332. [Google Scholar] [CrossRef] [PubMed]
  26. Yang, Y.; Niehaus, K.E.; Walker, T.M.; Iqbal, Z.; Walker, A.S.; Wilson, D.J.; Peto, T.E.; Crook, D.W.; Smith, E.G.; Zhu, T.; et al. Machine learning for classifying tuberculosis drug-resistance from DNA sequencing data. Bioinformatics 2018, 34, 1666–1671. [Google Scholar] [CrossRef] [PubMed]
  27. Chen, M.L.; Doddi, A.; Royer, J.; Freschi, L.; Schito, M.; Ezewudo, M.; Kohane, I.S.; Beam, A.; Farhat, M. Beyond multidrug resistance: Leveraging rare variants with machine and statistical learning models in Mycobacterium tuberculosis resistance prediction. EBioMedicine 2019, 43, 356–369. [Google Scholar] [CrossRef] [PubMed]
  28. Kouchaki, S.; Yang, Y.; Walker, T.M.; Walker, A.S.; Wilson, D.J.; Peto, T.E.; Crook, D.W.; CRyPTIC Consortium; Clifton, D.A. Application of machine learning techniques to tuberculosis drug resistance analysis. Bioinformatics 2019, 35, 2276–2282. [Google Scholar] [CrossRef] [PubMed]
  29. Alqudah, A.M.; Moussavi, Z. Bridging signal intelligence and clinical insight: A comprehensive review of feature engineering, model interpretability, and machine learning in biomedical signal analysis. Appl. Sci. 2025, 15, 12036. [Google Scholar] [CrossRef]
  30. Wang, Y.; Jiang, Z.; Liang, P.; Liu, Z.; Cai, H.; Sun, Q. TB-DROP: Deep learning-based drug resistance prediction of Mycobacterium tuberculosis utilizing whole genome mutations. BMC Genom. 2024, 25, 167. [Google Scholar] [CrossRef] [PubMed]
  31. Saliba, J.G.; Zheng, W.; Shu, Q.; Li, L.; Wu, C.; Xie, Y.; Lyon, C.J.; Qu, J.; Huang, H.; Ying, B.; et al. Enhanced diagnosis of multi-drug-resistant microbes using group association modeling and machine learning. Nat. Commun. 2025, 16, 2933. [Google Scholar] [CrossRef] [PubMed]
  32. Li, L.; Liu, H.; Lei, Q.; Li, T. From clinical phenotypes to genomic signatures: Machine learning integration for precision tuberculosis treatment prediction. Front. Bioinform. 2026, 6, 1787360. [Google Scholar] [CrossRef] [PubMed]
  33. Arulsamy, S.; Sharma, S. Machine learning in tuberculosis: Advancements in diagnostics, drug resistance prediction, and prognosis. Dis. Prev. Epidemiol. 2026, 1, 48–62. [Google Scholar] [CrossRef]
  34. Cen, H.; Zhang, P.; Ling, Y.; Zhao, G.; Zhang, G. An explainable artificial intelligence framework reveals mutations associated with drug resistance in Mycobacterium tuberculosis. Biosaf. Health 2025, 7, 384–394. [Google Scholar] [CrossRef] [PubMed]
  35. Paredes-Gutierrez, G.; Perea-Jacobo, R.; Acosta-Mesa, H.G.; Mezura-Montes, E.; Morales Reyes, J.L.; Zenteno-Cuevas, R.; Guerrero-Chevannier, M.Á.; Muñiz-Salazar, R.; Flores, D.L. Predicting drug resistance in Mycobacterium tuberculosis: A machine learning approach to genomic mutation analysis. Diagnostics 2025, 15, 279. [Google Scholar] [CrossRef] [PubMed]
  36. Xu, Y.; Mao, Y.; Hua, X.; Jiang, Y.; Zou, Y.; Wang, Z.; Liu, Z.; Zhang, H.; Lu, L.; Yu, Y. Machine learning-based prediction of antimicrobial resistance and identification of AMR-related SNPs in Mycobacterium tuberculosis. BMC Genom. Data 2025, 26, 48. [Google Scholar] [CrossRef] [PubMed]
  37. Valafar, S.J. Systematic review of mutations associated with isoniazid resistance points to continuing evolution and subsequent evasion of molecular detection, and potential for emergence of multidrug resistance in clinical strains of Mycobacterium tuberculosis. Antimicrob. Agents Chemother. 2021, 65, e01011-20. [Google Scholar] [CrossRef] [PubMed]
  38. Napier, G.; Campino, S.; Phelan, J.E.; Clark, T.G. Large-scale genomic analysis of Mycobacterium tuberculosis reveals extent of target and compensatory mutations linked to multi-drug resistant tuberculosis. Sci. Rep. 2023, 13, 623. [Google Scholar] [CrossRef] [PubMed]
  39. Bodaghi, A.B.; Shariati, A.; Shamseddin, J.; Bodaghi, A.B.; Rezaei, M.; Farahani, A. Mechanisms of antibiotic resistance and novel therapeutic approaches for Mycobacterium tuberculosis: A narrative review with a focus on tuberculosis mutations in Iran. Health Sci. Rep. 2025, 8, e71313. [Google Scholar] [CrossRef] [PubMed]
  40. Faye, L.M.; Hosu, M.C.; Oostvogels, S.; Dippenaar, A.; Warren, R.M.; Sineke, N.; Vasaikar, S.; Apalata, T. The detection of mutations and genotyping of drug-resistant Mycobacterium tuberculosis strains isolated from patients in the Rural Eastern Cape Province. Infect. Dis. Rep. 2023, 15, 403–416. [Google Scholar] [CrossRef] [PubMed]
  41. Singh, A.K.; Singh, N.; Kumar, S.; Mishra, A.K.; Singh, N.P. Molecular insights of drug-resistant tuberculosis: Genetic mutations and their profile. Front. Microbiol. 2025, 16, 1669327. [Google Scholar] [CrossRef] [PubMed]
  42. Kuang, X.; Wang, F.; Hernandez, K.M.; Zhang, Z.; Grossman, R.L. Accurate and rapid prediction of tuberculosis drug resistance from genome sequence data using traditional machine learning algorithms and CNN. Sci. Rep. 2022, 12, 2427. [Google Scholar] [CrossRef] [PubMed]
  43. Patel, K.; Shea, J.; Lapierre, P.; Halse, T.A.; Kohlerschmidt, D.; Dickinson, M.; Escuyer, V.; Musser, K.A. Predicting isoniazid resistance in Mycobacterium tuberculosis complex in New York State using whole-genome sequencing. J. Clin. Microbiol. 2026, 64, e0160925. [Google Scholar] [CrossRef] [PubMed]
  44. Diab, A.; Dickerson, H.; Al Musaimi, O. Targeting the heart of Mycobacterium: Advances in anti-tubercular agents disrupting cell wall biosynthesis. Pharmaceuticals 2025, 18, 70. [Google Scholar] [CrossRef] [PubMed]
  45. Pruthi, S.S.; Billows, N.; Thorpe, J.; Campino, S.; Phelan, J.E.; Mohareb, F.; Clark, T.G. Leveraging large-scale Mycobacterium tuberculosis whole genome sequence data to characterise drug-resistant mutations using machine learning and statistical approaches. Sci. Rep. 2024, 14, 27091. [Google Scholar] [CrossRef] [PubMed]
  46. World Health Organization. Catalogue of Mutations in Mycobacterium Tuberculosis Complex and Their Association with Drug Resistance; World Health Organization: Geneva, Switzerland, 2023. [Google Scholar]
  47. Jamal, S.; Khubaib, M.; Gangwar, R.; Grover, S.; Grover, A.; Hasnain, S.E. Artificial intelligence and machine learning based prediction of resistant and susceptible mutations in Mycobacterium tuberculosis. Sci. Rep. 2020, 10, 5487. [Google Scholar] [CrossRef] [PubMed]
  48. Nehru, V.J.; Jose Vandakunnel, M.; Brammacharry, U.; Ramachandra, V.; Pradhabane, G.; Mani, B.R.; Vn, A.D.; Muthaiah, M. Risk assessment and transmission of fluoroquinolone resistance in drug-resistant pulmonary tuberculosis: A retrospective genomic epidemiology study. Sci. Rep. 2024, 14, 19719. [Google Scholar] [CrossRef] [PubMed]
  49. Domínguez, J.; Boeree, M.J.; Cambau, E.; Chesov, D.; Conradie, F.; Cox, V.; Dheda, K.; Dudnyk, A.; Farhat, M.R.; Gagneux, S.; et al. Clinical implications of molecular drug resistance testing for Mycobacterium tuberculosis: A 2023 TBnet/RESIST-TB consensus statement. Lancet Infect. Dis. 2023, 23, e122–e137. [Google Scholar] [CrossRef] [PubMed]
  50. Roshdi Maleki, M. A comprehensive review of genetic mechanisms of Mycobacterium tuberculosis resistance to injectable agents, second-line drugs, and novel therapeutics. Infect. Drug Resist. 2026, 19, 1–22. [Google Scholar] [CrossRef] [PubMed]
  51. Serajian, M.; Lotfollahi, M.; Green, O.; Smith, K.; Marini, S.; Prosperi, M.; Boucher, C. Scalable machine learning improves resistance prediction and identifies novel determinants in Mycobacterium tuberculosis. bioRxiv 2026. It was posted on 29 April 2026. [Google Scholar] [CrossRef]
Figure 1. Machine-learning model development and evaluation workflow for the classification of molecular drug-resistance profiles in Mycobacterium tuberculosis.
Figure 1. Machine-learning model development and evaluation workflow for the classification of molecular drug-resistance profiles in Mycobacterium tuberculosis.
Preprints 239121 g001aPreprints 239121 g001b
Table 1. Data audit and model-development summary.
Table 1. Data audit and model-development summary.
Metric Value
Total raw rows 2627
Culture-positive rows used 2430
Feature columns INHA_CT_VALUE, KATG_CT_VALUE, GYRA1_CT_VALUE, GYRA2_CT_VALUE, GYRA3_CT_VALUE, RRS_CT_VALUE, INHA_CT_VALUE_DETECTED, KATG_CT_VALUE_DETECTED, GYRA1_CT_VALUE_DETECTED, GYRA2_CT_VALUE_DETECTED, GYRA3_CT_VALUE_DETECTED, RRS_CT_VALUE_DETECTED, AGE_CLEAN, YEAR, DISTRICT_NAME, MICROSCOPY RESULT_CONFORMED, CULTURE RESULT_CONFORMED_1
CV folds 2
Optimisation method GridSearchCV
Binary CV scoring ROC-AUC
Multiclass CV scoring Weighted F1-score
Held-out test size 0.25
Random state 42
Hyperparameter tuning subset Stratified subset of training data where needed; selected parameters refit on full training set
Table 2. Distribution of binary molecular resistance classifications used as outcome labels.
Table 2. Distribution of binary molecular resistance classifications used as outcome labels.
Outcome Valid N Resistant n Susceptible n Resistance prevalence
INH 2,413 1,741 672 72.2%
FLQ 2,395 315 2,080 13.2%
ETH 2,430 755 1,675 31.1%
AMK 2,401 166 2,235 6.9%
CAP 2,412 166 2,246 6.9%
KAN 2,401 166 2,235 6.9%
Table 3. Distribution of multiclass molecular resistance-profile labels.
Table 3. Distribution of multiclass molecular resistance-profile labels.
Resistance profile N Percent
INH only 868 35.7%
No reported resistance 649 26.7%
INH + ETH 518 21.3%
FLQ-containing 229 9.4%
Injectable containing 166 6.8%
Table 4. Best hyperparameter-optimized binary model for each drug-resistance outcome.
Table 4. Best hyperparameter-optimized binary model for each drug-resistance outcome.
Outcome Best model Accuracy ROC-AUC Sensitivity Specificity Precision F1-score Balanced accuracy TN FP FN TP Test N
AMK Random Forest 0.987 0.999 0.833 0.998 0.972 0.897 0.916 558 1 7 35 601
CAP Extra Trees 0.987 0.994 0.805 1.000 1.000 0.892 0.902 562 0 8 33 603
ETH Random Forest 0.980 0.999 0.947 0.995 0.989 0.968 0.971 417 2 10 179 608
FLQ Random Forest 0.997 1.000 0.975 1.000 1.000 0.987 0.987 520 0 2 77 599
INH Random Forest 0.983 0.999 0.998 0.946 0.980 0.989 0.972 159 9 1 435 604
KAN Random Forest 0.987 0.999 0.833 0.998 0.972 0.897 0.916 558 1 7 35 601
TN = actual susceptible predicted susceptible; FP = actual susceptible predicted resistant; FN = actual resistant predicted susceptible; TP = actual resistant predicted resistant.
Table 5. Performance of hyperparameter-optimized multiclass molecular resistance-profile classification models.
Table 5. Performance of hyperparameter-optimized multiclass molecular resistance-profile classification models.
Model Accuracy Balanced accuracy Weighted precision Weighted recall Weighted F1 Weighted ROC-AUC OVR Best CV weighted F1 Test N
Logistic Regression 0.605 0.616 0.686 0.605 0.626 0.885 0.662 608
Decision Tree 0.893 0.906 0.897 0.893 0.894 0.975 0.698 608
Random Forest 0.984 0.972 0.984 0.984 0.983 0.999 0.845 608
Extra Trees 0.967 0.956 0.968 0.967 0.967 0.998 0.791 608
Gradient Boosting 0.944 0.934 0.945 0.944 0.944 0.987 0.867 608
Support Vector Machine 0.701 0.578 0.701 0.701 0.683 0.683 608
Neural Network / MLP 0.658 0.525 0.650 0.658 0.638 0.872 0.220 608
XGBoost 0.701 0.621 0.720 0.701 0.694 0.898 0.633 608
Table 6. The top three Ct-derived molecular predictors ranked by permutation feature importance for each binary resistance classification.
Table 6. The top three Ct-derived molecular predictors ranked by permutation feature importance for each binary resistance classification.
Outcome Best model Ct-derived driver Permutation importance means Permutation importance SD Scoring
AMK Random Forest RRS_CT_VALUE 0.1159 0.0098 roc_auc
AMK Random Forest GYRA3_CT_VALUE 0.0168 0.0013 roc_auc
AMK Random Forest INHA_CT_VALUE 0.0061 0.0021 roc_auc
CAP Extra Trees RRS_CT_VALUE 0.0542 0.0041 roc_auc
CAP Extra Trees GYRA3_CT_VALUE 0.0069 0.0000 roc_auc
CAP Extra Trees KATG_CT_VALUE 0.0059 0.0020 roc_auc
ETH Random Forest INHA_CT_VALUE 0.1148 0.0078 roc_auc
ETH Random Forest KATG_CT_VALUE 0.0146 0.0036 roc_auc
ETH Random Forest GYRA3_CT_VALUE 0.0145 0.0005 roc_auc
FLQ Random Forest GYRA3_CT_VALUE 0.0107 0.0001 roc_auc
FLQ Random Forest GYRA2_CT_VALUE 0.0084 0.0004 roc_auc
FLQ Random Forest RRS_CT_VALUE 0.0064 0.0008 roc_auc
INH Random Forest KATG_CT_VALUE 0.1201 0.0062 roc_auc
INH Random Forest INHA_CT_VALUE 0.0084 0.0018 roc_auc
INH Random Forest GYRA3_CT_VALUE 0.0083 0.0001 roc_auc
KAN Random Forest RRS_CT_VALUE 0.1159 0.0098 roc_auc
KAN Random Forest GYRA3_CT_VALUE 0.0168 0.0013 roc_auc
KAN Random Forest INHA_CT_VALUE 0.0061 0.0021 roc_auc
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.