A classification method for active pulmonary tuberculosis images based on data enhancement

Through the combination of MMD-GAN and BiLSTM network, the problem of small samples and sample imbalance is solved, the data set is expanded, the efficiency and accuracy of active tuberculosis image classification is improved, and efficient classification of active tuberculosis images is achieved.

CN117934958BActive Publication Date: 2024-10-11GUIZHOU UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410136453.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-31
Publication Date
2024-10-11
Estimated Expiration
2044-01-31

AI Technical Summary

Technical Problem

In the case of small samples and unbalanced samples, the existing technology has low efficiency and accuracy in classifying active pulmonary tuberculosis images, and it is difficult to generate medical image data sets, making it difficult to train and test classification models.

Method used

Maximize mean difference-generative adversarial network (MMD-GAN) is used for data enhancement to generate a large number of samples that meet the requirements of the classification model, and the Bi-directional Long Short-Term Memory 2D (BiLSTM) network is used to establish a classification model for deep feature extraction. and analysis.

Benefits of technology

Expanding the small sample data set through data enhancement technology improves the completeness and richness of the training data, improves the efficiency and accuracy of active tuberculosis image classification, and ensures the model's adaptive deep feature extraction and classification of active tuberculosis images. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117934958B_ABST
    Figure CN117934958B_ABST
Patent Text Reader

Abstract

The present invention provides a method for classifying active pulmonary tuberculosis images based on data enhancement, including: obtaining active pulmonary tuberculosis images and classifying and labeling pathological types; determining the number of training samples and test samples for each pathological type, and selecting active pulmonary tuberculosis images corresponding to the pathological types of small samples; using the maximum mean difference-generative adversarial network to enhance the data of the active pulmonary tuberculosis images of small samples, and obtaining a sample-balanced target active pulmonary tuberculosis image data set; establishing a 2D bidirectional long short-term memory network classification model, and training the model through active pulmonary tuberculosis image training set samples to obtain a target classification model; inputting the active pulmonary tuberculosis images collected by the CT device into the target classification model for classification. The present invention effectively improves the integrity and richness of the training data type; and at the same time ensures the efficiency and accuracy of active pulmonary tuberculosis image classification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of pulmonary tuberculosis image classification methods, and in particular to an active pulmonary tuberculosis image classification method based on data enhancement. Background Art

[0002] Active pulmonary tuberculosis is a serious infectious disease. Early and accurate diagnosis is crucial for the treatment of patients and controlling the spread of the disease. At present, medical imaging examinations are still one of the main means of discovering and diagnosing active pulmonary tuberculosis. However, in the process of acquiring medical images, due to the huge image acquisition cost, the protection of the privacy of positive patients, the limitation of the number of cases and the difficulty of data labeling, medical image samples often have problems such as small data volume, unbalanced categories and low image resolution. At the same time, the annotation of medical images requires professional knowledge of radiologists, but the medical resources in my country are unevenly distributed, and most of the annotation tasks of medical images are very time-consuming. Collecting medical data requires the cooperation of researchers and radiologists, which is a complicated and expensive process. Therefore, it is very attractive to generate medical image data to expand the medical image dataset.

[0003] Thanks to the continuous development of computer vision and deep learning, data enhancement technology has been fully applied in many fields and has demonstrated its superior performance. When using classification training methods to optimize classification, the inventors found that there are problems with the efficiency and accuracy of active tuberculosis image classification when there are small samples and unbalanced samples. Summary of the invention

[0004] The purpose of the present invention is to provide an active pulmonary tuberculosis image classification method based on data enhancement, aiming to solve the problem of active pulmonary tuberculosis image classification efficiency and accuracy when the sample is small and the sample is unbalanced.

[0005] In order to achieve the above object, the present invention provides a method for classifying active pulmonary tuberculosis images based on data enhancement, comprising the following steps:

