# US 2022/0019855 A1 · Image generation method, neural network compression method, and related apparatus and device

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

- Number: US 2022/0019855 A1
- Document ID: US20220019855A1
- Status: Published application
- Kind: A1
- Application number: 17/488,735
- Filed: 2021-09-29
- Published: 2022-01-20
- Earliest claimed: 2019-03-31
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Hanting CHEN; Yunhe WANG; Chuanjian LIU; Kai HAN; Chunjing XU
- Web page: https://patentgrep.com/patent/US20220019855A1

## CPC

- G06F 18/2148: {characterised by the process organisation or structure, e.g. boosting cascade}
- G06V 30/19: Recognition using electronic means
- G06F 18/243: relating to the number of classes
- G06N 3/044: Recurrent networks, e.g. Hopfield networks
- G06N 3/045: Combinations of networks
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N 3/047: Probabilistic or stochastic networks
- G06N 3/0475: Generative networks
- G06N 3/0495: Quantised networks; Sparse networks; Compressed networks
- G06N 3/082: modifying the architecture, e.g. adding, deleting or silencing nodes or connections
- G06N 3/084: Backpropagation, e.g. using gradient descent
- G06N 3/088: Non-supervised learning, e.g. competitive learning
- G06N 3/094: Adversarial learning
- G06V 10/774: Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
- G06V 10/776: Validation; Performance evaluation
- G06V 10/778: Active pattern-learning, e.g. online learning of image or video features
- G06V 10/82: using neural networks
- G06V 40/174: {Facial expression recognition}
- G06V 40/178: {estimating age from face image; using age information for improving recognition}
- G06N 3/048: Activation functions
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

The present application discloses an image generation method, a neural network compression method, and a related apparatus and device in the field of artificial intelligence. The image generation method includes: inputting a first matrix into an initial image generator to obtain a generated image; inputting the generated image into a preset discriminator to obtain a determining result, where the preset discriminator is obtained through training based on a real image and a category corresponding to the real image; updating the initial image generator based on the determining result to obtain a target image generator; and further inputting a second matrix into the target image generator to obtain a sample image. Further, a neural network compression method is disclosed, to compress the preset discriminator based on the sample image obtained by using the foregoing image generation method.

## Claims

### Claim 1

An image generation method, comprising:
inputting a first matrix into an initial image generator to obtain a generated image, wherein the initial image generator is a deep neural network;
inputting the generated image into a preset discriminator to obtain a determining result, wherein the preset discriminator is obtained through training based on first training data, and the first training data comprises a real image and a category corresponding to the real image;
updating the initial image generator based on the determining result to obtain a target image generator; and
inputting a second matrix into the target image generator to obtain a sample image.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the determining result comprises a probability that the generated image is predicted as each of M categories, and M is an integer greater than 1.

### Claim 3 (depends on 2)

The method according to claim 2, wherein the updating the initial image generator based on the determining result specifically comprises:
determining a maximum probability in probabilities corresponding to the M categories, and determining, as a real result of the generated image, a category corresponding to the maximum probability; and
updating the initial image generator based on a difference between the determining result and the real result.

### Claim 4 (depends on 2)

The method according to claim 2, wherein before the updating the initial image generator based on the determining result, the method further comprises:
extracting a feature of the generated image by using the preset discriminator; and
the updating the initial image generator based on the determining result specifically comprises:
determining a maximum probability in probabilities corresponding to the M categories, and determining, as a real result of the generated image, a category corresponding to the maximum probability; and updating the initial image generator based on the feature and a difference between the determining result and the real result.

### Claim 5 (depends on 2)

The method according to claim 2, wherein the updating the initial image generator based on the determining result specifically comprises:
determining a maximum probability in probabilities corresponding to the M categories, and determining, as a real result of the generated image, a category corresponding to the maximum probability;
obtaining, based on N determining results that one-to-one correspond to N first matrices, an average probability value of each of the M categories in the N determining results, wherein N is a positive integer; and
updating the initial image generator based on the average probability value and a difference between the determining result and the real result.

### Claim 6 (depends on 2)

The method according to claim 2, wherein before the updating the initial image generator based on the determining result, the method further comprises:
extracting a feature of the generated image by using the preset discriminator; and
the updating the initial image generator based on the determining result specifically comprises:
determining a maximum probability in probabilities corresponding to the M categories, and determining, as a real result of the generated image, a category corresponding to the maximum probability; obtaining, based on N determining results that one-to-one correspond to N first matrices, an average probability value of each of the M categories in the N determining results; and updating the initial image generator based on a difference between the determining result and the real result, an eigenvalue of the feature, and the average probability value.

### Claim 7

A sample generation method, comprising:
inputting a first matrix into an initial sample generator to obtain a first generated sample, wherein the initial sample generator is a deep neural network;
inputting the first generated sample into a preset discriminator to obtain a determining result, wherein the preset discriminator is obtained through training based on first training data, and the first training data comprises a real sample and a category corresponding to the real sample;
updating parameters of the initial sample generator based on the determining result of the first generated sample to obtain a target sample generator; and
inputting a second matrix into the target sample generator to obtain a second generated sample.

