Skip to main content

Module profile_asymmetry_ratio

Module profile_asymmetry_ratio 

Source
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):

RoleSlotMediaPipe index
Nose tip (N)PadLandmarkId::NoseTip1
Left edge (L)PadLandmarkId::LeftCheek234
Right edge (R)PadLandmarkId::RightCheek454

§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§

ParVerdict

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).