A face image restoration method and system based on a diffusion model

By using a diffusion model-based face image restoration method and employing the identity information of a reference face image as a guide, the problem of identity inconsistency in blind face image restoration is solved, achieving high-quality face image restoration.

CN119090778BActive Publication Date: 2026-11-24NANKAI UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411130670.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-16
Publication Date
2026-11-24
Estimated Expiration
2044-08-16

AI Technical Summary

Technical Problem

Existing technologies struggle to adaptively identify and process unknown degradation types in blind face image restoration, resulting in poor restoration outcomes and discrepancies between the restored person's identity information and the actual person's identity.

Method used

A face image restoration method based on a diffusion model is adopted. By extracting low-frequency information and using a trained diffusion model for image restoration, and combining the identity information of the person in the reference face image as a guide, it is ensured that the identity information of the person in the restored image is consistent with the real person's identity.

Benefits of technology

It significantly improves the accuracy and precision of image restoration, ensuring that the identity information of the person in the restored image is consistent with the real person's identity, and improves image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119090778B_ABST
    Figure CN119090778B_ABST
Patent Text Reader

Abstract

This invention belongs to the field of image restoration technology and provides a method and system for face image restoration based on a diffusion model. The method extracts low-frequency information from the face image to be processed; uses the extracted low-frequency information as input, and performs image restoration using a trained diffusion model. During this process, the identity information of the person in the reference face image is used as guidance to ensure that the restored face image matches the identity information of the real person. This invention utilizes a diffusion model for blind face image restoration and uses the person information in the reference face image as guidance, enabling the identity information of the person in the restored face image to be consistent with the identity information of the real person.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image restoration technology, specifically relating to a face image restoration method and system based on a diffusion model. Background Technology

