Secure Edge-ML: A Tamper-Resistant and Spoof-Resilient TinyML Architecture for Resource-Constrained IoT Devices
Secure Edge-ML: A Tamper-Resistant and Spoof-Resilient TinyML Architecture for Resource-Constrained IoT DevicesAbstract Traditional edge artificial intelligence systems prioritize inference performance while leaving critical security gaps, such as vulnerability to sensor data-injection spoofing, flash firmware modification, and physical RAM extraction. This work proposes and demonstrates Secure Edge-ML, an industrial-grade, zero-trust architecture implemented on an ESP32 microcontroller that unifies high-speed machine learning inference with robust embedded cybersecurity. Introduction As artificial intelligence migrates to resource-constrained edge microcontrollers (TinyML), systems face severe physical and digital threat vectors. Edge nodes deployed in industrial or automotive environments are routinely exposed to sensor spoofing, physical tampering, and firmware extraction. Conventional implementations treat machine learning and embedded security as isolated silos, leaving networks vulnerable. This project bridges that gap by introducing a multi-layered defense-in-depth architecture on an ESP32-DevKitC V4 platform, proving that strict security validation can coexist with hard real-time execution constraints. Content & System Architecture Deterministic TinyML Inference Engine: Executes a quantized neural network model locally on the edge node in 118 microseconds, satisfying hard real-time industrial control constraints. Sensor Anti-Spoofing & Rail Validation: Intercepts raw ADC streams via a continuous potentiometer setup on GPIO 34 to block false data injection (e.g., voltage forced to absolute ground 0 or maximum rail 4095) prior to model evaluation. Boot Integrity Verification: Computes and verifies a cryptographic hash (0xAEAD4201) of model weights stored in flash memory during boot to prevent unauthorized firmware modification. Physical Tamper Protection: Implements an automated hardware interrupt linked to an enclosure intrusion switch (push-button with a pull-down resistor on GPIO 12) that performs instant RAM sanitization upon physical breach. Parameters Proving Superiority To prove compliance with industrial security guidelines (such as IEC 62443 and automotive functional safety standards), this prototype demonstrates that multi-layered security incurs zero performance penalty: Inference Latency: Maintained at an elite 118 µs, preserving real-time actuator response times. Threat Mitigation Rate: 100% interception of rail-saturation and spoofing attacks, safely bypassing untrusted inferences ([SECURITY ALERT] Sensor spoofing / rail saturation detected!). Memory Protection: Eliminates plaintext weight and key leakage during physical inspection through automated hardware-level sanitization. Repository Files & Images Manifest main(1).c : Core firmware housing the TinyML inference engine, boot hash verification, anti-spoofing rail filter, and physical tamper interrupt routines. diagram(1).json: Complete Wokwi simulation schematic wiring the ESP32-DevKitC V4, industrial sensor potentiometer (GPIO 34), and tamper push-button with pull-down resistor (GPIO 12). eml_out1.jpg: Execution logs demonstrating simultaneous real-time 118 µs normal inferences and security threat interceptions during rail-saturation events. eml_out2.jpg: Visual proof of the active Wokwi hardware simulation layout and serial monitor security outputs confirming physical component assembly and real-time threat reporting. Conclusion The Secure Edge-ML prototype successfully demonstrates that high-performance edge AI and enterprise-grade embedded security are mutually achievable on low-cost hardware like the ESP32. By combining real-time anomaly detection, pre-inference rail-saturation validation, flash integrity hashing, and physical tamper key-shredding, this architecture establishes a new benchmark for trustworthy industrial IoT deployment.
Authors
- Vasudevan Swornampillai (ORCID: https://orcid.org/0009-0004-4933-771X)
Institutions
- Embedded Systems (United States) (US)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-10-18
- DOI
- https://doi.org/10.5281/zenodo.23457960
- Primary Topic
- Security and Verification in Computing
- Type
- preprint