Image processing method, image synthesis model determination method, system and device

Through methods such as knowledge distillation technology and spatial transformation network, it solves the problems of high cost of clothing image synthesis and long generation cycle in the existing technology, realizes fast and low-cost clothing style replacement and efficient image generation, and satisfies merchants' demand for high-resolution images. requirements for efficiency and high efficiency.

CN114004772BActive Publication Date: 2024-10-18阿里巴巴(中国)网络技术有限公司
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202111162107.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-30
Publication Date
2024-10-18
Estimated Expiration
2041-09-30

AI Technical Summary

Technical Problem

The cost of generating simulated clothing try-on images with existing technology is high and the generation cycle is long. Moreover, the existing automatic image generation method has unrealistic effects and is difficult to meet the needs of merchants to quickly change clothing styles.

Method used

Using knowledge distillation technology, a high-precision pre-trained second image synthesis model is used to train the first image synthesis model, so that it has an accuracy and performance similar to that of the second image synthesis model. A relatively high-precision image synthesis model can be generated from two images. Good synthesis effect, and image synthesis is achieved through spatial transformation network and generative adversarial network.

Benefits of technology

It reduces the parameter amount and time delay of the image synthesis model, improves the processing efficiency and generation effect, realizes fast and low-cost clothing style replacement, and meets the needs of merchants for high resolution and high efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114004772B_ABST
    Figure CN114004772B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide an image processing method, a method for determining an image synthesis model, a system and a device. The image processing method includes: obtaining a first image and a second image in response to a user's operation; determining a first image synthesis model, wherein the first image synthesis model learns the image synthesis result of a second image synthesis model through a training process, and the second image synthesis model is a pre-trained model; inputting the first image and the second image into the first image synthesis model, outputting a synthesized image; and displaying the synthesized image. The technical solution provided by the embodiments of the present application has good synthesized image effect, low latency and good real-time performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an image processing method, a method for determining an image synthesis model, a system and a device. Background Art

[0002] When merchants promote their own clothing, the effect of using real people to show it is definitely better and more intuitive than just showing the clothing. However, merchants have many types of clothing. If a model is hired to shoot each piece of clothing, the shooting cost will be very high. Clothing types change very quickly, and reshooting after each change will increase the cost. In addition, not every merchant has the conditions to shoot with models.

[0003] There are some technologies in the prior art that allow merchants (or users) to generate images of simulated models trying on corresponding clothing through some automatic image generation means without having to find real models for shooting. However, the images generated using the prior art either take a long time to generate or the model's dressing effect is not realistic. Summary of the invention

[0004] The present application provides an image processing method, a method for determining a first image synthesis model, a system and a device that solve the above-mentioned problems or at least partially solve the above-mentioned problems.

[0005] In one embodiment of the present application, an image processing method is provided. The method comprises:

[0006] In response to a user operation, acquiring a first image and a second image;

[0007] Determine a first image synthesis model, wherein the first image synthesis model learns an image synthesis result of a second image synthesis model through a training process, and the second image synthesis model is a pre-trained model;

[0008] Inputting the first image and the second image into the trained first image synthesis model, and outputting a synthesized image;

[0009] The composite image is displayed.

[0010] In response to an image input operation by a user, acquiring a first exhibit image and a model image;

[0011] Determine a first image synthesis model, wherein the first image synthesis model learns an image synthesis result of a second image synthesis model through a training process, and the second image synthesis model is a pre-trained model;

[0012] Inputting the first exhibit image and the model image into the first image synthesis model, and outputting a synthesized image of the model displaying the first exhibit;

[0013] The composite image is displayed.

[0014] In yet another embodiment of the present application, a method for determining an image synthesis model for image processing is also provided. The method comprises:

[0015] Obtain a pre-trained second image synthesis model, a first image synthesis model to be trained, and training samples; wherein the training samples include a first sample image, at least one first feature image associated with the first sample image, a second sample image, at least one second feature image associated with the second sample image, a third sample image, and a fourth sample image; the first sample image and the second sample image are synthesized to obtain a synthesized image related to the image content of the third sample image; the fourth sample image and the third sample image are synthesized to obtain a synthesized image related to the image content of the first sample image;

[0016] Inputting the first sample image, the at least one first feature image, the second sample image, and the at least one second feature image into the second image synthesis model to synthesize the first sample image and the second sample image with reference to the at least one first feature image and the at least one second feature image to obtain a first output image;

[0017] Inputting the first output graph, the third sample graph, and the fourth sample graph into the first image synthesis model, and outputting a second output graph for knowledge distillation;

[0018] Optimizing the first image synthesis model based on the second output image and the first sample image;

[0019] The first optimized image synthesis model is used to process two input images to obtain a synthesized image.

[0020] In another embodiment of the present application, an image processing system is also provided. The image processing system comprises:

[0021] The data layer is used to interact with the database to store and retrieve data; the database stores data that can be used as training samples;

[0022] The processing layer has at least one second image synthesis model as a teacher model and at least one first image synthesis model as a student model, and is used to generate training samples according to the data set acquired by the data layer; the at least one first image synthesis model is trained respectively using the training samples and the at least one second image synthesis model to obtain at least one first image synthesis model that has learned the image synthesis result of the corresponding second image synthesis model;

[0023] An application layer, configured to receive a first image and a second image input by a user;

[0024] The processing layer is further used to synthesize the first image and the second image using at least part of the at least one first image synthesis model to obtain a synthesized image;

[0025] The application layer is further used to send the synthesized image to a client device corresponding to the user.

[0026] In another embodiment of the present application, an image processing system is also provided. The image processing system comprises:

[0027] The server is used to train at least one first image synthesis model as a student model using the training samples and at least one second image synthesis model as a teacher model, respectively, to obtain at least one first image synthesis model that has learned the image synthesis result of the corresponding second image synthesis model;

[0028] The client is used to locally deploy at least part of the at least one first image synthesis model; it is also used to obtain the first image and the second image in response to the user's operation; determine a first image synthesis model, input the first image and the second image into the first image synthesis model to output a synthesized image, and display the synthesized image.

[0029] In another embodiment of the present application, an electronic device is provided. The electronic device includes a processor and a memory, wherein:

[0030] The memory is used to store one or more computer instructions;

[0031] The processor is coupled to the memory and is used for executing the at least one or more computer instructions to implement the steps in the above method embodiments.

[0032] In another embodiment of the present application, a computer program product is provided, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the processor is enabled to implement the steps in the above method embodiments.

[0033] The technical solution provided in the embodiment of the present application uses the knowledge distillation technology to train the first image synthesis model using the second image synthesis model, so that the first image synthesis model has the accuracy and performance similar to the second image synthesis model. In this way, in the specific implementation, a model with good accuracy and performance can be selected as the second image synthesis model (in the field of knowledge distillation technology, the second image synthesis model can be called the teacher model), and the first image synthesis model is trained through the knowledge distillation process; although the initial first image synthesis model has low performance and accuracy, it has high accuracy and performance similar to the second image synthesis model through the knowledge distillation training process, so only two images are needed to perform image synthesis using the first image synthesis model, and good results can be achieved; in addition, most models with high accuracy and good performance have the problem of time delay, while the first image synthesis model in this embodiment has good accuracy and performance, and because of its small number of parameters, small time delay, and good real-time performance, when batch processing of images is required, the characteristics of high processing efficiency are more significant. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0035] Figure 1 A schematic diagram of a process flow of an image processing method provided by an embodiment of the present application is shown;

[0036] Figure 2 A schematic diagram showing the technical solution provided by an embodiment of the present application from the perspective of an application interface is shown;

[0037] Figure 3 The schematic diagram shows the principle of the space transformation network module mentioned in the image processing method provided in one embodiment of the present application;

[0038] Figure 4 A schematic diagram showing the deformation of Figure A using a spatial transformation network module is shown;

[0039] Figure 5 The schematic diagram shows the principle of the GAN module mentioned in the image processing method provided in one embodiment of the present application;

[0040] Figure 6 A schematic diagram showing the principle of an image processing method provided by an embodiment of the present application is shown;

[0041] Figure 7 A schematic diagram showing a flow chart of an image processing method provided by another embodiment of the present application is shown;

[0042] Figure 8 A schematic diagram showing the principle of training a first image synthesis model through a knowledge distillation process based on a second image synthesis model provided in an embodiment of the present application is shown;

[0043] Fig. 9 A schematic flow chart of a method for determining a first image synthesis model for image processing provided by an embodiment of the present application is shown;

