Giter Site home page Giter Site logo

cnn-for-detecting-lung-nodules's Introduction

CNN for detecting Lung Nodules from CT scans

Content

  1. Prerequisites
  2. Introduction
  3. Data from CT scans
  4. Preprocessing
  5. Building a Convolutional Neural Network
  6. References

Prerequisites:

Introduction

A computerized tomography (CT) scan consists of a series of X-ray images taken from different angles and combines them to create cross-sectional images, or slices, of the bones, soft tissues, etc. inside our body.

Since CT scans consist of slices which amalgamate a 3D view, this technology allows radiologists to analyze the body in high-resolution 3D representations.

Data from CT scans

CT scans contain 2D arrays with pixel intensities in DICOM files. However CT scans are not in the standard 0โ€“255 range, but are instead in HU (Hounsfield Units)

HU measure the radio-intensity of particular mediums based on their attenuation coefficients. Attenuation coefficients give a measure of how easily X-rays can pass through a particular medium.

They range from -1000 HU for air, to 0 HU for distilled water. In our case Lung CT scans, we have the following range:

  • Max HU: 400
  • Min HU: -1000

Once we clamp our input to a particular intensity window range as a preprocessing step, we can normalize the resulting data to 0โ€“255 and produce an image which can be used to train machine learning models.

Preprocessing

We are going to use the LUNA16 dataset which contains 888 CT scans. The images have a .mhd format and .raw files. The SimpleITK library can be used to read the .mhd files. Each CT scan has dimensions of 512x512xn, where n is the number of axial scans. There are about 200 images in each CT scan.

There are a total of 551065 annotations. Of all the annotations provided, 1351 were labeled as nodules, rest were labeled negative (549714). So there big class imbalance.

We could potentially train the CNN on all the pixels, but that would increase the computational cost and training time. So instead I just decided to crop the images around the coordinates provided in the annotations. The annotation were provided in Cartesian coordinates. So they had to be converted to voxel coordinates. Also the image intensity was defined in HU scale. So it had to be rescaled for image processing purposes.

The script would generate 50 x 50 grayscale images for training, testing and validating a CNN.

Building a Convolutional Neural Network

For building a CNN Tflearn will be used. Tflearn is a high-level API wrapper around tensorflow. Using a 3 convolutional layers in the architecture.

References:

  1. Stanford AI for Healthcare

  2. Example of the 3 Convolutional layer

  3. Dataset: LUNA16

  4. Tutorial to manage to open, visualize, transform cartesian coordinates to voxel coordinates

cnn-for-detecting-lung-nodules's People

Contributors

razielar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.