A method and system for face image restoration based on manifold constrained diffusion model

By introducing a unified framework of manifold constraint and semantic diffusion guidance into the image restoration model, the problem of insufficient fine-grained control, semantic guidance and manifold constraint capabilities of the existing technology is solved, and a higher quality and consistent image restoration effect is achieved. .

CN118247180BActive Publication Date: 2024-09-24HUAQIAO UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing image restoration methods based on diffusion generation priors have shortcomings in fine-grained control, semantic guidance and manifold constraint capabilities, especially DDPM's weak performance in these aspects.

Method used

An additional correction term based on manifold constraints and semantic diffusion are used to guide the unified framework, combined with the manifold constraint gradient term and data consistency, the reverse diffusion process of the basic diffusion model is adjusted, and the image-text alignment is performed through the visual semantic embedding model to guide Generate images.

Benefits of technology

The accuracy, authenticity and consistency of image restoration are improved, and the generated images are more diverse, refined and controllable. The manifold constraint gradient maintains the consistency of the structure and layout, improving the quality and realism of the generated images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118247180B
    Figure CN118247180B
Patent Text Reader

Abstract

The present invention is designed in the field of image restoration technology, and discloses a method and system for restoring a face image based on a manifold constrained diffusion model. The method includes the following steps: S1, making a data set and using the data set to pre-train a basic diffusion model; S2, constructing an additional correction term inspired by the manifold constraint and adding it to the basic diffusion model, constructing a semantic diffusion guidance unified framework and adding it to the basic diffusion model, and obtaining a face image restoration model; S3, inputting the face image to be restored and the guidance information into the face image restoration model to generate a restored face image. Based on the reverse generation process of the diffusion probability model (DDPM), the present invention designs an additional correction term inspired by the manifold constraint (Manifold Constrained) and introduces a semantic diffusion guidance (Semantic Diffusion Guidance) framework to control the generation process, which is used in conjunction with the previous solver to comprehensively consider the correctness, authenticity, and consistency of the restored image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image restoration, and in particular to a method and system for restoring a facial image based on a manifold constrained diffusion model. Background Art

[0002] The current image restoration methods based on diffusion generative priors can be divided into three categories: based on display modeling generative priors, based on generative adversarial networks (GANs), and based on diffusion generative priors. Among them, the methods based on display modeling generative priors use some generative models and adopt maximum likelihood estimation strategies for image restoration, including autoregressive models, variational autoencoders, and flow models. These methods have strong interpretability, but relatively weak modeling capabilities. The methods based on GAN generative priors use the generative prior capabilities of GANs for image restoration, and have good restoration and modeling capabilities, but their interpretability is poor, and the training process requires high tuning capabilities. The methods based on diffusion generative priors use the latest diffusion probability model (DDPM) for image restoration, showing strong distribution modeling capabilities. Compared with GAN, DDPM uses a simple variational inference training objective and is easy to train. Therefore, it has become one of the most popular generative prior image restoration methods, but DDPM still has shortcomings in fine-grained control, semantic guidance, manifold constraints, and control capabilities. Summary of the invention

[0003] The purpose of the present invention is to solve the problems in the prior art.

[0004] The technical solution adopted by the present invention to solve the technical problem is: to provide a method for restoring a face image based on a manifold constrained diffusion model, comprising the following steps:

[0005] S1, create a dataset and use the dataset to pre-train a basic diffusion model;

[0006] S2, constructs additional correction terms inspired by manifold constraints and adds them to the basic diffusion model, constructs a semantic diffusion guided unified framework and adds it to the basic diffusion model to obtain a face image restoration model;

[0007] S3, inputting the face image to be restored and the guiding information into the face image restoration model to output the restored face image; wherein the guiding information includes information for guiding image restoration;

[0008] In S2, an additional correction term inspired by the manifold constraint is constructed and added to the basic diffusion model, specifically:

[0009] S21, constructs the manifold constraint gradient term, expressed as:

[0010]

