Description
COVID-19 has significantly impacted medical imaging practices, including the use of CT scans to assess lung complications in infected patients. These scans play a crucial role in diagnosing and monitoring the progression of respiratory symptoms associated with the virus. This project involves constructing a 2D Convolutional Neural Network (CNN) for the diagnosis of COVID-19 using Computed Tomography (CT) images, specifically by modifying the architecture of ResNet-18 or ResNet-50 for binary classification.
This project is part of Dr. Liang’s CSC646: Intro to Machine Learning class.
Tools
- PyTorch
- Pandas
- Numpy
- Scikit-image
Requirements
The project requires two methods to be conducted:
- Method 1: Train the CNN from scratch
- Method 2: Train the CNN using transfer learning
These methods are compared to determine the superior model and assess whether transfer learning provides benefits over training from scratch.
The test accuracy of both models must be greater than 90% and each model must be visualized using two Class Activation Mapping (CAM) methods.
Examples of CAM methods:
Data Sources
- CT scan images of lungs from Dr. Liang
Method 1
Method 2
Results
In the comparison of the CNN trained from scratch and the CNN utilizing transfer learning, it is observed that both models exhibit similar performances based on the scores in the dataframe. The accuracy of the validation set is identical for both models. However, there is a dissimilarity in the accuracies of the test set, with the transfer learning model achieving a slightly higher score, approximately 0.005 greater than the model trained from scratch. Despite this difference, it can be deemed not significant. The evaluation based on accuracy alone does not reveal additional advantages for transfer learning.
Examining loss scores provides further insights. The model trained from scratch demonstrates lower loss scores, particularly on the validation set, indicating that its predictions are closer to the actual values than the transfer learning model. Moreover, sensitivity and precision scores for both models do not show substantial variations. In conclusion, considering these metrics collectively, both models are deemed to exhibit similar performances and learning capacities.
The CNN trained from scratch reached its optimal performance at epoch 19, while the transfer learning CNN achieved its best epoch at 39. This indicates that the CNN from scratch converged faster, learning underlying patterns in the data more rapidly during training compared to the transfer learning CNN.
The determination of the "better" model depends on the specific capacity, needs, and requirements of the application or task at hand. While the CNN from scratch displayed faster pattern recognition during training, both models exhibited similar performances. However, it's essential to acknowledge that training models from scratch can be time-consuming and computationally expensive. In contrast, transfer learning offers a potential advantage by reducing training time and the required computational resources.