[0044] Fig.10 A schematic diagram of an image processing system provided by an embodiment of the present application is shown;

[0045] Fig.11 A schematic diagram of the architecture of an image processing system provided by an embodiment of the present application from the system software architecture level is shown;

[0046] Fig.12 A schematic diagram of the structure of an image processing device provided by an embodiment of the present application is shown;

[0047] Fig.13 A schematic structural diagram of a device for determining a first image synthesis model for image processing provided by another embodiment of the present application is shown;

[0048] Fig.14 A schematic diagram of the principle structure of an electronic device provided in one embodiment of the present application is shown. DETAILED DESCRIPTION

[0049] There is a solution in the prior art that uses three-dimensional image rendering technology for generation. The solution mainly consists of two steps: generating a virtual three-dimensional model and then rendering clothing onto the three-dimensional model. The solution requires a large amount of three-dimensional information of the human body in the early stage, which requires a relatively high cost. The generation cycle in the later use stage is relatively long, and real-time generation cannot be achieved. To this end, the present application provides the following embodiments to solve the problems in the prior art, which can quickly generate a solution that can change the display effect according to changes in clothing styles.

[0050] In order to make the technical personnel in the technical field better understand the scheme of the present application, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. In some processes described in the specification, claims and the above-mentioned drawings of the present application, multiple operations appearing in a specific order are included, and these operations may not be executed or executed in parallel in the order in which they appear in this article. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different modules, models, devices, etc., do not represent the order of precedence, and do not limit "first" and "second" to different types. In addition, the following embodiments are only a part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.

[0051] Before introducing the various embodiments provided by the present application, a brief introduction is given to the scenarios to which the technical solutions provided by the embodiments of the present application are applicable. The scenarios to which the technical solutions provided by the embodiments of the present application are applicable include model changing scenes, such as Figure 2 The scene shown. For example, the technical solution provided by the embodiment of the present application can be used to provide merchants with product image synthesis services. For example, a merchant user can upload a model image (such as a previously taken photo of a model wearing clothing A) and a dress image (which can be a tiled image of a dress) through a client (such as a smart phone, desktop computer, tablet computer, etc.). Then the merchant user clicks the "Synthesis" control on the interactive interface of the client device to obtain a synthetic image of the model wearing a dress. Because the first image synthesis model used in the synthetic image is trained using knowledge distillation technology, it has higher performance and accuracy; the synthetic image has a better effect. The merchant user not only wants to promote the synthetic image on the e-commerce platform, but also wants to make it into an advertising poster for offline promotion. Since the first image synthesis model used in the synthetic image is trained using a high-resolution sample image, the synthetic image also has a higher resolution, which can meet the resolution requirements of the advertising poster, and the production of the advertising poster will have a very good effect.

[0052] In addition to changing clothes, the technical solution provided in the embodiments of the present application is also applicable to other types of goods, such as shoes, bags (handbags, school bags, luggage, etc.), scarves, hats, gloves, belts, accessories (such as bracelets, rings, necklaces, earrings, headwear, etc.), watches, and handheld electronic devices (such as mobile phones, laptops, tablets, etc.).

[0053] Among them, the training of the first image synthesis model used to process image synthesis in the present application can be the responsibility of the server. For example, the server trains the first image synthesis model, and then sends the trained first image synthesis model to the client, so that the client can locally use the first image synthesis model to synthesize the two images input by the client user. Alternatively, the training of the first image synthesis model and the synthesis of two images using the first image synthesis model are both performed by the server, and the client sends the first image and the second image input by the user to the server, and then receives the synthesized composite image fed back by the server.

[0054] Figure 1 The flowchart of the image processing method provided by an embodiment of the present application is shown. The execution subject of the method provided by this embodiment can be a client, and the client can be a smart phone, a desktop computer, a laptop computer, a tablet computer, a smart wearable device, etc., which is not limited in this embodiment. Figure 1 As shown, the method includes:

[0055] 101. In response to a user operation, acquire a first image and a second image;

[0056] 102. Determine a first image synthesis model, wherein the first image synthesis model learns an image synthesis result of a second image synthesis model through a training process, and the second image synthesis model is a pre-trained model;

[0057] 103. Input the first image and the second image into the first image synthesis model, and output a synthesized image;

[0058] 104. Display the composite image.

[0059] See also Figure 2 In the example shown, the user can Figure 2 The interactive interface displayed in the input first image and second image. The first image and the second image can be selected by the user from the gallery. The gallery can be stored locally by the execution subject of the method described in this embodiment (such as an album), or stored on other devices on the network side, which is not limited in this embodiment.

[0060] In the above 102, the accuracy and performance of the second image synthesis model are higher than those of the first image synthesis model. It should be noted here that as of the filing date of the present application, it is generally believed in the art that the performance and accuracy of a model with a larger model magnitude surpass that of a model with a smaller model magnitude. The model magnitudes of two models can be compared from multiple dimensions, such as the number of parameters in the model, the number of levels contained in the model, and the number of model input parameters. A model with a larger model magnitude has a larger number of parameters, more levels, more input parameters, etc. Therefore, in this embodiment, the model magnitude of the second image synthesis model is greater than the model magnitude of the first image synthesis model.

[0061] The first image synthesis model is obtained using knowledge distillation technology. Knowledge distillation refers to the migration of parameters between two models in deep learning, or the process of migrating information learned by a large model to a small model. The large model and the small model here are relative concepts. The two models in knowledge distillation, the one with a large number of parameters can be understood as a large model, and the one with a small number of parameters is a small model. Alternatively, the two models in knowledge distillation, the one with a large model size (such as more layers, more parameters in the model, and more input parameters) is the large model, and the one with a small model size (such as fewer layers, fewer parameters in the model, and fewer input parameters) is the small model.

[0062] Knowledge distillation is to build a lightweight small model and use the supervision information of a large model with better performance to train the small model in order to achieve better performance and accuracy. The large model is called the teacher model, and the small model is called the student model.

[0063] In the embodiment of the present application, the first image synthesis model is trained by using knowledge distillation based on the second image synthesis model. In the solution of the present application, the knowledge distillation process is further described.

[0064] The knowledge distillation process can include the following distillation methods: offline distillation, semi-supervised distillation, self-supervised distillation, etc. Among them, the offline distillation process is: train a teacher model in advance, and then use the obtained teacher model for supervised training when training the student model to achieve the purpose of distillation, and the training accuracy of this teacher should be higher than that of the student model. The larger the difference, the more obvious the distillation effect. Generally speaking, the parameters of the teacher model remain unchanged during the distillation training process to achieve the purpose of training the student model. The distillation loss function calculates the difference in the output prediction value between the teacher model and the student model, and then adds it to the student's loss as the loss of the entire training to perform gradient updates, and finally obtain a student model with higher performance and accuracy. The semi-supervised distillation process is: use the prediction information of the teacher model as a label to supervise the learning of the student model. Before training the student model, first input some unlabeled data, use the teacher network output label as supervision information, and then input it into the student model to complete the distillation process. In this way, you can use a smaller number of labeled data sets to achieve the purpose of improving model accuracy. The self-supervised distillation process is: there is no need to train a teacher model in advance, but the student model itself is trained to complete a distillation process. There are many ways to self-supervise distillation. Here is an example. For example, first train the student model, and in the last few epochs of the entire training process (1 epoch means that all samples in the training set have been trained once), use the previously trained student as a supervision model. In the remaining epochs, distill the model. The advantage of this is that there is no need to train the teacher model in advance, and you can distill while training, saving the training time of the entire distillation process.

[0065] In this embodiment, knowledge distillation technology is used. The first image synthesis model (such as the student model) can be trained by performing knowledge distillation on a high-precision second image synthesis model (such as a teacher model) to improve the accuracy of the first image synthesis model. The trained first image synthesis model can be used to perform synthesis calculations on two images. Compared with the second image synthesis model, the model magnitude of the first image synthesis model is small, and the latency of processing images using the trained first image synthesis model is small; in addition, the knowledge distillation method can also compress the input parameter amount of the second image synthesis model. The input parameter amount of the trained first image synthesis model (i.e., the first image synthesis model) is less than that of the second image synthesis model, which is convenient for users to use.

