# Novel Image Compression and Deblocking Approach Using BPN and Deep Neural Network Architecture

Rajsekhar Reddy Manyam, R. Sivagami, R. Krishankumar, V. Sangeetha, K.

S. Ravichandran, Samarjit Kar

► To cite this version:

Rajsekhar Reddy Manyam, R. Sivagami, R. Krishankumar, V. Sangeetha, K. S. Ravichandran, et al.. Novel Image Compression and Deblocking Approach Using BPN and Deep Neural Network Architecture. 4th International Conference on Intelligence Science (ICIS), Feb 2021, Durgapur, India. pp.209-216, 10.1007/978-3-030-74826-5_18 . hal-03741723

HAL Id: hal-03741723

https://inria.hal.science/hal-03741723v1

Submitted on 1 Aug 2022

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons CC BY 4.0 - Attribution - International License
Novel image compression and deblocking approach using BPN
and Deep neural network architecture

Rajsekhar Reddy Manyam¹, R. Sivagami¹, R. Krishankumar¹, V. Sangeetha¹, K. S. Ravichandran¹, Samarjit Kar²*

¹ School of Computing, SASTRA University, Thanjavur 613401, TN, India

² Department of Mathematics, NIT Durgapur, West Bengal, India

Mail to: rajasekarreddy@it.sastra.edu; sivagamiramadass@sastra.ac.in; krishan-kumar@sastra.ac.in; sangeetha@sastra.ac.in; raviks@sastra.edu; sa-marjit.kar@maths.nitdgp.ac.in

Abstract

Medical imaging is an important source of digital information to diag-
nose the illness of a patient. The digital information generated consists
of different modalities that occupy more disk space, and the distribution
of the data occupies more bandwidth. A digital image compression tech-
nique that can reduce an image's size without losing much of its im-
portant information is challenging. In this paper, a novel image compres-
sion technique based on BPN and Arithmetic coders is proposed. The
high non-linearity and unpredictiveness of the interrelationship between
the pixels present in the image to be compressed is handled by BPN. An
efficient coding technique called Arithmetic coding is used to produce
an image with a better compression ratio and lower redundancy. A deep
CNN based image deblocker is used as a post-processing step to remove
the artefacts present in the reconstructed image to improve the quality of
the reconstructed image. The effectiveness of the proposed methodology
is validated in terms of PSNR. The proposed method is able to achieve
about a 3% improvement in PSNR compared with the existing methods.

**Keywords:** image compression, MRI, medical imaging, Arithmetic coders, deblocker, CNN

1. Introduction

The advancement in sensor technology paved the way to generate
more imaging data. A high-resolution medical image plays a key role in
telemedicine techniques for diagnosing diseases accurately[1]. These raw
data generated from the sensors occupy more disk space and high band-
width when transferring data. As the need for transmission and digital
storage of data has been increased abundantly, novel image compression
techniques have gained more popularity among the research community.

Some of the traditional techniques for image compression are trans-
form coding, predictive coding, and vector quantization. Transform
based coding generates a set of coefficients. The subsets of the coeffi-
cient allow good data representation and maintain good data compres-
sion. The transform-based compression highly depends on the choice of
the transformation adopted. Discrete cosine transform is the one popular
method highly used for image compression. Predictive coding tech-
niques calculate the similarity between the neighbouring pixels and re-
move the redundancy within the image. Vector quantization is based on
the codebook generated for compression. A hybrid approach to these
techniques was proposed to achieve high data compression.

Many researchers have proposed different architectures for image
compression with low information loss during compression and recon-
struction for medical images. [2] proposed a three-stage approach based
on convergence theory and an iterative process for reconstruction. How-
ever, the proposed method shows certain improvement in PSNR, the it-
erative method for reconstruction is computationally expensive. [3] pro-
posed an improved version of ripplet transform-based coding. The sin-
gular value decomposition method is applied over the coefficients ob-
tained from ripplet transforms to capture the essential feature infor-
mation from coefficients. The entropy-based method is used to encode
the low and high-frequency information of ripplet coefficients. This en-
hanced ripplet transform-based method showed significant improvement
in performance than the JPEG compression and other transform-based
compression methods. The choice of transform affects the compression
system.

