Source-linked AI summary

Chat-UniVi: Unified Visual Representation Empowers Large Language Models with Image and Video Understanding

Peng Jin, Ryuichi Takanobu, Wancai Zhang, Xiaochun Cao, Li Yuan

arXiv:2311.08046v3cs.CV

TL;DR

Existing multimodal methods struggle to handle image and video understanding together while using limited visual tokens. Chat-UniVi unifies both modalities with dynamic, multi-scale visual tokens and mixed image-video training, and it consistently surpasses methods designed for only images or videos.

  • Problem

    Existing methods struggle to support both image and video understanding within a unified framework, especially while balancing spatial detail and temporal relationships.

    Source: §1 · pp. 1–2
  • Method

    Chat-UniVi uses dynamic visual tokens, multi-scale representations, DPC-KNN-based token merging, and mixed image-video training to represent both modalities uniformly.

    Source: §1 · p. 2, §5 · p. 8
  • Results

    Chat-UniVi consistently surpasses methods designed exclusively for images or videos across image and video understanding tasks.

    Source: §1 · p. 2, §5 · p. 8
  • Takeaways & Limitations

    The unified representation supports direct application to image and video tasks without modifications while retaining spatial and temporal information with fewer visual tokens.

    Source: §1 · p. 2, §5 · p. 8

    Hallucinations in large language models remain unresolved, and longer test sequences than those seen during training can challenge transformer generalization.

    Source: §A.4 · p. 14

Abstract

from arXiv · show

Large language models have demonstrated impressive universal capabilities across a wide range of open-ended tasks and have extended their utility to encompass multimodal conversations. However, existing methods encounter challenges in effectively handling both image and video understanding, particularly with limited visual tokens. In this work, we introduce Chat-UniVi, a Unified Vision-language model capable of comprehending and engaging in conversations involving images and videos through a unified visual representation. Specifically, we employ a set of dynamic visual tokens to uniformly represent images and videos. This representation framework empowers the model to efficiently utilize a limited number of visual tokens to simultaneously capture the spatial details necessary for images and the comprehensive temporal relationship required for videos. Moreover, we leverage a multi-scale representation, enabling the model to perceive both high-level semantic concepts and low-level visual details. Notably, Chat-UniVi is trained on a mixed dataset containing both images and videos, allowing direct application to tasks involving both mediums without requiring any modifications. Extensive experimental results demonstrate that Chat-UniVi consistently outperforms even existing methods exclusively designed for either images or videos. Code is available at https://github.com/PKU-YuanGroup/Chat-UniVi.

1. Introduction

Chat-UniVi addresses the challenge of enabling large language models to understand both images and videos within one framework. It uses dynamic, multi-scale visual tokens and mixed image-video training to preserve spatial and temporal information efficiently.

Motivation

  • Existing multimodal methods commonly specialize in either images or videos, creating a trade-off between fine spatial detail and temporal modeling.Image-focused methods use more tokens for spatial understanding, while video-focused methods reduce per-frame spatial detail to model temporal relationships.Source: §1 · pp. 1–2

Unified Representation

  • Chat-UniVi uniformly represents images and videos with dynamic visual tokens that capture image details and video temporal relationships.Image regions receive tokens at diverse sizes, while video tokens expand across frames within events.Source: §1 · p. 2

Training and Results

  • Chat-UniVi is trained on mixed image and video data and can be applied directly to both modalities without modification.The unified formulation reduces the number of visual tokens while maintaining expressive capability.Source: §1 · p. 2

Token Construction

  • The method progressively merges semantically similar visual tokens using DPC-KNN clustering and averages tokens within each cluster.For videos, DPC-KNN is also applied to frame features to identify events before temporal token merging.Source: §1 · p. 2

Multi-scale Representation

  • Chat-UniVi uses multi-scale representations so high-level features support semantic understanding while low-level features support detailed descriptions.This representation is intended to support varied image and video understanding tasks.Source: §1 · p. 2

Training and Results

  • Chat-UniVi consistently outperforms methods designed exclusively for images or videos and achieves competitive performance across image and video tasks without fine-tuning.The introduction also reports impressive results on an object hallucination benchmark.Source: §1 · p. 2, Figure 2 · p. 2

2. Related Work

Related work includes multimodal systems that connect language models with vision experts or integrate modalities end to end. Chat-UniVi extends dynamic visual tokens to video, unifying image and video representations with parameter-free clustering.

