How abtinmbm/andon works
Andon is an anomaly-detection product that learns normal machine sounds and signals deviations through an andon light. Its principal workflow is audio/data ingestion → log-mel features → model training and anomaly scoring → control limits and light-state simulation. The repository also includes benchmark evaluation, int8 conversion/export, a dashboard, and a Pico-oriented C firmware path. README statements support the documented end-to-end capabilities; firmware internals are only partly sampled, so uncertain internal connections are omitted or marked unverified.
Main entry points: features.py Feature extraction/cache · train_idcnn.py CNN training · train.py Baseline training · score.py Anomaly scoring
Components 24
Data and features
- DCASE dataset
andon/data/dataset.py - WAV audio I/O
andon/data/audio.py - Feature extraction/cache
andon/data/features.py - Log-mel frontend
andon/features/logmel.py
Detection models
- Classic models
andon/models/classic.py - Autoencoder
andon/models/autoencoder.py - Machine-ID CNN
andon/models/idcnn.py - Baseline training
andon/train.py - CNN training
andon/train_idcnn.py
Scoring and evaluation
- Experiment configuration
andon/experiment.py - Anomaly scoring
andon/score.py - Benchmark evaluation
andon/evaluate.py - Light state logic
andon/light.py - Stream simulator
andon/simulate.py - Int8 conversion
andon/quantize.py
Embedded device
- C model export
andon/export_c.py - Firmware controller
firmware/src/main.c - Microphone stream
firmware/src/mic_stream.c - C log-mel frontend
firmware/src/logmel.c - C inference model
firmware/src/model.c
Interfaces
- Dashboard
dashboard/app.py
Other components
- Machine audio
- DCASE recordings
- Fan hardware
Connections 31
- DCASE recordings → DCASE dataset: provides clips
- DCASE dataset → Feature extraction/cache: selects clips
andon/data/features.py - Feature extraction/cache → WAV audio I/O: reads WAV
andon/data/features.py - Feature extraction/cache → Log-mel frontend: extracts features
andon/data/features.py - Feature extraction/cache → CNN training: supplies features
andon/train_idcnn.py - Feature extraction/cache → Baseline training: supplies features
andon/train.py - Baseline training → Autoencoder: trains
andon/train.py - Baseline training → Classic models: trains
- CNN training → Machine-ID CNN: trains
andon/train_idcnn.py - CNN training → DCASE dataset: loads normal clips
andon/train_idcnn.py - Baseline training → Experiment configuration: uses run config
andon/train.py - CNN training → Experiment configuration: uses run config
andon/train_idcnn.py - Anomaly scoring → CNN training: uses scoring helpers
andon/score.py - Anomaly scoring → Benchmark evaluation: evaluates scores
andon/score.py - Stream simulator → Anomaly scoring: scores windows
andon/simulate.py - Stream simulator → Light state logic: drives states
andon/simulate.py - Benchmark evaluation → DCASE dataset: scores test clips
andon/evaluate.py - Benchmark evaluation → Experiment configuration: logs results
andon/evaluate.py - Machine-ID CNN → Anomaly scoring: produces ID scores
- Int8 conversion → Machine-ID CNN: converts model
andon/quantize.py - Int8 conversion → Benchmark evaluation: checks scores
andon/quantize.py - C model export → Int8 conversion: exports int8 model
andon/export_c.py - C model export → C inference model: writes C headers
- Machine audio → Microphone stream: streams sound
- Firmware controller → Microphone stream: uses stream
firmware/src/main.c - Microphone stream → C log-mel frontend: feeds frames
- C log-mel frontend → C inference model: provides features
- Firmware controller → Fan hardware: controls fan
firmware/src/main.c - Dashboard → Stream simulator: uses demo flow
dashboard/app.py - Dashboard → Experiment configuration: uses configuration
dashboard/app.py - Dashboard → Light state logic: uses light logic
dashboard/app.py