An image generation method and device based on AIGC

By using the AIGC-based image generation method in mobile phone shooting, the generative adversarial network model is trained to identify and repair defective areas in shooting, which solves the problem of people with closed eyes or blurred limbs in mobile phone shooting, improves photo quality and success rate, and provides A smart and convenient photography experience.

CN118175238BActive Publication Date: 2024-09-03WEIHAI KAISI INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410592132.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-14
Publication Date
2024-09-03
Estimated Expiration
2044-05-14

AI Technical Summary

Technical Problem

During the mobile phone shooting process, especially when capturing people, the dynamic characteristics of the people and the timing of shooting are difficult to grasp, and the photo quality is easily affected, resulting in quality problems such as closed eyes or blurred limbs of the people, which are difficult to effectively solve with existing technology.

Method used

Using an AIGC-based image generation method, the generative adversarial network model is trained during the photo preview stage to identify and generate corresponding repair areas, which are integrated into the original image to improve photo quality.

Benefits of technology

It has significantly improved the quality and success rate of mobile phone captures, providing users with a more intelligent and convenient photography experience, ensuring that every beautiful moment can be perfectly captured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118175238B
    Figure CN118175238B
Patent Text Reader

Abstract

This application discloses an image generation method and device based on AIGC, which completes the training of the generative adversarial network model in the photo preview stage, so that when the target camera captures the original image with defective areas, the generative adversarial network model can generate corresponding repair areas according to the characteristics of the defective areas, thereby obtaining the repaired target image. This greatly improves the quality and success rate of mobile phone capture. This application provides users with a more intelligent and convenient photo experience, ensuring that every beautiful moment can be perfectly captured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image generation method and device based on AIGC. Background Art

[0002] With the widespread popularity of smartphones and technological innovation, the camera function has become an indispensable part of mobile phone use. Mobile photography has been favored by the majority of users for its convenience and immediacy. Whether it is recording daily life, capturing beautiful moments, or sharing on social networks, mobile photography plays a vital role. Modern smartphones are not only equipped with high-resolution cameras, but also integrate a variety of camera modes and optimization algorithms, making photography easier and more effective. However, in the actual shooting process, especially when taking snapshots of people, there are still some technical challenges.

[0003] Although mobile phone photography technology continues to advance, the quality of photos is often affected when taking snapshots of people due to the dynamic characteristics of the person and the difficulty in grasping the timing of shooting. In particular, if the person closes his eyes or moves his body at the moment of pressing the shutter, the photo taken is likely to have quality problems such as the person's eyes closed or body blurred. In this case, even if the hardware configuration of the mobile phone camera is high, it is difficult to avoid such problems. Summary of the invention

[0004] The purpose of this application is to provide an AIGC-based image generation method and device, which can improve the above-mentioned problems.

[0005] In the first aspect, the present application provides an image generation method based on AIGC, which includes steps S1 to S4. Among them, S1, S2, etc. are only step identifiers, and the execution order of the method is not necessarily in the order from small to large numbers. For example, step S2 may be executed first and then step S1, and the present application does not limit this.

[0006] S1, if the preset conditions are met, storing at least N consecutive frames of the current preview images of the target camera to a temporary gallery, where N is a positive integer;

[0007] S2, in response to the shooting operation, acquiring an original image through the target camera;

[0008] S3, if a defective area is detected in the original image, a corresponding repair area is generated for the defective area in the original image by using a generative adversarial network model trained by the temporary image library;

[0009] S4, integrating the repaired area into the original image to obtain a target image.

[0010] It can be understood that this application discloses an image generation method based on AIGC, which completes the training of the generative adversarial network model in the photo preview stage, so that when the target camera captures the original image with defective areas, the generative adversarial network model can generate corresponding repair areas according to the characteristics of the defective areas, thereby obtaining the repaired target image. This greatly improves the quality and success rate of mobile phone capture. This application provides users with a more intelligent and convenient photo experience, ensuring that every beautiful moment can be perfectly captured.

