Pico-Former: a curve–event glucose Transformer on ESP32-S3
Abstract
This reproducibility-focused software archive provides Pico-Former, an on-device curve–event glucose Transformer for ESP32-S3. It accompanies the manuscript Pico-Former: a curve–event glucose Transformer on ESP32-S3. The repository supports independent audit of four connected device designs: (1) a 96-token, width-48 encoder whose activations fit in ESP32-S3 internal SRAM; (2) one Core-1 forward pass that emits a 48-point 1–4 h trajectory and 16 event logits; (3) Flash-resident validation-frozen thresholds so event flags are ℓ ≥ τ; and (4) a dual-core contract that leaves wireless I/O on Core 0. Tokenization, residual-on-inertia, and the τ protocol follow the public RICE-Former archive (Zenodo 10.5281/zenodo.22171786). Included materials ESP32-S3 firmware: self-attention, cross-attention, residual glue, and dual-core I/O (CEQT remains the engineering codename of the network) Host audit scripts to export weights from an authorized checkpoint and to stream holdout windows over serial Privacy-preserving aggregate tables for the AZT1D holdout curve and event recomputes Scripts of the revised manuscript (code/): board audit of five full sets, event tables with participant-clustered intervals, quantized baseline, design space, input checks and fault injection, wireless and HTTPS tests, and figures, with the aggregate results they write (code/results/) On-board summaries of the original submission (results/validation/) Documentation for data access, reproducibility, and GitHub–Zenodo release steps Repository layout firmware/: PlatformIO project for ESP32-S3 host/: weight export and serial-audit scripts (they import ceqt from a local RICE-Former checkout) results/tables/: aggregate AZT1D holdout curve and event tables code/ and code/results/: scripts and aggregate results of the revised manuscript results/validation/: on-board summaries of the original submission docs/: data access, reproducibility, and release instructions Install and verify cd firmware pio run -e s3_n16r8 -t upload Obtain AZT1D from its original provider and the RICE-Former source tree as described in docs/data-access.md. Export weights from an authorized checkpoint, then run python host/run_validation.py with RICE_FORMER_SRC, RICE_CKPT, and RICE_CACHE set. In version v1.1.0, every window of five sets (the AZT1D held-out sets of three independently trained models, OhioT1DM, and DiaTrend; 180,029 windows) was replayed to ESP32-S3 boards (chip revision v0.2, 240 MHz, hardware FP32). All 2,880,464 decision cells agree with the float64 host reference of the same checkpoint (largest logit difference 2.6e-5), the paired FNR/FPR are equal on both sides (4 h hypo70 0.669/0.043 for the deployed model), the median pass time on the deployed-model holdout is 393.3 ms, and the 196,608 B working buffer stays in internal SRAM. Commands for every table and figure are listed in docs/reproduce.md. Data and privacy boundary AZT1D remains available from Mendeley Data, 10.17632/gk9m674wcx.1. The host protocol, locked splits, and aggregate PC tables are archived as RICE-Former, 10.5281/zenodo.22171786. This deposit archives firmware source, host and revision scripts, and aggregate results. Raw CGM records, participant windows, trained weights, firmware images, and dataset archives are not redistributed; OhioT1DM and DiaTrend are obtained from their providers under their access conditions. Details are provided in docs/data-access.md. Citation Please cite this software archive as: Liu Q, Yang M, Wang Z, Wang S, An X, Lu S, Yang Q, Liu M, Wu Z, Huang D. Pico-Former: a curve–event glucose Transformer on ESP32-S3. Zenodo. https://doi.org/10.5281/zenodo.22218446 Please also cite the companion host archive: Liu Q, Yang M, Wang Z, Wang S, An X, Lu S, Yang Q, Liu M, Wu Z, Huang D. RICE-Former: a curve–event Transformer. Zenodo. https://doi.org/10.5281/zenodo.22171786 Citation metadata are also provided in CITATION.cff. Please cite the accompanying manuscript when referring to the scientific findings. Software repository: https://github.com/modalfuse/pico-former