Polyp segmentation model establishment method and polyp segmentation method based on box annotation training

By introducing the masking box strategy, mask loss and feature contrast loss into the polyp segmentation model, the problem that box annotation cannot provide rich supervision information is solved, and the performance of the polyp segmentation model is significantly improved, especially in complex and multiple polyp segmentation tasks. It shows excellent segmentation effect.

CN117351199BActive Publication Date: 2024-10-11HUAZHONG UNIV OF SCI & TECH +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311165596.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-11
Publication Date
2024-10-11
Estimated Expiration
2043-09-11

AI Technical Summary

Technical Problem

Existing polyp segmentation models based on box annotation cannot provide rich supervision information, resulting in poor polyp segmentation performance of the trained model, especially when polyps and surrounding tissue have similar colors and blurred boundaries in endoscopic images.

Method used

A projection loss function based on the masking other box strategy is used, combined with the mask loss and foreground feature contrast loss of the teacher model and student model. Through projection loss, mask loss and feature contrast loss, richer supervision information is provided to improve the performance of the model. Segmentation performance.

Benefits of technology

It effectively reduces the annotation workload while improving the segmentation performance of the polyp segmentation model, especially in the segmentation tasks of small polyps and multiple polyps with complex boundaries and unclear boundaries, showing better accuracy and fewer false positive predictions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117351199B_ABST
    Figure CN117351199B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for establishing a polyp segmentation model based on frame annotation training and a polyp segmentation method, which belongs to the field of medical image segmentation, and includes: obtaining an endoscopic image set annotated with a polyp annotation frame, and establishing a first deep learning model; using the endoscopic image in the endoscopic image set as input, training the first deep learning model, optimizing the first deep learning model through back propagation to minimize the training loss, and after the training, using the first deep learning model as a polyp segmentation model; the training loss includes a projection loss calculated based on a "shielding other boxes" strategy, a self-guided supervision loss based on a box optimization mask, and a self-guided supervision loss based on typical features. The present invention realizes the usability of projection loss in semantic box supervised segmentation tasks, and provides richer supervision information with the help of a teacher model, effectively improving the performance of polyp segmentation under frame supervision, and solving the problem of difficulty in labeling endoscopic polyp images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of medical image segmentation, and more specifically, relates to a method for establishing a polyp segmentation model based on frame annotation training and a polyp segmentation method. Background Art

[0002] Polyps refer to the growths that grow on the surface of human tissues. Modern medicine usually refers to the growths that grow on the surface of human mucosa as polyps. In medicine, they are generally named according to the location where they appear. For example, those that appear on the stomach wall are called "gastric polyps", those in the intestinal cavity are called "intestinal polyps", and so on. If there are more than two polyps in a certain part, it is also called "multiple polyps". Clinically, endoscopes are often used to assist in the examination of polyps. Polyps are a type of benign tumor. The clinical manifestations are mostly inflammatory polyps, adenomatous polyps and certain gastrointestinal polyposis syndromes. Although these lesions are benign, some of them have a tendency to become malignant. Therefore, in the early stage, being able to accurately segment polyps from endoscopic images is of great significance for reducing the discovery rate and mortality rate of certain malignant tumors.

[0003] With the development of artificial intelligence related technologies, auxiliary diagnosis technologies based on deep learning have been widely used in various medical-related scenarios, such as polyp segmentation of endoscopic images based on deep learning models, but currently, these working methods are based on pixel-level mask labels to train convolutional neural networks (Convolutional Neural Network). However, the boundary between polyps and surrounding normal tissues is often very vague, and even experienced doctors cannot accurately depict the edge of polyps. In comparison, if the labeling work only needs to draw a rectangular labeling box (labeling box) to represent the polyp, the labeling burden can be effectively reduced. The result supervision model training based on box labeling is also called "box supervision."

[0004] However, most of the current segmentation methods based on box annotation are aimed at natural scenes, where the foreground and background often have large color differences. Therefore, these methods can often use the color information of the image as prior information to distinguish the foreground from the background, or can generate high-quality pseudo labels for model training. However, in endoscopic images, the color of polyps is very similar to that of the surrounding normal tissues, and the boundaries are very blurred, so these methods cannot show good results in the polyp segmentation task. In addition, box annotation cannot provide rich supervision information for model training. Therefore, while training the model through box annotation to effectively reduce the burden of annotation work, how to make the model trained only by box annotation show efficient and accurate polyp segmentation performance is a technical difficulty that needs to be solved urgently. Summary of the invention

[0005] In view of the defects of the prior art and the need for improvement, the present invention provides a method for establishing a polyp segmentation model based on frame annotation training and a polyp segmentation method, aiming to solve the problem that frame annotation cannot provide rich supervision information for the polyp segmentation model and thus cannot guarantee the polyp segmentation performance of the trained model.

