A deep learning-based face verification system using MTCNN for face detection and InceptionResnetV1 for face recognition, fine-tuned on custom dataset.
graph LR
A[Input Image] --> B[MTCNN]
B --> C[Face Detection]
C --> D[Face Alignment]
D --> E[InceptionResnetV1]
E --> F[Face Embeddings]
F --> G[Verification Result]
style A fill:#f9f,stroke:#333,stroke-width:2px
style G fill:#bbf,stroke:#333,stroke-width:2px
- facenet_pytorch
- torch
- torchvision
- numpy
- opencv-python
- tensorboard
graph TD
A[Input Layer] --> B[MTCNN]
B --> C[InceptionResnetV1]
C --> D[FC Layer]
D --> E[Output Layer]
- Face detection using MTCNN
- Image resizing to 160x160 pixels
- Face alignment and normalization
- Data augmentation techniques
- Batch Size: 16
- Epochs: 120
- Optimizer: Adam
- Learning Rate: 0.001
- Loss Function: CrossEntropyLoss
- Learning Rate Scheduler: MultiStepLR
- Data Collection:
# Collect and organize face images in the following structure:
/dataset
/Person1
image1.jpg
image2.jpg
/Person2
image1.jpg
image2.jpg
- Training:
# Run the training script
python training_mtcnn.py
- Model Inference:
# Load the trained model
model = InceptionResnetV1(pretrained='vggface2')
model.load_state_dict(torch.load('Face_Verification_v4.pth'))
- Robust face detection using MTCNN
- Custom data augmentation pipeline
- Fine-tuned InceptionResnetV1 model
- Learning rate scheduling
- Training and validation visualization
- Cross-entropy loss optimization
The model achieves:
- Training Accuracy: ~95%
- Validation Accuracy: ~93%
- Real-time inference capability
- Robust face verification performance
graph TD
A[Project Root] --> B[training_mtcnn.py]
A --> D[dataset/]
A --> E[models/]
D --> F[Person1/]
D --> G[Person2/]
E --> H[Face_Verification_v4.pth]
Feel free to open issues and pull requests for:
- Bug fixes
- New features
- Documentation improvements
- Performance optimizations
This project is licensed under the Appache 2.0 License - see the LICENSE file for details.
- FaceNet PyTorch implementation
- MTCNN paper and implementation
- Labelled Faces in the Wild (LFW) Dataset