An interactive image segmentation method and system based on conditional generative adversarial
By employing adversarial training of the U-Net structure and a fully convolutional discriminator network in interactive image segmentation, the low accuracy problem of existing methods in complex backgrounds is solved, and efficient image segmentation results are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHANGSHA UNIVERSITY OF SCIENCE AND TECHNOLOGY
- Filing Date
- 2022-11-24
- Publication Date
- 2026-04-14
AI Technical Summary
Existing interactive image segmentation methods have low accuracy when the foreground and background are similar, the texture and appearance are complex, or the edges are weak. Furthermore, the iterative training strategy and backpropagation optimization of deep learning-based methods increase the time consumption for inference and prediction.
We adopt an encoder-decoder structure based on U-Net, combined with a segmentation network using an attention mechanism, and introduce a fully convolutional discriminator network. Through multi-layer feature fusion and adversarial training, we reduce user interaction and improve segmentation accuracy.
While reducing inference and prediction time, it improves the accuracy and high-order consistency of image segmentation, and enhances the matching between segmentation results and real results.
Smart Images

Figure CN115797628B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer image processing, and more specifically, to an interactive image segmentation method and system based on a conditional generative adversarial model. Background Technology
[0002] Image segmentation refers to dividing an image into several non-overlapping regions based on features such as grayscale, color, spatial texture, and geometric shape. These features should exhibit consistency or similarity within the same region, while showing significant differences between different regions. Interactive image segmentation allows users to specify portions of the foreground and background of an image using interactive methods (such as marking dots, drawing lines, and drawing frames). The method then automatically separates the image into the foreground and background of interest, using the user's input as segmentation constraints. As an important branch of image processing, interactive image segmentation can be used for image / video editing, data annotation tasks, and more.
[0003] In recent years, with the development of deep learning, interactive image segmentation can be divided into traditional interactive image segmentation and deep learning-based interactive image segmentation. Most traditional interactive segmentation methods are usually expressed as a graph cutting optimization problem. In 2001, Boykov et al. first introduced graph cutting into the field of image segmentation, proposing the classic interactive graph cuts algorithm (Boykov Y, Jolly M P. Interactive graph cuts for optimal boundary & region segmentation of objects in ND images[C] / / Proceedings of the IEEE International Conference on Computer Vision. LosAlamitos: IEEE Computer Society Press, 2001: 105-112), which expresses the image segmentation problem as an energy optimization problem of Markov random fields, and solves the global optimum using the maximum flow / minimum cut algorithm in graph theory. Subsequently, Rother et al. proposed the GrabCut method (Rother C, Kolmogorov V, Blake A. "GrabCut": interactive foreground extraction using iterated graph cuts[J]. ACMTransactions on Graphics, 2004, 23(3):309-314), which performs segmentation by iteratively estimating a color-based Gaussian mixture model and refines the results using Graph Cut.
[0004] However, these methods typically use low-level features such as color or texture to estimate foreground / background segmentation, resulting in lower accuracy when the foreground and background are similar, the texture and appearance are complex, or the edges are weak. In such cases, these methods require significant user interaction to achieve accurate segmentation, increasing the user's workload.
[0005] Deep learning-based methods extract high-level features generated by convolutional neural networks, leading to a higher level of understanding of objects and semantics. This significantly reduces the amount of user interaction required to generate high-quality segmentation results, achieving competitive segmentation performance compared to traditional methods. To further improve segmentation accuracy, Mahadevan et al. proposed an iterative strategy (Mahadevan, S., Voigtlaender, P., Leibe, B.: Iteratively trained interactive segmentation. In: British Machine Vision Conference 2018, pp. 212 (2018)), which adds interaction points to the largest error region of the currently predicted segmentation result to obtain more accurate results. Jang et al. proposed a backpropagation optimization method (Jang, WD, Kim, CS: Interactive ImageSegmentation via Backpropagating Refinement Scheme. In: IEEE Conference on Computer Vision and Pattern Recognition, pp. 5297-5306 (2019)). Since the forward propagation segmentation result may contain parts that do not match the user annotations, a backpropagation correction mechanism is used to correct the user interaction graph, ensuring that the segmentation result is correct for the user interaction parts. This method refines the segmentation result by running forward and backpropagation multiple times. Deep learning-based interactive image segmentation methods utilize deeper semantic information to further improve segmentation accuracy; however, the use of iterative training strategies and backpropagation optimization methods increases the inference and prediction time consumption. Summary of the Invention
[0006] To address the shortcomings of existing technologies, this invention provides an interactive image segmentation method and system based on a conditional generative adversarial model. This method employs a U-Net-based encoder-decoder structure, using a multi-layer feature fusion approach combined with an attention mechanism in the segmentation network to improve segmentation accuracy, achieving good segmentation results even with shallower networks. Furthermore, to further enhance segmentation accuracy, the method utilizes an adversarial training mechanism. A fully convolutional discriminator network is added to the segmentation network, which further improves the high-order consistency between the segmentation results and the ground truth results. Simultaneously, user interactions are transformed into distance maps and used as conditional inputs to both the segmentation and discriminator networks. This network architecture eliminates the need for a discriminator network during the inference phase, thus significantly reducing inference and prediction time.
[0007] To achieve the above objectives, the present invention provides an image segmentation learning model that integrates multi-scale features, comprising the following steps;
[0008] S1. Construct a network architecture consisting of two sub-networks: a segmentation network and a discriminator network. The proposed segmentation network architecture enhances the network's ability to learn image features, resulting in more accurate foreground object segmentation. This includes:
[0009] S101. The segmentation network consists of four parts: a base network backbone, a pyramid pooling module, a multi-layer fusion module, and a squeeze-and-attention mechanism module. We use a fully convolutional U-Net as the base network backbone. The skip connection structure in U-Net is beneficial for the fusion of low-level and deep-level information. At the same time, it has a large number of feature channels in the upsampling part of the U-shaped structure, which can propagate contextual information to higher resolution layers. Then, we use a pyramid pooling module to connect at the deepest part of U-Net to obtain global information at multiple scales. In addition, we use a multi-layer fusion module to replace the output of the last layer, and merge the outputs of all upsampling layers of U-Net through convolution and concatenation operations, which effectively improves the accuracy of object boundary segmentation. Finally, we add a squeeze-and-attention mechanism module after the multi-layer fusion module, which applies pixel attention to traditional convolution to form attention convolution channels, so as to understand the interdependencies between spatial channels and ensure that the segmentation network effectively focuses on the target object.
[0010] S102, the discriminator network consists of 5 convolutional layers, used to distinguish between the real results and the predicted segmentation results;
[0011] S2. Given an image as input, randomly label pixels according to the actual result label of the image to generate a set of interaction points between the target object and the background, thereby generating a large amount of interaction information to simulate user interaction.
[0012] S3. The interaction information provides the location information of the target object and the background. The obtained interaction information is transformed using Euclidean distance to generate a Euclidean distance map. This distance map is used to describe the spatial distance relationship between each pixel in the image and at least one pixel in the interaction point set. The Euclidean distance map is used as a condition and combined with the original image and the ground truth image respectively as the input of the segmentation network and the discriminator network.
[0013] S4. Perform joint adversarial training on the segmentation network and the discriminator network. The segmentation network is trained by minimizing the joint loss, including cross-entropy loss, DICE loss, and auxiliary adversarial loss. The discriminator network is trained by minimizing the spatial cross-entropy loss.
[0014] This invention provides an end-to-end trainable interactive image segmentation system based on conditional generative adversarial mechanisms, comprising an image segmentation network architecture module consisting of a segmentation network and a discriminator network. The segmentation network includes a backbone network, a pyramid pooling module, a multi-layer fusion module, and a squeeze-and-attention mechanism module. We employ a fully convolutional U-Net as the backbone network. The skip connection structure in U-Net facilitates the fusion of low-level and deep information. The discriminator network consists of five convolutional layers. An image labeling module randomly labels pixels based on the ground truth labels of the input image to generate a large amount of foreground / background interaction information to simulate user interaction. A distance mapping module uses Euclidean distance transformation to generate a Euclidean distance map, describing the spatial distance relationship between each pixel in the image and at least one pixel in the interaction point set. The Euclidean distance map is then used as a condition, combined with the original image and the ground truth image, as inputs to the segmentation network and the discriminator network, respectively. A model training module performs joint adversarial training on the segmentation network and the discriminator network. The segmentation network is trained by minimizing joint losses, including cross-entropy loss, DICE loss, and adversarial loss. The target segmentation module performs segmentation based on the provided image and the foreground / background Euclidean distance map to obtain the target object segmentation result.
[0015] Compared with existing technologies, it has the following beneficial effects:
[0016] This invention addresses the aforementioned problems by employing the U-Net network as the backbone in the segmentation network and combining it with an attention mechanism. This allows the network to effectively fuse shallow and deep features while focusing more intently on the target foreground, thus improving segmentation accuracy. Furthermore, this method utilizes adversarial training, introducing a discriminator network on top of the segmentation network. This discriminator network enhances the high-order consistency between the segmentation results and the ground truth. Since this discriminator network can be ignored during the inference phase, performance is improved while reducing inference and prediction time. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is the overall network structure diagram in this invention patent.
[0019] Figure 2 This is a schematic diagram of the segmentation network structure in this invention patent.
[0020] Figure 3 This is a schematic diagram of the interaction diagram in this invention patent.
[0021] Figure 4 This is a schematic diagram of the distance map in this invention patent.
[0022] Figure 5 This is a schematic diagram of the segmentation result in this invention patent. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other. The invention will now be described in detail with reference to the accompanying drawings and specific embodiments.
[0024] According to one aspect of this application, an image segmentation method fusing multi-scale features is provided, comprising steps S1 to S4:
[0025] S1. Construct a network architecture consisting of two sub-networks: a segmentation network and a discriminator network. The proposed segmentation network architecture enhances the network's ability to learn image features, resulting in more accurate foreground object segmentation. This includes:
[0026] S101. The segmentation network consists of four parts: a base network backbone, a pyramid pooling module, a multi-layer fusion module, and a squeeze-and-attention mechanism module. We use a fully convolutional U-Net as the base network backbone. The skip connection structure in U-Net is beneficial for the fusion of low-level and deep-level information. At the same time, it has a large number of feature channels in the upsampling part of the U-shaped structure, which can propagate contextual information to higher resolution layers. Then, we use a pyramid pooling module to connect at the deepest part of U-Net to obtain global information at multiple scales. In addition, we use a multi-layer fusion module to replace the output of the last layer, and merge the outputs of all upsampling layers of U-Net through convolution and concatenation operations, which effectively improves the accuracy of object boundary segmentation. Finally, we add a squeeze-and-attention mechanism module after the multi-layer fusion module, which applies pixel attention to traditional convolution to form attention convolution channels, so as to understand the interdependencies between spatial channels and ensure that the segmentation network effectively focuses on the target object.
[0027] S102, the discriminator network consists of 5 convolutional layers, used to distinguish between the real results and the predicted segmentation results;
[0028] S2. Given an image as input, randomly label pixels according to the actual result label of the image to generate a set of interaction points between the target object and the background, thereby generating a large amount of interaction information to simulate user interaction.
[0029] S3. The interaction information provides the location information of the target object and the background. The obtained interaction information is transformed using Euclidean distance to generate a Euclidean distance map. This distance map is used to describe the spatial distance relationship between each pixel in the image and at least one pixel in the interaction point set. The Euclidean distance map is used as a condition and combined with the original image and the ground truth image respectively as the input of the segmentation network and the discriminator network.
[0030] S4. Perform joint adversarial training on the segmentation network and the discriminator network. The segmentation network is trained by minimizing the joint loss, including cross-entropy loss, DICE loss, and auxiliary adversarial loss. The discriminator network is trained by minimizing the spatial cross-entropy loss. Each step is described in detail below.
[0031] In step S1, the network architecture is constructed, such as... Figure 1 As shown, this network model consists of two sub-networks: a segmentation network and a discriminator network. The specific steps are as follows:
[0032] S101. The segmentation network consists of four parts: a base network backbone, a pyramid pooling module, a multi-layer fusion module, and a squeeze-and-attention mechanism module. We use a fully convolutional U-Net as the base network backbone. The skip connection structure in U-Net is beneficial for the fusion of low-level and deep-level information. At the same time, it has a large number of feature channels in the upsampling part of the U-shaped structure, which can propagate contextual information to higher resolution layers. Then, we use a pyramid pooling module to connect at the deepest part of U-Net to obtain global information at multiple scales. In addition, we use a multi-layer fusion module to replace the output of the last layer, and merge the outputs of all upsampling layers of U-Net through convolution and concatenation operations, which effectively improves the accuracy of object boundary segmentation. Finally, we add a squeeze-and-attention mechanism module after the multi-layer fusion module, which applies pixel attention to traditional convolution to form attention convolution channels, so as to understand the interdependencies between spatial channels and ensure that the segmentation network effectively focuses on the target object.
[0033] S102, the discriminator network consists of 5 convolutional layers, used to distinguish between the real results and the predicted segmentation results; the network structure is as follows: Figure 1 As shown on the right.
[0034] In step S2, given an image as input, random pixel annotations are performed based on the image's actual labeling to generate a set of interaction points between the target object and the background. This generates a large amount of interaction information to simulate user interaction. The specific steps are as follows:
[0035] S201, the first pixel of the target object In the second sampling, we first calculate the random spacing margin for the adaptive target object region size. The specific calculations are as follows:
[0036]
[0037]
[0038] in, and Represent the pixel sets of the target object and the object boundary, respectively; function It is Euclidean distance. Calculate the pixel set of the target object With the object boundary pixel set The maximum value of the minimum Euclidean distance between them. In the interval Generate a random number.
[0039] S202. Use margin We calculate the minimum Euclidean distance between the target object point set and the previously sampled point set to generate candidate click sets. :
[0040]
[0041] in, For the first The point set of the second sampling; it can be known that any Each candidate point in the set has at least one connection with the previously sampled point set. The distance in pixels; finally, we randomly select the current point set. In Add it to This updates the point set; in this way, the sampled points can be evenly distributed over the target object's region.
[0042] S203. We sample the background point set in the same way; the foreground / background point set used is as follows: Figure 3 As shown.
[0043] In step S3, the interaction information provides the location information of the target object and the background. The obtained interaction information is then transformed using Euclidean distance to generate a Euclidean distance map, such as... Figure 4 As shown, this distance map describes the spatial distance relationship between each pixel in the image and at least one pixel in the interaction point set. The Euclidean distance map is used as a condition and combined with the inputs of the segmentation network and the discriminator network as the inputs of the corresponding networks. The specific steps are as follows:
[0044] S301. We use Euclidean distance transformation to encode the target object and background point sets, creating two distance maps for the target object and background respectively. Specifically, we calculate the Euclidean distance map using the minimum Euclidean distance between pixels and the target object / background point sets, and concatenate it with the RGB image to form the input pair for the segmentation network. The segmentation network ultimately outputs a segmentation probability map.
[0045] S302. Concatenate the Euclidean distance maps of the target object and the background with the output probability map and the ground truth image of the segmentation network to form the input pair of the discriminator network; the discriminator network outputs a spatial probability map with a value of 0-1, indicating whether each pixel in the output probability map of the segmentation network comes from the true result or the predicted segmentation result.
[0046] In step S4, the segmentation network and the discriminator network are jointly trained adversarially. The segmentation network is trained by minimizing the joint loss, including cross-entropy loss, Dice loss, and auxiliary adversarial loss. The discriminator network is trained by minimizing the spatial cross-entropy loss; the specific steps are as follows:
[0047] S401, We represent the segmentation network as... The discriminator network is represented as Given an input image Distance map The Euclidean distance mapping converted from the target object and background point set provided by the user. To predict the probability graph for the segmentation network, This is a label map representing the true result of the target object in the image;
[0048] S402. First, we train the segmentation network. To train the segmentation network, we minimize the joint loss, which is a weighted sum of the following three terms:
[0049]
[0050] in, , and These are the binary cross-entropy loss, the Dice loss, and the adversarial loss, respectively. and The weights are two; since the number of pixels in the foreground object is much smaller than the number of pixels in the background, segmentation prediction, especially for small objects, is a class imbalance problem. To solve this problem, we use binary cross-entropy loss and Dice loss to jointly optimize the segmentation network; the binary cross-entropy loss used for segmentation prediction can be defined as:
[0051]
[0052] The DICE loss measures the overlap between the segmentation result and the true result, and is insensitive to the number of foreground and background pixels. The DICE loss is composed of:
[0053]
[0054] Among them, It serves as a smoothing factor to avoid division by zero;
[0055] Furthermore, in the adversarial training setting, we used confidence maps obtained from the trained discriminator network. Calculate the adversarial loss :
[0056]
[0057] With this loss, we train the segmentation network to produce segments that are close enough to those from real results.
[0058] S403. Next, we train the discriminator network; we train the discriminator network by minimizing the following spatial cross-entropy loss:
[0059]
[0060] in, This represents the predicted probability map of the sample originating from the segmentation network. The samples are from the actual result label graph; Indicates the input image In position Confidence plot, Label map representing the true result of the target object in the image. In position Confidence plot.
[0061] According to another aspect of this application, an interactive image segmentation system based on conditional generative adversarial mechanisms is also provided, comprising the following modules:
[0062] The image segmentation network architecture consists of a segmentation network and a discriminator network. The segmentation network includes a base network backbone, a pyramid pooling module, a multi-layer fusion module, and a squeeze-and-attention mechanism module. We use a fully convolutional U-Net as the base network backbone. The skip connection structure in U-Net is beneficial for the fusion of low-level and deep information. The discriminator network consists of 5 convolutional layers.
[0063] Image labeling module: Given an image as input, it randomly labels pixels based on the image's real labels, including labels for target objects and background, thereby generating a large amount of interactive information to simulate user interaction;
[0064] Distance Mapping Module: The interaction information provides the location information of the target object and the background. The obtained interaction information is transformed using Euclidean distance to generate a Euclidean distance map. This distance map is used to describe the spatial distance relationship between each pixel in the image and at least one pixel in the interaction point set. The Euclidean distance map is used as a condition and combined with the original image and the ground truth image respectively as the input of the segmentation network and the discriminator network.
[0065] Model training module: Jointly trains the segmentation network and discriminator network adversarially; trains the segmentation network by minimizing the joint loss, including: cross-entropy loss, DICE loss, and auxiliary adversarial loss; trains the discriminator network by minimizing the spatial cross-entropy loss;
[0066] Target segmentation module: Performs segmentation based on the provided image and the foreground-background Euclidean distance map to obtain the target object segmentation result.
[0067] This system is used to implement the functions of the methods in the above embodiments. The specific implementation steps of the methods involved in the system module have been described in the methods and will not be repeated here.
[0068] In this embodiment, a segmentation model for the target object is constructed by concatenating Euclidean distance maps generated from the image, the target object point set, and the background point set into the segmentation model. This model integrates multi-layer, multi-scale, and contextual information, and uses an attention mechanism to focus on the segmentation of the target object. To further improve segmentation accuracy, adversarial training is employed, adding a discriminator network to enhance the high-order consistency between the segmentation results and the true results. This provides a more efficient segmentation model for practical applications.
[0069] The above description is merely a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural transformations made using the contents of the present invention's specification and drawings under the inventive concept of the present invention, or direct / indirect applications in other related technical fields, are included within the patent protection scope of the present invention.
Claims
1. An interactive image segmentation method based on conditional generative adversarial mechanisms, characterized in that, The method is executed by a computer and includes the following steps: S1. Construct an image segmentation network architecture, which consists of two sub-networks: a segmentation network and a discriminator network. The proposed segmentation network architecture enhances the network's ability to learn image features, resulting in more accurate foreground / object segmentation results, including: S101. The segmentation network consists of four parts: a base network backbone, a pyramid pooling module, a multi-layer fusion module, and a squeeze-and-attention mechanism module. We use a fully convolutional U-Net as the base network backbone. The skip connection structure in U-Net is beneficial for the fusion of low-level and deep-level information. At the same time, it has a large number of feature channels in the upsampling part of the U-shaped structure, which can propagate contextual information to higher resolution layers. Then, we use a pyramid pooling module to connect at the deepest part of U-Net to obtain global information at multiple scales. In addition, we use a multi-layer fusion module to replace the output of the last layer, and merge the outputs of all upsampling layers of U-Net through convolution and concatenation operations, which effectively improves the accuracy of object boundary segmentation. Finally, we add a squeeze-and-attention mechanism module after the multi-layer fusion module, which applies pixel attention to traditional convolution to form attention convolution channels, so as to understand the interdependencies between spatial channels and ensure that the segmentation network effectively focuses on the target object. S102, the discriminator network consists of 5 convolutional layers, used to distinguish between the real results and the predicted segmentation results; S2. Given an image as input, randomly label pixels according to the actual result label of the image to generate a set of interaction points between the target object and the background, thereby generating a large amount of interaction information to simulate user interaction. S3. The interaction information provides the location information of the target object and the background. The obtained interaction information is transformed using Euclidean distance to generate a Euclidean distance map. This distance map is used to describe the spatial distance relationship between each pixel in the image and at least one pixel in the interaction point set. The Euclidean distance map is used as a condition and combined with the original image and the ground truth image respectively as the input of the segmentation network and the discriminator network. S4. Jointly train the segmentation network and the discriminator network against each other; train the segmentation network by minimizing the joint loss, including: cross-entropy loss, DICE loss and auxiliary adversarial loss; train the discriminator network by minimizing the spatial cross-entropy loss.
2. The interactive image segmentation method based on conditional generative adversarial analysis as described in claim 1, characterized in that, The specific implementation process of S2 is as follows: S201, the first pixel of the target object In the second sampling, we first calculate the random spacing margin for the adaptive target object region size. The specific calculations are as follows: in, and Represent the pixel sets of the target object and the object boundary, respectively; function It is Euclidean distance. Calculate the pixel set of the target object With the object boundary pixel set The maximum value of the minimum Euclidean distance between them; function In the interval Generate a random number. S202. Use margin We calculate the minimum Euclidean distance between the target object point set and the previously sampled point set to generate candidate click sets. : in, For the first The point set of the second sampling; it can be known that any Each candidate point in the set has at least one connection with the previously sampled point set. The distance in pixels; finally, we randomly select the current point set. In and add it to This updates the foreground point set, allowing the sampled points to be evenly distributed across the target area. S203. We sample the background point set in the same way.
3. The interactive image segmentation method based on conditional generative adversarial science as described in claim 1, characterized in that, The specific implementation process of S3 is as follows: S301. We use Euclidean distance transformation to encode the target object and background point set, and create two distance maps for the target object and the background respectively. That is, we calculate the Euclidean distance map using the minimum Euclidean distance between the image pixels and the target object point set / background point set, and concatenate it with the RGB image to form the input pair of the segmentation network. The segmentation network ultimately outputs a segmentation probability map; S302. Concatenate the Euclidean distance maps of the target object and the background with the output probability map and the ground truth image of the segmentation network to form the input pair of the discriminator network; the discriminator network outputs a spatial probability map with a value of 0-1, indicating whether each pixel in the output probability map of the segmentation network comes from the true result or the predicted segmentation result.
4. The interactive image segmentation method based on conditional generative adversarial mechanisms as described in claim 1, characterized in that, The specific implementation process of S4 is as follows: S401, We represent the segmentation network as... The discriminator network is represented as ; Given an input image Distance map The Euclidean distance mapping converted from the target object and background point set provided by the user. To predict the probability graph for the segmentation network, This is a label map representing the true result of the target object in the image; S402. First, we train the segmentation network. To train the segmentation network, we minimize the joint loss, which is a weighted sum of the following three terms: in, , and These are binary cross-entropy loss, Dice loss, and auxiliary adversarial loss, respectively. and The weights are two; since the number of pixels in the foreground object is much smaller than the number of pixels in the background, segmentation prediction, especially for small objects, is a class imbalance problem. To solve this problem, we use binary cross-entropy loss and Dice loss to jointly optimize the segmentation network; the binary cross-entropy loss used for segmentation prediction can be defined as: Dice loss measures the overlap between the segmentation result and the true result, and is insensitive to the number of foreground and background pixels; the Dice loss is defined as follows: in, It serves as a smoothing factor to avoid division by zero; Furthermore, in the adversarial training setting, we used confidence maps obtained from the trained discriminator network. Calculate the adversarial loss : With this loss, we train the segmentation network to produce segments that are close enough to those from real results; S403. Next, we train the discriminator network; we train the discriminator network by minimizing the following spatial cross-entropy loss: in, This represents the predicted probability map of the sample originating from the segmentation network. The samples are from the actual result label graph; Indicates the input image In position Confidence plot, Label map representing the true result of the target object in the image. In position Confidence plot.
5. An interactive image segmentation system based on conditional generative adversarial mechanisms, characterized in that, It includes the following modules: The image segmentation network architecture consists of a segmentation network and a discriminator network. The segmentation network includes a base network backbone, a pyramid pooling module, a multi-layer fusion module, and a squeeze-and-attention mechanism module. We use a fully convolutional U-Net as the base network backbone. The skip connection structure in U-Net is beneficial for the fusion of low-level and deep information. The discriminator network consists of 5 convolutional layers. Image labeling module: Given an image as input, it randomly labels pixels based on the image's real labels, including labels for target objects and background, thereby generating a large amount of interactive information to simulate user interaction; Distance Mapping Module: The interaction information provides the location information of the target object and the background. The obtained interaction information is transformed using Euclidean distance to generate a Euclidean distance map. This distance map is used to describe the spatial distance relationship between each pixel in the image and at least one pixel in the interaction point set. The Euclidean distance map is used as a condition and combined with the original image and the ground truth image respectively as the input of the segmentation network and the discriminator network. Model training module: Jointly trains the segmentation network and discriminator network adversarially; trains the segmentation network by minimizing the joint loss, including: cross-entropy loss, DICE loss, and auxiliary adversarial loss; trains the discriminator network by minimizing the spatial cross-entropy loss; Target segmentation module: Performs segmentation based on the provided image and the foreground-background Euclidean distance map to obtain the target object segmentation result.