A myocardial infarction image segmentation method and system based on semi-supervised learning

By building a semi-supervised learning model, using the combination of labelless data and labeled data training, the accuracy and data dependence problems of myocardial infarction image segmentation are solved, and efficient segmentation results are achieved.

CN115565013BActive Publication Date: 2025-07-18ANHUI UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211297190.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-21
Publication Date
2025-07-18
Estimated Expiration
2042-10-21

AI Technical Summary

Technical Problem

The prior art central myocardial infarction image segmentation method has problems such as inaccurate segmentation, sufficient training, and inability to utilize a large amount of label-free data.

Method used

Using a myocardial infarction image segmentation method based on semi-supervised learning, by constructing an encoder, main decoder, auxiliary decoder and discriminator, the unlabeled data and labeled data are used for consistency training and adversarial training, feature information is extracted and the network is optimized, and segmentation accuracy is improved.

Benefits of technology

It improves the accuracy of myocardial infarction image segmentation, makes full use of labelless data, shortens training time, and reduces dependence on a large number of labeled data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115565013B_ABST
    Figure CN115565013B_ABST
Patent Text Reader

Abstract

The present invention discloses a myocardial infarction image segmentation method and system based on semi-supervised learning. The method includes: collecting a dataset of myocardial infarction magnetic resonance images with enhanced contrast, performing data processing on the dataset to obtain an enhanced training dataset; constructing an encoder and inputting the enhanced training dataset into the encoder; constructing a main decoder and two auxiliary decoders; constructing a discriminator; connecting the output end of the above-mentioned encoder to the main decoder and the two auxiliary decoders respectively, and connecting the discriminator to the output end of the main decoder, thereby constructing a semi-supervised myocardial infarction neural network segmentation model, training the model, and obtaining a trained model when the total loss is minimized; inputting the real-time collected myocardial infarction magnetic resonance image with enhanced contrast into the above-mentioned trained model to obtain a myocardial infarction segmentation image. The advantages of the present invention are: relatively accurate segmentation results, fast training process, and full utilization of a large amount of unlabeled data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of medical images, deep learning, and computer vision, and more particularly to a myocardial infarction image segmentation method and system based on semi-supervised learning. Background Art

[0002] Accurate segmentation of the myocardial infarction area is a key prerequisite for the diagnosis and treatment of myocardial infarction patients. From the segmented image, the infarct area and transmural extent can be seen. The infarct area is related to the cardiac function, and the transmural extent is related to the degree to which myocardial function can be restored after revascularization treatment. There are huge differences in the coronary blood supply of myocardial segments. Different infarct regions correspond to different segments, and each segment can be assigned to a specific coronary artery region, thereby enabling the determination of the coronary artery problem behind the infarction.

[0003] Currently in clinical practice, the gold standard for defining the myocardial infarction area is gadolinium-enhanced magnetic resonance imaging. The manual segmentation of myocardial infarction largely depends on the experience of doctors and is easily affected by personal subjective factors. Therefore, using machine learning to automatically segment myocardial infarction is an important research direction. The automatic segmentation of myocardial infarction is of great significance for its diagnosis and treatment plan: 1) Accurate automatic segmentation can automatically provide the location, size, and area of myocardial infarction, thus helping doctors judge the severity of myocardial infarction. 2) Accurate automatic segmentation can balance the differences caused by the experience of different cardiologists, thereby eliminating the diagnostic bias caused by the subjectivity of cardiologists. 3) Accurate automatic segmentation can be used as an index for evaluating patients after treatment, providing an evaluation basis for treatment effects and conducting relevant medical research.

[0004] However, there are currently two problems facing the accurate automatic segmentation of myocardial infarction. First, the segmentation is inaccurate due to the large variations in the location, size, and shape of the myocardial infarction area. Second, although existing deep learning models can achieve end-to-end fully automatic segmentation, their success largely depends on sufficient training with a large amount of labeled data, which is difficult to meet in the field of medical images. Relatively, there are a large number of unlabeled data in the field of medical images. How to improve the segmentation accuracy from these unlabeled data is another problem. For example, Chinese Patent Publication No. CN109498046A discloses a method for quantitative evaluation of myocardial infarction based on the fusion of radionuclide images and CT coronary angiography. Its myocardial infarction evaluation process relies on a large amount of labeled data and requires sufficient training.

[0005] In summary, the existing technologies have problems such as inaccurate segmentation, dependence on sufficient training, and inability to utilize a large amount of unlabeled data. Summary of the Invention

[0006] The technical problem to be solved by the present invention is that the existing myocardial infarction image segmentation method has problems such as inaccurate segmentation, relying on sufficient training, and being unable to utilize a large amount of unlabeled data.

[0007] The present invention solves the above technical problems through the following technical means: A myocardial infarction image segmentation method based on semi-supervised learning, the method comprising:

[0008] Step 1: Collect a dataset of enhanced myocardial infarction magnetic resonance images for data processing to obtain an enhanced training dataset.

[0009] Step 2: Construct an encoder, input the enhanced training dataset into the encoder, and extract the feature information of unlabeled data and labeled data.

[0010] Step 3: Construct a main decoder and two auxiliary decoders. The main decoder and the auxiliary decoders adopt the same network structure, but add perturbations to the auxiliary decoders before the features are input into the auxiliary decoders.

[0011] Step 4: Construct a discriminator.

[0012] Step 5: Connect the output end of the above encoder to the main decoder and the two auxiliary decoders respectively, and connect the discriminator to the output end of the main decoder, thereby constructing a semi-supervised myocardial infarction neural network segmentation model. Use the labeled data to train the main decoder to obtain a supervised loss, use the unlabeled data and the labeled data to perform consistency training on the auxiliary decoders and the main decoder to obtain a consistency loss, use the unlabeled data and the labeled data to train the discriminator to obtain an adversarial loss and a training loss, and obtain a trained model when the total loss is minimized.

[0013] Step 6: Input the real-time collected enhanced myocardial infarction magnetic resonance images into the above trained model to obtain myocardial infarction segmentation images.

[0014] The present invention extracts the feature information of unlabeled data and labeled data through an encoder, transmits it to the decoder and the auxiliary decoders, adds perturbations to the auxiliary decoders, and uses the unlabeled data and the labeled data to enforce the consistency of predictions between the main decoder and the auxiliary decoders through consistency training, thereby improving the feature representation ability of the encoder. Finally, use the unlabeled data and the labeled data to train the discriminator, use the discriminator to evaluate the segmentation quality, calculate the loss, further optimize the network, improve the model accuracy, make the segmentation result more accurate, and make full use of the unlabeled data, solve the problem of lack of a large amount of labeled data for myocardial infarction segmentation based on deep learning models, and at the same time improve the training speed through a combination of multiple training methods, with a fast model convergence speed and no need for a large number of repeated trainings.

[0015] Further, the first step includes:

[0016] S11. Collect a dataset of myocardial infarction magnetic resonance images enhanced by rolling;

[0017] S12. Adjust the image resolution to 256×256, and divide the image dataset into two parts: a training dataset and a test dataset. The training dataset is further divided into labeled data and unlabeled data according to whether there is a corresponding label;

