Introduction
Standard convolutional layers are the workhorse of computer vision, yet they suffer from a "local blind spot." They operate via sliding windows that only perceive small image patches. While stacking layers increases the receptive field, the kernels themselves remain static and indifferent to the broader scene. Context-Gated Convolution (CGC) addresses this by transforming static kernels into adaptive processors that modulate their weights based on global context.
Methodology: The CGC Framework
CGC modulates the static weights $W$ of a layer using a generated gate $G$ via element-wise multiplication: $\hat{W} = W \odot G$. To maintain efficiency, the gate generation is decomposed into three specialized modules:
- Context Encoding Module: Pools the input feature map and applies a linear layer to capture spatial interactions, creating a global context representation.
- Channel Interacting Module: Uses grouped linear layers to project context into the output dimension, avoiding parameter explosion.
- Gate Decoding Module: Decodes representations back into the spatial dimensions of the convolution kernel (e.g., $3 \times 3$).
This design adds negligible overhead—only 0.03M parameters for a ResNet-50—making it a highly efficient "drop-in" replacement for standard convolutions.
Key Insights and Results
CGC allows networks to specialize filters on the fly. For instance, if a "Goldfish" context is detected, kernels can adapt to better identify fins and scales throughout the image. The authors demonstrate that modulating weights is often more stable and effective than modulating features.
Performance Benchmarks
- ImageNet Classification: A ResNet-50 with CGC achieved 79.54% Top-1 accuracy, outperforming the standard ResNet-50 baseline (78.13%) and other attention-based methods like SE-Net and CBAM.
- Action Recognition: On the Something-Something dataset, CGC added to a TSN baseline improved Top-1 accuracy from 19.00% to 32.58%, significantly outperforming heavier "Non-local" blocks.
- Robustness: On the ObjectNet dataset, CGC showed a 2.18% improvement, indicating a better holistic understanding of objects in unusual poses or backgrounds.
- Machine Translation: In IWSLT’14 De-En, CGC yielded a 35.21 BLEU score, surpassing both the baseline and standard Transformer models.
Conclusion
Context-Gated Convolution provides a lightweight yet powerful mechanism for global feature interaction by modulating weights rather than features. Its minimal computational cost and consistent performance gains across vision and language tasks make it a compelling architectural enhancement for deep learning models.
Summary updated