abhishekk-y/COMPUTER-AIDED-RECOGNITION-OF-ALZHEIMER-DISEASE
AI-powered clinical decision support system for Alzheimer's disease detection using Deep Learning, Explainable AI (Grad-CAM), and RAG-enhanced LLM. Full-stack application with React frontend and FastAPI backend.
๐ง CARE-AD+
Computer-Aided Recognition of Alzheimer's Disease
An advanced AI-powered clinical decision support system for early Alzheimer's disease detection
Deep Learning โข Explainable AI (XAI) โข RAG-Enhanced LLM โข Clinical Reports โข Real-time Analytics
Features โข Quick Start โข Documentation โข Demo
๐ Overview
CARE-AD+ (Computer-Aided Recognition of Alzheimer's Disease Plus) is a comprehensive, multi-modal AI system designed to assist healthcare professionals in early detection and diagnosis of Alzheimer's disease. The system combines state-of-the-art deep learning with explainable AI techniques and RAG-enhanced LLM to provide transparent, clinically-relevant insights.
๐ฏ Mission
Early detection of Alzheimer's disease is crucial for patient care planning and potential intervention. CARE-AD+ provides clinicians with AI-powered analysis of brain MRI scans, backed by visual explanations, medical knowledge retrieval, and natural language interpretations.
โจ Key Features
๐ง Deep Learning AnalysisEfficientNet/ResNet CNN for accurate MRI classification across 4 dementia stages |
๐ Explainable AI (XAI)Grad-CAM heatmaps for transparent, interpretable predictions |
๐ฌ RAG-Enhanced LLMOllama + Medical Knowledge Base for evidence-based explanations |
๐ Clinical ReportsProfessional PDF reports with visualizations and recommendations |
๐ Real-time DashboardLive analytics, prediction tracking, and model performance monitoring |
โ๏ธ Admin ControlDataset management, model retraining, and system configuration |
๐๏ธ System Architecture
๐ฆ CARE-AD+ System
โ
โโโ ๐ฅ๏ธ Frontend (React + Vite)
โ โโโ ๐ Dashboard - Real-time statistics & charts
โ โโโ ๐ฌ Prediction - MRI upload & analysis
โ โโโ ๐ Results - Detailed findings with heatmaps
โ โโโ ๐ฌ Chat - RAG-enhanced AI Assistant
โ โโโ ๐ Reports - PDF generation & download
โ โโโ โ๏ธ Admin - System management
โ
โโโ โก Backend (FastAPI)
โ โโโ ๐ Authentication - JWT-based security
โ โโโ ๐ค Patients - Simplified CRUD (ID, Name, Age)
โ โโโ ๐ง Predictions - ML inference pipeline
โ โโโ ๐ฌ Chat - LLM with RAG integration
โ โโโ ๐ Reports - PDF generation
โ โโโ โ๏ธ Admin - Training & metrics
โ
โโโ ๐ค ML Pipeline (PyTorch)
โ โโโ ๐ฆ Dataset - Data loading & augmentation
โ โโโ ๐๏ธ Model - EfficientNet/ResNet architecture
โ โโโ ๐๏ธ Training - Complete training pipeline
โ โโโ ๐ Evaluation - Metrics & visualization
โ
โโโ ๐ XAI Services
โ โโโ ๐ฅ Grad-CAM - Visual explanations
โ
โโโ ๐ RAG Pipeline
โ โโโ ๐ฅ Medical Knowledge Base
โ โโโ ๐ Context Retrieval
โ โโโ ๐ก Prompt Enhancement
โ
โโโ ๐ฌ LLM Service (Ollama)
โโโ ๐จโโ๏ธ Technical Mode - For clinicians
โโโ ๐ค Patient Mode - Simplified explanations
๐ฅ Classification Categories
| Class | Description | Color Code |
|---|---|---|
| ๐ข NonDemented | Cognitively normal, no signs of dementia | Green |
| ๐ก VeryMildDemented | Very mild cognitive impairment, early changes | Amber |
| ๐ MildDemented | Mild dementia, consistent with early-stage AD | Orange |
| ๐ด ModerateDemented | Moderate dementia, significant impairment | Red |
๐ Quick Start
Prerequisites
| Requirement | Version | Download |
|---|---|---|
| Python | 3.10+ | python.org |
| Node.js | 18+ | nodejs.org |
| Ollama | Latest | ollama.ai |
โก One-Click Setup (Windows)
# Just double-click:
QUICK_START.batThis automatically:
- โ Creates Python virtual environment
- โ Installs all dependencies
- โ Pulls Ollama phi3 model
- โ Starts backend & frontend servers
๐ง Manual Installation
# 1. Clone repository
git clone https://github.com/abhishekk-y/COMPUTER-AIDED-RECOGNITION-OF-ALZHEIMER-DISEASE.git
cd COMPUTER-AIDED-RECOGNITION-OF-ALZHEIMER-DISEASE
# 2. Setup backend
cd backend
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txt
# 3. Setup frontend
cd ../frontend
npm install
# 4. Setup Ollama
ollama pull phi3
ollama serve
# 5. Start servers
cd ..
start_app.batAccess: http://localhost:3000
๐จ Tech Stack
Backend
| Technology | Purpose |
|---|---|
| REST API Framework | |
| Deep Learning | |
| Database ORM | |
| Local LLM |
Frontend
| Technology | Purpose |
|---|---|
| UI Framework | |
| Build Tool | |
| Data Visualization |
๐ Project Structure
COMPUTER-AIDED-RECOGNITION-OF-ALZHEIMER-DISEASE/
โ
โโโ ๐ backend/
โ โโโ ๐ app/
โ โ โโโ main.py # FastAPI application
โ โ โโโ config.py # Configuration
โ โ โโโ ๐ routers/ # API endpoints
โ โ โโโ ๐ services/ # Business logic
โ โ โ โโโ ml_service.py # ML inference
โ โ โ โโโ xai_service.py # Grad-CAM
โ โ โ โโโ llm_service.py # LLM integration
โ โ โ โโโ rag_service.py # RAG pipeline
โ โ โ โโโ report_service.py # PDF generation
โ โ โโโ ๐ models/ # Database models
โ โโโ ๐ ml/
โ โ โโโ model.py # CNN architecture
โ โ โโโ dataset.py # Data loading
โ โ โโโ train.py # Training pipeline
โ โ โโโ evaluate.py # Evaluation
โ โโโ requirements.txt
โ
โโโ ๐ frontend/
โ โโโ ๐ src/
โ โ โโโ ๐ pages/ # React pages
โ โ โโโ ๐ components/ # Reusable components
โ โ โโโ ๐ services/ # API client
โ โ โโโ ๐ styles/ # CSS
โ โโโ package.json
โ
โโโ ๐ assets/ # Project assets
โโโ QUICK_START.bat # One-click setup
โโโ setup_ollama.bat # Ollama setup
โโโ train_model.bat # Model training
โโโ INSTALLATION.md # Installation guide
โโโ OLLAMA_GUIDE.md # LLM + RAG guide
โโโ README.md # This file
๐ Documentation
| Document | Description |
|---|---|
| INSTALLATION.md | Complete installation guide |
| OLLAMA_GUIDE.md | LLM setup & RAG pipeline |
๐ง Model Training
# Quick training
train_model.bat
# Custom training
cd backend
python -m ml.train --dataset ../archive/combined_images --epochs 50๐ค RAG Pipeline
The system includes a Retrieval-Augmented Generation pipeline that enhances LLM responses with medical knowledge:
- Medical Knowledge Base: CDR staging, biomarkers, treatments
- Context Retrieval: Automatic relevant knowledge extraction
- Prompt Enhancement: Evidence-based medical facts
- Clinical Guidelines: Recommendations per disease stage
See OLLAMA_GUIDE.md for details.
๐ณ Docker Deployment
docker-compose up -dServices:
- Backend: http://localhost:8000
- Frontend: http://localhost:3000
- Ollama: http://localhost:11434
๐ฅ Default Credentials
| Role | Username | Password |
|---|---|---|
| Clinician | clinician |
password123 |
| Admin | admin |
admin123 |
โ ๏ธ Change in production!
๐ Model Performance
| Metric | Value |
|---|---|
| Accuracy | ~94% |
| Precision | ~92% |
| Recall | ~91% |
| F1 Score | ~92% |
๐ค Contributing
- Fork the repository
- Create feature branch:
git checkout -b feature/AmazingFeature - Commit changes:
git commit -m 'Add AmazingFeature' - Push:
git push origin feature/AmazingFeature - Open Pull Request
๐ License
MIT License - see LICENSE file.
โ ๏ธ Medical Disclaimer
IMPORTANT: CARE-AD+ is a clinical decision support tool. It is NOT intended to replace professional medical judgment, diagnosis, or treatment. All predictions should be reviewed by qualified healthcare professionals.
๐ Acknowledgments
- Academic Guidance: University project supervision
- Open Source: PyTorch, FastAPI, React communities
- Medical Research: Alzheimer's disease research community