# US 2021/0342977 A1 · Method And Apparatus For Image Restoration, Storage Medium And Terminal

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2021/0342977 A1
- Document ID: US20210342977A1
- Status: Published application
- Kind: A1
- Application number: 17/244,474
- Filed: 2021-04-29
- Published: 2021-11-04
- Earliest claimed: 2020-04-29
- Assignees: Shanghai Harvest Intelligence Technology Co., Ltd.
- Applicants: Shanghai Harvest Intelligence Technology Co., Ltd.
- Inventors: Chuan XIA
- Web page: https://patentgrep.com/patent/US20210342977A1

## CPC

- G06V 40/1347: {Preprocessing; Feature extraction}
- G06N 3/0455: Auto-encoder networks; Encoder-decoder networks
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N 3/0475: Generative networks
- G06N 3/09: Supervised learning
- G06N 3/094: Adversarial learning
- G06T 5/60: using machine learning, e.g. neural networks
- G06T 5/80: Geometric correction
- G06T 5/92: based on global image properties
- G06V 10/82: using neural networks
- G06T 2207/20081: Training; Learning
- G06T 2207/20084: Artificial neural networks [ANN]
- G06T 2207/30088: Skin; Dermal
- G06T 2207/30168: Image quality inspection
- G06T 2207/30196: Human being; Person
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL

## Abstract

The present disclosure provides an method and apparatus for image restoration, a storage medium and a terminal. The method includes: acquiring a to-be-processed image including biometric information; inputting the to-be-processed image into a generator, wherein the generator comprises a neural network model with a plurality of convolutional layers, and a weight of a convolutional kernel of the generator is determined at least according to a quality of an image historically restored by the generator; and restoring the to-be-processed image by the generator to acquire a restored image. The present disclosure can effectively improve a restoration quality when performing image restoration based on machine learning.

## Claims

### Claim 1

A method for image restoration, comprising:
acquiring a to-be-processed image, wherein the to-be-processed image comprises biometric information;
inputting the to-be-processed image into a generator, wherein the generator comprises a neural network model with a plurality of convolutional layers, and a weight of a convolutional kernel of the generator is determined at least according to a quality of an image historically restored by the generator; and
restoring the to-be-processed image by the generator to acquire a restored image.

### Claim 2 (depends on 1)

The method according to claim 1, wherein determining a weight of a convolutional kernel of the generator at least according to a quality of an image historically restored by the generator comprises:
updating the weight of the convolutional kernel of the generator according to an evaluation result of a discriminator on the image historically restored by the generator, wherein the discriminator comprises a neural network model with a plurality of convolutional layers.

### Claim 3 (depends on 2)

The method according to claim 2, wherein there is a connection relationship among the plurality of convolutional layers of the neural network model of the generator and/or the plurality of convolutional layers of the neural network model of the discriminator.

### Claim 4 (depends on 2)

The method according to claim 2, wherein updating the weight of the convolutional kernel of the generator according to an evaluation result of a discriminator on the image historically restored by the generator comprises:
acquiring the image historically restored by the generator;
inputting the historically restored image into the discriminator;
acquiring a first evaluation result of the discriminator on the historically restored image; and
updating the weight of the convolutional kernel of the generator at least according to a loss function of the generator and the first evaluation result.

### Claim 5 (depends on 4)

The method according to claim 4, wherein the loss function of the generator comprises an adversarial loss function and an L1 loss function, and updating the weight of the convolutional kernel of the generator at least according to the loss function of the generator and the first evaluation result comprises:
calculating a first output value according to the first evaluation result and the adversarial loss function of the generator;
calculating a second output value according to the historically restored image, a standard image corresponding to the historically restored image and the L1 loss function; and
updating the weight of the convolutional kernel of the generator according to the first output value and the second output value.

### Claim 6 (depends on 5)

The method according to claim 5, wherein calculating a first output value according to the first evaluation result and the adversarial loss function of the generator comprises:
calculating the first output value based on following formula:
L
g_adv
=
max
G
⁢
(
E
z
∼
p
⁡
(
z
)
⁡
[
D
⁡
(
G
⁡
(
z
)
)
]
)
;
wherein Lg_adv represents the first output value,
max
G
⁢
(
)
represents a value of G when the function of Ez˜p(z)[D(G(z))] has a maximum value, G represents the generator, the value of G calculated based on the above formula is the first output value; Ez˜p(z)(u) represents a mean value of a function u when z obeys P(z), p(z) represents a distribution of the historically restored image, z represents the to-be-processed image, D(G(z)) represents the first evaluation result, and G(z) represents the historically restored image.

### Claim 7 (depends on 5)

The method according to claim 5, wherein calculating a second output value according to the historically restored image, a standard image corresponding to the historically restored image and the L1 loss function comprises:
calculating the second output value based on following formula:
L1=∥x−G(z)∥1;
wherein L1 represents the second output value, x represents the standard image, z represents the to-be-processed image, and G(z) represents the historically restored image.

### Claim 8 (depends on 2)

The method according to claim 2, further comprising:
updating the weight of the convolutional kernel of the discriminator according to an evaluation result of the discriminator on the image historically restored by the generator and a standard image corresponding to the historically restored image.

### Claim 9 (depends on 8)

The method according to claim 8, wherein updating the weight of the convolutional kernel of the discriminator according to an evaluation result of the discriminator on the historically restored image by the generator and a standard image corresponding to the historically restored image comprises:
acquiring the image historically restored by the generator and the corresponding standard image;
inputting the historically restored image into the discriminator to obtain a first evaluation result, and inputting the standard image into the discriminator to obtain a second evaluation result; and
calculating a third output value at least according to an adversarial loss function of the discriminator, the first evaluation result and the second evaluation result; and
updating the weight of the convolutional kernel of the discriminator according to the third output value.

