Learning Large Euclidean Margin for Sketch-based Image Retrieval

Peng Lu, Gao Huang, Yanwei Fu, Guodong Guo, Hangyu Lin

Introduction

Sketch-Based Image Retrieval (SBIR) allows users to search for photos using hand-drawn sketches. While intuitive for humans, this task is computationally challenging due to the significant "domain gap": sketches are sparse, abstract, and iconic black-and-white lines, whereas photos are dense arrays of pixels with rich color and texture.

To bridge this gap, previous methods often relied on heavy, separate neural networks for each domain or complex generative models (like GANs) to translate sketches into photos. Furthermore, standard metric learning losses, such as triplet or contrastive loss, struggle to explicitly guarantee an ideal feature space—one where the maximum distance between two items of the same class is strictly smaller than the minimum distance between items of different classes.

Proposed Architecture

The authors propose a unified, semi-heterogeneous framework that leverages a shared backbone with domain-specific conditioning. The core of this architecture is the Domain-Aware Squeeze-and-Excitation (DASE) Network.

The proposed SBIR framework uses a shared backbone with DASE modules that receive a domain-specific code to bridge the visual gap between sketches and photos.

Standard SE networks dynamically re-weight feature channels based on global context. The DASE module modifies this by injecting a simple 1-bit binary code (0 for sketch, 1 for photo) into the SE module's low-dimensional bottleneck. This acts as a controlling gate, allowing the shared network to amplify content-related features and suppress style-related features depending on the input domain. This approach demonstrates that a single bit of domain information can effectively route features in a shared network, saving significant computation compared to dual-branch architectures.

Multiplicative Euclidean Margin Softmax (MEMS) Loss

To create a highly discriminative embedding space, the authors introduce the Multiplicative Euclidean Margin Softmax (MEMS) loss. Unlike recent metric learning trends that favor angular margin losses (e.g., ArcFace), MEMS operates on Euclidean distance.

By applying a multiplicative margin ($m$) to the intra-class distance, the loss explicitly forces the network to cluster same-class instances tightly around a class prototype. The authors provide a rigorous theoretical proof showing that a multiplicative margin of $m \ge 2 + \sqrt{3}$ is the necessary and sufficient condition to guarantee that the maximum intra-class distance is smaller than the minimum inter-class distance. This Euclidean focus is particularly beneficial for SBIR hashing, as Euclidean distance properties are easier to preserve when projecting features into low-dimensional binary hash codes.

Experimental Results

The model was evaluated on two major benchmarks: TU-Berlin Extension (250 categories) and Sketchy Extension (125 categories).

Performance and Ablation

The proposed method achieved state-of-the-art results in both supervised SBIR and hashing tasks. On the TU-Berlin Extension, it reached a Mean Average Precision (MAP) of 0.841, more than doubling the performance of previous best baselines (0.448). For hashing, using 128-bit codes, it achieved 0.829 MAP on TU-Berlin and 0.956 MAP on Sketchy, outperforming complex generative models like GDH while requiring less training time.

Ablation study showing the performance gains of DASE over standard SE and raw ResNet backbones across different architectures and datasets.

Ablation studies confirm the effectiveness of the DASE module, which consistently provided a MAP improvement of approximately 0.025 to 0.04 over standard SE modules. This proves the value of explicit domain conditioning in cross-modal retrieval.

Conclusion

By combining domain-aware attention with a mathematically grounded Euclidean margin loss, this work establishes a new performance ceiling for SBIR. The lightweight nature of the DASE module and the efficiency of the MEMS loss suggest that this framework could be readily adapted to other cross-modal tasks, such as text-to-image or audio-to-video matching.

Summary updated

Abstract

This paper proposes a novel approach for Sketch-Based Image Retrieval (SBIR), for which the key is to bridge the gap between sketches and photos in terms of the data representation. Inspired by channel-wise attention explored in recent years, we present a Domain-Aware Squeeze-and-Excitation (DASE) network, which seamlessly incorporates the prior knowledge of sample sketch or photo into SE module and make the SE module capable of emphasizing appropriate channels according to domain signal. Accordingly, the proposed network can switch its mode to achieve a better domain feature with lower intra-class discrepancy. Moreover, while previous works simply focus on minimizing intra-class distance and maximizing inter-class distance, we introduce a loss function, named Multiplicative Euclidean Margin Softmax (MEMS), which introduces multiplicative Euclidean margin into feature space and ensure that the maximum intra-class distance is smaller than the minimum inter-class distance. This facilitates learning a highly discriminative feature space and ensures a more accurate image retrieval result. Extensive experiments are conducted on two widely used SBIR benchmark datasets. Our approach achieves better results on both datasets, surpassing the state-of-the-art methods by a large margin.
BibTeX
@inproceedings{lu2021learning,
  author = {Peng Lu and Gao Huang and Yanwei Fu and Guodong Guo and Hangyu Lin},
  title = {{Learning Large Euclidean Margin for Sketch-based Image Retrieval}},
  booktitle = {ACM Multimedia},
  year = {2021},
  doi = {10.1145/3474085.3475499},
}
Figure