Enhancement of digitized X-ray films using Contrast-Limited Adaptive Histogram Equalization (CLAHE) [version 1; peer review: 1 approved with reservations]

Background: Rural clinics still have X-ray facilities that produce physical films, which are sent to the nearest hospital for evaluation. Purchasing digitalization facilities is costly, thus, sending digitized films to the radiologist may be a solution.  This can be achieved via digital photo capture.  However, there can be different output resolutions that may not be optimized for online diagnosis.  This paper investigates if digitized X-ray films can be enhanced using image processing techniques of Contrast-Limited Adaptive Histogram Equalization (CLAHE), Normalized-CLAHE (N-CLAHE) and Min-Max Normalized-CLAHE (MMCLAHE). Methods: We collected and digitized 21 X-ray films with low, medium, and high resolutions and implemented the CLAHE, N-CLAHE and MMCLAHE image enhancement. These methods introduced a limit to clip the histogram of image intensities so as to reduce any noise amplification before file compression with the Fast Fourier Transform (FFT) and Discrete Cosine Transform (DCT).  Quantitative metrics of the Peak Signal-to-Noise Ratio (PSNR) and Mean-Squared Error (MSE) were used to compare the accuracies between digitized and processed Xray films.  A qualitative evaluation was performed by a medical practitioner to validate the accuracy of enhanced digitized X-ray. Results: It had been found that both CLAHE and MMCLAHE provided good average PSNR values of 31dB 32dB and produced low MSE values compared to N-CLAHE.  The results of qualitative evaluation attained 89.9% correct diagnosis on nine randomly selected images. Generally, the evaluation indicated that the results fulfill the acceptable criteria for further evaluation and there seemed to be no pathological differences observed. Conclusion: This paper presented a proof of concept on an implementation of the CLAHE technique and its variations on digitized X-ray films.  This paper had shown potential improvements with the proposed enhancement methods that may contribute to an increase efficiency in healthcare processes at rural clinics. Open Peer Review

Any reports and responses or comments on the article can be found at the end of the article.

Introduction
The pandemic situation has accelerated digitalization to many countries. However, people living in rural areas are having an inconvenience to access medical technologies due to unavailability of specialists and also shortage of medical equipments. 1 In Malaysia rural clinics, for example, there are still X-ray facilities that produce physical X-ray films. The films are then sent using courier services to the nearest available hospital for diagnosis by radiologists, making the whole process becomes inefficient. Moreover, purchasing new digital X-ray facilities for rural clinics may not be cost beneficial since the population numbers are low.
Digital technology has seen growth that leads to telemedicine. [2][3][4] Telemedicine makes use of communication technology in healthcare and can be cost effective. However, telemedicine is not commonly practiced in Malaysia 5 despite its potential to address healthcare shortcomings in the rural areas. In this paper, we propose a proof of concept work to digitalize physical X-ray films via digital photo capture so that their digital versions can be sent via email or cloud for evaluation by a radiologist elsewhere. This may improve efficiency in remote diagnosis as well as reducing physical storage. 6 A study by 1 had described a simple implementation of 70 digitized chest X-ray films using a digital camera with an application of lossy compression technique. The digitized images had been shown in random order to two radiologists for diagnosis at 8 weeks after image capture. Then, lossy compression of different percentages were applied. The compressed images were again shown to the same radiologists in a random order for diagnosis at 8 weeks after the compression. The study achieved a mean percentage of 90% correct diagnosis with compression levels up to 20%. But with a compression of 40% and 50%, the correct percentages were 84% and 80%, respectively.
A similar study by 7 used an 8-megapixel smartphone on 44 X-ray films consisting of 16 chest and 28 musculo-skeletal. The digitize X-ray films were shown in random order to two radiologists for diagnosis through a LCD cellphone. The accuracy of diagnosis was reported as high. Also it was reported that a diagnosis was difficult when involving uncommon and difficult pathology cases.
These studies purely implemented digital photo capture of X-ray films and performed diagnosis without requiring online transmission. For sending images over the network, small file size with good resolution is best. However, there can be different resolutions due to differences in digital imaging software and hardware, hence, producing different qualities of digital X-ray films. 8 These variations open an opportunity to explore image enhancement techniques on images of digitized X-ray films. [9][10][11][12][13][14][15] In this paper, we investigate the use of CLAHE image processing techniques as a proof of concept and we validate the output via quantitative metrics and qualitative evaluation by a medical practitioner. Figure 1 shows the flow of our proposed methodology, which includes, data collection and digitalization, image enhancement and compression, and evaluation. These would be discussed in the preceding sections.

Ethical statement
This research project had received approval from the Multimedia University Research Ethics Committee (EA2242021).

Data collection and digitalization
We selected 21 upright chest X-ray images consisting of multiple abnormal diagnoses from multiple online databases. 16 Then, we printed these online sources to obtain the physical chest X-ray films (CXR). After that, the CXR were captured using an Apple iPhone XS Max. To alter the image resolutions, the images were taken using a third-party application, DSLR Camera. 17 An X-ray illuminator (Victor Steel VS148-A) was used as shown in Figure 2.
The setup in Figure 2 was done in a well-lit surrounding. A view box was placed on a flat surface approximately 30 cm away from a tripod mounted with a smartphone. A CXR was clipped to the view box in a side-view position with the illuminated area placed facing the smartphone. The position of the tripod head was adjusted to ensure the CXR filled the phone display and the personal details at the corner side were not in view. The flashlight setting was turned off to avoid reflections. The ISO speed was fixed to ISO-24 with an exposure time fixed to 1/100 seconds. Images were taken at High, Medium, and Low resolutions for a total of 63 digitized CXR. These images were stored as a JPEG format and unnecessary details were cropped using Windows 10 Photos application.

