Enhancing medical x-ray images

Image Processing, Data Visualisation

I spent 3 months at IBEX Innovations in 2019, a company specialising in medical x-ray image quality based in Sedgefield UK to carry out a research project with a fellow grad student. We were posed with the question of (I paraphrase) “can you help us build an in-house post-processing pipeline to enhance our x-ray images such that radiologists can more easily diagnose problems?” There were already commerically available medical post-processing software out there at the time but IBEX were interested in having full control of the image processing as the results can be potentially unpredictable.

There were three main enhancements that we wanted to carry out on the images: contrast enhancement, denoising, and edge enhancements. All of these were to increase the chance of picking out relevant features to aid a diagnosis. A pillar central to the post-processing pipeline we were going to construct was splitting up low and high frequency information in an image – think Fourier transform. Details of an image live in the high frequency bands so selectively enhancing those frequencies gives the appearance of a sharper and more contrasty image. This technique of splitting low and high frequency images is called unsharp masking.

Instead of splitting the image into high and low frequency bands, why not split it up into several bands? This is the idea behind the Laplacian pyramid. To construct a Laplacian pyramid you successively blue and downsample the original image to form a set of images ranging from the original image to a very pixelated version of it – this is a Gaussian pyramid. You then upscale and subtract neighbouring bands to obtain the difference between them, the difference is what contains the relevant frequency information.

IBEXPyramid Illustrating the different bands of a Laplacian pyramid. Each image contains different details unique to that band.

By working selectively on different bands it is possible to have much more control over how you modify your image. From there it was a case of applying different techniques to achieve the desired look. I was focused on figuring out a working solution to denoise the x-ray images. Since x-ray images are notoriously noisy due to low signal-to-background ratio, this is a crucial step in the post-processing pipeline.

A common denoising filter is the Gaussian filter which passes the image through a Gaussian kernel – the resulting image is usually a blur with loss of detail. Instead, I decided to use a bilateral filter which considers pixel location and pixel values for denoising. This meant that the filter was sensitive to big changes in pixel value, which is exactly what features in an image appear as, hence this filter retains details.

IBEXbilateral A comparison of Gaussian denoising (left) with bilateral denoising (right). Each image is split with the left being the original x-ray image, and the right being after denoised. Notice how the right image has retained much more of the detail.