[0011] In an optional embodiment of the present application, satisfying the preset condition includes at least one of the following: receiving a storage instruction triggered by a user; monitoring that a change value of the current preview image of two adjacent frames of the target camera within a preset time length is less than a first threshold.

[0012] In an optional embodiment of the present application, the change value includes: a displacement value of the character area in the current preview image.

[0013] It can be understood that this application mainly generates corresponding repair areas according to the characteristics of the defective area through artificial intelligence generated content (AIGC) technology, so as to make up for the defects of the original image. Therefore, the samples used for AIGC training should be as static as possible. In addition to the user's own judgment of static state and triggering the storage instruction, it can also be automatically monitored by the image processing method. The above-mentioned preset duration and the first threshold value can be set according to the experience of technicians in this field. The purpose is to identify whether the object photographed by the target camera is in a static state for a certain period of time, such as group photos, posed photos and other scenes.

[0014] In an optional embodiment of the present application, the following steps are also included: S5, if it is detected that there is no defective area in the original image, all data in the temporary image library are deleted.

[0015] It is understandable that the purpose of this application is to compensate for the defects of the original image. If the original image captured by the target camera does not have a defective area, the preview image previously stored in the temporary gallery can no longer play a training role. In order to save memory space and keep the content of the temporary gallery simple, all data in the temporary gallery can be deleted immediately when it is detected that there is no defective area in the original image.

[0016] In an optional embodiment of the present application, S2 further includes: in response to a shooting operation, if the number of picture frames currently stored in the temporary gallery is greater than or equal to N frames, the original image is acquired through the target camera.

[0017] It is understandable that since it takes time to establish a temporary gallery, the shooting operation can only be performed under the condition that the temporary gallery is established. If the number of picture frames stored in the current temporary gallery is greater than or equal to N frames, it means that the basic requirements of the temporary gallery have been met, and the temporary gallery has been successfully established, so the shooting instruction can be executed in response to the shooting operation input by the user. If the number of picture frames stored in the current temporary gallery is less than N frames, it means that the number of picture frames in the temporary gallery does not meet the requirements for training the subsequent generative adversarial network model, and the temporary gallery has not been successfully established. At this time, if a shooting operation input by the user is received, relevant prompts can be given through devices such as displays, indicator lights, and speakers.

[0018] In an optional embodiment of the present application, the generative adversarial network model includes a feature extractor, a generator and a discriminator; the feature extractor is used to extract image features of an input image; the generator is used to generate a regional reconstructed image based on the image features extracted by the feature extractor; and the discriminator is used to make a true or false judgment on the regional reconstructed image based on the regional image.

[0019] It can be understood that training the generative adversarial network by using at least N frames of current preview images is beneficial for the generator therein to continuously adjust so as to generate a more realistic regional reconstructed image.

[0020] In an optional embodiment of the present application, the defect area includes at least one of the following: a defect area where a person's face is squinting; a defect area where a person's limbs are blurred.

[0021] It can be understood that in response to the shooting operation, the original image is acquired through the target camera. If the original image contains blurred limbs or squinting of the person, it is regarded as a shooting effect that the user does not want to obtain, among which the squinting face area and blurred limb area are defective areas.

[0022] In an optional embodiment of the present application, when training the generative adversarial network model through the temporary gallery, the input image of the generative adversarial network model includes at least one of the following: an eye area image of the preview screen stored in the temporary gallery; a limb area image of the preview screen stored in the temporary gallery.

[0023] It can be understood that the training of the generative adversarial network model by the temporary image library can be performed after the defective area in the original image is identified. Therefore, the generative adversarial network model can be trained specifically through the regional image, which can greatly reduce the computing power requirements of the terminal device and improve shooting efficiency.

[0024] In an optional embodiment of the present application, S3 includes: if a defective area is detected in the original image, image features of the defective area are extracted by the feature extractor, and then a corresponding repair area is generated according to the image features by the generator.

