Medical image multi-label classification model training method, electronic equipment and storage medium

By adopting learnable spatial attention convolution, multi-head self-attention mechanism and deep MLP classifier in the medical imaging multi-label classification model, the problem of poor performance in image classification is solved, and higher feature expression ability and better classification performance are achieved.

CN120107705AActive Publication Date: 2025-06-06JIANGXI NORMAL UNIV

Patent Information

Application Number
CN202510592054.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-09
Publication Date
2025-06-06
Estimated Expiration
2045-05-09

AI Technical Summary

Technical Problem

The existing multi-label classification model of medical images is not effective in image classification, mainly because a single pooling operation is prone to loss of information, different areas of the image contribute unevenly to the classification, and the model capacity is insufficient, making it difficult to capture complex data distribution.

Method used

The input feature map is weighted aggregated by learningable spatial attention convolution to generate global feature vectors; then the global dependence between features is captured through the multi-head self-attention mechanism; finally, the deep MLP classifier is used for classification, including linear transformation, nonlinear activation, batch normalization and random inactivation steps.

Benefits of technology

By dynamically adjusting the weight of spatial location, highlighting significant areas and improving the detection ability of subtle lesions; the multi-head self-attention mechanism captures global dependence and highlights discriminant characteristics; the deep MLP classifier enhances nonlinear modeling capabilities, inhibits overfitting, improves generalization, and significantly improves the accuracy and robustness of multi-label classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120107705A_ABST
    Figure CN120107705A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of computer vision and machine learning, in particular to a medical image multi-label classification model training method, electronic equipment and a storage medium. The method comprises the following steps: performing feature extraction on an input image to obtain an input feature map; applying learnable space attention convolution to the input feature map to generate an attention map, performing nonlinear activation and normalization processing on the attention map, and performing weighted aggregation on the attention map and the input feature map to obtain a global feature vector; applying multi-head self-attention to the global feature vector to obtain a self-attention enhanced feature map; using a deep MLP classifier to classify the self-attention enhanced feature map, wherein the deep MLP classifier executes the steps of linear transformation, nonlinear activation, batch normalization and random inactivation; and updating parameters of the model through back propagation based on the loss function so as to obtain a medical image multi-label classification model. According to the medical image multi-label classification model, the medical image multi-label classification effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computer vision and machine learning, and in particular to a medical image multi-label classification model training method, an electronic device and a storage medium. Background Art

[0002] With the development of deep learning, convolutional neural networks (CNNs) have been widely used in the field of image classification. The backbone network of CNN is responsible for performing multi-layer convolution and downsampling operations on the input image to extract high-level semantic features. Traditionally, global average pooling and one or more layers of fully connected networks are usually used at the end of the network to complete the classification. However, this "backbone network + simple average pooling + fully connected" classification head may have the following shortcomings: (1) A single pooling operation (average pooling or maximum pooling) is prone to losing some significant information. Simple global average pooling may ignore the more prominent local areas in the image, while global maximum pooling may ignore the global background information. (2) Different regions in the image do not contribute equally to classification, and traditional methods cannot flexibly adjust the weight of each spatial position; (3) The classifier structure is relatively simple and the model capacity is insufficient. It is difficult to capture complex data distribution and fully explore the dependency relationship between high-dimensional features by relying solely on a single layer or a simple multi-layer perceptron (MLP).

[0003] Therefore, the existing models are not satisfactory when used for multi-label classification of medical images. Summary of the invention

[0004] Based on this, the present invention provides a medical image multi-label classification model training method, an electronic device and a storage medium, which at least solve one problem in the prior art.

[0005] In a first aspect, the present invention provides a medical image multi-label classification model training method, which comprises the following steps: Perform feature extraction on the input image to obtain an input feature map; Apply learnable spatial attention convolution to the input feature map to generate an attention map, then perform nonlinear activation and normalization on the attention map and weighted aggregation with the input feature map to obtain a global feature vector; Apply multi-head self-attention to the global feature vector to obtain a self-attention enhanced feature map; classifying the self-attention enhanced feature maps using a deep MLP classifier, where the deep MLP classifier performs steps including linear transformation, nonlinear activation, batch normalization, and random dropout; The model parameters are updated through back-propagation based on the loss function.

[0006] In some optional embodiments, feature extraction is performed on the input image using a pre-trained convolutional backbone network.

[0007] In some optional embodiments, applying a learnable spatial attention convolution to the input feature map includes: Apply 1×1 convolution to the input feature map as shown in formula (2); in, represents the attention map; X represents the input feature map, ; B represents the batch size, C Indicates the number of channels, H Represents the height of the input feature map, W Represents the width of the input feature map; represents the convolution kernel, ; represents the bias term, ; * indicates convolution operation.

[0008] In some optional embodiments, performing nonlinear activation and normalization on the attention map and then weighted aggregation with the input feature map includes: Apply the Sigmoid function to activate the attention map, normalize the attention score, and perform weighted aggregation with the input feature map, as shown in equations (3) to (5); in, represents the attention score; σ represents the Sigmoid function; Indicates b The sum of the weights of all pixels in the attention map, b represents a positive integer; represents the global eigenvector, .

[0009] In some optional embodiments, applying multi-head self-attention to the global feature vector includes: Expand the dimension of the global feature vector to obtain a tensor x’ ,in ; For tensors x’Perform linear projection to obtain query, key, and value matrices, as shown in equations (6) to (8); in, They represent the learnable weight matrices, , , ; Q K V denote query, key, and value matrices respectively; Reshape the feature vector of each attention head into The shape is [ B ,n,1,1] fractional tensor , as shown in formula (9); Apply the softmax function to get the attention weight , as shown in formula (10); The weighted sum of the value matrix is ​​calculated by formula (11): ; The weighted sum of the reshaped value matrix is ​​[B,1,d], that is , and through the weight matrix Perform additional projection to obtain the attention output after projection , as shown in formula (12); The output is obtained using residual connection, as shown in formula (13); in, represents the self-attention enhanced feature map, x Represents the global feature vector of the input.

[0010] In some optional embodiments, classifying the self-attention enhanced feature map using a deep MLP classifier includes: Construct a deep MLP classifier including input layer, hidden layer and output layer. The number of layers of the deep MLP classifier is L ,in L is a positive integer greater than 3; Perform a linear transformation on the self-attention enhanced feature map, as shown in formula (14); in, represents the self-attention enhanced feature map; and They represent the learnable parameters, , ; Represents the size of the first hidden layer in the deep MLP classifier; =C, indicating the dimension of the feature vector; The ReLU activation function is applied to introduce nonlinearity, as shown in formula (15); Perform batch normalization (BN), as shown in formula (16); in, Represents the mean of a batch; Indicates the standard deviation of a batch; denote the learnable scaling and translation parameters, respectively, and ; Apply random dropout to reduce overfitting, as shown in formula (17); in, , Dropout(·) means random dropout; The output layer produces the output result Y , as shown in formula (18); in, Indicates L -1 layer output features; Indicates L The weight matrix of the layer, ; Indicates L The bias vector of the layer, ; , Represents the final output dimension.

[0011] In some optional embodiments, random dropout randomly sets a proportion p of neurons to zero during training, where p is 25% to 50%.

[0012] In some optional embodiments, the loss function is a cross entropy loss function and / or a focal loss function.

[0013] In a second aspect, the present invention provides an electronic device, comprising: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores instructions, which, when executed by at least one processor, implement the medical image multi-label classification model training method as described above.

[0014] In a third aspect, the present invention provides a computer-readable storage medium storing instructions, which, when executed by a processor, implement the medical image multi-label classification model training method as described above.

[0015] Due to the adoption of the above technical solution, the embodiments of the present invention have at least the following beneficial effects: (1) With the help of learnable spatial attention convolution, different weights are dynamically assigned to each spatial position, which can better highlight the salient areas than simple average pooling or maximum pooling, and improve the detection ability of subtle lesions or targets; (2) The multi-head self-attention mechanism captures global dependencies in the channel or feature dimension, highlights the most discriminative features, and retains residual connections to prevent gradient disappearance; (3) When reducing the dimensionality of 3072-dimensional or higher-dimensional concatenated features, multiple linear layers, ReLU activation, batch normalization, and high-ratio Dropout are added to enhance the nonlinear modeling capability while effectively suppressing overfitting and improving generalization; (4) In tasks such as medical imaging and multi-target detection that require distinguishing multiple diseases or targets, the combination of attention and self-attention can better capture the correlation between different labels and perform more prominently. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 Schematic diagram of the process of stage 1 of a medical image multi-label classification model training method in one embodiment of the present invention.