[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.

[0003] Face restoration aims to recover high-quality, high-resolution images from low-quality facial images. This technology effectively repairs damage caused by image compression, noise, blurring, and other degrading factors by improving image sharpness, color, and contrast. On one hand, face restoration plays a crucial role in many downstream tasks, including video surveillance, face recognition, and face detection, because a clear facial image can significantly improve the accuracy of face recognition algorithms. On the other hand, in real-world scenarios, mobile imaging systems have significant limitations; facial photos taken at medium to long distances are often not clear enough. Upgrading mobile imaging hardware to improve image quality typically requires substantial resources. In contrast, face restoration algorithms not only effectively improve image quality but are also cost-effective and widely applicable.

[0004] In practical applications, non-blind face image restoration faces significant limitations, especially when the actual image degradation differs from the degradation model used during training, severely impairing the restoration results. This situation highlights the necessity of blind face image restoration, namely, developing a face restoration technique capable of adaptively recognizing and handling unknown degradation types.

[0005] The core objective of blind face image restoration is to recover high-resolution face images from low-quality images affected by various complex degradation factors such as noise, blur, and downsampling. This process involves adding high-frequency details to low-frequency regions of the image; the more severe the image degradation, the more details need to be added. Essentially, the process of adding details can be viewed as image generation; therefore, image restoration tasks are, to some extent, similar to image generation tasks. Blind face image restoration is also a highly ill-posed task because a degraded face image often corresponds to multiple feasible high-quality face images. Current face image restoration methods typically tend to produce mediocre solutions and cannot guarantee that the identity of the person in the restored face image matches the real person's identity. Summary of the Invention

[0006] To address the aforementioned problems, this invention proposes a face image restoration method and system based on a diffusion model. This invention utilizes a diffusion model for blind face image restoration and uses information about the person in a reference face image as a guide, enabling the restored face image to match the identity information of the person in the real face image.

[0007] According to some embodiments, the present invention adopts the following technical solution:

[0008] A face image restoration method based on a diffusion model includes the following steps:

[0009] Extract low-frequency information from the face image to be processed;

[0010] The extracted low-frequency information is used as input, and the trained diffusion model is used for image restoration. During this process, the identity information of the person in the reference face image is used as a guide to ensure that the restored face image matches the identity information of the real person.

[0011] As an alternative implementation, the following steps are also included:

[0012] Obtain the face image to be processed and the reference face image.

[0013] As an alternative implementation, the identity information of the person in the reference face image is extracted by a face recognition module and encoded into an identity information encoding vector.

[0014] As a further implementation, the identity information encoding vector is used to guide the training and recovery process of the diffusion model, so that the recovered face image remains consistent with the identity of the person in the reference face image.

[0015] As an alternative implementation, the training process of the diffusion model includes:

[0016] Build the training dataset;

[0017] Using image pairs in the training dataset as training data, the identity information encoding vector of the image pairs is extracted to guide the training of the diffusion model;

[0018] Generate a description for a reference face image, and completely invert the adjectives in the description to generate a negative prompt;

[0019] Based on the negative prompts, an image consistent with the description is generated, and a negative reference face image is obtained through face detection and cropping.

[0020] The negative reference face image is slightly degraded to avoid the attributes of the negative cue words appearing in the image generated by the diffusion model.

[0021] As a further defined implementation, the process of constructing the training dataset includes: acquiring multiple face images that meet quality requirements to form a dataset, wherein the face images cover different poses, expressions and / or shooting scenarios;

[0022] By transforming the pitch and yaw angles, multiple images of different attitudes are generated.

[0023] Each pose uses a human face image without any emotion or expression as a pose reference image;

[0024] Each image in the dataset is combined with a reference image for each pose to obtain an image pair;

[0025] Attributes are extracted from each image in each image pair, and the pose and expression attributes in the pose reference image are replaced to generate a new 3D pose image.

[0026] Calculate the identity similarity between each image in the dataset and its corresponding generated multiple images with different poses, and filter out images with an identity similarity greater than a set value;

[0027] Generate the final training dataset, which contains all images from the original dataset and the selected synthetic reference images.

[0028] As an alternative implementation method, the specific process of image restoration using the trained diffusion model includes the following steps: the diffusion model takes low-frequency information as input and gradually restores high-frequency details in the image. In each iteration, the identity information encoding vector and negative cue image are used as control signals to guide the restoration process, and finally a face image with the required clarity is generated. The identity information of the person in the restored image is consistent with the identity information of the person in the reference face image.

[0029] A face image restoration system based on a diffusion model includes:

[0030] The extraction module is configured to extract low-frequency information from the face image to be processed;

[0031] The face image restoration module is configured to take the extracted low-frequency information as input and use the trained diffusion model to restore the image. During this process, the identity information of the person in the reference face image is used as a guide to ensure that the restored face image matches the identity information of the real person.

[0032] A computer program product comprising a computer program that, when executed by a processor, implements the steps of the above-described method.

[0033] An electronic device includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, wherein the computer instructions, when executed by the processor, perform the steps in the above-described method; or store the above-described computer program product.

[0034] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0035] This invention innovatively proposes a face image restoration method based on a diffusion model. It uses the identity information of the person in the reference face image as a guide for face image restoration, which can make the identity information of the person in the restored face image consistent with the identity information of the real person, thereby improving the accuracy and precision of image restoration and significantly improving the quality of image restoration.

[0036] This invention innovatively proposes a method for constructing a training dataset that can support the training of a diffusion model. First, pitch and yaw angles are set, and various different poses are obtained through permutation and combination. Corresponding pose reference images are selected, image pairs are constructed, attributes of the images in the image pairs are extracted, and the images are replaced. Identity similarity is used to filter and synthesize reference images. The selected synthetic reference images and the original images are used together to construct the final training dataset, which can effectively increase the amount of training data while ensuring the quality of the training data.

[0037] This invention innovatively proposes a method for encoding personal identity information suitable for image restoration. It generates a detailed description of a reference face image, generates negative prompts based on the description, and then obtains a negative reference face image to increase diversity and avoid the appearance of attributes in the negative prompt words in the image generated by the diffusion model. This enables face image restoration based on the personal identity information in the reference face image as a guide by the diffusion model.

[0038] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0039] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0040] Figure 1 This is a schematic diagram of the implicit space diffusion model framework of one embodiment;

[0041] Figure 2 A schematic diagram of the overall process of one embodiment;

[0042] Figure 3This is a dataset synthesis result of one embodiment, where the left side is a re-rendered pose control image and the right side is a schematic diagram of the synthesized reference face image. Detailed Implementation

[0043] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0044] It should be noted that the following detailed description is illustrative and intended to provide further explanation of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0045] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, the singular form is intended to include the plural form as well, unless the context clearly indicates otherwise. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0046] Where there is no conflict, the embodiments and features described in this application may be combined with each other.

