ComAlign: Compositional Alignment in Vision-Language Models

Ali Abdollah, Amirmohammad Izadi, Armin Saghafian, Reza Vahidimajd, Mohammad Mozafari, Amirreza Mirzaei, Mohammad Samiei, Mahdieh Soleymani Baghshah

Introduction

Current state-of-the-art Vision-Language Models (VLMs) like CLIP and ALIGN are remarkably effective at matching general images to descriptions. However, they often suffer from a lack of compositional understanding, frequently treating images and text as "bags of words." This leads to failures in distinguishing between similar scenes with different attribute bindings, such as "a red car and a blue truck" versus "a blue car and a red truck."

This limitation arises because these models are typically trained using a coarse-grained contrastive loss that focuses on global embeddings. They miss the fine-grained structure—the specific ways objects, attributes, and actions are linked. ComAlign is introduced as a lightweight "plugin" to address this by extracting and aligning specific entities and relations without requiring massive retraining.

Methodology

ComAlign treats images and text as graphs where objects are nodes and relationships are edges. The process involves three main stages:

  1. Component Extraction:
  2. Text: NLP tools (spaCy) extract Entity Components (nouns and adjectives) and Relational Components (subject-action-object triplets).
  3. Image: An object detector (YOLOv9) identifies candidate regions for entities. "Relation boxes" are created by cropping areas that encompass pairs of interacting objects.
  4. Lightweight Plugin Architecture: The base VLM (e.g., CLIP) remains frozen. A two-layer transformer is added on top to produce contextualized representations of the fine-grained components.
  5. Fine-Grained Matching (FGM): The model calculates similarity by seeking the maximum alignment between specific image patches and text tokens, ensuring that descriptive terms in the text (like "red") align with the correct visual pixels.
The ComAlign architecture utilizes frozen VLM encoders followed by lightweight transformer-encoders to perform fine-grained matching between extracted entity and relation components.

Experiments and Datasets

The model was trained on the Visual Genome dataset (~100k images) due to its dense annotations for attributes and relationships. Evaluation was performed across several benchmarks:

  • Retrieval: MSCOCO and Flickr30K for zero-shot image-to-text (I2T) and text-to-image (T2I) tasks.
  • Compositional Understanding: The ARO benchmark (VG-Attribution and VG-Relation) and SVO-Probes were used to test attribute binding and subject-verb-object order.

Key Results

ComAlign demonstrates significant performance boosts across various backbones, including CLIP, NegCLIP, and CoCa. On the MSCOCO dataset, ComAlign improved CLIP-ViT-B32’s image-to-text retrieval (R@1) by 5.60% and text-to-image retrieval by 6.27%. In compositional tests like the VG-Attribution benchmark, it improved CLIP’s performance by 5.55%.

Quantitative comparison of ComAlign across MSCOCO and Flickr30K datasets, showing consistent relative gains in retrieval metrics for various base models.

Conclusion

ComAlign proves that efficiency can triumph over scale. By training a tiny plugin on just 100k samples, it outperforms models fine-tuned on hundreds of millions of samples. This suggests that explicitly seeking structural correspondence between modalities is a more effective path toward compositional intelligence than simply increasing data volume. Future work will focus on refining relationship directionality and integrating more complex scene graph topologies.

Summary updated

BibTeX
@misc{abdollah2024comalign,
  author = {Ali Abdollah and Amirmohammad Izadi and Armin Saghafian and Reza Vahidimajd and Mohammad Mozafari and Amirreza Mirzaei and Mohammad Samiei and Mahdieh Soleymani Baghshah},
  title = {{ComAlign: Compositional Alignment in Vision-Language Models}},
  year = {2024},
  eprint = {2409.08206},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2409.08206},
}
Figure