Papers
Topics
Authors
Recent
Search
2000 character limit reached

Criss-Cross Network (CCNet)

Updated 3 July 2026
  • Criss-Cross Network (CCNet) is a deep learning model that uses a criss-cross attention mechanism to aggregate image context by focusing on rows and columns.
  • It employs recurrent criss-cross attention and a category consistent loss to achieve state-of-the-art segmentation accuracy while reducing computational and memory costs.
  • Empirical evaluations on benchmarks like Cityscapes and ADE20K show improved mIoU and efficiency compared to traditional non-local attention methods.

The Criss-Cross Network (CCNet) is a deep learning architecture for semantic segmentation and dense visual prediction that leverages a novel criss-cross attention (CCA) mechanism to efficiently capture full-image contextual dependencies. CCNet achieves this by restricting pixel-level attention to the criss-cross path of the reference pixel, substantially reducing the computational and memory overhead compared to traditional non-local self-attention, while maintaining or surpassing state-of-the-art segmentation performance (Huang et al., 2018).

1. Motivation and Architectural Overview

Fully convolutional networks (FCNs) are constrained by limited receptive fields, often aggregating only local context and failing to capture dependencies between distant pixels—a limitation detrimental to tasks like semantic segmentation. Traditional non-local/self-attention modules overcome this by computing pairwise similarities for all N=H×WN=H\times W pixels, but at prohibitive O(N2)\mathcal O(N^2) time and space complexity. CCNet introduces a more tractable criss-cross attention structure: each pixel attends solely to pixels in the same row and column, reducing the attention set size for each pixel to approximately 2N2\sqrt N for images of nearly equal height HH and width WW.

The high-level CCNet pipeline is as follows:

  1. A backbone CNN (e.g., ResNet-101 with dilated convolutions) processes the input, yielding a feature map X∈RC×H×W\mathbf X\in \mathbb R^{C\times H\times W}.
  2. A 1×11\times1 convolution reduces channels to C′C', producing H∈RC′×H×W\mathbf H\in \mathbb R^{C'\times H\times W}.
  3. The recurrent criss-cross attention (RCCA) module, applied R=2R=2 times, augments O(N2)\mathcal O(N^2)0 with full-image context to produce O(N2)\mathcal O(N^2)1.
  4. The contextualized O(N2)\mathcal O(N^2)2 is concatenated with the original O(N2)\mathcal O(N^2)3, further fused using convolutional layers, and then fed to a pixel-wise classifier.

2. Criss-Cross Attention Mechanism

2.1. Linear Projections

Given input features O(N2)\mathcal O(N^2)4, three O(N2)\mathcal O(N^2)5 convolutional layers generate queries (O(N2)\mathcal O(N^2)6), keys (O(N2)\mathcal O(N^2)7), and values (O(N2)\mathcal O(N^2)8):

O(N2)\mathcal O(N^2)9

with 2N2\sqrt N0, 2N2\sqrt N1 and 2N2\sqrt N2.

2.2. Affinity and Normalization

For each spatial position 2N2\sqrt N3, attention operates over 2N2\sqrt N4—the set of all pixels sharing the same row or column. The affinity between reference position 2N2\sqrt N5 and a spatial position 2N2\sqrt N6 is computed as:

2N2\sqrt N7

Normalization via softmax is applied over the criss-cross set:

2N2\sqrt N8

2.3. Context Aggregation

The output feature at position 2N2\sqrt N9 is computed as:

HH0

or, in tensor notation,

HH1

3. Recurrent Application for Global Context

Because a single criss-cross attention module propagates information only within rows and columns, CCNet employs recurrence: two sequential passes of CCA with shared parameters. The update is:

HH2

The final feature HH3 thus incorporates information from the entire image, as pixels propagate context "across" and then "down" or vice versa, covering all spatial dependencies after two iterations.

4. Category Consistent Loss for Feature Discrimination

