Embedded System Development Process
for AI Systems

Lecture Agenda

Learning Objectives

  • Compare traditional embedded SDLC models against AI/ML-augmented development lifecycles
  • Elicit and specify requirements that account for data, model behavior, and resource constraints
  • Apply hardware-software co-design principles to deploy AI models on constrained devices
  • Design and execute a testing strategy that addresses the non-determinism of ML components
  • Analyze real-world embedded AI failures to extract actionable engineering lessons

7.1 — Development Process Models
for AI Systems

Duration: 1 Hour

Why Traditional Models Fall Short

  • Classic embedded lifecycles (Waterfall, V-Model) assume deterministic, specification-complete behavior
  • AI components are data-dependent, probabilistic, and drift over time — behavior isn't fully known until trained and tested
  • Two artifacts to manage instead of one: code and model/data pipeline, each with its own versioning and change cadence
  • Model performance is empirically determined, not provably correct from specification
  • Data quality and representativeness affect correctness — bugs can live in the data, not the code

The V-Model, Adapted for AI

System Requirements Software Requirements Architecture Design Module Design Implementation Module Testing Integration Testing System Testing Field / Operational Validation Data Requirements Model Requirements Data Quality Validation Model Validation DECOMPOSITION VERIFICATION AI V-BRANCH

Agile for Embedded AI

  • Sprints split into code sprints (firmware/software) and model sprints (experiment-driven, metric-tracked)
  • Hardware-in-the-loop testing doesn't fit neatly into 2-week sprints
  • Model training cycles can be long and expensive (hours to days of GPU time)

Agile: Parallel Track Pattern

Software/Firmware Track (Scrum)

  • 2-week sprints
  • Sprint planning, daily standup, review
  • Embedded HW testing in sprint
  • Continuous integration for code

Model Track (Kanban + Experiment Tracking)

  • WIP-limited flow
  • Experiment logging (MLflow, W&B)
  • Longer cycle: data → train → evaluate
  • Promotion gates at integration points

▼ Integration Checkpoint: Model + Software merged and validated on target ▼

MLOps and Its Embedded Variant (TinyMLOps)

Data Collection Feature Engineering Training Validation ⚡ Model Compression (quantize / prune / distill) 🚀 Cross-Compile & Deploy (TFLite Micro / ONNX / TVM) On-Device Monitoring (lightweight telemetry) Retraining Trigger EMBEDDED-SPECIFIC ADDITIONS

TinyMLOps: Embedded-Specific Constraints

  • Model compression stage (quantization, pruning, distillation) required before packaging
  • Cross-compilation / target-specific build stage: converting to TFLite Micro, ONNX Runtime Mobile, vendor SDKs
  • On-device monitoring is constrained — limited telemetry bandwidth, statistical summaries only
  • Retraining loop is slower and costlier: OTA update risk, certification re-runs, limited connectivity
  • Model rollback capability is essential — every OTA model update carries risk

Hybrid Process Model (Recommended)

  1. Concept & Feasibility — define the AI task, target hardware envelope, power/latency budget
  2. Data Strategy — sourcing, labeling, augmentation plan
  3. Parallel Tracks — Software/Firmware (V-model or Agile) + Model (iterative MLOps)
  4. Co-Design Integration Points — scheduled sync where model size/latency checked against hardware budget
  5. System Integration & Test
  6. Deployment & Field Monitoring
  7. Continuous Improvement Loop — retraining, OTA updates

Process Model Comparison

Aspect Waterfall V-Model Agile MLOps-Hybrid
Handles changing requirements Poor Poor Good Good
Handles data-driven uncertainty Poor Moderate Moderate Strong
Traceability / certification fit Strong Strong Weak Moderate
Suited to safety-critical embedded AI Rare use Common (adapted) Rare alone Common (with V overlay)
Manages data/model lifecycle No No Partial Yes

Section 7.1 — Recap

  • No single process model fully fits embedded AI — most teams overlay MLOps onto a V-Model or Agile backbone
  • The core shift: manage data and model lifecycle as first-class artifacts, not side effects of "software"
  • Embedded constraints (compression, cross-compilation, limited telemetry) add stages that cloud MLOps doesn't need
  • Safety-critical domains require the traceability of V-Model with the responsiveness of iterative ML experimentation

7.2 — Requirements Engineering
for AI Embedded Systems

Duration: 1 Hour

What's Different About AI Requirements

  • Traditional: "the system shall do X given input Y" — fully specifiable
  • AI requirements often stated statistically: "classify with ≥95% precision on the target distribution"
  • Requirements must cover four layers: System, Functional/Behavioral, Data, and Model Performance
  • "Correctness" is probabilistic, not binary — a fundamentally different contract

