Classification of COVID-19, Pneumonia, and Lung Opacity Using Deep Learning Methodology in Chest X-Ray Images PDF

Document Details

AttentiveRetinalite3325

Uploaded by AttentiveRetinalite3325

Srinivasa Ramanujan Centre

2024

SASTRA Deemed to be University

Preetkaa J, Priyadarshini M, Subashree M

Tags

COVID-19 pneumonia lung opacity deep learning

Summary

This is a project report titled "Classification Of Covid-19, Pneumonia, And Lung Opacity Using Deep Learning Methodology In Chest X-Ray Images" submitted to SASTRA Deemed to be University. The report was submitted in June 2024 as the project work requirement for the CSE400 course.

Full Transcript

CLASSIFICATION OF COVID-19, PNEUMONIA, AND LUNG OPACITY USING DEEP LEARNING METHODOLOGY IN CHEST X- RAY IMAGES Report submitted to the SASTRA Deemed to be University in partial fulfillment of the requirements as the requirem...

CLASSIFICATION OF COVID-19, PNEUMONIA, AND LUNG OPACITY USING DEEP LEARNING METHODOLOGY IN CHEST X- RAY IMAGES Report submitted to the SASTRA Deemed to be University in partial fulfillment of the requirements as the requirement for the course CSE400: PROJECT WORK Submitted by PREETIKAA J (Reg No.: 224003082, B. Tech CSE) PRIYADHARSHINI M (Reg No :224003083, B. Tech CSE) SUBASHREE M (Reg No: 224003123, B. Tech CSE) JUNE 2024 DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, SRINIVASA RAMANUJAN CENTRE, KUMBAKONAM, TAMIL NADU, INDIA-612001 I DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING, SRINIVASA RAMANUJAN CENTRE, KUMBAKONAM, TAMIL NADU, INDIA-612001 Bonafide Certificate This is to certify that the report titled “Classification Of Covid-19, Pneumonia, And Lung Opacity Using Deep Learning Methodology In Chest X-Ray Images” submitted as the requirement for the course, CSE400: PROJECT WORK for B.Tech. is a bonafide record of the work done by Ms. PREETIKAA J (Reg No.: 224003082, B. Tech CSE), Ms. PRIYADHARSHINI M (Reg No :224003083, B. Tech CSE) and Ms. SUBASHREE M (Reg No: 224003123, B. Tech CSE) during the academic year 2024 in the Srinivasa Ramanujan Centre. Signature of Project Supervisor: Name with Affiliation : Date : Project Based Work Viva voce held on________________. Examiner 1 Examiner 2 II SRINIVASA RAMANUJAN CENTRE KUMBAKONAM – 612 001 Declaration We declare that the project report titled “Classification Of Covid-19, Pneumonia, And Lung Opacity Using Deep Learning Methodology In Chest X-Ray Images” submitted by us is an original work done by us under the guidance of Dr. R. SUJARANI, AP-II, during the final semester of the academic year 2023-24, in the Srinivasa Ramanujan Centre. The work is original and wherever we have used materials from other sources, we have given due credit and cited them in the text of the report. This report has not formed the basis for the award of any degree, diploma, associate-ship, fellowship or other similar title to any candidate of any University. Signature of the candidate(s) : Name of the candidate(s) : Date : III Acknowledgements We would like to thank our Honourable Chancellor Prof. R. Sethuraman for providing us with an opportunity and the necessary infrastructure for carrying out this project as a part of our curriculum. We would like to thank our Honorable Vice-Chancellor Dr. S.Vaidhyasubramaniam and Dr. S. Swaminathan, Dean, Planning & Development, for the encouragement and strategic support at every step of our college life. We extend our sincere thanks to Dr. R. Chandramouli, Registrar, SASTRA Deemed to be University for providing the opportunity to pursue this project. We extend our heartfelt thanks to Dr. V. Ramaswamy, Dean, Dr. A. Alli Rani, Associate Dean, Srinivasa Ramanujan Centre, for their constant support and suggestions when required without any reservations. Our guide Dr. R. SUJARANI, AP-II, Srinivasa Ramanujan Centre was the driving force behind this whole idea from the start. His deep insight in the field and invaluable suggestions helped me/us in making progress throughout our project work. We also thank the project review panel members for their valuable comments and insights which made this project better. We would like to extend our gratitude to all the teaching and non-teaching faculties of the School of Computing who have either directly or indirectly helped us in the completion of the project. We gratefully acknowledge all the contributions and encouragement from my family and friends resulting in the successful completion of this project. We thank you all for providing me an opportunity to showcase my skills through project. IV LIST OF FIGURES Figure No. Title Page No. 2.1 Workflow Of Proposed Methodology 7 3.1.1 CXR Image Of Each Class 9 3.2.1 Original Image 10 3.2.2 Preprocessed Image 10 3.2.3 Original Image 11 3.2.4 Preprocessed Image 11 3.3.1 Extracted Image Features 13 3.3.2 CNN Architecture 14 3.3.3 Workflow Of GLCM And CNN Model 15 3.3.4 Workflow Of GLCM And XGBoost Model 17 3.3.5 Image Features Extracted By Pre-Trained VGG-19 19 3.3.6 Workflow Of VGG-19 And XGBoost Model 19 3.3.7 Workflow Of VGG-19 And CNN Model 21 4.1.1 Training And Validation Graph Of GLCM-CNN Model 24 4.1.2 Confusion Matrix Of GLCM-CNN Model 25 V 4.1.3 Classification Report of GLCM-CNN Model 25 4.2.1 Confusion Matrix of GLCM-XGBoost Model 26 4.2.2 Classification Report of GLCM-XGBoost Model 26 4.3.1 Confusion Matrix of VGG-19-XGBoost Model 27 4.3.2 Classification Report of VGG-19-XGBoost Model 27 4.4.1 Training and Validation Graph of VGG-19-CNN Model 28 4.4.2 Confusion Matrix of VGG-19-CNN Model 28 4.4.3 Classification Report of VGG-19-CNN Model 29 4.5.1 Techniques and Accuracy Comparison 29 4.5.2 Performance Metrics Comparison 30 4.5.3 Accuracy Plot Across Four Models 30 4.6.1 Main Window 31 4.6.2 CXR Image Prediction Window 31 VI LIST OF TABLES 3.1.1 Class Information 9 VII ABBREVIATIONS GLCM : Gray - Level - Co-Occurrence Matrix CNN : Convolutional Neural Networks VGG : Visual Geometry Group XGBoost : Extreme Gradient Boost CXR : Chest Radiography COVID-19 : Corona-virus Disease 2019 ReLU : Rectified Linear Unit MRI : Magnetic Resonance Imaging CT : Computed Tomography AI : Artificial Intelligence CAD : Computer - Aided Design OpenCV : Open Source Computer Vision Library vvdjdjvnnnvjjdkkdllwkkvvnndkkdoodkjnssjsjsjsj 1 X lksjlkdjlkfsjdlkfjsdlkfjlkdslkdjflskjflskABSTRACT Multiple aspects of life were seriously affected by the COVID-19 virus pandemic. This project presents a methodical approach to classify COVID-19, pneumonia, and lung opacity in chest X-ray (CXR) images. Initial preprocessing involves noise reduction and re- sizing for standardization. Features are then extracted using the Grey-Level Co-occurrence Matrix (GLCM) technique to capture vital texture information. Extracted features are inputted into various models, including XGBoost, CNN architectures, and transfer learning models. Every model is evaluated and trained to get its best performance. A comparative analysis reveals which models and methodologies are more accurate at distinguishing between lung opacity, pneumonia, and COVID-19 cases. This multi-model approach utilizes machine learning and deep learning methodologies, providing a robust framework for diagnosis and triage of respiratory ailments from CXR images. Keywords: Specific Contribution: PREETIKAA J PRIYADHARSHINI M SUBASHREE M Specific Learning: PREETIKAA J PRIYADHARSHINI M SUBASHREE M Technical Limitations & Ethical Challenges Faced: 2 X Table of Contents Table Page No. Bona-fide Certificate ii Declaration iii Acknowledgements iv List of Figures v List of Tables vii Abstract viii 1. Summary of the Base Paper 1.1. Summary 1 1.2. Introduction 2 1.3. Demerits of Existing System 3 1.4. Merits of Proposed System 4 2. Objective 5 3. Methodology 8 3.1. Dataset 8 3.2. Preprocessing 3.2.1. For GLCM-CNN and GLCM-XGBoost Model 9 3.2.2. For VGG-19-XGBoost and VGG-19-CNN 10 3.3. Model Development 11 3.3.1. GLCM and CNN 11 3.3.2. GLCM and XGBoost 15 3.3.3. VGG-19 and XGBoost (Transfer Learning) 18 3.3.4. VGG-19 and CNN (Transfer Learning) 20 3.4. Evaluation Metrics 21 3 X 3.4.1. Accuracy 21 3.4.2. Precision 22 3.4.3. Recall 22 3.4.4. F1 Score 22 3.4.5. Confusion Matrix 23 4. Results and Discussion 4.1. GLCM and CNN Model 24 4.2. GLCM and XGBoost Model 25 4.3. VGG-19 and XGBoost Model 26 4.4. VGG-19 and CNN Model 27 4.5. Models Comparison 29 4.6. Output 31 5. Conclusion and Future Work 5.1. Conclusion 32 5.2. Future Work 32 6. References 7. Appendix 7.1. Base Paper 7.2. Plagiarism Report 7.3. Source Code 4 X CHAPTER - 1 SUMMARY OF THE BASE PAPER Title: Classification Of Covid-19, Pneumonia, And Lung Opacity Using Deep Learning Methodology in Chest X-Ray Images Journal Name: IEEE Access Publisher: Francesco Prinzi, Carmelo Militello, Nicola Scichilone, Salvatore Gaglio, And Salvatore Vitabile Year: 2023 Title of Base Paper: Explainable Machine-Learning Models for COVID-19 Prognosis Prediction Using Clinical, Laboratory and Radiomic Features 1.1 Summary: This study used radiomic and clinical data to construct predictive models for COVID- 19 prognosis. Clinical, lab, and radiomic variables were combined using several machine learning classifiers and feature selection techniques. The results need to be precise, useful, comprehensible, and supported by clinical evidence. The study took into account stakeholders such as developers, doctors, and patients when proposing explainable AI algorithms for multi-level clinical explanations. Predictive models must be trained with explainable inputs, avoiding deep features, in order for them to be inherently explainable. In order to discover distributional drift and to explain the behaviour of the features that have the greatest influence on classification, a global explanation was employed. A local explanation was necessary in order to put the CDSS concept into practice. Personalized medicine may use them more quickly if explainable radiomic-powered prediction models are developed. Finding relationships between data and clinical outcomes necessitates an in-depth investigation using explainable machine learning methods. The ultimate foal is to develop reliable and understandable biomarkers for diagnosis and prognosis in precision medicine. 1 XI 1.2 Introduction: Millions of lives are affected by respiratory illnesses every year, which include COVID-19, pneumonia, and lung opacity. These conditions have a variety of causes, from inflammatory disorders to infectious agents, and they present significant challenges to global public heath systems. In order to control the spread of these illnesses and manage their effects on patients and healthcare systems, effective early detection, treatment, and prevention strategies are crucial. This introduction highlights the vital importance of thorough strategies that tackle the intricate nature of respiratory illnesses and emphasizes the importance of upgrading assessment and management protocols to protect public health.  COVID-19, a respiratory disease caused by the novel corona virus SARS-CoV-2, has significantly impacted public health globally, causing a range of symptoms from mild to severe pneumonia and ARDS, necessitating effective diagnostic and management strategies to control its spread and healthcare system impact.  Pneumonia, a lung inflammation, is a major global health issue, causing millions of hospitalizations and deaths annually, especially among children, the elderly, and immunocompromised individuals, resulting from infectious and non-infectious agents.  Lung opacity, a density increase in the lungs, can be caused by infections, inflammatory disorders, tumors, pulmonary edema, or interstitial lung diseases and is crucial for diagnosis, management, and disease monitoring. Respiratory diseases like COVID-19, pneumonia, and lung opacity pose significant public health challenges, necessitating comprehensive strategies for prevention, diagnosis, and treatment and advanced diagnostic tools and management protocols. Chest X-ray (CXR) imaging is crucial for diagnosing and managing respiratory diseases like COVID-19, pneumonia, and lung opacity due to various factors. CXR imaging is a primary screening tool for respiratory symptoms, aiding in diagnosis, monitoring disease progression, and guiding interventional procedures. It is cost-effective, widely available, and requires minimal patient preparation, making it an indispensable tool in resource-limited 2 XI healthcare settings. Its rapid turnaround time allows for timely decision-making and triage, particularly in emergency or critical care settings. Chest X-ray (CXR) imaging is used in predictive modeling through feature extraction, model development, classification, and evaluation. It captures lung pathology information and enables early detection, diagnosis, and patient management decisions. Predictive models, such as SVM, RF, and DNN, are trained using these features, and their performance is evaluated for reliability. This integration improves patient outcomes and supports evidence- based healthcare delivery. Prediction is crucial for respiratory diseases like COVID-19, pneumonia, and lung opacity for early detection, personalized patient management, preventive measures, clinical decision support, and healthcare planning. It enables timely interventions, personalized patient care, and informed decision-making in healthcare delivery and public health practice. Prediction models help identify high-risk individuals, optimize treatment, and allocate resources efficiently. 1.3 Demerits of Existing System:  The model differentiates between mild and severe cases. A more nuanced approach might consider a wider range of disease severities.  The performance of the model might be specific to the population it was trained on and may not translate well to other populations with different demographics or disease characteristics.  The study doesn't mention if the model's performance was validated on an independent dataset. 3 XI 1.4 Merits of Proposed System:  The study explores various methodologies, including traditional machine learning (XGBoost) and deep learning (CNNs and transfer learning with VGG19). This comprehensive approach allows for identifying the most effective technique for this task.  The research demonstrates the effectiveness of transfer learning with VGG19 for feature extraction.  A high accuracy model like VGG19 + CNN has the potential to be a valuable tool for computer-aided diagnosis (CAD) systems, assisting radiologists in screening and triage of respiratory illnesses.  In our proposed system it showcases a promising approach for chest X-ray analysis using a combination of machine learning and deep learning techniques. 4 XI CHAPTER 2 OBJECTIVE The goal of this study was to create a reliable and accurate system that could use chest X-ray (CXR) pictures to identify different lung disorders, such as pneumonia, lung opacity, and COVID-19. The growing prevalence of respiratory diseases such as COVID-19 emphasizes the requirement for effective diagnostic instruments. In order to fill this gap, this study investigated a multi-model strategy that blends deep learning with machine learning methods. This project's workflow is as follows: To guarantee consistency, chest X-ray pictures were first pre-processed. This involved resizing the image for uniformity and applying a median filter. One important stage was feature extraction, which included applying the Grey-Level Co-occurrence Matrix (GLCM) method. Through the analysis of an image's spatial distribution of pixel intensities, GLCM is able to extract important textural information that may point to underlying lung problems. Then, extracted features were used. This project explore various machine learning approaches for classifying chest X-ray images into four categories: COVID-19, Lung Opacity, Pneumonia, and Normal. The approaches investigated included: GLCM and XGBoost: This model leverages texture features extracted using Gray-Level Co-occurrence Matrix (GLCM) for classification with XGBoost, a powerful gradient boosting algorithm. GLCM and CNN: This approach combines GLCM features with a Convolutional Neural Network (CNN) for image classification. VGG19 and XGBoost (Transfer Learning): This model utilizes transfer learning with a pre-trained VGG19 model for feature extraction, followed by XGBoost for classification. 5 XI VGG19 and CNN (Transfer Learning): This approach combines transfer learning with VGG19 for feature extraction and a custom-built CNN for classification. Each approach has its own strengths and weaknesses. Evaluating these models using metrics like accuracy, precision, recall, and F1-score will determine the most effective approach for this specific classification task.For each model to perform at its best, extensive training and assessment were conducted. The project then carried out a comparison study to determine which model was the most accurate. The maximum accuracy model will be used to differentiate between COVID-19, pneumonia, lung opacity, and healthy lung states. In summary, our study effectively illustrated the potential of a multi-model strategy combining deep learning and machine learning for precise lung disease categorization in chest X-ray pictures. The model with impressive accuracy rate that model can be integrated into computer-aided diagnostic (CAD) systems. Radiologists might possibly enhance patient outcomes and diagnoses more quickly by using these tools to help screen and prioritize patients with respiratory infections. and a front end is made with the Tkinter library to show the results in classifying the result among the following diseases COVID-19, Pneumonia, and Lung Opacity and Normal. 6 XI Fig 2.1 Workflow of Proposed Methodology 7 XI CHAPTER – 3 METHODOLOGY 3.1 DATASET : Dataset Name: Balanced Augmented COVID-CXR Dataset Source: Kaggle Description: The Balanced Augmented COVID-CXR Dataset is a collection of chest X-ray (CXR) images balanced across four classes: COVID-19, Lung opacity (Non-Covid infection) , Pneumonia and Normal. The dataset aims to provide a diverse and representative sample of chest X-ray images for the classification of respiratory conditions. COVID-19 : Images depicting chest X-rays of patients diagnosed with COVID-19. Lung Opacity: Images showing chest X-rays with evidence of lung opacity or infiltrates. Pneumonia : Images displaying chest X-rays of patients diagnosed with pneumonia. Normal : Images showing chest X-rays of normal people. The dataset is balanced, with images distributed evenly throughout the four classes, ensuring that each condition is fairly represented. To boost dataset diversity, augmentation techniques such as image rotation, flipping, and scaling were used. This augmentation strengthens classification models by exposing them to fluctuations in the data. The collection comprises of image files in a standard format, such as JPEG or PNG, with each image representing a single chest X-ray. A subset of the original dataset was employed, with 2000 images per class, to retain diversity and representation across classes while efficiently managing computing resources. 8 XI Fig.:3.1.1 CXR image of each class Chest X-rays are a common diagnostic technique for respiratory diseases include COVID-19, lung opacity, and pneumonia. As a result, the dataset's concentration on chest X- ray pictures makes it therapeutically relevant for creating classification models to help healthcare practitioners diagnose COVID-19 and other disorders. LUNG Classes COVID OPACITY PNEUMONIA NORMAL No. of images 2000 2000 2000 2000 Table :3.1.1 Class information 3.2 PREPROCESSING : 3.2.1 For GLCM-CNN and GLCM-XGBoost model: The preprocessing steps include,  With the help of OpenCV Library (Open Source Computer Vision Library), each image file is read and converted to grayscale while retaining essential information for subsequent steps. 9 XI  Then, all images are resized to a fixed size of 224x224 pixels to ensure uniformity in image dimensions.  Then, a median filter is applied with a specified kernel size (kernel_size=3). Median filtering is a nonlinear filtering technique that replaces each pixel's value with the median value in its neighborhood. It is effective in removing noise while preserving edges and details in the image. Fig.3.2.1 Original image Fig.3.2.2 Preprocessed image 3.2.2 For VGG19-XGBoost and VGG19-CNN model: The preprocessing steps include,  The image is loaded using the TensorFlow's Keras preprocessing module. Then the image file is being read and returned as a PIL (Python Imaging Library) image object.Next, it is converted the PIL to a NumPy array. This conversion allows further processing and manipulation of the image using array operations.  After converting the image to a NumPy array, the pixel values are normalized by dividing each pixel value by 255.0. This step ensures that the pixel values are within the range [0, 1]. 10 XI  This prepares the image data for further processing and visualization, facilitating the exploration of the dataset. Fig.3.2.3 Original image Fig.3.2.4 Preprocessed image 3.3 MODEL DEVELOPMENT : 3.3.1 GLCM and CNN: This model integrates texture-based feature extraction techniques with deep learning models for effective image classification tasks. The GLCM texture features are used with Convolutional Neural Network (CNN) for the multi-class classification. GLCM : Gray-Level Co-occurrence Matrix, is a texture feature extraction approach that is frequently utilized in image processing and computer vision applications. It reflects the frequency with which pixel intensity pairs appear at specific spatial displacements or distances within a picture. Several statistical measures or features can be calculated from the GLCM, providing information about the image's texture or spatial arrangement of pixel intensities. It captures an image's texture attributes, such as roughness, smoothness, coarseness, and homogeneity. It 11 XI takes into account the relative locations and intensities of pixels within a particular neighborhood or window size. Why it's a Good Choice for this Task: Chest X-rays often exhibit specific textural patterns associated with the disease, such as ground-glass opacities, consolidation, and linear opacities. GLCM can effectively capture these textural features, aiding in the discrimination of COVID-positive and COVID-negative cases. It can capture not only the texture but also how different textures are distributed spatially in the X-ray image, which can provide valuable information for classification. GLCM-based features are often robust to variations in image acquisition conditions, such as differences in brightness, contrast, and noise levels. This robustness is crucial for ensuring the reliability of the classification model across different X-ray imaging systems and settings. GLCM can extract a variety of statistical features from the co-occurrence matrix and these features can serve as informative descriptors for training models to distinguish between COVID-positive and COVID-negative X-ray images. GLCM-based features are often robust to variations in image acquisition conditions, such as differences in brightness, contrast, and noise levels. This robustness is crucial for ensuring the reliability of the classification model across different X-ray imaging systems and settings. Feature extraction using GLCM: To capture textural information at various scales and orientations from the CXR images, GLCM is calculated for many distances and angles (0°, 45°, 90°, and 135°). A total of 8000 images were extracted. The features extracted from GLCM for our model include,  Energy: Represents the uniformity or homogeneity of the image texture. Also known as Angular Second Moment. 12 XI  Correlation: Measures the linear dependency between the intensity values at pixel pairs in the image.  Dissimilarity: Indicates the average absolute difference in intensity between neighboring pixels in the image.  Homogeneity: Reflects the closeness of pixel intensity pairs to the diagonal of the GLCM, signifying the uniformity of the image texture.  Contrast: Quantifies the local variations in pixel intensities, representing the differences between adjacent pixel pairs in the image. Figure 3.3.1 Extracted image features CNN model architecture : The CNN architecture follows a typical pattern with alternating convolutional and max-pooling layers, followed by fully connected layers for classification. ReLU activation functions are used in convolutional and dense layers to introduce non-linearity and enable the model to learn complex patterns in the data. The softmax activation in the output layer ensures that the model outputs probabilities that sum up to 1 across all classes, suitable for multi-class classification tasks. 13 XI Figure 3.3.2 CNN architecture Input Layer: Specifies the input shape of the images as (100, 100, 1), indicating images with a height and width of 100 pixels and a single channel (grayscale). Convolutional Layers: Three convolutional layers with 32, 64, and 50 filters respectively, each using a 3x3 kernel size and ReLU activation function. Pooling Layers: Each convolutional layer is followed by a max-pooling layer with a 2x2 pool size, which reduces the spatial dimensions of the feature maps. Flatten Layer: Flattens the output of the last convolutional layer into a one-dimensional vector, preparing it for input to the fully connected layers. Fully Connected Layers: Two fully connected (dense) layers with 100 neurons each, followed by ReLU activation functions. These layers extract high-level features from the flattened representation of the image features learned by the convolutional layers. Output Layer: Dense layer with n_classes (4 classes) neurons and softmax activation, producing the final output probabilities for each class. 14 XI Figure 3.3.3 Workflow of GLCM and CNN model GLCM features extracted from images are typically represented as one-dimensional arrays or vectors, where each element corresponds to a specific texture feature. Before feeding these features into a CNN, they need to be reshaped into a suitable format that matches the input shape expected by the network. After reshaping the GLCM features to match the input shape, they can be directly fed into the CNN model as input data. The input layer of the CNN is configured to accept data with the specified input shape. In this case, the input layer expects grayscale images of size 100x100 pixels. The reshaped features are then used as input during the model training process, along with the corresponding image labels. The trained CNN model can then predict class labels or probabilities effectively. The model's performance is evaluated using metrics such as accuracy, precision, recall, and F1-score on a separate test set. 3.3.2 GLCM and XGBoost: This model combines texture feature extraction using Gray-Level Co-occurrence Matrix (GLCM) with classification using XGBoost, an efficient gradient boosting algorithm. 15 XI XGBoost : XGBoost, short for Extreme Gradient Boosting, is a popular and powerful machine learning algorithm renowned for its efficiency, scalability, and accuracy in supervised learning tasks, especially in structured/tabular data. It enhances traditional gradient boosting by employing a more regularized model formulation, which helps prevent overfitting and improves generalization performance. Key Features of XGBoost classifier include,  Regularization: XGBoost includes L1 (Lasso) and L2 (Ridge) regularization terms in the objective function, controlling model complexity and reducing overfitting.  Tree Pruning: It utilizes a technique called tree pruning to remove splits that have little impact on improving the model's performance, resulting in more efficient and parsimonious trees.  Handling Missing Values: XGBoost automatically handles missing values in the dataset, enabling robustness to incomplete data.  Parallelization: XGBoost supports parallelized implementation, making it highly scalable and efficient, especially for large datasets. XGBoost often achieves state-of-the-art performance in structured/tabular data competitions and benchmarks, owing to its robustness, efficiency, and effectiveness in handling complex datasets and modeling scenarios. The XGBoost classifier is configured using the following parameters,  max_depth: Determines the maximum depth of each tree in the ensemble.  n_estimators: Specifies the number of boosting rounds (trees) to be built. 16 XI  subsample: Determines the fraction of training samples to be randomly subsampled during each boosting round.  colsample_bytree: Specifies the fraction of features to be randomly sampled for each tree.  gamma: Regularization parameter that controls the minimum loss reduction required to make a further partition on a leaf node. Figure 3.3.4 Workflow of GLCM and XGBoost model GLCM features such as energy, correlation, dissimilarity, contrast, and homogeneity are extracted from preprocessed images. The extracted GLCM features are used as input to train an XGBoost classifier. XGBoost model is trained on the features, optimizing its parameters for classification of COVID-19, lung opacity, and pneumonia cases. The model's performance is evaluated using metrics such as accuracy, precision, recall, and F1-score on a separate test set. 17 XI 3.3.3 VGG-19 and XGBoost (Transfer learning): This model utilizes transfer learning with VGG19, a pre-trained CNN model, combined with XGBoost for classification. This approach combines the feature extraction capabilities of a deep learning model (VGG19) with the interpretability and efficiency of a tree-based model (XGBoost). VGG-19 architecture: VGG19, additionally known as OxfordNet, is an CNN structure that has been pre- trained on the immense image dataset ImageNet. In 2014, researchers from the Visual Geometry Group (VGG) at the University of Oxford created it. VGG19 is a unique CNN architecture with 19 layers, the majority of which are convolutional layers for feature extraction. In the early stages, these layers learn low-level features such as edges, lines, and forms before moving on to more complicated features such as object components and full objects in deeper layers. Benefits of Using Pre-trained VGG19:  Since VGG19 is already pre-trained on ImageNet, it has learned valuable image features that can be leveraged for new tasks. This significantly reduces the training time required compared to training a CNN from scratch on a smaller dataset.  The pre-trained weights of VGG19 often provide a good starting point for fine-tuning on new, smaller datasets. This can lead to better performance on specific classification tasks compared to training a new model entirely.  VGG19 is commonly used in transfer learning approaches. In this scenario, the earlier layers of VGG19 (responsible for learning low-level features) are typically frozen, while the later layers (responsible for learning higher-level, task-specific features) are fine-tuned with your own dataset for the specific classification problem. 18 XI Figure 3.3.5 Image feature extraction by pre-trained VGG-19 Why VGG19+XGBoost a Good Choice for this Task:  VGG19 provides a strong foundation for feature extraction, potentially capturing valuable generic and disease-specific features from chest X-rays.  XGBoost can learn complex relationships between the extracted features and the classification task, potentially leading to improved accuracy compared to using either model alone.  XGBoost offers some level of interpretability compared to deep learning models. Understanding the features XGBoost relies on for classification can provide insights into the model's decision-making process.  It leverages the strengths of both models while offering potential benefits in terms of accuracy, interpretability, and efficiency. Figure 3.3.6 Workflow of VGG19 and XGBoost model 19 XI In this model, features are extracted from preprocessed images using the pre-trained VGG19 model. The extracted features are used as input to train an XGBoost classifier. The XGBoost classifier is trained on the extracted features, optimizing its parameters for multiclass classification. Then the model’s performance is evaluated using standard metrics on a separate test set. 3.3.4 VGG19 and CNN (Transfer learning): This model combines transfer learning with VGG19 as a feature extractor and a custom-built CNN as a classifier. VGG19 + CNN architecture: By incorporating a pre-trained VGG19 model for feature extraction, this CNN architecture leverages the pre-trained model's ability to extract meaningful features from images, potentially improving the model's performance and convergence speed. The custom CNN layers following the VGG19 model further refine the extracted features and perform classification based on the task requirements. Input Layer: The input shape is determined by the shape of the preprocessed images fed into the VGG19 model for feature extraction. Feature Extraction with Pre-trained VGG19: Before the Flatten layer, features are extracted from preprocessed images using a pre-trained VGG19 model. The pre-trained VGG19 model serves as a powerful feature extractor, capturing high-level features from the input images through its convolutional layers. The output from the VGG19 model's convolutional layers is used as input to the subsequent layers in the custom CNN architecture. Flatten Layer: The Flatten layer transforms the multi-dimensional output from the VGG19 model's convolutional layers into a one-dimensional array. This is necessary to connect the convolutional layers with the fully connected layers of the custom CNN. The shape of the input data after flattening is determined by the output shape of the last convolutional layer in the VGG19 model. 20 XI Dense Layers: Two Dense layers are added after the Flatten layer. These layers further process the features extracted by the VGG19 model and perform classification. Output Layer: The final Dense layer serves as the output layer. It generates the output probabilities for each class using the softmax activation function. Figure 3.3.7 Workflow of VGG19 and CNN model This CNN architecture is designed to process and classify the input data efficiently, with multiple layers for feature extraction and classification. The use of dropout regularization helps prevent overfitting, while the softmax activation in the output layer ensures the model produces probabilistic outputs for each class. 3.4 EVALUATION METRICS: Evaluation metrics help to objectively quantify how well the model is performing. They provide a numerical measure of the model's accuracy, effectiveness, and generalization ability. They enable comparisons between different models or different configurations of the same model. 3.4.1 Accuracy: The Accuracy considers the total of all confusion matrix entries in the denominator as well as the sum of the True Positive (TP) and True Negative (TN) components in the numerator. On the main diagonal of the confusion matrix, the elements TP and TN are those 21 XI that the model successfully classified; on the other hand, the denominator comprises all components that are not on the main diagonal and that the model incorrectly classified. Accuracy = (TP+TN)/ (TP+TN +FP+FN) 3.4.2. Precision: Precision is a useful metric to employ when FP has significant ramifications. When a non-infected image class (Real negative) is wrongly classified as infected in plant leaf disease detection, an FP occurs. Farmers' productivity will be impacted if the precision of the plant leaf disease detection model is inadequate. Precision = TP/(TP+FP) 3.4.3. Recall: Recall is an excellent metric to employ when the effects of FN are significant. The recall metric quantifies the proportion of real true positives that are accurately predicted to be true positives. When a sick leaf (Actual Positive) in plant leaf disease detection is anticipated to be a non-diseased leaf (anticipated Negative), this leads to the needless recommendation of pesticides. If the leaf disease is communicable, the expense associated with FN will be extremely significant. Recall = TP/(TP+FN) 3.4.4. F1 score: The F1 Score would be a better statistic to use if there is an unbalanced class distribution in the dataset—that is, a significant volume of Actual Negatives—and the goal is to discover the ideal balance between precision and recall. F1 Score = (2 ∗ Precision ∗ Recall)/ (Precision + Recall) 22 XI 3.4.5. Confusion matrix: A confusion matrix is a tabular representation of the performance of a classification model, showing the counts of true positive (TP), true negative (TN), false positive (FP), and false negative (FN) predictions made by the model on a dataset. It is a valuable tool for evaluating the performance of model, especially classification tasks. The components of a confusion matrix are, True Positive (TP): The number of instances that are correctly predicted as positive (belonging to the positive class). True Negative (TN): The number of instances that are correctly predicted as negative (not belonging to the positive class). False Positive (FP): Also known as Type I error, the number of instances that are incorrectly predicted as positive (predicted positive but actually negative). False Negative (FN): Also known as Type II error, the number of instances that are incorrectly predicted as negative (predicted negative but actually positive). 23 XI CHAPTER – 4 RESULTS AND DISCUSSION The evaluation metrics such as confusion matrix, F1-score, recall, and accuracy are calculated for each model to analyze their performance for the given task. Cross-validation and performance metric comparison are performed which provides a more reliable estimate of their generalization performance and insights into their strengths and weaknesses. 4.1 GLCM AND CNN MODEL: Accuracy:  The GLCM and CNN model accuracy achieved 70% accuracy. Fig.4.1.1 Training and Validation graph of GLCM-CNN model 24 XI Confusion Matrix: Fig.4.1.2 Confusion matrix of GLCM-CNN model Classification Report: Fig.4.1.3 Classification report of GLCM-CNN model 4.2 GLCM AND XGBOOST MODEL: Accuracy:  The GLCM and XGBoost model achieved 78% accuracy. 25 XI Confusion Matrix: Fig.4.2.1 Confusion matrix of GLCM-XGBoost model Classification Report: Fig.4.2.2 Classification report of GLCM-XGBoost model 4.3 VGG-19 AND XGBOOST MODEL: Accuracy:  The VGG-19 and XGBoost model achieved 87% accuracy. 26 XI Confusion Matrix: Fig.4.3.1 Confusion matrix of VGG19-XGBoost model Classification Report: Fig.4.3.2 Classification report of VGG19-XGBoost model 4.4 VGG-19 AND CNN MODEL: Accuracy:  The VGG19 and CNN model achieved 90% accuracy. 27 XI Fig.4.4.1 Training and Validation graph of VGG19-CNN model Confusion Matrix: Fig.4.4.2 Confusion matrix of VGG19-CNN model 28 XI Classification Report: Fig.4.4.3 Classification report of VGG19-CNN model 4.5 MODELS COMPARISON: Fig.4.5.1 Techniques and accuracy comparison 29 XI Performance Metrics Comparison: Fig.4.5.2 Performance metrics comparison Accuracy Comparison Chart: Fig.4.5.3 Accuracy plot across four models Based on the results obtained, we conclude that our model for prediction respitatory illness using VGG19 + CNN obtained accuracy 90% outperforming VGG19+XGBoost model of 87% accuracy. And, GLCM + XGBoost with 78% accuracy outperformed GLCM + 30 XI CNN of accuracy 70%. Hence the highest accuracy model (VGG19+CNN) is used for the prediction. 4.6 OUTPUT The GUI for final prediction is created using Tkinter library. Fig.4.6.1 Main window Fig.4.6.2 CXR image prediction window 31 XI CHAPTER – 5 CONCLUSION AND FUTURE WORK 5.1 Conclusion: This project comprehensively investigated the effectiveness of various machine learning and deep learning techniques for accurate classification of lung conditions in chest X-ray images and demonstrates the viability of multi-model approaches for chest X-ray classification, potentially leading to more accurate analysis compared to single-model solutions. The VGG19 combined with CNN model achieved a remarkable accuracy of 90%. This outcome indicates the potential of transfer learning for robust classification tasks involving chest X-ray data and emphasizes how well it works to leverage pre-trained models for faster development cycles and better performance. Finally, the combination of deep learning and machine learning techniques with an intuitive front-end interface underscores the potential for enhanced diagnostic capabilities in the field of chest radiology. 5.2 Future Work: Future directions for this project involve refining model generalization through techniques like data augmentation, ensemble learning, and regularization. Including new imaging modalities like MRIs and CT scans could provide a more thorough diagnostic framework. Incorporating explainable AI techniques would enhance model transparency and trustworthiness, facilitating acceptance in clinical settings. While multi-task learning can increase system efficiency by handling numerous diagnostic jobs at once, real-time processing capabilities could speed up diagnostic procedures. Furthermore, integrating domain-specific knowledge such as clinical guidelines and disease ontologies could enhance model accuracy and medical relevance. 32 XI 33 XI 34 XI 35 XI CHAPTER 7 APPENDIX - BASE PAPER 36 XI 37 XI 38 XI 39 XI 40 XI 41 XI 42 XI 43 XI 44 XI 45 XI 46 XI 47 XI 48 XI 49 XI 50 XI 51 XI 52 XI 53 XI 54 XI

Use Quizgecko on...
Browser
Browser