Pneumonia is one of the most common causes of death of kids under the age of 5 and it currently stands as one of the top reason for hospitalization in the US for people over the age of 65, but with early identification and treatment the person who has the disease can survive. Multiple deep learning models for image classification including CNNs, RNNs can allow rapid identification of Pneumonia to begin treatment of the patient to increase the chance of survival. Pneumonia is usually detected through X rays. Formal detection of the disease through this method is very timely and can cause human errors. During this research I am going to use the VGG 19 model, the Resnet 50 model and Xception model to detect pneumonia from pictures of Lung x rays to see if it is possible to be able to detect accurately instances of pneumonia in x rays using convolutional neural networks. I will do analysis on the models and find which model is the most accurate for this classification task.
Introduction
I. INTRODUCTION
Pneumonia causes the bronchioles in one or both of the lungs to swell and to fill up with fluid and not allow any air to pass through them. There are two types of pneumonia, the first is viral pneumonia which is caused by viruses such as COVID-19 and the common cold. The second type of pneumonia is called bacterial pneumonia and it is caused by a bacterial infection in the lungs by bacteria such as by streptococcus pnumonmaine or mycoplasma pnumonmaine. Bacterial pneumonia is more dangerous than viral pneumonia and is more likely to cause death.
Bacterial pneumonia can be prevented from getting worse with anti biotics anti fungal medications and viral pneumonia can be managed until it goes away on its own. It is important for doctors to be able to identify pneumonia as minimized error as possible to be able to give someone the treatment they need to prevent them from dying from this condition. The current methods used to diagnose pneumonia leave room for error and can require a lot of time that the patient with the symptoms cannot wait for. Using the output of deep learning technologies along with the review of a medical expert can minimize as much as possible the chance of a false negative and can save the patients life.
II. METHODS
I am going to be using the Kaggle Chest X Ray Images (Pneumonia) dataset which contains to 5,863 images identify true positive and true negative cases of pneumonia. The dataset is organized into folders “normal” for images that are benign for pneumonia and “pneumonia” for images that contain malignant instances of pneumonia in the images for the training and the test set. Each of the images in this dataset were scaled to the size of 224 by 224 pixels to be able to be fit into the VGG-19 model and were given a zoom range of 0.5 to reduce noise.
Here are some examples of the images
A. Convolutional Neural Networks
The VGG-19, Resnet 50 model and Xception model are all models based on convolutional neural networks. Convolutional neural networks are neural networks include a convolutional layers, pooling layers and a flattening layer in addition to dense layers. In the convolutional layer of the neural network the images are separated into different fields and depending on the color channels in these fields each part of the field with a specific value for a color channel will be given a certain value such as a 1 for a part of a field with a white color or a zero for a part of the field with a black color channel.
This will allow a small portions of the entire image to be represented by numerical values, after the convolution in the max pooling layers, the max value of groups of the values will be placed into an even smaller field of numbers. The flattening layer is the final layer of the network before the dense layers. In the case of the models in this paper I am going to use 1 dense layer after the flattening layer with a softmax activation function.
B. VGG-19
I will begin by using the VGG-19 model on the dataset. The VGG-19 model is a purely convolutional network model with 19 hidden layers. To use the model in the predetermined state I will leave the trainable parameter set to false for the model and I will process the output of the model into a flatten layer which will be the input to a Dense layer. The model bellow shows how the input moves through the model and is convoluted at each step. This can be shown by the decreasing dimensions of input by a factor of two for each convolution. At the end the input is arranged into a matrix of 4096 units.
Conclusion
By using VGG-19, Resnet 50 and Xception I have been able to accurately detect pneumonia from images of x-rays. I have explored the models of VGG-19, Resnet 50 and Xception and I have analyzed how they differ in structure, function and in accuracy for detecting malignant or benign cases of pneumonia from the images. From this research I have found that the VGG-19 model is the most prone to overfitting as can be seen with the high levels of value loss, and the Resnet 50 model has the best accuracy and value loss out of all of the models scoring 77.08% for accuracy and 44.02% for loss.
This shows that it can be possible to use deep learning to detect diseases at high accuracy rates such as pneumonia from x ray images. To better improve the accuracies of the models I can increase the epochs to 5 to give the model more time to train or increase the learning rate by 1% to allow the model to train faster. Also adding rotations, zooms and flips to the images can help to increase the accuracy rate by adding more diversity to the images in the dataset.
References
[1] (3/2021) The Extensive Usage of Facial Image Threshing machine for facial emotion recognition performance Alwin Poulos Jung Hwan Kim Dong Seong Han
[2] (5/2018) Breast Cancer Screening using convolutional neural network and follow up digital mammography Clifford K Yang Research Gate
[3] (8/18/2019) The Annotated Resnet 50 Suvaditya Mukherjee
[4] (4/4/2020) Ayush Choudhary Vanishing Gradient And Exploding Gradient Problems Medium