[0006] S101, using CT equipment to collect active pulmonary tuberculosis images of patients, and then classifying them according to corresponding pathological types, and labeling images of the same pathological type with the same type of labels;

[0007] S102, determining the number of training samples and the number of test samples of active pulmonary tuberculosis images corresponding to each pathological type for the classification model, and selecting active pulmonary tuberculosis images corresponding to the small sample pathological type;

[0008] S103, using Maximum Mean Discrepancy-Generative Adversarial Network (MMD-GAN) to perform data enhancement on small sample active pulmonary tuberculosis images, generate a large number of samples that meet the requirements of the classification model, and obtain a target active pulmonary tuberculosis image dataset with balanced samples;

[0009] S104, using Bi-directional Long Short-Term Memory 2D (2D bidirectional long short-term memory network) to establish a classification model, and training the model with active pulmonary tuberculosis image training set samples to obtain a target classification model, and using the test set samples to test the target classification model;

[0010] S105. The active pulmonary tuberculosis images collected by the CT device are input into the target classification model. The target classification model will automatically perform deep feature extraction and analysis on the active pulmonary tuberculosis images and output the pathological type of the active pulmonary tuberculosis.

[0011] Furthermore, the above-mentioned classification of active tuberculosis images of patients collected by CT equipment according to corresponding pathological types and labeling of the same type of images with the same pathological type are specifically as follows:

[0012] The active tuberculosis images of patients collected by CT equipment are handed over to professional radiologists for labeling. They are labeled according to the corresponding pathological types, including ground glass density shadows (GGO), halo signs and reverse halo signs, airway wall thickening, tuberculous nodules, cavities and pulmonary consolidation. Labeling software is used to affix the same type of labels to images of the same pathological type.

[0013] Furthermore, in the above S102, the number of training samples and the number of test samples of active tuberculosis images corresponding to each pathological type for the classification model are determined, and the active tuberculosis images corresponding to the pathological types of the small samples are selected to facilitate the next step of data expansion for the pathological types of the small samples and balance the data set.

[0014] Furthermore, in the above S103, MMD-GAN is used to enhance the data of the small sample active tuberculosis images, generate a large number of samples that meet the requirements of the classification model, and obtain a sample balanced target active tuberculosis image dataset, specifically:

[0015] (1) Gaussian noise is used to generate a large number of small sample active tuberculosis images through the generator G in the generative adversarial network (GAN) to obtain sample-balanced active tuberculosis images. The optimization goal of GAN is as follows:

[0016]

[0017] Where x represents the real data, z represents the noise, and P data(x) represents the distribution of real data, P z(z) represents the data distribution of noise, E is the expected distribution, D(·) is the discriminator, G(·) is the generator, refers to the expectation of logD(x), refers to the expectation of [log(1-D(G(z)))];

[0018] (2) By reducing the value of the maximized mean difference, the difference in the distribution of active tuberculosis image data is reduced, so that the active tuberculosis image generated by noise is close to the real active tuberculosis image.

[0019] The expression of MMD is as follows:

[0020]

[0021] In the above formula, H represents the reproducing kernel Hilbert space (RKHS), which is a complete inner product space. Φ(·) is a nonlinear mapping to RHKS. n1 and n2 represent the number of samples in the real active tuberculosis image dataset X and the generated active tuberculosis image dataset Y, respectively. i is the i-th sample in X, y j is the jth sample in Y. The smaller the value of MMD is, the smaller the difference in data distribution between the two data sets is.

[0022] Furthermore, the target classification model is established in S104 as follows:

[0023] (1) Establish a Bi-directional Long Short-Term Memory 2D classification model. Figure 2 As shown, BiLSTM consists of two ordinary LSTMs. is the input sequence, is the reverse input sequence, Represents the input sequence The output after LSTM processing is: Represents the reverse input sequence The output will be processed by LSTM;

[0024] (2) After BiLSTM processes the input sequence, the output in both directions and They are spliced ​​in sequence, and the output and splicing process is described as follows:

[0025]

[0026]

[0027] In the formula, and They all have the same hyperparameter, namely the hidden dimension D, so the dimension of h is 2D; Indicates that Splice it together;

[0028] (3) Construct two BiLSTMs, one of which is used to obtain the information of the forward and reverse sequences in the horizontal direction of the CT image, and the other is used to obtain the information in the vertical direction. For the input X of BiLSTM2D, it is defined as in is a set of sequences, such as Figure 4 As shown, H of the input image X represents the number of sequences in the vertical direction, W represents the number of sequences in the horizontal direction, and C represents the number of input channels;

[0029] Input X's sequence of all vertical directions :,w,: are all input into a vertical BiLSTM with hidden dimension D. The process is described as:

[0030]

[0031] Similarly, the horizontal Treated as a set of sequences, all sequences in the vertical direction are input into a horizontal BiLSTM with hidden dimension D.

[0032]

[0033] according to Figure 2 Schematic principle, the result obtained by taking the forward and reverse sequences as input and Finally, the features are output through the fully connected layer, and the process is calculated as:

[0034]

[0035] Here, FC(·) represents a fully connected operation, and the dimension of the output vector is uniquely determined by the type of active pulmonary tuberculosis; finally, the Softmax function is used for output to determine the corresponding active pulmonary tuberculosis category. The Softmax function is:

[0036]

[0037] Among them, x iis the feature value output by the last fully connected layer. The loss function of the proposed method model selects the cross entropy loss function, which is described as:

[0038]

[0039] Where M represents the number of active tuberculosis categories; y ic represents the sign function, which takes 1 if the label value of sample i is the same as c, otherwise it takes 0; p ic represents the probability that sample i belongs to category c, and N represents the number of samples.

[0040] Furthermore, the Long Short-Term Memory (LSTM) network in S104 is specifically as follows:

[0041] LSTM mainly includes three gate structures, namely the forget gate, input gate and output gate. These gates ensure that information can be selectively passed. In order to ensure the invariance of information during transmission, the state of the transmission unit is only obtained by some simple linear operations. LSTM learns the deep features of the original data by selectively retaining the effective information of the time series signal, thereby realizing the classification of active tuberculosis images.

[0042] The output of the forget gate is multiplied by the memory unit of the previous time step to determine whether the current candidate memory unit retains the information of the previous time step and the degree of their retention. t The output h of the previous sequence t-1 Memory unit C that jointly determines the previous process t-1 Whether the information in the data needs to be retained or how much to retain. The working mechanism of the forget gate is described as:

[0043]

[0044] In the formula, and Indicates the current input X t and the output h of the previous process t-1 The weight of b f Indicates bias. C t-1 Represents the hidden state of the previous process, which is used to retain the memory information of the previous moment. t With C t-1 The multiplication represents the degree of forgetting of the memory unit in the previous process, and then the information of the new candidate memory unit is added through the input gate to update the new memory unit. The operation process of the input gate can be calculated as formula (11). The candidate memory unit and its update process are composed of the memory unit C of the previous process. t-1 、output h t-1 and the current input Xt Together, this process is described as Equation (12) and Equation (13).

[0045]

[0046]

[0047]

[0048] Among them, W xi , W hi , W xC , W hC represents the weight, b i and b C is the bias, I t Indicates the degree of update of new information. represents the current candidate memory unit, F t ·C t-1 Represents the memory unit information of the previous stage retained after passing through the forget gate, I t · Represents the memory cell information of the current state after the input gate, C t Indicates the state of the current memory unit. Finally, the output gate determines whether to output or the degree of output. The process is described as:

[0049]

[0050] h t =O t tanh(C t )(15)

[0051] here, and is the weight, b O Indicates bias, O t Output information of the output gate, h t represents the output of the hidden layer, and h t-1 Similarly, it will serve as the input of the next hidden layer. In the operation of LSTM, σ(·) is the sigmoid activation function.

[0052]

[0053] tanh(·) is described as:

[0054]

[0055] x is just a transition variable and can be substituted into different formulas, such as middle, as well as Just substitute it in.

[0056] A data-enhanced active pulmonary tuberculosis image classification system, including:

[0057] An image acquisition classification and labeling unit is used to acquire active pulmonary tuberculosis images, classify them into pathological types, and label them with the same labels for the same pathological types;

[0058] A training sample number and a test sample number determination unit, used to determine the training sample number and the test sample number of active pulmonary tuberculosis images corresponding to each pathological type, and select active pulmonary tuberculosis images corresponding to small sample pathological types;

[0059] The data enhancement unit uses the maximum mean difference-generative adversarial network to enhance the data of small sample active tuberculosis images, generate a large number of samples that meet the requirements of the classification model, and obtain a sample-balanced target active tuberculosis image dataset;

[0060] The training unit uses a 2D bidirectional long short-term memory network to establish a classification model, and trains the model with active tuberculosis image training set samples to obtain a target classification model, and uses the test set samples to test the target classification model;

[0061] The output unit is used to input the active tuberculosis images collected by the CT device into the target classification model. The target classification model will automatically perform deep feature extraction and analysis on the active tuberculosis images and output the pathological type of active tuberculosis.

[0062] The beneficial effects of the present invention are as follows: compared with the prior art, the present invention first classifies the active tuberculosis images of patients collected by CT equipment according to the corresponding pathological types based on data enhancement technology, and labels the same type of images with the same pathological type; determines the number of training samples and the number of test samples of the active tuberculosis images corresponding to each pathological type for the classification model, and selects the active tuberculosis images corresponding to the pathological types of the small samples; uses the Maximum Mean Discrepancy-Generative Adversarial Network (MMD-GAN) to enhance the data of the active tuberculosis images of the small samples, generates a large number of samples that meet the requirements of the classification model, and obtains a sample-balanced standard active tuberculosis image data set; establishes a Bi-directional Long Short-Term A Memory2D (2D bidirectional long short-term memory network) classification model is developed, and the model is trained using samples of the active tuberculosis image training set to obtain a target classification model, which is then tested using samples of the test set. The active tuberculosis images collected by the CT device are input into the target classification model, which will automatically perform deep feature extraction and analysis on the active tuberculosis images and output the pathological type of active tuberculosis.

[0063] Compared with traditional methods, data enhancement technology is used to expand the active tuberculosis image dataset with small samples and unbalanced samples. The key factor that the population of patients with some pathological types of tuberculosis is small is comprehensively considered, so that the established initial classification model can obtain more small sample types of active tuberculosis image data for training, which effectively improves the completeness and richness of the training data type; at the same time, the established Bi-directional Long Short-Term Memory 2D (2D bidirectional long short-term memory network) classification model can perform adaptive deep feature extraction and classification of active tuberculosis images, thereby ensuring the efficiency and accuracy of active tuberculosis image classification. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0065] Figure 1 is a flow chart of a method for classifying active pulmonary tuberculosis images based on data enhancement provided in Example 1;

[0066] Figure 2 Schematic diagram of BiLSTM in the embodiment;

[0067] Figure 3 Schematic diagram of the long short-term memory network structure in the embodiment;

[0068] Figure 4 Schematic diagram of input of BiLSTM2D in different directions in the embodiment;

[0069] Figure 5 is a schematic diagram of GAN in an embodiment;

[0070] Figure 6 is a logical schematic diagram in an embodiment. DETAILED DESCRIPTION

[0071] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0072] Embodiment 1, as Figure 1 As shown in the flowchart, the active tuberculosis image classification method based on data enhancement includes the following steps:

[0073] S101, using CT equipment to collect active pulmonary tuberculosis images of patients, and then classifying them according to corresponding pathological types, and labeling images of the same pathological type with the same type of labels;