[0047] Example 1

[0048] A face image restoration method based on a diffusion model, such as Figure 2 As shown, it includes the following steps:

[0049] Obtain the face image to be processed and the reference face image;

[0050] Extract low-frequency information from the face image to be processed;

[0051] The extracted low-frequency information is used as input, and the trained diffusion model is used for image restoration. During this process, the identity information of the person in the reference face image is used as a guide to ensure that the restored face image matches the identity information of the real person.

[0052] Before training the diffusion model, a dataset needs to be constructed, which specifically includes:

[0053] (1) Dataset preparation:

[0054] (1-1) The FFHQ dataset was used, which contains 70,000 high-quality face images covering a variety of poses, expressions and shooting scenarios;

[0055] (1-2) Set the pitch angle to {-45°, 0°, 45°} and the yaw angle to {-45°, 0°, 45°}, and obtain 9 different attitudes by permutation and combination.

[0056] (2) Generation of pose reference image: For each pose, select a face image without any emotion or expression as the pose reference image, denoted as {ref_j|j=1,2,...,9};

[0057] (3) Synthetic image generation:

[0058] (3-1) Combine each image x in the FFHQ dataset with each pose reference image ref_j to obtain image pairs (x, ref_j);

[0059] (3-2) Using the Arc2Face method, extract attributes from images x and ref_j, and replace the pose and expression attributes in ref_j to generate a new 3D pose image r_j.

[0060] In subsequent processes, image x is used to provide information about the person's identity, and 3D pose image r_j is used to control the pose of the generated image.

[0061] (4) Composite image selection:

[0062] (4-1) Calculate the identity similarity between each image in the FFHQ dataset and its corresponding 9 generated images using the ArcFace method, and select the generated images with an identity similarity greater than 0.7, which are the synthetic reference images;

[0063] (4-2) Finally, the FFHQRef dataset is generated, which contains 70,000 FFHQ dataset images and 384,451 synthetic reference images.

[0064] In some other embodiments, based on the FFHQ dataset containing 70,000 high-quality face images, the Arc2Face method was used to synthesize the FFHQRef dataset, which meets the above properties, to compensate for the deficiencies in existing datasets. Specifically, this paper first sets the pitch angle to {-45°, 0°, -45°} and the yaw angle to {-45°, 0°, -45°}, and obtains 9 different poses by permuting and combining the pitch and yaw. Based on this pose setting, a face image without any emotion or expression is selected as a pose reference image for each pose, denoted as {refj|=1,2,...,9}. Then, these 9 pose reference images are combined with each image in the FFHQ dataset to obtain {(x,refj)|x∈FFHQ,j=1,2,...,9}. Following the Arc2Face method, the attributes of x and refj are extracted using EMOCA, denoted as:

[0065] Ec(x)→(β,θ,ψ,α,l,δ,c)Ec(refj)→(βj,θj,ψj,αj,lj,δj,cj)

[0066] Where β represents shape code, θ represents pose code, ψ represents expression code, α represents albedo code, l represents light code, δ represents detail code, and c represents camera code. Replacing the βj and δj attributes in refj with the β and δ attributes of x yields Condj = (β, θj, ψj, αj, lj, δ, cj). The 3D pose image rj can then be re-rendered using the Condj attribute set.

[0067] By combining Arc2Face and ControlNet, x is used as the input to Arc2Face to provide the person's identity information, and rj is used as the input to ControlNet to control the pose of the generated image, ultimately resulting in 630,000 generated images.

[0068] To improve the quality of the synthesized images, the ArcFace method was used to calculate the identity similarity between each image in the FFHQ dataset and its nine corresponding generated images, and generated images with an identity similarity greater than 0.7 were selected. The FFHQRef dataset ultimately contains 70,000 FFHQ dataset images and 384,451 synthetic reference images.

[0069] Once the training dataset is constructed, the diffusion model can be trained.

[0070] like Figure 1 As shown, this embodiment selects the latent space diffusion model, which is pre-trained on a large-scale dataset to accumulate rich prior knowledge.

[0071] During training, image pairs (x, ref_j) from the FFHQRef dataset are used as training data.

[0072] Extract the identity information encoding vectors of x and ref_j to guide the training of the diffusion model, so that the recovered face image is consistent with the identity of the person in the reference image.

[0073] The LLaVA model is used to generate a detailed description caption_ref for the reference face image, and the adjectives in caption_ref are completely inverted using a large language model to generate a negative prompt caption_neg;

[0074] Inputting caption_neg into the SDXL text-based image model generates an image_neg that matches the description, and through face detection and cropping, obtains the negative reference face image face_neg.

[0075] In this embodiment, images are used as negative prompts to achieve more precise control and improve image restoration quality.

[0076] Specifically, let `faceref` represent the input reference face image. First, LLaVA is used to obtain a detailed description of the reference face image, denoted as `captionref`. Then, a large language model is used to completely negate the adjectives in `captionref` to obtain `captionneg`. For example, when `captionref = ...` <a photo of an elderly man with manymustaches and wrinkles.> When, captionneg = <a photo of a young man without abeard or wrinkles.>It is a viable negative suggestion.

[0077] The captionneg is fed into the SDXL image model to obtain an imageneg that matches the description of captionneg. Then, a face detection algorithm is used to identify and crop the face region from imageneg to obtain faceneg. faceneg is a face image with completely opposite attributes to captionref. Using faceneg as a negative reference image avoids the appearance of attributes from faceneg in the image recovered by the diffusion model, making the information about the person in the recovered face image closer to faceref.

[0078] In some embodiments, training data augmentation is also involved:

[0079] The negative reference face image face_neg is slightly degraded to increase diversity and avoid the appearance of attributes from negative cue words in the images generated by the diffusion model.

[0080] In this embodiment, the CLIP image encoder can capture degradation information in the reference image to a certain extent.

[0081] In practical applications, the trained diffusion model can be used for image restoration.

[0082] Low-frequency information and high-frequency details are extracted from low-quality face images. The low-frequency information is used as input to a diffusion model, which gradually restores the high-frequency details in the image. In each iteration, the identity information encoding vector and negative cue image are used as control signals to guide the restoration process. Finally, a high-definition face image is generated, and the identity information of the person in the restored image is consistent with the identity information in the reference image. The image is rich in detail and of high quality.

[0083] To verify the effectiveness of the above embodiments, this embodiment underwent experimental verification.

[0084] First, we set up the experiment. In this embodiment, we selected the CelebA-HQ and FFHQ datasets as test datasets to compare the recovery effects of different methods.

[0085] Peak signal-to-noise ratio (PSNR), structural similarity index (SSIM), and identity similarity (IS) were used as evaluation metrics.

[0086] Comparative experiments showed that, compared with traditional Generative Adversarial Network (GAN) methods, the method of this invention significantly improved PSNR, SSIM, and IS metrics. Furthermore, the restored images exhibited superior performance in terms of facial detail, texture, and identity consistency, especially on severely degraded images.

[0087] In summary, this invention demonstrates the effectiveness of the face image restoration method based on the diffusion model, and conducts detailed experimental verification on different datasets, proving the significant advantages of the method in terms of image restoration quality and identity consistency.

[0088] Example 2

[0089] A face image restoration system based on a diffusion model includes:

[0090] The image acquisition module is configured to acquire the face image to be processed and the reference face image;

[0091] The extraction module is configured to extract low-frequency information from the face image to be processed;

[0092] The face image restoration module is configured to take the extracted low-frequency information as input and use the trained diffusion model to restore the image. During this process, the identity information of the person in the reference face image is used as a guide to ensure that the restored face image matches the identity information of the real person.

[0093] Example 3

[0094] A computer program product comprising a computer program, which, when executed by a processor, implements the steps of the method described in Embodiment 1.

[0095] Example 4

[0096] An electronic device includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, wherein the computer instructions, when executed by the processor, perform the steps in the method described in Embodiment 1;

[0097] Or it may contain the computer program product described in Embodiment 3.

[0098] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0099] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0100] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0101] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0102] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made by those skilled in the art without creative effort within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A face image restoration method based on a diffusion model, characterized in that, Includes the following steps: Extract low-frequency information from the face image to be processed; The extracted low-frequency information is used as input, and the trained diffusion model is used for image restoration. In this process, the identity information of the person in the reference face image is used as a guide to ensure that the restored face image matches the identity information of the real person. The training process of the diffusion model includes: Build the training dataset; Using image pairs in the training dataset as training data, the identity information encoding vector of the image pairs is extracted to guide the training of the diffusion model; Generate a description for a reference face image, and completely invert the adjectives in the description to generate a negative prompt; Based on the negative prompts, an image consistent with the description is generated, and a negative reference face image is obtained through face detection and cropping. A small amount of degradation processing is performed on the negative reference face image to avoid the appearance of attributes from negative prompt words in the images generated by the diffusion model; The process of constructing the training dataset includes: acquiring multiple face images that meet the quality requirements to form the dataset, wherein the face images cover different poses, expressions and / or shooting scenarios; By transforming the pitch and yaw angles, multiple images of different attitudes are generated. Each pose uses a human face image without any emotion or expression as a pose reference image; Each image in the dataset is combined with a reference image for each pose to obtain an image pair; Attributes are extracted from each image in each image pair, and the pose and expression attributes in the pose reference image are replaced to generate a new 3D pose image. Calculate the identity similarity between each image in the dataset and its corresponding generated multiple images with different poses, and filter out images with an identity similarity greater than a set value; Generate the final training dataset, which contains all images from the original dataset and the selected synthetic reference images.

2. The face image restoration method based on a diffusion model as described in claim 1, characterized in that, It also includes the following steps: Obtain the face image to be processed and the reference face image.

3. The face image restoration method based on a diffusion model as described in claim 1, characterized in that, The identity information of the person in the reference face image is extracted by the face recognition module and encoded into an identity information encoding vector.

4. The face image restoration method based on a diffusion model as described in claim 3, characterized in that, The identity information encoding vector is used to guide the training and recovery process of the diffusion model, so that the recovered face image matches the identity of the person in the reference face image.

5. The face image restoration method based on a diffusion model as described in claim 1, characterized in that, The specific process of image restoration using the trained diffusion model includes the following steps: the diffusion model takes low-frequency information as input and gradually restores high-frequency details in the image. In each iteration, the identity information encoding vector and negative cue image are used as control signals to guide the restoration process. Finally, a face image with the required clarity is generated, and the identity information of the person in the restored image is consistent with the identity information of the person in the reference face image.

6. A face image restoration system based on a diffusion model, characterized in that, include: The extraction module is configured to extract low-frequency information from the face image to be processed; The face image restoration module is configured to take the extracted low-frequency information as input and use the trained diffusion model to restore the image. In this process, the identity information of the person in the reference face image is used as a guide to ensure that the restored face image matches the identity information of the real person. The training process of the diffusion model includes: Build the training dataset; Using image pairs in the training dataset as training data, the identity information encoding vector of the image pairs is extracted to guide the training of the diffusion model; Generate a description for a reference face image, and completely invert the adjectives in the description to generate a negative prompt; Based on the negative prompts, an image consistent with the description is generated, and a negative reference face image is obtained through face detection and cropping. A small amount of degradation processing is performed on the negative reference face image to avoid the appearance of attributes from negative prompt words in the images generated by the diffusion model; The process of constructing the training dataset includes: acquiring multiple face images that meet the quality requirements to form the dataset, wherein the face images cover different poses, expressions and / or shooting scenarios; By transforming the pitch and yaw angles, multiple images of different attitudes are generated. Each pose uses a human face image without any emotion or expression as a pose reference image; Each image in the dataset is combined with a reference image for each pose to obtain an image pair; Attributes are extracted from each image in each image pair, and the pose and expression attributes in the pose reference image are replaced to generate a new 3D pose image. Calculate the identity similarity between each image in the dataset and its corresponding generated multiple images with different poses, and filter out images with an identity similarity greater than a set value; Generate the final training dataset, which contains all images from the original dataset and the selected synthetic reference images.

7. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1-5.

8. An electronic device, characterized in that, It includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, which, when executed by the processor, perform the steps of the method according to any one of claims 1-5; Or it may contain the computer program product as described in claim 7.

Citation Information

Patent Citations

  • Facial expression synthesis method and system based on pre-trained StyleGAN

    CN114581992A

  • Face image restoration method and system based on manifold constraint diffusion model

    CN118247180A