Skip to content

SujanNeupane42/MedicareAI-Multiclass-Classification-of-Chest-Radiographs-Using-CNNs-and-GANs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MedicareAI-Multiclass-Classification-of-Chest-Radiographs-Using-CNNs-and-GANs

The title of my undergraduate final year project is "MedicareAI". It involves a multiclass classification problem using the Kaggle radiography dataset which has three classes: Normal, Viral Pneumonia, and Covid. However, the dataset suffers from a severe class imbalance. To address this, I trained three classifiers - ResNet50, GoogLeNet, and EfficientNet - and compared their performance across a wide range of evaluation metrics such as precision, recall, F1 score, accuracy, and AUC. In addition to training these models on traditional data augmentation techniques such as random rotation, horizontal flip, and vertical flip, I also used three GAN architectures (DCGAN, WGAN, and WGAN-GP) to augment the data. The quality of each GAN was assessed using Fretchet Inception Distance.

Furthermore, I also trained each CNN model using data augmented with the three GAN architectures. Finally, the performance of each CNN was evaluated on imbalanced data, data with traditional augmentation, and data with DCGAN, WGAN, and WGAN-GP based augmentation. The results indicated that the GoogLeNet model performed the best when trained with WGAN-based augmented data.

Following technologies and tools have been used in this project.

Python scikit-learn PyTorch MySQL NumPy Pandas Jupyter Anaconda Seaborn

Following GIFs showcase image generated at every epoch for 3 GAN architeres. Since each GAN was trained for 1500 epochs, a total of 150 images were stiched together to create GIFs.

DCGAN

DCGAN

WGAN

WGAN

WGAN-GP

WGAN-GP

Now, The Fretchet Inception Distance(FID) for each GAN architeteceture has also been calculated, which is as follows.

FID Score

FID

WGAN performed better than all GANs. Similarly, DCGAN performed worse due to mode collapse and vanishing gradient problem.

After training GANs, new images for imbalanced classes were augmented using each GAN and 3 CNN architectures were trained and their performance was calcualted on the test dataset.

ResNet50

ResNet50 Training

ResNet50

ResNet50 performance metrics

ResNet50

ResNet50 Confusion Matrix

ResNet50

ResNet50 ROC Curve

ResNet50

Similarly, the performance of EfficientNet is also given below.

EfficientNet

EfficientNet Training

EfficientNet

EfficientNet performance metrics

EfficientNet

EfficientNet Confusion Matrix

EfficientNet

EfficientNet ROC Curve

EfficientNet

lets look at the performance of GoogLeNet. Two variants of GoogLeNet was implemented: With and Without Auxiliary classifiers.

GoogLeNet (Without Auxiliary Classifiers)

GoogLeNet (Without Auxiliary Classifiers) Training

GoogLeNet

GoogLeNet (Without Auxiliary Classifiers) performance metrics

GoogLeNet

GoogLeNet (Without Auxiliary Classifiers) Confusion Matrix

GoogLeNet

GoogLeNet (Without Auxiliary Classifiers) ROC Curve

GoogLeNet

Additionally, GoogLeNet classifier was also trained with auxiliary classifiers enabled during training.

GoogLeNet (With Auxiliary Classifiers)

GoogLeNet (With Auxiliary Classifiers) Training

GoogLeNet

GoogLeNet (With Auxiliary Classifiers) performance metrics

GoogLeNet

GoogLeNet (With Auxiliary Classifiers) Confusion Matrix

GoogLeNet

GoogLeNet (With Auxiliary Classifiers) ROC Curve

GoogLeNet

GoogLeNet, without auxiliary classifiers, performed the best as compared to other models. The following table summarizes the performance of GoogLeNet on the validation and test set.

Models Precision (Val) Precision (Test) Recall (Val) Recall (Test) F1 Score (Val) F1 Score (Test) AUC (Val) AUC (Test) Accuracy (Val) Accuracy (Test)
GoogLeNet-Imbalanced 0.9354 0.9363 0.9333 0.9325 0.9337 0.9325 0.9878 0.9881 93.33 93.25
GoogLeNet-Traditional 0.9308 0.9485 0.9291 0.9458 0.9295 0.9459 0.9883 0.9922 92.916 94.5833
GoogLeNet-DCGAN 0.9406 0.9375 0.9383 0.9333 0.9387 0.9331 0.9881 0.9919 93.83 93.33
GoogLeNet-WGAN 0.9378 0.9604 0.9375 0.9591 0.9376 0.9592 0.99 0.9947 93.75 95.92
GoogLeNet-WGANGP 0.9422 0.9584 0.9408 0.9575 0.9411 0.9575 0.9901 0.9933 94.08 95.75

Finally, GoogLeNet model trained with WGAN augmented data was deployed in a web application using Django. The following screenshots contain the predictions make by the system.

LOGIN

LOGIN

Signup

Signup

Prediction

Prediction

About

This is my final year undergraduate project.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages