# US 2023/0146865 A1 · Optimizer based prunner for neural networks

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

- Number: US 2023/0146865 A1
- Document ID: US20230146865A1
- Status: Published application
- Kind: A1
- Application number: 18/096,338
- Filed: 2023-01-12
- Published: 2023-05-11
- Earliest claimed: 2019-09-27
- Assignees: Snap Inc.
- Applicants: Snap Inc.
- Inventors: Enxu Yan; Sergey Tulyakov; Aleksei Podkin; Aleksei Stoliar
- Web page: https://patentgrep.com/patent/US20230146865A1

## CPC

- G06N 3/082: modifying the architecture, e.g. adding, deleting or silencing nodes or connections
- G06T 7/11: Region-based segmentation
- G06F 17/16: Matrix or vector computation {, e.g. matrix-matrix or matrix-vector multiplication, matrix factorization (matrix transposition G06F7/78)}
- G06N 3/04: Architecture, e.g. interconnection topology
- G06N 3/0495: Quantised networks; Sparse networks; Compressed networks
- G06N 3/09: Supervised learning
- G06T 7/10: Segmentation; Edge detection (motion-based segmentation G06T7/215)
- G06V 10/82: using neural networks
- G06T 2207/20081: Training; Learning
- G06T 2207/20084: Artificial neural networks [ANN]
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06T: IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06V: IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING

## Abstract

A neural network pruning system can sparsely prune neural network models using an optimizer based approach that is agnostic to the model architecture being pruned. The neural network pruning system can prune by operating on the parameter vector of the full model and the gradient vector of the loss function with respect to the model parameters. The neural network pruning system can iteratively update parameters based on the gradients, while zeroing out as many parameters as possible based a preconfigured penalty.42188

## Claims

### Claim 1

A method comprising:
training, at a server, a full generative neural network model;
generating a sparsely pruned generative neural network model from the full generative neural network model; and
communicating the sparsely pruned generative neural network model to a client device, the client device configured to generate a modified image based on the sparsely pruned generative neural network model.

### Claim 2 (depends on 1)

The method of claim 1, wherein generating the sparsely pruned generative neural network model comprises:
applying a sparse pruning optimizer that is agnostic to the full generative neural network model; and
individually pruning parameters of the full generative neural network model.

### Claim 3 (depends on 1)

The method of claim 1, wherein the client device is configured to:
generate an image with a camera of the client device;
generate image output data by applying the sparsely pruned generative neural network model to the image; and
generate the modified image based on the image output data.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
publishing the modified image as an ephemeral message on a social network site.

### Claim 5 (depends on 1)

The method of claim 1, wherein generating the sparsely pruned generative neural network model comprises:
pruning non-zero parameters in a parameter vector of the full generative neural network model based on gradient data in a gradient vector of the full generative neural network model.

### Claim 6 (depends on 5)

The method of claim 5, wherein individually pruning parameters comprises zeroing non-zero parameters based on corresponding gradient data.

### Claim 7 (depends on 3)

The method of claim 3, wherein the image output data is an image mask generated at least in part by segmentation of the image.

### Claim 8 (depends on 7)

The method of claim 7, further comprising:
generating the modified image using the image mask; and
storing the modified image on the server.

### Claim 9 (depends on 3)

The method of claim 3, wherein generating the image output data further comprises:
applying the sparsely pruned generative neural network model to the image to generate image mask data labelling a region depicted in the image; and
applying an image effect to the region depicted in the image to generate the modified image.

### Claim 10 (depends on 1)

The method of claim 1, wherein the modified image is part of a modified video sequence generated with a camera of the client device.

### Claim 11

A server comprising:
one or more processors of the server; and
a memory storing instructions that, when executed by the one or more processors, cause the server to perform operations comprising:
training, at the server, a full generative neural network model;
generating a sparsely pruned generative neural network model from the full generative neural network model; and
communicating the sparsely pruned generative neural network model to a client device, the client device configured to generate a modified image based on the sparsely pruned generative neural network model.

### Claim 12 (depends on 11)

The server of claim 11, wherein generating the sparsely pruned generative neural network model comprises:
applying a sparse pruning optimizer that is agnostic to the full generative neural network model; and
individually pruning parameters of the full generative neural network model.

### Claim 13 (depends on 11)

The server of claim 11, wherein the client device is configured to:
generate an image with a camera of the client device;
generate image output data by applying the sparsely pruned generative neural network model to the image; and
generate the modified image based on the image output data.

### Claim 14 (depends on 11)

The server of claim 11, wherein the operations further comprise:
publishing the modified image as an ephemeral message on a social network site.

### Claim 15 (depends on 11)

The server of claim 11, wherein generating the sparsely pruned generative neural network model comprises:
pruning non-zero parameters in a parameter vector of the full generative neural network model based on gradient data in a gradient vector of the full generative neural network model.

### Claim 16 (depends on 15)

The server of claim 15, wherein individually pruning parameters comprises zeroing non-zero parameters based on corresponding gradient data.

### Claim 17 (depends on 13)

The server of claim 13, wherein the image output data is an image mask generated at least in part by segmentation of the image.

### Claim 18 (depends on 17)

The server of claim 17, wherein the operations further comprise:
generating the modified image using the image mask; and
storing the modified image on the server.

### Claim 19 (depends on 13)

The server of claim 13, wherein generating the image output data further comprises:
applying the sparsely pruned generative neural network model to the image to generate image mask data labelling a region depicted in the image; and
applying an image effect to the region depicted in the image to generate the modified image.

### Claim 20

A non-transitory machine-readable storage device embodying instructions that, when executed by a server, cause the server to perform operations comprising:
training, at the server, a full generative neural network model;
generating a sparsely pruned generative neural network model from the full generative neural network model; and
communicating the sparsely pruned generative neural network model to a client device, the client device configured to generate a modified image based on the sparsely pruned generative neural network model.
