ADR-027: Project MERIDIAN — Cross-Environment Domain Generalization for WiFi Pose Estimation #68
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The Problem: WiFi Models Break When You Move Them
Train a WiFi pose estimation model in your living room -- it works great. Move it to the kitchen -- accuracy drops 40-70%. Deploy it in a different building -- it fails completely.
This is the domain gap problem, and it is the single biggest barrier to real-world WiFi sensing deployment.
Why it happens
Every room has a unique WiFi "personality":
The current wifi-densepose system trains and evaluates in a single environment. There is zero mechanism to handle new rooms, new buildings, or mixed hardware.
The Solution: Project MERIDIAN (ADR-027)
Multi-Environment Robust Inference via Domain-Invariant Alignment Networks
MERIDIAN adds a domain generalization layer to the existing pipeline. The core idea: explicitly separate what the model knows about the room from what it knows about the person.
The model is trained to maximize confusion about which room the data came from (adversarial training), while minimizing pose error. This forces it to learn environment-agnostic human motion features.
What MERIDIAN Adds (6 New Modules)
1. Hardware Normalizer (
hardware_norm.rs)Resamples any WiFi hardware CSI to a canonical 56-subcarrier format. ESP32 (64 sub), Intel 5300 (30 sub), Atheros (56 sub) all produce identical input shape.
Uses Catmull-Rom cubic interpolation + z-score normalization + phase sanitization.
2. Domain Factorizer + Gradient Reversal (
domain.rs)Splits the neural network internal representation into two paths:
A Gradient Reversal Layer (GRL) trains the pose path to be maximally confusing to a room classifier -- forcing it to drop all room-specific shortcuts.
3. Geometry Encoder + FiLM Conditioning (
geometry.rs)Enables zero-shot deployment: tell the model where the WiFi APs are located, and it adjusts its coordinate frame automatically. No retraining needed.
Uses Fourier positional encoding + permutation-invariant DeepSets + Feature-wise Linear Modulation (FiLM).
4. Virtual Domain Augmentation (
virtual_aug.rs)Generates synthetic "virtual rooms" during training by simulating:
Each training batch sees 4x more environment diversity than real data alone.
5. Few-Shot Rapid Adaptation (
rapid_adapt.rs)10 seconds of WiFi data in a new room produces automatic environment-specific fine-tuning. No pose labels needed.
Combines SONA LoRA adapters (ADR-005) with contrastive test-time training from AETHER (ADR-024).
6. Cross-Domain Evaluation (
eval.rs)Rigorous 6-metric evaluation protocol following PerceptAlign methodology:
How It Compares
MERIDIAN key differentiator: it is additive (small modules on top of existing pipeline), edge-compatible (+12K parameters, 67K total, still fits ESP32), and the first open-source WiFi pose system with cross-environment generalization.
Gap Closure: Proposed ADRs Addressed
MERIDIAN also closes gaps from 10 earlier proposed ADRs (002-011):
Model Size Impact
SOTA Research Foundation
MERIDIAN draws from 10 peer-reviewed papers (2024-2026):
Implementation Status
hardware_norm.rsdomain.rsgeometry.rsvirtual_aug.rsrapid_adapt.rseval.rsBranch:
adr-027-cross-environment-domain-generalizationFull ADR:
docs/adr/ADR-027-cross-environment-domain-generalization.mdQuick Start (After Merge)
ADR-027 Project MERIDIAN — Implementation Status
✅ Complete — All 7 Phases Implemented & Published
All six core modules plus the full training pipeline integration are implemented, tested, security-hardened, and published to crates.io.
Modules Delivered
domain.rsAdversarialSchedule(linear / exponential / cosine)domain.rsDomainFactorizerfor multi-factor decompositiongeometry.rseval.rsvirtual_aug.rsrapid_adapt.rsSecurity Audit — All Findings Resolved
AdaptError::InvalidRankerror returnadapt()panics → returnsResult<AdaptationResult, AdaptError>room_scaleguardTest Results
Published Artifacts
core,config,db,signal,nn,api,hardware,mat,train,ruvector,wasm,vitals,wifiscan,sensing-server,cliDocumentation
docs/adr/PR Ready to Merge
PR #69 — feat: ADR-027 MERIDIAN cross-environment domain generalization (all 7 phases)
adr-027-cross-environment-domain-generalizationThis issue can be closed once PR #69 is merged.