This project is a Python-based face authentication system that combines face recognition with liveness detection to prevent spoofing attacks (e.g., using photos or videos).
-
Face Registration & Recognition
- Uses MTCNN for face detection.
- Uses FaceNet (InceptionResnetV1) for generating face embeddings.
- Stores embeddings locally in
faces_db/.
-
Liveness Detection (Anti-Spoofing)
- Blink Detection – verifies natural eye blinks.
- Head Movement – ensures the user turns left/right.
- Smile Detection – detects mouth widening and lip movement.
- Randomized challenges make it harder to cheat.
-
Interactive Menu (OpenCV GUI)
- Register new users.
- Login with liveness + face recognition.
- Quit the system.
- Python, OpenCV – video capture & display.
- Mediapipe – facial landmarks (eyes, mouth, head movement).
- Facenet-PyTorch – face embeddings & recognition.
- NumPy, Torch – vector computations & ML.
- Register → Capture 50 samples of user face, store average embedding.
- Login → Run randomized liveness challenges (blink, head, smile).
- Authenticate → Compare captured embedding against saved embeddings.
- Result → Access granted if similarity > threshold.
- Run the Python script.
- Use the menu to register or login.
- Follow the on-screen prompts for liveness challenges.
faces_db/ # Stores user embeddings
test.py # Main script with all functionality