Image segmentation method and electronic device

By adding perturbations to the hidden layer of the image segmentation model for consistent learning of unlabeled samples, the problem of model training efficiency and performance in existing semi-supervised learning methods is solved, and the efficient performance of the image segmentation model in the boundary segmentation task is improved. .

CN112801107BActive Publication Date: 2024-10-18LENOVO (BEIJING) LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110134822.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-01
Publication Date
2024-10-18
Estimated Expiration
2041-02-01

AI Technical Summary

Technical Problem

Existing image segmentation methods using semi-supervised learning are difficult to achieve good boundary segmentation performance through a convenient and efficient model training process, especially when the hidden layer clustering estimation assumptions of the model are not fully utilized.

Method used

By adding perturbations to the hidden layer of the image segmentation model, we conduct consistency learning between unlabeled samples, use the feature information of labeled and unlabeled samples to optimize the encoder and decoder parameters, build an image segmentation model, and achieve efficient training of the model. and boundary segmentation performance improvements.

Benefits of technology

A convenient and efficient model training process is realized, which enables the image segmentation model to achieve better segmentation performance and is suitable for two-dimensional and three-dimensional image segmentation tasks, especially showing strong practicability in medical image boundary detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112801107B_ABST
    Figure CN112801107B_ABST
Patent Text Reader

Abstract

The image segmentation method and electronic device disclosed in the present application perform image segmentation by constructing an image segmentation model using a semi-supervised learning method, and when constructing the image segmentation model, by perturbing the image features of unlabeled samples, an idea of ​​adding perturbations to the hidden layer of the model to perform consistency learning between unlabeled samples is proposed. The inventor has found through research that there are cluster estimates in the hidden layer of the model, and the semi-supervised task needs to rely on the cluster estimation hypothesis, that is, the semi-supervised task needs to use the cluster estimation hypothesis as a basis / prerequisite. Therefore, the present application closely fits the characteristics of the semi-supervised task by adding perturbations to the hidden layer to perform consistency learning between unlabeled samples, and can achieve a better segmentation performance of the model based on a convenient and efficient model training process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image processing, and in particular relates to an image segmentation method and electronic equipment. Background Art

[0002] Image segmentation is the basic premise for image analysis.

[0003] Early image segmentation was generally based on traditional methods, such as threshold-based or edge detection-based image segmentation, and its performance was limited by the feature representation capabilities of traditional methods. With the development of deep learning technology, a method of using convolutional neural networks (CNN) to extract image features and then perform segmentation has been proposed. However, training convolutional neural network models requires a large amount of labeled data, which makes the labeling of model sample data very time-consuming and costly, and in some cases requires the labelers to have high professional capabilities.

[0004] The industry has further proposed using semi-supervised learning methods for image segmentation to solve the above technical problems. However, existing image segmentation methods using semi-supervised learning cannot achieve better boundary segmentation performance based on a convenient and efficient model training process. Summary of the invention

[0005] To this end, this application discloses the following technical solutions:

[0006] An image segmentation method, comprising:

[0007] The encoder of the image segmentation model performs feature extraction processing on the target image according to the corresponding encoder parameters to obtain image features of the target image; the image segmentation model includes the encoder and the main decoder;

[0008] The main decoder performs image boundary segmentation processing according to corresponding decoder parameters and the image features to obtain boundary segmentation information of the target image;

[0009] Among them, the encoder parameters corresponding to the encoder are determined according to image boundary segmentation information matching image features of a predetermined image; the image features of the predetermined image include: a first image feature of a labeled first sample image, a second image feature of an unlabeled second sample image, and a third image feature obtained by perturbing the second image feature.

[0010] Optionally, the encoder of the image segmentation model performs feature extraction processing on the target image according to corresponding encoder parameters to obtain image features of the target image, including:

[0011] The encoder extracts the features of the target image according to the corresponding encoder parameters to obtain a feature map of a first size of the target image; the first size is smaller than a second size of the target image;

[0012] The boundary segmentation information includes classification category information corresponding to each pixel in the feature map of the second size; the classification processing of the pixel is used to classify the pixel as whether it belongs to the boundary of the object in the image;

[0013] The main decoder performs image boundary segmentation processing according to the corresponding decoder parameters and the image features to obtain boundary segmentation information of the target image, including:

[0014] The primary decoder maps the feature map of the first size to the second size according to corresponding decoder parameters to obtain a feature map of the second size;

[0015] The main decoder performs classification processing on the pixels in the feature map of the second size to obtain classification category information of each pixel in the feature map of the second size.

[0016] Optionally, the encoder performs multiple convolution and downsampling operations on the target image; wherein different downsampling operations obtain feature maps of different sizes, and the last downsampling operation obtains the feature map of the first size;

[0017] The main decoder performs multiple convolution and upsampling operations on the feature map of the first size; wherein different upsampling operations obtain feature maps of different sizes, and the last upsampling operation obtains the feature map of the second size;

[0018] Before performing a convolution operation on a feature map of the first size other than for the first time, the main decoder connects a current feature map obtained by most recent upsampling with a feature map of the same size as the current feature map obtained by the encoder, and performs a convolution operation on the connected feature map obtained by the connection process.

[0019] Optionally, the process of constructing the image segmentation model includes:

[0020] Optimizing a first branch of a predetermined network model using image boundary segmentation information matching a first image feature of the first sample image; the first branch comprising an encoder model and a main decoder model connected to an output end of the encoder model;

[0021] The second branch of the predetermined network model is optimized by using image boundary segmentation information matching the second image feature of the second sample image and image boundary segmentation information matching the third image feature of the second sample image; the second branch includes the encoder model and an auxiliary decoder model connected to the output end of the encoder model; the optimized encoder model and the main decoder model are respectively used as the encoder and the main decoder of the image segmentation model.

[0022] Optionally, the optimizing the first branch of the predetermined network model by using the image boundary segmentation information matching the first image feature of the first sample image includes:

[0023] Obtaining first boundary segmentation information obtained by extracting features of the first sample image based on the first branch and processing the extracted first image features;

[0024] Obtaining second boundary segmentation information annotated for the first sample image;

[0025] According to the first boundary segmentation information and the second boundary segmentation information, encoder parameters corresponding to the encoder model and decoder parameters corresponding to the main decoder model are adjusted.

[0026] Optionally, optimizing the second branch of the predetermined network model by using the image boundary segmentation information matching the second image feature of the second sample image and the image boundary segmentation information matching the third image feature of the second sample image includes:

[0027] Obtaining third boundary segmentation information by extracting features of the second sample image based on the first branch and processing the extracted second image features;

[0028] Obtaining fourth boundary segmentation information by extracting features from the second sample image based on the second branch, performing perturbation processing on the extracted second image features, and processing third image features obtained after the perturbation;

[0029] According to the third boundary segmentation information and the fourth boundary segmentation information, encoder parameters corresponding to the encoder model and decoder parameters corresponding to the auxiliary decoder model are adjusted.

[0030] Optionally, the performing perturbation processing on the extracted second image features includes:

[0031] Based on predetermined noise information, noise is added to the second image feature.

[0032] Optionally, the optimizing the second branch of the predetermined network model by using the image boundary segmentation information matching the second image feature of the second sample image and the image boundary segmentation information matching the third image feature of the second sample image further includes:

[0033] Obtaining a boundary perception map of the second sample image; the boundary perception map is a boundary perception image constructed according to a plurality of fifth boundary segmentation information of the second sample image obtained by inputting the third image feature into the auxiliary decoder model for multiple times;

[0034] According to the third boundary segmentation information, the fourth boundary segmentation information and the boundary perception map, encoder parameters corresponding to the encoder model and decoder parameters corresponding to the auxiliary decoder model are adjusted.

[0035] Optionally, the target image, the first sample image and the second sample image are two-dimensional images, or the target image, the first sample image and the second sample image are three-dimensional images;

[0036] The picture element is a pixel of a two-dimensional image, or a voxel of a three-dimensional image.

[0037] An electronic device, comprising:

[0038] A memory for storing at least one set of instructions;

[0039] A processor is used to call and execute the instruction set in the memory, and implement any of the methods described above by executing the instruction set.

[0040] A computer-readable storage medium stores a computer instruction set, and when the computer instruction set is executed by a processor, the method described in any one of the above items is implemented.

[0041] It can be seen from the above scheme that the image segmentation method and electronic device disclosed in the present application perform image segmentation by constructing an image segmentation model using a semi-supervised learning method, and when constructing the image segmentation model, by perturbing the image features of unlabeled samples, an idea of ​​adding perturbations to the hidden layer of the model to perform consistency learning between unlabeled samples is proposed. The inventor has found through research that there are cluster estimates in the hidden layer of the model, and the semi-supervised task needs to rely on the cluster estimation hypothesis, that is, the semi-supervised task needs to use the cluster estimation hypothesis as a basis / prerequisite. Therefore, the present application closely fits the characteristics of the semi-supervised task by adding perturbations to the hidden layer to perform consistency learning between unlabeled samples, and can achieve a better segmentation performance of the model based on a convenient and efficient model training process. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0043] Figure 1 It is a flowchart of the image segmentation method provided in the embodiment of the present application;

[0044] Figure 2 is a model structure diagram of the image segmentation model provided in an embodiment of the present application;

[0045] Figure 3 is a flow chart of the construction process of the image segmentation model provided in the embodiment of the present application;

[0046] Figure 4 It is a model structure diagram of the network model based on which the image segmentation model is trained according to an embodiment of the present application;

[0047] Figure 5 It is a flowchart of the first branch of training a predetermined network model provided in an embodiment of the present application;

[0048] Figure 6 This is a flow chart of the second branch of training a predetermined network model provided in an embodiment of the present application;

[0049] Figure 7 It is another flow chart of the second branch of training a predetermined network model provided in an embodiment of the present application;

[0050] Figure 8 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0051] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0052] The present application discloses an image segmentation method and an electronic device, which are used to implement a convenient and efficient model training process in image segmentation based on semi-supervised learning so that the model can achieve better segmentation performance.

[0053] See also Figure 1, is a flow chart of an image segmentation method provided in an embodiment of the present application, which is used to achieve boundary segmentation of an image by performing boundary detection on objects in the image. The objects in the image may specifically be, but are not limited to, various human organs (such as heart, lungs, etc.) in medical images. The method can be applied to boundary segmentation processing of two-dimensional plane images or three-dimensional stereo images (such as three-dimensional medical images), and can be specifically applied to, but not limited to, terminal devices such as mobile phones, tablet computers, personal PCs (such as notebooks, all-in-one computers, desktop computers) with data processing functions, or physical machines corresponding to private cloud / public cloud platforms, local area network / Internet servers, etc. with data processing functions.