[0066] What is more outstanding is that: by adopting the technical solution provided in the embodiment of the present application, the user only needs to simply provide two images to obtain a good synthesis effect; for the user, the requirements for inputting images are low and the operation is simple; in particular, for merchants, merchant users only need to provide pictures of new products and existing model photos, and there is no need to find models for shooting, which is low-cost, convenient and fast, and the efficiency of putting products on the shelves is high.

[0067] Furthermore, the first image synthesis model described in this embodiment includes: a spatial transformation network module and an image synthesis network module. The first image synthesis model may include multiple layers, the spatial transformation network module may be a part of the multiple layers, and the image synthesis network module may be another part of the multiple layers. In addition to the layers corresponding to the spatial transformation network module and the image synthesis network module, the first image synthesis model may also include other layers, such as input layers, convolutional layers, output layers, etc., which are not specifically limited in this embodiment. Accordingly, step 103 of the method described in this embodiment, "inputting the first image and the second image into the first image synthesis model to output a synthesized image", may specifically include:

[0068] 1031. Input the first image and the second image into the spatial transformation network module, and output an intermediate image obtained by performing coordinate transformation on at least part of the pixels in the second image with reference to the first image;

[0069] 1032. Input the intermediate image and the first image into the image synthesis network module, and output the synthesized image;

[0070] The image synthesis network module and the second image synthesis model share at least some parameters. Here, the image synthesis network module and the second image synthesis model share parameters, which can be understood as: the second image synthesis model contains the same parameters as those in the image synthesis network module. Alternatively, the second image synthesis model and the image synthesis network module have the same network layer.

[0071] The above-mentioned Spatial Transformer Networks (STN) module is a module that provides spatial transformation functions. As a special network module, STN can be embedded in a certain layer of the first image synthesis model to support spatial transformation (simulation transformation, projection transformation), etc., and add rotation invariance and translation invariance to the first image synthesis model. For example, the STN module can perform posture transformation on objects in the image input to the first image synthesis model. See Figure 3 As shown, the principle structure of the STN module may include: a regression network, a network generator and a sampler. Among them:

[0072] Regression network (Localisation Network): The input original image U is subjected to several convolution operations, and then fully connected to regress 6 angle values ​​(assuming it is an affine transformation), such as a 2*3 matrix.

[0073] Grid generator: It is responsible for calculating the coordinate position of the target image V through matrix operation to correspond each position in the target image V to the coordinate position in the original image U, that is, to generate T(G).

[0074] Sampler: Samples the original image U according to the coordinate information in T(G) and copies the pixels in the original image U to the target image V.

[0075] for example Figure 4 The two figures shown, Figure A and Figure B are input into the STN module, and the STN module transforms the clothing in Figure B based on the posture of the model in Figure B to obtain Figure C. In fact, in addition to STN, GMM (Gemometric Matching Module) can also be used to implement it. GMM is an end-to-end neural network trained with pixel-wise L1 loss (a loss function that calculates the loss between the pixels of the predicted image and the target image), and can also be used to align the input clothing C with the character representation P (such as posture key point heat map, body shape mask, original image reserved area, etc.), and generate an image of clothing C suitable for the character's posture and body shape. For more detailed information about GMM, please refer to the relevant literature, which will not be repeated in this article.

[0076] In specific implementation, the image synthesis network module in this embodiment can be implemented using a generative adversarial network (GAN). The purpose of GAN is to generate data by means of adversarial games between neural networks. GAN has a strong image generation capability, which makes it widely used in image synthesis, image repair, super resolution, draft image restoration, etc. Figure 5 As shown in Figure 1, the GAN model consists of two parts: the generator and the discriminator. Figure 5 It can be observed that the input information is generated by the generator to obtain the generated image (fake), which is used as part of the input for the discriminator to judge. The other part of the input of the discriminator comes from the real image (real), so that the discriminator can judge the authenticity from the two inputs. During training, a game relationship exists between the discriminator and the generator, and their performance is significantly improved during continuous training.

[0077] In a feasible technical solution, the first image synthesis model in this embodiment can be obtained by the following steps.

[0078] Specific, combined Figure 6 As shown, the process of determining the first image synthesis model may include:

[0079] 1021. Obtain a pre-trained second image synthesis model, a first image synthesis model to be trained, and training samples.

[0080] Among them, the training samples include a first sample graph, at least one first feature graph associated with the first sample graph, a second sample graph, at least one second feature graph associated with the second sample graph, a third sample graph, and a fourth sample graph; the first sample graph and the second sample graph can be synthesized to obtain a synthesized graph related to the graph content of the third sample graph; the fourth sample graph and the third sample graph can be synthesized to obtain a synthesized graph related to the graph content of the first sample graph.

[0081] 1022. Input the first sample image, the at least one first feature image, the second sample image and the at least one second feature image into the second image synthesis model to perform synthesis processing on the first sample image and the second sample image with reference to the at least one first feature image and the at least one second feature image to obtain a first output image.

[0082] 1023. Input the first output image, the third sample image, and the fourth sample image into the first image synthesis model, and output a second output image for knowledge distillation.

[0083] 1024. Optimize the first image synthesis model based on the second output image and the first sample image.

[0084] The technical solution provided in this embodiment can be applied to image synthesis in many scenarios, such as synthesizing the face of a person in image a onto the face of a person in image b; synthesizing the clothing in image c onto the body of a person in image D; synthesizing the watch in image d onto the wrist of a person in image e; and so on, which are not limited in this embodiment.

[0085] The following is a specific example to illustrate each image in the above training sample. In order to train the first image synthesis model suitable for processing the model changing clothes scene, the selected training sample includes: the first sample image corresponding to the model showing the second exhibit, at least one first feature image associated with the first sample image, the second sample image corresponding to the third exhibit, at least one second feature image associated with the second sample image, the third sample image corresponding to the model showing the third exhibit, and the fourth sample image corresponding to the second exhibit.

[0086] The above example facilitates understanding of the above “the first sample image and the second sample image can be synthesized to obtain a synthesized image related to the image content of the third sample image; the fourth sample image and the third sample image can be synthesized to obtain a synthesized image related to the image content of the first sample image”. Here, “image content related” can be understood as: the image content in the synthesized image of the first sample image and the second sample image is the same as, similar to, or close to the image content of the third sample image, etc., and this embodiment does not limit this.

[0087] The at least one first feature map mentioned above may include but is not limited to at least one of the following: at least one segmentation map obtained by segmenting the first sample map using at least one segmentation method, and a feature point distribution map of the first sample map. The at least one second feature map includes but is not limited to at least one of the following: at least one segmentation map obtained by segmenting the second sample map using at least one segmentation method.

[0088] For example, the first sample image is a model image, and the corresponding at least one segmentation image corresponding to the model image can be used for human body detection and segmentation by at least one of the following methods, but not limited to: a template-based method, a model-based method, a parallel line-based method, an edge contour-based method, an image block-based method, etc., which is not limited in this embodiment. The feature point distribution map of the first sample image can be a human body posture key point map. The human body key point map can be obtained by detecting the person (i.e., the model) in the first sample image using a human body key point detection method. Among them, there are many human body key point detection methods. The human body detection method and the various segmentation methods mentioned above are not described in detail in this article, and other documents can be referred to. In actual implementation, in this embodiment, DensePose (human body posture recognition system) can be selected to identify human body postures in the image to generate human body posture information in the first sample image (which can be the human body posture key point map mentioned above). In order to obtain more accurate posture estimation, DensePose proposes a dense human body posture estimation method that maps each pixel to a dense posture point. The estimated dense posture is used to perform clothing area distortion and posture alignment, which provides richer posture details for posture-guided synthesis. Densepose solution contains body segmentation and mesh coordinates, which provides richer information for realistic pose-guided synthesis. Densepose solution and mesh coordinates provide dense pseudo-3D information that can be used to represent pose details.

[0089] For another example, the second sample image is a clothing image, and the at least one segmentation image corresponding to the corresponding clothing may be performed by clothing segmentation using but not limited to at least one of the following methods: an edge contour-based method, an image block-based method, and the like.

[0090] Furthermore, Figure 8As shown, the second module to be trained in this embodiment includes: a spatial transformation network module and an image synthesis network module. Specifically, the spatial transformation network module can be the STN module, GMM module, etc. mentioned above; the image synthesis network module can be a GAN module. Accordingly, the above step 1023 "input the first output image, the third sample image and the fourth sample image into the first image synthesis model, and output the second output image for knowledge distillation" is specifically:

[0091] S1, inputting the third sample image and the fourth sample image into the spatial transformation network module, and outputting a third output image after coordinate transformation of at least part of the pixels in the fourth sample image based on the third sample image;

[0092] S2. Input the first output image and the third output image into the image synthesis network module to obtain a second output image for knowledge distillation.

[0093] A more specific application scenario will be introduced below to help understand the relationship between the above sample images and a knowledge distillation method for training a first image synthesis model provided by this embodiment. For details, please refer to the embodiments below.

[0094] When the solution provided by the embodiment of the present application is actually applied, it will be found that the resolution of the images in the existing data set is relatively low, for example, only 256*192. Using low-resolution images as training samples, the resolution of the synthesized images output by the trained first image synthesis model will also be relatively low. If the low-resolution synthesized images are to be displayed for external advertising (such as made into window advertising posters or other displays), the effect will be very poor. Alternatively, when a merchant user displays the synthesized image as a product image on the merchant's e-commerce page, when the buyer wants to zoom in to see the details of the clothing, it will not be clearly displayed due to the low resolution. For this reason, the method provided in the embodiment of the present application can use the following steps to improve the resolution of the training samples used when training the second image synthesis model and using the trained second image synthesis model to train the first image synthesis model through knowledge distillation. That is, the method provided in this embodiment may also include the following steps:

[0095] 105. Get the data set;

[0096] 106. Based on the data set, determine a set of images that can be used as training samples;

[0097] 107. Process the images in the atlas to improve the resolution of the images in the atlas; wherein the processed images are used as sample images in the training samples;

[0098] 108. Analyze the processed images in the atlas to obtain at least one feature map corresponding to the image.

[0099] The data set in 105 can be obtained from some public data sets published on the Internet. A public data set is a data set that is made public by the holder of the data set for the public to read and use. In this embodiment, the selection of the public data set is not specifically limited.

[0100] In the specific implementation of the above 106, the atlas suitable for training samples can be selected according to the actual image synthesis requirements. For example, in the present embodiment, the first image synthesis model is used to synthesize the model image and the clothing image to obtain an image of the model changing into the clothing in the clothing image, then the model images, clothing images, images after changing clothes, etc. in the data set are all suitable as training samples. For another example, in the present embodiment, the first image synthesis model is used to synthesize two character images to obtain a composite image of face change, then the character images in the data set are all suitable as training samples. For another example, in the present embodiment, the first image synthesis model is used to synthesize the accessories image and the character image to obtain an image of the character wearing the accessories, then the accessories images, character images, etc. in the data set are all suitable as training samples.

[0101] In the specific implementation of the above 107, image super-resolution reconstruction means may be used to improve the image quality in the data set, that is, through software processing methods, detailed information of the image is reconstructed from the low-resolution image, thereby obtaining a higher-quality super-resolution image.

[0102] In the above steps, the image resolution can be improved by the following means:

[0103] 1. The interpolation-based super-resolution reconstruction method estimates the value of the current pixel through an algorithm based on the pixel values ​​of multiple known positions near the current pixel, thereby obtaining a higher resolution image. The interpolation-based algorithm is simple and has low computational complexity, and has a wide range of applications.

[0104] 2. Reconstruction-based super-resolution reconstruction method, which is based on the assumption that "more missing original detail features can be captured and estimated based on low-resolution images". Many super-resolution reconstruction models represented by spatial domain methods and frequency domain methods are based on this assumption.

[0105] 3. Learning-based super-resolution reconstruction method. The so-called learning-based super-resolution reconstruction method is to collect and establish a learning image material database. The algorithm can accumulate certain prior knowledge by performing a large amount of model training and image reconstruction. By adjusting certain parameter settings, it can better capture and restore the details of the original image, thereby improving the reconstruction effect. For example, the more classic one is the Super-Resolution using aGenerative Adversarial Network (SRGAN) algorithm based on generative adversarial networks. The main idea of ​​SRGAN is that the generator generates high-resolution images to approximate the real image effect through training and learning, and makes it as difficult as possible for the discriminator to determine whether the input high-resolution image comes from the original real high-resolution image or the generated high-resolution image. When the discriminator cannot distinguish the authenticity of the image, it means that the generator network has generated a high-quality high-resolution image.

[0106] For example, an image with a resolution of 256*192 obtained from an existing public dataset can be reconstructed into an image with a resolution of 512*384 using any of the above methods. Using images with a resolution of 512*384 as sample images in training samples and then using these high-resolution sample images to train the model can improve the resolution of the model output image and achieve better results.

[0107] Of course, in a specific embodiment, if there are high-resolution images, these high-resolution images can be directly selected as sample images, and there is no need to improve the image resolution through the above method.

[0108] In the above 108, the analysis of the processed images in the atlas may include the image segmentation mentioned above, the detection of key points in the image, etc., to obtain at least one feature map corresponding to the image, such as: at least one segmentation map obtained by segmenting the image using at least one segmentation method, a key point map obtained by detecting the image using a key point detection method, and so on.

[0109] Furthermore, the method provided in this embodiment may also include the following steps:

[0110] 109. In response to user feedback on the composite image, if the feedback synthesis effect does not meet the requirements, redetermine the first image synthesis model to calculate the composite image of the first image and the second image using the redetermined first image synthesis model; wherein the redetermined first image synthesis model is obtained by training the first image synthesis model through a knowledge distillation process based on the third model.

[0111] In a specific implementation, the model level of the third model may be greater than the model level of the second image synthesis model. Alternatively, the third model and the second image synthesis model have the same model level, but belong to different types of models (eg, different hierarchical structures and orders).

[0112] Alternatively, there may be more than one first image synthesis model for image processing in this embodiment. For example, different teacher models (such as the second image synthesis model and the third model mentioned above) are used in advance to train the second image synthesis model through knowledge distillation to obtain different first image synthesis models. For another example, different teacher models are used in advance to train different student models through knowledge distillation to obtain different first image synthesis models. For example, model A and model B can be used as teacher models in knowledge distillation; model a and model b can be used as student models in knowledge distillation. Model A can be used to train model a through knowledge distillation to obtain a first image synthesis model z; model B can be used to train model b through knowledge distillation to obtain a first image synthesis model x. It is also possible that when training each student model through knowledge distillation, different training sample sets can be used to suit the corresponding scene requirements. In this way, when the synthetic image effect is not satisfied, the user can reselect a first image synthesis model to regenerate the desired synthetic image. That is, the step of "determining the first image synthesis model" in the method provided in this embodiment can be specifically as follows:

[0113] In response to the user's model selection operation, a model is selected from multiple candidate models as the first image synthesis model; wherein the multiple candidate models include at least one of the following: a model obtained by training the first image synthesis model through a knowledge distillation process based on teacher models of different model levels, and a model obtained by training different student models through a knowledge distillation process based on teacher models of different model levels.

[0114] The technical solution provided by this application is described below in conjunction with specific application scenarios, such as the scenario of replacing the model's display. Figure 7 As shown, a flowchart of an image processing method provided by another embodiment of the present application is shown. The execution subject of the method provided by this embodiment may be a client, and the client may be a smart phone, a desktop computer, a laptop computer, a tablet computer, a smart wearable device, etc., which is not limited in this embodiment. Specifically, the method includes:

[0115] 201. In response to an image input operation by a user, acquiring a first exhibit image and a model image;

[0116] 202. Determine a first image synthesis model, wherein the first image synthesis model learns an image synthesis result of a second image synthesis model through a training process, and the second image synthesis model is a pre-trained model;

[0117] 203. Input the first exhibit image and the model image into the first image synthesis model, and output a synthesized image of the model displaying the first exhibit;

[0118] 204. Display the synthesized image.

[0119] The exhibits in this embodiment may be clothing, accessories, electronic products, bags (such as handbags, luggage, backpacks, etc.), shoes, hats, scarves, gloves, etc. Among them, accessories may be necklaces, watches, rings, headwear, earrings, etc., which are not limited in this embodiment.

[0120] like Figure 2 In the example shown, the user can input the first image (such as the model image) and the second image (such as the white top image) through the interactive interface. The user can see the synthesized image after clicking the "Synthesize" control on the interactive interface. For the subject (such as a mobile phone, computer, etc.) that executes the method of this embodiment, after the user inputs the first image and the second image, the first image synthesis model is first determined; then the first image and the second image are processed using the first image synthesis model to obtain a synthesized image (such as a synthesized image of a model wearing a white top).

[0121] For the corresponding model display object replacement scene of this embodiment, such as Figure 8 As shown, the method described in this embodiment can use the following steps to determine the first image synthesis model:

[0122] 2021. Obtain a pre-trained second image synthesis model, a first image synthesis model to be trained, and training samples.

[0123] Among them, the training samples include a first sample image corresponding to the second exhibit displayed by the model, at least one first feature image associated with the first sample image, a second sample image corresponding to the third exhibit, at least one second feature image associated with the second sample image, a third sample image corresponding to the third exhibit displayed by the model, and a fourth sample image corresponding to the second exhibit.

[0124] 2022. Input the first sample image, the at least one first feature image, the second sample image, and the at least one second feature image into the second image synthesis model to obtain a first output image corresponding to the model displaying the third exhibit;

[0125] 2023. Input the first output image, the third sample image, and the fourth sample image into the first image synthesis model, and output a second output image for knowledge distillation corresponding to the model displaying the second exhibit;

[0126] 2024. Optimize the first image synthesis model based on the second output image and the first sample image.

[0127] The at least one first feature map may include but is not limited to at least one of the following: at least one segmentation map obtained by segmenting the model in the first sample map using at least one segmentation method, and a distribution map of feature points of the model in the first sample map. The at least one second feature map may include but is not limited to at least one of the following: at least one segmentation map obtained by segmenting the third exhibit in the second sample map using at least one segmentation method.

[0128] Figure 8 The training process of the first image synthesis model suitable for image processing in the model changing scene is shown. The first image synthesis model includes a space transformation network module and an image synthesis network module. Figure 8 In the example shown, at least one first feature map corresponding to the first sample image may include: two segmentation maps obtained by performing body segmentation on the model in the first sample image using two segmentation methods, and a key point map representing the model's posture. Figure 8 The second image synthesis model above has more levels. The second image synthesis model has been trained and serves as a teacher model in the knowledge distillation process. The first sample image, two model body segmentation images and a model posture key point image are input into the second image synthesis model to obtain a first output image. The third sample image and the second sample image are input into the first image synthesis model, and the spatial transformation network module of the first image synthesis model is executed to obtain a third output image (i.e., a deformed clothing image suitable for the model posture). The third output image and the first output image output by the second image synthesis model are used as inputs to the image synthesis network module of the first image synthesis model, and the image synthesis network module is executed to obtain a second output image. Finally, based on the second output image and the first sample image, the knowledge distillation loss is calculated to optimize the first image synthesis model according to the knowledge distillation loss. More preferably, the parameters of the image synthesis network module are optimized according to the knowledge distillation loss.

[0129] It has been mentioned above that the second image synthesis model and the image synthesis network module share some parameters. Therefore, in the above optimization process, if the parameters shared with the second image synthesis model are optimized, the parameters in the second image synthesis model will also be optimized accordingly.

[0130] The reason for doing so in this embodiment is that it is difficult for the second image synthesis model to generate a good synthesis image in one step, so the first output image output by the second image synthesis model is used as the input of the first image synthesis model, and then the first sample image in the training sample is used as a label to calculate the loss for optimizing the first image synthesis model, which can enable the first image synthesis model to learn well.

[0131] It should be noted here that this embodiment does not limit how to calculate the knowledge distillation loss and how to use the loss to optimize the model parameters. In addition, this embodiment also does not specifically limit the selection or design (hierarchical structure) of the second image synthesis model and the first image synthesis model (spatial transformation network module and image synthesis network module). The focus of the embodiments of the present application is on the innovation of knowledge distillation, that is, the scheme of using the output of the second image synthesis model (i.e., the teacher model) as the input of the first image synthesis model for training; and the innovation of applying knowledge distillation technology to image processing (such as image synthesis) scenarios.

[0132] The above process is described in general terms as follows: first analyze the model's posture, then use the spatial transformation network module to deform the display image (such as a flat clothing image) to make it fit the model's posture in the model image; then synthesize the deformed display image with the model image to obtain a picture of the model displaying the object in the display image. The technical solutions provided in the embodiments of the present application use knowledge distillation in technology. On the one hand, the input content is greatly reduced. The trained first image synthesis model only needs to input the model image and the flat image to perform image synthesis, which greatly simplifies the application process; on the other hand, it further improves the generation effect.

[0133] Fig. 9 FIG. 1 is a flow chart of a method for determining a first image synthesis model for image processing provided by an embodiment of the present application. Fig. 9 As shown, the method includes:

[0134] 401. Obtain a pre-trained second image synthesis model, a first image synthesis model to be trained, and training samples; wherein the training samples include a first sample image, at least one first feature image associated with the first sample image, a second sample image, at least one second feature image associated with the second sample image, a third sample image, and a fourth sample image; the first sample image and the second sample image are synthesized to obtain a synthesized image related to the image content of the third sample image; the fourth sample image and the third sample image are synthesized to obtain a synthesized image related to the image content of the first sample image;

[0135] 402. Input the first sample image, the at least one first feature image, the second sample image, and the at least one second feature image into the second image synthesis model to perform synthesis processing on the first sample image and the second sample image with reference to the at least one first feature image and the at least one second feature image to obtain a first output image.

[0136] 403. Input the first output image, the third sample image, and the fourth sample image into the first image synthesis model, and output a second output image for knowledge distillation;

[0137] 404. Optimize the first image synthesis model based on the second output image and the first sample image;

[0138] The first optimized image synthesis model is used to process two input images to obtain a synthesized image.

[0139] For the contents of 401 to 402 above, please refer to the corresponding contents above and will not be repeated here.

[0140] Furthermore, the first image synthesis model includes: a spatial transformation network module and an image synthesis network module. Accordingly, the above step 403 "inputting the first output image, the third sample image and the fourth sample image into the first image synthesis model, and outputting a second output image for knowledge distillation" may include:

[0141] 4031. Input the third sample image and the fourth sample image into the space transformation network module, and output a third output image after coordinate transformation of at least part of the pixels in the fourth sample image is performed with reference to the third sample image;

[0142] 4032. Input the first output image and the third output image into the image synthesis network module to obtain a second output image for knowledge distillation.

[0143] Similarly, for the contents of 4031 to 4032 above, please refer to the corresponding contents in the above text, which will not be repeated here.

[0144] Because the technical solutions provided by the embodiments of the present application use knowledge distillation technology, the lightweight first image synthesis model can also have good performance. Therefore, in actual applications, the teacher model used in the knowledge distillation process can be trained on the server side, and after the teacher model is trained, it has better performance. Based on the trained teacher model, the learning model is trained through the knowledge distillation process. The trained student model is light in weight and can be deployed on the client, with a faster image processing rate and faster response. That is, the server is responsible for training the first image synthesis model. The trained student model is deployed to the client. Users can directly use the first image synthesis model stored locally on the client to complete image processing, which is simple and quick.

[0145] That is, an embodiment of the present application provides an image processing system. Figure 2 As shown, the image processing system includes: a server 302 and a client 301. The server 302 is used to train at least one first image synthesis model as a student model using training samples and at least one second image synthesis model as a teacher model, and obtain at least one first image synthesis model that has learned the image synthesis result of the corresponding second image synthesis model. The client 301 is used to locally deploy at least part of the at least one first image synthesis model; it is also used to obtain the first image and the second image in response to the user's operation; determine a first image synthesis model, input the first image and the second image into the first image synthesis model to output a synthesized image, and display the synthesized image.

[0146] like Figure 6 As shown, the first image synthesis model trained by the server can be deployed on the client. The client can be, but is not limited to: a desktop computer, a laptop computer, a mobile phone, a tablet computer, etc. The user can obtain and load the first image synthesis model from the server through the client request. Alternatively, the server sends the first image synthesis model to the client, and after receiving the first image synthesis model, the client automatically loads it locally or updates the first image synthesis model already existing locally.

[0147] Or, if Fig.10The image processing system shown. Another embodiment of the present application provides a system implementation scheme, namely, the server 302, which is used to use training samples and at least one second image synthesis model as a teacher model to train at least one first image synthesis model as a student model, respectively, to obtain at least one first image synthesis model that has learned the image synthesis result of the corresponding second image synthesis model; it is also used to receive the first image and the second image sent by the client, determine a first image synthesis model, input the first image and the second image into the first image synthesis model to output a synthesized image; and then feed back the synthesized image to the client 301. The client 301 is used to send the first image and the second image input by the user to the server 302 in response to the user's operation; receive the synthesized image fed back by the server 302, and display it.

