Developed a pneumonia detection system using MobileNet-V3 with transfer learning, achieving 91% accuracy in detecting pneumonia from chest X-rays. Optimized the model for edge devices through knowledge distillation to reduce model size and improve performance in resource-constrained environments. Deployed the model on AWS SageMaker using Flask, ensuring seamless integration and scalability for production environments. Implemented Grad-CAM for model interpretability, visualizing CNN focus areas to enhance prediction accuracy and provide insight into model decision-making.
- Normal images count in training set: 1349
- Pneumonia images count in training set: 3883
- Total Count of images: 5232
Chest_Xray_Pneumonia_Detector/
│── data/
│ ├── pneumonia/
│ ├── normal/
│── train/
│ ├── model_training_code.ipynb
│ ├── saving_model/
│ ├── pneumonia_model.keras
│── results/
│ ├── sample1.png
│ ├── sample3.png
│ ├──.....
│── deployment/
├── app.py
├── requirements.txt
├── index.html
pip install -r requirements.txt- Install dependencies
!pip install -r requirements.txt - Prepare dataset
Chest_Xray_Pneumonia_Detector/ pneumonia / img1.jpg img2.jpg normal/ img1.jpg img2.jpg - Train the model using
model_training_code.ipynb
- Navigate to the
deployment/folder and run:python app.py
- The web app will be available at
http://127.0.0.1:5000
- Launch an EC2 instance with Ubuntu.
- Install dependencies:
sudo apt update && sudo apt install python3-pip pip install -r requirements.txt - Run the Flask app:
python app.py
- Configure security groups to allow inbound traffic on port 5000.
POST /predict- Upload a chest X-ray and get a pneumonia prediction.
- Achieved 91% accuracy
- Used Grad-CAM to visualize model focus areas for interpretability(xAI).
👤 Author: Sai Krishna Chowdary Chundru
📩 Email: cchsaikrishnachowdary@gmail.com
🔗 LinkedIn: linkedin.com/in/sai-krishna-chowdary-chundru
💻 GitHub: github.com/sAI-2025
This project is licensed under the MIT License – feel free to use and modify!