Deep Learning in Healthcare — X-Ray Imaging (Part 2— Understanding X-Ray Images)

This is part 2 of the application of Deep learning on X-Ray imaging. Here the focus will be on understanding X-ray images — with a special focus on Chest X-rays.

Arjun Sarkar
Towards Data Science

--

Interpreting Chest X-Rays:

Figure 1. Chest X-Ray — 1) Lungs, 2) Right Hemidiaphragm, 3) Left Hemidiaphragm, 4) Right Atrium, 5) Left Atrium (By Diego Grez — Radiografía_pulmones_Francisca_Lorca.jpg, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=10302947. Editing by Author)

X-ray images are grayscale images, that is, the images have some pixels which are dark and some that are bright. In medical imaging terms, these are images that have values ranging from 0 to 255, where 0 corresponds to the completely dark pixels, and 255 corresponds to the completely white pixels.

Figure 2. The grayscale bar

Different values on the X-ray image correlate to different areas of density:

  1. Dark — Locations on the body which are filled with Air are going to appear black.
  2. Dark Grey — Subcutaneous tissues or fat
  3. Light Grey — Soft tissues like the heart and blood vessels
  4. Off White — Bones such as the ribs
  5. Bright White — Presence of metallic objects such as pacemakers or defibrillators

The way physicians interpret an image is by looking at the borders between the different densities. As in Figure 1, the ribs appear off-white because they are dense tissues, but since the lungs are filled with air, the lungs appear dark. Similarly below the lung is the hemidiaphragm, which is again a soft tissue and hence appears light grey. This helps us give a clear understanding of the location and extent of the lungs.

So, if two objects with different densities are present close to each other they can be demarcated in an X-ray image.

Now if something were to happen in the lungs, such as Pneumonia, then, the air dense lungs will change into water-dense lungs. This will cause the demarcation lines to fade since the pixel densities will start closing in on the grayscale bar.

For taking a chest X-ray, normally the patient is asked to stand, and the X-rays are shot from either front to back (Anterior-Posterior) or from back to front (Posterior-Anterior).

Various Anatomical structures which can be differentiated using Chest X-rays:

Figure 2. Anatomy Airways — 1) Trachea, 2) Right Main bronchus, 3) Left main Bronchus (By Diego Grez — Radiografía_pulmones_Francisca_Lorca.jpg, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=10302947, Edited by Author)
Figure 3. Anatomy Diaphragm and Pleura — 1) Pleura, 2) Right Hemidiaphragm, 3) Left Hemidiaphragm (By Diego Grez — Radiografía_pulmones_Francisca_Lorca.jpg, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=10302947, Edited by Author)
Figure 4. Anatomy Bones — 1) Clavicle, 2) Posterior Rib, 3) Anterior Rib, 4) Vertebral Body (By Diego Grez — Radiografía_pulmones_Francisca_Lorca.jpg, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=10302947, Edited by Author)
Figure 5. Cardiac Anatomy on Chest X-Rays (By Mikael Häggström, M.D.- Author info- Reusing imagesUsing source images by ZooFari, Stillwaterising and Gray’s Anatomy creators — editFile:Heart diagram-en.svg by ZooFari (Attribution-Share Alike 3.0 Unported license).File:Trachea (transparent).png (From Gray’s Anatomy, Public Domain)File:Chest_Xray_PA_3–8–2010.png by Stillwaterising (Public Domain)Further outline of venous system:(2011). “A pictorial essay: Radiology of lines and tubes in the intensive care unit”. Indian Journal of Radiology and Imaging 21 (3): 182. DOI:10.4103/0971–3026.85365. ISSN 0971–3026.Synthesis by: Mikael Häggström, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=55155319)

The point of the above images is to show how difficult it is for someone who is not a trained doctor, to interpret the different anatomies from a Chest X-ray image, let alone any abnormalities.

That is exactly where Deep learning comes in handy. With deep learning, even people who have no idea about the different abnormalities or anatomies of the body can come up with decent results on predicting various anomalies. Of course, none of that is possible without a huge dataset or without ground truth data from trained physicians, but nevertheless, the fact that a self-training algorithm can even come up with such results is baffling.

In the next few parts, we will deep dive into X-Ray image visualization using Python, Convolutional Neural Networks, and look into how they train, and come up with the predictions.

References:

  1. Fred A. Mettler, Walter Huda, Terry T. Yoshizumi, Mahadevappa Mahesh: “Effective Doses in Radiology and Diagnostic Nuclear Medicine: A Catalog” — Radiology 2008;248:254–263
  2. “Chest X-ray quality — Projection”. Radiology Masterclass. Retrieved 27 January 2016.
  3. Chest X-Ray, OB-GYN 101: Introductory Obstetrics & Gynecology. © 2003, 2004, 2005, 2008 Medical Education Division, Brookside Associates, Ltd. Retrieved 9 February 2010.

--

--