Computer Vision Β· Face Analysis

Face Mapping Lab

Real neural face mapping β€” 68-point landmarks, 478-point neural mesh, and a CCTV face-recognition system that tells the truth about tiny faces. Built by Usman Kalera.

68landmark points
478neural mesh points
17body pose keypoints
0fake results
478-point neural face mesh on three AI-generated faces

01 Β· Landmark detection

68-Point Face Mapping

Classic facial landmark detection with a neural 2D-FAN model β€” jaw, brows, eyes, nose and mouth mapped with a Delaunay mesh. Works on single faces and groups.

68 facial landmarks with Delaunay mesh on a single AI-generated face
Single face Β· 68 landmarks + Delaunay mesh
68 facial landmarks mapped on three faces in a group photo
Multi-face Β· 3 faces Γ— 68 landmarks
Per-frame 68-point tracking on video

02 Β· Dense 3D-style mesh

478-Point Neural Mesh

A dense β€œneurological-style” face mesh β€” 478 landmarks per face from a neural face-landmarker model, rendered as a glowing wireframe. Then tracked across every video frame.

478-point neural mesh wireframe over three AI-generated faces
478 points per face Β· neural mesh
Neural mesh tracked on video, frame by frame

03 Β· Beyond the face

Full-Body Pose + 3D Mesh

Face mapping is only the start. YOLOv8-pose maps 17 body keypoints β€” shoulders, elbows, wrists, hips, knees, ankles β€” and the 478-point neural mesh carries real depth (x, y, z), rendered here as a rotating 3D point cloud.

Full-body pose estimation: 17 amber keypoints and skeleton over a standing person
17/17 keypoints detected Β· avg confidence 0.97
β–Ά 478 landmarks in true 3D β€” rotating point cloud (x, y, z from the neural model)

Why it matters: pose unlocks gait analysis, fall detection and activity recognition β€” and 3D landmarks enable head-pose estimation and AR face filters. Same lab, bigger canvas.

04 Β· Real-world system

CCTV Face Recognition v2

A complete pipeline: YuNet detection β†’ tracking β†’ SachiEnhance β†’ SFace recognition β†’ best-frame selection β†’ quality gate. Tested honestly on night-vision CCTV frames.

CCTV software v2 interface: night-vision frame with detected face, best-frame verdict UNKNOWN flagged for review
Live system output β€” face detected at 32Γ—40 px, verdict: UNKNOWN β†’ flagged for human review

The honest test

← swipe to see full table β†’

TestSimilarityResult
Parking-lot frame (person too far)β€”0 faces detected β€” genuinely undetectable
Entrance frame, raw 32Γ—40 px face0.342UNKNOWN (threshold 0.40)
+ SachiEnhance (denoise + faithful SR)0.365UNKNOWN β€” improved, still below threshold
+ Real-ESRGAN (GAN hallucination)0.182WORSE β€” GAN invents fake identity details
Best-frame over 12-frame track0.365UNKNOWN β†’ flagged for review

Key finding: at 32 px, software can help a little β€” but it cannot invent missing identity. A good system says β€œI don’t know, a human should check” instead of guessing wrong. That honesty is the feature.

First CCTV test: face detected at entrance, similarity 0.34 UNKNOWN
First honest test β€” detection works, recognition correctly uncertain
CCTV frame with super-resolution enhancement applied to the detected face
Super-resolution enhancement pass

05 Β· The enhancement method

SachiEnhance v2

Sachi means β€œtruthful”. A faithful tiny-face enhancer for recognition: light denoise + FSRCNN super-resolution. No hallucination, no contrast tricks β€” because for recognition, pretty lies hurt and honest pixels help.

Side by side: blurry original 32px face crop versus super-resolved crop
Left: raw 32 px crop Β· Right: SachiEnhance output
Real-ESRGAN output on the tiny face: sharper but hallucinated plasticky features
What GANs do: sharper, but fake β€” similarity dropped to 0.182

What helped vs what hurt

← swipe to see full table β†’

TechniqueΞ” similarityVerdict
Light denoise + FSRCNN (SachiEnhance)+0.031βœ… helps β€” faithful only
Flip-averaged embeddings (TTA)small +βœ… helps
Best-frame over track+0.010βœ… helps slightly
Real-ESRGAN hallucinationβˆ’0.161❌ invents wrong identity
CLAHE contrast boostβˆ’0.111❌ amplifies noise
Enhancing the enrollment photovery βˆ’βŒ never enhance clean references
CCTV frame processed with SachiEnhance v2 pipeline
SachiEnhance v2 full pipeline output

06 Β· Lab tests & proofs

Stress-Tested, On Video

Real benchmark runs, not claims. YuNet detection was stress-tested against blur, noise and distance β€” and the full pipeline was timed on CPU. Watch the live execution.

