ruv commited on
Commit
472cfbe
Β·
verified Β·
1 Parent(s): 15f152e

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +63 -83
README.md CHANGED
@@ -4,14 +4,17 @@ tags:
4
  - wifi-sensing
5
  - vital-signs
6
  - presence-detection
 
7
  - edge-ai
8
  - esp32
9
  - self-supervised
 
10
  - cognitum
11
  - through-wall
12
  - privacy-preserving
13
  - spiking-neural-network
14
  - ruvector
 
15
  language:
16
  - en
17
  library_name: onnxruntime
@@ -20,14 +23,15 @@ pipeline_tag: other
20
 
21
  # RuView β€” WiFi Sensing Models
22
 
23
- **Turn WiFi signals into spatial intelligence.** Detect people, measure breathing and heart rate, track movement, and monitor rooms β€” through walls, in the dark, with no cameras. Just radio physics.
24
 
25
  ## What This Does
26
 
27
- WiFi signals bounce off people. When someone breathes, their chest moves the air, which subtly changes the WiFi signal. When they walk, the changes are bigger. This model learned to read those changes from a $9 ESP32 chip.
28
 
29
  | What it senses | How well | Without |
30
  |----------------|----------|---------|
 
31
  | **Is someone there?** | 100% accuracy | No camera needed |
32
  | **Are they moving?** | Detects typing vs walking vs standing | No wearable needed |
33
  | **Breathing rate** | 6-30 BPM, contactless | No chest strap |
@@ -39,22 +43,35 @@ WiFi signals bounce off people. When someone breathes, their chest moves the air
39
 
40
  ## Benchmarks
41
 
42
- Validated on real hardware (Apple M4 Pro + 2x ESP32-S3):
43
-
44
  | Metric | Result | Context |
45
  |--------|--------|---------|
 
46
  | **Presence accuracy** | **100%** | Never misses, never false alarms |
47
  | **Inference speed** | **0.008 ms** | 125,000x faster than real-time |
48
  | **Throughput** | **164,183 emb/sec** | One laptop handles 1,600+ sensors |
49
- | **Contrastive learning** | **51.6% improvement** | Trained on 8 hours of overnight data |
50
- | **Model size** | **8 KB** (4-bit quantized) | Fits in ESP32 SRAM |
51
- | **Training time** | **12 minutes** | On Mac Mini M4 Pro, no GPU needed |
52
- | **Camera required** | **No** | Trained from 10 sensor signals |
 
53
 
54
  ## Models in This Repo
55
 
56
- | File | Size | Use |
57
- |------|------|-----|
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  | `model.safetensors` | 48 KB | Full contrastive encoder (128-dim embeddings) |
59
  | `model-q4.bin` | 8 KB | **Recommended** β€” 4-bit quantized, 8x compression |
60
  | `model-q2.bin` | 4 KB | Ultra-compact for ESP32 edge inference |
@@ -63,12 +80,11 @@ Validated on real hardware (Apple M4 Pro + 2x ESP32-S3):
63
  | `node-1.json` | 21 KB | LoRA adapter for room/node 1 |
64
  | `node-2.json` | 21 KB | LoRA adapter for room/node 2 |
65
  | `config.json` | 586 B | Model configuration |
66
- | `training-metrics.json` | 3.1 KB | Loss curves and training history |
67
 
68
  ## Quick Start
69
 
70
  ```bash
71
- # Download models
72
  pip install huggingface_hub
73
  huggingface-cli download ruv/ruview --local-dir models/
74
 
@@ -81,90 +97,54 @@ python -m esptool --chip esp32s3 --port COM9 --baud 460800 \
81
  write_flash 0x0 bootloader.bin 0x8000 partition-table.bin \
82
  0xf000 ota_data_initial.bin 0x20000 esp32-csi-node.bin
83
 
84
- # Provision WiFi
85
- python firmware/esp32-csi-node/provision.py --port COM9 \
86
- --ssid "YourWiFi" --password "secret" --target-ip YOUR_IP
87
-
88
- # See what WiFi reveals about your room
89
- node scripts/deep-scan.js --bind YOUR_IP --duration 10
90
  ```
91
 
92
  ## Architecture
93
 
 
94
  ```
95
- WiFi signals β†’ ESP32-S3 ($9) β†’ 8-dim features @ 1 Hz β†’ Encoder β†’ 128-dim embedding
96
- ↓
97
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
98
- ↓ ↓ ↓
99
- Presence head Activity head Vitals head
100
- (100% accuracy) (still/walk/talk) (BR, HR)
 
 
101
  ```
102
 
103
- The encoder converts 8 WiFi Channel State Information (CSI) features into a 128-dimensional embedding:
104
-
105
- | Dim | Feature | What it captures |
106
- |-----|---------|-----------------|
107
- | 0 | Presence | How much the WiFi signal is disturbed |
108
- | 1 | Motion | Rate of signal change (walking > typing > still) |
109
- | 2 | Breathing | Chest movement modulates subcarrier phase at 6-30 BPM |
110
- | 3 | Heart rate | Blood pulse creates micro-Doppler at 40-120 BPM |
111
- | 4 | Phase variance | Signal quality β€” higher = more movement |
112
- | 5 | Person count | Independent motion clusters via min-cut graph |
113
- | 6 | Fall detected | Sudden phase acceleration followed by stillness |
114
- | 7 | RSSI | Signal strength β€” indicates distance from sensor |
115
-
116
- ## Training Details
117
-
118
- **No camera was used.** Trained using self-supervised contrastive learning:
119
-
120
- - **Data**: 60,630 samples from 2 ESP32-S3 nodes over 8 hours
121
- - **Method**: Triplet loss + InfoNCE (nearby frames = similar, distant = different)
122
- - **Augmentation**: 10x via temporal interpolation, noise, cross-node blending
123
- - **Supervision**: PIR sensor, BME280, RSSI triangulation, subcarrier asymmetry
124
- - **Quantization**: TurboQuant 2/4/8-bit with <0.5% quality loss
125
- - **Adaptation**: LoRA rank-4 per room, EWC to prevent forgetting
126
-
127
- ## 17 Sensing Applications
128
-
129
- Built on these embeddings ([RuView](https://github.com/ruvnet/RuView)):
130
-
131
- **Core:** Presence, person counting, RF scanning, SNN learning, CNN fingerprinting
132
-
133
- **Health:** Sleep monitoring, apnea screening, stress detection, gait analysis
134
-
135
- **Environment:** Room fingerprinting, material detection, device fingerprinting
136
-
137
- **Multi-frequency:** RF tomography, passive radar, material classification, through-wall motion
138
 
139
- ## Hardware
140
 
141
- | Component | Cost | Purpose |
142
- |-----------|------|---------|
143
- | ESP32-S3 (8MB) | ~$9 | WiFi CSI sensing |
144
- | [Cognitum Seed](https://cognitum.one) (optional) | $131 | Persistent storage, kNN, witness chain, AI proxy |
145
 
146
- ## Limitations
 
 
 
147
 
148
- - Room-specific (use LoRA adapters for new rooms)
149
- - Camera-free pose: 2.5% PCK@20 (camera labels improve significantly)
150
- - Health features are for screening only, not medical diagnosis
151
- - Breathing/HR less accurate during active movement
152
 
153
- ## Citation
154
 
155
- ```bibtex
156
- @software{ruview2026,
157
- title={RuView: WiFi Sensing with Self-Supervised Contrastive Learning},
158
- author={rUv},
159
- year={2026},
160
- url={https://github.com/ruvnet/RuView},
161
- note={Models: https://huggingface.co/ruv/ruview}
162
- }
163
- ```
164
 
165
  ## Links
166
 
167
- - **GitHub**: https://github.com/ruvnet/RuView
168
- - **Cognitum Seed**: https://cognitum.one
169
- - **RuVector**: https://github.com/ruvnet/ruvector
170
- - **License**: MIT
 
4
  - wifi-sensing
5
  - vital-signs
6
  - presence-detection
7
+ - pose-estimation
8
  - edge-ai
9
  - esp32
10
  - self-supervised
11
+ - camera-supervised
12
  - cognitum
13
  - through-wall
14
  - privacy-preserving
15
  - spiking-neural-network
16
  - ruvector
17
+ - wiflow
18
  language:
19
  - en
20
  library_name: onnxruntime
 
23
 
24
  # RuView β€” WiFi Sensing Models
25
 
26
+ **Turn WiFi signals into spatial intelligence.** Detect people, measure breathing and heart rate, estimate pose, track movement, and monitor rooms β€” through walls, in the dark, with no cameras. Just radio physics.
27
 
28
  ## What This Does
29
 
30
+ WiFi signals bounce off people. When someone breathes, their chest moves the air, which subtly changes the WiFi signal. When they walk, the changes are bigger. These models learned to read those changes from a $9 ESP32 chip.
31
 
32
  | What it senses | How well | Without |
33
  |----------------|----------|---------|
34
+ | **Pose estimation** | **92.9% PCK@20** (17 COCO keypoints) | No camera at deployment |
35
  | **Is someone there?** | 100% accuracy | No camera needed |
36
  | **Are they moving?** | Detects typing vs walking vs standing | No wearable needed |
37
  | **Breathing rate** | 6-30 BPM, contactless | No chest strap |
 
43
 
44
  ## Benchmarks
45
 
 
 
46
  | Metric | Result | Context |
47
  |--------|--------|---------|
48
+ | **Pose PCK@20** | **92.9%** | Camera-supervised WiFlow model (v0.7.0) |
49
  | **Presence accuracy** | **100%** | Never misses, never false alarms |
50
  | **Inference speed** | **0.008 ms** | 125,000x faster than real-time |
51
  | **Throughput** | **164,183 emb/sec** | One laptop handles 1,600+ sensors |
52
+ | **Model size (pose)** | **974 KB** | WiFlow lite, 189K params |
53
+ | **Model size (sensing)** | **8 KB** (4-bit quantized) | Fits in ESP32 SRAM |
54
+ | **Training time (pose)** | **19 minutes** | 5-min data collection + lite training |
55
+ | **Training time (sensing)** | **12 minutes** | On Mac Mini M4 Pro, no GPU needed |
56
+ | **Hardware cost** | **$9** | Single ESP32-S3 |
57
 
58
  ## Models in This Repo
59
 
60
+ ### WiFlow Pose Model (v0.7.0) β€” NEW
61
+
62
+ | File | Size | Description |
63
+ |------|------|-------------|
64
+ | `wiflow-v1/wiflow-v1.json` | 974 KB | **Camera-supervised pose model** β€” 92.9% PCK@20, 17 COCO keypoints |
65
+ | `wiflow-v1/training-log.json` | 13 KB | Loss curves per training phase |
66
+ | `wiflow-v1/baseline-report.json` | 1 KB | Pre-training baseline metrics |
67
+ | `wiflow-v1/MODEL_CARD.md` | 1 KB | Model documentation |
68
+
69
+ Trained on real ESP32 CSI (7,000 frames) + real webcam keypoints via MediaPipe (6,470 frames). 5-minute data collection, 19-minute training. See [ADR-079](https://github.com/ruvnet/RuView/blob/main/docs/adr/ADR-079-camera-ground-truth-training.md).
70
+
71
+ ### Contrastive Sensing Model (v0.6.0)
72
+
73
+ | File | Size | Description |
74
+ |------|------|-------------|
75
  | `model.safetensors` | 48 KB | Full contrastive encoder (128-dim embeddings) |
76
  | `model-q4.bin` | 8 KB | **Recommended** β€” 4-bit quantized, 8x compression |
77
  | `model-q2.bin` | 4 KB | Ultra-compact for ESP32 edge inference |
 
80
  | `node-1.json` | 21 KB | LoRA adapter for room/node 1 |
81
  | `node-2.json` | 21 KB | LoRA adapter for room/node 2 |
82
  | `config.json` | 586 B | Model configuration |
 
83
 
84
  ## Quick Start
85
 
86
  ```bash
87
+ # Download all models
88
  pip install huggingface_hub
89
  huggingface-cli download ruv/ruview --local-dir models/
90
 
 
97
  write_flash 0x0 bootloader.bin 0x8000 partition-table.bin \
98
  0xf000 ota_data_initial.bin 0x20000 esp32-csi-node.bin
99
 
100
+ # Train your own pose model (5 min data + 19 min training)
101
+ python scripts/collect-ground-truth.py --duration 300 --preview
102
+ python scripts/record-csi-udp.py --duration 300
103
+ node scripts/align-ground-truth.js --gt data/ground-truth/*.jsonl --csi data/recordings/*.csi.jsonl
104
+ node scripts/train-wiflow-supervised.js --data data/paired/*.jsonl --scale lite
 
105
  ```
106
 
107
  ## Architecture
108
 
109
+ ### WiFlow Pose Model
110
  ```
111
+ CSI amplitude [35, 20] (ruvector-selected subcarriers)
112
+ |
113
+ TCN: 2 dilated causal conv blocks (k=3, d=[1,2])
114
+ 35 -> 32 -> 32 channels
115
+ |
116
+ Flatten [640] -> FC [256] -> FC [34] -> Sigmoid
117
+ |
118
+ 17 COCO keypoints [x, y] in [0, 1]
119
  ```
120
 
121
+ ### Contrastive Sensing Model
122
+ ```
123
+ WiFi signals -> ESP32-S3 ($9) -> 8-dim features @ 1 Hz -> Encoder -> 128-dim embedding
124
+ |
125
+ Presence head (threshold 0.3) -> person/no-person
126
+ Activity head -> stationary/walking/typing
127
+ Vitals extraction -> breathing BPM, heart rate BPM
128
+ ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
 
130
+ ## Training Your Own Pose Model
131
 
132
+ The camera is only needed during a one-time 5-minute training session. After that, the model runs on CSI alone β€” no camera at deployment.
 
 
 
133
 
134
+ 1. **Collect** β€” Run `collect-ground-truth.py` + `record-csi-udp.py` simultaneously for 5 minutes
135
+ 2. **Align** β€” `align-ground-truth.js` pairs camera keypoints with CSI windows by timestamp
136
+ 3. **Train** β€” `train-wiflow-supervised.js` trains WiFlow with curriculum learning + bone constraints
137
+ 4. **Deploy** β€” Load `wiflow-v1.json` and run inference on CSI only
138
 
139
+ See the [v0.7.0 release](https://github.com/ruvnet/RuView/releases/tag/v0.7.0) for details.
 
 
 
140
 
141
+ ## License
142
 
143
+ MIT β€” see [LICENSE](https://github.com/ruvnet/RuView/blob/main/LICENSE)
 
 
 
 
 
 
 
 
144
 
145
  ## Links
146
 
147
+ - [GitHub](https://github.com/ruvnet/RuView)
148
+ - [v0.7.0 Release](https://github.com/ruvnet/RuView/releases/tag/v0.7.0)
149
+ - [ADR-079: Camera Ground-Truth Training](https://github.com/ruvnet/RuView/blob/main/docs/adr/ADR-079-camera-ground-truth-training.md)
150
+ - [Cognitum.one](https://cognitum.one)