C ONTEXT - ADAPTIVE E NTROPY M ODEL FOR E ND - TOEND O PTIMIZED I MAGE C OMPRESSION
Anonymous authors
Paper under double-blind review
A BSTRACT
We propose a context-adaptive entropy model for use in end-to-end optimized image compression.
Our model exploits two types of contexts, bit-consuming contexts and bit-free contexts, distinguished based upon whether additional bit allocation is required.
Based on these contexts, we allow the model to more accurately estimate the distribution of each latent representation with a more generalized form of the approximation models, which accordingly leads to an enhanced compression performance.
Based on the experimental results, the proposed method outperforms the traditional image codecs, such as BPG and JPEG2000, as well as other previous artiﬁcial-neural-network (ANN) based approaches, in terms of the peak signal-to-noise ratio (PSNR) and multi-scale structural similarity (MSSSIM) index
I NTRODUCTION
Recently, artiﬁcial neural networks (ANNs) have been applied in various areas and have achieved a number of breakthroughs resulting from their superior optimization and representation learning performance.
In particular, for various problems that are sufﬁciently straightforward that they can be solved within a short period of time by hand, a number of ANN-based studies have been conducted and signiﬁcant progress has been made.
With regard to image compression, however, relatively slow progress has been made owing to its complicated target problems.
A number of works, focusing on the quality enhancement of reconstructed images, were proposed.
For instance, certain approaches (Dong et al., 2015; Svoboda et al., 2016; Zhang et al., 2017) have been proposed to reduce artifacts caused by image compression, relying on the superior image restoration capability of an ANN.
Although it is indisputable that artifact reduction is one of the most promising areas exploiting the advantages of ANNs, such approaches can be viewed as a type of post-processing, rather than image compression itself.
Regarding ANN-based image compression, the previous methods can be divided into two types.
First, as a consequence of the recent success of generative models, some image compression approaches targeting the superior perceptual quality (Agustsson et al., 2018; Santurkar et al., 2018;
Rippel & Bourdev, 2017) have been proposed.
The basic idea here is that learning the distribution of natural images enables a very high compression level without severe perceptual loss by allowing the generation of image components, such as textures, which do not highly affect the structure or the perceptual quality of the reconstructed images.
Although the generated images are very realistic, the acceptability of the machine-created image components eventually becomes somewhat applicationdependent.
Meanwhile, a few end-to-end optimized ANN-based approaches (Toderici et al., 2017;
Johnston et al., 2018; Ball´e et al., 2017; Theis et al., 2017; Ball´e et al., 2018), without generative models, have been proposed.
In these approaches, unlike traditional codecs comprising separate tools, such as prediction, transform, and quantization, a comprehensive solution covering all functions has been sought after using end-to-end optimization.
Toderici et al.
(2017)’s approach exploits a small number of latent binary representations to contain the compressed information in every step, and each step increasingly stacks the additional latent representations to achieve a progressive improvement in quality of the reconstructed images.
Johnston et al.
(2018) improved the compression performance by enhancing operation methods of the networks developed by Toderici et al.
Although Toderici et al.
; Johnston et al.
(2018) provided novel frameworks suitable to quality control using a single trained network, the increasing number of iteration steps to obtain higher image quality can be a burden to certain applications.
In contrast to the approaches developed by
Toderici et al.
(2017) and Johnston et al.
(2018), which extract binary representations with as high an entropy as possible, Ball ´ e et al.
(2017), Theis et al.
(2017), and Ball ´ e et al.
(2018) regard the image compression problem as being how to retrieve discrete latent representations having as low an entropy as possible.
In other words, the target problem of the former methods can be viewed as how to include as much information as possible in a ﬁxed number of representations, whereas the latter is simply how to reduce the expected bit-rate when a sufﬁcient number of representations are given, assuming that the low entropy corresponds to small number of bits from the entropy coder.
To solve the second target problem, Ball´e et al.
(2017), Theis et al.
(2017), and Ball´e et al.
(2018) adopt their own entropy models to approximate the actual distributions of the discrete latent representations.
More speciﬁcally, Ball ´ e et al.
(2017) and Theis et al.
(2017) proposed novel frameworks that exploit the entropy models, and proved their performance capabilities by comparing the results with those of conventional codecs such as JPEG2000.
Whereas Ball ´ e et al.
(2017) and Theis et al.
(2017) assume that each representation has a ﬁxed distribution, Ball ´ e et al.
(2018) introduced an input-adaptive entropy model that estimates the scale of the distribution for each representation.
This idea is based on the characteristics of natural images in which the scales of the representations vary together in adjacent areas.
They provided test results that outperform all previous ANN-based approaches, and reach very close to those of BPG (Bellard, 2014), which is known as a subset of HEVC (ISO/IEC 23008-2, ITU-T H.265), used for image compression.
One of the principle elements in end-to-end optimized image compression is the trainable entropy model used for the latent representations.
Because the actual distributions of latent representations are unknown, the entropy models provide the means to estimate the required bits for encoding the latent representations by approximating their distributions.
When an input image x is transformed into a latent representation y
and then uniformly quantized into ˆ y , the simple entropy model can be represented by p ˆ y
( ˆ y ) , as described by Ball´e et al.
When the actual marginal distribution of ˆ y is denoted as m ( ˆ y ) , the rate estimation, calculated through cross entropy using the entropy model, p ˆ y ( ˆ y ) , can be represented as shown in equation (1), and can be decomposed into the actual entropy of ˆ y and the additional bits owing to a mismatch between the actual distributions and their approximations.
Therefore, decreasing the rate term R during the training process allows the entropy model p
ˆ y ( ˆ y )
to approximate m ( ˆ y ) as closely as possible, and let the other parameters transform x into y properly such that the actual entropy of ˆ y becomes small.
[Equation]
In terms of KL-divergence, R is minimized when p ˆ y ( ˆ y ) becomes perfectly matched with the actual distribution m ( ˆ y ) .
This means that the compression performance of the methods essentially depends on the capacity of the entropy model.
To enhance the capacity, we propose a new entropy model that exploits two types of contexts, bit-consuming and bit-free contexts, distinguished according to whether additional bit allocation is required.
Utilizing these two contexts, we allow the model to more accurately estimate the distribution of each latent representation through the use of a more generalized form of the entropy models, and thus more effectively reduce the spatial dependencies among the adjacent latent representations.
Figure 1 demonstrates a comparison of the compression results of our method to those of other previous approaches.
The contributions of our work are as follows:
• We propose a new context-adaptive entropy model framework that incorporates the two different types of contexts.
• We provide the test results that outperform the widely used conventional image codec BPG in terms of the PSNR and MS-SSIM.
• We discuss the directions of improvement in the proposed methods in terms of the model capacity and the level of the contexts.
Note that we follow a number of notations given by Ball´e et al.
(2018) because our approach can be viewed as an extension of their work, in that we exploit the same rate-distortion (R-D) optimization framework.
The rest of this paper is organized as follows.
In Section 2, we introduce the key approaches of end-to-end optimized image compression and propose the context-adaptive entropy model.
Section 3 demonstrates the structure of the encoder and decoder models used, and the experimental setup and results are then given in section 4.
Finally, in Section 5, we discuss the current state of our work and directions for improvement.
E ND - TO - END OPTIMIZATION BASED ON CONTEXT - ADAPTIVE ENTROPY MODELS 2. P REVIOUS ENTROPY MODELS
Since they were ﬁrst proposed by Ball ´ e et al.
(2017) and Theis et al.
(2017), entropy models, which approximate the distribution of discrete latent representations, have noticeably improved the image compression performance of ANN-based approaches.
Ball ´ e et al.
(2017) assumes the entropy models of the latent representations as non-parametric models, whereas Theis et al.
(2017) adopted a Gaussian scale mixture model composed of six weighted zero-mean Gaussian models per representation.
Although they assume different forms of entropy models, they have a common feature in that both concentrate on learning the distributions of the representations without considering input adaptivity.
In other words, once the entropy models are trained, the trained model parameters for the representations are ﬁxed for any input during the test time.
Ball ´ e et al.
(2018), in contrast, introduced a novel entropy model that adaptively estimates the scales of the representations based on input.
They assume that the scales of the latent representations from the natural images tend to move together within an adjacent area.
To reduce this redundancy, they use a small amount of additional information by which the proper scale parameters (standard deviations) of the latent representations are estimated.
In addition to the scale estimation, Ball ´ e et al.
(2018) have also shown that when the prior probability density function (PDF) for each representation in a continuous domain is convolved with a standard uniform density function, it approximates the prior probability mass function (PMF) of the discrete latent representation, which is uniformly quantized by rounding, much more closely.
For training, a uniform noise is added to each latent representation so as to ﬁt the distribution of these noisy representations into the mentioned PMF-approximating functions.
Using these approaches, Ball´e et al.
(2018) achieved a state-of-the-art compression performance, close to that of
BPG.
2. S PATIAL DEPENDENCIES OF THE LATENT VARIABLES
The latent representations, when transformed through a convolutional neural network, essentially contain spatial dependencies because the same convolutional ﬁlters are shared across the spatial regions, and natural images have various factors in common within adjacent regions.
Ball ´ e et al.
(2018) successfully captured these spatial dependencies and enhanced the compression performance by input-adaptively estimating standard deviations of the latent representations.
Taking a step forward, we generalize the form of the estimated distribution by allowing, in addition to the standard deviation, the mean estimation utilizing the contexts.
For instance, assuming that certain representations tend to have similar values within a spatially adjacent area, when all neighborhood representations have a value of 10, we can intuitively guess that, for the current representation, the chance of having a value equal or similar to 10 is relatively high.
This simple estimation will consequently reduce the entropy.
Likewise, our method utilizes the given contexts for estimating the mean, as well as the standard deviation, of each latent representation.
Note that Toderici et al.
(2017), Johnston et al.
(2018), and Rippel & Bourdev (2017)
also apply context-adaptive entropy coding by estimating the probability of each binary representation.
However, these context-adaptive entropy-coding methods can be viewed as separate components, rather than one end-to-end optimization component because their probability estimation does not directly contribute to the rate term of the R-D optimization framework.
Figure 2 visualizes the latent variables ˆ y and their normalized versions of the two different approaches, one estimating only the standard deviation parameters and the other estimating both the mu and standard deviation parameters with the two types of mentioned contexts.
The visualization shows that the spatial dependency can be removed more effectively when the mu is estimated along with the given contexts.
2. C ONTEXT - ADAPTIVE ENTROPY MODEL
The optimization problem described in this paper is similar with Ball ´ e et al.
(2018), in that the input x is transformed into y having a low entropy, and the spatial dependencies of y are captured into ˆ z .
Therefore, we also use four fundamental parametric transform functions: an analysis transform g a ( x ; φ g ) to transform x into a latent representation y , a synthesis transform g s ( ˆ y ; θ g ) to reconstruct image ˆ x , an analysis transform h a ( ˆ y ; φ h ) to capture the spatial redundancies of ˆ y into a latent representation z , and a synthesis transform h s ( ˆ z ; θ h ) used to generate the contexts for the model estimation.
Note that h s does not estimate the standard deviations of the representations directly as in Ball´e et al.
(2018)’s approach.
In our method, instead, h s generates the context c (cid:48) , one of the two types of contexts for estimating the distribution.
These two types of contexts are described in this section.
Ball´e et al.
(2018) analyzed the optimization problem from the viewpoint of the variational autoencoder (Kingma & Welling (2014); Rezende et al.
and showed that the minimization of the
KL-divergence is the same problem as the R-D optimization of image compression.
Basically, we follow the same concept; however, for training, we use the discrete representations on the conditions instead of the noisy representations, and thus the noisy representations are only used as the inputs to the entropy models.
Empirically, we found that using discrete representations on the conditions show better results, as shown in appendix 6.2.
These results might come from removing the mismatches of the conditions between the training and testing, thereby enhancing the training capacity by limiting the affect of the uniform noise only to help the approximation to the probability mass functions.
We use the gradient overriding method with the identity function, as in Theis et al.
(2017), to deal with the discontinuities from the uniform quantization.
The resulting objective function used in this paper is given in equation (2).
The total loss consists of two terms representing the rates and distortions, and the coefﬁcient λ controls the balance between the rate and distortion during the R-D optimization.
Note that λ is not an optimization target, but a manually conﬁgured condition that determines which to focus on between rate and distortion:
[Equation]
Here, the noisy representations of ˜ y and ˜
z follow the standard uniform distribution, the mean values of which are y and z , respectively, when y and z are the result of the transforms g a
and h a , repectively.
Note that the input to h a is ˆ y , which is a uniformly quantized representation of y , rather than the noisy representation ˜ y .
Q denotes the uniform quantization function, for which we simply use a rounding function:
[Equation]
with
[Equation] = g
[Equation]
The rate term represents the expected bits calculated using the entropy models of p ˜
y
| ˆ z and p ˜ z .
Note that p ˜ y
| ˆ z and p ˜
z are eventually the approximations of p ˆ y | ˆ z and p ˆ z , respectively.
Equation (4) represents the entropy model for approximating the required bits for ˆ y .
The model is based on the
Gaussian model, which not only has the standard deviation parameter σ i , but also the mu parameter µ i .
The values of µ i and σ i are estimated from the two types of given contexts based on the function f , the distribution estimator, in a deterministic manner.
The two types of contexts, bit-consuming and bit-free contexts, for estimating the distribution of a certain representation are denoted as c (cid:48)
i and c (cid:48)(cid:48) i .
E (cid:48) extracts c (cid:48)
i from c (cid:48) , the result of transform h s .
In contrast to c (cid:48)
i , no additional bit allocation is required for c (cid:48)(cid:48) i .
Instead, we simply utilize the known (already entropy-coded or decoded) subset of ˆ y , denoted as (cid:104)
ˆ y (cid:105) .
Here, c (cid:48)(cid:48)
i is extracted from (cid:104)
ˆ y (cid:105) by the extractor E (cid:48)(cid:48) .
We assume that the entropy coder and the decoder sequentially process ˆ y i in the same speciﬁc order, such as with raster scanning, and thus (cid:104) ˆ y (cid:105) given to the encoder and decoder can always be identical when processing the same ˆ y i .
A formal expression of this is as follows:
[Equation]
[Equation]
with µ
[Equation]
In the case of ˆ z , a simple entropy model is used.
We assumed that the model follows zero-mean
Gaussian distributions which have a trainable σ .
Note that ˆ z is regarded as side information and it contributes a very small amount of the total bit-rate, as described by Ball´e et al.
(2018), and thus we use this simpler version of the entropy model, rather than a more complex model, for end-to-end optimization over all parameters of the proposed method:
[Equation]
h s , μ i σ i σ z ̃ σ z ̂
EC U|Q
ED y y ̃ entropymodel for z
U|Q y
̂ z ̂ g a g s h a h s
Encoder
Decoder x x ̂ c ′ y ̂
EC
ED z ̂ entropymodel for z ̂ entropy model for entropy model for ∣ y ̂ z ̂ ∣ y ̂ z ̂ ⟨ ⟩ y ̂
E' c ′
i
E'' c ″ i , μ i σ i ⟨ ⟩ y ̂ E'' c ″ i c ′ E' c ′ i
Note that actual entropy coding or decoding processes are not necessarily required for training or encoding because the rate term is not the amount of real bits, but an estimation calculated from the entropy models, as mentioned previously.
We calculate the distortion term using the mean squared error (MSE) 1 , assuming that p x | ˆ y follows a Gaussian distribution as a widely used distortion metric.
E NCODER - DECODER MODEL
This section describes the basic structure of the proposed encoder-decoder model.
On the encoder side, an input image is transformed into latent representations, quantized, and then entropy-coded using the trained entropy models.
In contrast, the decoder ﬁrst applies entropy decoding with the same entropy models used for the encoder, and reconstructs the image from the latent representations, as illustrated in ﬁgure 3.
It is assumed that all parameters that appear in this section were already trained.
The structure of the encoder-decoder model basically includes g a and g s in charge of the transform of x into y and its inverse transform, respectively.
The transformed y is uniformly quantized into ˆ y by rounding.
Note that, in the case of approaches based on the entropy models, unlike traditional codecs, tuning the quantization steps is usually unnecessary because the scales of the representations are optimized together through training.
The other components between g a
and g s carry out the role of entropy coding (or decoding) with the shared entropy models and underlying context preparation processes.
More speciﬁcally, the entropy model estimates the distribution of each ˆ y i individually, in which µ i and σ i are estimated with the two types of given contexts, c (cid:48)
i and c (cid:48)(cid:48) i .
Among these contexts, c (cid:48) can be viewed as side information, which requires an additional bit allocation.
To reduce the required bit-rate for carrying c (cid:48) , the latent representation z , transformed from ˆ y , is quantized and entropy-coded by its own entropy model, as speciﬁed in section 2.3.
On the other hand, c (cid:48)(cid:48)
i is extracted from (cid:104) ˆ y (cid:105) , without any additional bit allocation.
Note that (cid:104) ˆ y (cid:105) varies as the entropy coding or decoding progresses, but is always identical for processing the same ˆ y i in both the encoder and decoder, as described in 2.3.
The parameters of h s and the entropy models are simply shared by both the encoder and the decoder.
Note that the inputs to the entropy models during training are the noisy representations, as illustrated with the dotted line in ﬁgure 3, to allow the entropy model to approximate the probability mass functions of the discrete representations.
c on v
M x 3 x 3 /↓ c on v N x 5 x 5 / 2 ↓ c on v N x 5 x 5 / 2 ↓ c on v N x 5 x 5 / 2 ↓ c on v
M x 5 x 5 /↓
G DN
G DN
G DN c on v N x 3 x 3 /c on v N x 5 x 5 / 2 ↓ c on v N x 5 x 5 / 2 ↓ ab s
R eL U
R eL U c on vx 5 x 5 / 2 ↑ c on v N x 5 x 5 / 2 ↑ c on v N x 5 x 5 / 2 ↑ c on v N x 5 x 5 / 2 ↑
I G DN
I G DN I G DN
Q c on v
M x 3 x 3 /c on v N x 5 x 5 / 2 ↑ c on v N x 5 x 5 / 2 ↑ e x p
R eL U R eL U
QT
EC
ED
EC
ED c on c a t f , μ i σ i
E' f c on v
M x 3 x 3 /c on v
M x 3 x 3 /l ea ky
R eL U l ea ky R eL U l ea ky
R eL U
F CN 2 * M σ i μ i
M
M y
[Figure]
̂ z z ̂
[Figure]
̂ z ̂
[Figure]
h
[Figure]
h s unseenarea c ′ c ′ i c ″
i E''
c ″ i c i
M
M [Figure] r e c on s t r u c t i on x ̂ [Figure]
m
[Figure] on [Figure] of the convolutional layer follow Ball ´ e et al.
(2018): the number of ﬁlters × ﬁlter height × ﬁlter width / the downscale or upscale factor, where ↑ and ↓ denote the up and downscaling, respectively.
For up or downscaling, we use the transposed convolution.
E XPERIMENTS 4. I MPLEMENTATION
We use a convolutional neural networks to implement the analysis transform and the synthesis transform functions, g a , g s , h a , and h s .
The structures of the implemented networks follow the same structures of Ball´e et al.
(2018), except that we use the exponentiation operator instead of an absolute operator at the end of h s .
Based on Ball ´ e et al.
(2018)’s structure, we added the components to estimate the distribution of each ˆ y i , as shown in ﬁgure 4.
Herein, we represent a uniform quantization (round) as ”Q,” entropy coding as ”EC,” and entropy decoding as ”ED.”
The distribution estimator is denoted as f , and is also implemented using the convolutional layers which takes channel-wise concatenated c (cid:48)
i and c (cid:48)(cid:48) i as inputs and provides estimated µ i and σ i as results.
Note that the same c (cid:48)
i and c (cid:48)(cid:48)
i are shared for all
ˆ
y
i s located at the same spatial position.
In other words, we let E (cid:48) extract all spatially adjacent elements from c (cid:48) across the channels to retrieve c (cid:48)
i and likewise let E (cid:48)(cid:48) extract all adjacent known elements from (cid:104)
ˆ y (cid:105) for c (cid:48)(cid:48)
i .
This could have the effect of capturing the remaining correlations among the different channels.
In short, when M is the total number of channels of y , we let f estimate all M distributions of ˆ y i s, which are located at the same spatial position, using only a single step, thereby allowing the total number of estimations to be reduced.
Furthermore, the parameters of f are shared for all spatial positions of ˆ y , and thus only one trained f per λ is necessary to process any sized images.
In the case of training, however, collecting the results from the all spatial positions to calculate the rate term becomes a signiﬁcant burden, despite the simpliﬁcations mentioned above.
To reduce this burden, we designate a certain number (16 in the experiments) of random spatial points as the representatives per training step, to calculate the rate term easily.
Note that we let these random points contribute solely to the rate term, whereas the distortion is still calculated over all of the images.
Because y is a three-dimensional array in our implementation, index i can be represented as three indexes, k , l , and m , representing the horizontal index, the vertical index, and the channel index, respectively.
When the current position is given as ( k, l, m ) , E (cid:48) extracts c (cid:48)
[ k − 2 ...
k +1] , [ l − 3 ...
l ] , [1 ...M ] as c (cid:48) i , and E (cid:48)(cid:48) extracts (cid:104)
ˆ y (cid:105)
[ k − 2 ...k +1] , [ l − 3 ...
l ] , [1 ...M ] as c (cid:48)(cid:48)
i , when (cid:104) ˆ y (cid:105) represents the known area of ˆ y .
Note that we ﬁlled in the unknown area of (cid:104)
ˆ y (cid:105) with zeros, to maintain the dimensions of (cid:104)
ˆ y (cid:105) identical to those of ˆ y .
Consequently, c (cid:48)(cid:48) i [3 ... 4] , 4 , [1 ...M ] are always padded with zeros.
To keep the dimensions of the estimation results to the inputs, the marginal areas of c (cid:48) and (cid:104) ˆ y (cid:105) are also set to zeros.
Note that when training or encoding, c (cid:48)(cid:48)
i can be extracted using simple 4 × 4 × M windows and binary masks, thereby enabling parallel processing, whereas a sequential reconstruction is inevitable for decoding.
Another implementation technique used to reduce the implementation cost is combining the lightweight entropy model with the proposed model.
The lightweight entropy model assumes that the representations follow a zero-mean Gaussian model with the estimated standard deviations, which is very similar with Ball´e et al.
(2018)’s approach.
We utilize this hybrid approach for the top four cases, in bit-rate descending order, of the nine λ conﬁgurations, based on the assumption that for the higher-quality compression, the number of sparse representations having a very low spatial dependency increases, and thus a direct scale estimation provides sufﬁcient performance for these added representations.
For implementation, we separate the latent representation y into two parts, y 1 and y 2 , and two different entropy models are applied for them.
Note that the parameters of g a , g s , h a , and h s are shared, and all parameters are still trained together.
The detailed structure and experimental settings are described in appendix 6.1.
The number of parameters N and M are set to 128 and 192, respectively, for the ﬁve λ conﬁgurations for lower bit-rates, whereas 2-3 times more parameters, described in appendix 6.1, are used for the four λ conﬁgurations for higher bit-rates.
Tensorﬂow and Python were used to setup the overall network structures, and for the actual entropy coding and decoding using the estimated model parameters, we implemented an arithmetic coder and decoder, for which the source code of the ”Reference arithmetic coding” project 2 was used as the base code.
4. E XPERIMENTAL ENVIRONMENTS
We optimized the networks using two different types of distortion terms, one with MSE and the other with MS-SSIM.
For each distortion type, the average bits per pixel (BPP) and the distortion, PSNR and MS-SSIM, over the test set are measured for each of the nine λ conﬁgurations.
Therefore, a total of 18 networks are trained and evaluated within the experimental environments, as explained below:
• For training, we used 256 × 256 patches extracted from 32,420 randomly selected YFCC100m
(Thomee et al.
(2016)) images.
We extracted one patch per image, and the extracted regions were randomly chosen.
Each batch consists of eight images, and 1M iterations of the training steps were conducted, applying the ADAM optimizer (Kingma & Ba (2015)).
We set the initial learning rate to 5 × 10 − 5 , and reduced the rate by half every 50,000 iterations for the last 200,000 iterations.
Note that, in the case of the four λ conﬁgurations for high bpp, in which the hybrid entropy model is used, 1M iterations of pre-training steps were conducted using the learning rate of 1 × 10 − 5 .
Although we previously indicated that the total loss is the sum of R and λD for a simple explanation, we tuned the balancing parameter λ in a similar way as Theis et al.
(2017), as indicated in equation (6).
We used the λ parameters ranging from 0.01 to 0.5.
[Equation]
• For the evaluation, we measured the average BPP and average quality of the reconstructed images in terms of the PSNR and MS-SSIM over 24 PNG images of the Kodak PhotoCD image dataset (Kodak, 1993).
Note that we represent the MS-SSIM results in the form of decibels, as in Ball´e et al.
(2018), to increase the discrimination.
4. E XPERIMENTAL RESULTS
We compared the test results with other previous methods, including traditional codecs such as BPG and JPEG2000, as well as previous ANN-based approaches such as Theis et al.
(2017) and Ball´e et al.
Because two different quality metrics are used, the results are presented with two separate plots.
As shown in ﬁgure 5, our methods outperform all other previous methods in metrics.
In particular, our models not only outperform Ball´e et al.
(2018)’s method, which is believed to be a state-of-the-art ANN-based approach, but we also obtain better results than the widely used conventional image codec, BPG.
More speciﬁcally, the compression gains in terms of the BD-rate of PSNR over JPEG2000, Ball ´ e et al.
(2018)’s approach (MSE-optimized), and BPG are 34.08%, 11.87%, and 6.85%, respectively.
In the case of MS-SSIM, we found wider gaps of 68.82%, 13.93%, and 49.68%, respectively.
Note that we achieved signiﬁcant gains over traditional codecs in terms of MS-SSIM, although this might be because the dominant target metric of the traditional codec developments have been the PSNR.
In other words, they can be viewed as a type of MSE-optimized codec.
Even when setting aside the case of MS-SSIM, our results can be viewed as one concrete evidence supporting that ANN-based image compression can outperform the existing traditional image codecs in terms of the compression performance.
Supplemental image samples are provided in appendix 6.3.
D ISCUSSION
Based on previous ANN-based image compression approaches utilizing entropy models (Ball´e et al., 2017; Theis et al., 2017; Ball´e et al., 2018), we extended the entropy model to exploit two different types of contexts.
These contexts allow the entropy models to more accurately estimate the distribution of the representations with a more generalized form having both mean and standard deviation parameters.
Based on the evaluation results, we showed the superiority of the proposed method.
The contexts we utilized are divided into two types.
One is a sort of free context, containing the part of the latent variables known to both the encoder and the decoder, whereas the other is the context, which requires additional bit allocation.
Because the former is a generally used context in a variety of codecs, and the latter was already veriﬁed to help compression using Ball´e et al.
(2018)’s approach, our contributions are not the contexts themselves, but can be viewed as providing a framework of entropy models utilizing these contexts.
Although the experiments showed the best results in the ANN-based image compression domain, we still have various studies to conduct to further improve the performance.
One possible way is generalizing the distribution models underlying the entropy model.
Although we enhanced the performance by generalizing the previous entropy models, and have achieved quite acceptable results, the Gaussian-based entropy models apparently have a limited expression power.
If more elaborate models, such as the non-parametric models of Ball´e et al.
(2018) or Oord et al.
(2016), are combined with the context-adaptivity proposed in this paper, they would provide better results by reducing the mismatch between the actual distributions and the approximation models.
Another possible way is improving the level of the contexts.
Currently, our methods only use low-level representations within very limited adjacent areas.
However, if the sufﬁcient capacity of the networks and higher-level contexts are given, a much more accurate estimation could be possible.
For instance, if an entropy model understands the structures of human faces, in that they usually have two eyes, between which a symmetry exists, the entropy model could approximate the distributions more accurately when encoding the second eye of a human face by referencing the shape and position of the ﬁrst given eye.
As is widely known, various generative models (Goodfellow et al., 2014;
Radford et al., 2016;
Zhao et al., 2017) learn the distribution p ( x ) of the images within a speciﬁc domain, such as human faces or bedrooms.
In addition, various in-painting methods (Pathak et al., 2016; Yang et al., 2017; Yeh et al., 2017) learn the conditional distribution p ( x | c ontext ) when the viewed areas are given as c ontext .
Although these methods have not been developed for image compression, hopefully such high-level understandings can be utilized sooner or later.
Furthermore, the contexts carried using side information can also be extended to some high-level information such as segmentation maps or any other information that helps with compression.
Segmentation maps, for instance, may be able to help the entropy models estimate the distribution of a representation discriminatively according to the segment class the representation belongs to.
Traditional codecs have a long development history, and a vast number of hand-crafted heuristics have been stacked thus far, not only for enhancing compression performance, but also for compromising computational complexities.
Therefore, ANN-based image compression approaches may not provide satisfactory solutions as of yet, when taking their high complexity into account.
However, considering its much shorter history, we believe that ANN-based image compression has much more potential and possibility in terms of future extension.
Although we remain a long way from completion, we hope the proposed context-adaptive entropy model will provide an useful contribution to this area.
A CKNOWLEDGMENTS
This work was supported by Institute for Information & communications Technology Promotion(IITP) grant funded by the Korea government (MSIT)
(No. 2017-0-00072, Development of
Audio/Video Coding and Light Field Media Fundamental Technologies for Ultra Realistic Teramedia).
A PPENDIX 6. H YBRID NETWORK FOR HIGHER BIT - RATE COMPRESSIONS
We combined the lightweight entropy model with the context-adaptive entropy model to reduce the implementation costs for high-bpp conﬁgurations.
The lightweight model exploits the scale (standard deviation) estimation, assuming that the PMF approximations of the quantized representations follow zero-mean Gaussian distributions convolved with a standard uniform distribution.
Figure 6 illustrates the network structure of this hybrid network.
The representation y is split channel-wise into two parts, y 1 and y 2 , which have M 1 and M 2 channels, respectively, and is then quantized.
Here, ˆ y 1 is entropy coded using the proposed entropy model, whereas ˆ y 2 is coded with the lightweight entropy model.
The standard deviations of ˆ y 2 are estimated using h a and h s .
Unlike the context-adaptive entropy model, which uses the results of h a ( ˆ c (cid:48) ) as the input source to the estimator f , the lightweight entropy model retrieves the estimated standard deviations from h a directly.
Note that h a takes the concatenated ˆ y 1 and ˆ y 2 as input, and h s generates ˆ c (cid:48) as well as σ 2 , at the same time.
The total loss function also consists of the rate and distortion terms, although the rate is divided into three parts, each of which is for ˆ y 1 , ˆ y 2 , and ˆ z , respectively.
The distortion term is the same as before, but note that ˆ y is the channel-wise concatenated representation of ˆ y 1 and ˆ y 2 :
[Equation]
(7) with
[Equation]
Here, the noisy representations of ˜ y 1 , ˜ y 2 , and ˜
z follow a standard uniform distribution, the mean values of which are y 1 , y 2 , and z , respectively.
In addition, y 1 and y 2 are channel-wise split representations from y , the results of the transform g a , and have M 1 and M 2 channels, respectively:
[Equation]
with y 1 , y 2 =
S ( g a ( x
[Equation]
φ g )) ,
ˆ y = Q ( y 1 )
⊕ Q ( y 2 ) ,
z = h a ( ˆ y ; φ h ) .
The rate term for ˆ y 1 is the same model as that of equation (4).
Note that ˆ σ 2 does not contribute here, but does contribute to the model for ˆ y 2 :
[Equation]
with µ 1 i , σ 1 i = f ( c (cid:48)
i , c (cid:48)(cid:48) i )
[Equation]
The rate term for ˆ y 2 is almost the same as Ball ´ e et al.
(2018), except that noisy representations are only used as the inputs to the entropy models for training, and not for the conditions of the models.
[Equation]
The model of z is the same as in equation (5).
For implementation, we used this hybrid structure for the top-four conﬁgurations in bit-rate descending order.
We set N , M 1 , and M 2 to 400, 192, and 408, respectively, for the top-two conﬁgurations, and to 320, 192, and 228, respectively, for the next two conﬁgurations.
In addition, we measured average execution time per image, spent for encoding and decoding Kodak PhotoCD image dataset (Kodak, 1993), to clarify beneﬁt of the hybrid model.
The test was conducted under CPU environments, Intel i9-7900X. Note that we ignored time for actual entropy coding because all models with the same values of N and M spend the same amount of time for entropy coding.
As shown in ﬁgure 7, the hybrid models clearly reduced execution time of the models. Setting N and M to 320 and 420, respectively, we obtained 46.83% of speed gain. With the higher number of parameters, 400 of N and 600 of M , we obtained 57.28% of speed gain. 6. T EST RESULTS OF THE MODELS TRAINED USING DIFFERENT TYPES OF REPRESENTATIONS
In this section, we provide test results of the two models, the proposed model trained using discrete representations as inputs to the synthesis transforms, g s and h s , and the same model but trained using noisy representations following the training process of Ball´e et al.
(2018)’s approach.
In detail, in training phase of the proposed model, we used quantized representations ˆ y and ˆ z as inputs to the transforms g s and h s , respectively, to ensure the same conditions of training and testing phases.
On the other hand, for training the compared model, representations ˜ y and ˜ z are used as inputs to the transforms.
An additional change of the proposed model is using ˆ y , instead of y , as inputs to h a , but note that this has nothing to do with the mismatches between training and testing.
We used them to match inputs to h a to targets of model estimation via f .
As shown in ﬁgure 8, the proposed model, trained using discrete representations, was 5.93% better than the model trained using noisy representations.
Compared with Ball´e et al.
(2018)’s approach, the performance gains of the two models, trained using discrete representations and noisy representations, were 11.87% and 7.13%, respectively.
6. S AMPLES OF THE EXPERIMENTS
In this section, we provide a few more supplemental test results.
Figures 9, 10, and 11 show the results of the MSE optimized version of our method, whereas ﬁgures 12 and 13 show the results of the MS-SSIM optimized version.
All ﬁgures include a ground truth image and the reconstructed images for our method, BPG, and Ball ´ e et al.
(2018)’s approach, in the clockwise direction.