[0017] Figure 2 Schematic diagram of the process of stage 2 of the medical image multi-label classification model training method in one embodiment of the present invention.

[0018] Figure 3 Schematic diagram of the process of stage three of the medical image multi-label classification model training method in one embodiment of the present invention.

[0019] Figure 4 This is an AUC-ROC graph of 14 disease classifications obtained by a model obtained by a medical image multi-label classification model training method in an embodiment of the present invention.

[0020] Figure 5 In one embodiment of the present invention, the Grad-CAM visualization technology is applied to evaluate the medical image multi-label classification model training method to obtain a visualization heat map of the key areas predicted by the model. DETAILED DESCRIPTION

[0021] The following is a clear and complete description of the concept of the present invention and the technical effects produced, so as to fully explain the purpose, scheme and effect of the present invention.

[0022] An embodiment of the present invention provides a medical image multi-label classification model training method, which significantly improves the accuracy and robustness of the model in image classification while ensuring the calculation efficiency of the model.

[0023] The method first preprocesses the input image and then uses the first three convolution extraction stages of ConvNeXt V2 to extract the features of the input image. After feature extraction of the input image, the method includes the following three stages: Phase 1 (Spatial Attention Pooling): Apply learnable spatial attention convolution to the feature map to generate an attention map, assigning different weights to different spatial positions, so as to obtain more accurate global features during global pooling; Stage 2 (simplified multi-head self-attention fusion): The global feature vector output from stage 1 is used to calculate the correlation between features through the multi-head self-attention mechanism, and a higher weight is given to the channel or component that can best distinguish the category; Stage 3 (deep MLP classification): Use a deep MLP classifier to further reduce the dimension and classify the features after attention enhancement. The deep MLP classifier contains several linear layers, activation functions, batch normalization modules, and Dropout modules of different proportions to improve the model capacity while suppressing overfitting.

[0024] Through the three stages of "spatial attention pooling + simplified multi-head self-attention fusion + deep MLP classification", the important shortcomings of single pooling and simple fully connected layers that are difficult to fully utilize high-dimensional features and lack of spatial / channel attention are overcome. Compared with existing classification models, the model obtained by the medical image multi-label classification model training method in the embodiment of the present invention has stronger feature expression ability and better classification performance, especially in the need to identify subtle lesions or multi-label, multi-category situations, can significantly improve the detection accuracy and generalization performance of the model, and has high practical application value.

[0025] like Figure 1 As shown, in stage 1, for the input feature map obtained by feature extraction in, B represents the batch size, C Indicates the number of channels, H Represents the height of the input feature map, W Represents the width of the input feature map; Apply 1×1 convolution to generate attention map α , as shown in formula (2); in, represents the convolution kernel, ; represents the bias term, ; * indicates convolution operation; α represents the attention map, ; Apply the Sigmoid function to activate the attention map, normalize the attention score, and perform weighted aggregation with the input feature map, as shown in equations (3) to (5); in, represents the attention score; σ Represents the Sigmoid function; Indicates b The sum of the weights of all pixels in the attention map, b represents a positive integer; represents the global eigenvector, .

[0026] In the first stage, the attention weights are learned through 1×1 convolution combined with Sigmoid activation function, and then weighted aggregation is performed after multiplication with the global average to achieve the amplification of salient areas and suppression of non-salient areas, which can better retain local saliency; the attention mechanism can adaptively assign weights to each spatial position and retain key information more finely.

