
Förderjahr 2024 / Stipendium Call #19 / ProjektID: 7383 / Projekt: Dynamic Power Management for Edge AI: A Sustainable Self-Adaptive Approach
In this post, I outline part of my master’s work: measuring how different object detection models, image resolutions, and frame rates impact a Raspberry Pi’s power consumption.
Motivation
In the context of dynamic power management for edge AI, getting the power profile right is essential. My project centers on training a reinforcement learning agent that will optimize power consumption during object detection tasks. For the agent to learn effective switching strategies between different operating configurations, I needed an accurate model of the Raspberry Pi’s power consumption. This meant characterizing energy usage across various configurations, including variations in object detection model size, camera frame rate, and image resolution.
Hardware Setup
For this experiment, I built a test environment that mirrors a real‑world edge setup:
-
Raspberry Pi 4: Serving as the primary processing unit
-
Camera Module: Attached to the Raspberry Pi for image capture
-
Digital Power Meter: Connected to the Pi and accessible via SSH for real‑time power measurements
The camera and Pi are mounted on a shelf in a lab setup, which-due to the fixed positioning-results in capturing mostly black frames. These are discarded and replaced with a controlled set of test images from a pre‑sampled dataset.
Factors Influencing Power Consumption
For this round of experiments, the focus is on three primary factors:
-
Object Detection Model Size: Comparing two variants-yolov5s and the lighter yolov5n
-
Image Resolution: Low 240 px, Medium 320 px, High 640 px
-
Frame Rate: Varying how often frames are captured and processed
These three variables form the grid of configurations the reinforcement learning agent will explore.
The Experiment
Models and Resolutions
I used two models (yolov5s and yolov5n) and sample images from the COCO 2017 dataset, each scaled to 240 px, 320 px, or 640 px and stored in separate folders. An inference script was created to generate workload on the Raspberry Pi, which is then queried with a digital power meter for its energy consumption.
Inference Script Overview
-
Set camera to the chosen resolution and frame rate
-
Capture a frame (always black) and discard it
-
Swap in a random image from the matching COCO folder
-
Run inference with the selected model
-
Log power consumption via SSH‑queried power meter
-
Repeat continuously for 90 seconds per configuration
Parameter Grid
-
2 models: yolov5s, yolov5n
-
3 resolutions: 240 px, 320 px, 640 px
-
Multiple frame‑rate settings
Preliminary Results
A quick glance at the early data and accompanying charts reveals that both the choice of model and image resolution strongly influence the Pi’s power draw, which was expected. The heavier yolov5s model and higher resolutions (640 px) consistently drive up consumption, while the lighter yolov5n and lower resolutions (240 px) sit at the opposite end of the spectrum. As for frame rate, the initial runs hint at an effect, but overlap in our current measurements makes it hard to pin down its true impact-more targeted tests are needed to isolate how FPS alone changes the energy profile.
Future Work
-
Deepen FPS Analysis: Vary only the frame rate (keeping model and resolution fixed) to quantify its power impact
-
Train the RL Agent: Feed the refined power measurements into the reinforcement learning framework to teach optimal switching policies
-
Optimize Models & Hardware: Experiment with model quantization and a USB accelerator (e.g., Google Coral) to shave off more watts without losing accuracy
-
Publish Detailed Findings: Share full energy-performance curves, tuning tips, and code snippets to help others build leaner edge‑AI setups
Conclusion
Understanding a Raspberry Pi’s energy consumption in an object detection scenario is key for efficient edge AI deployments. By systematically measuring power across different models, resolutions, and frame rates, we lay the groundwork for dynamic power management systems. Whether you’re building a security camera, a robot, or any edge AI device, these insights will help you balance performance with energy efficiency.
Thank you for reading!