Single-positive multi-label chest X-ray image classification method based on generalized Nesterov iteration fast gradient symbol method and pseudo-label consistency regularization
Generating adversarial samples and pseudo-label consistency regularization through the generalized Nesterov iterative fast gradient sign method solves the problem of false negative labels in single-positive multi-label chest X-ray image classification and improves the accuracy and generalization ability of the model.
Patent Information
- Application Number
- CN202410756944.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-06-13
AI Technical Summary
It is difficult to maintain model classification accuracy in the classification of single-positive multi-label chest X-ray images with existing technology, especially when the data set has limited labels. Traditional methods are prone to introduce false negative labels, affecting model performance.
The adversarial sample is generated based on the generalized Nesterov iterative fast gradient symbol method, and through pseudo-label consistency regularization, the hyperparameter pseudo-label threshold is used to screen model predictions, and pseudo-labels are generated for supervised training to reduce the impact of false negative labels.
Through adversarial samples and pseudo-label consistency regularization, the model can achieve more accurate classification under limited data sets, reduce labeling costs, improve model generalization performance, and form smoother decision boundaries.
Smart Images

Figure CN118736280A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of medical image classification, in particular to a single-positive multi-label chest X-ray image classification method based on a generalized Nesterov iterative fast gradient sign method and pseudo-label consistency regularization. Background Art
[0002] Deep learning methods for multi-label chest X-ray image classification often require large-scale datasets. However, obtaining fully labeled datasets is expensive and time-consuming, and incorrect labels may be introduced during the annotation process. Consider an extreme case where the annotator only provides one relevant label for each image, that is, only one positive label is observed, and other category labels are unknown. Therefore, each image in the training set will have only one positive label and no clear negative label, which is called single-positive multi-label chest X-ray image classification. Therefore, how to maintain the accuracy of model classification when the dataset is limited is a challenging problem.
[0003] There are three traditional methods for implementing the single-positive multi-label chest X-ray image classification task. The first method simply sets the loss term corresponding to the unobserved label to 0 and adjusts the model parameters according to the loss value. However, this loss implicitly assumes that the unobserved labels are all predicted correctly, and the loss value calculated by this assumption has a large error. The second method is to assume that the unobserved labels are all negative, which is the most common method in the single-positive label classification task. Since in the chest X-ray image classification task, the negative labels contained in the image are mostly more than the positive labels, it is realistic to assume that the unobserved labels are negative. However, this method will introduce some false negative labels, that is, the labels that were originally positive are mistakenly assumed to be negative labels and participate in the calculation of the loss function. The third method further reduces the weight of the loss term corresponding to the negative label on the basis of assuming that the unobserved label is negative. This method reduces the impact of false negative labels, but the impact of false negative labels has not been reasonably resolved. Therefore, a single-positive multi-label chest X-ray image classification method based on the generalized Nesterov iterative fast gradient sign method and pseudo-label consistency regularization is invented. Summary of the invention
[0004] In view of the above problems and / or the existing problems in the single-positive multi-label chest X-ray image classification method based on generalized Nesterov iterative fast gradient sign method and pseudo-label consistency regularization, the present invention is proposed.
[0005] Therefore, the purpose of the present invention is to provide a single-positive multi-label chest X-ray image classification method based on generalized Nesterov iterative fast gradient sign method and pseudo-label consistency regularization, by introducing the idea of adversarial sample generation into the chest X-ray image classification task, and further optimizing the Nesterov Accelerated Gradient algorithm. The method first inputs the single-positive multi-label chest X-ray image into the sub-model and uses the optimized generalized Nesterov iterative fast gradient sign method to generate adversarial samples as strong enhanced images. Then, the original image is preprocessed by random horizontal flipping to obtain a weakly enhanced image, and the pseudo-label is generated by combining the predicted value of the weakly enhanced image by the main model with the single positive label of the image using the hyperparameter pseudo-label threshold τ. Then, the strongly enhanced image is input into the main model and the pseudo-label is used to supervise the model's prediction of the strongly enhanced version of the same image to achieve pseudo-label consistency regularization of image-level perturbations. Finally, the regularized training model is used to realize the classification of single-positive multi-label chest X-ray images, which can solve the above-mentioned existing problems.
[0006] To solve the above technical problems, according to one aspect of the present invention, the present invention provides the following technical solutions:
[0007] The single-positive multi-label chest X-ray image classification method based on the generalized Nesterov iterative fast gradient sign method and pseudo-label consistency regularization includes the following specific steps:
[0008] S1: Input the single-positive multi-label chest X-ray image into the sub-model g' and use the generalized Nesterov iterative fast gradient sign method to utilize the accumulated gradient and the optimized perturbation step size to generate adversarial samples as strongly enhanced images;
[0009] S2: The single-positive multi-label chest X-ray image is preprocessed with random horizontal flipping as a weakly enhanced image and input into the main model g, where the high-level features of the image are obtained in the backbone network, and then the classification head is used to obtain the model prediction of the weakly enhanced image based on these features;
[0010] S3: The model predictions of the weakly enhanced images are screened by combining the hyperparameter pseudo-label threshold, and the labels with high model prediction confidence are selected as the pseudo-labels of the images;
[0011] S4: The obtained pseudo-labels are calculated with the model predictions of the strongly enhanced images for consistency regularization, and the main network is trained by minimizing the error between the pseudo-labels and the strongly enhanced image predictions. The trained main network is used to achieve accurate classification of single-positive multi-label chest X-ray images.
[0012] As a preferred solution of the single-positive multi-label chest X-ray image classification method based on generalized Nesterov iterative fast gradient sign method and pseudo-label consistency regularization described in the present invention, the specific process of S1 is as follows:
[0013] S11: The single positive multi-label chest X-ray image is input into the sub-model g', and the image is perturbed according to the hyperparameter perturbation step size α and the gradient attenuation factor μ to obtain a forward-looking perturbation image. After that, the model's prediction value for the image is obtained by passing through the backbone network and the classification head in sequence. For the setting of the iterative step size parameter, combined with the Nesterov AcceleratedGradient algorithm, the influence of the optimization parameters on the convergence is analyzed and studied, and the generalized NesterovAcceleratedGradient algorithm is further deduced, and its formula is as follows:
[0014]
[0015] Where T is the transformation operator used to update or adjust the solution to the desired target direction, θ k is the momentum parameter, t k is the number of iterations;
[0016] The generalized Nesterov accelerated gradient algorithm is combined to implement the generalized Nesterov iterative fast gradient symbol method, and the perturbation step size α of the sub-model is set as follows:
[0017]
[0018] Where t is the current iteration number;
[0019] The generation formula of the forward-looking perturbation image is as follows:
[0020]
[0021] in is the forward-looking perturbation image obtained in this round of iteration, is the perturbation image obtained in the previous iteration, α is the perturbation step size, and μ is the gradient attenuation factor;
[0022] S12: Use the predicted value of the forward-looking perturbation image and the corresponding single positive label to calculate the cross entropy loss, and find its gradient g relative to the image t ;
[0023] S13: The gradient g calculated according to this round of iteration t Calculate and update the cumulative gradient g with the attenuation factor μ t+1 , the cumulative gradient update formula is as follows:
[0024]
[0025] where g t is the cumulative gradient after iteration t rounds, g0=0, μ is the attenuation factor, and J() is the cross entropy loss function;
[0026] Use the cumulative gradient g to increase the loss t+1 The perturbed image of this round of iteration is obtained by adding the constraints and perturbed image in the direction of . The generation formula of the perturbed image is as follows:
[0027]
[0028] in is a pruning function used to constrain the pixel values of the generated adversarial samples;
[0029] The perturbed image is input as the input image into the sub-model for the next round of iteration. According to the conditions of the loop, multiple rounds of iterations are performed to generate the final adversarial sample.
[0030] As a preferred solution of the single-positive multi-label chest X-ray image classification method based on generalized Nesterov iterative fast gradient sign method and pseudo-label consistency regularization described in the present invention, wherein: the backbone network of the sub-model comprises a primary convolution layer with a convolution kernel size of 7×7 and 8 residual blocks, and each residual block comprises two convolution layers with a convolution kernel size of 3×3.
[0031] As a preferred solution of the single-positive multi-label chest X-ray image classification method based on generalized Nesterov iterative fast gradient sign method and pseudo-label consistency regularization described in the present invention, wherein: the classification head is composed of a global average pooling layer and a fully connected layer.
[0032] As a preferred scheme of the single-positive multi-label chest X-ray image classification method based on generalized Nesterov iterative fast gradient sign method and pseudo-label consistency regularization described in the present invention, wherein: the main model network structure in S2 has a total of 50 layers from input to output, including an initial convolution layer consisting of a 7x7 convolution layer and a maximum pooling layer, and 4 groups of residual blocks.
[0033] As a preferred solution of the single-positive multi-label chest X-ray image classification method based on generalized Nesterov iterative fast gradient sign method and pseudo-label consistency regularization described in the present invention, wherein: the number of residual blocks in each group is 3, 4, 6, and 3 respectively, and each residual block consists of 3 convolutional layers.
[0034] As a preferred solution of the single-positive multi-label chest X-ray image classification method based on generalized Nesterov iterative fast gradient sign method and pseudo-label consistency regularization described in the present invention, wherein: the model prediction results for weakly enhanced images in S3 are combined with the hyperparameter pseudo-label threshold τ to screen the model predictions, and the categories with predicted values greater than τ are set to positive, and the categories with predicted values lower than 1-τ are set to negative, that is, labels with high model prediction confidence are screened as pseudo-labels.
[0035] As a preferred solution of the single-positive multi-label chest X-ray image classification method based on generalized Nesterov iterative fast gradient sign method and pseudo-label consistency regularization described in the present invention, wherein: in S4, the adversarial sample generated by S1 is input into the main model g, and the model's prediction value for the strongly enhanced image is obtained in sequence through the backbone network and the classification head, and the regularization loss is calculated in combination with the pseudo-label obtained by S3. The regularization loss formula is:
[0036]
[0037] in is the value of the lth category in the pseudo-label of the i-th weakly enhanced image, is the value of the lth category in the model prediction of the i-th strongly enhanced image, and τ is the pseudo-label threshold. According to the regularized loss formula, the main model is trained with the goal of minimizing the loss to achieve accurate classification of single-positive multi-label chest X-ray images.
[0038] Compared with existing technologies:
[0039] By using adversarial samples as strong enhanced images and adding small and precise perturbations, the model can explore and learn deeper and more abstract features during the training process, which is conducive to the model forming a smoother and more stable decision boundary, and can more effectively generalize and correctly classify when dealing with new data with blurred boundaries between categories. In addition, the generalized Nesterov Accelerated Gradient algorithm is used in the process of generating adversarial samples to stabilize the update direction of the perturbation. At the same time, the forward-looking idea is adopted to use the expected update to correct the previously accumulated gradient, which is conducive to getting rid of the poor local extreme values in the loss function more easily and quickly, thereby improving the quality of adversarial samples. Secondly, the weakly enhanced images preprocessed by random horizontal flipping are used to generate pseudo labels for subsequent supervision. This approach effectively utilizes unlabeled data, reduces the labeling cost, fully restores the potential positive labels, and improves the effect of model training. Finally, pseudo-label consistency regularization uses pseudo-labels generated from weakly enhanced images to supervise the strongly enhanced version of the same image, which is conducive to reducing the impact of false negative label problems and enhancing the generalization performance of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a schematic diagram of the overall model framework of the present invention;
[0041] Figure 2 It is a flow chart of the present invention;
[0042] Figure 3 It is the architecture diagram of the sub-model network of the present invention;
[0043] Figure 4 This is a structural diagram of the main model network of the present invention. DETAILED DESCRIPTION
[0044] To make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0045] The present invention provides a single-positive multi-label chest X-ray image classification method based on the generalized Nesterov iterative fast gradient sign method and pseudo-label consistency regularization. Figure 1-Figure 4 ;
[0046] The specific steps are as follows:
[0047] S1: Input the single-positive multi-label chest X-ray image into the sub-model g' and use the generalized Nesterov iterative fast gradient sign method to use the accumulated gradient and the optimized perturbation step size to generate adversarial samples as strong enhanced images. The single-positive multi-label chest X-ray image means that each image has 14 categories but only one category is marked as positive, and the rest of the categories are unknown;
[0048] Among them, the specific process of S1 is as follows:
[0049] S11: The single positive multi-label chest X-ray image is input into the sub-model g', and the image is perturbed according to the hyperparameter perturbation step size α and the gradient attenuation factor μ to obtain a forward-looking perturbation image. After that, the model's prediction value for the image is obtained by passing through the backbone network and the classification head in sequence. For the setting of the iterative step size parameter, combined with the Nesterov AcceleratedGradient algorithm, the influence of the optimization parameters on the convergence is analyzed and studied, and the generalized NesterovAcceleratedGradient algorithm is further deduced, and its formula is as follows:
[0050]
[0051] Where T is the transformation operator used to update or adjust the solution to the desired target direction, θ k is the momentum parameter, t k is the number of iterations;
[0052] The generalized Nesterov accelerated gradient algorithm is combined to implement the generalized Nesterov iterative fast gradient symbol method, and the perturbation step size α of the sub-model is set as follows:
[0053]
[0054] Where t is the current iteration number;
[0055] The generation formula of the forward-looking perturbation image is as follows:
[0056]
[0057] in is the forward-looking perturbation image obtained in this round of iteration, is the perturbation image obtained in the previous iteration, α is the perturbation step size, and μ is the gradient attenuation factor;
[0058] S12: Use the predicted value of the forward-looking perturbation image and the corresponding single positive label to calculate the cross entropy loss, and find its gradient g relative to the image t ;
[0059] S13: The gradient g calculated according to this round of iteration t Calculate and update the cumulative gradient g with the attenuation factor μ t+1 , the cumulative gradient update formula is as follows:
[0060]
[0061] where g t is the cumulative gradient after iteration t rounds, g0=0, μ is the attenuation factor, and J() is the cross entropy loss function;
[0062] Use the cumulative gradient g to increase the loss t+1 The perturbed image of this round of iteration is obtained by adding the constraints and perturbed image in the direction of . The generation formula of the perturbed image is as follows:
[0063]
[0064] in is a pruning function used to constrain the pixel values of the generated adversarial samples;
[0065] The perturbed image is input as the input image to the sub-model for the next round of iteration. According to the loop conditions, multiple rounds of iterations are performed to generate the final adversarial sample.
[0066] Among them: the backbone network of the sub-model consists of a primary convolution layer with a convolution kernel size of 7×7 and 8 residual blocks, each residual block contains two convolution layers with a convolution kernel size of 3×3; the classification head consists of a global average pooling layer and a fully connected layer;
[0067] S2: The single-positive multi-label chest X-ray image is preprocessed by random horizontal flipping as a weakly enhanced image and input into the main model g, where the high-level features of the image are obtained in the backbone network, and then the classification head is used to obtain the model prediction of the weakly enhanced image based on these features; the main model network structure has 50 layers from input to output, including an initial convolution layer consisting of a 7x7 convolution layer and a maximum pooling layer, and 4 groups of residual blocks, the number of residual blocks in each group is 3, 4, 6, and 3 respectively, and each residual block consists of 3 convolution layers;
[0068] S3: The model prediction of the weakly enhanced image is screened in combination with the hyperparameter pseudo-label threshold, and the label with high model prediction confidence is selected as the pseudo-label of the image; wherein, for the model prediction result of the weakly enhanced image, the model prediction is screened in combination with the hyperparameter pseudo-label threshold τ, and the category with a prediction value greater than τ is set as positive, and the category with a prediction value less than 1-τ is set as negative, that is, the label with high model prediction confidence is screened as the pseudo-label;
[0069] S4: performing consistency regularization calculation on the obtained pseudo labels and the model prediction of the strongly enhanced image, training the main network by minimizing the error between the pseudo labels and the prediction of the strongly enhanced image, and using the trained main network to achieve accurate classification of single-positive multi-label chest X-ray images;
[0070] Among them, the adversarial sample generated by S1 is input into the main model g, and the model's prediction value for the strongly enhanced image is obtained through the backbone network and the classification head in turn, and the regularization loss is calculated in combination with the pseudo label obtained by S3. The regularization loss formula is:
[0071]
[0072] in is the value of the lth category in the pseudo-label of the i-th weakly enhanced image, is the value of the lth category in the model prediction of the i-th strongly enhanced image, and τ is the pseudo-label threshold. According to the regularized loss formula, the main model is trained with the goal of minimizing the loss to achieve accurate classification of single-positive multi-label chest X-ray images.
[0073] The experimental dataset used in the present invention is the CheXpert dataset, which is a large dataset for chest X-ray diagnosis, consisting of 224,316 multi-view chest X-rays of 65,240 patients, which are marked as positive, negative, or unannotated for 14 pathologies. The size of all input CXR images is 224×224, and the dataset is divided into training set, validation set, and test set in a ratio of 7:2:1. At the same time, the image batch size during model training is 64. The image label uses a single positive label, that is, each image contains only one correct positive category, and the remaining categories are marked as unknown.
[0074] In addition, the entire algorithm of the present invention is tested in a CentOS7 (Core) (64-bit) system, where the CPU is Intel Xeon Silver 4210R (2.4GHz) and the graphics card model is GeForce RTX 3090 (24GB video memory). In programming, the Pytorch 2.1.2 platform is used to build the network model.
[0075] Although the present invention has been described above with reference to the embodiments, various modifications may be made thereto and parts thereof may be replaced by equivalents without departing from the scope of the present invention. In particular, as long as there is no structural conflict, the various features in the embodiments disclosed in the present invention may be used in combination with each other in any manner, and the fact that these combinations are not exhaustively described in this specification is only for the sake of omitting space and saving resources. Therefore, the present invention is not limited to the specific embodiments disclosed herein, but includes all technical solutions falling within the scope of the claims.
Claims
1. A single-positive multi-label chest X-ray image classification method based on generalized Nesterov iterative fast gradient sign method and pseudo-label consistency regularization, characterized in that: The specific steps are as follows: S1: Input the single-positive multi-label chest X-ray image into the sub-model g' and use the generalized Nesterov iterative fast gradient sign method to utilize the accumulated gradient and the optimized perturbation step size to generate adversarial samples as strongly enhanced images; S2: The single-positive multi-label chest X-ray image is preprocessed with random horizontal flipping as a weakly enhanced image and input into the main model g, where the high-level features of the image are obtained in the backbone network, and then the classification head is used to obtain the model prediction of the weakly enhanced image based on these features; S3: The model predictions of the weakly enhanced images are screened by combining the hyperparameter pseudo-label threshold, and the labels with high model prediction confidence are selected as the pseudo-labels of the images; S4: The obtained pseudo-labels are calculated with the model predictions of the strongly enhanced images for consistency regularization, and the main network is trained by minimizing the error between the pseudo-labels and the strongly enhanced image predictions. The trained main network is used to achieve accurate classification of single-positive multi-label chest X-ray images.
2. The single-positive multi-label chest X-ray image classification method based on generalized Nesterov iterative fast gradient sign method and pseudo-label consistency regularization according to claim 1, characterized in that: The specific process of S1 is as follows: S11: The single positive multi-label chest X-ray image is input into the sub-model g', and the image is perturbed according to the hyperparameter perturbation step size α and the gradient attenuation factor μ to obtain a forward-looking perturbation image. After that, the model's prediction value for the image is obtained by passing through the backbone network and the classification head in sequence. For the setting of the iterative step size parameter, combined with the Nesterov AcceleratedGradient algorithm, the influence of the optimization parameters on the convergence is analyzed and studied, and the generalized NesterovAcceleratedGradient algorithm is further deduced, and its formula is as follows: Where T is the transformation operator used to update or adjust the solution to the desired target direction, θ k is the momentum parameter, t k is the number of iterations; The generalized Nesterov accelerated gradient algorithm is combined to implement the generalized Nesterov iterative fast gradient symbol method, and the perturbation step size α of the sub-model is set as follows: Where t is the current iteration number; The generation formula of the forward-looking perturbation image is as follows: in is the forward-looking perturbation image obtained in this round of iteration, is the perturbation image obtained in the previous iteration, α is the perturbation step size, and μ is the gradient attenuation factor; S12: Use the predicted value of the forward-looking perturbation image and the corresponding single positive label to calculate the cross entropy loss, and find its gradient g relative to the image t ; S13: The gradient g calculated according to this round of iteration t Calculate and update the cumulative gradient g with the attenuation factor μ t+1 , the cumulative gradient update formula is as follows: where g t is the cumulative gradient after iteration t rounds, g0=0, μ is the attenuation factor, and J() is the cross entropy loss function; Use the cumulative gradient g to increase the loss t+1 The perturbed image of this round of iteration is obtained by adding the constraints and perturbed image in the direction of . The generation formula of the perturbed image is as follows: in is a pruning function used to constrain the pixel values of the generated adversarial samples; The perturbed image is input as the input image into the sub-model for the next round of iteration. According to the conditions of the loop, multiple rounds of iterations are performed to generate the final adversarial sample.
3. The single-positive multi-label chest X-ray image classification method based on generalized Nesterov iterative fast gradient sign method and pseudo-label consistency regularization according to claim 2, characterized in that: The backbone network of the sub-model includes a primary convolution layer with a convolution kernel size of 7×7 and 8 residual blocks, and each residual block includes two convolution layers with a convolution kernel size of 3×3.
4. The single-positive multi-label chest X-ray image classification method based on generalized Nesterov iterative fast gradient sign method and pseudo-label consistency regularization according to claim 2, characterized in that: The classification head consists of a global average pooling layer and a fully connected layer.
5. The single-positive multi-label chest X-ray image classification method based on generalized Nesterov iterative fast gradient sign method and pseudo-label consistency regularization according to claim 1, characterized in that: The main model network structure in S2 has 50 layers from input to output, including an initial convolution layer consisting of a 7x7 convolution layer and a maximum pooling layer, and 4 groups of residual blocks.
6. The single-positive multi-label chest X-ray image classification method based on generalized Nesterov iterative fast gradient sign method and pseudo-label consistency regularization according to claim 5, characterized in that: The number of residual blocks in each group is 3, 4, 6, and 3 respectively, and each residual block consists of 3 convolutional layers.
7. The single-positive multi-label chest X-ray image classification method based on generalized Nesterov iterative fast gradient sign method and pseudo-label consistency regularization according to claim 1, characterized in that: The model prediction results of the weakly enhanced image in S3 are combined with the hyperparameter pseudo-label threshold τ to screen the model predictions. The categories with predicted values greater than τ are set as positive, and the categories with predicted values less than 1-τ are set as negative, that is, the labels with high confidence in model prediction are screened as pseudo-labels.
8. The single-positive multi-label chest X-ray image classification method based on generalized Nesterov iterative fast gradient sign method and pseudo-label consistency regularization according to claim 1, characterized in that: In S4, the adversarial sample generated by S1 is input into the main model g, and the prediction value of the model for the strongly enhanced image is obtained by the backbone network and the classification head in sequence, and the regularization loss is calculated in combination with the pseudo label obtained by S3. The regularization loss formula is: in is the value of the lth category in the pseudo-label of the i-th weakly enhanced image, is the value of the lth category in the model prediction of the i-th strongly enhanced image, and τ is the pseudo-label threshold. According to the regularized loss formula, the main model is trained with the goal of minimizing the loss to achieve accurate classification of single-positive multi-label chest X-ray images.
Citation Information
Patent Citations
Self-adaptive deep belief network bearing fault diagnosis method based on Nesterov momentum method
CN106769048A
Deep learning-based device for classifying, identifying and positioning common lung diseases
CN114550916A
