Vision Transformer Global Context Attention Mechanism

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Vision transformers face challenges in capturing long-range spatial dependencies in a computationally expensive manner due to their limited ability to cross-interact with non-local image regions, which restricts their effectiveness in higher resolution applications.

Innovation Solution

The implementation of a vision transformer architecture that incorporates both local and global self-attention mechanisms, where each stage includes a local self-attention module for short-range interactions and a global self-attention module that accesses features from outside the local window, allowing for the modeling of both short-range and long-range dependencies.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Use of energy by moving object

If vision transformers use local window self-attention to process image patches, then computational cost is reduced, but the ability to capture long-range spatial dependencies deteriorates

Engineering Contradiction:
Improvecomputational costVSAvoidlong-range spatial dependencies
Core Design Contradiction:
Use of energy by moving objectVSLoss of information

Solution Approach 1:

The patent divides the self-attention mechanism into two segments: local self-attention that operates within fixed windows to capture short-range dependencies efficiently, and global self-attention that operates across the entire image to capture long-range dependencies. This segmentation allows the model to process different spatial scopes separately, reducing overall computational cost while preserving both local and global contextual information.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces an intermediary mechanism where local self-attention features serve as the base representation, and global self-attention acts as a mediator to inject long-range contextual information into these local features. This intermediary approach allows efficient local processing to be enhanced by global context without requiring direct computation between all image patches.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Measurement precision

If vision transformers process higher resolution images with fixed resolution architecture, then image detail processing is improved, but adaptability to different resolutions deteriorates

Engineering Contradiction:
Improveimage detail processingVSAvoidadaptability to different resolutions
Core Design Contradiction:
Measurement precisionVSAdaptability or versatility

Solution Approach 1:

The patent employs dynamic resolution processing where the image is first downsampled to a fixed resolution for transformer processing, then the results are upsampled back to the original high resolution. This dynamic approach allows the model to maintain a fixed internal architecture while adapting to various input resolutions, preserving image details through the upsampling operation.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent changes the resolution parameter dynamically by downsampling input images to a standardized fixed resolution before processing, and subsequently restoring the original resolution through upsampling. This parameter transformation allows the fixed-resolution transformer architecture to handle high-resolution images effectively while maintaining adaptability to different input sizes.

Inventive Principle:
Principle #35Parameter changes

3Loss of information

If vision transformers shift windows to cross-interact with non-local regions, then global context capture is improved, but computational expense increases

Engineering Contradiction:
Improveglobal context captureVSAvoidcomputational expense
Core Design Contradiction:
Loss of informationVSUse of energy by moving object

Solution Approach 1:

The patent segments the attention computation into local and global components, where local self-attention handles within-window interactions and global self-attention handles cross-window interactions. This segmentation eliminates the need to shift windows and recompute attention, as global attention directly computes interactions across all regions in a single pass, reducing computational expense while capturing global context.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS20230394781A1Global context vision transformer
Publication Date: 2023.12.07 NVIDIA CORP
  • US20230394781A1 patent drawing
  • US20230394781A1 patent drawing
  • US20230394781A1 patent drawing

AI summary

Vision transformers are deep learning models that employ a self-attention mechanism to obtain feature representations for an input image. To date, the configuration of vision transformers has limited the self-attention computation to a local window of the input image, such that short-range dependencies are modeled in the output. The present disclosure provides a vision transformer that captures global context, and that is therefore able to model long-range dependencies in its output.