# Backpropagation Neural Network Implementation for Medical Image Compression

Authors: Kamil Dimililer
Journal: Journal of Applied Mathematics
 (2013)

---

## Abstract

Medical images require compression, before transmission or storage, due to constrained bandwidth and storage capacity. An ideal image compression system must yield high-quality compressed image with high compression ratio. In this paper, Haar wavelet transform and discrete cosine transform are considered and a neural network is trained to relate the X-ray image contents to their ideal compression method and their optimum compression ratio.


---

## Body

## 1. Introduction

Most images at some point will require compression before transmitting or storage due to constrained bandwidths and limited storage capacity. This is especially true of medical images. X-ray images are widely used in medicine; they are the second most commonly used type of tests after laboratory ones.Teleradiology, which is the term used for using technology to send radiographic images or X-rays across distances from one location to another, has become lately one of the most used clinical aspects of telemedicine. Telemedicine refers to the use of communication and information technologies for the delivery of clinical care, such as the transfer radiological images from a site of image acquisition to a remote location for interpretation in hospitals such as tomography (CT) scans, magnetic imaging (MRI), ultrasonography (US), and X-rays. These radiological images are needed to be compressed before transmission to a distant location or due to the bandwidth or storage limitations [1].There has been a rapid development in compression methods to compress large data files such as images where data compression in various applications has become more vital [2]. Efficient methods of compression, to compress and store or transfer image data files, are needed while retaining high image quality and marginal reduction in size due to the improvements of technology [3].The discrete cosine transform (DCT) is one of the most popular transforms used in compression of medical images in standards like Joint Photographic Experts Group (JPEG). In DCT-based compression the image is split into smaller blocks for computational simplicity, and the blocks are classified on the basis of information content to maximize compression ratio without sacrificing diagnostic information [1]. DCT-based image compression has been popular due to its simplicity and thus has been used in many medical image processing applications [4–7]. The use of DCT and artificial neural networks has also been investigated in search for optimum compression methods. In [8], DCT and neural networks based medical image compression was proposed and applied to MR and CT medical images. In [9], a topology-preserving neural network was developed for medical image compression using a “neural-gas” network. In [10], adaptive architecture neural networks were implemented for medical image compression. In [11], a neural network classifier was used with a combination of different image compression techniques for various applications. In [12], a neural network model called direct classification was used to compress image data. In [13], a direct solution method applied to image compression using neural networks was suggested.More works using neural networks for image compression applications emerged lately, such as those in [14]; a neural network quantizer was used to yield a high compression ratio while maintaining high-quality images. In [15], a multiresolution neural network (MRNN) filter bank was used as a transform for coding. In [16], an image compression algorithm based on image blocks complexity measure methods and a neural network was proposed. In [17], image compression using wavelet transform and a neural network was suggested. In [18], a neural network based DCT compression system that finds the optimum compression ratios for a variety of images was also suggested.Unlike the discrete cosine transform, the wavelet transforms are not fourier based and therefore discontinuities in image data can be handled with better results using wavelets [19]. Wavelets are a mathematical tool for hierarchically decomposing functions. There is a general preference to use wavelet transforms in image compression because the compressed images will be obtained with higher compression ratios and higher PSNR values [20]. Haar wavelet transform is one of the wavelet methods applied in compressing the digital images. Previous works using Haar image compression include an application that is applied to adaptive data hiding for the images dividing the original image into 8 × 8 subblocks and reconstructing the images after compression with good quality [21].The use of compression methods in general, and wavelet compression in particular, with medical images has been previously investigated in [1, 22–25]. More recently, a neural network model was used to obtain the optimum compression ratio when using Haar wavelet image compression which was applied to a variety of images [19].The aim of the work presented within this paper is to develop an image compression system for medical X-ray image compression using a neural network classifier and two popular compression methods, namely, Haar wavelet transform (HWT) and discrete cosine transform (DCT). Our novel method suggests that a trained neural network can learn the nonlinear relationship between the intensity (pixel values) of an X-ray image and its ideal compression method and optimum compression ratio. Once the ideal compression method, out of the two considered methods, is chosen by the network, and the highest compression ratio, while maintaining good image quality, using that chosen method, is obtained, then the result reduction in radiograph image size should make the storage and transmission of radiographs more efficient.Figure1 represents the block diagram for the suggested medical image compression system. In training phase, predetermined compression methods with their compression ratios are prepared and trained using backpropagation neural network and in testing phase, the images are given to the back propagation neural network system to achieve the compression ratio and compression method.Figure 1
Block diagram of medical image compression system.The paper is organized as follows. Section2 describes the X-ray image database which is used for the implementation of our proposed system. Section 3 presents the X-rays compression system, describing image preprocessing and the neural network design and implementation. Section 4 introduces the method used to evaluate the results and provides an analysis of the system implementation. Finally, Section 5 concludes the work that is presented within this paper and suggests further work.