[0018] S13. Perform data augmentation on the images and their labels in the training dataset by randomly flipping them horizontally and randomly cropping them.

[0019] Even further, the second step includes:

[0020] S21. Construct an encoder, and input the training dataset after data augmentation into the encoder. The encoder consists of a backbone network followed by an atrous spatial pyramid pooling, then another backbone network and an atrous spatial pyramid pooling, and finally a spatial attention mechanism;

[0021] S22. The output of the first backbone network is expressed as:

[0022] p1(x) = ReLU(BN(Conv(ReLU(BN(Conv(x))))))

[0023] where Conv represents convolution, BN represents the batch normalization function, and ReLU represents the activation function;

[0024] Adopt dilation rates of 1, 6, 12, and 18 respectively, and the atrous spatial pyramid pooling is ASPP. Then ASPP = cat(x, atrous1(x), atrous6(x), atrous12(x), atrous18(x)), and the output of the first atrous spatial pyramid pooling is p2 = ASPP(p1);

[0025] where atrous1(x) represents convolution with a dilation rate of 1, atrous6(x) represents convolution with a dilation rate of 6, atrous12(x) represents convolution with a dilation rate of 12, atrous18(x) represents convolution with a dilation rate of 18, and cat() represents the concatenation function, which concatenates the above layers and the original image X together;

[0026] The output of the second backbone network is expressed as:

[0027] p3(x) = ReLU(BN(Conv(ReLU(BN(Conv(p2))))))

[0028] The output of the second atrous spatial pyramid pooling is p4 = ASPP(p3); at this time, p4 ∈ RC×H×W , where R represents the space it is in, and C, H, and W represent the number of channels, the height of the image pixels, and the width of the image pixels, respectively.

[0029] S23. The spatial attention mechanism block first uses a 1×1 convolution and the view() function to reconstruct p4 to obtain a query feature map q, a key feature map k, and a value feature map v, where v ∈ R C×N , C1 = C / 8, N = H×W. A matrix multiplication operation is performed between the transpose of the query feature map q and the key feature map k, and a softmax layer is applied to calculate the spatial attention map, denoted as attn:

[0030]

[0031] where, q i represents the i-th column of matrix q, k j represents the j-th column of matrix k, exp() represents the exponential function, and attn ij represents the influence of the j-th position on the i-th position. Then, a matrix multiplication is performed on the value feature map v and the transpose of the spatial attention map attn to obtain:

[0032]

[0033] where, v j represents the j-th position, and attn ji represents the influence of the i-th position on the j-th position. Next, the view() function is used to reconstruct z1 to obtain the final output z, z ∈ R C×H×W .

[0034] Furthermore, the third step includes:

[0035] S31. Construct a main decoder and two auxiliary decoders respectively connected to the output end of the encoder. The main decoder and the auxiliary decoders adopt the same network structure, but perturbations are added to the auxiliary decoders before the features are input into them; the main encoder and the two auxiliary decoders are both composed of two decoder backbone networks connected in sequence;

[0036] S32. The output of the main decoder is expressed as:

[0037] g(z) = ReLU(BN(ConvT(ReLU(BN(ConvT(z)))))), where ConvT represents a transposed convolution layer with a convolution kernel of 3×3;

[0038] S33. Add f-noise perturbation to the first auxiliary decoder: Uniformly sample a noise tensor N of size z, where N ∼ U(-0.3, 0.3). Multiply it by z to adjust its amplitude, and then inject the noise into the output z of the encoder to obtain r1 = (z ⊙ N) + z. Denote the first auxiliary decoder as Then

[0039] S34. Add F-Drop perturbation to the second auxiliary decoder: Uniformly sample a threshold, i.e., γ ∼ U(0.6, 0.9). Then normalize z to get z`, and generate a mask Mdrop = {z` < γ}. According to this mask Mdrop, obtain the new perturbed feature r2 = z ⊙ Mdrop. Denote the second auxiliary decoder as Then

[0040] Furthermore, the fourth step includes:

[0041] Construct a discriminator connected to the output end of the main decoder. The discriminator consists of six convolutional layers and five fully connected layers connected in sequence. The 6 convolutional layers are set with a kernel size of 4×4, a stride of 2×2, a padding of 1×1, and the number of convolutional kernels is set to [64, 128, 256, 512, 256, 128].

[0042] Furthermore, the fifth step includes:

[0043] S51. Connect the output end of the above encoder to the main decoder and the two auxiliary decoders respectively, and connect the discriminator to the output end of the main decoder, so as to construct a semi-supervised myocardial infarction neural network segmentation model;

[0044] S52. Use the SGD optimizer to train the model and set its learning rate to 0.001. Assume that the training dataset D contains labeled data and unlabeled data where x n , x m ∈ R H×W is the input image of the segmentation model, y n ∈ {0, 1} H×W is the segmentation label of myocardial infarction, and N and M are the numbers of labeled data and unlabeled data respectively (N << M);

[0045] The loss function L of the semi-supervised myocardial infarction neural network segmentation model is set as:

[0046] L = L 有监督损失 + L 一致性损失 + L 对抗损失

[0047]

[0048] Among them, the supervised loss is only trained on the labeled dataset, and the consistency loss and adversarial loss are co-trained on the labeled and unlabeled data; H() is the cross-entropy loss function, is the segmentation prediction result output by the main decoder, and f(·) represents the combination of the encoder and the main decoder;

[0049]

[0050] Among them, d(.,.) represents the distance between the predicted probability distribution maps output by the two auxiliary decoders, and z represents the output of the encoder, that is, the input of the auxiliary decoder;

[0051]

[0052] Among them, a(.,.) represents the discriminator, l bce is the binary cross-entropy loss, represents the segmentation result output by the model after the labeled data and unlabeled data are input into the model;

[0053] S53. Before optimizing the encoder and the main decoder using the discriminator, the discriminator needs to be trained first, and its loss function is as follows:

[0054]

[0055] S54. Adjust the model parameters through backpropagation, and select the model parameters with the highest accuracy for saving.

[0056] The present invention also provides a myocardial infarction image segmentation system based on semi-supervised learning, and the system includes:

[0057] A data processing module, configured to collect a dataset of enhanced myocardial infarction magnetic resonance images for data processing to obtain an enhanced training dataset;

[0058] An encoding module, configured to construct an encoder, and input the enhanced training dataset into the encoder to extract the feature information of the unlabeled data and the labeled data;

[0059] A decoding module, configured to construct a main decoder and two auxiliary decoders. The main decoder and the auxiliary decoders adopt the same network structure, but add perturbations to the auxiliary decoders before the features are input into the auxiliary decoders;

[0060] A discrimination module, configured to construct a discriminator;

[0061] The model construction and training module is used to connect the output ends of the above-mentioned encoder to the main decoder and two auxiliary decoders respectively, and connect the discriminator to the output end of the main decoder, so as to construct a semi-supervised myocardial infarction neural network segmentation model. The main decoder is trained with labeled data to obtain a supervised loss, the auxiliary decoder and the main decoder are trained for consistency using unlabeled data and labeled data to obtain a consistency loss, and the discriminator is trained with unlabeled data and labeled data to obtain an adversarial loss and a training loss. When the total loss is minimized, the trained model is obtained;

