Abstract
The Representative Graph Neural Network (RepGraph) addresses the massive computational overhead of "non-local" operations (like self-attention) in computer vision. By dynamically sampling only a few "representative" nodes instead of processing every single pixel, RepGraph achieves a 17x reduction in complexity and a 5x speedup while improving accuracy on benchmarks like ADE20K and Cityscapes.
Introduction: The Non-Local Bottleneck
In tasks like semantic segmentation, understanding long-range dependencies—the relationship between distant parts of an image—is crucial. For instance, identifying a small blue patch as a "lake" often requires context from surrounding "trees" and "grass."
To capture these dependencies, researchers typically employ non-local operations. However, standard non-local blocks are "dense": every pixel attends to every other pixel in the image. For an image with $N$ pixels, the computational complexity grows quadratically ($O(N^2)$). This creates a massive bottleneck for high-resolution image processing.
Statistical Motivation: The Sparsity "Aha" Moment
The authors observed a key inefficiency in standard non-local blocks: the "affinity matrix"—which determines the attention weight between pixels—is extremely imbalanced.
As shown in the histogram above, most pixels contribute negligible weights to the final output. This proves that "global" context does not require "dense" computation; rather, a few representative nodes can capture the necessary information. Unlike previous methods that used fixed pooling to reduce resolution, RepGraph is dynamic, learning where to look based on the specific content of the image.
Methods: The RepGraph Layer
The core innovation is the RepGraph layer, which replaces the dense, fully-connected graph of standard non-local blocks with a sparse graph. Instead of looking at all $N$ positions, the model learns to pick $S$ "representative" nodes, where $S \ll N$.
The RepGraph layer operates through several key steps:
- Dynamic Sampling: The network uses a $1 \times 1$ convolution to predict spatial offsets for $S$ nodes.
- Bilinear Interpolation: Because learned offsets can be fractional, the model uses bilinear interpolation to sample features from the grid accurately.
- Message Passing: The response for each pixel is calculated as a weighted sum of only these few representative nodes, drastically reducing the number of connections.
The authors proposed several architectural variants, including Simple RepGraph (SRG) for direct replacement, Bottleneck RepGraph (BRG) for channel efficiency, and Grid & Group extensions for further spatial and channel-wise optimization.
Key Results
The RepGraph network (RGNet) was evaluated across major benchmarks, demonstrating superior efficiency and performance:
- Efficiency: For a $256 \times 128$ input, RepGraph is approximately 17 times smaller in GFLOPs and 5 times faster than standard non-local blocks.
- ADE20K: RGNet achieved 45.8% mIoU, outperforming established models like DANet and CCNet (both 45.22%).
- Cityscapes: The model reached 81.5% mIoU, matching state-of-the-art performance with a significantly lighter footprint.
- Object Detection (COCO): Adding a single RepGraph layer to a Mask R-CNN backbone improved Box AP from 38.0 to 39.6, surpassing the standard non-local baseline (39.0).
Conclusion
RepGraph demonstrates that the redundancy inherent in dense non-local operations is not only computationally expensive but potentially harmful to feature robustness. By forcing the model to pick representative nodes, it learns a more robust, less noisy feature representation. RepGraph provides a scalable and efficient path for long-range dependency modeling in high-resolution computer vision tasks.
Summary updated