Multimodal Models

  • Multimodal models broadly use LLMs as dispatch schedulers for vision experts or integrate different modalities into end-to-end trainable systems.The related-work discussion places Chat-UniVi among models that seek broader multimodal capability.Source: §2 · pp. 2–3

Dynamic Tokens

  • Prior dynamic-token methods explore token adaptation within transformers, but the cited methods cannot be directly extended to video.This limitation motivates extending dynamic tokenization across both image and video inputs.Source: §2 · p. 3

Chat-UniVi

  • Chat-UniVi extends dynamic tokens to video and integrates image and video representations in a unified framework.The authors describe this as the first demonstration of reconciling image spatial detail with video temporal understanding.Source: §2 · p. 3, Figure 3 · p. 3
  • Its clustering method is parameter-free, which the authors identify as central to the model’s success amid gradient instability in multimodal conversation training.The authors attribute the convergence difficulty to parameterized methods under gradient instability.Source: §2 · p. 3

3. Methodology

Chat-UniVi uses dynamic visual tokens to represent images and videos in one language-model-compatible framework. It merges semantically similar tokens and video frames while retaining multi-scale visual information and substantially reducing token count.

Unified Visual Representation

  • Chat-UniVi uniformly represents images and videos through dynamic visual tokens, bridging spatial image details with temporal video relationships.The representation is designed for a unified language sequence that LLMs can comprehend.Source: §3 · pp. 3–4

Spatial Visual Token Merging

  • DPC-KNN clusters image tokens by local density and distance, then averages each cluster into one representative token.Cluster centers use relatively high ρ_i × δ_i, and merged regions are formed from the union of constituent vision regions.Source: §3.1 · p. 4

Temporal Visual Token Merging

  • Temporal visual token merging clusters frames into critical events before expanding tokens only across frames within the same event.Frame representations are obtained by mean-pooling their tokens, and DPC-KNN identifies event clusters.Source: §3.1 · p. 4

Multi-scale Representation

  • Multi-scale aggregation provides visual features at different merging stages for both high-level semantics and low-level detail.The method progressively merges CLIP-derived visual tokens while preserving representations at multiple scales.Source: §3.1 · p. 4

Efficiency

  • 112 visual tokens are used by Chat-UniVi compared with 256 for LLaVA, despite retaining dynamic visual representations.The reported comparison emphasizes the lower token count of the proposed method.Source: §3.1 · p. 4

Multimodal Training Scheme

  • Joint instruction tuning uses a mixture of multi-turn and single-turn conversations with single images, multiple images, and videos.The model is fully fine-tuned with the language model and projection matrix, enabling direct processing of images and videos without realignment.Source: §3.2 · p. 5

4. Experiments

Chat-UniVi is evaluated across image, video, question-answering, hallucination, ablation, and human-assessment settings. Results consistently favor the unified model, while ablations examine training schemes and visual-cluster choices.

Video Understanding

  • Chat-UniVi significantly surpasses recently proposed state-of-the-art methods focused exclusively on video in GPT-based video understanding evaluation.Evaluation uses ActivityNet-based videos and GPT-3.5 scores correctness, detail, context, temporal understanding, and consistency.Source: §4.2 · p. 6

Question-Answer Evaluation

  • Chat-UniVi outperforms recently proposed methods across zero-shot video question-answering datasets, including MSRVTT-QA, MSVD-QA, TGIF-QA FrameQA, and ActivityNet-QA.The evaluation follows GPT-assisted assessment protocols.Source: §4.3 · p. 6

Object Hallucination Evaluation

  • Chat-UniVi outperforms recently proposed state-of-the-art methods on POPE and even exceeds the 13B MiniGPT-4 despite using 7B parameters.The authors attribute this success to multi-scale representations combining high-level semantics with low-level visual appearance.Source: §4.4 · pp. 6–7, Table 5 · p. 6

Ablation Studies

  • Joint training on image and video data improves understanding of both media, whereas training on only one medium decreases comprehension of the other.The ablation compares single-medium tuning, sequential image-then-video fine-tuning, and mixed image-and-video training.Source: §4.5 · p. 7, Table 6 · p. 7
  • Fewer spatial clusters reduce fine-detail capacity, while more clusters add redundancy and can reduce overall performance.The practical configuration uses 64, 32, and 16 clusters across three spatial levels.Source: §4.5 · p. 7, Table 7 · p. 7

