Face Liveness Detection using Deep Learning CNN Models (Keras)
This project focuses on liveness detection to differentiate between real and spoof (fake) faces using deep learning techniques. The main goal is to classify faces as either real or fake by analyzing both video and image datasets.
The project is structured into two main phases:
- Face Spoofing Detection: A deep learning model is used to extract features and classify faces into real or fake (spoof).
- Model Training and Evaluation: Models such as CNN and a fully connected neural network were trained using a combination of real and spoof face datasets.
- CASIA Face Anti-Spoofing: Videos with labeled face spoofing instances.
- CelebA-Spoof: A dataset containing images of real and spoof faces.
- Real and spoof faces are separated into two classes (
Real
andSpoof
). - Images are augmented using the
ImageDataGenerator
from Keras to increase dataset size. - The datasets were split into training and validation sets with an 80/20 ratio.
Faces are extracted from images using the DeepFace
framework. This includes:
- SSD (Single Shot Multibox Detector) for fast face detection.
- Extracted faces are cropped and saved for model input.
The CNN model was trained with the following parameters:
- Image Size: 128x128 pixels
- Epochs: 20
- Batch Size: 8
- Optimizer: Adam with an exponential learning rate decay.
A pre-trained model was fine-tuned on the dataset to improve detection accuracy.