Application of collaborative training shared multi-model based on blood routine in the classification of pulmonary tuberculosis
Through shared multi-model collaborative training based on blood routine, semi-supervised learning using labeled and unlabeled data solves the problems of small data volume and poor accuracy in tuberculosis classification, and achieves efficient model construction and highly interpretable classification effects.
Patent Information
- Application Number
- CN202410135784.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-31
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2044-01-31
AI Technical Summary
The existing technology has problems in pulmonary tuberculosis classification, such as difficulty in obtaining standard medical data, small amount of data, complicated training process of traditional semi-supervised model, and high time and cost for doctors to confirm the data.
A collaborative training shared multi-model based on blood routine is used to build a model through a multi-layer perceptron neural network. Labeled and unlabeled data are used for semi-supervised learning to build a model for tuberculosis classification.
Building a model with a small amount of standard data solves the problems of poor accuracy and small number of data in medical data sets. The model has strong interpretability, low difficulty in obtaining data, and high applicability.
Smart Images

Figure CN117828478B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data classification, and in particular to an application of a collaborative training shared multi-model based on blood routine in the classification of pulmonary tuberculosis. Background Art
[0002] Currently, more and more technologies are being applied to tuberculosis classification. However, most of the existing related technologies are based on artificial intelligence algorithms to predict and identify diseases. However, this method has the following disadvantages when applied to the medical industry:
[0003] First, standard medical data is difficult to obtain. Medical data is different from traditional data forms. Most of them are jointly produced by hospitals or published by hospitals for learning and discussion. They are difficult to obtain naturally and the amount of data is small.
[0004] Second, the traditional semi-supervised model cannot be end-to-end. It needs to train the trained model on supervised data and then use the saved model to predict unlabeled data. The training process is complicated.
[0005] Third, medical data requires the cooperation of doctors to organize and confirm the data, and doctors have many years of clinical experience, which spans a long time, is costly, and has poor sample accuracy. Summary of the invention
[0006] The purpose of the present invention is to provide an application of a collaborative training shared multi-model based on blood routine in the classification of tuberculosis, to solve the problem of the small number of standard data samples, and to adopt a semi-supervised model construction method. The model can be constructed through a small amount of standard data, which solves the problems of poor accuracy of medical data sets and small amount of acquired data.
[0007] To achieve the above object, the present invention provides an application of a collaborative training shared multi-model based on blood routine in the classification of pulmonary tuberculosis, comprising the following steps:
[0008] (1) Obtain a routine blood test data set, including a labeled standard data set S1 and an unlabeled non-standard data set S2. The data ratio of the labeled standard data set S1 to the unlabeled non-standard data set S2 is 1:11. The negative-to-positive ratio in the labeled standard data set S1 is 2:1. It is impossible to determine the negative and positive in the unlabeled non-standard data set S2.
[0009] The validation set Y contains verified positive and negative data, and the ratio of the validation set Y to the labeled standard data set S1 is 1:10;
[0010] (2) A collaborative training shared multi-model based on routine blood test data is constructed through a multi-layer perceptron neural network. The specific operations are as follows:
[0011] Build multiple models, including basic model, mode1_1, mode1_2, mode1_3;
[0012] The labeled standard data set S1 is input into the basic model, mode1_2, and mode1_3 network models respectively, and the unlabeled non-standard data set S2 is input into the basic model and mode1_1 network models respectively. The basic model network has two inputs, and the network parameters are trained at the same time;
[0013] The output of the basic mode1 input of the labeled standard dataset S1 is pred_1; the output of the basic model input of the unlabeled non-standard dataset S2 is pred_2; the output of mode1_1 input of the unlabeled non-standard dataset S2 is pred_3; the output of mode1_2 input of the labeled standard dataset S1 is pred_4; the output of mode1_3 input of the labeled standard dataset S1 is pred_5;
[0014] The collaborative training shared multi-model based on blood routine is trained by using the labeled standard dataset S1 and the unlabeled non-standard dataset S2, and the basic model is retained, that is, the collaborative training shared multi-model of the trained blood routine data;
[0015] (3) Use the trained collaboratively trained shared multi-model based on blood routine to verify the validation set Y.
[0016] Preferably, in step (1), the label of the labeled standard dataset S1 is whether there is tuberculosis; the unlabeled non-standard dataset S2 is a dataset that complies with the medical AI industry; the validation set Y is validation data that does not belong to the dataset S1 and the dataset S2, and contains the correct label of whether there is tuberculosis disease.
[0017] Preferably, in step (2), the basic mode 1 is constructed by a 7-layer network;
[0018] Mode1_1 is constructed by a 6-layer network. The parameters of the first 2 layers are shared with the basic model. The last 4 layers are the same as the 3rd, 4th, 5th, and 7th layers of the basic model, but they do not share parameters and have independent parameters.
[0019] Mode1_2 is constructed by a 6-layer network. The first 4 layers have the same network structure as the basic model and share parameters. The 5th and 6th layers have the same network structure as the 5th and 7th layers of the basic model and have independent parameters.
[0020] mode1_3 is constructed by an 8-layer network. The network structure of the first 4 layers is the same as the first 4 layers of the basic model, and the parameters are shared. The network structure of the 5th and 6th layers is the same as that of model_2, and the parameters are shared; the 7th and 8th layers have independent parameters.
[0021] Preferably, the label of pred_1 and the labeled standard data set S1 is calculated using bce_loss; pred_1 and pred_2 are calculated using the mse loss function; pred_3 and pred_4 are calculated using the ed loss function; pred_4 and pred_5 are calculated using the mse loss function. Preferably, the calculation methods of bce_loss, mse loss function, and ed loss function are as follows:
[0022] bce_loss:
[0023] L=-(y*log(p)+(1-y)*log(1-p))
[0024] Among them, y is the true label, and p is the label value of the predicted result;
[0025] MSE loss function:
[0026]
[0027] Among them, f(x) is the prediction result of the model, and y1 is the label of whether the sample is positive or negative;
[0028] ed loss function:
[0029]
[0030] Among them, x i and i are the true label of the sample and the output result of the model respectively; i is each sample individual; n is the total number of samples; X is category X, which specifically refers to the label category; Y is category Y, which specifically refers to the model output.
[0031] Therefore, the present invention adopts the above-mentioned collaborative training shared multi-model based on blood routine in the application of tuberculosis classification, and its technical effects are as follows:
[0032] (1) The routine blood test data is used as training data to build the model. Routine blood test data is easy to obtain, has high universality, is simple to classify, and has strong model interpretability.
[0033] (2) A semi-supervised model construction method is adopted, and the model can be built using a small amount of standard data, which solves the problems of poor accuracy of medical data sets and small amount of data obtained.
[0034] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A flowchart of the application of the collaborative training shared multi-model based on blood routine in the classification of pulmonary tuberculosis of the present invention;
[0036] Figure 2 It is a schematic diagram of the DNN model structure;
[0037] Figure 3 Co-training network structure for multiple models. DETAILED DESCRIPTION
[0038] The technical solution of the present invention is further described below through the accompanying drawings and embodiments.
[0039] Unless otherwise defined, technical or scientific terms used in the present invention shall have the common meanings understood by one having ordinary skills in the field to which the present invention belongs.
[0040] Embodiment 1
[0041] like Figure 1 As shown, it is a flowchart of the application of a collaborative training shared multi-model based on blood routine in the classification of pulmonary tuberculosis of the present invention, which specifically includes the following steps:
[0042] Step 1: Use the blood routine data set obtained from the Second Central Hospital of Baoding, including a small number of standard data sets S1 with labels, of which data set S1 has 530 tuberculosis positive data and 988 tuberculosis negative data; and a large number of non-standard data sets S2 without labels, data set S2 has a total of 13724 mixed negative and positive data, and a validation set Y used to verify the effect of the algorithm, validation set Y has 100 verified positive and negative data;
[0043] Step 2: Establish a multi-branch collaborative training neural network model such as Figure 3 As shown, data set S1 is input from the basic model, model_2, and model_3 respectively, and data set S2 is input from the basic model and model_1 respectively. Each model is constructed in the above manner, and the outputs are pred_1, ...pred_5 respectively. Various loss functions are calculated respectively. If the parameters are the same during the model construction process, the parameters are optimized together. If they are independent parameters, the parameters are optimized separately. Figure 3The model in the above example constructs L layers. The upper right subscript of L indicates whether it is an independent layer, and the lower right subscript indicates which layer it is. The training process uses datasets S1 and S2 to train the model. The Keras model.fit interface is used to fill in data training. The training is iterated 300 times, with a batch size of 30 each. After training, only the basic model is retained.
[0044] Step 3: Load the retained base model and make predictions on the validation set Y to obtain the results of the semi-supervised model.
[0045] In step 2:
[0046] 2a) Use the validation set to test the difference between the fully supervised model and the semi-supervised model through the 200-item standard dataset Y;
[0047] 2b) 22 items of blood routine test and 24-dimensional features of gender and age are put into the network for training, specifically gender, age, WBC, RBC, PDW, MCV, NEUT%, LYMPH%, EO%, BASO%, NEUT, LYMPH, BASO, HGB, HCT, MCH, MCHC, R-CV, PLT, MPV, PCT, MONO, MONO%, EO, a total of 24-dimensional features;
[0048] 2c) Disrupt the data order to prevent the model from learning sequential features;
[0049] 2d) Divide the dataset S1 into 8:2, which is the ratio of the training set to the validation set. Put all the dataset S2 into the model and model_1 models as input regardless of the ratio.
[0050] 2e) Use Keras to build a multi-branch collaborative training shared model with the following structure: Figure 2 As shown, the data initialization method of all layers is uniform, the data initialization method is uniform, and the activation function is Relu. The function formula is as follows:
[0051] φ(x)=max(0,x)
[0052] Among them, x is the input of the data; φ(x) is the output of the Relu function.
[0053] The activation function of the last layer of classification network is Sigmoid, and the function formula is as follows:
[0054]
[0055] Among them, x is the input data, It is the output of the Sigmoid function.
[0056] 2f) During the model training process, the loss functions are binary cross entropy loss function, ed distance function, and mse loss function, and the optimizer is Adam. The Adam method is as follows:
[0057] 1. Initialize model parameters θ and gradient cache variables S and R;
[0058] 2. For each iteration step t=1,2,..., perform the following operations:
[0059] A. Randomly extract a small batch of samples X from the training set t and other corresponding labels y t ;
[0060] B. Calculate the gradient information g of small batch samples t ;
[0061] C. Update the first moment estimate vector S t and the second moment estimate vector R t ;
[0062] D. Calculate the gradient information g' after bias correction t ;
[0063] E. Update model parameters θ.
[0064] The specific algorithm process is as follows:
[0065] a) Calculate gradient information:
[0066]
[0067] In the formula, J(θ,X T ,y t ) represents the objective function, X t and t denote the features and labels of samples from a mini-batch, respectively.
[0068] b) Calculate the first moment estimate vector S t and the second moment estimate vector R t :
[0069] S t =β1S t-1 +(1-β1)g t
[0070]
[0071] In the formula, S t represents the first moment estimation vector, R t represents the second moment estimation vector; β1 and β2 are the decay rates, usually taking values of 0.9 and 0.999.
[0072] c) Calculate the gradient information g after bias correction t ':
[0073]
[0074]
[0075]
[0076] In the formula, and They represent the first moment estimation vector and the second moment estimation vector after bias correction respectively; α represents the learning rate, and ε is the smoothing term, which is usually set to 10 -8 , used to prevent division by 0;
[0077] d) Update model parameters:
[0078] θ t+1 =θ t -g t '
[0079] θ t+1 is the model parameter of the next moment;
[0080] The comparison of the results of the semi-supervised model and the fully supervised model of the present invention is shown in Table 1:
[0081] Table 1 Results comparison
[0082] Model TPR TNR ACC Semi-supervised model (this invention) 0.616 0.837 0.726 Fully supervised model 0.536 0.795 0.650
[0083] Therefore, the present invention adopts the above-mentioned collaborative training shared multi-model based on blood routine in the classification of tuberculosis to solve the problem of small number of standard data samples, and adopts a semi-supervised model construction method. The model can be constructed through a small amount of standard data, which solves the problems of poor accuracy of medical data sets and small amount of acquired data.
[0084] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that they can still modify or replace the technical solution of the present invention with equivalents, and these modifications or equivalent replacements cannot cause the modified technical solution to deviate from the spirit and scope of the technical solution of the present invention.
Claims
1. An application of collaborative training shared multi-model based on blood routine in tuberculosis classification, characterized in that: The following steps are involved: (1) Obtain a routine blood test data set, including a labeled standard data set S1 and an unlabeled non-standard data set S2. The data ratio of the labeled standard data set S1 to the unlabeled non-standard data set S2 is 1:
11. The negative-to-positive ratio in the labeled standard data set S1 is 2:
1. It is impossible to determine the negative and positive in the unlabeled non-standard data set S2. The validation set Y contains verified positive and negative data, and the ratio of the validation set Y to the labeled standard data set S1 is 1:10; (2) A collaborative training shared multi-model based on routine blood test data is constructed through a multi-layer perceptron neural network. The specific operations are as follows: Build multiple models, including basic model, mode1_1, mode1_2, mode1_3; The labeled standard data set S1 is input into the basic model, mode1_2, and mode1_3 network models respectively, and the unlabeled non-standard data set S2 is input into the basic model and mode1_1 network models respectively. The basic model network has two inputs, and the network parameters are trained at the same time; The output of the basic mode1 input of the labeled standard dataset S1 is pred_1; the output of the basic model input of the unlabeled non-standard dataset S2 is pred_2; the output of mode1_1 input of the unlabeled non-standard dataset S2 is pred_3; the output of mode1_2 input of the labeled standard dataset S1 is pred_4; the output of mode1_3 input of the labeled standard dataset S1 is pred_5; The collaborative training shared multi-model based on blood routine is trained by using the labeled standard dataset S1 and the unlabeled non-standard dataset S2, and the basic model is retained, that is, the collaborative training shared multi-model of the trained blood routine data; (3) Use the trained blood routine-based collaborative training shared multi-model to verify the validation set Y; In step (2), the basic mode1 is constructed by a 7-layer network; Mode1_1 is constructed by a 6-layer network. The parameters of the first 2 layers are shared with the basic model. The last 4 layers are the same as the 3rd, 4th, 5th, and 7th layers of the basic model, but they do not share parameters and have independent parameters. Mode1_2 is constructed by a 6-layer network. The first 4 layers have the same network structure as the basic model and share parameters. The 5th and 6th layers have the same network structure as the 5th and 7th layers of the basic model and have independent parameters. mode1_3 is constructed by an 8-layer network. The network structure of the first 4 layers is the same as the first 4 layers of the basic model, and the parameters are shared. The network structure of the 5th and 6th layers is the same as that of model_2, and the parameters are shared; the 7th and 8th layers have independent parameters.
2. The application of a collaborative training shared multi-model based on blood routine in the classification of pulmonary tuberculosis according to claim 1 is characterized in that: In step (1), the label of the labeled standard dataset S1 is whether there is tuberculosis; the unlabeled non-standard dataset S2 is a dataset that complies with the medical AI industry; the validation set Y is validation data that does not belong to the dataset S1 and the dataset S2, and contains the correct label of whether there is tuberculosis disease.
3. The application of a collaborative training shared multi-model based on blood routine in the classification of pulmonary tuberculosis according to claim 2 is characterized in that: The labels of pred_1 and the labeled standard dataset S1 are calculated using bce_loss; pred_1 and pred_2 are calculated using the mse loss function; pred_3 and pred_4 are calculated using the ed loss function; pred_4 and pred_5 are calculated using the mse loss function; Among them, the ed loss function is: ; in, and They are the true labels of the samples and the output results of the model respectively; For each sample individual; is the total number of samples; is category X, i.e. label category; is the category Y, which is the model output.
Citation Information
Patent Citations
Pulmonary tuberculosis intelligent identification method based on conventional test data
CN112635069A
Combined disease diagnosis method based on conventional test data and knowledge graph
CN113990485A
Federal unsupervised image classification model training method, classification method and equipment based on semantic clustering
CN116310530A
