Level 0: variance threshold
Compute subcarrier variance over a 1-second sliding window. If variance exceeds a threshold tuned on empty-room data, declare motion. No labels needed. No ML framework needed. This is occupancy and motion detection, not activity recognition. But it is the foundation every classifier builds on, and it should work before you add complexity.Level 1: handcrafted features + classical classifier
The CARM baseline (MobiCom 2015) is still worth implementing before a CNN:- PCA denoising on amplitude (subcarrier correlations from body motion; impulse noise rejection)
- Discrete wavelet transform features
- CSI–speed model linking amplitude change frequency to limb speed
- HMM per activity for state transitions
- Mean and variance of amplitude across subcarriers
- Spectral energy in 1–5 Hz band (from FFT of the amplitude time series)
- Correlation between adjacent subcarriers
- Entropy of the amplitude distribution
Level 2: spectrogram + CNN
Convert each window to a spectrogram: STFT of the amplitude (or sanitized phase) time series per subcarrier, or a 2D tile of (time × subcarrier) with color = amplitude:The label collection problem
WiFi HAR has no ImageNet. Labels come from:- Manual annotation — a person performs activities on a schedule; you align timestamps with CSI recordings.
- Video-assisted labeling — a camera in the room (during training only) provides activity labels synced to CSI. Person-in-WiFi and MM-Fi (320k frames, 5 modalities, 40 subjects, 27 actions) use this pattern: rich supervision during training, WiFi-only at deployment.
- Self-supervised pretext tasks — predict future CSI, contrastive learning on augmented windows. Research direction; not yet plug-and-play.
Why transfer fails and what to do
A model trained in Room A fails in Room B because the static channel H(f) is different. Motion is measured as perturbation on top of that static channel. The CNN learns “what walking looks like in Room A’s multipath,” not “what walking looks like in general.” Mitigations, in order of practicality:- Collect labels in the target room. Best accuracy, highest cost.
- Fine-tune the last layers on 10–20 examples per class from the target room.
- Roaming synthesis — train an offline model on source + target calibration data; synthesize target-site CSI for fine-tuning. CrossSense boosted cross-site gesture accuracy from ~20% to >90%.
- Adversarial environment stripping — feature extractor vs domain discriminator minimax (EI framework).
- Consensus adversarial adaptation — source and target encoders align to shared invariant space (CADA).
- Baseline subtraction before classification — remove the static channel so the model sees perturbation only. Helps, but does not fully solve shift.
Evaluation discipline
- Split by session, not by window. Random window splits leak temporal correlation and inflate accuracy.
- Report per-environment accuracy. In-room and cross-room numbers tell different stories.
- Measure latency. Spectrogram + CNN on a Raspberry Pi host should run in < 100 ms per window for real-time use.
Further reading
Sensing Pipeline
Preprocessing steps before the classifier sees data.
Detection Ladder
Where human activity recognition sits on the feasibility scale.
Motion Detection
Use-case framing for motion and activity detection with Wavey.
