Joint Unsupervised Object Segmentation and Inpainting

Through the segmentation, enhancement and repair technology of the SEIGAN architecture, the problems of inaccurate object segmentation and unstable high-resolution processing in unsupervised object segmentation and image processing are solved, achieving more accurate and stable image processing effects.

CN113016005BActive Publication Date: 2024-09-06SAMSUNG ELECTRONICS CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN201980074975.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-02-20
Filing Date
2019-11-05
Publication Date
2024-09-06
Estimated Expiration
2039-11-05

AI Technical Summary

Technical Problem

Existing technologies have problems such as inaccurate object segmentation, limited scope of application, and instability in high-resolution image processing in unsupervised object segmentation and image processing. In particular, human intervention and multiple tasks are required in object category recognition and ternary diagram generation. step optimization.

Method used

Propose a SEIGAN (Segmentation-Augmentation-Inpainting) architecture that utilizes three neural networks for segmentation, enhancement and repair by simultaneously learning to segment object masks and remove objects from the background, combining adversarial loss, reconstruction loss and mask consistency The loss is trained end-to-end to ensure the consistency and stability of image processing.

Benefits of technology

Achieve more accurate object segmentation and image blending under unsupervised conditions, improve processing stability and high-resolution applicability, reduce human intervention and steps, and be able to naturally transfer objects from one background to another superior.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113016005B_ABST
    Figure CN113016005B_ABST
Patent Text Reader

Abstract

The present invention relates to the implementation of image processing functions associated with finding the boundaries of an object, removing an object from an image, inserting an object into an image, and creating a new image from a combination of existing images. A method for automatic image processing and a computing system for performing automatic image processing are proposed, comprising: a first neural network for generating a segmented image containing an object O and a background B by segmenting a mask m. x The object O is segmented from the original image x, and the segmented object O is cut out from the image x and pasted onto the image B containing only the background B using the mask m. y a second neural network for constructing an enhanced version of the image (image I) with the pasted segmented object O by enhancing the rough image z based on the original images x and y and the mask m; a third neural network for restoring an image (image II) with only the background without the removed segmented object O by repairing the image obtained by setting the pixels of image x to zero using the mask m; wherein the first neural network, the second neural network and the third neural network are combined into a general architecture of a neural network for sequentially performing segmentation, enhancement and repair and for simultaneous learning, wherein the general architecture of the neural network accepts images and outputs processed images of the same size.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the implementation of image processing functions associated with finding the boundaries of objects, removing objects from an image, inserting objects into an image, creating new images from a combination of existing images. Background Art

[0002] Unsupervised and weakly supervised object segmentation. In

[18] , the authors proposed a GAN-based

[30] technique for generating object segmentation masks from bounding boxes. Their training procedure consists of taking two crops of the same image: one with the object and one without it. Objects are detected using Faster R-CNN

[19] . They then train the GAN to produce a segmentation mask such that the two crops merge with the mask result into a plausible image. The authors use a combination of adversarial loss, existence loss (where the existence loss verifies that the object is present in the image) and cut loss (where the cut loss verifies that no object parts are left after the object is cut). They experiment with only a few classes from Cityscapes [5] and all classes from the MSCOCO

[14] dataset. The authors report that their method achieves higher average intersection-over-union values ​​than the classic GrabCut

[21] algorithm and the recent Simple-Doe-It

[12] . The method requires a pre-trained Faster R-CNN and a special strategy for foreground and background region selection. The method also had difficulty in correctly segmenting some object classes (e.g., kites, giraffes, etc.). Their method also only worked for small resolution images (28×28).

[0003] In

[23] , the authors proposed an unlabeled framework for learning segmentation networks for homogeneous objects. They used an adaptive synthetic data generation process to create a training dataset.

[0004] Although traditionally addressed with superpixel clustering, unsupervised image segmentation has recently been tackled with deep learning [9]. In the latter paper, the authors proposed maximizing the information between two cluster vectors obtained from nearby regions of the same image using a fully convolutional network. A similar technique has been proposed in

[24] , but subject to a reconstruction loss. The authors describe a W-Net (an autoencoder with a U-net-like encoder and decoder) that attempts to cluster pixels in the inner layers and then reconstruct the image from the pixel clusters. Their segmentation results are agnostic to object class.

[0005] Visual grounding. Methods for visual grounding aim at unsupervised or weakly supervised matching of regions of an image to free-form text queries. Typically, super vision takes the form of pairs (image; caption). Model performance is usually measured as the intersection-over-union with respect to the ground truth labels. The most popular datasets are Visual Genome

[13] , Flickr30k

[17] , Refer-It-Game

[11] , and MSCOCO

[14] . The general approach to grounding consists of predicting whether a given caption and image correspond to each other. Negative samples are obtained by scrambling the caption and image independently. Text-image attention is a core feature of most visual grounding models

[28] . Obviously, using more fine-grained supervision (e.g., region-level annotations instead of image-level annotations) leads to higher scores

[29] .

[0006] Ternary map generation. Ternary map generation is the problem of segmenting an image into three classes: foreground, background, and unknown (transparent foreground). Most algorithms require human intervention to come up with a ternary map, but recently superpixel and clustering based methods have been proposed for automatic ternary map generation [7]. However, their methods require multiple optimization steps to be performed on each image. Deep learning is used to generate an alpha matting mask given an image and a ternary map

[26] . There is also some work on video matting and background replacement in videos [8]. They use frame-by-frame superpixel segmentation and then optimize the energy in a conditional random field of a Gaussian mixture model to separate foreground and background frame-by-frame.

[0007] Generative Adversarial Networks. In recent years, GANs [6] are perhaps the most common approach for training generative models. While powerful, they suffer from unstable training processes and inconsistent performance for higher resolution images. A recently proposed method, CycleGAN

[30] , trains two GANs together to establish a bidirectional mapping between two domains. Their approach provides greater stability and consistency. In contrast, the method requires the dataset to visualize a reversible operation. A large number of modifications and applications of CycleGAN have been published, including semantic image manipulation

[22] , domain adaptation [2], unsupervised image-to-image translation

[15] , multi-domain translation [3], etc. There is also the problem that this mapping between domains may be ambiguous. BicycleGAN

[31] and enhanced CycleGAN [1] address this problem by requiring that the mapping must preserve the hidden representation.

[0008] In this paper, we build on the ideas of Cut&Paste

[18] and CycleGAN[6] and propose a novel architecture and pipeline that solves a different problem (background swapping) and achieves better results in unsupervised object segmentation, inpainting, and image blending. Summary of the invention

[0009] Technical issues

[0010] Technical Solution

[0011] This paper proposes a novel approach to visual understanding by simultaneously learning to segment object masks and remove objects from the background (also known as cutting and pasting).

[0012] A computing system for performing automatic image processing is proposed, comprising: a first neural network for segmenting an image containing an object O and a background B by segmenting a mask m x The object O is segmented from the original image x, and the mask m is used to segment the object O by cutting out the segmented object O from the image x and pasting it onto the background B containing only the background. y a second neural network for constructing an image with the pasted segmented object O by enhancing the rough image z based on the original images x and y and the mask m; A third neural network for restoring an image having only the background without the removed segmented object O by inpainting the image obtained by zeroing the pixels of the image x using the mask m The first neural network, the second neural network, and the third neural network are combined into a general architecture of a neural network for sequentially performing segmentation, enhancement, and restoration and for simultaneous learning, wherein the general architecture of the neural network accepts an image and outputs a processed image of the same size. In addition, the first neural network, the second neural network, and the third neural network are used to create an image. and And convert the image and The system further comprises: two neural networks configured as discriminators for estimating the plausibility of the image. In addition, the first discriminator is a background discriminator that attempts to distinguish between a reference real background image and a restored background image; and the second discriminator is an object discriminator that attempts to distinguish between a reference real object O image and an enhanced object O image. In addition, the first neural network and the second neural network constitute a switching network. In addition, the switching network is configured to be trained end-to-end using a loss function to construct an image with the pasted segmented object O In addition, one of the loss functions is an object reconstruction function for ensuring consistency and training stability, and is implemented as an image x and an image obtained by applying the exchange network twice to the image x. In addition, one of the loss functions is used to increase the image The adversarial object function of the rationality of , and the one loss function is implemented using a dedicated discriminator network. In addition, one of the loss functions is a mask consistency function for making the first neural network invariant to the background, and is implemented as the mask extracted from the image x and the mask extracted from the image The average absolute distance between the extracted masks. One of the loss functions is an object enhancement identification function for forcing the second neural network to produce an image closer to the real image, and is the image G obtained by applying the second neural network to the image x. enh (x) and x itself. In addition, one of the loss functions is a background identification function for ensuring that the general architecture does not perform any processing on images that do not contain objects. In addition, one of the loss functions is an overall loss function, wherein the overall loss function is a linear combination of an object reconstruction function, an adversarial object function, a mask consistency function, an object enhancement identification function, and a background identification function. In addition, the segmentation mask m is predicted by a first neural network based on the image x.

[0013] A method for automatic image processing is proposed by the following steps: using a first neural network to segment an object O and a background B via a segmentation mask m x The object O is segmented from the original image x of the image x, and the segmented object O is cut out from the image x using the mask m and pasted onto the image y containing only the background to form a rough image z: an image with the pasted segmented object O is constructed using a second neural network by enhancing the rough image z based on the original images x and y and the mask m An enhanced version of; using a third neural network to restore an image without the removed segmented object O by zeroing the pixels of the image x using the mask m to obtain an image having only the background Output images of the same size and In addition, the first neural network, the second neural network and the third neural network are used to create images and And convert the image and The method further comprises: two neural networks configured as discriminators for estimating the plausibility of the image. In addition, the first discriminator is a background discriminator that attempts to distinguish between a reference real background image and a restored background image; and the second discriminator is an object discriminator that attempts to distinguish between a reference real object O image and an enhanced object O image. In addition, the first neural network and the second neural network constitute a switching network. In addition, the switching network is configured to be trained end-to-end using a loss function to construct an image with the pasted segmented object O In addition, one of the loss functions is an object reconstruction function for ensuring consistency and training stability, and is implemented as an image x and an image obtained by applying the exchange network twice to the image x. In addition, one of the loss functions is an adversarial object function for increasing the plausibility of the image, and the one loss function is implemented using a dedicated discriminator network. In addition, one of the loss functions is a mask consistency function for making the first neural network invariant to the background, and is implemented as a mask extracted from the image x and a mask extracted from the image The average absolute distance between the extracted masks. In addition, one of the loss functions is an object enhancement identification function for enhancing the second neural network to produce an image closer to the real image, and is an image G obtained by applying the second neural network to the image x. enh (x) and x itself. In addition, one of the loss functions is a background identification function for ensuring that the general architecture does not perform any processing on images that do not contain objects. In addition, one of the loss functions is an overall loss function, wherein the overall loss function is a linear combination of an object reconstruction function, an adversarial object function, a mask consistency function, an object enhancement identification function, and a background identification function. In addition, the segmentation mask m is predicted by a first neural network based on the image x.

