Know your lungs to attest of COVID!!! (A compact real world deep learning project for beginners.)
COVID-19 Detector is a web application that solves some part of the current problem faced by the world of pandemic COVID -19 virus. It helps users like doctors for checking their lungs X-ray images. For this, they need to upload the photocopy or an image of the X-ray and the web application, and they will get the result where there is COVID-19 effect still exists in the lungs or not. It will also help to predict when the person has chances of having coronavirus.
The necessary library for this project are:
What is VGG-19 Convolutional Neural Network?
Convolutional Neural Networks are specific deep neural networks that can process data with an input shape like a 2D matrix. Images are commonly represented as a 2D matrix, and CNN is beneficial when working with images. It scans images from top to bottom and left to right to extract essential features from the image and combine the extracted features to identify the images. It can manage images that have been translated, rotated, scaled, and change in perspective.
For this particular project, VGG -19, a type of CNN model is used, which is 19 weight layers consisting of 16 convolutional layers with 3 fully connected layers and the same 5 pooling layers.
The input is a 224 * 224 RGB image to VGG based convNet. The pre-processing layer takes the RGB image with pixel values in the range 0–255 and subtracts the mean image values computed over the entire ImageNet training collection. After pre-processing, the input images are passed through layers of weight. The training images are processed through a stack of convolutional layers.
The architecture of VGG-19:
- The first two layers are convolutional layers with 3*3 filters, and the first two layers use 64 filters that result in 224*224*64. The filters are always 3*3 with a stride of 1.
- Next is the pooling layer with max-pool of 2*2 size and stride 2, which reduces image size from 224*224*64 to 112*112*64.
- This is preceded by 2 more convolution layers with 128 filters, which results in the new dimension of 112*112*128. Again pooling layer is applied, which changes the size to 56*56*128.
- Two more convolution layers are added with 256 filters, each followed by a down-sampling layer, which reduces the size to 28*28*256.
- There are two more stacks, each with 3 convolution layer is separated by a max-pool layer with 7*7*512 volume, which is flattened into a Fully Connected (FC) layer and followed by a softmax layer as output.
Building the python based project:
- We need to create a juypter file and import all the necessary packages
2. Load the dataset for training and validation and after it performing normalisation on it.
3. Now perform label binarizer for the target class
4. Now create the model and add layers
5. Configure the optimizer and compiler
6. Check the change in accuracy and the loss function with graph of graph
7. Evaluating the network on basis of different parameters
8. Testing the model
9. Visualize the predicted result with the confusion matrix
10. Save the model
Now integrating the model with GUI with the help of Flask
- Create app.py and import the model inside the file.
2. Now create the required functions for normalizing the given image and to predict the class.
3. Create two HTML pages inside the template folder. And run the app.py file.
In this COVID-19 spread, I have to build a web application using a flask and deep learning project using python. This model depends on the dataset, so it might not be accurate to the different situations. The same concept can be extended to a wide variety of objects with a lot of training data and an effective network. The same concept can be extended to a wide variety of objects with a lot of training data and an effective network.
View the project :
Project Code :