A tuberculosis CT image classification method, system, device and storage medium
By iteratively training the Mask RCNN model and combining it with the Swin Transformer and Random Forest algorithms, the problems of low efficiency and low accuracy of traditional tuberculosis detection methods in resource-scarce areas have been solved, achieving efficient and accurate CT image classification of tuberculosis.
Patent Information
- Application Number
- CN202310361392.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-06
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2043-04-06
AI Technical Summary
Traditional tuberculosis detection methods cannot detect infectious tuberculosis in a timely manner in areas with scarce medical resources. Furthermore, existing CT image classification methods ignore the high accuracy of CT and the impact of different types of tuberculosis on diagnosis, resulting in low classification efficiency and accuracy.
A CT image classification model for pulmonary tuberculosis was constructed using the Mask RCNN model. The multi-task loss value was optimized by iteratively training the parameters. The accuracy and efficiency of the classification model were improved by combining the Swin Transformer and Random Forest algorithms.
It has improved the efficiency and accuracy of classifying the infectivity of pulmonary tuberculosis, especially under conditions of limited medical resources, and has achieved more efficient CT image classification of pulmonary tuberculosis.
Smart Images

Figure CN116778219B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of medical image classification, in particular to a pulmonary tuberculosis CT image classification method, system, device and storage medium. BACKGROUND
[0002] Tuberculosis is a class of infectious diseases caused by Mycobacterium tuberculosis. If not treated in time, the mortality rate of tuberculosis is very high, and it usually affects the lungs, but also affects sites other than the lungs. When a person with active tuberculosis (ATB) coughs, sneezes or expels infectious bacteria in other ways, it will spread through the air. Through early diagnosis and treatment, most deaths from tuberculosis can be prevented. The WHO issued the "Tuberculosis Comprehensive Guidelines: Preventive Treatment" in 2020, which states that people with a history of tuberculosis or non-active pulmonary tuberculosis have a higher risk of developing the disease and should be the target group for post-exposure intervention. Non-active tuberculosis is the focus of intervention to achieve the goal of eliminating tuberculosis, and needs to be chemically and immunologically prevented. Therefore, accurate detection and diagnosis of these pulmonary tuberculosis subcategories has important practical significance.
[0003] The traditional method for detecting the infectivity of pulmonary tuberculosis is sputum smear and sputum culture, which is undeniable in its effectiveness, but this method itself requires a certain period of time to reach a conclusion, and in areas where medical resources are scarce, it is even more difficult to detect patients with infectious pulmonary tuberculosis in a timely manner. For pulmonary tuberculosis, hospitals will also make imaging judgments, but this is very limited in high-burden countries where medical resources and radiology experts are scarce. At the same time, the cases of pulmonary tuberculosis patients with infectiousness that hospitals can access are relatively few, and the use of traditional classification methods cannot draw good conclusions. Current pulmonary tuberculosis CT image classification mostly focuses on binary classification detection based on X-ray films, ignoring the fact that CT has better accuracy in detection and diagnosis than X-ray films, and ignoring the impact of different types of pulmonary tuberculosis on doctor's diagnosis of the disease. SUMMARY
[0004] The present application aims to at least solve the technical problems existing in the prior art. To this end, the present application provides a pulmonary tuberculosis CT image classification method, system, device and storage medium, which can improve the classification efficiency and classification accuracy of pulmonary tuberculosis infectivity.
[0005] In a first aspect of the present application, a pulmonary tuberculosis CT image classification method is provided, comprising the following steps:
[0006] Obtaining a labeled pulmonary tuberculosis CT image dataset and a to-be-predicted image;
[0007] constructing an initial tuberculosis CT image classification model based on a Mask RCNN model: obtaining first training parameters of the initial tuberculosis CT image classification model;
[0008] inputting the labeled tuberculosis CT image dataset into the initial tuberculosis CT image classification model for training to obtain a multi-task loss value of a first RPN network, a first predicted multi-task loss value and a first tuberculosis CT image classification model;
[0009] If the multi-task loss value of the first RPN network and the first predicted multi-task loss value reach a preset value, the first tuberculosis CT image classification model is taken as a trained tuberculosis CT image classification model; if the multi-task loss value of the first RPN network and the first predicted multi-task loss value do not reach the preset value, the first training parameters are updated according to the multi-task loss value of the first RPN network and the first predicted multi-task loss value to obtain second training parameters, the first tuberculosis CT image classification model is trained according to the second training parameters and the labeled tuberculosis CT image dataset to obtain a multi-task loss value of a second RPN network, a second predicted multi-task loss value and a second tuberculosis CT image classification model;
[0010] If the multi-task loss value of the second RPN network and the second predicted multi-task loss value reach the preset value, the second tuberculosis CT image classification model is taken as the trained tuberculosis CT image classification model; if the multi-task loss value of the second RPN network and the second predicted multi-task loss value do not reach the preset value, the second training parameters are updated according to the multi-task loss value of the second RPN network and the second predicted multi-task loss value to obtain third training parameters, and the process is sequentially repeated until the number of iterations reaches a maximum number of iterations set in advance or the multi-task loss value of the RPN network obtained through iteration and the predicted multi-task loss value reach the preset value, so that the trained tuberculosis CT image classification model is obtained;
[0011] inputting the to-be-predicted image into the trained tuberculosis CT image classification model to obtain a tuberculosis CT image classification result of the to-be-predicted image.
[0012] The control method according to the embodiment of the application has at least the following beneficial effects:
[0013] The method comprises the following steps: obtaining a labeled tuberculosis CT image data set and a to-be-predicted image, constructing an initial tuberculosis CT image classification model based on a Mask RCNN model, obtaining first training parameters of the initial tuberculosis CT image classification model, inputting the labeled tuberculosis CT image data set into the initial tuberculosis CT image classification model for training, obtaining a multi-task loss value of a first RPN network, a first predicted multi-task loss value and a first tuberculosis CT image classification model, if the multi-task loss value of the first RPN network and the first predicted multi-task loss value reach a preset value, taking the first tuberculosis CT image classification model as a trained tuberculosis CT image classification model, if the multi-task loss value of the first RPN network and the first predicted multi-task loss value do not reach the preset value, updating the first training parameters according to the multi-task loss value of the first RPN network and the first predicted multi-task loss value to obtain second training parameters, training the first tuberculosis CT image classification model according to the second training parameters and the labeled tuberculosis CT image data set to obtain a multi-task loss value of a second RPN network, a second predicted multi-task loss value and a second tuberculosis CT image classification model, if the multi-task loss value of the second RPN network and the second predicted multi-task loss value reach the preset value, taking the second tuberculosis CT image classification model as the trained tuberculosis CT image classification model, if the multi-task loss value of the second RPN network and the second predicted multi-task loss value do not reach the preset value, updating the second training parameters according to the multi-task loss value of the second RPN network and the second predicted multi-task loss value to obtain third training parameters, and the like, until the number of iterations reaches a maximum number of iterations set in advance or the multi-task loss value of the RPN network and the predicted multi-task loss value obtained through iteration reach the preset value, thereby obtaining the trained tuberculosis CT image classification model, inputting the to-be-predicted image into the trained tuberculosis CT image classification model, obtaining a tuberculosis CT image classification result of the to-be-predicted image, and improving the classification efficiency and the classification accuracy of tuberculosis infectivity.
[0014] According to some embodiments of the application, the calculation formula of the step of inputting the labeled tuberculosis CT image data set into the initial tuberculosis CT image classification model for training to obtain a multi-task loss value of a first RPN network is as follows:
[0015]
[0016]
[0017]
[0018]
[0019] wherein, L cls represents a foreground-background classification loss, Lreg denotes anchor regression loss, p i denotes the probability that the i-th anchor is the ground truth label, denotes 1 when t i denotes the predicted bounding box regression parameter of the i-th anchor, denotes the ground truth bounding box regression parameter of the i-th anchor, N cls denotes the number of samples in a batch-size, N reg denotes the number of anchor locations, and λ denotes a coefficient parameter, denotes a robust loss function, x denotes the error value between the predicted value and the ground truth value.
[0020] According to some embodiments of the present application, the first predicted multi-task loss value includes a classification loss value, a bounding box regression loss value, and a mask loss value; wherein the classification loss value and the bounding box regression loss value are calculated in the following manner:
[0021] L(p, u, t u , v) = L cls (p, u) + λ[u≥1]L loc (t u , v)
[0022] L cls (p, u) = -log p u
[0023]
[0024] wherein p denotes the softmax probability distribution predicted by the classifier p = (p0,..., p k ), u denotes the real class label of the corresponding target, t u denotes the regression parameter of the real class label u predicted by the bounding box regressor, v denotes the bounding box regression parameter of the corresponding real target, λ denotes a coefficient parameter, [u≥1] denotes the Iverson bracket, (x, y) denotes the coordinates of the center point of the detected target box, w denotes the width of the target box, and h denotes the height of the target box, L(p, u, t u , v) denotes the classification and bounding box regression loss value, L cls (p, u) denotes the classification loss value, and L loc (t u , v) denotes the bounding box regression loss value.
[0025] According to some embodiments of the present application, the mask loss value is calculated in the following manner:
[0026]
[0027] wherein, L mask represents a mask loss value, 1 c represents 1 when the cth channel corresponds to the true class of the target, otherwise 0; C represents the number of masks, z represents the label value of the mask at the current position, f represents the output value at the current position, and m represents the mask size value.
[0028] According to some embodiments of the present application, the method further comprises:
[0029] inputting the labeled tuberculosis CT image dataset into the initial tuberculosis CT image classification model to obtain tuberculosis CT image classification data, wherein the tuberculosis CT image classification data comprises the type of lesion, the number of lesions, the number of various types of lesions, the location of lesions, the size of lesions, and the probability of detection of each lesion;
[0030] integrating the tuberculosis CT image classification data to obtain a tuberculosis CT image classification dataset;
[0031] training the initial tuberculosis CT image classification model according to the tuberculosis CT image classification dataset to obtain the first tuberculosis CT image classification model.
[0032] According to some embodiments of the present application, the calculation formula for integrating the tuberculosis CT image classification data to obtain a tuberculosis CT image classification dataset is:
[0033] n k =Class_num(Get_result(result),c k )
[0034] p k =Posibility(Get_result(result),c k )
[0035] q=In_result(Get_result(result),c1)+In_result(Get_result(result),c2)+...
[0036]
[0037] wherein, result represents a result variable of one detection, Get_result() function represents querying all lesion information in the result, c kIn_result() represents whether the result contains the information of the kth kind of lesion, n k In_result() represents whether the result contains the information of the kth kind of lesion, n k In_result() represents whether the result contains the information of the kth kind of lesion, n
[0038] According to some embodiments of the present application, the labeled tuberculosis CT image dataset is obtained, comprising:
[0039] Collecting a lung computed tomography image, and converting the lung computed tomography image into a basic format image through a format conversion method;
[0040] Performing mean filtering, wavelet denoising and Gaussian filtering on the basic format image to obtain a denoised image;
[0041] Performing data enhancement on the denoised image through a histogram equalization and saturation contrast adjustment method to obtain a data-enhanced image;
[0042] Performing linear and nonlinear transformation on the data-enhanced image to obtain a normalized image;
[0043] Performing image labeling on the normalized image through labelme to obtain the labeled tuberculosis CT image dataset, wherein the labeling of the labeled tuberculosis CT image dataset includes caseous lesions, tree-in-bud lesions, consolidation lesions and cavity lesions.
[0044] In a second aspect of the present application, a tuberculosis CT image classification system is provided, comprising:
[0045] An image acquisition module is configured to acquire a labeled tuberculosis CT image dataset and a to-be-predicted image;
[0046] A classification model construction module is configured to construct an initial tuberculosis CT image classification model based on a Mask RCNN model, and acquire first training parameters of the initial tuberculosis CT image classification model;
[0047] The classification model training module is configured to input the labeled tuberculosis CT image dataset into the initial tuberculosis CT image classification model for training, obtain a multi-task loss value of a first RPN network, a first predicted multi-task loss value, and a first tuberculosis CT image classification model; if the multi-task loss value of the first RPN network and the first predicted multi-task loss value reach a preset value, the first tuberculosis CT image classification model is used as a trained tuberculosis CT image classification model; if the multi-task loss value of the first RPN network and the first predicted multi-task loss value do not reach the preset value, the first training parameter is updated according to the multi-task loss value of the first RPN network and the first predicted multi-task loss value, to obtain a second training parameter, the first tuberculosis CT image classification model is trained according to the second training parameter and the labeled tuberculosis CT image dataset, to obtain a multi-task loss value of a second RPN network, a second predicted multi-task loss value, and a second tuberculosis CT image classification model; if the multi-task loss value of the second RPN network and the second predicted multi-task loss value reach the preset value, the second tuberculosis CT image classification model is used as the trained tuberculosis CT image classification model; if the multi-task loss value of the second RPN network and the second predicted multi-task loss value do not reach the preset value, the second training parameter is updated according to the multi-task loss value of the second RPN network and the second predicted multi-task loss value, to obtain a third training parameter, and the process is repeated until the number of iterations reaches a maximum number of iterations set in advance or the multi-task loss value of the RPN network obtained through iteration and the predicted multi-task loss value reach the preset value, to obtain the trained tuberculosis CT image classification model.
[0048] The classification result output module is configured to input the to-be-predicted image into the trained tuberculosis CT image classification model, to obtain a tuberculosis CT image classification result of the to-be-predicted image.
[0049] The system obtains a labeled tuberculosis CT image data set and a to-be-predicted image, constructs an initial tuberculosis CT image classification model based on a Mask RCNN model, obtains first training parameters of the initial tuberculosis CT image classification model, inputs the labeled tuberculosis CT image data set into the initial tuberculosis CT image classification model for training, obtains a multi-task loss value of a first RPN network, a first predicted multi-task loss value and a first tuberculosis CT image classification model, and if the multi-task loss value of the first RPN network and the first predicted multi-task loss value reach a preset value, the first tuberculosis CT image classification model is taken as a trained tuberculosis CT image classification model; if the multi-task loss value of the first RPN network and the first predicted multi-task loss value do not reach the preset value, the first training parameters are updated according to the multi-task loss value of the first RPN network and the first predicted multi-task loss value, second training parameters are obtained, the first tuberculosis CT image classification model is trained according to the second training parameters and the labeled tuberculosis CT image data set, a multi-task loss value of a second RPN network is obtained, a second predicted multi-task loss value and a second tuberculosis CT image classification model, if the multi-task loss value of the second RPN network and the second predicted multi-task loss value reach the preset value, the second tuberculosis CT image classification model is taken as the trained tuberculosis CT image classification model; if the multi-task loss value of the second RPN network and the second predicted multi-task loss value do not reach the preset value, the second training parameters are updated according to the multi-task loss value of the second RPN network and the second predicted multi-task loss value, third training parameters are obtained, and the process is repeated until the number of iterations reaches a maximum number of iterations set in advance or the multi-task loss value of the RPN network and the predicted multi-task loss value obtained through iteration reach the preset value, a trained tuberculosis CT image classification model is obtained, the to-be-predicted image is input into the trained tuberculosis CT image classification model, a tuberculosis CT image classification result of the to-be-predicted image is obtained, and the classification efficiency and the classification accuracy of tuberculosis infectivity are improved.
[0050] In a third aspect, the present application provides a tuberculosis CT image classification electronic device, comprising at least one control processor and a memory connected in communication with the at least one control processor; the memory stores instructions executable by the at least one control processor, and the instructions are executed by the at least one control processor to enable the at least one control processor to perform the tuberculosis CT image classification method described above.
[0051] In a fourth aspect, the present application provides a computer-readable storage medium storing computer-executable instructions for causing a computer to perform the tuberculosis CT image classification method described above.
[0052] It should be noted that the beneficial effects between the second to fourth aspects of the present application and the prior art are the same as the beneficial effects between the above-mentioned tuberculosis CT image classification system and the prior art, which will not be described here.
[0053] Additional aspects and advantages of the present application will be described in the following description, become apparent from the following description, or be learned by practice of the present application. BRIEF DESCRIPTION OF DRAWINGS
[0054] The above and / or additional aspects and advantages of the present application will become apparent and be readily understood from the following description, taken in conjunction with the accompanying drawings, in which:
[0055] Figure 1 is a flow chart of a tuberculosis CT image classification method according to an embodiment of the present application;
[0056] Figure 2 is a detection effect diagram of a tuberculosis CT image classification method according to an embodiment of the present application;
[0057] Figure 3 is a classification ROC diagram of a tuberculosis CT image classification method according to an embodiment of the present application;
[0058] Figure 4 is a structural schematic diagram of a tuberculosis CT image classification system according to an embodiment of the present application. DETAILED DESCRIPTION
[0059] Embodiments of the present application are described in detail below with reference to the accompanying drawings, in which the same or similar elements or elements having the same or similar functions are denoted by the same or similar reference numerals throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are intended only to explain the present application, and should not be understood as limiting the present application.
[0060] In the description of the present application, if there is a description of first, second, etc., it is only for the purpose of distinguishing technical features, and should not be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features or the order of indicated technical features.
[0061] In the description of the present application, it should be understood that the orientation description, such as up, down, etc., is based on the orientation or positional relationship shown in the drawings, only for the purpose of facilitating the description of the present application and simplifying the description, and is not intended to indicate or imply that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore should not be understood as limiting the present application.
[0062] In the description of the present application, it should be noted that the words such as setting, installation, connection, etc. should be understood broadly unless otherwise explicitly limited, and the person skilled in the art can reasonably determine the specific meaning of the above words in the present application in combination with the specific content of the technical solution.
[0063] Before introducing the present application, Swin Transformer, Mask RCNN and random forest are briefly described:
[0064] Swin Transformer:
[0065] Swin Transformer not only inherits the global attention mechanism of Transformer, which can pay attention to global information, but also uses a moving window method, so that adjacent windows in the feature map of the previous layer can also be associated and pay attention to some information related to adjacent windows, so that the model feature extraction ability is enhanced. Because of the use of moving window, the self-attention mechanism is calculated within the window, which can reduce the complexity of calculation, and the model can get better results faster.
[0066] The structure of Swin Transformer has four stages, and the structures of the four stages are almost the same. Each stage contains a Swin Transformer block, and the difference lies in the number of Swin Transformer blocks in each stage. Only the first stage has a structure that is a little different from the other stages, but actually the functions of the two modules of Patch patition and Linear Embeding are equivalent to a Patch Merging module, which all play the role of down-sampling. After the input picture of HxWx3 size is processed by the Patch Partition module, the picture is divided into small blocks of 4x4, and the pixels in each small block are combined into a vector. The size of the output picture is The Linear Embeding module will change the dimension of the input vector to the dimension that the Transformer can accept, and then the first two dimensions of the picture are flattened. After the SwinTransformer module, the size becomes
[0067] The Swin Transformer Block module has two similar parts, the former part is composed of a layer normalization (LN) layer, a window-based multi-head self-attention (W-MSA) module, a residual connection and a multi-layer perceptron (MLP), and the only difference in the latter part is that the W-MSA module is replaced by a shift window-based multi-head self-attention (SW-MSA) module. SW-MSA is a method of using a moving window based on W-MSA, and the latter uses a method of using a moving window based on the former, which is equivalent to shifting the window of the l-th feature layer from the top left corner to the right and downward by [M / 2] pixels respectively, so that the four windows of the l-th layer have information exchange with each other.
[0068] In the Swin Transformer Block module and respectively represent the outputs of the W-MSA and SW-MSA modules, z l and z l+1 respectively represent the outputs of the MLP modules in the first and second parts, and the specific calculation formula in the Swin Transformer Block module is as follows.
[0069]
[0070] Mask RCNN:
[0071] The Mask RCNN algorithm can segment the target while ensuring high accuracy and fast training speed.
[0072] The Mask-RCNN algorithm is composed of a base network, a region proposal network (RPN), a classification network, and a mask segmentation network. The base network is composed of a residual network with removed full connection layers, and a feature pyramid (FPN) is used for resampling the image, fusing the two feature maps, and outputting feature maps with different depths, so that the feature maps have more complete image information for subsequent operations. The role of the RPN is to use the trained parameters to provide the classification network with a region of interest alignment layer (RoIAlign) in the generated candidate box. The input of the RPN is the feature map after feature extraction, and many candidate boxes are generated on the feature map. The RPN first realizes binary classification and boundary box prediction for the candidate boxes, then uses the non-maximum suppression method to screen the candidate boxes, reduces invalid candidate boxes, and leaves effective candidate boxes, improving the efficiency of the classification network and regression task to be performed later. Among them, RoIAlign cancels the quantization operation compared to RoIpooling, thereby reducing the impact of the misalignment caused by the quantization operation on the algorithm accuracy. The function of the classification network is to predict the category of the detection target within the RoIAlign range and adjust the RoIAlign position to reduce the impact of the inaccurate RoIAlign position on the algorithm accuracy. The principle of the mask segmentation network is to classify the category of the target to which the detection target belongs pixel by pixel based on the RoIAlign position and the result of the classification network.
[0073] Random forest:
[0074] Random forest is an algorithm that integrates multiple trees through the idea of ensemble learning. Its basic unit is a decision tree, and its essence belongs to a branch of machine learning, ensemble learning method. Random forest belongs to ensemble algorithm, which belongs to bagging in ensemble algorithm, and the other is boosting. Ensemble means that the algorithm is composed of multiple algorithms. Random forest is integrated by decision trees, and each decision tree is a classifier (assuming that it is now for classification problem). For an input sample, N trees will have N classification results. Random forest integrates all voting results and specifies the class with the most votes as the final output, which is a simple bagging idea. Random forest is used to solve the problem of weak generalization ability of decision tree, because decision tree has only one decision flow, and its generalization ability is weak. Random forest can solve this problem. The randomness of random forest mainly includes two aspects: random selection of features and random selection of samples. For example, we have N data and M features for each data. Random forest will randomly select X sample data and Y features, and then form multiple decision trees.
[0075] The traditional method for detecting the infectivity of pulmonary tuberculosis is sputum smear and sputum culture, which is undeniable in effectiveness, but this method itself needs a certain period of time to draw a conclusion, and in areas where medical resources are scarce, it is even more difficult to detect patients with infectious pulmonary tuberculosis in time. For pulmonary tuberculosis, hospitals will also make image-based judgments, but this is very limited in high-burden countries where medical resources and radiology experts are scarce. At the same time, the cases of pulmonary tuberculosis patients that hospitals can access are relatively few, and traditional classification methods cannot draw good conclusions. Most current CT image classification of pulmonary tuberculosis focuses on binary classification detection based on X-ray films, ignoring the fact that CT has better accuracy detection and diagnosis than X-ray films, and ignoring the impact of different types of pulmonary tuberculosis on doctor's diagnosis of the disease.
[0076] In order to solve the above technical defects, according to the Figure 1 The application also provides a pulmonary tuberculosis CT image classification method, comprising:
[0077] Step S101, acquiring a labeled pulmonary tuberculosis CT image dataset and a to-be-predicted image;
[0078] Step S102, constructing an initial pulmonary tuberculosis CT image classification model based on a Mask RCNN model;
[0079] Step S103, acquiring a first training parameter of the initial pulmonary tuberculosis CT image classification model;
[0080] Step S104, input the labeled tuberculosis CT image dataset into the initial tuberculosis CT image classification model for training, obtain the multi-task loss value of the first RPN network, the first predicted multi-task loss value and the first tuberculosis CT image classification model;
[0081] Step S105, if the multi-task loss value of the first RPN network and the first predicted multi-task loss value reach the preset value, the first tuberculosis CT image classification model is taken as the trained tuberculosis CT image classification model; if the multi-task loss value of the first RPN network and the first predicted multi-task loss value do not reach the preset value, the first training parameter is updated according to the multi-task loss value of the first RPN network and the first predicted multi-task loss value, to obtain the second training parameter, the first tuberculosis CT image classification model is trained according to the second training parameter and the labeled tuberculosis CT image dataset, to obtain the multi-task loss value of the second RPN network, the second predicted multi-task loss value and the second tuberculosis CT image classification model;
[0082] Step S106, if the multi-task loss value of the second RPN network and the second predicted multi-task loss value reach the preset value, the second tuberculosis CT image classification model is taken as the trained tuberculosis CT image classification model; if the multi-task loss value of the second RPN network and the second predicted multi-task loss value do not reach the preset value, the second training parameter is updated according to the multi-task loss value of the second RPN network and the second predicted multi-task loss value, to obtain the third training parameter, and the iteration is carried out in turn until the iteration number reaches the maximum iteration number set in advance or the multi-task loss value of the RPN network obtained by iteration and the predicted multi-task loss value reach the preset value, to obtain the trained tuberculosis CT image classification model;
[0083] Step S107, input the image to be predicted into the trained tuberculosis CT image classification model, to obtain the tuberculosis CT image classification result of the image to be predicted.
[0084] The method comprises the following steps: obtaining a labeled tuberculosis CT image data set and a to-be-predicted image, constructing an initial tuberculosis CT image classification model based on a Mask RCNN model, obtaining first training parameters of the initial tuberculosis CT image classification model, inputting the labeled tuberculosis CT image data set into the initial tuberculosis CT image classification model for training, obtaining a multi-task loss value of a first RPN network, a first predicted multi-task loss value and a first tuberculosis CT image classification model, if the multi-task loss value of the first RPN network and the first predicted multi-task loss value reach a preset value, taking the first tuberculosis CT image classification model as a trained tuberculosis CT image classification model, if the multi-task loss value of the first RPN network and the first predicted multi-task loss value do not reach the preset value, updating the first training parameters according to the multi-task loss value of the first RPN network and the first predicted multi-task loss value to obtain second training parameters, training the first tuberculosis CT image classification model according to the second training parameters and the labeled tuberculosis CT image data set, obtaining a multi-task loss value of a second RPN network, a second predicted multi-task loss value and a second tuberculosis CT image classification model, if the multi-task loss value of the second RPN network and the second predicted multi-task loss value reach the preset value, taking the second tuberculosis CT image classification model as the trained tuberculosis CT image classification model, if the multi-task loss value of the second RPN network and the second predicted multi-task loss value do not reach the preset value, updating the second training parameters according to the multi-task loss value of the second RPN network and the second predicted multi-task loss value to obtain third training parameters, and the like, until the number of iterations reaches a maximum number of iterations set in advance or the multi-task loss value of the RPN network and the predicted multi-task loss value obtained through iteration reach the preset value, obtaining the trained tuberculosis CT image classification model, inputting the to-be-predicted image into the trained tuberculosis CT image classification model, obtaining a tuberculosis CT image classification result of the to-be-predicted image, and improving the classification efficiency and classification accuracy of tuberculosis infectivity.
[0085] In some embodiments, the labeled tuberculosis CT image data set is input into the initial tuberculosis CT image classification model for training, and the calculation formula of the multi-task loss value of the first RPN network is as follows:
[0086]
[0087]
[0088]
[0089]
[0090] wherein, L cls represents a foreground-background classification loss, L regdenotes the anchor regression loss, p i denotes the probability that the i-th anchor predicts the real label, denotes 1 when it is a positive sample and 0 when it is a negative sample, t i denotes the predicted bounding box regression parameters of the i-th anchor, denotes the real bounding box regression parameters corresponding to the i-th anchor, N cls denotes the number of all samples in a batch-size, N reg denotes the number of anchor positions, and λ denotes a coefficient parameter, denotes a robust loss function, x denotes the error value between the predicted value and the real value.
[0091] In some embodiments, the first predicted multi-task loss value includes a classification loss value, a bounding box regression loss value, and a mask loss value; wherein the classification loss value and the bounding box regression loss value are calculated in the following manner:
[0092] L(p, u, t u ,v) = L cls (p, u) + λ[u≥1]L loc (t u ,v)
[0093] L cls (p, u) = -log p u
[0094]
[0095] wherein p denotes the softmax probability distribution predicted by the classifier p = (p0,..., p k ), u denotes the real class label of the corresponding target, t u denotes the regression parameters of the real class label u predicted by the bounding box regressor, v denotes the bounding box regression parameters of the corresponding real target, λ denotes a coefficient parameter, [u≥1] denotes the Iverson bracket, (x, y) denotes the coordinates of the center point of the detected target box, w denotes the width of the target box, and h denotes the height of the target box, L(p, u, t u ,v) denotes the classification and bounding box regression loss value, L cls (p, u) denotes the classification loss value, and L loc (t u ,v) denotes the bounding box regression loss value.
[0096] In some embodiments, the mask loss value is calculated in the following manner:
[0097]
[0098] wherein L mask denotes the mask loss value, 1 c denotes 1 when the cth channel corresponds to the true class of the target, otherwise 0; C denotes the number of masks, z denotes the label value of the mask at the current position, f denotes the output value at the current position, and m denotes the mask size value.
[0099] In some embodiments, a labeled tuberculosis CT image dataset is input into an initial tuberculosis CT image classification model for training to obtain a first tuberculosis CT image classification model, including:
[0100] The labeled tuberculosis CT image dataset is input into the initial tuberculosis CT image classification model to obtain tuberculosis CT image classification data, wherein the tuberculosis CT image classification data includes the type of lesion, the number of lesions, the number of various types of lesions, the location of lesions, the size of lesions, and the probability of detection of each lesion.
[0101] The tuberculosis CT image classification data is integrated to obtain a tuberculosis CT image classification dataset.
[0102] The initial tuberculosis CT image classification model is trained according to the tuberculosis CT image classification dataset to obtain the first tuberculosis CT image classification model.
[0103] In some embodiments, the tuberculosis CT image classification data is integrated to obtain a tuberculosis CT image classification dataset, and the calculation formula is:
[0104] n k =Class_num(Get_result(result),c k )
[0105] p k =Posibility(Get_result(result),c k )
[0106] q=In_result(Get_result(result),c1)+In_result(Get_result(result),c2)+...
[0107]
[0108] wherein result represents a result variable of one detection, Get_result() function represents querying all lesion information in the result, c k represents the kth lesion, and In_result() function represents determining whether the queried result contains lesion information of a certain type, n krepresents the number of the kth lesion, p represents the probability of the kth lesion, I represents the position of the lesion, and d is a preset auxiliary value. k represents the probability of the kth lesion, I represents the position of the lesion, and d is a preset auxiliary value.
[0109] In some embodiments, a labeled tuberculosis CT image dataset is obtained, including:
[0110] A lung computed tomography image is collected, and the lung computed tomography image is converted into a base format image through a format conversion method;
[0111] The base format image is subjected to mean filtering, wavelet denoising and Gaussian filtering to obtain a denoised image.
[0112] The denoised image is subjected to data enhancement through a histogram equalization and saturation contrast adjustment method to obtain a data-enhanced image.
[0113] The data-enhanced image is subjected to linear and nonlinear transformation to obtain a normalized image.
[0114] The normalized image is subjected to image labeling through labelme to obtain a labeled tuberculosis CT image dataset, wherein the labeling of the labeled tuberculosis CT image dataset includes caseous lesions, tree-in-bud lesions, consolidation lesions and cavity lesions.
[0115] In some embodiments, the tuberculosis CT image classification method further includes:
[0116] The attention value is calculated through the self-attention mechanism of the Swin Transformer network, and the calculation formula of the attention value calculated through the self-attention mechanism of the Swin Transformer network is:
[0117]
[0118] wherein K represents a key matrix, V represents a value matrix, Q represents a query matrix, d k represents the dimension of the column feature in the key matrix.
[0119] In some embodiments, the initial tuberculosis infectiousness classification model includes a Swin Transformer network, an RPN network, a RoiAlign, a fully connected layer and a full convolutional layer.
[0120] To facilitate understanding by those skilled in the art, a set of experimental data is provided below:
[0121] A large hospital specializing in tuberculosis collected CT image pictures of 1000 tuberculosis patients, and the dataset was divided into 500 positive patients and 500 negative patients. The method was used to experiment on these data, and the results obtained by the method are as follows:
[0122] Referring to Figure 2 , the first part of the application is to detect lesions, the average accuracy of the four lesions detected by the application is 81.7%, and the detection effect is as shown in Figure 2 . Figure 2 The horizontal coordinates of the images are step (the number of steps of the model, that is, the number of times of updating the parameter weight), and the vertical coordinates are mAP, respectively. The dark curve in the figure is the result after smoothing, and the light curve is the curve before processing. We can see that in the bbox_mAP image, the mAP value steadily increases before 3.5k steps, and tends to be stable after 3.5k steps, with a maximum value of about 0.61; similarly, in the bbox_mAP_50 image, the mAP value steadily increases before 3.5k steps, and tends to be stable after 3.5k steps, reaching a maximum value of 0.83 at 3.3k steps; in the bbox_mAP_75 image, the maximum value of mAP is 0.73.
[0123] Referring to Figure 3 , the second part of the application is to classify the infectivity, which uses random forest to classify and judge according to the comprehensive information of the lesions. The classification accuracy without using hyperparameter optimization optimization is 76%, and after using it, the classification accuracy is 80%, and the optimized hyperparameter content is: n_estimators=275, min_samples_split=2, min_samples_leaf=1, max_depth=3. The ROC image of the classification is shown in the figure above, the ROC curve divides the entire image into two parts, the area under the curve is called AUC, which is used to reflect the authenticity of the detection method. When it is necessary to evaluate a diagnostic method or compare the advantages and disadvantages of two diagnostic methods, that is, it is necessary to use AUC to test, the higher the AUC value, that is, the larger the area under the curve, the higher the prediction accuracy. The AUC value of the ROC curve of the application is as high as 0.81, combined with the classification accuracy of 80%, it can be seen that the classification effect of the application on the infectivity of pulmonary tuberculosis is very good.
[0124] After the above experiment, a second experiment was conducted, again using 1000 CT image pictures of patients with pulmonary tuberculosis, the data set was divided into 500 positive patients and 500 negative patients, and the classical network models AlexNet, VGGNet, GoogleNet and ResNet were used for experiments. It can be seen that these models have general effect on such small medical data sets, and the specific results are shown in the following table.
[0125] The method of the invention AlexNet VGGNet GoogleNet ResNet Classification accuracy 80% 72.5% 48% 52% 50.7%
[0126] The application uses a Mask Rcnn network based on a swin transformer to solve the problem of the infectivity of pulmonary tuberculosis in combination with a support vector machine. The first part is to detect lesions, and the method used in this part combines a swin transformer model and can better perform feature extraction. The average accuracy of the four lesions detected by the method of the application is 88.7%; the second part is to judge the infectivity, and a support vector machine is used to classify and judge according to the comprehensive information of the lesions, and the classification accuracy is 83.5%. According to these data, more information can be provided to doctors, and at the same time, the level requirement of radiologists is reduced, and the auxiliary diagnosis of the infectivity of pulmonary tuberculosis can be well performed.
[0127] With the continuous improvement of computer capabilities and the continuous in-depth research of deep learning methods, the combination of deep learning and medicine will continue to deepen, not only limited to the fields of auxiliary diagnosis, lesion detection, prediction, etc., but also can solve more complex medical problems and reduce the workload of doctors. It can be predicted that in the problem of the infectivity of pulmonary tuberculosis, deep learning methods will play a more important role and solve this problem in depth.
[0128] In addition, with reference to Figure 4 One embodiment of the application provides a pulmonary tuberculosis CT image classification system, which comprises an image acquisition module 1100, a classification model construction module 1200, a classification model training module 1300 and a classification result output module 1400, wherein:
[0129] The image acquisition module 1100 is used for acquiring an annotated pulmonary tuberculosis CT image dataset and a to-be-predicted image;
[0130] The classification model construction module 1200 is used for constructing an initial pulmonary tuberculosis CT image classification model based on a Mask RCNN model: acquiring first training parameters of the initial pulmonary tuberculosis CT image classification model;
[0131] The classification model training module 1300 is configured to input the labeled pulmonary tuberculosis CT image dataset into an initial pulmonary tuberculosis CT image classification model for training, obtain a multi-task loss value of a first RPN network, a first predicted multi-task loss value, and a first pulmonary tuberculosis CT image classification model; if the multi-task loss value of the first RPN network and the first predicted multi-task loss value reach a preset value, the first pulmonary tuberculosis CT image classification model is taken as a trained pulmonary tuberculosis CT image classification model; if the multi-task loss value of the first RPN network and the first predicted multi-task loss value do not reach the preset value, the first training parameter is updated according to the multi-task loss value of the first RPN network and the first predicted multi-task loss value to obtain a second training parameter, the first pulmonary tuberculosis CT image classification model is trained according to the second training parameter and the labeled pulmonary tuberculosis CT image dataset, a multi-task loss value of a second RPN network, a second predicted multi-task loss value, and a second pulmonary tuberculosis CT image classification model are obtained, if the multi-task loss value of the second RPN network and the second predicted multi-task loss value reach the preset value, the second pulmonary tuberculosis CT image classification model is taken as the trained pulmonary tuberculosis CT image classification model; if the multi-task loss value of the second RPN network and the second predicted multi-task loss value do not reach the preset value, the second training parameter is updated according to the multi-task loss value of the second RPN network and the second predicted multi-task loss value to obtain a third training parameter, and the process is repeated in turn until the number of iterations reaches a maximum number of iterations set in advance or the multi-task loss value of the RPN network and the predicted multi-task loss value obtained by iteration reach the preset value, and the trained pulmonary tuberculosis CT image classification model is obtained.
[0132] The classification result output module 1400 is configured to input the to-be-predicted image into the trained pulmonary tuberculosis CT image classification model to obtain a pulmonary tuberculosis CT image classification result of the to-be-predicted image.
[0133] The system obtains a labeled tuberculosis CT image data set and a to-be-predicted image, constructs an initial tuberculosis CT image classification model based on a Mask RCNN model, obtains first training parameters of the initial tuberculosis CT image classification model, inputs the labeled tuberculosis CT image data set into the initial tuberculosis CT image classification model for training, obtains a multi-task loss value of a first RPN network, a first predicted multi-task loss value and a first tuberculosis CT image classification model, and if the multi-task loss value of the first RPN network and the first predicted multi-task loss value reach a preset value, the first tuberculosis CT image classification model is taken as a trained tuberculosis CT image classification model. If the multi-task loss value of the first RPN network and the first predicted multi-task loss value do not reach the preset value, the first training parameters are updated according to the multi-task loss value of the first RPN network and the first predicted multi-task loss value to obtain second training parameters, the first tuberculosis CT image classification model is trained according to the second training parameters and the labeled tuberculosis CT image data set to obtain a multi-task loss value of a second RPN network, a second predicted multi-task loss value and a second tuberculosis CT image classification model, and if the multi-task loss value of the second RPN network and the second predicted multi-task loss value reach the preset value, the second tuberculosis CT image classification model is taken as the trained tuberculosis CT image classification model. If the multi-task loss value of the second RPN network and the second predicted multi-task loss value do not reach the preset value, the second training parameters are updated according to the multi-task loss value of the second RPN network and the second predicted multi-task loss value to obtain third training parameters, and the process is repeated until the number of iterations reaches a maximum number of iterations set in advance or the multi-task loss value of the RPN network and the predicted multi-task loss value obtained through iteration reach the preset value, thereby obtaining the trained tuberculosis CT image classification model. The to-be-predicted image is input into the trained tuberculosis CT image classification model to obtain a tuberculosis CT image classification result of the to-be-predicted image, and the classification efficiency and the classification accuracy of tuberculosis infectivity are improved.
[0134] It should be noted that the system embodiment and the system embodiment described above are based on the same inventive concept, and therefore the related content of the above method embodiments is also applicable to the system embodiment, which will not be described here.
[0135] The application also provides a tuberculosis CT image classification electronic device, which comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the tuberculosis CT image classification method described above when executing the computer program.
[0136] The processor and the memory can be connected through a bus or other means.
[0137] The memory, as a non-transitory computer readable storage medium, can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory can include high-speed random access memory, and can also include non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory can optionally include a memory that is remotely arranged relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0138] The non-transitory software programs and instructions required to implement the above-mentioned embodiments of the tuberculosis CT image classification method are stored in the memory, and when executed by the processor, the tuberculosis CT image classification method in the above-mentioned embodiments is executed, for example, the method steps S101 to S107 in the above-described Figure 1 are executed.
[0139] The present application also provides a computer readable storage medium storing computer executable instructions for executing the tuberculosis CT image classification method as described above.
[0140] The computer readable storage medium stores computer executable instructions, which are executed by a processor or a controller, for example, by a processor in the above-mentioned electronic device embodiment, so that the above-mentioned processor executes the tuberculosis CT image classification method in the above-mentioned embodiments, for example, the method steps S101 to S107 in the above-described Figure 1 are executed.
[0141] As will be appreciated by one of ordinary skill in the art, all or some of the steps, systems, and techniques disclosed herein can be embodied in software, firmware, hardware, or any suitable combination thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application- specific integrated circuit. Such software can be distributed on computer readable media, which can comprise computer storage media (or non-transitory media), and communication media (or transitory media). As will be appreciated by one of ordinary skill in the art, the term computer storage media includes all physical and tangible computer storage media, such as a volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules, or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by a computer. Further, as will be appreciated by one skilled in the art, communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. In the foregoing specification, the concepts have been described with reference to specific embodiments. However, one of ordinary skill in the art appreciates that various modifications and changes can be made without departing from the scope of the application as set forth in the claims below. Accordingly, the specification is to be regarded in an illustrative rather than a restrictive sense.
[0142] The embodiments of the present application disclosed above are only used to explain the principle of the present application, and the present application is not limited to the above embodiments. Various changes can be made by those skilled in the art without departing from the spirit of the present application.
Claims
1. A method for classifying CT images of pulmonary tuberculosis, characterized in that, The CT image classification method for pulmonary tuberculosis includes: Obtain a dataset of labeled CT images of pulmonary tuberculosis and the images to be predicted; An initial CT image classification model for pulmonary tuberculosis was constructed based on the Mask RCNN model; Obtain the first training parameters of the initial pulmonary tuberculosis CT image classification model; The labeled pulmonary tuberculosis CT image dataset is input into the initial pulmonary tuberculosis CT image classification model for training, and the multi-task loss value of the first RPN network is obtained. The first predicted multi-task loss value is compared with the first pulmonary tuberculosis CT image classification model. If the multi-task loss value of the first RPN network and the first predicted multi-task loss value reach a preset value, the first tuberculosis CT image classification model is used as the trained tuberculosis CT image classification model; if the multi-task loss value of the first RPN network and the first predicted multi-task loss value do not reach the preset value, the first training parameters are updated according to the multi-task loss value of the first RPN network and the first predicted multi-task loss value to obtain the second training parameters. The first tuberculosis CT image classification model is trained according to the second training parameters and the labeled tuberculosis CT image dataset to obtain the multi-task loss value of the second RPN network, the second predicted multi-task loss value and the second tuberculosis CT image classification model. If the multi-task loss value of the second RPN network and the second predicted multi-task loss value reach a preset value, the second tuberculosis CT image classification model is used as the trained tuberculosis CT image classification model; if the multi-task loss value of the second RPN network and the second predicted multi-task loss value do not reach the preset value, the second training parameters are updated according to the multi-task loss value of the second RPN network and the second predicted multi-task loss value to obtain the third training parameters, and so on, until the number of iterations reaches the preset maximum number of iterations or the multi-task loss value of the RPN network and the predicted multi-task loss value obtained by the iterations reach the preset value, and the trained tuberculosis CT image classification model is obtained. The image to be predicted is input into the trained CT image classification model for tuberculosis, and the CT image classification result for tuberculosis of the image to be predicted is obtained.
2. The CT image classification method for pulmonary tuberculosis according to claim 1, characterized in that, The labeled pulmonary tuberculosis CT image dataset is input into the initial pulmonary tuberculosis CT image classification model for training, and the calculation formula for the multi-task loss value of the first RPN network is as follows: Among them, L cls L represents the foreground / background classification loss. reg p represents the anchor regression loss. i This represents the probability that the i-th anchor point is predicted to be the true label. This indicates that t is 1 for positive samples and 0 for negative samples. i This represents the bounding box regression parameters for predicting the i-th anchor point. N represents the regression parameters of the true bounding box corresponding to the i-th anchor point. cls N represents the total number of samples in a batch size. reg This represents the number of anchor positions, and λ represents the coefficient parameter. This represents the robust loss function, where x represents the error between the predicted and the true values.
3. The CT image classification method for pulmonary tuberculosis according to claim 2, characterized in that, The first predicted multi-task loss value includes a classification loss value, a bounding box regression loss value, and a mask loss value; wherein, the classification loss value and the bounding box regression loss value are calculated in the following manner: L(p,u,t u ,v)=L cls (p,u)+λ[u≥1]L loc (t u ,v) L cls (p,u)=-log p u Where p represents the softmax probability distribution predicted by the classifier, p = (p0,...,p...). k ), u represents the true category label of the corresponding target, t u L(p,u,t) represents the regression parameters of the predicted true class label u by the bounding box regressor, v represents the bounding box regression parameters corresponding to the true target, λ represents the coefficient parameters, [u≥1] denotes Iverson brackets, (x,y) represents the coordinates of the center point of the detected target box, w represents the width of the target box, h represents the height of the target box, and L(p,u,t) represents the regression parameters of the predicted true class label u by the bounding box regressor, v represents the regression parameters of the bounding box corresponding to the true target, λ represents the coefficient parameters, [u≥1] denotes Iverson brackets, (x,y) represents the coordinates of the center point of the detected target box, w represents the width of the target box, h represents the height of the target box, and L(p,u,t) represents the height of the target box. u (v) represents the classification and bounding box regression loss value, L cls (p,u) represents the classification loss value, L loc (t u ,v) represents the bounding box regression loss value.
4. The CT image classification method for pulmonary tuberculosis according to claim 3, characterized in that, The mask loss value is calculated as follows: Among them, L mask Indicates the mask loss value, 1 c The value is 1 if the c-th channel corresponds to the true category of the target, and 0 otherwise; C represents the number of masks, z represents the label value of the mask at the current position that is 0 or 1, f represents the output value at the current position, and m represents the mask size value.
5. The CT image classification method for pulmonary tuberculosis according to claim 4, characterized in that, The step of inputting the labeled CT image dataset of pulmonary tuberculosis into the initial CT image classification model of pulmonary tuberculosis for training to obtain the first CT image classification model of pulmonary tuberculosis includes: The labeled CT image dataset of pulmonary tuberculosis is input into the initial CT image classification model of pulmonary tuberculosis to obtain CT image classification data of pulmonary tuberculosis. The CT image classification data of pulmonary tuberculosis includes the type of lesion, the number of lesion types, the number of each type of lesion, the location of the lesion, the size of the lesion, and the probability of detection of each lesion. The CT image classification data of pulmonary tuberculosis are integrated to obtain a CT image classification dataset of pulmonary tuberculosis; The initial pulmonary tuberculosis CT image classification model is trained based on the pulmonary tuberculosis CT image classification dataset to obtain the first pulmonary tuberculosis CT image classification model.
6. The CT image classification method for pulmonary tuberculosis according to claim 5, characterized in that, The formula for integrating the pulmonary tuberculosis CT image classification data to obtain the pulmonary tuberculosis CT image classification dataset is as follows: n k =Class_num(Get_result(result),c k ) p k =Posibility(Get_result(result),c k ) q=In_result(Get_result(result),c1)+In_result(Get_result(result),c2)+... Here, `result` represents the result variable of a single test, and the `Get_result()` function retrieves all lesion information from the results. k This represents the k-th type of lesion. The In_result() function determines whether the query results contain information about a certain type of lesion. k p represents the number of the k-th type of lesion. k Let represent the probability of the k-th type of lesion, l represent the location of the lesion, and d represent a pre-set auxiliary value.
7. The CT image classification method for pulmonary tuberculosis according to claim 1, characterized in that, The acquisition of the labeled CT image dataset for pulmonary tuberculosis includes: Acquire computed tomography (CT) images of the lungs, and convert the CT images of the lungs into a basic format image using a format conversion method; The base format image is subjected to mean filtering, wavelet denoising and Gaussian filtering to obtain the denoised image; The denoised image is augmented using histogram equalization and saturation / contrast adjustment methods to obtain an augmented image. The data-enhanced image is subjected to linear and nonlinear transformations to obtain a normalized image; The normalized images are labeled using labelme to obtain the labeled CT image dataset of pulmonary tuberculosis. The labels in the labeled CT image dataset of pulmonary tuberculosis include caseous lesions, tree-in-bud lesions, consolidation lesions, and cavitary lesions.
8. A CT image classification system for pulmonary tuberculosis, characterized in that, The CT image classification system for pulmonary tuberculosis includes: The image acquisition module is used to acquire a dataset of labeled CT images of pulmonary tuberculosis and the image to be predicted. The classification model construction module is used to construct an initial pulmonary tuberculosis CT image classification model based on the Mask RCNN model: obtaining the first training parameters of the initial pulmonary tuberculosis CT image classification model; The classification model training module is used to input the labeled pulmonary tuberculosis CT image dataset into the initial pulmonary tuberculosis CT image classification model for training, obtaining the multi-task loss value of the first RPN network, the first predicted multi-task loss value, and the first pulmonary tuberculosis CT image classification model; if the multi-task loss value of the first RPN network and the first predicted multi-task loss value reach a preset value, the first pulmonary tuberculosis CT image classification model is used as the trained pulmonary tuberculosis CT image classification model; if the multi-task loss value of the first RPN network and the first predicted multi-task loss value do not reach the preset value, the first training parameters are updated according to the multi-task loss value of the first RPN network and the first predicted multi-task loss value to obtain second training parameters, and the first pulmonary tuberculosis CT image classification model is trained according to the second training parameters and the labeled pulmonary tuberculosis CT image dataset. The image classification model obtains the multi-task loss value of the second RPN network, the second predicted multi-task loss value, and the second tuberculosis CT image classification model. If the multi-task loss value of the second RPN network and the second predicted multi-task loss value reach a preset value, the second tuberculosis CT image classification model is used as the trained tuberculosis CT image classification model. If the multi-task loss value of the second RPN network and the second predicted multi-task loss value do not reach the preset value, the second training parameters are updated according to the multi-task loss value of the second RPN network and the second predicted multi-task loss value to obtain the third training parameters. This process is repeated until the number of iterations reaches the preset maximum number of iterations or the multi-task loss value of the RPN network and the predicted multi-task loss value obtained from the iterations reach the preset value, thus obtaining the trained tuberculosis CT image classification model. The classification result output module is used to input the image to be predicted into the trained pulmonary tuberculosis CT image classification model to obtain the pulmonary tuberculosis CT image classification result of the image to be predicted.
9. A CT image classification device for pulmonary tuberculosis, characterized in that, It includes at least one control processor and a memory for communicatively connecting to the at least one control processor; the memory stores instructions executable by the at least one control processor, which, when executed by the at least one control processor, enable the at least one control processor to perform a CT image classification method for tuberculosis as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions for causing a computer to perform a CT image classification method for tuberculosis as described in any one of claims 1 to 7.