BatchFormer: Learning to Explore Sample Relationships for Robust Representation Learning
Authors:
- 1 June 2022
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 7246-7256
Abstract
Despite the success of deep neural networks, there are still many challenges in deep representation learning due to the data scarcity issues such as data imbalance, unseen distribution, and domain shift. To address the above-mentioned issues, a variety of methods have been devised to explore the sample relationships in a vanilla way (i.e., from the perspectives of either the input or the loss function), failing to explore the internal structure of deep neural networks for learning with sample relationships. Inspired by this, we propose to enable deep neural networks themselves with the ability to learn the sample relationships from each mini-batch. Specifically, we introduce a batch transformer module or BatchFormer, which is then applied into the batch dimension of each mini-batch to implicitly explore sample relationships during training. By doing this, the proposed method enables the collaboration of different samples, e.g., the head-class samples can also contribute to the learning of the tail classes for long-tailed recognition. Furthermore, to mitigate the gap between training and testing, we share the classifier between with or without the BatchFormer during training, which can thus be removed during testing. We perform extensive experiments on over ten datasets and the proposed method achieves significant improvements on different data scarcity applications without any bells and whistles, including the tasks of long-tailed recognition, compositional zero-shot learning, domain generalization, and contrastive learning. Code is made publicly available at https://github.com/zhihou7/BatchFormer.Keywords
All Related Versions
Funding Information
- ARC (FL-170100117)
This publication has 44 references indexed in Scilit:
- Deeper, Broader and Artier Domain Generalization2017
- Grad-CAM: Visual Explanations from Deep Networks via Gradient-Based Localization2017
- Places: A 10 Million Image Database for Scene RecognitionIEEE Transactions on Pattern Analysis and Machine Intelligence, 2017
- Deep Hashing Network for Unsupervised Domain Adaptation2017
- Deep Residual Learning for Image Recognition2016
- Discovering states and transformations in image collections2015
- Fine-Grained Visual Comparisons with Local Learning2014
- Unbiased Metric Learning: On the Utilization of Multiple Datasets and Web Images for Softening Bias2013
- Learning from Imbalanced DataIEEE Transactions on Knowledge and Data Engineering, 2009
- Dimensionality Reduction by Learning an Invariant Mapping2006