Medical Image Compression Based on Wavelets with Particle Swarm Optimization

: This paper presents a novel method utilizing wavelets with particle swarm optimization (PSO) for medical image compression. Our method utilizes PSO to overcome the wavelets discontinuity which occurs when compressing images using thresholding. It transfers images into subband details and approximations using a modified Haar wavelet (MHW), and then applies a threshold. PSO is applied for selecting a particle assigned to the threshold values for the subbands. Nine positions assigned to particles values are used to represent population. Every particle updates its position depending on the global best position (gbest) (for all details subband) and local best position (pbest) (for a subband). The fitness value is developed to terminate PSO when the difference between two local best (pbest) successors is smaller than a prescribe value. The experiments are applied on five different medical image types, i.e., MRI, CT, and X-ray. Results show that the proposed algorithm can be more preferably to compress medical images than other existing wavelets techniques from peak signalto noise ratio (PSNR) and compression ratio (CR) points of views.


Introduction
Compressing patient's medical images is a rising demand nowadays in medical organizations due to the needs to archive and transfer large numbers of high resolutions images. Indeed, maintaining those images costs organizations powerful servers, wide network bandwidth and backup storage devices. The problem arises here is concerning the nature of these data itself, medical images need special care when performing compression. Losing important medical details in images may affect medical diagnose for patients. Therefore, any improvement in image compression methods would help storing and transferring medical history properly.
Many compressing algorithms have been proposed in this context, some of them utilizes wavelet family transforms. Haar wavelet method is a member of the family, it is considered as a popular image compression method due to its simplicity comparing to others. Nonetheless, the main disadvantages of the Haar wavelet is features discontinuity that leads to difficulties for simulating continuous signals [1][2][3].
In this paper, a modified Haar wavelet (MHW) algorithm for medical images compression is introduced. The algorithm combines Haar wavelet with PSO as a threshold value selection method. This modification assists in compressing medical image to maintain its purity and preserve fine details while keeping compression ratio high.
The proposed algorithm begins by subdivide the input image into four frequency subbands: one approximation and three detail coefficients. Haar wavelet is modified for this task in order to work with 2 × 2 matrices instead of whole image and to keep the approximation subband unchanged. We get one approximation of low subbands for row and column filtering (LL), high subbands for row filtering and low subbands for column filtering (HL), low subbands for row filtering and high subbands for columns filtering (LH), and high subbands for row and column filtering (HH). To sum up, nine subbands are obtained by applying MHW on the details (LL-HL-LH-HH).
A threshold is utilized for reducing search space of the coefficients while nine thresholds assigned to their positions are selected to represent subbands (one for each subband). We use these thresholds as particle candidates for the PSO algorithm. PSO is updated by the global best position (gbest) for all details subband and local best position (pbest) for a subband. We developed the fitness value to terminate the PSO to reach a target threshold. The proposed algorithm is implemented using various types of medical images with different sizes, and it is compared with other existing wavelets techniques. The algorithm achieved better result from PSNR and CR point of views.
This work is organized into five sections: Section 1 introduced the work. In Section 2, related work is depicted. Section 3 describes the proposed algorithm. The performance evaluation is shown in Section 4. We provided the experimental results in Section 5. Finally, the conclusion is presented in Section 6.