## 2. The X-Ray Image Database

The development and implementation of the proposed system for medical X-rays compression uses 80 X-ray images from our medical image database, which contains X-ray images of fractured, dislocated, broken, and healthy bones in different parts of the body. Both considered compression methods (DCT and HWT) were applied to X-ray images using nine compression ratios (10%,20%,…,90%) and an original image with its compression using the ratios using DCT method is shown in Figure 2 [26].Figure 2
An original image, its DCT compression at nine ratios.Contrast weighted entropy is a new term that combines the change of contrast values between the neighbor pixels with the entropy of the image which includes the information present within an image. An image with high contrast weighted entropy should be compressed with a low amount of compression ratio in order not to make the information within the pixels lost. However, an image with low contrast weighted entropy can be compressed with higher amount of compression ratio because there are not enough details that can be lost during the compression process. Equation (1) represents the contrast weighted entropy of an image:
(1)CWH=-∑N(pi-μ)×pi×log2(pi)×Tot,
where Tot represents the total number of pixels within the image, N represents the number of intensity values of the pixels within the image, pi represents the probability of the intensity values, and μ represents mean value of the frequencies of the intensity values.The optimum HWT and DCT compression ratios for the X-ray images were determined using the optimum compression criteria based on visual inspection and empirical analysis. The visual inspection involved 10 experts in their field who were asked to observe the change in contrast within the pixels, amount of data within an image, and smoothness and edge continuity of certain areas within the reconstructed images [27] and consider the contrast within the adjacent pixels and their entropy within the certain areas of the images which is the value of contrast weighted entropy in Table 1 [28].(i)
Training image set: contains 40 images withknown optimum compression ratios which are used for training the neural network within the compression system. Examples of training images are shown in Figure 3(a).(ii)
Testing image set: it contains 40 images withknown optimum compression ratios which are used to test and validate the efficiency of the trained neural network. Examples of these testing images are shown in Figure 3(b).Table 1
Original and compressed images with their CWH.
Image 1
CWH
Image 1
CWH
Org. Image
−34411.02
50% DCT
−48393.47
10% DCT
−38218.98
60% DCT
−46485.02
20% DCT
−50871.91
70% DCT
−48452.21
30% DCT
−49501.59
80% DCT
−74821.62
40% DCT
−49025.81
90% DCT
−120325.1(a) Training Set. (b) Testing Set.
(a)
(b)


## 3. The X-Rays Image Compression System

The X-ray image compression system uses a supervised neural network based on the back propagation learning algorithm, due to its implementation simplicity and the availability of sufficient “input/target” database for training this supervised learner. The neural network relates the X-ray image intensity (pixel values) to the image ideal compression method and its optimum compression ratio having been trained using images with predetermined compression methods and ratios. Once trained, the neural network would choose the ideal method and the optimum compression ratio for an X-ray image upon presenting it to the neural network by using its intensity values.Sample image resizing was used to resize the original images of size (256 × 256) pixels into (64 × 64) pixels, deleting the next three pixels while keeping the first pixel value. Further reduction to the size of the images was attempted in order to reduce the number of input layer neurons and consequently the training time; however, meaningful neural network training could not be achieved and, thus, the use of whole images of the reduced size of 64 × 64 pixels.In a previous research [19], 32 × 32 = 1024 nodes of input was applied to the back propagation neural network. In this paper, 64 × 64 = 4096 nodes of input has been preferred to give adequate information to the suggested image compression system. Although 1024 nodes of input takes less training time, the 4096 nodes of input were preferred because the recognition ratio for the 4096 nodes of input is higher than the recognition ratio of the 1024 nodes of input. The testing time for both networks was equal. As a result, 64 × 64 = 4096 nodes of input has been preferred taking into account the recognition ratio rather than the training time.The size of the input X-ray images affects the choice of the number of neurons in the neural network’s input layer, which has three layers: input, hidden, and output layers.Figure3 represents sample images from the training set and testing set of the back propagation neural network.Using one-pixel-per-neuron approach, the neural network’s input layer has 4096 neurons; according to the topology of the neural network, the hidden layer has been decided to be used as 52 neurons after several experiments, which assures meaningful training while keeping the time cost to a minimum, and its output layer has 18 neurons representing the output classification of the ideal compression method and the optimum compression ratio as follows: output neurons {1–9} represent DCT compression at ratios (10%–90%), whereas output neurons {10–18} represent HWT compression at ratios (10%–90%).During the learning phase, the learning coefficient and the momentum rate were adjusted during various experiments in order to achieve the required minimum error value of 0.002, which was considered as sufficient for this application. Figure4 shows the topology of this neural network, within the image compression system.Figure 4
X-ray image compression system. ICM: ideal compression method, OCR: optimum compression ratio.