[0027] like Figure 2 As shown, in stage 2, the global feature vector output from stage 1 is y is the input, denoted as the input vector x , for the input vector x Expand the dimension and get the tensor x’ ,in ; For tensors x’ Perform linear projection to obtain query, key, and value matrices, as shown in equations (6) to (8); in, They represent the learnable weight matrices, , , ; Q K V denote query, key, and value matrices respectively; For a multi-head setting (with n heads, n is 4 in this example), the vector is reshaped as The shape of , the attention score of each attention head is calculated by scaling the dot product, and the score tensor with shape [B,n,1,1] is obtained , as shown in formula (9); Apply the softmax function to get the attention weight, as shown in formula (10); The weighted sum of the value matrix is ​​calculated by formula (11): ; Reshape the weighted sum of the value matrix into the shape of [B,1,d], that is , and through the weight matrix Perform additional projection to obtain the attention output after projection , as shown in formula (12); The output is obtained using residual connection, as shown in formula (13); in, Represents the self-attention enhanced feature map.

[0028] In the second stage, the dependencies between different channels or features in the global scope are captured, key information is highlighted, irrelevant noise is suppressed, and the final classification decision is more accurate. The steps in the second stage can complete the "feature recalibration" in the high-dimensional feature space, thereby enhancing the capture of feature importance.

[0029] like Figure 3 As shown, in stage three, a deep MLP classifier including an input layer, a hidden layer, and an output layer is constructed. The number of layers of the deep MLP classifier is L ,in L is a positive integer greater than 3; Perform a linear transformation on the self-attention enhanced feature map, as shown in formula (14); in, represents the self-attention enhanced feature map; and They represent the learnable parameters, , ; Represents the size of the first hidden layer in the deep MLP classifier; =C, indicating the dimension of the feature vector; The ReLU activation function is applied to introduce nonlinearity, as shown in formula (15); Perform batch normalization (BN), as shown in formula (16); in, Represents the mean of a batch; Indicates the standard deviation of a batch; denote the learnable scaling and translation parameters, respectively, and ; Apply random dropout to reduce overfitting, as shown in formula (17); in, , Dropout (·) indicates random dropout; The output layer produces the output result Y , as shown in formula (18); in, Indicates L -1 layer output features; Indicates L The weight matrix of the layer, ; Indicates L The bias vector of the layer, ; , Represents the final output dimension.

[0030] Compared with ordinary MLP classifiers, the deep MLP classifier in stage 3 has a more sophisticated design in terms of hidden layer dimensions, nonlinear activation layers, and normalization layers, and can perform more complex mappings between high-order features to improve discrimination. At the same time, the regularization technology is combined to effectively prevent overfitting and improve the generalization ability of the model.

[0031] In order to verify the effectiveness of the medical image multi-label classification model training method (method of the embodiment of the present invention) of the embodiment of the present invention, a test experiment was conducted on the NIH ChestXray14 dataset. The NIH ChestXray14 dataset covers a total of 112,120 chest X-ray images and 14 of the most common chest pathology data. These images were taken by the NIH Clinical Center in the United States, and then pathology labels were extracted from radiology reports using natural language processing technology. The dataset is unbalanced, and the number of samples in some classes is significantly lower than that in other classes. For example, Hernia has only 227 samples, while Infiltration has more than 20,000 samples. For training, the dataset is randomly divided, with 80% for training, 10% for validation, and 10% for testing.

[0032] In terms of data preprocessing, the original images of size 1024×1024 are first resized to 256×256 and then randomly cropped to 224×224 to enhance model generalization. Data augmentation techniques, including random horizontal flipping and normalization, are used to ensure compatibility with pre-trained ConvNeXt V2 weights.

[0033] All experiments were conducted on an NVIDIA A100 GPU server using the PyTorch deep learning framework, running CUDA version 11.8. To optimize data processing efficiency, Dataloader parallel loading was used.

