Text with Knowledge Graph Augmented Transformer for Video Captioning

Xin Gu, Guang Chen, Yufei Wang, Libo Zhang, Tiejian Luo, Longyin Wen

Abstract

Video captioning systems often struggle with the "long-tail" challenge, where rare objects or niche actions are poorly described due to their infrequent appearance in training datasets. We present TextKG, a novel two-stream transformer architecture that integrates external Knowledge Graphs (KGs) to provide linguistic and factual priors. By combining an internal stream of visual and transcript data with an external stream of retrieved knowledge triples, TextKG significantly outperforms existing models on domain-specific benchmarks like YouCookII, achieving an 18.7% improvement in CIDEr scores.

1. Introduction

Generating natural language descriptions for video content requires more than just visual recognition; it requires an understanding of the relationships between entities and the context of actions. Traditional deep learning models rely on associating visual patterns with high-frequency words in training sets. Consequently, they often fail to identify "long-tail" entities—such as specific cooking ingredients or specialized tools—that appear rarely. While large-scale pre-training offers some relief, it does not inherently provide the common-sense or domain-specific knowledge necessary to describe infrequent entities accurately. This paper introduces TextKG, which leverages external knowledge as a "cheat sheet" to bridge this gap.

2. Methodology

2.1 Two-Stream Transformer Architecture

The core of TextKG is a two-stream transformer designed to synthesize direct visual observations with external factual data.

  • Internal Stream: This stream processes standard video inputs, including appearance features from frames, speech transcripts obtained via Automatic Speech Recognition (ASR), and previously generated caption tokens.
  • External Stream: This component acts as the knowledge-retrieval engine. It identifies objects within the video and queries a Knowledge Graph (e.g., ConceptNet) to retrieve relevant triples, such as "pepper — has property — spicy" or "knife — used to — cut".
Figure 1: The TextKG framework, illustrating the parallel processing of internal video features and external knowledge graph triples through cross-attention mechanisms.

2.2 Cross-Attention and Knowledge Selection

To prevent the model from being overwhelmed by irrelevant data, a Knowledge Selection mechanism is employed. Using SBERT, the model ranks retrieved triples based on their semantic similarity to the video's speech transcripts. Only the most contextually relevant facts are passed to the transformer. The two streams interact via a cross-attention mechanism, allowing external knowledge to refine visual features and vice versa during the decoding process.

3. Experimental Results

3.1 Quantitative Performance

TextKG was evaluated on four major benchmarks: YouCookII, ActivityNet Captions, MSR-VTT, and MSVD. The model achieved state-of-the-art (SOTA) results, most notably on the YouCookII dataset, which is characterized by complex, domain-specific vocabulary. TextKG improved the absolute CIDEr score by 18.7% over the previous best-published results. On ActivityNet, the model achieved SOTA performance across three of the four primary metrics (BLEU, METEOR, and CIDEr).

3.2 Qualitative Analysis

Qualitative evaluations demonstrate that TextKG successfully identifies specific entities that baseline models overlook. For instance, while a baseline might vaguely describe "mixing sauce," TextKG leverages its external stream to identify specific ingredients like "sesame oil" and "corn starch" by utilizing the relational data provided by the Knowledge Graph.

Figure 4: Qualitative comparison of TextKG against baseline models, demonstrating the successful retrieval and integration of long-tail ingredient information such as sesame oil and black pepper.

4. Conclusion

TextKG demonstrates that integrating external knowledge is a highly effective strategy for overcoming the long-tail word challenge in video captioning. By treating speech transcripts as a primary input and filtering Knowledge Graph data for semantic relevance, the model gains a deeper understanding of the intent and entities within a video. Future work will explore more sophisticated retrieval strategies that incorporate action context and the development of unified multi-modal Knowledge Graphs.

Summary updated

BibTeX
@inproceedings{gu2023text,
  author = {Xin Gu and Guang Chen and Yufei Wang and Libo Zhang and Tiejian Luo and Longyin Wen},
  title = {{Text with Knowledge Graph Augmented Transformer for Video Captioning}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
}
Figure