Edge AI Deployment Checklist
A model that works in a notebook is not a deployed model. This checklist covers the four things that most often go wrong when you move a model onto an edge device: choosing the number format, inspecting what you are actually deploying, budgeting memory and time, and turning raw predictions into reliable alerts. For the big picture, start at AI Start Here.
1. Quantization: INT8 vs FP16
Section titled “1. Quantization: INT8 vs FP16”Quantization stores weights (and often activations) in fewer bits. It shrinks the model and can speed it up, at some risk to accuracy.
| FP32 (baseline) | FP16 | INT8 | |
|---|---|---|---|
| Bits per weight | 32 | 16 | 8 |
| Approx. size vs FP32 | 1x | about 0.5x | about 0.25x |
| Speed | Baseline | Faster only if hardware supports half precision well (many GPUs and some accelerators) | Often fastest on CPUs, microcontrollers and NPUs with integer kernels |
| Accuracy risk | None (reference) | Usually very small | Small to noticeable; must be measured |
| Needs calibration data | No | No | Yes for full-integer post-training quantization |
| Typical target | Training, servers | GPU or capable edge accelerators | Microcontrollers, Raspberry Pi CPU, integer-only accelerators |
Post-training quantization vs quantization-aware training
Section titled “Post-training quantization vs quantization-aware training”- Post-training quantization (PTQ). Convert a trained model. Fast and needs no retraining. For full-integer INT8 you supply a representative dataset: a few hundred real, varied input samples that the converter runs through the model to estimate the value range of each tensor (the scale and zero-point).
- Quantization-aware training (QAT). Simulate quantization during training so the model learns to tolerate it. More work, but it recovers accuracy when PTQ loses too much.
What to do
- Evaluate the FP32 model on a held-out test set and record the metric.
- Convert to INT8 with a representative dataset and evaluate again on the same test set.
- If the drop is too large, try per-channel quantization if your toolchain offers it, then QAT, then keep selected layers in higher precision.
- Re-check on-device. Host-side evaluation and on-device results can differ.
2. Inspect the model with Netron
Section titled “2. Inspect the model with Netron”Netron is a free viewer for model files (TensorFlow Lite, ONNX and others). Open the file before you flash it and check:
| Check | Why it matters |
|---|---|
| Input shape and type | Must match your preprocessing exactly: channel order, size, and whether input is float32 or int8. A mismatch gives plausible but wrong outputs. |
| Output shape | Confirms the number of classes or the box and score layout your post-processing expects. |
| Operators used | Your runtime may not support every op. Unsupported ops fail at load or fall back to a slow path. Compare against the operator list of your runtime or accelerator. |
| Quantization parameters | For an INT8 model, the input and output tensors carry a scale and zero-point. You need them to convert real values to int8 and back. |
| File size | Gives a first estimate of flash use. It is not the RAM use. |
3. RAM and latency budgeting
Section titled “3. RAM and latency budgeting”Flash vs RAM
Section titled “Flash vs RAM”- Flash holds the model weights (read-only data) and your firmware. Model file size is roughly your flash cost.
- RAM holds the working buffers. In TensorFlow Lite for Microcontrollers this is the tensor arena: one block you allocate statically, sized to fit all intermediate tensors. Too small and allocation fails at start-up; too large wastes RAM you need for Wi-Fi, TLS and buffers.
Budget both, plus headroom:
Flash: firmware + model weights + OTA slot(s) <= partition size RAM: tensor arena + input/output buffers + Wi-Fi/MQTT/TLS stacks + stacks and heap <= usable RAMFind the arena size by trying values and reading what the runtime reports it used, then add a margin.
Measure real inference time
Section titled “Measure real inference time”- Do not trust datasheet numbers or desktop timings. Time the invoke call on the target with a hardware timer, over many runs.
- Warm-up: the first inference is often slower (cache, lazy initialisation). Discard the first few runs and report the median and the worst case.
- Measure the whole pipeline, not just the model: sampling, pre-processing, inference and post-processing.
Sensor sampling budget
Section titled “Sensor sampling budget”Total time per cycle must fit within the sampling period.
window period (e.g. 1000 ms) |-- acquire --|-- preprocess --|-- inference --|-- publish --|-- idle --|If acquisition plus compute exceeds the period, you drop samples or fall behind. Also consider power: running inference constantly drains batteries, so check the numbers with the IoT Battery Calculator.
4. From detection to MQTT and Modbus alerts
Section titled “4. From detection to MQTT and Modbus alerts”Confidence threshold and debouncing
Section titled “Confidence threshold and debouncing”A model outputs a score per frame or window. Do not alert on every score above the threshold.
- Confidence threshold: choose it from your validation data, trading missed events against false alarms.
- Debounce / N-of-M rule: require the condition in, say, 3 of the last 5 inferences before raising an alarm.
- Hysteresis: raise at a high threshold (e.g. 0.80), clear only below a lower one (e.g. 0.60), so the state does not chatter around a single value.
- Cooldown: limit repeat alerts for the same event.
Topic naming and payload
Section titled “Topic naming and payload”Use a consistent hierarchy, for example site/line1/cam01/ai/alerts. Validate your filters with the MQTT Topic Tester. Include a timestamp, model version and enough context to debug later.
{ "ts": "2026-11-22T10:15:30Z", "device": "cam01", "model": "ppe-yolo-int8-v3", "event": "no_helmet", "confidence": 0.87, "state": "alarm"}Publishing with paho-mqtt (Python)
Section titled “Publishing with paho-mqtt (Python)”import json, timeimport paho.mqtt.client as mqtt
client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION2) # paho-mqtt 2.xclient.username_pw_set("edge-user", "change-me")client.connect("192.168.1.10", 1883)client.loop_start()
payload = {"ts": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()), "device": "cam01", "event": "no_helmet", "confidence": 0.87, "state": "alarm"}client.publish("site/line1/cam01/ai/alerts", json.dumps(payload), qos=1)client.loop_stop()Mapping an alarm to a Modbus coil
Section titled “Mapping an alarm to a Modbus coil”If a PLC or SCADA system expects Modbus, expose the debounced alarm as a coil (a single read/write bit). This pymodbus sketch assumes a Modbus TCP server at the given address. Use the virtual Modbus lab to try it safely.
from pymodbus.client import ModbusTcpClient
client = ModbusTcpClient("192.168.1.20", port=502)client.connect()client.write_coil(0, True) # coil 0 = AI alarm activeclient.close()Notes: pymodbus parameter names for the unit/device ID have changed between versions, so check the documentation for your installed version if you need a non-default ID. Agree the coil address map with whoever owns the PLC, and never let an AI alarm drive a safety function directly.
Printable checklist
Section titled “Printable checklist”- FP32 baseline metric recorded on a held-out test set
- Quantized model evaluated on the same test set; accuracy drop accepted
- Representative dataset comes from real deployment conditions
- Model opened in Netron: input shape, type and output layout verified
- All operators supported by the target runtime or accelerator
- Input and output scale/zero-point used correctly in code
- Flash budget checked, including OTA space
- Tensor arena sized, with RAM headroom for networking and stacks
- Inference time measured on the device (median and worst case, after warm-up)
- Full cycle fits the sampling period
- Confidence threshold chosen from validation data
- Debouncing and hysteresis implemented
- MQTT topic and JSON payload documented and tested
- Broker uses authentication and TLS outside the lab
- Modbus coil map agreed and tested if used
- Model version included in every alert
- Offline behaviour defined (buffer, retry or drop)
- Update and rollback plan for the model written down