Search

CN-122023194-A - Image restoration method, device, computer equipment and readable storage medium

CN122023194ACN 122023194 ACN122023194 ACN 122023194ACN-122023194-A

Abstract

The application relates to an image restoration method, an image restoration device, computer equipment and a readable storage medium. The method comprises the steps of obtaining an image to be repaired, downsampling the image to be repaired to obtain a downsampled image, determining a first degradation characteristic through a first target degradation sensing module in a target image repair model based on the downsampled image, determining a first repair image through a first target repair network in the target image repair model based on the first degradation characteristic and the downsampled image, and determining a target repair image through a second target repair network in the target image repair model based on the first repair image. By adopting the method, the restoration effect of the high-resolution image can be improved.

Inventors

  • HAN HAOTIAN
  • CHEN XING
  • LI PIANZHEN
  • LIU LUOQI

Assignees

  • 厦门美图之家科技有限公司

Dates

Publication Date
20260512
Application Date
20260114

Claims (12)

  1. 1. An image restoration method, comprising: Acquiring an image to be repaired; downsampling the image to be repaired to obtain a downsampled image; determining, based on the downsampled image, a first degradation feature by a first target degradation perception module in a target image restoration model; determining a first repair image based on the first degradation feature and the downsampled image, through a first target repair network in the target image repair model; and determining a target repair image through a second target repair network in the target image repair model based on the first repair image.
  2. 2. The method of claim 1, wherein the determining a target repair image based on the first repair image through a second target repair network in the target image repair model comprises: Upsampling the first repair image to obtain an upsampled image; And determining a target repair image through a second target repair network in the target image repair model based on the image to be repaired and the up-sampled image.
  3. 3. The method according to claim 1, wherein the method further comprises: Acquiring first training data, wherein the first training data comprises at least two training images and at least two tag images, and the at least two training images correspond to the at least two tag images one by one; downsampling a first training image to obtain a first downsampled training image, wherein the at least two training images comprise the first training image; determining, by a first target degradation perception module in a first initial image restoration model, a second degradation feature based on the first downsampled training image; Determining a second repair image through a first target repair network in the first initial image repair model based on the first downsampled training image and the second degradation feature; Determining a third repair image based on the second repair image and the first training image through a second initial repair network in the first initial image repair model; Determining a first loss based on the third repair image and a first label image, wherein the first label image is a label image corresponding to the first training image in the at least two label images; And adjusting network parameters of a second initial repair network in the first initial image repair model based on the first loss until a training ending condition is met, so as to obtain a second initial image repair model, wherein the second initial image repair model comprises the second target repair network.
  4. 4. The method according to claim 1, wherein the method further comprises: Acquiring second training data, wherein the second training data comprises at least two training image pairs, and the quality of one image in the training image pairs is larger than that of the other image; Determining, by a second degradation perception module, a third degradation characteristic from a first training image pair, the at least two training image pairs comprising the first training image pair; Determining a fourth degradation characteristic through a first initial degradation sensing module in a third initial image restoration model according to a second training image, wherein the second training image is an image with low quality in the first training image pair; determining a fourth repair image through a first initial repair network in the third initial image repair model according to the fourth degradation characteristic and the second training image; determining a second loss based on the third degradation feature, the fourth repair image, and a third training image, the third training image being one of the first training image with a high centering; and adjusting network parameters of the first initial degradation sensing module and the first initial restoration network based on the second loss until a training ending condition is met, so as to obtain a fourth initial image restoration model, wherein the fourth initial image restoration model comprises the first target restoration network and the first target degradation sensing module.
  5. 5. The method of claim 4, wherein the determining a second loss based on the third degradation feature, the fourth repair image, and the third training image comprises: Determining a third loss based on the third degradation characteristic and the fourth degradation characteristic; Determining a fourth loss based on the fourth repair image and a third training image; a second loss is determined based on the third loss and the fourth loss.
  6. 6. The method according to claim 1, wherein the method further comprises: and determining a motion blur removal repair image through a target motion blur removal module in the target image repair model based on the target repair image.
  7. 7. The method of claim 6, wherein the method further comprises: acquiring third training data, wherein the third training data comprises at least two training images and at least two tag images, and the at least two training images correspond to the at least two tag images one by one; downsampling a fourth training image to obtain a second downsampled training image, wherein the at least two training images comprise the fourth training image; Determining, by a first target degradation perception module in a fifth initial image restoration model, fifth degradation features based on the second downsampled training images, the at least two training images including the fourth training image; Determining a fifth repair image through a first target repair network in the fifth initial image repair model based on the fifth degradation feature and the second downsampled training image; determining a sixth restoration image based on the fifth restoration image through an initial motion blur removal module in the fifth initial image restoration model; Determining a fifth loss based on the sixth repair image and a second label image, wherein the second label image is a label image corresponding to the fourth training image in the at least two label images; And adjusting network parameters of an initial motion blur removal module in the fifth initial image restoration model based on the fifth loss until a training ending condition is met, so as to obtain a sixth initial image restoration model, wherein the sixth initial image restoration model comprises the target motion blur removal module.
  8. 8. The method according to claim 1, wherein the method further comprises: And determining a refined repair image through a target refined module in the target image repair model based on the target repair image.
  9. 9. The method of claim 8, wherein the method further comprises: Acquiring fourth training data, wherein the fourth training data comprises at least two training images and at least two tag images, and the at least two training images and the at least two tag images are in one-to-one correspondence; downsampling a fifth training image to obtain a third downsampled training image, wherein the at least two training images include the fifth training image; Determining, by a first target degradation perception module in a seventh initial image restoration model, a sixth degradation feature based on the third downsampled training image, the at least two training images including the fifth training image; determining a seventh repair image through a first target repair network in the seventh initial image repair model based on the sixth degradation feature and the third downsampled training image; Determining, based on the seventh repair image, an eighth repair image by an initial refinement module in the seventh initial image repair model; determining a sixth loss based on the eighth repair image and a third label image, wherein the third label image is a label image corresponding to the fifth training image in the at least two label images; And adjusting network parameters of an initial finishing module in the seventh initial image restoration model based on the sixth loss until a training ending condition is met, so as to obtain an eighth initial image restoration model, wherein the eighth initial image restoration model comprises the target finishing module.
  10. 10. An image restoration device, the device comprising: The acquisition module is used for acquiring the image to be repaired; The downsampling module is used for downsampling the image to be repaired to obtain a downsampled image; The first determining module is used for determining a first degradation characteristic through a first target degradation sensing module in a target image restoration model based on the downsampled image; A second determining module configured to determine a first repair image through a first target repair network in the target image repair model based on the first degradation feature and the downsampled image; And the third determining module is used for determining a target repair image through a second target repair network in the target image repair model based on the first repair image.
  11. 11. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the steps of the method of any one of claims 1 to 9 when the computer program is executed.
  12. 12. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the method of any of claims 1 to 9.