[0014] Beneficial Effects BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The above and / or other aspects will become more apparent by describing exemplary embodiments with reference to the accompanying drawings, in which:

[0016] Figure 1 The architecture of the neural network, the data preparation scheme, and setting its parameters are shown. High-level overview of the SEIGAN (Segmentation-Enhancement-Inpainting) process for joint segmentation and inpainting: the swap operation is performed twice and optimized to reproduce the original image. The ellipses represent objects and data; the solid rectangles represent the neural network; the rounded rectangles represent the loss function; the solid lines represent the data flow, and the dashed lines represent the value flow of the loss function.

[0017] Figure 2 is a switching network that cuts objects from one image and pastes them onto another image (from Figure 1 ) architecture.

[0018] Figure 3 are examples of images and masks generated by our model.

[0019] Figure 4 is the architecture of a residual network used for inpainting and / or segmentation networks.

[0020] Figure 5 It is the architecture of U-network for segmentation and refinement of networks. DETAILED DESCRIPTION

[0021] The proposed invention may be useful hardware, wherein the useful hardware includes software products and devices that perform automatic or automated image processing, including:

[0022] - Graphics editor;

[0023] - Creative applications for creating graphic content;

[0024] - The hardware system (wearable device, smartphone, robot) for which you want to find the object in the image;

[0025] - Augmented reality modeling (virtual / augmented reality);

[0026] -Preparing data for building machine learning methods (any industry).

[0027] The symbols used in the application materials are explained below.

[0028] O - Object depicted in the image.

[0029] B x - The background depicted in image x.

[0030] B y -The background depicted in image y.

[0031] x= <O,B x >- contains object O and background B x of the image.

[0032] -Contains only background B y (and no object in the foreground).

[0033] x – the set of all images x.

[0034] y – the set of all images y.

[0035] - Remove the image x of object O (so that the image only contains the background B x ).

[0036] - Paste the image y of object O.

[0037] and - Background B x and background B y and transformed (approximate) variants of object O.

[0038] m=Mask(x)-segmentation mask of image x.

[0039] z=m⊙x+(1-m)⊙y-a coarse image constructed by blending images x and y using a blending mask m.

[0040] G seg , G inp , G enh -Neural networks used as generators for segmentation, inpainting, and augmentation.

[0041] D bg , D obj- Neural network used as discriminator (D bg Classify images with real background and inpainted images, D obj Classify images with real objects from images with pasted objects).

[0042] Gram(i) – Gram matrix constructed from the 3D tensor representing features of image pixels.

[0043] VGG(i) - a function used to compute a 3D tensor that represents features of image pixels.

[0044] L, -Optimization criteria for tuning neural network parameters.

[0045] λ 1 , ..., λ 7 - A non-negative real coefficient used to balance the importance of different optimization criteria.

[0046] The proposed image processing functions require less detailed human control than current existing simulations.

[0047] The proposed solution can be implemented in software, which in turn can be run on any device with sufficient computing power.

[0048] Throughout this paper, we represent images as object-background tuples, e.g., x = <O,Bx > indicates that image x contains object O and background Bx, and Indicates that image y contains background B y and does not contain an object.

[0049] The main problem we address in this work can be formulated as follows. Given a dataset of background images Dataset x with objects on different backgrounds = <O,B x > x∈X (unpaired, i.e., no mapping between X and Y), the model is trained to take an object from an image x∈X and paste it onto a new background defined by an image y∈Y, while removing the object from the original background. In other words, the problem is to take a pair of images x= <O,B x > and Transform into a new pair and in, and But the object and both backgrounds are changed so that the new image looks natural.

[0050] This general problem can be broken down into three subtasks:

[0051] - Segmentation: Segment m = Mask(x) from the original image x = <O,B x > Segmented object O; given a mask, we can do a crude hybrid of simply cutting the segmented object from x and pasting it onto y: z = m⊙x + (1-m)⊙y, where ⊙ represents component-wise multiplication. In the learning process, the parameters of the neural network are adjusted in such a way that when an image with an object is input, it gives the correct mask in which the object is selected. The user does not participate in this process.

[0052] - Enhancement: Given the original images x and y, the coarse image z and the segmentation mask m, construct A refined version of .

[0053] - Inpainting: Given a segmentation mask m and an image (1-m)⊙x obtained by zeroing the pixels of x according to m, recover the image with only the background Instead of removing the segmented object O, a part of the image is filled with a third neural network based on the rest of the image and a random signal. During training, the parameters of the third neural network are configured in such a way that, based on this incomplete information, a reasonable background filling is produced. The result is two images and However, the focus is on the image The image with a blank background is an intermediate result of the algorithm, but an image with a blank background can also be used.

[0054] For each of these tasks, we can build separate neural networks that take in an image or a pair of images and output a new image or pair of images of the same dimensions. However, the main idea we explore in this work is that it is very beneficial to train all of these neural networks together in the absence of large paired and labeled datasets (which is the normal case in most applications).

[0055] Therefore, we propose our SEIGAN (Segmentation-Enhancement-Inpainting) architecture that combines all three components in a novel and previously unexplored way. Figure 1 In Figure 1, boxes with dashed outlines represent data (images); ovals represent objects contained in the data; boxes with sharp corners represent subroutines that implement the neural network; boxes with rounded corners represent subroutines that control the process of adjusting the parameters of the neural network during the training process; lines represent the flow of data during the training process (the fact that an arrow points from one box to another means that the result of the first box is passed as input to the second box). Figure 1 The general flow of our architecture is outlined above; the “swap network” module combines segmentation and augmentation. Since cut and paste are partially reversible operations, it is natural to organize the training process in a similar way to CycleGAN

[30] : the swap network and the repair network are applied twice in order to complete the cycle and be able to use idempotence properties for the loss function. We use and represents the result of the first application, and is represented by and Indicates that the object is removed from The result of the second application of the move back (see Figure 1 ).

[0056] Figure 1 The architecture shown in the paper combines five different neural networks, three used as generators to create images and transform them, and two used as discriminators to estimate the plausibility of images:

[0057] ·G seg Solve the segmentation task: given an image x, predict the segmentation mask Mask(x) of the object on the image;

[0058] ·G inp Solve the repair problem: given m and (1-m)⊙x, predict

[0059] ·G enh Perform enhancement: Given x, y, and z = m⊙x+(1-m)y, predict

[0060] ·D bgis a background discriminator that tries to distinguish between real background-only images and fake (inpainted) background-only images; if x is real, the output of the background discriminator D bg (x) should be close to 1, and if x is fake, the output of the background discriminator D bg (x) should be close to 0;

[0061] ·D obj is an object discriminator that performs the same operation on objects and background images; if x is real, the output of the object discriminator D obj (x) should be close to 1, and if x is fake, the output D of the object discriminator is obj (x) should be close to 0.

[0062] Generator G seg and G enh The so-called "switching network" is formed, wherein the so-called "switching network" Figure 1 is depicted as a single unit and Figure 2 This diagram depicts the architecture of a "switching network" along with the minimum set of other entities required to describe how to use a "switching network" ( Figure 1 ). Boxes with dashed outlines represent data (images); ovals represent objects contained in the data; boxes with sharp corners represent subroutines that implement the neural network; boxes with rounded corners represent subroutines that control the process of adjusting the parameters of the neural network during the training process; lines represent the flow of data during the training process (the fact that arrows point from one box to another means that the result of the first box is passed as input to the second box). A segmentation network is a neural network that takes an image and outputs a segmentation mask of the same size. A refinement network takes an image and outputs an improved version of the image of the same size (i.e., with more realistic colors, artifacts removed, etc.).

[0063] Compared to

[18] , the training process in SEIGAN has been shown to be more stable and able to work at higher resolutions. In addition, our architecture allows to handle more tasks (painting and blending) simultaneously instead of just predicting segmentation masks. As is common in GAN design, the secret of the architecture lies in a good combination of different loss functions. In SEIGAN, we use a combination of adversarial loss, reconstruction loss, and normalization loss.

[0064] Repair Network G inp Aims to generate a plausible background given a source image (1-m)⊙x Wherein, the source image (1-m)⊙x represents the original image x according to the segmentation mask m (m = G seg(x)) is subtracted; in fact, we fill the pixels of m⊙x with white. During end-to-end training, we Figure 1 The rounded rectangle on the right shows the parameters of the optimized repair network.

[0065] The adversarial background loss aims to improve the plausibility of the resulting image. The adversarial background loss uses a dedicated discriminator network D bg To achieve this. bg , except for the number of layers, we use the same architecture as in the original CycleGAN

[30] ; our experiments have shown that deeper discriminators work better in our setting. Since the loss function D bg We use the MSE adversarial loss proposed in Least Squares GAN (LSGAN)

[16] , so in fact, the loss function D bg More stable than other types of GAN loss functions:

[0066]

[0067] in, is the original background image,

[0068] is the background image produced by x after the first swap, and After the second exchange The generated background image.

[0069] The background reconstruction loss aims to preserve the original background B x The background reconstruction loss is implemented using the texture loss

[25] , where the texture loss is the mean absolute difference between the Gram matrices of the feature maps after the first 5 layers of the VGG-16 network:

[0070]

[0071] Where VGG(y) represents the feature matrix of a pre-trained image classification neural network (e.g., VGG, but not limited to this), and G ram (A) ij =∑ k A ik A jk is the Gram matrix.

[0072] Our choice of loss function is motivated by the fact that there are a large number of possible plausible background reconstructions, and so the loss function must account for certain degrees of freedom that the mean absolute error or mean squared error does not allow but that the texture loss allows. In our experiments, optimizing the MAE or MSE often results in generated images filled with median or mean pixel values, without objects or texture. Note that since we do not have a ground truth background for x, we only apply the background reconstruction loss on y (see Figure 1 ).

[0073] Another important remark is that before feeding the image to the inpainting network G inp Previously, we subtracted a portion of the image according to the segmentation mask m, and we did it in a differentiable way without applying any thresholding to m. Therefore, the gradient can be propagated back to the segmentation network G through the segmentation mask seg The joint training of inpainting and segmentation has a normalizing effect. First, the inpainting network G inp We want the mask to be as accurate as possible: if the mask is too small, then G inp The rest of the object will have to be erased (which is a big order problem), and if the mask is too large, G inp There will be more blank areas to inpaint. Second, even without thresholding, G inp We also want the segmentation mask m to be high contrast (having values ​​close to 0 and 1): if most of m is low contrast (close to 0.5), then G inp will have to learn to remove the “artifacts” of the object (again, more difficult than just inpainting on empty space), and the discriminator D bg It is probably easier to tell that the resulting picture is fake.

[0074] Figure 3 Examples of data consumed and produced by the proposed method are shown in . Meaning of the images, from left to right, top to bottom:

[0075] 1) The leftmost image in the top row is the real input image with an object ( Figure 1 Example of "Source Image 1" on );

[0076] 2) The second image in the top row is the real input image without the object ( Figure 1 Example of "Source Image 2" on );

[0077] 3) The mask predicted by the segmentation network given image 1;

[0078] 4) Real input image with object ( Figure 1 Another example of "Source Image 1" on );

[0079] 5) Real input image without objects ( Figure 1 Another example of "Source Image 2" on );

[0080] 6) The leftmost image in the bottom row is the output of the inpainting network ( Figure 1 ), where the object from image 1 is removed by the mask on image 3;

[0081] 7) Refine the output of the network ( Figure 1 ), where the object from image 1 is pasted onto the background from image 2;

[0082] 8) Given image 4, the mask predicted by the segmentation network;

[0083] 9) Fix the output of the network ( Figure 1 ), wherein an object from image 4 is removed by a mask on image 8;

[0084] 10) Refine the output of the network ( Figure 1 Another example of “generated image 2” above), where the object from image 4 is pasted onto the background from image 5.

[0085] For G inp , we use a neural network consisting of two residual blocks connected sequentially (see Figure 4 ). We also conducted experiments with ShiftNet

[27] . Figure 4 Depicted is the architecture of the ResNet neural network used as "Inpainting Network" and "Segmentation Network". Ellipses represent data; rectangles - layers of the neural network. The overall architecture is present in the left part of the figure. The right part of the figure contains a more detailed description of the blocks used in the left part. The arrows represent the data flow (i.e., the output of one block is fed as input to another block). Conv2d represents a convolutional layer; BatchNorm2d represents a batch normalization layer; ReLU - Rectification Linear Unit; ReflectionPad - padding pixels with reflections; ConvTranspose2d - deconvolutional layer.

[0086] The exchange network aims to transform two original images (x= <O,B x >, with different backgrounds B y of ) Generate a new image

[0087] The switching network consists of two main steps: segmentation G seg and enhanced G enh (See Figure 2 ).

[0088] Segmentation network G seg Generate soft segmentation mask m=G from x seg (x). Using mask m, we can extract object O from the source image x of mask m and paste object O on B y to produce a "rough" version of the target image z = m⊙x + (1-m)⊙y; however, z is not the final result: it lacks anti-aliasing, color or brightness correction, and other improvements. Note that in the ideal case, pasting objects in a natural way may also require a more complex understanding of the target background; for example, if we want to paste a dog onto grass, we should probably put some background grass in front of the dog, hiding its paws, because in reality, its paws will not be seen behind the grass.

[0089] To solve this problem, we introduce the so-called enhanced neural network G enh , where the purpose of the enhanced neural network is to generate a rough result z = m⊙x+(1-m)⊙y ​​given the original images x and y and the segmentation mask m <O,B y >, producing a "smoother", more natural image We have experimented with augmented networks implemented in four different ways:

[0090] Black box enhancement: G enh (x,y,m) outputs the final improved image;

[0091] Mask enhancement: G enh The (x, y, m) output better separates the object O from the new background B y The new segmentation mask m' that is fitted together;

[0092] Color enhancement: G enh (x, y, m) outputs a per-pixel per-channel multiplier γ⊙z; the weights γ are normalized to be close to 1 with an additional MSE loss;

[0093] Hybrid Enhancement: G enh (x,y,m) outputs both the new mask m' and the multiplier γ⊙z;

[0094] In any case, we pass G enh (x,y,m) represents the enh The final improved image after all outputs of have been applied accordingly to z.

