REPro.JPEG: a new image compression approach based on reduction/expansion image and JPEG compression for dermatological medical images

Medical images are known for their huge volume which becomes a real problem for their archiving or transmission notably for telemedicine applications. In this context, we present a new method for medical image compression which combines image definition resizing and JPEG compression. We baptise this new protocol REPro.JPEG (reduction/expansion protocol combined with JPEG compression). At first, the image is reduced then compressed before its archiving or transmission. At last, the user or the receiver decompresses the image then enlarges it before its display. The obtain results prove that, at the same number of bits per pixel lower than 0.42, that REPRo.JPEG guarantees a better preservation of image quality compared to the JPEG compression for dermatological medical images. Besides, applying the REPRo.JPEG on these colour medical images is more efficient while using the HSV colour space compared to the use of RGB or YCbCr colour spaces.


Introduction
Information is now of paramount importance in our daily life and work. Information can take many forms i.e., text, signal, image and video [1]. In this work, we will focus on image type of the data. These images are very rich in information which explains their large file volume [2]. Thus, the image storage requires a large space and can generate a transmission delay of the network [3]. Despite this, the use of images is very common in our daily lives mainly in social networks and platforms for collaborative work [4]. In this context, image is a key component in medical diagnosis and notably in telemedicine applications [5]. Moreover, the doctor requires good visual quality of the image being examined to minimise the chances of misinterpretations. Consequently, image compression is seen as the ideal solution to minimise the storage space of these images and to reduce their transmission time between different hospitals involved in a collaborative platform for telemedicine while taking into account the preservation of visual image content [6].
In the literature, several encoding image compression techniques are cited such as fractal coding methods [7], region of interest coding techniques [8,9], lossless dynamic and adaptive compression [10], low-complexity compression [11] and genetic algorithms [12]. However, JPEG [13], JPEG 2000 [14,15], TIFF and JPEG-LS (JLS) [16] have remained among the widespread methods used as standards since they provided better performances in image compression. So to compress an image, it will, at first, be represented on a specific colour space (RGB, YCbCr, HSV, etc.). Then, the image will be transformed to the compression appropriate domain such as the frequency domain for the JPEG compression and the multiresolution field for the JPEG 2000 compression. Next, a quantisation process will be applied to the new image representation. The obtained result shows the presence of grate rate of symbol redundancy which facilitates image encoding by several algorithms such as RLE, Shannon and Huffman. As a result, we obtained a compressed image file [17]. We note that the quantisation step has a great impact on the loss or lossless behaviour of the compression scheme.
However, we presented, on our earlier work, a new compression method (REPro: reduction/expansion protocol) which based on reducing the pixel numbers of the image to transmit or to archive [18]. In fact, the image will be reduced before its archiving or transmission. To display it, the image should be enlarged before to get its initial size [19].
In this work, we present a new protocol of image compression for transmitting and archiving images based on image reduction, then JPEG compression of images during storage or transmission, and decompression flowed expansion at the reception and the display. As this technique combines the resizing image aspect of the REPro and the encoding aspect of the JPEG compression, we named it REPro.JPEG (reduction/expansion protocol combined with JPEG compression). A particular attention will be paid to the impact of the choice of the colour space on the performances of this new compression scheme.
In the next section of this paper, we will focus on earlier works, namely JPEG and REPro, which we will fuse to obtain the REPro.JPEG. The second section will be dedicated to detail the used image processing tools needed to achieve and to assess our proposed approaches. The principle of REPro.JPEG will be explained in the third section. The last section will present the results of REPro and REPro.JPEG evaluation and a comparison between the compressed REPro and JPEG compression applied on our dermatological medical image database. Finally, we ended our paper by our conclusion.

