Abstract
Img-Diff is an automated pipeline for synthesizing high-quality contrastive image pairs to enhance the fine-grained visual perception of Multimodal Large Language Models (MLLMs). By generating image pairs that differ by a single object replacement and providing localized, region-specific captions, the method enables open-source models to outperform proprietary systems like GPT-4V on visual discrimination benchmarks.
Introduction
While current Multimodal Large Language Models (MLLMs) such as GPT-4 and LLaVA excel at general scene description, they frequently struggle with fine-grained visual perception. These models often fail at "spot-the-difference" tasks or identifying subtle changes in texture, color, or object type within complex scenes. This limitation is largely due to the nature of existing instruction-tuning datasets, which typically consist of single images with global captions, failing to challenge the model's ability to distinguish between highly similar visual inputs. Img-Diff addresses this bottleneck by automating the creation of a massive, diverse, and contrastive dataset that forces models to focus on localized regions to identify semantic changes.
Methodology
The authors propose a three-stage automated synthesis pipeline to generate contrastive data:
- Image Pairs Generation: Utilizing Stable Diffusion XL (SDXL) in conjunction with the Prompt-to-Prompt technique, the system modifies a single noun in an existing image caption. Prompt-to-Prompt ensures that the generated "after" image maintains the exact layout and background of the "before" image, changing only the target object.
- Difference Area Identification: To pinpoint the precise location of the change, the pipeline uses FastSAM for image segmentation. A series of filters, including CLIP for visual similarity and BLIP for image-text alignment, are employed to identify the specific bounding boxes containing the replaced objects.
- Difference Caption Generation: This two-stage process involves an MLLM (LLaVA-NEXT) generating descriptions for the content within the identified bounding boxes. These descriptions are then synthesized into a concise "difference caption" that articulates the specific change between the two images.
Dataset and Evaluation
The primary contribution is the Img-Diff dataset, which contains approximately 12,688 high-quality object replacement instances derived from MSCOCO and LLaVA pre-training data. The models were evaluated on several benchmarks:
- MMVP (Multimodal Visual Perception): Designed to challenge CLIP-based models with similar-looking pairs.
- Spot-the-Diff & Image-Edit-Request: Standard benchmarks for image change captioning.
- General Benchmarks: Including VQAv2, GQA, and ScienceQA, to ensure that specialized training does not degrade general reasoning capabilities.
Key Insights
The effectiveness of Img-Diff stems from two core principles:
- Localized Supervision: MLLMs learn superior visual discrimination when forced to focus on localized regions rather than the entire image. Providing bounding boxes and region-specific captions results in a cleaner training signal.
- Hard Negatives via Prompt-to-Prompt: Contrastive learning is most effective when negative samples are visually similar to positive ones. By creating "almost identical" pairs, the model is forced to ignore background noise and focus strictly on the semantic difference.
Results
Fine-tuning models with Img-Diff data yielded significant performance gains:
- Surpassing State-of-the-Art: An MGM-7B model fine-tuned with Img-Diff achieved a score of 50.7 on the MMVP benchmark, significantly outperforming GPT-4V (38.7) and Gemini (40.7).
- General Improvement: LLaVA-1.5 showed an average improvement of 3.06% across eight standard MLLM benchmarks.
- Enhanced Captioning: On the Spot-the-Diff benchmark, the fine-tuned MGM-7B model improved its CIDEr-D score from 46.3 to 53.5, demonstrating a superior ability to articulate visual changes.
Limitations and Future Work
Currently, the Img-Diff dataset focuses primarily on object replacement. While effective, other types of visual changes—such as object removal, movement, or size alterations—are not yet fully integrated. Additionally, the dataset's quality is dependent on the underlying generative model (SDXL); artifacts or failures in prompt-following can introduce noise. Future research will aim to expand the lexicon of objects and explore "Contrastive Chain-of-Thought" reasoning to further improve model explanations of visual differences.
Summary updated