Overview
The face recognition feature provides:- Face Detection - Automatically locate faces in images and video frames
- Face Encoding - Generate 128-dimensional feature vectors for each face
- Similar Face Search - Find faces similar to a reference face across the case
- Video Support - Process video thumbnails for face detection
- GPU Optimization - Optimized to run efficiently without GPU requirements
Technology
IPED uses the Face Recognition library built on dlib’s state-of-the-art face recognition:- dlib - C++ machine learning library
- face_recognition - Python wrapper with simple API
- OpenCV - Image processing operations
- NumPy - Numerical computing for feature vectors
Configuration
Face recognition is configured inFaceRecognitionConfig.txt:
Face Detection Models
HOG (Histogram of Oriented Gradients)
Recommended for CPU processing- Fast execution on CPU
- Good accuracy for frontal faces
- Lower memory usage
- Handles standard lighting conditions
CNN (Convolutional Neural Network)
Recommended for GPU processing- Higher accuracy
- Better with various angles and lighting
- Detects partially occluded faces
- Requires GPU for acceptable speed
Implementation
The face recognition task is implemented as a Python script integrated into IPED’s processing pipeline:Initialization
Processing Flow
Face Attributes
Detected faces stored as item extra attributes:face_count
Number of faces detected in the image.face_locations
Bounding box coordinates for each face (top, right, bottom, left).face_encodings
128-dimensional feature vectors for similarity comparison.External Process Architecture
IPED uses external Python processes for face recognition:Benefits
- Stability - Crashes don’t affect main IPED process
- Parallelism - Multiple processes for concurrent processing
- Resource isolation - Memory leaks contained
- Process reuse - Avoid model reload overhead
Process Communication
Communication via stdin/stdout:- Ping/pong mechanism verifies process alive
- Automatic restart if process crashes
- Error logging for debugging
Similar Face Search
The analysis interface provides face search functionality:From Image Viewer
- Right-click on detected face
- Select “Search Similar Faces”
- Adjust similarity threshold slider
- View results ranked by similarity
From External Image
- Tools menu → Face Search
- Select reference image containing face
- Set similarity threshold
- Search entire case for matches
Similarity Calculation
Based on Euclidean distance between 128D encodings:- 0.3 - Very strict, same person in similar conditions
- 0.4 - Strict, likely same person
- 0.6 - Default, good balance (recommended)
- 0.8 - Relaxed, may include similar-looking people
Performance Optimization
Image Downscaling
Large images automatically downscaled:- Faster processing
- Reduced memory usage
- Minimal accuracy impact
Process Pooling
- Reuses Python processes
- Avoids model reload overhead
- Balances parallelism vs. memory
Result Caching
- Duplicate files processed once
- In-memory cache for fast access
- Significant speedup for duplicates
Video Support
Face recognition works on video files via thumbnails:- Requires video thumbnail generation enabled
- Processes representative frame
- Detects faces in thumbnail image
Installation Requirements
Required Python packages:- CMake - For compiling dlib
- C++ compiler - GCC/Clang or Visual Studio
- CUDA (optional) - For GPU acceleration
Use Cases
Person of Interest Search
Find all images containing a specific individual:- Identify reference image with target person
- Run similarity search
- Review ranked results
- Bookmark matches for export
Victim Identification
Locate victims in CSAM investigations:- Compare against known victim database
- Identify co-occurrences
- Build victimology timeline
Suspect Association
Map relationships:- Find images showing multiple suspects together
- Identify unknown associates
- Build network diagrams
Social Media Analysis
Analyze social media content:- Identify persons in photos
- Track presence across platforms
- Timeline of appearances
Limitations
Detection Challenges
- Extreme angles - Profile views harder than frontal
- Poor lighting - Underexposed or overexposed faces
- Occlusion - Masks, sunglasses reduce accuracy
- Low resolution - Faces smaller than minSize ignored
- Motion blur - Blurry faces may not detect
Search Limitations
- Age progression - Significant aging affects similarity
- Facial hair - Beards/mustaches impact matching
- Cosmetics - Heavy makeup changes features
- Image quality - Low quality reduces accuracy
Troubleshooting
No Faces Detected
- Check minimum image size (width/height > minSize)
- Verify faces are clearly visible
- Try increasing upSampling parameter
- Switch to ‘cnn’ model for better detection
Slow Processing
- Reduce maxResolution for faster processing
- Use ‘hog’ instead of ‘cnn’ model
- Decrease upSampling value
- Increase numFaceRecognitionProcesses
High Memory Usage
- Reduce numFaceRecognitionProcesses
- Lower maxResolution
- Process videos as subitems to reduce memory
Process Crashes
- Check Python environment compatibility
- Verify numpy version less than 2.0
- Review error logs for stack traces
- Restart with fewer parallel processes