image

paper

TL;DR

  • task : image captioning and SGG
  • problem : 이미지 내 scene graph를 활용해서 캡셔닝을 하면 도움이 되어서 외부 SGG + GCN을 활용해서 input으로 넣어준다. 그런데 (1) loss를 relation과 관련된 loss가 아니라 image captioning loss(=MLE)를 쓰는게 encoder를 충분히 학습시키지 못하고 (2) encoder만 따로 떼서 relation을 뽑을 수 있는 형태가 아니어서 범용성도 떨어지고 설명가능성도 떨어진다.
  • idea : 하나의 트랜스포머 모델로 image captioning과 scene graph generator 같이 하자!
  • architecture : FasterRCNN으로 bbox 뽑고 Transformer encoder으로 self-attention 거친 output 으로 m(m-1) 해서 relation prediction 하고 transformer encoder의 L층의 hidden vector weighted sum해서 decoder로 넘겨주고 token prediction.
  • objective : cross-entropy loss for SGG / MLE for captioning.
  • baseline : IMP, MOTIFS, VCTree(for SGG)
  • data : COCO(image captioning), Visual Genome -> COCO랑 Visual Genome이랑 겹치는 이미지들도 있는데 아주 소수임.
  • result : image captioning과 SGG 모두 SOTA
  • contribution : SGG + captioning in one model!
  • limitation : SGG도 sota인게 신기함.

Details

A Relational Encoding Learning Idea

image

보통의 captioning objective는 아래와 같음 image

y는 토큰들 $x$는 이미지의 visual feature. captioning을 할 때 scene graph 정보를 넣어주기 위해서는 일단 image feature x를 어떤 pretrained SGG에 넣어서 그래프를 뽑고, 이 그래프를 GCN에 넣어서 잘 임베딩 한다음에 그 임베딩과 이미지 feature를 concat해서 captioning input에 넣어주는 형식으로 진행했음. 이 때 objective가 SGG가 아니라 captioning에 걸리고, encoder가 정보 딱히 안뽑아도 decoder가 강하면 성능이 어느 정도 잘 나온다는 연구들이 있어서 이 encoder에서 relation을 잘 임베딩 뽑도록 학습되는지에 대한 의문이 듦

Architecture

image

Encoder Architecture

Encoder의 경우 bbox 정보와 CNN에서 뽑은 결과, box label의 GloVe 벡터를 인풋으로 넣어주고 트랜스포머 인코더 태우고, m(m-1)쌍을 relation 벡터랑 concat해서 어떤 relation인지 softmax로 뽑았다.

Weighted Decoder for Image Captioning

decoding할 때는 transformer의 모든 레이어의 output vector를 weighted sum한 것이 주어졌을 때 token prediction으로 바꾸었다. image

Sequential Training with Inferred Labels

(i) Visual Genome에 대해 Faster RCNN 학습 (ii) Visual Genome에 대해 학습된 Faster RCNN을 가지고 Encoder 학습 (iii) encoder 학습 된 뒤, COCO dataset에 대해 encoder - caption decoder 같이 학습

caption loss와 SGG loss weighted sum 해봤다. ablation 해보니 caption loss만 건 것보다 성능이 안좋았다. image

Results

SGG

image

c.f. two-stage SGG 비교 Predicate classification(PredCLS) : given GT bbox and cls, predict predicates Scene graph classification(SGCLS) : given GT bbox, predict predicates and object class SGDet = SGGen인듯

SGDetR@20R@50R@100
Reformer(here)25.433.037.2
Seq2Seq https://github.com/long8v/PTIR/issues/5022.130.934.4
BGT-Net(GRU) https://github.com/long8v/PTIR/issues/5125.532.837.3
RTN https://github.com/long8v/PTIR/issues/4922.529.033.1
SGClsR@20R@50R@100
Reformer(here)36.640.141.1
Seq2Seq https://github.com/long8v/PTIR/issues/5034.538.339.0
BGT-Net(GRU) https://github.com/long8v/PTIR/issues/5141.745.947.1
RTN https://github.com/long8v/PTIR/issues/4943.844.044.0

Captioning

image

Ablation for captioning

image