LAVIS: A Library for Language-Vision Intelligence

Dongxu Li, Junnan Li, Hung Le, Guangsen Wang, Silvio Savarese, Steven C. H. HoiarXiv 2022 · DOI

Introduction

The field of Language-Vision (LV) intelligence—encompassing tasks such as image captioning, visual question answering (VQA), and multimodal retrieval—has experienced a surge in powerful foundation models. However, the ecosystem remains highly fragmented. Each new model typically introduces its own codebase, data-loading logic, and inconsistent evaluation metrics. This fragmentation creates a high barrier to entry and leads to redundant efforts. LAVIS (LAnguage-VISion) addresses these challenges by providing a unified, extensible, and reproducible open-source library that simplifies the pipeline from data preparation to model inference and benchmarking.

Methods and Architecture

The cornerstone of LAVIS is its modular design, which decouples the various stages of the machine learning pipeline to ensure flexibility and ease of use.

The modular architecture of the LAVIS library.

The library is structured around several key components:

  • Unified Interface: Users can interact with complex architectures through simple commands like load_model() and load_dataset(), hiding the underlying complexity of specific architectures.
  • Models: LAVIS provides native support for state-of-the-art foundation models, including ALBEF (contrastive learning), BLIP (captioning and understanding), CLIP (dual-encoder representations), and ALPRO (video-text alignment).
  • Processors: These components handle the preprocessing of multimodal inputs, such as image resizing and text tokenization, into model-ready formats.
  • Tasks: Abstracted logic for specific objectives (e.g., retrieval or VQA) allows a single model to be evaluated across different tasks seamlessly.
  • Runners: This layer manages the training lifecycle, including optimization, logging, and epoch/iteration-based loops.

The library utilizes a hierarchical configuration system and a central registry, facilitating the integration of custom models and datasets.

Supported Datasets

LAVIS supports over 20 public datasets across image-text and video-text modalities. Key image-text datasets include MSCOCO, Flickr30k, VQAv2, OK-VQA, and LAION, while video-text support includes MSRVTT and MSVD. A significant feature is the inclusion of automatic dataset downloading tools, which streamlines the setup process for these benchmarks.

Key Insights and Capabilities

LAVIS emphasizes productivity through modularity. By separating the "Model" from the "Task," researchers can evaluate a single architecture across diverse scenarios—from zero-shot classification to video dialogue—without rewriting core logic. Additionally, the library treats multimodal feature extraction as a primary use case, catering to users who require representations for downstream applications rather than full model training.

Examples of multimodal tasks supported by the LAVIS GUI.

To facilitate qualitative analysis, LAVIS includes a GUI web demo and a dataset browser. This "human-in-the-loop" approach allows researchers to inspect model predictions and data samples intuitively, complementing quantitative metrics.

Key Results

The authors validated LAVIS by replicating the results of several foundation models, matching or exceeding original reported performances:

  • ALBEF: Replicated SOTA on COCO text retrieval (77.6 R@1).
  • BLIP: Achieved a CIDEr score of 133.5 on COCO captioning and demonstrated strong zero-shot transfer to video-text tasks.
  • CLIP: Replicated zero-shot ImageNet classification accuracy at 76.5%.
  • Knowledge-based VQA: The LAVIS implementation of BLIP surpassed previous state-of-the-art results on OK-VQA and A-OKVQA by leveraging its strong language-vision pre-training.

Limitations and Future Work

Current limitations include the need for more robust parallelism support for large-scale distributed training, which the authors plan to address in future releases. While the library currently focuses on four major foundation models, there are plans to integrate emerging architectures continuously. Finally, the authors highlight ethical considerations, noting that models trained on large-scale web data may inherit socioeconomic biases, necessitating careful review before deployment.

Summary updated

BibTeX
@misc{li2022lavis,
  author = {Dongxu Li and Junnan Li and Hung Le and Guangsen Wang and Silvio Savarese and Steven C. H. Hoi},
  title = {{LAVIS: A Library for Language-Vision Intelligence}},
  year = {2022},
  eprint = {2209.09019},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2209.09019},
}
Figure