구축 방법 — Wearable Biosignals · v1.0 · 2026-11-07
■ 방법
- Heart Rate & HRV: 진폭 문턱과 국소 최댓값, 250 ms 비최대 억제. 단순 시연용 검출기다. Pan–Tompkins의 전체 알고리즘을 재현한 것이 아니다.
- SDNN: 표본 표준편차. RMSSD: 유효한 이웃 NN 쌍만 사용. 제외된 박동을 건너뛰어 잇지 않는다.
- 주석과 ±50 ms 일대일 대응으로 TP·FP·FN, 민감도·정밀도·시점 평균 절대 오차 계산. 검출 후보의 RR 표준편차는 SDRR로 표시.
- 브라우저 JavaScript와 Web Worker에서 계산·학습. 외부 모델·LLM 호출 없음. 본문 초안·코드 작성에 Codex 사용, 전문가 검수 전.
- PPG: 8초 창, 평균 제거, periodic Hann, 0.5–4 Hz 단측 periodogram. 가장 큰 파워 빈 ×60이 심박 추정. ECG 라벨은 동일 창 안 순간 심박의 평균이다. 빈 간격 0.125 Hz=7.5 bpm. 가속도는 각 축 PSD를 합한 뒤 대역 총합으로 정규화. 대역 겹침 O=Σmin(p,a).
- EDA: 4 Hz 원자료, 1차 causal low-pass, fc=0.02–0.2 Hz. d=1−cos(2πfc/fs), α=√(d²+2d)−d, 첫 표본으로 초기화. 잔차의 봉우리−직전 골 진폭, 1초 비최대 억제 뒤 문턱 0.01–0.5 µS. 처음 10초 제외. 논문의 deconvolution 재현이 아닌 분해 탐구용 근사.
- Fusion: 8초 창/2초 또는 8초 이동. PPG 2개·EDA 3개·ACC 3개 특징, 모집단 표준편차. 평균·표준편차는 학습에서만 추정. one-hot 목표 ridge least squares λ=1, 절편 페널티 없음. 가장 큰 출력을 활동 라벨로 선택. 초기화·최적화 반복 없는 선형시스템 해법.
- 평가: 6명 중 2명 제외 분할과 각 사람/활동 1/3 무작위 분할(시드17, LCG/Fisher–Yates). 정확도·macro-F1·혼동행렬·중복 사람·겹치는 원구간 쌍 계산. ablation은 같은 분할에서 전부/PPG제외/EDA제외/ACC제외를 각각 재학습한다.
■ 데이터
- Moody & Mark (2005), MIT-BIH Arrhythmia Database 1.0.0, PhysioNet · ODC-By 1.0.
- 기록 100 MLII, 0–300초, 360 Hz 원래 표본율 유지. WFDB 4.3.1로 mV로 바꾸고 JSON 저장. 정상/비정상 박동 주석은 원본 그대로.
- 자료 출처·조건·변경 고지. 사용자 입력 저장 없음(표시 테마만 기기에 저장).
- Reiss et al. (2019), PPG-DaLiA, UCI · CC BY 4.0. 원 저자의 별도 배포 조건은 비상업 연구용으로 다르다. 이 발췌는 CC BY가 명시된 UCI 배포본이다.
- S1,S2,S3,S4,S5,S7의 앉기·계단·걷기. 활동 첫 등장+30초를 짝수 초로 올림한 뒤 120초. 활동 전체 일치 확인. 총 18구간, 2160초. 손목 BVP64 Hz·ACC32 Hz·EDA4 Hz. 가슴 EDA/EMG/Temp 더미 제외.
- BVP 소수 2자리, ACC·EDA·기준 심박 소수 6자리 JSON. 신호 필터링·재표본화 없음. 기준 심박은 원본 8초 창·2초 이동 라벨과 정렬. 설문·인구통계 제외. 원자료·가공 SHA256과 모든 경계는 evidence/wearable-ppg-manifest.json.
- ECG+손목 JSON 총 약 3.55 MB, 10 MB 제한 이내. python/wearable/prepare_ecg.py와 prepare_ppg.py로 재생성. 합성 생체신호 사용 없음.
- 재현 의존성: python/wearable/requirements.txt. 원본 압축 파일은 약 2.86 GB로 로컬 .work에만 보관하며 웹에는 발췌 JSON만 포함한다.
■ 검증
- 고정 입력 [800,810,790,805,795] ms: SDNN 7.905694, RMSSD 14.361407 ms. 손계산·NumPy 2.5.4와 일치하며 설계서 15의 7.906 / 14.361 ms를 재현한다.
- 기록 100의 300초 NN: SDNN 25.372101 ms, RMSSD 25.898539 ms. NumPy 대조 1e-9 ms 이내.
- 기본 문턱 0.45 mV: TP 371, FP 0, FN 0, 시점 평균 절대 오차 1.168 ms. 한 발췌에 대한 검사다.
- SciPy 1.18.1 periodogram·lfilter·freqz·find_peaks와 스펙트럼·필터 계수·파형·후보 수 대조. 8개 분할 ×4 신호 구성의 계수·예측·혼동행렬을 NumPy linalg.solve와 대조: 수치 허용오차 1e-9, 예측·정수 개수 정확히 일치.
- 기본값(평가 S5,S7, 2초 이동, 전체 특징): 학습684/평가342창. 사람 분할 정확도75.73%, macro-F1 0.749; 무작위78.95%, 0.784. 중복 사람0/6명, 원구간 중첩0/1352쌍. 이 발췌 계산 결과이며 논문 성능이 아니다.
- 검사 코드: tests/wearable/core-test.mjs, multimodal-test.mjs, ui-check.mjs, multimodal-ui-check.mjs. 독립 기준 재생성: python/wearable/validate_multimodal.py.
- Chromium 실제 브라우저 검사: 390·1280px × 한영, 4탭. 문턱·창·그림 드래그·키보드·신호 재학습·분할·클립보드 상태 링크·새로고침·글씨 확대·테마·인쇄 스타일·구축 방법 통과. 실기기 폰과 외부 전문가 검수는 미확인.
■ 범위
- 문턱 −0.6–1.5 mV, 표시 창 8초, NN 분석 창 30–300초. 정상 간격은 양 끝 주석이 모두 N인 경우만 포함.
- PPG는 같은 8초 구간의 주파수 비교, EDA는 분해·검출 규칙 비교, Fusion은 일상 활동 3종 분류다. 고정 활동 순서·참가자 수·발췌 선택이 일반화에 영향을 준다. 전문가 검수·실기기 성능 검수 전이며 의료·스트레스·피로·건설 안전을 판정하지 않는다.
■ 출처
- Task Force (1996), Circulation 93:1043–1065 / Eur Heart J 17:354–381. 실제 열람은 EHJ 동시출판 원문, pp.355–358,364–365.
- Pan & Tompkins (1985), IEEE TBME 32(3):230–236, DOI 10.1109/TBME.1985.325532.
- Moody & Mark (2001), IEEE EMB 20(3):45–50. https://physionet.org/content/mitdb/1.0.0/
- Reiss et al. (2019), Deep PPG, Sensors 19:3079, DOI 10.3390/s19143079. 데이터 수치 근거는 실제 열람한 UCI 원본 설명서 I–III.
- Benedek & Kaernbach (2010), A continuous measure of phasic electrodermal activity, J Neurosci Methods190:80–91, PMC2892750.
- SciPy periodogram/Hann/lfilter 공식 문서; scikit-learn grouped cross-validation·ridge 공식 문서. 본문 각 탭 References에 원문 링크.
How it's built — Wearable Biosignals · v1.0 · 2026-11-07
■ Method
- Heart Rate & HRV: amplitude threshold, local maxima and 250 ms nonmaximum suppression. A demonstration detector, not a reproduction of the complete Pan–Tompkins algorithm.
- SDNN uses sample standard deviation; RMSSD uses only originally adjacent valid NN pairs, without bridging excluded intervals.
- One-to-one matching within ±50 ms yields TP, FP, FN, sensitivity, precision and mean absolute timing error. Candidate RR standard deviation is labelled SDRR.
- Direct browser JavaScript and Web Worker calculations/training; no external model or LLM calls. Codex assisted text and implementation; awaiting expert review.
- PPG: eight-second window, demeaning, periodic Hann, one-sided periodogram over 0.5–4 Hz. Highest-power bin ×60 gives HR; ECG labels average instantaneous HR in the same window. Resolution 0.125 Hz=7.5 bpm. Sum acceleration PSDs across axes and normalize band totals. Overlap O=Σmin(p,a).
- EDA: native 4 Hz, first-order causal low-pass at fc=0.02–0.2 Hz. d=1−cos(2πfc/fs), α=√(d²+2d)−d; initialize with the first sample. Peak-minus-preceding-trough amplitude, one-second nonmaximum suppression, then threshold 0.01–0.5 µS. Exclude opening ten seconds. A separation proxy, not a reproduction of the paper’s deconvolution.
- Fusion: eight-second windows/2 or 8 s steps. Two PPG, three EDA and three ACC features, population standard deviations. Fit scaling on training rows only. One-hot ridge least squares λ=1, unpenalized intercept, largest output selects the activity. Solves a linear system without iterative optimization.
- Validation: hold out two of six participants versus one third of windows within every person/activity (seed 17, LCG/Fisher–Yates). Accuracy, macro-F1, confusion, shared people and raw-interval overlap counts. Refit all/no PPG/no EDA/no ACC on the same person split.
■ Data
- Moody & Mark (2005), MIT-BIH Arrhythmia Database 1.0.0, PhysioNet · ODC-By 1.0.
- Record 100, MLII, 0–300 s at the original 360 Hz. WFDB 4.3.1 physical conversion to mV, JSON export, original beat types and timestamps.
- Attribution, license and changes. No user input storage (display theme is stored locally).
- Reiss et al. (2019), PPG-DaLiA, UCI · CC BY 4.0. The authors’ separate distribution has scientific/noncommercial terms; this extract uses the explicitly CC-BY UCI distribution.
- S1,S2,S3,S4,S5,S7, Sitting/Stairs/Walking. First activity occurrence +30 s rounded up to an even second, then 120 s wholly within the activity. 18 excerpts/2160 s. Wrist BVP64 Hz, ACC32 Hz, EDA4 Hz. Chest EDA/EMG/Temp dummy channels excluded.
- JSON: BVP 2 decimals; ACC, EDA and HR references 6 decimals. No filtering/resampling. Reference HR aligned to supplied eight-second windows/two-second steps. No questionnaires/demographics. Source/export SHA256 and exact bounds: evidence/wearable-ppg-manifest.json.
- ECG+wrist JSON approximately 3.55 MB, below 10 MB. Reproduce with python/wearable/prepare_ecg.py and prepare_ppg.py. No synthetic biosignals.
- Reproduction dependencies: python/wearable/requirements.txt. The approximately 2.86 GB source archive stays in local .work; the site includes excerpt JSON only.
■ Validation
- Fixed [800,810,790,805,795] ms: SDNN 7.905694, RMSSD 14.361407 ms, matching hand calculation, NumPy 2.5.4 and the design reference rounded to 7.906 / 14.361 ms.
- 300 s normal intervals: SDNN 25.372101 ms, RMSSD 25.898539 ms; NumPy agreement within 1e-9 ms.
- Default threshold 0.45 mV: TP 371, FP 0, FN 0; mean absolute timing error 1.168 ms. This checks one excerpt only.
- SciPy 1.18.1 periodogram/lfilter/freqz/find_peaks cross-check spectra, filter coefficients, waveforms and candidate counts. Eight splits × four signal sets checked against NumPy linalg.solve: numeric tolerance 1e-9, identical predictions and integer counts.
- Defaults (S5,S7 held out, 2 s step, all signals): 684 training/342 test windows. Person accuracy75.73%, macro-F1 0.749; random78.95%, 0.784. Shared people0/6, overlapping interval pairs0/1352. These are excerpt results, not paper performance.
- Tests: tests/wearable/core-test.mjs, multimodal-test.mjs, ui-check.mjs and multimodal-ui-check.mjs. Regenerate independent references: python/wearable/validate_multimodal.py.
- Actual Chromium checks: 390/1280 px × Korean/English, four tabs. Thresholds, windows, dragging, keyboard, refitting, splits, copied state links, reloads, large text, themes, print styles and methods passed. Physical-phone and external-expert review remain unverified.
■ Scope
- Threshold −0.6–1.5 mV; 8 s waveform view; NN windows 30–300 s. Include intervals only when both endpoint annotations are N.
- PPG compares spectra within aligned eight-second windows; EDA compares separation/detection rules; Fusion classifies three daily activities. Fixed activity order, small participant count and excerpt selection affect generalization. Expert and physical-device review are pending; no medical, stress, fatigue or construction-safety assessment.
■ Sources
- Task Force (1996), Circulation 93:1043–1065 / Eur Heart J 17:354–381. Read the simultaneous EHJ publication, pp.355–358,364–365.
- Pan & Tompkins (1985), IEEE TBME 32(3):230–236, DOI 10.1109/TBME.1985.325532.
- Moody & Mark (2001), IEEE EMB 20(3):45–50. https://physionet.org/content/mitdb/1.0.0/
- Reiss et al. (2019), Deep PPG, Sensors19:3079, DOI 10.3390/s19143079. Dataset facts use the inspected original UCI documentation I–III.
- Benedek & Kaernbach (2010), A continuous measure of phasic electrodermal activity, J Neurosci Methods190:80–91, PMC2892750.
- Official SciPy periodogram/Hann/lfilter and scikit-learn grouped cross-validation/ridge documentation. Original links in each tab’s References.
■ History
- 2026-11-07 · v1.0 · Released