[0054] like Figure 1 As shown, the above image segmentation method includes the following processing steps:

[0055] Step 101: The encoder of the image segmentation model performs feature extraction processing on the target image according to corresponding encoder parameters to obtain image features of the target image.

[0056] In this application, an image segmentation model is pre-built based on a semi-supervised learning method, such as Figure 2 The model structure diagram shown in FIG. 1 shows an image segmentation model including the above-mentioned encoder and a main decoder.

[0057] In which, when constructing the model, the encoder parameters corresponding to the encoder are determined according to the image boundary segmentation information matching the image features of the predetermined image; the image features of the predetermined image include: the first image features of the labeled first sample image, the second image features of the unlabeled second sample image and the third image features obtained by perturbing the second image features.

[0058] Optionally, in the process of constructing an image segmentation model, or performing boundary segmentation processing on an image using the constructed model, the image features involved (such as the features of the target image extracted using an encoder, or the first / second / third sample image features mentioned above) can be specifically represented in the form of a feature map.

[0059] In step 101, the encoder performs feature extraction processing on the target image according to the corresponding encoder parameters, specifically including: the encoder extracts the features of the target image according to the corresponding encoder parameters to obtain a feature map of a first size of the target image; the first size is smaller than the second size of the target image.

[0060] Specifically, the encoder performs multiple convolution and downsampling operations on the target image, and obtains a feature map with semantic information of the target image through a series of convolution and downsampling operations. The convolution operation and downsampling operation are interspersed. After each convolution operation is completed, a downsampling operation is performed on the feature map output by the convolution operation, and the feature map of the corresponding size obtained by downsampling is used as the input of the next convolution operation. Different downsampling operations obtain feature maps of different sizes of the target image, and the last downsampling operation obtains a feature map of the first size of the target image, and the feature map of the first size is input to the main decoder.

[0061] Step 102: The main decoder of the image segmentation model performs image boundary segmentation processing according to corresponding decoder parameters and image features to obtain boundary segmentation information of the target image.

[0062] The decoder parameters corresponding to the main decoder are determined according to the image boundary segmentation information that matches the first image feature of the marked first sample image.

[0063] In step 102, the main decoder performs image boundary segmentation processing according to corresponding decoder parameters and image features, which specifically includes:

[0064] The main decoder first maps the feature map of the first size to the second size according to the corresponding decoder parameters, that is, maps it to the original size of the target image, and obtains the feature map of the second size; then, the pixels in the feature map of the second size are further classified to obtain the classification category information of each pixel in the feature map of the second size. The classification category information of each pixel in the feature map of the second size constitutes the boundary segmentation information corresponding to the target image (that is, the image segmentation result of the target image).

[0065] In the process where the main decoder maps the feature map of the first size to the second size according to the corresponding decoder parameters, specifically, the main decoder performs multiple convolution and upsampling operations on the feature map of the first size, and the convolution operation and the upsampling operation are interspersed, and each time a convolution operation is completed, an upsampling operation is performed on the feature map output by the convolution operation, and the feature map of the corresponding size obtained by upsampling is used as the input of the next convolution operation. Different upsampling operations obtain feature maps of different sizes, and the last upsampling operation obtains the feature map of the second size mentioned above.

[0066] In addition, optionally, before performing the convolution operation for the feature map of the first size for the non-first time, the main decoder connects the current feature map obtained by the most recent upsampling with the feature map of the same size as the current feature map obtained by the encoder (e.g. Figure 2 The “lateral connection” shown in ), and a convolution operation is performed on the connection feature map obtained by the connection processing.

[0067] Or, to put it another way, after each upsampling, the main decoder connects the upsampling result (feature map of a certain size) with the feature map of the same size as the encoder, and then performs convolution on the connected feature map.

[0068] The inventors have found through research that a lot of image detail information will be lost in the process of downsampling an image. In view of this, in the process of decoding using the main decoder, this embodiment performs the above-mentioned horizontal connection processing according to size on the features from the bottom layer to the high layer of the encoder (the feature maps obtained by a series of downsampling operations respectively). This can make the semantic information of the feature maps in the main decoder richer, thereby improving the classification performance.

[0069] The classification processing of pixels in the image feature map is used to classify the pixels as whether they belong to the boundary of the object in the image. That is, in the present application, the classification category space corresponding to the pixels includes a first category indicating that the pixel belongs to the boundary of the object in the image (e.g., represented by "1"), and a second category indicating that the pixel does not belong to the boundary of the object in the image (e.g., represented by "0").

[0070] When classifying the pixels in the feature map of the second size, a softmax layer may be used to perform pixel-level classification.

[0071] In implementation, the boundary segmentation information output by the model can be specifically represented in the form of a predicted segmentation map, wherein the predicted segmentation map is specifically an image obtained by adding classification category information to each pixel of the image, and the classification category information of the pixel is used to indicate whether the pixel belongs to the boundary of an object in the target image (such as an organ in a medical image). In implementation, optionally, the pixel classification category information carried in the predicted segmentation map can be specifically represented as the probability value / confidence predicted by the model for each pixel that the pixel belongs to each category in the above-mentioned category space.

