Semi-supervised Visual Feature Integration for Pre-trained Language Models

Lisai Zhang, Qingcai Chen, Dongfang Li, Buzhou Tang · DOI

Abstract

Integrating visual features has been proved useful for natural language understanding tasks. Nevertheless, in most existing multimodal language models, the alignment of visual and textual data is expensive. In this paper, we propose a novel semi-supervised visual integration framework for pre-trained language models. In the framework, the visual features are obtained through a visualization and fusion mechanism. The uniqueness includes: 1) the integration is conducted via a semi-supervised approach, which does not require aligned images for every sentence; 2) the visual features are integrated as an external component and can be directly used by pre-trained language models. To verify the efficacy of the proposed framework, we conduct experiments on both natural language inference and reading comprehension tasks. The results demonstrate that our mechanism brings improvement to two strong baseline models. Considering that our framework only requires an image database and does not require further alignments, it provides an efficient and feasible way for multimodal language learning.

Introduction

Human language understanding is inherently multimodal; for instance, the word "bank" is often disambiguated by mental imagery of either a river's edge or a financial institution. While modern Natural Language Understanding (NLU) models excel at processing text, they often lack this "imagination" capability. Existing multimodal models typically rely on expensive, manually aligned image-text pairs, creating a bottleneck for large-scale text datasets that lack corresponding visual data.

This paper addresses the "alignment gap" by introducing a semi-supervised framework that allows pre-trained language models to retrieve and integrate visual context from a general image database, effectively allowing the model to "visualize" text even when no explicit images are provided in the task dataset.

Methodology: Sentence Visualization and Fusion

The core of the proposed framework is an external "imagination" module that can be plugged into various pre-trained architectures like BERT. The process involves three distinct stages:

  1. Sentence Visualization (Retrieval): For a given input sentence, a text-to-image retrieval module ($\mathcal{V}$) identifies the most relevant image from an unlabelled "Image Memory," such as MS COCO or Flickr30k.
  2. Visual Feature Extraction: The model extracts global features via ResNet-152 and object-level features via Faster R-CNN to identify specific entities within the retrieved image.
  3. Text-Visual Fusion: An attention mechanism ($\mathcal{S}$) calculates the relevance of visual features to the textual input. If a sentence mentions a "cake," the attention mechanism highlights corresponding regions in the retrieved image to enrich the text embedding.
Architecture of the Sentence Visualization and Fusion framework.

The integration follows a semi-supervised pipeline where the visualization module is first trained on aligned data, followed by training the fusion layer while the language model remains frozen, and finally fine-tuning the entire system end-to-end.

Evaluation and Task Integration

The framework was evaluated across two primary NLU domains: Natural Language Inference (NLI) and Reading Comprehension (RC). For NLI, the authors utilized the SNLI and SICK datasets. For RC, SemEval-2018 Task 11 was used to test commonsense reasoning capabilities.

Integration of visual features into NLI and Reading Comprehension models.

As shown in the task-specific architectures, the visualization module acts as a modular component. In NLI, visual features are fused with the premise and hypothesis embeddings. In RC, which involves longer passages, the model employs "late fusion," visualizing individual sentences and aggregating those cues to support the final answer selection.

Key Results

The integration of visual features yielded consistent improvements over strong baselines:

  • Natural Language Inference: The model achieved state-of-the-art accuracy of 91.3% on SNLI and 90.6% on SICK, demonstrating that visual context helps BERT resolve logical relationships more effectively.
  • Reading Comprehension: Accuracy on SemEval-2018 Task 11 improved by 1.28% for single models, outperforming other external knowledge sources like ConceptNet.
  • Visual Impact: Analysis revealed that the framework is most effective for "concrete" sentences that are easily visualized. Performance gains were highest for "what" and "where" questions, which rely heavily on spatial and entity-based reasoning.

Conclusion

This research demonstrates that pre-trained language models can benefit significantly from a retrieved visual "imagination." By decoupling the visual module from the base architecture, the framework provides a scalable, semi-supervised method to enhance NLU without the need for task-specific image alignments. Future work may explore the use of generative models, such as Diffusion models, to create even more precise visual contexts on the fly, further reducing reliance on static image databases.

Summary updated

Abstract

Integrating visual features has been proved useful for natural language understanding tasks. Nevertheless, in most existing multimodal language models, the alignment of visual and textual data is expensive. In this paper, we propose a novel semi-supervised visual integration framework for pre-trained language models. In the framework, the visual features are obtained through a visualization and fusion mechanism. The uniqueness includes: 1) the integration is conducted via a semi-supervised approach, which does not require aligned images for every sentences 2) the visual features are integrated as an external component and can be directly used by pre-trained language models. To verify the efficacy of the proposed framework, we conduct the experiments on both natural language inference and reading comprehension tasks. The results demonstrate that our mechanism brings improvement to two strong baseline models. Considering that our framework only requires an image database, and no not requires further alignments, it provides an efficient and feasible way for multimodal language learning.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
SNLIBERT + sentence visualization and fusion frameworkAccuracy91.3%+0.1 vs baselinesplit: test
Source quote
L195: BERT + Ours │ 91.3 │ 90.6
SICKBERT + sentence visualization and fusion frameworkAccuracy90.6%+0.2 vs baselinesplit: test
Source quote
L195: BERT + Ours │ 91.3 │ 90.6
Reported baseline / comparator measurements (2)
BenchmarkMethodMetricScoreProtocol / Evidence
SNLIBERT baselineAccuracy91.2%split: test
Source quote
L194: BERT \cite{devlin:bert} │ 91.2 │ 90.4
SICKBERT baselineAccuracy90.4%split: test
Source quote
L194: BERT \cite{devlin:bert} │ 91.2 │ 90.4
BibTeX
@misc{zhang2019semi,
  author = {Lisai Zhang and Qingcai Chen and Dongfang Li and Buzhou Tang},
  title = {{Semi-supervised Visual Feature Integration for Pre-trained Language Models}},
  year = {2019},
  eprint = {1912.00336},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1912.00336},
}
Figure