Gramformer: Learning Crowd Counting via Graph-Modulated Transformer

Fuente: arXiv
Gespeichert in:
Bibliographische Detailangaben
Hauptverfasser: Lin, Hui, Ma, Zhiheng, Hong, Xiaopeng, Shangguan, Qinnan, Meng, Deyu
Format: Preprint
Veröffentlicht: 2024
Schlagworte:
Online-Zugang:
Tags: Tag hinzufügen
Keine Tags, Fügen Sie den ersten Tag hinzu!
_version_ 1866909065066577920
author Lin, Hui
Ma, Zhiheng
Hong, Xiaopeng
Shangguan, Qinnan
Meng, Deyu
author_facet Lin, Hui
Ma, Zhiheng
Hong, Xiaopeng
Shangguan, Qinnan
Meng, Deyu
contents Transformer has been popular in recent crowd counting work since it breaks the limited receptive field of traditional CNNs. However, since crowd images always contain a large number of similar patches, the self-attention mechanism in Transformer tends to find a homogenized solution where the attention maps of almost all patches are identical. In this paper, we address this problem by proposing Gramformer: a graph-modulated transformer to enhance the network by adjusting the attention and input node features respectively on the basis of two different types of graphs. Firstly, an attention graph is proposed to diverse attention maps to attend to complementary information. The graph is building upon the dissimilarities between patches, modulating the attention in an anti-similarity fashion. Secondly, a feature-based centrality encoding is proposed to discover the centrality positions or importance of nodes. We encode them with a proposed centrality indices scheme to modulate the node features and similarity relationships. Extensive experiments on four challenging crowd counting datasets have validated the competitiveness of the proposed method. Code is available at {https://github.com/LoraLinH/Gramformer}.
format Preprint
id arxiv_https___arxiv_org_abs_2401_03870
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Gramformer: Learning Crowd Counting via Graph-Modulated Transformer
Lin, Hui
Ma, Zhiheng
Hong, Xiaopeng
Shangguan, Qinnan
Meng, Deyu
Computer Vision and Pattern Recognition
Transformer has been popular in recent crowd counting work since it breaks the limited receptive field of traditional CNNs. However, since crowd images always contain a large number of similar patches, the self-attention mechanism in Transformer tends to find a homogenized solution where the attention maps of almost all patches are identical. In this paper, we address this problem by proposing Gramformer: a graph-modulated transformer to enhance the network by adjusting the attention and input node features respectively on the basis of two different types of graphs. Firstly, an attention graph is proposed to diverse attention maps to attend to complementary information. The graph is building upon the dissimilarities between patches, modulating the attention in an anti-similarity fashion. Secondly, a feature-based centrality encoding is proposed to discover the centrality positions or importance of nodes. We encode them with a proposed centrality indices scheme to modulate the node features and similarity relationships. Extensive experiments on four challenging crowd counting datasets have validated the competitiveness of the proposed method. Code is available at {https://github.com/LoraLinH/Gramformer}.
title Gramformer: Learning Crowd Counting via Graph-Modulated Transformer
topic Computer Vision and Pattern Recognition
url https://arxiv.org/abs/2401.03870