System Architecture

Layered Safety Architecture

The system combines a Flutter mobile app, Flask backend services, and AWS cloud infrastructure to keep the wearable experience lightweight while the heavy work happens remotely.

FlutterFlutter
FlaskFlask
AWSAWS

Architecture Layers

Flutter Mobile Layer

The companion app is built with Flutter to deliver cross-platform role-based flows for Patient, Caregiver, and Doctor users.

Flask Backend Services

Core APIs are implemented with Flask for authentication, profile management, AI endpoint routing, and secure token-based access.

AWS Cloud Layer

AWS powers compute, storage, and database services using EC2, S3, and RDS to handle heavy processing reliably at scale.

Layered Safety Architecture

Layer 1: Edge Perception

Raspberry Pi + camera capture real-time visual context and send only the required data stream for processing.

Layer 2: AI Inference

Face recognition and medicine/object detection execute in controlled modes to maintain low latency and stable response.

Layer 3: Safety Intelligence

Role-based chatbot and clinical support logic enrich raw detections into safe, understandable guidance.

Layer 4: Secure Backend

Flask APIs with JWT validation, rate limiting, and standardized error handling enforce reliable operations.

Layer 5: Cloud Reliability

AWS EC2, S3, and RDS ensure model availability, scalable processing, and persistent medical data integrity.

Layer 6: Continuous Learning

Retraining pipelines ingest new faces from mobile uploads and hot-update active models without downtime.

Flow Visualization

Edge Capture
AI Inference
Safety Logic
Flask API
AWS Cloud
OLED Output

Computer Vision Processing

Real-time image processing from AR glasses: face recognition via SVM, object detection via YOLOv8, with immediate OLED output.

Voice Chat & Diagnosis

Multimodal RAG system with Gemini: patient questions, STT/TTS, database context, and ResNet50 MRI analysis for doctors.

Machine Learning Retraining

Caregiver uploads images to S3, the training server refreshes the SVM model, and the main API hot reloads the latest version.

Identity & Access Management

JWT-based stateless auth with token blacklist, password signature validation, and role-based access control.