A method, system and medium for pathogen classification of pneumonia CT images
By combining semi-supervised learning and contrast learning, pseudo-labels are generated using adaptive confidence thresholds and supervised and self-supervised comparison learning, the problem of relying on a large amount of labeled data for the pathogenic classification of pneumonia CT imaging in the prior art is solved, and a high-precision pathogenic classification of pneumonia CT imaging is achieved.
Patent Information
- Application Number
- CN202510168391.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-17
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2045-02-17
AI Technical Summary
The prior art relies on a large amount of labeled data in the pathogenic classification of pneumonia CT imaging, and it is difficult to effectively utilize labeled data, resulting in low prediction accuracy and limiting its practical application.
Semi-supervised learning and contrast learning are used to generate high-quality pseudo-labels through adaptive confidence thresholds, supervised comparison learning is performed on labeled images and pseudo-label images, and self-supervised comparison learning is performed on the remaining unlabeled images to build a high-precision pneumonia CT imaging pathogen classification system.
With a small amount of labeled data and a large amount of unlabeled data, the differentiated characteristics between CT images of different pathogenic types are effectively learned, which improves the accuracy of pathogenic classification of pneumonia CT images, and achieves accurate and efficient auxiliary diagnosis of pneumonia etiology.
Smart Images

Figure CN119625443B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of medical image processing technology, and in particular to a method, system and medium for pathogen classification of pneumonia CT images. Background Art
[0002] Efficient and accurate etiological diagnosis of pneumonia is the basis for standardizing treatment, improving efficacy, reducing drug resistance and avoiding complications. At present, clinical pneumonia pathogen detection mostly relies on bronchoscopy to obtain alveolar lavage fluid for microbiological testing, but its culture cycle is long and the detection rate is not high; some special detection methods (such as lung tissue biopsy) are expensive and invasive, and are difficult to use as routine examination methods. Computed tomography (CT) imaging is an important means of diagnosing pneumonia, but due to the overlap of signs of different pathogenic types of pneumonia (including bacterial pneumonia, viral pneumonia, fungal pneumonia, mycoplasma pneumonia, chlamydial pneumonia and rickettsial pneumonia, etc.), the same type of pneumonia may also show different signs. Only manually interpreting pneumonia CT images for etiological classification is not only time-consuming and laborious, but also has an average diagnostic accuracy of less than 70%.
[0003] Deep learning methods can automatically and efficiently extract multi-level features from pneumonia CT images, obtain rich features that far exceed what the human eye can recognize, and perform quantitative analysis, which is expected to achieve accurate and efficient pneumonia etiology auxiliary diagnosis. In order to improve the prediction accuracy of deep networks, a large amount of labeled data is usually required for network training. For example, Chinese patent CN111724356B provides an image processing method and system for CT image pneumonia recognition, which requires training a pneumonia segmentation model to obtain a pneumonia mask. The pneumonia mask is used during the training of the convolution classification model to make the network more focused on the mask area, and the final pneumonia classification result is related to the mask area predicted by the segmentation model. In order to improve the classification accuracy of pneumonia, the prediction accuracy of the pneumonia segmentation model must be guaranteed, which usually requires a large amount of high-quality manually annotated pneumonia CT image data. However, due to the diverse imaging manifestations of pneumonia-infected areas and the frequent occurrence of diffuse lesions, manually annotating pneumonia CT images is very time-consuming and labor-intensive. Therefore, this type of method often has low prediction accuracy due to insufficient high-quality annotated data, which limits its practical application.
[0004] Clinically, pneumonia CT images without pathogen category labels are relatively easy to obtain. However, due to the low detection rate of pneumonia etiology testing, the pathogen category labels corresponding to pneumonia CT images are difficult to obtain, resulting in insufficient labeled pneumonia CT image data that can be used for fully supervised deep learning, which restricts the accuracy of pneumonia CT image etiology classification. In order to improve the accuracy of pneumonia classification using unlabeled pneumonia CT images, Chinese patent CN115761342A proposes a method for classifying pneumonia in lung CT images, which restores the image by randomly masking it and training a Transformer model to improve the model representation ability without using category labels. Although this method can reduce the dependence on labeled data to a certain extent, thereby reducing the cost of data annotation, it is difficult to guide the network to fully learn the discriminative features between pneumonia CT images of different etiological types because it does not add classification supervision information during the training process. Therefore, it is difficult to effectively improve the prediction accuracy. In addition, the number of pneumonias of different etiological types is unevenly distributed, with viral pneumonia and bacterial pneumonia being the most common, accounting for more than 80%, resulting in a class imbalance in the pneumonia CT classification task, causing the predicted posterior probability of the deep network to be biased towards the majority class, increasing the difficulty of effectively using unlabeled pneumonia CT image data and making accurate predictions.
[0005] Therefore, there is an urgent need for a method that can simultaneously utilize a small amount of labeled pneumonia CT image data and a large amount of unlabeled pneumonia CT image data to effectively learn the discriminative features between pneumonia CT images of different etiological types without the need for pneumonia masks, build a high-precision pneumonia CT image etiological classification model, and achieve accurate and efficient pneumonia etiology-assisted diagnosis.
[0006] It should be noted that the above introduction to the technical background is only for the convenience of providing a clear and complete description of the technical solutions of the present application and for the convenience of understanding by those skilled in the art. It cannot be considered that the above technical solutions are well known to those skilled in the art simply because they are described in the background technology section of the present application. Summary of the invention
[0007] The purpose of the present invention is to provide a pneumonia CT image etiology classification method, system and medium, so as to construct a high-precision pneumonia CT image etiology classification system based on a small amount of labeled data and a large amount of unlabeled data.
[0008] In order to solve the above problems, in the first aspect, a method for pathogen classification of pneumonia CT images is provided, comprising the following steps:
[0009] S1. Collect pneumonia CT images to construct a training set, wherein the images include labeled images and unlabeled images;
[0010] S2, extracting features from the image using a feature extraction network to generate a corresponding feature vector;
[0011] S3, performing semi-supervised learning training: inputting the feature vector of the image into the classification head for classification prediction to obtain the prediction probability; based on the prediction probability, performing supervised learning on the labeled image; assigning a pseudo label to the unlabeled image based on the prediction probability and the generated adaptive confidence threshold, wherein the adaptive confidence threshold of each category is determined based on the current average prediction confidence of the unlabeled image and the average prediction probability of each category;
[0012] S4, performing contrastive learning training: based on the assigned pseudo-labels, the images are divided into remaining unlabeled images, labeled images and pseudo-labeled images, self-supervised contrastive learning is performed on the remaining unlabeled images, and supervised contrastive learning is performed jointly with the labeled images and pseudo-labeled images;
[0013] S5. Constructing a joint loss function based on the supervised learning, the self-supervised contrastive learning and the supervised contrastive learning, and performing back-propagation optimization;
[0014] S6, repeating steps S2 to S5 to perform iterative training until the training is completed;
[0015] S7. Based on the trained feature extraction network and classification head, a pneumonia CT image etiology classification system is established, and the pneumonia CT images are classified using the classification system.
[0016] This technical solution combines the methods of semi-supervised learning and contrastive learning. In semi-supervised learning, the designed confidence threshold is iteratively optimized by category to adaptively generate high-quality pseudo-labels that match the network learning state. Supervised contrastive learning is performed on labeled images and pseudo-labeled images, and self-supervised contrastive learning is performed on the remaining unlabeled images. The dynamic weighted balance loss is used to effectively alleviate the category imbalance problem, and a high-precision pneumonia etiology classification system is established.
[0017] Before step S2, the images are subjected to one weak enhancement and two different forms of strong enhancement; the weakly enhanced images are used for semi-supervised learning training, and the two different forms of strong enhanced images are used for comparative learning training.
[0018] In step S3, supervised learning is performed using a dynamic weighted balance loss based on the predicted probability of the labeled image and the corresponding true label. The supervised learning loss function is for:
[0019]
[0020]
[0021] in, is the number of labeled images in the current batch, Y is the number of pneumonia etiology categories contained in the labeled images, is the probability that the i-th labeled image is predicted to be the j-th class, is the jth component of the one-hot encoding of the i-th labeled image, represents the category weight of the j-th image, n j is the number of images of the jth category in the labeled images.
[0022] In step S3, the prediction category and prediction confidence are determined based on the prediction probability of the unlabeled image, and a pseudo label is assigned to the unlabeled image whose prediction confidence is greater than or equal to the adaptive confidence threshold of the corresponding category. The formula for generating the adaptive confidence threshold is as follows:
[0023]
[0024]
[0025]
[0026] in, is the adaptive confidence threshold of the y-th class at the t-th iteration, is the average prediction confidence of the unlabeled image at the tth iteration, is the average predicted probability of the y-th class at the t-th iteration, is the number of unlabeled images, is the prediction confidence of the i-th unlabeled image at the t-th iteration, is the probability that the i-th unlabeled image belongs to the y-th category at the t-th iteration, is the feature extraction network parameter at the tth iteration.
[0027] In step S4, the two strongly enhanced images in different forms are input into a projection head to form corresponding feature vector pairs in the projection space;
[0028] Based on the assigned pseudo-labels, the images are divided into remaining unlabeled images, labeled images, and pseudo-labeled images;
[0029] The feature vectors of the remaining unlabeled images are used for self-supervised contrastive learning. The loss function of self-supervised contrastive learning is: , the feature vectors of the labeled image and the pseudo-labeled image are combined to perform supervised contrastive learning. The supervised contrastive learning loss function is , the two loss functions are as follows:
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036] in, is the number of remaining unlabeled images in the current batch, is the feature vector of the strongly enhanced image in the projection space, and are the feature vectors of the two different forms of strongly enhanced images of the j-th unlabeled image in the projection space, is the temperature coefficient, is the index set of two strongly enhanced images: labeled images and pseudo-label images, is the sum of the number of labeled images and pseudo-labeled images in the current batch, is the index set of positive sample images with the same category as the i-th image.
[0037] The joint loss function , and is the weight coefficient; the joint loss function is minimized using the AdaBound algorithm , used to optimize the parameters of the feature extraction network, classification head and projection head.
[0038] The feature extraction network is 3D ResNet; the classification head consists of a 256-dimensional fully connected layer and a Softmax layer; and the projection head is a 256-dimensional fully connected layer projection head.
[0039] On the other hand, the present invention also provides a pneumonia CT image etiology classification system, which is trained using the method described in any one of the first aspects.
[0040] The classification system includes: a feature extraction network for receiving input images and performing feature extraction to generate feature vectors; a classification head for receiving the feature vectors generated by the feature extraction network and performing classification prediction to output pneumonia etiology classification results.
[0041] In yet another aspect, the present invention further provides a computer storage medium, wherein the computer storage medium stores a computer program; when the computer program is executed on a computer, the computer executes the method as described in any one of the first aspects.
[0042] Compared with the prior art, the beneficial effects of the present invention mainly include the following: the technical scheme combines the methods of semi-supervised learning and contrastive learning. In semi-supervised learning, the designed confidence threshold is iteratively optimized category by category to adaptively generate high-quality pseudo-labels that match the network learning state, perform supervised contrastive learning on labeled images and pseudo-labeled images, and perform self-supervised contrastive learning on the remaining unlabeled images. The dynamic weighted balance loss is used to effectively alleviate the category imbalance problem, and a high-precision pneumonia etiology classification system is established. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the specific 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 ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 A schematic diagram of the structure of a pneumonia CT image etiology classification system provided by the present invention.
[0045] Figure 2 This is a schematic diagram of the 3D ResNet network structure provided by the present invention.
[0046] Figure 3 A schematic diagram of the process of the pneumonia CT image etiology classification system provided by the present invention. DETAILED DESCRIPTION
[0047] The above and other technical contents, features and effects of the present invention will be clearly presented in the following detailed description of a preferred embodiment with reference to the drawings. The directional terms mentioned in the following embodiments, such as up, down, left, right, front or back, etc., are only referenced to the directions of the attached drawings. Therefore, the directional terms used are used to illustrate and not to limit the present invention.
[0048] The following will describe the various embodiments of the present application in detail with reference to the accompanying drawings. However, it will be appreciated by those skilled in the art that in the various embodiments of the present application, many technical details are provided in order to enable the reader to better understand the present application. However, even without these technical details and various changes and modifications based on the following embodiments, the technical solution claimed in the present application can be implemented.
[0049] The steps in the following embodiments do not correspond one to one with the summary of the invention.
[0050] Embodiment 1
[0051] The present application provides a method, system and medium for the etiology classification of pneumonia CT images, such as Figure 1 The figure is a schematic diagram of the structure of a pneumonia CT image etiology classification system provided by an embodiment of the present invention.
[0052] refer to Figure 1 The present invention provides a method, system and medium for the etiology classification of pneumonia CT images. The classification method comprises the following steps:
[0053] Step 1: Construct a dataset for pneumonia CT image etiology classification task;
[0054] Pneumonia CT image data from multiple centers were collected as training samples to construct a training set. The etiological types of pneumonia include bacterial pneumonia, viral pneumonia, fungal pneumonia, and mycoplasma pneumonia. Corresponding pathogen category labels were set for pneumonia CT images whose pathogen categories were confirmed by pathogen biology tests as a subset of labeled pneumonia CT image data. ; Pneumonia CT images without clear pathogen categories are used as the unlabeled pneumonia CT image data subset .
[0055] It can be understood that the pathogenic types of pneumonia include not only the above four types, but also other types such as Chlamydia and Rickettsia. This application does not limit the specific types and number of categories of pneumonia pathogens involved in the training.
[0056] Step 2: Establish a category-aware semi-supervised contrastive learning method that can use both labeled and unlabeled images to train a pneumonia CT image etiology classification model;
[0057] In the case of insufficient labeled pneumonia CT image data, in order to accurately and efficiently use unlabeled pneumonia CT images to improve the network representation ability, we first constructed a category-aware semi-supervised contrastive learning network, and adaptively generated high-quality pseudo labels for unlabeled images that matched the network learning state and the classification difficulty of each category through a confidence threshold iterative optimization mechanism; and further through category-aware contrastive learning, we effectively used labeled images, pseudo-label images, and unlabeled images to optimize the feature extraction network, learn the discriminative features between pneumonia CT images of different etiological types, and thus improve the accuracy of pneumonia CT image etiology classification. Specifically:
[0058] (1) Category-aware semi-supervised contrastive learning network and its training process construction
[0059] The unlabeled pneumonia CT image subset in the training set is represented as , the labeled pneumonia CT image subset is represented as ,in and Represent the number of unlabeled images and labeled images respectively, represents the corresponding category label, and Y represents the number of pneumonia pathogen types contained in the pneumonia CT image data used for training. Figure 1 The category-aware semi-supervised contrastive learning network shown in the figure has four main parts in its training process:
[0060] 1) Image enhancement: used to enhance unlabeled and labeled images. For any input pneumonia CT image , both use the medical image automatic enhancement method MedAugment for a weak enhancement and two different forms of strong enhancement and Among them, the weakly enhanced image is closer to the original image, and its classification result is more likely to be consistent with the classification result of the original image, so the weakly enhanced image For subsequent classification prediction, the two strongly enhanced images and Used for contrastive learning.
[0061] 2) Feature extraction: Characterize the features of the enhanced pneumonia CT images. The feature extraction network uses 3DResNet, which is composed of Indicates that Represents the parameters of the feature extraction network. The 3D ResNet used (network structure is as follows Figure 2 Repeated use The convolutional layers composed of convolutional kernels and residual connections construct a deep network. Downsampling is performed through the convolutional layer with a step size of 2 to reduce the size of the feature map. The number of convolutional kernels is doubled each time the sample is downsampled. Finally, average pooling is performed to obtain the extracted deep features. , feature extraction of the two strongly enhanced images is performed to obtain and .
[0062] 3) Adaptive pseudo-label semi-supervised learning: The feature vectors of weakly enhanced labeled images and weakly enhanced unlabeled images are input into a classification head composed of a 256-dimensional fully connected layer and a Softmax layer for classification prediction to obtain the predicted probability. It can be understood that for any input image, the network will output the probability corresponding to each category (that is, the predicted probability shows the corresponding probability value of the current image belonging to each category), and the sum of the probabilities of all categories is 100%; among them, the predicted category That is, the category with the highest probability, the prediction confidence That is, the probability corresponding to the predicted category. For example, when there are only three pathogen categories set during training, namely category 1, category 2, and category 3, and the predicted probability of a certain image is 20% for category 1, 50% for category 2, and 30% for category 3, then the predicted category of the image is category 2, and the prediction confidence is 50%.
[0063] In order to effectively utilize the labeled pneumonia CT images, a dynamic weighted balance loss is used for supervised learning based on the predicted probability of the labeled images and the corresponding true labels (i.e., the pathogen category labels set for the labeled images in step 1):
[0064]
[0065] in, Indicates the number of labeled images in the current batch of training samples. It indicates the probability that the network predicts the i-th labeled image as the j-th class, Represents the jth component of the one-hot encoding of the i-th labeled image. One-hot encoding is a method of converting discrete categorical variables into binary vector representations. Each category corresponds to a unique vector, and only the position of the category is 1, and the rest are 0. represents the category weight of the jth image, and the calculation formula is:
[0066]
[0067] This formula represents the number of images of the majority class and the number of images of the jth class in the labeled pneumonia CT image data n j The logarithmic ratio between the two plus 1. Here, the category weight of the majority class is 1, and the penalty for the network's misclassification of the minority class image is the same as the majority class image. Therefore, the network will pay more attention to the minority class images during training, especially the misclassified images in the minority class (misclassified means Small, will be larger), thus better overcoming the class imbalance problem.
[0068] In order to make more efficient use of unlabeled data, The predicted probability Get the corresponding prediction category and prediction confidence During the training process, the confidence thresholds of each category are iteratively optimized category by category to adaptively generate high-quality pseudo labels.
[0069] Specifically, in order to quantitatively evaluate the overall learning status of the network, the average prediction confidence of the network for all unlabeled pneumonia CT images during the training process was calculated. ,in represents the parameters of the feature extraction network at the tth iteration, It represents the prediction confidence of the network for the i-th unlabeled image at the t-th iteration.
[0070] In order to quantitatively evaluate the learning status of the network for each pathogen category, the average prediction probability of each category during the training process was calculated. ,in It represents the probability that the network predicts the i-th unlabeled image as the y-th class at the t-th iteration.
[0071] The adaptive confidence threshold used to generate pseudo labels is iteratively optimized by category:
[0072]
[0073] At the tth iteration, The adaptive confidence threshold corresponding to the class is recorded as .if , then it is the corresponding unlabeled image Generate pseudo labels ; Otherwise, it is not the unlabeled image Generate pseudo labels.
[0074] In this way, not only can the confidence threshold of each category be gradually improved as the network is trained to reduce erroneous pseudo-labels, but the confidence threshold of each category can also be adaptively optimized according to the classification difficulty of pneumonia CT images of different pathogenic types, and the number of pseudo-label images of different categories, especially difficult-to-classify categories, can be adaptively increased without affecting the quality of the labels, thereby providing more supervision information for network optimization. At the same time, considering the low degree of early network training and the possible presence of data outside the training categories in the images (for example, when the categories set in this training are bacterial pneumonia, viral pneumonia, fungal pneumonia and mycoplasma pneumonia, and the input unlabeled images are actually chlamydial pneumonia images), the problem of low reliability of pseudo-labels is caused, this application will re-select unlabeled images with prediction confidence higher than the current adaptive confidence threshold based on the situation of this batch in each iteration and assign pseudo-labels to ensure that erroneous pseudo-labels in the previous training process will not affect subsequent network learning. On the other hand, the main purpose of setting an adaptive confidence threshold is to improve the accuracy of pseudo-labels. Therefore, for some erroneous samples, such as images outside the training category, it is more likely to ensure that their prediction confidence is always low and does not reach the corresponding threshold, and thus will not be assigned a pseudo-label, preventing possible contamination and errors.
[0075] It is worth noting that in conventional semi-supervised learning methods, labeled images are generally first input for model pre-training, and then unlabeled images can be input into the pre-trained model for classification prediction. However, since this technical solution adjusts pseudo labels by generating adaptive confidence thresholds, the pre-training step can be omitted, thereby avoiding overfitting of the network to a small amount of labeled data.
[0076] 4) Category-aware contrastive learning: Category-aware contrastive learning is performed based on the category information provided by the adaptive pseudo-label semi-supervised learning module.
[0077] Specifically, the feature vectors of the two strongly enhanced images (including labeled images and unlabeled images) are input into a 256-dimensional fully connected layer projection head to form corresponding feature vector pairs in the projection space (the feature vector pair is Figure 1 ).
[0078] According to the category information provided by the adaptive pseudo-label semi-supervised learning module (i.e., the assigned pseudo-label situation), the original unlabeled images can be further divided into two categories, among which the corresponding data assigned with pseudo-labels are called pseudo-label images, and the remaining data are not assigned with pseudo-labels, called remaining unlabeled images.
[0079] On this basis, the feature vector pairs corresponding to the labeled image and the pseudo-labeled image are combined to calculate the supervised contrast loss:
[0080]
[0081] in, Indicates the current batch For example, there are two index sets of strongly enhanced images: labeled images and pseudo-label images. , is the index set of positive sample images with the same category as the i-th image. Positive samples are samples that belong to the same category or are similar to the current sample, while negative samples are samples that belong to different categories or are not similar to the current sample. is the temperature coefficient, Represents the eigenvector of the strongly enhanced image in the projection space. Minimize The distance between samples of the same type in the feature space will be reduced and the distance between samples of different types will be increased, thereby optimizing the feature extraction network more efficiently.
[0082] In order to make full use of the unlabeled pneumonia CT images, self-supervised contrast learning is performed on the unlabeled images without generating pseudo labels, that is, the remaining unlabeled images. The self-supervised contrast loss function used is:
[0083]
[0084] in, Indicates the number of remaining unlabeled images in the current batch, and is the feature vector of the two different forms of strongly enhanced images of the jth unlabeled image in the projection space. Minimize This will reduce the distance between different enhanced views of the same image in the feature space, promoting the network to extract more discriminative features.
[0085] Finally, the AdaBound algorithm is used to minimize the joint loss function Implement adaptive pseudo-label semi-supervised learning and category-aware contrastive learning, and perform back-propagation to optimize the parameters of the feature extraction network 3D ResNet, the classification head, and the projection head. Dynamic weighted balance loss in the joint loss function It can effectively alleviate the class imbalance problem of labeled pneumonia CT image data, calibrate the network confidence during training, guide the network to generate more accurate prediction probabilities for each category, and help improve the quality of pseudo-label generation; supervised contrast loss By combining labeled images and high-quality pseudo-label images, more effective supervision information can be provided for network optimization, improving network learning effects; self-supervised contrast loss The remaining unlabeled images that failed to generate pseudo labels can be further utilized to promote the network's learning of difficult samples, thereby improving the prediction accuracy. and Represents the weight coefficient, which can be adjusted according to the actual training data. Generally, it can be set , .
[0086] 5) Iterative training: Iterative training is performed based on the optimized system until the training is completed.
[0087] Step 3: Based on the trained 3D ResNet model and classification head, a pneumonia CT image etiology classification system is established. The pneumonia CT images to be etiologically classified are input into the pneumonia CT image etiology classification system to automatically obtain the pneumonia etiology classification results (such as Figure 3 The classification results include the probability that the input pneumonia CT images belong to bacterial pneumonia, viral pneumonia, fungal pneumonia, and mycoplasma pneumonia, among which the type with the highest probability is the pathogenic type predicted by the pneumonia CT image pathogenic classification system.
[0088] Embodiment 2:
[0089] The embodiment of the present application provides a computer device for implementing the steps of the above-mentioned pneumonia CT image etiology classification method, or the steps of the above-mentioned pneumonia CT image etiology classification method, and the computer device may include: a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory communicate with each other through the communication bus; the processor can call the logic instructions in the memory, and the logic instructions in the memory can be implemented in the form of software function units and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0090] Embodiment three:
[0091] An embodiment of the present application provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the steps of the above-mentioned pneumonia CT image pathology classification method, or the steps of the above-mentioned pneumonia CT image pathology classification method.
[0092] Based on such understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., various media that can store program codes.
[0093] In order to facilitate the description, some common English nouns or letters used in the present invention are only used for exemplary reference rather than restrictive interpretation or specific usage, and the protection scope of the present invention should not be limited by their possible Chinese translations or specific letters.
[0094] It should also be noted that, in this document, relational terms such as "first" and "second" are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations.
Claims
1. A method for the etiology classification of pneumonia CT images, characterized in that: The steps include: S1. Collect pneumonia CT images to construct a training set, wherein the images include labeled images and unlabeled images; S2, extracting features from the image using a feature extraction network to generate a corresponding feature vector; S3, performing semi-supervised learning training: inputting the feature vector of the image into the classification head for classification prediction to obtain the prediction probability; based on the prediction probability, performing supervised learning on the labeled image; assigning a pseudo label to the unlabeled image based on the prediction probability and the generated adaptive confidence threshold, wherein the adaptive confidence threshold of each category is determined based on the current average prediction confidence of the unlabeled image and the average prediction probability of each category; S4, performing contrastive learning training: based on the assigned pseudo-labels, the images are divided into remaining unlabeled images, labeled images and pseudo-labeled images, self-supervised contrastive learning is performed on the remaining unlabeled images, and supervised contrastive learning is performed on the labeled images and pseudo-labeled images together; S5. Constructing a joint loss function based on the supervised learning, the self-supervised contrastive learning and the supervised contrastive learning, and performing back-propagation optimization; S6, repeating steps S2 to S5 to perform iterative training until the training is completed; S7. Based on the trained feature extraction network and classification head, a pneumonia CT image etiology classification system is established, and the pneumonia CT images are classified using the classification system; Among them, in step S3, the prediction category and prediction confidence are determined based on the prediction probability of the unlabeled image, and a pseudo label is assigned to the unlabeled image whose prediction confidence is greater than or equal to the adaptive confidence threshold of the corresponding category. The formula for generating the adaptive confidence threshold is as follows: in, For the t The first iteration y Adaptive confidence threshold for classes, For the t The average prediction confidence of the unlabeled images at the iteration, For the t The first iteration y The average predicted probability of the class, is the number of unlabeled images, For the t The first iteration i For example, the prediction confidence of an unlabeled image is For the t The first iteration i For example, the unlabeled image is y The probability of the class, For the t Parameters of the feature extraction network at iteration .
2. A pneumonia CT imaging etiology classification method according to claim 1, characterized in that: Before step S2, the images are subjected to one weak enhancement and two different forms of strong enhancement; the weakly enhanced images are used for semi-supervised learning training, and the two different forms of strong enhanced images are used for comparative learning training.
3. A pneumonia CT imaging etiology classification method according to claim 2, characterized in that: In step S3, supervised learning is performed using a dynamic weighted balance loss based on the predicted probability of the labeled image and the corresponding true label. The supervised learning loss function is for: in, is the number of labeled images in the current batch, Y is the number of pneumonia etiological categories contained in the labeled images, For the i For example, the labeled image is predicted to be j The probability of the class, For the i Example of one-hot encoding of labeled images j Quantity, Indicates j The class weight of the class image, n j is the first labeled image j The number of class images.
4. The method for pneumonia CT imaging etiology classification according to claim 3, characterized in that: In step S4, the two strongly enhanced images in different forms are input into a projection head to form corresponding feature vector pairs in the projection space; Based on the assigned pseudo-labels, the images are divided into remaining unlabeled images, labeled images, and pseudo-labeled images; The feature vectors of the remaining unlabeled images are used for self-supervised contrastive learning. The loss function of self-supervised contrastive learning is: , the feature vectors of the labeled image and the pseudo-labeled image are combined to perform supervised contrastive learning. The supervised contrastive learning loss function is , the two loss functions are as follows: in, is the number of remaining unlabeled images in the current batch, is the eigenvector of the strongly enhanced image in the projection space, and Respectively j For example, the feature vectors of two different forms of strongly enhanced images of unlabeled images in the projection space are: is the temperature coefficient, is the index set of two strongly enhanced images: labeled images and pseudo-label images. is the sum of the number of labeled images and pseudo-labeled images in the current batch, For the i The example image has a set of positive sample image indexes of the same category.
5. The method for pneumonia CT imaging etiology classification according to claim 4, characterized in that: The joint loss function , and is the weight coefficient; Use the AdaBound algorithm to minimize the joint loss function , used to optimize the parameters of the feature extraction network, classification head and projection head.
6. The method for pneumonia CT imaging etiology classification according to claim 4, characterized in that: The feature extraction network is 3D ResNet; The classification head consists of a 256-dimensional fully connected layer and a Softmax layer; The projection head is a 256-dimensional fully connected layer projection head.
7. A pneumonia CT imaging etiology classification system, characterized in that: The classification system is trained by the method according to any one of claims 1 to 6.
8. The pneumonia CT imaging etiology classification system according to claim 7, characterized in that: include: A feature extraction network is used to receive input images and perform feature extraction to generate feature vectors; The classification head is used to receive the feature vector generated by the feature extraction network and perform classification prediction, and output the pneumonia etiology classification result.
9. A computer storage medium, characterized in that The computer storage medium stores a computer program; when the computer program is executed on a computer, the computer executes the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
An image processing method and system for pneumonia identification in CT images
CN111724356B
Lung CT image pneumonia classification method, device and equipment
CN115761342A
New coronal pneumonia CT image analysis method based on semi-supervised deep learning
CN114549452A
Full-section pathological image classification method based on semi-supervised learning
CN117557558A
Cited By
Multi-feature matching semi-supervised pavement disease identification method and system
CN121837939A
A multi-feature matching semi-supervised pavement disease identification method and system
CN121837939B