Earlier works
The high price of medical equipment, the small number of specialised and experienced medical staff, and the great dispersion of the population in rural areas present a great obstacle to the proper conduct of a medical examination 6. Given this situation, telemedicine is seen as an ideal solution to overcome these shortcomings 20. Indeed, thanks to technological advances in the fields of electronics, telecommunications and information technology, it is now possible to perform medical consultations, analysis, medical treatments and staff meetings remotely. Thus, these platforms must ensure a real time and huge information exchanges in signal, text, voice, image and video forms ( Figure 1).
However, the large volume of information exchanged between stakeholders and the limitation of bandwidth in certain covered areas can hinder the exploitation of collaborative platforms. Given the large volume of medical images and their frequent use, we propose a new image compression technique that aims to lighten bandwidth when transmitting these images and reduce their volumes of storage in medical images servers [20]. This approach is based on the combination of the REPro and JPEG compression. These two methods are the subject of this section.

JPEG image compression
The JPEG image compression standard is one of the most used image compressions and supported by the majority of informatics platforms to benefit from its high compression ratio and its image quality preservation. JPEG exists in loss and lossless modes. In medicine, the JPEG compression standard is integrated in the DICOM file format [21]. To apply the JPEG algorithm on a colour image, the image is first converted to YCbCr colour space. Then, each 8 by 8 bloc will be transformed to the frequency domain using the Discret Cosinus Transform (DCT). Next, we quantify the obtained image representation. At last, we apply the RLE (run length encoding) and Huffman encoding to obtain the compressed image code [22].
However, we note that medical image should ensure a good quality image preservation to guarantee a correct diagnosis. This imposes the adoption of a low compression ratio (Equation (1)) which means a high number of bits per pixel (NBpP: Equation (2)) compressionration = originalimage filevolume(bits) compressedimage filevolume(bits) (1) NBpP = compressedimagefilevolume(bits) imagepixelnumber (2) According to Figure 2, its clear that the choice of the NBpP has a great impact on the display of the compressed image. In fact, the increase of NBpP ensures a better restitution of the image, but it yields also a raise of the image file volume to storage or to transmit.

REPro: reduction/expansion protocol
Reduction/expansion protocol called REPro is a new approach for image compression which consists in reducing the image size by sub-sampling it before its transmission or archiving. Using the mesh squaresquare decimation, mesh square-square decimation or the filtered mesh square-staggered-square decimation, in this phase, reduces the image volume to the quarter. However, displaying this image does not guarantee a visual comfort due to the reduced size of the image. Therefore, we suggest to enlarge the image size before its display. Several techniques for over sampling this image could be used such as zero padding, polynomial interpolation and B-spline transform. In this context, REPro aims to find the best reduction/expansion combination (R/E in Figure 3) to guarantee a maximum preservation of the image quality.
We note that a space colour conversion could be applied to the image to reduce by (R) before its decimation. A such process imposes a conversion to the RGB model before the expansion (E) phase.

Used image processing tools
In the following, we will detail the different tools necessary for the development and the evaluation of our new approach REPro.JPEG. As the JPEG compression algorithm is very familiar, we will focus on the reduction and expansion techniques as well as colour spaces needed to complete the compression chain REPro.JPEG. The evaluation will be based on metrics PSNR (peak signal-to-noise ratio) and MSSIM (means structural similarity index) and their derivatives' selection rates.

Used reduction and expansion techniques
Square-square mesh decimation To reduce the image volume file, we can simply reduce the image definition which decreases the image pixels' number. In the literature, several techniques of image sub-sampling are cited such as square-square mesh decimation staggered-square-mesh decimation and square-staggered-square decimation. Previous works [17] proved that square-square mesh decimation insures the best visual image quality. This image reduction method consists in preserving one pixel and removing three pixels from a 2 by 2 pixels bloc. This decimation yields to image reduction by a factor equal to 2 ( Figure 4).
Generally, an image reduction by a factor equal to 2 n remains on applying the square-square mesh decimation on the reduced image by a factor 2 n−1 . We note, also, that a reduction by factor of (a) decreases the image pixel number to (a th ) pixels number of the original image.

