🎥 Demo Video: Watch the Demo on YouTube
A production-grade offline facial recognition and liveness detection system for NHAI field personnel authentication. Works 100% offline in zero-network zones and syncs to AWS when connectivity is restored.
- Real face recognition using MobileFaceNet TFLite (INT8 quantized)
- Platform-specific detection: MLKit (Android) + Apple Vision (iOS)
- Active liveness detection — blink + head turn (anti-spoofing)
- 100% offline operation — works in airplane mode
- SQLite encrypted local storage with WAL mode
- AWS REST sync + purge when network restored
- Hindi + English bilingual UI
- Government-grade NHAI design system
- Personnel directory with search
- Calendar attendance view
| Model | Size | Purpose | Platform |
|---|---|---|---|
| MobileFaceNet (INT8) | ~1.2 MB | Face embedding | Both |
| Google MLKit | 0 MB (built-in) | Detection + liveness | Android |
| Apple Vision | 0 MB (built-in) | Detection + liveness | iOS |
| Total bundle | ~1.2 MB | Under 20MB limit ✅ |
graph TD
subgraph MC["Mobile Client (Offline Edge)"]
A["Camera Frame"] --> B["Native Detection Bridge"]
subgraph PD["Platform Detection"]
B --> B1["Android: Google MLKit"]
B --> B2["iOS: Apple Vision Framework"]
end
B1 --> C["Active Liveness Validation"]
B2 --> C
subgraph LC["Liveness Checks (Anti-Spoofing Challenge)"]
C --> C1["Eye Aspect Ratio / EAR Blink Check"]
C --> C2["Euler Yaw Angle Head Turn Check"]
end
C1 --> D["Embedding Extraction"]
C2 --> D
D --> D1["MobileFaceNet TFLite Inference"]
D1 --> E["Matching Engine"]
E --> E1["Cosine Similarity Score >= 0.72"]
E1 --> F{"Auth Decision"}
F -->|GRANTED| G["Write Log to SQLite WAL"]
F -->|DENIED| H["Display Access Denied"]
end
subgraph SS["SQLite Storage (AES-256)"]
G --> G1[("Encrypted Database")]
end
subgraph SQ["Synchronization Queue"]
G1 --> I["NetInfo Network Listener"]
I -->|Online Detected| J["Outbox Queue Processor"]
end
subgraph CB["Cloud Backend (AWS REST)"]
J -->|Secure HTTPS Batch| K["AWS API Gateway"]
K --> L["AWS Lambda"]
L --> M[("Central Data Lake")]
M -->|Sync Acknowledged 200 OK| N["Purge Local Face Embeddings"]
end
- Face detection: < 100ms
- Liveness check: real-time (500ms snapshot loop)
- Embedding extraction: < 200ms
- Total auth pipeline: < 1 second ✅
- Model bundle size: ~1.2 MB ✅
- Minimum device: 3GB RAM, Android 8+ / iOS 13+
- Blink detection via eye open probability (Android)
- Head turn detection via Euler yaw angle (both platforms)
- Photo spoof rejected (no natural eye movement)
- Video spoof rejected (challenges are randomized)
- All data stored in SQLite (WAL mode for performance)
- Face embeddings stored as Base64 compressed strings
- Attendance logged locally with sync_status flag
- Background outbox queue uploads when WiFi restored
- Raw embeddings purged after confirmed sync
npm install npx react-native run-android
npm install cd ios && pod install && cd .. npx react-native run-ios
curl -L "https://github.com/MCarlomagno/FaceRecognitionAuth/raw/master/assets/mobilefacenet.tflite" -o assets/models/mobilefacenet.tflite
src/ ai/ - TFLite model wrappers db/ - SQLite repositories sync/ - AWS sync service screens/ - All UI screens navigation/ - React Navigation setup utils/ - Helpers and constants native/ - iOS native modules assets/models/ - TFLite model files
https://github.com/Nightkilller/DataLakeGuardV2
Solo participant — NHAI Hackathon 7.0 Submission: June 5, 2026


