This deep learning project uses Convolutional Neural Network (CNN) to detect COVID-19 from X-ray images of posteroanterior (PA) chest view.
Here are the sources of the images we use.
- Positive COVID-19 cases
- Negative COVID-19 cases but with Pneumonia
- Normal cases from ishantk
- Normal cases from Kaggle
For image preprocessing, we use image_dataset_from_directory
provided by keras.utils
to convert images into datasets.
We also carry out data augmentation.
It generates additional training data from existing examples by augmenting them using random transformations
that yield believable-looking images. This helps expose the model to more aspects of the data and generalize better.
The data augmentation types that we use are RandomFlip
,
RandomRotation
, RandomZoom
, and Rescaling
.
Besides the two CNN layers and fully-connected layer, we also use the dropout layer which randomly sets input units to 0 with a frequency of rate at each step during training time, which helps prevent overfitting.
After training, we visualise the accuracy and loss of both training and validation sets.
Here, we achieve 90% accuracy in detecting positive cases, 92% accuracy in detecting negative cases but with Pneumonia, and 93% accuracy in detecting normal cases.
Here, we use cv2 library instead of image preprocessing library.
We obtain 91% accuracy in detecting negative cases but with Pneumonia.