[0072] The picture element is the smallest processing unit of the image, which can be a pixel of a two-dimensional image or a voxel of a three-dimensional image.

[0073] It can be seen from the above scheme that the image segmentation method of this embodiment performs image segmentation by constructing an image segmentation model using a semi-supervised learning method, and when constructing the image segmentation model, by perturbing the image features of unlabeled samples, it is proposed to add perturbations to the hidden layer of the model to perform consistency learning between unlabeled samples. The inventor has found through research that there is a cluster estimation in the hidden layer of the model, and the semi-supervised task needs to rely on the cluster estimation hypothesis, that is, the semi-supervised task needs to be based on the cluster estimation hypothesis / prerequisite. Therefore, this application closely fits the characteristics of the semi-supervised task by adding perturbations to the hidden layer to perform consistency learning between unlabeled samples, and can achieve a better segmentation performance of the model based on a convenient and efficient model training process.

[0074] Figure 1 The processing process of the image segmentation method shown needs to be based on a pre-built image segmentation model. In the embodiment of the present application, a semi-supervised learning method is used to construct the image segmentation model. The semi-supervised image segmentation method can be divided into three categories: 1) pseudo-label-based method; 2) generative model-based method; 3) consistency-based method.

[0075] Among them, for the third type, the principle of the consistency method is to make the model's prediction invariant by adding disturbances when building the model. Based on this principle, the traditional technology specifically adds disturbances to the original input of the model (equivalent to adding disturbances to the input layer of the model) to make the model's prediction invariant.

[0076] However, semi-supervised tasks need to rely on the cluster estimation hypothesis, that is, the semi-supervised tasks need to be based on the cluster estimation hypothesis. The inventors found through research that there is no cluster estimation on the original input of the model. Therefore, the traditional technology ignores the cluster estimation by adding disturbances to the original input of the model, making it difficult to achieve good boundary segmentation performance through a convenient and efficient model training process.

[0077] Specifically, for the image segmentation task, the inventors verified the cluster estimation hypothesis by calculating the local smoothness of the image, and based on this verification found that there is no cluster estimation hypothesis on the original input of the model, but there is an obvious cluster estimation (that is, low-density area) on the feature map (corresponding to the hidden layer of the model).

[0078] Therefore, based on the above findings, the present application proposes a consistent hidden representation learning mechanism that performs consistency learning between unlabeled data by adding perturbations to the hidden layer of the model, and constructs an image segmentation model based on this mechanism.

[0079] like Figure 3 As shown, in this embodiment, the process of constructing the image segmentation model includes:

[0080] Step 301: Optimize a first branch of a predetermined network model using image boundary segmentation information that matches a first image feature of a labeled first sample image.

[0081] The process of optimizing the first branch of the predetermined network model is essentially a process of training the first branch in the predetermined network model based on the sample image.

[0082] See also Figure 4 , is the model structure of the predetermined network model used when constructing the image segmentation model in this application, and the predetermined network model includes two branches: a first branch and a second branch.

[0083] Among them, the first branch includes an encoder model and a main decoder model whose input end is connected to the output end of the encoder model, which is used for supervised learning based on the labeled first sample image; the second branch includes an encoder model and an auxiliary decoder model whose input end is connected to the output end of the encoder model, which is used for unsupervised learning based on the unlabeled second sample image, and the two branches share the encoder model.

[0084] In implementation, the two branches may, but are not limited to, both use V-net or both use U-net (V-net or U-net is an image semantic segmentation network based on deep learning) as the backbone network.

[0085] In this step 301, the first branch is trained using the labeled first sample image to optimize the network parameters (encoder parameters, decoder parameters) of the encoder model and the main decoder model in the first branch. The encoder parameters may specifically include the parameters of the convolution kernel in the encoder, and similarly, the decoder parameters may specifically include the parameters of the convolution kernel in the decoder (such as the main decoder or the auxiliary decoder described below).

[0086] Here, the labeled first sample image is a general description. In implementation, the first sample image may specifically be a collection of a series of labeled sample images.

[0087] See also Figure 5 , the above step 301 can be further implemented as follows:

[0088] Step 501: Obtain first boundary segmentation information by extracting features from a labeled first sample image based on the first branch and processing the extracted first image features.

[0089] Specifically, the first sample image can be input into the encoder model, and the encoder obtains a feature map of a first size with semantic information of the first sample image based on a series of convolution operations and downsampling operations; and outputs the feature map of the first size to the main decoder model in the first branch. The main decoder model maps the feature map of the first size to the original size (second size) of the first sample image through a series of convolution and upsampling operations, and then performs pixel-level classification on the feature map of the second size (such as pixel-level classification using the softmax layer set in the main decoder), and finally obtains a predicted segmentation map with classification category information corresponding to each pixel on the image added to it. The predicted segmentation map is the above-mentioned first boundary segmentation information.

[0090] Among them, during the decoding process based on the above series of convolution and upsampling operations, the main decoder model will horizontally connect the features from the bottom layer to the high layer of the encoder model. That is, after each upsampling, the main decoder model will connect the obtained feature map of the corresponding size with the feature map of the same size obtained by the encoder model, and then convolve the connected feature map, so as to make the semantic information of the feature map richer, thereby improving the classification performance.