Related Work
Medical image compression techniques can be categorized into two main types depending on the redundancy removal way, namely Lossless et al. [4][5][6]. Lossless allows the original image to be reconstructed exactly from the compressed image with low compression rate [7]. In contrast, lossy image compression characterized by degrading image quality because it does not reconstruct exactly the original image [8].
Wavelet transform considers a well-known technique that can work as lossy or lossless compression based on calculating thresholds in the details subbands [9]. Several wavelet types like Haar, Coiflet, Symlets, Daubechies, Biorthogonal, and (5/3) and (9/7) lifting schemes can be used for medical images compression [10]. The performance of these algorithms varies depending on its ability to decompose signal into low and high frequency components where thresholding process takes place for compression.
Rao et al. [11] had evaluated comparison analysis of image compression techniques based on Haar wavelets. Their studies concentrated on relation between compression efficiency and short processing time in case of data transfer over the internet or any channel. Zanaty et al. [12] combined wavelets by a region growing technique for compressing region of interest. Mohamed et al. [13] integrated Haar wavelet with quad tree to enhance mammogram image compression. Umezu et al. [14] introduced Z-map models depending on irreversible compression algorithm using a two-dimensional Haar wavelet transform in order to resolve tight memory situation for an ordinary PC, see [15] for more mathematical theories. Nahar et al. [16] proposed double density wavelets transform (DDW) for image compression based on discrete wavelets transform (DWT) [17]. Priya et al. [18] compressed medical image based fuzzy segmentation applying a fuzzy C-means clustering into a region of interest (ROI) and non-region of interest (NROI). ROI is compressed using DWT coding while NROI is compressed using well-known context adaptive variable length decoder. Benyahia et al. [19] used wavelet packet coupled with the progressive coder SPIHT for developing compression techniques for medical images by preserving detailed structures to produce high quality images. Reisenhofer et al. [20] presented Haar wavelet algorithm based on perceptual similarity index. The algorithm uses similarity measures for full reference image to evaluate quality level assessment. Vasanth et al. [21] mixed Haar wavelet with Huffman encoding for image compression. Rao et al. [22] examined the performance of principle component analysis (PCA) and wavelet difference reduction (WDR) techniques when applied to x-ray and CT images. Agarwal et al. [23] reviewed various image compression using wavelet-based methods including subband coding (SBC), decoding for medical pitch (EHT) [24] and transform coding (IATC). More compression technique is stated in [25,26] for combinational hybrid compression algorithm of medical image in [27,28] and to analyzing the relation between resultant image details of different granularities.
From the stated methods, we have noted that there is no universal algorithm for providing an optimal compression. Each algorithm has its own specific drawbacks like compressing ratio, speed, image types, or memory usage. Therefore, effort is needed in order to overcome such drawbacks.

Modified Haar Wavelet with PSO
In this section, we describe the proposed algorithm for medical image compression. The novelty of this algorithm is the use of POS for the shrinkage of the transforming coefficients. Fig. 1 shows the proposed compression scheme. In the following subsections, the compression steps of the proposed algorithm are described. First, the modified Haar wavelet transform step is explained. Then, the thresholding process is addressed. Finally, using the POS is discussed.

Modified Haar Wavelet
Haar wavelet transform is the simplest orthogonal wavelet transform, and it is computed by iterating difference and averaging between odd and even pixels of digital images. Haar wavelet transform can be utilized in various ways for compressing images by decomposing its matrix to sparser one [29][30][31][32][33]. In order to preserve more image quality and clarity, we modified Haar wavelet (MHW). MHW introduces a new transformation capable to achieve better compression results than the classical one in [34,35], and to reach better PSNR and CR values.
Instead of performing Haar wavelet levels on rows then perform the same step on resulting matrix (on columns) as what in [36][37][38], we make the one step transform just one time on all rows follow by one step transform on resulted columns as [39]. For that, we use MHW for dividing the original image of W × H dimensions into 2 × 2 matrices and apply the transform as in Eqs. (1) and (2): where values of A, B, C and D are calculated as follow: For reconstruction, we can gain a, b, c and d as follow: Eq. (4) can be reformatted as: ⎡ In a similar way, the reconstruction equation:

Subbands and Thresholding
We use thresholding process in order to reduce searching space of coefficients. First, subbands coefficients are evaluated by applying MHW on the input image to obtain four subbands details (coefficients). This means that the positions in Eq. (1) are replaced by coefficients in Eq. (5) to become: ⎡ Redistributing the coefficients of this matrix to be: where i = 1, 2, . . . , W , and j = 1, 2, . . . , H. In the four subbands, one is called approximation and three are called details (approximation LL-horizontal details LH-vertical details HL-diagonal details HH) as shown in Fig. 2.

Figure 2: The matrix is subdivided into four subbands
In order to reach optimal PSNR, MHW is applied again to LH, HL and HH subbands to get 12 subbands: three approximation, and nine details. The approximation subbands (LL) includes the important information (approximation) as shown in Fig. 3. The details are then employing the thresholding process and arranged to nine subbands (HL1, LH1, HH1, HL2, LH2, HH2, HL3, LH3, HH3) as follows: Secondly, we select an element x ij for each subband of N × N dimensions and compute the corresponding threshold T using the following equation: where μ is mean of the detailed subband coefficients (consists of nine values) and σ is the coefficients standard deviation. μ is calculated in every detailed subband as: Also, σ is computed as:

Particle Swarm Optimization (PSO)
PSO has appeared as a rising algorithm for solving various optimization challenges iteratively [40][41][42][43][44]. In PSO, population is called a swarm and individuals are called particles. The movement of swarming particle depends on two components: A deterministic and stochastic component [45,46].
In our methods, the nine positions are the population assigned to particle values (i.e., a threshold value for a subband) as in Fig. 3. PSO estimates best achievable threshold for each subband. This step leads us to get best achievable PSNR for reconstructed image, and to get acceptable CR and MSE values, as well. The resultant nine subband details represent input particles candidates for the PSO algorithm. The largest value in the population is named as gbest global best, pbest represents local best value for the input subband. The fitness value is evaluated by assigning a value to a particle's position. rand () is selected randomly from thresholds spaces of a subband, Particles are flying around in the search space and every particle redefines its position depending on the global best position gbest, local best position pbest and can be represented by the following formula: where v [] and pr [] represent the guided particle's fitness value and the initial state of the particle (start by 0), respectively, while c1, c2 are learning factors equal to 2 [47,48].
The population is updated by rand () value for each iteration, and consequently gbest and pbest are updated if rand () is greater than pbest. The process stops if the fitness function f (p best ) is smaller than a prescribe value where the best threshold is obtained for a subband: wherep best successor value of p best for iteration.

Overview of the Proposed Algorithm
The proposed algorithm starts by input a given image to MHW transformation. MHW works on detailed subbands instead of approximation subbands. Then, the subbands are reconstructed while thresholding process is completed; particle swarm optimization is used for thresholding details of subbands based on the fitness function. Briefly, the proposed algorithms can be described as the following steps: Step 5. Applies PSO (Eqs. (12) and (13)) on input particles for a subband. 6. Step 6. Updates the position and velocity (Eqs. (12)) until the result for the fitness function leads to best value. The processes are stop if the fitness function f (p best ) (Eq. (14)) is smaller than the prescribe value. 7.
Step 7. Updates the rand () by pbest and select an arbitrary threshold from the next subband. 8.
Step 9. Finds the best threshold pbest from the output nine thresholds 10.
Step 10. Reconstructs the compressed image f (x, y) (threshold matrix) assigned to the original image f (x, y), where x and y are coordinates.

Performance Evaluation
After reconstructing the subbands (thresholds matrix) by applying the transformation (Eq. (6)). We examine our algorithms performance. Various image similarity indexes were used like PSNR, MSE, CR, and percentage difference in order to prove efficiency of the proposed method.

Mean Square Error (MSE)
MSE measures the error between two images. Root mean squared error or RMSE calculated using the square root of MSE. MSE can be evaluated for monochrome images by: where W and H are dimensions of a reconstruction matrix. f (x, y) and f (x, y) represent original and compressed image pixels, respectively. Compression methods aim to minimize the MSE.

Peak Signal to Noise Ratio (PSNR)
PSNR represents the ratio between original signal variance and reconstruction error variance. PSNR is expressed in Decibel scale. The PSNR used as a measure of the reconstruction quality gained during image compression process. Compression methods aim to maximize PSNR values. PSNR = 10 * log 10 255 2 MSE (16) Assuming pixels are represented using eight bits while 255 represents the maximum pixel value of the image, PSNR values takes range between zero and infinity, infinity for perfect identical images and 0 for images that have no commonality.

Peak Signal to Noise Ratio (PSNR)
CR is defined as the ratio between the original image size and compressed image size.
where f (x, y) is compressed image, and f (x, y) represent original image.

Percentage Difference (PD)
The absolute value of the change in method results, divided by the average of them, then multiplied by 100. it is calculated for finding percentage differences between method performances.

Experiment Results and Discussion
In this section, various compressing methods are compared aiming to compress medical images. We experimentally study the performance of these methods, where the performance is assessed using a wide number of medical images of different sizes from MRI and CT types. To run this experiment, five different grey-scale medical images were used: MRI for posterior cruciate ligament (1280 × 1280), CT horizontal view for (937 × 937), CT vertical view for and neck (800 × 600), X-ray image for chest (1060 × 1227), and MRI for circulatory system (024 × 610). The test images are shown in Fig. 4. The images have been chosen carefully to help in distinguishing between the methods. The sharp edges in the posterior cruciate ligament image helps in demonstrating how various methods compress edges, whereas the fine details in and neck image helps in demonstrating how various methods preserve image clarity. The grey gradations in chest image provide insight into the amount of compressing that has been applied to images. We have implemented our proposed algorithm on a machine has processor Intel Core i7-4510U-CPU 2.00 GHz-internal memory 8.00 GB RAM. In the following subsections, the methods are evaluated both quantitatively and qualitatively. The images were compressed by existing Haar, Coiflet, Daubechies, Biorthogonal, Dmeyer, Symlets, and the proposed algorithm. Then, the inverse transformation was used to construct the final images (constructed image). All method outputs were compared quantitatively and qualitatively.