[0011] Among them, x i Indicates the current time step state vector generated by the face image to be restored entering the back diffusion, represents the initial estimate of the state vector, y represents the observed data, Q i is the process noise covariance matrix representing the i-th state vector, H is the observation matrix that maps the state vector to the observation space, J is the Jacobian matrix that describes the impact of the change of the state vector on the observation data, W is the weight matrix, U is the state space tangent plane, and M is the state space representing all possible state sets;

[0012] S22, the manifold constraint gradient term is combined into the gradient update step of the back diffusion of the basic diffusion model. The back diffusion combined with the manifold constraint gradient term is expressed as:

[0013]

[0014] Among them, x' i-1 represents the noise image at the current time step, s θ represents the scoring function, g(x i ) represents the diffusion term in the forward diffusion process, N represents Gaussian noise, z represents the noise sampled from Gaussian noise, and I represents the identity matrix;

[0015] S23, data consistency is combined into the projection constraint step of the back diffusion of the basic diffusion model. The back diffusion combined with data consistency is expressed as:

[0016] x i-1 =Ax' i-1 +b i ;

[0017] Among them, x i-1 represents the state vector of the previous time step generated by the face image to be restored entering the back diffusion, A represents the linear transformation matrix, b i Indicates x i-1 The vector to be corrected or adjusted;

[0018] S24, repeat S22-S23 at each time step of back diffusion;

[0019] In S2, a unified framework for guiding semantic diffusion is constructed and added to the basic diffusion model, specifically:

[0020] S31, the guidance information includes image guidance and / or text guidance. When image guidance and text guidance are input simultaneously, a visual semantic embedding model is used to perform image-text alignment, and the image guidance and text guidance are jointly embedded. The guidance information is expressed as:

[0021] F(x t,x t ',t)=E I '(x t ,t)·E I '(x t ',t);

