Improving Performance and Energy Efficiency of the Classification of Data Streams on Edge Computing

Reginaldo Luna, Guilherme Weigert Cassales, Hermes Senger2023

Abstract

In this work, we propose a loop transformation to improve performance and energy efficiency of ensembles. We compare the performance of our technique with three other strategies for improving energy efficiency and throughput in data stream classification using six state-of-the-art ensemble algorithms and four benchmark datasets. Our results show that software strategies can significantly reduce energy consumption. Mini-batching improved energy efficiency by 96% on average and 169% in the best case. Likewise, mini-batching with loop fusion improved energy efficiency by 136% on average and 456% in the best case.

Introduction

Edge computing brings data processing closer to the source, such as sensors or IoT devices, significantly reducing latency and bandwidth requirements. However, edge devices like Raspberry Pis or industrial controllers are often severely power-constrained. Running complex machine learning models, specifically ensembles—which combine multiple "weak" learners to make a strong prediction—is computationally expensive and drains batteries rapidly.

While hardware-level solutions like Dynamic Voltage and Frequency Scaling (DVFS) exist, they often trade off too much performance for energy savings. This research addresses the gap by proposing software-level architectural optimizations to make data stream classification both faster and more energy-efficient without requiring specialized hardware.

Methodology: Mini-Batching and Loop Fusion

The core of the proposed approach is the combination of mini-batching with a novel loop fusion technique.

  1. Mini-batching: Instead of processing data points individually as they arrive in a stream, the system groups them into small batches. This reduces the overhead associated with repeated function calls and system interrupts.
  2. Loop Fusion (MB-LF): Standard stream processing typically involves two distinct passes: one loop to classify the incoming data and a second loop to train the model on that same data. The proposed technique "fuses" these into a single loop. This maximizes cache reuse; when a data instance is loaded into the processor's high-speed cache for classification, it remains there for the subsequent training step. This prevents the processor from fetching the same data from slower main memory (RAM) twice, saving both time and energy.

The study compared the "Mini-Batching with Loop Fusion" (MB-LF) strategy against several baselines:

  • Core Limiting (CL): Restricting the number of active CPU cores.
  • Voltage-Frequency Scaling (VFS): Reducing the CPU's clock speed.
  • Pure Mini-Batching (MB): Batching without the fused loops.

Experimental Results

The researchers evaluated the approach on a Raspberry Pi 3 Model B, measuring two primary metrics: Joules Per Instance (JPI) for energy efficiency and Instances Per Second (IPS) for throughput. The tests utilized six state-of-the-art ensemble algorithms, including Adaptive Random Forest (ARF), Streaming Random Patches (SRP), and Leveraging Bagging (LBag), across four benchmark datasets.

Comparison of energy efficiency (JPI) and throughput (IPS) across various ensemble algorithms and optimization strategies.

As shown in Figure 1, software-level optimizations (MB and MB-LF) consistently provided better energy savings and higher throughput than hardware-level strategies (VFS and CL). Specifically:

  • Energy Efficiency: Pure mini-batching improved efficiency by 96% on average. Adding loop fusion (MB-LF) increased this to 136% on average, reaching a 456% improvement in the best-case scenario.
  • Throughput: The MB-LF strategy consistently outperformed hardware strategies in terms of the number of data instances processed per second.
  • Consistency: The software strategies were more effective across all six tested ensemble algorithms compared to simply capping hardware performance.

Discussion and Key Insights

The success of MB-LF highlights that in edge computing, the primary bottleneck is often the movement of data between memory and the CPU rather than raw calculation. By keeping data in the cache through loop fusion, the system spends fewer processor cycles per instance.

Furthermore, the results suggest that software-level optimizations can be more effective than hardware-level ones because they can be tailored to the specific logic of the algorithm. Hardware scaling is often a "blunt instrument" that affects the entire system, whereas MB-LF optimizes the specific data-handling patterns of machine learning ensembles.

Limitations and Future Work

While the results are promising, several areas remain for further exploration. The current study uses static batch sizes; future work will focus on "adaptive mini-batching" that can adjust in real-time based on data load and battery levels. Additionally, there is an inherent trade-off between batching and latency, as waiting to fill a batch increases the time a single data point waits to be processed. Further research is needed to find the optimal balance for different real-time applications and to assess how mini-batching affects the long-term predictive accuracy of the models.

Conclusion

This work demonstrates that software-based loop transformations can significantly enhance the performance and energy efficiency of machine learning on edge devices. By optimizing data locality and reducing processing overhead, techniques like MB-LF enable more complex models to run effectively on power-constrained hardware.

Summary updated

BibTeX
@misc{luna2023improving,
  author = {Reginaldo Luna and Guilherme Weigert Cassales and Hermes Senger},
  title = {{Improving Performance and Energy Efficiency of the Classification of Data Streams on Edge Computing}},
  year = {2023},
  doi = {10.5753/eradsp.2023.231687},
}
Figure