# US 2019/0318231 A1 · Method for acceleration of a neural network model of an electronic euqipment and a device thereof related appliction information

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

- Number: US 2019/0318231 A1
- Document ID: US20190318231A1
- Status: Published application
- Kind: A1
- Application number: 16/404,232
- Filed: 2019-05-06
- Published: 2019-10-17
- Earliest claimed: 2018-04-11
- Assignees: Hangzhou Flyslice Technologies Co., Ltd.
- Applicants: Hangzhou Flyslice Technologies Co., Ltd.
- Inventors: Wenhua WANG; Ailian CHENG
- Web page: https://patentgrep.com/patent/US20190318231A1

## CPC

- G06N 3/063: using electronic means
- G06N 3/045: Combinations of networks
- G06N 3/0464: Convolutional networks [CNN, ConvNet]
- G06N 3/048: Activation functions
- G06N 3/08: Learning methods
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A method is provided for hardware acceleration of a neural network model of an electronic equipment and a device thereof. The method includes: obtaining data to be identified and a configuration parameter for the neural network model of the first electronic equipment; proceeding the hardware acceleration of a convolution calculation matched with the neural network model of the first electronic equipment for the data to be identified according to the configuration parameter, and generating a convolution result of the neural network model of the first electronic equipment for the data to be identified. The invention can support a neural network model established by various open source development environments, and also support a user-defined neural network model; when the algorithm of the neural network model is updated, only the parameters of the first electronic device need to be reconfigured without changing the hardware.

## Claims

### Claim 1

A method for hardware acceleration of a neural network model of a first electronic equipment, comprising:
obtaining data to be identified and a configuration parameter for the neural network model of the first electronic equipment;
proceeding the hardware acceleration of a convolution calculation matched with the neural network model of the first electronic equipment for the data to be identified according to the configuration parameter, and generating a convolution result of the neural network model of the first electronic equipment for the data to be identified; and
proceeding the hardware acceleration of a function calculation for the convolution result by calling one or more function modules which match with the neural network model of the first electronic equipment from at least one function module which preset according to the configuration parameter, and generating a recognition result of the neural network model of the first electronic equipment for the data to be identified.

### Claim 2 (depends on 1)

The method of claim 1, wherein the configuration parameter comprises:
a weight parameter of the neural network model of the first electronic equipment, a convolution calculation parameter, and one or more of called function parameters which are required;
wherein the weight parameter is generated by rearranging an original weight parameter of the neural network model of the first electronic equipment based on a format needed by the first electronic equipment;
the convolution calculation parameter comprises: specification of the data to be identified, quantity of a convolution kernel, size of the convolution kernel, step size of the convolution calculation, and one or more of number of layers of the neural network model;
called function parameters which are required comprise: a function name, a function parameter and a calling sequence, which is called by the neural network model of the first electronic equipment according to requirement.

### Claim 3 (depends on 1)

The method of claim 1, wherein the hardware acceleration of the function calculation for the convolution result comprises:
connecting one or more function modules by Bypass according to the configuration parameter; and
inputting the convolution result into one or more function modules which are connected by Bypass, proceeding the hardware acceleration by one or more function modules in order and outputting a result.

### Claim 4 (depends on 1)

The method of claim 1, wherein at least one function module which preset comprises one or more of the following functions: BatchNorm, Scale, Eltwise, ReLU, Sigmoid, Tanh, Pooling, max pooling, mean pooling, root mean square pooling, FC, and Softmax.

### Claim 5 (depends on 1)

The method of claim 1, wherein the data to be identified and the configuration parameter of the neural network model of the first electronic equipment comprises: reading the data to be identified and the configuration parameter of the neural network model of the first electronic equipment from an external memory, and writing the data to be identified and the configuration parameter of the neural network model of the first electronic equipment which is read into a local memory.

### Claim 6 (depends on 5)

The method of claim 5, wherein when the data to be identified is reading and writing, each separate data file is read and written only once.

### Claim 7 (depends on 5)

The method of claim 5, wherein if specification of the data to be identified which is read is M*N*K, according to a split method of M*(N1+N2)*(K1+K2) the processing data is split into some small three-dimensional matrix at the time of writing when the data to be identified is writing;
for a picture file, M is a width of a picture, N is a height of the picture, K is number of channels of the picture; K1+K2=K, N1+N2=N.

### Claim 8

A device for hardware acceleration of a neural network model of a first electronic equipment, comprising:
an acquisition module, used for obtaining data to be identified and a configuration parameter of the neural network model of the first electronic equipment;
a convolution calculation module, used for proceeding the hardware acceleration of a convolution calculation matched with the neural network model of the first electronic equipment for the data to be identified according to the configuration parameter, and generating a convolution result of the neural network model of the first electronic equipment for the data to be identified; and
a function calculation module, used for proceeding the hardware acceleration of a function calculation for the convolution result by calling one or more function modules which match with the neural network model of the first electronic equipment from at least one function module which preset according to the configuration parameter, and generating a recognition result of the neural network model of the first electronic equipment for the data to be identified.

### Claim 9 (depends on 8)

The device of claim 8, wherein the configuration parameter comprises:
a weight parameter of the neural network model of the first electronic equipment, a convolution calculation parameter, and one or more of function parameters which need to be called;
wherein the weight parameter is generated by rearranging an original weight parameter of the neural network model of the first electronic equipment based on a format needed by the first electronic equipment;
the convolution calculation parameter comprises: specification of the data to be identified, quantity of a convolution kernel, size of the convolution kernel, step size of the convolution calculation, and one or more of number of layers of the neural network model;
function parameters called which are required comprises: a function name, a function parameter and a calling sequence, which is called by the neural network model of the first electronic equipment according to requirement.

### Claim 10 (depends on 8, 9)

The device of claim 8 or claim 9, wherein the function calculation module comprises:
a function skip module and at least one function module;
wherein each function module is used for implementing a function calculation of a specific function;
the function skip module is used for connecting one or more function modules by Bypass according to the configuration parameter; the convolution result is inputted into one or more function modules which are connected by Bypass, proceeded by one or more function modules with hardware acceleration in order and outputted as a result.

### Claim 11 (depends on 8, 9)

The device of claim 8 or claim 9, wherein at least one function module which preset comprises one or more of the following functions: BatchNorm, Scale, Eltwise, ReLU, Sigmoid, or Tanh, Pooling, max pooling, mean pooling, root mean square pooling, FC, and Softmax.

### Claim 12 (depends on 8, 9)

The device of claim 8 or claim 9, further comprising: a read and write control module, used for reading the data to be identified and the configuration parameter of the neural network model of the first electronic equipment from an external memory, and writing the data to be identified and the configuration parameter of the neural network model of the first electronic equipment which is read into a local memory.

### Claim 13 (depends on 12)

The device of claim 12, wherein the read and write control module is used to implement that, when the data to be identified is reading and writing, each separate data file is read and written only once.

### Claim 14 (depends on 12)

The device of claim 12, wherein if specification of the data to be identified which is read by the read and write control module is M*N*K, according to a split method of M*(N1+N2)*(K1+K2) the data to be identified is split into some small three-dimensional matrix when the read and write control module is writing;
for a picture file, M is a width of a picture, N is a height of the picture, K is number of channels of the picture; K1+K2=K, N1+N2=N.

### Claim 15 (depends on 1)

A method for an auxiliary acceleration of a neural network model of a second electronic equipment, comprising:
extracting a topology structure and a parameter for each layer of the neural network model of the first electronic equipment which is trained from an open source framework, and based on the topology structure and the parameter for each layer which is extracted, generating the configuration parameter of the first electronic equipment which is used in the method for the hardware acceleration of the neural network model of the first electronic equipment according to claim 1; and
providing the configuration parameter to the first electronic equipment.
