IP Library Granted Patent US 11,669,585
Granted Patent B2
US 11,669,585 · App. 16/452,441 · Granted Jun 6, 2023

Optimizing binary convolutional neural networks

Inventors: Carlo Eduardo Cabanero del Mundo (Seattle, WA); Ali Farhadi (Seattle, WA)
Assignee: Apple Inc.
G06F17/15G06F7/5443G06N3/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 11,669,585
App. No.
16/452,441
Granted
Jun 6, 2023
Kind
B2
Abstract

In one embodiment, a method includes receiving an input tensor corresponding to a media object at a binary convolutional neural network, wherein the binary convolutional neural network comprises at least one binary convolution layer comprising one or more weights, and wherein the media object is associated with a particular task, binarizing the input tensor by the at least one binary convolution layer, binarizing the one or more weights by the at least one binary convolution layer, and generating an output corresponding to the particular task by the binary convolutional neural network based on the binarized input tensor and the binarized one or more weights.

Claims (55)

1. A method comprising, by one or more computing systems:

generating an input tensor based at least in part on a media object associated with a particular task;

providing, to a binary convolutional neural network, the input tensor generated based at least in part on the media object, wherein the binary convolutional neural network comprises at least one binary convolution layer comprising one or more weights;

binarizing, by the at least one binary convolution layer, the input tensor generated based at least in part on the media object;

binarizing, by the at least one binary convolution layer, the one or more weights; and providing by the binary convolutional neural network, an output corresponding to performance of the particular task based on the binarized input tensor and the binarized one or more weights.

2. The method of claim 1 , wherein the input tensor comprises a plurality of values, and

wherein binarizing the input tensor comprises:

extracting, for each of the plurality of values, a sign associated with the value; and

packing, for each of the plurality of values, the extracted sign into a bitarray.

3. The method of claim 1 , wherein the generating comprises:

decoding the media object into an interleaved tensor comprising one or more values; and

normalizing the one or more values to one or more floating-point values.

4. The method of claim 3 , wherein binarizing the input tensor comprises:

reading, by one or more warps, the one or more floating-point values; and

performing, by the one or more warps, sign comparison and shift extraction on the one or more floating-point values.

5. The method of claim 1 , wherein the input tensor is three-dimensional.

6. The method of claim 1 , wherein the input tensor is associated with a particular data layout, wherein the particular data layout corresponds to one or more dimensionalities of the input tensor, wherein each of the one or more dimensionalities comprises one of height, width, or channel.

7. The method of claim 1 , wherein generating the output corresponding to the particular task based on the binarized input tensor and the binarized one or more weights comprises:

performing one or more binary convolutions between the binarized input tensor and the binarized one or more weights.

8. The method of claim 7 , wherein each of the one or more binary convolutions is based on one or more of an XNOR operation or a POPCOUNT operation.

9. The method of claim 1 , further comprising performing a patch extraction transformation on the input tensor, wherein the patch extraction transformation comprises:

reading the input tensor in one or more particular windows; and

representing the input tensor as a two-dimensional matrix.

10. The method of claim 1 , wherein the binary convolutional neural network further comprises at least one batch normalization layer and at least one bias layer.

11. The method of claim 10 , further comprising:

fusing the at least one batch normalization layer with the at least one bias layer.

12. The method of claim 1 , further comprising:

applying one or more fused-multiply-and-add operations to the output.

13. The method of claim 1 , wherein the media object comprises an image and the task comprises image classification for the image.

14. A system comprising:

one or more processors; and

a memory coupled to the processors comprising instructions executable by the processors, the processors being operable when executing the instructions to:

receive, at a binary convolutional neural network, an input tensor corresponding to a media object, wherein the binary convolutional neural network comprises at least one binary convolution layer comprising one or more weights, and wherein the media object is associated with a particular task;

binarize, by the at least one binary convolution layer, the input tensor;

binarize, by the at least one binary convolution layer, the one or more weights; and

generate, by the binary convolutional neural network, an output corresponding to the particular task based on the binarized input tensor and the binarized one or more weights.

15. The system of claim 14 , wherein the input tensor comprises a plurality of values, and

wherein binarizing the input tensor comprises:

extracting, for each of the plurality of values, a sign associated with the value; and

packing, for each of the plurality of values, the extracted sign into a bitarray.

16. The system of claim 14 , wherein the processors are further operable when executing the instructions to generate the input tensor, wherein the generation comprises:

decoding the media object into an interleaved tensor comprising one or more values; and

normalizing the one or more values to one or more floating-point values.

17. The system of claim 14 , wherein binarizing the input tensor comprises:

reading, by one or more warps, the one or more floating-point values; and

performing, by the one or more warps, sign comparison and shift extraction on the one or more floating-point values.

18. The system of claim 14 , wherein the input tensor is three-dimensional.

19. The system of claim 14 , wherein the input tensor is associated with a particular data layout, wherein the particular data layout corresponds to one or more dimensionalities of the input tensor, wherein each of the one or more dimensionalities comprises one of height, width, or channel.

20. The system of claim 14 , wherein generating the output corresponding to the particular task based on the binarized input tensor and the binarized one or more weights comprises:

performing one or more binary convolutions between the binarized input tensor and the binarized one or more weights.

21. One or more computer-readable non-transitory storage media embodying software comprising instructions operable when executed to:

receive, at a binary convolutional neural network, an input tensor corresponding to a media object, wherein the binary convolutional neural network comprises at least one binary convolution layer comprising one or more weights, and wherein the media object is associated with a particular task;

binarize, by the at least one binary convolution layer, the input tensor;

binarize, by the at least one binary convolution layer, the one or more weights; and

generate, by the binary convolutional neural network, an output corresponding to the particular task based on the binarized input tensor and the binarized one or more weights.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 14, 2021
From: XNOR.AI, INC.
To: APPLE INC.
Reel/Frame 058390/0589 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 25, 2019
From: DEL MUNDO, CARLO EDUARDO CABANERO; FARHADI, ALI
To: XNOR.AI, INC.
Reel/Frame 049584/0925 →
Continuity (1)
Related Publication 20200410318A1 · Dec 31, 2020
Cited By (2)
US 12,242,946 US 12,488,222