[0091] Step 502: Obtain second boundary segmentation information annotated for the annotated first sample image.

[0092] Similarly, the second boundary segmentation information may be implemented in the form of a segmentation map in which each pixel in the image is marked (eg, manually labeled) with classification category information corresponding to the pixel.

[0093] Step 503: According to the first boundary segmentation information and the second boundary segmentation information, adjust the encoder parameters corresponding to the encoder model in the first branch and the decoder parameters corresponding to the main decoder model.

[0094] After obtaining the above-mentioned first boundary segmentation information and the second boundary segmentation information, the model parameters of the encoder model and the model parameters of the main decoder are further adjusted according to the loss between the first boundary segmentation information and the second boundary segmentation information, such as the loss between the predicted segmentation map output by the first branch and the manually labeled segmentation map, so as to optimize the network parameters of the encoder model and the main decoder model in the first branch.

[0095] During implementation, a series of labeled samples can be continuously input into the first branch, and for each input sample, the loss value between the predicted segmentation map output by the first branch and the labeled segmentation map is calculated according to the preset loss function, and with the goal of reducing the loss value, the encoder parameters of the encoder model in the first branch and the decoder parameters of the main decoder model are adjusted until the loss value is no more than the preset threshold, or the number of adjustments reaches the set upper limit, and the training of the first branch is completed.

[0096] The following examples illustrate this.