[0062] The result output module is used to input the real-time collected enhanced myocardial infarction magnetic resonance image into the above-mentioned trained model to obtain a myocardial infarction segmentation image.

[0063] Furthermore, the data processing module is also used for:

[0064] S11. Collect an enhanced myocardial infarction magnetic resonance image dataset;

[0065] S12. Adjust the image resolution to 256×256, and divide the image dataset into a training dataset and a test dataset. The training dataset is further divided into labeled data and unlabeled data according to whether there is a corresponding label;

[0066] S13. Randomly horizontally flip and randomly crop the images and their labels in the training dataset for data augmentation.

[0067] Even further, the encoding module is also used for:

[0068] S21. Construct an encoder, and input the data-augmented training dataset into the encoder. The encoder consists of a backbone network followed by an atrous spatial pyramid pooling, then another backbone network and an atrous spatial pyramid pooling, and finally a spatial attention mechanism;

[0069] S22. The output of the first backbone network is expressed as:

[0070] p1(x) = ReLU(BN(Conv(ReLU(BN(Conv(x))))))

[0071] where Conv represents convolution, BN represents batch normalization function, and ReLU represents activation function;

[0072] The atrous rates are 1, 6, 12, and 18 respectively, and the atrous spatial pyramid pooling is ASPP. Then ASPP = cat(x, atrous1(x), atrous6(x), atrousl2(x), atrous18(x)), and the output of the first atrous spatial pyramid pooling is p2 = ASPP(p1);

[0073] Among them, atrous1(x) represents convolution with a dilation rate of 1, atrous6(x) represents convolution with a dilation rate of 6, atrous12(x) represents convolution with a dilation rate of 12, atrous18(x) represents convolution with a dilation rate of 18, and cat() represents a concatenation function that concatenates the above layers and the original image X together;

[0074] The output of the second backbone network is expressed as:

[0075] p3(x) = ReLU(BN(Conv(ReLU(BN(Conv(p2))))))

[0076] The output of the second Atrous Pyramid Pooling is p4 = ASPP(p3); at this time, p4 ∈ R C×H×W , where R represents the space it is in, and C, H, and W represent the number of channels, the height of the image pixels, and the width of the image pixels respectively;

[0077] S23, the spatial attention mechanism block first uses a 1×1 convolution and the view() function to reconstruct p4 to obtain a query feature map q, a key feature map k, and a value feature map v, where v ∈ R C×N , C1 = C / 8, N = H×W, perform a matrix multiplication operation between the transpose of the query feature map q and the key feature map k, and apply a softmax layer to calculate the spatial attention map, denoted as attn:

[0078]

[0079] where, q i represents the i-th column of matrix q, k j represents the j-th column of matrix k, exp() represents the exponential function, and attn ij represents the influence of the j-th position on the i-th position, and then perform a matrix multiplication on the value feature map v and the transpose of the spatial attention map attn to obtain:

[0080]

[0081] where, v j represents the j-th position, and attn ji represents the influence of the i-th position on the j-th position. Next, use the view() function to reconstruct z1 to obtain the final output z, z ∈ R C×H×W .

[0082] Furthermore, the decoding module is also used for:

[0083] S31. Construct a main decoder and two auxiliary decoders respectively connected to the output end of the encoder. The main decoder and the auxiliary decoders adopt the same network structure, but add perturbations to the auxiliary decoders before the features are input into them. The main encoder and the two auxiliary decoders are both composed of two decoder backbone networks connected in sequence.

[0084] S32. The output of the main decoder is expressed as:

[0085] g(z) = ReLU(BN(ConvT(ReLU(BN(ConvT(z)))))), where ConvT represents a transposed convolution layer with a kernel size of 3×3.

[0086] S33. Add f-noise perturbation to the first auxiliary decoder: Uniformly sample a noise tensor N of size z, N ∼ U(-0.3, 0.3), multiply it with z to adjust its amplitude, and then inject the noise into the output z of the encoder to obtain r1 = (z ⊙ N) + z. Denote the first auxiliary decoder as Then

[0087] S34. Add F-Drop perturbation to the second auxiliary decoder: Uniformly sample a threshold, i.e., γ ∼ U(0.6, 0.9), then normalize z to get z`, and then generate a mask Mdrop = {z` < γ}. According to this mask Mdrop, obtain the new perturbed feature r2 = z ⊙ Mdrop. Denote the second auxiliary decoder as Then

[0088] Furthermore, the discrimination module is also used for:

[0089] Construct a discriminator connected to the output end of the main decoder. The discriminator consists of six convolutional layers and five fully connected layers connected in sequence. The 6 convolutional layers are set with a kernel size of 4×4, a stride of 2×2, a padding of 1×1, and the number of convolutional kernels is set to [64, 128, 256, 512, 256, 128].

[0090] Furthermore, the model construction and training module is also used for:

[0091] S51. Connect the output end of the above encoder to the main decoder and the two auxiliary decoders respectively, and connect the discriminator to the output end of the main decoder, so as to construct a semi-supervised myocardial infarction neural network segmentation model.

[0092] S52. Use the SGD optimizer to train the model, and set its learning rate to 0.001. Assume that the training dataset D contains labeled data and unlabeled data where xn , x m ∈ R H×W is the input image of the segmentation model, y n ∈ {0, 1} H×W is the segmentation label of myocardial infarction. N and M are the numbers of labeled data and unlabeled data respectively (N << M);

[0093] The loss function L of the semi - supervised myocardial infarction neural network segmentation model is set as:

[0094] L = L 有监督损失 + L 一致性损失 + L 对抗损失

[0095]

[0096] Among them, the supervised loss is only trained on the labeled dataset, and the consistency loss and adversarial loss are jointly trained on the labeled and unlabeled data; H() is the cross - entropy loss function, is the segmentation prediction result output by the main decoder, and f(·) represents the combination of the encoder and the main decoder;

[0097]

[0098] Among them, d(.,.) represents the distance between the predicted probability distribution maps output by the two auxiliary decoders, and z represents the output of the encoder, which is also the input of the auxiliary decoder;

[0099]

[0100] Among them, a(.,.) represents the discriminator, l bce is the binary cross - entropy loss, represents the segmentation result output by the model after the labeled data and unlabeled data are fed into the model;

[0101] S53. Before optimizing the encoder and the main decoder using the discriminator, the discriminator needs to be trained first, and its loss function is as follows:

[0102]

[0103] S54. Adjust the model parameters through backpropagation and select the model parameters with the highest accuracy for saving.

[0104] The advantages of the present invention are as follows: The present invention extracts the feature information of unlabeled data and labeled data through an encoder, and transmits it to a decoder and an auxiliary decoder. A perturbation is added to the auxiliary decoder. By using the unlabeled data and the labeled data, the consistency of the predictions between the main decoder and the auxiliary decoder is forced through consistency training, thereby improving the feature representation ability of the encoder. Finally, the discriminator is trained using the unlabeled data and the labeled data. The discriminator is used to evaluate the segmentation quality, and the calculated loss is used to further optimize the network, improve the model accuracy, make the segmentation result more accurate, and make full use of the unlabeled data, solving the problem that the myocardial infarction segmentation based on the deep learning model lacks a large amount of labeled data. At the same time, the training speed is increased by combining multiple training methods, the model convergence speed is fast, and a large amount of repeated training is not required. BRIEF DESCRIPTION OF THE DRAWINGS

