IP Library Granted Patent US 10,896,522
Granted Patent B2
US 10,896,522 · App. 16/130,722 · Granted Jan 19, 2021

Method and apparatus for compressing image

Inventor: Renliang Weng (Beijing, CN)
Assignee: Baidu Online Network Technology (Beijing) Co., Ltd.
G06T9/002G06K9/46G06K9/4628G06K9/6202G06K9/627G06N3/04G06N3/08H04N19/00
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 10,896,522
App. No.
16/130,722
Granted
Jan 19, 2021
Kind
B2
Abstract

Embodiments of the present disclosure disclose a method and apparatus for compressing an image. A specific embodiment of the method includes: acquiring a to-be-processed image; and performing feature extraction on the to-be-processed image by using a convolutional neural network corresponding to a trained image compression model to obtain a plurality of feature maps, a difference between the to-be-processed image and a reconstructed image obtained by reconstructing the plurality of feature maps through a deconvolution neural network corresponding to a trained image reconstruction model satisfying a preset condition. This embodiment achieves compression of the data size of an image while ensuring the restoration quality of the image.

Claims (47)

1. A method for compressing an image, the method comprising:

acquiring a to-be-processed image; and

performing feature extraction on the to-be-processed image by using a convolutional neural network corresponding to a trained image compression model to obtain a plurality of feature maps;

a difference between the to-be-processed image and a reconstructed image obtained by reconstructing the plurality of feature maps through a deconvolution neural network corresponding to a trained image reconstruction model satisfying a preset condition;

wherein the image compression model and the image reconstruction model are trained as follows:

acquiring a sample image and performing a comparison step;

the comparison step comprises: inputting the sample image into the image compression model, outputting a plurality of sample feature maps, inputting the plurality of sample feature maps into the deconvolution neural network corresponding to the image reconstruction model to reconstruct the plurality of sample feature maps to obtain a reconstructed image of the sample image, creating a loss function based on a difference between the sample image and the reconstructed image of the sample image, and determining whether a value of the loss function satisfies a preset convergence condition;

updating at least one of a parameter of the convolutional neural network corresponding to the image compression model or a parameter of the deconvolution neural network corresponding to the image reconstruction model using a gradient descent method based on the loss function, if a result of the comparison step is negative, and performing the comparison step based on the updated parameter; and

outputting the parameter of the convolutional neural network corresponding to the image compression model and the parameter of the deconvolution neural network corresponding to the image reconstruction model, if the result of the comparison step is positive.

2. The method according to claim 1 , wherein the method further comprises:

storing a parameter of the convolutional neural network corresponding to the image compression model and a parameter of the deconvolution neural network corresponding to the image reconstruction model.

3. The method according to claim 2 , wherein the method further comprises:

storing the plurality of feature maps as a compression result of the to-be-processed image.

4. The method according to claim 1 , wherein each of the plurality of feature maps comprises at least one pixel having a gray value of a floating-point number; and

the method further comprises:

calculating a maximum value and a minimum value of gray values of a plurality of the pixels in the plurality of feature maps of the to-be-processed image, and converting the gray values of the plurality of pixels in the plurality of feature maps into character data based on the maximum value and the minimum value.

5. The method according to claim 4 , wherein the method further comprises:

storing the character data corresponding to the gray values of the plurality of pixels in the plurality of feature maps of the to-be-processed image as an image compression result, and storing the maximum value and the minimum value of the gray values of the plurality of pixels in the plurality of feature maps of the to-be-processed image.

6. An apparatus for compressing an image, the apparatus comprising:

at least one processor; and

a memory storing instructions, the instructions when executed by the at least one processor, cause the at least one processor to perform operations, the operations comprising:

acquiring a to-be-processed image; and

performing feature extraction on the to-be-processed image by using a convolutional neural network corresponding to a trained image compression model to obtain a plurality of feature maps;

