Face Anti-Spoofing System (MobileNetV2)
Introduction
The Face Anti-Spoofing System is a biometric security application designed to distinguish between genuine faces (Real) and presentation attacks (Spoof), such as printed photos, video replays, or screen-based attacks.
This repository hosts the Deep Learning component of the system, utilizing MobileNetV2 CNN for robust real-time inference.
Model Summary
Deep Learning Model — MobileNetV2 CNN
The primary model for real-time face anti-spoofing.
- Architecture: MobileNetV2 encoder (top 20 layers fine-tuned) + custom dense classification head
- Input Resolution: 224 × 224 RGB
- Output Classes:
Real, Spoof
- Key Strengths:
- Detects screen glare, moiré patterns, depth inconsistencies
- Optimized for low-latency real-time inference
Model File:
face_antispoofing_v3_224.keras
Features (Full System Context)
Dual-Mode Interface
Static Image Verification
- High-resolution image analysis
- Instant predictions (no temporal smoothing)
- Bounding boxes with confidence scores
- Visual debugging support
Live Webcam Protection
- Real-time face detection
- 10-frame temporal voting window for stable predictions
- Color-coded feedback:
- 🟢 Green → Real
- 🔴 Red → Spoof
- Automatic reset when face leaves or scene changes
Tech Stack
AI & Backend
- TensorFlow / Keras — MobileNetV2 CNN
Core Dependencies
- Python 3.10+
- NumPy
- Pillow (PIL)
Project Structure
This repository contains the trained model file:
face_antispoofing_v3_224.keras: The CNN model (MobileNetV2) trained for face anti-spoofing.
README.md: Documentation.