Skip to content

Latest commit

 

History

History
79 lines (56 loc) · 2.46 KB

File metadata and controls

79 lines (56 loc) · 2.46 KB

EdgePlug ML modeling pipeline

Machine learning pipeline for converting Keras models to CMSIS-NN-friendly artifacts with quality gates and reproducibility targets.

Repository layout (this directory)

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`

Quality gates (targets)

  • 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

Quick start (recommended)

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/ -q

Full ML stack (TensorFlow, ONNX, adversarial libs):

uv sync --python 3.11 --extra full

See TOOLCHAIN.md for QEMU, ARM GCC, and CMake (not provided via PyPI).

Docker

docker build -t edgeplug-models:local -f models/Dockerfile models

Pipeline usage

Run stages from the models/ directory so imports such as data.generator resolve.

cd models
uv run python pipeline.py --help

Individual modules (when the full environment is installed):

uv run python -m training.train --help
uv run python -m quantization.quantize --help

Continuous integration

GitHub 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.

Contributing

See the repository root CONTRIBUTING.md and SECURITY.md.