Source-linked AI summary

AHAR: Adaptive CNN for Energy-efficient Human Activity Recognition in Low-power Edge Devices

Nafiul Rashid, Berken Utku Demirel, Mohammad Abdullah Al Faruque

arXiv:2102.01875v3cs.LGeess.SP

TL;DR

Wearable HAR requires continuous activity monitoring, but deep CNNs can strain device energy and memory, while confidence-based early exits may lose performance. AHAR uses an output-block predictor to select how much of a CNN to run. Across Opportunity and w-HAR, it reports comparable or better weighted F1 scores and energy savings over its baseline.

  • Problem

    Wearable HAR needs low-energy, low-memory algorithms that maintain performance, while deep CNNs can require substantial resources and confidence-based early exits may reduce performance.

    Source: §I · pp. 1–2
  • Method

    AHAR uses an output-block predictor rather than classification confidence to select the portion of the baseline CNN used during inference.

    Source: §I · p. 2, B. Energy-efficient CNN Design… · p. 4
  • Results

    AHAR reports comparable weighted F1 on Opportunity (91.79% baseline; 91.57% adaptive) and better-than-state-of-the-art weighted F1 on w-HAR (97.55% baseline; 97.64% adaptive).

    Source: §VI · p. 10
  • Takeaways & Limitations

    The adaptive architecture uses less energy than its baseline while providing similar performance on Opportunity and better performance on w-HAR.

    Source: §VI · p. 10

Abstract

from arXiv · show

Human Activity Recognition (HAR) is one of the key applications of health monitoring that requires continuous use of wearable devices to track daily activities. This paper proposes an Adaptive CNN for energy-efficient HAR (AHAR) suitable for low-power edge devices. Unlike traditional early exit architecture that makes the exit decision based on classification confidence, AHAR proposes a novel adaptive architecture that uses an output block predictor to select a portion of the baseline architecture to use during the inference phase. Experimental results show that traditional early exit architectures suffer from performance loss whereas our adaptive architecture provides similar or better performance as the baseline one while being energy-efficient. We validate our methodology in classifying locomotion activities from two datasets- Opportunity and w-HAR. Compared to the fog/cloud computing approaches for the Opportunity dataset, our baseline and adaptive architecture shows a comparable weighted F1 score of 91.79%, and 91.57%, respectively. For the w-HAR dataset, our baseline and adaptive architecture outperforms the state-of-the-art works with a weighted F1 score of 97.55%, and 97.64%, respectively. Evaluation on real hardware shows that our baseline architecture is significantly energy-efficient (422.38x less) and memory-efficient (14.29x less) compared to the works on the Opportunity dataset. For the w-HAR dataset, our baseline architecture requires 2.04x less energy and 2.18x less memory compared to the state-of-the-art work. Moreover, experimental results show that our adaptive architecture is 12.32% (Opportunity) and 11.14% (w-HAR) energy-efficient than our baseline while providing similar (Opportunity) or better (w-HAR) performance with no significant memory overhead.

I. INTRODUCTION

Wearable HAR must balance energy, memory, and performance, while fog/cloud processing adds communication energy, latency, and privacy concerns. AHAR uses an output-block predictor for adaptive inference, motivated by evidence that many segments are handled by the first block while later blocks improve overall accuracy at greater computational cost.

I. INTRODUCTION

  • Fog/cloud HAR sends wearable data to a phone or server, adding communication energy, latency, and privacy risks; edge computing processes data on-device.Hierarchical systems classify some simple activities locally but still transmit complex ones to fog/cloud.Source: §I · p. 1
  • Wearable HAR algorithms must use low energy and memory while maintaining performance, but many existing HAR systems target fog/cloud platforms and prioritize performance.CNNs automatically extract features, but deep networks can require more energy, memory, and execution time because they use many layers.Source: §I · pp. 1–2
  • Traditional confidence-based early exits can exit after a confidently misclassified segment, motivating AHAR's output-block predictor for selecting how much of the CNN to use.The paper proposes this adaptive approach to retain performance similar to or better than the baseline while improving energy efficiency.Source: §I · p. 2

A. Motivational Example

  • 94.73% of w-HAR segments were correctly classified by both the first output block (FOB) and baseline, motivating adaptive inference that avoids redundant baseline operations.The example used 5-fold cross-validation on 4,740 activity segments.Source: A. Motivational Example · p. 2
  • FOB and baseline accuracy were 95.06% and 97.60%, while their per-segment FLOP counts were 5,799 and 7,575, respectively.Execution times were 26.36 µJ and 32.07 µJ, and energy use was 401.73 µJ and 488.74 µJ, respectively.Source: A. Motivational Example · p. 3

B. Observation and Problem Statement

The paper proposes using an output-block predictor instead of classification confidence to select the inference path. Its motivating analysis identifies redundant baseline computation, and the reported evaluations compare the adaptive approach with confidence-based exits and report results across datasets and resource measures.

B. Observation and Problem Statement

  • The motivating analysis estimates that adaptive inference can save 1,744.47 FLOPs, 5.55 ms, and 84.51 µJ per segment versus the baseline while achieving 97.93% accuracy versus 97.60%.The analysis routes most segments through the first output block and uses the baseline for a smaller subset.Source: B. Observation and Problem Statement · p. 3
  • At an FOB confidence threshold of 0.9, traditional CDLN still performs below the baseline; AHAR's predictor-based architecture outperforms both across reported performance metrics.The paper attributes confidence-based early-exit errors to cases where an earlier layer confidently misclassifies a segment.Source: B. Observation and Problem Statement · p. 3

C. Novel Contributions

  • Adaptive AHAR achieved 91.79% and 91.57% weighted F1 on Opportunity for baseline and adaptive models, and 97.55% and 97.64% on w-HAR, respectively.The paper reports comparable results to fog/cloud approaches on Opportunity and better results than state-of-the-art work on w-HAR.Source: C. Novel Contributions · p. 3
  • The baseline used 422.38x less energy and 14.29x less memory than works on Opportunity; on w-HAR it used 2.04x less energy and 2.18x less memory than the state-of-the-art wearable work.These are real-hardware evaluations.Source: C. Novel Contributions · p. 3
  • Adaptive inference was 12.32% more energy-efficient on Opportunity and 11.14% on w-HAR than the baseline, with similar or better performance and no significant memory overhead.The performance was similar on Opportunity and better on w-HAR.Source: C. Novel Contributions · p. 3

II. RELATED WORKS

Prior HAR work evaluates locomotion recognition on Opportunity and w-HAR, while energy-efficient CNN approaches reduce inference cost through software or hardware changes. AHAR focuses on inference-time early exit using an output block predictor rather than classification confidence.

Opportunity (Opp.)

  • For Opportunity locomotion recognition, prior works report weighted F1 scores of 90%, 93%, 92.57%, and 92.5%.The cited approaches include random forests, deep CNN with LSTM layers, two-dimensional CNN, and combined temporal and spatial convolutions.Source: Opportunity (Opp.) · p. 4

A. Works on Human Activity Recognition

  • On w-HAR, the baseline and activity-aware classifiers report weighted F1 scores of 94.96% and 97.37%, respectively.The activity-aware method classifies static versus dynamic activities before applying further classifiers and features.Source: Opportunity (Opp.) · p. 4

B. Energy-efficient CNN Design Approaches

  • HAR CNNs face energy and memory constraints on wearable devices, motivating software-based training or inference methods and custom hardware accelerators.Inference-time early-exit methods can stop after an earlier layer when confidence is sufficient, but may lose performance after a confident misclassification.Source: B. Energy-efficient CNN Design… · p. 4
  • AHAR replaces confidence-based early exit with an output block predictor and reports early exit without performance loss for HAR.The authors describe this as the first investigation of this adaptive CNN architecture for HAR.Source: B. Energy-efficient CNN Design… · p. 4

III. PROPOSED METHODOLOGY

Preprocessing begins by denoising and smoothing raw data with a moving average, then proceeds to segmentation.

III. PROPOSED METHODOLOGY

  • Raw data are smoothed with an 8-sample moving average filter before segmentation.The paper places denoising and smoothing at the start of preprocessing.Source: 1) Filtering · p. 4

2) Segmentation:

The pipeline segments filtered data using dataset-specific procedures, downsamples each segment to a fixed length, extracts statistical features for adaptive block selection, and applies segment-wise Z-score normalization.

2) Segmentation:

  • Opportunity data use 100-sample sliding windows with 70% overlap, capturing 3.33 seconds at 30 Hz; w-HAR uses dynamic segmentation based on a five-point derivative.The dynamic procedure is applied to stretch-sensor data.Source: 2) Segmentation · pp. 4–5

3) Downsampling:

  • Each segment is downsampled to 32 samples to reduce CNN computation and provide fixed-size inputs for dynamic segmentation.Source: 3) Downsampling · p. 5

4) Calculating Statistical Features:

  • The output block predictor uses four statistical features for Opportunity and six for w-HAR to select an output block at inference.Features include acceleration means and sensor-specific minimum and maximum values.Source: 4) Calculating Statistical Features · p. 5

