Dataset and Codebase for Resilient Edge: Deploying and Measuring Real-Time Network Fault Diagnosis on Resource-Constrained Embedded Systems
Abstract
Dataset and codebase for "Resilient Edge" — an on-device network fault classifier that separates Baseline operation, Network Congestion, and Distance attenuation on an ESP32 microcontroller using RSSI and latency. The deployed model is a depth-two decision rule over those two features. Seven models were ported to C and profiled on the device by cycle counting; inference and transmission energy were measured with the whole board supplied through an INA219 current shunt. KEY MEASURED RESULTS Hold-out accuracy (main dataset, packet-level split): 91.93% (5,699-packet test split; 10-fold CV: 91.86 ± 0.40%) Single-clock causal accuracy: 93.53% (95% CI [92.05, 94.84]; 8,064 exchanges in 18 sessions recorded on one day, run held out; each decision uses the round-trip time of the preceding exchange) Grouped accuracy (main dataset): 77.85% Leave-One-Day-Out (95% CI [53.65, 99.13]); 73.10% Leave-One-Session-Out (95% CI [51.26, 91.78]) Inference latency: 16 marginal CPU cycles (66.7 ns @ 240 MHz), with 30-cycle harness overhead subtracted Inference energy: 11.0 nJ per decision above an idle processor (33.3 nJ in total, whole board); 1.23 nJ marginal above an active CPU loop Wi-Fi transmission energy: 10.4 mJ per 230-byte packet within a stream of 50 packets per second; 29.8 mJ when sent alone every 2 s REPOSITORY STRUCTURE ResilientEdge_Code_and_Data_v3.1/ README.md 01_Main_Dataset_and_Model/ esp32EdgeAI.ipynb training, ablation, evaluation model.h deployed rule as a C header 01_Raw_Data/ 28,696 raw packets, 3 days x 3 classes (28,495 analysed) 02_Device_Measurements_and_Analysis/ README.md 01_Results/ cycle counts, energy, grouped validation, congestion sweep 02_Raw_Logs/ node serial records, INA219 energy records, gateway logs 03_Firmware/ benchmark, energy and round-trip sketches; C model ports 04_Tools/ analysis, measurement and figure scripts 03_Single_Clock_Latency_Dataset/ README.md 01_Results/ processed dataset (8,064 exchanges) & grouped validation 02_Raw_Logs/ node records of 18 sessions and a calibration; gateway logs 03_Firmware/ sensor-node sketch (round trip timed on the node) 04_Tools/ capture software and grouped evaluation USAGE Model training & ablation: run 01_Main_Dataset_and_Model/esp32EdgeAI.ipynb. Statistics & grouped validation: run analyse_models.py and analyse_grouped.py under 02_Device_Measurements_and_Analysis/04_Tools/. Energy: run analyse_energy.py on each energy record in 02_Raw_Logs/, then energy_paper_table.py; the folder README gives the commands. Single-clock causal validation: run build_dataset.py, then grouped_eval.py, under 03_Single_Clock_Latency_Dataset/04_Tools/. MCU deployment: include model.h in an Arduino sketch on an ESP32. The README files list every command. The analyses need no hardware. ENVIRONMENT & CREDENTIALS ESP32-WROOM-32 (240 MHz) with a DHT22 sensor; INA219 current sensor (0.1 Ω shunt) in series with the 5 V supply, used for the energy measurements only; Raspberry Pi 5 gateway (Ubuntu 24.04). Python 3.11 or later with NumPy, pandas, SciPy, scikit-learn, Matplotlib and seaborn; arduino-cli for the firmware. All secrets.h files contain placeholders only.