[0006] To achieve the above object, according to one aspect of the present invention, a method for establishing a polyp segmentation model based on frame annotation training is provided, comprising:

[0007] Initialization step: obtaining an endoscopic image set with polyp annotation frames, and establishing a first deep learning model for segmenting polyps from the endoscopic images to obtain polyp masks;

[0008] Model training steps: using the endoscopic image in the endoscopic image set as input, training the first deep learning model, optimizing the first deep learning model through back propagation to minimize the training loss, and after the training, using the first deep learning model as a polyp segmentation model;

[0009] The training loss includes the projection loss between the annotation box calculated based on the shielding other box strategy and the polyp mask predicted and output by the first deep learning model, where the polyp mask is the supervised image. The projection loss is calculated based on the shielding other box strategy as follows:

[0010] Convert the annotation box of each endoscopic image I into N data pairs; each data pair contains a annotation box B i and other annotation boxes N is the number of annotation boxes;

[0011] For each data pair, obtain the annotation box B i And the corresponding single annotation box image b i , and mask out the images belonging to the set from the supervised image The pixels of the labeled box in the image are obtained as a single instance image.

[0012] Calculate the projection loss between all single-annotated box images and the corresponding single instance images;

[0013] Among them, the single annotation box image b i In the marked box B i The pixel inside is 1, which is located in the marked box B i Pixels outside are 0.

[0014] Further, the initialization step also includes: establishing a second deep learning model as a teacher model for segmenting polyps from the endoscopic image to obtain a polyp mask, and using the first deep learning model as a student model;

[0015] Furthermore, the model training step also includes: each time the parameters of the student model are updated, they are passed to the teacher model;

[0016] In addition, the training loss also includes: mask loss; the mask loss is used to characterize the difference in each pixel between the polyp mask predicted by the teacher model and the polyp mask predicted by the student model.

[0017] Furthermore, the mask loss is calculated as:

[0018]

[0019] Among them, L mask represents the mask loss; m represents the polyp mask predicted by the student model; m t represents the polyp mask predicted by the teacher model, b represents the set of single-labeled box images, ο represents the dot product; F() represents the calculation of the difference between each pixel.

[0020] Furthermore, the training loss also includes: foreground and background feature contrast loss;

[0021] The calculation method of the foreground and background feature contrast loss includes:

[0022] Select some features extracted from the teacher model and upsample them to the original endoscopic image size before fusion as the teacher feature f t , select the corresponding partial features from the features extracted by the student model, upsample them to the original endoscopic image size, and then fuse them into the student feature f;

[0023] The polyp mask m predicted by the teacher model t From the teacher characteristics t Extract the typical foreground features p f , and calculate the background typical feature p b ;

[0024] Calculate the student features f and the foreground typical features p respectively f The similarity between f and student characteristics f and background typical characteristics p b The similarity between b , and according to the similarity r f and similarity r b Construct foreground response map m f ; Foreground response map m f In the figure, the larger the pixel value, the closer the student feature f is to the foreground than the background;

[0025] Respond to the foreground image m f For the supervised image, the annotation box and foreground response map m are calculated based on the masking box strategy fThe projection loss between the foreground and background features is obtained.

[0026] Further,

[0027]

[0028] Among them, T(·) means using a preset threshold for binarization, and M is The total number of pixels with a median value of 1, Represents dot product.

[0029] Further,

[0030]

[0031] Among them, softmax 1 (·) indicates softmax operation along the first dimension; Is the teacher characteristic conversion t The background pixel set.

[0032] Further,

[0033] According to another aspect of the present invention, there is provided an endoscopic image polyp segmentation method, comprising:

[0034] Inputting the endoscopic image to be segmented into the polyp segmentation model established by the polyp segmentation model establishment method based on frame annotation training provided by the present invention to obtain a polyp mask;

[0035] The polyp segmentation result is obtained by multiplying the endoscopic image to be segmented with the polyp mask.

[0036] According to another aspect of the present invention, a computer-readable storage medium is provided, comprising a stored computer program; when the computer program is executed by a processor, the device where the computer-readable storage medium is located is controlled to execute the polyp segmentation model established by the method for establishing a polyp segmentation model based on frame annotation training provided by the present invention, or the endoscopic image polyp segmentation method provided by the present invention.

[0037] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects:

