This project implements a Siamese Neural Network for efficient image triplet analysis, seamlessly integrating OpenCV for image collection. Three categories of images - positive, negative, and anchor - are collected using OpenCV and preprocessed to standardize dimensions to 100x100 pixels in JPEG format.
- Data Collection: Utilizing OpenCV, 300 images are collected from each category: positive, negative, and anchor.
- Preprocessing: Images are resized to 100x100 pixels and converted to JPEG format.
- Dataset Creation: Positive and negative image pairs are combined with anchor images, generating a labeled dataset. Positive pairs are labeled as 1, and negative pairs as 0.
- Training Data Preparation: The dataset is split into training and testing sets in a 70-30 ratio and batched with a size of 8 for efficient processing.
- Siamese Model Architecture: A Siamese neural network is constructed with an embedding layer for feature extraction and a custom distance layer for similarity computation.
- Model Training: The Siamese model is trained on the prepared dataset, optimizing recall and precision metrics for performance evaluation.
- Real-Time Verification: OpenCV is employed for real-time image verification, showcasing the practical application of the trained model.
-
Clone the Repository:
git clone https://github.com/MOHINI1403/Deep-Facial-Recognisation-System.git
-
Install Dependencies:
pip install -r requirements.txt
-
Folder Structure:
- Data Folder:
- Contains three sections: positive, negative, and anchor images.
- Use OpenCV to collect images for the positive and negative sections.
- Negative images can be downloaded here.
- Application Images Folder:
- Contains two folders: input_image and verification_images.
- verification_images folder should contain around 50 images randomly selected from positive and anchor sets.
- Data Folder:
-
Virtual Environment:
- Create a virtual environment named faceid:
python -m venv faceid
- Activate the virtual environment:
- On Windows:
faceid\Scripts\activate
- On macOS and Linux:
source faceid/bin/activate
- On Windows:
- Create a virtual environment named faceid:
Contributions are welcome! Fork the repository, make your changes, and submit a pull request.
- OpenCV Integration: Efficient image collection and real-time verification.
- Siamese Neural Network: Architecture for learning image similarity through feature embeddings.
- Custom Distance Layer: Calculates the L1 distance between embeddings for similarity assessment.
- Training Evaluation: Metrics such as recall and precision used to assess model performance.
Try Reading this Documentation :