series · in progress

Edge AI Lab Notes: The Data Between Training and Device

Experiments on the data side of edge AI: keeping Python and C in agreement, what storage and query choices really cost, and checks that fail the build.

5 of 12 published · started 2026-08-08

Most edge AI guides are about the model: how to shrink it, convert it, load it onto a device and make it run faster. They rarely cover what happens around the model. That includes the recorded sensor data, the code that cuts it into windows, the file it is stored in, and the point where a model trained in Python meets firmware written in C and the two quietly disagree about what “a window of data” means.

That part is where most of my time on these projects has actually gone, and its failures do not crash. They produce answers that look reasonable and are wrong, and it is easy to spend weeks blaming the model. This series shows how to set up a project so that these mistakes make a build fail, instead of slipping through unnoticed.

Nothing here depends on a particular product. It applies whether you are building a fall detector, a presence sensor, a machine that predicts equipment failure or a voice command detector. You do not need to be an expert to follow it: each post explains the terms it uses.

The companion code runs on an ordinary laptop, with no sensor board and no dataset to download. It uses a generator that produces synthetic data with the same properties as real sensor recordings. Every benchmark result was measured on a Raspberry Pi 5 with 8 GB of memory, running Raspberry Pi OS Bookworm from an SD card, and each run records the processor temperature so that a slowed-down, overheated run cannot pass for a real result. The raw results are in the repository alongside the code.

The series is written to be read in order. Each part builds on the one before it: the contract defines the data, the file format preserves it, and the query engine checks it. If you already have a working pipeline and only want the measurements, start with Part 2, where the benchmarks begin.

Part 4, comparing Parquet and Arrow, is in progress.

Start reading: Why Some Edge AI Bugs Never Crash →

coming next 2.1 Why Parquet for Edge AI Data: The File Format Is Part of the Contract, on 12 November 2026. The RSS feed will carry it.

  1. 1.1
    Why Some Edge AI Bugs Never Crash

    When a model trained in Python runs on a device programmed in C, the two can disagree about the data without any error. Why it happens, and how to catch it.

  2. 1.2
    One Source for Python and C: Generating Shared Constants

    Shared values like window length and channel order belong in one file. Generate the Python and C versions from it, and catch drift with one command.

  3. 1.3
    Golden Vectors: Testing That Python and C Calculate the Same Features

    A hash cannot tell whether two functions agree. Golden vectors can: saved inputs and outputs that both the Python and the C code must reproduce.

  4. 1.4
    Choosing Test Cases, and Proving They Catch Real Bugs

    How to design test inputs that each target a specific mistake, then break the C code ten ways on purpose to prove the test catches every one.

  5. 1.5
    Refusing to Build on Guessed Values

    Some settings cannot be decided until there is real data. Make the firmware refuse to build until they are, while everything else stays testable.