Dynamic Decision Tree Ensembles for Energy-Efficient Inference on IoT Edge Nodes

Francesco Daghero, Alessio Burrello, Enrico Macii, Paolo Montuschi, Massimo Poncino, Daniele Jahier PagliariarXiv 2023 · DOI

TL;DR

This paper introduces a dynamic early-stopping framework for decision tree ensembles (Random Forests and Gradient Boosted Trees) deployed on ultra-low-power multi-core IoT edge nodes. By evaluating input complexity at runtime and halting computation once a confidence threshold is met, the proposed method reduces inference energy consumption by up to 42% on an 8-core RISC-V System-on-Chip (SoC) without any loss in accuracy.

What Problem Does This Paper Address?

Deploying Machine Learning (ML) directly onto Internet of Things (IoT) edge devices ("extreme-edge computing") eliminates the latency, privacy, and energy costs associated with constantly streaming data to the cloud. While deep learning models are often too heavy for resource-constrained microcontrollers, tree-based ensembles like Random Forests (RFs) and Gradient Boosted Trees (GBTs) offer a lightweight alternative.

However, standard implementations evaluate every single tree in the ensemble for every input, meaning computational cost scales linearly with ensemble size. Traditional optimization techniques like static pruning permanently shrink the model, which risks dropping accuracy on complex inputs. The authors address this inefficiency by designing an input-dependent, runtime-adaptive inference mechanism that saves energy on "easy" inputs while preserving full model capacity for "hard" ones.

Methods

The authors developed a comprehensive framework that spans algorithmic innovations and hardware-specific optimizations:

  1. Aggregated Score Policies: Traditional early-stopping methods check the confidence of only the latest executed classifier. Because weak learners in a tree ensemble have similar predictive power, the authors propose Aggregated Max Score ($S^t$) and Aggregated Score Margin ($SM^t$). These metrics evaluate confidence based on the accumulated predictions of all trees executed up to the current iteration, providing a much more stable and reliable early-stopping trigger.
Fig. 2: A dynamic RF with N = 3, M = 3 and D = 3. In case early stopping is not triggered, the obtained output is identical to a static RF.
  1. Multi-Core Batching Mechanism: On multi-core platforms, evaluating the early-stopping policy after every single tree introduces severe synchronization overhead. The authors introduce a configurable batching mechanism where trees are executed in parallel across $C$ cores, and the early-stopping policy is only checked after the entire batch finishes.
Fig. 5: Multi-core inference for a dynamic tree ensemble.
  1. Hardware-Aware Deployment: The authors built an automated tool that compiles Python-trained models into optimized C code tailored for the 8-core GAP8 RISC-V SoC. This includes a static memory allocation strategy that intelligently maps data structures between limited, fast L1 scratchpad memory and larger, slower L2 memory, alongside support for symmetric min-max quantization (8/16/32-bit).

Datasets

The framework was evaluated on three diverse, IoT-relevant benchmarks:

  • NinaPro DB1: Surface Electromyography (sEMG)-based hand gesture recognition (14 classes), utilizing patient-specific training.
  • Backblaze: Hard-drive failure prediction using SMART features (binary classification, highly unbalanced).
  • UniMiB-SHAR: Human Activity Recognition (HAR) and fall detection using smartphone accelerometer data (17 classes).

Key Insights and Ideas

  • Ensemble History Matters: For ensembles of weak learners, looking at the running total of predictions yields vastly superior early-stopping trade-offs compared to state-of-the-art single-classifier metrics, which often suffer from severe accuracy drops.
  • Parallelism vs. Adaptivity Trade-off: There is a fundamental tension between multi-core parallel efficiency and granular early stopping. Checking for early exits too frequently destroys parallel speedups due to barrier synchronization overhead, a reality often ignored by purely theoretical sequential models.
  • Quantization as a Regularizer: Moving to 16-bit or 8-bit precision drastically reduces memory footprints (crucial for fitting models into L1/L2 scratchpads) and occasionally acts as a regularizer, improving generalization on the test set.

Key Results

  • Energy Savings: When deployed on the 8-core GAP8 SoC, the dynamic ensembles achieved an energy reduction of up to 37.9% for GBTs and 41.7% for RFs at iso-accuracy compared to their static counterparts.
  • Complexity Reduction: The hardware-agnostic number of visited tree nodes was cut by 57% to 90% with less than a 1% drop in accuracy across all three tasks.
  • Flexibility: Unlike static pruning, the threshold ($t_h$) can be dynamically adjusted at runtime to adapt to changing system states, such as a low-battery mode.

Limitations and Future Work

The primary limitation highlighted is that the effectiveness of dynamic early stopping diminishes as the number of parallel cores increases. With larger core counts, the minimum batch size grows, meaning the system must execute more trees before it can check if it's safe to stop, which reduces the potential energy savings on easy inputs.

For future work, the authors plan to investigate more sophisticated, lightweight early-stopping metrics—such as tracking a running mean of scores rather than a simple aggregation—and further optimize these models for even smaller, single-core platforms with tighter memory constraints.

Summary updated

BibTeX
@misc{daghero2023dynamic,
  author = {Francesco Daghero and Alessio Burrello and Enrico Macii and Paolo Montuschi and Massimo Poncino and Daniele Jahier Pagliari},
  title = {{Dynamic Decision Tree Ensembles for Energy-Efficient Inference on IoT Edge Nodes}},
  year = {2023},
  eprint = {2306.09789},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2306.09789},
}
Figure