[0097] Assumptions represents a labeled sample set including n labeled sample data, represents an unlabeled sample set including m unlabeled sample data, where and are three-dimensional medical images of H×W×D, where H, W, and D represent the height, width, and depth of the three-dimensional medical image, respectively. For After labeling each pixel in the image (such as manual labeling), the information obtained includes the category information of each pixel (whether it belongs to the image The labeled segmentation map of an object such as the boundary of an organ in the image. Where 1≤i≤n, 1≤j≤m, i, j, m, n are all integers.

[0098] When training the first branch, the labeled samples x l (The above set D l Any sample data in) input the first branch (supervisory branch) f l =e·g, where e represents the encoder model and g represents the main decoder model. This branch generates a predicted segmentation map S l ∈[0, 1] H×W×D , and then use the supervised loss function L l Calculate the sample x l The loss value between the predicted segmentation map and the labeled segmentation map is calculated, and the encoder parameters of the encoder model e in the first branch and the decoder parameters of the main decoder model g are adjusted with the goal of reducing the loss value to achieve supervised learning. The specific formula is as follows:

[0099] S l =f l (x l ;θ) (1)

[0100]

[0101] In formulas (1)-(2), Θ represents the parameters of the model (encoder parameters or decoder parameters), H(·) represents the cross entropy loss, D(·) represents the Dice loss, and r1 and r2 represent weights.

[0102] Step 302: Optimize the second branch of the predetermined network model by using the image boundary segmentation information that matches the second image feature of the unlabeled second sample image and the image boundary segmentation information that matches the third image feature of the second sample image.

[0103] The optimized encoder model and main decoder model are completed and used as the encoder and main decoder of the constructed image segmentation model respectively.

[0104] The process of optimizing the second branch is essentially a process of training the second branch based on sample images.

[0105] Here, the unlabeled second sample image is also a general description. In implementation, the second sample image may specifically be a set of a series of unlabeled sample images.

[0106] See also Figure 6 , step 302 can be further implemented as follows:

[0107] Step 601: obtaining third boundary segmentation information by extracting features of a second sample image based on the first branch and processing the extracted second image features;

[0108] Specifically, the unlabeled second sample image is input into the encoder model to obtain the second image features of the second sample image extracted by the encoder model, and the second image features are output to the main decoder model in the first branch, and then the main decoder model processes the second image features to obtain the corresponding third boundary segmentation information. For a more detailed implementation process of processing the sample image using the first branch, please refer to the description of step 501 above, which will not be repeated here.

[0109] The third boundary segmentation information obtained by processing the second sample image using the first branch can also be represented as a predicted segmentation map, which includes the result obtained after labeling the classification category information of each pixel in the second sample image (such as the probability value of the pixel belonging to each category).

[0110] Step 602: Obtain fourth boundary segmentation information by extracting features from the second sample image based on the second branch, performing perturbation processing on the extracted second image features, and processing the third image features obtained after the perturbation;

[0111] This step 602 further performs perturbation processing on the second image feature of the second sample image output by the encoder model. Optionally, noise can be added to the second image feature based on predetermined noise information to achieve perturbation.

[0112] Afterwards, the third image feature obtained after the disturbance is input into the auxiliary decoder model in the second branch. The auxiliary decoder model has similar structure and function to the main decoder model. It also undergoes multi-layer convolution and upsampling to map the third image feature map to the size of the second sample image, and then performs pixel-level classification through the softmax layer. Finally, a predicted segmentation map corresponding to the sample with the disturbance is obtained, which is the fourth boundary segmentation information mentioned above.

[0113] In implementation, in order to enrich the semantic information of the feature map and thus improve the classification performance, in the processing of the auxiliary decoder model, the feature map of the corresponding size obtained after each upsampling can be connected with the feature map of the same size in the encoder model, and then the next convolution is performed on the connected feature map.

[0114] Step 603: According to the third boundary segmentation information and the fourth boundary segmentation information, adjust encoder parameters corresponding to the encoder model and decoder parameters corresponding to the auxiliary decoder model.

[0115] After obtaining the third boundary segmentation information and the fourth boundary segmentation information mentioned above, the parameters of the encoder model and the parameters of the auxiliary decoder model can be further adjusted according to the loss between the third boundary segmentation information and the fourth boundary segmentation information, such as according to the predicted segmentation map of the second sample image output by the first branch and the predicted segmentation map of the second sample image output by the second branch, so as to optimize the parameters of the encoder model and the auxiliary decoder model in the second branch.

[0116] The following example still uses the above example to illustrate:

[0117] The unlabeled sample x u (The above set D u Any sample data in) input into the second branch (unsupervised branch) f u =e·g u , where e represents the encoder model, g u represents the auxiliary decoder model, x u First, the encoder e generates the feature map Z, and then a perturbation is added to the feature map Z to obtain the feature map Then the feature map Z is input into the main decoder model g to obtain the predicted segmentation map S l (third boundary segmentation information), the feature map Input to the auxiliary decoder model g u Get the predicted segmentation map S u (fourth boundary segmentation information), S u ∈[0, 1] H×W×D , the specific formula is as follows:

[0118] Z = e(xu ; θ) (3)

[0119]

[0120]

[0121] S l =g(Z;θ) (6)

[0122] In equations (3)-(6), Θ represents the parameters of the model (encoder model or decoder parameters), o represents element-wise product, and N represents uniform noise N~U(-0.3, 0.3).

[0123] Then use the unsupervised loss function L u Perform unsupervised learning of the second branch. Specifically, use the unsupervised loss function L u Calculate the sample x u The predicted segmentation map S u and the predicted segmentation map S l The loss value between , and the encoder parameters of the encoder model e and the auxiliary decoder model g in the second branch are adjusted with the goal of reducing the loss value u The decoder parameters are used to implement unsupervised learning. The specific formula is as follows:

[0124]

[0125] In formula (7), d(·) represents the mean squared error (MSE) function.

[0126] Finally, the entire network model (first branch + second branch) uses the loss function L for supervised and unsupervised learning, and uses the stochastic gradient descent method to update the model parameters.

[0127] L=L l +a1L u (8)

[0128] In formula (8), a1 represents the weight, and the loss function L u No gradient back propagation is performed on the main decoder model g, and only the labeled sample data is used to train the main decoder g.

[0129] In this embodiment, when constructing an image segmentation model, consistency learning between unlabeled sample data is performed by adding disturbances to the hidden layer of the model. This follows the premise that semi-supervised tasks must rely on the clustering estimation hypothesis, closely fits the characteristics of semi-supervised tasks, and can achieve an image segmentation model with good boundary segmentation performance by utilizing a small amount of labeled data and a large amount of unlabeled data. It has strong practicality.

[0130] In addition, in the present application, when using unlabeled samples to train the encoder and auxiliary decoder, the feature map generated by the encoder for the unlabeled data is passed through a main decoder trained only with labeled samples, and through an auxiliary decoder trained only with unlabeled samples (noise is added to the feature map when passing through the auxiliary decoder). The purpose is to make the probability distribution of each pixel classification category information basically consistent during the prediction processing of the auxiliary decoder and the main decoder. This will force the encoder model to learn the commonalities between the labeled and unlabeled sample data (such as the common features of the organ body in medical images), thereby improving the encoder's encoding ability and robustness for objects in the image.

[0131] In order to further optimize the model performance of the constructed image segmentation model, optionally, when optimizing the second branch of the network model and training the second branch, refer to Figure 7 In addition to obtaining the third boundary segmentation information and the fourth boundary segmentation information for branch training, the following processing may also be included:

[0132] Step 604: obtaining a boundary perception map of the second sample image;

[0133] Among them, the boundary perception map of the second sample image is a boundary perception image constructed based on the multiple fifth boundary segmentation information obtained by inputting the third image features of the second sample image into the auxiliary decoder model multiple times.

[0134] The multiple fifth boundary segmentation information may specifically be multiple predicted segmentation maps obtained by the auxiliary decoder model based on the third image features input multiple times.

[0135] When generating the above-mentioned boundary segmentation map, specifically, based on the above-mentioned multiple predicted segmentation maps, multiple probability values ​​that the same pixel in the image belongs to each category in the pixel category space can be obtained; and based on the multiple probability values ​​that the same pixel belongs to each category, the average probability value of the same pixel belonging to each category is calculated, and finally, the average probability value of each pixel in the second sample image belonging to each category in the above-mentioned category space is obtained, and then based on the average probability value of each pixel in the second sample image belonging to each category in the above-mentioned category space, the above-mentioned boundary perception map is modeled.

[0136] The boundary perception map obtained by modeling can be, but is not limited to, a binary map in the form of a 0, 1 distribution. A pixel position in the binary map corresponds to a value of "1", indicating that the pixel corresponding to the pixel position in the second sample image belongs to the boundary of the object in the second sample image, and a value of "0" indicates that it does not belong to the boundary of the object in the second sample image.

[0137] Step 605: Adjust encoder parameters corresponding to the encoder model and decoder parameters corresponding to the auxiliary decoder model according to the third boundary segmentation information, the fourth boundary segmentation information and the boundary perception map.

[0138] Specifically, according to the loss between the predicted segmentation map of the second sample image output by the auxiliary decoder model and the predicted segmentation map of the second sample image output by the main decoder model, and the boundary loss between the predicted boundary output by the auxiliary decoder model and the predicted boundary output by the main decoder model determined based on the boundary perception map, the parameters of the encoder model and the auxiliary decoder model in the second branch can be adjusted to achieve training of the second branch.

[0139] Let’s use the above example to illustrate:

[0140] When the unlabeled sample x u (The above set D u Any sample data in) input into the second branch (unsupervised branch) f u =e·g u When , this branch not only generates a predicted segmentation map S u ∈[0, 1] H×W×D , and generate a boundary-aware map M∈{0,1} H×W×D To obtain the boundary perception map M, we need to train the consistency of x u The encoder obtains the feature map Z, and adds a perturbation to Z to convert it into a feature map After that, To the auxiliary decoder model g u Perform T forward passes and use the auxiliary decoder model g u The output T boundary segmentation maps are calculated x u The average probability that each pixel belongs to each category in the category space is used to model the boundary perception map M. The specific formula is as follows:

[0141]

[0142]

[0143] u=-∑ c u c log(u c ) (11)

[0144] M v =Γ(u>h) (12)

[0145] In formulas (9)-(12), Θ represents the parameters of the model, represents the probability of the tth time on the c category, Γ represents the indicator function, h is the threshold hyperparameter, M v is the voxel-level boundary perception result, all M v The set of constitutes the boundary-aware map M.

[0146] Then use the unsupervised loss function L u (represents the loss between the predicted segmentation map output by the auxiliary decoder and the predicted segmentation map output by the main decoder, and the L in the above formula (7) is still used u Formula) and L b (denoting the above boundary loss) performs branched unsupervised learning:

[0147]

[0148]

[0149]

[0150] In formulas (13)-(14), V represents the image sample x u The number of all voxels in .

[0151] Finally, for the entire network model, the loss function L is used for supervised and unsupervised learning, and the stochastic gradient descent method is used to update the model parameters:

[0152] L=L l +a1L u +a2L b (15)

[0153] In formula (15), a1 and a2 represent weights, and the loss function L u and L b No gradient back propagation is performed on the main decoder g, and only the labeled sample data is used to train the main decoder g.

[0154] This embodiment helps to perform consistency training on the second branch of the network model by generating a boundary segmentation map and determining the boundary loss between the predicted boundary output by the auxiliary decoder and the predicted boundary output by the main decoder based on the boundary segmentation map, so as to better learn the consistency of the features of unlabeled samples, thereby further improving the model performance.

[0155] In summary, compared with the traditional technology, the method of the present application has at least the following advantages:

[0156] 1) It can build an image segmentation model using a small amount of labeled data and a large amount of unlabeled data, which is highly practical;