### Claim 10 (depends on 9)

The method according to claim 9, wherein calculating a third output value at least according to an adversarial loss function of the discriminator, the first evaluation result and the second evaluation result comprises:
calculating the third output value based on following formula:
L
d_adv
=
min
D
⁢
(
E
x
∼
q
⁡
(
x
)
⁡
[
max
⁡
(
0
,
1
-
D
⁡
(
x
)
)
]
+
E
z
∼
p
⁡
(
z
)
⁡
[
max
⁡
(
0
,
1
+
D
⁡
(
G
⁡
(
z
)
)
)
]
)
+
λ
⁢
E
I
^
∼
p
⁢
I
^
⁡
(
(

∇
I
^
⁢
D
⁡
(
I
^
)

)
2
-
1
)
2
;
wherein Ld_adv represents the third output value,
min
D
⁢
(
)
represents a value of D when the function of Ex˜q(x)[max(0,1−D(x))]Ez˜p(z)[max(0,1+D(G(z)))] has a minimum value, D represents the discriminator, the value of D calculated based on the above formula represents the third output value, Ex˜q(x)(u) represents a mean value of a function u when x obeys q(x), q(x) represents a distribution of the standard image, x represents the standard image, Ez˜p(z)(u) represents a mean value of the function u when z obeys p(z), p(z) represents a distribution of the historically restored image, z represents the to-be-processed image, D(x) represents the second evaluation result, D(G(z)) represents the first evaluation result, G(z) represents the historically restored image, λ represents a preset hyperparameter, ∇( ) represents a gradient penalty function, Î represents an interpolation function between the distribution of q(x) and the distribution of p(z), and ∇ÎD(Î) represents a gradient penalty of the discriminator by the interpolation function Î between the distribution of q(x) and the distribution of p(z).

### Claim 11 (depends on 8)

The method according to claim 8, wherein updating the weight of the convolutional kernel of the generator and updating the weight of the convolutional kernel of the discriminator are performed several times.

### Claim 12 (depends on 2)

The method according to claim 2, wherein the discriminator comprises:
a plurality of residual modules connected in series and configured to receive a feature map of a to-be-evaluated image or a feature map processed by an upper level residual module, wherein the to-be-evaluated image is the image historically restored by the generator or a standard image corresponding to the historically restored image, and each residual module comprises one or more convolutional layers; and
a self-attention module having an input end connected with a residual module of the plurality of residual modules to receive the feature map processed by the residual module, wherein the self-attention module is configured to extract global features of an input feature map, and an output end of the self-attention module is connected with another residual module of the plurality of residual modules.

### Claim 13 (depends on 12)

The method according to claim 12, wherein one or more of the plurality of residual modules comprise:
a channel attention module configured to perform a weighting process on channels of the input feature map, and the input feature map is a feature map processed by the one or more convolutional kernels of the residual module.

### Claim 14 (depends on 13)

The method according to claim 13, wherein the channel attention module comprises:
a global average pooling unit configured to perform a global average pooling on the input feature map;
a linear correction unit configured to perform a linear correction on the feature map on which the global average pooling has been performed; and
an s activation function unit configured to determine a weight of each channel according to the feature map on which the linear correction has been performed;
wherein adjacent units are connected through a full connection layer.

### Claim 15 (depends on 14)

The method according to claim 14, wherein the channel attention module further comprises:
a first weighted summation unit configured to perform a weighted summation on the input feature map according to the weight of each channel determined by the s activation function unit.

### Claim 16 (depends on 12)

The method according to claim 12, wherein the self-attention module comprises:
a query unit configured to perform convolution on the input processed feature map by a query convolutional kernel to obtain a query convolution processing result;
a key unit configured to perform convolution on the input processed feature map by a key convolutional kernel to obtain a key convolution processing result;
a value unit configured to perform convolution on the input processed feature map by a value convolutional kernel to obtain a value convolution processing result;
a self-similarity calculation unit configured to calculate a self-similarity degree of the query convolution processing result and the value convolution processing result;
a normalization processing unit configured to normalize the calculated self-similarity based on a preset regression function to obtain a normalized weight; and
a second weighted summation unit configured to perform weighted summation on the value convolution processing result according to the normalized weight to obtain a weighted summation result, wherein the output of the self-attention module is generated according to the weighted summation result.

### Claim 17 (depends on 1)

The method according to claim 1, wherein the generator processes the to-be-processed image based on partial convolution and/or LBAM.

### Claim 18

An apparatus for image restoration, comprising:
a first acquisition circuitry configured to: acquire a to-be-processed image, wherein the to-be-processed image comprises biometric information, and to input the to-be-processed image into a generator; and
a processing circuitry comprising the generator, wherein the generator is configured to restore the to-be-processed image and comprises a neural network model with a plurality of convolutional layers, and a weight of a convolutional kernel of the generator is determined at least according to a quality of an image historically restored by the generator.

### Claim 19 (depends on 1)

A non-transitory storage medium having computer instructions stored therein, wherein the computer instructions are executed to perform steps of the method according to claim 1.

### Claim 20 (depends on 1)

A terminal comprising a memory and a processor, wherein the memory is stored with computer instructions executable on the processor, and the computer instructions are executed by the processor to perform steps of the method according to claim 1.
