plans/phase2-architecture/system-architecture.md
WiFi-DensePose is a revolutionary privacy-preserving human pose estimation system that transforms commodity WiFi infrastructure into a powerful human sensing platform. The system processes WiFi Channel State Information (CSI) through specialized neural networks to achieve real-time human pose estimation with 87.2% accuracy without using cameras or optical sensors.
graph TD
subgraph Hardware_Layer
A[WiFi Routers] --> B[CSI Data Extraction]
end
subgraph Core_Processing_Layer
B --> C[Signal Preprocessing]
C --> D[Neural Network Pipeline]
D --> E[Pose Estimation Engine]
E --> F[Multi-Person Tracking]
end
subgraph Service_Layer
F --> G[API Gateway]
G --> H1[REST API]
G --> H2[WebSocket Server]
G --> H3[MQTT Broker]
G --> H4[Webhook Service]
G --> H5[Restream Service]
end
subgraph Application_Layer
H1 --> I1[Web Dashboard]
H2 --> I1
H1 --> I2[Mobile App]
H2 --> I2
H3 --> I3[IoT Integration]
H4 --> I4[External Services]
H5 --> I5[Streaming Platforms]
end
subgraph Management_Layer
J[Configuration Management] --> A
J --> C
J --> D
J --> E
J --> G
K[Monitoring & Diagnostics] -.-> Hardware_Layer
K -.-> Core_Processing_Layer
K -.-> Service_Layer
end
sequenceDiagram
participant Router as WiFi Router
participant CSI as CSI Collector
participant Preproc as Signal Preprocessor
participant NN as Neural Network
participant Pose as Pose Estimator
participant Tracker as Multi-Person Tracker
participant API as API Services
participant Client as Client Applications
Router->>CSI: Raw CSI Data (UDP)
CSI->>Preproc: Structured CSI Data
Preproc->>NN: Preprocessed CSI Features
NN->>Pose: Spatial Representations
Pose->>Tracker: Raw Pose Estimates
Tracker->>API: Tracked Pose Data
API->>Client: Pose Data (REST/WebSocket)
graph LR
A[Pose Data] --> B[Short-Term Cache]
A --> C[Time-Series Database]
C --> D[Data Aggregation]
D --> E[Analytics Storage]
E --> F[Reporting Engine]
G[Configuration Data] --> H[Config Database]
H --> I[Runtime Config]
H --> J[Config Templates]
K[System Metrics] --> L[Metrics Database]
L --> M[Monitoring Dashboard]
L --> N[Alert Engine]
CSI Collector → Signal Preprocessor:
interface CSIData {
timestamp: number;
routerId: string;
amplitude: Float32Array[][];
phase: Float32Array[][];
rssi: number;
metadata: Record<string, any>;
}
Neural Network → Pose Estimator:
interface SpatialRepresentation {
features: Float32Array[][][];
confidence: number;
timestamp: number;
processingTime: number;
}
Pose Estimator → Multi-Person Tracker:
interface PoseEstimate {
keypoints: Array<{x: number, y: number, confidence: number}>;
boundingBox: {x: number, y: number, width: number, height: number};
confidence: number;
timestamp: number;
}
graph TD
A[System Events] --> B{Event Bus}
B --> C[Hardware Events]
B --> D[Processing Events]
B --> E[API Events]
B --> F[Alert Events]
C --> C1[Router Connected]
C --> C2[Router Disconnected]
C --> C3[CSI Data Received]
D --> D1[Processing Started]
D --> D2[Processing Completed]
D --> D3[Error Detected]
E --> E1[Client Connected]
E --> E2[Request Received]
E --> E3[Response Sent]
F --> F1[Fall Detected]
F --> F2[Person Detected]
F --> F3[System Alert]
graph TD
subgraph Docker_Host
subgraph Core_Containers
A[CSI Collector Container]
B[Neural Network Container]
C[Pose Estimation Container]
D[API Services Container]
end
subgraph Support_Containers
E[Database Container]
F[MQTT Broker Container]
G[Redis Cache Container]
H[Monitoring Container]
end
subgraph Frontend_Containers
I[Web Dashboard Container]
J[Streaming Server Container]
end
A --> B
B --> C
C --> D
D --> E
D --> F
D --> G
A --> H
B --> H
C --> H
D --> H
D --> I
D --> J
end
CSI Collector Container:
Neural Network Container:
Pose Estimation Container:
API Services Container:
Database Container:
MQTT Broker Container:
Redis Cache Container:
Monitoring Container:
graph TD
subgraph Kubernetes_Cluster
subgraph Core_Services
A[CSI Collector Deployment]
B[Neural Network Deployment]
C[Pose Estimation Deployment]
D[API Gateway Deployment]
end
subgraph Data_Services
E[Database StatefulSet]
F[Redis StatefulSet]
G[MQTT Broker Deployment]
end
subgraph Frontend_Services
H[Web Dashboard Deployment]
I[Streaming Server Deployment]
end
subgraph Infrastructure
J[Ingress Controller]
K[Prometheus Operator]
L[Cert Manager]
end
J --> D
J --> H
J --> I
K -.-> Core_Services
K -.-> Data_Services
K -.-> Frontend_Services
A --> B
B --> C
C --> D
D --> E
D --> F
D --> G
end
graph TD
A[Load Balancer] --> B1[API Gateway Instance 1]
A --> B2[API Gateway Instance 2]
A --> B3[API Gateway Instance n]
B1 --> C1[Processing Pipeline 1]
B2 --> C2[Processing Pipeline 2]
B3 --> C3[Processing Pipeline n]
C1 --> D[Shared Database Cluster]
C2 --> D
C3 --> D
C1 --> E[Shared Cache Cluster]
C2 --> E
C3 --> E
graph TD
A[Client Request] --> B[API Gateway]
B --> C{Authentication}
C -->|Invalid| D[Reject Request]
C -->|Valid| E{Authorization}
E -->|Unauthorized| F[Reject Request]
E -->|Authorized| G[Process Request]
subgraph Auth_Services
H[JWT Service]
I[API Key Service]
J[Role Service]
K[Permission Service]
end
C -.-> H
C -.-> I
E -.-> J
E -.-> K
graph TD
subgraph Components
A1[CSI Collector]
A2[Neural Network]
A3[Pose Estimator]
A4[API Services]
end
subgraph Metrics_Collection
B[Prometheus]
end
subgraph Visualization
C[Grafana]
end
subgraph Alerting
D[Alert Manager]
end
A1 --> B
A2 --> B
A3 --> B
A4 --> B
B --> C
B --> D
D --> E[Notification Channels]
graph TD
subgraph Zone_A
A1[API Gateway A]
B1[Processing Pipeline A]
C1[Database Node A]
end
subgraph Zone_B
A2[API Gateway B]
B2[Processing Pipeline B]
C2[Database Node B]
end
subgraph Zone_C
A3[API Gateway C]
B3[Processing Pipeline C]
C3[Database Node C]
end
D[Global Load Balancer] --> A1
D --> A2
D --> A3
C1 --- C2
C2 --- C3
C3 --- C1
The WiFi-DensePose system architecture provides a robust, scalable, and secure foundation for privacy-preserving human pose estimation using WiFi signals. The modular design enables deployment across various environments from edge devices to cloud infrastructure, while the well-defined interfaces ensure extensibility and integration with external systems.
Key architectural decisions prioritize:
This architecture supports the system requirements while providing a clear roadmap for implementation and future enhancements.