Expand description
Profile Asymmetry Ratio (PAR) — geometric lock against 2D rigid planes.
§Critical trap: never trust model Z
MediaPipe (and similar) infer depth from a monocular 2D image using statistical priors. A flat iPad showing a face will yield a “perfect” hallucinated mesh Z. Validating on model Z lets the attack pass.
This module uses only raw image-space (x) coordinates of three landmarks (MediaPipe Face Mesh indices):
| Role | Slot | MediaPipe index |
|---|---|---|
| Nose tip (N) | PadLandmarkId::NoseTip | 1 |
| Left edge (L) | PadLandmarkId::LeftCheek | 234 |
| Right edge (R) | PadLandmarkId::RightCheek | 454 |
§Math
[ d_L = \lvert x_N - x_L\rvert,\quad d_R = \lvert x_R - x_N\rvert,\quad PAR = d_L / d_R ]
At frontal (t_0): (PAR \approx 1). At peak yaw (t_1): a true 3D head produces a large (|PAR(t_1)/PAR(t_0) - 1|) (occlusion spike). A flat mask scales both sides by (\cos\theta), so (\Delta PAR \approx 0).
Require (|\Delta yaw| \ge 25^\circ) so the spike is unambiguous. Baseline PAR at (t_0) is normalized before the delta (human faces are asymmetric).
Structs§
- ParSample
- Horizontal distances and PAR from (x) only (y and model Z ignored).
Enums§
Constants§
- DEFAULT_
PAR_ TAU - Default (\tau): minimum baseline-normalized (|\Delta PAR|) for live 3D. Empirical; calibrate in MANIFEST for production yaw policy.
- MIN_
PAR_ SAMPLES - Minimum frames with valid N/L/R (x).
- MIN_
YAW_ SPAN_ DEG - Minimum absolute yaw span (degrees) between frontal and peak for a valid test.
Functions§
- evaluate_
profile_ asymmetry - Evaluate PAR geometric lock over a landmark + pose trajectory.
- normalized_
par_ delta - Baseline-normalized absolute delta: (|PAR(t_1)/PAR(t_0) - 1|).
- profile_
asymmetry_ ratio - (d_L = |x_N - x_L|), (d_R = |x_R - x_N|), (PAR = d_L / d_R).