Khaos Regime Shift Detection
A patch transformer that scores, for every 8-sample patch of a multivariate sensor window (8 channels, 512 samples), the probability that the operating regime changes there.
tele_regime_shift v1, from Khaos (a local-first library of pre-trained models for domain-specific tasks). This is the first release of the artifact.
Model
- Architecture: RegimeShiftTransformer: patch embedding (8 samples), 4-layer transformer (dim 128, 4 heads), head on each patch and its difference from the previous patch
- Parameters: 842,881
- Format: ONNX (
model.onnx) plus PyTorch weights (model.pt) andmanifest.json - Training data: fletxcher/khaos-tele_regime_shift
Results
Measured on the held-out test split of the training dataset.
| Metric | Value |
|---|---|
| test_patch_ap | 0.4191 |
| event_precision_tol1 | 0.4865 |
| event_recall_tol1 | 0.5658 |
| event_f1_tol1 | 0.5231 |
| threshold | 0.0500 |
| chance_ap | 0.0274 |
| n_test | 690 |
| event_f1_tol1_cwru_spliced | 0.6064 |
| event_f1_tol1_skab | 0.1494 |
| event_f1_tol1_uci_har_spliced | 0.6823 |
Test results by source
| Source | Windows | Patch AP | Event precision | Event recall | Event F1 |
|---|---|---|---|---|---|
| cwru_spliced | 150 | 0.453 | 0.481 | 0.819 | 0.606 |
| skab | 240 | 0.039 | 0.319 | 0.098 | 0.149 |
| uci_har_spliced | 300 | 0.796 | 0.520 | 0.991 | 0.682 |
skab is the real, annotated testbed data. The spliced sources are real recordings joined at a known change point, with the join smoothed during training. A second training stage fine-tunes on the real SKAB windows alone, selected on SKAB validation; the threshold was also chosen on the real SKAB validation windows.
Training
{
"epochs": 40,
"batch": 64,
"lr": 0.0005,
"kind": "regime",
"architecture": "RegimeShiftTransformer"
}
Best epoch 20, trained in 2.0 minutes on a single consumer GPU (RTX 3050 8 GB).
Intended use
Alerting when a machine or wearable moves to a different operating mode. Pad streams with fewer than 8 channels with zeros.
Limitations
- Real annotated change points come from a single industrial testbed (SKAB); other sources are spliced recordings.
- Window length is fixed at 512 samples.
- Sampling rates differ between sources and are not modelled.
Usage
pip install khaos
khaos serve ./tele_regime_shift
License
This model was trained on data with research-only, share-alike or mixed terms (see the training dataset card for each source). Treat it as research use and check the upstream data licenses before any commercial use.