CN-116012589-B - Image segmentation method, device, equipment and storage medium
Abstract
The application relates to an image segmentation method, an image segmentation device, image segmentation equipment and a storage medium, in particular to the technical field of image detection. The method comprises the steps of obtaining sample image data, carrying out feature extraction on the sample image data through a downsampling module of a target detection model to obtain a target sample feature image, carrying out upsampling on the target sample feature image through an upsampling module in the target detection model to obtain upsampling feature images of at least two layers, obtaining a first loss function value according to the upsampling feature images of a top layer and sample labels, carrying out channel compression on the upsampling feature images of at least two layers to obtain at least two layers of laminated feature images, obtaining a second loss function value according to the at least two layers of laminated feature images and the sample labels, and training the target detection model according to the first loss function value and the second loss function value to obtain a trained target detection model. Based on the scheme, the image recognition accuracy of the target detection model is improved.
Inventors
- DAI YAKANG
- ZHOU ZHIYONG
- GENG CHEN
- HU JISU
- QIAN XUSHENG
- ZHENG YI
Assignees
- 苏州国科康成医疗科技有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20230220
Claims (7)
- 1. An image segmentation method, the method comprising: Acquiring sample image data, wherein the sample image data comprises sample labels; The method comprises the steps of carrying out feature extraction on sample image data through a downsampling module of a target detection model to obtain a target sample feature map, wherein the downsampling module comprises at least two feature extraction layers, wherein the feature extraction layers comprise a convolution layer and a GC block layer; Up-sampling the target sample feature map through an up-sampling module in the target detection model to obtain at least two layers of up-sampling feature maps, wherein the up-sampling module comprises at least two up-sampling layers; Acquiring a first loss function value according to the upsampling feature map of the top layer and the sample label; respectively carrying out channel compression on the up-sampling feature images of the at least two layers to obtain at least two layers of compressed feature images, wherein the channel number of the up-sampling feature images of the up-sampling layer applying deep supervision is compressed to 1/4 of the channel number of the up-sampling feature images of the second layer; obtaining a second loss function value according to at least two layers of the laminated characteristic diagrams and the sample labels; training the target detection model according to the first loss function value and the second loss function value to obtain a trained target detection model, wherein the trained target detection model is used for processing target image data to obtain a target segmentation result; the obtaining a second loss function value according to the at least two layers of the laminated feature map and the sample label comprises: amplifying each layer of the laminated characteristic map to a specified resolution according to the layer number corresponding to each layer of the laminated characteristic map to obtain each first sample characteristic map; splicing the first sample feature images according to the channels, and processing the first sample feature images through the convolution layer and the full connection layer to obtain a first identification result; determining the second loss function value according to the first identification result and the sample label; The method further comprises the steps of: In the sample image, determining an outer ring boundary according to pixel points which are positioned outside a sample marked area and are separated from the sample marked boundary by a first threshold value; In the sample image, determining an inner ring boundary according to pixel points which are positioned in a sample marked area and are separated from the sample marked boundary by a second threshold value; determining a region between the outer ring boundary and the sample marked boundary as an outer ring region; determining a region between the inner ring boundary and the sample marked boundary as an inner ring region; Determining a third loss function value according to the inner loop region, the outer loop region and the up-sampling feature map; The training the target detection model according to the first loss function value and the second loss function value includes: And training the target detection model according to the first loss function value, the second loss function value and the third loss function value.
- 2. The method of claim 1, wherein obtaining a first loss function value from the top-level upsampled feature map and the sample label comprises: performing upsampling processing on the upsampled feature map of the top layer to obtain a second sample feature map; and obtaining the first loss function value according to the second sample feature map and the sample label.
- 3. The method according to claim 1 or 2, wherein said determining said third loss function value from said inner loop region, said outer loop region and said up-sampled feature map comprises: Determining the prediction probability sum of each pixel point of the inner ring area of the sample image according to the up-sampling feature map; determining the prediction probability sum of each pixel point of the outer ring area of the sample image according to the up-sampling feature map; And obtaining a third loss function value according to the prediction probability sum of each pixel point of the inner ring area and the prediction probability sum of each pixel point of the outer ring area.
- 4. The method according to claim 1 or 2, wherein the feature extraction of the sample image data by the downsampling module of the target detection model to obtain a target sample feature map comprises: And sequentially carrying out feature extraction processing on the sample image data through the at least two feature extraction layers to obtain at least two layers of downsampling feature images, wherein the target sample feature image is a downsampling feature image of the bottom layer.
- 5. An image segmentation apparatus, the apparatus comprising: The data acquisition unit is used for acquiring sample image data, wherein the sample image data comprises sample labels; The device comprises a sample image data acquisition unit, a feature extraction unit, a feature detection unit and a feature detection unit, wherein the sample image data acquisition unit is used for acquiring a target sample feature image through a downsampling module of a target detection model; the up-sampling unit is used for up-sampling the target sample feature map through an up-sampling module in the target detection model to obtain at least two layers of up-sampling feature maps, wherein the up-sampling module comprises at least two up-sampling layers; the first loss function acquisition unit is used for acquiring a first loss function value according to the upsampling feature map of the top layer and the sample label; The channel compression unit is used for respectively carrying out channel compression on the up-sampling feature images of the at least two layers to obtain at least two layers of compression feature images, wherein the channel number of the up-sampling feature images of the up-sampling layer applying deep supervision is compressed to 1/4 of the channel number of the up-sampling feature images of the second layer; The second loss function acquisition unit is used for acquiring a second loss function value according to at least two layers of the laminated characteristic diagrams and the sample labels; The training unit is used for training the target detection model according to the first loss function value and the second loss function value to obtain a trained target detection model, wherein the trained target detection model is used for processing target image data to obtain a target segmentation result; The second loss function obtaining unit is further configured to: amplifying each layer of the laminated characteristic map to a specified resolution according to the layer number corresponding to each layer of the laminated characteristic map to obtain each first sample characteristic map; splicing the first sample feature images according to the channels, and processing the first sample feature images through the convolution layer and the full connection layer to obtain a first identification result; determining the second loss function value according to the first identification result and the sample label; The apparatus further comprises a region determination unit for: In the sample image, determining an outer ring boundary according to pixel points which are positioned outside a sample marked area and are separated from the sample marked boundary by a first threshold value; In the sample image, determining an inner ring boundary according to pixel points which are positioned in a sample marked area and are separated from the sample marked boundary by a second threshold value; determining a region between the outer ring boundary and the sample marked boundary as an outer ring region; determining a region between the inner ring boundary and the sample marked boundary as an inner ring region; Determining a third loss function value according to the inner loop region, the outer loop region and the up-sampling feature map; The training unit is further configured to: And training the target detection model according to the first loss function value, the second loss function value and the third loss function value.
- 6. A computer device comprising a processor and a memory having stored therein at least one instruction that is loaded and executed by the processor to implement the image segmentation method of any of claims 1-4.
- 7. A computer readable storage medium having stored therein at least one instruction that is loaded and executed by a processor to implement the image segmentation method of any one of claims 1-4.
Description
Image segmentation method, device, equipment and storage medium Technical Field The present application relates to the field of image detection, and in particular, to an image segmentation method, apparatus, device, and storage medium. Background CT images are obtained by scanning according to the different absorption capacities of different tissues and organs of a human body on X rays, and a three-dimensional image is formed by a plurality of axial slices. In recent years, deep learning is increasingly applied to image segmentation. The U-shaped network structure Unet is a deep learning based semantic segmentation algorithm that follows the principles of FCNs and improves accordingly to accommodate small sample simple segmentation. The deep supervision is widely used in classification and segmentation, and the central thought is to provide direct supervision for a hidden layer, so that gradient information can be injected into a network deeper, gradient disappearance is effectively treated, and training of a middle layer is promoted. By combining the deep supervision with the U-shaped network structure, the problems of training gradient elimination, too slow convergence speed and the like of the U-shaped network structure can be effectively solved. However, since the effective information in the CT image stays only in the shallow layer of the network during the training process, the recognition accuracy of the network model is poor. Disclosure of Invention The application provides an image segmentation method, an image segmentation device, an image segmentation equipment and a storage medium. In one aspect, there is provided an image segmentation method, the method comprising: Acquiring sample image data, wherein the sample image data comprises sample labels; Performing feature extraction on the sample image data through a downsampling module of a target detection model to obtain a target sample feature map; Up-sampling the target sample feature map through an up-sampling module in the target detection model to obtain at least two layers of up-sampling feature maps, wherein the up-sampling module comprises at least two up-sampling layers; Acquiring a first loss function value according to the upsampling feature map of the top layer and the sample label; Channel compression is carried out on the up-sampling feature images of the at least two layers respectively, so that at least two layers of laminated feature images are obtained; obtaining a second loss function value according to at least two layers of the laminated characteristic diagrams and the sample labels; And training the target detection model according to the first loss function value and the second loss function value to obtain a trained target detection model, wherein the trained target detection model is used for processing target image data to obtain a target segmentation result. In yet another aspect, there is provided an image segmentation apparatus, the apparatus including: The data acquisition unit is used for acquiring sample image data, wherein the sample image data comprises sample labels; The feature extraction unit is used for extracting features of the sample image data through a downsampling module of the target detection model to obtain a target sample feature map; the up-sampling unit is used for up-sampling the target sample feature map through an up-sampling module in the target detection model to obtain at least two layers of up-sampling feature maps, wherein the up-sampling module comprises at least two up-sampling layers; the first loss function acquisition unit is used for acquiring a first loss function value according to the upsampling feature map of the top layer and the sample label; The channel compression unit is used for respectively carrying out channel compression on the up-sampling feature images of the at least two layers to obtain at least two layers of compression feature images; The second loss function acquisition unit is used for acquiring a second loss function value according to at least two layers of the laminated characteristic diagrams and the sample labels; The training unit is used for training the target detection model according to the first loss function value and the second loss function value to obtain a trained target detection model, and the trained target detection model is used for processing target image data to obtain a target segmentation result. In one possible implementation manner, the obtaining a second loss function value according to at least two layers of the laminated feature map and the sample labeling includes: amplifying each layer of the laminated characteristic map to a specified resolution according to the layer number corresponding to each layer of the laminated characteristic map to obtain each first sample characteristic map; splicing the first sample feature images according to the channels, and processing the first sample feature images through the convolution layer and