Machine learning pipeline for converting Keras models to CMSIS-NN-friendly artifacts with quality gates and reproducibility targets.
models/
├── config/ # Model specifications (YAML)
├── data/ # Dataset generation utilities
├── training/ # Training entrypoints
├── quantization/ # Quantization / conversion helpers
├── adversarial/ # Robustness testing utilities
├── tests/ # Lightweight CI tests (no full TF required)
├── pipeline.py # Orchestrator
├── pyproject.toml # Locked dependencies (uv)
├── uv.lock # Lockfile — commit changes with dependency bumps
├── Dockerfile # Reproducible Linux environment
├── TOOLCHAIN.md # System tools not installable via pip
└── requirements.txt # Legacy pip subset; prefer `uv sync`
- Precision: high on pilot dataset (per config)
- Inference time: within embedded budget (per target MCU)
- Model size: within flash budget (e.g. 16KB class binaries where applicable)
- Adversarial robustness: documented failure modes where DeepXplore-style tests are enabled
- Reproducibility: fixed seeds and hashed artifacts where implemented in training scripts
cd models
# Install uv: https://github.com/astral-sh/uv
uv sync --python 3.11
# CI-equivalent smoke tests (config YAML only)
uv run pytest tests/ -qFull ML stack (TensorFlow, ONNX, adversarial libs):
uv sync --python 3.11 --extra fullSee TOOLCHAIN.md for QEMU, ARM GCC, and CMake (not provided via PyPI).
docker build -t edgeplug-models:local -f models/Dockerfile modelsRun stages from the models/ directory so imports such as data.generator resolve.
cd models
uv run python pipeline.py --helpIndividual modules (when the full environment is installed):
uv run python -m training.train --help
uv run python -m quantization.quantize --helpGitHub Actions (repo root) runs uv sync --frozen --python 3.11 and pytest tests/ for changes under models/. Coverage for the full TensorFlow stack is optional and can be added once a dedicated job or image is in place.
See the repository root CONTRIBUTING.md and SECURITY.md.