8
VIII
https://doi.org/10.22214/ijraset.2020.31014
August 2020
International Journal for Research in Applied Science & Engineering Technology (IJRASET) ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429 Volume 8 Issue VIII Aug 2020- Available at www.ijraset.com
Predictive Analysis on Pneumonia using CNNs Prateek Nayak1, Sarthak Garg2, Rajat Shukla3 1, 2, 3
Student, Computer Science, Raj Kumar Goel Institute of Technology, Uttar Pradesh, India
Abstract: Healthcare data analysis has come up as one of the few encouraging researchable domains. Pneumonia affects a large number of world’s population. The aim of this briefing is to make a robust decision support system to predict the presence of a disease using the techniques of Machine Learning. Machine Learning is used to analyze the patterns in the data, detect and analyze trends and then make predictions with the help of ML techniques and it’s Algorithm. It gives us tools, techniques and methods that can help in solving diagnostic problems in different medical domains e.g. prediction of disease progression, extraction of medical knowledge for outcome research, therapy planning and support, and for the overall patient management. It offers a principled approach for developing automatic and optimal algorithms for biomedical data. This paper focuses on developing a deep neural network which will help predict the presence of pneumonia using chest x-rays. In order to achieve this, Convolutional neural networks have been deployed to increase efficiency and accuracy. Our model will use exact number of epochs that is required to calculate maximum efficiency which has to be given by the model. Keywords: Deep learning (DL), Machine Learning (ML), Convolutional neural networks, Classification. I. INTRODUCTION Pneumonia is a disease which is an infection in the human lungs. This disease can be caused by bacteria, viruses and fungi. Pneumonia in India accounts for 20 percent of the death worldwide caused by pneumonia. It is an acute respiratory infection which affects the lungs which can be detected by analyzing chest x-rays. This can be credited to the way that x-rays are very efficient investigative tools in revealing the pathological changes, in addition to its bloodless characteristics and financial considerations [1]. Analyzing and classifying chest x-rays can be very tedious because of noise due to sensors electronic device and implantation. Numerous algorithms have been proposed by researchers to effectively analyze x-rays for disease detection [7, 9, and 10], but they are not as accurate as our model. A paper [2] proposed used convolutional neural networks to diagnose disease using x-rays. For comparative analysis, BPNNs (back propagation neural networks) with supervised learning, competitive neural networks (CpNNs) with unsupervised learning were also developed. However, the network did not provide satisfactory results. So, we are using a CNN with a specific number of hidden layer and activation function which will increase the efficiency of a model. II. MACHINE LEARNING Machine learning is a method of data analysis that helps us to build an effective machine learning model. It is a branch of artificial intelligence (AI) based on the idea that a system can learn from the data, identify patterns and make decisions with minimal human interference. It focuses mainly on machine learning from their experience and making predictions based on its experience .A formal definition of machine learning is given by Mitchel: A computer program is said to learn from experience E with respect to some class of tasks T and performance measure P, if its performance at tasks in T, as measured by P, improves with experience E [4]. Machine learning is sub-categorized to three types: A. Supervised Learning In supervised learning, the model is trained on the dataset having the correct result and the incorrect result for every data value. In simple words, supervised learning means that we are training the machine with the dataset which already has been tagged with correct answer. After training, the machine is given new datasets so that the algorithm analyses it produces a correct result. In this paper, prediction using supervised learning models has been done. B. Unsupervised Learning In unsupervised learning, the machine is trained using the dataset which is not tagged with the correct answers. It allows the algorithm to work or analyze the dataset without any guidance. In this learning the model tries to find the patterns in the dataset, and then takes the unknown input and tries to match the pattern and how effectively it matches the pattern determines the accuracy of the model.
©IJRASET: All Rights are Reserved
769 769
International Journal for Research in Applied Science & Engineering Technology (IJRASET) ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429 Volume 8 Issue VIII Aug 2020- Available at www.ijraset.com C. Reinforcement Learning In Reinforcement Learning, system attempts to learn through direct interaction from its surroundings so as to maximize some numbers of cumulative rewards. It uses the concept of rewards, if it predicts the correct result a reward has been given (i.e. 1) and 0 has been given for the failures. That’s how the model learns and increases its accuracy.
Fig.1 Approaches of different types of Machine Learning III. ALGORITHM To analyze datasets without needing explicit programming, Machine learning uses algorithms which learn from previous data to help produce correct and repeatable decisions. Machine Learning is just is a collection of algorithms. ML Algorithms uses knowledge of various mathematical concepts such as statistics, probability, calculus, vector algebra, matrices, optimization techniques etc. When it comes to Machine Learning, Artificial Neural Networks perform really well. Artificial Neural Networks are used in various classification tasks like image, audio, words. Convolution Neural Network is used for image classification. Fig 2 shows the structure of CNN.
Fig 2: Structure of CNNs In a Neural Network there are three types of layers: 1) Input Layers: The input to our model is given into this layer. The neurons present in the layer are same as the features in the data. 2) Hidden Layer: The input that comes from the input layer is then provided to the hidden layer. There can be many hidden layers. The number of hidden layers depends on our model and size of data. Every hidden layer can consist of distinct number of neurons which can be more or less than the number of features present. The result from every layer is calculated by matrix multiplication of the result of the preceding layer along with its learnable weight and then addition of learnable biases. An activation function is also necessary for the entire input layer, so that the model becomes non-linear. 3) Output Layer: The output or result that comes from the hidden layer is then given into a logistic function such as sigmoid or softmax which transforms the output of each class into probability score of each class.
ŠIJRASET: All Rights are Reserved
770 770
International Journal for Research in Applied Science & Engineering Technology (IJRASET) ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429 Volume 8 Issue VIII Aug 2020- Available at www.ijraset.com In CNN, the structure is not as same as regular neural networks: a) Input Layer: The input layer is responsible for holding the raw input of the image with width 200, height 200 according to our dataset. b) Convolution Layer: This layer calculates the output volume by calculating the dot product between all the filters and image patch. It is the layer consists of weights which are needed to be trained. c) Activation Function Layer: This layer applies the element wise activation function to the result of convolution layer. It is the function which decides whether to fire a neuron or not. Some examples of activation functions include: RELU: max(0,x) and leaky RELU. Sigmoid:1/(1+e^-x) Tanh: (1-e^-2x)/(1+ e^-2x) d) Pool Layer: The main function of Pool Layer is to reduce the size of volume which makes calculations fast and reducing the memory and also prevents from over fitting. It is used to reduce the number of parameters. This layer is periodically inserted in the convolution layer. Two common types of pooling layers are max pooling and average pooling. e) Fully-Connected Layer: This layer is regular neural network layer which takes input from the preceding layer and calculates the class scores and gives the 1-D array of size equal to the number of classes as output. IV. IMPLEMENTATION The implementation phase has various steps of machine learning and the flow of implementation is shown in Fig.3.
Fig.3 Phases of Implementation A. Data Collection The Kaggle dataset is used consists of total, 5863 X-Ray images (JPEG). The dataset structured into 3 parts such as train, test, and validation, contains sub folders for each image category or class such as Pneumonia or Normal. Chest X-ray images (anteriorposterior) were looked over review accomplices of pediatric patients of 1 to 5 years from Guangzhou Women and Children's Medical Center, Guangzhou. All chests X-ray imaging was gathered and executed as a major aspect of patients' normal clinical consideration [6].
Normal
©IJRASET: All Rights are Reserved
Normal
Pneumonia
Pneumonia
771 771
International Journal for Research in Applied Science & Engineering Technology (IJRASET) ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429 Volume 8 Issue VIII Aug 2020- Available at www.ijraset.com B. Data Preparation Data preparation refers to cleaning the data and adding appropriate missing data. This step is also called Data Pre- processing. As this paper deals with medical data, any changes have not been made in order to preserve the patient’s data. As the dataset contain the images having different height and width, so we resize the dimensions of all the images to 200*200*3, to fit the images in our model having 200*200 neurons as input layer. C. Training Model The datasets are trained using Convolutional neural network with input layer of shape (200,200,3), three Conv layer, three pool layer having the ‘relu’ activation function on both the pool layer and the output layer having with the softmax function. Training is basically the process of, giving the machine capability to make further predictions after learning from the training dataset.
Fig 5: Training model using datasets.
Fig 6: Graph for the Model accuracy.
©IJRASET: All Rights are Reserved
772 772
International Journal for Research in Applied Science & Engineering Technology (IJRASET) ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429 Volume 8 Issue VIII Aug 2020- Available at www.ijraset.com
Fig 7: Graph for the Model loss D. Testing Model Testing of a model is done to check the performance of the algorithms in term of accuracy, precision etc. In testing whether the prediction is correct or not is checked using already predefined dataset. We tested the dataset on the validation dataset our original dataset.
Fig 8: Graph for the accuracy on validation dataset
ŠIJRASET: All Rights are Reserved
773 773
International Journal for Research in Applied Science & Engineering Technology (IJRASET) ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429 Volume 8 Issue VIII Aug 2020- Available at www.ijraset.com
Fig 9: Graph for Model Validation loss E. Prediction Prediction refers to the output of a model after it has been trained on a predefined dataset and applied to new data when forecasting the likelihood of a outcome. The model will generate values for an unknown variable for each record in the new data, allowing the model to identify what that value will most likely be. Our model has the accuracy of 96.13%.
ŠIJRASET: All Rights are Reserved
774 774
International Journal for Research in Applied Science & Engineering Technology (IJRASET) ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429 Volume 8 Issue VIII Aug 2020- Available at www.ijraset.com F. Confusion Matrix It is the table which is used to describe the performance of the model (or classifier) on the test dataset for which the true values are known. A confusion matrix is a summary of prediction results on a classification problem. The numbers of correct and incorrect predictions are summarized to each class. The confusion matrix shows the ways in which your classification model is confused when it makes predictions. It gives us insight not only into the errors being made by a classifier but more importantly the types of errors that are being made [3].
Fig 10: Confusion matrix for the model. V. CONCLUSION Machine learning has emerged as a field critical for providing tools and methodologies for analyzing the data generated by the biomedical sciences. This review has provided a condensed snapshot of applications of machine learning for the detection of pneumonia in lungs using Convolutional neural networks. Fusion of disparate multimodal and multi-scale biomedical data continues to be a challenge. Further improvements in data can be made like having more features and least null values. VI. FUTURE SCOPE Machine learning includes a number of algorithms and techniques to analyze and implement to gain the benefits of them in different fields including healthcare. ML methods can help the integration of computer-based systems in the healthcare scenario providing opportunities to facilitate and enhance the work of medical doctors and ultimately to improve the efficiency and quality of medical care. ML technologies can be used to identify potential clinical trial candidates, access their medical history records, monitor the candidates throughout the trial process, select best testing samples, reduce data-based errors, and much more [11]. In future with respect to this model, one can try to develop a system in which most probable disease for a patient can be predicted on the basis of symptoms and moreover test can also be recommended for the predicted disease. A potential future development of the presented work is to apply ML models to other data with different features, concerning the survival prognosis of the patients and early detection of the disease and it can also be developed in web-based application with additional services.
ŠIJRASET: All Rights are Reserved
775 775
International Journal for Research in Applied Science & Engineering Technology (IJRASET) ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429 Volume 8 Issue VIII Aug 2020- Available at www.ijraset.com REFERENCES [1] [2] [3] [4] [5] [6] [7] [8] [9]
El-Solh, C.-B. Hsiao, S. Goodnough, J. Serghani, and B. J. B. Grant, ―Predicting active pulmonary tuberculosis using an artificial neural network,‖ Chest, vol. 116, no. 4, pp. 968–973,1999. Abiyev RH, Ma'aitah MKS. Deep Convolutional Neural Networks for Chest Diseases Detection. J Healthc Eng. 2018;2018:4168538. Published 2018 Aug 1.doi10.1155/2018/4168538 https://www.geeksforgeeks.org/confusion-matrix-machine-learning/ T. Mitchell, Machine learning, 0-07-042807-7, McGraw Hill (1997), p. 2. https://www.kaggle.com/paultimothymooney/ches t-xray-pneumonia P. Pattrapisetwong and W. Chiracharit, ―Automatic lung segmentation in chest radiographs using shadow filter and multilevel thresholding,‖ in Proceedings of 2016 IEEE Conference on Computational Intelligence in Bioinformatics and Computational Biology (CIBCB), Manchester, UK,2016. S.Jaeger,A.Karargyris,and S.Candemir,―Automatic tuberculosis screening using chest radiographs,‖ in Proceedings of IEEE Transactions on Medical Imaging, London, UK,2014. U. Avni, H. Greenspan, E. Konen, M. Sharon, and J. Goldberger, ―X-ray categorization and retrieval onthe organ and pathology level, using patch-based visual words,‖ in Proceedings of IEEE Transactions on Medical Imaging, Orlando, FL, USA,2011 [Upgrad] [Blog][Machine Learning Applications in Healthcare] https://www.upgrad.com/blog/machine-learning-applications-in-healthcare/.
©IJRASET: All Rights are Reserved
776 776