Skip to main content

Physics-certified motion data toolkit for Physical AI training

Project description

S2S — Physics-Certified Sensor Data

Physics-certified motion data for prosthetics, robotics, and Physical AI.

S2S is a physics validation layer for human motion sensor data. Before training a prosthetic hand, surgical robot, or humanoid — run your IMU data through S2S. It verifies the data obeys 11 biomechanical laws and issues a certificate. Bad data gets rejected before it reaches your model.

PyPI DOI S2S CI License: BSL-1.1 Python 3.9+ Zero Dependencies


Live Demos

No install needed. All processing runs on your device. No data sent anywhere.


The Problem

Physical AI (robots, prosthetics, exoskeletons) is trained on motion data. But most datasets contain synthetic data that violates physics, corrupted recordings, and mislabeled actions — with no way to verify the data came from a real human moving in physically valid ways.

A robot trained on bad data learns bad motion. A prosthetic hand trained on uncertified data fails its user.


Four Proven Training Benefits

S2S is not just a filter. It improves model performance at every stage of the training pipeline. All results validated across two independent datasets (WISDM 20Hz, PAMAP2 100Hz).

Level 1 — Quality Floor

Remove data that fails physics before training.

Dataset Corruption Recovery Result
WISDM 20Hz 35% corrupted 108% of damage recovered +0.23% net vs clean
PAMAP2 100Hz 35% corrupted Confirmed cross-dataset +0.51% F1

Physics floor removes bad data and beats the clean baseline with 46% less data.

Level 2 — Curriculum Training

Train in physics quality order: GOLD → SILVER → BRONZE.

Dataset Result
WISDM 20Hz +1.03% F1 vs clean baseline, 46% less data

The model learns the ceiling first. Marginal data is introduced only after the model understands perfect motion.

Level 3 — Adaptive Reconstruction

Repair marginal (BRONZE) records using frequency-appropriate methods. Every repaired record carries full provenance.

Hz Method Result
≤50Hz (20Hz WISDM) Kalman RTS smoother +1.44% F1
≥100Hz (PAMAP2) Savitzky-Golay Spectral sim=0.997 — signal needs no repair

Dual acceptance: physics re-score ≥75 AND spectral similarity ≥0.8. Both must pass.

At low Hz, noise is separable from signal — Kalman removes it. At high Hz, every micro-movement is real — smoothing destroys features. S2S adapts automatically.

Level 4 — Kinematic Chain Consistency (headline result)

Verify that multiple sensors tell a consistent biomechanical story.

Condition F1 Δ
Single chest IMU 0.7969 baseline
3 IMUs naive concat 0.8308 +3.39%
3 IMUs + chain filter 0.8399 +0.91% over naive
Net vs single sensor +4.23% F1 ← headline

Tested on PAMAP2 12-class activity recognition (hand + chest + ankle IMU, 100Hz).

Why this catches synthetic data: Synthetic motion generators produce each sensor channel independently. Real walking produces a 50–100ms ankle-to-chest jerk lag from heel-strike propagating up the skeleton. This timing cannot be faked without full rigid-body simulation. S2S Level 4 is the first physics-based cross-sensor consistency check for IMU data.


11 Physics Laws

Single-Sensor Laws (Levels 1–3)

# Law What It Catches
1 Newton's Second Law (F=ma, 75ms EMG delay) Synthetic data missing lagged EMG-accel correlation
2 Segment Resonance (ω=√(K/I)) Tremor at impossible frequency for body segment
3 Rigid Body Kinematics (a=α×r+ω²×r) Gyro and accel generated independently
4 Ballistocardiography (F=ρQv) IMU missing cardiac recoil
5 Joule Heating (Q=0.75×P×t) Sustained EMG without thermal elevation
6 Motor Control Jerk (∂³x/∂t³ ≤ 5000 m/s³) Robotic or keyframe animation artefacts
7 IMU Consistency (Var(accel) ~ f(Var(gyro))) Accel and gyro from independent generators

Multi-Sensor Chain Laws (Level 4)