A recent review on image compression techniques [4] discusses all the
existing and recent advancements to the standard methods and focuses
on image compression for medical images. From the summary of the ex-
isting methods, it is clear that the standard compression techniques have
their own pros like reduction in inter-pixel redundancy, high compres-
sion by block coding, and cons like edge degradation, highly sensitive to
channel noise, blocking artefacts, computationally expensive and are
highly sensitive to error. In this chapter a BPN and arithmetic coder
based compression methods are proposed for image compression and to
overcome the artifacts present in the compressed image, and deep learn-
ing-based Denoising CNN is used as a post-processing step. The rest of
the chapter deals with the methodology proposed and a detailed analysis
of the outcome of the proposed work. The flow diagram for the proposed
image compression methodology is given in Fig.1.
## 2. Proposed methodology

<figure><img src="image_2.png" /><figcaption>Fig.1 Work flow for the proposed methodology</figcaption></figure>

### 2.1 Image preprocessing

The input image to be compressed is split into several non-overlapping sub-images. Here, the size of the sample input image is 256 x 256. A single image that is to be compressed is split into several non-overlapping 4 x 4 pixel length sub-images, as shown in Fig.2. A total of 4 x 4 x4096 non-overlapping sub-images are obtained.

These sub-blocks are converted into a vector form. The vector form of each sub-block is further concatenated into a 16x4096 element vector. The intensity of the pixels varies from 0 to 255. A max normalization process is used as a preprocessing before feeding these element vectors as training samples to the neural network to ease the neural network's training process and reduce the complexity of mapping between the pixels. The input image to be compressed here is a greyscale MRI image. The maximum value in this greyscale is 255. A linear function is used for max normalization. Each pixel value is divided by 255, a maximum greyscale value. The normalized element vector ranges from 0 to 1. This normalized element vector is used as a training sample for the neural networks.
<figure><img src="image_3.png" /><figcaption>Fig.2 Preprocessing of the input image with 4 x 4 sub-images</figcaption></figure>

## 2.2 Backpropagation neural networks

The backpropagation algorithm is the most fundamental algorithm used to train a neural network through a chain rule effectively. The feed-forward neural network approximates the given problem with high accuracy. After each forward pass through a network, a backward pass is performed to adjust the model parameters such as weights and biases to reduce the error propagated. In simple terms, the forward and backward passes are the error-correction learning rule [5].

In the forward pass, the input vector is applied to the neurons in the input layer. The effect of this input vector is propagated through the hidden layer, and a set of output as a response is obtained from the output layer. The weights of all the layers are fixed in the forward pass. An error value is generated by subtracting the actual output and the response obtained during the forward pass from the output layer. If the error obtained from the output layer is above a tolerance value, a backward pass is carried out where the weights are adjusted based on the chain rule. This weight updation is performed iteratively until the actual response reaches the desired response.
A three-layered back propagation neural network consisting of an input layer, a hidden layer, and an output layer is used for image compression. The normalized pixel value of each sub-block image will be the input for the input nodes. For image compression, the compressed image's size will be equal to the input image's size with a reduced number of bits. Therefore, the number of neurons in the output layer is equal to the number of neurons in the input layer. The input itself acts as a target for training a neural network [6]. The input layer and the output layer of the neural network are fully connected to the hidden layer. Small random variables between -1 and +1 are initialized as weights for the neurons that connect the input, hidden, and output layers. A non-linear activation function like Sigmoid or tanh allows the network to learn the given data set's complex patterns. The training plot for BPN based compression is shown in Fig.7

## 2.3 Arithmetic coding

Arithmetic coding is a lossless compression technique, and it is used in all types of data compression algorithms because of its advantages of flexibility and optimality. Arithmetic coding provides a better compression ratio, and redundancy is much reduced compared to Huffman Coding [7]. Unlike Huffman coding, a discrete number of bits for each code is not used in arithmetic coding [8]. Each pixel value is assigned with an interval value based on the sequence of event probabilities. Starting with lower limit 0 and upper limit 1, each interval is divided into several sub-intervals.

## 2.4 Image deblocker

The image compression process causes the image to lose some information. So that the compressed image appears to be distorted, meaning that the image has some blocking artefacts. To reduce the effects of blocking artifacts, many algorithms have been proposed in the literature to deblock the artefact effect in the compressed image. Recent successful deep learning-based Denoising architecture has been used as a preprocessing step to reduce the artefact effects in the compressed image.

