- Camera Frame ->
react-native-vision-camera(YUV 420, 640x480) - Face Detection -> BlazeFace (TFLite, NNAPI Accelerated). Returns Bounding Box.
- Alignment & Preprocessing -> Crop using bbox, apply CLAHE to balance contrast (crucial for outdoor sunlight). Resize to 112x112.
- Embedding Generation -> MobileFaceNet INT8. Returns 128-float vector.
- Matching -> Cosine Similarity against local SQLite DB. Threshold > 0.6.
- Passive: The
antispoofing.tflitemodel evaluates micro-texture and depth cues from the 2D image to detect screens and printed paper. - Active Anti-Replay: MediaPipe Face Mesh detects landmark movements. A randomized 4-digit token is presented requiring a sequence (e.g. BLINK_TWICE, SMILE) within 8 seconds. This prevents replay attacks.
graph TD;
A[Attendance Logged] --> B[Store in Local SQLite DB];
B --> C[Network Restored];
C --> D[Read PENDING records];
D --> E[Upload chunks of 50 to AWS Amplify];
E --> F{Upload Success?};
F -- Yes --> G[Update Status to SYNCED];
G --> H[Purge Data];
F -- No --> I[Retry with Backoff];
Instead of sending raw facial photos to the cloud, FieldGuard AI supports federated learning. Devices collect anonymized gradient drifts (based on false negatives manually corrected by supervisors) and send the gradients to AWS Lambda. A FedAvg aggregator merges them and pushes the updated INT8 quantized model back to S3.