[0038] (1) The present invention provides a method for establishing a polyp segmentation model based on frame annotation training. The training loss of the model includes the projection loss between the annotation box calculated based on the masking other box strategy and the polyp mask predicted and output by the first deep learning model. Specifically, the endoscopic image containing the annotation box is separated into single-annotated frame images. For each single-annotated frame image, the content located in the remaining annotation boxes is masked from the segmentation result output by the model to obtain a segmentation result corresponding to the single-annotated frame image. Thus, the output result of the model is converted into a corresponding number of "class instantiation" outputs according to the real frame annotation, so that the Projection Loss can be used in the training of the polyp segmentation model to accurately measure the loss between the segmentation result output by the model and the frame annotation information, thereby providing effective supervision information for model training, and ensuring the segmentation performance of the model while reducing the annotation workload based on the frame annotation.

[0039] (2) In the preferred embodiment of the present invention, a teacher model is further established, and a mask loss is introduced into the training loss to characterize the pixel differences between the polyp mask predicted by the teacher model and the polyp mask predicted by the student model, so that the polyp mask output by the teacher model can be used as a pseudo-label to guide and supervise the student model pixel by pixel, and more knowledge information is provided to the student model on the basis of the annotated frame. In a further preferred embodiment, before calculating the mask loss, the polyp mask output by the teacher model is optimized using the frame annotation information, and the false positive pixel predictions outside the frame are filtered out, so as to further improve the segmentation performance of the trained polyp segmentation model.

[0040] (3) In the preferred embodiment of the present invention, on the basis of establishing the teacher model, the foreground and background feature contrast loss is introduced into the training loss, so that the typical features extracted from the teacher model can be used to guide the feature learning of the student model. This process does not directly constrain the model output, but indirectly constrains the model output by constraining the response graph, which is similar to the auxiliary guidance of the output level, thereby providing richer supervision information and further improving the segmentation performance of the trained polyp segmentation model.

[0041] (4) In the preferred embodiment of the present invention, when calculating the foreground and background feature contrast loss, a single feature vector is used to represent the foreground typical feature, and The similarity between background features and teacher features was calculated, and based on the calculated similarity, Different weights are assigned to the pixels in the image, which is consistent with the characteristics of the foreground and background in the endoscopic image, and can accurately obtain the typical features of the foreground and the background. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1A schematic diagram of a method for establishing a polyp segmentation model based on frame annotation training provided in an embodiment of the present invention;

[0043] Figure 2 A schematic diagram of calculating the projection loss between the annotation box and the polyp mask output by the student model based on the shielding box strategy provided in an embodiment of the present invention;

[0044] Figure 3 A qualitative comparison diagram of the segmentation results of polyps with complex boundaries obtained by training polyp segmentation models based on different box supervision methods provided in an embodiment of the present invention; wherein (a) is the original endoscopic image and its annotation box, (b) is the gold standard mask, (c) is the segmentation result of the model trained with BoxInst, (d) is the segmentation result of the model trained with DiscoBox, (e) is the segmentation result of the model trained with BoxLevelset, and (f) is the segmentation result of the polyp segmentation method provided in an embodiment of the present invention;

[0045] Figure 4 A qualitative comparison diagram of the segmentation results of inconspicuous small polyps obtained by the polyp segmentation models trained based on different box supervision methods provided in the embodiment of the present invention; wherein (a) is the original endoscopic image and its annotation box, (b) is the gold standard mask, (c) is the segmentation result of the model trained by BoxInst, (d) is the segmentation result of the model trained by DiscoBox, (e) is the segmentation result of the model trained by BoxLevelset, and (f) is the segmentation result of the polyp segmentation method provided in the embodiment of the present invention;

[0046] Figure 5 A qualitative comparison diagram of the segmentation results of multiple polyps obtained by the polyp segmentation models trained based on different box supervision methods provided in the embodiment of the present invention; wherein, (a) is the original endoscopic image and its annotation box, (b) is the gold standard mask, (c) is the segmentation result of the model trained by BoxInst, (d) is the segmentation result of the model trained by DiscoBox, (e) is the segmentation result of the model trained by BoxLevelset, and (f) is the segmentation result of the polyp segmentation method provided in the embodiment of the present invention. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0048] In the present invention, the terms "first", "second", etc. (if any) in the present invention and the accompanying drawings are used to distinguish similar objects but not necessarily to describe a specific order or sequence.

[0049] In order to solve the problem that the existing box annotation cannot provide rich supervision information for the polyp segmentation model and thus cannot guarantee the polyp segmentation performance of the trained model, the present invention provides a method for establishing a polyp segmentation model based on box annotation training and a polyp segmentation method. The overall idea is: on the basis of box annotation, based on the characteristics of polyps in endoscopic images, a corresponding loss function is designed to provide richer supervision information, so as to effectively improve the segmentation performance of the trained polyp segmentation model.

[0050] The following are examples.

[0051] Embodiment 1:

[0052] A method for establishing a polyp segmentation model based on box annotation training includes: an initialization step and a model training step, and each step is specifically as follows.

[0053] In this embodiment, the initialization step includes two aspects of preprocessing, namely, preprocessing of the original image and preprocessing of the model structure. The preprocessing of the original image is used to obtain an endoscopic image set with polyp annotation boxes. In the endoscopic image set, each endoscopic image may contain one or more polyps and corresponding annotation boxes, and, optionally, in this embodiment, the size of each endoscopic image is unified to 352×352. The endoscopic image set will be used as a training data set for training the segmentation model. Optionally, this embodiment further expands the training data set by the following data enhancement method:

[0054] 1) Multi-scale enhancement, with scale multiples of 0.75, 1.0, and 1.25;

[0055] 2) Color enhancement: Randomly transform the image brightness in the interval [0.6, 1.4], and randomly transform the image contrast in the interval [0.6, 1.4].

[0056] In the initialization step of this embodiment, the preprocessing of the model structure specifically includes: establishing Figure 1 The model shown specifically includes two deep learning models, one of which is a teacher model and the other is a student model. Both the teacher model and the student model are used to segment polyps from endoscopic images to obtain polyp masks; the teacher model provides more refined guidance information for the student model; the model parameters of the student model will be optimized through back propagation during the training process. Each time the model parameters of the student model are optimized, they will be passed to the teacher model through the exponential mean indicator (EMA), and the two will be optimized together during training.

[0057] The structure of the teacher model and the student model is the same, and any segmentation model can be selected for implementation, such as UNet, PraNet, Polyp-PVT, SANet, etc. Optionally, in this embodiment, both the teacher model and the student model are Polyp-PVT.

[0058] In this embodiment, the model training step specifically includes: taking the endoscopic image in the endoscopic image set as input, training the first deep learning model, optimizing the first deep learning model through back propagation to minimize the training loss, and after the training, using the first deep learning model as a polyp segmentation model.

[0059] Since box annotation cannot provide rich supervision information for the training of polyp segmentation model, this embodiment improves the training loss function based on box annotation and according to the characteristics of endoscopic polyp images. First, in the traditional method of model training based on box annotation, projection loss is often used to reflect the training effect of the model. When calculating the projection loss, the segmentation result and the annotation box are projected along the x and y directions respectively, and then the loss of the projection of the two in the x and y directions is calculated. Projection Loss solves the problem of how to directly use box annotation and segmentation result to calculate the loss value in the box-supervised instance segmentation task. It can limit the segmentation result to the box annotation, thereby making full use of the box annotation information and greatly improving the performance of the box-supervised instance segmentation task.

[0060] However, since the endoscopic polyp segmentation task does not require specific distinction of polyp instances, and the public dataset label is a semantic mask that does not contain instance information, the polyp segmentation task is defined as a semantic segmentation task, and the output of the model does not contain instance information. In the case of multiple polyps, if the projections of different polyps intersect, the box reconstructed by the projection will not match the true box annotation. Therefore, when training the polyp segmentation model based on the box annotation, ProjectionLoss cannot be directly used to calculate the loss value of the box annotation and the model output, otherwise the segmentation performance of the trained model will not be guaranteed. Based on this, this embodiment first proposes a method for calculating the projection loss between the annotation box and the segmentation result output by the student model based on the strategy of shielding other boxes. The core idea of ​​this strategy is to separate the endoscopic image containing the annotation box into a single annotation box image. For each single annotation box image, the content in the remaining annotation boxes is shielded from the segmentation result output by the model to obtain the segmentation result corresponding to the single annotation box image. Thus, the output result of the model is converted into a corresponding number of "class instantiation" outputs according to the true box annotation, and then the projection loss is calculated for each pair of single annotation box images and single instance segmentation results.

[0061] Based on the above strategy, in this embodiment, the method of calculating the projection loss based on the shielding other box strategy is as follows:

[0062] Convert the annotation box of each endoscopic image I into N data pairs; each data pair contains a annotation box B i and other annotation boxes N is the number of annotation boxes;

[0063] For each data pair, obtain the annotation box B i And the corresponding single annotation box image b i , and mask out the images belonging to the set from the supervised image The pixels of the labeled box in the image are obtained as a single instance image.

[0064] Calculate the projection loss between all single-annotated box images and the corresponding single instance images;

[0065] Among them, the single annotation box image b i In the marked box B i The pixel inside is 1, which is located in the marked box B i Pixels outside are 0.

[0066] In this embodiment, when calculating the projection loss between the annotation box and the polyp mask based on the shielding box strategy, m represents the polyp mask output by the student model, and m represents i Represents the single-labeled box image b i The corresponding single instance image is Figure 2 For example, an original endoscopic image contains three annotation boxes, namely B 0 , B 1 and B 2 , the endoscopic image is divided into three pairs of data, namely:

[0067] B 0 ,

[0068] B 1 ,

[0069] B 2 ,

[0070] For B i and By filling "1" inside the box and "0" outside the box, i and Convert to b i and pass right If the value is negated, the value inside the box is "0" and the value outside the box is "1". By multiplying, we can shield the The content of b i The corresponding single instance image m i .

[0071] by represents the projection loss between the annotation box and the polyp mask calculated based on the shielding box strategy, then The calculation formula is as follows:

[0072]

[0073] In the formula, Dice(·,·) represents the calculation of the Dice similarity coefficient of two one-dimensional vectors, Proj c () and Proj y () Project the two-dimensional graph to the one-dimensional line value along the vertical direction and the vertical direction respectively.

[0074] The strategy based on shielding other boxes proposed in this embodiment enables the use of Projection Loss in the training of the polyp segmentation model to accurately measure the loss between the segmentation results output by the model and the box annotation information, providing effective supervision information for model training, while reducing the annotation workload based on box annotation and ensuring the segmentation performance of the model.

[0075] In order to further improve the segmentation performance of the polyp segmentation model, this embodiment will further use the segmentation results output by the teacher model to provide additional supervision information for the student model. Accordingly, in this embodiment, the training loss also includes: mask loss; the mask loss is used to characterize the difference between each pixel between the polyp mask predicted by the teacher model and the polyp mask predicted by the student model.

[0076] This embodiment introduces mask loss into the training loss, and can use the polyp mask output by the teacher model as a pseudo-label to guide and supervise the student model pixel by pixel, and provide more knowledge information for the student model based on the annotation box.

[0077] In order to further improve the accuracy of pseudo-label information, in this embodiment, before calculating the mask loss, the teacher mask is optimized using the single-labeled frame image. Specifically, the set b consisting of the single-labeled frame images is set to {b i} and the polyp mask m output by the teacher model t Based on the prior knowledge, the foreground (i.e., polyp) in the polyp segmentation task only exists in the labeled box. Therefore, b and m are multiplied. t Multiplying together can filter out the false positive pixel predictions outside the box and obtain the mask after box optimization. Compared with m t Closer to the true polyp mask, it replaces m tAs pseudo labels, we can guide and supervise the student model pixel by pixel, which can further improve the training effect of the model. The difference between each pixel of the polyp mask m output by the student model can be calculated using Intersection over Union (IoU), Dice loss, etc. Optionally, in this embodiment, IoU is used; represents the mask loss, then

[0078]

[0079] Taking into account that the boundary between polyps and surrounding normal tissues in endoscopic images is often very blurred, if the contrast between the foreground (polyps) and the background (surrounding normal tissues) can be increased, it will help to further improve the polyp segmentation accuracy of the model. Based on this consideration, this embodiment further introduces foreground and background feature contrast loss in the loss function.

[0080] In this embodiment, the calculation process of the foreground and background feature contrast loss is as follows:

[0081] First, a feature space needs to be defined, from which typical features of the foreground and background are calculated. Based on the principle of simple design and as few parameters as possible, in this embodiment, some features extracted from the teacher model are selected and upsampled to the original endoscopic image size and then fused into the teacher feature f t , select the corresponding partial features from the features extracted by the student model, upsample them to the original endoscopic image size, and then fuse them into the student feature f;

[0082] Optionally, the feature fusion method is to connect the feature maps along the channel dimension, and the final teacher feature f t And the student feature f constitutes the feature space. The specific features of which layers are involved can be selected according to which layer features the model is applied to during forward prediction.

[0083] Since there is no pixel-level category annotation in the case of box annotation, this embodiment calculates the typical features of the foreground and background to achieve the purpose of improving the foreground and background contrast. Inspired by few-shot learning, this embodiment uses the box optimization mask and fusion feature map of the teacher model, and adopts Adaptive Foreground Prototype (AFP) and Adaptive Self-support Background Prototype (ASBP) as the foreground typical feature p f And the background typical feature pb, the calculation process is as follows:

[0084]

[0085] Among them, T(·) means using a preset threshold for binarization, and M is The total number of pixels with a median value of 1, represents dot product;

[0086]

[0087] Among them, softmax 1 (·) indicates softmax operation along the first dimension; Is the teacher characteristic conversion t The background pixel set; The total number of pixels with a median value of 1 can be represented by K.

