0% found this document useful (0 votes)
51 views

Detection of Pneumonia Clouds in Chest X-Ray Using Image Processing Approach

Uploaded by

Rahul Shetty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

Detection of Pneumonia Clouds in Chest X-Ray Using Image Processing Approach

Uploaded by

Rahul Shetty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

2017

Detection of Pneumonia clouds in Chest X-ray using


Image processing approach

Abhishek Sharma Daniel Raju Sutapa Ranjan


Institute for Plasma Research, HBNI Institute for Plasma Research, HBNI Institute for Plasma Research
Bhat,Gandhinagar,India Bhat,Gandhinagar,India Bhat,Gandhinagar,India
[email protected] [email protected] [email protected]

Abstract—Finding ways to automate diagnostics from obligations, so we have undertaken a purely an image
medical images, has continuously been one of the most processing approach as in [4], using free open source tools
interesting areas of software development. This article presents a such as Python and its image processing libraries.
novel approach for detecting the presence of pneumonia clouds
INTRO
in chest X-rays (CXR) by using only Image processing When interpreting chest X-rays for Pneumonia, the
techniques. For this, we have worked on 40 analog chest CXRs radiologist will look for white spots in the lungs called
pertaining to Normal and Pneumonia infected patients. infiltrates that identify an infection. However, such cloudy
Indigenous algorithms have been developed for cropping and for patterns would also be observed in TB Pneumonia and severe
extraction of the lung region from the images. To detect cases of bronchitis too. For conclusive diagnosis, further
pneumonia clouds we have used Otsu thresholding which will investigations such as complete blood count (CBC), Sputum
segregate the healthy part of lung from the pneumonia infected test, and Chest computed tomography (CT) scan etc. may be
cloudy regions. We are proposing to compute the ratio of area of needed. Therefore, we are only attempting to detect
healthy lung region to total lung region to establish a result. The possibility of pneumonia from Chest X-rays, by looking for
task has been performed using Python and OpenCV as they are cloudy region in the same. Conclusive detection will depend
free, opensource tools and can be used by all, without any on pathological tests
legality issues or cost implication.
II. DATA AND SOFTWARE TOOLS USED
Keywords—Medical image processing, lung extraction,
Pneumonia cloud detection, lung segmentation, automated For the purpose of coding, we have used Python version
diagnosis 2.7 with the OpenCV libraries. We have developed
indigenous algorithms for cropping of images to remove
LS I. INTRODUCTION abdomen region and for lung boundary identification. We
have also looked for Japan Society of Radiological
Pneumonia is the leading cause of death among children
in developing countries, including India. WHO estimates that Technology (JSRT) image dataset as mentioned in [4], but
one in three new born infant deaths is due to pneumonia[1]. we felt that image quality of that dataset is really very good
About half of these deaths can be prevented as they are compared to ground truth images. So we have used analog
caused by the bacteria for which an effective vaccine is CXR images that matches rural scenario situations. As per
available. According to a report [2] which was released by availability, our dataset contains only 40 adult CXR.
International Vaccine Access Centre(IVAC), Johns Hopkins Few samples of normal and Pneumonia infected CXR
Bloomberg School of Public Health, India has the highest images from our dataset, are shown in Fig. 1 and Fig. 2.
number of pneumonia and diarrhea deaths among children in
the world with nearly three lakh children dying in 2016.
Chest X-ray (CXR), is an important tool for diagnosing
pneumonia and many clinical decisions rely heavily on its
radiological findings. Also it is relatively cheap compared to
other imaging diagnostics and can be afforded by masses.
Some work has been done on automated pneumonia detection
through natural language processing and artificial neural
network [3].However, such tools require elaborate hardware
and software setup.
In order to develop a software that can be easily and freely Fig. 1. Normal CXR images
ported to mobile devices, with no financial or license related

978-1-5386-1747-2/17/$31.00 ©2017 IEEE


time and results observed. The comparison of data is shown
in Table I.
TABLE I
Comparison Table for Different Sizes of Images

Size Computational Result observed


time(s)
2048x2048 71 Good
1024x1024 9 Good
Fig. 2. Pneumonia affected CXR image 800x800 4.6 Good
500x500 3.2 Not satisfactory
III. METHODOLOGY
For obtaining the above table, we have randomly
The methodology used by us, is shown in form of block selected the 5 CXR images from our dataset and performed
diagram in Fig. 3. We shall describe each section in detail, our methodology on the same 5 CXR images by changing
explaining the steps and the algorithm, specially the their image size. Then we have noted the thresholded images
indigenous ones. We shall also mention why we decided on and ratio obtained in each case. The results are considered
the threshold values used in our algorithms. good, if they provide sufficient demarcation in the normal
The task has been performed as follows. All images have CXR images and pneumonia affected CXR images.
been resized to optimal size for computational purposes. From the above Table I, we have selected an image size
Then we have performed histogram equalisation on the same of 800x800 for further operations, as the computational time
to enhance contrast of the images. Thereafter we have used is lowest without compromising on the result quality. We
our own algorithm to crop the abdomen area from CXR resized all the images to 800x800, using the ‘resize’
images. The lung boundary is then identified, to calculate the function of OpenCV.
lung area. Thereafter, image thresholding has been performed
to detect the non-cloudy region of the lung and its area is B. Histogram Equalization
computed. The ratio of areas of this non-cloudy lung region
to the total area of extracted lung region, would give an Histogram equalization is done to adjust image intensities
indication of the amount of cloud formation in the lungs. The so as to enhance contrast. The enhanced contrast aids in
following figure summarise or approach in form of the block detection of the clouds. We used the ‘equalizeHist’ function
diagram for detection of pneumonia clouds. available in OpenCV.

Resizing

Histogram equalisation

Cropping abdomen area


(i) (ii)

Lung boundary Fig. 4. (i) Image before histogram equalization (ii) Image after histogram
equalization

C. Cropping of lower region


Thresholding
Lower region of the image has been cropped to eliminate
the abdomen region, present in most of the CXR images as
Compute ratio for each lung that region of CXR is insignificant in detection of pneumonia
clouds. For this, we have started from the lower leftmost point
of the image and traversed the image horizontally in batches
Fig. 3. Block diagram for detection of pneumonia clouds
of 5 pixels, till half of the image width. While traversing, we
have compared the average intensities of two successive
A. Resizing batches looking for a transition from white to black region
with an intensity gradient of 100. We decided on the number
The original images were 2048x2048 pixels in size. We 100, after multiple trials with various gradient values. After
resized it to different values and compared the computational
traversing the bottommost line, we move vertically upward in E. Thresholding
steps of 2 pixels to next pixel and continue the horizontal
scanning till we locate the batches where the intensity Thresholding is done to segregate healthy part of lung
gradient changes by 100. Now, the image is cropped region from the pneumonia affected part. For this purpose we
horizontally from the pixel coordinates we have found while have used Otsu thresholding. The image after thresholding
scanning. gives us the binary image containing the dark region of image
as black and remaining as white.

(i) (ii) (i) (ii)

Fig. 7. (i) Image before thresholding (ii) Image after thresholding

Fig. 5. (i) Image before cropping lower abdomen region (ii) Image after
cropping lower abdomen region Images of lung region after thresholding

D. Lung boundary identification


Lung boundary identification is important for calculating
lung area. By finding the rib cage boundary or lung boundary
we can actually get an idea of the actual area covered by lung
in the given CXR image. For this purpose we have vertically
split CXR into two halves, left and right. Then we have
selected 100 equidistant horizontal lines in each lung and
looked for a pixel intensity gradient value greater than some
Fig. 8. Pneumonia affected lung region, after thresholding
threshold value of 30, along each horizontal line. The number
30 was chosen after attempting lung boundary identification
using multiple threshold values and selecting the one that
produced the best results.
For values of pixel intensity an average of 5 consecutive
pixels has been taken to nullify the effect of stray high or low
intensity points. Wherever the desired gradient transition is
noticed, the coordinate of the first pixel of the batch is taken
as a boundary point to ensure that the lung region is not
truncated.
Fig. 9. Normal lung region, after thresholding

IV. CONCLUSION
Computer assisted detection of diseases from CXR are
always very helpful at places where there is shortage of
skilled radiologist. In countries like India where, we do not
have experienced radiologists in rural areas, such tools can be
of immense help by automatically screening people who need
urgent medical care and further diagnosis.
At this stage of the project, we have identified the lung
(i) (ii) region by rib cage boundary identification and would be
computing the area of this region. We have also used Otsu
Fig. 6. Image after lung boundary detection (i) normal CXR (ii) Pneumonia thresholding to segregate the pneumonia cloud from the
affected CXR healthy lung in the lung area, still we are working on other
methods that can be adopted for thresholding the CXR images
which can yield better results. Also, we are now looking to
compute the ratio of the two areas - the area of the lung after
Otsu threholding to the area of the total lung area. As
pneumonia clouds are not visible in the image of the lung
after Otsu thresholding, this ratio is expected to be much
lower than when computed for healthy lungs without clouds.

REFERENCES
[1] WHO and Maternal and Child Epidemiology Estimation Group
(MCEE) estimates 2015.
[2] International Vaccine Access Centre (IVAC) “The Pneumonia
and Diarrhoea Progress Report for 2016”.
[3] Oliveira, L.L.G., Silva, S.A.e., Ribeiro, L.H.V., de Oliveira,
R.M., Coelho,C.J., S.Andrade, A.L.S. “Computer-aided
diagnosis in chest radiography for detection of childhood
pneumonia”(2008) International Journal of Medical
Informatics, 77 (8), pp. 555-564.
[4] Mohd Nizam Saad, Noraidah Sahari Ashaari, Hamzaini Abdul
Hamid, "Image Segmentation for Lung Region in Chest X-ray
Images using Edge Detection and Morphology", 2014 IEEE
International Conference on Control System Computing and
Engineering, 28-30 November 2014.

You might also like