Learn practical skills, build real-world projects, and advance your career

Chest X-Ray Medical Diagnosis with Deep Learning

alt

Welcome to the first assignment of course 1!

In this assignment! You will explore medical image diagnosis by building a state-of-the-art chest X-ray classifier using Keras.

The assignment will walk through some of the steps of building and evaluating this deep learning classifier model. In particular, you will:

  • Pre-process and prepare a real-world X-ray dataset
  • Use transfer learning to retrain a DenseNet model for X-ray image classification
  • Learn a technique to handle class imbalance
  • Measure diagnostic performance by computing the AUC (Area Under the Curve) for the ROC (Receiver Operating Characteristic) curve
  • Visualize model activity using GradCAMs

In completing this assignment you will learn about the following topics:

  • Data preparation
    • Visualizing data
    • Preventing data leakage
  • Model Development
    • Addressing class imbalance
    • Leveraging pre-trained models using transfer learning
  • Evaluation
    • AUC and ROC curves

1. Import Packages and Functions¶

We'll make use of the following packages:

  • numpy and pandas is what we'll use to manipulate our data
  • matplotlib.pyplot and seaborn will be used to produce plots for visualization
  • util will provide the locally defined utility functions that have been provided for this assignment

We will also use several modules from the keras framework for building deep learning models.

Run the next cell to import all the necessary packages.

import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt

from keras.preprocessing.image import ImageDataGenerator
from keras.applications.densenet import DenseNet121
from keras.layers import Dense, GlobalAveragePooling2D
from keras.models import Model
from keras import backend as K

from keras.models import load_model

import util
Using TensorFlow backend.