[0088] Since the foreground only includes polyps in the polyp segmentation task, the foreground pixels share semantic commonality, while the background pixels are often very cluttered, and different pixels are different at the visual and semantic levels. Therefore, the background typical feature p b The representation needs to be adaptively changed at different positions. This embodiment calculates the foreground typical feature p based on the above calculation formula. f and background typical features p b , using a single feature vector to represent the typical features of the foreground, and The similarity between background features and teacher features was calculated, and based on the calculated similarity, Different weights are assigned to the pixels in the image, which can accurately obtain the typical features of the foreground and the background.

[0089] According to experience, this embodiment calculates the typical feature p of the foreground f and background typical features p b , and the thresholds of the binarization operation T(·) are set to 0.5 and 0.8 respectively.

[0090] After calculating the typical feature p of the foreground f and background typical features p b On the basis of f The similarity between the background pixel and the feature value of p b The similarity between f and p is further calculated point by point in this embodiment. f 、p b The similarity of the front and background response graphs r is obtained. f and r b ; Optionally, in this embodiment, the cosine distance is used to calculate the feature similarity, and the calculation process is as follows:

[0091] r f = cosine(pf , f)

[0092] r b = cosine(p b , f)

[0093] Among them, cosine() means calculating the cosine distance point by point.

[0094] The normalized foreground response map m is further obtained using the following formula: f :

[0095]

[0096] m f The larger the median value, the closer the corresponding pixel in the student feature f is to the foreground compared to the background;

[0097] Respond to the foreground image m f For the supervised image, the annotation box and foreground response map m are calculated based on the masking box strategy f The projection loss between the foreground and background features is obtained.

[0098] This embodiment introduces the foreground and background feature contrast loss in the training loss, and can use the typical features extracted from the teacher model to guide the feature learning of the student model. This process does not directly constrain the model output, but indirectly constrains the model output through constraints on the response map, which is similar to auxiliary guidance at the output level.

[0099] Calculate the annotation box and foreground response map m based on the strategy of shielding other boxes f For the specific calculation method of the projection loss between the annotation box and the polyp mask m, please refer to the description of calculating the projection loss between the annotation box and the polyp mask m based on the strategy of shielding other boxes. Represents the calculation of the annotation box and foreground response map m based on the strategy of shielding other boxes f The projection loss between f,i Represents the foreground response map m f In the single labeled box image b i The corresponding single instance image is:

[0100]

[0101] in,

[0102] Based on the above analysis, this embodiment eliminates the projection loss calculated based on the shielding box strategy, and introduces the mask loss and the foreground and background feature contrast loss into the training loss. Finally, in this embodiment, the overall training loss The calculation formula is as follows:

[0103]

[0104] Among them, λ 1 and λ 2 Balance loss term, optionally, in this embodiment, λ 1 Set to 0.5, λ 2 Set to 1.0.

[0105] In the specific model optimization settings, for the student model, the model training uses the Adam optimizer and the learning rate is constant at 0.0001; while for the teacher model, the decay coefficient in the EMA operation is set to 0.99.

[0106] In general, this embodiment proposes a "shield other boxes" strategy to realize the usability of Projection Loss in polyp segmentation tasks based on semantic segmentation; by introducing mask loss in the training loss, the segmentation results output by the teacher model can be used as pseudo labels to self-guide and supervise the student model; by introducing the foreground and background feature contrast loss in the training loss, the foreground and background typical features of the teacher model can be generated, and the contrast feature learning of the student model can be enhanced by self-guidance. Therefore, this embodiment can provide richer supervision information for the training of the polyp segmentation model, and effectively improve the segmentation performance of the polyp segmentation model while reducing the annotation burden by using box annotation.

[0107] It should be noted that the balance loss term λ 1 and λ 2 The setting is only an optional setting and should not be understood as the only limitation of the present invention. In some other embodiments of the present invention, when the segmentation performance of the polyp segmentation model meets the application requirements, λ 1 and λ 2 One of the items in can also be set to 0, or even all of them can be set to 0. It is easy to understand that when λ 1 and λ 2 When both are set to 0, in the initialization step, the model structure established only needs to include the student model.

[0108] Embodiment 2:

[0109] An endoscopic image polyp segmentation method, comprising:

[0110] Inputting the endoscopic image to be segmented into the polyp segmentation model established by the polyp segmentation model establishment method based on frame annotation training provided in the above-mentioned embodiment 1 to obtain a polyp mask;

[0111] The polyp segmentation result is obtained by multiplying the endoscopic image to be segmented with the polyp mask.

[0112] Embodiment 3:

