Image compression system with an optimisation of compression ratio

IET Image ProcessingVolume 13, Issue 11 p. 1960-1969 Research ArticleFree Access Image compression system with an optimisation of compression ratio Adil Amirjanov, Adil Amirjanov Department of Computer Engineering, Near East University, Nicosia, N. Cyprus via Mersin-10, TurkeySearch for more papers by this authorKamil Dimililer, Corresponding Author Kamil Dimililer kamil.dimililer@neu.edu.tr Department of Electrical and Electronic Engineering, Near East University, Nicosia, N. Cyprus via Mersin-10, TurkeySearch for more papers by this author Adil Amirjanov, Adil Amirjanov Department of Computer Engineering, Near East University, Nicosia, N. Cyprus via Mersin-10, TurkeySearch for more papers by this authorKamil Dimililer, Corresponding Author Kamil Dimililer kamil.dimililer@neu.edu.tr Department of Electrical and Electronic Engineering, Near East University, Nicosia, N. Cyprus via Mersin-10, TurkeySearch for more papers by this author First published: 09 August 2019 https://doi.org/10.1049/iet-ipr.2019.0114Citations: 4AboutSectionsPDF ToolsRequest permissionExport citationAdd to favoritesTrack citation ShareShare Give accessShare full text accessShare full-text accessPlease review our Terms and Conditions of Use and check box below to share full-text version of article.I have read and accept the Wiley Online Library Terms and Conditions of UseShareable LinkUse the link below to share a full-text version of this article with your friends and colleagues. Learn more.Copy URL Share a linkShare onFacebookTwitterLinkedInRedditWechat Abstract The fundamental goal of image data compression is to set an optimal compression ratio while maintaining an acceptable reproduction quality. This study describes the principles of design of image compression system that automatically sets an optimal compression ratio for particular image content by identifying the image compression method while maintaining a tolerable reproduction quality. The proposed image compression system employs subjective and objective criteria for an assessment of the quality of the image compression system. The supervised artificial neural network is used to identify a compression method among different compression techniques by using subjective criterion. An objective criterion is used to determine an optimal compression ratio, which is calculated by using linear regression analysis that establishes analytical expression between a compression ratio, a property of an image and a reconstructed quality of an image. It was proved that the system is an effective tool for medical image compression applications. 1 Introduction The objective of image compression is to reduce redundancy of the image data in order to be able to store or transmit data in an efficient form. Current compression schemes produce high compression rates, if loss of quality is affordable. In medical image compression applications, diagnosis is effective only when compression techniques preserve all the relevant and important image information, which means that the lossless compression techniques are appropriate [1]. Lossy compression techniques, on the other hand, are more efficient in terms of storage and transmission needs, but there is no warranty that they can preserve the characteristics needed in medical image processing and diagnosis. In medicine, particularly in telemedicine, the demand for data storage and bandwidth requirements increases, that is, lossy compression techniques become necessity [2]. There are many lossy compression techniques. Current standards for compression of images (Joint Photographic Experts Group compression algorithm) use discrete cosine transform (DCT), which represent an image as a superposition of cosine functions with different discrete frequencies [3]. DCT-based algorithm is good for compression of images with smooth variations of tone. On the other hand, DCT-based algorithm may not be as well-suited for the images with the sharp contrasts between adjacent pixels which can cause notable artefacts and reduce the reconstructed image quality [4]. DCT-based compression algorithm with high compression ratio severely affects the quality of the image. Another approach for image compression is a discrete wavelet transform (DWT) compression technique which represents an image as a superposition of a set of wavelet. Wavelet transform are based on small waves, called wavelets, of varying frequency and limited duration [5]. There are several families of wavelets that have proven to be especially useful for image compression such as Haar, Daubechies, biorthogonal etc. [6]. DWT can provide better image quality than DCT on a higher compression ratio. The fundamental goal of image data compression is to set an optimal compression ratio while maintaining an acceptable reproduction quality. To reach this objective of compression, several factors should be considered that include compression algorithms, properties of images and the special requirements of particular applications. Owing to the vast amount of image data have to be managed, the image compression system should allow automatically set an optimal compression ratio with an acceptable reproduction quality by assessment of the image content and selecting a suitable compression algorithm. This paper describes the principles of design of image compression system that automatically sets an optimal compression ratio for particular image content by identifying the image compression method while maintaining a tolerable reproduction quality. 2 Factors influenced to image compression system design The restored image quality has a fundamental importance for designing of the image compression system because the restored image quality is significantly correlated to the compression ratio. The other factors which need to be considered for design of image compression system are the properties of image and the compression methods. The properties of image such as the image's brightness, the image's contrast, the pixel probability distribution etc. need to be carefully considered to select a property that significantly affects the performance of compression methods. The features of different compression methods should be analysed as well to make a correct choice of the compression method for particular image content. 2.1 Quality measures There is no single reliable objective criterion for measuring the quality of a compressed image, but two general approaches have come to dominate [7]: Objective criteria which are based on computable objective distortion measures such as mean square error (MSE) or peak-signal-to-noise ratio (PSNR). Subjective criteria which make an assessment of image quality by the subjective rating of opinions of human observers. PSNR describes the similarity of restored image to original image. For n-bits per pixel, PSNR is defined as follows [8]: (1)where L is the number of intensity values and MSE is the mean square difference between restored and original images, and it is calculated as follows: (2)where and are, respectively, the intensity of original and recovered pixel values at the ith row and ith column of the image with m rows and n columns. Subjective quality of a reconstructed image is judged in the following way: a suitably randomised set of images is presented to experts who rate them, often on a scale of 1–5. Subsequent statistical analysis then applies to highlight average, variability and other trends in the data [9]. Mean opinion scores (MOSs) are widely used as a quantitative measure of subjective criteria for an assessment of the quality of a compressed image. MOS of a group of observers who join the evaluation is usually computed by (3)where is the score corresponding to the kth rating; is the number of observers with this rating; and is the number of grades in the scale. Some methods have been considered for quantifying the degree of a correlation between two such quality measures [10]. However, objective distortion measures have a limited relation to the subjective impression (perception) of image. A slight spatial shift of an image causes a significant increment of PSNR, but no visual distortion and, conversely, a small increment of PSNR can result in a damaging visual artefact [10]. The objective picture quality metric as well was developed that is taking into account known image impairments due to coding and by weighing their quantitative perceptual importance [11]. The metric, named picture quality scale (PQS), closely approximates the MOS. However, for poor quality images, it is possible to obtain negative values of PQS, a meaningless result [11, 12]. Subjective criteria are more reliable visual quality measure because the final users of images are humans. The reliable visual quality measure allows comparing the images compressed by different techniques, and it is also instrumental in designing of image compression systems. 2.2 Image compression techniques Any image compression system consists of transformer, quantiser and an encoder. Most popular image compression techniques the DCT-based and DWT-based algorithms are used as a transformer. DCT represents an image as a superposition of cosine functions with different discrete frequencies. In DCT-based algorithms, the image is divided into blocks of samples and each block is transformed independently to give DCT coefficients. To achieve the compression, DCT coefficients are quantised. The quantisation results in loss of information. Increasing the quantised scale leads to coarser quantisation which gives high compression ratio and poor decoded image quality. The block-based segmentation of source image is a fundamental limitation of the DCT-based compression system. The degradation is known as the ‘blocking effect’ and depends on block size [13]. DWT represents an image as a superposition of a set of small waves, called wavelets, of varying frequency and limited duration. In the DWT-based compression system, the entire image is transformed and compressed as a single data object rather than block by block as in a DCT-based compression system. As a result, wavelets provide good compression ratios, mainly for high-resolution images. Especially, on a higher compression ratio, DWT provides better image quality than DCT [14]. The comparisons of DCT and DWT show that the DWT is better in the representation of images with broadband signals, while the DCTs are more suitable in the representation of images with narrowband signals. For a narrowband signal, DCT provides excellent energy compaction, that is, the few energetic coefficients of the DCT accumulates almost all signal energy, while the DWT accumulates significantly less than the total signal energy. On the contrary, for a broadband signal, the few most dominant DCT coefficients accumulate only a small part of the total signal energy, while the DWT accumulates almost all signal energy. It is because the wavelet uses sub-band coding to selectively extract different sub-bands from the given image. The wavelet filters are designed, so that the coefficients in each sub-band are almost uncorrelated from the coefficients in other sub-bands [15]. Wavelet filter is the most important factor affecting the performance of DWT. A less properly selected wavelet filter may bring down the quality of the restored image. Therefore, the properties of an image should be taken into account and the appropriate transformation method should be chosen in order to make the image compression effective. The improvement of the compression performance for images with different spectral activity needs the selection of the transformation function from the set of transformation functions related to DCT or DWT-based algorithms. 2.3 Image properties The properties of an image are the data which are available to represent or estimate the image. The image properties can be regarded as summary statistics reflecting the texture of the image. The statistical properties of an image characterise the image as a random variable. This statistical model describes an image as a message symbols (pixel) according to the probability distribution of the source alphabet. The following statistical properties of images are usually considered for image modelling. The brightness of the two-dimensional (2D) image is the mean of intensity of total grey pixels [16] (4)where E(X) is the mean of a random variable X. Root-mean-square (RMS) contrast is defined as the standard deviation of the pixel intensities and it is a measure of the dispersion of a pixel's intensity around the mean value [16] (5)However, the RMS contrast does not depend on spatial-frequency content of the image or the spatial distribution of contrast in the image [17]. The information content of an image can be measured by its entropy [18] (6)where L is the number of intensity values and is a probability of the particular sth grey level which is calculated as follows: (7)where is the number of times that intensity with the sth grey level occurs in the image. The entropy of the image specifies of an energy distribution between different pixels intensities, but the entropy of the image does not depend on spatial-frequency content of the image. Typically, well-contrasted regions call for particular attention. Moreover, a well-contrasted shape is likely to be a part of the boundary of a real object in the image. Thus, contrast is an important feature to define perceptual objects. To compute the contrast along the shape border, the magnitude of the gradient between neighbouring pixels needs to be used. The pixels of an image form geometrical structures with appropriate spatial dependencies. The dependencies can be localised to a limited neighbourhood which can be done by weighing the entropy with a factor that measures the amount of contrast of each region with its neighbours. Given a measure of contrast for each sth grey level, we define the contrast-weighted entropy (HC) as (8)where is the mean contrast which determines by the number of neighbours. The contrast can be expressed as follows: (9)where is the number of neighbours in the region r; is the intensity of the sth grey level and is the mean intensity of the region r. The contrast is defined by a distinct configuration of grey level pixels in the local context template (Fig. 1). Using a larger context template, we can utilise spatial dependencies from a wider area, but it will reduce the mean contrast of a particular grey level. By implementing the contrast-weighted entropy, the energy of particular grey level in an image will be weighted by the different configuration of neighbouring pixels. Fig. 1Open in figure viewerPowerPoint 8 and 24 px local context templates. Location of the current pixel is marked by black colour The contrast-weighted entropy as a property of an image is more sensible for a content of an image than a conventional entropy. Table 1 and Fig. 2 represent the collection of X-ray images with almost same value of entropy, but with significantly different weighted-contrast entropy. It can be seen that the weighted-contrast entropy is a better image property for an assessment of differences in content of the images. Table 1. Original images with their entropy (H) values and contrast-weighted entropy (HC) values Image H HC image 1 5.7303 279.5 image 2 6.0045 264.67 image 3 7.2372 130.54 image 4 7.1803 124.26 image 5 5.8296 266.32 image 6 6.4913 184.09 image 7 6.0313 179.9 image 8 7.4567 218.52 image 9 4.7748 120.08 image 10 5.3048 166.55 Fig. 2Open in figure viewerPowerPoint Original X-ray images described in Table 1. The first row (from left to right): Image 1–Image 5. The second row (from left to right): Image 6–Image 10 Similar image property is used in a statistical image compression technique [19]. A statistical image compression technique exploits a context-based statistical model of an image, but a context is defined as a distinct black and white configuration of pixels. 3 Principles of image compression system design Two main issues need to be discussed for designing of an image compression system: the choice of an image compression method and setting an optimal compression ratio while maintaining an acceptable reproduction quality. 3.1 Choice of an image compression technique The choice of an image compression technique depends on the image application and the content of an image. Some criteria for selecting DCT or DWT transform methods were discussed in Section 2.2. The most important factor affecting DWT is a selection of an optimal wavelet function dependent on different criteria in various applications. Wickerhauser [20] developed an entropy-based algorithm for choosing the best wavelet basis that can achieve higher compression ratios. Villasenor et al. [21] derived a wavelet filter evaluation metric according to the filter impulse response. Grgic et al. [12] proposed a method for selecting a wavelet function based on objective criteria of image quality by measuring PSNR. Lo et al. [22] developed a neural network-based framework to search for an optimal wavelet kernel. In the algorithm, a linear convolution neural network was employed to seek a wavelet that minimises errors and maximises compression efficiency for the medical images. In the field of image compression, one major criticism in the evaluation of reconstructed images is that investigators usually use objective criteria by measuring the PSNR or the MSE. However, subjective criteria are more preferable and more reliable visual quality measure because the final users of images are humans. A classification of images with different contents to the particular groups needs to be done for an identification of most relevant image compression method. Neural network approaches are undoubtedly powerful tools that exploit the learning capability and training mechanism to make a classification of images. Furthermore, neural networks have the capability of optimising the relationship between the inputs and outputs via distributed computing, training and processing, leading to reliable solutions desired by specifications. Soliman and Omari [23] presented a novel neural model for image compression called the direct classification model. In training phase, the images classified according to the class centroid which represents the centre of mass (average) of its entire class member. However, their neural model used as well-objective criteria for an assessment of image quality. Khashman and Dimililer [24] proposed an image compression system for medical X-ray images using a neural network classifier. The advantage of their approach is that they used subjective criteria for learning the non-linear relationship between the intensity (pixel values) of an X-ray image and most relevant compression method. In our image compression system, we use similar approach by implementing a supervised neural network based on the back-propagation learning algorithm. The artificial neural network (ANN) is composed of three layers: an input layer, a hidden layer and an output layer (Fig. 3). Fig. 3Open in figure viewerPowerPoint Three layers of ANN The output of each input layer neurone is exactly equal to the normalised input. The input presented to a neurone in the hidden layer is equal to the sum of all the inputs of the input layer neurones multiplied by their associated connection weights (10)Each output of a hidden neurone is calculated using the sigmoid function described by the equation (11)The input presented to a neurone in the output layer is equal to the sum of all the outputs of the hidden layer neurones multiplied by the their associated connection weights (12)Each output of an output neurone is calculated using the sigmoid function in a similar manner as in the hidden layer (13)During the network training, the feed-forward output state calculation is combined with backward error propagation and weight adjustment calculations that represent the network's learning. The error term (E) described by expression (14) represents a measure of how well a network is training on a particular training set (14)where is the target value; is a result of the feed-forward calculations; the subscript p denotes the value for a given pattern and the aim of the training process is to minimise the error over all training patterns. For our image compression system apart from a DCT transform, the DWT transform methods with Daubechies and Biorthogonal wavelets were selected. Important properties of wavelet functions in image compression applications are a compact support which leads to efficient implementation, a symmetry that is useful in avoiding dephasing in image processing, an orthogonality which allows a fast algorithm, a regularity and a degree of smoothness which is related to a filter order or a filter length. Daubechies wavelets are the wavelet family of scale functions that are orthogonal and have finite vanishing moments, that is, they have a compact support [25]. The order (N) of Daubechies wavelets (dbN) denotes the filter order of the wavelet and the number of the vanishing moments. The regularity of the wavelets increases with the order. The wavelets with fewer vanishing moments give less smoothing and remove less details, but the wavelets with larger vanishing moments produce more distortions [26]. Daubechies wavelet (db4) was selected for the image compression system. A major disadvantage of Daubechies wavelets is their asymmetry, which can cause artefacts at borders of the wavelet sub-bands. It is well known that bases that span a space do not have to be orthogonal. To gain greater flexibility in the construction of wavelet bases, the orthogonality condition can be relaxed allowing semi-orthogonal, biorthogonal or non-orthogonal wavelet bases. Biorthogonal wavelets are a family of compactly supported symmetric wavelets. The symmetry of the filter coefficients is often desirable since it results in linear phase of the transfer function. Biorthogonal wavelets have the following desirable properties: compact support, smoothness, symmetry, good localisation, a simple analytical form in the spatial-frequency domain and efficient implementation. It is convenient to name the biorthogonal wavelets as biorNr.Nd, where Nr is the number of the order of the wavelet or the scaling functions used for reconstruction, while Nd is the order of the functions used for decomposition. Biorthogonal wavelet (bior2.2) was selected for the image compression system. The multilevel tree decomposition based on the wavelet transform was used, where every 2D digital image is represented by a 2D array X (m, n) with m rows and n columns, where m, n are positive integers. First, a 1D DWT is performed on rows to get low-frequency L and high-frequency H components of the image. Then, once again a 1D DWT is performed columnwise on this intermediate result to form the final DWT coefficients LL, HL, LH and HH, which are called sub-bands. The LL sub-band is further decomposed into four sub-bands by following the above procedure. This process is continuing up to the eight numbers of levels. Thus, for eight levels of the decomposition, the 25 sub-bands were used. A database consisting of 90 X-ray images of fractured, dislocated, broken and healthy bones in different parts of the body was used in this paper. The neural network relates the X-ray image intensity (pixel values) to the image compression method and its compression ratio having been trained using images with predetermined compression methods and ratios. Once trained, the neural network would choose the method and the compression ratio for an X-ray image on presenting it to the neural network. For the reduction of a training time, a simple image resizing mechanism was used to resize the original images of size (256 × 256) pixels into (64 × 64) pixels. Using one-pixel-per-neurone approach, the neural network's input layer has 4096 neurones, its hidden layer has 50 neurones, which assures meaningful training while keeping the time cost to a minimum, and its output layer has 14 neurones representing the output classification of three compression methods with the relative data redundancy as follows: the output neurones 1–4 represent a DCT-based compression with range 10–40%, the output neurones 5–14 represent DWT-based compression, where the output neurones 5–9 employ Daubechies wavelet transform in range 50–90% and the output neurones 10–14 employ biorthogonal wavelet transform in range 50–90%. The changing step of the relative data redundancy is equal to 10%. The neural network relates the X-ray image intensity (pixel values) to the image compression method and its compression ratio having been trained using images with predetermined compression methods and ratios. During the learning phase, the learning coefficient and the momentum rate were adjusted by various experiments in order to minimise the MSE for as less as possible number of training epochs. In the learning curve of the neural network, the MSE was monotonously reduced along with a number of epochs, and it achieved value of 0.002 for 2700 epochs. Once trained, the neural network would choose the method and the compression ratio for an X-ray image on presenting it to the neural network. The relative data redundancy corresponds to the compression ratio as follows: (15)Training set contains the images with known relative data redundancy, known as reconstructed image quality (PSNR) and known compression method. This set was determined by the visual inspection of submitted images. The visual inspection involved 12 experts who were asked to observe the smoothness and edge continuity of certain areas within the reconstructed images, then MOSs were computed by using expression (3) for every image. MOSs were used to select images as a target for training ANN. To test and validate the efficiency of the trained neural network, the testing set of images with known relative data redundancy and known compression method were used. The evaluation of the testing results was performed using two measurements: correctness of a recognition of a compression method [the recognition rate (RR)] and accuracy of an assessment of a relative data redundancy (the accuracy rate). The RR is defined as follows: (16)where is a number of images with correctly recognised compression method and N is the total number of images in testing set. The accuracy rate (RA) is defined by the expression (17)where is the predetermined (expected) relative data redundancy in percentage; is the relative data redundancy in percentage determined by the trained neural network; and S represents the total number of compression ratio related to the particular compression method. The estimation of the system implementation shows that it is accurate for the recognition of a compression method, RR = 94%, but it is not accurate for an assessment of the relative data redundancy: the mean of the accuracy rate and the standard deviation . It means that the 97% of images from the training set has the accuracy rate (0–35.4%), which significantly exceeds the changing step of the relative data redundancy. Having observed the above results, it can be proved that the supervised ANN is an appropriate tool for a selection of image compression techniques, but not for setting of a compression ratio. 3.2 Setting an optimal compression ratio Compression ratio is a quantitative parameter which influences a reconstructed quality of an image. The other parameter which influences a reconstructed quality of an image is a property of an image. Linear regression analysis can be employed to establish analytical expression between a compression ratio or a relative data redundancy , a property of an image (contrast-weighted entropy, HC) and a reconstructed quality of an image (PSNR). Plotting of experimental data allows establishing an initial model that describes the total variation in a reconstructed quality of an image (PSNR) by the changes of the deterministic components and HC. Fig. 4 shows the data plot of 90 X-ray images with Daubechies wavelet transform, where the cross-sectional plot in Fig. 4a represents the relationship between PSNR and a contrast-weighted entropy HC for a different relative data redundancy . The relationship between PSNR and HC for particular can be modelled well by a linear regression type, shown in Fig. 4a as a trend line of the plotted data (18) Fig. 4Open in figure viewerPowerPoint Data plot with Daubechies wavelet transform (a) PSNR is plotted against HC with the accepted linear regression type that includes two estimated parameters a and b, (b) Estimated parameter a is plotted versus , (c) Estimated parameter b is plotted versus The linear regression model is a heuristic one that is completely based on the collected data, and the quality of the model can be proved by an estimation of a correlation between the observed and model-predicted values of the dependent variable PSNR. PSNR also depends on a relative data redundancy , which means that the estimated parameters a and b of a linear regression model described by expression (18) also depend on . These dependencies are plotted in Figs. 4b and c for the parameters a and b, respectively. The examination of the plots of the estimated parameters a and b versus a relative data redundancy roughly indicates how should be incorporated into a model of a reconstructed quality of an image (PSNR). The choice of a polynomial regression type is suggested for the relationship between the est