Human Evaluation

  • Human evaluations cover 30 image and 30 video conversation scenarios, with evaluators rating multimodal conversation performance from 0 to 10.The final model score is the average rating; Chat-UniVi surpasses Flamingo-based, image-specific, and video-specific models.Source: §4.6 · pp. 7–8, Figure 4 · p. 7

5. Conclusion

Chat-UniVi unifies image and video understanding with dynamic visual tokens, DPC-KNN clustering, and multi-scale features. Mixed image-video training enables direct use across both media, and experiments report consistent superiority over specialized methods.

5. Conclusion

  • Chat-UniVi uses dynamic visual tokens and multi-scale features to represent images and videos within one unified multimodal framework.DPC-KNN progressively clusters visual tokens and supplies multi-scale representations.Source: §5 · p. 8
  • Mixed image-and-video training lets Chat-UniVi apply directly to tasks involving both media without modifications.The training data encompasses both images and videos.Source: §5 · p. 8
  • Chat-UniVi consistently surpasses methods designed exclusively for images or videos.The conclusion characterizes this result as supported by extensive experimental evidence.Source: §5 · p. 8

A.1. Comparison of Chat-UniVi and Other Multimodal Methods

Chat-UniVi differs from prior multimodal methods through multi-scale dynamic tokens, variable-length video features, joint training, and parameter-free clustering. These choices support unified image-video modeling while keeping clustering overhead negligible.

Comparison with Other Multimodal Methods

  • Q-former methods extract a fixed number of tokens per image or video, making variable-length videos difficult to model effectively.Chat-UniVi instead determines temporal-cluster counts proportionally to input frame count.Source: §A.1 · p. 13
  • Chat-UniVi allocates more temporal visual tokens to longer videos through variable-length video features.This contrasts with Q-former-based methods that use fixed token counts.Source: §A.1 · p. 13
  • Joint training on mixed image-video datasets simultaneously enhances the model’s understanding of both images and videos.The unified representation permits direct application to tasks involving both media.Source: §A.1 · p. 13

Comparison with Clustering Transformer Methods

  • Chat-UniVi extends token clustering to video inputs, integrating image and video representations with a parameter-free method.The authors report that parameterized clustering performs significantly worse and attribute this to gradient instability.Source: §A.2 · p. 13
  • The clustering algorithm’s time and memory costs are negligible compared with those of the large language model.This comparison is reported in the corresponding cost analysis.Source: §A.3 · p. 13

A.4. Limitations and Future Work

The paper acknowledges inherited vulnerabilities from pretrained language models and identifies limitations in hallucination, long-sequence processing, and natural-language outputs. It also points to broader modality integration as future work.

  • Pretrained language models transmit their vulnerabilities to Chat-UniVi.Source: §A.4 · p. 14
  • Hallucinations remain unresolved and can produce unsupported conjectures during open multimodal conversations.Source: §A.4 · p. 14
  • Long-sequence constraints cause forgetfulness in multi-turn conversations and declining performance with multiple video inputs.Source: §A.4 · p. 14
  • Natural-language outputs are inconvenient for bounding boxes and dense pixel predictions, while their flexibility complicates evaluation.Source: §A.4 · p. 14
  • Future work can add modalities such as audio to broaden tasks and potentially enhance video understanding.Source: §A.4 · p. 14

B. Implementation Details

Chat-UniVi uses multimodal data and standard vision-language components in a staged training setup. The implementation also documents training-data composition and runtime-complexity variables.

C. Additional Experiments

Additional experiments examine fine-tuning strategy, vision encoders, multi-scale representation, training data, and object hallucination. The results support competitive efficiency and improvements associated with the proposed structure and data.

D. Additional Visualization Results

Additional visualizations show that dynamic visual tokens generalize across varied image categories and capture spatial nuances with limited tokens. The token-merging method requires neither object-outline labels nor trainable parameters.

E. Additional Qualitative Analysis

Chat-UniVi demonstrates multimodal conversational understanding through examples involving images, videos, and combinations of both. The examples show contextually appropriate responses across multiple conversational turns, including reasoning and creative expression.

F. Details of Quantitative Evaluations

The quantitative evaluations assess image and video understanding with GPT-based protocols, zero-shot object hallucination probing, and visual-token analyses. These procedures measure response quality, correctness, and the flexibility of the dynamic-token representation.

Image understanding

Video understanding

Dynamic visual tokens

Object hallucination

Loading 2311.08046v3…