5) Z-score Normalization:

  • Each downsampled segment is Z-score normalized to reduce outlier effects, using that segment’s sample mean and standard deviation.Source: 5) Z-score Normalization · p. 5

B. Adaptive CNN Architecture

AHAR combines a multi-output CNN with a predictor that selects an output block for each segment based on statistical features. The design targets low-power wearable constraints and aims to use less energy than the baseline.

1) Multi-output CNN Architecture:

2) Output Block Predictor (OBP):

  • A decision-tree output block predictor uses segment statistics to choose the first output block or the baseline, avoiding further computation when the first block suffices.The predictor determines the output block used at inference.Source: 2) Output Block Predictor (OBP) · p. 5, B. Adaptive CNN Architecture · p. 5
  • The adaptive design is energy-efficient only when predictor and selected-block energy across N segments is less than using the baseline for all N segments.The equation accounts for N1 segments classified by the first output block and N2 classified by the baseline, with N1 + N2 = N.Source: 2) Output Block Predictor (OBP) · p. 6

IV. EXPERIMENTAL SETUP

The experiments evaluate locomotion recognition on Opportunity and w-HAR, using dataset-specific sensor inputs and training protocols. The Opportunity split follows the challenge distribution, while w-HAR uses stratified five-fold cross-validation.

1) Opportunity Dataset [29]:

  • Opportunity includes four locomotion classes in this study, using seven channels from a knee accelerometer and shoe IMU sampled at 30 Hz.The dataset contains six hours of recordings from four subjects; the selected channels aim to capture information with sensors close to the wearable device.Source: 1) Opportunity Dataset [29] · p. 6

2) w-HAR Dataset [28]:

  • w-HAR evaluation uses all seven channels from an ankle IMU and knee stretch sensor across seven locomotion activities plus transitions.The IMU is sampled at 250 Hz and the stretch sensor at 25 Hz; the dataset includes 22 subjects.Source: 2) w-HAR Dataset [28] · p. 6

B. Training Multi-output CNN Classifier

  • Opportunity training and testing follow the challenge distribution, with ADL3 from subjects 2 and 3 reserved for validation.The classifier is trained for 100 epochs using Sparse Categorical Cross Entropy and Adam with a learning rate of .007.Source: B. Training Multi-output CNN Classifier · p. 6
  • w-HAR uses stratified five-fold cross-validation, with 80% of data for training and 20% for testing.Twenty percent of the training data is used for validation; training runs for 300 epochs with Adam at a learning rate of 0.01.Source: B. Training Multi-output CNN Classifier · p. 6

C. Training Output Block Predictor

The output block predictor (OBP) is trained to select a classifier output block for each activity segment using segment-level statistical features. The evaluation setup also specifies the wearable hardware and performance metrics.

C. Training Output Block Predictor

  • OBP training labels encode which output block can correctly classify each segment, while misclassified-by-both segments are assigned to the first output block.When both blocks classify correctly, the first output block is selected to save energy; when only one succeeds, the label selects that block.Source: C. Training Output Block Predictor · p. 7, Table V · p. 7
  • The OBP takes four statistical features for Opportunity segments and six for w-HAR segments, using the classifier's corresponding training and testing splits.For w-HAR, OBP training and testing use stratified five-fold cross-validation with an 80/20 split.Source: C. Training Output Block Predictor · p. 7

D. Wearable Platform

  • The classifier is evaluated on an EFM32 Giant Gecko microcontroller with an ARM Cortex–M3 processor, 128 KB RAM, and 1 MB Flash.The processor has a maximum clock rate of 48 MHz.Source: D. Wearable Platform · p. 7

V. EXPERIMENTAL RESULTS AND ANALYSIS

  • Because activity counts are imbalanced, evaluation uses precision, recall, and weighted F1 in addition to accuracy.The weighted F1 formula weights class-wise F1 scores by each class's share of the total segments.Source: §V · p. 7

A. Performance Evaluation of Multi-output CNN Classifier

The baseline multi-output CNN outperforms the first output block (FOB) on both datasets, including overall metrics and the cited difficult activity classes.

A. Performance Evaluation of Multi-output CNN Classifier

  • 91.79% weighted F1 for Opportunity and 97.55% weighted F1 for w-HAR are achieved by the baseline, versus 87.24% and 94.45% for the FOB.The Opportunity baseline also has 91.79% accuracy, precision, and recall; w-HAR baseline accuracy, precision, and recall are 97.60%, 97.57%, and 97.60%.Source: A. Performance Evaluation of… · p. 7
  • For Opportunity, the FOB correctly classifies 63 lying segments, while the baseline correctly classifies 184.The passage reports that the baseline improves performance on lying activity.Source: A. Performance Evaluation of… · p. 7
  • For w-HAR, the FOB correctly classifies 114 transition segments, compared with 222 for the baseline.Source: A. Performance Evaluation of… · p. 7

