Structured Sparse Back-propagation for Lightweight On-Device Continual Learning on Microcontroller Units

Francesco Paissan, Davide Nadalini, Manuele Rusci, Alberto Ancilotto, Francesco Conti, Luca Benini, Elisabetta FarellaWorkshops @ CVPR 2024

Introduction

Training deep learning models on "extreme edge" devices, such as low-power microcontrollers (MCUs) found in wearables and smart sensors, presents significant challenges. Typically, models are trained in the cloud and deployed as static entities. However, real-world applications often require on-device adaptation to new environments or data distributions. This adaptation faces two primary obstacles: catastrophic forgetting, where the model loses previously learned knowledge when fine-tuned on new data, and severe resource constraints, as standard back-propagation requires substantial RAM for activations and gradients—far exceeding the megabyte-scale memory of typical MCUs.

Methods: A Two-Pronged Approach

To enable lightweight on-device learning, this work introduces a strategy combining Latent Replay with a novel Structured Sparse Update mechanism.

Latent Replay (LR)

Instead of storing raw input images to mitigate forgetting—a practice that is memory-prohibitive on MCUs—the system stores "latent representations." These are intermediate activations extracted from a middle layer of the network. During training, the model processes a mixture of new data and these compact stored "memories," effectively reminding the network of prior tasks with minimal storage overhead.

Overview of the Latent Replay architecture showing the forward and backward passes and the storage of latent representations.

Structured Sparse Update

The core innovation of this research is the Structured Sparse Update. While traditional sparse training often employs unstructured (random) weight updates, which are difficult to accelerate on hardware, this approach utilizes structured sparsity. By updating only a specific subset of input and output channels in each layer, the method reduces the memory required for intermediate values during the backward pass.

The Structured Sparse Update mechanism, illustrating how partiality coefficients determine the fraction of channels updated to reduce memory and computation.

The researchers introduce "partiality coefficients" ($p$) to define the fraction of channels retained. This structured approach ensures that the remaining computations remain compatible with the SIMD (Single Instruction, Multiple Data) units of modern MCUs, maintaining high hardware efficiency.

Datasets and Evaluation

The approach was evaluated on two benchmarks adapted for continual learning:

  • Split CIFAR-10: The standard 10-category dataset, divided into five sequential tasks of two categories each.
  • CORe50: A challenging dataset for object recognition in dynamic environments, featuring 50 objects across 10 categories.

Key Insights: Hardware-Software Co-design

A critical insight of this work is the importance of hardware-aware pruning. Unstructured sparsity creates irregular data patterns that hinder processor efficiency. By focusing on structured sparsity (skipping entire channels), the authors leverage the MCU's architectural strengths. Furthermore, they identify a "Pareto frontier" in learning: updating only the final layers with 60-70% channel sparsity achieves a "sweet spot," maintaining high accuracy while significantly lowering memory usage.

Key Results

Testing on a RISC-V multi-core MCU (PULP platform) demonstrated:

  • Efficiency: Up to a 1.3x reduction in memory and computational costs compared to standard back-propagation.
  • Performance: On CORe50, a MobileNetV2 model learned a new task (two unseen classes) in 18 minutes using just 4.63 MB of RAM.
  • Accuracy: The sparse strategy resulted in only a minor 2% accuracy drop compared to full training.
  • Benchmarking: Compared to state-of-the-art methods like SparCL, this approach required 80x less memory (2.11 MB vs 177 MB) on CIFAR-10, largely due to starting from a pre-trained model.

Limitations and Future Work

Current limitations include the use of a fixed sparsity mask; future iterations could explore dynamic sparsity to improve accuracy at the cost of some computational overhead. Additionally, while latency and memory were optimized, future research could explicitly target energy-per-learned-concept. Finally, scaling these techniques to more complex tasks like object detection or natural language processing remains an open challenge for MCU-class devices.

Summary updated

BibTeX
@inproceedings{paissan2024structured,
  author = {Francesco Paissan and Davide Nadalini and Manuele Rusci and Alberto Ancilotto and Francesco Conti and Luca Benini and Elisabetta Farella},
  title = {{Structured Sparse Back-propagation for Lightweight On-Device Continual Learning on Microcontroller Units}},
  booktitle = {Workshops @ CVPR},
  year = {2024},
  doi = {10.1109/cvprw63382.2024.00222},
}
Figure