### Claim 8 (depends on 7)

The method according to claim 7, wherein the determining result comprises a probability that the first generated sample is predicted as each of M categories, and M is an integer greater than 1.

### Claim 9 (depends on 7)

The method according to claim 7, wherein the updating the initial sample generator based on the determining result specifically comprises:
determining a maximum probability in probabilities corresponding to the M categories, and determining, as a real result of the first generated sample, a category corresponding to the maximum probability; and
updating the initial sample generator based on a difference between the determining result and the real result.

### Claim 10 (depends on 7)

The method according to claim 7, wherein before the updating the initial sample generator based on the determining result, the method further comprises:
extracting a feature of the first generated sample by using the preset discriminator; and
the updating the initial sample generator based on the determining result specifically comprises:
determining a maximum probability in probabilities corresponding to the M categories, and determining, as a real result of the first generated sample, a category corresponding to the maximum probability; and updating the initial sample generator based on the feature and a difference between the determining result and the real result.

### Claim 11 (depends on 7)

The method according to claim 7, wherein the updating the initial sample generator based on the determining result specifically comprises:
determining a maximum probability in probabilities corresponding to the M categories, and determining, as a real result of the first generated sample, a category corresponding to the maximum probability;
obtaining, based on N determining results that one-to-one correspond to N first matrices, an average probability value of each of the M categories in the N determining results, wherein N is a positive integer; and
updating the initial sample generator based on the average probability value and a difference between the determining result and the real result.

### Claim 12 (depends on 7)

The method according to claim 7, wherein before the updating the initial sample generator based on the determining result, the method further comprises:
extracting a feature of the first generated sample by using the preset discriminator; and
the updating the initial sample generator based on the determining result specifically comprises:
determining a maximum probability in probabilities corresponding to the M categories, and determining, as a real result of the first generated sample, a category corresponding to the maximum probability; obtaining, based on N determining results that one-to-one correspond to N first matrices, an average probability value of each of the M categories in the N determining results; and updating the initial sample generator based on a difference between the determining result and the real result, the feature, and the average probability value.

### Claim 13

An image generation apparatus, comprising a memory and a processor, wherein the memory is configured to store a program, the processor is configured to execute the program stored in the memory, and when the program stored in the memory is executed, the processor is configured to perform the image generation method, the method comprising:
inputting a first matrix into an initial image generator to obtain a generated image, wherein the initial image generator is a deep neural network;
inputting the generated image into a preset discriminator to obtain a determining result, wherein the preset discriminator is obtained through training based on first training data, and the first training data comprises a real image and a category corresponding to the real image;
updating the initial image generator based on the determining result to obtain a target image generator; and
inputting a second matrix into the target image generator to obtain a sample image.

### Claim 14 (depends on 13)

The apparatus according to claim 13, wherein the determining result comprises a probability that the generated image is predicted as each of M categories, and M is an integer greater than 1.

### Claim 15 (depends on 13)

The apparatus according to claim 13, wherein the updating the initial image generator based on the determining result specifically comprises:
determining a maximum probability in probabilities corresponding to the M categories, and determining, as a real result of the generated image, a category corresponding to the maximum probability; and
updating the initial image generator based on a difference between the determining result and the real result.

### Claim 16 (depends on 13)

The apparatus according to claim 13, wherein before the updating the initial image generator based on the determining result, the method further comprises:
extracting a feature of the generated image by using the preset discriminator; and
the updating the initial image generator based on the determining result specifically comprises:
determining a maximum probability in probabilities corresponding to the M categories, and determining, as a real result of the generated image, a category corresponding to the maximum probability; and updating the initial image generator based on the feature and a difference between the determining result and the real result.

### Claim 17 (depends on 13)

The apparatus according to claim 13, wherein the updating the initial image generator based on the determining result specifically comprises:
determining a maximum probability in probabilities corresponding to the M categories, and determining, as a real result of the generated image, a category corresponding to the maximum probability;
obtaining, based on N determining results that one-to-one correspond to N first matrices, an average probability value of each of the M categories in the N determining results, wherein N is a positive integer; and
updating the initial image generator based on the average probability value and a difference between the determining result and the real result.

### Claim 18 (depends on 7)

The apparatus according to claim 7, wherein before the updating the initial image generator based on the determining result, the method further comprises:
extracting a feature of the generated image by using the preset discriminator; and
the updating the initial image generator based on the determining result specifically comprises:
determining a maximum probability in probabilities corresponding to the M categories, and determining, as a real result of the generated image, a category corresponding to the maximum probability; obtaining, based on N determining results that one-to-one correspond to N first matrices, an average probability value of each of the M categories in the N determining results; and updating the initial image generator based on a difference between the determining result and the real result, an eigenvalue of the feature, and the average probability value.

### Claim 19 (depends on 1)

A computer-readable storage medium, wherein the computer-readable storage medium stores program code to be executed by a device, and the program code comprises the image generation method according to any one of claim 1.

### Claim 20 (depends on 7)

A computer-readable storage medium, wherein the computer-readable storage medium stores program code to be executed by a device, and the program code comprises the sample generation method according to any one of claim 7.
