🫁⚡ A lightweight machine learning web app that detects Pneumonia from chest X-rays with 94.6% accuracy in under 1.5 seconds. Built for low-resource clinics.
# 🫁 Pneumonia Detection System using Chest X-Rays through Machine Learning
Project website: PNEUMONIA DETECTION
An intelligent web-based application that detects pneumonia from chest X-ray images using classical Machine Learning techniques. The system combines image preprocessing, handcrafted feature extraction, ensemble classification, and explainable AI to provide accurate, fast, and interpretable predictions.
---
## 📖 Overview
Pneumonia is one of the leading causes of respiratory-related deaths worldwide, especially among children and elderly patients. Accurate diagnosis from chest X-rays requires experienced radiologists, which may not always be available in rural or resource-constrained healthcare facilities.
This project provides an AI-assisted diagnosis system that analyzes chest X-ray images and predicts whether a patient is suffering from pneumonia. Unlike many deep learning-only approaches, this project focuses on an interpretable and lightweight machine learning pipeline that can be deployed efficiently without requiring high-end GPU infrastructure.
---
## ✨ Key Features
- 🩻 Chest X-ray image upload
- ✅ Four-layer X-ray validation system
- 🎨 CLAHE-based image enhancement
- 📊 HOG (Histogram of Oriented Gradients) feature extraction
- 🧩 LBP (Local Binary Pattern) feature extraction
- ⚖️ Feature normalization using StandardScaler
- 🤖 Ensemble Machine Learning classifier
- 📈 Pneumonia severity scoring
- 🔍 SHAP-based explainability
- 📄 PDF report generation
- 🌐 FastAPI backend
- 💻 Responsive web interface
- ☁️ Serverless deployment
---
# 🏗️ System Workflow
```
Chest X-ray Upload
│
▼
4-Layer Image Validation
│
▼
Image Preprocessing (CLAHE)
│
▼
Feature Extraction
(HOG + LBP + Statistical Features)
│
▼
Feature Scaling
(StandardScaler)
│
▼
Ensemble Classifier
(SVM + Random Forest + Gradient Boosting)
│
▼
Prediction
│
▼
Severity Analysis
│
▼
SHAP Explainability
│
▼
Result & PDF Report
```
---
# 🧠 Machine Learning Pipeline
### Image Preprocessing
- …