[0034] For model training, the first 296 layers of ConvNeXt V2 (about 77.08% of the total parameters) were frozen, allowing only the remaining 22.92% (mainly including high-level feature extraction layers and classification heads) to be trained. Five training rounds (epochs) were trained in a frozen manner, which provides efficient computation and reduces memory overhead, thereby allowing rapid convergence and stability; in subsequent steps, the previously frozen layers were further unfrozen in training for another 8 epochs, allowing further fine-tuning of the features within these layers to appropriately adjust the idiosyncrasies presented by chest CT images. The AdamW optimizer with an initial learning rate of 1e-4 and a weight decay of 1e-5 was used to improve generalization. In addition, gradient clipping was applied during training to ensure gradient stability. The model training batch size was 16 and the training cycle was 50 epochs. The learning rate scheduling strategy followed the cosine annealing (CosineAnnealingLR), and a decay factor of 0.1 was applied after 20 epochs to promote effective convergence.

[0035] For multi-label classification, BCEWithLogitsLoss is used in combination with Focal Loss to alleviate the impact of class imbalance on model training.

[0036] In order to comprehensively evaluate the performance of the trained model, the area under the receiver operating characteristic curve (ROC-AUC) and F1 score (F1-score) are used as the main evaluation indicators. These indicators are particularly useful for multi-label classification tasks, where class imbalance and model generalization play a crucial role in performance evaluation.

[0037] As shown in Table 1, the AUC values ​​of the model obtained by the method of the embodiment of the present invention on various disease categories were calculated, and the results were compared with HRCC-NET (https: / / doi.org / 10.3390 / diagnostics13132165), EfficientNet and PCSANet baseline models (Baseline).

[0038] Table 1 Comparison of AUC values ​​of the model obtained by the method of the embodiment of the present invention and the benchmark model on the ChestXray14 dataset It can be seen that the model obtained by the method of the embodiment of the present invention shows excellent disease detection performance on the NIH ChestXray 14 dataset, surpassing other benchmark models, especially in categories such as pneumothorax (0.92), emphysema (0.92) and cardiac hypertrophy (0.91). The model obtained by the method of the embodiment of the present invention achieved an average AUC value of 0.852, which is significantly better than PCSANet (0.820) and HRCC-NET (0.741), and slightly surpasses EfficientNet (0.837). These results show that the model obtained by the method of the embodiment of the present invention shows strong generalization ability in multi-label disease classification tasks, ensuring stable classification performance on multiple disease categories.

[0039] Figure 4 The ROC-AUC of the model obtained by the method of the embodiment of the present invention for 14 disease classifications is shown, and the curve in the figure describes the relationship between the true positive rate (TPR) and the false positive rate (FPR). It can be seen from the figure that the AUC values ​​of pneumothorax, emphysema and hernia are 0.92, 0.92 and 0.92 respectively; these values ​​are very high, indicating that the model performs well in classifying these cases.

[0040] Figure 5To apply the Grad-CAM visualization technique to evaluate the visualization heatmaps of key areas leading to the prediction. Grad-CAM generates these visualization heatmaps by calculating the gradient of the class score relative to the convolutional feature map, thereby back-projecting the area that the model actually focuses on. In other words, it provides the region of interest (ROIs) that the model focuses on. As can be seen from the figure, the model mainly focuses on abnormal lung areas in cases of pneumothorax, effusion, and mass, which shows that the model obtained by the method of the embodiment of the present invention effectively captures the pathological area, thereby enhancing the interpretability of AI medical image analysis.

[0041] Table 2 shows the changes in the F1 score during the training process. The F1 score slowly climbs from 0.117 to 0.183 during the training process, which indicates that the model gradually learns better feature representations, thereby improving the prediction performance.

