Detecting Covid-19 from X-ray Images.
- Note: Purpose of this test project is to learn how to build a CNN model. It does not claim any guarantee of the outcome.
To build a CNN model for detecting COVID-19 and create a complete end to end Project.
- Dataset of X-ray Images are taken from Kaggle.
- Check Chest_xray_Corona_Metadata.csv and Chest_xray_Corona_dataset_Summary.csv from the given link for COVID-19 infected X-ray images.
- Here, I have manually chosen images of Covid-19 and Normal State.
- Entire model is trained on total around 400 images.
- For testing, I have used around 50 images.
- Below is the model that I have created.
- If you also want to visualize your model check Netron.
- Here, the input image is (224,224,3) which means image is (224,224) size with RGB color.
-
Conv2D Layer(3,3,3,32): Conv2D Layer contains 32 kernels, size (3,3) ====> Output: 32 images of size (222,222).
-
Conv2D Layer(3,3,32,64): Conv2D Layer contain 64 kernels, size (3,3) ====> Output: 64 images of size (220,220).
-
MaxPool2D Layer (3,3): MaxPool2D Layer is applied with (3,3) pool-size ====> Output: 64 images of size (73,73).
-
Dropout Layer
-
Conv2D Layer(3,3,64,64): Conv2D Layer contain 64 kernels, size (3,3) ====> Output: 64 images of size (71,71).
-
MaxPool2D Layer (3,3): MaxPool2D Layer is applied with (3,3) pool-size ====> Output: 64 images of size (23,23).
-
Dropout Layer
-
Conv2D Layer(3,3,64,128): Conv2D Layer contain 128 kernels, size (3,3) ====> Output: 128 images of size (21,21).
-
MaxPool2D Layer (3,3): MaxPool2D Layer is applied with (3,3) pool-size ====> Output: 128 images of size (7,7).
-
Dropout Layer
-
Flatten Layer: This will flatten all the (7,7,128) images ====> Output: (6272).
-
Dense Layer(6272,128): Here Flattened array will be passed to 128 neurons in the Hidden Layer with applying 'relu' Activation Function ====> Output: (128).
-
Dense Layer(128,2): Output of 128 Neurons is passed to 2 Neurons with Activation Function 'softmax' which will help in deciding final output. ====> Output: (2).
-
Here, The Images are converted into different dimensions according to applied different Mathematical Equations based on Conv2D layer, MaxPolling and Padding.
-
Detail code about training model is available in Covid(GoogleColab).ipynb and prediction based code is available in Covid.ipynb.
-
Check app.py regarding WebApp code.
-
Our Final Trained model is covid.h5.