TL;DR
PerforatedCNNs accelerate deep learning models by skipping convolutional calculations at redundant spatial positions and interpolating the missing values. By exploiting spatial redundancy, this method achieves 2x–4x speedups on architectures like AlexNet and VGG-16 with minimal impact on accuracy, offering a "drop-in" solution for deploying heavy models on power-constrained mobile devices.
Introduction
Convolutional Neural Networks (CNNs) are the backbone of modern computer vision, but they are computationally expensive. In a typical network, convolutional layers account for over 80% of the execution time. This high cost makes it difficult to run state-of-the-art models on mobile phones or embedded systems without dedicated GPUs.
While techniques like "striding" (skipping pixels during convolution) exist, they change the network's architecture—altering the size of intermediate feature maps and the number of weights in subsequent layers. The authors sought a method to reduce computation that preserves the network's structure, allowing researchers to accelerate existing models without redesigning them from scratch.
Methods: The Perforation Approach
The authors introduce Perforation, a concept borrowed from traditional software engineering (loop perforation), where non-critical iterations of a loop are skipped to save time.
- Perforation Mask: The core idea is to define a binary mask for each convolutional layer. The convolution is only calculated at positions where the mask is "1."
- Interpolation: For the skipped positions (where the mask is "0"), the value is filled in using the nearest neighbor from the calculated set. This keeps the output tensor the same size as the original.
- Mask Selection Strategies: The paper explores four ways to choose which pixels to skip:
- Uniform: Randomly selecting positions.
- Grid: Selecting positions on a regular grid (similar to a fractional stride).
- Pooling Structure: Prioritizing pixels that are most frequently sampled by the following pooling layer.
- Impact: A data-driven approach using a first-order Taylor expansion to estimate which spatial positions have the highest impact on the final loss function.
- Lowering to Matrix Multiplication: To ensure actual wall-clock speedups, the authors modify the standard "im2col" (or lowering) process. By only generating rows in the data matrix that correspond to the perforation mask, they directly reduce the size of the matrix multiplication that drives most CNN implementations.
Key Insights and Ideas
- Spatial Redundancy is Real: Feature maps in CNNs are often spatially smooth. Calculating every single pixel is often overkill because neighboring pixels carry highly correlated information.
- Architecture Preservation: Because PerforatedCNNs use interpolation to maintain the original output size, they don't require changing the dimensions of the fully connected layers. This makes it much easier to apply to pre-trained models.
- The "Impact" Strategy: The authors found that pixels in the center of an image often have a higher "impact" on the loss function (likely because ImageNet objects are usually centered). Their Impact mask automatically learns to focus computation on these salient regions.
- Complementarity: Perforation targets spatial redundancy, whereas other popular methods (like low-rank tensor decomposition) target channel redundancy. The authors demonstrate that these two approaches can be combined to achieve even greater speedups than either could alone.
Key Results
The researchers evaluated their approach on standard computer vision benchmarks, including CIFAR-10 (with Network in Network) and ImageNet (with AlexNet and VGG-16).
- Speed vs. Accuracy: On ImageNet, the method achieved a 2x–4x speedup in convolutional layers. The Impact and Pooling strategies generally offered the best trade-offs between speedup and error increase.
- Fine-tuning is Essential: While perforation initially "damages" the network's performance, a round of fine-tuning (retraining the weights) recovers most of the lost accuracy.
- VGG-16 Performance: For VGG-16, the authors achieved a 4x theoretical speedup with only a ~1.6% increase in top-5 error when combined with other acceleration methods.
- Memory Savings: By only storing the calculated values, the memory required for intermediate activations is reduced by the perforation rate (e.g., a 50% perforation rate halves the activation memory).
Limitations and Future Work
- Static Masks: The masks used in this paper are "data-independent," meaning the same pixels are skipped regardless of what is in the image. The authors suggest that input-dependent perforation (dynamic masking based on image content) is a promising next step.
- Interpolation Overhead: While nearest-neighbor interpolation is fast, more sophisticated interpolation (like bilinear) might yield better accuracy but could introduce enough computational overhead to negate the speed gains.
- Hardware Specifics: The actual speedup depends heavily on how the underlying BLAS (Basic Linear Algebra Subprograms) libraries handle the reduced matrix sizes. On some hardware, the overhead of managing the mask might diminish the theoretical FLOP savings.
Summary updated