Abstract
The Non-Local Network (NLNet) presents a pioneering approach for capturing long-range dependencies, via aggregating query-specific global context to each query position. However, through a rigorous empirical analysis, we have found that the global contexts modeled by non-local network are almost the same for different query positions within an image. In this paper, we take advantage of this finding to create a simplified network based on a query-independent formulation, which maintains the accuracy of NLNet but with significantly less computation. We further observe that this simplified design shares similar structure with Squeeze-Excitation Network (SENet). Hence we unify them into a three-step general framework for global context modeling. Within the general framework, we design a better instantiation, called the global context (GC) block, which is lightweight and can effectively model the global context. The lightweight property allows us to apply it for multiple layers in a backbone network to construct a global context network (GCNet), which generally outperforms both simplified NLNet and SENet on major benchmarks for various recognition tasks.
Introduction
In computer vision, capturing "long-range dependencies"—how a pixel in the top-left corner of an image relates to one in the bottom-right—is essential for understanding complex scenes. Standard Convolutional Neural Networks (CNNs) struggle with this because convolutions only look at small, local neighborhoods. To see the "big picture," a network typically requires stacking dozens of layers to expand the receptive field.
The Non-Local Network (NLNet) was a breakthrough that solved this using a self-attention mechanism, allowing every pixel to "talk" to every other pixel in a single layer. However, NLNet is computationally expensive and memory-intensive because it calculates a unique attention map for every single pixel (query position). GCNet investigates whether this massive pairwise computation is actually necessary.
Empirical Analysis and the Illusion of Query-Specificity
The authors began with a rigorous empirical analysis of NLNet. By visualizing the attention maps for different query points, they discovered that the maps were almost identical regardless of the query position. Whether the query was a pixel on an object or in the background, the network attended to the same global regions.
This observation suggests that the expensive "query-specific" attention in NLNet is largely redundant. The network naturally learns a global saliency map rather than specific point-to-point relationships.
Methods: The Global Context (GC) Block
Based on the query-independent observation, the authors developed a simplified formulation. This led to the GC Block, which unifies the strengths of NLNet and Squeeze-Excitation (SE) Networks into a single, high-performance architecture. The GC Block follows a three-step framework:
- Context Modeling: Instead of calculating unique maps, it uses a single global attention map (via global attention pooling) to aggregate features from the entire image.
- Feature Transform: It uses a bottleneck structure (two 1x1 convolutions) to capture channel-wise interdependencies, similar to SENet.
- Fusion: It merges this global context back into the original features using element-wise addition.
Crucially, the authors added Layer Normalization inside the bottleneck transform, which significantly eased optimization and improved generalization. Because the GC Block is so efficient (adding only ~0.26% to the FLOP count of a ResNet-50), it can be applied to every residual block in a network, rather than just a few layers.
Key Results
GCNet consistently outperformed its predecessors across major benchmarks with negligible overhead:
- Object Detection (COCO): On a Mask R-CNN with ResNet-50, GCNet improved the $AP^{box}$ by 2.7% and $AP^{mask}$ by 2.4% over the baseline, outperforming both NLNet and SENet.
- Image Classification (ImageNet): GCNet achieved a 0.82% top-1 accuracy increase over ResNet-50 with almost no increase in FLOPs.
- Action Recognition (Kinetics): It provided a 1.1% top-1 accuracy boost over the "Slow-only" baseline.
Overall, a GC-ResNet-50 is significantly faster and uses fewer parameters than a standard Non-Local ResNet-50 while achieving higher accuracy.
Conclusion
GCNet demonstrates that query-independent global context is sufficient for general recognition tasks like classification and detection. By identifying that NLNet and SENet are two sides of the same coin—NLNet having superior pooling and SENet having a superior transform—the GC Block provides a "best of both worlds" solution. While some specific tasks might still require query-dependent modeling, the GCNet framework's efficiency and performance make it a powerful tool for large-scale vision backbones.
Summary updated