[0157] 2) It can accurately capture the boundaries of the main body of the object in the image (such as the main body of the human organ) without adding any model parameters or using prior knowledge of the boundaries;

[0158] 3) By proposing a boundary perception map, the boundary perception of the object body in the image is enhanced, further improving the image segmentation performance;

[0159] 4) Achieved the best performance on two public challenge datasets;

[0160] 5) When using 20% ​​labeled data for training (i.e., the labeled data accounts for 20% of the sample set), the segmentation performance can be almost the same as that when using 100% labeled data.

[0161] An embodiment of the present application also discloses an electronic device, which may be, but is not limited to, a terminal device such as a mobile phone, a tablet computer, a personal PC (such as a notebook, an all-in-one computer, a desktop computer) with data processing capabilities, or a physical machine corresponding to a private cloud / public cloud platform, a local area network / Internet server, etc. with data processing capabilities.

[0162] like Figure 8 The electronic device shown is a schematic diagram of a structure of an electronic device, the electronic device at least comprising:

[0163] Memory 801, used for storing computer instruction sets;

[0164] The above-mentioned computer instruction set can be implemented in the form of a computer program.

[0165] The memory 801 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0166] The processor 802 is used to implement the image segmentation method of any of the above method embodiments by executing the instruction set stored in the above memory.

[0167] The processor 802 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices.

[0168] In addition, the electronic device may also include components such as a communication interface and a communication bus. The memory, the processor and the communication interface communicate with each other through the communication bus.

[0169] The communication interface is used for communication between electronic devices and other devices (such as the central control device in the CDN scheduling system). The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc.

[0170] For the electronic device disclosed in this embodiment, since its processing process corresponds to the image segmentation method disclosed in the above method embodiments, the description is relatively simple. For relevant similarities, please refer to the description of the corresponding method embodiments above, which will not be described in detail here.

[0171] In addition, an embodiment of the present application further discloses a computer-readable storage medium, in which a computer instruction set is stored. When the computer instruction set is executed by a processor, the image segmentation method disclosed in any of the above method embodiments is implemented.

[0172] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0173] For the convenience of description, the above system or device is described by dividing it into various modules or units according to its functions. Of course, when implementing the present application, the functions of each unit can be implemented in the same or multiple software and / or hardware.

[0174] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be essentially or partly contributed to the prior art in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.