Functional & Non-Functional Requirements

Functional

  • Task definition, input/output modality, operating conditions

Non-Functional (Embedded-Specific)

  • Latency — real-time inference deadlines
  • Power/energy budget — battery-operated, energy harvesting
  • Memory footprint — SRAM/Flash limits (often KB, not MB)
  • Thermal constraints — sustained inference may cause throttling
  • Reliability & availability under intermittent connectivity

Data Requirements (Unique to AI Systems)

  • Data sourcing — representativeness of target deployment environment
  • Labeling requirements — accuracy, inter-annotator agreement thresholds
  • Data volume & class balance — minimum samples per class, augmentation strategy
  • Data governance — privacy, consent, regulatory compliance (biometric, medical data)
  • Edge case & out-of-distribution (OOD) requirements — what must the system do when it doesn't know?

Model Performance Requirements

  • Beyond accuracy: precision/recall tradeoffs relevant to the application cost matrix
  • Robustness under sensor noise, adversarial perturbation, lighting/temperature variation
  • Explainability/interpretability requirements (often mandated in regulated domains)
  • Fairness/bias requirements across relevant subpopulations
  • Calibration — confidence scores should reflect actual likelihood of correctness

Safety & Regulatory Requirements

Standard Domain Key AI-Relevant Aspect
ISO 26262 Automotive ASIL levels, hardware metrics, safety lifecycle
IEC 61508 General industrial SIL levels, systematic capability
IEC 62304 Medical software Software safety classes, risk management
DO-178C Avionics DAL levels, with ED-324 AI supplement
  • Safety requirements must define fallback/degraded-mode behavior when the model is uncertain
  • Traceability: every model behavior must trace back to a validated requirement

Elicitation Techniques Adapted for AI

  • Stakeholder interviews plus data audits — what data actually exists vs. what's assumed
  • Scenario-based elicitation including failure scenarios — what happens when the model is wrong?
  • Prototyping with a baseline model early to surface unstated requirements
  • Requirements co-evolve with data exploration — expect iteration, not a frozen spec

Example: Smart Doorbell Person Detector

ID Requirement Type
FR-01 System shall detect human presence in frame within 200ms of trigger Functional
NFR-01 Inference shall consume ≤15mA average current on MCU X Non-Functional
NFR-02 Model binary shall fit within 256KB flash Non-Functional
DR-01 Training data shall include ≥30% low-light/night images Data
MR-01 False negative rate for adult humans shall be ≤2% at 95% CI Model Perf.
SR-01 On sensor fault, system shall default to "assume presence" (fail-safe) Safety

Section 7.2 — Recap

  • AI requirements engineering adds data and statistical performance contracts on top of traditional specs
  • Safety-critical systems require explicit degraded-mode and traceability requirements
  • Requirements co-evolve with data exploration — early prototyping surfaces hidden assumptions
  • Requirements must balance precision vs. recall based on real-world cost asymmetries

7.3 — Design & Implementation
of AI Systems

Duration: 1 Hour

Layered Embedded-AI Architecture

Communication / Monitoring Layer OTA updates, telemetry, drift monitoring
Decision / Actuation Layer Post-processing, control logic, fallback controllers
Inference Layer ML model execution, accelerator/NPU/MCU, runtime (TFLite, ONNX)
Preprocessing Layer Filtering, normalization, feature extraction, windowing
Sensing Layer Sensors, ADC, signal conditioning, calibration

Hardware-Software Co-Design

Compute Target Example Model Constraints Typical Use
MCU-class Cortex-M4/M7 Models in KBs, integer-only ops TinyML, keyword spotting
MCU + NPU/DSP Ethos-U, Hexagon Larger models, quantized INT8 Visual wake word, anomaly detection
SoC with GPU/NPU Jetson-class Larger CNNs/transformers feasible Object detection, multi-modal
  • Co-design loop: architecture search constrained by target's memory, compute (MACs/sec), and power
  • Roofline analysis determines if a model is compute-bound or memory-bound on the target

Model Optimization Techniques

  • Quantization: FP32 → INT8/INT4; QAT (quantization-aware training) retains better accuracy than post-training
  • Pruning: structured (remove channels/filters, hardware-friendly) vs. unstructured (sparse weights, needs special HW)
  • Knowledge distillation: train a small "student" model to mimic a larger "teacher"
  • NAS: Neural Architecture Search constrained by hardware cost models (latency-aware)
  • Operator fusion & graph optimization during compilation (TFLite converter, TVM, vendor SDKs)

Optimization Impact Example