## 4. Results and Discussion

The evaluation of the training and testing results was performed using two measurements: the recognition rate and the accuracy rate. Once the choice of the ideal compression method is made by the neural network, the recognition rate is defined as follows:(2)RROC=(IOCIT)*100,
where RROC is the recognition rate for the neural network within the X-ray compression system, IOC is the number of optimally compressed X-ray images, and IT is the total number of X-ray images in the database set.The accuracy rate RAOC for the neural network output results is defined as follows:
(3)RAOC=100+(1-((|Sp-Si|)*10)+STST),
where SP represents the pre-determined (expected) optimum compression ratio in percentage, Si represents the optimum compression ratio as determined by the trained neural network in percentage, and ST represents the total number of compression ratios used for both of the compression methods.The optimum compression deviation (OCD) is another term that is used in our evaluation. OCD is the difference between the pre-determined or expected optimum compression ratioSP and the optimum compression ratio Si as determined by the trained neural network and is defined as follows:
(4)OCD=(|Sp-Si|)10.The OCD is used to indicate the accuracy of the system, and depending on its value the recognition rates vary. Table2 shows the three considered values of OCD and their corresponding accuracy rates and recognition rates. The evaluation of the system implementation results uses (OCD = 1) as it provides a minimum accuracy rate of 87.5% which is considered sufficient for this application.Table 2
Accuracy and recognition rates according to OCD.
OCD
Accuracy rate (RAOC)
Recognition rate (RROC)
0
100%
21/40 (52.5%)
1
94.44%
36/40 (90.0%)
2
88.89%
37/40 (92.5%)
3
Below 88.89%
40/40 (100%)The neural network learnt and converged after 3524 iterations or epochs, and within 33 minutes and 12 seconds, whereas the running time for the generalized neural networks after training and using one forward pass was 0.01 seconds. These results were obtained using a 2.8 GHz PC with 8 GB of RAM, Windows 8, 64-bit OS, and MATLAB 2013a software.Table3 lists the final parameters of the successfully trained neural network, whereas Figure 5 shows the error minimization curve of the neural network during learning.Table 3
Neural network final training parameters.
Input nodes
4096
Hidden nodes
52
Output nodes
18
Learning rate
0.0005
Momentum rate
0.3
Error
0.002
Iterations
3524
Training time (seconds)
2015
Run time (seconds)
0.015Figure 5
Neural network’s learning curve.The trained neural network recognized correctly the ideal method and optimum compression ratios for all 40 training images as would be expected, thus yielding 100% recognition of the training set. Testing the trained neural network using the 40 images from testing set that were not presented to the network before yielded 90% recognition rate, where 36 out of the 40 images with known ideal method and optimum compression ratios were correctly classified.The results of this application are demonstrated in Figure6 which shows examples of the optimally compressed X-ray images as determined by the trained neural network.Figure 6
Examples of testing set image compression using the developed system.


## 5. Conclusions

This paper describes a novel method for compressing medical X-Ray images using a neural network with Discrete Cosine Transform and Haar Wavelet Transform. The method uses HWT and DCT based compression with nine compression ratios each and a supervised neural network that learns to associate the gray X-ray image intensity (pixel values) with the ideal compression method and a single optimum compression ratio to be used with the selected method.The implementation of the proposed system chooses HWT and DCT based image compression methods as they have been popularly and efficiently used in previous works for this kind of application. The aim of an optimum compression ratio is to combine high compression with good-quality compressed X-ray images, thus making the storage and transmission of these medical images more efficient.The proposed system was developed and implemented using 80 X-ray images of fractured, dislocated, broken, and healthy bones in different parts of the body. The neural network within the compression system learnt to associate the 40 training images with their predetermined ideal compression method and optimum compression ratios within 3524 seconds. Once trained, the neural network could recognize the ideal method and optimum ratio for an X-ray image within 0.015 seconds.In this work, a minimum accuracy level of 94.44% was considered as acceptable. Using this accuracy level, the neural network yielded 90.0% correct recognition rate of ideal method and optimum ratios.Future work will include the implementation of this system using multilayer perceptron neural network structure to be used in the decision of optimum compression ratio with optimum compression method using Daubechies wavelet and biorthogonal wavelet transform based image compression.



---

*Source: 453098-2013-12-31.xml*