B. Performance Evaluation of Output Block Predictor

The OBP selects output blocks with high reported classification metrics, and the resulting adaptive architecture stays close to the Opportunity baseline while exceeding it on w-HAR. It also outperforms or matches cited work in the reported dataset comparisons.

B. Performance Evaluation of Output Block Predictor

  • 99.32% weighted F1 for the w-HAR OBP accompanies 99.30% accuracy and recall and 99.34% precision; Opportunity OBP weighted F1 is 97.47%.Opportunity OBP accuracy, precision, and recall are 97.44%, 97.51%, and 97.44%, respectively.Source: B. Performance Evaluation of Output… · pp. 7–8

C. Performance Evaluation of Adaptive Architecture

D. Energy and Memory Evaluation on Real Hardware

Real-hardware evaluation compares per-segment time, energy, and RAM on an EFM32 Giant Gecko at 14 MHz. The adaptive architecture uses less energy than the baseline on both datasets, with similar Opportunity performance and better w-HAR performance.

D. Energy and Memory Evaluation on Real Hardware

  • At 14 MHz, evaluation reports execution time, power, and energy for one activity segment; machine-learning figures include feature extraction and classification, while CNN figures cover classification.The hardware platform is an EFM32 Giant Gecko microcontroller.Source: D. Energy and Memory Evaluation on… · p. 9
  • 403.71 µJ per Opportunity segment is the adaptive architecture’s reported energy, below the baseline while providing similar performance.The adaptive architecture averages 26.48 ms per segment; its output block predictor uses 1.09 KB RAM and consumes 24.56 µJ.Source: D. Energy and Memory Evaluation on… · p. 9, Table XIII · p. 9
  • 374.69 µJ and 24.57 ms are the reported per-segment energy and time for the Opportunity FOB, which uses 2.62 KB RAM.The Opportunity OBP uses 1.09 KB RAM, takes 1.61 ms, and consumes 24.56 µJ to extract four statistical features and classify a segment.Source: D. Energy and Memory Evaluation on… · p. 9, Table XIII · p. 9
  • 995.77 µJ and 65.07 ms are the reported per-segment energy and time averages for the w-HAR activity-aware classifier in.The calculation averages the static classifier over 1,810 segments and the dynamic classifier over 2,930; both classifiers require 9.75 KB RAM for 120-feature calculation.Source: D. Energy and Memory Evaluation on… · p. 9, Table XIV · p. 9
  • 434.29 µJ per w-HAR segment is the adaptive architecture’s reported energy, below the baseline while providing better performance.The adaptive architecture averages 28.50 ms per segment; its output block predictor uses 1.10 KB RAM and consumes 29.86 µJ.Source: Table XIV · p. 9, D. Energy and Memory Evaluation on… · p. 10

E. Final Benchmarking

On Opportunity and w-HAR, AHAR’s baseline and adaptive architectures achieve comparable or better benchmark performance while reducing resource use. On both datasets, the adaptive architecture uses less energy than the baseline, with similar or better performance.

E. Final Benchmarking

  • 91.79% weighted F1 is the Opportunity baseline result, comparable to fog/cloud works –, with 1228.22x, 1052.86x, and 507.83x less parameter size, respectively.Compared with, the baseline uses 422.38x less energy and 14.29x less RAM; the adaptive architecture is 12.32% more energy-efficient with similar performance.Source: E. Final Benchmarking · p. 10
  • 97.55% weighted F1 is the w-HAR baseline result, exceeding the 94.96% baseline and 97.37% activity-aware classifiers in; it uses 2.04x less energy and 2.18x less memory than the activity-aware classifier.The adaptive architecture is 11.14% more energy-efficient than the baseline and outperforms it; these energy savings are reported for a two-layer convolution architecture.Source: Figure 9 · p. 10, E. Final Benchmarking · p. 10

VI. CONCLUSION

  • Across the two datasets, the conclusion reports weighted F1 scores of 91.79% and 91.57% for Opportunity baseline and adaptive architectures, and 97.55% and 97.64% for w-HAR, respectively.The adaptive architecture is reported as 12.32% more energy-efficient on Opportunity and 11.14% on w-HAR, with similar or better performance and no significant memory overhead.Source: §VI · p. 10
Loading 2102.01875v3…