# Law What It Catches
8 Locomotion Coherence (freq spread <2.5Hz) Sensors recording different activities
9 Segment Coupling (chest-ankle r >0.3) Independent synthetic channels
10 Gyro-Accel Coupling (per IMU) Rotation without corresponding acceleration
11 Cross-Sensor Jerk Timing (ankle leads chest 0–200ms) Reversed or zero lag — not real heel-strike

Tier System

Tier Score Meaning
GOLD ≥87 All physics laws passed. Pristine.
SILVER 75–86 Trusted. Minor deviations within noise.
BRONZE 60–74 Marginal. Candidate for reconstruction at ≤50Hz.
RECONSTRUCTED Repaired, re-scored ≥75, spectral sim ≥0.8. Weight 0.5.
REJECTED <floor Removed from pipeline.

Floor = p25 of clean score distribution per dataset (adaptive). GOLD always means the same thing everywhere.


Install

pip install s2s-certify

Zero dependencies. Pure Python 3.9+. Works on any platform.


Quick Start

from s2s_certify import certify

# Single window — list of [ax, ay, az] samples
result = certify(accel_window, sample_rate_hz=20)

print(result['tier'])        # GOLD / SILVER / BRONZE / REJECTED
print(result['score'])       # 0–100
print(result['laws_passed']) # which of 7 single-sensor laws passed

Or certify a CSV file directly from terminal:

s2s-certify your_imu_data.csv

Columns auto-detected: timestamp, acc_x, acc_y, acc_z, gyro_x, gyro_y, gyro_z


Datasets Validated

Dataset Hz Sensors Windows Used for
WISDM 2019 20Hz Wrist accel 46,946 Levels 1, 2, 3
PAMAP2 100Hz Hand+Chest+Ankle IMU 13,094 Levels 1, 3, 4

Paper

S2S: Physics-Certified Sensor Data — Four Proven Training Benefits Across Two Independent Datasets

→ Read paper (PDF) | → DOI: 10.5281/zenodo.18878307


Project Structure

s2s_standard_v1_3/     # Physics engine (zero dependencies)
experiments/           # All 4 level experiments + results JSON
  level3_adaptive_reconstruction.py  # Kalman + SavGol adaptive
  level4_multisensor_fusion.py       # Kinematic chain consistency
  results_level4_pamap2.json         # +4.23% chain result
  results_level3_adaptive_wisdm.json # +1.44% Kalman result
docs/paper/            # S2S_Paper_v5.pdf + .docx
dashboard/app.py       # Streamlit human review UI
train_classifier.py    # Domain classifier (v1.4, 76.6% acc)
wisdm_adapter.py       # WISDM 2019 dataset adapter

License

BSL-1.1 — free for research and non-commercial use. Contact for commercial licensing.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

s2s_certify-1.4.2.tar.gz (79.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

s2s_certify-1.4.2-py3-none-any.whl (85.8 kB view details)

Uploaded Python 3

File details

Details for the file s2s_certify-1.4.2.tar.gz.

File metadata

  • Download URL: s2s_certify-1.4.2.tar.gz
  • Upload date:
  • Size: 79.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for s2s_certify-1.4.2.tar.gz
Algorithm Hash digest
SHA256 fd233f13e74fd9135e4c694afa7d5e75b9b393fec5fe95946f7a7eb18d6eaeb7
MD5 596085bf3c386b46fdd55c0a7ea854d1
BLAKE2b-256 7875950b855a88781203681093eefb7129c40d6c55a14fb85d103c994446878a

See more details on using hashes here.

File details

Details for the file s2s_certify-1.4.2-py3-none-any.whl.

File metadata

  • Download URL: s2s_certify-1.4.2-py3-none-any.whl
  • Upload date:
  • Size: 85.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for s2s_certify-1.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8a02ace25a9d3ab706a763fab77a5b2bd9c93c594a57bf9da1a7a252534092e2
MD5 c3e2d12b1c0f6cb6720b01b5fb66061d
BLAKE2b-256 613f5604f6e7459f15d4f9439f0e2bbd4af5d280afe90e49aa7c5ff45f995dd3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page