[0022] Among them, F(x t ,x t ',t) represents the guidance information of the current time step, E I ' represents the eigenvector, x t represents the face image to be restored at the current time step, x t ' represents the noise image at the current time step, t represents the current time step;

[0023] S32, combining the guidance information and the currently generated image to calculate a gradient direction g, expressed as:

[0024]

[0025] Among them, p φ represents the probability density function under given conditions; y represents the given conditions and is used to substitute the guiding information; Indicates x t Partial guide;

[0026] S33, adjusting the currently generated image x according to the calculated gradient direction g t , expressed as:

[0027] x t +s·g→x t ;

[0028] Among them, → represents the assignment, s is a user-controllable hyperparameter used to determine the guidance strength;

[0029] S34, repeating steps S31 to S33 at each time step of back diffusion.

[0030] Preferably, the preparation of the data set in S1 specifically includes:

[0031] Select three datasets with different distribution characteristics, including the LSUN 256×256 dataset of bedroom images, the FFHQ 256×256 dataset, and the ImageNet 256×256 dataset of natural images. All three datasets contain training datasets and validation images.

[0032] Screen out those images that are not affected by blur, have correct data format and are relatively unique, and obtain a preliminary screening data set;

[0033] For the face images and natural images in the initial screening data set, data augmentation operations are performed, and the enhanced images are adjusted to images with a size of 256×256 and a channel number of 3 to form a new data set.

[0034] Preferably, the data enhancement operation includes dividing the image into blocks and then flipping each block image.

[0035] Preferably, in S1, a basic diffusion model is pre-trained using a data set, specifically including: selecting a pre-trained model, a data set, a degradation operator and an evaluation index for different restoration tasks, and training the pre-trained model using the selected data set, degradation operator and evaluation index to obtain a basic diffusion model.

[0036] Preferably, the pre-trained model is trained using the selected data set, degradation operator and evaluation index. For the face image restoration task, FFHQ 256×256 and ImageNet 256×256 data sets are selected; the ADM-based pre-trained model in the open source library is selected; the degradation operator uses a matrix to process the image; and the distance score and learning-perceived image block similarity are used as evaluation indicators.

[0037] Preferably, the pre-trained model is trained using the selected data set, degradation operator and evaluation index. For the face image colorization task, FFHQ 256×256 and LSUN 256×256 data sets are selected for verification, and a pre-trained model based on ADM in the open source library is selected; the degradation operator uses a three-channel normalization degradation operator; and the structural similarity index and learning-perceived image block similarity are used as evaluation indicators.

[0038] Preferably, the pre-trained model is trained using the selected data set, degradation operator and evaluation index. For the face CT reconstruction task, the AAPM Grand Challenge data set is selected, an ncsnpp model is trained, and the VE-SDE framework is used for training; the degradation operator uses the discretized Radon transform R to process the image; and the peak signal-to-noise ratio and the structural similarity index are used as evaluation indicators.

[0039] The present invention also provides a face image restoration system based on a manifold constrained diffusion model, comprising:

[0040] Pre-training module, which creates a data set and uses it to pre-train a basic diffusion model;

[0041] Improve the module, construct additional correction terms inspired by manifold constraints and add them to the basic diffusion model, construct a semantic diffusion guided unified framework and add it to the basic diffusion model, and obtain a face image restoration model;

[0042] An application module, inputting a face image to be restored and guiding information into a face image restoration model to output a restored face image; wherein the guiding information includes information for guiding image restoration;

[0043] The additional correction term inspired by the manifold constraint is constructed and added to the basic diffusion model, specifically:

[0044] S21, constructs the manifold constraint gradient term, expressed as:

[0045]

[0046] Among them, x i Indicates the current time step state vector generated by the face image to be restored entering the back diffusion, represents the initial estimate of the state vector, y represents the observed data, Q i is the process noise covariance matrix representing the i-th state vector, H is the observation matrix that maps the state vector to the observation space, J is the Jacobian matrix that describes the impact of the change of the state vector on the observation data, W is the weight matrix, U is the state space tangent plane, and M is the state space representing all possible state sets;

[0047] S22, the manifold constraint gradient term is combined into the gradient update step of the back diffusion of the basic diffusion model. The back diffusion combined with the manifold constraint gradient term is expressed as:

[0048]

[0049] Among them, x' i-1 represents the noise image at the current time step, s θ represents the scoring function, g(x i ) represents the diffusion term in the forward diffusion process;

[0050] S23, data consistency is combined into the projection constraint step of the back diffusion of the basic diffusion model. The back diffusion combined with data consistency is expressed as:

[0051] x i-1 =Ax' i-1 +b i ;

[0052] Among them, x i-1 represents the state vector of the previous time step generated by the face image to be restored entering the back diffusion, A represents the linear transformation matrix, b i Indicates x i-1 The vector to be corrected or adjusted;

[0053] S24, repeat S22-S23 at each time step of back diffusion;

[0054] The construction of a unified framework for guiding semantic diffusion and adding it to the basic diffusion model is as follows:

[0055] S31, the guidance information includes image guidance and / or text guidance. When image guidance and text guidance are input simultaneously, a visual semantic embedding model is used to perform image-text alignment, and the image guidance and text guidance are jointly embedded. The guidance information is expressed as:

[0056] F(x t ,x' t ,t)=E I '(x t ,t)·E I '(x t ',t);

[0057] Among them, F(x t ,x t ',t) represents the guidance information of the current time step, E I ' represents the eigenvector, x t represents the face image to be restored at the current time step, x t ' represents the noise image at the current time step, t represents the current time step;

[0058] S32, combining the guidance information and the currently generated image to calculate a gradient direction g, expressed as:

[0059]

[0060] Among them, p φ represents the probability density function under given conditions; y represents the given conditions and is used to substitute the guiding information; Indicates x t Partial guide;

[0061] S33, adjusting the currently generated image x according to the calculated gradient direction g t , expressed as:

[0062] x t +s·g→x t ;

[0063] Among them, → represents the assignment, s is a user-controllable hyperparameter used to determine the guidance strength;

[0064] S34, repeating steps S31 to S33 at each time step of back diffusion.

[0065] The present invention has the following beneficial effects:

[0066] (1) Based on the original diffusion model, an additional correction term inspired by manifold constraints and a unified framework of semantic diffusion guidance (SDG) are added. Compared with the original image restoration network based on the diffusion model, the correctness, authenticity and consistency of the restored image are comprehensively considered. Not only can consistency be guaranteed while maintaining high correctness and high authenticity, but also a reverse diffusion solution is realized.

[0067] (2) We construct a new unified framework for semantic diffusion guidance, which allows language or image guidance, or both. This guidance can effectively combine semantic information to improve the diversity and quality of generated images, making the generated images more diverse, refined, and controllable. The combination process uses the gradient of image text or image matching scores to inject guidance into the pre-trained unconditional diffusion model without retraining the diffusion model.

[0068] (3) Manifold-constrained gradients can maintain the consistency of structure and layout during image generation, improving the quality and realism of generated images. This constraint helps generate images that are more coherent and natural.

[0069] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments, but the present invention is not limited to the embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] Figure 1 A method step diagram of an embodiment of the present invention;

[0071] Figure 2 A visual schematic diagram of a manifold constrained gradient (MCG) according to an embodiment of the present invention;

[0072] Figure 3 A visual schematic diagram of semantic diffusion guidance (SDG) according to an embodiment of the present invention.

[0073] Figure 4 A flowchart of manifold constrained gradient (MCG) and semantic diffusion guidance (SDG) is added to the embodiment of the present invention;

[0074] Figure 5 4 is a system structure diagram of an embodiment of the present invention. DETAILED DESCRIPTION

[0075] See also Figure 1 FIG. 1 is a diagram showing steps of a method according to an embodiment of the present invention, comprising the following steps:

[0076] S101, create a data set and use the data set to pre-train a basic diffusion model;

[0077] S102, constructing an additional correction term inspired by the manifold constraint and adding it to the basic diffusion model, constructing a semantic diffusion guided unified framework and adding it to the basic diffusion model, and obtaining a face image restoration model;

[0078] S103, inputting the face image to be restored and the guiding information into the face image restoration model to output the restored face image; wherein the guiding information includes information for guiding image restoration.

[0079] Specifically, the step of preparing the data set in S101 is as follows:

[0080] Select three datasets with different distribution characteristics, including the LSUN 256×256 dataset of bedroom images, the FFHQ 256×256 dataset, and the ImageNet 256×256 dataset of natural images. All three datasets contain training datasets and validation images.

[0081] Screen out those images that are not affected by blur, have correct data format and are relatively unique, and obtain a preliminary screening data set;

[0082] For the face images and natural images in the initial screening data set, data augmentation operations are performed, and the enhanced images are adjusted to images with a size of 256×256 and a channel number of 3 to form a new data set.

[0083] Specifically, the data enhancement operation includes dividing the image into blocks and then flipping each block image.

[0084] Specifically, the use of a data set to pre-train a basic diffusion model in S101 specifically refers to selecting a pre-trained model, a data set, a degradation operator and an evaluation index for different restoration tasks, and training the pre-trained model using the selected data set, degradation operator and evaluation index to obtain a basic diffusion model.

[0085] Specifically, the restoration task includes a face image repair task, a face image colorization task and a face CT reconstruction task.

[0086] For the face image restoration task, the FFHQ 256×256 and ImageNet 256×256 datasets were selected; the pre-trained model based on ADM (VP-SDE) in the open source library was selected; the degradation operator used a matrix to process the image; and the distance score and learning-perceived image block similarity were used as evaluation indicators.

[0087] For the face image colorization task, the FFHQ 256×256 and LSUN 256×256 datasets were selected for verification, and the pre-trained model based on ADM (VP-SDE) in the open source library was selected; the degradation operator used the three-channel normalization degradation operator; the structural similarity index and learning-perceived image block similarity were used as evaluation indicators.

[0088] For the face CT reconstruction task, the AAPM Grand Challenge dataset was selected, an ncsnpp model was trained and trained using the VE-SDE framework; the degradation operator used the discretized Radon transform R to process the image; the peak signal-to-noise ratio and structural similarity index were used as evaluation indicators.

[0089] For details, see Figure 2 As shown, the additional correction term inspired by the manifold constraint is constructed as described in S102 and added to the basic diffusion model, specifically:

[0090] S21, constructs the manifold constraint gradient term, expressed as:

[0091]

[0092] Among them, x i Indicates the current time step state vector generated by the face image to be restored entering the back diffusion, represents the initial estimate of the state vector, y represents the observed data, Q i is the process noise covariance matrix representing the i-th state vector, H is the observation matrix that maps the state vector to the observation space, J is the Jacobian matrix that describes the impact of the change of the state vector on the observation data, W is the weight matrix, U is the state space tangent plane, and M is the state space representing all possible state sets;

[0093] S22, the manifold constraint gradient term is combined into the gradient update step of the back diffusion of the basic diffusion model. The back diffusion combined with the manifold constraint gradient term is expressed as:

[0094]

[0095] Among them, x' i-1 represents the noise image at the current time step, s θ represents the scoring function, g(x i ) represents the diffusion term in the forward diffusion process, N represents Gaussian noise, z represents the noise sampled from Gaussian noise, and I represents the identity matrix;

[0096] S23, data consistency is combined into the projection constraint step of the back diffusion of the basic diffusion model. The back diffusion combined with data consistency is expressed as:

[0097] xi-1 =Ax' i-1 +b i ;

[0098] Among them, x i-1 represents the state vector of the previous time step generated by the face image to be restored entering the back diffusion, A represents the linear transformation matrix, b i Indicates x i-1 The vector to be corrected or adjusted;

[0099] S24, repeat S22-S23 at each time step of back diffusion.

[0100] For details, see Figure 3 As shown, the semantic diffusion guidance unified framework is constructed in S102 and added to the basic diffusion model, specifically:

[0101] S31, the guidance information includes image guidance and / or text guidance. When image guidance and text guidance are input simultaneously, a visual semantic embedding model is used to perform image-text alignment, and the image guidance and text guidance are jointly embedded. The guidance information is expressed as:

[0102] F(x t ,x t ',t)=E I '(x t ,t)·E I '(x t ',t);

[0103] Among them, F(x t ,x t ',t) represents the guidance information of the current time step, E I ' represents the eigenvector, x t represents the face image to be restored at the current time step, x t ' represents the noise image at the current time step, t represents the current time step;

[0104] S32, combining the guidance information and the currently generated image to calculate a gradient direction g, expressed as:

[0105]

[0106] Among them, p φ represents the probability density function under given conditions; y represents the given conditions and is used to substitute the guiding information; Indicates x t Partial guide;

[0107] S33, adjusting the currently generated image x according to the calculated gradient direction g t , expressed as:

[0108] x t +s·g → x t

[0109] Among them, → represents the assignment, s is a user-controllable hyperparameter used to determine the guidance strength;

[0110] S34, repeat S31 to S33 at each time step of the back diffusion.

[0111] See also Figure 4 As shown, a flow chart of adding manifold constrained gradient (MCG) and semantic diffusion guidance (SDG) is provided for an embodiment of the present invention. In the iteration of reverse diffusion, each time step includes MCG and SDG, wherein SDG inputs semantic guidance conditions (i.e., guidance information).

[0112] See also Figure 5 As shown, the present invention also provides a face image restoration system based on a manifold constrained diffusion model, comprising:

[0113] A pre-training module 501, preparing a data set and using the data set to pre-train a basic diffusion model;

[0114] Improvement module 502, constructing an additional correction term inspired by manifold constraints and adding it to the basic diffusion model, constructing a semantic diffusion guided unified framework and adding it to the basic diffusion model, and obtaining a face image restoration model;

[0115] The application module 503 inputs the face image to be restored and the guiding information into the face image restoration model to output the restored face image; wherein the guiding information includes information for guiding image restoration.

[0116] It can be seen that the face image restoration method and system based on the manifold constrained diffusion model proposed in the present invention, by designing a new MCG and introducing the SDG framework, can not only achieve consistency guarantee while maintaining high correctness and high authenticity, but also realize an image restoration method in which a back diffusion solver is added with additional correction terms and semantic guidance.

[0117] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A face image restoration method based on a manifold constrained diffusion model, characterized in that: The following steps are involved: S1, create a dataset and use the dataset to pre-train a basic diffusion model; S2, constructs additional correction terms inspired by manifold constraints and adds them to the basic diffusion model, constructs a semantic diffusion guided unified framework and adds it to the basic diffusion model to obtain a face image restoration model; S3, inputting the face image to be restored and the guiding information into the face image restoration model to output the restored face image; wherein the guiding information includes information for guiding image restoration; In S2, an additional correction term inspired by the manifold constraint is constructed and added to the basic diffusion model, specifically: S21, constructs the manifold constraint gradient term, expressed as: Among them, x i Indicates the current time step state vector generated by the face image to be restored entering the back diffusion, represents the initial estimate of the state vector, y represents the observed data, Q i is the process noise covariance matrix representing the i-th state vector, H is the observation matrix that maps the state vector to the observation space, J is the Jacobian matrix that describes the impact of the change of the state vector on the observation data, W is the weight matrix, U is the state space tangent plane, and M is the state space representing all possible state sets; S22, the manifold constraint gradient term is combined into the gradient update step of the back diffusion of the basic diffusion model. The back diffusion combined with the manifold constraint gradient term is expressed as: Among them, x′ i-1 represents the noise image at the current time step, s θ represents the scoring function, g(x i ) represents the diffusion term in the forward diffusion process, N represents Gaussian noise, z represents the noise sampled from Gaussian noise, and I represents the identity matrix; S23, data consistency is combined into the projection constraint step of the back diffusion of the basic diffusion model. The back diffusion combined with data consistency is expressed as: x i-1 =Ax′ i-1 +b i ; Among them, x i-1 represents the state vector of the previous time step generated by the face image to be restored entering the back diffusion, A represents the linear transformation matrix, b i Indicates x i-1 The vector to be corrected or adjusted; S24, repeat S22-S23 at each time step of back diffusion; In S2, a unified framework for guiding semantic diffusion is constructed and added to the basic diffusion model, specifically: S31, the guidance information includes image guidance and / or text guidance. When image guidance and text guidance are input simultaneously, a visual semantic embedding model is used to perform image-text alignment, and the image guidance and text guidance are jointly embedded. The guidance information is expressed as: F(x t ,x′ t ,t)=E′ I (x t ,t)·E′ I (x′ t ,t); Among them, F(x t ,x′ t ,t) represents the guidance information of the current time step, E′ I represents the eigenvector, x t represents the face image to be restored at the current time step, x′ t represents the noise image at the current time step, and t represents the current time step; S32, combining the guidance information and the currently generated image to calculate a gradient direction g, expressed as: Among them, p φ represents the probability density function under given conditions; y represents the given conditions and is used to substitute the guiding information; Indicates x t Partial guide; S33, adjusting the currently generated image x according to the calculated gradient direction g t , expressed as: x t +s·g→x t ; Among them, → represents the assignment, s is a user-controllable hyperparameter used to determine the guidance strength; S34, repeating steps S31 to S33 at each time step of back diffusion.

2. The method for facial image restoration based on manifold constrained diffusion model according to claim 1, characterized in that: The specific data set produced in S1 is: We select three datasets with different distribution characteristics, including the LSUN 256×256 dataset of bedroom images, the FFHQ 256×256 dataset, and the ImageNet 256×256 dataset of natural images. All three datasets contain training datasets and validation images. Screen out those images that are not affected by blur, have correct data format and are relatively unique, and obtain a preliminary screening data set; For the face images and natural images in the initial screening data set, data augmentation operations are performed, and the enhanced images are adjusted to images with a size of 256×256 and a channel number of 3 to form a new data set.

3. The method for facial image restoration based on manifold constrained diffusion model according to claim 2, characterized in that: The data augmentation operation includes dividing the image into blocks and then flipping each block image.

4. The method for facial image restoration based on manifold constrained diffusion model according to claim 1, characterized in that: In S1, a basic diffusion model is pre-trained using a data set, specifically including: selecting a pre-trained model, a data set, a degradation operator and an evaluation index for different restoration tasks, and training the pre-trained model using the selected data set, degradation operator and evaluation index to obtain a basic diffusion model.

5. The method for restoring a facial image based on a manifold constrained diffusion model according to claim 4, characterized in that: The pre-trained model is trained using the selected dataset, degradation operator and evaluation index. For the face image restoration task, FFHQ 256×256 and ImageNet 256×256 datasets are selected; the ADM-based pre-trained model in the open source library is selected; the degradation operator uses a matrix to process the image; and the distance score and learning-perceived image block similarity are used as evaluation indicators.

6. The method for facial image restoration based on manifold constrained diffusion model according to claim 4, characterized in that: The pre-trained model is trained using the selected data set, degradation operator and evaluation index. For the face image colorization task, FFHQ 256×256 and LSUN 256×256 data sets are selected for verification, and the pre-trained model based on ADM in the open source library is selected; the degradation operator uses a three-channel normalization degradation operator; Structural similarity index and learning-perceptual image patch similarity are used as evaluation metrics.

7. The method for facial image restoration based on manifold constrained diffusion model according to claim 4, characterized in that: The pre-trained model is trained using the selected data set, degradation operator and evaluation index. For the face CT reconstruction task, the AAPM Grand Challenge data set is selected to train an ncsnpp model, and the VE-SDE framework is used for training; the degradation operator uses the discretized Radon transform R to process the image; the peak signal-to-noise ratio and the structural similarity index are used as evaluation indicators.

8. A face image restoration system based on a manifold constrained diffusion model, characterized in that: include: Pre-training module, which creates a data set and uses it to pre-train a basic diffusion model; Improve the module, construct additional correction terms inspired by manifold constraints and add them to the basic diffusion model, construct a semantic diffusion guided unified framework and add it to the basic diffusion model, and obtain a face image restoration model; An application module, inputting a face image to be restored and guiding information into a face image restoration model to output a restored face image; wherein the guiding information includes information for guiding image restoration; The additional correction term inspired by the manifold constraint is constructed and added to the basic diffusion model, specifically: S21, constructs the manifold constraint gradient term, expressed as: Among them, x i Indicates the current time step state vector generated by the face image to be restored entering the back diffusion, represents the initial estimate of the state vector, y represents the observed data, Q i is the process noise covariance matrix representing the i-th state vector, H is the observation matrix that maps the state vector to the observation space, J is the Jacobian matrix that describes the impact of the change of the state vector on the observation data, W is the weight matrix, U is the state space tangent plane, and M is the state space representing all possible state sets; S22, the manifold constraint gradient term is combined into the gradient update step of the back diffusion of the basic diffusion model. The back diffusion combined with the manifold constraint gradient term is expressed as: Among them, x′ i-1 represents the noise image at the current time step, s θ represents the scoring function, g(x i ) represents the diffusion term in the forward diffusion process; S23, data consistency is combined into the projection constraint step of the back diffusion of the basic diffusion model. The back diffusion combined with data consistency is expressed as: x i-1 =Ax′ i-1 +b i ; Among them, x i-1 represents the state vector of the previous time step generated by the face image to be restored entering the back diffusion, A represents the linear transformation matrix, b i Indicates x i-1 The vector to be corrected or adjusted; S24, repeat S22-S23 at each time step of back diffusion; The construction of a unified framework for guiding semantic diffusion and adding it to the basic diffusion model is as follows: S31, the guidance information includes image guidance and / or text guidance. When image guidance and text guidance are input simultaneously, a visual semantic embedding model is used to perform image-text alignment, and the image guidance and text guidance are jointly embedded. The guidance information is expressed as: F(x t ,x′ t ,t)=E′ I (x t ,t)·E′ I (x′ t ,t); Among them, F(x t ,x′ t ,t) represents the guidance information of the current time step, E′ I represents the eigenvector, x t represents the face image to be restored at the current time step, x′ t represents the noise image at the current time step, and t represents the current time step; S32, combining the guidance information and the currently generated image to calculate a gradient direction g, expressed as: Among them, p φ represents the probability density function under given conditions; y represents the given conditions and is used to substitute the guiding information; Indicates x t Partial guide; S33, adjusting the currently generated image x according to the calculated gradient direction g t , expressed as: x t +s·g→x t ; Among them, → represents the assignment, s is a user-controllable hyperparameter used to determine the guidance strength; S34, repeating steps S31 to S33 at each time step of back diffusion.