English

Adaptively Clustering Neighbor Elements for Image-Text Generation

Computer Vision and Pattern Recognition 2025-08-19 v4

Abstract

We propose a novel Transformer-based image-to-text generation model termed as \textbf{ACF} that adaptively clusters vision patches into object regions and language words into phrases to implicitly learn object-phrase alignments for better visual-text coherence. To achieve this, we design a novel self-attention layer that applies self-attention over the elements in a local cluster window instead of the whole sequence. The window size is softly decided by a clustering matrix that is calculated by the current input data and thus this process is adaptive. By stacking these revised self-attention layers to construct ACF, the small clusters in the lower layers can be grouped into a bigger cluster, \eg vision/language. ACF clusters small objects/phrases into bigger ones. In this gradual clustering process, a parsing tree is generated which embeds the hierarchical knowledge of the input sequence. As a result, by using ACF to build the vision encoder and language decoder, the hierarchical object-phrase alignments are embedded and then transferred from vision to language domains in two popular image-to-text tasks: Image captioning and Visual Question Answering. The experiment results demonstrate the effectiveness of ACF, which outperforms most SOTA captioning and VQA models and achieves comparable scores compared with some large-scale pre-trained models. Our code is available \href{https://github.com/ZihuaEvan/ACFModel/}{[here]}.

Keywords

Cite

@article{arxiv.2301.01955,
  title  = {Adaptively Clustering Neighbor Elements for Image-Text Generation},
  author = {Zihua Wang and Xu Yang and Hanwang Zhang and Haiyang Xu and Ming Yan and Fei Huang and Yu Zhang},
  journal= {arXiv preprint arXiv:2301.01955},
  year   = {2025}
}

Comments

This work has been accepted by IEEE Transactions on Multimedia

R2 v1 2026-06-28T08:03:27.754Z