NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

When Sparsity Meets Dynamic Convolution

Shwai He, Yuhang Li, Chenbo Jiang, Shi GuarXiv 2022

Abstract

Dynamic convolution achieves better performance for efficient CNNs at the cost of negligible FLOPs increase. However, the performance increase can not match the significantly expanded number of parameters, which is the main bottleneck in real-world applications. Contrastively, mask-based unstructured pruning obtains a lightweight network by removing redundancy in the heavy network. In this paper, we propose a new framework, Sparse Dynamic Convolution (SD-Conv), to naturally integrate these two paths such that it can inherit the advantage of dynamic mechanism and sparsity. We first design a binary mask derived from a learnable threshold to prune static kernels, significantly reducing the parameters and computational cost but achieving higher performance in Imagenet-1K. We further transfer pretrained models into a variety of downstream tasks, showing consistently better results than baselines. We hope our SD-Conv could be an efficient alternative to conventional dynamic convolutions.

Introduction: The Parameter Explosion Problem

Standard "static" convolutions use fixed weights for every input. To increase model capacity without exploding computational costs, Dynamic Convolution (DY-Conv) was introduced. It uses an attention mechanism to combine multiple parallel kernels (experts) on the fly based on the input. While this significantly boosts representation power with negligible extra FLOPs, it creates a massive memory bottleneck: a model with 4 experts has nearly 4x the parameters of its static counterpart.

The authors observed that this 400% increase in parameters often yields only a 1-2% gain in accuracy, making DY-Conv difficult to deploy on edge devices. The challenge is to retain the "dynamic" benefits while shedding the "heavyweight" baggage.

The SD-Conv Framework

The proposed SD-Conv framework marries dynamic kernels with fine-grained, learnable sparsity. Unlike standard dynamic convolution which aggregates dense kernels, SD-Conv applies a binary mask to each parallel expert.

Comparison between (a) standard Dynamic Convolution and (b) the proposed Sparse Dynamic Convolution (SD-Conv).

Learnable Differentiable Pruning

The core of SD-Conv is a binary mask $M$ determined by a learnable threshold $\tau$. If a weight's magnitude is below $\tau$, it is pruned. To make this discrete decision trainable via gradient descent, the authors use a softmax-based approximation with a temperature hyperparameter and the Straight-Through Estimator (STE). This allows the network to "learn" the optimal sparsity pattern during training.

Optimization and Regularization

To achieve a specific target sparsity (e.g., 50%), the authors introduce an $L_0$-norm regularization term in the loss function. This penalty targets the count of non-zero elements, ensuring the model converges to the desired budget without manual layer-by-layer tuning. An iterative pruning policy is employed, gradually increasing sparsity to allow the network to adapt.

Key Insights: Why Sparsity Works

A critical finding of this work is that Pruning Doesn't Kill Dynamics. By analyzing a pretrained dynamic model, the researchers found that the statistical properties (mean and variance) of the aggregated kernels remained remarkably stable even after 50% pruning.

Mean and variance of aggregated kernels across layers for vanilla and pruned models.

Furthermore, the authors discovered that Diversity is Essential. Comparing "Same Mask" (shared across experts) vs. "Different Mask" (unique per expert) strategies revealed that unique masks perform significantly better. This suggests that unique sparsity patterns help preserve the functional diversity between experts that makes dynamic convolution effective.

Experimental Results

The researchers evaluated SD-Conv across ImageNet-1K, robustness benchmarks, and eight downstream tasks.

  • Efficiency: On ResNet-18, SD-Conv achieved 73.3% Top-1 accuracy on ImageNet with only 23.2M parameters. Standard DY-Conv achieved 72.7% but required 42.7M parameters.
  • FLOPs Reduction: For MobileNetV2-1.0, SD-Conv required fewer FLOPs (261.9M) than the original static convolution (300M) while being 3.3% more accurate.
  • Robustness: SD-Conv proved more resilient to noise. On ResNet-50 with high Gaussian noise, SD-Conv maintained 55.9% accuracy, outperforming both static (54.2%) and standard dynamic (55.4%) versions.
  • Generalization: SD-Conv consistently outperformed baselines across all downstream tasks (CIFAR, Food-101, etc.), proving the learned sparse features are highly transferable.

Conclusion

SD-Conv demonstrates that the massive redundancy in dynamic convolution can be effectively managed through learnable unstructured pruning. By integrating sparsity directly into the dynamic mechanism, SD-Conv achieves a superior trade-off between accuracy, parameters, and FLOPs. While hardware acceleration for unstructured sparsity remains a challenge on general-purpose GPUs, SD-Conv provides a powerful blueprint for making dynamic models "lean and mean" for memory-constrained environments.

Summary updated

BibTeX
@misc{he2022when,
  author = {Shwai He and Yuhang Li and Chenbo Jiang and Shi Gu},
  title = {{When Sparsity Meets Dynamic Convolution}},
  year = {2022},
  eprint = {2204.02227},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2204.02227},
}
Figure