GitHunt
AB

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+ Logo

๐Ÿง  CARE-AD+

Computer-Aided Recognition of Alzheimer's Disease

Python
PyTorch
FastAPI
React

License
PRs Welcome
Maintenance


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 Analysis

EfficientNet/ResNet CNN for accurate MRI classification across 4 dementia stages

๐Ÿ” Explainable AI (XAI)

Grad-CAM heatmaps for transparent, interpretable predictions

๐Ÿ’ฌ RAG-Enhanced LLM

Ollama + Medical Knowledge Base for evidence-based explanations

๐Ÿ“„ Clinical Reports

Professional PDF reports with visualizations and recommendations

๐Ÿ“Š Real-time Dashboard

Live analytics, prediction tracking, and model performance monitoring

โš™๏ธ Admin Control

Dataset 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.bat

This 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.bat

Access: http://localhost:3000


๐ŸŽจ Tech Stack

Backend

Technology Purpose
FastAPI REST API Framework
PyTorch Deep Learning
SQLAlchemy Database ORM
Ollama Local LLM

Frontend

Technology Purpose
React UI Framework
Vite Build Tool
Recharts 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 -d

Services:


๐Ÿ‘ฅ 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

  1. Fork the repository
  2. Create feature branch: git checkout -b feature/AmazingFeature
  3. Commit changes: git commit -m 'Add AmazingFeature'
  4. Push: git push origin feature/AmazingFeature
  5. 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

๐ŸŒŸ Star this repo if it helped you!

Made with โค๏ธ for Better Healthcare

GitHub stars