β–Ά Live execution record β€” the actual benchmark run, unedited
12-panel robustness proof: face detection under increasing blur, noise and simulated distance, with detection boxes
Blur (k=0–21) Β· Noise (Οƒ=0–60) Β· Distance (573–51 px) β€” green = detected
Charts: detection rate under stress and per-stage pipeline speed in milliseconds
Detection rate: blur 100% Β· noise 60% Β· distance 100% β€” pipeline 2.9 FPS on CPU

Benchmark results

← swipe to see full table β†’

Stress testResultLimit found
Gaussian blur k = 0 β†’ 21βœ… 6/6 detectedNone β€” detected even at extreme blur
Gaussian noise Οƒ = 0 β†’ 60βœ… 3/5 detectedFails at Οƒ β‰₯ 40
Simulated distance (face 573 β†’ 51 px)βœ… 5/5 detectedDetected down to 51 px wide
YuNet detect (CPU)216.4 msFull pipeline: 347.7 ms
= 2.9 FPS on CPU
SFace embedding36.7 ms
Denoise83.0 ms
FSRCNN Γ—4 super-resolution11.6 ms

Honest note: detection is tougher than it looks here β€” recognition (telling who) is the harder problem, as the CCTV tests above show. Detection = β€œa face is there”; recognition = β€œwhose face”.

Biometric accuracy: genuine vs impostor

Same person (with rotation, brightness, blur, downscale changes) vs different people β€” scored by SFace. The ranges overlap: no perfect threshold exists, which is exactly why the quality gate matters.

Scatter chart: genuine scores 0.23-0.92 versus impostor scores 0.13-0.34, overlapping near the 0.40 threshold
Genuine 0.23–0.92 Β· Impostor 0.13–0.34 Β· overlap zone = hard cases
Occlusion test: original face, eyes blacked out, mouth blacked out
Occlusion test β€” eyes hidden: 0.77 Β· mouth hidden: 0.96 (still recognized!)

← swipe to see full table β†’

ConditionSimilarityReading
Rotation Β±5Β°0.92 / 0.31⚠️ asymmetric β€” direction matters to SFace
Rotation ±10°0.27 / 0.72❌ beyond ±5° is unreliable
Darkened βˆ’300.23❌ poor lighting breaks it
Brightened +300.89βœ… fine
Heavy blur0.82βœ… fine
4Γ— downscale0.30❌ tiny faces fail (the CCTV problem)
Eyes hidden0.77βœ… surprisingly robust
Mouth hidden0.96βœ… barely affected

Landmark accuracy: repeatability test

Same face, 12 variants (rotation, brightness, blur, noise, JPEG, downscale) β€” how far do the 68 points wander? Mean drift β‰ˆ 9 px on a 1024-px image; the model is fully deterministic (clean repeat = 0.00 px). Jawline and brow points drift most.

Heatmap of 68 facial landmarks colored by drift in pixels
Per-landmark drift heatmap β€” red = stable, yellow = drifts

← swipe β†’

VariantMean driftMax drift
Rotation Β±5Β°8.5 px20.8 px
Brightness Β±209.0 px38.0 px
Blur k=7/157.6 px19.0 px
Noise Οƒ=158.1 px17.0 px
JPEG q=50/2011.1 px39.1 px
3Γ— downscale10.6 px42.1 px
Clean repeat0.00 px0.00 px

Detection check (YuNet): found the face at every blur and noise level. Score held 0.48–0.67 β€” but the box wanders under heavy blur (IoU 1.00 β†’ 0.22), so alignment quality drops before detection fails.

08 Β· Live training

Face-ID training, for real

Not a mockup β€” a real classifier trained in this lab: 5 identities Γ— 30 augmented samples (rotation, brightness, blur, flip) β†’ 128-dim SFace embeddings β†’ SVC. Train/test split 80/20.

Confusion matrix: 38 of 38 test samples classified correctly
Confusion matrix β€” 38/38 correct (100%) on held-out test set
β–Ά Live inference β€” the trained model IDs faces in real frames (5/5 correct)

Honest scope: 100% is on augmented variants of the same base photos β€” it proves robustness to imaging changes, not new-photo generalization. And one identity (a 32-px CCTV face) couldn't even be enrolled β€” the detector found nothing to train on. That failure is the finding.

09 Β· Open code

Run it yourself

Two small Python modules. Models download automatically from public sources (YuNet, SFace, FSRCNN).

cctv_software.py

Full v2 system: enroll β†’ identify_frame β†’ identify_track with quality gate.

from cctv_software import CCTVFaceRecognition
s = CCTVFaceRecognition()
s.enroll("person-1", clean_photo)
print(s.identify_frame(cctv_frame))
# (None, 0.365, 0.63, 'UNKNOWN -> flag for review')
print(s.identify_track(frames_12))

sachi_enhance.py

The faithful enhancer in 10 lines.

def sachi_enhance(crop):
    d = cv2.fastNlMeansDenoisingColored(
        crop, None, 4, 4, 7, 21)
    return sr_model().upsample(d)  # FSRCNN x4

Note: all faces shown are AI-generated test faces, never a real person’s photo. The pipeline works on any face image or video.