[0042] Table 2 Changes in F1 scores during training of the method of the embodiment of the present invention The synergistic gain effect of the three stages of "spatial attention pooling + simplified multi-head self-attention fusion + deep MLP classification" is verified through ablation experiments. The configurations of the ablation experiments are: Baseline-Linear Head: Use ConvNeXtV2 for classification, that is, use Global Average Pooling followed by a linear full connection layer, without spatial attention pooling, simplified multi-head self-attention fusion and deep MLP classification; Advanced Head (Full): Classification is performed using the method in the embodiment of the present invention, which includes spatial attention pooling, simplified multi-head self-attention fusion and deep MLP classification in order to enhance feature weighting, channel interaction and nonlinear expression capabilities; Ablation-A: w / o AttnPool: Based on Advanced Head (Full), the spatial attention pooling is replaced by ordinary global average pooling to test the effect of spatial attention pooling; Ablation-B: w / o SelfAttn: Based on Advanced Head (Full), the simplified multi-head self-attention fusion is removed to evaluate the gain of simplified multi-head self-attention fusion in channel interaction; Ablation-C: w / o MLP: Based on Advanced Head (Full), the deep MLP classification is removed and only spatial attention pooling and simplified multi-head self-attention fusion are used for feature aggregation and fusion to test the value of deep MLP classification. Ablation-D: w / o AttnPool&SelfAttn: Based on Advanced Head (Full), we remove spatial attention pooling and simplify multi-head self-attention fusion, and only retain the deep MLP classification to evaluate the performance of deep MLP classification without attention assistance; Ablation-E: w / o AttnPool&MLP: Based on Advanced Head (Full), spatial attention pooling and deep MLP classification are removed, and only simplified multi-head self-attention fusion is retained to test the independent effect of simplified multi-head self-attention fusion without pooling weighting and nonlinear mapping; Ablation-F: w / o SelfAttn&MLP: Based on Advanced Head (Full), the simplified multi-head self-attention fusion and deep MLP classification are removed and only spatial attention pooling is retained to evaluate the effect of spatial attention pooling without channel fusion and nonlinear classification.

[0043] The ablation experiments were all completed under the same data set partitioning, the same hyperparameter configuration (learning rate, weight decay, etc.) and the same random seed within a 5-epoch training budget, with ROC-AUC as the main evaluation indicator to ensure the fairness and reproducibility of the results. The results are shown in Table 3. The Advanced Head (Full) reached the highest ROC-AUC (0.8523) in the 5th epoch, while the Baseline-Linear Head was only 0.8197. Compared with the Baseline-Linear Head, the Advanced Head (Full) achieved a 3.97% improvement in the comprehensive ROC-AUC. Compared with the single ablation results, it can be seen that the performance drops the most after removing the deep MLP classification (from 0.8523 to 0.7958, a drop of 6.63%), indicating that deep MLP classification is crucial in multi-label discrimination; removing spatial attention pooling leads to a 1.43% drop, highlighting the role of spatial attention pooling in extracting information from the lesion area; removing the simplified multi-head self-attention fusion only causes a 0.43% drop, suggesting that although the simplified multi-head self-attention fusion has a gain, the marginal utility is relatively small. Further combined ablation results show that when only the deep MLP classification is retained, the ROC-AUC is 0.8506, which is only slightly lower than Advanced Head (Full) by 0.20%, further highlighting the core support of the deep MLP classification for the overall performance; when the simplified multi-head self-attention fusion + deep MLP classification or spatial attention pooling + deep MLP classification is retained, the ROC-AUC drops to 0.8260 (a decrease of 3.09%) and 0.7850 (a decrease of 7.90%), respectively, indicating that when the spatial or channel information is not fused enough, the model performance will drop significantly, and the synergy of deep MLP classification and spatial attention pooling is better than the combination with simplified multi-head self-attention fusion. In short, deep MLP classification contributes the most, followed by spatial attention pooling. Although the simplified multi-head self-attention fusion contributes limitedly alone, it is still indispensable in the collaborative configuration.

[0044] Table 3 Ablation experiment results The above is only a preferred embodiment of the present invention. The present invention is not limited to the above implementation. As long as the technical effect of the present invention is achieved by the same or equivalent means, it should belong to the protection scope of the present invention. Within the protection scope of the present invention, its technical scheme and / or implementation method can have various modifications and changes.

Claims

1. A medical image multi-label classification model training method, characterized in that: The following steps are involved: Perform feature extraction on the input image to obtain an input feature map; Apply learnable spatial attention convolution to the input feature map to generate an attention map, then perform nonlinear activation and normalization on the attention map and weighted aggregation with the input feature map to obtain a global feature vector; Apply multi-head self-attention to the global feature vector to obtain a self-attention enhanced feature map; classifying the self-attention enhanced feature maps using a deep MLP classifier, where the deep MLP classifier performs steps including linear transformation, nonlinear activation, batch normalization, and random dropout; The model parameters are updated through back-propagation based on the loss function.

