This project is focused on the early detection of pneumonia from chest X-ray images and uses a Generative Adversarial Network (GAN) model for the generation of realistic synthetic pneumonia images to augment training data. Early detection of pneumonia can help healthcare providers offer timely treatments, improving patient outcomes and potentially saving lives. The detection system is deployed as a web application using Flask.
Pneumonia is a life-threatening illness that affects over 450 million people globally each year. The early detection of pneumonia is critical for administering timely medical interventions, especially in children under five and the elderly. Implementing a GAN-based pneumonia image generation system helps in:
The detection model is a convolutional neural network (CNN) trained to classify chest X-ray images into two categories: Pneumonia and Normal. It takes a chest X-ray image as input and outputs the probability of the image belonging to either class.
The Generative Adversarial Network (GAN) is used to generate synthetic pneumonia images. This is particularly useful for improving the detection model’s performance by augmenting the dataset with more pneumonia images.
Exploratory Data Analysis was conducted to understand the dataset better. Visualizations such as class distributions, image quality, and correlation analyses were performed to ensure balanced and clean data for model training.
The performance of the pneumonia detection model is evaluated using the following metrics:
The GAN model is evaluated based on its ability to generate realistic and diverse pneumonia images that can fool the discriminator while improving classification model performance.
The project includes a Flask-based web application that allows users to upload chest X-ray images and receive predictions on whether the patient has pneumonia or not.
git clone https://github.com/your-repo/pneumonia-gan-detection.git
cd pneumonia-gan-detection
pip install -r requirements.txt
Download or place the trained models (detection_model.h5
and gan_model.h5
) in the model/
directory.
python app.py
http://127.0.0.1:5000/
.This project is licensed under the MIT License. See the LICENSE file for more details.