Spike-Based Anytime Perception

Matthew Dutson, Yin Li, Mohit Gupta

Abstract

In many emerging computer vision applications, it is critical to adhere to stringent latency and power constraints. The current neural network paradigm of frame-based, floating-point inference is often ill-suited to these resource-constrained applications. Spike-based perception – enabled by spiking neural networks (SNNs) – is one promising alternative. Unlike conventional neural networks (ANNs), spiking networks exhibit smooth tradeoffs between latency, power, and accuracy. SNNs are the archetype of an "anytime algorithm" whose accuracy improves smoothly over time. This property allows SNNs to adapt their computational investment in response to changing resource constraints. Unfortunately, mainstream algorithms for training SNNs (i.e., those based on ANN-to-SNN conversion) tend to produce models that are inefficient in practice. To mitigate this problem, we propose a set of principled optimizations that reduce latency and power consumption by 1–2 orders of magnitude in converted SNNs. These optimizations leverage a set of novel efficiency metrics designed for anytime algorithms. We also develop a state-of-the-art simulator, SaRNN, which can simulate SNNs using commodity GPU hardware and neuromorphic platforms. We hope that the proposed optimizations, metrics, and tools will facilitate the future development of spike-based vision systems.

The Speed-Accuracy Dilemma in Modern Vision

In real-time domains like robotics, autonomous vehicles, and AR/VR, computer vision systems face a fundamental "speed vs. accuracy" trade-off. Standard Artificial Neural Networks (ANNs) operate on an "all-or-nothing" basis: the system must wait for the entire forward pass through every layer to complete before any output is available. This latency can be catastrophic in safety-critical scenarios where a robot needs to react to an obstacle immediately.

The Anytime Advantage of SNNs

Spiking Neural Networks (SNNs) offer a paradigm shift. By processing information through discrete spikes over time, SNNs function as "anytime algorithms." Instead of waiting for a final result, an SNN provides a rough initial estimate that improves smoothly as more spikes are processed. This allows a system to stop computation early for a fast response or continue for higher precision, depending on available resources.

Comparison of ANN vs SNN accuracy over time.

However, the most common method for creating deep SNNs—converting pre-trained ANNs—often results in models that are slow to reach peak accuracy and consume excessive power. This research addresses these inefficiencies through a holistic optimization approach.

Optimizing the SNN Lifecycle

To bridge the efficiency gap, the authors introduce a suite of optimizations across the model's entire lifecycle:

  1. Sparsity-Aware Training: A new loss penalty for Batch Normalization layers encourages activation sparsity. By keeping more neurons below their firing threshold, the network generates fewer spikes, directly reducing power consumption.
  2. Neuron-Level Scaling: Standard conversion scales entire layers uniformly. This work proposes fine-tuning individual neuron firing rates using a derivative-free optimizer to minimize accuracy loss during conversion.
  3. High-Entropy Initialization: Traditionally, SNN membranes start at zero. The authors demonstrate that initializing membranes to 0.5 (the "high-entropy" state) allows neurons to reach steady-state firing rates much faster, significantly reducing startup latency.
  4. Pareto-Optimal Metrics: Rather than optimizing for a single point, new metrics measure the entire area under the accuracy-time and accuracy-power curves, ensuring robustness across various operating points.

Results: Slashing Latency and Power

The proposed optimizations were tested on benchmarks ranging from MNIST to ImageNet. The results demonstrate that "anytime" performance can be achieved without sacrificing peak accuracy.

Latency and power savings achieved through proposed optimizations.

Key performance gains include:

  • Latency: Reduced by approximately 10x. On ImageNet, the time required for inference dropped from 1568 to 416 time steps.
  • Power: Synaptic events, a proxy for power on neuromorphic hardware, were reduced by up to 100x.
  • Peak Accuracy: On ImageNet, the optimized SNN achieved 49.68% accuracy, outperforming the 41.59% baseline.

Conclusion

By treating SNNs as anytime algorithms and optimizing for the entire tradeoff curve, it is possible to achieve order-of-magnitude improvements in efficiency. These advancements, supported by the high-performance SaRNN simulator, pave the way for deploying sophisticated spike-based vision systems on resource-constrained edge devices and neuromorphic hardware like SpiNNaker.

Summary updated

BibTeX
@inproceedings{dutson2023spike,
  author = {Matthew Dutson and Yin Li and Mohit Gupta},
  title = {{Spike-Based Anytime Perception}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2023},
  url = {https://openreview.net/forum?id=R0WMQgfAKZ},
}
Figure