TL;DR
CustomContrast shifts the paradigm of subject-driven text-to-image customization from simple image reconstruction to a "cross-differential" contrastive learning approach. By explicitly decoupling a subject's intrinsic attributes from irrelevant details (like pose or background), it solves the long-standing trade-off between high subject similarity and flexible text controllability.
What Problem Does This Paper Address?
Existing "finetune-free" customization methods (like IP-Adapter or ELITE) typically follow a self-reconstructive perspective. They train an encoder to help a diffusion model recreate a specific reference image as accurately as possible.
The flaw in this approach is feature entanglement. If the model only sees one image of a teddy bear on a wooden bench, it struggles to distinguish the bear (intrinsic features) from the bench and the lighting (irrelevant features). This leads to a binary failure mode:
- Overfitting: The model captures the bear perfectly but insists on generating the bench every time, ruining text controllability.
- Underfitting: The model ignores the bench but loses the specific details of the bear, resulting in low subject similarity.
Methods
The authors propose CustomContrast, a framework designed to disentangle these features using two main components:
- Multimodal Feature Injection (MFI) Encoder: Instead of a simple image projection, this encoder uses a Visual Qformer and a Textual Qformer to extract features. A Textual-Visual (TV) Fusion module then uses the text embeddings as queries to "sift" through visual features, ensuring the resulting representation is aligned with the text space.
- Multilevel Contrastive Learning (MCL) Paradigm: This is the core innovation. It applies contrastive constraints at two levels:
- Crossmodal Semantic Contrastive Learning (CSCL): Aligns high-level semantics between visual and textual embeddings using CLS tokens.
- Multiscale Appearance Contrastive Learning (MACL): Operates in the $S^+$ space (a per-layer extended visual concept space). It ensures intra-consistency (pulling different views of the same subject together) and inter-distinctiveness (pushing different subjects apart). Crucially, it uses scaling factors based on real-world subject similarity to maintain a structured feature space.
Additionally, the model employs a timestep-specific subject location loss during training and inference to further suppress background interference by focusing the attention maps on the subject's mask.
Datasets
- Training: The model was trained on filtered subsets of MVImageNet (a large-scale multi-view dataset) and OpenImage.
- Evaluation: Performance was benchmarked using DreamBench, a standard dataset for subject-driven T2I customization.
Key Insights and Ideas
- Contrastive Learning as a Decoupler: The "aha moment" is that contrastive learning is naturally suited for disentanglement. By showing the model multiple views of the same object, the only thing that remains constant is the "intrinsic" subject.
- The $S^+$ Space Advantage: By applying MACL separately to different cross-attention layers in the U-Net, the model can learn subject features at multiple scales—from high-level shape to low-level texture.
- Relative Distance Preservation: Unlike standard contrastive losses that just push negatives away, MACL uses scaling factors to ensure that the distance between a "husky" and a "labrador" in feature space reflects their actual visual similarity, preventing the collapse of the embedding space.
Key Results
CustomContrast was tested on both Stable Diffusion V1.5 and SDXL, outperforming state-of-the-art (SOTA) methods like IP-Adapter-plus and MOMA.
- Quantitative: On SD-V1.5, it achieved a CLIP-T (controllability) score of 0.325 (vs. 0.313 for MOMA) and a massive jump in ImageReward from -0.24 to 0.45. Subject similarity (E-DI) also improved by nearly 6%.
- Qualitative: The model excels at difficult "shape-shifting" prompts. For example, it can successfully generate a specific cat toy "playing a guitar" or "driving a car," whereas previous methods often failed to change the subject's pose or kept the original background.
- Multi-Subject & Human Domain: The framework naturally extends to generating multiple unique subjects in one scene and maintains high fidelity for human face customization.
Limitations and Future Work
While CustomContrast significantly improves disentanglement, the authors note (or imply) a few areas for growth:
- Data Dependency: The MACL loss relies on multi-view data (like MVImageNet) to define positive samples. The performance might degrade if such data isn't available for specific niche categories.
- Computational Overhead: The use of multiple Qformers and a multilevel loss increases training complexity compared to simpler projection-based adapters.
- Future Directions: The authors suggest that this contrastive perspective could be further integrated with Multimodal Large Language Models (MLLMs) to achieve even more nuanced text-image alignment.
Summary updated