[0074] In this embodiment, the pathological types of active pulmonary tuberculosis include six categories: ground-glass density shadow, halo sign and reverse halo sign, airway wall thickening, tuberculous nodules, cavitation and pulmonary consolidation, and the true label vectors corresponding to the above classification states are shown in Table 1.

[0075] Table 1

[0076]

[0077] S102, determining the number of training samples and the number of test samples of active pulmonary tuberculosis images corresponding to each pathological type for the classification model, and selecting active pulmonary tuberculosis images corresponding to the pathological type of a small sample;

[0078] In S102, the number of active pulmonary tuberculosis images corresponding to each pathological type used for the training sample number and the number of test sample number of the classification model are determined, and the active pulmonary tuberculosis images corresponding to the pathological type of the small sample are selected to facilitate the next step of data expansion for the pathological type of the small sample and balance the data set;

[0079] The training set samples and the test set samples include multiple active pulmonary tuberculosis images; the number ratio of the training set samples to the test set samples is 7:3; and both the training set samples and the test set samples contain corresponding active pulmonary tuberculosis image status labels;

[0080] S103, using Maximum Mean Discrepancy-Generative Adversarial Network (MMD-GAN) to perform data enhancement on small sample active pulmonary tuberculosis images, generate a large number of samples that meet the requirements of the classification model, and obtain a sample balanced target active pulmonary tuberculosis image dataset;

[0081] MMD-GAN is used to enhance the data of small sample active tuberculosis images, generate a large number of samples that meet the requirements of the classification model, and obtain a sample-balanced standard active tuberculosis image dataset, specifically:

[0082] (1) GAN schematic diagram Figure 5 As shown. Specifically, the GAN principle is to make the generated data close to the real data. GAN generates data through the generator G, and then authenticates it through the discriminator D composed of real data until the discriminator believes that the generated data is real data. The optimization goal of GAN is as follows:

[0083]

[0084] Among them, x represents the real data, z represents the noise, and P data(x) represents the distribution of real data, P z(z) represents the data distribution of noise, and E is the expected distribution;

[0085] (2) By minimizing the MMD, the differences in the distribution of active tuberculosis image data are reduced, so that the active tuberculosis images generated by noise are close to the real active tuberculosis images.

[0086] The expression of MMD is as follows:

[0087]

[0088] In the above formula, H represents the reproducing kernel Hilbert space (RKHS), which is a complete inner product space. Φ(·) is a nonlinear mapping to RHKS. n1 and n2 represent the number of samples in the real active tuberculosis image dataset X and the generated active tuberculosis image dataset y, respectively. The smaller the value of MMD, the smaller the difference in data distribution between the two datasets;

[0089] S104, using Bi-directional Long Short-Term Memory 2D (2D bidirectional long short-term memory network) to establish a classification model, and training the model with active pulmonary tuberculosis image training set samples to obtain a target classification model, and using the test set samples to test the target classification model;

[0090] The specific steps to establish the target classification model are as follows:

[0091] (1) Establish a Bi-directional Long Short-Term Memory 2D classification model. Figure 2 As shown, BiLSTM consists of two ordinary LSTMs. is the input sequence, is the reverse input sequence, Represents the input sequence The output after LSTM processing is: Represents the reverse input sequence The output will be processed by LSTM;

[0092] (2) After BiLSTM processes the input sequence, the output in both directions and They are spliced ​​in sequence, and the output and splicing process is described as follows:

[0093]

[0094]

[0095] In the formula, and They all have the same hyperparameter, namely the hidden dimension D, so the dimension of h is 2D;

[0096] (3) Construct two BiLSTMs, one of which is used to obtain the information of the forward and reverse sequences in the horizontal direction of the CT image, and the other is used to obtain the information in the vertical direction. For the input X of BiLSTM2D, it is defined as in is a set of sequences, such as Figure 4 As shown, H of the input image X represents the number of sequences in the vertical direction, W represents the number of sequences in the horizontal direction, and C represents the number of input channels;