Expansion methods
The major purpose of image expansion is to increase the visual comfort of the viewer and by raising the image definition (the number of pixels in the processed image). This resizing application is frequently used to access the image details in several fields such as photocopying, computer graphics, medicine, military, the analysis of satellite images. The expansion is based on preserving the visual content of the image and is done through several techniques such as the zero padding, the nearest neighbour interpolation, polynomial interpolation and the B-Spline transformation.
The technique of zero padding [23] is based on preserving the spectral content of the image. Indeed, the image is transformed to the frequency domain using the Discrete Fourier Transform (DFT). Next, we add zeros in the image high frequencies. At last, the resulting image representation is converted to spatial domain by applying the inverse DFT (DFT −1 ) [24].  The polynomial and B-spline transform interpolations for image expansion are based on the preservation of the frequency and spatial contents of the image to enlarge. Thus, the pixels and the frequency spectrum of the original image are preserved. This image interpolation can be achieved easily in the spatial domain. Indeed, to enlarge an image by a factor of (a) using polynomial interpolation, we began by interlacing (a-1) pixels between each pair of adjacent pixels. Then, we compute values of the new pixels initially set to zeros using the adopted interpolation function and the near preserved pixels.
For a polynomial of degree 0, this method is called an interpolation to the nearest neighbour. In this case, we assign to each new pixel the value of its nearest original pixel [25]. Equation (3) describes this polynomial.
By raising the polynomial degree to 3, we obtain the cubic interpolation. The use of this function to compute the value of a new added pixel takes into consideration the four closest preserved pixels. The following equation [26] describes the polynomial to be used in this expansion: The latest expansion technique we used is the B-Spline transformation interpolation. It consists in an analogue to digital conversion which provides a smooth curve including all elements of the discrete function. In our case, we use a B-Spline transformation applied to a Dirac impulsion. The given function involves all the original pixels to calculate values of new pixels [27]. The process of the B-Spline transformation is detailed in [17].
In Figure 5, we present the results of a test sample ( Figure 5(a)) magnified by a factor equal to 16 magnification using the different adopted approaches.
This figure shows ripples at the edge of the image enlarged by the zero padding technique (Figure 5(b)) which reflects the frequency discontinuity introduced by inserting components zero at high frequencies.
On the other hand, the pixilation is clearly present in Figure 5(c). Indeed, the expansion by interpolation to the nearest neighbour yields to the apparition of grouping pixels having the same values. This undesirable effect is reduced by the cubic interpolation to cause the appearance of blur ( Figure 5(d)) due to the dependence of new pixel values on those of its preserved neighbouring pixels. Finally, the B-Spline transformation seems the most efficient expansion technique by removing the pixilation flaw and by reducing the blur in the enlarged image ( Figure 5(e)) [17].

Image colour space representations
During this study, we will use three colour image models namely RGB, YCbCr and HSV. The RGB (red, green and blue) space colour image encoding is the image representation which takes into consideration the display standards. As the display devices use the variation of the three components of the RGB additive base to display the image, colour image is represented by three matrices which quantify for each pixel with its red, green and blue chrominances. The superposition of these three chromas gives the colour of each pixel.
On the other hand, YCbCr is a standard appearing essentially for analogue video by separating the luma Y, chroma Cb and chroma Cr. This system was developed to adapt televisions whose display is in greyscale at the reception of colour video. This format is also the starting colour space of the JPEG compression [28]. The equation below describes the RGB to YCbCr transformation [29]. The last colour space that we will adopt is the HSV space. This type coding codes the image in three matrices: H (Hue) codes perceived colour, S (saturation) represents the purity of colour and V (value) quantifies the amount of light colour [30]. This type of coding is widely used for the segmentation of colour images [31]. The following equation describes the RGB to HSV transformation.
where R, G and B represent the red, green and blue chromas in the RGB space colour.
By displaying, in RGB colour space, the RGB, YCbCr and HSV matrices of the same image ( Figure 6), we note that these views show the same image structure but with different colours.

Evaluation metrics
To ensure a correct diagnosis, the proposed compression techniques should guarantee a good preservation of the image visual content. To quantify the distortion involved in the use of the compression methods, we will use the PSNR and MSSIM metrics.

