[Paper Review] CMA-CLIP: Cross-Modality Attention CLIP for Image-Text Classification
CMA-CLIP introduces a unified framework that enhances CLIP by integrating sequence-wise and modality-wise cross-modality attention mechanisms to improve image-text classification. By modeling fine-grained patch-token relationships and dynamically weighting modalities based on relevance, it achieves 11.9% higher recall at 90% precision on the MRWPA dataset and 5.5% higher accuracy than SOTA on Fashion-Gen, while demonstrating robustness to noisy inputs.
Modern Web systems such as social media and e-commerce contain rich contents expressed in images and text. Leveraging information from multi-modalities can improve the performance of machine learning tasks such as classification and recommendation. In this paper, we propose the Cross-Modality Attention Contrastive Language-Image Pre-training (CMA-CLIP), a new framework which unifies two types of cross-modality attentions, sequence-wise attention and modality-wise attention, to effectively fuse information from image and text pairs. The sequence-wise attention enables the framework to capture the fine-grained relationship between image patches and text tokens, while the modality-wise attention weighs each modality by its relevance to the downstream tasks. In addition, by adding task specific modality-wise attentions and multilayer perceptrons, our proposed framework is capable of performing multi-task classification with multi-modalities. We conduct experiments on a Major Retail Website Product Attribute (MRWPA) dataset and two public datasets, Food101 and Fashion-Gen. The results show that CMA-CLIP outperforms the pre-trained and fine-tuned CLIP by an average of 11.9% in recall at the same level of precision on the MRWPA dataset for multi-task classification. It also surpasses the state-of-the-art method on Fashion-Gen Dataset by 5.5% in accuracy and achieves competitive performance on Food101 Dataset. Through detailed ablation studies, we further demonstrate the effectiveness of both cross-modality attention modules and our method's robustness against noise in image and text inputs, which is a common challenge in practice.
Motivation & Objective
- To address CLIP’s limitation in modeling fine-grained image-text relationships during fine-tuning for classification tasks.
- To improve robustness against noisy image or text inputs by learning modality relevance weights.
- To enable multi-task classification using a single unified network with task-specific modality attention and MLP heads.
- To enhance CLIP’s performance in downstream classification beyond zero-shot capabilities by leveraging both modalities during training and inference.
Proposed method
- Integrates a sequence-wise attention module that models fine-grained correlations between image patches and text tokens using a transformer-based mechanism.
- Employs a modality-wise attention module that learns dynamic weights for image and text modalities based on their relevance to the classification task.
- Augments the CLIP backbone with task-specific modality-wise attention heads and multilayer perceptrons (MLPs) to support multi-task learning.
- Trains the model using contrastive loss on image-text pairs, with end-to-end optimization of the full architecture.
- Uses attention visualization to interpret and validate the model’s focus on relevant image patches and text tokens.
Experimental results
Research questions
- RQ1Can modeling fine-grained cross-modality relationships between image patches and text tokens improve classification performance beyond standard CLIP?
- RQ2Does learning modality-specific attention weights enhance robustness to noisy or irrelevant image or text inputs?
- RQ3Can a unified network architecture effectively support multi-task image-text classification with shared representations?
- RQ4How does CMA-CLIP compare to SOTA methods in terms of accuracy and robustness on real-world and public benchmarks?
Key findings
- On the MRWPA dataset, CMA-CLIP achieves an average recall improvement of 11.9% at the same precision level (90%) compared to fine-tuned CLIP across three product attribute classification tasks.
- On the Fashion-Gen dataset, CMA-CLIP achieves 93.6% accuracy, surpassing the previous SOTA method (KaleidoBERT) by 5.5 percentage points.
- Abllation studies show that removing the modality-wise attention module reduces average recall on MRWPA from 53.4% to 47.5%, confirming its role in filtering noisy inputs.
- The sequence-wise attention module contributes significantly to performance, as removing it further drops recall from 47.5% to 45.8%.
- Visualization confirms that sequence-wise attention correctly identifies relevant image patches correlated with classification-relevant text tokens across all three datasets.
- CMA-CLIP maintains competitive performance on Food101, achieving 93.1% accuracy, outperforming strong baselines like MMBT and BERT.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.