CCNet introduces a category consistent loss (CCL) to enhance class-discriminative feature clustering:

  • For each class HH4 with pixel count HH5, feature vectors HH6 (from a HH7 conv) define cluster centers HH8.
  • The loss consists of:
    • Intra-class variance term:

    HH9

    with

    WW0 - Inter-class distance term:

    WW1

    WW2 - Regularization:

    WW3

  • The full loss is:

WW4

Recommended weights: WW5, WW6, WW7, WW8.

5. Computational and Memory Efficiency

Comparing with non-local modules:

  • Non-local attention: Each of WW9 pixels attends to X∈RC×H×W\mathbf X\in \mathbb R^{C\times H\times W}0 positions, yielding X∈RC×H×W\mathbf X\in \mathbb R^{C\times H\times W}1 computational/memory cost.

  • Criss-cross attention: Each pixel processes only X∈RC×H×W\mathbf X\in \mathbb R^{C\times H\times W}2 positions for nearly square images, so total cost is X∈RC×H×W\mathbf X\in \mathbb R^{C\times H\times W}3.

  • In empirical evaluation:

    • Non-local block (X∈RC×H×W\mathbf X\in \mathbb R^{C\times H\times W}4) on X∈RC×H×W\mathbf X\in \mathbb R^{C\times H\times W}5 features: ~108 GFLOPs, +1411 MB GPU memory.
    • RCCA (X∈RC×H×W\mathbf X\in \mathbb R^{C\times H\times W}6): ~16.5 GFLOPs, +127 MB GPU memory.
    • Thus, RCCA is about 11× more memory efficient and reduces FLOPs by ~85% compared to non-local blocks.
Module Computational Cost Memory Cost
Non-local X∈RC×H×W\mathbf X\in \mathbb R^{C\times H\times W}7 X∈RC×H×W\mathbf X\in \mathbb R^{C\times H\times W}8
CCA (single) X∈RC×H×W\mathbf X\in \mathbb R^{C\times H\times W}9 1×11\times10
RCCA (1×11\times11) 1×11\times12 1×11\times13

This efficiency enables deployment on high-resolution images where non-local modules are infeasible.

6. Empirical Evaluation on Benchmark Datasets

CCNet's performance has been validated on multiple semantic and instance segmentation benchmarks:

  • Cityscapes:
    • Val: 80.5% mIoU with ResNet-101 + 1×11\times14 + CCL.
    • Test: 81.9% mIoU, outperforming DenseASPP (80.6%).
  • ADE20K (150 classes):
    • Val: 45.76% mIoU, an improvement of +1.1 percentage points over EncNet (44.65%).
  • LIP (human parsing, 20 parts):
    • Val: 55.47% mIoU, +2.3 over previous best CE2P (53.10%).
  • COCO (instance segmentation):
    • Mask R-CNN + RCCA (ResNet-50): Box AP increases from 38.2 to 39.3; Mask AP from 34.8 to 36.1.
    • With ResNet-101: Box AP 40.1→41.0; Mask AP 36.2→37.3.
  • CamVid (video segmentation):
    • 3D-RCCA with 5-frame clips (ResNet-101, 1×11\times15, 1×11\times16): 79.1% mIoU, up from 77.9% (1×11\times17), exceeding VideoGCRF (75.2%).

These results demonstrate that CCNet not only improves performance metrics, but does so with significantly reduced computation and memory requirements (Huang et al., 2018).

7. Summary and Significance

CCNet advances semantic segmentation by combining criss-cross attention with recurrent propagation and a category consistent loss, yielding dense contextual aggregation across images at a fraction of the computational cost incurred by non-local self-attention modules. Empirical results demonstrate its broad applicability and state-of-the-art segmentation accuracy on standard benchmarks. The source code is publicly available at https://github.com/speedinghzl/CCNet (Huang et al., 2018).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Criss-Cross Network (CCNet).