Gastric atrophy region segmentation system, electronic device and readable storage medium
By generating and screening pixel-level pseudo-label images, combined with image segmentation model training, the problem of high cost of annotating gastroscopy images is solved, and the accuracy and model performance of gastric atrophy area segmentation are improved.
Patent Information
- Application Number
- CN202410864665.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-07-01
AI Technical Summary
Semantic segmentation of gastroscopy images requires a large amount of pixel-level manual annotation, which results in high annotation costs and affects the accuracy of model predictions.
Multiple trainings are used to generate pixel-level pseudo-label images, and fused positioning maps are generated through dilated convolutions with different dilatations. Combined with trusted pseudo-label screening and image segmentation model training, the labeling cost is reduced and the accuracy of segmentation prediction is improved.
It effectively reduces the cost of labeling gastroscopy images, improves the accuracy of gastric atrophy region segmentation prediction, reduces the need for pixel-level manual labeling, and improves model performance.
Smart Images

Figure CN118397283B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a gastric atrophy region segmentation system, electronic equipment and a readable storage medium. Background Art
[0002] The evolution of gastric cancer is mainly divided into normal gastric mucosa, chronic superficial gastritis, chronic atrophic gastritis, intestinal metaplasia and dysplasia, and gastric cancer. By judging the severity of atrophic gastritis under gastroscopy, the probability of gastric cancer can be predicted at an early stage. With the development of digestive endoscopy and artificial intelligence technology, it has become possible to segment and predict gastric atrophy areas using trained deep learning models.
[0003] However, the semantic segmentation of gastroscopic images requires relevant professionals to perform a large amount of pixel-level manual annotation, so the annotation cost of gastroscopic images is high, resulting in very high data costs for training models, which in turn seriously affects the accuracy of model predictions. Summary of the invention
[0004] In order to solve the above problems, the present invention proposes a gastric atrophy region segmentation system, an electronic device and a readable storage medium to reduce the annotation cost of gastroscopic images and improve the accuracy of gastric atrophy region segmentation prediction.
[0005] In order to achieve the above object, the present invention adopts the following technical solution:
[0006] In a first aspect, the present invention provides a gastric atrophy region segmentation system, comprising:
[0007] A data acquisition module is configured to acquire a gastric atrophy image, a gastric non-atrophy image, and a pixel-level annotated image of a gastric atrophy region;
[0008] The pseudo-label generation module is configured to train the image classification model multiple times according to the gastric atrophy image and the gastric non-atrophy image to generate a pixel-level pseudo-label image; wherein the last convolution layer of the image classification model is set to multiple dilated convolutions with different dilation degrees, and each time the training is performed, the dilated convolutions with different dilation degrees are used to generate a fused positioning map, and a final positioning map is obtained based on the fused positioning maps of multiple trainings, and a significant area is delineated in the final positioning map, thereby obtaining a pixel-level pseudo-label image;
[0009] A credible pseudo-label screening module is configured to screen credible pixel-level pseudo-label images based on the pixel-level pseudo-label images;
[0010] The image segmentation module is configured to train an image segmentation model based on credible pixel-level pseudo-labels and pixel-level annotated images, and obtain a prediction result of gastric atrophy area segmentation using the trained image segmentation model based on the gastroscopy digital image to be tested.
[0011] As an optional implementation, the data acquisition module further includes:
[0012] The original gastroscopic digital images are obtained, clustered after feature extraction, and each type of original gastroscopic digital images is cleaned and labeled at the image level and pixel level, so as to obtain gastric atrophy images, gastric non-atrophy images and pixel-level labeled images of gastric atrophy areas.
[0013] As an optional implementation, the pseudo label generation module further includes:
[0014] During each training, a localization map is generated by using dilated convolutions with different dilation degrees. The localization maps generated after each round of training are weighted and summed to obtain a fused localization map. The maximum value of the pixels in the fused localization map obtained by multiple trainings is taken to obtain the final localization map. The areas in the final localization map with values greater than the set threshold are identified as salient areas, thereby obtaining a pixel-level pseudo-label image.
[0015] As an optional implementation, a class activation mapping algorithm is used to generate positioning maps for hole convolutions with different dilation degrees. The class activation mapping algorithm uses global average pooling instead of the fully connected layer, and then connects a linear classification layer to obtain a set of linear classification weights through training. The positioning map is obtained by weighted summing of the feature maps obtained by the last convolution layer based on the linear classification weights.
[0016] As an optional implementation, the trusted pseudo-label screening module further includes:
[0017] Setting a credible threshold, and setting the pixel-level pseudo-label images exceeding the credible threshold as the first group of credible pixel-level pseudo-label images;
[0018] Batch generate pseudo-label images corresponding to each non-atrophic stomach image and with all pixel values of 0, and set the pseudo-label images as the second group of credible pixel-level pseudo-label images;
[0019] The first set of credible pixel-level pseudo-label images and the second set of credible pixel-level pseudo-label images are proportionally merged into credible pixel-level pseudo-label images.
[0020] As an optional implementation, the image segmentation module further includes:
[0021] Set a weighted loss function for training the image segmentation model;
[0022] The weighted loss function is the sum of the weighted pseudo-label loss function and the labeled label loss function;
[0023] The annotation loss function and the pseudo-label loss function are both the sum of the cross entropy loss function and the Dice loss function.
[0024] As an optional implementation, the image segmentation module further includes:
[0025] When training the image segmentation model, feature extraction and downsampling are performed through the encoder, and the encoder and decoder with similar feature semantics are jump-connected using a nested structure. The corresponding semantic features of the encoder and decoder are fused, and upsampling is performed through the decoder. After multiple rounds of iterative training, the trained image segmentation model is obtained.
[0026] As an optional implementation, the image segmentation model shares an encoder, features of different layers are restored by a decoder, and a weighted loss function is added to the feature layer.
[0027] In a second aspect, the present invention provides an electronic device, including a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, a method for segmenting a gastric atrophy region is performed; the method for segmenting a gastric atrophy region includes:
[0028] Obtaining a gastric atrophy image, a gastric non-atrophy image, and a pixel-level annotated image of a gastric atrophy region;
[0029] The classification model is trained multiple times according to the gastric atrophy image and the gastric non-atrophy image to generate a pixel-level pseudo-label image; wherein the last convolution layer of the classification model is set to a plurality of dilated convolutions with different dilation degrees, and each time the training is performed, a fused localization map is generated by using dilated convolutions with different dilation degrees, and a final localization map is obtained based on the fused localization map of multiple trainings, and a significant area is delineated in the final localization map, thereby obtaining a pixel-level pseudo-label image;
[0030] Screening credible pixel-level pseudo-label images based on pixel-level pseudo-label images;
[0031] The segmentation model is trained according to the credible pixel-level pseudo-labels and pixel-level annotated images, and the segmentation prediction result of the gastric atrophy area is obtained by using the trained segmentation model according to the gastroscope digital image to be tested.
[0032] In a third aspect, the present invention provides a computer-readable storage medium for storing computer instructions, wherein when the computer instructions are executed by a processor, a method for segmenting a gastric atrophy region is performed; the method for segmenting a gastric atrophy region comprises:
[0033] Obtaining a gastric atrophy image, a gastric non-atrophy image, and a pixel-level annotated image of a gastric atrophy region;
[0034] The classification model is trained multiple times according to the gastric atrophy image and the gastric non-atrophy image to generate a pixel-level pseudo-label image; wherein the last convolution layer of the classification model is set to a plurality of dilated convolutions with different dilation degrees, and each time the training is performed, a fused localization map is generated by using dilated convolutions with different dilation degrees, and a final localization map is obtained based on the fused localization map of multiple trainings, and a significant area is delineated in the final localization map, thereby obtaining a pixel-level pseudo-label image;
[0035] Screening credible pixel-level pseudo-label images based on pixel-level pseudo-label images;
[0036] The segmentation model is trained according to the credible pixel-level pseudo-labels and pixel-level annotated images, and the segmentation prediction result of the gastric atrophy area is obtained by using the trained segmentation model according to the gastroscope digital image to be tested.
[0037] Compared with the prior art, the present invention has the following beneficial effects:
[0038] The present invention proposes a gastric atrophy region segmentation system, an electronic device and a readable storage medium, which generate pixel-level pseudo-label images based on gastric atrophy images and gastric non-atrophy images, and screen credible pixel-level pseudo-label images, and train an image segmentation model based on credible pixel-level pseudo-labels and pixel-level annotated images to perform segmentation prediction on gastric atrophy regions, thereby reducing the annotation cost of gastroscopic images, and automatically segmenting the gastric atrophy region of gastroscopic digital images, thereby improving the accuracy of gastric atrophy region segmentation prediction.
[0039] Since the cost of manual annotation at the pixel level is much higher than that of manual annotation at the image level, but manual annotation at the pixel level is much more detailed than that of manual annotation at the image level, and is more conducive to model training, if manual annotation is not used, the model prediction ability will be greatly weakened. Therefore, the present invention improves the traditional method of using only manual annotation data at the pixel level to a method of using both manual annotation data at the image level and manual annotation data at the pixel level. While ensuring that the accuracy of model prediction remains almost unchanged, the manual annotation at the image level is used to replace part of the manual annotation at the pixel level, which can effectively reduce the required manual annotation data at the pixel level, reduce the manual annotation cost, and achieve higher model performance at a certain cost.
[0040] The present invention uses image-level annotation to generate pixel-level pseudo-labels. Image-level annotation is to annotate the category to which the entire image belongs, and pixel-level pseudo-labels are to annotate each pixel on the annotated image. Obviously, the annotation accuracy of image-level annotation and pixel-level pseudo-labels is very different. Therefore, the present invention can significantly improve the generation quality when generating pixel-level pseudo-labels.
[0041] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0043] Figure 1 A schematic diagram of a gastric atrophy region segmentation system provided in Example 1 of the present invention;
[0044] Figure 2 A flow chart of a method implemented by the gastric atrophy region segmentation system provided in Example 1 of the present invention;
[0045] Figure 3 It is a schematic diagram of the pixel-level pseudo-label image generation process provided by Example 1 of the present invention. DETAILED DESCRIPTION
[0046] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0047] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0048] It should be noted that the terms used herein are only for describing specific embodiments, and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "include" and "have" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0049] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0050] Example 1
[0051] like Figure 1-Figure 2 As shown, this embodiment provides a gastric atrophy region segmentation system, comprising:
[0052] A data acquisition module is configured to acquire a gastric atrophy image, a gastric non-atrophy image, and a pixel-level annotated image of a gastric atrophy region;
[0053] The pseudo-label generation module is configured to train the image classification model multiple times according to the gastric atrophy image and the gastric non-atrophy image to generate a pixel-level pseudo-label image; wherein the last convolution layer of the image classification model is set to multiple dilated convolutions with different dilation degrees, and each time the training is performed, the dilated convolutions with different dilation degrees are used to generate a fused positioning map, and a final positioning map is obtained based on the fused positioning maps of multiple trainings, and a significant area is delineated in the final positioning map, thereby obtaining a pixel-level pseudo-label image;
[0054] A credible pseudo-label screening module is configured to screen credible pixel-level pseudo-label images based on the pixel-level pseudo-label images;
[0055] The image segmentation module is configured to train an image segmentation model based on credible pixel-level pseudo-labels and pixel-level annotated images, and obtain a prediction result of gastric atrophy area segmentation using the trained image segmentation model based on the gastroscopy digital image to be tested.
[0056] In this embodiment, the data acquisition module includes:
[0057] The cleaning unit is configured to: obtain the original gastroscope digital image collected by the endoscope device, perform feature extraction and clustering on the original gastroscope digital image, and remove irrelevant interference information from each type of original gastroscope digital image, so as to obtain a cleaned gastroscope digital image;
[0058] Specifically:
[0059] The resolution of the original gastroscopic digital image was compressed from 1920*1080 to 540*540, and the trained resnet50 model was used to obtain the image features before the pooling layer of the resnet50 model;
[0060] The k-means clustering algorithm is used for image features to classify similar image features into the same category, and k categories of image features are obtained;
[0061] The original gastroscope digital images are divided into k categories according to the corresponding k categories of image features, so as to obtain multiple categories of original gastroscope digital images;
[0062] For each type of original gastroscopic digital images, the low-quality images and the images with serious interference information occluding the main body are removed respectively, thereby obtaining high-quality original gastroscopic digital images;
[0063] The black background, text watermarks and thumbnails of different formats in the high-quality original gastroscope digital images were removed and cropped to a resolution of 1080*1080 to obtain the cleaned gastroscope digital images.
[0064] The k-means clustering algorithm first randomly selects k centroids, then calculates the distance between the sample and the centroid, selects the centroid with the shortest distance as a category, and then calculates the centroid of the new category, and compares the clustering result with the last result to see if it has changed. If there is a change, repeat from calculating the distance between the sample and the centroid until there is no change and outputs the clustering result.
[0065] In this embodiment, the purpose of clustering is to remove interfering images and remove interfering information in the images. For the multiple types of images obtained after clustering, algorithms can be designed to remove interfering images and remove interfering information in the images in batches; wherein, removing interfering information in the images means filling or cropping the pixels where the detected interfering information is located.
[0066] The annotation unit is configured to: annotate the gastroscopic digital image to obtain a gastric atrophy image, a gastric non-atrophy image, and a pixel-level annotated image of a gastric atrophy region;
[0067] Specifically:
[0068] Dividing the gastroscopic digital images into images to be annotated at the image level and images to be annotated at the pixel level;
[0069] Among them, the gastroscopic digital images are randomly divided according to proportion, and the images to be annotated at the image level and the images to be annotated at the pixel level are randomly divided according to 1:1 to achieve a good balance between the annotation cost and the segmentation accuracy; if the ratio is increased (such as 2:1), the annotation cost will be reduced, but the segmentation accuracy will be reduced at the same time; if the ratio is reduced, the annotation cost will increase, but the segmentation accuracy will be improved.
[0070] For the image to be annotated at the image level, a professional physician annotates whether it is a gastric atrophy image, and obtains a gastric atrophy image and a gastric non-atrophy image;
[0071] For the image to be annotated at the pixel level, a professional physician annotates the specific gastric atrophy area therein to obtain a pixel-level annotated image.
[0072] In this embodiment, the pseudo label generation module includes:
[0073] A preprocessing unit is configured to: preprocess the gastric atrophy image and the gastric non-atrophy image;
[0074] Specifically: the resolution of the gastric atrophy image and the gastric non-atrophy image is compressed from 1080*1080 to 224*224, and random rotation and probability horizontal rotation are performed to obtain the preprocessed gastric atrophy image and the gastric non-atrophy image;
[0075] The generation unit is configured to: input the image classification model for training, and obtain the pixel-level pseudo-label image through the pseudo-label generation model;
[0076] The preprocessed gastric atrophy images and gastric non-atrophy images were input into the resnet50 image classification model and trained using the cross entropy loss function. The convolution kernel of the last convolution layer of the resnet50 image classification model was set to dilated convolutions with different dilation degrees, and then global average pooling was performed, and the image category was predicted through the fully connected layer.
[0077] Among them, the class activation mapping algorithm is used to generate localization maps for the dilated convolutions with different dilation degrees. After each training, the localization maps generated after each round of training are weighted summed to obtain a fused localization map.
[0078] The number of rounds in each training is changed to obtain multiple fused positioning maps with different numbers of training rounds, and the maximum value of each pixel point of the multiple fused positioning maps is taken to obtain the final positioning map;
[0079] The areas in the final positioning map with values greater than the set threshold are identified as salient areas, and a pixel-level pseudo-label image is obtained. The specific process is as follows: Figure 3 shown.
[0080] As an optional implementation, the cross entropy loss function is:
[0081] ;
[0082] in, For sample The label of the positive class is 1 and the negative class is 0. For sample The probability of predicting the positive class.
[0083] As an optional implementation, the atrous convolutions with different dilation degrees are atrous convolutions with dilation rates of d1, d2, and d3, respectively, and the sizes of the convolution kernels are interpolated at different dilation rates;
[0084] The positioning maps generated by the dilated convolutions with different dilation degrees are respectively M1 generated by d1, M2 generated by d2, and M3 generated by d3;
[0085] The fused positioning map obtained by weighted summing of the generated positioning maps is: ;
[0086] in, To fuse the localization map, Set to 0.5, Set to 0.3, It is set to 0.2, so that the information obtained by the standard receptive field is more prominent; in this embodiment, the expansion rate of d1 is set to 1, the expansion rate of d2 is set to 3, and the expansion rate of d3 is set to 6. The corresponding receptive fields of the feature maps of the current layer increase successively, and the multi-scale context information obtained increases successively.
[0087] As an optional implementation, the class activation mapping algorithm uses global average pooling instead of the fully connected layer, and then connects a linear classification layer. A set of linear classification weights are obtained through training, and the feature map obtained by the last convolutional layer is weighted and summed based on the weights to obtain a positioning map.
[0088] As an optional implementation, three training sessions are set, and the number of rounds for each training session is set to n1, n2, and n3; wherein n1 is 200, n2 is 250, and n3 is 300, and three different fused positioning maps are obtained after three training sessions.
[0089] In this embodiment, the credible pseudo-label screening module is configured to determine whether the pixel-level pseudo-label image is credible by setting a credible threshold, so as to screen out credible pixel-level pseudo-label images;
[0090] Specifically:
[0091] The pixel-level pseudo-label images with a probability higher than the credible threshold in the prediction results of the resnet50 image classification model are set as the first group of credible pixel-level pseudo-label images;
[0092] Batch generate pseudo-label images with all pixel values of 0 corresponding to each stomach non-atrophy image, and set the pseudo-label images as the second group of credible pixel-level pseudo-label images;
[0093] The first group of credible pixel-level pseudo-label images and the second group of credible pixel-level pseudo-label images are merged into credible pixel-level pseudo-label images in a certain quantity ratio; wherein the ratio is set to 3:2 to prevent poor training effect caused by imbalance in the ratio.
[0094] In this embodiment, the image segmentation module includes:
[0095] The image segmentation model building unit is configured to: build the image segmentation model based on Unet++ and set a weighted loss function;
[0096] The weighted loss function is the label loss function + weight * pseudo label loss function;
[0097] Among them, the annotation label loss function and the pseudo label loss function are both cross entropy loss function + Dice loss function;
[0098] The Dice loss function is:
[0099] ;
[0100] in, express and The intersection between and Respectively and The number of elements of .
[0101] The weighted loss function is:
[0102] ;
[0103] in, is the label loss function, is the pseudo label loss function, is the weight.
[0104] The image enhancement unit is configured to compress the resolution of the credible pixel-level pseudo-label image and the pixel-level annotated image from 1080*1080 to 480*480, and perform horizontal flipping, affine transformation, perspective transformation, image blurring, image sharpening and Gaussian noise addition processing respectively to obtain the enhanced training set image.
[0105] The model training unit is configured to: input the training set images into the image segmentation model for training, perform feature extraction and downsampling through the encoder, use a nested structure to perform jump connection between the encoder and the decoder with similar feature semantics, fuse the corresponding semantic features of the encoder and the decoder, perform upsampling through the decoder, and obtain a trained image segmentation model after multiple rounds of iterative training;
[0106] The image segmentation model shares the same encoder, features of different layers are restored by a decoder, and a set weighted loss function is added to the four feature layers of the image segmentation model.
[0107] The segmentation prediction unit is configured to: use the trained image segmentation model on the gastroscope digital image to be tested to obtain the segmentation prediction result of the gastric atrophy area, set the transparency of the predicted gastric atrophy area, and then superimpose it on the gastroscope digital image to be tested for output.
[0108] In this embodiment, the image segmentation model is trained using both pixel-level annotated images and credible pixel-level pseudo-label images. Because the pixel-level annotated images are annotated by professional physicians, the pixel-level annotated images are more accurate than the pixel-level pseudo-label images. The pixel-level pseudo-label images are obtained from the image-level annotated images, so the pixel-level pseudo-label images are cheaper than the pixel-level manually annotated images, that is, the pixel-level manually annotated images are more expensive and more accurate, and using only pixel-level pseudo-labels will reduce the accuracy of model predictions.
[0109] In further embodiments, there is also provided:
[0110] An electronic device includes a memory and a processor, and computer instructions stored in the memory and running on the processor, wherein when the computer instructions are run by the processor, a method for segmenting a gastric atrophy region is completed; the method for segmenting a gastric atrophy region includes:
[0111] A data acquisition module is configured to acquire a gastric atrophy image, a gastric non-atrophy image, and a pixel-level annotated image of a gastric atrophy region;
[0112] The pseudo-label generation module is configured to train the image classification model multiple times according to the gastric atrophy image and the gastric non-atrophy image to generate a pixel-level pseudo-label image; wherein the last convolution layer of the image classification model is set to multiple dilated convolutions with different dilation degrees, and each time the training is performed, the dilated convolutions with different dilation degrees are used to generate a fused positioning map, and a final positioning map is obtained based on the fused positioning maps of multiple trainings, and a significant area is delineated in the final positioning map, thereby obtaining a pixel-level pseudo-label image;
[0113] A credible pseudo-label screening module is configured to screen credible pixel-level pseudo-label images based on the pixel-level pseudo-label images;
[0114] The image segmentation module is configured to train an image segmentation model based on credible pixel-level pseudo-labels and pixel-level annotated images, and obtain a prediction result of gastric atrophy area segmentation using the trained image segmentation model based on the gastroscopy digital image to be tested.
[0115] It should be understood that in this embodiment, the processor may be a central processing unit CPU, and the processor may also be other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, off-the-shelf programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0116] The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.
[0117] A computer-readable storage medium is used to store computer instructions. When the computer instructions are executed by a processor, a method for segmenting a gastric atrophy region is completed. The method for segmenting a gastric atrophy region includes:
[0118] A data acquisition module is configured to acquire a gastric atrophy image, a gastric non-atrophy image, and a pixel-level annotated image of a gastric atrophy region;
[0119] The pseudo-label generation module is configured to train the image classification model multiple times according to the gastric atrophy image and the gastric non-atrophy image to generate a pixel-level pseudo-label image; wherein the last convolution layer of the image classification model is set to multiple dilated convolutions with different dilation degrees, and each time the training is performed, the dilated convolutions with different dilation degrees are used to generate a fused positioning map, and a final positioning map is obtained based on the fused positioning maps of multiple trainings, and a significant area is delineated in the final positioning map, thereby obtaining a pixel-level pseudo-label image;
[0120] A credible pseudo-label screening module is configured to screen credible pixel-level pseudo-label images based on the pixel-level pseudo-label images;
[0121] The image segmentation module is configured to train an image segmentation model based on credible pixel-level pseudo-labels and pixel-level annotated images, and obtain a prediction result of gastric atrophy area segmentation using the trained image segmentation model based on the gastroscopy digital image to be tested.
[0122] The method can be directly implemented as a hardware processor, or can be implemented by a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.
[0123] Those skilled in the art will appreciate that the units, i.e., algorithm steps, of the various examples described in conjunction with this embodiment can be implemented in electronic hardware or in a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0124] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. A gastric atrophy region segmentation system, characterized in that: include: A data acquisition module is configured to acquire a gastric atrophy image, a gastric non-atrophy image, and a pixel-level annotated image of a gastric atrophy region; The pseudo-label generation module is configured to train the image classification model multiple times according to the gastric atrophy image and the gastric non-atrophy image to generate a pixel-level pseudo-label image; wherein the last convolution layer of the image classification model is set to multiple dilated convolutions with different dilation degrees, and each time the training is performed, the dilated convolutions with different dilation degrees are used to generate a fused positioning map, and a final positioning map is obtained based on the fused positioning maps of multiple trainings, and a significant area is delineated in the final positioning map, thereby obtaining a pixel-level pseudo-label image; A credible pseudo-label screening module is configured to screen credible pixel-level pseudo-label images based on the pixel-level pseudo-label images; The image segmentation module is configured to train an image segmentation model based on the credible pixel-level pseudo-labels and the pixel-level annotated images, and obtain a segmentation prediction result of a gastric atrophy region using the trained image segmentation model based on the gastroscope digital image to be tested; The data acquisition module further includes: acquiring original gastroscopic digital images, clustering the original gastroscopic digital images after feature extraction, and performing image-level annotation and pixel-level annotation on each type of original gastroscopic digital images after cleaning, so as to obtain a gastric atrophy image, a gastric non-atrophy image, and a pixel-level annotation image of a gastric atrophy area; The pseudo-label generation module also includes: each time training, using hole convolutions with different dilation degrees to generate a positioning map, weighted summing the positioning maps generated after each round of training to obtain a fused positioning map, taking the maximum value of the pixel points in the fused positioning map obtained by multiple trainings, thereby obtaining a final positioning map, and identifying the area in the final positioning map with a value greater than a set threshold as a significant area, thereby obtaining a pixel-level pseudo-label image; using a class activation mapping algorithm to generate positioning maps for hole convolutions with different dilation degrees respectively, the class activation mapping algorithm uses global average pooling to replace the fully connected layer, and then connects a linear classification layer to obtain a set of linear classification weights through training, and weighted summing the feature map obtained by the last convolution layer based on the linear classification weights to obtain the positioning map; The credible pseudo-label screening module also includes: setting a credible threshold, setting the pixel-level pseudo-label images exceeding the credible threshold as a first group of credible pixel-level pseudo-label images; batch-generating pseudo-label images corresponding to each gastric non-atrophy image and with all pixel values of 0, setting the pseudo-label images as a second group of credible pixel-level pseudo-label images; merging the first group of credible pixel-level pseudo-label images and the second group of credible pixel-level pseudo-label images into credible pixel-level pseudo-label images in proportion; The image segmentation module also includes: setting a weighted loss function for the training of the image segmentation model; the weighted loss function is the sum of the pseudo-label loss function after weighting and the label loss function; the label loss function and the pseudo-label loss function are both the sum of the cross entropy loss function and the Dice loss function; when training the image segmentation model, feature extraction and downsampling are performed through the encoder, and the encoder and decoder with similar feature semantics are skipped using a nested structure, the corresponding semantic features of the encoder and decoder are fused, and upsampling is performed through the decoder. After multiple rounds of iterative training, a trained image segmentation model is obtained; an encoder is shared in the image segmentation model, features of different layers are restored by the decoder, and a weighted loss function is added to the feature layer.
2. An electronic device, characterized in that: The method comprises a memory and a processor and computer instructions stored in the memory and executed on the processor, wherein the computer instructions are executed by the processor to complete the method for segmenting a gastric atrophy region; The gastric atrophy region segmentation method comprises: Obtaining a gastric atrophy image, a gastric non-atrophy image, and a pixel-level annotated image of a gastric atrophy region; The classification model is trained multiple times according to the gastric atrophy image and the gastric non-atrophy image to generate a pixel-level pseudo-label image; wherein the last convolution layer of the classification model is set to a plurality of dilated convolutions with different dilation degrees, and each time the training is performed, a fused localization map is generated by using dilated convolutions with different dilation degrees, and a final localization map is obtained based on the fused localization map of multiple trainings, and a significant area is delineated in the final localization map, thereby obtaining a pixel-level pseudo-label image; Screening credible pixel-level pseudo-label images based on pixel-level pseudo-label images; The segmentation model is trained according to the credible pixel-level pseudo-labels and the pixel-level annotated images, and the segmentation prediction result of the gastric atrophy area is obtained by using the trained segmentation model according to the gastroscope digital image to be tested; Acquire original gastroscopic digital images, perform clustering on the original gastroscopic digital images after feature extraction, clean each type of original gastroscopic digital images, and perform image-level annotation and pixel-level annotation to obtain gastric atrophy images, gastric non-atrophy images, and pixel-level annotation images of gastric atrophy areas; During each training, a dilated convolution with different dilation degrees is used to generate a localization map, and the localization maps generated after each round of training are weighted and summed to obtain a fused localization map. The maximum value of the pixel points in the fused localization map obtained by multiple trainings is taken to obtain a final localization map, and the area in the final localization map with a value greater than a set threshold is identified as a significant area, thereby obtaining a pixel-level pseudo-label image; a class activation mapping algorithm is used to generate localization maps for dilated convolutions with different dilation degrees, and the class activation mapping algorithm uses global average pooling to replace the fully connected layer, and then connects a linear classification layer to obtain a set of linear classification weights through training, and the feature map obtained by the last convolution layer is weighted and summed based on the linear classification weights to obtain a localization map; A credible threshold is set, and pixel-level pseudo-label images exceeding the credible threshold are set as the first group of credible pixel-level pseudo-label images; pseudo-label images corresponding to each gastric non-atrophy image and with all pixel values of 0 are batch-generated, and the pseudo-label images are set as the second group of credible pixel-level pseudo-label images; the first group of credible pixel-level pseudo-label images and the second group of credible pixel-level pseudo-label images are proportionally merged into credible pixel-level pseudo-label images; A weighted loss function is set for the training of the image segmentation model; the weighted loss function is the sum of the pseudo-label loss function after weighting and the annotated label loss function; the annotated label loss function and the pseudo-label loss function are both the sum of the cross entropy loss function and the Dice loss function; when training the image segmentation model, feature extraction and downsampling are performed through the encoder, and the encoder and decoder with similar feature semantics are jump-connected using a nested structure, the corresponding semantic features of the encoder and decoder are fused, and upsampling is performed through the decoder. After multiple rounds of iterative training, a trained image segmentation model is obtained; an encoder is shared in the image segmentation model, features of different layers are restored by the decoder, and a weighted loss function is added to the feature layer.
3. A computer-readable storage medium, characterized in that: Used to store computer instructions, when the computer instructions are executed by the processor, a method for segmenting a gastric atrophy region is completed; the method for segmenting a gastric atrophy region includes: Obtaining a gastric atrophy image, a gastric non-atrophy image, and a pixel-level annotated image of a gastric atrophy region; The classification model is trained multiple times according to the gastric atrophy image and the gastric non-atrophy image to generate a pixel-level pseudo-label image; wherein the last convolution layer of the classification model is set to a plurality of dilated convolutions with different dilation degrees, and each time the training is performed, a fused localization map is generated by using dilated convolutions with different dilation degrees, and a final localization map is obtained based on the fused localization map of multiple trainings, and a significant area is delineated in the final localization map, thereby obtaining a pixel-level pseudo-label image; Screening credible pixel-level pseudo-label images based on pixel-level pseudo-label images; The segmentation model is trained according to the credible pixel-level pseudo-labels and the pixel-level annotated images, and the segmentation prediction result of the gastric atrophy area is obtained by using the trained segmentation model according to the gastroscope digital image to be tested; Acquire original gastroscopic digital images, perform clustering on the original gastroscopic digital images after feature extraction, clean each type of original gastroscopic digital images, and perform image-level annotation and pixel-level annotation to obtain gastric atrophy images, gastric non-atrophy images, and pixel-level annotation images of gastric atrophy areas; During each training, a dilated convolution with different dilation degrees is used to generate a localization map, and the localization maps generated after each round of training are weighted and summed to obtain a fused localization map. The maximum value of the pixel points in the fused localization map obtained by multiple trainings is taken to obtain a final localization map, and the area in the final localization map with a value greater than a set threshold is identified as a significant area, thereby obtaining a pixel-level pseudo-label image; a class activation mapping algorithm is used to generate localization maps for dilated convolutions with different dilation degrees, and the class activation mapping algorithm uses global average pooling to replace the fully connected layer, and then connects a linear classification layer to obtain a set of linear classification weights through training, and the feature map obtained by the last convolution layer is weighted and summed based on the linear classification weights to obtain a localization map; A credible threshold is set, and pixel-level pseudo-label images exceeding the credible threshold are set as the first group of credible pixel-level pseudo-label images; pseudo-label images corresponding to each gastric non-atrophy image and with all pixel values of 0 are batch-generated, and the pseudo-label images are set as the second group of credible pixel-level pseudo-label images; the first group of credible pixel-level pseudo-label images and the second group of credible pixel-level pseudo-label images are proportionally merged into credible pixel-level pseudo-label images; A weighted loss function is set for the training of the image segmentation model; the weighted loss function is the sum of the pseudo-label loss function after weighting and the annotated label loss function; the annotated label loss function and the pseudo-label loss function are both the sum of the cross entropy loss function and the Dice loss function; when training the image segmentation model, feature extraction and downsampling are performed through the encoder, and the encoder and decoder with similar feature semantics are jump-connected using a nested structure, the corresponding semantic features of the encoder and decoder are fused, and upsampling is performed through the decoder. After multiple rounds of iterative training, a trained image segmentation model is obtained; an encoder is shared in the image segmentation model, features of different layers are restored by the decoder, and a weighted loss function is added to the feature layer.
