> ## Documentation Index
> Fetch the complete documentation index at: https://docs.waveyhq.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Motion and Activity Detection Using WiFi CSI

> Detect motion via variance thresholds and classify human activities through three generations of CSI-based HAR, from physics-linked models to dual-stream transformers.

Movement is the strongest signal in WiFi CSI. Limb acceleration creates broadband energy in the 1–5 Hz band, variance spikes across subcarriers, and channel changes within a single packet window. Wavey detects that something moved with a simple threshold, and supports coarser activity classification where labeled data from the deployment environment justifies a classifier.

## From motion to activity

**Motion detection** is a threshold on variance or spectral power — binary, fast, and environment-agnostic within a single deployment.

**Human activity recognition (HAR)** has three generations in the published literature. Each generation trades model complexity against cross-environment robustness.

<Accordion title="Generation 1: physics-linked models (CARM, MobiCom 2015)">
  Before deep learning dominated, CARM built quantitative models:

  * **CSI–speed** — amplitude change frequency maps to limb speed via Doppler (path-length change of one wavelength = 2π phase shift).
  * **CSI–activity** — activities differ by which body parts move at which speeds (legs periodic in walking, torso impulse in falling).

  Features: PCA denoising, discrete wavelet transform, HMM per activity for state transitions. Greater than 96% on COTS WiFi using **amplitude**, not phase — CFO on commodity hardware makes raw phase unusable for macro-motion HAR. Still a strong baseline because features encode mechanism, not just correlation.
</Accordion>

<Accordion title="Generation 2: spectrogram CNNs">
  STFT tiles (time × frequency) fed to CNNs. Learns motion textures without explicit speed models. Works when you have labels; brittle cross-room without adaptation.
</Accordion>

<Accordion title="Generation 3: dual-stream transformers (THAT, AAAI 2021)">
  CSI has two informative axes:

  | Stream            | What it captures                      | Missed by LSTM-only |
  | ----------------- | ------------------------------------- | ------------------- |
  | Channel-over-time | How each subcarrier evolves           | —                   |
  | Time-over-channel | Subcarrier correlation at one instant | Yes                 |

  THAT's Multi-scale Convolution Augmented Transformer (MCAT) processes both streams with Gaussian range encoding. +2.2 pts accuracy over ABLSTM, 1.8–3.4× faster — because a single temporal sample is too elementary to represent a CSI pattern.
</Accordion>

## The cross-room transfer problem

CrossSense (MobiCom 2018) showed gesture recognition accuracy collapse from greater than 90% in-room to approximately 20% cross-site with a single global model. Their fix: a **roaming model** that synthesizes target-environment training data from a small calibration set, plus a **mixture-of-experts** runtime selector (DTW-based) that routes signals to specialized models.

Separately, the EI framework (MobiCom 2018) uses adversarial training — feature extractor vs domain discriminator — to strip environment-specific information before classification.

Without one of these (or per-site fine-tuning), do not deploy a model trained elsewhere. See the [sensing pipeline](/concepts/sensing-pipeline) for the full adaptation landscape.

## What Wavey targets

Wavey emits motion events (intensity, duration) as the primary output. Coarse activity classes are supported where labeled data from the deployment environment justifies a classifier. Multi-person 3D pose (CVPR 2024: approximately 92–125 mm joint error with dense WiFi nodes in a 4×3.5 m rig) is research territory — not ESP32 territory. See the [detection ladder](/concepts/detection-ladder), rung 4.

For building a classifier from scratch, read [building an activity classifier on CSI](/posts/wifi-motion-detection-without-camera).

## Further Reading

<CardGroup cols={2}>
  <Card title="Detection Ladder" icon="stairs" href="/concepts/detection-ladder">
    HAR feasibility and limits
  </Card>

  <Card title="Security & Intrusion" icon="lock" href="/use-cases/security-intrusion-detection">
    Motion as a zone alarm
  </Card>

  <Card title="WiFi Motion Detection Without Camera" icon="book-open" href="/posts/wifi-motion-detection-without-camera">
    Building an activity classifier from scratch
  </Card>

  <Card title="Getting Started" icon="rocket" href="/getting-started">
    Set up your first Wavey deployment
  </Card>
</CardGroup>
