Optimized embedded AI: efficient implementation of CNNs on ESP32-CAM for real-time image classification
摘要
This paper presents a lightweight Embedded Artificial Intelligence system for real-time image classification on ultra-low-cost microcontrollers. Built on the ESP32-CAM platform, our system integrates a quantized Convolutional Neural Network (CNN) trained on the Fashion MNIST dataset, achieving 92.3% accuracy. Beyond standard model design, our main contribution lies in the system-level integration of AI inference, web-based interaction, and sensor control within severe hardware constraints: 520 KB SRAM, no FPU, and limited stack space. This work highlights the engineering innovations required to overcome ESP32-CAM’s memory, concurrency, and scheduling constraints-barriers often underexplored in the literature. We address key engineering challenges such as TensorFlow Lite buffer overflows, quantized memory misalignment, and real-time task arbitration between AI, camera, and WiFi modules. A responsive web interface enables real-time streaming and prediction on-device. Experimental benchmarks demonstrate accuracy close to higher-end embedded systems while operating at nearly six times lower cost and nearly four times lower power. This work advances the practical deployment of AI in constrained environments, offering a reproducible framework for edge robotics and TinyML applications.