Image enhancement
Histogram Equalization (HE) is the commonly used method for image enhancement. In HE the contrast of an image is enhanced by modifying the distribution of pixel intensities. By distributing pixel intensities equally to each histogram, a global equalization is achieved. Thus, HE tends to over-enhance parts of an image that adds unnecessary artifacts and may increase image noise. 11 Adaptive Histogram Equalization (AHE) is an improvement of HE. AHE improves local contrast by dividing an image into blocks and applying computations to every block. 11 Bilinear interpolation is used to combine all blocks into one image. A study conducted by 10 applied AHE on 50 microfocus X-ray images. It showed that 80% of these had significant increase in contrast and detailing. However, AHE had a slow processing speed and enhanced image noise.
Contrast-Limited Adaptive Histogram Equalization (CLAHE) is an extension of AHE. Similar to AHE, CLAHE uses blocks in an image. The only difference is the addition of a contrast limit to reduce the noise amplification by clipping the histograms. 14 The limit is a predefined value prior to calculation of a Cumulative Distributive Function (CDF). Histograms that exceed the clipped value are redistributed evenly to other histograms instead of removal. A study by 9 found that images produced from CLAHE had higher pixel values than that of original images and had brought out more details and structure to the images. Both 9 and 14 had agreed that CLAHE was good at maintaining image brightness level.
A study by 18

Image compression
Image compression is a process to reduce large-sized images into smaller-sized images without degrading the image quality. In this work, it is required to compress the digitized CXR since these need to be sent to the specialists using a low or moderate network bandwidth. Compression works by reducing the number of bits to represent an image. It has three types, lossless, lossy and hybrid. 19 A hybrid compression combines both lossless and lossy based on region of interest (ROI) and non-ROI of images. 20 However, in the absence of subject experts, the ROI could not be determined 21-23 as in our work.
A lossless compression produces high-fidelity reproduction of images but may tend to have large file sizes. On the other hand, lossy compression produces good compression for use in telemedicine that suits rural areas with limited internet connectivity. Thus, in this research, standard lossy image compression techniques such as the Fast Fourier Transform (FFT) and Discrete Cosine Transform (DCT) are used. 24 Quantitative evaluation metrics The Peak Signal-to-Noise Ratio (PSNR) and Mean-Squared Error (MSE) are our quality metrics for comparing the before and after processing of the digitized CXR. A higher PSNR value means better quality of the compressed image. A lower MSE value means less errors contain in the image.

Qualitative evaluation procedure
To validate the diagnosis of the digitized CXR, we invited a medical practitioner to perform a blind evaluation. A randomly selected processed CXR with specific diagnosis were sent to the evaluator. The evaluator was asked to confirm the diagnosis by answering a series of "yes/no" questions and the responses were recorded.  For qualitative evaluation, samples of Figure 3 were presented to the medical practitioner. Generally, the practitioner was extremely satisfied with the quality of the digitized and processed CXR. Images C and D (using MMCLAHE) were said to be better than Images A and B (using CLAHE). Images E and F (using N-CLAHE) were the worst among all due to overexposure. Table 2 shows the results of blind qualitative evaluation where nine images were randomly selected for diagnosis. All diagnosis of the presented digitized CXR had managed to be identified without any difficulties except for Image 7. The true diagnosis for Image 7 was Normal. However, the diagnosis reported that there might be some abnormalities present even though Image 7 was a High resolution MMCLAHE-FFT enhanced image. Thus, a simple accuracy attained by the qualitative evaluation is 89.9%, which is comparable to the work of Refs. 1 and 7.  Also, for Image 6, which was a Medium resolution CLAHE-FFT, it was highlighted that further testing would be required to confirm the diagnosis of Infiltration. Nonetheless it was generally concluded that no pathological differences were observed between all processed CXR and all digitalized CXR.

Conclusions
In this paper, we presented the results of image processing techniques using CLAHE and its variations to enhance digitized X-ray films. Twenty-one physical X-ray films had been digitized via mobile phone capture at Low, Medium, and High resolutions. Three different image enhancement methods with two different image compression techniques had been compared. Results of quantitative evaluation indicated that N-CLAHE may not be a suitable method due to producing an overexposure. Also, the performance of DCT or FFT did not affect the quality of output.
Results of qualitative evaluation further validated the accuracy of the digitized X-ray with a medical practitioner. It had been found that the accuracy of correct diagnosis is close to the work by others in literatures. The overall presentation of the digitized X-ray had been found to be acceptable though some images might require further testing to confirm a diagnosis. Nevertheless, this paper had shown potential improvements with the proposed methods of enhancement that in turn may contribute to an increase efficiency in healthcare processes at rural clinics. This project contains the following data:

Author contributions
-A collection of processed chest X-ray digitized images with CLAHE, MMCLAHE, N-CLAHE techniques and FFT and DCT compression.
Data are available under the terms of the Creative Commons Zero "No rights reserved" data waiver (CC BY 4.0 Public domain dedication).

Figshare. CLAHE-Enhanced X-ray Images
This project contains the following data: -Processed images after digitization of physical X-ray films using CLAHE, MMCLAHE, N-CLAHE, and DCT and FFT compression.
Data are available under the terms of the Creative Commons Zero "No rights reserved" data waiver (CC BY 4.0 Public domain dedication).