Low-Power Edge AI-Based Color Ball Detection on Microcontrollers for Gaming Machines

Author: Min-Sheng Chen (陳旻盛)  |  Advisor: Prof. Tsung-Han Tsai (蔡宗漢)  |  M.S. Thesis, 2025
AISoC Laboratory, Department of Electrical Engineering, National Central University

Abstract

Edge AI has emerged as a promising alternative to cloud-based computing for real-time object detection, particularly in resource-constrained environments. In this study, we propose a color ball detection system based on TinierSSD, optimized for deployment on the MAX78000 DNN accelerator. A custom dataset comprising 2400 images was constructed and utilized for model training, followed by 8-bit quantization and generation of embedded C code. The final model has a compact size of only 300 KB, enabling efficient deployment on memory-limited hardware. The system was evaluated in real-time with a built-in camera module, achieving an inference time of 13.8 ms and an ultra-low power consumption of 354 µJ per inference, while maintaining an mAP of 76.2%. These results demonstrate the feasibility of deploying low-power deep learning models for real-time applications in gaming machines.

Architecture

The architecture of our proposed system can be divided into five stages: dataset preparation, model training, quantization, code synthesis, and real-time deployment. The proposed detection model is based on TinierSSD, a lightweight variant of TinySSD optimized by Analog Devices Inc. (ADI), which fuses 2D convolution, batch normalization, and ReLU into a single computation unit to reduce model size and computational overhead. The hardware platform is the MAX78000, an ultra-low-power microcontroller unit (MCU) with a built-in convolutional neural network (CNN) accelerator, which is constrained to 442 KB of weight storage memory and supports only a restricted set of operators, including 1×1 and 3×3 convolutional kernels, average pooling, and max pooling.

During training, a custom dataset of 2400 RGB images (74×74×3), covering four ball colors (red, yellow, blue, and green), is split into training, validation, and test sets and augmented through horizontal flipping, vertical flipping, and salt-and-pepper noise. The model is trained using Smooth L1 Loss for localization and cross-entropy loss for classification, optimized with Adam over 300 epochs, with the final 50 epochs dedicated to Quantization-Aware Training (QAT). Once training is complete, the model is quantized from 32-bit floating-point to 8-bit integer precision to minimize inference latency and power consumption. In the synthesis stage, the quantized model checkpoint is converted into embedded C code, with weights, biases, and hyperparameters stored in header files for direct integration with the MAX78000. During real-time deployment, the built-in camera module captures input images, which are processed by the on-chip CNN accelerator to perform color ball detection, with results displayed on the built-in TFT screen.

The workflow of the system
Fig. 1. The workflow of the system
← Back to Edge AI & Neural Acceleration