Khaos Robot Failure Detection
A causal transformer that gives, at every timestep, the probability that a bimanual robot has stalled or started to chatter, using only past states so it can run in a control loop.
robo_failure_detection 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: FailureDetector: 4-layer causal transformer (dim 128, 4 heads) with a per-step logit, wrapped with input standardization
- Parameters: 928,299
- Format: ONNX (
model.onnx) plus PyTorch weights (model.pt) andmanifest.json - Training data: fletxcher/khaos-robo_failure_detection
Results
Measured on the held-out test split of the training dataset.
| Metric | Value |
|---|---|
| alarm_threshold | 0.9703 |
| test_step_auroc | 0.9970 |
| test_false_alarm_rate | 0.0333 |
| test_detection_rate | 0.9667 |
| test_median_delay_steps | 3.0000 |
| test_baseline_false_alarm_rate | 0.4333 |
| test_baseline_detection_rate | 0.2111 |
| test_unseen_task_step_auroc | 0.9915 |
| test_unseen_task_false_alarm_rate | 0.1859 |
| test_unseen_task_detection_rate | 0.9615 |
| test_unseen_task_median_delay_steps | 3.0000 |
| test_unseen_task_baseline_false_alarm_rate | 0.1026 |
| test_unseen_task_baseline_detection_rate | 0.0833 |
Failure detection
The alarm threshold is the lowest value that keeps the false-alarm rate on validation clean episodes at or below 5%. An alarm needs 3 consecutive steps above threshold. Delay is measured in steps (25 Hz) from the failure onset. The baseline flags a stall when every joint moves less than 0.004 rad per step for 10 steps, so it cannot see chatter.
| Split | Episodes | Step AUROC | False-alarm rate | Detection rate | Median delay | Baseline false-alarm rate | Baseline detection rate |
|---|---|---|---|---|---|---|---|
| test | 180 | 0.997 | 0.033 | 0.967 | 3.0 | 0.433 | 0.211 |
| test_unseen_task | 312 | 0.991 | 0.186 | 0.962 | 3.0 | 0.103 | 0.083 |
Training
{
"epochs": 80,
"batch": 32,
"lr": 0.0005,
"architecture": "FailureDetector"
}
Best epoch 21, trained in 4.4 minutes on a single consumer GPU (RTX 3050 8 GB).
Intended use
Real-time monitoring: read the failure probability at the last timestep and alarm above the calibrated threshold.
Limitations
- Trained on synthetic failures (freezes and chatter) injected into real demonstrations; real failures such as drops and collisions are not covered.
- A deliberate pause during a task can look like a stall.
Usage
pip install khaos
khaos serve ./robo_failure_detection
License
Trained on openly licensed (MIT and Apache-2.0) robot demonstrations with synthetic failures; released under Apache-2.0.