[0113] A computer-readable storage medium includes a stored computer program; when the computer program is executed by a processor, the device where the computer-readable storage medium is located is controlled to execute the polyp segmentation model established by the method for establishing a polyp segmentation model based on box annotation training provided in the above embodiment 1, or the endoscopic image polyp segmentation method provided in the above embodiment 2.

[0114] A colonoscope is a type of endoscope. Without loss of generality, polyp segmentation in a colonoscope image is taken as an example to further explain the beneficial effects that can be achieved by the present invention.

[0115] Five commonly used polyp public datasets (ClinicDB, Kvasir-SEG, ColonDB, EndoScene and ETIS) were used as experimental datasets. Specifically, 548 images in ClinicDB and 900 images in Kvasir-SEG were used as training sets, and 64 images in ClinicDB, 100 images in Kvasir-SEG, 380 images in ColonDB, 60 images in EndoScene and 196 images in EITS were used as test sets.

[0116] Dice and IoU are used as evaluation metrics, which measure the similarity at the region level and focus on the internal consistency of the segmented objects. Here, the evaluation reports the average values ​​of Dice and IoU, denoted by mDice and mIoU, respectively.

[0117] Based on the most advanced polyp segmentation models UNet, PraNet and Polyp-PVT, supervised training is performed. The supervision methods include:

[0118] Supervised method 1: Full supervision of the model based on gold standard pixel masks;

[0119] Supervised method 2: Perform full supervision on the model based on the masks generated by filling in the gold standard box;

[0120] Supervised method 3: only using the projection loss between the annotation box and the polyp mask calculated based on the "shield other box" strategy for supervision;

[0121] Supervision method 4: using the training loss in the above embodiment 1 for supervision;

[0122] In addition, the currently suboptimal polyp segmentation model SANet is used as a basis and supervised training is performed using the above-mentioned supervised method 1.

[0123] After each polyp model is supervised and trained using each supervised method, the evaluation indicators of the obtained models on different data sets are as follows: Figure 1As shown in Table 1, we can see that:

[0124] (1) The performance of the model using supervised method 3 is better than that of supervised method 2, which shows that the Projection Loss based on the "shielding other boxes" strategy proposed in this invention can better utilize box annotations than simply directly using the mask generated by filling the gold standard box;

[0125] (2) On almost all datasets (except PraNet on EndoScene and ETIS datasets), the performance of the present invention is better than other box supervision methods, which fully verifies the superiority of the present invention in using box optimization masks and typical features for refined self-guided supervision;

[0126] (3) Compared with the supervised method 1 marked in gray in the table, the present invention even achieves better performance when only box annotation is used, for example: Polyp-PVT on the ETIS dataset, which fully demonstrates that the present invention maintains the performance of the model while greatly reducing the complexity of the annotation work.

[0127] Table 1 Evaluation indicators of each model trained on each data set

[0128]

[0129] Secondly, the present invention uses Polyp-PVT as the main framework and compares the above-mentioned supervised method 4 with the most advanced box supervised methods in natural scenes, including BoxInst, DiscoBox and BoxLevelset. After training Polyp-PVT using various supervised methods, the evaluation indicators of the obtained polyp segmentation model on various data sets are shown in Table 2. According to the results shown in Table 2, the present invention is always superior to other methods on all data sets.

[0130] Table 2 Evaluation indicators of the trained models on various data sets

[0131]

[0132] Figure 3 , Figure 4 and Figure 5 The segmentation results of the polyp segmentation model trained by the present invention and other different box-supervised methods for the same colonoscopy images are shown. Figure 3 , Figure 4 and Figure 5In the figure, (a) is the original endoscopic image and its annotation box, (b) is the gold standard mask, (c) is the segmentation result of the model trained with BoxInst, (d) is the segmentation result of the model trained with DiscoBox, (e) is the segmentation result of the model trained with BoxLevelset, and (f) is the segmentation result of the polyp segmentation method provided in an embodiment of the present invention.

[0133] Figure 3 For the segmentation results of polyps with complex boundaries, according to Figure 3 It can be seen from the results that the present invention predicts finer boundaries than other methods, which is because the present invention improves the fine self-guidance at the pixel and feature levels with the help of the teacher model.

[0134] Figure 4 For the segmentation results of inconspicuous small polyps, according to Figure 4 As shown in the results, other methods produced false positive predictions due to the high similarity between polyps and surrounding normal circular tissues. In contrast, the present invention showed fewer false positive predictions. This is because the typical feature guidance of the teacher model in the present invention enhances the feature contrast learning of the student model.

[0135] Figure 5 For the segmentation results of multiple polyps, according to Figure 5 It can be seen from the results that the present invention can accurately segment each polyp example, while other methods have omissions, which shows that the present invention shows better prediction results in the task of segmenting multiple polyps. This is because the present invention calculates the projection loss based on the shielding other box strategy.

