AI-Powered Telemedicine Platform for Early Alzheimer's Detection
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.
- 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
- 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
- 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
| Patient Dashboard | MRI Reports | Appointments |
|---|---|---|
![]() |
![]() |
![]() |
| Doctor Dashboard | Doctor Profile | User Guide |
|---|---|---|
![]() |
![]() |
![]() |
| 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.
| 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 |
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)
- Flutter SDK
^3.9.2 - A Firebase project (Auth + Firestore enabled)
- A Supabase project (Storage bucket)
git clone https://github.com/<your-username>/teleneuro.git
cd teleneuroflutter pub get- Create a Firebase project β enable Email/Password Auth and Firestore.
- Run:
flutterfire configureThis regenerates lib/firebase_options.dart and android/app/google-services.json for your own project.
- 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.sqlinside the Supabase SQL Editor. - Update
lib/supabase_config.dartwith 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';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:
- Download the model file from:(GitHub Release)
- Place the downloaded file at: assets/vit_fyp_direct.tflite
- Confirm it's registered in
pubspec.yaml(already included in this repo):
flutter:
assets:
- assets/vit_fyp_direct.tflite- Run
flutter pub getagain, then rebuild the app.
Model training and export details are documented in
final-fyp.ipynb.
flutter run- Never commit real Firebase/Supabase keys to a public repository β use environment-specific config or
--dart-definefor production. - Firestore & Storage rules should restrict read/write access appropriately before going to production (this project uses permissive
anonpolicies for development β seesupabase_mri_reports_storage.sql).
This project is licensed under the MIT License β see the LICENSE file for details.
Malik Anas Ahmed π§ anasahmed.appdev@gmail.com π LinkedIn
Made with β€οΈ using Flutter, Firebase, Supabase & PyTorch