[0148] The technical solution provided in this application can also be adopted as follows Fig.11 The system architecture shown is implemented. Fig.11 The system architecture shown may be deployed on a single server on the server side, a server cluster, a virtual server deployed on a server, or in the cloud, etc. Fig.11 The system architecture shown in the figure can also be deployed on a client-side computer. Fig.11 As shown, the image processing system includes: a data layer, a processing layer and an application layer. The data layer is used to interact with the database to store and obtain data; wherein the database stores data that can be used as training samples. The processing layer has at least one second image synthesis model as a teacher model and at least one first image synthesis model as a student model, which is used to generate training samples according to the data set obtained by the data layer; the at least one first image synthesis model is trained respectively using the training samples and the at least one second image synthesis model to obtain at least one first image synthesis model that has learned the image synthesis results of the corresponding second image synthesis model. Fig.11 Each model in the second image synthesis model, the second model, the third model, ... the Nth model shown in the figure can be used as a teacher model in a knowledge distillation training task, and can also be used as a student model in the next knowledge distillation training task. The application layer is used to receive the first image and the second image input by the user. The processing layer is also used to use at least part of the models in the at least one first image synthesis model to synthesize the first image and the second image to obtain a composite image. For example, one first image synthesis model is selected at a time to obtain a composite image, or multiple first image synthesis models are selected at a time to obtain multiple composite images for the user to select the most satisfactory one. In the specific implementation, the use of several first image synthesis models to participate in image processing can be determined by the user. The application layer is also used to send the composite image to the client device corresponding to the user.

[0149] The technical solutions provided by the embodiments of the present application are described below in conjunction with specific application scenarios. The technical solutions provided by the embodiments of the present application can provide merchants with product image synthesis services. For example, a merchant user can upload a model image (such as a previously taken photo of a model wearing clothing A) and a dress image (which can be a tiled image of a dress) through the client. Then the merchant user clicks the "Synthesis" control to get a synthetic image of the model wearing a dress. Because the first image synthesis model used in the synthetic image is trained using knowledge distillation technology, it has higher performance and accuracy; the synthetic image has a better effect. The merchant user not only wants to promote the synthetic image on the e-commerce platform, but also wants to make it into an advertising poster for offline promotion. Since the first image synthesis model used in the synthetic image is trained using a high-resolution sample image, the synthetic image also has a higher resolution, which can meet the resolution requirements of the advertising poster, and the production of the advertising poster will have a very good effect.

[0150] In fact, based on the technical solutions provided in the embodiments of the present application, it is also possible to provide merchants with batch processing image synthesis services. For example, there are 10 new clothing items this season, 3 of which are suitable for the temperament and posture of model x; 4 of which are suitable for the temperament and posture of model y; and 3 of which are suitable for the temperament and posture of model z. In this case, the user can upload the model image of model x and the images of the three pieces of clothing at one time, and then click the "batch processing" control. The back-end of the client device or the server device will process the model image of model x and the images of the three pieces of clothing in turn to obtain a composite image of model x wearing the three pieces of clothing. Similarly, the other pieces can also be processed in batches in this way, so that users do not need to perform multiple operations, which simplifies the operation and improves efficiency.

[0151] It can be seen that the technical solutions provided by the embodiments of the present application save the shooting costs of clothing displays, adapt to changes in clothing styles more quickly, and can change the display effects in real time according to style changes.

[0152] The above description is only combined with the scenario of model changing clothes. The technical solution provided in the embodiment of the present application can also be applied to other scenarios for users with different needs, which are not listed one by one in this article.

[0153] Fig.12 FIG. 1 is a schematic diagram showing the structure of an image processing device provided by an embodiment of the present application. Fig.12As shown, the device includes: an acquisition module 11, a determination module 12, a calculation module 13 and a display module 14. The acquisition module 11 is used to acquire the first image and the second image in response to the user's operation. The determination module 12 is used to determine the first image synthesis model, wherein the first image synthesis model learns the image synthesis result of the second image synthesis model through a training process, and the second image synthesis model is a pre-trained model. The calculation module 13 is used to input the first image and the second image into the first image synthesis model and output a synthesized image. The display module 14 is used to display the synthesized image.

[0154] Furthermore, the first calculation module 13 includes: a space transformation network module and an image synthesis network module. Accordingly, when the first image and the second image are input into the first image synthesis model to output a synthesized image, the calculation module is specifically used to:

[0155] The first image and the second image are input into the spatial transformation network module, and an intermediate image is output after coordinate transformation of at least part of the pixels in the second image is performed with reference to the first image; the intermediate image and the first image are input into the image synthesis network module, and the synthesized image is output; wherein the image synthesis network module shares at least part of the parameters with the second image synthesis model.

[0156] Furthermore, when determining the first image synthesis model, the determination module 12 is specifically used to:

[0157] Obtain a pre-trained second image synthesis model, a first image synthesis model to be trained, and training samples; wherein the training samples include a first sample image, at least one first feature image associated with the first sample image, a second sample image, at least one second feature image associated with the second sample image, a third sample image, and a fourth sample image; the first sample image and the second sample image are synthesized to obtain a synthesized image related to the image content of the third sample image; the fourth sample image and the third sample image are synthesized to obtain a synthesized image related to the image content of the first sample image;

[0158] Inputting the first sample image, the at least one first feature image, the second sample image, and the at least one second feature image into the second image synthesis model to synthesize the first sample image and the second sample image with reference to the at least one first feature image and the at least one second feature image to obtain a first output image;

[0159] Inputting the first output graph, the third sample graph, and the fourth sample graph into the first image synthesis model, and outputting a second output graph for knowledge distillation;

[0160] The first image synthesis model is optimized based on the second output image and the first sample image.

[0161] Furthermore, the at least one first feature map includes at least one of the following: at least one segmentation map obtained by segmenting the first sample map using at least one segmentation method, and a feature point distribution map of the first sample map. The at least one second feature map includes at least one of the following: at least one segmentation map obtained by segmenting the second sample map using at least one segmentation method.

[0162] Furthermore, the first image synthesis model includes but is not limited to: a spatial transformation network module and an image synthesis network module. Accordingly, when the determination module 12 inputs the first output image, the third sample image and the fourth sample image into the first image synthesis model and outputs the second output image for knowledge distillation, it is specifically used to:

[0163] Input the third sample image and the fourth sample image into the spatial transformation network module, and output a third output image after coordinate transformation of at least part of the pixels in the fourth sample image based on the third sample image;

[0164] The first output graph and the third output graph are input into the image synthesis network module to obtain a second output graph for knowledge distillation.

[0165] Furthermore, the device provided in this embodiment also includes a data preparation module. The data preparation module is used to obtain a data set; based on the data set, determine a set of images that can be used as training samples; process the images in the set of images to improve the resolution of the images in the set of images; the processed images are used as sample images in the training samples; and analyze the processed images in the set of images to obtain at least one feature map corresponding to the image.

[0166] It should be noted here that: the image processing device provided in the above embodiment can implement the technical solutions described in the above method embodiments. The specific implementation principles of the above modules or units can be found in the corresponding contents in the above method embodiments, which will not be repeated here.

[0167] Another embodiment of the present application provides an image processing device, which has the same structure as the above Fig.12The structure shown. The image processing device includes: an acquisition module, a determination module, a calculation module and a display module. The acquisition module is used to obtain a first exhibit image and a model image in response to an image input operation of a user. The determination module is used to determine a first image synthesis model, wherein the first image synthesis model learns the image synthesis result of a second image synthesis model through a training process, and the second image synthesis model is a pre-trained model. The calculation module is used to input the first exhibit image and the model image into the first image synthesis model, and output a synthesized image of the model displaying the first exhibit. The display module is used to display the synthesized image.

[0168] Furthermore, when determining the first image synthesis model, the determination module is specifically used to:

[0169] Obtain a pre-trained second image synthesis model, a first image synthesis model to be trained, and training samples; wherein the training samples include a first sample image corresponding to a second exhibit displayed by a model, at least one first feature image associated with the first sample image, a second sample image corresponding to a third exhibit, at least one second feature image associated with the second sample image, a third sample image corresponding to the third exhibit displayed by the model, and a fourth sample image corresponding to the second exhibit;

[0170] Inputting the first sample image, the at least one first feature image, the second sample image and the at least one second feature image into the second image synthesis model to obtain a first output image corresponding to the model displaying the third exhibit;

[0171] Inputting the first output image, the third sample image, and the fourth sample image into the first image synthesis model, and outputting a second output image for knowledge distillation corresponding to the model displaying the second exhibit;

