Skip to content

AKHIL-SAURABH/HealthAI-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


🫁 HealthAI – AI-Powered Chest X-Ray Disease Detection System

A deep-learning powered platform for multi-disease medical imaging analysis, built with TensorFlow, FastAPI, Streamlit, and deployed on Render.

HealthAI Banner


🏷️ Tech Stack Badges

Python TensorFlow FastAPI Streamlit Render Pandas NumPy EfficientNet

Machine Learning Deep Learning Computer Vision

Status


🚀 Overview

HealthAI is an end-to-end medical imaging project that detects multiple chest diseases from X-ray images using a deep learning model trained on the CheXpert dataset. It features:

  • 📸 Multi-Disease Chest X-Ray Classification (supports 5+ pathologies)
  • 🧠 CNN/Transfer Learning Model (EfficientNetB0)
  • ⚙️ FastAPI Backend for AI Inference
  • 🧩 Streamlit Dashboard for Real-time Diagnosis
  • ☁️ Cloud Deployment on Render
  • 🔒 Clean architecture, modular API, scalable structure

This project demonstrates real-world deep learning workflow: data pipeline → model training → evaluation → API → UI → deployment.


🎥 Demo Video

healthai.mp4

🧠 Features

✔ 1. Multi-Label Disease Detection

Predicts probability for diseases such as:

  • Atelectasis
  • Cardiomegaly
  • Consolidation
  • Edema
  • Pleural Effusion

Example output:

{
  "Atelectasis": 0.14,
  "Cardiomegaly": 0.02,
  "Consolidation": 0.51,
  "Edema": 0.09,
  "Pleural Effusion": 0.78
}

✔ 2. FastAPI Backend

Endpoints:

POST /predict-xray

  • Accepts an uploaded X-ray image
  • Returns normalized probabilities for all diseases

GET /health

Health check endpoint


✔ 3. Streamlit Dashboard

  • Upload X-ray image
  • Call backend API
  • Display disease probabilities in clean UI
  • Visual + interactive

✔ 4. Cloud Deployment

Backend deployed on Render, accessible publicly.


📁 Project Structure

HealthAI-Project/
│
├── backend/
│   ├── main.py
│   ├── model/
│   │   ├── healthai_model.keras
│   │   └── diseases.json
│   └── requirements.txt
│
├── dashboard/
│   ├── app.py
│   └── assets/
│
├── notebooks/
│   ├── 01_train_healthai_model.ipynb
│
├── .gitignore
├── README.md
└── LICENSE

🌍 Live API (Render Deployment)

Base URL:

https://healthai-backend-oj25.onrender.com/

Swagger Docs:

https://healthai-backend-oj25.onrender.com/docs

Streamlit Interface:

https://healthai-frontend-aldddrxsrswa59csqqrkij.streamlit.app/

📡 API Reference (Quick Guide)

🔹 POST /predict-xray

Request: multipart/form-data field name = file

Response:

{
  "Atelectasis": 0.14,
  "Cardiomegaly": 0.02,
  "Consolidation": 0.51,
  "Edema": 0.09,
  "Pleural Effusion": 0.78
}

🔹 GET /health

Simple API check.


🏗 Architecture

graph TD
    A[CheXpert Dataset] --> B[Model Training - EfficientNet]
    B --> C[Saved Model - Keras]
    C --> D[FastAPI Backend]
    D --> E[Streamlit Dashboard]
    D --> F[Mobile App - Future]
    D --> G[Cloud Deployment - Render]

Loading

📥 How to Run Locally

1️⃣ Create environment

conda create -n healthai python=3.10
conda activate healthai

2️⃣ Install backend dependencies

cd backend
pip install -r requirements.txt

3️⃣ Run FastAPI backend

uvicorn main:app --reload --host 0.0.0.0 --port 8000

Docs: http://127.0.0.1:8000/docs


4️⃣ Run Dashboard

Open a second terminal:

cd dashboard
streamlit run app.py

Streamlit UI: http://localhost:8501/


📸 Screenshots

Add these once screenshots are uploaded:

DASBOARD

Dashboard Home

PNEUMONIA PREDICTION

Pneumonia Prediction Result

MULTIPLE DISEAS PREDICTION

Multi-Diseas1 Prediction Result Multi-Diseas2 Prediction Result


📊 Model Training Details

  • Dataset: CheXpert small (5 diseases)

  • Input size: 224x224

  • Base model: EfficientNetB0

  • Optimizer: Adam (lr=1e-4)

  • Loss: Binary Crossentropy

  • Metrics: AUC, Accuracy

  • Achieved Validation Metrics:

    • Accuracy: ~88%
    • Loss: ~0.27

🧩 Future Improvements

  • Add more diseases (14-class CheXpert full)
  • Add attention heatmaps (Grad-CAM)
  • Add mobile app (Flutter)
  • Add hospital-level data logging
  • Improve UI/UX of dashboard

💼 Why This Project?

This project demonstrates:

  • Deep learning model building
  • Medical imaging pipeline
  • Multi-label classification
  • Clean backend architecture
  • Real-world API integration
  • Deployment experience
  • Professional-grade UI

A perfect portfolio project for Machine Learning, AI Engineering, and Healthcare AI roles.


📄 License

This project is licensed under the MIT License.


👤 Author

Akhil Saurabh


About

AI-powered medical imaging system for multi-disease chest X-ray detection,built with EfficientNet deep learning, a FastAPI backend, and an interactive Streamlit dashboard. Deployed on Render for real-time healthcare diagnostics, detecting conditions like Atelectasis, Edema and more.An end-to-end project demonstrating model training,API development.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors