Skip to content

About

This project develops an AI-powered mobile app using Vision Transformers to accurately classify Alzheimer's stages from MRI scans, assisting doctors and patients in early and reliable diagnosis.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

35 Commits

Folders and files

Repository files navigation

🧠 TeleNeuro

AI-Powered Telemedicine Platform for Early Alzheimer's Detection


πŸ“– Overview

TeleNeuro is a full-stack Flutter telemedicine application that connects patients and neurologists, combined with an on-device AI diagnostic engine for early Alzheimer's detection from brain MRI scans.

The app runs a fine-tuned Vision Transformer (ViT-B/16) model β€” converted to TFLite and bundled directly into the app β€” so MRI classification happens entirely on-device, without sending medical images to any external inference server.

Patients can upload an MRI scan, receive an instant AI-generated diagnosis report (PDF), book appointments with doctors, chat in real time, and securely share their reports β€” all within one app.


✨ Features

πŸ‘€ Patient Side

  • Secure sign-up / login (Gmail-restricted email validation, 18+ age gate)
  • Browse & search doctors by specialization, sorted by rating
  • Book appointments with date/time picker + problem description
  • Real-time chat with doctors after appointment acceptance
  • AI MRI Diagnosis β€” upload a scan, get instant stage classification + confidence score
  • Auto-generated PDF diagnostic report, saved to personal Lab Reports library
  • Share MRI reports selectively with doctors (only those with an accepted appointment)
  • In-app notifications (bookings, messages, session updates, shared reports)
  • Editable profile with photo upload (Supabase-backed)
  • Secure account deletion with password re-authentication

🩺 Doctor Side

  • Separate doctor registration flow (specialization, qualification, hospital, experience)
  • Dashboard with live stats: total patients, pending requests, rating, experience
  • Accept / decline appointment requests in real time
  • Dedicated chat inbox per patient, with "End Session" and delete conversation controls
  • View shared MRI reports & clinical summaries from linked patients
  • "My Patients" directory built from appointment history
  • Patient reviews & ratings section on public profile
  • In-app doctor guide / FAQ

πŸ” Shared / Core

  • Dual-role authentication routing (Patient vs Doctor) via Firestore role checks
  • Firestore-backed real-time notification engine (deduplicated per event)
  • Appointment-scoped chat with visibility rules (auto-hides chat if either account is deleted)
  • Reusable UI kit: searchable dropdowns, animated buttons, custom date pickers, badge icons

πŸ“Έ Screenshots

Patient Dashboard MRI Reports Appointments
patient_dashboard Reports Appointments
Doctor Dashboard Doctor Profile User Guide
doctor_dashboard doctor_profile user_guide

🧠 AI Model

Architecture Vision Transformer β€” ViT-B/16 (torchvision)
Task 4-class classification: NonDemented, VeryMildDemented, MildDemented, ModerateDemented
Training framework PyTorch (mixed-precision / AMP, early stopping)
Datasets Alzheimer's MRI Dataset + OASIS Brain MRI Dataset
Export pipeline PyTorch β†’ ONNX (opset 14) β†’ TFLite (via ai-edge-torch)
On-device runtime tflite_flutter
Input 224Γ—224Γ—3 RGB tensor, ImageNet-normalized

Preprocessing pipeline (must match training exactly): Resize(256) → CenterCrop(192) → Grayscale→RGB → Resize(224) → Normalize(ImageNet mean/std) → CHW

The full training/export notebook is documented in final-fyp.ipynb.


πŸ› οΈ Tech Stack

Layer Technology
Frontend Flutter (Dart)
Authentication Firebase Auth
Database Cloud Firestore (real-time)
File Storage Supabase Storage (MRI PDFs, images, profile photos)
AI Inference TensorFlow Lite (on-device)
PDF Generation pdf package
State/Local Cache shared_preferences

πŸ“‚ Project Structure

lib/
β”œβ”€β”€ Splash/                       # Onboarding / splash screens
β”œβ”€β”€ Profile Side/                 # Role selection (Patient / Doctor)
β”œβ”€β”€ Patient Side/
β”‚   β”œβ”€β”€ Auth/                     # Patient login, signup, portal
β”‚   β”œβ”€β”€ Screens/                  # Dashboard, appointments, chat, MRI upload, reports...
β”‚   └── services/                 # MRI report service
β”œβ”€β”€ Doctor Side/
β”‚   β”œβ”€β”€ Auth/                     # Doctor login, signup, portal
β”‚   β”œβ”€β”€ Screens/                  # Dashboard, appointments, chat, patients, reports...
β”‚   └── Widgets/                  # Doctor-specific cards
β”œβ”€β”€ Widgets/                      # Shared reusable widgets (avatars, dropdowns, pickers...)
β”œβ”€β”€ services/                     # Shared services (auth, notifications, validation...)
β”œβ”€β”€ data/                         # Static option lists (specializations, qualifications)
β”œβ”€β”€ firebase_options.dart
β”œβ”€β”€ supabase_config.dart
└── main.dart

assets/
β”œβ”€β”€ screen1.png ... screen4.jpg   # Onboarding illustrations
└── vit_fyp_direct.tflite         # AI model (NOT committed β€” see setup below)

πŸš€ Getting Started

Prerequisites

  • Flutter SDK ^3.9.2
  • A Firebase project (Auth + Firestore enabled)
  • A Supabase project (Storage bucket)

1. Clone the repository

git clone https://github.com/<your-username>/teleneuro.git
cd teleneuro

2. Install dependencies

flutter pub get

3. Configure Firebase

  • Create a Firebase project β†’ enable Email/Password Auth and Firestore.
  • Run:
  flutterfire configure

This regenerates lib/firebase_options.dart and android/app/google-services.json for your own project.

4. Configure Supabase

  • Create a free project at supabase.com.
  • Create a public Storage bucket (default name used in this project: mri-reports).
  • Run the SQL policies in supabase_mri_reports_storage.sql inside the Supabase SQL Editor.
  • Update lib/supabase_config.dart with your own Project URL and anon key:
  static const String supabaseUrl = 'YOUR_SUPABASE_URL';
  static const String supabaseAnonKey = 'YOUR_SUPABASE_ANON_KEY';
  static const String supabaseBucket = 'mri-reports';

5. ⚠️ AI Model Setup (required β€” not included in this repo)

The .tflite model file is too large for a normal Git push (GitHub blocks files over 100MB), so it is hosted separately instead of being committed to this repository.

Steps to set it up:

  1. Download the model file from:(GitHub Release)
  2. Place the downloaded file at: assets/vit_fyp_direct.tflite
  3. Confirm it's registered in pubspec.yaml (already included in this repo):
   flutter:
     assets:
       - assets/vit_fyp_direct.tflite
  1. Run flutter pub get again, then rebuild the app.

Model training and export details are documented in final-fyp.ipynb.

6. Run the app

flutter run

πŸ”’ Security Notes

  • Never commit real Firebase/Supabase keys to a public repository β€” use environment-specific config or --dart-define for production.
  • Firestore & Storage rules should restrict read/write access appropriately before going to production (this project uses permissive anon policies for development β€” see supabase_mri_reports_storage.sql).

πŸ“œ License

This project is licensed under the MIT License β€” see the LICENSE file for details.


πŸ‘¨β€πŸ’» Author

Malik Anas Ahmed πŸ“§ anasahmed.appdev@gmail.com πŸ”— LinkedIn


Made with ❀️ using Flutter, Firebase, Supabase & PyTorch

About

This project develops an AI-powered mobile app using Vision Transformers to accurately classify Alzheimer's stages from MRI scans, assisting doctors and patients in early and reliable diagnosis.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages