IP Library Granted Patent US 12705486
Granted Patent B1
US 12705486 · App. 16/952,502 · Granted Aug 11, 2026

Pruning filters from convolutional neural networks

Inventors: Sean Settle (San Jose, CA); Paolo D'Alberto (San Jose, CA)
Assignee: XILINX, INC.
G06N3/082G06N3/04
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12705486
App. No.
16/952,502
Granted
Aug 11, 2026
Kind
B1
Abstract

Levels of cross-correlation between pairs of original filters in the layers of a convolutional neural network (CNN) are determined and used in pruning the filters. The pruning includes, for one or more pairs of the pairs of original filters having a level of cross-correlation that satisfies a pruning threshold, determining a scale factor between first and second filters of the one or more pairs, and storing data that identify the first filter, the second filter, and the scale factor. The pruning further includes modifying the initial CNN into a modified CNN by removing the second filter of the one or more pairs and adjusting convolution logic of the CNN, and adding regeneration logic to the modified CNN. The regeneration logic generates an output channel corresponding to the second filter of the one or more pairs based on the scale factor and an output channel produced by the first filter.

Claims (80)

1 . A method comprising:

pruning filters from a plurality of layers of a convolutional neural network (CNN) by a computer processor, wherein each of the plurality of layers includes pairs of original filters, each pair including a first filter and a second filter and having a level of cross-correlation indicating a level of similarity between the first filter and the second filter, and wherein the pruning includes, for a first pair of the pairs of the original filters:

in response to the level of cross-correlation satisfying a pruning threshold, wherein the pruning threshold specifies a threshold level of cross-correlation:

retaining the first filter in the CNN to generate a first output channel;

removing the second filter and adjusting convolution logic of the CNN; and

adding first regeneration logic to the CNN, the first regeneration logic being distinct from training back-propagation, configured to, during inference, generate a second output channel corresponding to the second filter by multiplying the first output channel produced by the first filter by a scale factor computed to minimize, for the trained CNN, a difference between the second filter and a product of the scale factor and the first filter,

wherein the scale factor is determined from pre-pruning filter values and is available to the regeneration logic for use during inference and wherein the regenerated second output channel maintains output dimensionality of the layer as prior to pruning so that subsequent layers receive outputs of a same dimensionality without additional training.

2 . The method of claim 1 , wherein the pruning includes, for a second pair of the pairs of the original filters:

shifting the first filter of the second pair by one or more positions relative to the second filter of the second pair;

in response to a level of cross-correlation between the first filter of the second pair, as shifted, and the second filter of the second pair satisfying the pruning threshold:

retaining the first filter of the second pair in the CNN to generate a third output channel;

removing the second filter of the second pair and adjusting the convolution logic of the CNN; and

adding second regeneration logic to the CNN, wherein the second regeneration logic is configured to generate a fourth output channel corresponding to the second filter of the second pair based on a scale factor between the first filter of the second pair, as shifted, and the second filter of the second pair and the third output channel produced by the first filter of the second pair, as shifted.

3 . The method of claim 1 , wherein the CNN is trained before the pruning, and the pruning includes:

initializing the pruning threshold to an initial value;

for the second filter removed from the CNN:

creating a regenerated second filter from the first filter using the scale factor, the regenerated second filter associated with the removed second filter, and

comparing the regenerated second filter to the removed second filter to determine an accuracy level;

reducing the pruning threshold in response to the accuracy level being less than an accuracy tolerance; and

repeating the pruning of the filters after relaxing the pruning threshold.

4 . The method of claim 3 , wherein the scale factor is set to a value that minimizes a difference between the regenerated second filter and the removed second filter.

5 . The method of claim 1 , wherein the CNN is trained before the pruning, and the pruning includes:

initializing the pruning threshold to an initial value;

creating a regenerated second filter from the first filter using the scale factor, the regenerated second filter associated with the removed second filter;

creating a second set of filters including the regenerated second filter and the first filter;

before the pruning, performing first convolutions of the plurality of layers of the CNN using the original filters to produce reference output data;

after the pruning, performing second convolutions of the plurality of layers of the CNN using the second set of filters to produce regenerated output data;

comparing the reference output data to the regenerated output data to determine an accuracy level;

reducing the pruning threshold in response to the accuracy level being less than an accuracy tolerance; and

repeating the pruning of the filters after relaxing the pruning threshold.

6 . The method of claim 5 , wherein the scale factor is set to a value that minimizes a difference between the reference output data and the regenerated output data.

7 . The method of claim 1 , wherein:

the CNN is untrained before the pruning; and

the pruning is performed during training of the CNN.

8 . The method of claim 7 , wherein the scale factor is learned by back-propagation during training of the CNN.

9 . The method of claim 1 , wherein two or more of the pairs of the original filters have a same child filter and have the levels of cross-correlation that satisfy the pruning threshold, the method further comprising:

selecting for pruning, one pair of the two or more pairs that has a greatest level of cross-correlation.

10 . The method of claim 1 , wherein parent filters in two or more pairs of the pairs of the original filters have a same child filter and have the levels of cross-correlation that satisfy the pruning threshold, the method further comprising:

selecting for pruning, one pair of the two or more pairs based on respective numbers of the pairs of the original filters having the parent filters and having the levels of cross-correlation that satisfy the pruning threshold.

11 . A system comprising:

one or more processors; and

a memory arrangement configured with instructions that when executed by the one or more processors cause the one or more processors to perform operations including:

pruning filters from a plurality of layers of a convolutional neural network (CNN), wherein each of the plurality of layers includes pairs of original filters, each pair including a first filter and a second filter and having a level of cross-correlation indicating a level of similarity between the first filter and the second filter, and wherein the pruning includes, for a first pair of the pairs of original filters:

in response to the level of cross-correlation satisfying a pruning threshold, wherein the pruning threshold specifies a threshold level of cross-correlation:

retaining the first filter in the CNN to generate a first output channel;

removing the second filter and adjusting convolution logic of the CNN; and

adding first regeneration logic to the CNN, the first regeneration logic being distinct from training back-propagation, configured to, during inference, generate a second output channel corresponding to the second filter by multiplying the first output channel produced by the first filter by a scale factor computed to minimize, for the trained CNN, a difference between the second filter and a product of the scale factor and the first filter,

wherein the scale factor is determined from pre-pruning filter values and is available to the regeneration logic for use during inference and wherein the regenerated second output channel maintains output dimensionality of the layer as prior to pruning so that subsequent layers receive outputs of a same dimensionality without additional training.

12 . The system of claim 11 , wherein:

the instructions for pruning include, for a second pair of the pairs of the original filters instructions that when executed by the one or more processors cause the one or more processors to perform operations including:

shifting the first filter of the second pair by one or more positions relative to the second filter of the second pair;

in response to a level of cross-correlation between the first filter of the second pair, as shifted, and the second filter of the second pair satisfying the pruning threshold:

retaining the first filter of the second pair in the CNN to generate a third output channel;

removing the second filter of the second pair and adjusting the convolution logic of the CNN; and

adding second regeneration logic to the CNN, wherein the second regeneration logic is configured to generate an output channel corresponding to the second filter of the second pair based on a scale factor between the first filter of the second pair, as shifted, and the second filter of the second pair and an output channel produced by the first filter of the second pair, as shifted.

13 . The system of claim 11 , wherein the CNN is trained before the pruning, and the instructions for pruning include instructions for:

initializing the pruning threshold to an initial value;

for the second filter removed from the CNN:

creating a regenerated second filter from the first filter using the scale factor, the regenerated second filter associated with the removed second filter, and

comparing the regenerated second filter to the removed second filter to determine an accuracy level;

reducing the pruning threshold in response to the accuracy level being less than an accuracy tolerance; and

repeating the pruning of the filters after relaxing the pruning threshold.

14 . The system of claim 13 , wherein the scale factor is set to a value that minimizes a difference between the regenerated second filter and the removed second filter.

15 . The system of claim 11 , wherein the CNN is trained before the pruning, and the instructions for pruning include instructions for:

initializing the pruning threshold to an initial value;

creating a regenerated second filter from the first filter using the scale factor, the regenerated second filter associated with the removed second filter;

creating a second set of filters including the regenerated second filter and the first filter;

before the pruning, performing first convolutions of the plurality of layers of the CNN using the original filters to produce reference output data;

after the pruning, performing second convolutions of the plurality of layers of the CNN using the second set of filters to produce regenerated output data;

comparing the reference output data to the regenerated output data to determine an accuracy level;

reducing the pruning threshold in response to the accuracy level being less than an accuracy tolerance; and

repeating the pruning of the filters after relaxing the pruning threshold.

16 . The system of claim 15 , wherein the scale factor is set to a value that minimizes a difference between the reference output data and the regenerated output data.

17 . The system of claim 11 , wherein:

the CNN is untrained; and

the instructions for pruning are executable during training of the CNN.

18 . The system of claim 17 , wherein the scale factor is learned by back-propagation during training of the CNN.

19 . The system of claim 11 , wherein two or more of the pairs of the original filters have a same child filter and have the levels of cross-correlation that satisfy the pruning threshold, and the memory arrangement is further configured with instructions that when executed cause the one or more processors to select for pruning, one pair of the two or more pairs that has a greatest level of cross-correlation.

20 . The system of claim 11 , wherein parent filters in two or more pairs of the pairs of the original filters have a same child filter and have the levels of cross-correlation that satisfy the pruning threshold, and the memory arrangement is further configured with instructions that when executed cause the one or more processors to:

select for pruning, one pair of the two or more pairs based on respective numbers of the pairs of the original filters having the parent filters and having the levels of cross-correlation that satisfy the pruning threshold.