Gastric lesion segmentation method and system based on generative adversarial network
By introducing the residual mechanism and dilated convolution module into the U-Net segmentation network, and combining it with the discriminant network for alternate training, the problem of low accuracy in unclear gastroscopy image processing is solved, and the segmentation accuracy and early stage of gastric cancer lesions are improved. Detection capabilities.
Patent Information
- Application Number
- CN202111574420.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-21
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2041-12-21
AI Technical Summary
Existing gastric cancer detection methods have low accuracy when processing unclear gastroscopy images, and lack self-learning and self-adjustment capabilities, which limits the ability to identify early gastric cancer lesions.
The gastric lesion segmentation method based on generative adversarial network adds a residual mechanism and dilated convolution module to the improved U-Net segmentation network, and combines the discriminant network for alternate training to optimize the segmentation network to improve the segmentation accuracy of the lesion area.
It improves the segmentation accuracy and precision of the lesion area in gastroscopy pictures, can more clearly identify the details of the lesion edge, and improves the accuracy of early gastric cancer detection.
Smart Images

Figure CN114266786B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image segmentation, and in particular to a gastric lesion segmentation method based on a generative adversarial network and a gastric lesion segmentation system based on a generative adversarial network. Background Art
[0002] Gastric cancer is a serious and fatal malignant tumor. The top five cancers with the highest incidence and the top five cancers with the highest mortality rates in the world all have gastric cancer. At present, the commonly used method for gastric cancer examination is gastroscopy. Doctors can directly observe the internal situation of the stomach through gastroscopy images, so as to judge early gastric cancer. However, manual annotation of lesion areas is a time-consuming and laborious task. Using computer-aided diagnosis technology to segment gastric lesions has become an effective way. Extracting features such as texture and color in gastroscopy images is an important means of identifying lesion locations and the degree of cancer. These methods cannot model high-level semantics in images, have no self-learning and self-adjustment capabilities, and the feature content is also fixed, which to a certain extent limits these features in identifying early gastric cancer lesions. Other researchers use machine learning to extract information from a large amount of data to identify gastric lesions. Although the demand for experimental equipment is low and the experiment takes less time, the experimental detection accuracy is low, and the robustness and practicality are poor. In recent years, deep learning has developed rapidly in the field of medical image processing. The new generation of methods represented by convolutional neural networks have attracted extensive research and attention in the field of medical image segmentation. In the detection of early gastric cancer, when observing gastric mucosal lesions using a system based on convolutional neural networks, the experimental effect of using narrow-band imaging magnifying endoscopes is better than that of ordinary white light endoscopes. Due to the small amount of experimental data, the application scope of the CNN system is limited. In addition, the automatic detection model based on convolutional neural networks (CNN) fine-tunes the texture information of white light endoscope images, which can show the approximate location of early gastric cancer. However, since only gastroscopic images with texture information are selected for processing, the accuracy of the experimental results is affected. In addition, there is a CNN built using the deep neural network architecture GoogLeNet, which has sufficient parameters and effective expression of neural networks compared to traditional CNNs, and effectively improves the ability to distinguish between early gastric cancer and non-cancerous lesions. Since the experiment selected clear images, it is difficult to use unclear images to diagnose the disease.
[0003] In actual operation, unclear gastroscopic images may be captured, so the processing of unclear gastroscopic images needs to be studied. In the identification of lesion areas in gastroscopic images, the results of identifying and segmenting gastric lesions using simple deep convolutional neural networks are not ideal. Summary of the invention
[0004] In view of the above problems, the present invention provides a gastric lesion segmentation method based on a generative adversarial network, which segments gastroscopic lesion images through an improved segmentation network based on U-Net, and adds a residual mechanism to the encoding and decoding parts of the segmentation network, and introduces parallel branches into the network to propagate gradients, thereby avoiding the gradual disappearance of gradients as the network deepens. In addition, an expanded convolution module is used at the bottom of U-Net instead of ordinary convolution to obtain image information of different scales, so that the segmented lesion area obtains clearer edge details. In the process of network training, the segmentation network and the discriminant network are iteratively optimized until both converge at the same time. The trained segmentation network can be used to complete the segmentation of the lesion area in the gastroscopic image, thereby improving the segmentation accuracy and precision.
[0005] To achieve the above object, the present invention provides a gastric lesion segmentation method based on a generative adversarial network, comprising:
[0006] Inputting a gastroscopic lesion image sample into a segmentation network to obtain a segmentation prediction image of the lesion area; wherein the segmentation network includes an encoder, a dilated convolution module and a decoder based on U-Net, the encoder includes a convolution unit for downsampling an image, the dilated convolution module includes dilated convolutions with different dilation rates connected in series, the dilated convolution module is used to expand the receptive field of the image downsampled by the encoder, the decoder includes a convolution unit for upsampling the image to restore the input image size, and a residual connection operation is added to each convolution unit of the encoder and the decoder;
[0007] A four-channel tensor formed by splicing the gastroscopic lesion image sample and the segmentation prediction image and a four-channel tensor formed by splicing the gastroscopic lesion image sample and the manually annotated image are used as two sets of inputs of the discriminant network, and the true or false judgment of the two sets of inputs, namely the segmentation prediction image or the manually annotated image, is used as the output, and the segmentation network and the discriminant network are alternately trained to a balanced state by generative adversarial network in a game-theoretic manner;
[0008] The gastroscopic image for lesion segmentation is input into the segmentation network trained by the generative adversarial network to obtain the gastric lesion segmentation image.
[0009] In the above technical solution, preferably, the encoder includes 5 groups of convolution units, the first 4 groups of convolution units include two groups of convolution layers, batch normalization layers, ReLU activation functions and maximum pooling layers, and the last group of convolution units includes two groups of convolutions, batch normalization and ReLU activation functions;
[0010] The decoder includes 4 groups of convolution units, the first 3 groups of convolution units include upsampling and two groups of convolution layers, batch normalization layers and ReLU activation functions, and the last group of convolution units includes upsampling and two groups of 1×1 convolution layers, batch normalization layers and sigmoid activation functions;
[0011] A residual connection operation is added to each group of convolutional units to allow the gradient to be directly transferred from one end to the other end;
[0012] The dilated convolution module includes 4 groups of dilated convolutions, the dilation rates of the 4 groups of dilated convolutions are coprime numbers, and each group of dilated convolutions includes a convolution layer and a normalization layer.
[0013] In the above technical solution, preferably, the discriminant network includes 5 groups of convolutional units, each group of convolutional units includes two convolutional groups, each convolutional group includes a convolutional layer, a batch normalization layer, a ReLU activation function and a maximum pooling layer, and global average pooling is set after the 5 groups of convolutional units.
[0014] In the above technical solution, preferably, during the training process of the generative adversarial network, the adversarial loss function is:
[0015]
[0016] Among them, X r Indicates gastroscopy images, X s represents manually annotated images, G(X r ) represents the segmentation result mapping of the segmentation network, D(X r ,X s ) represents the output of the discriminant network, E[*] represents the expected value of the distribution function, and pdata(*) represents the distribution of the real sample;
[0017] The adversarial objective function is G * =min G max D L adv (G,D), where min G max D Indicates minimizing the segmentation network and maximizing the discrimination network;
[0018] The loss function of the segmentation network is
[0019]
[0020] The loss function of the generative adversarial network training is L total =G * +γL seg (G), where γ is the weight coefficient.
[0021] In the above technical solution, preferably, during the training process of the generative adversarial network, the discriminant network and the segmentation network are alternately iterated and trained. During the training process of the discriminant network, the parameters of the segmentation network are fixed so that D(X r ,X s ) to maximize D(X r ,G(X r )) is minimized to update the parameters of the discriminant network;
[0022] In the process of training the segmentation network, the parameters of the discriminant network are fixed so that D(X r ,G(X r )) is maximized to update the parameters of the segmentation network.
[0023] The present invention further proposes a gastric lesion segmentation system based on a generative adversarial network, which uses the gastric lesion segmentation method based on a generative adversarial network disclosed in any one of the above technical solutions, including:
[0024] A sample segmentation module, used for inputting gastroscopic lesion image samples into a segmentation network to obtain a segmentation prediction image of the lesion area; wherein the segmentation network includes an encoder, a dilated convolution module and a decoder based on U-Net, the encoder includes a convolution unit for downsampling an image, the dilated convolution module includes dilated convolutions with different dilation rates connected in series, the dilated convolution module is used to expand the receptive field of the image downsampled by the encoder, the decoder includes a convolution unit for upsampling the image to restore the input image size, and a residual connection operation is added to each convolution unit of the encoder and the decoder;
[0025] A generative adversarial training module uses a four-channel tensor formed by splicing the gastroscopic lesion image sample and the segmentation prediction image and a four-channel tensor formed by splicing the gastroscopic lesion image sample and the manually annotated image as two sets of inputs of the discriminant network, and uses the true or false judgment of the two sets of inputs, namely the segmentation prediction image or the manually annotated image, as output, and alternately performs generative adversarial network training on the segmentation network and the discriminant network in a game-theoretic manner until a balanced state;
[0026] The lesion segmentation module inputs the gastroscopic image to be segmented into the segmentation network trained by the generative adversarial network to obtain the gastric lesion segmentation image.
[0027] In the above technical solution, preferably, in the sample segmentation module, the encoder includes 5 groups of convolution units, the first 4 groups of convolution units include two groups of convolution layers, batch normalization layers, ReLU activation functions and maximum pooling layers, and the last group of convolution units includes two groups of convolutions, batch normalization and ReLU activation functions;
[0028] The decoder includes 4 groups of convolution units, the first 3 groups of convolution units include upsampling and two groups of convolution layers, batch normalization layers and ReLU activation functions, and the last group of convolution units includes upsampling and two groups of 1×1 convolution layers, batch normalization layers and sigmoid activation functions;
[0029] A residual connection operation is added to each group of convolutional units to allow the gradient to be directly transferred from one end to the other end;
[0030] The dilated convolution module includes 4 groups of dilated convolutions, the dilation rates of the 4 groups of dilated convolutions are coprime numbers, and each group of dilated convolutions includes a convolution layer and a normalization layer.
[0031] In the above technical solution, preferably, in the generative adversarial training module, the discriminant network includes 5 groups of convolutional units, each group of convolutional units includes two convolutional groups, each convolutional group contains a convolutional layer, a batch normalization layer, a ReLU activation function and a maximum pooling layer, and global average pooling is set after the 5 groups of convolutional units.
[0032] In the above technical solution, preferably, during the generative adversarial network training process performed by the generative adversarial training module, the adversarial loss function is:
[0033]
[0034] Among them, X r Indicates gastroscopy images, X s represents manually annotated images, G(X r ) represents the segmentation result mapping of the segmentation network, D(X r ,X s ) represents the output of the discriminant network, E[*] represents the expected value of the distribution function, and pdata(*) represents the distribution of the real sample;
[0035] The adversarial objective function is G * =min G max D L adv (G,D), where min G max D Indicates minimizing the segmentation network and maximizing the discrimination network;
[0036] The loss function of the segmentation network is
[0037]
[0038] The loss function of the generative adversarial network training is L total =G * +γL seg (G), where γ is the weight coefficient.
[0039] In the above technical solution, preferably, during the generative adversarial network training process of the generative adversarial training module, the discriminant network and the segmentation network are alternately iterated in the training process, and during the training of the discriminant network, the parameters of the segmentation network are fixed so that D(X r ,X s ) to maximize D(X r ,G(X r )) is minimized to update the parameters of the discriminant network;
[0040] In the process of training the segmentation network, the parameters of the discriminant network are fixed so that D(X r ,G(X r )) is maximized to update the parameters of the segmentation network.
[0041] Compared with the prior art, the beneficial effects of the present invention are as follows: the gastroscopic lesion images are segmented by an improved segmentation network based on U-Net, and a residual mechanism is added to the encoding and decoding parts of the segmentation network, and parallel branches are introduced into the network to propagate gradients, thereby avoiding the gradual disappearance of gradients as the network deepens. In addition, an expanded convolution module is used at the bottom of U-Net instead of ordinary convolution to obtain image information of different scales, so that the segmented lesion area obtains clearer edge details. In the process of network training, the segmentation network and the discriminant network are iteratively optimized until both converge at the same time, and the trained segmentation network can be used to complete the segmentation of the lesion area in the gastroscopic image, thereby improving the segmentation accuracy and precision. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A schematic diagram of an overall model of a gastric lesion segmentation method based on a generative adversarial network disclosed in an embodiment of the present invention;
[0043] Figure 2 A schematic diagram of the convolution unit structure of a gastric lesion segmentation method based on a generative adversarial network disclosed in an embodiment of the present invention;
[0044] Figure 3 A schematic diagram of a discriminant network of a gastric lesion segmentation method based on a generative adversarial network disclosed in an embodiment of the present invention;
[0045] Figure 4 A schematic diagram of a dilated convolution method for a gastric lesion segmentation method based on a generative adversarial network disclosed in an embodiment of the present invention;
[0046] Figure 5 The figure is a schematic diagram of the overall architecture of a gastric lesion segmentation method based on a generative adversarial network disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] The present invention is further described in detail below in conjunction with the accompanying drawings:
[0049] like Figure 1 As shown, a gastric lesion segmentation method based on a generative adversarial network provided by the present invention includes:
[0050] Inputting a gastroscopic lesion image sample into a segmentation network to obtain a segmentation prediction image of the lesion area; wherein the segmentation network is based on U-Net and includes an encoder, a dilated convolution module and a decoder, the encoder includes a convolution unit for downsampling an image, the dilated convolution module includes dilated convolutions with different dilation rates connected in series, the dilated convolution module is used to expand the receptive field of the image downsampled by the encoder, the decoder includes a convolution unit for upsampling the image to restore the size of the input image, and a residual connection operation is added to each convolution unit of the encoder and the decoder;
[0051] The four-channel tensor formed by splicing gastroscopic lesion image samples and segmentation prediction images and the four-channel tensor formed by splicing gastroscopic lesion image samples and manually annotated images are used as two sets of inputs of the discriminant network. The true or false judgment of the two sets of inputs, namely the segmentation prediction images or the manually annotated images, is used as the output. The segmentation network and the discriminant network are alternately trained to generate adversarial networks in a game-theoretic manner until they are in a balanced state.
[0052] The gastroscopic image for lesion segmentation is input into the segmentation network trained by the generative adversarial network to obtain the gastric lesion segmentation image.
[0053] In this embodiment, the gastroscopic lesion image is segmented by using an improved segmentation network based on U-Net, and a residual mechanism is added to the encoding and decoding parts of the segmentation network, and parallel branches are introduced into the network to propagate gradients, thereby avoiding the gradual disappearance of gradients as the network deepens. In addition, an expanded convolution module is used at the bottom of U-Net instead of ordinary convolution to obtain image information of different scales, so that the segmented lesion area obtains clearer edge details. In the process of network training, the segmentation network and the discriminant network are iteratively optimized until both converge at the same time. The trained segmentation network can be used to complete the segmentation of the lesion area in the gastroscopic image, thereby improving the segmentation accuracy and precision.
[0054] Specifically, in the generative adversarial network, the generator is a segmentation network improved by U-Net. When the gastroscopy image is input into the segmentation network, the segmentation prediction image of the lesion area will be output. The discriminator receives two sets of inputs: one set is a four-channel tensor of the original gastroscopy image and the segmentation result image of the generator spliced together according to the channel, and the other set is a four-channel tensor of the manually annotated real label and the original gastroscopy image. The output of the discriminator is a true or false judgment of whether the image is manually annotated or generated by the segmentation grid network. The discriminator iteratively optimizes the segmentation network by judging whether the input image is segmented or manually annotated, and improves the segmentation accuracy by continuously approaching the similarity between the segmentation image and the manually annotated image.
[0055] like Figure 2 and Figure 3 As shown, in the above embodiment, preferably, the encoder includes 5 groups of convolution units, the first 4 groups of convolution units include two groups of 3×3 convolution layers, batch normalization layers, ReLU activation functions and maximum pooling layers, and the last group of convolution units includes two groups of 3×3 convolutions, batch normalization and ReLU activation functions, and the maximum pooling layer is removed, so that the size of the feature map remains unchanged after passing through the convolution unit;
[0056] The decoder consists of 4 groups of convolutional units. The first 3 groups of convolutional units include upsampling and two groups of convolutional layers, batch normalization layers, and ReLU activation functions. The last group of convolutional units includes upsampling and two groups of 1×1 convolutional layers, batch normalization layers, and sigmoid activation functions.
[0057] A residual connection operation is added to each group of convolutional units to allow the gradient to be directly transferred from one end to the other end;
[0058] The dilated convolution module includes 4 groups of dilated convolutions, the dilation rates of the 4 groups of dilated convolutions are coprime numbers, and each group of dilated convolutions includes a convolution layer and a normalization layer.
[0059] In this embodiment, multi-scale information is obtained by adjusting the expansion rate of the dilated convolution, and the receptive field is expanded without losing resolution. On the one hand, a large receptive field can detect and segment large lesion areas, and on the other hand, a high resolution can accurately locate the lesion area. The gastroscopic image is input into the network, and a convolution operation is first performed to extract features and then pooling is performed, which reduces the image size while increasing the receptive field. However, since the image segmentation prediction is a pixel-by-pixel output, the smaller image size after pooling must be upsampled to the original image size through deconvolution for prediction. The previous pooling operation allows each pixel prediction to see larger receptive field information, but some image information is lost in the process of first reducing and then increasing.
[0060] Therefore, in the feature extraction process, a dilated convolution module is added to the network to obtain more global information by learning multi-scale features. Considering the problems of dilated convolution itself, when obtaining the result of a certain layer, the adjacent pixels are convolved from independent subsets, lacking mutual dependence, and the sparse sampling input signal makes the information obtained by long-distance convolution uncorrelated, and improper use will affect the classification results. Therefore, it is chosen to connect multiple dilated convolutions with different dilation rates in series to better adapt to lesions of different sizes in gastroscopic images.
[0061] like Figure 4 As shown, specifically, among the four groups of dilated convolutions, the first group uses a dilation rate of 1, the second group uses a dilation rate of 2, the third group uses a dilation rate of 3, and the fourth group uses a dilation rate of 5. The four groups of dilation rates have no common divisor other than 1, which can well avoid the "chessboard effect", and each group of results is concatenated as the input of the encoding path.
[0062] In the above embodiment, preferably, the discriminant network includes 5 groups of convolutional units, each group of convolutional units includes two convolutional groups, each convolutional group includes a convolutional layer with a convolution kernel of 3×3 and a step size of 2, a batch normalization layer, a ReLU activation function and a maximum pooling layer with a filter size of 2×2, and global average pooling is set after the 5 groups of convolutional units, and global average pooling is used instead of the fully connected layer. This design method is intended to make the conversion between the feature map and the final classification judgment simpler and more natural, and secondly, because the use of global average pooling can reduce spatial parameters to make the model more robust and better against overfitting.
[0063] In the above embodiment, preferably, during the training process of the generative adversarial network, the adversarial loss function is:
[0064]
[0065] Among them, X r Indicates gastroscopy images, X s represents manually annotated images, G(X r ) represents the segmentation result mapping of the segmentation network, D(X r ,X s ) represents the output of the discriminant network, E[*] represents the expected value of the distribution function, and pdata(*) represents the distribution of the real sample;
[0066] Specifically, after the log function, the final discriminant network will {X r , X s} is mapped to {0, 1}, when X s When X is 0, it means that the discriminator judges that the input is the lesion segmentation map generated by the generator. sWhen it is 1, it means that the discriminator determines that the input is a manually labeled lesion segmentation map.
[0067] The adversarial objective function is G * =min G max D L adv (G,D), where min G max D Indicates minimizing the segmentation network and maximizing the discrimination network;
[0068] The loss function of the segmentation network is
[0069] Specifically, for the segmentation network as a generator, it is still a binary classification task loss function, and the distance between the two is calculated by the binary cross entropy loss function. Since the learning rate can be controlled by the output error, the use of cross entropy as the loss function promotes the use of the sigmoid function when the gradient descends, effectively avoiding the problem of the mean square error loss function learning rate decrease.
[0070] The final loss function of the generative adversarial network training is L total =G * +γL seg (G) is obtained by adding the generation adversarial loss and the segmentation loss multiplied by a certain weight coefficient, where γ is the weight coefficient, preferably 10.
[0071] like Figure 5 As shown, in the above embodiment, preferably, during the training process of the generative adversarial network, the discriminant network and the segmentation network are alternately iterated in the training process. During the training process of the discriminant network, the parameters of the segmentation network are fixed so that D(X r ,X s ) to maximize D(X r ,G(X r )) is minimized to update the parameters of the discriminant network, and the manual annotations should be judged as true and the generated images should be judged as false as much as possible;
[0072] In the process of training the segmentation network, the parameters of the discriminant network are fixed so that D(X r ,G(X r )) is maximized to update the parameters of the segmentation network and try to produce a segmentation map that is close to the manual annotation.
[0073] Specifically, the training of the generative adversarial network is an alternating process, in which the segmentation network and the discriminant network are iteratively optimized in a game-playing manner until the two reach a balance.
[0074] Through the gastric lesion segmentation method based on the generative adversarial network disclosed in the above embodiment, after multiple experimental verifications, the segmentation accuracy rate reached about 91.9%. It can also be seen from the results that the segmented image contains most of the lesion area, which also shows that this achievement can help doctors in clinical diagnosis to a certain extent.
[0075] The present invention further proposes a gastric lesion segmentation system based on a generative adversarial network, which uses the gastric lesion segmentation method based on a generative adversarial network disclosed in any one of the above embodiments, including:
[0076] A sample segmentation module is used to input gastroscopic lesion image samples into a segmentation network to obtain a segmentation prediction image of the lesion area; wherein the segmentation network is based on U-Net and includes an encoder, a dilated convolution module and a decoder, the encoder includes a convolution unit for downsampling the image, the dilated convolution module includes dilated convolutions with different dilation rates connected in series, the dilated convolution module is used to expand the receptive field of the image downsampled by the encoder, the decoder includes a convolution unit for upsampling the image to restore the input image size, and a residual connection operation is added to each convolution unit of the encoder and the decoder;
[0077] Generative adversarial training module, using the four-channel tensor formed by splicing gastroscopic lesion image samples and segmentation prediction images and the four-channel tensor formed by splicing gastroscopic lesion image samples and manually annotated images as two sets of inputs of the discriminant network, and using the true or false judgment of the two sets of inputs, whether they are segmentation prediction images or manually annotated images, as output, and alternately performing generative adversarial network training on the segmentation network and the discriminant network in a game-theoretic manner until a balanced state;
[0078] The lesion segmentation module inputs the gastroscopic image to be segmented into the segmentation network trained by the generative adversarial network to obtain the gastric lesion segmentation image.
[0079] In this embodiment, the gastroscopic lesion image is segmented by using an improved segmentation network based on U-Net, and a residual mechanism is added to the encoding and decoding parts of the segmentation network, and parallel branches are introduced into the network to propagate gradients, thereby avoiding the gradual disappearance of gradients as the network deepens. In addition, an expanded convolution module is used at the bottom of U-Net instead of ordinary convolution to obtain image information of different scales, so that the segmented lesion area obtains clearer edge details. In the process of network training, the segmentation network and the discriminant network are iteratively optimized until both converge at the same time. The trained segmentation network can be used to complete the segmentation of the lesion area in the gastroscopic image, thereby improving the segmentation accuracy and precision.
[0080] Specifically, in the generative adversarial network, the generator is a segmentation network improved by U-Net. When the gastroscopy image is input into the segmentation network, the segmentation prediction image of the lesion area will be output. The discriminator, that is, the discriminant network, receives two sets of inputs: one set is a four-channel tensor of the original gastroscopy image and the segmentation result image of the generator spliced together according to the channel, and the other set is a four-channel tensor of the manually annotated real label and the original gastroscopy image. The output of the discriminator is a true or false judgment of whether the image is manually annotated or generated by the segmentation grid network. The discriminator iteratively optimizes the segmentation network by judging whether the input image is segmented or manually annotated, and improves the segmentation accuracy by continuously approaching the similarity between the segmentation image and the manually annotated image.
[0081] In the above embodiment, preferably, in the sample segmentation module, the encoder includes 5 groups of convolution units, the first 4 groups of convolution units include two groups of 3×3 convolution layers, batch normalization layers, ReLU activation functions and maximum pooling layers, and the last group of convolution units includes two groups of 3×3 convolutions, batch normalization and ReLU activation functions, and the maximum pooling layer is removed, so that the size of the feature map remains unchanged after passing through the convolution unit;
[0082] The decoder consists of 4 groups of convolutional units. The first 3 groups of convolutional units include upsampling and two groups of convolutional layers, batch normalization layers, and ReLU activation functions. The last group of convolutional units includes upsampling and two groups of 1×1 convolutional layers, batch normalization layers, and sigmoid activation functions.
[0083] A residual connection operation is added to each group of convolutional units to allow the gradient to be directly transferred from one end to the other end;
[0084] The dilated convolution module includes 4 groups of dilated convolutions, the dilation rates of the 4 groups of dilated convolutions are coprime numbers, and each group of dilated convolutions includes a convolution layer and a normalization layer.
[0085] In the above embodiment, preferably, in the generative adversarial training module, the discriminant network includes 5 groups of convolutional units, each group of convolutional units includes two convolutional groups, each convolutional group includes a convolutional layer with a convolution kernel of 3×3 and a step size of 2, a batch normalization layer, a ReLU activation function and a maximum pooling layer with a filter size of 2×2, and global average pooling is set after the 5 groups of convolutional units, and global average pooling is used instead of the fully connected layer. This design method is intended to make the conversion between the feature map and the final classification judgment simpler and more natural, and secondly, because the use of global average pooling can reduce spatial parameters to make the model more robust and better against overfitting.
[0086] In the above embodiment, preferably, during the generative adversarial network training by the generative adversarial training module, the adversarial loss function is:
[0087]
[0088] Among them, X r Indicates gastroscopy images, X s represents manually annotated images, G(X r ) represents the segmentation result mapping of the segmentation network, D(X r ,X s ) represents the output of the discriminant network, E[*] represents the expected value of the distribution function, and pdata(*) represents the distribution of the real sample;
[0089] Specifically, after the log function, the final discriminant network will {X r , X s} is mapped to {0, 1}, when X s When X is 0, it means that the discriminator judges that the input is the lesion segmentation map generated by the generator. s When it is 1, it means that the discriminator determines that the input is a manually labeled lesion segmentation map.
[0090] The adversarial objective function is G * =min G max D L adv (G,D), where min G max D Indicates minimizing the segmentation network and maximizing the discrimination network;
[0091] The loss function of the segmentation network is
[0092] Specifically, for the segmentation network as a generator, it is still a binary classification task loss function, and the distance between the two is calculated by the binary cross entropy loss function. Since the learning rate can be controlled by the output error, the use of cross entropy as the loss function promotes the use of the sigmoid function when the gradient descends, effectively avoiding the problem of the mean square error loss function learning rate decrease.
[0093] The loss function for training a generative adversarial network is L total =G * +γL seg (G) is obtained by adding the generation adversarial loss and the segmentation loss multiplied by a certain weight coefficient, where γ is the weight coefficient, preferably 10.
[0094] In the above embodiment, preferably, during the generative adversarial network training by the generative adversarial training module, the discriminant network and the segmentation network are alternately iterated in the training process. During the training of the discriminant network, the parameters of the segmentation network are fixed so that D(X r ,X s ) to maximize D(Xr ,G(X r )) is minimized to update the parameters of the discriminant network;
[0095] In the process of training the segmentation network, the parameters of the discriminant network are fixed so that D(X r ,G(X r )) is maximized to update the parameters of the segmentation network.
[0096] Specifically, the training of the generative adversarial network is an alternating process, in which the segmentation network and the discriminant network are iteratively optimized in a game-playing manner until the two reach a balance.
[0097] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A gastric lesion segmentation method based on generative adversarial network, characterized in that: include: Inputting a gastroscopic lesion image sample into a segmentation network to obtain a segmentation prediction image of the lesion area; wherein the segmentation network includes an encoder, a dilated convolution module and a decoder based on U-Net, the encoder includes a convolution unit for downsampling an image, the dilated convolution module includes dilated convolutions with different dilation rates connected in series, the dilated convolution module is used to expand the receptive field of the image downsampled by the encoder, the decoder includes a convolution unit for upsampling the image to restore the input image size, and a residual connection operation is added to each convolution unit of the encoder and the decoder; A four-channel tensor formed by splicing the gastroscopic lesion image sample and the segmentation prediction image and a four-channel tensor formed by splicing the gastroscopic lesion image sample and the manually annotated image are used as two sets of inputs of the discriminant network, and the true or false judgment of the two sets of inputs, namely the segmentation prediction image or the manually annotated image, is used as the output, and the segmentation network and the discriminant network are alternately trained to a balanced state by generative adversarial network in a game-theoretic manner; The encoder includes 5 groups of convolution units, the first 4 groups of convolution units include two groups of convolution layers, batch normalization layers, ReLU activation functions and maximum pooling layers, and the last group of convolution units includes two groups of convolutions, batch normalization and ReLU activation functions; The decoder includes 4 groups of convolution units, the first 3 groups of convolution units include upsampling and two groups of convolution layers, batch normalization layers and ReLU activation functions, and the last group of convolution units includes upsampling and two groups of 1×1 convolution layers, batch normalization layers and sigmoid activation functions; A residual connection operation is added to each group of convolutional units to allow the gradient to be directly transferred from one end to the other end; The dilated convolution module includes 4 groups of dilated convolutions, the dilation rates of the 4 groups of dilated convolutions are coprime numbers, and each group of dilated convolutions includes a convolution layer and a normalization layer; Inputting the gastroscope image to be segmented into the segmentation network trained by the generative adversarial network to obtain the gastric lesion segmentation image; During the training process of the generative adversarial network, the adversarial loss function is: Among them, X r Indicates gastroscopy images, X s represents manually annotated images, G(X r ) represents the segmentation result mapping of the segmentation network, D(X r ,X s ) represents the output of the discriminant network, E[*] represents the expected value of the distribution function, and pdata(*) represents the distribution of the real sample; The adversarial objective function is G * =min G max D L adv (G,D), where min G max D Indicates minimizing the segmentation network and maximizing the discrimination network; The loss function of the segmentation network is The loss function of the generative adversarial network training is L total =G * +γL seg (G), where γ is the weight coefficient.
2. The gastric lesion segmentation method based on generative adversarial network according to claim 1, characterized in that: The discriminant network includes 5 groups of convolutional units, each group of convolutional units includes two convolutional groups, each convolutional group includes a convolutional layer, a batch normalization layer, a ReLU activation function and a maximum pooling layer, and global average pooling is set after the 5 groups of convolutional units.
3. The gastric lesion segmentation method based on generative adversarial network according to claim 1, characterized in that: In the process of training the generative adversarial network, the discriminant network and the segmentation network are alternately and iteratively trained. During the training of the discriminant network, the parameters of the segmentation network are fixed so that D(X r ,X s ) to maximize D(X r ,G(X r )) is minimized to update the parameters of the discriminant network; In the process of training the segmentation network, the parameters of the discriminant network are fixed so that D(X r ,G(X r )) is maximized to update the parameters of the segmentation network.
4. A gastric lesion segmentation system based on generative adversarial network, characterized in that: The method for segmenting gastric lesions based on a generative adversarial network according to any one of claims 1 to 3 is applied, comprising: A sample segmentation module, used for inputting gastroscopic lesion image samples into a segmentation network to obtain a segmentation prediction image of the lesion area; wherein the segmentation network includes an encoder, a dilated convolution module and a decoder based on U-Net, the encoder includes a convolution unit for downsampling an image, the dilated convolution module includes dilated convolutions with different dilation rates connected in series, the dilated convolution module is used to expand the receptive field of the image downsampled by the encoder, the decoder includes a convolution unit for upsampling the image to restore the input image size, and a residual connection operation is added to each convolution unit of the encoder and the decoder; In the sample segmentation module, the encoder includes 5 groups of convolution units, the first 4 groups of convolution units include two groups of convolution layers, batch normalization layers, ReLU activation functions and maximum pooling layers, and the last group of convolution units includes two groups of convolutions, batch normalization and ReLU activation functions; The decoder includes 4 groups of convolution units, the first 3 groups of convolution units include upsampling and two groups of convolution layers, batch normalization layers and ReLU activation functions, and the last group of convolution units includes upsampling and two groups of 1×1 convolution layers, batch normalization layers and sigmoid activation functions; A residual connection operation is added to each group of convolutional units to allow the gradient to be directly transferred from one end to the other end; The dilated convolution module includes 4 groups of dilated convolutions, the dilation rates of the 4 groups of dilated convolutions are coprime numbers, and each group of dilated convolutions includes a convolution layer and a normalization layer; A generative adversarial training module uses a four-channel tensor formed by splicing the gastroscopic lesion image sample and the segmentation prediction image and a four-channel tensor formed by splicing the gastroscopic lesion image sample and the manually annotated image as two sets of inputs of the discriminant network, and uses the true or false judgment of the two sets of inputs, namely the segmentation prediction image or the manually annotated image, as output, and alternately performs generative adversarial network training on the segmentation network and the discriminant network in a game-theoretic manner until a balanced state; During the generative adversarial network training process performed by the generative adversarial training module, the adversarial loss function is: Among them, X r Indicates gastroscopy images, X s represents manually annotated images, G(X r ) represents the segmentation result mapping of the segmentation network, D(X r ,X s ) represents the output of the discriminant network, E[*] represents the expected value of the distribution function, and pdata(*) represents the distribution of the real sample; The adversarial objective function is G * =min G max D L adv (G,D), where min G max D Indicates minimizing the segmentation network and maximizing the discrimination network; The loss function of the segmentation network is The loss function of the generative adversarial network training is L total =G * +γL seg (G), where γ is the weight coefficient; The lesion segmentation module inputs the gastroscopic image to be segmented into the segmentation network trained by the generative adversarial network to obtain the gastric lesion segmentation image.
5. The gastric lesion segmentation system based on generative adversarial network according to claim 4, characterized in that: In the generative adversarial training module, the discriminant network includes 5 groups of convolutional units, each group of convolutional units includes two convolutional groups, each convolutional group contains a convolutional layer, a batch normalization layer, a ReLU activation function and a maximum pooling layer, and global average pooling is set after the 5 groups of convolutional units.
6. The gastric lesion segmentation system based on generative adversarial network according to claim 4, characterized in that: In the process of training the generative adversarial network by the generative adversarial training module, the discriminant network and the segmentation network are alternately iterated and trained. In the process of training the discriminant network, the parameters of the segmentation network are fixed so that D(X r ,X s ) to maximize D(X r ,G(X r )) is minimized to update the parameters of the discriminant network; In the process of training the segmentation network, the parameters of the discriminant network are fixed so that D(X r ,G(X r )) is maximized to update the parameters of the segmentation network.
