Current metric learning approaches for image retrieval are usually based on learning a space of informative latent representations where simple approaches such as the cosine distance will work well. Recent state of the art methods such as HypViT move to more complex embedding spaces that may yield better results but are harder to scale to production environments. In this work, we first construct a simpler model based on triplet loss with hard negatives mining that performs at the state of the art level but does not have these drawbacks. Second, we introduce a novel approach for image retrieval postprocessing called Siamese Transformer for Image Retrieval (STIR) that reranks several top outputs in a single forward pass. Unlike previously proposed Reranking Transformers, STIR does not rely on global/local feature extraction and directly compares a query image and a retrieved candidate on pixel level with the usage of attention mechanism. The resulting approach defines a new state of the art on standard image retrieval datasets: Stanford Online Products and DeepFashion In-shop. We also release the source code at https://github.com/OML-Team/open-metric-learning/tree/main/pipelines/postprocessing/ and an interactive demo of our approach at https://dapladoc-oml-postprocessing-demo-srcappmain-pfh2g0.streamlit.app/
翻译:当前的图像检索度量学习方法通常基于学习一个信息丰富的潜在表示空间,使得余弦距离等简单方法能够有效工作。最近诸如HypViT等最先进方法转向更复杂的嵌入空间,虽能取得更优结果,但难以扩展至生产环境。本文首先构建了一个基于三元组损失与难负样本挖掘的简化模型,该模型在达到当前最优水平的同时避免了上述缺陷;其次,我们提出了一种名为“用于图像检索的孪生Transformer”(STIR)的新型图像检索后处理方法,该方法能在单次前向传播中对多个候选结果进行重排序。与先前提出的重排序Transformer不同,STIR不依赖全局/局部特征提取,而是利用注意力机制在像素级别直接比较查询图像与检索候选图像。该方法在标准图像检索数据集(Stanford Online Products和DeepFashion In-shop)上取得了新的最优结果。我们已在https://github.com/OML-Team/open-metric-learning/tree/main/pipelines/postprocessing/ 开源相关代码,并在https://dapladoc-oml-postprocessing-demo-srcappmain-pfh2g0.streamlit.app/ 提供交互式演示。