This project implements a Face Liveness Detection System using profile detection and blink detection techniques. The system is designed to verify whether a person is physically present during the authentication process by analyzing facial features and eye blinks. π
The system employs the following methodologies:
-
Profile Detection πΈ:
- The system utilizes Haar Cascade classifiers to detect frontal and profile faces. This helps in determining whether the user is facing the camera properly.
- The classifiers are loaded from XML files that contain pre-trained models.
-
Blink Detection ποΈ:
- Dlib's shape predictor is used to detect eye landmarks, allowing the calculation of the Eye Aspect Ratio (EAR).
- If the EAR falls below a certain threshold, the system counts it as a blink. The system requires a specific number of blinks to confirm that the user is alive.
-
User Instructions π£οΈ:
- The user is instructed to turn left or right and to blink their eyes as prompted.
- If the conditions of turning and blinking are satisfied within the specified limits, the system declares the liveness detection as successful; otherwise, it fails.
To run this project, ensure you have the following dependencies installed. You can install them using pip:
pip install -r requirements.txtTo run the main file and start the liveness detection process, follow these steps:
-
Make sure you have a working webcam connected to your computer. π·
-
Navigate to the project directory in your terminal or command prompt.
-
Execute the following command:
python main.py
-
Follow the on-screen instructions to complete the liveness detection process. π
your_project_directory/
β
βββ dataset/
β βββ haarcascade_frontalface_default.xml
β βββ haarcascade_profileface.xml
β βββ shape_predictor_68_face_landmarks.dat
β
βββ main.py
βββ README.md