Description

Image restoration method, device, computer equipment and readable storage medium Technical Field The present application relates to the field of image processing technologies, and in particular, to an image restoration method, an image restoration device, a computer device, and a readable storage medium. Background In the field of picture restoration, super Resolution refers to a technique of recovering a High-Resolution image (HR) from a Low-Resolution image (LR) by an algorithm. In short, although the image with blur, fewer pixels, noise becomes clearer, the details are more abundant, etc., the restoration effect on the high-resolution image (for example, the 4K resolution image) is poor in the prior art. Disclosure of Invention In view of the foregoing, it is desirable to provide an image restoration method, apparatus, computer device, and readable storage medium capable of improving the restoration effect of a large-resolution image. In a first aspect, the present application provides an image restoration method, including: Acquiring an image to be repaired; downsampling the image to be repaired to obtain a downsampled image; determining, based on the downsampled image, a first degradation feature by a first target degradation perception module in a target image restoration model; determining a first repair image based on the first degradation feature and the downsampled image, through a first target repair network in the target image repair model; and determining a target repair image through a second target repair network in the target image repair model based on the first repair image. In some embodiments, the determining, based on the first repair image, a target repair image through a second target repair network in the target image repair model includes: Upsampling the first repair image to obtain an upsampled image; And determining a target repair image through a second target repair network in the target image repair model based on the image to be repaired and the up-sampled image. In some embodiments, the method further comprises: Acquiring first training data, wherein the first training data comprises at least two training images and at least two tag images, and the at least two training images correspond to the at least two tag images one by one; downsampling a first training image to obtain a first downsampled training image, wherein the at least two training images comprise the first training image; determining, by a first target degradation perception module in a first initial image restoration model, a second degradation feature based on the first downsampled training image; Determining a second repair image through a first target repair network in the first initial image repair model based on the first downsampled training image and the second degradation feature; Determining a third repair image based on the second repair image and the first training image through a second initial repair network in the first initial image repair model; Determining a first loss based on the third repair image and a first label image, wherein the first label image is a label image corresponding to the first training image in the at least two label images; And adjusting network parameters of a second initial repair network in the first initial image repair model based on the first loss until a training ending condition is met, so as to obtain a second initial image repair model, wherein the second initial image repair model comprises the second target repair network. In some embodiments, the method further comprises: Acquiring second training data, wherein the second training data comprises at least two training image pairs, and the quality of one image in the training image pairs is larger than that of the other image; Determining, by a second degradation perception module, a third degradation characteristic from a first training image pair, the at least two training image pairs comprising the first training image pair; Determining a fourth degradation characteristic through a first initial degradation sensing module in a third initial image restoration model according to a second training image, wherein the second training image is an image with low quality in the first training image pair; determining a fourth repair image through a first initial repair network in the third initial image repair model according to the fourth degradation characteristic and the second training image; determining a second loss based on the third degradation feature, the fourth repair image, and a third training image, the third training image being one of the first training image with a high centering; and adjusting network parameters of the first initial degradation sensing module and the first initial restoration network based on the second loss until a training ending condition is met, so as to obtain a fourth initial image restoration model, wherein the fourth initial image restoration model comprises the first target r