[0172] The first image synthesis model is optimized based on the second output image and the first sample image.

[0173] Furthermore, the at least one first feature map includes at least one of the following: at least one segmentation map obtained by segmenting the model in the first sample map using at least one segmentation method, and a distribution map of feature points of the model in the first sample map. The at least one second feature map includes at least one of the following: at least one segmentation map obtained by segmenting the third exhibit in the second sample map using at least one segmentation method.

[0174] It should be noted here that: the image processing device provided in the above embodiment can implement the technical solutions described in the above method embodiments. The specific implementation principles of the above modules or units can be found in the corresponding contents in the above method embodiments, which will not be repeated here.

[0175] Fig.13 A structural schematic diagram of a device for determining a first image synthesis model for image processing provided by another embodiment of the present application is shown. As shown in the figure, the determination device includes: an acquisition module 21, a first calculation module 22, a second calculation module 23 and an optimization module 24. The acquisition module 21 is used to acquire a pre-trained second image synthesis model, a first image synthesis model to be trained and a training sample; wherein the training sample includes a first sample image, at least one first feature image associated with the first sample image, a second sample image, at least one second feature image associated with the second sample image, a third sample image and a fourth sample image; the first sample image and the second sample image can be synthesized to obtain a synthesized image related to the image content of the third sample image; the fourth sample image and the third sample image can be synthesized to obtain a synthesized image related to the image content of the first sample image. The first calculation module 22 is used to input the first sample image, the at least one first feature image, the second sample image and the at least one second feature image into the second image synthesis model to synthesize the first sample image and the second sample image with reference to the at least one first feature image and the at least one second feature image to obtain a first output image. The second calculation module 23 is used to input the first output image, the third sample image and the fourth sample image into the first image synthesis model, and output a second output image for knowledge distillation. The optimization module 24 is used to optimize the first image synthesis model according to the second output image and the first sample image. The optimized first image synthesis model is used to process the two input images to obtain a synthesized image.

[0176] Furthermore, the first image synthesis model includes: a spatial transformation network module and an image synthesis network module. Accordingly, when the second calculation module 23 inputs the first output image, the third sample image and the fourth sample image into the first image synthesis model and outputs the second output image for knowledge distillation, it is specifically used to:

[0177] Input the third sample image and the fourth sample image into the spatial transformation network module, and output a third output image after coordinate transformation of at least part of the pixels in the fourth sample image with reference to the third sample image;

[0178] The first output graph and the third output graph are input into the image synthesis network module to obtain a second output graph for knowledge distillation.

[0179] It should be noted here that the device for determining the first image synthesis model for image processing provided in the above embodiment can implement the technical solution described in the above corresponding method embodiment. The specific implementation principles of the above modules or units can refer to the corresponding contents in the above corresponding method embodiment, which will not be repeated here.

[0180] Fig.14 The schematic diagram of the principle structure of an electronic device provided by an embodiment of the present application is shown. The electronic device includes a processor 31 and a memory 33. The memory 33 is used to store one or more computer instructions; the processor 31 is coupled to the memory 33 and is used for the at least one or more computer instructions (such as computer instructions for implementing data storage logic) to implement:

[0181] In response to a user operation, acquiring a first image and a second image;

[0182] Determine a first image synthesis model, wherein the first image synthesis model learns an image synthesis result of a second image synthesis model through a training process, and the second image synthesis model is a pre-trained model;

[0183] Inputting the first image and the second image into the first image synthesis model, and outputting a synthesized image;

[0184] The composite image is displayed.

[0185] It should be noted that: in addition to implementing the above steps, the processor can also implement other method steps provided in the above data processing method embodiment. For details, please refer to the detailed description in the above embodiment, which will not be repeated here. The memory 33 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as a static random access memory (SRAM), an electrically erasable programmable read-only memory (EEPROM), an erasable programmable read-only memory (EPROM), a programmable read-only memory (PROM), a read-only memory (ROM), a magnetic memory, a flash memory, a magnetic disk or an optical disk.

[0186] Further, if Fig.14 As shown, the electronic device also includes: a communication component 35, a power component 32, a display 34 and other components. Fig.14 Only some components are shown schematically, which does not mean that the electronic device only includes Fig.14 Components shown.

[0187] Another embodiment of the present application provides an electronic device, whose principle structure diagram is as shown above Fig.14Specifically, the electronic device includes a processor and a memory. The memory is used to store one or more computer instructions; the processor, coupled to the memory, is used to execute the at least one or more computer instructions to implement:

[0188] In response to an image input operation by a user, acquiring a first exhibit image and a model image;

[0189] Determine a first image synthesis model, wherein the first image synthesis model learns an image synthesis result of a second image synthesis model through a training process, and the second image synthesis model is a pre-trained model;

[0190] Inputting the first exhibit image and the model image into the first image synthesis model, and outputting a synthesized image of the model displaying the first exhibit;

[0191] The composite image is displayed.

[0192] It should be noted here that: in addition to implementing the above steps, the processor can also implement other method steps provided in the above data processing method embodiment. For details, please refer to the detailed description in the above embodiment, which will not be repeated here.

[0193] Another embodiment of the present application provides an electronic device, whose principle structure diagram is as shown above Fig.14 Specifically, the electronic device includes a processor and a memory. The memory is used to store one or more computer instructions; the processor, coupled to the memory, is used to execute the at least one or more computer instructions to implement:

[0194] Obtain a pre-trained second image synthesis model, a first image synthesis model to be trained, and training samples; wherein the training samples include a first sample image, at least one first feature image associated with the first sample image, a second sample image, at least one second feature image associated with the second sample image, a third sample image, and a fourth sample image; the first sample image and the second sample image are synthesized to obtain a synthesized image related to the image content of the third sample image; the fourth sample image and the third sample image are synthesized to obtain a synthesized image related to the image content of the first sample image;

[0195] Inputting the first sample image, the at least one first feature image, the second sample image, and the at least one second feature image into the second image synthesis model to synthesize the first sample image and the second sample image with reference to the at least one first feature image and the at least one second feature image to obtain a first output image;

[0196] Inputting the first output graph, the third sample graph, and the fourth sample graph into the first image synthesis model, and outputting a second output graph for knowledge distillation;

[0197] Performing knowledge distillation using the second output graph and the first sample graph to optimize the first image synthesis model;

[0198] The first image synthesis model that has completed optimization is used as the first image synthesis model, and the first image synthesis model is used to process two input images to obtain a synthesized image.

[0199] It should be noted here that: in addition to implementing the above steps, the processor can also implement other method steps provided in the above data processing method embodiment. For details, please refer to the detailed description in the above embodiment, which will not be repeated here.

[0200] Another embodiment of the present application provides a computer program product (no corresponding figure is shown in the drawings of the specification). The computer program product includes a computer program or instructions, and when the computer program or instructions are executed by a processor, the processor is enabled to implement the steps in the above-mentioned method embodiments.

[0201] Accordingly, an embodiment of the present application further provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a computer, the method steps or functions provided in the above embodiments can be implemented.

[0202] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0203] Through the description of the above implementation modes, those skilled in the art can clearly understand that each implementation mode can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on such an understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0204] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. An image processing method, characterized in that: include: In response to a user operation, acquiring a first image and a second image; Input the first image and the second image into a trained first image synthesis model, and output a synthesized image; the first image synthesis model is obtained in the following manner: obtain a pre-trained second image synthesis model, a first image synthesis model to be trained, and a training sample; wherein the training sample includes a first sample image, at least one first feature image associated with the first sample image, a second sample image, at least one second feature image associated with the second sample image, a third sample image, and a fourth sample image; the first sample image and the second sample image can be synthesized to obtain a synthesized image related to the image content of the third sample image; the fourth sample image and the third sample image can be synthesized to obtain a synthesized image related to the image content of the first sample image; the first sample image, the at least one first feature image, the second sample image, and the at least one second feature image are input into the second image synthesis model to synthesize the first sample image and the second sample image with reference to the at least one first feature image and the at least one second feature image to obtain a first output image; the first output image, the third sample image, and the fourth sample image are input into the first image synthesis model, and a second output image for knowledge distillation is output; the first image synthesis model is optimized based on the second output image and the first sample image; The composite image is displayed.

2. The method according to claim 1, characterized in that: The first image synthesis model includes: a spatial transformation network module and an image synthesis network module, and Inputting the first image and the second image into the first image synthesis model to output a synthesized image includes: Inputting the first image and the second image into the spatial transformation network module, and outputting an intermediate image obtained by performing coordinate transformation on at least part of the pixels in the second image with reference to the first image; Input the intermediate image and the first image into the image synthesis network module, and output the synthesized image; Among them, the image synthesis network module and the second image synthesis model share at least some parameters.

3. The method according to claim 1, characterized in that: The at least one first feature map includes at least one of the following: at least one segmentation map obtained by segmenting the first sample map using at least one segmentation method, and a feature point distribution map of the first sample map; The at least one second feature map includes at least one of the following: at least one segmentation map obtained by segmenting the second sample map using at least one segmentation method.

4. The method according to claim 1, characterized in that: The first image synthesis model includes: a spatial transformation network module and an image synthesis network module, and Inputting the first output graph, the third sample graph, and the fourth sample graph into the first image synthesis model, and outputting a second output graph for knowledge distillation, comprising: Input the third sample image and the fourth sample image into the spatial transformation network module, and output a third output image after coordinate transformation of at least part of the pixels in the fourth sample image based on the third sample image; The first output graph and the third output graph are input into the image synthesis network module to obtain a second output graph for knowledge distillation.

5. The method according to claim 1, characterized in that: Also includes: Get the dataset; Based on the data set, determining a set of images that can be used as training samples; Processing the images in the atlas to improve the resolution of the images in the atlas; wherein the processed images are used as sample images in the training samples; The processed images in the atlas are analyzed to obtain at least one feature map corresponding to the image.

6. An image processing method, characterized in that: include: In response to an image input operation by a user, acquiring a first exhibit image and a model image; The first exhibit image and the model image are input into a first image synthesis model, and a synthesized image of the model displaying the first exhibit is output; the first image synthesis model is obtained in the following manner: a pre-trained second image synthesis model, a first image synthesis model to be trained, and a training sample are obtained; wherein the training sample includes a first sample graph, at least one first feature graph associated with the first sample graph, a second sample graph, at least one second feature graph associated with the second sample graph, a third sample graph, and a fourth sample graph; the first sample graph and the second sample graph are synthesized to obtain a synthesized graph related to the graph content of the third sample graph; the fourth sample graph and the third sample graph are synthesized to obtain a synthesized graph related to the graph content of the first sample graph; the first sample graph, the at least one first feature graph, the second sample graph, and the at least one second feature graph are input into the second image synthesis model to synthesize the first sample graph and the second sample graph with reference to the at least one first feature graph and the at least one second feature graph to obtain a first output graph; the first output graph, the third sample graph, and the fourth sample graph are input into the first image synthesis model, and a second output graph for knowledge distillation is output; the first image synthesis model is optimized based on the second output graph and the first sample graph; The composite image is displayed.

7. The method according to claim 6, characterized in that The at least one first feature map includes at least one of the following: at least one segmentation map obtained by segmenting the model in the first sample map using at least one segmentation method, and a distribution map of feature points of the model in the first sample map; The at least one second feature map includes at least one of the following: at least one segmentation map obtained by segmenting the third exhibit in the second sample map using at least one segmentation method.

8. A method for determining an image synthesis model for image processing, characterized in that: include: Obtain a pre-trained second image synthesis model, a first image synthesis model to be trained, and training samples; wherein the training samples include a first sample image, at least one first feature image associated with the first sample image, a second sample image, at least one second feature image associated with the second sample image, a third sample image, and a fourth sample image; the first sample image and the second sample image are synthesized to obtain a synthesized image related to the image content of the third sample image; the fourth sample image and the third sample image are synthesized to obtain a synthesized image related to the image content of the first sample image; Inputting the first sample image, the at least one first feature image, the second sample image, and the at least one second feature image into the second image synthesis model to synthesize the first sample image and the second sample image with reference to the at least one first feature image and the at least one second feature image to obtain a first output image; Inputting the first output graph, the third sample graph, and the fourth sample graph into the first image synthesis model, and outputting a second output graph for knowledge distillation; Optimizing the first image synthesis model based on the second output image and the first sample image; The first optimized image synthesis model is used to process two input images to obtain a synthesized image.

9. The method according to claim 8, characterized in that The first image synthesis model includes: a spatial transformation network module and an image synthesis network module, and Inputting the first output graph, the third sample graph, and the fourth sample graph into the first image synthesis model, and outputting a second output graph for knowledge distillation, comprising: Input the third sample image and the fourth sample image into the spatial transformation network module, and output a third output image after coordinate transformation of at least part of the pixels in the fourth sample image with reference to the third sample image; The first output graph and the third output graph are input into the image synthesis network module to obtain a second output graph for knowledge distillation.

10. An image processing system, characterized in that: include: The data layer is used to interact with the database to store and retrieve data; the database stores data that can be used as training samples; A processing layer having at least one second image synthesis model as a teacher model and at least one first image synthesis model as a student model, for generating training samples according to the data set acquired by the data layer; using the training samples and the at least one second image synthesis model to respectively train the at least one first image synthesis model to obtain at least one first image synthesis model of the image synthesis result of the corresponding second image synthesis model; using the training samples and the second image synthesis model to train the first image synthesis model, including: obtaining a pre-trained second image synthesis model, a first image synthesis model to be trained and a training sample; wherein the training sample includes a first sample image, at least one first feature map associated with the first sample image, a second sample image, at least one second feature map associated with the second sample image, a first feature map associated with the second sample image, and a second feature map associated with the second sample image. three sample images, and a fourth sample image; the first sample image and the second sample image can be synthesized to obtain a synthesized image related to the image content of the third sample image; the fourth sample image and the third sample image can be synthesized to obtain a synthesized image related to the image content of the first sample image; the first sample image, the at least one first feature image, the second sample image, and the at least one second feature image are input into the second image synthesis model to synthesize the first sample image and the second sample image with reference to the at least one first feature image and the at least one second feature image to obtain a first output image; the first output image, the third sample image, and the fourth sample image are input into the first image synthesis model to output a second output image for knowledge distillation; based on the second output image and the first sample image, the first image synthesis model is optimized; An application layer, configured to receive a first image and a second image input by a user; The processing layer is further used to synthesize the first image and the second image using at least part of the at least one first image synthesis model to obtain a synthesized image; The application layer is further used to send the synthesized image to a client device corresponding to the user.

11. An image processing system, characterized in that: include: The server is used to train at least one first image synthesis model as a student model using the training samples and at least one second image synthesis model as a teacher model, respectively, to obtain at least one first image synthesis model that has learned the image synthesis result of the corresponding second image synthesis model; The first image synthesis model is trained by using the training samples and the second image synthesis model, including: obtaining a pre-trained second image synthesis model, a first image synthesis model to be trained and training samples; wherein the training samples include a first sample image, at least one first feature image associated with the first sample image, a second sample image, at least one second feature image associated with the second sample image, a third sample image and a fourth sample image; the first sample image and the second sample image are synthesized to obtain a synthesized image related to the image content of the third sample image; the fourth sample image and the third sample image are synthesized to obtain a synthesized image related to the image content of the first sample image; the first sample image, the at least one first feature image, the second sample image and the at least one second feature image are input into the second image synthesis model to synthesize the first sample image and the second sample image with reference to the at least one first feature image and the at least one second feature image to obtain a first output image; the first output image, the third sample image and the fourth sample image are input into the first image synthesis model to output a second output image for knowledge distillation; the first image synthesis model is optimized based on the second output image and the first sample image; The client is used to locally deploy at least part of the at least one first image synthesis model; it is also used to obtain the first image and the second image in response to the user's operation; determine a first image synthesis model, input the first image and the second image into the first image synthesis model to output a synthesized image, and display the synthesized image.

12. An electronic device, characterized in that: comprising a processor and a memory, wherein: The memory is used to store one or more computer instructions; The processor, coupled to the memory, is used to execute the at least one or more computer instructions to implement the steps of the method described in any one of claims 1 to 5, or to implement the steps of the method described in claim 6 or 7, or to implement the steps of the method described in claim 8 or 9.

Citation Information

Patent Citations

  • Model compression method, image processing method and related devices

    CN111178447A

  • Image fusion method and device, computer equipment and storage medium

    CN111768507A

  • Training and reconstruction method of super-resolution reconstruction model of face image

    CN112581370A

  • Image generation method and device, computer equipment and computer readable storage medium

    CN112991494A

  • Method and device for matting model training and image matting

    CN113052868A