Working artifact / CPU-only / reproducible

PHYSICAL PROCESS
DATA ENGINE

An end-to-end pipeline that turns raw video and synchronised sensor telemetry of a physical process into labelled, exportable training data — with a small agentic loop that writes and validates the pipeline, and compute accounting throughout. A working artifact, not a deck.

40 tests passing No GPU required Dual export contract ONNX optional Deterministic, offline

The run / measured

Every number on this page is read from the run's own output at load time. The clip is 30 s of synthetic-but-physical process data; the vision stage never sees the ground truth.

57labelled windows
0.982label accuracy
0.937 → 0.989agent objective
18 / 17 / 22nominal / anom / eol
4,138frames per second
$0.000272agent token cost

Accuracy is agreement with the simulator's ground truth; coherence and coverage are model-free. Throughput is wall-clock on an Apple M5 Pro, single CPU process.

The process / what is being watched

A motor-driven rotor with a wearing bearing. Three coupled physics — mechanics, tribology, thermal — so degradation shows up in several channels at once rather than in a single hand-waved health score. The drive has a real torque-speed curve, so rising friction genuinely costs speed and raises torque, current and heat.

The rendered input. The marker carries rotation; the assembly wobbles more as the bearing wears. Vision recovers both from pixels alone.

Frame at the start of the clip: healthy bearing Frame at 5 seconds Frame at 10 seconds Frame at 15 seconds Frame at 20 seconds Frame at the end of the clip: end of life
channelfreshfailed
rotation rate38.9 rad/s25.2 rad/s
bearing temperature22 °C72 °C
vibration RMS0.355.3
motor torque / current0.81 N·m2.64 N·m
latent wear0.001.00

Simulator ground truth over one clip. The pipeline sees only the video and the telemetry CSV.

The pipeline / six stages

Each stage is a small single-purpose module returning a typed result, orchestrated by one pipeline and driven by a Typer CLI. The extraction thresholds it uses are the values the agent tunes.

01

Simulate

Forward-integrates the coupled physics and renders video, telemetry and ground truth. simulate.py

02

Vision

Per-frame rotation rate and vibration amplitude from the marker and disk jitter. No learned model. video.py

03

Fusion

Aligns video against telemetry and blends four normalised penalties into one health index. fusion.py

04

Labels

Windows the fused stream into training units and thresholds them into the three physical states. labeling.py

05

Agent

Proposes a validated JSON patch to the extraction config, re-runs, and keeps what improves the objective. agent.py

06

Export

Prometheus text, JSON/JSONL dataset, model-ready npz, HTML report, and an optional ONNX path. export_*.py

Health & labels / over the clip

Four signals, each min-max normalised so their shapes are comparable, with the labelled state band underneath. The health index is a weighted blend of speed loss, temperature rise, vibration rise and current rise — hand-weighted and documented, not learned.

Hover the chart for the value at any instant.

health index rotation (fused) temperature vibration nominal anomalous end of life

Confusion, ground truth × predicted

Agentic curation / the config it wrote

Each iteration runs the pipeline, validates the output, asks the backend for a JSON patch to the extraction config, and applies it only if the objective improves. An invalid patch is rejected by schema validation and recorded. Two backends share the identical contract: any OpenAI-compatible endpoint, or a deterministic offline proposer so the demo always runs.

iterobjectiveresultrationalepatch
Loading…

The loop took label accuracy from 0.895 to 0.982 by reading its own confusion matrix and lowering the thresholds that were letting end-of-life windows read as merely anomalous. It is not decoration.

Export contract / dual and swappable

A Prometheus-style text exposition for teams with a monitoring stack, and structured JSON for model serialisation — produced side by side from the same run. ONNX is explicitly conditional, never assumed.

metrics.prom

Prometheus text exposition. Also servable at /metrics.

ppe_frames_processed_total 900
ppe_video_fps 4138.061864
ppe_label_windows{class="nominal"} 18
ppe_label_windows{class="anomalous"} 17
ppe_label_windows{class="end_of_life"} 22
ppe_validation_accuracy 0.982456
ppe_validation_objective 0.989474
ppe_compute_gpu_backend{backend="none"} 1
ppe_agent_tokens_total{kind="input"} 1329

dataset.jsonl

One training record per labelled window: the label, its confidence, and the fused features.

{"id": 0, "t_start": 0.0, "t_end": 2.0,
 "n_samples": 100, "label": "nominal",
 "confidence": 1.0, "features": {
 "omega_mean": 38.59, "temp_max": 27.31,
 "vib_max": 0.686, "health_mean": 0.951}}

features.npz

Model-ready matrix and label vector, with feature names and window ids.

X            (57, 13)  float64
y            (57,)     int64
feature_names (13,)    str
window_ids   (57,)     int64

onnx_status.json

Optional path. The linear classifier always trains; only serialisation is conditional.

{"exported": false,
 "reason": "onnx not installed"}

Compute accounting / data about the data

Reported per run, with the honesty rules baked into the code: a projected figure is never reported as a measurement, the GPU backend is detected rather than assumed, and token counts are marked estimated unless the API returned real usage.

itemvalue
Loading…

Limits / what this is not