Contrast Enhancement Techniques for Medical Images

Hemanth Sanisetty
Level Up Coding
Published in
4 min readJun 30, 2022

--

Introduction

Contrast enhancement is a technique that amplifies the visual difference between adjacent structures in images. It is especially useful in medical imaging because it can reveal more information about the organs or tumors shown in the image and sharpen the edges between them. In this Kaggle Competition, we tried out several methods to achieve contrast enhancement during image preprocessing.

Dataset

The competition dataset consists of MRI scans from 85 patients over a range of 1 to 6 days. In total, there are 274 days of scans for 85 patients, with each day containing 144 slices of images. A small number of days, around 5%, have only 80 slices. The dataset includes a total of approximately 38,000 image slices. For contrast enhancement of this dataset, we examined the following three different methods.

Histogram Normalization

To perform histogram normalization, the full range of pixel values in an image is divided into a series of bins. The pixel values in each bin are then normalized using min-max normalization, which scales the values so that they span the full range of possible values (e.g., 0 to 255 for 8-bit images). This results in a more evenly distributed histogram, with more of the pixel values falling towards the middle of the range rather than clustering at the low or high end.

Histogram normalization can be useful in a variety of applications, including medical imaging, where it can help to improve the visibility of features in an image and make it easier to identify abnormalities or structures of interest.

Original image followed by the images after histogram normalization with bins = 8, 16, 32, 64 respectively.

Gamma Correction

Gamma correction is a technique used to adjust the brightness and contrast of images displayed on electronic devices, such as monitors and TVs. It is especially important in medical imaging, where accurate display of images is critical for diagnosis and treatment. Gamma correction is used to ensure that the images are displayed correctly on the device and appear the same as they were intended by the creator.

To apply gamma correction to medical images, the first step is to determine the gamma value of the display device that will be used to view the images. This can typically be done by looking up the specification of the device or by measuring the device’s response to a known input signal.

Once the gamma value of the display device has been determined, the intensity values of the medical images can be adjusted to match the characteristics of the device. This is typically done by applying a reverse gamma correction, or gamma decoding, to the encoded intensity values of the images.

In the public dataset of this competition, there are images from at least two devices and we don’t have any information about the gamma of these devices. We have experimented with different possible gamma values in an attempt to adjust the contrast of the images.

Original image followed by images after gamma contrast with gamma = 0.25, 0.50, 0.75, 1.25 respectively.

CLAHE

In both of the above methods, you can see that the output images have a lot of noise amplification, particularly in the brighter images. To address this issue, we used Contrast Limited Adaptive Histogram Equalization (CLAHE). To apply CLAHE to medical images, the first step is to divide the image into a grid of tiles. Histogram equalization is then applied to each tile individually, using a clip limit to limit the amount of local contrast enhancement that can be applied. The tiles are then combined using bi-linear interpolation to remove artificial boundaries.

One of the advantages of CLAHE is that it operates on tiles rather than the whole image, which helps to reduce noise amplification and prevent over-saturation of the image. This can be especially useful in medical images, where noise and over-saturation can obscure important details and make it difficult to accurately interpret the image.

Original image followed by images after CLAHE with clip limit = 2, 4, 6, 8 respectively.

Conclusion

All three of these methods were submitted to the competition using a LeViT-UNet model. Both histogram normalization and gamma correction resulted in a private leaderboard score of 0.82, while CLAHE resulted in a score of 0.84 on the private leaderboard. This suggests that CLAHE is effective for contrast enhancement on a wide range of images with different levels of original contrast.

Level Up Coding

Thanks for being a part of our community! Before you go:

🚀👉 Join the Level Up talent collective and find an amazing job

--

--