CBinfer: Change-Based Inference for Convolutional Neural Networks on Video Data

Lukas Cavigelli, Philippe Degen, Luca Benini

Introduction

Deep learning models, particularly Convolutional Neural Networks (CNNs), have become the standard for complex computer vision tasks such as object detection and semantic segmentation. However, their deployment on edge devices—such as smart surveillance cameras or drones—is often hindered by significant power and computational constraints. Standard CNN inference typically processes every video frame from scratch, which is highly inefficient for static camera feeds where the vast majority of the scene remains unchanged between frames.

This paper introduces CBinfer, a novel algorithm that exploits the spatio-temporal sparsity of video data to accelerate inference. By computing convolutions only for pixels that have changed between frames, CBinfer achieves an 8.6x speedup and a 10x boost in energy efficiency on edge hardware, maintaining high accuracy with less than 0.1% loss and requiring no retraining of the original network.

Methodology: Change-Based Spatial Convolution

The core innovation of CBinfer is the change-based spatial convolution layer (CBconv). Unlike standard layers that rely on dense matrix multiplications for the entire image, CBinfer decomposes the inference process into a sequence of targeted operations:

  1. Change Detection: The system compares the current input feature map to the previous frame's feature map, flagging pixels where the absolute difference exceeds a threshold ($\tau$).
  2. Index Extraction: It compiles the exact coordinates of these changed pixels.
  3. Matrix Generation & Multiplication: Instead of a full-frame matrix, it constructs a miniature matrix containing only the data necessary to update the affected output pixels.
  4. Output Updating: The previous frame's feature map is updated by overwriting only the newly computed, changed pixels.
The CBinfer pipeline, detailing the transition from change detection to output updating.

Crucially, CBinfer applies this change detection at every convolution layer. This prevents "receptive field explosion," a phenomenon where a single changed pixel at the input would otherwise necessitate recomputing an exponentially larger area in subsequent layers. By thresholding at every stage, the algorithm keeps computation strictly bounded to meaningful movement.

Experimental Setup

The algorithm was evaluated on an urban street surveillance dataset featuring high-resolution (776 x 1040) video sequences. The primary task was 8-class semantic segmentation, classifying pixels into categories such as buildings, roads, vehicles, and sky.

Visualization of the 8-class semantic segmentation task on a street scene.

CBinfer serves as a drop-in replacement for standard inference engines. Because it approximates the mathematical output by reusing identical past data, it can be applied to existing, pre-trained models without any modification to the weights.

Results and Discussion

Experimental results on an Nvidia Jetson TX1 demonstrate the effectiveness of the approach:

  • Speedup: CBinfer achieved an average 8.6x speedup over an optimized cuDNN baseline, increasing throughput from ~1.96 fps to ~17 fps.
  • Accuracy: The massive reduction in compute came with a negligible pixel classification accuracy loss of <0.1%.
  • Energy Efficiency: Efficiency improved by 10x, jumping from 32.0 GOp/s/W to an equivalent of 327.6 GOp/s/W.
  • Compute Reduction: Execution time for the heaviest feature-extraction layers shrank by over 12.9x.

Conclusion and Future Work

CBinfer effectively addresses the computational bottlenecks of deploying CNNs on the edge by leveraging temporal redundancy. While it introduces a memory overhead of approximately 58% to store intermediate states, this is a manageable trade-off for the significant gains in speed and power efficiency. Future research will focus on implementing adaptive threshold control loops to dynamically manage the trade-off between frame rate and accuracy in highly dynamic scenes.

Summary updated

BibTeX
@inproceedings{cavigelli2017cbinfer,
  author = {Lukas Cavigelli and Philippe Degen and Luca Benini},
  title = {{CBinfer: Change-Based Inference for Convolutional Neural Networks on Video Data}},
  booktitle = {ICDSC},
  year = {2017},
  url = {https://openreview.net/forum?id=l1UMktUfmXf},
}
Figure