Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a17b630

Browse files
committed
feat: Add wifi-densepose-mat disaster detection module
Implements WiFi-Mat (Mass Casualty Assessment Tool) for detecting and localizing survivors trapped in rubble, earthquakes, and natural disasters. Architecture: - Domain-Driven Design with bounded contexts (Detection, Localization, Alerting) - Modular Rust crate integrating with existing wifi-densepose-* crates - Event-driven architecture for audit trails and distributed deployments Features: - Breathing pattern detection from CSI amplitude variations - Heartbeat detection using micro-Doppler analysis - Movement classification (gross, fine, tremor, periodic) - START protocol-compatible triage classification - 3D position estimation via triangulation and depth estimation - Real-time alert generation with priority escalation Documentation: - ADR-001: Architecture Decision Record for wifi-Mat - DDD domain model specification
1 parent 0fa9a0b commit a17b630

31 files changed

Lines changed: 9042 additions & 0 deletions
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
# ADR-001: WiFi-Mat Disaster Detection Architecture
2+
3+
## Status
4+
Accepted
5+
6+
## Date
7+
2026-01-13
8+
9+
## Context
10+
11+
Natural disasters such as earthquakes, building collapses, avalanches, and floods trap victims under rubble or debris. Traditional search and rescue methods using visual inspection, thermal cameras, or acoustic devices have significant limitations:
12+
13+
- **Visual/Optical**: Cannot penetrate rubble, debris, or collapsed structures
14+
- **Thermal**: Limited penetration depth, affected by ambient temperature
15+
- **Acoustic**: Requires victim to make sounds, high false positive rate
16+
- **K9 Units**: Limited availability, fatigue, environmental hazards
17+
18+
WiFi-based sensing offers a unique advantage: **RF signals can penetrate non-metallic debris** (concrete, wood, drywall) and detect subtle human movements including breathing patterns and heartbeats through Channel State Information (CSI) analysis.
19+
20+
### Problem Statement
21+
22+
We need a modular extension to the WiFi-DensePose Rust implementation that:
23+
24+
1. Detects human presence in disaster scenarios with high sensitivity
25+
2. Localizes survivors within rubble/debris fields
26+
3. Classifies victim status (conscious movement, breathing only, critical)
27+
4. Provides real-time alerts to rescue teams
28+
5. Operates in degraded/field conditions with portable hardware
29+
30+
## Decision
31+
32+
We will create a new crate `wifi-densepose-mat` (Mass Casualty Assessment Tool) as a modular addition to the existing Rust workspace with the following architecture:
33+
34+
### 1. Domain-Driven Design (DDD) Approach
35+
36+
The module follows DDD principles with clear bounded contexts:
37+
38+
```
39+
wifi-densepose-mat/
40+
├── src/
41+
│ ├── domain/ # Core domain entities and value objects
42+
│ │ ├── survivor.rs # Survivor entity with status tracking
43+
│ │ ├── disaster_event.rs # Disaster event aggregate root
44+
│ │ ├── scan_zone.rs # Geographic zone being scanned
45+
│ │ └── alert.rs # Alert value objects
46+
│ ├── detection/ # Life sign detection bounded context
47+
│ │ ├── breathing.rs # Breathing pattern detection
48+
│ │ ├── heartbeat.rs # Micro-doppler heartbeat detection
49+
│ │ ├── movement.rs # Gross/fine movement classification
50+
│ │ └── classifier.rs # Multi-modal victim classifier
51+
│ ├── localization/ # Position estimation bounded context
52+
│ │ ├── triangulation.rs # Multi-AP triangulation
53+
│ │ ├── fingerprinting.rs # CSI fingerprint matching
54+
│ │ └── depth.rs # Depth/layer estimation in rubble
55+
│ ├── alerting/ # Notification bounded context
56+
│ │ ├── priority.rs # Triage priority calculation
57+
│ │ ├── dispatcher.rs # Alert routing and dispatch
58+
│ │ └── protocols.rs # Emergency protocol integration
59+
│ └── integration/ # Anti-corruption layer
60+
│ ├── signal_adapter.rs # Adapts wifi-densepose-signal
61+
│ └── nn_adapter.rs # Adapts wifi-densepose-nn
62+
```
63+
64+
### 2. Core Architectural Decisions
65+
66+
#### 2.1 Event-Driven Architecture
67+
- All survivor detections emit domain events
68+
- Events enable audit trails and replay for post-incident analysis
69+
- Supports distributed deployments with multiple scan teams
70+
71+
#### 2.2 Configurable Detection Pipeline
72+
```rust
73+
pub struct DetectionPipeline {
74+
breathing_detector: BreathingDetector,
75+
heartbeat_detector: HeartbeatDetector,
76+
movement_classifier: MovementClassifier,
77+
ensemble_classifier: EnsembleClassifier,
78+
}
79+
```
80+
81+
#### 2.3 Triage Classification (START Protocol Compatible)
82+
| Status | Detection Criteria | Priority |
83+
|--------|-------------------|----------|
84+
| Immediate (Red) | Breathing detected, no movement | P1 |
85+
| Delayed (Yellow) | Movement + breathing, stable vitals | P2 |
86+
| Minor (Green) | Strong movement, responsive patterns | P3 |
87+
| Deceased (Black) | No vitals for >30 minutes continuous scan | P4 |
88+
89+
#### 2.4 Hardware Abstraction
90+
Supports multiple deployment scenarios:
91+
- **Portable**: Single TX/RX with handheld device
92+
- **Distributed**: Multiple APs deployed around collapse site
93+
- **Drone-mounted**: UAV-based scanning for large areas
94+
- **Vehicle-mounted**: Mobile command post with array
95+
96+
### 3. Integration Strategy
97+
98+
The module integrates with existing crates through adapters:
99+
100+
```
101+
┌─────────────────────────────────────────────────────────────┐
102+
│ wifi-densepose-mat │
103+
├─────────────────────────────────────────────────────────────┤
104+
│ ┌─────────────┐ ┌─────────────┐ ┌─────────────────────┐ │
105+
│ │ Detection │ │ Localization│ │ Alerting │ │
106+
│ │ Context │ │ Context │ │ Context │ │
107+
│ └──────┬──────┘ └──────┬──────┘ └──────────┬──────────┘ │
108+
│ │ │ │ │
109+
│ └────────────────┼─────────────────────┘ │
110+
│ │ │
111+
│ ┌───────────▼───────────┐ │
112+
│ │ Integration Layer │ │
113+
│ │ (Anti-Corruption) │ │
114+
│ └───────────┬───────────┘ │
115+
└──────────────────────────┼───────────────────────────────────┘
116+
117+
┌──────────────────┼──────────────────┐
118+
│ │ │
119+
▼ ▼ ▼
120+
┌───────────────┐ ┌───────────────┐ ┌───────────────┐
121+
│wifi-densepose │ │wifi-densepose │ │wifi-densepose │
122+
│ -signal │ │ -nn │ │ -hardware │
123+
└───────────────┘ └───────────────┘ └───────────────┘
124+
```
125+
126+
### 4. Performance Requirements
127+
128+
| Metric | Target | Rationale |
129+
|--------|--------|-----------|
130+
| Detection Latency | <500ms | Real-time feedback for rescuers |
131+
| False Positive Rate | <5% | Minimize wasted rescue efforts |
132+
| False Negative Rate | <1% | Cannot miss survivors |
133+
| Penetration Depth | 3-5m | Typical rubble pile depth |
134+
| Battery Life (portable) | >8 hours | Full shift operation |
135+
| Concurrent Zones | 16+ | Large disaster site coverage |
136+
137+
### 5. Safety and Reliability
138+
139+
- **Fail-safe defaults**: Always assume life present on ambiguous signals
140+
- **Redundant detection**: Multiple algorithms vote on presence
141+
- **Continuous monitoring**: Re-scan zones periodically
142+
- **Offline operation**: Full functionality without network
143+
- **Audit logging**: Complete trace of all detections
144+
145+
## Consequences
146+
147+
### Positive
148+
- Modular design allows independent development and testing
149+
- DDD ensures domain experts can validate logic
150+
- Event-driven enables distributed deployments
151+
- Adapters isolate from upstream changes
152+
- Compatible with existing WiFi-DensePose infrastructure
153+
154+
### Negative
155+
- Additional complexity from event system
156+
- Learning curve for rescue teams
157+
- Requires calibration for different debris types
158+
- RF interference in disaster zones
159+
160+
### Risks and Mitigations
161+
| Risk | Mitigation |
162+
|------|------------|
163+
| Metal debris blocking signals | Multi-angle scanning, adaptive frequency |
164+
| Environmental RF interference | Spectral sensing, frequency hopping |
165+
| False positives from animals | Size/pattern classification |
166+
| Power constraints in field | Low-power modes, solar charging |
167+
168+
## References
169+
170+
- [WiFi-based Vital Signs Monitoring](https://dl.acm.org/doi/10.1145/3130944)
171+
- [Through-Wall Human Sensing](https://ieeexplore.ieee.org/document/8645344)
172+
- [START Triage Protocol](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3088332/)
173+
- [CSI-based Human Activity Recognition](https://arxiv.org/abs/2004.03661)

0 commit comments

Comments
 (0)