Skip to content

dumplingman0403/COVID-19-CT-Image-Diagnosis-via-Transfer-Learning

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

COVID-19-CT-Image-Diagnosis-via-Transfer-Learning

Introduction

This project is designed to use transfer learning to classify COVID-19 by lung CT scan. The pre-train weight and the following models in Keras applications is being applied :

  • ResNet50V2
  • Xception
  • DenseNet201
  • MobileNetV2

Data

This project is originally designed for "INFORMS 2020 QSR Data Challenge - CT Scan Diagnosis for COVID-19". The dataset is provided by competition organizer. To accesss dataset, you can follow the guildline in challenge website or here.

Number of COVID : 251
Number of NonCOVID : 292
Total data : 543

covid_imgnon_covid_img
CT COVID(left), CT Non-COVID(right)

Performance

Model Percision Sensitivity Specificity F1 score Accuracy
ResNet50V2 0.94 0.94 0.93 0.94 0.94
Xception 0.91 0.90 0.925 0.91 0.91
DenseNet201 0.96 0.96 0.93 0.96 0.96
MobileNetV2 0.94 0.95 0.925 0.94 0.94

How to run

Customize your input

def load_train():
    dir = "Images-processed"                        # your file directory
    covid_dir = dir+"/CT_COVID/"
    noncovid_dir = dir+"/CT_NonCOVID/"
def estimate(X_train, y_train, back_bone):          
    IMAGE_WIDTH = 224                               # Image width
    IMAGE_HEIGHT = 224                              # Image height
    input_shape = (IMAGE_WIDTH, IMAGE_HEIGHT, 3)    # (width, height, channel) channel = 3 ---> RGB
    batch_size = 8                                  # Batch size 
    epochs = 40                                     # Number of epochs
    ntrain = 0.8 * len(X_train)                     # Split data with 80/20 train/validation 
    nval = 0.2 * len(X_train)

    X_train, X_val, y_train, y_val = train_test_split(  # 20% validation set
        x, y_train, test_size=0.20, random_state=2)

Run model

Step 1. Execute Model.py in terminal.

python3 Model.py

Step 2. Select transfer learning model by input model's name. For example, in the following, we choose ResNet50V2 as the transfer learning model.

select transfer learning model: 
1.ResNet50V2 2.Xception 3.DenseNet201 4.MobileNetV2 :
ResNet50V2

Demo

demo.ipynb : Example of transfer learning model using DenseNet201

Contact Us

Chun Yu Wu - ericchunyuwu@gmail.com
Kao-Feng Hsieh - hsiehkaofeng@gmail.com

About

QSR Data Challenge "2020 COVID-19 CT Image Diagnosis" via Tranfer Learning

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published