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

Skip to content

Commit 7d09710

Browse files
authored
Merge pull request ruvnet#18 from ruvnet/claude/wifi-mat-disaster-detection-MxxnQ
Create WiFi-Mat disaster detection module
2 parents 0fa9a0b + 2eb23c1 commit 7d09710

59 files changed

Lines changed: 24804 additions & 92 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude-flow/daemon-state.json

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
11
{
22
"running": true,
3-
"startedAt": "2026-01-13T03:24:14.137Z",
3+
"startedAt": "2026-01-13T18:06:18.421Z",
44
"workers": {
55
"map": {
6-
"runCount": 3,
7-
"successCount": 3,
6+
"runCount": 8,
7+
"successCount": 8,
88
"failureCount": 0,
9-
"averageDurationMs": 1.3333333333333333,
10-
"lastRun": "2026-01-13T03:39:14.149Z",
11-
"nextRun": "2026-01-13T03:39:14.144Z",
9+
"averageDurationMs": 1.25,
10+
"lastRun": "2026-01-13T18:21:18.435Z",
11+
"nextRun": "2026-01-13T18:21:18.428Z",
1212
"isRunning": false
1313
},
1414
"audit": {
15-
"runCount": 2,
15+
"runCount": 5,
1616
"successCount": 0,
17-
"failureCount": 2,
17+
"failureCount": 5,
1818
"averageDurationMs": 0,
19-
"lastRun": "2026-01-13T03:31:14.142Z",
20-
"nextRun": "2026-01-13T03:41:14.143Z",
19+
"lastRun": "2026-01-13T18:13:18.424Z",
20+
"nextRun": "2026-01-13T18:23:18.425Z",
2121
"isRunning": false
2222
},
2323
"optimize": {
24-
"runCount": 2,
24+
"runCount": 4,
2525
"successCount": 0,
26-
"failureCount": 2,
26+
"failureCount": 4,
2727
"averageDurationMs": 0,
28-
"lastRun": "2026-01-13T03:33:14.140Z",
29-
"nextRun": "2026-01-13T03:48:14.141Z",
28+
"lastRun": "2026-01-13T18:15:18.424Z",
29+
"nextRun": "2026-01-13T18:30:18.424Z",
3030
"isRunning": false
3131
},
3232
"consolidate": {
33-
"runCount": 1,
34-
"successCount": 1,
33+
"runCount": 3,
34+
"successCount": 3,
3535
"failureCount": 0,
36-
"averageDurationMs": 0,
37-
"lastRun": "2026-01-13T03:11:00.656Z",
38-
"nextRun": "2026-01-13T03:41:00.656Z",
36+
"averageDurationMs": 0.6666666666666666,
37+
"lastRun": "2026-01-13T18:13:18.428Z",
38+
"nextRun": "2026-01-13T18:42:18.422Z",
3939
"isRunning": false
4040
},
4141
"testgaps": {
42-
"runCount": 1,
42+
"runCount": 3,
4343
"successCount": 0,
44-
"failureCount": 1,
44+
"failureCount": 3,
4545
"averageDurationMs": 0,
46-
"lastRun": "2026-01-13T03:37:14.141Z",
47-
"nextRun": "2026-01-13T03:57:14.142Z",
46+
"lastRun": "2026-01-13T18:19:18.457Z",
47+
"nextRun": "2026-01-13T18:39:18.457Z",
4848
"isRunning": false
4949
},
5050
"predict": {
@@ -131,5 +131,5 @@
131131
}
132132
]
133133
},
134-
"savedAt": "2026-01-13T03:39:14.149Z"
134+
"savedAt": "2026-01-13T18:21:18.435Z"
135135
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"timestamp": "2026-01-13T03:39:14.148Z",
2+
"timestamp": "2026-01-13T18:21:18.434Z",
33
"projectRoot": "/home/user/wifi-densepose",
44
"structure": {
55
"hasPackageJson": false,
66
"hasTsConfig": false,
77
"hasClaudeConfig": true,
88
"hasClaudeFlow": true
99
},
10-
"scannedAt": 1768275554149
10+
"scannedAt": 1768328478434
1111
}

.claude-flow/metrics/consolidation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"timestamp": "2026-01-13T03:11:00.656Z",
2+
"timestamp": "2026-01-13T18:13:18.428Z",
33
"patternsConsolidated": 0,
44
"memoryCleaned": 0,
55
"duplicatesRemoved": 0

README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,61 @@ Mathematical correctness validated:
7373

7474
See [Rust Port Documentation](/rust-port/wifi-densepose-rs/docs/) for ADRs and DDD patterns.
7575

76+
## 🚨 WiFi-Mat: Disaster Response Module
77+
78+
A specialized extension for **search and rescue operations** - detecting and localizing survivors trapped in rubble, earthquakes, and natural disasters.
79+
80+
### Key Capabilities
81+
82+
| Feature | Description |
83+
|---------|-------------|
84+
| **Vital Signs Detection** | Breathing (4-60 BPM), heartbeat via micro-Doppler |
85+
| **3D Localization** | Position estimation through debris up to 5m depth |
86+
| **START Triage** | Automatic Immediate/Delayed/Minor/Deceased classification |
87+
| **Real-time Alerts** | Priority-based notifications with escalation |
88+
89+
### Use Cases
90+
91+
- Earthquake search and rescue
92+
- Building collapse response
93+
- Avalanche victim location
94+
- Mine collapse detection
95+
- Flood rescue operations
96+
97+
### Quick Example
98+
99+
```rust
100+
use wifi_densepose_mat::{DisasterResponse, DisasterConfig, DisasterType, ScanZone, ZoneBounds};
101+
102+
let config = DisasterConfig::builder()
103+
.disaster_type(DisasterType::Earthquake)
104+
.sensitivity(0.85)
105+
.max_depth(5.0)
106+
.build();
107+
108+
let mut response = DisasterResponse::new(config);
109+
response.initialize_event(location, "Building collapse")?;
110+
response.add_zone(ScanZone::new("North Wing", ZoneBounds::rectangle(0.0, 0.0, 30.0, 20.0)))?;
111+
response.start_scanning().await?;
112+
113+
// Get survivors prioritized by triage status
114+
let immediate = response.survivors_by_triage(TriageStatus::Immediate);
115+
println!("{} survivors require immediate rescue", immediate.len());
116+
```
117+
118+
### Documentation
119+
120+
- **[WiFi-Mat User Guide](docs/wifi-mat-user-guide.md)** - Complete setup, configuration, and field deployment
121+
- **[Architecture Decision Record](docs/adr/ADR-001-wifi-mat-disaster-detection.md)** - Design decisions and rationale
122+
- **[Domain Model](docs/ddd/wifi-mat-domain-model.md)** - DDD bounded contexts and entities
123+
124+
**Build:**
125+
```bash
126+
cd rust-port/wifi-densepose-rs
127+
cargo build --release --package wifi-densepose-mat
128+
cargo test --package wifi-densepose-mat
129+
```
130+
76131
## 📋 Table of Contents
77132

78133
<table>
@@ -81,6 +136,8 @@ See [Rust Port Documentation](/rust-port/wifi-densepose-rs/docs/) for ADRs and D
81136

82137
**🚀 Getting Started**
83138
- [Key Features](#-key-features)
139+
- [Rust Implementation (v2)](#-rust-implementation-v2)
140+
- [WiFi-Mat Disaster Response](#-wifi-mat-disaster-response-module)
84141
- [System Architecture](#️-system-architecture)
85142
- [Installation](#-installation)
86143
- [Using pip (Recommended)](#using-pip-recommended)
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)