a difference between the to-be-processed image and a reconstructed image obtained by reconstructing the plurality of feature maps through a deconvolution neural network corresponding to a trained image reconstruction model satisfying a preset condition;

wherein the image compression model and the image reconstruction model are trained as follows:

acquiring a sample image and performing a comparison step;

the comparison step comprises: inputting the sample image into the image compression model, outputting a plurality of sample feature maps, inputting the plurality of sample feature maps into the deconvolution neural network corresponding to the image reconstruction model to reconstruct the plurality of sample feature maps to obtain a reconstructed image of the sample image, creating a loss function based on a difference between the sample image and the reconstructed image of the sample image, and determining whether a value of the loss function satisfies a preset convergence condition;

updating at least one of a parameter of the convolutional neural network corresponding to the image compression model or a parameter of the deconvolution neural network corresponding to the image reconstruction model using a gradient descent method based on the loss function, if a result of the comparison step is negative, and performing the comparison step based on the updated parameter; and

outputting the parameter of the convolutional neural network corresponding to the image compression model and the parameter of the deconvolution neural network corresponding to the image reconstruction model, if the result of the comparison step is positive.

7. The apparatus according to claim 6 , wherein the operations further comprise:

storing a parameter of the convolutional neural network corresponding to the image compression model and a parameter of the deconvolution neural network corresponding to the image reconstruction model.

8. The apparatus according to claim 7 , wherein the operations further comprise:

storing the plurality of feature maps as a compression result of the to-be-processed image.

9. The apparatus according to claim 6 , wherein each of the plurality of feature maps comprises at least one pixel having a gray value of a floating-point number; and

the operations further comprise:

calculating a maximum value and a minimum value of gray values of a plurality of the pixels in the plurality of feature maps of the to-be-processed image, and converting the gray values of the plurality of pixels in the plurality of feature maps into character data based on the maximum value and the minimum value.

10. The apparatus according to claim 9 , wherein the operations further comprise:

storing the character data corresponding to the gray values of the plurality of pixels in the plurality of feature maps of the to-be-processed image as an image compression result, and storing the maximum value and the minimum value of the gray values of the plurality of pixels in the plurality of feature maps of the to-be-processed image.

11. A non-transitory computer-readable storage medium storing a computer program, the computer program when executed by one or more processors, causes the one or more processors to perform operations, the operations comprising:

acquiring a to-be-processed image; and

performing feature extraction on the to-be-processed image by using a convolutional neural network corresponding to a trained image compression model to obtain a plurality of feature maps;

a difference between the to-be-processed image and a reconstructed image obtained by reconstructing the plurality of feature maps through a deconvolution neural network corresponding to a trained image reconstruction model satisfying a preset condition;

wherein the image compression model and the image reconstruction model are trained as follows:

acquiring a sample image and performing a comparison step;

the comparison step comprises: inputting the sample image into the image compression model, outputting a plurality of sample feature maps, inputting the plurality of sample feature maps into the deconvolution neural network corresponding to the image reconstruction model to reconstruct the plurality of sample feature maps to obtain a reconstructed image of the sample image, creating a loss function based on a difference between the sample image and the reconstructed image of the sample image, and determining whether a value of the loss function satisfies a preset convergence condition;

updating at least one of a parameter of the convolutional neural network corresponding to the image compression model or a parameter of the deconvolution neural network corresponding to the image reconstruction model using a gradient descent method based on the loss function, if a result of the comparison step is negative, and performing the comparison step based on the updated parameter; and

outputting the parameter of the convolutional neural network corresponding to the image compression model and the parameter of the deconvolution neural network corresponding to the image reconstruction model, if the result of the comparison step is positive.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 13, 2018
From: WENG, RENLIANG
To: BAIDU ONLINE NETWORK TECHNOLOGY (BEIJING) CO., LTD.
Reel/Frame 046871/0671 →
Continuity (1)
Related Publication 20190206091A1 · Jul 4, 2019
Cited By (1)
US 12,631,554