cs
ViperGPT (ICCV 2023, VQA)
DL·ML/NLP

ViperGPT (ICCV 2023, VQA)

Abstract

  • ICCV 2023
  • VQA
  • compositional VQA를 풀기 위해 modular architecture 사용
  • API와 Codex를 활용하여 Python code를 output하는 framework 

 

 

Motivation

특히 compositional한 문제를 풀 때에는 modular structure가 필요하게 되는 경우가 많다. 예컨대, Fig. 1의 첫 번째 query에 대한 답을 내기 위해서는 1) children과 muffin을 찾고, 2) 개수를 센 다음, 3) 'fair'하게 나눠야 한다. 이는 end-to-end approach로는 compositional reasoning하기 어려워 해결하기 어렵다.

 

또한 end-to-end appraoch의 경우 interpretability가 떨어진다는 문제가 있다. 

 

이런 문제를 해결하기 위해 modular한 방식이 시도되어 왔으나 optimize하기 어렵고 hand-crafted거나 RL을 사용하여 domain specific하다는 문제가 있었다.

 

 

Figure 1: Compositional Visual Question Answering Problems.

 

따라서 논문에서는 LLM의 code generation을 이용하여 textual query에 맞게 vision model을 compose하는 framework인 ViperGPT를 제안한다.

 

 

 

 

Methods

Notation

visual input $x$와 textual query $q$에 대해서, program generator $π$에 의해 program은 $z=π(q)$로 생성된다.

 

여기에 execution engine $r=φ(x,z)$를 이용하여 result $r$을 얻는다. 여기서의 $z$는 Python code로 제공된다. 

 

 

Program Generation

기존에는 $π$를 neural network를 사용했으나, 이는 scability가 떨어진다는 단점이 있다. 따라서 OpenAI Codex를 사용한다. 

 

이를 용이하게 하기 위해서 prompt로 여러 역할의 vision model의 API specification과 sample이 제공된다. 이에 대한 expected output은 Python function이다. 

 

 

Modules and Their API

API는 두 개의 global class `ImagePatch`와 `VideoSegment`로 구성된다. 각 class 안에는 method들이 해당 image 또는 video를 process한 뒤 결과를 return한다. 예컨대, `ImagePatch` class의 `compute_detph` method는 image patch의 estimated median detph를 return한다. 

 

API는 input과 output, 각 function의 설명이 natural language로 작성되어 있다. 자세한 내용은 paper의 appendix를 참조하면 된다.

 

 

Program Execution

이전에는 generated program $z$를 execute하기 위해서 execution engine을 neural module network로 학습해서 사용했다. 이 경우 end-to-end의 문제점을 그대로 갖게 된다. 

 

따라서 본 paper에서는 Python interpreter를 사용한다. 

 

 

 

 

Results

Visual Grounding

 

 

 

Compositional Image QA

 

External Knowledge-dependent Image QA

이 task에 대해서는 잘 모르는데, image 안에서의 정보만을 이용해서는 대답할 수 없는 VQA task인 것으로 생각된다.

 

`llm-query`라는 GPT-3 based module을 사용해서 external knowledge를 사용한다.

 

 

 


References

[1] Surís, D., Menon, S., & Vondrick, C. (2023). Vipergpt: Visual inference via python execution for reasoning. In Proceedings of the IEEE/CVF International Conference on Computer Vision (pp. 11888-11898).

Footnotes