PneumoScan AI is an advanced, explainable AI platform designed for rapid triage of pneumonia in chest radiographs. Built for clinical efficiency, it provides radiologists with high-accuracy predictions coupled with interpretability heatmaps.
- Explainable AI (XAI): Uses Grad-CAM to generate visual heatmaps, highlighting specific thoracic regions used by the model for its decision.
- High Precision: Reaches 96% accuracy on the RSNA Pneumonia Detection dataset.
- Instant Triage: Analysis completed in seconds, prioritizing critical cases for immediate review.
- Medical Reports: Generate professional PDF reports with findings, patient metadata, and timestamps.
- Cloud-Ready: Scalable architecture designed for deployment on Cloudflare Pages and modern container platforms.
- Frontend: Next.js 15, Tailwind CSS, Shadcn UI, Lucide Icons.
- Backend: FastAPI (Python), PyTorch, Torchvision.
- Database/Auth: Supabase.
- Visualization: Recharts, Matplotlib (Backend).
graph LR
User((User)) --> NextJS[Next.js Frontend]
NextJS --> API[Next.js API Routes]
API --> FastAPI[FastAPI ML Backend]
FastAPI --> PyTorch[PyTorch Model]
NextJS --> Supabase[(Supabase DB/Auth)]
- Navigate to the backend directory:
cd backend - Install dependencies:
pip install -r requirements.txt
- Run the FastAPI server:
uvicorn main:app --reload
- Navigate to the frontend directory:
cd frontend - Install dependencies:
npm install
- Set up environment variables:
Create a
.env.localfile based on.env.example. - Run the development server:
npm run dev
- Push the
frontenddirectory to GitHub. - Connect your repository to Cloudflare Pages.
- Set the Build command to
npm run buildand Output directory to.next. - Add environment variables (
NEXT_PUBLIC_SUPABASE_URL, etc.).
- Deploy the
backenddirectory to a platform supporting Python (e.g., Render, Fly.io, or AWS). - Ensure the model weights in
backend/models/best_model.pthare included in your deployment.
The model is trained on the RSNA Pneumonia Detection dataset. For local testing, you can place your X-ray images in the pneumonia_xrays directory.
This tool is for demonstration and research purposes only. It is not a certified medical device and should not be used for clinical diagnosis without the supervision of a certified radiologist.
Distributed under the MIT License. See LICENSE for more information.