Eye Scanner is a dual-architecture, zero-infrastructure edge Progressive Web App (PWA) designed to democratize high-grade medical diagnostics.
I built Eye Scanner with a singular goal in mind: to bring immediate, clinical-grade medical treatment to marginalized and deeply impoverished populations where hospitals do not exist.
In rural and underserved regions, the lack of immediate access to an ophthalmologist can mean the difference between sight and permanent blindness. Eye Scanner places a powerful diagnostic engine directly into the pockets of field workers, running entirely on consumer-grade mobile devices. It works entirely offline when internet connectivity is completely unavailable, ensuring that poor communities get immediate triage and intervention without relying on expensive, centralized medical infrastructure.
Eye Scanner utilizes a deeply optimized split-architecture system that fluidly transitions between edge-compute and cloud-compute based on network availability.
graph TD
subgraph Client ["Client Device (Offline/Edge)"]
A[Camera Capture] --> B[CLAHE Preprocessing]
B --> C{Network Status?}
C -- Offline --> D[ONNX WebEngine]
D --> E[IndexedDB Queue]
end
subgraph Cloud ["Cloud Engine (Online/REST)"]
C -- Online --> F[FastAPI Backend]
F --> G[EfficientNet-B4 + Grad-CAM]
G --> H[Supabase DB Sync]
end
E -- Automatic Sync --> F
H --> I[Detailed PDF Report]
When operating in remote areas with zero connectivity, Eye Scanner falls back to a locally cached MobileNetV3 neural network.
- ONNX Runtime Web: Executed completely locally using WebAssembly (
.wasm) and WebGL APIs to process images natively within the device's CPU/GPU. - IndexedDB Offline Queue: Scans taken offline are securely queued in the browser's IndexedDB. When connectivity is restored, the
is_offline: trueflagged records sync back to the master database.
When internet is restored, the PWA seamlessly transitions to a robust, serverless backend hosted on Hugging Face Spaces.
- Pure FastAPI Inference: Stripped of UI bloat, the cloud runs a heavy-duty EfficientNet-B4 model.
- Grad-CAM Heuristics: Generates granular heatmaps using Gradient-weighted Class Activation Mapping to pinpoint the exact vascular lesions and exudates.
- Monte Carlo Dropout (MC Dropout): Runs 10 concurrent passes to generate statistical uncertainty metrics, warning clinicians of low-confidence predictions.
- CLAHE: Contrast Limited Adaptive Histogram Equalization is applied client-side to strip lighting abnormalities and clarify retinal vessels.
- EXIF Parser: Automatically reads focal length, ISO, and device manufacturer metrics to normalize inference weights.
The architecture includes rudimentary hooks for Federated Learning. Rather than uploading heavy, privacy-violating patient images to centralized servers, Eye Scanner captures encrypted weight deltas which are aggregated periodically, meaning the model gets smarter globally while patient data never leaves the device locally.
- Frontend: React.js, Vite, Vanilla CSS
- Backend Inference: Python, FastAPI, TensorFlow/Keras
- Database: Supabase (PostgreSQL + RLS)
- Edge Inference: ONNX WebAssembly
For a deep dive into the technical challenges faced during development (Camera APIs, ONNX conversion, and Backend hurdles), see the HURDLES.md document.
- Node.js (v18+)
- Supabase Account
- Hugging Face Account
- Clone the repository:
git clone https://github.com/mrQhere/eye-scanner-pwa.git
cd eye-scanner-pwa- Install dependencies:
npm install- Set up your environment variables (see
.env.example):
cp .env.example .env
# Edit .env with your specific API keys- Run locally:
npm run devThis software is released under the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) license.
The mission of Eye Scanner is strictly humanitarian. You are free to fork this project, deploy it, and use it in your local communities. However, you are strictly prohibited from using any part of this software, its models, or its architectures for commercial profit or monetization.
Developed by mrQhere. For a world where healthcare has no borders.
