Employee face recognition system using traditional computer vision techniques. Built for the Kaggle "Identify Employees in Surveillance CCTV" hackathon.
RecognAIze is a lightweight face recognition pipeline that processes surveillance camera frames to identify employees without requiring GPU hardware or deep learning frameworks. It uses:
- Haar cascade classifiers for face detection
- Traditional CV features (HOG, LBP, raw pixels, statistical moments) for embeddings
- Cosine similarity matching with employee prototypes
- Configurable thresholds for unknown face handling
Input Image → Face Detection → Feature Extraction → Embedding → Similarity Matching → Employee ID
↓ ↓ ↓ ↓ ↓
OpenCV Haar Cascade HOG + LBP + PCA Cosine Similarity
Raw Pixels + Reduction with Prototypes
Moments
git clone https://github.com/TheValiant/RecognAIze.git
cd RecognAIze
pip install -r requirements.txt
pip install -e .Requirements:
- Python 3.8+
- OpenCV (opencv-python)
- scikit-learn
- NumPy
from src.face_recognition.inference.test_inference import TestInferencePipeline
pipeline = TestInferencePipeline(
dataset_root="path/to/dataset",
similarity_threshold=0.6
)
output_files = pipeline.run_complete_inference(
min_confidence=0.4,
save_debug=True
)from src.face_recognition.detection.detector import FaceDetector
from src.face_recognition.embedding.embedder import FaceEmbedder
import cv2
# Initialize
detector = FaceDetector()
embedder = FaceEmbedder()
# Detect and embed
image = cv2.imread("image.jpg")
faces = detector.detect_faces(image, min_confidence=0.5)
for face_data in faces:
face_result = detector.extract_face(image, face_data)
embedding = embedder.compute_embedding(face_result['face'])dataset/
├── reference_faces/
│ ├── emp001/
│ │ ├── image1.jpg
│ │ └── image2.jpg
│ └── emp002/
│ └── image1.jpg
├── train/
│ ├── images/
│ └── labels.csv
└── test/
└── images/
detector_config = {
'scale_factor': 1.1,
'min_neighbors': 5,
'min_size': (30, 30),
'max_size': (300, 300)
}matcher_config = {
'similarity_threshold': 0.6,
'aggregation_method': 'mean',
'min_faces_per_employee': 1
}- Processing Speed: ~0.1-0.2 seconds per image on CPU
- Memory Usage: ~100-200MB for full pipeline
- Face Detection Rate: ~50-70% on surveillance-quality images
Trade-offs:
- Fast setup with no model downloads
- Low resource usage - works on basic hardware
- Deterministic results
- Lower accuracy than deep learning approaches
- Sensitive to lighting conditions
python tests/run_tests.pyTest suite covers:
- Face detection functionality
- Embedding generation
- Similarity matching
- Pipeline integration
RecognAIze/
├── src/face_recognition/
│ ├── detection/ # Face detection module
│ ├── embedding/ # Feature extraction
│ ├── inference/ # Similarity matching and pipelines
│ └── utils/ # Utilities and data loading
├── tests/ # Unit tests
├── main.py # Entry point
├── validate_system.py # Validation utilities
└── optimize_system.py # Hyperparameter optimization
This is a traditional computer vision approach designed for educational purposes and rapid prototyping. For production security systems, consider:
- Deep learning models (FaceNet, ArcFace, VGGFace2)
- Advanced detection (MTCNN, RetinaFace)
- GPU acceleration for batch processing
MIT License - see LICENSE for details.