Occupant cognition · hazard fusion · forensic ledger
A real-time cognitive–motor threat surface mapped from facial micro-dynamics, then collapsed into dual, non-commuting alert manifolds—fatigue versus visual escape from the forward field.
Canonical entry: https://dms.aher.dev/
Split-brain topology
Raw photons never leave the observation plane: inference stays on the
local capture stratum. Only collapsed statistics—aspect ratios, pose
cosines, iris-offset fields—cross the trust boundary on a
versioned binary telemetry envelope
(metrics_batch v1), keyed by session UUID and stamped with client monotonic
time.
Upstream sits an async ASGI control plane with lifecycle-gated schema
materialization: SQLAlchemy 2.0 declarative models, idempotent
create_all bootstrap, and a write path that treats trips as
first-class causal traces—not logfiles. Persistence is
PostgreSQL over an async wire with negotiated TLS; offline / lab runs can
snap to embedded SQLite without touching application code.
Perception substrate
- Dense facial mesh with refined iris loci: hundreds of landmarks per frame, pentadic iris topology, per-frame scalarization into six-point EAR / MAR analogs—feeds that behave like neuro-muscular strain gauges on eyelid compliance and mandible aperture.
- Head pose as rigid-body hack: iterative perspective-n-point on a canonical cranial rig, Rodrigues rotation unwrapped to Euler priors; if the photogrammetry stack is unavailable, a deterministic geometric fallback keeps the pipeline from collapsing into NaNs.
-
Attention lattice: iris displacement normalized against palpebral fissure extrema,
fused with pose priors into a discrete
gaze_regioncodebook—forward, lateral mirror bands, ventral fixation (lap / stack), off-boresight drift.
Inference & policy
- RollingSignalBuffer: server-monotonic deques, sliding temporal aperture (~30 s effective memory at nominal batch cadence). Inside: EAR dominance mass, MAR excursion counts, pitch swing as micro-sleep / nod proxy.
- Dual non-commuting alert channels: (a) a semantic synthesis head—natural-language alerts from fused feature summaries, with SHA-256–keyed snapshot deduplication so the model cannot thrash on duplicate latent states; (b) a parallel DistractionMonitor with speed-gated hysteresis, region-majority voting, and orthogonal cooldown namespaces so visual escape and somnolence cannot starve each other.
- Lattice fallback: if the high-level policy path is cold, a deterministic severity quantizer takes over—same thresholds used in offline A/B against fixed EAR floors in the benchmark harness.
Data plane
Trips mirror session identity one-to-one: bounded route_json polylines, odometer from
speed–time quadrature, monotonic alert counters, append-only alert ledger for
post-hoc reconstruction—what fired, when, under which reasoning code. Read models expose cursorable trip lists and per-trip
timelines for anything downstream that cares about liability graphs or fleet replay.
Hardening
The service layer is pinned on a modern Python runtime, ASGI-native workers, and co-located static delivery so the capture UI and the policy engine share origin—no cross-site identity theater, no split certificate stories for the live feed.
Disclaimer
Research and demonstration artifact—not certified for ADAS, FMVSS, or clinical vigilance. No claim of crash avoidance or medical diagnosis. Gaze and fatigue estimates are heuristics; mount, optics, and population shift eat your lunch.