Tuberculosis report case recent propagation prediction method based on machine learning
Through a machine learning-based method, using patient genomic information and environmental characteristics, we predict the recent transmission risk of reported cases of tuberculosis, solve the problem of lack of early warning and prediction capabilities in the existing technology, and realize effective prediction and prevention and control strategies for the transmission of tuberculosis. Formulate.
Patent Information
- Application Number
- CN202411475907.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-02-14
AI Technical Summary
The existing technology lacks early warning and prediction capabilities and cannot effectively predict the transmission mode of tuberculosis, especially in urban areas, making it difficult to formulate targeted prevention and control strategies.
Using a machine learning-based method, we use the method to collect patient genomic information, build a feature library, perform feature engineering, and train using the CATBoost model to predict the recent transmission risk of reported cases of tuberculosis.
The prediction of the transmission of tuberculosis is achieved, and individual and environmental factors leading to transmission can be identified, interpretable prediction results can be provided, and targeted prevention and control strategies can be helped to improve the efficiency of tuberculosis prevention and control in urban areas.
Smart Images

Figure CN119446564A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a reported case transmission prediction method, in particular to a reported case recent transmission prediction method for tuberculosis based on machine learning, belonging to the technical field of reported case transmission prediction methods. Background Art
[0002] my country's tuberculosis prevention and control system has established a daily monitoring and direct reporting system, but lacks early warning and prediction capabilities. The current targeted screening strategy mainly targets the incidence of tuberculosis. However, especially in urban areas, the incidence and transmission patterns of tuberculosis are obviously heterogeneous.
[0003] This is mainly because there are no localized and systematic studies on the spread of tuberculosis that include genomic analysis, making it impossible to determine the source of tuberculosis in the system. However, the cultivation of tuberculosis isolates is time-consuming and inefficient, the acquisition of sequencing data is relatively expensive, and the analysis process requires bioinformatics expertise, making it difficult to apply widely in situations with a high disease burden.
[0004] Machine learning technology has many applications in clinical auxiliary diagnosis. Some studies have used machine learning technology to understand the characteristics of cases and case clusters to predict which clusters are most likely to continue to grow above the baseline rate level. However, no study has used machine learning algorithms to perform binary predictions on whether tuberculosis patients will spread or not. Therefore, a method for predicting the recent spread of reported tuberculosis cases based on machine learning is designed to solve the above problem. Summary of the invention
[0005] The main purpose of the present invention is to provide a method for predicting the near-term spread of reported tuberculosis cases based on machine learning.
[0006] The purpose of the present invention can be achieved by adopting the following technical solutions:
[0007] A method for predicting the near-term spread of reported tuberculosis cases based on machine learning, comprising the following steps:
[0008] Step 1: Collect genomic information of patients with positive test results and determine the transmission relationship between patients based on bacterial genetic correlation;
[0009] Step 2: Construct feature library;
[0010] Step 3: Feature engineering using standardization and one-hot encoding of multi-class features;
[0011] Step 4: Whether the genome is clustered is used as a binary outcome variable;
[0012] Step 5: Use the trained classification model to classify the test set data and output the classification results;
[0013] Step 6: After tuning is completed, import the test set into the model, and evaluate the final performance of the model based on the model prediction results and actual results through the confusion matrix, using accuracy, precision, recall, F1 score and AUC indicators.
[0014] Preferably, in step 2, the strain number of the positive strain is matched with the medical record database to obtain demographic and epidemiological characteristics of the positive strain patients;
[0015] After geocoding the residential addresses of Peiyang patients, they were matched with an already integrated structured spatial database to obtain environmental characteristic information.
[0016] Preferably, the case database derived from the tuberculosis reporting system already contains information on the demographic and epidemiological characteristics of the patients;
[0017] Then, using the home address column, we converted the address into longitude and latitude through a written python script and Baidu / Amap API, matched the case with the spatial database through the geographic location and captured the patient's environmental data;
[0018] Each cultured strain has a corresponding strain number that corresponds to the case database. This strain number is used to match the results of whether each case is genomic clustered;
[0019] The outcome variable is whether or not the case is clustered. The features are divided into two parts: one is the personal features of the case, and the other is the environmental features obtained after matching with the spatial database.
[0020] Preferably, in step 3, feature engineering is performed by standardizing and one-hot encoding multi-class features, calculating the correlation between feature variables, and filtering out features with excessive collinearity;
[0021] Standardization: transform continuous data into a distribution with a mean of 0 and a standard deviation of 1;
[0022] One-hot encoding: Discrete data is encoded using an N-bit state register to encode N states, each state has its own independent register bit, and only one bit is valid at any time;
[0023] Correlation: Pearson correlation coefficient is used for judgment. If it is greater than 0.75, the collinearity is too high, and the variables with too high collinearity are deleted.
[0024] Preferably, in step 4, the CATBoost model is trained on the training set, and the hyperparameters of the CATBoost model are optimized using Bayesian optimization based on the AUC value to obtain the optimal parameters;
[0025] The entire data set is divided into a training set and a test set in a ratio of 8:2. On the training set, the CATBoost algorithm is used to build the model, and AUC is used as the prediction performance evaluation indicator. The five hyperparameters of maximum number of iterations, tree depth, learning rate, sample row sampling ratio, and sample column sampling ratio are tuned by Bayesian parameter tuning method, and the Early Stopping mechanism is set to prevent the model from overfitting.
[0026] Preferably, in step one, the patient transmission relationship is determined based on the bacterial genetic correlation by pairing two by two, with the SNPs distance being less than or equal to 12 as the standard for clustering / non-clustering judgment.
[0027] Preferably, the environmental data in matching the cases with the spatial database by geographic location and capturing the environmental data of the patients include socio-economic data such as population, GDP, road density, and environment data such as PM2.5 and NDVI, and the variables include continuous variables and categorical variables.
[0028] Preferably, the specific model of the algorithm used in step 4 is CATBoost in python.
[0029] Beneficial technical effects of the present invention:
[0030] The present invention provides a method for predicting the recent spread of reported tuberculosis cases based on machine learning. In urban areas, tuberculosis caused by transmission is often the cause of the high burden of tuberculosis in this area. How to use the daily monitoring data in the tuberculosis prevention and control system to predict the source of tuberculosis in the direct reporting system in advance is the core purpose of this study.
[0031] Patient case data usually has problems such as imbalance and collinearity, and also contains nonlinear data. The model we use can solve this problem well, and at the same time perform well when facing categorical data, and can obtain better prediction results, with overall good performance.
[0032] This study ranked the importance of the output feature variables while using the model for prediction, which can identify individual and environmental factors related to the spread of tuberculosis and make the prediction results interpretable. This is of great significance for the formulation of targeted prevention and control strategies. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 The present invention is a flowchart of a preferred embodiment of a method for predicting the near-term spread of reported tuberculosis cases based on machine learning according to the present invention.
[0034] Figure 2The present invention is a schematic diagram of a specific model building process according to a preferred embodiment of a method for predicting the recent spread of reported tuberculosis cases based on machine learning. DETAILED DESCRIPTION
[0035] In order to make the technical solution of the present invention more clear and specific to those skilled in the art, the present invention is further described in detail below in conjunction with embodiments and drawings, but the implementation manner of the present invention is not limited thereto.
[0036] like Figure 1-Figure 2 As shown, this embodiment provides a method for predicting the recent spread of reported tuberculosis cases based on machine learning, which collects genomic information of positive tuberculosis patients and analyzes the transmission relationship between patients based on bacterial genetic correlation.
[0037] Feature library construction: The Peiyang strain number is matched with the medical record database to obtain the demographic and epidemiological characteristics of Peiyang patients. After the residential address of Peiyang patients is geocoded, it is matched with the integrated structured spatial database to obtain environmental characteristics information.
[0038] The case database exported from the tuberculosis reporting system already contains the demographic and epidemiological characteristics of the patients. Then, using the home address column, the address is converted into longitude and latitude through the written python script and Baidu / AutoNavi API, and the case is matched with the spatial database (map, attribute table contains environmental data) through the geographic location and the patient's environmental data is captured. Each cultured strain has a corresponding strain number corresponding to the case database. After matching with this strain number, the result of whether each case is genotyped is obtained. In short, the outcome variable is whether it is clustered (gene), and there are two features, one is the personal characteristics of the case (demographic and epidemiological characteristics), and the other is the environmental characteristics obtained after matching with the map.
[0039] Feature Engineering: Use standardization and one-hot encoding for multi-class features. Calculate the correlation between feature variables and filter out features with high collinearity.
[0040] Standardization: Transform continuous data into a distribution with a mean of 0 and a standard deviation of 1.
[0041] One-hot encoding: Discrete data is encoded using an N-bit state register to encode N states. Each state has its own independent register bit, and only one bit is valid at any time. For example, occupation: ["A", "B", "C"], it will generate 3 columns ["A", "B", "C"]. In column A, all occupations are assigned 1 for A and 0 for others. The same applies to columns BC.
[0042] Correlation: Pearson correlation coefficient is used for judgment. If it is greater than 0.75, the collinearity is too high, and the variables with high collinearity are deleted.
[0043] Whether the genome is clustered is used as the binary outcome variable, and the CATBoost model (categorical gradient boosting) is trained on the training set. The hyperparameters of the CATBoost model are optimized using Bayesian optimization based on the AUC value (Area Under ROC curve) to obtain the optimal parameters.
[0044] The entire data set is divided into a training set and a test set in a ratio of 8:2. On the training set, the CATBoost algorithm is used to build the model, and AUC is used as the prediction performance evaluation indicator. The five hyperparameters of maximum number of iterations, tree depth, learning rate, sample row sampling ratio, and sample column sampling ratio are tuned through Bayesian optimization. At the same time, the Early Stopping mechanism is set to prevent the model from overfitting.
[0045] Use the trained classification model to classify the test set data and output the classification results.
[0046] After the tuning is completed, the test set is imported into the model. According to the model prediction results (whether it is clustered) and the actual results (whether it is clustered), the final performance of the model is evaluated using the accuracy, precision, recall, F1 score and AUC indicators through the confusion matrix.
[0047] Confusion Matrix
[0048]
[0049] TP: True positive, i.e., actual clusters are predicted as clusters; FN: False negative, i.e., actual clusters are predicted as non-clustered; FP: False positive, i.e., actual non-clustered are predicted as clustered; TN: True negative, i.e., actual non-clustered are predicted as non-clustered
[0050] The above description is only a further embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical solutions and concepts of the present invention within the scope disclosed by the present invention, which belong to the protection scope of the present invention.
Claims
1. A method for predicting the near-term spread of reported tuberculosis cases based on machine learning, characterized in that: The steps include: Step 1: Collect genomic information of patients with positive test results and determine the transmission relationship between patients based on bacterial genetic correlation; Step 2: Construct feature library; Step 3: Feature engineering using standardization and one-hot encoding of multi-class features; Step 4: Whether the genome is clustered is used as a binary outcome variable; Step 5: Use the trained classification model to classify the 10-fold cross-validation data of the training set and output the classification results; Step 6: After tuning is completed, import the test set into the model, and evaluate the final performance of the model based on the model prediction results and actual results through the confusion matrix, using accuracy, precision, recall, F1 score and AUC indicators.
2. The method for predicting the recent spread of reported tuberculosis cases based on machine learning according to claim 1, characterized in that: In step 2, the strain number of the positive strain is matched with the medical record database to obtain the demographic and epidemiological characteristics of the positive patients; After geocoding the residential addresses of Peiyang patients, they were matched with an already integrated structured spatial database to obtain environmental characteristic information.
3. The method for predicting the recent spread of reported tuberculosis cases based on machine learning according to claim 2, characterized in that: The case database derived from the tuberculosis reporting system already contains information on the demographic and epidemiological characteristics of the patients; Then, using the home address column, we converted the address into longitude and latitude through a written python script and Baidu / Amap API, matched the case with the spatial database through the geographic location and captured the patient's environmental data; Each cultured strain has a corresponding strain number corresponding to the case database. This strain number is used to match the whole genome sequencing data to obtain the result of whether each case is genomic clustered; The outcome variable is whether or not the case is clustered. The features are divided into two parts: one is the personal features of the case, and the other is the environmental features obtained after matching with the spatial database.
4. The method for predicting the recent spread of reported tuberculosis cases based on machine learning according to claim 1, characterized in that: In step 3, feature engineering is performed using standardization and one-hot encoding of multi-class features. Calculate the correlation between feature variables and filter out features with too high collinearity; Standardization: transform continuous data into a distribution with a mean of 0 and a standard deviation of 1; One-hot encoding: Discrete data is encoded using an N-bit state register to encode N states, each state has its own independent register bit, and only one bit is valid at any time; Correlation: Use the Pearson correlation coefficient for judgment. If it is greater than 0.75, the collinearity is too high, and the variables with too high collinearity are deleted.
5. The method for predicting the recent spread of reported tuberculosis cases based on machine learning according to claim 1, characterized in that: In step 4, the CATBoost model is trained on the training set, and the CATBoost model hyperparameters are optimized based on the AUC value using Bayesian optimization to obtain the optimal parameters; The entire data set is divided into a training set and a test set in a ratio of 8:
2. On the training set, the CATBoost algorithm is used to build the model, and AUC is used as the prediction performance evaluation indicator. The five hyperparameters of maximum number of iterations, tree depth, learning rate, sample row sampling ratio, and sample column sampling ratio are tuned by Bayesian parameter tuning method, and the Early Stopping mechanism is set to prevent the model from overfitting.
6. The method for predicting the recent spread of reported tuberculosis cases based on machine learning according to claim 1, characterized in that: In step 1, the disease transmission relationship is analyzed based on bacterial genetic correlation, and the clustering / non-clustering judgment is performed by pairing two by two, with the SNPs distance less than or equal to 12 as the standard.
7. The method for predicting the recent spread of reported tuberculosis cases based on machine learning according to claim 6, characterized in that: The environmental data of patients are captured by matching cases with spatial databases through geographic location, including socioeconomic data such as population, GDP, and road density, and environmental data such as PM2.5 and NDVI. The variables are divided into two types: continuous variables and categorical variables.
8. The method for predicting the recent spread of reported tuberculosis cases based on machine learning according to claim 7, characterized in that: The specific model of the algorithm used in step 4 is the CATBoost python package.
Citation Information
Cited By
Mycobacterium tuberculosis propagation relation detection system and application thereof
CN120048362A