codeamt / mle-capstone-modeling

data modeling submodule for Udacity's mle nanodegree program.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fast Efficient COVID-19 Case Detection

Data modeling submodule for Udacity's Machine Learning Engineering Nanodegree program.

Open In Colab

Repo Contents

Packages Used

pytorchcv
sklearn
fastai #(v1)
numpy
torch
torchvision
tracemalloc
pthflops
plotly_express

Overview

The notebook in this repo provides detailed steps on building and executing this end-to-end Fast.ai Image Classification pipeline. When running the notebook in a Jupyter environment, be sure to upload and extract the output zip file -- and designate the extracted folder as your path-- from the data preprocessing submodule as well as train and test .csv label files, and the common.py module to patch the pytorchcv lib's Swish Activation implementation with a more memory-efficient one:

Model Implementation

Base Architecture: CovidNet Blocks

COVID-Net Illustration (L. Wang and A. Wong., 2020)

Fastai Classifier:

Check out my project proposal for more info.

Training

Hardware Specs

Model was trained in Google Colab with the following GPU:

Phases

Each phase utilizes the "One-cycle training strategy" provided with Fastai learner class.

Phase Epochs Tuned Hyperparams
  • State: Unfrozen
  • Epochs: 6
  • Learning Rate: slice(5e-3/6)
  • Weight Decay: 2e-3
  • State: Frozen
  • Epochs: 3
  • Learning Rate: slice(2e-3)
  • Weight Decay: None

Input Size* FLOPs GFLOPs
(1, 3, 240, 240) 718,097,040 0.72
  • Fore details about FLOPs per layer, see notebook for Fastai Learner Callback and helpers, measuring RAM usage.

Performance Metrics

Label Precision Specificity Sensitivity F1
Pneumonia 0.943256 0.965595 0.949438 0.946337
COVID-19 0.938776 0.998882 0.958333 0.948454
Normal 0.966916 0.956911 0.962112 0.964508

Label Precision Specificity Sensitivity F1
Pneumonia 0.93178 0.958628 0.942761 0.937238
COVID-19 0.965517 0.999326 0.903226 0.933333
Normal 0.959091 0.956911 0.953672 0.956374

References

1 COVID-Net: A Tailored Deep Convolutional Neural Network Design for Detection of COVID-19 Cases from Chest X-Ray Image. L. Wang and A. Wong., 2020.

2 A Disciplined Approach to Neural Network Hyper-Parameters: Part 1 - Learniing Rate, Batch Size, Momentum, and Weight Decay. L Smith., 2018.

Resources

About

data modeling submodule for Udacity's mle nanodegree program.


Languages

Language:Jupyter Notebook 98.7%Language:Python 1.3%