[0095] We use the following loss function (given by Figure 1 The switching network is trained end-to-end (shown as the rounded rectangle on FIG5 ).

[0096] Object reconstruction loss Designed to ensure consistency and training stability. is realized as a source image x=(O, B x )and The mean absolute difference between .

[0097]

[0098] in, and Right now

[0099] is the result of applying the switching network twice to x and y.

[0100] Adversarial Object Loss Aims to increase rationality. With a dedicated discriminator network D obj to achieve. It also has the function of making the segmentation mask m=G seg (x) has the side effect of maximizing the area covered by the object. We apply this loss to all images with the object: real images x and “fake” images and Again, except for the number of layers, the discriminator has the same architecture as in CycleGAN

[30] , where we have found that deeper discriminators work better. We again use the MSK loss inspired by LSGAN

[16] :

[0101] The mask consistency loss aims to make the segmentation network invariant to the background. It is implemented as m = G seg (x)(from x= <O,B x > extracted mask) with (from The average absolute distance between the extracted masks):

[0102]

[0103] The mask is basically a black and white picture of the same size as the picture from which it was extracted. The white pixels on the mask correspond to the selected area of ​​the image (in this case the pixels depicting the object) and the black pixels correspond to the background. The mean absolute distance is the modulus of the difference in pixel values ​​averaged over all pixels. The mask is re-extracted to ensure that the neural network that extracted the mask responds precisely to the shape of the object and not to the background behind the object (in other words, the mask for the same object must always be the same).

[0104] Finally, in addition to the loss functions defined above, we also use identity loss, which is a concept proposed in CycleGAN

[30] . We introduce two different instances of identity loss:

[0105] Object enhancement identification loss Enhanced Network G enh The results for real images are closer to the logo: It's G enh The average distance between (x) and x itself:

[0106]

[0107] Background identification loss Try to make sure our cutting and repairing architecture does not do anything to images that do not contain objects: For images We find the segmentation mask G seg (y), subtract the segmentation mask G from y seg (y) to obtain (1-G seg (y))⊙y, apply the repair G inp , and then minimize the average distance between the original y and the result:

[0108]

[0109] The overall SEIGAN loss function is a linear combination of all the loss functions defined above:

[0110]

[0111] The coefficients are selected based on experience.

[0112] During our experiments, we noticed several interesting effects. First, the original image x= <O,B x > and They may have different scales and aspect ratios before being merged. Rescaling them to the same shape using bilinear interpolation will introduce significant differences in the low-level textures, which will be very easy for the discriminator to identify as fake, thus preventing the GAN from converging.

[0113] The authors of

[18] faced the same problem and solved it through a special procedure they used to create training samples: they only took foreground and background regions from the same image to ensure the same scale and aspect ratio, which reduced diversity and made fewer images suitable for the training set. In our setting, this problem is solved by a separate augmentation network, so we have fewer restrictions on finding suitable training data.

[0114] Another interesting effect is the low contrast in the segmentation mask when optimizing inpainting for MAE or MSE reconstruction losses. A low contrast mask (i.e., one with m around 0.5 instead of many values ​​close to 0 or 1) causes information about the object to “leak” from the original image and facilitates reconstruction. Similar effects have been noticed by other researchers before, and have even been used for steganography in the CycleGAN architecture [4]. We first address this issue by converting the soft segmentation mask to a hard mask via simple thresholding. Later, we find that optimizing for texture loss Optimized image inpainting is a more elegant approach that produces better results than thresholding.

[0115] For the segmentation network G seg We use the architecture from CycleGAN

[30] , which is itself an adaptation of the architecture from

[10] . For better performance, we replace the ConvTranspose layer with bilinear upsampling. In addition, after the last layer of the network, we use logistic and sigmoid as activation functions.

[0116] For enhanced network G enh We use the U-net architecture

[20] due to its ability to handle high-resolution images while making small changes in the source image. This is important for our setting since we do not want to significantly change the image content in the augmentation network but only “smooth” the boundaries of the pasted image in a smarter way.

[0117] Figure 5 , the figure depicts the architecture of the U-Net neural network used as a "segmentation network" and a "thinning network". Rectangles - layers of the neural network. The overall architecture is present in the left part of the figure. The right part of the figure contains a more detailed description of the blocks used in the left part. The arrows represent the data flow (i.e., the output of one block is fed as input to another block). Conv2d represents a convolutional layer; BatchNorm2d represents a batch normalization layer; ReLU - Rectification Linear Unit; ReflectionPad - padding pixels with reflections; ConvTranspose2d - deconvolution layer.

[0118] Data preparation

[0119] The main part of our experiments is conducted on images publicly available on Flickr under a Creative Commons license. We collect initial images using the query "dog". We then use a pre-trained Faster R-CNN to detect all objects (including dogs) and all regions without any objects. We then construct two datasets { <O,B 1 >}(from the area with dogs) and {(B 2)}(areas from which there are no objects of any class). After data collection, we perform a data filtering procedure in order to obtain image regions which are free of any foreign objects.

[0120] The filtering procedure is performed as follows. First, we use Faster R-CNN

[19] (pre-trained on MSCOCO

[14] ) to detect all objects on the image. Then, we obtain the crop of the input image according to the following rule:

[0121] 1. After rescaling, the size of the object is equal to 64×64, and the final cropped size is equal to 128×128;

[0122] 2. The object is located at the center of the crop;

[0123] 3. There are no other objects that intersect with the given clipping;

[0124] 4. The source size of the cropped object is larger than 60% (by the smallest side) of the entire source image and not larger than 40% (by the longest side) of the entire source image.

[0125] The foregoing exemplary embodiments are examples and are not to be construed as limiting. Furthermore, the description of the exemplary embodiments is intended to be illustrative, rather than limiting the scope of the claims, and many alternatives, modifications and variations will be apparent to those skilled in the art.

[0126] References

[0127] [1] J A.Almahairi.S.Rajeswar,A.Sordoni,R Bachman,andA.Courville.Augmented cyclegan:Learning many-to-many mappings from unpaiddata.arXiv preprint arXiv.l802.10151.2018.

[0128] [2]K.Bousmalis.A.Iipan.P.Wohlhait.Y.Bai.M.Kelcey.M.Kalakrishnan.LDowns.J.I bar / .P.Pastor.K.Konolige.et al.Using simulation and domainadaptation to improve efficiency of deep robotic grasping.In 2018IEEEInternational Conference on Robotics and Automation(ICRA),pages 4243-4250.IEEE,2018.

[0129] [3]Y.Choi.M.Choi.M.Kim.J.-W.Ha.S.Kim.and J.Choo.Stargan:Unifiedgenerative adversarial networks for multi-domain image-to-imagetranslation.arXiv preprint.1711,2017.

[0130] [4]C.Chu.A.Zhmoginov.and M.Sandler.Cyclegan:a master ofsteganography.arXiv preprint arXiv:1712.02950,2017.

[0131] [5]M.Cordts.M.6mran.S.Ramos,T.Rehfeld,M.Enzweiler,R.Benenson.U.Franke.S.Roth,and B.Schiele.The cityscapes dataset for semanticurban scene understanding.In Proc.of the IEEE Conference on Computer Visionand Pattern Recognition(CVPR).2016.

[0132] [6]I.Goodfellow,J.Pouget-Abadie.M.Miiza,B.Xu,D.Warde-Farley.S.Ozair.A.Courville.and Y.Bengio.Generative adversarial nets.InAdvances in neural information processing systems,pages 2672-2680,2014.

[0133] [7]V.Gupta and S.Raman.Automatic trimap generation for imagematting.In Signal and Information Processing(ICon-SIP).InternationalConference on.pages 1-5.IEEE.2016.

[0134] [8]H.Huang.X.Fang.Y.Ye.S.Zhang,and P.L Rosin Prac-tical automaticbackground substitution for live video.Computational Visual Media,3(3):273-284.2017.

[0135] [9]X.Ji,J.F.Henriques,and A.Vedaldi.Invariant informationdistillation for unsupervised image segmentation and clustering.arXivpreprint arXiv:1807.06653,2018.

[0136]

[10] J.Johnson,A.Alahi,and F.Li.Perceptual losses for real-time styletransfer and super-resolution.CoRR,abs / 1603.08155,2016.

[0137]

[11] S. Kazemzadeh, V. Ordonez, M. Matten, and T. Berg.Referring game: Referring to objects in photographs of natural scenes.

[0138]

[12] A.Khoreva,R.Benenson,JHHosang,M.Hein,and B.Schiele.Simple doesit:Weakly supervised instance and semantic segmentation.In CVPR,volume 1,page3,2017.

[0139]

[13] R.Krishna,Y.Zhu,O.Groth,J.Johnson,K.Hata,J.Kravitz,S.Chen,Y.Kalantidis,L.-J.Li,DAShamma,M.Bernstein,and L Fei-Fei.Visual genome:Connecting language and vision using crowdsourced dense image annotations.2016.

[0140]

[14] T.-Y.Lin,M.Maire,S.Belongie,J.Hays,P.Perona,D.Ramanan,P.Dollar,and CLZitnick.Microsoft coco:Common objects in context.In Europeanconference on computer vision,pages 740-755.Springer,2014.

[0141]

[15] M.-Y.Liu,T.Breuel,and J.Kautz.Unsupervised image-to imagetranslation networks.In Advances in Neural Information Processing Systems,pages 700-708,2017.

[0142]

[16] X.Mao,Q.Li,H.Xie,R.Lau,Z.Wang,and S.P.Smolley.Least squaresgenerative adversarial networks,arxiv preprint.arXiv preprint ArXiv:1611.04076,2(5),2016.

[0143]

[17] B.A.Plummer,L.Wang,С.M.Cervantes,J.СCaicedo,J.Hockenmaier,andS.Lazebnik.Flickr30k entities:Collecting region-to-phrase correspondences forricher image-to-sentence models.In Proceedings of the IEEE internationalconference on computer vision,pages 2641-2649,2015.

[0144]

[18] T.Remez,J.Huang,and M.Brown.Learning to segment via cut-and-paste.arXiv preprint arXiv:1803.06414,2018.

[0145]

[19] S.Ren,K.He,R.Girshick,and J.Sun.Faster r-cnn:Towards real-timeobject detection with region proposal networks.In Advances in neuralinformation processing systems,pages 91-99,2015.

[0146]

[20] O.Ronneberger,P Fischer,and T.Brox.U-net:Convolutional networksfor biomedical image segmentation.CoRR,abs / 1505.04597,2015.

[0147]

[21] С.Rother,V.Kolmogorov,and A.Blake.Grabcut:Interactive foregroundextraction using iterated graph cuts.In ACM transactions on graphics(TOG),volume 23,pages 309-314.ACM,2004.

[0148]

[22] Т.-C.Wang,M.-Y.Liu,J.-Y.Zhu,A.Tao,J.Kautz,and B.Catanzaro.High-resolution image synthesis and semantic manipulation with conditionalgans.arXiv preprint arXiv:1711.11585,2017.

[0149]

[23] Z.Wu,R.Chang,J.Ma,C.Lu,and C.-K.Tang.Annotation-free and one-shotlearning for instance segmentation of homogeneous object clusters.arXivpreprint arXiv:1802.00383,2018.

[0150]

[24] X.Xia and B.Kulis.W-net:A deep model for fully unsupervised imagesegmentation.arXiv preprint arXiv:1711.08506,2017.

[0151]

[25] W.Xian,P.Sangkloy,J.Lu,СFang,F.Yu,and J.Hays.Texturegan:Controlling deep image synthesis with texture patches.CoRR,abs / 1706.02823,2017.

[0152]

[26] N.Xu,B.L.Price,S.Cohen,and T.S.Huang.Deep image matting.In CVPR,volume 2,page 4,2017.

[0153]

[27] Z.Yan,X.Li,M.Li,W.Zuo,and S.Shan.Shift-net:Image inpainting viadeep feature rearrangement.arXiv preprint arXiv:1801.09392,2018.

[0154]

[28] L.Yu,Z.Lin,X.Shen,J.Yang,X.Lu,M.Bansal,and T.L.Berg.Mattnet:Modular attention network for referring expression comprehension.InProceedings of the IEEE Conference on Computer Vision and Pattern Recognition(CVPR),2018.

[0155]

[29] Y.Zhang,L.Yuan,Y.Guo,Z.He,I.-A.Huang,and H.Lee.Discriminativebimodal networks for visual localization and detection with natural languagequeries.In Proceedings of the IEEE Conference on Computer Vision and PatternRecognition(CVPR),2017.

[0156]

[30] J.Zhu,T.Park,P.Isola,and A.A.Efros.Unpaired image-to-imagetranslation using cycle-consistent adversarial networks.CoRR,abs / 1703.10593,2017.

[0157]

[31] J.-Y.Zhu,R.Zhang,D.Pathak,T.Darnell,A.A.Efros,O.Wang,andE.Shechtman.Toward multimodal image-to-image translation.In Advances inNeural Information Processing Systems,pages 465-176,2017.

Claims

1. A computing system for performing automatic image processing, include: The first neural network is used to obtain the object O and the background B through the segmentation mask m. x The object O is segmented from the original image x, and the segmented object O is cut out from the image x using the mask m and pasted onto the image containing only the background B. y The rough image z is formed on the image y; A second neural network for constructing an image with the pasted segmented object O by enhancing the rough image z based on the original images x and y and the mask m An enhanced version of A third neural network for restoring an image of only the background without the removed segmented object O by inpainting the image obtained by zeroing the pixels of the image x using the mask m The first neural network, the second neural network and the third neural network are combined into a general architecture of a neural network for sequentially performing segmentation, enhancement and restoration and for simultaneous learning, wherein the general architecture of the neural network accepts an image and outputs a processed image of the same size.

2. The system according to claim 1, in, The first neural network, the second neural network and the third neural network are to create images and images And convert the image and images The generator.

3. The system according to claim 2, further comprising: include: Two neural networks,configured as discriminators that estimate the plausibility of images.

4. The system according to claim 3, in, The first discriminator is a background discriminator that attempts to distinguish between a reference true background image and an inpainted background image; The second discriminator is an object discriminator that attempts to distinguish between the reference real object O image and the augmented object O image.

5. A system as claimed in any one of claims 2 to 4, in, The first neural network and the second neural network form a switching network.

6. The system according to claim 5, in, The switching network is configured to be trained end-to-end using the loss function to construct an image with the segmented object O pasted An enhanced version of .

7. The system of claim 6, in, One of the loss functions is an object reconstruction function for ensuring consistency and training stability and is implemented as an image x and an image obtained by applying the switching network twice to image x The mean absolute difference between .

8. The system according to claim 6, in, One of the loss functions is used to increase the image The adversarial object function of the rationality, and the one loss function is implemented using a dedicated discriminator network.

9. The system according to claim 6, in, One of the loss functions is a mask consistency function for making the first neural network invariant to the background and is implemented as the mask extracted from the image x and the mask extracted from the image The average absolute distance between the extracted masks.

10. The system according to claim 6, in, One of the loss functions is an object enhancement identification function for forcing the second neural network to produce an image closer to the real image, and is an image G obtained by applying the second neural network to the image x. enh The average absolute distance between (x) and x itself.

11. The system according to claim 6, in, One of the loss functions is a background identification function that is used to ensure that the general architecture does not perform any processing on images that do not contain objects.

12. The system of claim 6, in, One of the loss functions is an overall loss function, wherein the overall loss function is a linear combination of an object reconstruction function, an adversarial object function, a mask consistency function, an object enhancement identification function, and a background identification function.

13. The system of claim 1, in, The segmentation mask m is predicted by a first neural network based on the image x.

14. A method for automatic image processing comprising the steps of: Using the first neural network, we can extract the segmentation mask m from the object O and the background B. x The object O is segmented from the original image x, and the segmented object O is cut out from the image x using the mask m and pasted onto the image containing only the background B. y The rough image z is formed on the image y; Using a second neural network, an image with the segmented object O pasted is constructed by enhancing the rough image z based on the original images x and y and the mask m An enhanced version of Using a third neural network, an image of only the background without the removed segmented object O is restored by inpainting the image obtained by zeroing the pixels of the image x using the mask m. Output images of the same size and images 15. The method of claim 14, in, The first neural network, the second neural network and the third neural network are to create images and images And convert the image and images The generator.

Citation Information

Patent Citations

  • Interactive commentary based on video-content characteristics

    WO2017112017A1

  • Facial image conversion method based on cycle generative adversarial network

    CN108182657A

  • Image processing method and apparatus thereof

    KR1020160062571A

  • Image restoration cascade

    US20150030237A1

  • Utilizing deep learning for boundary-aware image segmentation

    US20170287137A1