Borrowing Knowledge From Pre-trained Language Model: A New Data-efficient Visual Learning Paradigm

Wenxuan Ma, Shuang Li, Jinming Zhang, Chi Harold Liu, Jingxuan Kang, Yulin Wang, Gao Huang

Abstract

Deep learning models are traditionally data-hungry and often lack semantic context due to the limitations of standard cross-entropy supervision. This paper introduces BorLan (Borrowing Knowledge from Pre-trained Language Models), a framework that leverages the semantic richness of frozen language models to improve vision model data-efficiency. By modeling categories as Gaussian distributions in a shared text-image embedding space, BorLan enables flexible, domain-agnostic alignment. Experiments across semi-supervised, few-shot, and domain generalization tasks demonstrate that BorLan significantly outperforms existing methods, particularly as labeled data scales, by providing explicit semantic guidance to the vision backbone.

Introduction: The Semantic Deficiency of Cross-Entropy

Deep learning models typically require vast amounts of labeled data to generalize effectively. A primary reason for this "data hunger" is the reliance on cross-entropy supervision, which treats labels as one-hot vectors. This approach suffers from semantic deficiency: it teaches a model that a "cat" is not a "dog," but fails to convey that a "cat" is semantically closer to a "tiger" than to an "airplane."

This lack of inherent semantic context makes models less robust and less capable of generalizing when training data is limited. To address this, the authors propose BorLan, a paradigm that "borrows" the semantic relationships already present in the embedding space of off-the-shelf Pre-trained Language Models (PLMs) like BERT or GPT.

Methodology: Borrowing Linguistic Priors

The BorLan framework operates in two main stages: offline knowledge extraction and distribution-aware training. Unlike models like CLIP, BorLan does not require expensive joint pre-training of vision and language modalities. Instead, it uses frozen, independent PLMs to guide any vision backbone.

Detailed architecture of BorLan, highlighting the distribution-aware alignment between image features and the text embedding space.

1. Offline Knowledge Extraction

Category names are inserted into multiple handcrafted prompts (e.g., "This is a photo of a {cat}") and passed through a frozen PLM. This generates a set of text embeddings that capture the linguistic nuances of each concept.

2. Distribution Modeling

Rather than representing a category as a single average vector, BorLan models each category as a Gaussian distribution in the text embedding space. This accounts for variations in linguistic descriptions and mitigates the impact of noisy or poorly designed prompts.

3. Distribution-Aware Alignment

During training, a vision model (such as ResNet or Swin Transformer) maps images into the same dimensional space as the text embeddings via a projector head. A novel alignment objective ($L_{text}$) is used to pull image features toward their corresponding linguistic distribution, ensuring the vision model inherits the semantic structure of the language model.

Experimental Results

BorLan was evaluated across three major data-scarce paradigms: Semi-supervised Learning (SSL), Single Domain Generalization (SDG), and Few-shot Learning (FSL).

  • Semi-supervised Learning: On the FGVC Aircraft dataset with only 15% labels, BorLan achieved 71.05% accuracy, outperforming the previous state-of-the-art by nearly 7%.
  • Domain Generalization: By aligning vision features to domain-agnostic linguistic descriptions, BorLan improved the average accuracy of a ResNet-50 on the Office-Home benchmark by 5.22% over standard empirical risk minimization (ERM).
  • Few-shot Learning: BorLan demonstrates exceptional scaling properties. While prompt-tuning methods like CoOp may lead in ultra-low-shot regimes (1-2 shots), BorLan significantly pulls ahead as more labeled data (8-16 shots) becomes available.
Few-shot learning performance across 10 benchmarks, demonstrating BorLan's superior scaling compared to prompt-tuning methods.

Key Insights and Conclusion

BorLan proves that vision models can achieve high data efficiency by leveraging pure, independent language models as a domain-agnostic prior. The shift from point-based alignment to distribution-based alignment makes the framework robust to prompt noise and allows it to capture the inherent variance in semantic concepts.

Ultimately, BorLan offers a highly flexible and computationally efficient alternative to massive co-trained models, allowing researchers to "mix and match" any vision architecture with any off-the-shelf language model to achieve state-of-the-art performance in data-scarce scenarios.

Summary updated

BibTeX
@inproceedings{ma2023borrowing,
  author = {Wenxuan Ma and Shuang Li and Jinming Zhang and Chi Harold Liu and Jingxuan Kang and Yulin Wang and Gao Huang},
  title = {{Borrowing Knowledge From Pre-trained Language Model: A New Data-efficient Visual Learning Paradigm}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2023},
  doi = {10.1109/iccv51070.2023.01722},
}
Figure