PSNR and MSSIM
The PSNR quantifies the dissemblance (in decibel dB) between two images X and Y having the same dimensions (nxm) [32]. The PSNR is computed from the MSE (mean squared error) function as described in the following equations: PSNR(X, Y) = 10 log 10 L 2 MSE(X, Y) = 10 log 10 255 2 MSE(X, Y) where L is the dynamic range of the pixel values.
On the other hand, the MSSIM quantifies the structural similarity between the two images X and Y. The MSSIM function is described by Equation (9).
where M is the total number of local SSIM indices and SSIM(i,j) is the local structural similarity of the bloc (i,j).
In fact, each one of the X and Y images is subdivided into M blocs x and y having the same dimension (generally 8 × 8 blocs). Equation (10) illustrates the equation of SSIM index of (x,y) blocs [33].

SSIM(x, y) =
(2m x m y + C 1 )(2s xy + C 2 ) (m 2 x + m 2 y + C 1 )(s 2 x + s 2 y + C 2 ) where µ x , µ y , s xy , s x , s y denote respectively the average of the window x (from X ), the average of the window y (from Y ), the covariance of x and y, the standard deviation of x and the standard deviation of y. C 1 and C 2 are two small positive constants with K 1 = 0.01 and K 2 = 0.03 by default.
Reduction-enlargement selection rate based on PSNR or SSIM metrics During our evaluation, we will look for, each image, the best combination of image reduction/enlargement adopted for REPro and REPro.JPEG. For an image, a combination is said 'selected' if it provides the best fidelity between the original image and its reduced then enlarged counterpart image in terms of PSNR or SSIM. Subsequently, we can calculate, for each test image basis, the selection percentage of each reduction/enlargement combination.
Proposed approach: compressed REPro (REPro.JPEG) JPEG and REPro represent two different schemes for image compression. In fact, REPro compresses image by reducing its size. However, the JPEG applies an encoding algorithm on the transformed image to frequency domain. The REPro.JPEG combines these two approaches and consists in reducing the image to its quarter number of pixels then compressing it by applying the JPEG algorithm on the reduced image before its archiving or transmission. Subsequently, before its display, the received or archived image should be decompressed and then magnified. Such colour images could have many representations, depending on the chosen colour space. The adoption of an image colour space representation could yield to the modification of the best reduction/expansion combination. For this reason, we suggest introducing a space colour conversion to improve the performances of our compression approach as shown on the Figure 7, where (Red. Comp. Image) is the reduced then compressed image to archive or to transmit.
So the REPro.JPEG parameters are the chosen colour space, the image reduction technique (square-square mesh decimation in our case), the image expansion technique and the NBpP of the JPEG compression.

