Initial release: 6-stage ckpt (444M params) + Phone ONNX
Browse files- README.md +80 -0
- normalizer.pkl +3 -0
- patch_encoder.onnx +3 -0
- stage1_patch.pt +3 -0
- stage2_adapter.pt +3 -0
- stage2_minute.pt +3 -0
- stage3_hourslot.pt +3 -0
- stage4_history.pt +3 -0
- stage4_refiner.pt +3 -0
- stage5_full.pt +3 -0
- stage6_vitalguard.pt +3 -0
README.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: ko
|
| 3 |
+
library_name: pytorch
|
| 4 |
+
tags:
|
| 5 |
+
- anomaly-detection
|
| 6 |
+
- wearable-sensors
|
| 7 |
+
- elderly-monitoring
|
| 8 |
+
- imu
|
| 9 |
+
- heart-rate
|
| 10 |
+
license: mit
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# SISA-RoutineGuard
|
| 14 |
+
|
| 15 |
+
**노인 일상 패턴 이상 감지 시스템** (Galaxy Watch + Jetson Orin Nano)
|
| 16 |
+
|
| 17 |
+
4-tier hierarchical SSM-Informed Softmax Attention 모델로 노인의 24시간 wearable 데이터에서 routine anomaly를 감지합니다.
|
| 18 |
+
|
| 19 |
+
## 모델 구성
|
| 20 |
+
|
| 21 |
+
| Component | Params | 위치 |
|
| 22 |
+
|---|---|---|
|
| 23 |
+
| PatchEncoder | 0.22M | Phone (ONNX) |
|
| 24 |
+
| MinuteEncoder | 48.09M | Jetson |
|
| 25 |
+
| FeatureAdapter | 0.66M | Jetson |
|
| 26 |
+
| HourSlotEncoder | 142.60M | Jetson |
|
| 27 |
+
| HistoryEncoder | 141.86M | Jetson |
|
| 28 |
+
| QueryRefiner | 97.65M | Jetson |
|
| 29 |
+
| VitalGuard | 12.01M | Jetson |
|
| 30 |
+
| OutputHeads | 1.58M | Jetson |
|
| 31 |
+
| **Full model** | **444.66M** | Total |
|
| 32 |
+
|
| 33 |
+
## 학습 데이터
|
| 34 |
+
- **CAPTURE-24** (Oxford, 151 subjects × 24h wrist accelerometer)
|
| 35 |
+
- **ArWISE V3** (CASAS, 10 subjects × 9 days, 76 days raw)
|
| 36 |
+
- **PPG-DaLiA** (UCI, 15 subjects)
|
| 37 |
+
- **WESAD** (Schmidt 2018, 15 subjects)
|
| 38 |
+
- **MHEALTH** (UCI, 10 subjects)
|
| 39 |
+
|
| 40 |
+
## 학습 단계 (Plan v1.4)
|
| 41 |
+
|
| 42 |
+
1. **Stage 1 — PatchEncoder**: reconstruction MSE on CAPTURE-24 + ArWISE V3 raw acc
|
| 43 |
+
2. **Stage 2 — MinuteEncoder + FeatureAdapter**: alignment + InfoNCE on real CAPTURE-24
|
| 44 |
+
3. **Stage 3 — HourSlotEncoder**: slot context + cross-day contrastive (real ArWISE features)
|
| 45 |
+
4. **Stage 4 — HistoryEncoder + QueryRefiner**: day order + neighbor slot alignment
|
| 46 |
+
5. **Stage 5 — Full model**: synthetic anomaly injection on real distribution
|
| 47 |
+
6. **Stage 6 — VitalGuard**: HR regression on PPG-DaLiA + WESAD + MHEALTH
|
| 48 |
+
|
| 49 |
+
## Files
|
| 50 |
+
|
| 51 |
+
- `stage1_patch.pt` — PatchEncoder weights (Phone deploy)
|
| 52 |
+
- `stage2_minute.pt`, `stage2_adapter.pt` — MinuteEncoder + Adapter
|
| 53 |
+
- `stage3_hourslot.pt` — HourSlotEncoder
|
| 54 |
+
- `stage4_history.pt`, `stage4_refiner.pt` — History + QueryRefiner
|
| 55 |
+
- `stage5_full.pt` — Full model fine-tuned with anomaly injection
|
| 56 |
+
- `stage6_vitalguard.pt` — VitalGuard module
|
| 57 |
+
- `patch_encoder.onnx` — Phone deploy ONNX (880KB)
|
| 58 |
+
- `normalizer.pkl` — Feature normalizer
|
| 59 |
+
|
| 60 |
+
## Inference
|
| 61 |
+
|
| 62 |
+
```python
|
| 63 |
+
import torch
|
| 64 |
+
from src.models.full_model import SISARoutineGuard
|
| 65 |
+
|
| 66 |
+
model = SISARoutineGuard().cuda().eval()
|
| 67 |
+
state = torch.load("stage5_full.pt", map_location="cpu")["model"]
|
| 68 |
+
model.load_state_dict(state, strict=False)
|
| 69 |
+
|
| 70 |
+
# Merge Stage 6 VitalGuard
|
| 71 |
+
vg = torch.load("stage6_vitalguard.pt", map_location="cpu")["model"]
|
| 72 |
+
model.vitalguard.load_state_dict(vg, strict=False)
|
| 73 |
+
```
|
| 74 |
+
|
| 75 |
+
코드: https://github.com/tlstngud/sisa-routineguard (private)
|
| 76 |
+
|
| 77 |
+
## 평가
|
| 78 |
+
- forward_replay inference: **448 ms / batch=2** (RTX 4090)
|
| 79 |
+
- pytest 57/69 통과
|
| 80 |
+
- 9 시나리오 normal/shift 시연 검증
|
normalizer.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:785eb9005f76a63318cfdca4f0075a882f6476bf5dd084c6f45b6c3ddb320780
|
| 3 |
+
size 405
|
patch_encoder.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0c8a9cd943ea39d200a5231caabe4090beceeb9a41148ed3ac8f3f619758a5da
|
| 3 |
+
size 880620
|
stage1_patch.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:578c2a04602a59a0d2bde9c826697c620b153b54b72e62072e3128ce692d804f
|
| 3 |
+
size 878862
|
stage2_adapter.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f099e360f831d4ab9be63f1d4352a9e6aca4ba6c41e8faa11645fcfd6768b525
|
| 3 |
+
size 2656462
|
stage2_minute.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:61ebd23b835ad08035fb8697ef497682bcb84cc866d8e23e6b04ee5cfc75091c
|
| 3 |
+
size 192411630
|
stage3_hourslot.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1c4dcdd17f60d2252c12e8ed76677442358d3757b05fc4a4284f1812dcb00b8a
|
| 3 |
+
size 570743966
|
stage4_history.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9502d232603d513d8c55e6627e746e5abb05b505dda8028fba07b98ed37f7d9d
|
| 3 |
+
size 567507699
|
stage4_refiner.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cb063a1a99e6754c7cb0019d41ff16bb0819caaae6b6020147d399441c109e4d
|
| 3 |
+
size 390625845
|
stage5_full.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f22774a6633ec1a2d0ab21964160252000dc77cc3b5732806dbbae31ab1cf99b
|
| 3 |
+
size 1779230774
|
stage6_vitalguard.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c84cbf1ab835ef10f72a8524a990debaf7233dab27750e22888dcd6406a2f2b6
|
| 3 |
+
size 48077842
|