VisorGPT: Learning Visual Prior via Generative Pre-Training

Jinheng Xie, Kai Ye, Yudong Li, Yuexiang Li, Kevin Qinghong Lin, Yefeng Zheng, Linlin Shen, Mike Zheng ShouarXiv 2023 · DOI

TL;DR

This paper introduces VisorGPT, a novel generative pre-training approach that learns the "visual prior" – the implicit knowledge of object locations, shapes, and relationships in images – by treating visual annotations as sequences. This allows for customized generation of spatial conditions, significantly improving the realism and accuracy of conditional image synthesis tasks.

What Problem Does This Paper Address?

Modern deep learning models, particularly Visual Foundation Models (VFMs), implicitly learn a "visual prior" from vast amounts of image data. This prior, representing common sense about how objects appear and interact in the real world (e.g., a donut is usually round and on a table, not square and floating), is crucial for generating realistic synthetic images. However, existing methods for controlling image synthesis often struggle to generate customized spatial conditions that consistently adhere to this visual prior. This can lead to unnatural or inaccurate results, especially when trying to synthesize complex scenes with specific object arrangements. The paper aims to explicitly learn this visual prior and provide a flexible way to sample and customize spatial conditions for various vision tasks.

Methods

The core idea of VisorGPT is to leverage the success of large language models (LLMs) in sequence modeling. The authors propose to:

  1. Discretize Visual Annotations: They convert various visual annotations (bounding boxes, human poses, instance masks) into discrete sequences of tokens. This is achieved by defining standardized "prompt templates" that encode information like annotation type, data type, object size, number of instances, and category names, followed by their spatial coordinates.
  2. Generative Pre-Training: A decoder-only transformer architecture, similar to GPT, is trained on these sequences. The objective is to maximize the likelihood of these sequences, effectively learning the probabilistic distribution of visual priors.
  3. Prompt Engineering for Customization: Users can guide the generation process by providing specific prompts. These prompts act as conditions, allowing VisorGPT to sample customized sequences of spatial information that adhere to the learned visual prior. This enables fine-grained control over aspects like object type, count, size, and even continuous generation of sequences.

Datasets

The authors collected approximately 4 million sequences from publicly available datasets for training and evaluation. These include:

  • MS-COCO: Used for bounding boxes, human poses, and instance masks.
  • Objects365: Used for bounding boxes.
  • Open Images: Used for bounding boxes.
  • CrowdPose: Used for human poses.
  • ImageNet-1K: Used for object-centric scenarios.

The paper does not introduce new benchmark datasets but rather reformats existing annotations into sequences for their training and evaluation.

Key Insights and Ideas

  • Visual Priors as Sequences: The most significant insight is the successful framing of complex visual spatial information (locations, shapes, relationships) as discrete sequences, making them amenable to powerful language modeling techniques.
  • Generative Pre-Training for Visual Common Sense: By training a transformer on these visual sequences, VisorGPT implicitly learns "visual common sense" – the underlying rules and patterns of the visual world.
  • Prompting for Controllable Synthesis: The use of prompt engineering allows for flexible and intuitive control over the generated spatial conditions, bridging the gap between user intent and realistic image synthesis.
  • NLP Knowledge is Less Critical for Visual Priors: Ablation studies suggest that initializing with NLP pre-trained weights (Textual Knowledge) can actually deteriorate performance, indicating that visual priors are best learned directly from visual data rather than being heavily influenced by language model biases.

Key Results

  • Accurate Prior Modeling: VisorGPT demonstrates a high degree of similarity (measured by KL divergence) between the learned visual priors (location, shape, relation) and the real priors from datasets like COCO, Open Images, and Objects365.
  • High-Quality Sequence Generation: Generated sequences are highly decodable into visual locations (over 99% accuracy) and accurately reflect user-specified conditions for object size and number of instances (over 90% accuracy).
  • Improved Conditional Image Synthesis: When used with models like ControlNet and GLIGEN, VisorGPT-generated spatial conditions lead to more realistic and natural-looking synthetic images compared to conditions that do not adhere to the visual prior.
  • Scalability: The model architecture scales well with increased parameters, showing improved performance with larger models.

Limitations and Future Work

  • Limited Number of Labeled Classes: VisorGPT is currently limited to closed-set inference within approximately 1,000 categories due to the training data.
  • Maximum Sequence Length: The model's ability to handle sequences with a very large number of instances is constrained by the maximum token length of the transformer.
  • Future Work: The authors plan to address these limitations by:
  • Incorporating natural language corpora to potentially enrich understanding.
  • Extending the maximum sequence length to handle more complex scenes with numerous instances.
  • Potentially enabling open-set inference for a wider range of categories.

Summary updated

BibTeX
@misc{xie2023visorgpt,
  author = {Jinheng Xie and Kai Ye and Yudong Li and Yuexiang Li and Kevin Qinghong Lin and Yefeng Zheng and Linlin Shen and Mike Zheng Shou},
  title = {{VisorGPT: Learning Visual Prior via Generative Pre-Training}},
  year = {2023},
  eprint = {2305.13777},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2305.13777},
}
Figure