A built-in deep feed-forward Convolutional neural network, called DnCNN proposed by [9], is adopted for deblocking the artefacts in the compressed image. This DnCNN was originally designed to remove the noises present in the image. The same architecture can be trained in such a way to remove the artifacts and improve the resolution of the image. The network learns to estimate the residual information about the dis-
torted image. The residual information is the difference between the original uncompressed image and the distorted image. The distortions here are the blocking artifacts.

The residual information is detected from the luminance of a color image. The luminance channel 'Y' is the brightness information present in the given image. The CNNs are trained using only the luminance channel 'Y' as the human perception is more sensitive to changes in brightness than to the changes in the color. The principle strategy adopted for estimating the residual information can be represented as follows.

$$Y_{\text{Residual}} = Y_{\text{Compressed}} - Y_{\text{Original}} \quad (7)$$

where $Y_{Original}$ is the luminance channel of the input uncompressed image. $Y_{Compressed}$ is the lossy compressed image. The CNN[10] network trained to learn and predict $Y_{Residual}$ from the training data. If the network is able to estimate the residual information effectively, an undistorted version of the uncompressed image can be reconstructed by adding the predicted residual information with the compressed image.

<figure><img src="image_4.png" /><figcaption>Deblocked Compressed Image</figcaption></figure>

Fig.4 Architecture of the post processing using DeNoising CNN to remove the artefacts

The architecture for deblocking the artifacts present in the compressed image is given in Fig.4 It has a series of convolution Layers consisting of convolution, ReLU- an activation Layer and batch normalization
Layer. The DnCNN architecture adopted for this work has 19 Convolutional Layers. The last 20th layer has only a convolution 2D layer that maps the learned features to the resolution of the input image and final regression layer.

### 3 Performance Analysis and Discussion

The experimental part is done using MATLAB R2018b [12] on a computer with Intel i5 processor and CUDA enabled NVIDIA GPU with compatibility 4.0. The BPN network has been trained with tangential sigmoid function with a maximum epoch of 1000 iterations with gradient method. The training plot of BPN based compression is shown in Fig. 8. The pretrained denoising convolutional neural networks adopted as post processing step has been trained with stochastic gradient descent optimization technique with initial learning rate of about 0.1 for a maximum of 30 epochs with a gradient threshold value of 0.005 to avoid exploding gradients and batch size has been initialized to 64.

For better visualization of the effect of compressed image without Denoising and with denoising is shown in Fig.5 and Fig.6. An image tool in MATLAB has been used for visualization. From the observation it is clear that, BPN and denoising based compressor has reconstructed the compressed image with reduced blocking artefacts. The quantitative analysis of proposed framework is done using peak signal to noise ratio (PSNR) as given below.

$$PSNR = 10\log_{10} \left( \frac{R^2}{MSE} \right) \qquad (8)$$

$$MSE = \frac{\sum_{M,N}[I_1(m,n) - I_2(m,n)]^2}{M * N} \qquad (9)$$

where R is the maximum fluctuation value in the image. If the input image has a double-precision floating-point data type, then R is 1. If it has an 8-bit unsigned integer data type, R is 255. M and N are number of rows and columns of the given input image.

Table 1 depicts the PSNR value obtained from BPN based compression and BPN with denoising as post processing. The inference from the result depicts that the BPN and DnCNN based compression achieved a 3% improvement in the total PSNR value compared with using only BPN based compression. An average of about 3.64% improvement in PSNR value was achieved by the proposed technique.
<figure><img src="image_5.png" /><figcaption>Fig. 5 Image visualization of the compressed image</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>Fig. 6 Image visualization after applying Denoising convolutional neural network</figcaption></figure>

<table><caption>Table 1 Qualitative analysis of BPN based compression and BPN with Denoising CNN</caption><thead><tr><td>Input image</td><td>PSNR using BPN (dB)[11]</td><td>PSNR using BPN and DnCNN</td></tr></thead><tbody><tr><td>Image (1)</td><td>29.906</td><td>30.62</td></tr><tr><td>Image (2)</td><td>30.41</td><td>31.75</td></tr><tr><td>Image (3)</td><td>30.42</td><td>31.8</td></tr><tr><td>Image (4)</td><td>30.44</td><td>31.76</td></tr><tr><td>Image (5)</td><td>30.41</td><td>31.51</td></tr><tr><td>Image (6)</td><td>31.05</td><td>32.25</td></tr><tr><td>Image (7)</td><td>31.46</td><td>32.79</td></tr><tr><td>Image (8)</td><td>31.63</td><td>32.82</td></tr></tbody></table>