[0136] The above qualitative and quantitative comparison results all indicate that the polyp segmentation model established in the present invention can accurately segment polyps with complex boundaries, inconspicuous small polyps, and multiple polyps.

[0137] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for establishing a polyp segmentation model based on box annotation training, characterized in that: include: Initialization step: obtaining an endoscopic image set with polyp annotation frames, and establishing a first deep learning model for segmenting polyps from the endoscopic images to obtain polyp masks; Model training step: using the endoscopic image in the endoscopic image set as input, training the first deep learning model, optimizing the first deep learning model through back propagation to minimize the training loss, and after the training, using the first deep learning model as a polyp segmentation model; The training loss includes a projection loss between a labeling box calculated based on the shielding other box strategy and a polyp mask predicted and output by the first deep learning model, wherein the polyp mask is a supervised image. The projection loss is calculated based on the shielding other box strategy as follows: Convert the annotation box of each endoscopic image I into N data pairs; each data pair contains a annotation box B i and other annotation boxes N is the number of annotation boxes; For each data pair, obtain the annotation box B i And the corresponding single annotation box image b i , and mask out the images belonging to the set from the supervised image The pixels of the labeled box in the image are obtained as a single instance image. Calculate the projection loss between all single-annotated box images and the corresponding single instance images; Among them, the single annotation box image b i In the marked box B i The pixel inside is 1, which is located in the marked box B i Pixels outside are 0.

2. The method for establishing a polyp segmentation model based on frame annotation training according to claim 1, characterized in that: The initialization step further includes: establishing a second deep learning model as a teacher model for segmenting polyps from the endoscopic image to obtain a polyp mask, and using the first deep learning model as a student model; Furthermore, the model training step further includes: each time the parameters of the student model are updated, they are transmitted to the teacher model; In addition, the training loss also includes: a mask loss; the mask loss is used to characterize the difference between each pixel between the polyp mask predicted by the teacher model and the polyp mask predicted by the student model.

3. The method for establishing a polyp segmentation model based on frame annotation training according to claim 2, characterized in that: The mask loss is calculated as: Among them, L mask represents the mask loss; m represents the polyp mask predicted by the student model; m t represents the polyp mask predicted by the teacher model, b represents the set of single labeled box images, represents dot product; F() represents calculating the difference between pixels.

4. The method for establishing a polyp segmentation model based on frame annotation training according to claim 2 or 3, characterized in that: The training loss also includes: foreground and background feature contrast loss; The calculation method of the foreground and background feature contrast loss includes: Select some features from the features extracted by the teacher model, upsample them to the original endoscopic image size, and then fuse them into the teacher features f t , select the corresponding partial features from the features extracted by the student model, upsample them to the original endoscopic image size, and then fuse them into the student feature f; The polyp mask m predicted by the teacher model t From the teacher characteristics t Extract the typical foreground features p f , and calculate the background typical feature p b ; Calculate the student features f and the foreground typical features p respectively f The similarity between f and student characteristics f and background typical characteristics p b The similarity between b , and according to the similarity r f and similarity r b Constructing foreground response map m f ; The foreground response map m f In , the pixel with a larger value indicates that the student feature f is closer to the foreground than the background; Respond to the foreground image m f For the supervised image, the annotation box and the foreground response map m are calculated based on the masking box strategy. f The projection loss between the foreground and background features is obtained.

5. The method for establishing a polyp segmentation model based on frame annotation training according to claim 4, characterized in that: Among them, T(·) means using a preset threshold for binarization, and M is The total number of pixels with a median value of 1, b represents the set of single-labeled box images, Represents dot product.

6. The method for establishing a polyp segmentation model based on frame annotation training according to claim 5, characterized in that: Among them, softmax1(·) means softmax operation along the first dimension; Is the teacher characteristic conversion t The background pixel set.

7. The method for establishing a polyp segmentation model based on frame annotation training according to claim 6, characterized in that: 。 8. A polyp segmentation method for endoscopic images, characterized in that: include: Inputting the endoscopic image to be segmented into the polyp segmentation model established by the method for establishing a polyp segmentation model based on frame annotation training according to any one of claims 1 to 7 to obtain a polyp mask; The endoscopic image to be segmented is multiplied by the polyp mask to obtain a polyp segmentation result.

9. A computer-readable storage medium, characterized in that: The invention comprises a stored computer program; when the computer program is executed by a processor, the device where the computer-readable storage medium is located is controlled to execute the polyp segmentation model established by the method for establishing a polyp segmentation model based on frame annotation training as described in any one of claims 1 to 7, or the method for endoscopic image polyp segmentation as described in claim 8.