[0105] Figure 1 It is a flowchart of a myocardial infarction image segmentation method based on semi-supervised learning disclosed in Embodiment 1 of the present invention;

[0106] Figure 2 It is an overall architecture diagram of a semi-supervised myocardial infarction neural network segmentation model in a myocardial infarction image segmentation method based on semi-supervised learning disclosed in Embodiment 1 of the present invention;

[0107] Figure 3 It is a schematic diagram of the encoder structure in a myocardial infarction image segmentation method based on semi-supervised learning disclosed in Embodiment 1 of the present invention;

[0108] Figure 4 It is a schematic diagram of the decoder and auxiliary decoder structures in a myocardial infarction image segmentation method based on semi-supervised learning disclosed in Embodiment 1 of the present invention;

[0109] Figure 5 It is a schematic diagram of the discriminator structure in a myocardial infarction image segmentation method based on semi-supervised learning disclosed in Embodiment 1 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0110] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0111] Embodiment 1

[0112] As Figure 1As shown in the figure, a myocardial infarction image segmentation method based on semi-supervised learning, the method comprising:

[0113] S1: As Figure 2 shown in the figure, collect the enhanced myocardial infarction magnetic resonance image dataset for data processing to obtain the data-augmented training dataset; the specific process is as follows:

[0114] S11. Collect the enhanced myocardial infarction magnetic resonance image dataset;

[0115] S12. Adjust the image resolution to 256×256 by the bilinear interpolation method, and divide the image dataset into two parts: a training dataset and a test dataset, where the training dataset is further divided into labeled data and unlabeled data according to whether there is a corresponding label;

[0116] S13. Perform data augmentation on the images and their labels in the training dataset by randomly flipping horizontally and randomly cropping;

[0117] The present invention takes the above data-augmented training dataset as input, inputs it into the encoder, and takes the output of the main decoder as the final myocardial infarction segmentation result of the model.

[0118] S2: Figure 2 Combine Figure 3 , construct an encoder, input the data-augmented training dataset into the encoder, and extract the feature information of the unlabeled data and the labeled data; the specific process is as follows:

[0119] S21. Construct an encoder, input the data-augmented training dataset into the encoder. The encoder consists of a backbone network followed by an atrous spatial pyramid pooling, then another backbone network and an atrous spatial pyramid pooling, and finally a spatial attention mechanism;

[0120] S22. Each backbone network consists of two convolutional layers with a convolutional kernel of 3×3, two batch normalization function BatchNormalization layers, and two activation function ReLU layers. The backbone network can realize the encoding function of the encoder. After the first backbone network, the feature width and height are encoded from 256×256 to 128×128 and then to 64×64. Similarly, the second backbone network can encode the feature width and height from 64×64 to 32×32 and then to 16×16. Assuming the input result of the encoder is x and the intermediate layer feature is p(·), the output of the first backbone network is expressed as:

[0121] p1(x) = ReLU(BN(Conv(ReLU(BN(Conv(x))))))

[0122] Among them, Conv represents convolution, BN represents batch normalization function, and ReLU represents activation function;

[0123] The atrous spatial pyramid pooling connected after the backbone network can expand the receptive field without reducing the image resolution, which is beneficial to capturing the position information of the segmentation target. Specifically, in atrous convolution, different dilation rates are assigned to generate different receptive fields, thus capturing multi-scale context information. In the present invention, the dilation rates are 1, 6, 12, and 18 respectively, and the atrous spatial pyramid pooling is ASPP. Then ASPP = cat(x, atrous1(x), atrous6(x), atrous12(x), atrous18(x)), and the output of the first atrous spatial pyramid pooling is p2 = ASPP(p1);

[0124] Among them, atrous1(x) represents the convolution with a dilation rate of 1, atrous6(x) represents the convolution with a dilation rate of 6, atrous12(x) represents the convolution with a dilation rate of 12, atrous18(x) represents the convolution with a dilation rate of 18, and cat() represents the concatenation function, which concatenates the above layers and the original image X together.

[0125] Similarly, the output of the second backbone network is expressed as:

[0126] p3(x) = ReLU(BN(Conv(ReLU(BN(Conv(p2))))))

[0127] The output of the second atrous spatial pyramid pooling is p4 = ASPP(p3); at this time, p4 ∈ R C×H×W , where R represents the space it is in, and C, H, and W represent the number of channels, the height of the image pixels, and the width of the image pixels respectively.

[0128] S23. The high-level features extracted by the backbone network and the atrous spatial pyramid pooling are coarser in granularity but can better reflect the spatial dependence relationship between features. Therefore, adding a spatial attention mechanism after the last atrous spatial pyramid pooling can not only obtain the spatial dependence relationship but also reduce the computational amount. The specific operation is as follows: Let the input p4 ∈ R C ×H×W , the spatial attention mechanism block first uses a 1×1 convolution and the view() function to reconstruct p4 to obtain the query feature map q, the key feature map k, and the value feature map v, where , v ∈ R C×N , C1 = C / 8, N = H×W. A matrix multiplication operation is performed between the transpose of the query feature map q and the key feature map k, and a softmax layer is applied to calculate the spatial attention map, denoted as attn:

[0129]

[0130] Among them, q i represents the i-th column of matrix q, and k j represents the j-th column of matrix k. exp() represents the exponential function, and attn ij represents the influence of the j-th position on the i-th position. Then, matrix multiplication is performed on the value feature map v and the transpose of the spatial attention map attn to obtain:

[0131]

[0132] Among them, v j represents the j-th position, and attn ji represents the influence of the i-th position on the j-th position. Next, the view() function is used to reconstruct z1 to obtain the final output z, where z ∈ R C×H×W .

[0133] S3: Figure 2 Combine Figure 4 , construct a main decoder and two auxiliary decoders. The main decoder and the auxiliary decoders adopt the same network structure, but perturbations are added to the auxiliary decoders before the features are input into the auxiliary decoders. The specific process is as follows:

[0134] S31. Construct a main decoder and two auxiliary decoders that are respectively connected to the output end of the encoder. The main decoder and the auxiliary decoders adopt the same network structure. The difference between the main decoder and the auxiliary decoders is that perturbations are added to the auxiliary decoders before the features are input into the auxiliary decoders. The main encoder and the two auxiliary decoders are both composed of two decoder backbone networks connected in sequence. Each layer of the decoder backbone network consists of two transposed convolutional layers with a convolution kernel of 3×3, two batch normalization function BatchNormalization layers, and two activation function ReLU layers. The backbone network can implement the decoding function of the decoder, gradually restore the input feature map to the original image size and output it.

[0135] S32. Assume that the result output by the encoder is z, and denote the main decoder as g(·). Then, the output of the main decoder is expressed as:

[0136] g(z) = ReLU(BN(ConvT(ReLU(BN(ConvT(z)))))), where ConvT represents a transposed convolutional layer with a convolution kernel of 3×3;