2. The method according to claim 1, characterized in that: Feature extraction is performed on the input image through a pre-trained convolutional backbone network.

3. The method according to claim 1, characterized in that Applying a learnable spatial attention convolution to the input feature map involves: Apply 1×1 convolution to the input feature map as shown in formula (2); in, represents the attention map, ; X represents the input feature map, ; B represents the batch size, C Indicates the number of channels, H Represents the height of the input feature map, W Represents the width of the input feature map; represents the convolution kernel, ; represents the bias term, ; * indicates convolution operation.

4. The method according to claim 3, characterized in that The attention map is nonlinearly activated and normalized, and then weighted aggregated with the input feature map, including: Apply the Sigmoid function to activate the attention map, normalize the attention score, and perform weighted aggregation with the input feature map, as shown in equations (3) to (5); in, represents the attention score; σ Represents the Sigmoid function; Indicates b The sum of the weights of all pixels in the attention map, b represents a positive integer; represents the global eigenvector, .

5. The method according to claim 4, characterized in that Applying multi-head self-attention to the global feature vector includes: Expand the dimension of the global feature vector to obtain a tensor x’ ,in ; For tensors x’ Perform linear projection to obtain query, key and value matrices, as shown in equations (6) to (8); in, They represent the learnable weight matrices, , , ; Q K V denote query, key, and value matrices respectively; Reshape the feature vector of each attention head into The shape is [ B ,n,1,1] fractional tensor , as shown in formula (9); Apply the softmax function to get the attention weight , as shown in formula (10); The weighted sum of the value matrix is ​​calculated by formula (11): ; The weighted sum of the reshaped value matrix is ​​[B,1,d], that is , and through the weight matrix Perform additional projection to obtain the attention output after projection , as shown in formula (12); The output is obtained using residual connection, as shown in formula (13); in, represents the self-attention enhanced feature map, x Represents the global feature vector of the input.

6. The method according to claim 5, characterized in that Classifying the self-attention enhanced feature maps using a deep MLP classifier involves: Construct a deep MLP classifier including input layer, hidden layer and output layer. The number of layers of the deep MLP classifier is L ,in L is a positive integer greater than 3; Perform a linear transformation on the self-attention enhanced feature map, as shown in formula (14); in, represents the self-attention enhanced feature map; and They represent the learnable parameters, , ; Represents the size of the first hidden layer in the deep MLP classifier; , represents the dimension of the feature vector; The ReLU activation function is applied to introduce nonlinearity, as shown in formula (15); Perform batch normalization, as shown in formula (16); in, Represents the mean of a batch; Indicates the standard deviation of a batch; denote the learnable scaling and translation parameters, respectively, and ; Random dropout is applied to reduce overfitting, as shown in formula (17); in, , Dropout (·) indicates random dropout; The output layer produces the output result Y , as shown in formula (18); in, Indicates L -1 layer output features; Indicates L The weight matrix of the layer, ; Indicates L The bias vector of the layer, ; , Represents the final output dimension.

7. The method according to claim 6, characterized in that Dropout randomly sets a proportion p of neurons to zero during training, with p ranging from 25% to 50%.

8. The method according to claim 1, characterized in that The loss function is a cross entropy loss function and / or a focal loss function.

9. An electronic device, characterized in that: include: at least one processor; and a memory communicatively coupled to the at least one processor; The memory stores instructions, which, when executed by at least one processor, implement the medical image multi-label classification model training method as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: Instructions are stored, and when the instructions are executed by the processor, the medical image multi-label classification model training method as described in any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Small sample target detection method based on attention and contrast learning

    CN113392855A

  • Hyperspectral image classification method based on mixed spectral network and multi-head self-attention mechanism

    CN115222994A

  • OCTA image retinal vessel segmentation method based on attention mechanism

    CN115294075A

  • Hyperspectral image classification method combining multi-attention and Transform

    CN115439679A

  • Fine-grained image recognition method based on attention

    CN116580289A

Cited By

  • Vibration signal classification method based on multi-channel time-space domain and Transform structure

    CN121144958A