Skip to content

regfish7/COVIDNet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

COVIDNet

Contributors Forks Stargazers Issues

My PyTorch implementation of COVID-Net, for the original work please see: https://github.com/lindawangg/COVID-Net

The purpose of this github is to reproduce results and not to claim state-of-the-art performance !!

Also Google Colab Notebook for plug-n-play training and evaluation here -->IliasPap/covidnet.ipynb

Table of Contents

Getting Started

Installation

To install the required python packages use the following command

pip install -r requirements.txt

Usage

Training

The network takes as input an image of shape (N, 224, 224, 3) and outputs the softmax probabilities as (N, C), where N is the number of batches and C number of output classes.

  1. To train the Network from scratch simply do python main.py Arguments for training
  -h, --help            show this help message and exit
 --batch_size BATCH_SIZE
                       batch size foe training
 --log_interval LOG_INTERVAL
                       steps to print metrics and loss
 --dataset_name DATASET_NAME
                       dataset name
 --nEpochs NEPOCHS     total number of epochs
 --device DEVICE       gpu device
 --seed SEED           select seed number for reproducibility
 --classes CLASSES     dataset classes
 --lr LR               learning rate (default: 1e-3)
 --weight_decay WEIGHT_DECAY
                       weight decay (default: 1e-6)
 --cuda                use gpu for speed-up
 --tensorboard         use tensorboard for loggging and visualization
 --resume PATH         path to latest checkpoint (default: none)
 --model {COVIDNet_small,resnet18,mobilenet_v2,densenet169,COVIDNet_large}
 --opt {sgd,adam,rmsprop}
 --root_path ROOT_PATH
                       path to dataset
 --save SAVE           path to checkpoint save directory


Results

with my implementation of COVID-Net and comparison with CNNs pretrained on ImageNet dataset

Results in COVIDx dataset

Accuracy (%) # Params (M) MACs (G) Model
89.10 115.42 2.26 [COVID-Net-Small]
91.22 118.19 3.54 COVID-Net-Large
94.0 - - Mobilenet V2
95.0 - - ResNeXt50-32x4d
94.0 - - ResNet-18

Results in COVID-CT dataset

Soon ...

Accuracy (%) # Params (M) MACs (G) Model
- - - [COVID-Net-Small]
- - - [COVID-Net-Large]
76 - - Mobilenet V2
76 - - [ResNeXt50-32x4d]
73 - - [ResNet-18]
81 - - [Densenet-169]

Confusion Matrix on both datasets coming soon !!

Datasets

1) COVID-CT-Dataset

The COVID-CT-Dataset has 288 CT images containing clinical findings of COVID-19. We are continuously adding more COVID CTs.

The images are collected from medRxiv and bioRxiv papers about COVID-19. CTs containing COVID-19 abnormalities are selected by reading the figure captions in the papers. All copyrights of the data belong to medRxiv and bioRxiv.

Please refer to the preprint for details: COVID-CT-Dataset: A CT Scan Dataset about COVID-19

2) COVIDx dataset

The current COVIDx dataset is constructed by the following open source chest radiography datasets:

We especially thank the Radiological Society of North America and others involved in the RSNA Pneumonia Detection Challenge, and Dr. Joseph Paul Cohen and the team at MILA involved in the COVID-19 image data collection project, for making data available to the global community.

Steps to generate the COVIDx dataset

Download the datasets listed above

  • git clone https://github.com/ieee8023/covid-chestxray-dataset.git
  • go to this link to download the RSNA pneumonia dataset
  1. Create a data directory and within the data directory, create a train and test directory
  2. Use COVIDNet.ipynb to combine the two dataset to create COVIDx. Make sure to remember to change the file paths.
  3. We provide the train and test txt files with patientId, image path and label (normal, pneumonia or COVID-19). The description for each file is explained below:

Chest radiography images distribution

Type Normal Pneumonia COVID-19 Total
train 7966 8514 66 16546
test 100 100 10 210

Links

Check out this repository for more medical applications with deep-learning in PyTorch https://github.com/black0017/MedicalZooPytorch from https://github.com/black0017

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 94.7%
  • Python 5.3%