[0137] S33. Add different perturbations to the two auxiliary decoders at the feature level. First, add f-noise perturbation to the first auxiliary decoder: uniformly sample a noise tensor N of size z, where N ∼ U(-0.3, 0.3). Multiply it by z to adjust its amplitude, and then inject the noise into the output z of the encoder to get r1 = (z ⊙ N) + z. Denote the first auxiliary decoder as Then

[0138] S34. Add F-Drop perturbation to the second auxiliary decoder: uniformly sample a threshold, i.e., γ ∼ U(0.6, 0.9). Then normalize z to get z`. Next, generate a mask Mdrop = {z` < γ}. According to this mask Mdrop, obtain the new perturbed feature r2 = z ⊙ Mdrop. In this way, 10% to 40% of the active regions in the feature map will be masked. Denote the second auxiliary decoder as Then

[0139] It should be noted that during the subsequent training of the entire model, consistency training needs to be carried out on the main decoder and the auxiliary decoders. The training loss will be introduced later. Consistency training has been proven to be a powerful semi-supervised learning framework for training using unlabeled data under the clustering assumption, where the decision should be located in the low-density region of the boundary. Therefore, the present invention strengthens the consistency between the predictions of the main decoder and the auxiliary decoders, taking different perturbed versions of the encoder output as inputs, thereby improving the representation of the encoder. The goal of consistency training is to make the predictions of the model invariant to small perturbations of the input. Therefore, the learned model is robust to such small changes. Specifically, consider training a shared encoder and a main decoder using labeled examples. To utilize the unlabeled data, two auxiliary decoders are then added, and their inputs are the perturbed versions of the output of the shared encoder. In this way, the representation of the shared encoder can be enhanced by using the additional training signals extracted from the unlabeled data. Compared with the encoder, the parameters of the added auxiliary decoders can be ignored. In addition, only the main decoder is used during the inference process, reducing the computational overhead of training and inference.

[0140] S4: Figure 2 Combine Figure 5 , and construct a discriminator. The specific process is as follows:

[0141] Construct a discriminator connected to the output end of the main decoder. The discriminator consists of six convolutional layers connected in sequence and five fully connected layers. The 6 convolutional layers are set with a kernel size of 4×4, a stride of 2×2, and a padding of 1×1. The number of convolutional kernels is set to [64, 128, 256, 512, 256, 128] to enable the discriminator to widely extract features, and then select valuable features in the subsequent fully connected layers.

[0142] It should be noted that the discriminator consists of a training stage and an adversarial stage. Before optimizing the encoder and the main decoder using the discriminator, the discriminator network needs to be trained first. Therefore, during the subsequent training of the entire model involving the training of the discriminator, the adversarial loss and the training loss will be introduced in the subsequent training process. In the training stage, the discriminator is trained to distinguish between the real labels and the prediction maps of the segmentation model. The evaluation target for the real labels is set to 1, and the evaluation target for the segmentation prediction maps is set to 0. At this time, the scores of the discriminator for the real labels and the segmentation prediction maps should be close to 1 and 0 respectively, so as to achieve the purpose of training the discriminator. In the adversarial stage, the discriminator is not trained, and the encoder and the main decoder are optimized using the scoring results of the discriminator for the real labels and the segmentation prediction maps. At this time, it is hoped that the discrimination result of the segmentation prediction map is also close to 1, so as to narrow the distance between the segmentation prediction and the real labels, thereby promoting the training of the segmentation model.

[0143] S5: Connect the output ends of the above-mentioned encoder to the main decoder and two auxiliary decoders respectively, and connect the discriminator to the output end of the main decoder, thereby constructing a semi-supervised myocardial infarction neural network segmentation model. Use the labeled data to train the main decoder to obtain the supervised loss, use the unlabeled data and the labeled data to perform consistency training on the auxiliary decoder and the main decoder to obtain the consistency loss, use the unlabeled data and the labeled data to train the discriminator to obtain the adversarial loss and the training loss, and obtain the trained model when the total loss is minimized; the specific process is as follows:

[0144] S51: Connect the output ends of the above-mentioned encoder to the main decoder and two auxiliary decoders respectively, and connect the discriminator to the output end of the main decoder, thereby constructing a semi-supervised myocardial infarction neural network segmentation model;

[0145] S52: Use the SGD optimizer to train the model and set its learning rate to 0.001. Assume that the training dataset D contains labeled data and unlabeled data where x n , x m ∈R H×W is the input image of the segmentation model, y n ∈{0, 1} H×W is the segmentation label of myocardial infarction, and N and M are the numbers of labeled data and unlabeled data respectively (N << M);

[0146] The loss function L of the semi-supervised myocardial infarction neural network segmentation model is set as:

[0147] L = L 有监督损失 + L 一致性损失 + L 对抗损失

[0148]

[0149] Among them, the supervised loss is only trained on the labeled dataset, and the consistency loss and adversarial loss are jointly trained on the labeled and unlabeled data; H() is the cross-entropy loss function, is the segmentation prediction result output by the main decoder, and f(·) represents the combination of the encoder and the main decoder;

[0150]

[0151] Among them, d(.,.) represents the distance between the predicted probability distribution maps output by the two auxiliary decoders, and z represents the output of the encoder, which is also the input of the auxiliary decoder; here, the mean squared error (MSE) is selected as the distance measure.

[0152]

[0153] Among them, a(.,.) represents the discriminator, l bce is the binary cross-entropy loss, represents the segmentation result output by the model after the labeled data and unlabeled data are fed into the model; at this time, whether the input is the true label or the predicted map output by the main decoder, it is expected that its score is close to 1, so that the predicted map is closer to the true label.

[0154] S53. Before optimizing the encoder and the main decoder using the discriminator, the discriminator needs to be trained first, and its loss function is as follows:

[0155]

[0156] Among them, a(.,.) represents the discriminator, l bce is the binary cross-entropy loss. At this time, it is expected that the discriminator scores close to 1 for the true label and close to 0 for the predicted map.

[0157] S54. Adjust the model parameters through backpropagation, and select the model parameters with the highest accuracy for saving. The selected evaluation metrics include the Dice coefficient, Jaccard index, 95% Hausdorff distance, and average symmetric surface distance to evaluate the model performance.

[0158] S6: Input the real-time collected enhanced myocardial infarction magnetic resonance images into the above-trained model to obtain myocardial infarction segmentation images.

[0159] Through the above technical solutions, the present invention extracts the feature information of unlabeled data and labeled data through an encoder, and transmits it to a decoder and an auxiliary decoder, and adds perturbations to the auxiliary decoder. By using the unlabeled data and the labeled data, the consistency of the predictions between the main decoder and the auxiliary decoder is forced through consistency training, thereby improving the feature representation ability of the encoder. Finally, the discriminator is trained using the unlabeled data and the labeled data, and the discriminator is used to evaluate the segmentation quality, and the calculated loss is used to further optimize the network, improve the model accuracy, make the segmentation result more accurate, and make full use of the unlabeled data, solving the problem that the myocardial infarction segmentation based on deep learning models lacks a large amount of labeled data. At the same time, the training speed is improved by combining multiple training methods, the model convergence speed is fast, and a large number of repeated trainings are not required.

[0160] Embodiment 2

[0161] Based on Embodiment 1, Embodiment 2 of the present invention further provides a myocardial infarction image segmentation system based on semi-supervised learning, and the system includes:

[0162] A data processing module, configured to collect a dataset of enhanced myocardial infarction magnetic resonance images for data processing to obtain an enhanced training dataset;

[0163] An encoding module, configured to construct an encoder, and input the enhanced training dataset into the encoder to extract the feature information of unlabeled data and labeled data;

[0164] A decoding module, configured to construct a main decoder and two auxiliary decoders. The main decoder and the auxiliary decoders have the same network structure, but perturbations are added to the auxiliary decoders before the features are input into the auxiliary decoders;

[0165] A discrimination module, configured to construct a discriminator;

[0166] A model construction and training module, configured to connect the output end of the above encoder to the main decoder and the two auxiliary decoders respectively, and connect the discriminator to the output end of the main decoder, thereby constructing a semi-supervised myocardial infarction neural network segmentation model. The main decoder is trained using labeled data to obtain a supervised loss, the auxiliary decoder and the main decoder are subjected to consistency training using unlabeled data and labeled data to obtain a consistency loss, the discriminator is trained using unlabeled data and labeled data to obtain an adversarial loss and a training loss, and the trained model is obtained when the total loss is minimized;

[0167] A result output module, configured to input the real-time collected enhanced myocardial infarction magnetic resonance image into the above trained model to obtain a myocardial infarction segmentation image.

[0168] Specifically, the data processing module is further configured to:

[0169] S11. Collect a dataset of magnetic resonance images of infarcted myocardium with enhanced rolling

[0170] S12. Adjust the image resolution to 256×256, and divide the image dataset into two parts: a training dataset and a test dataset. The training dataset is further divided into labeled data and unlabeled data according to whether there is a corresponding label.

[0171] S13. Perform data augmentation on the images and their labels in the training dataset by randomly flipping them horizontally and randomly cropping them.

[0172] More specifically, the encoding module is also used for:

[0173] S21. Construct an encoder, and input the training dataset after data augmentation into the encoder. The encoder consists of a backbone network followed by an atrous spatial pyramid pooling, then another backbone network and an atrous spatial pyramid pooling, and finally a spatial attention mechanism.

[0174] S22. The output of the first backbone network is expressed as:

[0175] p1(x) = ReLU(BN(Conv(ReLU(BN(Conv(x))))))

[0176] where Conv represents convolution, BN represents batch normalization function, and ReLU represents activation function.

[0177] Adopt dilation rates of 1, 6, 12, and 18 respectively, and the atrous spatial pyramid pooling is ASPP. Then ASPP = cat(x, atrous1(x), atrous6(x), atrous12(x), atrous18(x)). The output of the first atrous spatial pyramid pooling is p2 = ASPP(p1).

[0178] where atrous1(x) represents convolution with a dilation rate of 1, atrous6(x) represents convolution with a dilation rate of 6, atrous12(x) represents convolution with a dilation rate of 12, atrous18(x) represents convolution with a dilation rate of 18, and cat() represents a concatenation function that concatenates the above layers and the original image X together.

[0179] The output of the second backbone network is expressed as:

[0180] p3(x) = ReLU(BN(Conv(ReLU(BN(Conv(p2))))))

[0181] The output of the second atrous spatial pyramid pooling is p4 = ASPP(p3); at this time, p4 ∈ R C×H×W, where R represents the space it is in, and C, H, and W represent the number of channels, the height of the image pixels, and the width of the image pixels respectively;

[0182] S23. The spatial attention mechanism block first uses a 1×1 convolution and the view() function to reconstruct p4 to obtain the query feature map q, the key feature map k, and the value feature map v, where , v ∈ R C×N , C1 = C / 8, N = H×W. Perform a matrix multiplication operation between the transpose of the query feature map q and the key feature map k, and apply a softmax layer to calculate the spatial attention map, denoted as attn:

[0183]

[0184] where, q i represents the i-th column of matrix q, k j represents the j-th column of matrix k, exp() represents the exponential function, attn ij represents the influence of the j-th position on the i-th position. Then, perform a matrix multiplication on the value feature map v and the transpose of the spatial attention map attn to obtain:

[0185]

[0186] where, v j represents the j-th position, attn ji represents the influence of the i-th position on the j-th position. Next, use the view() function to reconstruct z1 to obtain the final output z, z ∈ R C×H×W .

[0187] More specifically, the decoding module is further used for:

[0188] S31. Construct a main decoder and two auxiliary decoders respectively connected to the output end of the encoder. The main decoder and the auxiliary decoders adopt the same network structure, but add perturbations to the auxiliary decoders before the features are input into the auxiliary decoders; both the main encoder and the two auxiliary decoders are composed of two decoder backbone networks connected in sequence;

[0189] S32. The output of the main decoder is expressed as:

[0190] g(z) = ReLU(BN(ConvT(ReLU(BN(ConvT(z)))))), where ConvT represents a transposed convolution layer with a 3×3 convolution kernel;

[0191] S33. Add f-noise perturbation to the first auxiliary decoder: Uniformly sample a noise tensor N of size z, where N ∼ U(-0.3, 0.3). Multiply it by z to adjust its amplitude, and then inject the noise into the output z of the encoder to obtain r1 = (z ⊙ N) + z. Denote the first auxiliary decoder as Then

[0192] S34. Add F-Drop perturbation to the second auxiliary decoder: Uniformly sample a threshold, i.e., γ ∼ U(0.6, 0.9). Then normalize z to get z`, and generate a mask Mdrop = {z` < γ}. According to this mask Mdrop, obtain the new perturbed feature r2 = z ⊙ Mdrop. Denote the second auxiliary decoder as Then

[0193] More specifically, the discrimination module is further used for:

[0194] Construct a discriminator connected to the output end of the main decoder. The discriminator consists of six convolutional layers and five fully connected layers connected in sequence. The 6 convolutional layers are set with a kernel size of 4×4, a stride of 2×2, a padding of 1×1, and the number of convolutional kernels is set to [64, 128, 256, 512, 256, 128].

[0195] More specifically, the model construction and training module is further used for:

[0196] S51. Connect the output end of the above encoder to the main decoder and two auxiliary decoders respectively, and connect the discriminator to the output end of the main decoder, so as to construct a semi-supervised myocardial infarction neural network segmentation model;

[0197] S52. Use the SGD optimizer to train the model, and set its learning rate to 0.001. Assume that the training dataset D contains labeled data and unlabeled data where x n , x m ∈R H×W is the input image of the segmentation model, y n ∈{0, 1} H×W is the segmentation label of myocardial infarction, and N and M are the numbers of labeled data and unlabeled data respectively (N << M);

[0198] The loss function L of the semi-supervised myocardial infarction neural network segmentation model is set as:

[0199] L = L 有监督损失 + L 一致性损失 + L 对抗损失

[0200]

[0201] Among them, the supervised loss is only trained on the labeled dataset, and the consistency loss and adversarial loss are jointly trained on both labeled and unlabeled data; H() is the cross-entropy loss function, is the segmentation prediction result output by the main decoder, and f(·) represents the combination of the encoder and the main decoder;

[0202]

[0203] Among them, d(.,.) represents the distance between the predicted probability distribution maps output by the two auxiliary decoders, and z represents the output of the encoder, which is also the input of the auxiliary decoder;

[0204]

[0205] Among them, a(.,.) represents the discriminator, and l bce is the binary cross-entropy loss, represents the segmentation result output by the model after the labeled data and unlabeled data are fed into the model;

[0206] S53. Before optimizing the encoder and the main decoder using the discriminator, the discriminator needs to be trained first, and its loss function is as follows:

[0207]

[0208] S54. Adjust the model parameters through backpropagation, and select the model parameters with the highest accuracy for saving.

[0209] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A myocardial infarction image segmentation method based on semi-supervised learning, characterized in that, The method includes: Step 1: Collect a dataset of enhanced myocardial infarction magnetic resonance images and perform data processing to obtain an enhanced training dataset; Step 2: Construct an encoder, input the enhanced training dataset into the encoder, and extract the feature information of unlabeled data and labeled data; Step 2 includes: S21. Construct an encoder, input the enhanced training dataset into the encoder. The encoder consists of a backbone network followed by an atrous spatial pyramid pooling, then another backbone network and an atrous spatial pyramid pooling, and finally a spatial attention mechanism; Step 3: Construct a main decoder and two auxiliary decoders. The main decoder and the auxiliary decoders have the same network structure, but perturbations are added to the auxiliary decoders before the features are input into them; Step 4: Construct a discriminator; Step 5: Connect the output ends of the above encoder to the main decoder and the two auxiliary decoders respectively, and connect the discriminator to the output end of the main decoder, so as to construct a semi-supervised neural network segmentation model for myocardial infarction. Use the labeled data to train the main decoder to obtain a supervised loss, use the unlabeled data and the labeled data to perform consistency training on the auxiliary decoders and the main decoder to obtain a consistency loss, use the unlabeled data and the labeled data to train the discriminator to obtain an adversarial loss and a training loss, and obtain a trained model when the total loss is minimized; Step 6: Input the real-time collected enhanced myocardial infarction magnetic resonance images into the above trained model to obtain myocardial infarction segmentation images.

2. The myocardial infarction image segmentation method based on semi-supervised learning according to claim 1, wherein, Step 1 includes: S11. Collect a dataset of enhanced myocardial infarction magnetic resonance images; S12. Adjust the image resolution to 256×256, and divide the image dataset into a training dataset and a test dataset. The training dataset is further divided into labeled data and unlabeled data according to whether there are corresponding labels; S13. Perform data augmentation on the images and their labels in the training dataset by randomly flipping horizontally and randomly cropping.

3. A myocardial infarction image segmentation method based on semi-supervised learning according to claim 2, characterized in that, Step 2 also includes: S22. The output of the first backbone network is expressed as: p1(x) = ReLU(BN(Conv(ReLU(BN(Conv(x)))))) where Conv represents convolution, BN represents batch normalization function, and ReLU represents activation function; Take atrous rates of 1, 6, 12, and 18 respectively, and the atrous spatial pyramid pooling is ASPP. Then ASPP = cat(x, atrous1(x), atrous6(x), atrous12(x), atrous18(x)). The output of the first atrous spatial pyramid pooling is p2 = ASPP(p1); where atrous1(x) represents convolution with an atrous rate of 1, atrous6(x) represents convolution with an atrous rate of 6, atrous12(x) represents convolution with an atrous rate of 12, atrous18(x) represents convolution with an atrous rate of 18, and cat() represents a concatenation function that concatenates the above layers and the original image X together; The output of the second backbone network is expressed as: p3(x) = ReLU(BN(Conv(ReLU(BN(Conv(p2)))))) The output of the second atrous spatial pyramid pooling is p4 = ASPP(p3); at this time, p4 ∈ R C×H×W , where R represents the space it is in, and C, H, and W represent the number of channels, the height of the image pixels, and the width of the image pixels respectively; S23. The spatial attention mechanism block first reconstructs p4 using a 1×1 convolution and the view() function to obtain a query feature map q, a key feature map k, and a value feature map v, where v ∈ R C×N , C1 = C / 8, N = H×W. A matrix multiplication operation is performed between the transpose of the query feature map q and the key feature map k, and a softmax layer is applied to calculate the spatial attention map, denoted as attn: where q i represents the i-th column of matrix q, k j represents the j-th column of matrix k, exp() represents the exponential function, and attn ij represents the influence of the j-th position on the i-th position. Then, matrix multiplication is performed on the value feature map v and the transpose of the spatial attention map attn to obtain: Among them, v j represents the j-th position, and attn ji represents the influence of the i-th position on the j-th position. Next, the view() function is used to reconstruct z1 to obtain the final output z, z ∈ R C×H×W .

4. A myocardial infarction image segmentation method based on semi-supervised learning according to claim 3, characterized in that, Step 3 includes: S31. Construct a main decoder and two auxiliary decoders respectively connected to the output end of the encoder. The main decoder and the auxiliary decoders adopt the same network structure, but perturbations are added to the auxiliary decoders before the features are input into the auxiliary decoders. The main encoder and the two auxiliary decoders are both composed of two decoder backbone networks connected in sequence; S32. The output of the main decoder is expressed as: g(z) = ReLU(BN(ConvT(ReLU(BN(ConvT(z)))))), where ConvT represents a transposed convolution layer with a convolution kernel of 3×3; S33. Add f-noise perturbation to the first auxiliary decoder: Uniformly sample a noise tensor N of size z ~ U(-0.3, 0.3), multiply it by z to adjust its amplitude, and then inject the noise into the output z of the encoder to obtain r1 = (z ⊙ N) + z. Denote the first auxiliary decoder as Then S34. Add F-Drop perturbation to the second auxiliary decoder: Uniformly sample a threshold, i.e., γ ∼ U(0.6, 0.9), then normalize z to obtain z`, and then generate a mask Mdrop = {z` < γ}. According to this mask Mdrop, obtain the new perturbation feature r2 = z ⊙ Mdrop. Denote the second auxiliary decoder as Then 5. A method for myocardial infarction image segmentation based on semi-supervised learning according to claim 4, characterized in that, Step 4 includes: Construct a discriminator connected to the output end of the main decoder. The discriminator consists of six convolutional layers and five fully connected layers connected in sequence. The 6 convolutional layers are set with a kernel size of 4×4, a stride of 2×2, a padding of 1×1, and the number of convolutional kernels is set to [64, 128, 256, 512, 256, 128].

6. The myocardial infarction image segmentation method based on semi-supervised learning according to claim 5, characterized in that, Step 5 includes: S51. Connect the output end of the above-mentioned encoder to the main decoder and the two auxiliary decoders respectively, and connect the discriminator to the output end of the main decoder, so as to construct a semi-supervised myocardial infarction neural network segmentation model; S52. Train the model using the SGD optimizer and set its learning rate to 0.

