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

Asymmetric Non-local Neural Networks for Semantic Segmentation

Zhen Zhu, Mengde Xu, Song Bai, Tengteng Huang, Xiang Bai

TL;DR

Non-local blocks are highly effective at capturing long-range context for semantic segmentation, but their quadratic computational and memory complexity makes them notoriously expensive. This paper introduces Asymmetric Non-local Neural Networks (ANN), which leverage spatial pyramid pooling to sample a sparse set of key anchor points. This simple twist slashes GPU memory usage by up to 28x and speeds up processing by 6x while achieving state-of-the-art segmentation accuracy.

What Problem Does This Paper Address?

To accurately segment objects in an image, a deep network needs to understand both fine-grained local details and global context (long-range dependencies). While standard convolutional layers excel at local features, their receptive fields grow slowly, making it difficult to capture relationships between distant pixels.

The "non-local block" (inspired by self-attention) was introduced to solve this by computing pixel-to-pixel relationships across the entire image. However, its computational and memory complexity scales quadratically ($O(N^2)$) with the number of pixels ($N = H \times W$). For high-resolution images common in semantic segmentation, standard non-local blocks quickly overwhelm GPU memory and severely slow down inference, making them impractical for real-world deployment.

Methods

The authors introduce two novel, lightweight components to break the quadratic bottleneck by making the non-local operations asymmetric:

  1. Asymmetric Pyramid Non-local Block (APNB): Instead of computing a massive $N \times N$ affinity matrix, APNB samples a fixed, much smaller number of representative "anchor points" ($S \ll N$) from the Key and Value branches. It does this using Spatial Pyramid Pooling (SPP) at four scales ($1\times1, 3\times3, 6\times6,$ and $8\times8$). Flattening and concatenating these yields just $S = 110$ anchor points. This drops the matrix multiplication complexity from $O(N^2)$ to $O(NS)$ while keeping the final output resolution intact.
  2. Asymmetric Fusion Non-local Block (AFNB): Traditional feature fusion (e.g., combining low-level detail layers with high-level semantic layers) is typically done via simple pixel-wise addition or concatenation. AFNB applies the asymmetric non-local mechanism across different stages of the network (Stage 4 and Stage 5 of a ResNet backbone), allowing the model to fuse multi-level features while accounting for global, long-range statistical correlations.
Figure 1: Architecture of a standard non-local block (a) and the asymmet- ric non-local block (b). N = H · W while S ≪N.
Figure 4: Demonstration of the pyramid max or average sampling process.

Datasets

The proposed network was rigorously evaluated on several prominent semantic segmentation benchmarks:

  • Cityscapes: Urban street-scene dataset containing 5,000 finely annotated high-resolution images.
  • ADE20K: A challenging scene parsing dataset spanning 150 semantic categories.
  • PASCAL Context: Full-scene annotations covering 60 distinct object and background classes.
  • COCO-Stuff-10K & NYUD-V2: Used in supplementary experiments to demonstrate generalization on both large and small benchmarks.

Key Insights and Ideas

  • Asymmetry is Sufficient: You don't need dense pixel-to-pixel comparisons to capture global context. Sampling a sparse, well-chosen set of global anchor points for the keys and values preserves the necessary contextual awareness without sacrificing output resolution.
  • Pyramid Pooling as a Statistical Remedy: Sub-sampling can sometimes lead to a loss of information. However, using spatial pyramid pooling to generate the anchor points acts as a strong regularizer, capturing multi-scale context that actually remedies potential performance drops.
  • Global Cross-Level Fusion Eradicates Local Inconsistencies: Traditional local fusion often struggles with large objects (like a massive truck or building), leading to fragmented predictions. Fusing features globally via AFNB ensures semantic consistency across large regions.

Key Results

  • Efficiency Gains: For a $256 \times 128$ input feature map, APNB runs 6 times faster on a GPU and reduces running memory footprint by 28 times compared to a standard non-local block.
  • State-of-the-Art Performance:
  • Cityscapes: Achieved a top-tier 81.3% mIoU on the test set.
  • ADE20K: Reached 45.24% mIoU, outperforming heavier backbones like PSPNet (ResNet-269).
  • PASCAL Context: Achieved 52.8% mIoU.
Figure 2: GPU time ( ≥1 ms) comparison of different operations between a generic non-local block and our APNB. The last bin denotes the sum of all the time costs. The size of the inputs for these two blocks is 256×128.

Limitations and Future Work

  • Architectural Sensitivity: The authors noted that AFNB requires careful tuning depending on the overall macro-architecture. For example, adding a batch normalization layer after the output projection ($W_o$) significantly boosts performance when AFNB is used in isolation, but can degrade results when integrated into the full combined model.
  • Hyperparameter Dependency: The network remains highly sensitive to initial learning rate configurations and strict training schedules (such as the "poly" learning rate decay policy).
  • Future Directions: The authors suggest that this asymmetric sampling strategy is a generic framework capable of accelerating self-attention in other domains, and they plan to apply it to video analysis and object tracking.

Summary updated

BibTeX
@misc{zhu2019asymmetric,
  author = {Zhen Zhu and Mengde Xu and Song Bai and Tengteng Huang and Xiang Bai},
  title = {{Asymmetric Non-local Neural Networks for Semantic Segmentation}},
  year = {2019},
  eprint = {1908.07678},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1908.07678},
}
Figure