Though the method proposed is able to achieve an average of 3% improvement in PSNR than the existing state of the art methods, training of neural networks is computationally expensive and data intensive. In fu-
ture, further studies can be done on utilizing auto encoders an unsuper-
vised technique for image compression and to more generalized archi-
tecture based only on deep learning dedicated for medical image com-
pression.

<figure><img src="image_7.png" /><figcaption>Fig.7 Training plot of BPN in comparison with number of epochs
and mean squared error</figcaption></figure>

4 Conclusion

In this paper, a novel image compression technique based on BPN and Arithmetic coders is proposed. The high non-linearity and unpredictiveness of the interrelationship between the pixels of the image to be compressed are handled by BPN. An efficient coding technique called an arithmetic coding is used to produce an image with a better compression ratio and lower redundancy. Further, a deep CNN-based image deblocker is used as a post-processing step to remove the artefacts present in the reconstructed image. Post-processing is done to improve the quality of the reconstructed image. The effectiveness of the proposed methodology is validated by using PSNR. It is inferred from the results that PSNR has improved by three percent when compared with state-of-the-art methods.

Acknowledgment

The authors would like to thank the following funding under grant no:
09/1095(0033)18-EMR-I, 09/1095(0026)18-EMR-I, F./2015-17/RGNF-
2015-17-PAM-83, SR/FST/ETI-349/2013.

**References**

[1] Shapiro, Jerome M. "Embedded image coding using zerotrees of
wavelet coefficients." IEEE Transactions on signal processing 41, no. 12 (1993): 3445-3462.

[2] H. Sunil, S.G. Hiremath, A combined scheme of pixel and block level splitting for medical image compression and reconstruction, Alexandria Eng. J. 57 (2018) 767-772.
doi:10.1016/j.aej.2017.03.001.

[3] J. Anitha, P.E. Sophia, L. Hoang, V. Hugo, C. De Albuquerque, Performance enhanced ripple transform based compression method for medical images, Measurement. 144 (2019) 203-213.
doi:10.1016/j.measurement.2019.04.036.

[4] A.J. Hussain, A. Al-fayadh, N. Radi, Neurocomputing Image compression techniques: A survey in lossless and lossy algorithms, Neurocomputing. 300 (2018) 44-69.
doi:10.1016/j.neucom.2018.02.094.

[5] Savković-Stevanović, J. "Neural networks for process analysis and optimization: modeling and applications." Computers & chemical engineering 18, no. 11-12 (1994): 1149-1155.

[6] H.S. Soliman, M. Omari, A neural networks approach to image data compression §, 6 (2006) 258-271.
doi:10.1016/j.asoc.2004.12.006.

[7] H. St, A. Uhl, Comparison of Compression Algorithms Impact on Fingerprint and Face Recognition Accuracy, (2006).

[8] E.H. Sibley, I.A.N.H. Willen, R.M. Neal, J.G. Cleary, arithmetic coding for data compression, 30 (1987).

[9] K. Zhang, W. Zuo, S. Member, Y. Chen, D. Meng, Beyond a Gaussian Denoiser: Residual Learning of Deep CNN for Image Denoising, IEEE Trans. Imageprocessing. 26 (2017) 3142-3155.

[10] R. Sivagami, J. Srihari, K.S. Ravichandran, Analysis of Encoder-Decoder Based Deep Learning Architectures for Semantic Segmentation in Remote Sensing Images, in: Int. Conf. Intell. Syst. Des. Appl., 2020: pp. 332-341. doi:10.1007/978-3-030-16660-1.

[11] M.R. Reddy, M.A. Deepika, D. Anusha, J. Iswariya, K.S. Ravichandran, A new approach for image compression using efficient coding technique and BPN for medical images, in: Int. Conf. ISMAC Comput. Vis. Bio-Engineering, 2019: pp. 283-290.
doi:10.1007/978-3-030-00665-5.

[12] MATLAB R2018b, The MathWorks, Natick, 2018