[0175] Finally, it should be noted that, in this article, relational terms such as first, second, third and fourth are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0176] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. An image segmentation method, comprising: The encoder of the image segmentation model performs feature extraction processing on the target image according to the corresponding encoder parameters to obtain image features of the target image; The image segmentation model includes the encoder and the main decoder; The main decoder performs image boundary segmentation processing according to corresponding decoder parameters and the image features to obtain boundary segmentation information of the target image; Wherein, encoder parameters corresponding to the encoder are determined based on image boundary segmentation information that matches image features of a predetermined image; the image features of the predetermined image include: a first image feature of a labeled first sample image, a second image feature of an unlabeled second sample image, and a third image feature obtained by perturbing the second image feature, wherein consistency learning between unlabeled samples is performed by adding perturbations to the hidden layer of the image segmentation model.

2. According to the method of claim 1, the encoder of the image segmentation model performs feature extraction processing on the target image according to the corresponding encoder parameters to obtain the image features of the target image, including: The encoder extracts the features of the target image according to the corresponding encoder parameters to obtain a feature map of a first size of the target image; The first size is smaller than a second size of the target image; The boundary segmentation information includes classification category information corresponding to each pixel in the feature map of the second size; the classification processing of the pixel is used to classify the pixel as whether it belongs to the boundary of the object in the image; The main decoder performs image boundary segmentation processing according to the corresponding decoder parameters and the image features to obtain boundary segmentation information of the target image, including: The primary decoder maps the feature map of the first size to the second size according to corresponding decoder parameters to obtain a feature map of the second size; The main decoder performs classification processing on the pixels in the feature map of the second size to obtain classification category information of each pixel in the feature map of the second size.

3. The method according to claim 2, wherein the encoder performs multiple convolution and downsampling operations on the target image; wherein, Different downsampling operations obtain feature maps of different sizes, and the last downsampling operation obtains the feature map of the first size; The main decoder performs multiple convolution and upsampling operations on the feature map of the first size; wherein different upsampling operations obtain feature maps of different sizes, and the last upsampling operation obtains the feature map of the second size; Before performing a convolution operation on a feature map of the first size other than for the first time, the main decoder connects a current feature map obtained by most recent upsampling with a feature map of the same size as the current feature map obtained by the encoder, and performs a convolution operation on the connected feature map obtained by the connection process.

4. According to the method of claim 1, the process of constructing the image segmentation model comprises: Optimizing a first branch of a predetermined network model using image boundary segmentation information matching a first image feature of the first sample image; The first branch includes an encoder model and a main decoder model connected to an output end of the encoder model; The second branch of the predetermined network model is optimized by using image boundary segmentation information matching the second image feature of the second sample image and image boundary segmentation information matching the third image feature of the second sample image; the second branch includes the encoder model and an auxiliary decoder model connected to the output end of the encoder model; the optimized encoder model and the main decoder model are respectively used as the encoder and the main decoder of the image segmentation model.

5. The method according to claim 4, wherein optimizing the first branch of the predetermined network model by using the image boundary segmentation information matching the first image feature of the first sample image comprises: Obtaining first boundary segmentation information obtained by extracting features of the first sample image based on the first branch and processing the extracted first image features; Obtaining second boundary segmentation information annotated for the first sample image; According to the first boundary segmentation information and the second boundary segmentation information, encoder parameters corresponding to the encoder model and decoder parameters corresponding to the main decoder model are adjusted.

6. The method according to claim 4, wherein optimizing the second branch of the predetermined network model by using the image boundary segmentation information matching the second image feature of the second sample image and the image boundary segmentation information matching the third image feature of the second sample image comprises: Obtaining third boundary segmentation information by extracting features of the second sample image based on the first branch and processing the extracted second image features; Obtaining fourth boundary segmentation information by extracting features from the second sample image based on the second branch, performing perturbation processing on the extracted second image features, and processing third image features obtained after the perturbation; According to the third boundary segmentation information and the fourth boundary segmentation information, encoder parameters corresponding to the encoder model and decoder parameters corresponding to the auxiliary decoder model are adjusted.

7. The method according to claim 6, wherein the perturbation processing of the extracted second image features comprises: Based on predetermined noise information, noise is added to the second image feature.

8. The method according to claim 6, wherein: The optimizing the second branch of the predetermined network model by using the image boundary segmentation information matching the second image feature of the second sample image and the image boundary segmentation information matching the third image feature of the second sample image further includes: Obtaining a boundary perception map of the second sample image; the boundary perception map is a boundary perception image constructed according to a plurality of fifth boundary segmentation information of the second sample image obtained by inputting the third image feature into the auxiliary decoder model for multiple times; According to the third boundary segmentation information, the fourth boundary segmentation information and the boundary perception map, encoder parameters corresponding to the encoder model and decoder parameters corresponding to the auxiliary decoder model are adjusted.

9. The method according to claim 2, wherein the target image, the first sample image and the second sample image are two-dimensional images, or the target image, the first sample image and the second sample image are three-dimensional images; The picture element is a pixel of a two-dimensional image, or a voxel of a three-dimensional image.

10. An electronic device, comprising: A memory for storing at least one set of instructions; A processor, configured to call and execute the instruction set in the memory, and implement the method according to any one of claims 1 to 9 by executing the instruction set.

Citation Information

Patent Citations

  • Training method of image ground feature element classification model, image analysis method and image analysis system

    CN111598174A

  • Medical image segmentation using an integrated edge guidance module and object segmentation network

    US10482603B1