This repository contains code and models developed during my tenure as an Artificial Intelligence Intern at Code Clause from May 2024 to June 2024 . The primary objective of this project is to detect the presence or absence of pneumonia using chest X-ray images sourced from the PneumoniaMNIST dataset, which is a part of the larger MedMNIST dataset collection. Pneumonia is a serious condition that causes inflammation in one or both lungs, and early detection is crucial for effective treatment.
Below are the key steps involved:
- Installation
- Dataset
- Visualization
- Data Preprocessing
- Model Architecture
- Model Evaluation
- User Interface
To run this project, you need to install the required libraries. The following libraries are necessary for this project:
- Gradio
- TensorFlow
- Matplotlib
- MedMNIST
The dataset used in this project is the PneumoniaMNIST dataset from MedMNIST, which consists of chest X-ray images. Each image is of 224x224 pixels, in grayscale. The dataset is divided into training, validation, and testing sets.
Size of Training Set = 4708 Size of Test Set = 624 Size of Validation Set= 524
Two images have been visualized from the training set using Matplotlib
The images are converted from grayscale to RGB format and their dimensions are expanded to match the input shape required by the ResNet50 model.
The concept of transfer learning is utilized .The model is built using the ResNet50 architecture as the base model, with additional layers added for the specific task of pneumonia detection.
The following metrics were utilized to analyze the performance of the model:
- Accuracy = 0.9038461538461539
- Precision = 0.9155590503246753
- Recall = 0.9038461538461539
- F1 Score = 0.9003725478782234
- Confusion Matrix
The project utilizes the Gradio library to create an interactive web interface for the AI-driven medical diagnosis system. Gradio is a powerful library that allows developers to quickly deploy machine learning models and create user-friendly interfaces without extensive front-end development knowledge.
Do Star this repository if you find it useful!