Quantitative Evaluation
In this subsection, we use numerical indicators to evaluate the methods. Eqs. (16)-(18) were exploited for MSE, PSNR and CR, respectively. Various existing wavelets for images compression were compared. The results are computed by measuring the differences between original and compressed images. Tab. 1 shows the obtained performance of the methods. The proposed methods on the sub details (LH-HL-HH) and (LL-LH-HL-HH) gave better results than the existing wavelets like Haar, Coiflet, Daubechies, Biorthogonal, Dmeyer, and Symlets. The proposed methods are the best whether they are used for compressing MRI or CT types. When we applied the proposed method (LH-HL-HH) to the MRI images posterior cruciate ligament and circulatory system, the results overcame the second best obtained (Coiflet) results by 17.67%, and 57.22%, respectively-from PSNR point of view. In case of the CT horizontal view for human brain and human brain and neck images, the method's performance significantly exceeded (Coiflet) by 34.31%, and 28.81% respectively-from PSNR point of view. Moreover, when we applied the method to the X-ray image for the chest, it achieved 39.17% better than (Coiflet)from PSNR point of view.
Similarly, when we applied the proposed method (LL-LH-HL-HH) to the MRI images posterior cruciate ligament and circulatory system, it overcame second best obtained results (Coiflet) by 7.32%, and 20.36%, respectively-from PSNR point of view. In case of the CT horizontal view for human brain and human brain and neck, the method's performance exceeded (Coiflet) by 19.53%, and 27.48% respectively-from PSNR point of view. Moreover, when we applied the method to the X-ray image for the chest, it achieved 19.99% better than (Coiflet)-from PSNR point of view.
When we utilized Eq. (18) for finding the percentage differences among the method we noticed that (LH-HL-HH) achieved generally better percentages than (LL-LH-HL-HH). We believed that (LH-HL-HH) keeps the LL subband constant during the decompositions phase. A chart graph shows results of the various methods when compressing the various images, in Fig. 5.

Qualitative Evaluation
In this subsection, a comparison between reconstructed images of the posterior cruciate ligament using various transforms are shown in Fig. 6. Reconstructed images of the human brain are shown in Fig. 7. Fig. 8 shows a comparison between reconstructed images of human brain and neck. A comparison between reconstructed images of the chest using various transforms are shown in Fig. 9. Fig. 10 shows comparisons between reconstructed images of circulatory system.

Conclusion
In this paper, we have introduced a novel algorithm based on merging wavelets and PSO to overcome the medical image compression problems like trade-off between CR and PSNR. Keeping CR high affects PSNR, and vice versa. The algorithm has been designed to keep the PSNR as high as possible using the PSO. It has been applied to challenging applications like MRI, CT, X-ray images in order to prove its efficiency. The output results were compared with the existing wavelets techniques like Haar, Coiflet, Daubechies, Biorthogonal, Dmeyer and Symlets. Applying the algorithm on (LH-HL-HH) keeps the LL subband constant during the decompositions, and that assists in achieving high compression.
The performance of the proposed algorithm has showed superiority in all tests over the existing wavelets even with high detailed images like circulatory system images, from PSNR point of view. PSNR and CR values were increased for horizontal view for the CT (brain image) and MRI image (posterior cruciate ligament), respectively. Compressing X-ray (chest view) overcame best existing methods by six times.
The PSNR value is enhanced, when applied the proposed algorithm only on the detailed subbands. That can give greater flexibility towards our target either to gain more cleared image (high PSNR value) or saving more space (high CR value). Future research, it is possible to integrate intelligence techniques with the proposed algorithm to create a learning dictionary that accelerates and helps in the process of compressing images of a convergent nature, which may lead to continuous improvement of the values of image compression, purity and speed up the process as a whole.
Funding Statement: This work was funded by the University of Jeddah, Saudi Arabia, under Grant No. UJ-20-043-DR. The authors, therefore, acknowledge with thanks the University technical and financial support.

Conflicts of Interest:
The authors declare that they have no conflicts of interest to report regarding the present study.