[0025] In a second aspect, the present application discloses an AIGC-based image generation device, comprising a processor, an input device, an output device, and a memory, wherein the processor, input device, output device, and memory are interconnected, wherein the memory is used to store a computer program, and the computer program includes program instructions, and the processor is configured to call the program instructions to execute a method as described in any one of the first aspects.

[0026] In a third aspect, the present application discloses a computer-readable storage medium, wherein the computer storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor executes the method as described in any one of the first aspects.

[0027] Beneficial effects: This application discloses an image generation method and device based on AIGC, which completes the training of the generative adversarial network model in the photo preview stage, so that when the target camera captures the original image with defective areas, the generative adversarial network model can generate corresponding repair areas according to the characteristics of the defective areas, thereby obtaining the repaired target image. This greatly improves the quality and success rate of mobile phone capture. This application provides users with a more intelligent and convenient photo experience, ensuring that every beautiful moment can be perfectly captured.

[0028] In order to make the above-mentioned objects, features and advantages of the present application more obvious and understandable, optional embodiments are specifically listed below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0030] Figure 1 It is a flowchart of an image generation method based on AIGC provided by the present application;

[0031] Figure 2 It is a schematic diagram of the training principle of the generative adversarial network model provided in this application;

[0032] Figure 3 yes Figure 2Schematic diagram of the working process of the generative adversarial network model to generate repair areas. DETAILED DESCRIPTION

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

[0034] First, as Figure 1 As shown, the present application provides an AIGC-based image generation method, which includes steps S1 to S4. Among them, S1, S2, etc. are only step identifiers, and the execution order of the method is not necessarily in the order of numbers from small to large. For example, step S2 may be executed first and then step S1, and the present application does not limit this.

[0035] S1, if the preset conditions are met, storing at least N consecutive frames of the current preview images of the target camera into a temporary gallery, where N is a positive integer.

[0036] In an optional embodiment of the present application, satisfying the preset condition includes at least one of the following: receiving a storage instruction triggered by a user; monitoring that the change value of the current preview image of two adjacent frames of the target camera within a preset time period is less than a first threshold. The change value includes: the displacement value of the character area in the current preview image.

[0037] It can be understood that this application mainly generates corresponding repair areas according to the characteristics of the defective area through artificial intelligence generated content (AIGC) technology, so as to make up for the defects of the original image. Therefore, the samples used for AIGC training should be as static as possible. In addition to the user's own judgment of static state and triggering the storage instruction, it can also be automatically monitored by the image processing method. The above-mentioned preset duration and the first threshold value can be set according to the experience of technicians in this field. The purpose is to identify whether the object photographed by the target camera is in a static state for a certain period of time, such as group photos, posed photos and other scenes.

[0038] S2, in response to the shooting operation, acquiring an original image through a target camera.

[0039] In an optional embodiment of the present application, S2 also includes: in response to the shooting operation, if the number of picture frames stored in the current temporary gallery is greater than or equal to N frames, the original image is acquired through the target camera.

[0040] It is understandable that since it takes time to establish a temporary gallery, the shooting operation can only be performed under the condition that the temporary gallery is established. If the number of picture frames stored in the current temporary gallery is greater than or equal to N frames, it means that the basic requirements of the temporary gallery have been met, and the temporary gallery has been successfully established, so the shooting instruction can be executed in response to the shooting operation input by the user. If the number of picture frames stored in the current temporary gallery is less than N frames, it means that the number of picture frames in the temporary gallery does not meet the requirements for training the subsequent generative adversarial network model, and the temporary gallery has not been successfully established. At this time, if a shooting operation input by the user is received, relevant prompts can be given through devices such as displays, indicator lights, and speakers.

[0041] S3, if a defective area is detected in the original image, a corresponding repair area is generated for the defective area in the original image through a generative adversarial network model trained with a temporary image library.

