# QS-Attn: Query-Selected Attention for Contrastive Learning in I2I Translation

arXiv: https://arxiv.org/abs/2203.08483 · HTML: https://mlsanity.com/paper/2203.08483/

## Key facts

- Cited by 39 papers in the map (data through 14 Oct 2026).
- Builds on 45 of its 61 references that are in the map.
- First posted on arXiv 16 Mar 2022.

## Builds on (most cited first, 30 of 45)

- [Adam: A Method for Stochastic Optimization](https://mlsanity.com/paper/1412.6980/) (2014)
- [Very Deep Convolutional Networks for Large-Scale Image Recognition](https://mlsanity.com/paper/1409.1556/) (2014)
- [A Simple Framework for Contrastive Learning of Visual Representations](https://mlsanity.com/paper/2002.05709/) (2020)
- [Representation Learning with Contrastive Predictive Coding](https://mlsanity.com/paper/1807.03748/) (2018)
- [Momentum Contrast for Unsupervised Visual Representation Learning](https://mlsanity.com/paper/1911.05722/) (2019)
- [A Style-Based Generator Architecture for Generative Adversarial Networks](https://mlsanity.com/paper/1812.04948/) (2018)
- [Generative Adversarial Networks](https://mlsanity.com/paper/2203.00667/) (2022)
- [Bootstrap your own latent: A new approach to self-supervised Learning](https://mlsanity.com/paper/2006.07733/) (2020)
- [Image-to-Image Translation with Conditional Adversarial Networks](https://mlsanity.com/paper/1611.07004/) (2016)
- [Exploring Simple Siamese Representation Learning](https://mlsanity.com/paper/2011.10566/) (2020)
- [Unsupervised Learning of Visual Features by Contrasting Cluster Assignments](https://mlsanity.com/paper/2006.09882/) (2020)
- [Perceptual Losses for Real-Time Style Transfer and Super-Resolution](https://mlsanity.com/paper/1603.08155/) (2016)
- [Large Scale GAN Training for High Fidelity Natural Image Synthesis](https://mlsanity.com/paper/1809.11096/) (2018)
- [Improved Baselines with Momentum Contrastive Learning](https://mlsanity.com/paper/2003.04297/) (2020)
- [Informer: Beyond Efficient Transformer for Long Sequence Time-Series Forecasting](https://mlsanity.com/paper/2012.07436/) (2020)
- [Conditional Generative Adversarial Nets](https://mlsanity.com/paper/1411.1784/) (2014)
- [Photo-Realistic Single Image Super-Resolution Using a Generative Adversarial Network](https://mlsanity.com/paper/1609.04802/) (2016)
- [Unsupervised Feature Learning via Non-Parametric Instance-level Discrimination](https://mlsanity.com/paper/1805.01978/) (2018)
- [Instance Normalization: The Missing Ingredient for Fast Stylization](https://mlsanity.com/paper/1607.08022/) (2016)
- [High-Resolution Image Synthesis and Semantic Manipulation with Conditional GANs](https://mlsanity.com/paper/1711.11585/) (2017)
- [StarGAN v2: Diverse Image Synthesis for Multiple Domains](https://mlsanity.com/paper/1912.01865/) (2019)
- [CyCADA: Cycle-Consistent Adversarial Domain Adaptation](https://mlsanity.com/paper/1711.03213/) (2017)
- [StarGAN: Unified Generative Adversarial Networks for Multi-Domain Image-to-Image Translation](https://mlsanity.com/paper/1711.09020/) (2017)
- [Multimodal Unsupervised Image-to-Image Translation](https://mlsanity.com/paper/1804.04732/) (2018)
- [Contrastive Learning for Unpaired Image-to-Image Translation](https://mlsanity.com/paper/2007.15651/) (2020)
- [Unsupervised Image-to-Image Translation Networks](https://mlsanity.com/paper/1703.00848/) (2017)
- [DualGAN: Unsupervised Dual Learning for Image-to-Image Translation](https://mlsanity.com/paper/1704.02510/) (2017)
- [Toward Multimodal Image-to-Image Translation](https://mlsanity.com/paper/1711.11586/) (2017)
- [Dilated Residual Networks](https://mlsanity.com/paper/1705.09914/) (2017)
- [Learning to Discover Cross-Domain Relations with Generative Adversarial Networks](https://mlsanity.com/paper/1703.05192/) (2017)

## Built on by (most cited first, 30 of 39)

- [DreamInpainter: Text-Guided Subject-Driven Image Inpainting with Diffusion Models](https://mlsanity.com/paper/2312.03771/) (2023)
- [Spectral Normalization and Dual Contrastive Regularization for Image-to-Image Translation](https://mlsanity.com/paper/2304.11319/) (2023)
- [StainDiffuser: MultiTask Dual Diffusion Model for Virtual Staining](https://mlsanity.com/paper/2403.11340/) (2024)
- [Masked and Adaptive Transformer for Exemplar Based Image Translation](https://mlsanity.com/paper/2303.17123/) (2023)
- [Structural Attention: Rethinking Transformer for Unpaired Medical Image Synthesis](https://mlsanity.com/paper/2406.18967/) (2024)
- [Rethinking the Paradigm of Content Constraints in Unpaired Image-to-Image Translation](https://mlsanity.com/paper/2211.10867/) (2022)
- [T-FAKE: Synthesizing Thermal Images for Facial Landmarking](https://mlsanity.com/paper/2408.15127/) (2024)
- [Multi-view Cross-Modality MR Image Translation for Vestibular Schwannoma and Cochlea Segmentation](https://mlsanity.com/paper/2303.14998/) (2023)
- [Multi-cropping Contrastive Learning and Domain Consistency for Unsupervised Image-to-Image Translation](https://mlsanity.com/paper/2304.12235/) (2023)
- [TPSeNCE: Towards Artifact-Free Realistic Rain Generation for Deraining and Object Detection in Rain](https://mlsanity.com/paper/2311.00660/) (2023)
- [CHIMLE: Conditional Hierarchical IMLE for Multimodal Conditional Image Synthesis](https://mlsanity.com/paper/2211.14286/) (2022)
- [Energy-Guided Diffusion Model for CBCT-to-CT Synthesis](https://mlsanity.com/paper/2308.03354/) (2023)
- [Patch-wise Graph Contrastive Learning for Image Translation](https://mlsanity.com/paper/2312.08223/) (2023)
- [Self-Supervised Monocular Depth Estimation in the Dark: Towards Data Distribution Compensation](https://mlsanity.com/paper/2404.13854/) (2024)
- [Learning Site-specific Styles for Multi-institutional Unsupervised Cross-modality Domain Adaptation](https://mlsanity.com/paper/2311.12437/) (2023)
- [AV-GAN: Attention-Based Varifocal Generative Adversarial Network for Uneven Medical Image Translation](https://mlsanity.com/paper/2404.10714/) (2024)
- [USIGAN: Unbalanced Self-Information Feature Transport for Weakly Paired Image IHC Virtual Staining](https://mlsanity.com/paper/2507.05843/) (2025)
- [Masked Discriminators for Content-Consistent Unpaired Image-to-Image Translation](https://mlsanity.com/paper/2309.13188/) (2023)
- [Contrastive Learning and Cycle Consistency-based Transductive Transfer Learning for Target Annotation](https://mlsanity.com/paper/2401.12340/) (2024)
- [Non-Adversarial Learning: Vector-Quantized Common Latent Space for Multi-Sequence MRI](https://mlsanity.com/paper/2407.02911/) (2024)
- [CAS-GAN for Contrast-free Angiography Synthesis](https://mlsanity.com/paper/2410.08490/) (2024)
- [Patch-Wise Hypergraph Contrastive Learning with Dual Normal Distribution Weighting for Multi-Domain Stain Transfer](https://mlsanity.com/paper/2503.09523/) (2025)
- [Digital Staining with Knowledge Distillation: A Unified Framework for Unpaired and Paired-But-Misaligned Data](https://mlsanity.com/paper/2504.09899/) (2025)
- [DSI2I: Dense Style for Unpaired Image-to-Image Translation](https://mlsanity.com/paper/2212.13253/) (2022)
- [How Good Are Deep Generative Models for Solving Inverse Problems?](https://mlsanity.com/paper/2312.12691/) (2023)
- [An Analysis for Image-to-Image Translation and Style Transfer](https://mlsanity.com/paper/2408.06000/) (2024)
- [Improving Object Detection via Local-global Contrastive Learning](https://mlsanity.com/paper/2410.05058/) (2024)
- [crossMoDA Challenge: Evolution of Cross-Modality Domain Adaptation Techniques for Vestibular Schwannoma and Cochlea Segmentation from 2021 to 2023](https://mlsanity.com/paper/2506.12006/) (2025)
- [Image-to-Image Translation Framework Embedded with Rotation Symmetry Priors](https://mlsanity.com/paper/2604.12805/) (2026)
- [Disentangled Contrastive Image Translation for Nighttime Surveillance](https://mlsanity.com/paper/2307.05038/) (2023)

## Abstract (arXiv)

Unpaired image-to-image (I2I) translation often requires to maximize the mutual information between the source and the translated images across different domains, which is critical for the generator to keep the source content and prevent it from unnecessary modifications. The self-supervised contrastive learning has already been successfully applied in the I2I. By constraining features from the same location to be closer than those from different ones, it implicitly ensures the result to take content from the source. However, previous work uses the features from random locations to impose the constraint, which may not be appropriate since some locations contain less information of source domain. Moreover, the feature itself does not reflect the relation with others. This paper deals with these problems by intentionally selecting significant anchor points for contrastive learning. We design a query-selected attention (QS-Attn) module, which compares feature distances in the source domain, giving an attention matrix with a probability distribution in each row. Then we select queries according to their measurement of significance, computed from the distribution. The selected ones are regarded as anchors for contrastive loss. At the same time, the reduced attention matrix is employed to route features in both domains, so that source relations maintain in the synthesis. We validate our proposed method in three different I2I datasets, showing that it increases the image quality without adding learnable parameters.
