-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
ADR-036: RVF Model Training Pipeline & UI Integration
Status: Proposed | Date: 2026-03-02
Context
The system currently operates in signal-derived mode — keypoints are computed from aggregate CSI features (motion power, breathing rate, variance) using deterministic math. This gives whole-body presence and gross motion but cannot track individual limbs.
The infrastructure for model inference exists but is disconnected:
- RVF container format (1,102 lines) — binary format with weights, metadata, LoRA profiles, embeddings, witness trails
- Training crate — AdamW, PCK@0.2/OKS metrics, LR scheduling, early stopping, checkpoint export
- NN inference crate — ONNX Runtime with CPU/GPU, dynamic tensors, thread-safe backend
- Sensing server CLI —
--model,--train,--pretrainflags exist but end-to-end path not wired
Decision — 5 Phases
Phase 1: Data Collection & Self-Supervised Pretraining
- CSI Recording API: REST endpoints to start/stop/list/download
.csi.jsonlrecordings - Contrastive Pretraining (ADR-024): Self-supervised NT-Xent loss → 128-dim CSI embedding, no labels needed
- Output:
.rvfwithSEG_EMBED+SEG_VECsegments
Phase 2: Supervised Training Pipeline
- Dataset Integration: MM-Fi (114→56 subcarrier interpolation) + Wi-Pose (30→56 zero-pad) + self-collected
- Training API: REST + WebSocket streaming of loss curves, PCK, OKS, early stopping
- RVF Export: Auto-export best checkpoint as
.rvfwith manifest + witness
Phase 3: LoRA Environment Adaptation
- Fine-tune LoRA adapter weights (rank 4-16) on environment-specific recordings
- 5-10 minutes of data from new room suffices
- Hot-swap profiles without reloading base model
Phase 4: UI Integration
| Component | Description |
|---|---|
| Model Panel | Model library, inspector, load/unload, LoRA profile selector |
| Training Panel | Recording controls, live loss/PCK charts, epoch table, early stopping indicator |
| Live Demo Enhancements | Model selector dropdown, LoRA profile switcher, A/B split view (signal vs model), pose trail |
| Settings Extensions | Model config (device, threads, auto-load), training config (epochs, LR, patience) |
| Dark Mode | All new panels match existing dark theme |
Phase 5: Inference Pipeline Wiring
- CSI frame → amplitude/phase tensors → ONNX session → Kalman smoothing → WebSocket
- Progressive Loading: Layer A (instant signal-derived) → Layer B (embeddings) → Layer C (full model)
pose_source: "model_inference"badge switches automatically
Implementation Order
| Phase | Effort | Priority |
|---|---|---|
| 1.1 CSI Recording API | 2-3 days | High |
| 1.2 Contrastive Pretraining | 3-5 days | High |
| 2.1 Dataset Integration | 3-5 days | High |
| 2.2 Training API | 2-3 days | High |
| 2.3 RVF Export | 1-2 days | Medium |
| 3.1 LoRA Fine-Tuning | 3-5 days | Medium |
| 3.2 Profile Switching | 1 day | Medium |
| 4.1 Model Panel UI | 2-3 days | High |
| 4.2 Training Dashboard UI | 3-4 days | High |
| 4.3 Live Demo Enhancements | 2-3 days | Medium |
| 5.1 Inference Wiring | 3-5 days | High |
| 5.2 Progressive Loading | 2-3 days | Medium |
Total: ~4-6 weeks (phases parallelizable)
Files
New
ui/components/ModelPanel.js— Model library & inspectorui/components/TrainingPanel.js— Recording + training progressui/services/model.service.js— Model API clientui/services/training.service.js— Training API clientsensing-server/src/recording.rs— CSI recording handlerssensing-server/src/training_api.rs— Training API + WS progresssensing-server/src/model_manager.rs— Model loading & LoRA
Modified
sensing-server/src/main.rs— Wire new modules, inference branchtrain/src/trainer.rs— WS progress callback, LoRA modetrain/src/dataset.rs— MM-Fi + Wi-Pose loadersnn/src/onnx.rs— LoRA injection, INT8 quantizationui/components/LiveDemoTab.js— Model selector, A/B splitui/components/SettingsPanel.js— Model/training config + dark modeui/components/PoseDetectionCanvas.js— Pose trailui/index.html— Training tabui/app.js— Tab initializationui/style.css— New panel styles
References
- ADR-036 full text
- ADR-015: MM-Fi + Wi-Pose datasets
- ADR-016: RuVector training pipeline
- ADR-024: AETHER contrastive embeddings
- ADR-035: Live sensing UI accuracy
- Settings panel still uses light theme — convert to dark mode #92 Settings dark mode
- Branch:
feat/rvf-training-ui-improvements
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
