This project implements a Facial Recognition System using Siamese Neural Networks (SNN). The model is trained to compare two facial images and determine if they belong to the same person. This approach is widely used for applications such as face authentication, access control, and more.
- One-shot learning: Identifies faces with limited training data.
- Custom dataset creation: Train the model with your own images.
- High accuracy: Optimized model for robust performance.
Facial recognition is achieved using Siamese Neural Networks, a deep learning architecture designed to find similarity between two inputs. Unlike traditional classification models, SNNs focus on learning a distance metric to measure the similarity between facial images.
Key steps:
- Data Preparation: Images are preprocessed and paired as matching or non-matching pairs.
- Model Training: The SNN is trained to minimize the contrastive loss, which measures the distance between embeddings of paired images.
- Real-time Recognition: After training, the model is used to verify or identify faces in real time.
Model Accuracy: The system achieves an accuracy of approximately 92% on the test set, with a false positive rate of 5% for challenging datasets.
The dataset for this project was prepared manually. It consists of facial images of multiple individuals, carefully labeled and organized for training and testing.
- Collect images: Capture or gather facial images for each individual.
- Organize the dataset: Save the images in folders, where each folder corresponds to a specific individual:
dataset/ ├── person1/ │ ├── img1.jpg │ ├── img2.jpg ├── person2/ │ ├── img1.jpg │ ├── img2.jpg - Generate image pairs: Create pairs of images for training:
- Positive pairs: Two images of the same person.
- Negative pairs: Images of different people.
Install the required dependencies using the following command:
pip install -r requirements.txtgit clone https://github.com/akhandpratap18/facial-recognition-system.git
cd facial-recognition-systemPlace your prepared dataset in the dataset/ directory as described above.
Upload facial images or use a webcam to test the system's accuracy in recognizing individuals.
Feel free to contribute to this project by submitting issues or pull requests. Suggestions for improving the model or optimizing the pipeline are always welcome!
Akhand Pratap Singh
Passionate about deep learning and computer vision. 😊