001. Assume that the training dataset D contains labeled data and unlabeled data where x n , x m ∈R H×W is the input image of the segmentation model, and y n ∈{0, 1} H×W is the segmentation label of myocardial infarction. N and M are the numbers of labeled data and unlabeled data respectively (N << M); The loss function L of the semi-supervised myocardial infarction neural network segmentation model is set as: L = L 有监督损失 + L 一致性损失 + L 对抗损失 Among them, the supervised loss is only trained on the labeled dataset, and the consistency loss and adversarial loss are jointly trained on both labeled and unlabeled data; H() is the cross-entropy loss function, is the segmentation prediction result output by the main decoder, and f(·) represents the combination of the encoder and the main decoder; where d(.,.) represents the distance between the predicted probability distribution maps output by the two auxiliary decoders, and z represents the output of the encoder, that is, the input of the auxiliary decoders; Among them, a(.,.) represents the discriminator, and l bce is the binary cross-entropy loss, represents the segmentation result output by the model after the labeled data and unlabeled data are fed into the model; S53. Before optimizing the encoder and the main decoder using the discriminator, the discriminator needs to be trained first, and its loss function is as follows: S54. Adjust the model parameters through backpropagation, and select the model parameters with the highest accuracy for preservation.

7. A myocardial infarction image segmentation system based on semi-supervised learning, characterized in that, The system includes: A data processing module, which is used to collect a dataset of enhanced myocardial infarction magnetic resonance images for data processing to obtain an enhanced training dataset; An encoding module, which is used to construct an encoder, input the enhanced training dataset into the encoder, and extract the feature information of unlabeled data and labeled data. The encoding module is used for: S21. Construct an encoder, input the enhanced training dataset into the encoder. The encoder consists of a backbone network followed by an atrous spatial pyramid pooling, then another backbone network and an atrous spatial pyramid pooling, and finally a spatial attention mechanism; A decoding module, which is used to construct a main decoder and two auxiliary decoders. The main decoder and the auxiliary decoders adopt the same network structure, but perturbations are added to the auxiliary decoders before the features are input into the auxiliary decoders; A discrimination module, which is used to construct a discriminator; The model construction and training module is used to connect the output ends of the above-mentioned encoder to the main decoder and two auxiliary decoders respectively, and connect the discriminator to the output end of the main decoder, so as to construct a semi-supervised myocardial infarction neural network segmentation model. The main decoder is trained with labeled data to obtain a supervised loss, the auxiliary decoder and the main decoder are trained for consistency using unlabeled data and labeled data to obtain a consistency loss, and the discriminator is trained with unlabeled data and labeled data to obtain an adversarial loss and a training loss. The trained model is obtained when the total loss is minimized; The result output module is used to input the real-time collected myocardial infarction magnetic resonance image with enhanced rolling into the above-mentioned trained model to obtain a myocardial infarction segmentation image.

8. A myocardial infarction image segmentation system based on semi-supervised learning according to claim 7, characterized in that, The data processing module is also used for: S11. Collect a myocardial infarction magnetic resonance image dataset with enhanced rolling; S12. Adjust the image resolution to 256×256, and divide the image dataset into two parts: a training dataset and a test dataset. The training dataset is further divided into labeled data and unlabeled data according to whether there is a corresponding label; S13. Randomly horizontally flip and randomly crop the images and their labels in the training dataset for data augmentation.

9. A myocardial infarction image segmentation method based on semi-supervised learning according to claim 8, characterized in that, The encoding module is also used for: S22. The output of the first backbone network is expressed as: p1(x) = ReLU(BN(Conv(ReLU(BN(Conv(x)))))) where Conv represents convolution, BN represents the batch normalization function, and ReLU represents the activation function; Adopt atrous rates of 1, 6, 12, and 18 respectively, and the atrous spatial pyramid pooling is ASPP, then ASPP = cat(x, atrous1(x), atrous6(x), atrous12(x), atrous18(x)). The output of the first atrous spatial pyramid pooling is p2 = ASPP(p1); where atrous1(x) represents convolution with an atrous rate of 1, atrous6(x) represents convolution with an atrous rate of 6, atrous12(x) represents convolution with an atrous rate of 12, atrous18(x) represents convolution with an atrous rate of 18, and cat() represents the concatenation function, which concatenates the above layers and the original image X together; The output of the second backbone network is expressed as: p3(x) = ReLU(BN(Conv(ReLU(BN(Conv(p2)))))) The output of the second Atrous Spatial Pyramid Pooling is p4 = ASPP(p3); at this time, p4 ∈ R C×H×W , where R represents the space it is in, and C, H, and W represent the number of channels, the height of the image pixels, and the width of the image pixels, respectively; S23. The spatial attention mechanism block first reconstructs p4 using a 1×1 convolution and the view() function to obtain a query feature map q, a key feature map k, and a value feature map v, where v ∈ R C×N , C1 = C / 8, N = H×W. A matrix multiplication operation is performed between the transpose of the query feature map q and the key feature map k, and a softmax layer is applied to calculate the spatial attention map, denoted as attn: where q i represents the i-th column of matrix q, k j represents the j-th column of matrix k, exp() represents the exponential function, and attn ij represents the influence of the j-th position on the i-th position, and then matrix multiplication is performed on the value feature map v and the transpose of the spatial attention map attn to obtain: Among them, v j represents the j-th position, and attn ji represents the influence of the i-th position on the j-th position. Next, the view() function is used to reconstruct z1 to obtain the final output z, z ∈ R C×H×W .

10. A method for myocardial infarction image segmentation based on semi-supervised learning according to claim 9, characterized in that, The decoding module is also used for: S31. Construct a main decoder and two auxiliary decoders that are respectively connected to the output end of the encoder. The main decoder and the auxiliary decoders adopt the same network structure, but add perturbations to the auxiliary decoders before the feature input. The main encoder and the two auxiliary decoders are both composed of two decoder backbone networks connected in sequence; S32. The output of the main decoder is expressed as: g(z) = ReLU(BN(ConvT(ReLU(BN(ConvT(z)))))), where ConvT represents a transposed convolution layer with a kernel size of 3×3; S33. Add f-noise perturbation to the first auxiliary decoder: Uniformly sample a noise tensor N of size z, where N ∼ U(-0.3, 0.3). After multiplying it by z to adjust its amplitude, inject the noise into the output z of the encoder to obtain r1 = (z ⊙ N) + z. Denote the first auxiliary decoder as Then S34. Add F-Drop perturbation to the second auxiliary decoder: Uniformly sample a threshold, i.e., γ ∼ U(0.6, 0.9), then normalize z to get z`, and then generate a mask Mdrop = {z` < γ}. According to this mask Mdrop, obtain the new perturbation feature r2 = z ⊙ Mdrop. Denote the second auxiliary decoder as Then

Citation Information

Patent Citations

  • Method for quantitatively evaluating myocardial infarction on basis of nuclide image and CT (computed tomography) coronary angiography fusion

    CN109498046A

  • Unsupervised domain-adaptive brain tumor semantic segmentation method based on deep adversarial learning

    CN108062753A

  • High-resolution remote sensing image cloud snow identification method and device fusing topographic data and deep neural network

    CN113936204A