GANs for Discrete Text Generation
Junfu
- Oct. 20th, 2018
GANs for Discrete Text Generation Junfu Oct. 20 th , 2018 Show, - - PowerPoint PPT Presentation
Paper Reading GANs for Discrete Text Generation Junfu Oct. 20 th , 2018 Show, Tell and Discriminate Problems in Image Captioning Imitate the language structure patterns (phrases, sentences) Templated and Generic (Different image
2 Xihui Liu, et al. Show, Tell and Discriminate: Image Captioning by Self-retrieval with Partially Labeled Data. ECCV 2018, CUHK.
Act as a metric and an evaluator of caption discriminativeness to assure the quality of generated captions Use unlabeled data to boost captioning performance
3
4
Image Caption
𝐽 𝐷 = {𝑥1, 𝑥2, … , 𝑥𝑈} 𝐷∗ = {𝑥1
∗, 𝑥2 ∗, … , 𝑥𝑈′ ∗ }
𝑤 = 𝐹𝑗(𝐽) 𝐷 = 𝐸𝑑(𝑤)
Encoder: CNN Decoder: LSTM
𝑀𝐷𝐹 𝜄 = −
𝑢=1 𝑈
log(𝑞𝜄(𝑥𝑢
∗|𝑤, 𝑥𝑢 ∗, … , 𝑥𝑢−1 ∗
))
Image Encoder (CNN) Caption Encoder (GRU)
𝑤 = 𝐹𝑗(𝐽) 𝑑 = 𝐹𝑑(𝐷) Similarity between 𝑑𝑗 and 𝑤𝑘: 𝑡(𝑑𝑗, 𝑤𝑘) 𝑀𝑠𝑓𝑢 𝐷𝑗, 𝐽1, 𝐽2, … , 𝐽𝑜 = max
𝑘≠𝑗 𝑛 − 𝑡 𝑑𝑗, 𝑤𝑗 + 𝑡 𝑑𝑗, 𝑤𝑘 +
where 𝑦 + = max(𝑦, 0) Train with ranking loss: 𝑠 𝐷𝑗
𝑡 = 𝑠𝑑𝑗𝑒𝑓𝑠 𝐷𝑗 𝑡 + 𝛽 ∙ 𝑠𝑠𝑓𝑢(𝐷𝑗 𝑡, {𝐽1, … , 𝐽𝑜})
Pre-train: Adv-train:
Labeled Data Unlabeled Data Labeled Image: {𝐽1
𝑚, 𝐽2 𝑚, … , 𝐽𝑜𝑚 𝑚 }
Generated Caption: {𝐷1
𝑚, 𝐷2 𝑚, … , 𝐷𝑜𝑚 𝑚 }
Unlabeled Image: {𝐽1
𝑣, 𝐽2 𝑣, … , 𝐽𝑜𝑣 𝑣 }
𝑠 𝐷𝑗
𝑚 = 𝑠 𝑑𝑗𝑒𝑓𝑠 𝐷𝑗 𝑚 + 𝛽 ∙ 𝑠 𝑠𝑓𝑢(𝐷𝑗 𝑚, {𝐽1 𝑚, 𝐽2 𝑚, … , 𝐽𝑜𝑚 𝑚 }⋃{𝐽1 𝑣, 𝐽2 𝑣, … , 𝐽𝑜𝑣 𝑣 })
𝑠 𝐷𝑗
𝑣 = 𝛽 ∙ 𝑠 𝑠𝑓𝑢(𝐷𝑗 𝑣, {𝐽1 𝑚, 𝐽2 𝑚, … , 𝐽𝑜𝑚 𝑚 }⋃{𝐽1 𝑣, 𝐽2 𝑣, … , 𝐽𝑜𝑣 𝑣 })
Unlabeled Image: {𝐽1
𝑣, 𝐽2 𝑣, … , 𝐽𝑜𝑣 𝑣 }
Feature: {𝑤1
𝑣, 𝑤2 𝑣, … , 𝑤𝑜𝑚 𝑣 }
Groundtruth Caption: 𝐷∗ = {𝑥1
∗, 𝑥2 ∗, … , 𝑥𝑈′ ∗ }
Similarity: {𝑡(𝑑∗, 𝑤1
𝑣), 𝑡(𝑑∗, 𝑤2 𝑣), … , 𝑡(𝑑∗, 𝑤𝑜𝑣 𝑣 }
Rank and sample: [ℎ𝑛𝑗𝑜, ℎ𝑛𝑏𝑦]
Images and corresponding captions in labeled dataset
Images and corresponding captions in labeled dataset Share image encoder with self-retrieval module MLE with cross-entropy loss
Reward for labeled data: CIDEr and self-retrieval reward Reward for unlabeled data: self-retrieval reward CIDEr: guarantee the similarity between caption and groundtruth Self-retrieval reward: encourage caption to be discriminative
Word embedding: 300-D vector Image encoder: ResNet-101 Language decoder: single GRU with 1024 hidden units
Share image encoder with self-retrieval module Language decoder: attention LSTM Visual feature: 2048x7x7 before pooling 𝛽 = 1, #𝑚𝑏𝑐𝑓𝑚𝑓𝑒 𝑒𝑏𝑢𝑏: #𝑣𝑜𝑚𝑏𝑐𝑓𝑚𝑓𝑒 𝑒𝑏𝑢𝑏 = 1: 1
Beam search size: 5
Baseline: captioning module only trained only with CIDEr (w/o self-retrieval module) SR-FL: proposed method training with fully-labeled data SR-PL: proposed method training with additional unlabeled data
Baseline: captioning module only trained only with CIDEr (w/o self-retrieval module) SR-FL: proposed method training with fully-labeled data SR-PL: proposed method training with additional unlabeled data
VSE0: VSE++:
Unique captions: captions that are unique in all generated captions Novel captions: captions that have not been seen in training
Machine and human captions are quite distinct
Word distributions Vocabulary size Strong bias (frequent captions)
How to generate human-like captions
Multiple captions Diverse captions
13
Rakshith Shetty, et al., Speaking the Same Language: Matching Machine to Human Captions by Adversarial Training. ICCV, 2017.
14
Rakshith Shetty, et al., Speaking the Same Language: Matching Machine to Human Captions by Adversarial Training. ICCV, 2017.
Generate multiple sentences and pick one with highest prob Use greedy search approaches (beam search)
High variance Computationally intensive (sampling)
Easily distinguishes between softmax distribution and sharp ref.
15
16
CDF: PDF: 均值𝑏 + 𝛿𝑐
17
Performance Comparison Diversity Comparison Corpus Level Diversity
Diversity in a set of captions for corresp. Image
18 Lijun Wu, Yingce Xia, Tie-yan Liu, et al., Adversarial Neural Machine Translation. ACML, 2018.
19 Lijun Wu, Yingce Xia, Tie-yan Liu, et al., Adversarial Neural Machine Translation. ACML, 2018.
20