Medical image segmentation method based on lesion area perception and uncertainty guidance
By adding a border regression algorithm and uncertainty guidance to the UNet encoder, dynamic scaling and adjustment of weights solve the problem of insufficient detection capabilities of existing semi-supervised medical image segmentation methods for small-area damage samples, and significantly improve the performance of small-area damage samples. segmentation effect.
Patent Information
- Application Number
- CN202210370643.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-10
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-04-10
AI Technical Summary
Existing semi-supervised medical image segmentation methods lack the ability to automatically detect and segment small-area damage samples, and cannot effectively handle small-area damage samples in unlabeled medical images.
Using a method based on damage area perception and uncertainty guidance, the region of interest is obtained by adding a bounding box regression algorithm after the UNet encoder, calculating the transformation matrix for scaling processing, and adding a decoder to the UNet neural network to obtain conservative and aggressive segmentation As a result, combined with the uncertainty map for loss function guidance, the scaling and weights are dynamically adjusted to give more accurate segmentation results.
It improves the network's ability to detect small-area damaged samples, ensures that samples with uneven damage areas are converted to a unified scale during the training process, reduces the negative impact of uncertainty on network segmentation results, and significantly improves the segmentation effect of small-area damaged samples. .
Smart Images

Figure CN114820473B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of digital image processing, and in particular relates to a medical image segmentation method. Background Art
[0002] In recent years, with the continuous development of digital media and computers, medical image segmentation technology has also made rapid breakthroughs. Accurate segmentation of medical images can reduce the workload of professional doctors and alleviate the problem of insufficient number of professional doctors in many hospitals. The current medical image segmentation methods can be divided into fully supervised methods and semi-supervised methods. The fully supervised method uses a large amount of labeled data to achieve accurate segmentation of medical images. However, a large amount of labeled data often requires a lot of human resources. Most medical images are unlabeled. Semi-supervised methods can make good use of a large amount of unlabeled data to achieve better segmentation results.
[0003] Mean-Teacher in Semi-Supervised Methods [1] It is a commonly used semi-supervised image segmentation method. Its main idea is to use two branches, namely the student network and the teacher network. The parameters of the teacher network are obtained by summing the parameters of the student network. The output of the teacher network is used as a pseudo label to supervise the segmentation of the student network. [2] It is another commonly used semi-supervised model, which also uses two branch networks. For the input of the two branches, the same image is input into the two branches respectively after different enhancement perturbations, and finally the consistency loss is used to make the segmentation results of the two branches as close as possible. However, the current semi-supervised medical image segmentation method still lacks the ability to automatically detect and segment samples with small area damage in the input image. The present invention provides a new semi-supervised medical image segmentation method, which can also show better segmentation results for small area damage. Summary of the invention
[0004] In order to overcome the shortcomings of the prior art, the purpose of the present invention is to provide a medical image segmentation method based on damage area perception and uncertainty guidance, which mainly targets small-area damage samples in the image and automatically scales them according to the damage area, thereby improving the network's segmentation ability for small-area damage samples.
[0005] The present invention provides a medical image segmentation method based on lesion area perception and uncertainty guidance, and the specific steps are as follows:
[0006] (1) Obtaining the region of interest
[0007] Add a bounding box regression algorithm at the end of the UNet encoder [3] , Generate bounding box annotations based on the segmentation annotation results, so that the UNet encoder can not only obtain the segmentation results, but also the region of interest;
[0008] The network structure of the UNet encoder adopts a 4-layer UNet structure, two convolution layers and a fully connected layer are added after the UNet encoder, and a four-dimensional vector is output for the bounding box regression algorithm.
[0009] (2) Calculate the transformation matrix and scale the region of interest;
[0010] For any region of interest, the transformation matrix is calculated as follows:
[0011]
[0012]
[0013] Among them, S is the area of the damaged area, W represents the width of the input image, α is a hyperparameter set to prevent the image damage area from being 0, θ is the conversion factor, which determines the conversion ratio of the image, and T is the conversion matrix; the smaller the damaged area S, the smaller the conversion factor θ, and the larger the zoom factor of the region of interest; the larger S is, the larger the zoom factor θ, and the smaller the magnification of the region of interest is; the zoom ratio can be dynamically adjusted according to the damaged area to reach a suitable size.
[0014] According to the transformation matrix T, the region of interest is transformed using the affine transformation method, and the calculation formula is as follows:
[0015] χ T =T i (3)
[0016] Among them, χ T is the pixel coordinate after transformation, χ i To input the coordinates of the image points in the region of interest;
[0017] Typically, the hyperparameter α is set to 0.3.
[0018] (3) Segment the scaled image
[0019] The scaled region of interest is used as input and segmented using the UNet neural network. The input of this neural network only contains the core area of the image, which can better process the details of the damaged area. In order to obtain a segmentation result of the same size as the original segmentation annotation, we add an affine transformation after the UNet result to convert it back to the original region of interest size; the formula for the affine transformation is as follows:
[0020] χ o =T -1 χ t (4) Where, χ t T is the pixel coordinates of the UNet segmentation result image; -1is the inverse matrix of the transformation matrix obtained by equation (2); o The pixel coordinates of the final output image.
[0021] Furthermore, in step (3), the output of UNet is a W×W×C result map, where C is the number of segmentation categories. The result map is first affine transformed using the bilinear interpolation method according to formula (4) and then passed through the Softmax layer to obtain the segmentation result probability map, and then the segmentation result is obtained with a threshold of 0.5.
[0022] (4) Uncertainty-Guided Segmentation Supervision
[0023] By adding two decoders to the UNet segmentation network, three segmentation results are obtained, one of which is the original decoder; one decoder gives a higher weight to its foreground segmentation result during training, making it segment the foreground area more accurately, which is called conservative segmentation; one decoder gives a higher weight to its background segmentation result during training, making it segment the background area more accurately, which is called aggressive segmentation. By calculating the residual of the segmentation results of conservative segmentation and aggressive segmentation, an uncertainty map can be obtained, and its calculation formula is as follows:
[0024] U=|M con -M rad |, (5)
[0025] Among them, M con represents the segmentation result of conservative segmentation, M rad represents the segmentation result of aggressive segmentation, and U is the uncertainty map. When calculating the loss, the area with higher uncertainty is given a lower weight, which can reduce the impact of the uncertain area on the network quota. The loss function is as follows:
[0026]
[0027] Among them, l ic represents the label of the i-th pixel in the c-th category, U i is the i-th pixel value in the uncertainty map, M ic is the probability value predicted by the network that the i-th pixel belongs to the c-th class, and N is the total number of pixels.
[0028] Furthermore, in step (4), the final total loss function is:
[0029] l total = l sup +βl unc (7)
[0030] Among them, l total is the total loss function, l sup For the labeled supervised loss function, the cross entropy loss function is used; lunc is the uncertainty-guided loss function, and β is a hyperparameter, usually set to 0.8.
[0031] The beneficial effects of the present invention are:
[0032] The method of the present invention not only takes into account the influence of small-area damage samples, so that samples with uneven damage areas are converted to a uniform scale during the training process, thereby improving the network's detection ability for small-area damage samples, but also takes into account the influence of uncertainty in the semi-supervised segmentation method. By adding the guidance of the uncertainty map, it avoids damage to the network caused by poor network segmentation results. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 The figure is a flow chart of the method of the present invention.
[0034] Figure 2 Result comparison of an embodiment of the present invention, where (a) is the segmentation result of this experiment, (b) is the segmentation result of other semi-supervised methods, and (c) is the segmentation annotation. DETAILED DESCRIPTION
[0035] The specific steps are:
[0036] (1) Before training, the image is normalized, randomly rotated, flipped, and enhanced;
[0037] (2) Pre-training: crop the images to a uniform size and use the labeled data to pre-train the networks of the two branches. One branch is trained using the original labeled data and the bounding box generated according to the label, and the other branch is trained using the cropped and transformed data. The initial learning rate of pre-training is set to 0.02, and the adam optimizer is used, with beta set to (0.5, 0.999);
[0038] (3) During training, the labeled data and the unlabeled data were cropped to a uniform size and then input into the network together. The two networks were trained jointly, with the learning rate set to 0.02, the adam optimizer was used, and beta was set to (0.5, 0.999);
[0039] (4) During testing, the image is cropped to a uniform size and then input into the network, and the segmentation results of the two networks can be obtained;
[0040] In formula (1), the hyperparameter α is set to 0.3; in formula (7), the hyperparameter β is set to 0.8.
[0041] Figure 2 is an example of the present invention, wherein Figure 2 (a) is the segmentation result of this experiment. Figure 2 (b) Other semi-supervised methods [4]The segmentation result map, Figure 2 (c) is the segmentation annotation; it can be seen that the method of the present invention has a better segmentation result for processing small area damage samples.
[0042] References
[0043] [1] A.Tarvainen and H.Valpola, “Mean teachers are better role mod-els: Weight-averaged consistency targets improve semi-supervised deep learning results,” in Advances in Neural Information Processing Systems, 2017, pp.1195–1204.
[0044] [2]L.Chen, P.Bentley, K.Mori, K.Misawa, M.Fujiwara and D.Rueckert, "DRINet for Medical Image Segmentation," in IEEE Transactions on Medical Imaging, vol.37, no.11, pp.2453-2462, Nov.2018, doi:10.1109 / TMI.2018.2835303.
[0045] [3]Ren S, He K, Girshick R, et al. Faster r-cnn: Towards real-time object detection with region proposal networks [J]. Advances in neural information processing systems, 2015, 28.
[0046] [4] Y.Shi et al., "Inconsistency-Aware Uncertainty Estimation for Semi-Supervised Medical Image Segmentation," in IEEE Transactions on MedicalImaging, vol.41, no.3, pp.608-620, March 2022, doi:10.1109 / TMI.2021.3117888.
Claims
1. A medical image segmentation method based on lesion area perception and uncertainty guidance, characterized in that: The specific steps are: (1) Obtaining the Region of Interest (ROI) Add a bounding box regression algorithm at the end of the UNet encoder to generate bounding box annotations based on the segmentation annotation results, so that the UNet encoder can obtain the segmentation results and the region of interest at the same time; (2) Calculate the transformation matrix and scale the region of interest For any region of interest, the transformation matrix is calculated as follows: Where S is the area of the damaged area, W represents the width of the input image, α is a hyperparameter set to prevent the image damage area from being zero, θ is a conversion factor used to determine the conversion ratio of the image, and T is a conversion matrix; the smaller the damaged area S, the smaller the conversion factor θ, and the larger the zoom factor of the region of interest; the larger S is, the larger the zoom factor θ, and the smaller the magnification of the region of interest; the zoom ratio is dynamically adjusted according to the damaged area to reach a suitable size; According to the transformation matrix T, the region of interest is transformed using the affine transformation method, and the calculation formula is as follows: x T =Tx i , (3) Among them, χ T is the pixel coordinate after transformation, χ i To input the coordinates of the image points in the region of interest; (3) Segment the scaled image The scaled region of interest is used as input and segmented using the UNet neural network. The input of the neural network only contains the core area of the image, so as to better process the detailed information of the damaged area. In order to obtain a segmentation result of the same size as the original segmentation annotation, an affine transformation is added after the UNet result to change it back to the original region of interest size. The affine transformation formula is as follows: x o =T -1 x t , (4) Among them, χ t T is the pixel coordinates of the UNet segmentation result image; -1 is the inverse matrix of the transformation matrix obtained by equation (2); o The pixel coordinates of the final output image; (4) Uncertainty-Guided Segmentation Supervision By adding two decoders to the UNet segmentation network, three segmentation results are obtained; one of them is the original decoder; in addition, one decoder gives a higher weight to its foreground segmentation result during training, making it segment the foreground area more accurately, which is called conservative segmentation; one decoder gives a higher weight to its background segmentation result during training, making it segment the background area more accurately, which is called aggressive segmentation; by calculating the residual of the segmentation results of conservative segmentation and aggressive segmentation, the uncertainty map is obtained, and its calculation formula is as follows: U=|M con -M rad |, (5) Among them, M con represents the segmentation result of conservative segmentation, M rad represents the segmentation result of aggressive segmentation, and U is the uncertainty map; When calculating the loss, areas with higher uncertainty are given lower weights to reduce the impact of uncertain areas on network quotas. The loss function is as follows: Among them, l ic represents the label of the i-th pixel in the c-th category, U i is the i-th pixel value in the uncertainty map, M ic is the probability value predicted by the network that the i-th pixel belongs to the c-th class, and N is the total number of pixels.
2. The method according to claim 1, characterized in that In step (1), the UNet encoder network is a 4-layer UNet network, and its encoder output passes through two convolution layers and a fully connected layer to output a four-dimensional vector for bounding box regression.
3. The method according to claim 1, characterized in that In step (2), the hyperparameter α is set to 0.
3.
4. The method according to claim 1, characterized in that In step (3), the output of UNet is a W×W×C result map, where C is the number of segmentation categories. The result map is first affine transformed according to formula (4) using the bilinear interpolation method and then passed through the Softmax layer to obtain the segmentation result probability map, and then the segmentation result is obtained with a threshold of 0.
5.
5. The method according to claim 1, characterized in that In step (4), the final total loss function is: l total =l sup +βl unc (7) Among them, l total is the total loss function, l sup For the labeled supervised loss function, the cross entropy loss function is used; l unc is the uncertainty-guided loss function, and β is a hyperparameter set to 0.8.