Technique Model Size Accuracy (mAP) Inference Latency
Baseline (FP32) 4.2 MB 78.3% 85 ms
+ INT8 PTQ 1.1 MB 77.1% 32 ms
+ INT8 QAT 1.1 MB 77.9% 31 ms
+ Structured Pruning + QAT 0.6 MB 76.5% 18 ms
+ Knowledge Distillation 0.5 MB 77.2% 15 ms

Example values for object detection on ARM Cortex-M7 @ 400MHz. Always validate on actual target hardware.

Toolchains for Embedded AI

Model Runtimes

  • TensorFlow Lite Micro
  • ONNX Runtime Mobile
  • Apache TVM
  • CMSIS-NN

Development Platforms

  • Edge Impulse
  • STM32Cube.AI
  • MCUXpresso SDK
  • NVIDIA JetPack

Version Control Triad

  • Git (code)
  • DVC (data/models)
  • MLflow (experiments)
  • Git-LFS (large files)

Design Patterns for Reliability

  • Confidence thresholding — reject/flag low-confidence inferences rather than acting on them
  • Ensemble-lite / redundancy — cheap secondary heuristic check on top of model output for safety-critical actuation
  • Watchdog + fallback controller — classical control logic that takes over if the AI pipeline stalls or produces anomalous output
  • Graceful degradation — reduce model complexity/frequency under thermal or power stress

Implementation Checklist

  • Model fits memory budget with margin (typically ≥20% headroom)
  • Inference latency measured on actual target hardware, not simulator only
  • Numerical behavior validated after quantization (accuracy delta documented)
  • Fallback / safe-state logic implemented and testable independently of the model
  • OTA update mechanism supports model rollback
  • Confidence thresholding implemented with threshold derived from validation data

Section 7.3 — Recap

  • Embedded AI design is fundamentally a co-design problem — hardware limits shape model choice, not the reverse
  • Optimization techniques (quantization, pruning, distillation) trade accuracy for footprint/latency
  • Must validate post-transformation on actual hardware, not just in the training environment
  • Reliability patterns (confidence thresholding, watchdog, fallback) are requirements, not nice-to-haves

7.4 — Integration and Testing
of Embedded AI Systems

Duration: 1 Hour

Why AI Testing Differs

  • Non-determinism — same input can behave differently across FP vs. quantized builds, or across HW revisions
  • No complete oracle — "correct" output is statistical, not exact
  • Distributional risk — system may pass all test cases yet fail on real-world data drift
  • Emergent behavior — model behavior at scale may differ from controlled test environments

The Adapted Testing Pyramid

Unit Tests Preprocessing, tensor shapes, quantization math Model Validation Accuracy, precision/recall, confusion matrix, adversarial tests Integration Tests Full pipeline: sensor → preprocess → infer → actuate Hardware-in-the-Loop Real sensors/actuators + simulated environment Field / Operational Pilot deployment + monitoring Most tests (fast, cheap) Fewest tests (slow, expensive) ML-specific

Model-Specific Test Categories

Test Type Purpose Key Metric
Regression New model ≥ old model on full benchmark Accuracy delta ≥ 0
Robustness Noise, occlusion, lighting shifts, adversarial Degradation bounds
Edge case / OOD Inputs outside training distribution Fallback trigger rate
Latency & Resource WCET for inference, not just average P99 latency, peak RAM
Bias / Fairness Performance across subgroups Max performance gap

Test Data Management

  • Held-out test set must be strictly isolated from training/validation to avoid leakage
  • Maintain a golden dataset version-locked to each model release for reproducible regression
  • Synthetic / augmented data can supplement rare edge cases (simulated rain, sensor dropout)
  • Data lineage tracking: where each test sample came from, how it was labeled, and who approved it

Verification & Validation (V&V) for Certification

Verification

"Was the model built right?"

  • Traceability from requirement to test case
  • Training process reproducibility
  • Code and model review

Validation

"Was the right model built?"

  • Operational need met in real conditions
  • Explainability tools (saliency maps, SHAP)
  • Independent review of performance claims
  • Documentation trail: dataset lineage, training config, evaluation report, known limitations

Continuous Testing / CI for ML

  • On every model or code commit → unit tests → accuracy regression → resource/latency check on target
  • Gate merge on thresholds — model doesn't merge if accuracy drops below baseline
  • Canary deployment — roll out to 5% of devices, monitor, then expand
  • Shadow mode — run new model alongside old, compare outputs without acting on new model

Section 7.4 — Recap

  • Testing embedded AI requires layering classical practices (HIL, WCET) with ML-specific ones (regression, robustness, OOD, fairness)
  • Passing tests is not sufficient proof of safety — continuous field monitoring closes the gap
  • Test data management (isolation, golden sets, lineage) is as important as the tests themselves
  • Canary and shadow deployment strategies reduce risk of new model rollout

7.5 — Case Studies and Failures
in AI Embedded Systems

Duration: 1 Hour

Each case: Context → What Went Wrong → Root Cause → Lesson

Case 7.5.1 — Autonomous Driving: Fatal Pedestrian Collision (2018)

Context

A self-driving test vehicle operating in autonomous mode struck and killed a pedestrian crossing outside a crosswalk at night.

What Went Wrong

The perception system detected the pedestrian but repeatedly reclassified the object type, resetting its predicted trajectory each time. Emergency braking was disabled in autonomous mode, and the safety driver was not attentive.

Root Cause

Classification system not designed to handle jaywalking pedestrians reliably. Disabled automatic emergency braking during testing. Inadequate human-oversight design.

Lesson

Safety-critical embedded AI needs an independent, simpler safety layer (e.g., classical collision-avoidance braking) that operates regardless of the primary model's classification confidence or consistency.

Case 7.5.2 — Flight Control: Repeated Nose-Down Commands (2018–2019)

Context

A flight control augmentation system used a single angle-of-attack sensor to trigger automatic nose-down trim commands.

What Went Wrong

A faulty sensor reading caused repeated, aggressive automatic trim inputs that pilots struggled to counteract, contributing to two fatal accidents.

Root Cause

Reliance on a single sensor input without redundancy or plausibility cross-checks. Insufficient disclosure and training on the system's authority.

Lesson

Embedded systems with autonomous actuation of critical controls require sensor redundancy, cross-validation, and clear override/fallback authority for human operators.

Case 7.5.3 — Clinical Decision-Support AI Underperformance

Context

A commercial AI system was deployed to recommend cancer treatment plans, trained substantially on synthetic and limited real patient data.

What Went Wrong

The system recommended treatments misaligned with clinical guidelines in various real-world cases and failed to generalize beyond its narrow training distribution.

Root Cause

Insufficient representative training/validation data. Performance claims not adequately validated against independent, real-world outcomes before deployment.

Lesson

Model validation must specify representativeness of the deployment population. Performance claims should be independently verified before high-stakes deployment — not accepted from vendor benchmarks alone.

Case 7.5.4 — Voice Assistant: False-Trigger Privacy Incidents

Context

Always-listening embedded voice assistants use a low-power wake-word detector to trigger cloud-based full processing.

What Went Wrong

Wake-word detectors occasionally misfired on unrelated speech, causing unintended audio capture and transmission to the cloud.

Root Cause

Models tuned primarily for recall (avoid missing activations) with insufficient attention to false-positive rate under diverse acoustic conditions.

Lesson

Requirements must balance false-positive vs. false-negative costs based on privacy and trust impact. Sensitive data should be filtered/minimized as close to the sensor as possible.

Case 7.5.5 — Industrial Predictive Maintenance: Silent Model Drift

Context

An embedded vibration-analysis model deployed on factory equipment to predict failures.

What Went Wrong

Accuracy degraded silently over months as machinery wear patterns and ambient conditions shifted from the training distribution.

Root Cause

No on-device or fleet-level drift monitoring. Retraining cadence not tied to any measured performance signal.

Lesson

Embedded AI needs lightweight on-device drift/confidence monitoring and defined retraining triggers — silence is not evidence of continued correctness.

Cross-Case Themes

Theme Cases Illustrating It
Single point of sensor/model failure without redundancy Flight control, autonomous vehicle
Insufficient representative training/validation data Clinical AI, predictive maintenance
Missing independent safety fallback layer Autonomous vehicle, flight control
Wrong optimization target (recall vs. precision, benchmark vs. real-world) Voice assistant, clinical AI
No field monitoring for drift/degradation Predictive maintenance

Section 7.5 — Recap

  • Nearly every failure traces back to process gaps covered in 7.1–7.4: weak requirements, missing co-design safeguards, insufficient testing/monitoring
  • Robust process — not just a better model — prevents failures from recurring
  • Independent safety layers and redundancy are non-negotiable in safety-critical applications
  • Field monitoring with drift detection is essential — deployed models are never "done"

End-of-Lecture Summary

1

Process

Overlay MLOps onto V-Model/Agile; manage code, data, and model as parallel first-class tracks

2

Requirements

Specify data, statistical performance, and safety fallback behavior explicitly

3

Design

Co-design model and hardware together; optimize and validate post-transformation

4

Testing

Layer classical (HIL, WCET) with ML-specific (regression, robustness, OOD, fairness) and continuous field monitoring

5

Failures

Consistently trace to skipped redundancy, unrepresentative data, missing fallback logic, or absent drift monitoring

Thank You

Questions & Discussion

Section 7 — Embedded System Development Process for AI Systems