Bone tuberculosis and suppurative bone infection identification model establishment method based on deep learning
By using the TabPFN model based on the Transformer architecture and mNGS diagnostic labels, combined with serum biomarkers, the challenge of early differentiation between STB and PSI was solved, achieving efficient and accurate diagnostic support, enhancing the model's interpretability and clinical reliability, and making it suitable for cross-platform clinical auxiliary diagnosis.
Patent Information
- Application Number
- CN202511377681.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-25
- Publication Date
- 2026-02-03
AI Technical Summary
Existing technologies struggle to accurately differentiate between spinal tuberculosis (STB) and purulent spinal infection (PSI) in the early stages. Traditional diagnostic methods lack specificity, leading to delayed diagnosis and untimely treatment.
Using the TabPFN model based on the Transformer architecture, combined with diagnostic tags confirmed by metagenomic next-generation sequencing (mNGS) and common serum biomarkers, we extracted patient data semantically and screened key variables to construct an interpretable deep learning model to distinguish between STB and PSI.
It achieves efficient and accurate early STB identification, provides immediate diagnostic support, improves the interpretability of diagnosis and the trustworthiness of clinical applications, and is suitable for cross-platform deployment of clinical auxiliary diagnostic systems.
Smart Images

Figure CN121459929A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and machine learning technology, and more specifically, to a method for establishing a deep learning-based model for differentiating between bone tuberculosis and purulent bone infection. Background Technology
[0002] Spinal tuberculosis (STB), also known as Pott's disease, is the most common form of skeletal tuberculosis, accounting for a large proportion of extrapulmonary tuberculosis cases. If left undiagnosed and untreated, it can lead to serious complications such as vertebral collapse, spinal deformities, and paraplegia. However, early diagnosis remains particularly challenging due to its insidious onset and nonspecific clinical presentations, often resembling purulent spinal infections (PSI) or malignancies. Many patients initially present with chronic back pain or mild systemic symptoms that do not immediately raise suspicion of tuberculosis. Furthermore, definitive etiological diagnosis often requires invasive procedures such as image-guided biopsy or open surgery to obtain tissue for microbiological or pathological examination. These challenges frequently lead to delays in diagnosis and treatment, ultimately impairing patient outcomes.
[0003] In clinical practice, when direct diagnosis is challenging, clinicians often rely on ancillary examinations and biomarkers. Serological inflammatory markers, such as erythrocyte sedimentation rate (ESR) and C-reactive protein (CRP), which are often elevated in spinal tuberculosis, are used to monitor disease activity. However, these markers have limited diagnostic value due to their lack of specificity. Immunological tests, including the tuberculin skin test (TST) and interferon-gamma release test (IGRA), can indicate sensitization to Mycobacterium tuberculosis, but cannot distinguish active STB from latent infection or TB in other sites. Therefore, while these tests may support clinical suspicion, they are insufficient for definitive diagnosis or differentiation from other spinal diseases. Imaging techniques, such as computed tomography (CT) and magnetic resonance imaging (MRI), offer higher diagnostic efficacy; however, they still cannot reliably distinguish between STB and PSI. Therefore, developing novel diagnostic tools capable of accurately differentiating STB and PSI early is crucial for both clinicians and patients.
[0004] In recent years, machine learning (ML) has shown great potential in infectious disease diagnosis, particularly in analyzing complex clinical data and identifying subtle diagnostic patterns. A machine learning model based on routine laboratory parameters was developed to differentiate between active tuberculosis and latent infection. Kenneth A. McLean and colleagues constructed a multimodal neural network integrating patient-reported outcomes (PROMs) and imaging data to predict surgical site infection within 48 hours. Commonly used machine learning algorithms, such as decision trees, support vector machines (SVMs), random forests (RF), and gradient boosting classifiers (GBCs), have demonstrated high sensitivity and specificity in biomarker-based tuberculosis diagnosis. However, these traditional methods typically require large-scale datasets, which may limit their applicability in real-world clinical settings.
[0005] Due to the nonspecificity of clinical symptoms and the limitations of traditional diagnostic methods, early diagnosis of spinal tuberculosis (STB) remains challenging. Accurate differentiation of spinal purulent infection (PSI) is crucial for timely intervention and improved patient prognosis. Summary of the Invention
[0006] To overcome the aforementioned deficiencies in existing technologies, this invention provides a method for establishing a deep learning-based model to differentiate between bone tuberculosis and purulent bone infection (PSI). It offers a novel interpretable deep learning model based on the Transformer architecture, utilizing metagenomic next-generation sequencing (mNGS)-confirmed diagnostic tags to distinguish between STB and PSI. The TabPFN model provided in this application, by utilizing mNGS-confirmed diagnostic tags and common serological biomarkers, not only demonstrates strong diagnostic accuracy but also possesses interpretability for early STB identification, providing clinicians with immediate early diagnostic decision support. This application is the first to apply the TabPFN model to the diagnosis of spinal tuberculosis, providing an efficient and accurate tool and laying a solid foundation for future AI-assisted clinical diagnostic research.
[0007] The above-mentioned technical objective of this invention is achieved through the following technical solution: a method for establishing a differentiation model between bone tuberculosis and purulent bone infection based on deep learning, comprising the following steps:
[0008] S1. Sample and Feature Collection: The Transformer model is used to extract semantics from unstructured texts such as patients' electronic medical records, admission records, laboratory tests, and progress notes to automatically identify suspected spinal infection patients and preliminarily screen potential key variables as feature prompts; combined with structured data, a unified input matrix is constructed for subsequent modeling.
[0009] S2. Pathogen analysis: Metagenomic sequencing and bioinformatics analysis are performed on pathological samples to identify infectious pathogens, which are used as diagnostic labels for model training.
[0010] S3. Variable selection: After standardization, the characteristic variables were used to select 8 key predictors with significant diagnostic differences using LASSO regression combined with cross-validation.
[0011] S4. Model Development: Based on the selected variables, construct multiple models including TabPFN, RF, GBC, ABC, XGB, and LGB, and optimize hyperparameters through cross-validation;
[0012] S5. Model Training and Performance Evaluation: Model training and evaluation are conducted on the training set and independent validation set. The model performance is comprehensively evaluated through ROC curves, accuracy, sensitivity and specificity metrics.
[0013] S6. Model Interpretability Analysis: The SHAP method is introduced to explain the prediction mechanism of the TabPFN model, clarify the contribution of each variable to the diagnostic results, and perform individual prediction interpretation.
[0014] Furthermore, in step S5, in order to quantify the uncertainty of performance estimation, the 95% confidence interval of each metric is calculated by bootstrap resampling.
[0015] Furthermore, a web interface based on Streamlit was built to automatically output STB / PSI prediction results after clinicians input key variables, which can be used for real-time auxiliary diagnosis.
[0016] Furthermore, statistical tests and visualization analyses were performed using R and Python to ensure the statistical significance and reproducibility of the results.
[0017] In summary, the present invention has the following beneficial effects:
[0018] (1) This application is the first to apply the TabPFN model to the differential diagnosis of spinal infections:
[0019] TabPFN is a pre-trained model based on the Transformer architecture, designed for small sample tabular data, which can perform efficient and accurate diagnostic predictions without the need for large-scale training data or parameter tuning.
[0020] (2) Introducing metagenomic sequencing (mNGS) as a highly reliable diagnostic label:
[0021] Overcome the low sensitivity of traditional culture / pathology methods and improve the clinical representativeness of model training data, especially covering culture-negative but confirmed cases.
[0022] (3) Interpretable AI model design:
[0023] By using the SHAP method to interpret deep models at both the global and individual levels, doctors can enhance their understanding and trust in the model's predictions, thus overcoming the bottleneck of "black box models" in clinical applications.
[0024] (4) Cross-platform deployed clinical auxiliary diagnostic systems:
[0025] The development of interactive web tools that can be integrated into hospital systems to enable real-time input and automatic diagnosis of serum indicators has good potential for promotion and transformation value.
[0026] (5) Lightweight modeling approach adapted to clinical practice:
[0027] By focusing on eight routine laboratory indicators as input features, the threshold for clinical sampling and model deployment is lowered, enabling AI tools to have the practical value of being "quick to learn and easy to integrate". Attached Figure Description
[0028] Figure 1 This is a flowchart of the model development process for a method of establishing a differentiation model between bone tuberculosis and purulent bone infection based on deep learning, as described in Embodiment 1 of the present invention.
[0029] Figure 2 This is a predictive feature selection diagram for STB diagnosis in an embodiment of the present invention;
[0030] Figure 3 This is a graph showing the model performance comparison and classification results of the training and validation sets in an embodiment of the present invention;
[0031] Figure 4 This is a schematic diagram illustrating the global interpretation of the TabPFN model using SHAP values in an embodiment of the present invention;
[0032] Figure 5 This is a schematic diagram illustrating the local interpretation and interaction effects of the TabPFN model using SHAP in an embodiment of the present invention. Detailed Implementation
[0033] The following is in conjunction with the appendix Figure 1-4 The present invention will be described in further detail below.
[0034] Example 1: A method for establishing a deep learning-based model to differentiate between bone tuberculosis and purulent bone infection, comprising the following steps:
[0035] S1. Sample and Feature Collection: The Transformer model is used to extract semantics from unstructured texts such as patients' electronic medical records, admission records, laboratory tests, and progress notes to automatically identify suspected spinal infection patients and preliminarily screen potential key variables as feature prompts; combined with structured data, a unified input matrix is constructed for subsequent modeling.
[0036] S2. Pathogen Analysis: Metagenomic sequencing and bioinformatics analysis are performed on pathological samples to identify infectious pathogens, which are then used as diagnostic labels for model training, as detailed below:
[0037] Samples obtained via percutaneous biopsy or open surgery were sealed under aseptic conditions and stored at -20°C or transported with dry ice to Hugobiotech Co., Ltd. in Beijing for metagenomic sequencing analysis. DNA was extracted from the samples using the QIAamp DNA MicroKit (QIAGEN, Hilden, Germany) according to the manufacturer's instructions. DNA libraries were constructed using the QIAseq™ Illumina Ultra-Low Input Library Construction Kit (QIAGEN, Hilden, Germany) according to the manufacturer's instructions. The quality and quantity of each library were evaluated using a Qubit fluorometer from Thermo Fisher Scientific (Massachusetts, USA) and an Agilent 2100 Bioanalyzer from Agilent Technologies (Palo Alto, USA). Only libraries meeting quality standards were sequenced on the Nextseq 550 platform (Illumina, San Diego, USA), with a target of approximately 20 million 75 bp single-end reads per library.
[0038] Bioinformatics analysis was performed on the sequencing data to identify potential pathogens. First, low-quality reads were filtered out, and human host reads were removed using SNAP software by alignment with the human reference genome (hg38). Next, the remaining reads were aligned to a comprehensive database containing genomes of over 30,000 microorganisms (including bacteria, viruses, fungi, and parasites) using the Burrows-Wheeler alignment algorithm. Candidate pathogens were identified based on predefined thresholds for genome coverage and relative abundance (in RPMs per million reads).
[0039] S3. Variable selection: After standardization, the characteristic variables were used to select 8 key predictors with significant diagnostic differences using LASSO regression combined with cross-validation.
[0040] In this process, continuous variables are standardized using a min-max scaling method. Then, the lasso (minimum absolute shrinkage and selection operator) regression method from the glmnet package, combined with 10-fold cross-validation, is used to select a set of key features. Finally, the optimal feature set is determined by applying the cross-validation results to a single standard error rule.
[0041] S4. Model Development: Based on the selected variables, construct multiple models including TabPFN, RF, GBC, ABC, XGB, and LGB, and optimize hyperparameters through cross-validation;
[0042] S5. Model Training and Performance Evaluation: Model training and evaluation are conducted on the training set and independent validation set. The model performance is comprehensively evaluated through ROC curves, accuracy, sensitivity and specificity metrics.
[0043] All the model predictions and class probabilities mentioned above were obtained using scikit-learn.
[0044] S6. Model Interpretability Analysis: The SHAP method is introduced to explain the prediction mechanism of the TabPFN model, clarify the contribution of each variable to the diagnostic results, and perform individual prediction interpretation.
[0045] SHAP values were calculated using the SHAP library in Python, with batch processing to manage memory and saving intermediate results to prevent data loss. SHAP analysis provides insights into feature contribution through various charts, including global feature importance, individual feature dependencies, and force graphs for specific cases.
[0046] Furthermore, in step S5, in order to quantify the uncertainty of performance estimation, the 95% confidence interval of each metric is calculated by bootstrap resampling.
[0047] Furthermore, a web interface based on Streamlit was built to automatically output STB / PSI prediction results after clinicians input key variables, which can be used for real-time auxiliary diagnosis.
[0048] This platform allows clinicians to input patient parameters through an interactive interface and obtain real-time prediction results from the TabPFN model. Output includes the predicted probability of STB (compared to PSI) and the classification decision based on preset thresholds. The interface design prioritizes user-friendliness and features robust error handling mechanisms to ensure system reliability and a good user experience.
[0049] Furthermore, statistical tests and visualization analyses were performed using R and Python to ensure the statistical significance and reproducibility of the results.
[0050] Categorical variables were described by frequency and percentage, and compared using the chi-square test. Continuous variables were presented as mean ± standard deviation when normally distributed, and as median and interquartile range (IQR) when non-normally distributed. For comparisons of continuous data, t-tests were used for normally distributed variables, and Wilcoxon rank-sum tests were used for non-normally distributed variables. All tests were two-tailed, and a p-value less than 0.05 was considered statistically significant.
[0051] Example 2:
[0052] Trial validation: This application included 342 patients (median age 59 years, 142 females) from four hospitals. All patients were diagnosed with STB or PSI by mNGS (metagenomic sequencing). Of these, 151 were diagnosed with STB and 191 with PSI. Detailed baseline clinical characteristics of the 342 patients are shown in Table 1.
[0053] Patients in Hospital 1 (n = 217) were used as the training set, while patients in Hospitals 2, 3, and 4 (n = 125) were used as the external validation set. Figure 1 Table 1 presents a comparative analysis of the STB group and the PSI group in terms of age, sex, IGRA test results, routine blood cell counts, liver and kidney function, coagulation parameters, and inflammatory markers. The results showed significant differences between the two groups in IGRA positivity rate, lymphocyte count, monocyte percentage, albumin / globulin ratio (A / G), prothrombin time (PT), activated partial thromboplastin time (APTT), D-dimer, and erythrocyte sedimentation rate (ESR) (P < 0.05). However, there were no significant differences in overall clinical characteristics between the training and validation sets (P > 0.05), indicating that the two groups were comparable, as shown in Table 1 below.
[0054] Table 1: Basic Information Table of Included Case Samples
[0055]
[0056]
[0057] * Comparative analysis between the STB group and the PSI group was performed using the t-test, Mann-Whitney U test, or chi-square test.
[0058] † Use the Mann-Whitney U test or chi-square test to perform comparative analysis between the training and validation sets.
[0059] Data are expressed as median (interquartile range: Q25, Q75), mean ± standard deviation, or number of cases (percentage).
[0060] The full names of the abbreviations in the table are as follows: interferon-γ release assays (IGRAs), white blood cell (WBC), red blood cell (RBC), hemoglobin (HGB), platelet (PLT), neutrophil (Neut), lymphocyte (lymph), eosinophil (EO), basophil (BASO), monocyte (Mono), neutrophil % (Neut%), lymphocyte % (Lymph%), basophil % (BASO%), eosinophil% (Eo%), monocyte % (Mono%), red blood cell distribution width (RDW), platelet volume (PCT), mean platelet volume (MPV), total protein (TP), albumin (A), globulin (G), albumin / globulin (AG), alanine aminotransferase (ALT), aspartate aminotransferase (AST), blood urea nitrogen (BUN), creatinine (Cr), triglyceride (TG), cholesterol (Chol), high-density lipoprotein (HDL), low-density lipoprotein (LDL), glucose (BS), prothrombin time (PT), activated partial thromboplatin time (APTT), international normalized ratio (INR), D dimer (DD), erythrocyte sedimentation rate (ESR), C-reactive protein (CRP).
[0061] As Figure 1 shown in the figure:
[0062] (A) Population and variables: 342 patients were divided into a training set (n = 217) and a validation set (n = 125). Clinical variables, including basic information, laboratory test results and IGRA levels, were collected and a feature matrix was constructed.
[0063] (B) mNGS-based labeling: Samples are obtained through biopsy or surgery and mNGS testing is performed to identify the pathogen. Based on the sequencing results, the patient is labeled as STB or PSI.
[0064] (C) Model Development: First, LASSO regression was used for feature selection, followed by five-fold cross-validation to optimize the hyperparameters. The final model was trained on the complete training set.
[0065] (D) Evaluation and Interpretation: Model performance is evaluated using ROC curves and confusion matrices. Feature contributions are interpreted using SHAP summary plots. The trained model is deployed via the user-friendly TabPFN web application.
[0066] like Figure 2 As shown, to evaluate the predictive power of each variable for STB diagnosis, we first plotted the ROC curves for all 35 candidate variables. Figure 2 A), and calculated their corresponding area under the curve (AUC) values ( Figure 2 B). The results showed that IGRA had the highest individual diagnostic performance (AUC = 0.78), while the AUC values of other variables were relatively low (< 0.70). Correlation heatmaps revealed significant collinearity among several clinical variables. Figure 2 C). To address the multicollinearity problem, we applied LASSO (Least Absolute Contraction and Selection) regression to these 35 features, ultimately identifying eight key predictors: IGRA, PT, hemoglobin (HGB), C-reactive protein (CRP), red blood cell count (RBC), lymphocyte count, albumin (A), and monocyte ratio (CRP). Figure 2 (D and 2E). These features were used in the development of the model.
[0067] Figure 2 (A) Receiver Operating Characteristic (ROC) curves for all 35 candidate variables. (B) Area Under the Curve (AUC) value for each variable. (C) Correlation heatmap among clinical variables. (D) Relationship between Lasso coefficient curves and logarithm (λ) for the 35 variables. (E) Ten-fold cross-validation was used for Lasso regression. The optimal λ value was selected by minimizing binomial bias, ultimately determining eight variables (IGRA, PT, lymphocyte count, RBC, HGB, monocyte count, CRP, and albumin) for model construction.
[0068] like Figure 3 As shown, this application utilizes a training set containing 217 samples to construct six machine learning models: TabPFN, RF, GBC, ABC, XGB, and LGM, to distinguish between STB and PSI. The performance of these models on the training set and the external validation set (a total of 125 samples) was evaluated. The ROC curves for the training and validation sets are shown below. Figure 3 A and Figure 3 C, and the corresponding AUC values were calculated. The optimal cutoff values for predictions were determined on the training set using the Youden index, and confusion matrices were generated based on these thresholds (see all confusion matrices in the supplementary materials for details). All models performed well on the training set (AUC = 0.90–0.99), but their performance on the external validation set decreased, though it remained satisfactory. Notably, the TabPFN model achieved the highest AUC value (AUC = 0.87) on the external validation cohort, and its confusion matrix can be found in [link to relevant documentation]. Figure 3 B (training) and Figure 3 D (Validation). Therefore, TabPFN was selected as the final model for further interpretation and clinical application.
[0069] Figure 3 (A) ROC curves of the six models in the training set. The TabPFN model achieves an AUC of 0.902, comparable to other ensemble models. (B) TabPFN confusion matrix in the training set. (C) ROC curves in the validation set. TabPFN exhibits the best generalization performance (AUC = 0.870). (D) TabPFN confusion matrix in the validation set, showing a balanced sensitivity and specificity.
[0070] like Figure 4 As shown, to clarify the prediction mechanism of the final TabPFN model, we employ the Schapley Additive Interpretation (SHAP) to evaluate the importance of features. Figure 4 As shown in Figure A, the importance of global features was ranked according to the mean absolute SHAP value. The top-ranked features included IGRA, prothrombin time (PT), lymphocyte count, red blood cell count (RBC), hemoglobin (HGB), monocyte ratio, C-reactive protein (CRP), and albumin. Figure 4 B presents a SHAP summary plot of the TabPFN model, which details the distribution of each feature and its impact.
[0071] like Figure 5 As shown, this application also utilizes SHAP values for individual-level predictive analysis. For example, patient A is a true STB case with a SHAP value of +0.58, exceeding the baseline threshold, thus correctly predicting STB ( Figure 5A). Conversely, patient B is a true case of PSI with a SHAP value of −0.42, below the threshold, and is correctly classified as PSI. Figure 5 B). Furthermore, we generated a SHAP dependency graph to visualize the relationship between feature values and their corresponding SHAP contributions, further demonstrating how each variable influences the model's predictions. Figure 5 C). A network-based TabPFN model is used for clinical decision support. Users can input eight selected clinical variables (IGRAs, RBC, HGB, A, lymphocytes, monocytes, PT, and CRP) to obtain real-time predictions of spinal tuberculosis and purulent spinal infections. Figure 5 D).
[0072] In summary, this application constructs an interpretable deep learning model (STBNet) based on the TabPFN architecture. This model can accurately and efficiently distinguish between spinal tuberculosis and purulent spinal infections using only routine laboratory data. By using mNGS-confirmed cases as training samples, the limitations of traditional culture standards are overcome, improving the representativeness and clinical relevance of the data. The TabPFN model outperforms traditional machine learning methods in external validation, demonstrating strong generalization ability. Through SHAP analysis, the diagnostic logic behind the model's predictions is clarified, particularly the roles of IGRA, CRP, and PT, thereby improving transparency and clinical confidence. An easy-to-use web application is deployed to further support clinical application. This application not only provides clinicians with a practical AI-assisted diagnostic tool but also offers valuable reference for the application of AI in medical diagnosis, potentially promoting future clinical decision-making.
[0073] This specific embodiment is merely an explanation of the present invention and is not intended to limit the invention. After reading this specification, those skilled in the art can make modifications to this embodiment without contributing any inventive step, but such modifications are protected by patent law as long as they are within the scope of the claims of the present invention.
Claims
1. A method for establishing a deep learning-based model for differentiating between bone tuberculosis and purulent bone infection, characterized in that, Includes the following steps: S1. Sample and Feature Collection: The Transformer model is used to extract semantics from unstructured texts such as patients' electronic medical records, admission records, laboratory tests, and medical records to automatically identify suspected spinal infection patients and preliminarily screen potential key variables as feature prompts. By combining structured data, a unified input matrix is constructed for subsequent modeling. S2. Pathogen analysis: Metagenomic sequencing and bioinformatics analysis are performed on pathological samples to identify infectious pathogens, which are used as diagnostic labels for model training. S3. Variable selection: After standardization, the characteristic variables were used to select 8 key predictors with significant diagnostic differences using LASSO regression combined with cross-validation. S4. Model Development: Based on the selected variables, construct multiple models including TabPFN, RF, GBC, ABC, XGB, and LGB, and optimize hyperparameters through cross-validation; S5. Model Training and Performance Evaluation: Model training and evaluation are conducted on the training set and independent validation set. The model performance is comprehensively evaluated through ROC curves, accuracy, sensitivity and specificity metrics. S6. Model Interpretability Analysis: The SHAP method is introduced to explain the prediction mechanism of the TabPFN model, clarify the contribution of each variable to the diagnostic results, and perform individual prediction interpretation.
2. The method for establishing a deep learning-based model for differentiating bone tuberculosis from purulent bone infection according to claim 1, characterized in that, In step S5, in order to quantify the uncertainty of performance estimation, the 95% confidence interval of each metric is calculated by bootstrap resampling.
3. The method for establishing a deep learning-based model for differentiating bone tuberculosis from purulent bone infection according to claim 1, characterized in that, We built a Streamlit-based web interface to automatically output STB / PSI prediction results after clinicians input key variables, which can be used for real-time auxiliary diagnosis.
4. The method for establishing a deep learning-based model for differentiating bone tuberculosis from purulent bone infection according to claim 1, characterized in that, Use R and Python to perform statistical tests and visualization analysis to ensure the statistical significance and reproducibility of the results.