Results and discussion
To highlight the contribution of our compression approach REPro.JPEG, we will compare its performances with those of the JPEG in terms of NBpP and in terms of preserving the image content quantified by PSNR and SSIM. At first, it is necessary to define the REPro parameters. These parameters are the reduction and expansion techniques and the starting colour space adopted in the proposed compression scheme. During this assessment, we will use image colour image database compounded by 30 medical dermatological images.
We began by the determination of the best reduction/expansion image combination for each colour space. Tables 1-3 summarise the evaluation results of this study in terms of PSNR averages, SSIM averages and selection rates for the image database. In these illustrations, we named R the square-square mesh decimation used for image reduction, A1, A2, A3 and A4, respectively, the zero padding, nearest neighbour, cubic interpolation and B-Spline interpolation techniques used for image enlargement.
The application of REPro on these images reduces the image pixel number to the quarter which involves a decrease in the storage image file volume in bitmap format to almost the quarter of the original image volume. Thus, the preservation of the image content becomes the determining factor in the selection of the reduction/enlargement combination.
Based on the established results in Tables 1-3, we note that the enlargement by nearest neighbour technique of the reduced image guarantees the best fidelity to the original image in terms of PSNR for all images of the image database (PSNR selection rate 100%) and RGB, HSV and YCbCr colour spaces. This same decimation/expansion combination seems the most adequate for the REPro applied in the HSV and YCbCr colour spaces according to the SSIM. However, the RGB space colour promotes the use of the cubic interpolation to enlarge image according to the SSIM metric (Table 1) for all images (SSIM selection rate = 100%).
Given this disagreement at the REPro RGB (REPro applied on RGB images) assessment where PSNR promotes the RoA 2 combination, while SSIM promotes the RoA 3 combination, we merged these two metrics to choose between these two combinations. This metric fusion is based on the product operator that gives us a score equal to 33.36 for RoA 2 (PSNR 34.58 × SSIM 0.9648) and a score equal to 31.12 for RoA 3 (PSNR 32.25 × SSIM 0.9651). Consequently, we can consider the combination of the reduction by square-square mesh decimation and the expansion by the nearest neighbour (RoA 2 ) as the best REPro configuration in the RGB colour space.
Moreover, we note that the HSV colour space seems the best image colour model for the REPro compression approach for all reduction-enlargement.
The REPro compressed protocol (REPro.JPEG) combines a reduction of the image pixel number followed by the JPEG compression. In what follows, we will apply this new compression approach on our dermatological image database transformed on the RGB, HSV and YCbCr colour spaces. The best combination of each colour space will be used for the REPro.JPEG and will be compared to the standard JPEG compression. Thus, the REPro protocol will be represented by the couple RoA 2 (square-square mesh decimation and interpolation to the nearest neighbour) in RGB, HSV and YCbCr spaces. This assessment will highlight the compression performances in terms of NBpP versus the image alteration quantified by PSNR and SSIM.
The comparison of the different variants of REPro.J-PEG revealed a clear advantage of REPro.JPEG in HSV  space view; it provides the best preservation of visual image content in terms of PSNR (Figure 8(a)) and SSIM (Figure 8(b) Figure 9. The visual inspection (Figure 9) of the compression of the sample, shown in (Figure 9(a)) at NBpP equal to 0.25 by the JPEG standard, shows a sharp deterioration in the image as pixilation and loss of colour shades. This distortion will be reduced by the adoption of different variants of REPro.JPEG especially by REPro.Jpeg HSV which allows a good restitution of the original image. This visual inspection is aligned with the quantitative assessment in terms of PSNR and SSIM. Indeed, the PSNR of REPro.JPEG are greater than 30 dB to exceed 35 dB through the REPro.JPEG HSV , marking a distinct advantage over conventional JPEG that provides us a PSNR of 28.33 dB. This last PSNR value unveils a flagrant dissimilarity between the original image and the image compressed by JPEG.

Conclusion
Image compression is still one of the busiest areas of research especially in the telemedicine domain. Indeed, medical images are known for their large data volume which can slow their transmissions and hinder their storages. Thus, compression is a necessity for the exploitation of these images. However, a high compression can result in a loss of information and leads to a false diagnosis. In this context, the JPEG is seen as the most common compression standard. In this paper, we propose a new approach that combines the encoding aspect of the JPEG compression to the image resizing aspect of the REPro (reduction/expansion protocol). Thus, our new approach, which we named REPro.JPEG, consists in reducing the number of image pixel before its storage or its transmission and then its compression through JPEG. At the reception or when it is displayed, the image is decompressed and expanded. The reduction is provided by the square-square mesh decimation. To enlarge the image, we proposed four techniques namely zero padding, interpolation to the nearest neighbour, cubic interpolation and interpolation by the transformed B-Spline. In addition, we studied the impact of the choice of the starting colour space in the proposed compression scheme. Indeed, the REPro and REPro.JPEG were tested on a database including 30 dermatological images which could be coded in the RGB, HSV and YCbCr colour spaces.
The preliminary study on REPro demonstrated an advantage of the combination square-square mesh decimation, followed by an expansion based on the  nearest neighbour interpolation. Moreover, we noted that the HSV space is the most adequate image representation to the REPro. Combining the REPro and the standard JPEG compression, we note again that the adoption of the HSV colour space ensures a better preservation of visual content of the compressed image by REPro.JPEG. In this paper, we also compared the JPEG compression to the compressed REPro (REPro.JPEG). This assessment reveals an advantage for JPEG during compression at NBpP higher than 0.46 in terms of PSNR. This threshold will be reduced to 0.42 for the assessment in terms of SSIM. Below these thresholds, the REPro.JPEG HSV guarantees a better restitution of the original image. In addition, below the 0.24 threshold, we note a sharp distortion of the images compressed by JPEG and which gives PSNR lower than 30 dB, while REPro.JPEG HSV provides PSNR superior to 34 dB which allows us to exploit the image compressed by our approach.