[0097] Input X's sequence of all vertical directions :,w,: are all input into a vertical BiLSTM with hidden dimension D. The process is described as:

[0098]

[0099] Similarly, the horizontal Treated as a set of sequences, all sequences in the vertical direction are input into a horizontal BiLSTM with hidden dimension D.

[0100]

[0101] according to Figure 2 Schematic principle, the result obtained by taking the forward and reverse sequences as input and Finally, the features are output through the fully connected layer, and the process is calculated as:

[0102]

[0103] Here, FC(·) represents a fully connected operation, and the dimension of the output vector is uniquely determined by the type of active pulmonary tuberculosis; finally, the Softmax function is used for output to determine the corresponding active pulmonary tuberculosis category. The Softmax function is:

[0104]

[0105] Among them, x i is the feature value output by the last fully connected layer. The loss function of the proposed method model selects the cross entropy loss function, which is described as:

[0106]

[0107] Where M represents the number of active tuberculosis categories; y ic represents the sign function, which takes 1 if the label value of sample i is the same as c, otherwise it takes 0; p ic represents the probability that sample i belongs to category c.

[0108] The Long Short-Term Memory (LSTM) network is as follows:

[0109] LSTM mainly includes three gate structures, namely the forget gate, input gate and output gate. These gates ensure that information can be selectively passed. In order to ensure the invariance of information during transmission, the state of the transmission unit is only obtained by some simple linear operations. LSTM learns the deep features of the original data by selectively retaining the effective information of the time series signal, thereby realizing the classification of active tuberculosis images.

[0110] The output of the forget gate is multiplied by the memory unit of the previous time step to determine whether the current candidate memory unit retains the information of the previous time step and the degree of their retention.t The output h of the previous sequence t-1 Memory unit C that jointly determines the previous process t-1 Whether the information in the data needs to be retained or how much to retain. The working mechanism of the forget gate is described as:

[0111]

[0112] In the formula, and Indicates the current input X t and the output h of the previous process t-1 The weight of b i Indicates bias. C t-1 Represents the hidden state of the previous process, which is used to retain the memory information of the previous moment. t With C t-1 The multiplication reaches the degree of forgetting of the memory unit of the previous process, and then the information of the new candidate memory unit is added through the input gate to update the new memory unit. The operation process of the input gate can be calculated as formula (7). The candidate memory unit and its update process are composed of the memory unit C of the previous process. t-1 、output h t-1 and the current input X t Together, this process is described as Equation (12) and Equation (13).

[0113]

[0114]

[0115]

[0116] Among them, I t Indicates the degree of update of new information. represents the current candidate memory unit, F t ·C t-1 Represents the memory unit information of the previous stage retained after passing through the forget gate, Represents the memory cell information of the current state after the input gate, C t Indicates the state of the current memory unit. Finally, the output gate determines whether to output or the degree of output. The process is described as:

[0117]

[0118] h t =O t tanh(C t )(15)

[0119] Here, O t Output information of the output gate, ht represents the output of the hidden layer, and h t-1 Similarly, it will serve as the input of the next hidden layer. In the operation of LSTM, σ(·) is the sigmoid activation function.

[0120]

[0121] tanh(·) is described as:

[0122]

[0123] S105. The active pulmonary tuberculosis images collected by the CT device are input into the target classification model. The target classification model will automatically perform deep feature extraction and analysis on the active pulmonary tuberculosis images and output the pathological type of the active pulmonary tuberculosis.

[0124] Embodiment 2: An active pulmonary tuberculosis image classification system based on data enhancement, comprising:

[0125] An image acquisition classification and labeling unit is used to acquire active pulmonary tuberculosis images, classify them into pathological types, and label them with the same labels for the same pathological types;

