Face Comparison
Compare two face images to determine if they belong to the same person. Uses AI-powered face recognition running entirely in your browser — no data is sent to any server.
Input
Output
Readme
How does facial recognition work?
Facial recognition is a type of biometric technology that identifies or verifies a person by analyzing the unique features of their face. Modern face recognition systems work by detecting a face in an image, mapping key facial landmarks (such as the distance between the eyes, the shape of the jawline, and the position of the nose), and converting those measurements into a numerical representation called a face descriptor or embedding. This compact vector captures the essence of a face's geometry in a way that can be compared mathematically against other descriptors.
When two face descriptors are compared, the system calculates the Euclidean distance between them — a measure of how far apart the two vectors are in high-dimensional space. A small distance indicates high similarity, suggesting the faces likely belong to the same person, while a large distance suggests different individuals. A configurable threshold determines the cutoff between a match and a non-match.
Tool description
This tool lets you compare two face photos side by side to determine whether they belong to the same person. It uses a pre-trained deep learning model (SSD MobileNet v1) for face detection and a dedicated face recognition network to generate 128-dimensional face descriptors. The entire process — from model loading to face detection and comparison — runs locally in your browser using WebGL acceleration. No images or data are ever uploaded to a server, making it a fully private face verification tool.
How it works
- Model loading — On first use, the tool downloads lightweight neural network models (face detector, landmark predictor, and recognition network) and caches them in the browser.
- Face detection — Each uploaded image is scanned using the SSD MobileNet v1 detector to locate a face and extract 68 facial landmarks.
- Descriptor extraction — The landmark-aligned face region is passed through a recognition network that produces a 128-dimensional descriptor vector.
- Distance calculation — The Euclidean distance between the two descriptors is computed. A distance below the threshold indicates a match; above it indicates different people.
- Visual feedback — Detected faces are highlighted with bounding boxes on both images, and the similarity percentage and raw distance are displayed.
Examples
| Scenario | Expected result |
|---|---|
| Two selfies of the same person taken on different days | High similarity (85–99%), match |
| Photo of person A vs. photo of person B | Low similarity (20–50%), no match |
| Same person with and without glasses | Usually still a match if the face is clearly visible |
| Same person at significantly different ages | May not match if facial structure changed substantially |
Features
- 100% browser-based — all processing happens locally using WebGL; no server uploads, no cloud APIs
- Adjustable match threshold — fine-tune sensitivity with a slider ranging from 0.1 to 1.0 (default: 0.6)
- Visual face detection overlay — bounding boxes are drawn around detected faces on both images
- Detailed metrics — displays both similarity percentage and raw Euclidean distance for transparency
- Multiple image formats — supports JPEG, PNG, and WebP uploads
Use cases
- Identity verification — quickly check whether two photos show the same individual, useful for document review or profile verification
- Photo organization — determine which photos in a collection belong to the same person before sorting them into albums
- Security auditing — compare a live photo against a reference image for access control or attendance confirmation
Options explained
| Option | Description | Default |
|---|---|---|
| Match threshold | Controls how strict the comparison is. Lower values require faces to be more similar to count as a match. Higher values are more lenient. | 0.6 |
A threshold of 0.6 works well for most cases. If you're getting false positives (different people marked as the same), lower the threshold. If you're getting false negatives (same person marked as different), raise it.
Limitations
- Only one face per image is analyzed. If an image contains multiple faces, only the most prominent one is detected.
- Very low-resolution images, heavy occlusion (masks, scarves), or extreme angles may prevent face detection.
- The model performs best on frontal or near-frontal face poses with adequate lighting.
- Initial model loading may take a few seconds depending on network speed and device performance.
- Results are probabilistic, not definitive — this tool is not suitable for legal or forensic identification.
FAQ
Is my data safe? Yes. The tool runs entirely in your browser. Your images are never uploaded to any server. All face detection and comparison logic executes locally using WebGL.
Why does it say "No face detected"? The image may be too small, too dark, heavily obscured, or taken from an extreme angle. Try a clearer, front-facing photo with good lighting.
What does Euclidean distance mean here? It's a numerical measure of how different two face descriptors are. Values closer to 0 indicate nearly identical faces; values above the threshold suggest different people.
Can I compare faces from different age groups? The tool can handle moderate age differences, but significant aging (e.g., child vs. elderly) may reduce accuracy since facial structure changes over time.