[0042] In an optional embodiment of the present application, the following steps are also included: S5, if it is detected that there is no defective area in the original image, all data in the temporary image library are deleted.

[0043] It is understandable that the purpose of this application is to compensate for the defects of the original image. If the original image captured by the target camera does not have a defective area, the preview image previously stored in the temporary gallery can no longer play a training role. In order to save memory space and keep the content of the temporary gallery simple, all data in the temporary gallery can be deleted immediately when it is detected that there is no defective area in the original image.

[0044] S4, integrates the repaired area into the original image to obtain the target image.

[0045] It can be understood that this application discloses an image generation method based on AIGC, which completes the training of the generative adversarial network model in the photo preview stage, so that when the target camera captures the original image with defective areas, the generative adversarial network model can generate corresponding repair areas according to the characteristics of the defective areas, thereby obtaining the repaired target image. This greatly improves the quality and success rate of mobile phone capture. This application provides users with a more intelligent and convenient photo experience, ensuring that every beautiful moment can be perfectly captured.

[0046] In an optional embodiment of the present application, if Figure 2 As shown, the generative adversarial network model includes a feature extractor 101, a generator 102 and a discriminator 103; the feature extractor 101 is used to extract image features of an input image; the generator 102 is used to generate a regional reconstructed image according to the image features extracted by the feature extractor; the discriminator 103 is used to judge whether the regional reconstructed image is true or false based on the regional image.

[0047] It can be understood that training the generative adversarial network by using at least N frames of current preview images is beneficial for the generator therein to continuously adjust so as to generate a more realistic regional reconstructed image.

[0048] The above-mentioned generative adversarial network is a self-mapping supervised cyclic generative adversarial network, and its total loss is: ;

[0049] in, is the function corresponding to the generator, is the function corresponding to the discriminator, To combat losses, is the self-mapping test loss, is the weight of the self-mapping test loss.

[0050] The adversarial loss of the self-mapping supervised recurrent generative adversarial network consists of:

[0051] ;

[0052] in, represents the image features of the input image extracted by the feature extractor, represents the region image containing the image features in the input image extracted by the second extractor, Expressing hope;

[0053] The self-mapping test loss of the self-mapping supervised cycle generation adversarial network satisfies the following formula:

[0054] .

[0055] In an optional embodiment of the present application, the defect area includes at least one of the following: a defect area where a person's face is squinting; a defect area where a person's limbs are blurred.

[0056] It can be understood that in response to the shooting operation, the original image is acquired through the target camera. If the original image contains blurred limbs or squinting of the person, it is regarded as a shooting effect that the user does not want to obtain, among which the squinting face area and blurred limb area are defective areas.

[0057] In an optional embodiment of the present application, when training a generative adversarial network model through a temporary gallery, the input image of the generative adversarial network model includes at least one of the following: an eye area image of the preview screen stored in the temporary gallery; a limb area image of the preview screen stored in the temporary gallery.

[0058] It can be understood that the training of the generative adversarial network model by the temporary image library can be performed after the defective area in the original image is identified. Therefore, the generative adversarial network model can be trained specifically through the regional image, which can greatly reduce the computing power requirements of the terminal device and improve shooting efficiency.

[0059] Take the case of identifying the defective area of ​​​​the face squinting in the original image as an example. Figure 2 The figure shows a training process, firstly extracting the eye area image of the preview screen in the temporary gallery; then extracting the image features of each eye area image, such as the corner of the eye, the eyeliner contour, the end of the eye, etc., through the feature extractor 101, so that the generator 102 can generate the eye area image in the open state as the regional reconstructed image according to the image features; finally, the discriminator judges the authenticity of the regional reconstructed image according to the eye area image.

[0060] In an optional embodiment of the present application, S3 includes: if a defective area is detected in the original image, the image features of the defective area are extracted by a feature extractor, and then a corresponding repair area is generated according to the image features by a generator.

[0061] like Figure 3 As shown, after identifying the defective area in the original image, the defective area is extracted to the feature extractor 101 to extract image features, so that the generator 102 generates a corresponding repair area according to the image features, and finally the repair area and the original image are fused to obtain the target image expected by the user.

[0062] In a second aspect, the present application provides an image generation device based on AIGC. The image generation device based on AIGC includes one or more processors; one or more input devices, one or more output devices and a memory. The processor, input device, output device and memory are connected via a bus. The memory is used to store a computer program, which includes program instructions, and the processor is used to execute the program instructions stored in the memory. The processor is configured to call the program instructions to perform the operation of any method of the first aspect:

[0063] It should be understood that in the embodiments of the present invention, the processor referred to may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0064] Input devices may include a touchpad, a fingerprint sensor (for collecting the user's fingerprint information and fingerprint direction information), a microphone, etc., and output devices may include a display (LCD, etc.), a speaker, etc.

[0065] The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.

[0066] In a specific implementation, the processor, input device, and output device described in the embodiments of the present invention may execute the implementation method described in any method of the first aspect, or may execute the implementation method of the terminal device described in the embodiments of the present invention, which will not be repeated here.

[0067] In a third aspect, the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the steps of any method of the first aspect are implemented.

[0068] The computer-readable storage medium may be an internal storage unit of the terminal device of any of the aforementioned embodiments, such as a hard disk or memory of the terminal device. The computer-readable storage medium may also be an external storage device of the terminal device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal device. Furthermore, the computer-readable storage medium may also include both an internal storage unit of the terminal device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the terminal device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.

[0069] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0070] In the several embodiments provided in the present application, it should be understood that the disclosed terminal device and method can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or it can be an electrical, mechanical or other form of connection.

[0071] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of the present invention.

[0072] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0073] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0074] The above description is only an optional embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above invention concept. For example, the above features are replaced with the technical features with similar functions disclosed in this application (but not limited to) by each other.

[0075] The above description is only an optional embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. An image generation method based on AIGC, characterized in that: The following steps are involved: S1, if the preset conditions are met, storing at least N consecutive frames of the current preview images of the target camera to a temporary gallery, where N is a positive integer; S2, in response to the shooting operation, acquiring an original image through the target camera; S3, if a defective area is detected in the original image, a corresponding repair area is generated for the defective area in the original image by using a generative adversarial network model trained by the temporary image library; S4, integrating the repaired area into the original image to obtain a target image; The satisfying of the preset condition includes: monitoring that the change value of the current preview image of two adjacent frames of the target camera within the preset time length is less than a first threshold; the change value includes: the displacement value of the character area in the current preview image; The generative adversarial network model includes a feature extractor, a generator and a discriminator; the feature extractor is used to extract image features of an input image; the generator is used to generate a regional reconstructed image according to the image features extracted by the feature extractor; the discriminator is used to judge the authenticity of the regional reconstructed image according to the regional image; The defective area includes at least one of the following: The defective area of ​​​​the squinting face; The defective areas where the characters’ limbs are blurred; When the generative adversarial network model is trained by the temporary image library, the input image of the generative adversarial network model includes at least one of the following: The eye area image of the preview picture stored in the temporary gallery; The limb area image of the preview screen stored in the temporary gallery; The S3 includes: if a defective area is detected in the original image, the image features of the defective area are extracted by the feature extractor, and then the corresponding repair area is generated by the generator according to the image features.

2. The AIGC-based image generation method according to claim 1, characterized in that: The following steps are also included: S5: If it is detected that there is no defective area in the original image, all data in the temporary image library are deleted.

3. The AIGC-based image generation method according to claim 2, characterized in that: The S2 also includes: in response to the shooting operation, if the number of picture frames currently stored in the temporary gallery is greater than or equal to N frames, acquiring the original image through the target camera.

4. An image generation device based on AIGC, characterized in that: The method comprises a processor, an input device, an output device and a memory, wherein the processor, the input device, the output device and the memory are interconnected, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 3.