X-RayGuard is an AI-powered system for detecting lung diseases from chest X-ray images. It classifies images into three categories: COVID-19, Viral Pneumonia, and Normal. Built with TensorFlow and Gradio, this project provides a comprehensive pipeline for medical image analysis, from preprocessing to explainable predictions.
- Disease Classification: Detects COVID-19, Viral Pneumonia, and Normal cases.
- Explainable AI: Integrated Grad-CAM visualization to highlight decision-critical regions.
- Interactive Web Interface: User-friendly Gradio app for real-time predictions.
- Transfer Learning: Uses MobileNetV2 for efficient feature extraction.
- Detailed Metrics: Confusion matrices, classification reports, and training history plots.
- Python 3.8+
- TensorFlow 2.x
- OpenCV, NumPy, Gradio
- Clone the repository:
git clone https://github.com/RaitonRed/X-RayGuard.git cd X-RayGuard - Installing Dependency's
pip install -r requirements.txt
- Run the web app
cd src python run.py
X-RayGuard/
├── .env/
├── data/
├── models/
├── notebooks/
├── results/
├── src/
│ ├── interface/
│ │ ├── __init__.py
│ │ ├── app.py
│ │ └── functions.py
│ ├── __init__.py
│ ├── data_preprocessing.py
│ ├── evaluate.py
│ ├── grad_cam.py
│ ├── options.py
│ ├── predict.py
│ ├── run.py
│ └── train.py
├── .gitignore
├── LICENSE
├── README.md
├── requirements.txt
└── research_requirements.txt
This project uses the COVID-19 Radiography Dataset. Organize the dataset as follows:
data/
├── COVID
├── NORMAL
└── VIRAL PNEUMONIA
- Train the model:
python train.py- Generate Grad-CAM heatmaps:
python grad_cam.py --image path/to/image.png --save output.png - Evaluate the model:
python evaluate.pyContributions are welcome!
- Report bugs via GitHub Issues.
- Suggest improvements or open a Pull Request.
- Improve documentation or add new features.
This project is licensed under the MIT License. See LICENSE for details.
Made with ❤️ by Raiton.

