Abstract
This paper presents a novel approach to adaptive inference for energy-constrained IoT devices. By utilizing class-specific confidence thresholds rather than a global "one-size-fits-all" metric, the proposed system optimizes the balance between predictive accuracy and energy consumption. We demonstrate that recognizing the inherent difficulty variance across different categories allows for significant energy savings—up to 64.4%—on standard benchmarks like CIFAR-10, GTSRB, and Google Speech Commands.
1. Introduction
Deploying complex deep learning models on battery-powered IoT edge devices necessitates a constant trade-off between accuracy and energy efficiency. Adaptive inference has emerged as a promising solution, where models are arranged in a sequence from low-power "small" models to high-power "large" models. In these systems, the small model is executed first; if its prediction is sufficiently confident, the process terminates, saving the energy required to run the larger model.
The standard metric for confidence is the Score Margin (SM), defined as the difference between the highest and second-highest probability scores. However, current implementations typically rely on a single global threshold for the SM. This approach is sub-optimal because it fails to account for the fact that some classes are inherently easier to identify than others. A global threshold often leads to over-processing of simple classes or under-processing of complex ones.
2. Methodology
We propose a methodology to calculate class-dependent thresholds ($th_c$), where each output class is assigned a customized confidence requirement.
2.1 System Architecture
The system employs a policy-based selection mechanism, as illustrated in Figure 1. For any given input, the small model (M1) generates a set of probabilities. If the predicted class $c$ has a Score Margin exceeding its specific threshold $th_c$, the prediction is accepted. Otherwise, the system triggers the larger model (MN) to perform a more robust inference.
2.2 Threshold Optimization
Thresholds are determined offline using a validation dataset. We employ a cost function that balances accuracy (minimizing false positives where the system stopped early incorrectly) and energy (minimizing unnecessary calls to the large model). A hyperparameter, $\alpha$, is introduced to allow developers to tune this balance: a high $\alpha$ prioritizes battery longevity, while a low $\alpha$ prioritizes maximum accuracy. Importantly, this approach introduces zero runtime overhead, as thresholds are stored as a simple array.
3. Motivation: Class Complexity Variance
The core insight of this work is that different classes exhibit distinct confidence distributions. As shown in Figure 2, some classes allow the small model to be highly accurate even with a low margin, while others require a much higher margin to ensure correctness.
By implementing class-dependent thresholds, the system can automatically compensate for these variances, including those caused by imbalanced training data, without requiring model retraining.
4. Experimental Evaluation
The proposed method was implemented on an STM32H743 microcontroller (ARM Cortex-M7) and evaluated across three diverse datasets: CIFAR-10, the German Traffic Sign Recognition Benchmark (GTSRB), and Google Speech Commands (GSP).
4.1 Key Results
The class-dependent approach consistently outperformed the single-threshold baseline:
- Energy Reduction: Compared to a "big-model-only" baseline, our method reduced energy consumption by 11.4% on CIFAR-10, 56.0% on GTSRB, and 64.4% on GSP while maintaining comparable accuracy.
- Efficiency Gains: When compared to standard single-threshold adaptive methods at equivalent accuracy levels, our approach achieved additional energy savings of 10% to 60%.
- Robustness to Imbalance: In scenarios with skewed data distributions, the class-dependent method provided up to 40% better energy savings than the baseline.
5. Conclusion and Future Work
This work demonstrates that class-dependent confidence thresholds provide a zero-overhead mechanism to significantly enhance the energy efficiency of adaptive inference on IoT nodes. While this study focused on two-model cascades, future research will explore extending this logic to deeper model chains ($N > 2$) and developing methods for dynamic, "on-the-fly" threshold updates to adapt to changing environmental conditions.
Summary updated