[0126] A training sample number and a test sample number determination unit, used to determine the training sample number and the test sample number of active pulmonary tuberculosis images corresponding to each pathological type, and select active pulmonary tuberculosis images corresponding to small sample pathological types;

[0127] The data enhancement unit uses the maximum mean difference-generative adversarial network to enhance the data of small sample active tuberculosis images, generate a large number of samples that meet the requirements of the classification model, and obtain a sample-balanced target active tuberculosis image dataset;

[0128] The training unit uses a 2D bidirectional long short-term memory network to establish a classification model, and trains the model with active tuberculosis image training set samples to obtain a target classification model, and uses the test set samples to test the target classification model;

[0129] The output unit is used to input the active tuberculosis images collected by the CT device into the target classification model. The target classification model will automatically perform deep feature extraction and analysis on the active tuberculosis images and output the pathological type of active tuberculosis.

[0130] The implementation of each unit is implemented using the method in Example 1.

[0131] The above is a detailed introduction to a data-enhanced active tuberculosis image classification method provided by the present invention. The present invention uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. An active pulmonary tuberculosis image classification system based on data enhancement, characterized in that: include, An image acquisition classification and labeling unit is used to acquire active pulmonary tuberculosis images, classify them into pathological types, and label them with the same labels for the same pathological types; A training sample number and a test sample number determination unit, used to determine the training sample number and the test sample number of active pulmonary tuberculosis images corresponding to each pathological type, and select active pulmonary tuberculosis images corresponding to small sample pathological types; The data enhancement unit uses the maximum mean difference-generative adversarial network to enhance the data of small sample active tuberculosis images, generate a large number of samples that meet the requirements of the classification model, and obtain a target active tuberculosis image dataset with balanced samples; The training unit uses a bidirectional long short-term memory network to establish a classification model, and trains the model through active tuberculosis image training set samples to obtain a target classification model, and uses the test set samples to test the target classification model; The specific steps of the target classification model are: (1) Establish a classification model of a bidirectional long short-term memory network. BiLSTM consists of two ordinary LSTMs. is the input sequence, is the reverse input sequence, Represents the input sequence The output after LSTM processing is: Represents the reverse input sequence The output will be processed by LSTM; (2) After BiLSTM processes the input sequence, the output in both directions and They are spliced ​​in sequence, and the output and splicing process is described as follows: In the formula, and All have the same hyperparameter, namely the hidden dimension D, so the dimension of h is 2D. Indicates that Splice it together; (3) Construct two BiLSTMs, one of which is used to obtain the information of the forward and reverse sequences in the horizontal direction of the CT image, and the other is used to obtain the information in the vertical direction. For the input X of BiLSTM2D, it is defined as in is a set of sequences, where H of the input image X represents the number of sequences in the vertical direction, W represents the number of sequences in the horizontal direction, and C represents the number of input channels; Input X's sequence of all vertical directions :,w,: are all input into a vertical BiLSTM with hidden dimension D. The process is described as: Similarly, the horizontal Treated as a set of sequences, all sequences in the vertical direction are input into a horizontal BiLSTM with a hidden dimension of D; The result obtained by taking the forward and reverse sequence as input and Finally, the features are output through the fully connected layer, and the process is calculated as: In the formula, FC(·) represents a fully connected operation, and the dimension of the output vector is uniquely determined by the type of active pulmonary tuberculosis. Finally, the Softmax function is used to output the corresponding active pulmonary tuberculosis category. The Softmax function is: Among them, x i For the feature values ​​output by the last fully connected layer, the model's loss function selects the cross entropy loss function, which is described as: Where: M represents the number of active tuberculosis categories; y ic represents the sign function, which takes 1 if the label value of sample i is the same as c, otherwise it takes 0; p ic represents the probability that sample i belongs to category c, and N represents the number of samples; The output unit is used to input the active tuberculosis images collected by the CT device into the target classification model. The target classification model will automatically perform deep feature extraction and analysis on the active tuberculosis images and output the pathological type of the active tuberculosis.