Affinity-based Attention in Self-supervised Transformers Predicts Dynamics of Object Grouping in Humans

Hossein Adeli, Seoyoung Ahn, Nikolaus Kriegeskorte, Gregory J. ZelinskyarXiv 2023 · DOI

Introduction

Perceptual grouping, the ability of the human visual system to organize discrete pixels into coherent objects, is a fundamental component of vision. While classical Gestalt principles (e.g., proximity, continuity) provide a basic framework, they often struggle to explain how humans navigate the complexity of natural, cluttered scenes. This study investigates whether the emergent object-centric properties of self-supervised Vision Transformers (ViTs) can serve as a computational mechanism for how humans spread attention across an object to define its boundaries.

Methodology: The Affinity-Spread Model

The researchers proposed an Affinity-spread model leveraging the internal representations of ViTs trained with self-supervised objectives, such as DINO and MAE. Unlike traditional models that rely on hand-crafted features, this approach utilizes the mathematical "affinity" (similarity) between image patches.

Visualization of affinity-based feature similarity in a Vision Transformer, showing how attention spreads across specific objects like the person or the bench.

In this model, an image is decomposed into tokens (patches). The affinity between tokens is calculated via the dot product of their feature vectors. Starting from a "seed" point, the model iteratively recruits neighboring patches with high affinity to the currently attended region. This process simulates the dynamic growth of attention across a single entity, effectively discovering object boundaries without explicit supervision.

Experimental Design and Validation

To validate the model against human behavior, the authors conducted a "two-dot" grouping experiment using 288 complex images from the MS COCO dataset. Seventy-two human participants were tasked with determining whether two flickering cues (dots) appeared on the same object or different objects.

The experimental paradigm (A) and the four conditions (B) used to measure human reaction times in the two-dot object grouping task.

The study compared human reaction times (RT) to the number of computational "steps" required by the affinity-spread model to connect the two points. This allowed the researchers to test the "Same-Object Advantage"—the phenomenon where humans process two points faster if they belong to the same object, regardless of physical distance.

Key Results

  • Superiority of Self-Supervision: Models trained without explicit labels, particularly DINOv2, developed significantly more object-centric features. ROC analysis showed that DINOv2 features aligned with ground-truth object boundaries with an AUC of 0.877, vastly outperforming CNN-based models (AUC ~0.61).
  • Human-AI Alignment: The affinity-spread model achieved a significant Spearman rank correlation (~0.25) with human reaction times. This suggests that the global attention mechanism in Transformers is better suited for capturing long-range dependencies in object grouping than the local filters of traditional CNNs.
  • Feature Importance: The study found that using Key or Query features from the Transformer architecture yielded the highest alignment with human behavioral dynamics, outperforming the "Value" features.

Discussion and Limitations

While the ViT-based models represent a significant step forward, a performance gap remains between AI models and human-to-human agreement (~0.42). A notable discrepancy was observed in the "different object" condition: while human reaction times remain relatively flat once they identify the dots are on separate objects, the model's "reaction time" was still influenced by the physical distance between the dots.

Future research will focus on integrating top-down feedback—incorporating semantic knowledge of objects—to help the model resolve ambiguous boundaries and refining the "stopping criteria" for attention spread to better mimic human perceptual limits.

Summary updated

BibTeX
@misc{adeli2023affinity,
  author = {Hossein Adeli and Seoyoung Ahn and Nikolaus Kriegeskorte and Gregory J. Zelinsky},
  title = {{Affinity-based Attention in Self-supervised Transformers Predicts Dynamics of Object Grouping in Humans}},
  year = {2023},
  eprint = {2306.00294},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2306.00294},
}
Figure