Image segmentation method and system based on corrected diffusion model
By introducing a corrected diffusion model into the image segmentation model, the system error is calculated and corrected, the problem of low image segmentation accuracy in the prior art is solved, and higher image segmentation accuracy and lower training cost are achieved.
Patent Information
- Application Number
- CN202311781398.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-21
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2043-12-21
AI Technical Summary
The existing machine learning-based image segmentation model fails to effectively consider and correct system errors, resulting in low accuracy of image segmentation results.
The image segmentation method based on the correction diffusion model is adopted, and the difference after adding Gaussian noise in the system error map is calculated, and the loss function is used for iterative correction and reconstruction, thereby improving the image segmentation accuracy.
By diffusing system errors, the accuracy of image segmentation is significantly improved, the training cost is reduced, and the training of corrected diffusion models is realized under limited computing resources.
Smart Images

Figure CN117765000B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of image segmentation, and in particular relates to an image segmentation method and system based on a corrected diffusion model. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] Generally, image segmentation errors can be divided into two categories: random errors and systematic errors. Random errors are caused by random effects, such as image noise or unpredictable image artifacts, and such errors can be reduced by fusing multiple information labels generated by independent segmentation. However, due to the unpredictability of random errors, it is very difficult to detect random errors or correct them. Systematic errors are errors caused by systematic patterns, that is, the difference between the standard segmentation definition used by system developers to train segmentation models and the manual segmentation protocol. Since systematic errors are related to specific models, they will continue to occur under specific model conditions. Therefore, we can use machine learning techniques to effectively correct the systematic errors of specific models.
[0004] In recent years, machine learning-based methods have been widely used in image segmentation. One of the most common techniques is to use convolutional neural networks or U-Net and its variants to directly segment images. Although existing solutions can achieve image segmentation based on machine learning, the above solutions still have the following problems, and the final segmentation accuracy is low:
[0005] Existing machine learning-based segmentation models do not consider the segmentation error problem. That is, when using convolutional neural networks or U-Net models for image segmentation, they do not consider the problem that the accuracy of image segmentation results may have errors due to model characteristics or image noise, artifacts and other factors.
[0006] Existing machine learning-based segmentation models do not consider correcting systematic errors, that is, deep learning models such as convolutional neural networks and U-Net can improve the accuracy of image segmentation to some extent, but they usually cannot automatically handle systematic errors. At the same time, they also do not consider how to correct systematic errors. Summary of the invention
[0007] In order to overcome the shortcomings of the above-mentioned prior art, the present invention provides an image segmentation method and system based on a corrected diffusion model. In the corrected diffusion model, a loss function is used to calculate the difference between the system error map after adding Gaussian noise and the system error map without adding noise, and the system error map is corrected and reconstructed, thereby further improving the image segmentation accuracy by diffusing the system error.
[0008] To achieve the above object, a first aspect of the present invention provides an image segmentation method based on a corrected diffusion model, comprising:
[0009] Preprocessing the image to be segmented to obtain a preprocessed image to be segmented;
[0010] Use the trained U-Net segmentation network to segment the preprocessed image to obtain a preliminary segmentation result map;
[0011] Perform a difference operation between the real image segmentation image and the preliminary segmentation result image to obtain a system error image;
[0012] Under the condition of a Markov chain, Gaussian noise is added to the system error graph, and the difference between the system error graph after adding Gaussian noise and the system error graph without adding noise is calculated using a constructed loss function, and the system error graph is iteratively corrected and reconstructed according to the calculation result of the loss function to obtain a reconstructed system error graph;
[0013] The preliminary segmentation result map and the obtained reconstruction system error map are added together to obtain the final segmentation result map.
[0014] A second aspect of the present invention provides an image segmentation system based on a corrected diffusion model, comprising:
[0015] Acquisition module: preprocesses the image to be segmented to obtain the preprocessed image to be segmented;
[0016] Preliminary segmentation module: Use the trained U-Net segmentation network to segment the preprocessed image to obtain a preliminary segmentation result map;
[0017] Calculation module: perform difference calculation on the real image segmentation image and the preliminary segmentation result image to obtain the system error image;
[0018] Reconstruction module: under the condition of Markov chain, Gaussian noise is added to the system error map, and the difference between the system error map after adding Gaussian noise and the system error map without adding noise is calculated by using the constructed loss function, and the system error map is iteratively corrected and reconstructed according to the calculation result of the loss function to obtain a reconstructed system error map;
[0019] Segmentation module: Add the preliminary segmentation result map and the obtained reconstruction system error map to obtain the final segmentation result map.
[0020] The third aspect of the present invention provides a computer device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the steps of the above-mentioned image segmentation method based on the corrected diffusion model are performed.
[0021] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the above-mentioned image segmentation method based on the corrected diffusion model are executed.
[0022] One or more of the above technical solutions have the following beneficial effects:
[0023] In the present invention, a loss function is used to calculate the difference between the system error map after adding Gaussian noise and the system error map without adding noise, and the system error map is corrected and reconstructed, thereby further improving the image segmentation accuracy by diffusing the system error.
[0024] In the present invention, a vector quantized variational autoencoder is introduced, and the correction diffusion model is applied to the latent space of a powerful autoencoder, which can reduce the training cost and realize the training of the correction diffusion model under limited computing resources.
[0025] In the present invention, a cross-attention mechanism is introduced to improve the flexibility and reliability of the corrected diffusion model, so that the corrected diffusion model can be input based on the image to be segmented as a condition to obtain a more flexible and reliable result.
[0026] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0028] Figure 1 A schematic diagram of a flow chart of an image segmentation method based on a corrected diffusion model according to an embodiment of the present invention;
[0029] Figure 2 It is a structural diagram of the reasoning process of the correction diffusion model segmentation system in the first embodiment of the present invention;
[0030] Figure 3 It is the U-Net segmentation result diagram and the final segmentation result diagram of the corrected diffusion model segmentation system in Example 1 of the present invention. DETAILED DESCRIPTION
[0031] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0032] It should be noted that the terms used herein are for describing specific embodiments only and are not intended to be limiting of exemplary embodiments according to the present invention.
[0033] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0034] Embodiment 1
[0035] This embodiment discloses an image segmentation method based on a corrected diffusion model, comprising:
[0036] Preprocessing the image to be segmented to obtain a preprocessed image to be segmented;
[0037] Use the trained U-Net segmentation network to segment the preprocessed image to obtain a preliminary segmentation result map;
[0038] Perform a difference operation between the real image segmentation image and the preliminary segmentation result image to obtain a system error image;
[0039] Under the condition of a Markov chain, Gaussian noise is added to the system error graph, and the difference between the system error graph after adding Gaussian noise and the system error graph without adding noise is calculated using a constructed loss function, and the system error graph is iteratively corrected and reconstructed according to the calculation result of the loss function to obtain a reconstructed system error graph;
[0040] The preliminary segmentation result map and the obtained reconstruction system error map are added together to obtain the final segmentation result map.
[0041] This embodiment takes the image to be segmented as an MRI brain tumor image as an example to illustrate the solution in detail.
[0042] In this embodiment, the MRI brain tumor image to be segmented is preprocessed, specifically including:
[0043] The acquired MRI brain tumor images to be segmented were uniformly resized, and all input images were standardized to 128×128.
[0044] By preprocessing the original MRI brain tumor images, the computational efficiency can be improved, the memory space can be saved, and the performance of the network model can be improved, making it better for segmentation tasks.
[0045] Then, the preprocessed MRI brain tumor image to be segmented is input into the trained U-Net segmentation network to segment the MRI brain tumor image and output the brain tumor segmentation result map.
[0046] The training process of the U-Net segmentation network is as follows: using labeled MRI brain tumor images as input and brain tumor segmentation result images as output to train the U-Net segmentation network.
[0047] The actual brain tumor segmentation image and the preliminary segmentation result map obtained by the U-Net segmentation network are subtracted and the system error map is output.
[0048] The system error map is input into the trained correction diffusion model, the generated system error map is corrected using the trained correction diffusion model, and the trained encoder τ is used θ The MRI brain tumor image is encoded and mapped into a corrected diffusion model to guide the system error map, and the reconstructed system error map is output.
[0049] In this embodiment, a corrected diffusion model segmentation network is constructed to segment the image. The corrected diffusion model segmentation network includes a corrected diffusion model and a U-Net segmentation network. The corrected diffusion model is mainly composed of a diffusion model, an encoder-decoder, a vector quantized variational autoencoder τ θ , and cross-attention components.
[0050] Specifically, in the corrected diffusion model segmentation network: a U-Net segmentation network segments the MRI brain tumor image to obtain a preliminary segmentation result map of the brain tumor; a difference module obtains a system error image based on the real brain tumor segmentation image and the preliminary segmentation result map; a corrected diffusion model module, with a parameter of θ, is divided into a forward diffusion process and a backward diffusion process to obtain a reconstructed system error image; a vector quantized variational autoencoder, consisting of an encoder E and a decoder D, is used to map the MRI image to a low-dimensional and efficient latent space; a cross-attention mechanism is used to improve the flexibility and reliability of the corrected diffusion model; a fusion module obtains the final brain tumor segmentation result image based on the preliminary segmentation result map and the reconstructed system error map.
[0051] In the training phase of the corrected diffusion model segmentation network: a U-Net segmentation network segments the MRI brain tumor image to obtain a preliminary segmentation result map of the brain tumor; a differential module obtains a system error image based on the real brain tumor segmentation image and the preliminary segmentation result map; a corrected diffusion model module is used to obtain a reconstructed system error image. Specifically, the system error image obtained in the differential module first enters the forward diffusion process, is encoded by a vector quantized variational autoencoder, and then undergoes T forward denoising processes to obtain a Gaussian noise image. Secondly, it enters the reverse diffusion process, takes the MRI brain tumor image as a condition, starts with the Gaussian noise image, and then decodes it through a decoder to obtain a reconstructed system error map. A fusion module obtains the final brain tumor segmentation result image based on the preliminary segmentation result map and the reconstructed system error map.
[0052] The corrected diffusion model segmentation network is used in the actual application, that is, in the inference stage: a U-Net segmentation network segments the MRI brain tumor image to obtain the brain tumor segmentation result map; a corrected diffusion model module is used to obtain the reconstructed system error image. Specifically, the reverse diffusion process uses the MRI brain tumor image as the input condition, starts from the Gaussian noise image, and performs T reverse denoising processes, and then decodes it through the decoder to obtain the reconstructed system error map. A fusion module obtains the final brain tumor segmentation result image based on the preliminary segmentation result map and the reconstructed system error map.
[0053] In this embodiment, the training process of the correction diffusion model is as follows: in the forward diffusion process, the system error map is used as input and the Gaussian noise image is used as output; in the backward diffusion process, the loss function is used to calculate the difference between the predicted output and the actual Gaussian noise output image, and the connection weights are updated through gradient calculation to gradually iteratively generate a reconstructed system error image from the Gaussian noise image.
[0054] Then, the preliminary segmentation result map obtained by the U-Net segmentation network and the reconstructed system error map obtained by the corrected diffusion model are added together to output the final brain tumor segmentation result map.
[0055] In the rectified diffusion model segmentation network, the brain tumor segmentation task is implemented through MRI brain tumor images X and true labels M.
[0056] The process of correcting the diffusion model can be expressed as:
[0057]
[0058] Where, X represents the MRI brain tumor image; z 0 represents the system error image; z t represents the Gaussian noise image; t represents the time step; εθ represents the conditional noise predictor; τ θ represents a vector quantized variational autoencoder used to encode the MRI brain tumor image X, and ε represents the Gaussian noise added in the forward diffusion process of the diffusion model.
[0059] A vector quantized variational autoencoder in the above correction diffusion model is built as follows:
[0060] Assume that the U-Net segmentation result map is the initial mask S, and the system error map obtained by subtracting the true label M from the initial mask S is E. For a given system error map E, the system error map E is encoded by a vector quantized variational autoencoder to obtain the latent space representation z 0 =E(E), and then the decoder represents the latent space z 0 Decode and get the reconstructed error image
[0061] This embodiment uses two regularization methods to center the latent variable z around zero. One is KL regularization, which applies a KL penalty to z. The other is VQ regularization, which first learns codebooks for different z and then regularizes the latent space using a vector quantization layer. Through the compression model, MRI brain tumor images can enter a latent representation space that abstracts high-frequency details and subtle details. Moreover, in this low-dimensional and efficient latent space, the possibility-based generative model is more suitable, which can focus on the important semantic bits of the data and can be trained in a low-dimensional and more computationally efficient space.
[0062] The specific construction process of the forward diffusion process in the above correction diffusion model is as follows:
[0063] The diffusion process continuously adds Gaussian noise to the original data information under the condition of Markov chain, that is, 0 Continuously add Gaussian noise to convert it into z T , each step of adding noise is from z t-1 →z t , so the definition formula is:
[0064]
[0065] Among them, N is Gaussian distribution, I is the unit matrix, β t is a preset constant between 0 and 1. is the standard deviation of the current time distribution, t∈{1,2,...,T}, q(Z t |Z t-1 ) means that at a given Z t-1 In the case of Z t The conditional probability distribution of .
[0066] The formula for adding Gaussian noise each time is obtained using the re-parameter technology as follows:
[0067]
[0068] Among them, z t represents the data distribution at time t, ε t represents the Gaussian noise added at time t.
[0069] When α t =1-β t , hour,
[0070]
[0071] The reverse diffusion process in the above correction diffusion model is specifically constructed as follows:
[0072] The original data is obtained from the Gaussian noise through the back diffusion process, assuming that the back diffusion process is still z T →z 0 The Markov chain process is expressed as:
[0073] p θ (z t-1 |z t ,τ θ (X)) = N(z t-1 ;μ θ (z t ,t,τ θ (X)),σ θ (z t ,t,τ θ (X) 2 I) (5)
[0074] Among them, μ θ (z t ,t,τ θ (X)) is the average value in the reverse diffusion process, σ θ (z t ,t,τ θ (X) 2 is the variance in the back diffusion process.
[0075] By using the neural network P θ Fitting the reverse process q(Z t-1 |Z t ,τ θ (X), due to q(Z t-1 |Z t ,τ θ (X),Z 0 ) can be deduced that P θTherefore, by using the Bayesian formula for q(Z t-1 |Z t ,τ θ (X),Z 0 ) is solved, and finally an exponential function with a quadratic exponent is obtained. According to the Bayesian formula, the mean and variance can be obtained. In the reverse process, z should not be known in advance. 0 , so use z t Instead of z 0 ,so:
[0076]
[0077]
[0078] z t-1 It can be expressed as:
[0079]
[0080] Among them, Z~N(0,I) represents the random noise generated when the model is output, ε θ The back-diffusion process used to determine the diffusion model is a conditional noise predictor with encoding of MRI brain tumor images.
[0081] In addition, the back-diffusion process also introduces a cross-attention mechanism to enhance its underlying U-Net denoising network. The back-diffusion process is conditioned on the MRI brain tumor image encoded by the encoder. The MRI brain tumor image is mapped to the middle layer of the U-Net denoising network in the diffusion model through the cross-attention mechanism. Then, the conditional noise predictor ε is used θ Perform T iterations of denoising and transform the latent variable z T Convert to z 0 , and then enter the decoder for decoding to obtain the reconstruction error map
[0082] It can be understood that the principle of the diffusion model is to perform T-iteration denoising, and each step of iterative denoising contains a U-Net denoising network, and each step is implemented by the U-Net denoising network from Z t to Z t-1 For example, the sample at time step t is input into the U-Net denoising network, and implicit denoising is performed to obtain the sample at time step t-1.
[0083] Therefore, the loss function of the corrected diffusion model is defined as:
[0084]
[0085] The cross-attention mechanism in the above corrected diffusion model is constructed as follows:
[0086] In principle, the diffusion model can be modeled using a conditional denoising autoencoder ε θ (z t ,t,X) to realize P(z 0 |X) conditional distribution modeling. In order to enhance the flexibility of the diffusion model, this embodiment introduces a cross attention mechanism to enhance the underlying U-Net denoising network, which is effective for improving the quality of the output results according to the input conditional MRI brain tumor image X.
[0087] This embodiment introduces a CLIP image encoder, called τ θ , which preprocesses the MRI brain tumor image X. It projects the MRI brain tumor image X into the intermediate representation τ θ (X), and maps it to the middle layer of the U-Net denoising network in the diffusion model through the cross attention mechanism. The cross attention mechanism is used to connect the conditional encoding with the middle layer of the U-Net denoising network. The input of the cross attention mechanism is z t and τ θ (X), the output of the cross-attention mechanism is input to the decoder for decoding.
[0088] The back diffusion process is used to learn the systematic error and add the information of the MRI brain tumor image X at each time step to guide the learning of the model. By mapping the information of the MRI brain tumor image X to the middle layer of the U-Net denoising network, it helps to improve the performance and ability of the model and better capture the characteristics and distribution of the data.
[0089] During the back diffusion process, the MRI brain tumor image X information is added at each time step to guide the learning of the system error.
[0090]
[0091] in, is the projection matrix, Denotes U-Net implements ε θ The intermediate representation of .
[0092] In summary, in this embodiment, the training steps of the corrected diffusion model segmentation network include:
[0093] Construct a training sample set, which is MRI brain tumor images with tumor labels;
[0094] Construct a corrected diffusion model segmentation network;
[0095] The corrected diffusion model segmentation network is trained using the training sample set. When the loss function reaches the minimum value or the number of iterations meets the set requirements, the training is stopped to obtain a trained corrected diffusion model segmentation network.
[0096] During the training process, the samples were randomly divided into 8:2 based on the sample set, of which 80% were training samples and the remaining 20% were test samples. The brain tumor datasets provided by BRATS2019, BRATS2020, and Jun Cheng were selected to evaluate the model. Among them, the sample values of BRATS2019 and BRATS2020 are brain tumor images with WT (whole tumor), TC (tumor core), and ET (enhanced tumor) labels. The brain tumor dataset provided by Jun Cheng contains three types of brain tumor images, and the sample values are all brain tumor images with tumor labels.
[0097] Among them, the training correction diffusion model segmentation network mainly consists of two parts. Figure 1 The two modules shown in the figure correspond to each other. The first part is the U-Net segmentation network, which takes the MRI brain tumor image as input and segments the MRI brain tumor image through the U-Net network to obtain the initial mask s; the second part is the correction diffusion model network, which uses the diffusion model principle to correct the system segmentation error, and obtains the system error segmentation result diagram according to the loss function.
[0098] In this embodiment, the loss function of the correction diffusion model system is specifically:
[0099]
[0100] In the above formula, the network loss function L of the corrected diffusion model is CorrDiff In the figure, X represents the MRI brain tumor image, z 0 represents the system error image, z t represents a Gaussian noise image, t represents the time step, ε θ represents the conditional noise predictor, τ θ represents an encoder used to encode an MRI brain tumor image X.
[0101] During the training process, the MRI brain tumor images are preprocessed and then input into the U-Net segmentation network to generate the initial mask s, and the error map E is obtained and input into the correction diffusion model. θ and vector quantized variational autoencoder τ θ Perform joint optimization, use the loss function to further improve the accuracy of the experiment, and output the reconstruction error map Then, the initial mask s and the reconstruction error map Add together and finally output the brain tumor segmentation result map.
[0102] In this embodiment, the reasoning process of the correction diffusion model network is specifically as follows:
[0103] like Figure 2 As shown in Figure 1, an MRI brain tumor image is used as input. z is sampled from a standard Gaussian distribution. T , through the vector quantized variational autoencoder τ θ The MRI brain tumor image X is encoded and mapped to the U-Net denoising network in the diffusion model through a cross-attention layer and applied in each iteration. Then, the conditional noise predictor ε is used θ With z t , t and τ θ As input to calculate z t-1 When t = 1, z 0 For the final system error prediction, the decoder calculates z 0 Decode and get the reconstruction error map Through the initial mask s and the reconstruction error map Add together to get the final brain tumor segmentation result map and correct the mask
[0104] In this embodiment, brain tumor segmentation experiments were performed on brain tumor datasets provided by BRATS2019, BRATS2020, and Jun Cheng. The BRA TS2019 training set contains 335 images, which are randomly divided into 268 images for training and 67 images for verification. Similarly, the BRA TS2020 training set contains 369 images, which are randomly divided into 295 images for training and 74 images for verification. In addition, the brain tumor dataset provided by Jun Cheng consists of 3064 T1-weighted contrast-enhanced images, which are also randomly divided into 2452 for training and 612 for verification.
[0105] The final segmentation results of this embodiment on the BRA TS2020 dataset are compared with the existing segmentation schemes. Figure 3 As shown in Table 1 below, the solution described in this embodiment can achieve a better segmentation effect.
[0106] Table 1 Segmentation results of the brain tumor segmentation system according to the embodiment of the present invention and the existing brain tumor segmentation system on the BRA TS2020 dataset:
[0107]
[0108] The final segmentation results of this embodiment on the BRA TS2019 dataset are compared with the existing segmentation schemes. Figure 3 As shown in Table 2 below, the solution described in this embodiment can achieve a better segmentation effect.
[0109] Table 2 Segmentation results of the brain tumor segmentation system described in the embodiment of the present invention and the existing brain tumor segmentation system on the BRA TS2019 dataset:
[0110]
[0111] In this embodiment, an MRI brain tumor image is obtained, preprocessed, and then input into the U-Net network. The MRI brain tumor image is segmented, and the brain tumor segmentation result map is output to generate an initial mask s. Then, the difference operation is performed between the real brain tumor segmentation image and the U-Net segmentation result map s to obtain the error map E, which is input into the correction diffusion model network. θ Perform T iterations of denoising and output the reconstruction error map Then, the initial mask s and the reconstruction error map Add together and finally output the brain tumor segmentation result map.
[0112] This embodiment provides an accurate MRI brain tumor image segmentation system based on a corrected diffusion model. By utilizing the diffusion model to perform diffusion correction on the systematic error generated by the segmentation algorithm, the accuracy of MRI brain tumor image segmentation is further improved by diffusing the systematic error, thereby assisting doctors in diagnosing brain tumor diseases.
[0113] The corrected diffusion model algorithm proposed in this embodiment applies the diffusion model to correct system errors, and improves the segmentation accuracy of brain tumors by introducing correction learning into the diffusion model.
[0114] This embodiment introduces a vector quantized variational autoencoder and applies the corrected diffusion model to the latent space of a powerful autoencoder, which can reduce the training cost and implement the training of the corrected diffusion model under limited computing resources.
[0115] This embodiment introduces a cross-attention mechanism to improve the flexibility and reliability of the corrected diffusion model, so that the corrected diffusion model can output more flexible and reliable results based on the conditional input of the MRI brain tumor image.
[0116] Embodiment 2
[0117] This embodiment provides an image segmentation system based on a corrected diffusion model, including:
[0118] Acquisition module: preprocesses the image to be segmented to obtain the preprocessed image to be segmented;
[0119] Preliminary segmentation module: Use the trained U-Net segmentation network to segment the preprocessed image to obtain a preliminary segmentation result map;
[0120] Calculation module: perform difference calculation on the real image segmentation image and the preliminary segmentation result image to obtain the system error image;
[0121] Reconstruction module: under the condition of Markov chain, Gaussian noise is added to the system error map, and the difference between the system error map after adding Gaussian noise and the system error map without adding noise is calculated by using the constructed loss function, and the system error map is iteratively corrected and reconstructed according to the calculation result of the loss function to obtain a reconstructed system error map;
[0122] Segmentation module: Add the preliminary segmentation result map and the obtained reconstruction system error map to obtain the final segmentation result map.
[0123] Embodiment 3
[0124] The purpose of this embodiment is to provide a computing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the method described in Embodiment 1 is implemented when the processor executes the program.
[0125] Embodiment 3
[0126] The purpose of this embodiment is to provide a computer-readable storage medium.
[0127] A computer-readable storage medium stores a computer program, which, when executed by a processor, performs the method described in Embodiment 1.
[0128] The steps involved in the above embodiments 2, 3 and 4 devices correspond to the method embodiment 1. For the specific implementation, please refer to the relevant description of embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood to include any medium that can store, encode or carry an instruction set for execution by a processor and enable the processor to execute any method in the present invention.
[0129] Those skilled in the art should understand that the modules or steps of the present invention described above can be implemented by a general-purpose computer device, or alternatively, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. The present invention is not limited to any specific combination of hardware and software.
[0130] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. An image segmentation method based on a corrected diffusion model, characterized in that: include: Preprocessing the image to be segmented to obtain a preprocessed image to be segmented; Use the trained U-Net segmentation network to segment the preprocessed image to obtain a preliminary segmentation result map; The preliminary segmentation result map is processed using the corrected diffusion model, specifically: Perform a difference operation between the real image segmentation image and the preliminary segmentation result image to obtain a system error image; Under the condition of a Markov chain, Gaussian noise is added to the system error graph, and the difference between the system error graph after adding Gaussian noise and the system error graph without adding noise is calculated using a constructed loss function, and the system error graph is iteratively corrected and reconstructed according to the calculation result of the loss function to obtain a reconstructed system error graph; The preliminary segmentation result map and the obtained reconstruction system error map are added together to obtain the final segmentation result map.
2. The image segmentation method based on the corrected diffusion model according to claim 1, characterized in that: The training of the U-Net segmentation network specifically includes: taking the labeled image as the input of the U-Net segmentation network, taking the segmentation result of the image as the output of the U-Net segmentation network, and training the U-Net segmentation network.
3. The image segmentation method based on the corrected diffusion model according to claim 1, characterized in that: Gaussian noise is added to the system error map using the forward diffusion process of the correction diffusion model, specifically: encoding the system error map by an encoder; Continuously adding Gaussian noise to the encoded system error map; The re-parameterization technique is used to obtain the system error diagram after each addition of Gaussian noise.
4. The image segmentation method based on the corrected diffusion model according to claim 1, characterized in that: The trained correction diffusion model is used to process the image to be segmented to obtain a reconstructed system error map. Specifically, in the reverse diffusion process of the trained correction diffusion model, the image to be segmented encoded by the encoder is used as a condition, and multiple reverse denoising processes are performed starting from the Gaussian noise image, and then decoded by the decoder to obtain a reconstructed system error map.
5. The image segmentation method based on the corrected diffusion model as claimed in claim 4, characterized in that: The U-Net denoising network is used for denoising. In the U-Net denoising network, the image to be segmented is encoded by a vector quantized variational autoencoder, and the encoded image to be segmented is mapped to the middle layer of the U-Net denoising network through a cross-attention mechanism. The conditional noise predictor is used for multiple iterative denoising. The latent variables are converted and input into the decoder for decoding to obtain a reconstructed system error map.
6. The image segmentation method based on the corrected diffusion model according to claim 1, characterized in that: The training of the correction diffusion model is specifically as follows: in the forward diffusion process, the system error map is used as input and the Gaussian noise image is used as output; in the backward diffusion process, the loss function is used to calculate the difference between the predicted output and the actual Gaussian noise output image, and the connection weights are updated through gradient calculation to gradually iteratively generate a reconstructed system error image from the Gaussian noise image.
7. The image segmentation method based on the corrected diffusion model as claimed in claim 4, characterized in that: During the back diffusion process, the image to be segmented is added at each time step to guide the learning of the system error.
8. An image segmentation system based on a corrected diffusion model, based on the image segmentation method based on a corrected diffusion model as claimed in any one of claims 1 to 7, characterized in that: include: Acquisition module: preprocesses the image to be segmented to obtain the preprocessed image to be segmented; Preliminary segmentation module: Use the trained U-Net segmentation network to segment the preprocessed image to obtain a preliminary segmentation result map; Calculation module: perform difference calculation on the real image segmentation image and the preliminary segmentation result image to obtain the system error image; Reconstruction module: under the condition of Markov chain, Gaussian noise is added to the system error map, and the difference between the system error map after adding Gaussian noise and the system error map without adding noise is calculated by using the constructed loss function, and the system error map is iteratively corrected and reconstructed according to the calculation result of the loss function to obtain a reconstructed system error map; Segmentation module: Add the preliminary segmentation result map and the obtained reconstruction system error map to obtain the final segmentation result map.
9. A computer device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the computer device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, an image segmentation method based on a corrected diffusion model as described in any one of claims 1 to 7 is performed.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the image segmentation method based on a corrected diffusion model according to any one of claims 1 to 7 is executed.