# US 2021/0081798 A1 · Neural network method and apparatus

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

- Number: US 2021/0081798 A1
- Document ID: US20210081798A1
- Status: Published application
- Kind: A1
- Application number: 16/835,532
- Filed: 2020-03-31
- Published: 2021-03-18
- Earliest claimed: 2019-09-16
- Assignees: Samsung Electronics Co., Ltd.
- Applicants: Samsung Electronics Co., Ltd.
- Inventors: Minkyoung CHO; Wonjo LEE; Seungwon LEE
- Web page: https://patentgrep.com/patent/US20210081798A1

## CPC

- G06N 3/082: modifying the architecture, e.g. adding, deleting or silencing nodes or connections
- G06N 3/04: Architecture, e.g. interconnection topology
- G06N 3/045: Combinations of networks
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N 3/0495: Quantised networks; Sparse networks; Compressed networks
- G06N 3/09: Supervised learning
- G06N 3/044: Recurrent networks, e.g. Hopfield networks
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A method and apparatus for the pruning of a neural network is provided. The method sets a weight threshold value based on a weight distribution of layers included in a neural network, predicts a change of inference accuracy of a neural network by pruning of each layer based on the weight threshold value, determines a current subject layer to be pruned with a weight threshold value among the layers included in the neural network, and prunes a determined current subject layer.

## Claims

### Claim 1

A processor implemented neural network method comprising:
setting a weight threshold value to prune the neural network to a target pruning rate, based on a determined weight distribution;
pruning plural layers of the neural network based on the weight threshold value;
predicting a change in inference accuracy of the pruned plural layers of the neural network based on an input pruning data set;
determining a current subject layer to be pruned among each of the layers of the neural network, based on the predicted change in inference accuracy; and
generating a pruned neural network by pruning the determined current subject layer.

### Claim 2 (depends on 1)

The method of claim 1, wherein the pruning data set is a predetermined number of data sources that are randomly extracted from each class included in a given data set.

### Claim 3 (depends on 1)

The method of claim 1, further comprising determining a weight distribution of the layers of the neural network.

### Claim 4 (depends on 1)

The method of claim 1, wherein the current subject layer is determined to be a layer that is predicted to have a lowest sensitivity to the predicted change in inference accuracy among layers other than a previously pruned layer.

### Claim 5 (depends on 4)

The method of claim 4, wherein the predicting of the change in inference accuracy comprises calculating a sensitivity for each of the plural layers based on a difference between an inference accuracy before pruning on each layer is performed, and an inference accuracy after pruning on each of the plural layers is performed.

### Claim 6 (depends on 4)

The method of claim 4, wherein the layer that is predicted to have the lowest sensitivity corresponds to a layer that is predicted to have a least effect on a decrease in the inference accuracy of the neural network.

### Claim 7 (depends on 1)

The method of claim 1, wherein the setting of the weight threshold value comprises setting a weight value corresponding to the target pruning rate to be the weight threshold value when the determined weight distribution corresponds to a standard normal distribution.

### Claim 8 (depends on 1)

The method of claim 1, wherein the pruning of the current subject layer comprises pruning the current subject layer by adjusting a pruning rate of weights of the current subject layer by updating the weight threshold value until the inference accuracy of the neural network based on the pruning data set is decreased to a threshold accuracy.

### Claim 9 (depends on 8)

The method of claim 8, wherein the updating of the weight threshold value comprises increasing a current weight threshold value when the inference accuracy of the neural network that includes weights pruned to the current weight threshold value is not decreased to the threshold accuracy.

### Claim 10 (depends on 1)

The method of claim 1, wherein the determining of the current subject layer and the pruning of the determined current subject layer are repeatedly performed until a number of all layers or at least all of the plural layers have been pruned.

### Claim 11 (depends on 1)

The method of claim 1, further comprising providing the pruning data set,
wherein the pruning data set comprises one of a data set generated by randomly extracting a predetermined number of data sources for each class included in the given data set, or a data set generated by selecting valid classes from the pruning data set and randomly extracting a predetermined number of data sources for each selected valid class.

### Claim 12 (depends on 11)

The method of claim 11, wherein the providing of the pruning data set comprises:
randomly extracting samples of the predetermined number of data sources from each class included in the given data set;
determining a label corresponding to each of the randomly extracted samples by performing inference on the randomly extracted samples with the neural network;
determining classes having a rate of a most frequent label that is equal to or greater than a predetermined accuracy among classes included in the given data set, to be valid classes; and
randomly extracting a predetermined number of data sources from each of the determined valid classes,
wherein the pruning data set is provided based on the predetermined number of data sources randomly extracted from the determined valid classes.

### Claim 13 (depends on 1)

The method of claim 1, wherein the generating of the pruned neural network is performed without retraining of the pruned neural network using the pruning data set.

### Claim 14 (depends on 1)

The method of claim 1, further comprising implementing the generated pruned neural network for captured data.

### Claim 15 (depends on 1)

A non-transitory computer-readable storage medium storing instructions that, when executed by a processor, cause the processor to perform the method of claim 1.

### Claim 16

A neural network apparatus comprising:
one or more processors configured to:
set a weight threshold value to prune the neural network to a target pruning rate, based on a determined weight distribution;
prune plural layers of the neural network based on the weight threshold value;
predict a change in inference accuracy of the pruned plural layers of the neural network based on an input pruning data set;
determine a current subject layer to be pruned with a weight threshold value among each of the layers of the neural network, based on the predicted change in inference accuracy; and
generate a pruned neural network by prune the determined current subject layer.

### Claim 17 (depends on 16)

The apparatus of claim 16, wherein the pruning data set is a predetermined number of data sources that are randomly extracted from each class included in a given data set.

### Claim 18 (depends on 16)

The apparatus of claim 16, wherein the one or more processors are further configured to determine a weight distribution of the layers of the neural network.

### Claim 19 (depends on 16)

The apparatus of claim 16, further comprising a memory storing instructions that, when executed by the one or more processors, configure the one or more processors to perform the determining of the weight distribution of the layers, the setting of the weight threshold, the predicting of the change in inference accuracy, the determining of the current subject layer, and the pruning of the determined current subject layer.

### Claim 20 (depends on 16)

The apparatus of claim 16, wherein for the determining of the current subject layer, the one or more processors are configured to determine a layer that is predicted to have a lowest sensitivity to the predicted change in inference accuracy among layers other than a previously pruned layer, to be the current subject layer.

### Claim 21 (depends on 16)

The apparatus of claim 16, wherein for the predicting of the change in inference accuracy, the one or more processors are configured to calculate a sensitivity for each of the plural layers based on a difference between an inference accuracy before pruning of each of the plural layers is performed, and an inference accuracy after pruning of each of the plural layers is performed.

### Claim 22 (depends on 16)

The apparatus of claim 16, wherein the layer that is predicted to have the lowest sensitivity corresponds to a layer that is predicted to have a least effect on a decrease in the inference accuracy of the neural network.

### Claim 23 (depends on 16)

The apparatus of claim 16, wherein the one or more processors are configured to set the weight value corresponding to a target pruning rate to be the weight threshold value when the determined weight distribution corresponds to a standard normal distribution.

### Claim 24 (depends on 16)

The apparatus of claim 16, wherein the one or more processors are configured to prune the current subject layer by adjusting a pruning rate of weights of the current subject layer by updating the weight threshold value until the inference accuracy of a neural network based on the pruning data set is decreased to a threshold accuracy.

### Claim 25 (depends on 24)

The apparatus of claim 24, wherein the updating of the weight threshold value comprises increasing a current weight threshold value when the inference accuracy of the neural network that includes weights pruned to the current weight threshold value is not decreased to the threshold accuracy.

### Claim 26 (depends on 16)

The apparatus of claim 16, wherein the determining of the current subject layer and the pruning of the determined current subject layer are repeatedly performed by the one or more processors until a number of all layers or at least all of the plural layers have been pruned.

### Claim 27 (depends on 16)

The apparatus of claim 16, wherein the pruning data set comprises one of a data set generated by randomly extracting a predetermined number of data sources for each class included in the given data set, or a data set generated by selecting valid classes from the pruning data set and randomly extracting a predetermined number of data sources for each selected valid class.

### Claim 28 (depends on 27)

The apparatus of claim 27, wherein the one or more processors are configured to provide the pruning data set by
randomly extracting samples of the predetermined number of data sources from each class included in the given data set,
determining a label corresponding to each of the randomly extracted samples by performing inference on the randomly extracted samples with the neural network,
determining classes having a rate of a most frequent label that is equal to or greater than a predetermined accuracy among classes included in the given data set, to be valid classes, and
randomly extracting a predetermined number of data sources from each of the determined valid classes.

### Claim 29 (depends on 16)

The apparatus of claim 16, further comprising implementing the generated pruned neural network for captured data.
