Image compression method and device and terminal equipment

文档序号:1508883 发布日期:2020-02-07 浏览:30次 中文

阅读说明:本技术 一种图像压缩方法、装置及终端设备 (Image compression method and device and terminal equipment ) 是由 袁庆祝 于 2019-11-01 设计创作,主要内容包括:本发明适用于图像压缩技术领域,提供了一种图像压缩方法、装置及终端设备,所述方法包括:基于压缩网络的编码器提取原始图像的特征矩阵;基于所述压缩网络的超参网络得到所述特征矩阵每个位置的均值与方差;根据所述每个位置的均值与方差,对所述特征矩阵进行熵估计;根据所述熵估计的结果对所述特征矩阵进行算术编码得到二进制文件;对所述二进制文件进行算术解码,并基于压缩网络的解码器得到所述原始图像的重构图像。本发明通过预测特征矩阵的分布来减少进行算术编码所需要的码字,提升了编码速度且减少了需要存储的内存空间。(The invention is suitable for the technical field of image compression, and provides an image compression method, an image compression device and terminal equipment, wherein the method comprises the following steps: extracting a characteristic matrix of an original image by an encoder based on a compression network; obtaining the mean value and the variance of each position of the feature matrix based on the hyper-parametric network of the compressed network; performing entropy estimation on the feature matrix according to the mean value and the variance of each position; performing arithmetic coding on the feature matrix according to the result of entropy estimation to obtain a binary file; and performing arithmetic decoding on the binary file, and obtaining a reconstructed image of the original image based on a decoder of a compression network. The invention reduces code words required by arithmetic coding by predicting the distribution of the characteristic matrix, improves the coding speed and reduces the memory space required to be stored.)

1. An image compression method, comprising:

extracting a characteristic matrix of an original image by an encoder based on a compression network;

obtaining the mean value and the variance of each position of the feature matrix based on the hyper-parametric network of the compressed network;

performing entropy estimation on the feature matrix according to the mean value and the variance of each position;

performing arithmetic coding on the feature matrix according to the result of entropy estimation to obtain a binary file;

and performing arithmetic decoding on the binary file, and obtaining a reconstructed image of the original image based on a decoder of a compression network.

2. The image compression method of claim 1,

the compression network comprises: an encoder, a hyperreference network, a full connectivity layer, and a decoder.

3. The image compression method of any one of claims 1-2, wherein the deriving the mean and variance of each position of the feature matrix based on the hyperreference network of the compression network comprises:

inputting the feature matrix into the super-parameter network to obtain super-parameter network output;

and inputting the value of the characteristic matrix and the output of the hyper-parameter network into the full connection layer after concat operation to obtain the mean value and the variance of each position of the characteristic matrix.

4. The image compression method of claim 1, wherein the entropy estimating the feature matrix based on the mean and variance of each location comprises:

and based on the Laplace distribution, performing entropy estimation on the feature matrix according to the mean value and the variance of each position.

5. The method of any image compression of claim 3, wherein the inputting the values of the feature matrix and the hyper-parameter network output to the fully-connected layer after concat operation comprises:

performing round operation on the feature matrix;

and performing concat operation on the feature matrix after the round operation and the super-parameter network output based on a preset matrix block, and inputting the feature matrix and the super-parameter network output into the full connection layer.

6. An image compression apparatus, comprising:

the characteristic extraction module is used for extracting a characteristic matrix of an original image based on an encoder of a compression network;

the mean variance module is used for obtaining the mean and the variance of each position of the feature matrix based on the hyper-parametric network of the compression network;

the entropy estimation module is used for carrying out entropy estimation on the characteristic matrix according to the mean value and the variance of each position;

the arithmetic coding module is used for carrying out arithmetic coding on the characteristic matrix according to the result of the entropy estimation to obtain a binary file;

and the reconstruction module is used for performing arithmetic decoding on the binary file and obtaining a reconstructed image of the original image based on a decoder of a compression network.

7. The image compression method of claim 6,

the compression network comprises: an encoder, a hyperreference network, a full connectivity layer, and a decoder.

8. The image compression method of any one of claims 6-7, wherein the mean variance module comprises:

the super-parameter network unit is used for inputting the characteristic matrix into the super-parameter network to obtain super-parameter network output;

and the full connection layer unit is used for inputting the value of the characteristic matrix and the super-parameter network output into the full connection layer after concat operation so as to obtain the mean value and the variance of each position of the characteristic matrix.

9. An image compression terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 5 when executing the computer program.

10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.

Technical Field

The invention belongs to the technical field of image compression, and particularly relates to an image compression method, an image compression device and terminal equipment.

Background

The existing image compression technology based on the neural network needs more code words when arithmetic coding is carried out in the network training process, so that the coding speed is low and the memory space required to be stored is too much.

Disclosure of Invention

In view of this, embodiments of the present invention provide an image compression method, an image compression apparatus, and a terminal device, so as to solve the problem in the prior art that many codewords are required when performing arithmetic coding.

A first aspect of an embodiment of the present invention provides an image compression method, including:

extracting a characteristic matrix of an original image by an encoder based on a compression network;

obtaining the mean value and the variance of each position of the feature matrix based on the hyper-parametric network of the compressed network;

performing entropy estimation on the feature matrix according to the mean value and the variance of each position;

performing arithmetic coding on the feature matrix according to the result of entropy estimation to obtain a binary file;

and performing arithmetic decoding on the binary file, and obtaining a reconstructed image of the original image based on a decoder of a compression network.

A second aspect of an embodiment of the present invention provides an image compression apparatus, including:

the characteristic extraction module is used for extracting a characteristic matrix of an original image based on an encoder of a compression network;

the mean variance module is used for obtaining the mean and the variance of each position of the feature matrix based on the hyper-parametric network of the compression network;

the entropy estimation module is used for carrying out entropy estimation on the characteristic matrix according to the mean value and the variance of each position;

the arithmetic coding module is used for carrying out arithmetic coding on the characteristic matrix according to the result of the entropy estimation to obtain a binary file;

and the reconstruction module is used for performing arithmetic decoding on the binary file and obtaining a reconstructed image of the original image based on a decoder of a compression network.

A third aspect of embodiments of the present invention provides an image compression terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method provided in the first aspect when executing the computer program.

A fourth aspect of embodiments of the present invention provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the method as provided in the first aspect above.

Compared with the prior art, the embodiment of the invention has the following beneficial effects:

the invention reduces code words required by arithmetic coding by predicting the distribution of the characteristic matrix, improves the coding speed and reduces the memory space required to be stored compared with the prior art.

Drawings

In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.

FIG. 1 is a schematic diagram of an implementation flow of an image compression method provided by an embodiment of the present invention;

FIG. 2 is an exemplary diagram of a compression network provided by an embodiment of the present invention;

FIG. 3 is a schematic diagram of an image compression apparatus provided by an embodiment of the present invention;

fig. 4 is a schematic diagram of an image compression terminal device provided by an embodiment of the present invention.

Detailed Description

In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.

In order to explain the technical means of the present invention, the following description will be given by way of specific examples.

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:多媒体传输方法及其装置、介质和系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类