Data Science: CNN & OpenCV : Chest XRAY-Pneumonia Detection

A practical hands on Deep Learning Project on building a Pneumonia Detection model using Tensorflow, CNN and OpenCV

If you want to learn the process to detect whether a person is having Pneumonia using Chest XRays with the help of AI and Machine Learning algorithms then this course is for you.

What you’ll learn

  • Data Analysis and Understanding.
  • Data Augumentation.
  • Data Generators.
  • Model Checkpoints.
  • CNN and OpenCV.
  • Pretrained Models like MobileNetV2.
  • Compiling and Fitting a customized pretrained model.
  • Model Evaluation.
  • Model Serialization.
  • Classification Metrics.
  • Model Evaluation.
  • Using trained model to detect Pneumonia using Chest XRays.

Course Content

  • Introduction and Getting Started –> 3 lectures • 7min.
  • Data Understanding & Importing Libraries –> 7 lectures • 43min.
  • Common Methods for plotting and class weight calculation –> 3 lectures • 9min.
  • Data Augmentation –> 2 lectures • 5min.
  • Data Generators –> 2 lectures • 5min.
  • Model Building –> 9 lectures • 23min.
  • Compiling the Model –> 5 lectures • 9min.
  • ModelCheckpoint –> 2 lectures • 4min.
  • Fitting the Model –> 2 lectures • 5min.
  • Model Evaluation –> 6 lectures • 15min.
  • Using trained model to predict whether a person has Pneumonia –> 2 lectures • 7min.
  • Project Files and Code –> 1 lecture • 1min.

Auto Draft


If you want to learn the process to detect whether a person is having Pneumonia using Chest XRays with the help of AI and Machine Learning algorithms then this course is for you.


In this course I will cover, how to build a model to predict whether an X-ray scan shows presence of pneumonia with very high accuracy using Deep Learning Models. This is a hands on project where I will teach you the step by step process in creating and evaluating a deep learning model using Tensorflow, CNN and OpenCV.


This course will walk you through the initial data exploration and understanding, Data Augumentation,Data Generators,customizing pretrained Models like MobileNetV2, Model Checkpoints, model building and evaluation.Then using the trained model to detect the presence of Pneumonia using Chest XRays.


I have splitted and segregated the entire course in Tasks below, for ease of understanding of what will be covered.


Task 1  :  Project Overview.

Task 2  :  Introduction to Google Colab.

Task 3  :  Understanding the project folder structure.

Task 4  :  Understanding the dataset and the folder structure.

Task 5  :  Setting up the project in Google Colab_Part1

Task 6  : Setting up the project in Google Colab_Part2

Task 7  :  About Config and Create_Dataset File

Task 8  :  Importing the Libraries.

Task 9  :  Plotting the count of data against each class in each directory

Task 10  :  Plotting some samples from both the classes

Task 11  :  Creating a common method to get the number of files from a directory

Task 12  :  Defining a method to plot training and validation accuracy and loss

Task 13  :  Calculating the class weights in train directory

Task 14 :  About Data Augmentation.

Task 15 :  Implementing Data Augmentation techniques.

Task 16 :  About Data Generators.

Task 17 :  Implementing Data Generators.

Task 18 :  About Convolutional Neural Network (CNN).

Task 19 :  About OpenCV.

Task 20 :  Understanding pre-trained models.

Task 21 :  About MobileNetV2 model.

Task 22 :  Loading the MobileNetV2 classifier.

Task 23 :  Building a new fully-connected (FC) head.

Task 24 :  Building the final MobileNetV2 model.

Task 25 :  Understanding Conv2D, Filters, Relu activation, Batch Normalization, MaxPooling2D, Dropout, Flatten, Dense

Task 26 :  Building a custom CNN network architecture.

Task 27 :  Role of Optimizer in Deep Learning.

Task 28 :  About Adam Optimizer.

Task 29 :  About binary cross entropy loss function.

Task 30 :  Putting all together for MobileNetV2.

Task 31 :  Putting all together for Custom CNN Model.

Task 32 :  About Model Checkpoint

Task 33 :  Implementing Model Checkpoint

Task 34 :  About Epoch and Batch Size.

Task 35 :  MobileNetV2 and Custom CNN Model Fitting.

Task 36 :  Predicting on the test data using both MobileNetV2 and Custom CNN Model

Task 37 :  About Classification Report.

Task 38 :  Classification Report in action for both MobileNetV2 and Custom CNN Model.

Task 39 :  Computing the confusion matrix and and using the same to derive the accuracy, sensitivity and specificity.

Task 40 :  Plot training and validation accuracy and loss

Task 41 :  Serialize/Writing the mode to disk

Task 42 :  Loading the final model from drive

Task 43 :  Loading an image and predicting using the model whether the person has Pneumonia.




Machine learning has a phenomenal range of applications, including in health and diagnostics. This course will explain the complete pipeline from loading data to predicting results on cloud, and it will explain how to build an X-ray image classification model from scratch to predict whether an X-ray scan shows presence of pneumonia. This is especially useful during these current times as COVID-19 is known to cause pneumonia.

Take the course now, and have a much stronger grasp of Deep learning in just a few hours!



You will receive :


1. Certificate of completion from AutomationGig.

2. The Jupyter notebook and other project files are provided at the end of the course in the resource section.




So what are you waiting for?


Grab a cup of coffee, click on the ENROLL NOW Button and start learning the most demanded skill of the 21st century. We’ll see you inside the course!


Happy Learning !!


[Music : bensound]

Get Tutorial