Selectively Hard Negative Mining for Alleviating Gradient Vanishing in Image-Text Matching

Zheng Li, Caili Guo, Xin Wang, Zerun Feng, Zhongtian Du
3/1/2023
cs.CVcs.MM

No official code found. Best implementation: AAA-Zheng/RVSEPP (4 stars, MIT, last commit 2023-07-10).

Abstract

Recently, a series of Image-Text Matching (ITM) methods achieve impressive performance. However, we observe that most existing ITM models suffer from gradients vanishing at the beginning of training, which makes these models prone to falling into local minima. Most ITM models adopt triplet loss with Hard Negative mining (HN) as the optimization objective. We find that optimizing an ITM model using only the hard negative samples can easily lead to gradient vanishing. In this paper, we derive the condition under which the gradient vanishes during training. When the difference between the positive pair similarity and the negative pair similarity is close to 0, the gradients on both the image and text encoders will approach 0. To alleviate the gradient vanishing problem, we propose a Selectively Hard Negative Mining (SelHN) strategy, which chooses whether to mine hard negative samples according to the gradient vanishing condition. SelHN can be plug-and-play applied to existing ITM models to give them better training behavior. To further ensure the back-propagation of gradients, we construct a Residual Visual Semantic Embedding model with SelHN, denoted as RVSE++. Extensive experiments on two ITM benchmarks demonstrate the strength of RVSE++, achieving state-of-the-art performance.

View on arXivView PDF

Code Implementations(1)

AAA-Zheng/RVSEPPCommunity58%
MIT

Official PyTorch implementation of the paper "Selectively Hard Negative Mining for Alleviating Gradient Vanishing in Image-Text Matching"

40PythonMar 13, 20233 years agoMIT

Similar Papers

Cite this paper

@article{li2023selectively,
  title  = {Selectively Hard Negative Mining for Alleviating Gradient Vanishing in Image-Text Matching},
  author = {Zheng Li and Caili Guo and Xin Wang and Zerun Feng and Zhongtian Du},
  year   = {2023},
  eprint = {2303.00181},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2303.00181v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2303.00181.svg)](https://codeofpaper.com/paper/2303.00181)

Discussion