Add Batch 19ba7818-91d9-46fa-aa9b-a73000b3eebc
Browse files- contrastivevisionlanguagepretrainingwithlimitedresources/f4976c4a-2f50-4375-badd-b536ee7e6978_content_list.json +3 -0
- contrastivevisionlanguagepretrainingwithlimitedresources/f4976c4a-2f50-4375-badd-b536ee7e6978_model.json +3 -0
- contrastivevisionlanguagepretrainingwithlimitedresources/f4976c4a-2f50-4375-badd-b536ee7e6978_origin.pdf +3 -0
- contrastivevisionlanguagepretrainingwithlimitedresources/full.md +325 -0
- contrastivevisionlanguagepretrainingwithlimitedresources/images.zip +3 -0
- contrastivevisionlanguagepretrainingwithlimitedresources/layout.json +3 -0
- contributionsofshapetextureandcolorinvisualrecognition/f7c18fda-281b-44eb-8771-96b4ada85b30_content_list.json +3 -0
- contributionsofshapetextureandcolorinvisualrecognition/f7c18fda-281b-44eb-8771-96b4ada85b30_model.json +3 -0
- contributionsofshapetextureandcolorinvisualrecognition/f7c18fda-281b-44eb-8771-96b4ada85b30_origin.pdf +3 -0
- contributionsofshapetextureandcolorinvisualrecognition/full.md +256 -0
- contributionsofshapetextureandcolorinvisualrecognition/images.zip +3 -0
- contributionsofshapetextureandcolorinvisualrecognition/layout.json +3 -0
- controllablevideogenerationthroughglobalandlocalmotiondynamics/0153e114-8b68-4c4a-b6fb-adf9fc9f290f_content_list.json +3 -0
- controllablevideogenerationthroughglobalandlocalmotiondynamics/0153e114-8b68-4c4a-b6fb-adf9fc9f290f_model.json +3 -0
- controllablevideogenerationthroughglobalandlocalmotiondynamics/0153e114-8b68-4c4a-b6fb-adf9fc9f290f_origin.pdf +3 -0
- controllablevideogenerationthroughglobalandlocalmotiondynamics/full.md +266 -0
- controllablevideogenerationthroughglobalandlocalmotiondynamics/images.zip +3 -0
- controllablevideogenerationthroughglobalandlocalmotiondynamics/layout.json +3 -0
contrastivevisionlanguagepretrainingwithlimitedresources/f4976c4a-2f50-4375-badd-b536ee7e6978_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1b5478b5b643ae6f22205a120827d158b7af705283d2568aace6188d83a8c166
|
| 3 |
+
size 86398
|
contrastivevisionlanguagepretrainingwithlimitedresources/f4976c4a-2f50-4375-badd-b536ee7e6978_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ead42613ff4d1d255a3389602c35325aaa8ba709e4048da432520e54cfe78515
|
| 3 |
+
size 104280
|
contrastivevisionlanguagepretrainingwithlimitedresources/f4976c4a-2f50-4375-badd-b536ee7e6978_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ffbada562efd74a15b96979ff89377394bb6c710919e8329b5e38b28f54583e5
|
| 3 |
+
size 979416
|
contrastivevisionlanguagepretrainingwithlimitedresources/full.md
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Contrastive Vision-Language Pre-training with Limited Resources
|
| 2 |
+
|
| 3 |
+
Quan Cui $^{1,2}$ , Boyan Zhou $^{1}$ , Yu Guo $^{1}$ , Weidong Yin $^{1}$ , Hao Wu $^{1\star}$ , Osamu Yoshie $^{2}$ , and Yubo Chen $^{1}$
|
| 4 |
+
|
| 5 |
+
1 ByteDance
|
| 6 |
+
|
| 7 |
+
2 Waseda University
|
| 8 |
+
|
| 9 |
+
cui-quan@toki.waseda.jp, wuhao.5688@bytedance.com
|
| 10 |
+
|
| 11 |
+
Abstract. Pioneering dual-encoder pre-training works (e.g., CLIP and ALIGN) have revealed the potential of aligning multi-modal representations with contrastive learning. However, these works require a tremendous amount of data and computational resources (e.g., billion-level web data and hundreds of GPUs), which prevent researchers with limited resources from reproduction and further exploration. To this end, we propose a stack of novel methods, which significantly cut down the heavy resource dependency and allow us to conduct dual-encoder multi-modal representation alignment with limited resources. Besides, we provide a reproducible baseline of competitive results, namely ZeroVL, with only 14M publicly accessible academic datasets and 8 V100 GPUs. Additionally, we collect 100M web data for pre-training, and achieve comparable or superior results than state-of-the-art methods, further proving the effectiveness of our methods on large-scale data. We hope that this work will provide useful data points and experience for future research in contrastive vision-language pre-training. Code is available at https://github.com/zerovl/ZeroVL.
|
| 12 |
+
|
| 13 |
+
Keywords: Multi-Modal Representation Learning, Contrastive Learning, Language-Image Pre-training, Limited Resources
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
Large-scale representation pre-training has become the de-facto approach in vision [5,6,17,45], language [10,30,18] and vision-language [35,22] modeling tasks. In the vision-language pre-training field, most mainstream approaches fall into one of two classes: single-encoder [40,28,37,7,29,51,13,20,23,27] and dual-encoder [35,22]. Typical single-encoder approaches focus on learning semantic alignments between image regions and text entities with a single backbone network, greatly benefiting various downstream multi-modal tasks, e.g., VQA [1,50,14], VCR [48] and NLVR [38,39], etc.. In real-scenario applications [34], dual-encoder pre-training approach could be preferable for its flexibility. For one thing, downstream tasks of either modality can benefit from the pre-training. For another, dual-encoder approaches are more efficient than single-encoder approaches on popular multi-modal industrial applications, e.g., cross-modal matching and retrieval tasks [4,21].
|
| 18 |
+
|
| 19 |
+
<table><tr><td rowspan="2">method</td><td colspan="2">computation</td><td rowspan="2">data</td><td colspan="2">MS-COCO</td><td colspan="2">F30K</td></tr><tr><td>device</td><td>count</td><td>zs.</td><td>ft.</td><td>zs.</td><td>ft.</td></tr><tr><td>CLIP [35]</td><td>V100</td><td>256</td><td>400M</td><td>400.2</td><td>-</td><td>540.6</td><td>-</td></tr><tr><td>ALIGN [22]</td><td>TPUv3</td><td>1,024</td><td>1800M</td><td>425.3</td><td>500.4</td><td>553.3</td><td>576.0</td></tr><tr><td>baseline</td><td>V100</td><td>8</td><td>14.2M</td><td>371.6</td><td>471.9</td><td>483.3</td><td>553.0</td></tr><tr><td>ZeroVL</td><td>V100</td><td>8</td><td>14.2M</td><td>425.0</td><td>485.0</td><td>536.2</td><td>561.6</td></tr><tr><td>ZeroVL†</td><td>V100</td><td>8</td><td>100M</td><td>442.1</td><td>500.5</td><td>546.5</td><td>573.6</td></tr></table>
|
| 20 |
+
|
| 21 |
+
Table 1. Statistics of training resources and cross-modal retrieval RSUM scores [4,43,3]. "zs." and "ft." represent zero-shot and fine-tuned settings. "†" means pre-training with 100M web data.
|
| 22 |
+
|
| 23 |
+
Recent works [35,22] have demonstrated that, by aligning visual and language representations with the contrastive loss, a simple dual-encoder architecture is able to yield state-of-the-art representation learning performances. However, we notice a significant problem which might obstruct the progress in this research direction, i.e., pioneering works require a tremendous amount of vision-linguistic corpus and computational resources for training, and such heavy resource dependency prevents researchers with limited resources from reproduction and further explorations. For instance, CLIP [35] and ALIGN [22] respectively collected 400M and 1.8B web image-text pairs and trained models with 256 V100 GPUs and 1,024 TPU cores. Such experimental environments present a big challenge for the most researchers, and further lead to a lack of commonly reproducible benchmarks for dual-encoder model, making it hard to validate novel methods.
|
| 24 |
+
|
| 25 |
+
To alleviate the problems above, we design a comprehensive training pipeline with only open-source academic datasets and limited computational resources. Specifically, we propose a collection of novel methods to deal with limited data and computation, respectively. Our proposed methods boost model performances while only introducing marginal overhead to both computation and implementation. As shown in Table 1, we achieve competitive results with $\sim 14\mathrm{M}$ academic data and 8 V100 GPUs, greatly alleviating the heavy dependency on data and computation of contrastive language-image pre-training. To further demonstrate the effectiveness of our method on large-scale data, we collect 100M web image-text images and conduct pre-training without fine-tuning hyper-parameters. Surprisingly, our method successfully outperforms CLIP and achieves comparable results with ALIGN on pre-training and fine-tuning tasks.
|
| 26 |
+
|
| 27 |
+
# 2 A Naive Baseline
|
| 28 |
+
|
| 29 |
+
In this section, we build up a naive baseline for stacking our methods and polishing it to a strong one. Methods are related to training with limited data and training with limited computation resource, which will be discussed in Sec. 3 and 4.
|
| 30 |
+
|
| 31 |
+
# 2.1 Pre-Training Datasets
|
| 32 |
+
|
| 33 |
+
To ensure reproducibility, only publicly accessible academic datasets are leveraged to demonstrate the effectiveness of our methods. The statistics of collected image-text pair datasets are reported in Table 2. Four widely-used image-text pair
|
| 34 |
+
|
| 35 |
+
<table><tr><td rowspan="2"></td><td colspan="5">Pre-training</td><td colspan="2">Test</td></tr><tr><td>Total</td><td>SBU</td><td>VG</td><td>CC3M</td><td>CC12M</td><td>MS-COCO</td><td>F30K</td></tr><tr><td>#image</td><td>14.23M</td><td>0.86M</td><td>0.50M</td><td>2.81M</td><td>10.06M</td><td>5K</td><td>1K</td></tr><tr><td>#text</td><td>14.23M</td><td>0.86M</td><td>0.50M</td><td>2.81M</td><td>10.06M</td><td>25K</td><td>5K</td></tr></table>
|
| 36 |
+
|
| 37 |
+
Table 2. The statistics of datasets for pre-training and test.
|
| 38 |
+
|
| 39 |
+
datasets are selected for pre-training, i.e., (1) SBU Captioned Photos (SBU) [33], (2) Visual Genome (VG) [25], (3) Conceptual Captions 3M (CC3M) [36], and (4) Conceptual 12M (CC12M) [2] datasets. Detailed introductions are attached in the appendix.
|
| 40 |
+
|
| 41 |
+
# 2.2 Baseline Settings
|
| 42 |
+
|
| 43 |
+
Baseline settings are elaborated from the data, model, and training perspectives.
|
| 44 |
+
|
| 45 |
+
Data preparation. Batches are comprised by randomly sampling image-text pairs from pre-training datasets. Following [35,22], each image is randomly cropped to a rectangular region with aspect ratio sampled in $[3/4, 4/3]$ and area sampled in $[60\%, 100\%]$ , then resized to $224 \times 224$ resolution. Regarding the corresponding text, we use a percentage of $20\%$ input words for processing. For each word, we mask it, replace it with a random word, or delete it with a probability of $50\%$ , $10\%$ and $40\%$ , respectively. During test, images are resized to $256 \times 256$ and center cropped to $224 \times 224$ , while no specific process is applied to texts.
|
| 46 |
+
|
| 47 |
+
Model architecture. Inspired by [35,22], we employ a simple dual-encoder model to align
|
| 48 |
+
|
| 49 |
+
visual and language representations of image-text pairs via a contrastive loss. The framework is illustrated in Figure 1. Image and text encoders are ViT-B/16 [11] and BERT-Base [10], respectively. [CLS] tokens from image and text encoders are extracted and then projected to compact embeddings for calculating the contrastive loss.
|
| 50 |
+
|
| 51 |
+
Training. AdamW [24,31] optimizer is used for training and the weight decay is 1e-3. The dual-encoder model is trained for 20 epochs on 8 Nvidia V100 GPUs with a batch size of 1,024. The learning rate is initialized to 1e-4 and follows a cosine decay schedule. Notably, we set a minimum learning rate 1e-5 to avoid over-fitting. The embedding dimension for image and text representations is 512 and the trainable temperature of contrastive loss is initialized to 0.02.
|
| 52 |
+
|
| 53 |
+

|
| 54 |
+
Fig.1. Illustration of the dual-encoder model architecture.
|
| 55 |
+
|
| 56 |
+
# 2.3 Evaluations
|
| 57 |
+
|
| 58 |
+
Metrics. Typically, multi-modal retrieval tasks are assessed with the recall at K (R@K) metric, with $\mathrm{K} = \{1,5,10\}$ . We follow [43,3,4] to use RSUM as the metric to reveal the overall performance, which is defined as the sum of recall metrics at $\mathrm{K} = \{1,5,10\}$ of both image-to-text and text-to-image retrieval tasks. Test datasets. Following the standard practice in [35,22,4,12,43,3], we evaluate representations of pre-trained models by carrying out zero-shot image-text retrieval tasks on test sets of (1) MS-COCO Captions Karpathy's split (MS-COCO) and (2) Flickr 30K (F30K) datasets. MS-COCO and F30K results are reported with 5K and 1K test images, respectively.
|
| 59 |
+
|
| 60 |
+
# 3 Training with Limited Data Resource
|
| 61 |
+
|
| 62 |
+
Due to the copyright or technical issues, publicly accessible image-text academic datasets are greatly limited. The common practice to construct vision-linguistic corpus is collecting datasets from multiple sources. However, it brings in the dataset bias issue, which is caused by different collection manners of these datasets. Besides, limited data could suffer from the over-fitting problem, and seldom efforts were made for creating extra data for multi-modal pre-training. In this section, we study how to take full advantages of limited data from these two perspectives, i.e., (1) leveraging biased data and (2) creating extra data.
|
| 63 |
+
|
| 64 |
+
# 3.1 Leveraging Biased Data with Debiased Sampling
|
| 65 |
+
|
| 66 |
+

|
| 67 |
+
Fig.3. Illustration of image and text embeddings.
|
| 68 |
+
|
| 69 |
+

|
| 70 |
+
Fig. 2. Illustration of sampling strategies.
|
| 71 |
+
|
| 72 |
+
Random sampling brings in dataset bias. Random sampling is an intuitive and widely used strategy, which randomly constructs training batches with all available data, as illustrated in Figure 2. However, when a batch is composed of
|
| 73 |
+
|
| 74 |
+
samples from different datasets, models could be driven to distinguish negative samples by hacking the source information, i.e., learning the dataset bias. For instance, dataset A is mainly composed of natural scenery photos with long captions, while dataset B is mainly comprised of people with short captions. To distinguish samples from A and B, models are allowed to remember the dataset bias on image contents and caption lengths. To prove this, we first carry out visualizations to show the biased distribution of representations learned by random sampling. Then, we delve into the gradient of InfoNCE loss and provide evidences that data bias influences the model optimization.
|
| 75 |
+
|
| 76 |
+
Dataset bias leads to biased representation distributions. In the upper part of Figure 3, we visualize image and text embeddings learned with random sampling. Intra-dataset representations are closely gathered, while inter-dataset representations are separated. Representations are separated to three parts, i.e., VG, SBU and "CC3M+CC12M". Since CC3M and CC12M are composed of similar image-text pairs, representations of CC3M and CC12M are slightly overlapped. It demonstrates that the model is driven to separate representations from different datasets, and, within a training batch, the model will easily distinguish negative samples.
|
| 77 |
+
|
| 78 |
+
Dataset bias influences the optimization of InfoNCE. Since the dual-encoder model is optimized by InfoNCE loss, we first formulate the loss function and its gradient for further explorations:
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\mathcal {L} = \sum_ {j} \sum_ {k} y _ {j k} \log \left(\frac {\exp (s _ {j k})}{\sum_ {l} \exp (s _ {j l})}\right), \nabla_ {\theta} \mathcal {L} = - \sum_ {j} \sum_ {k} y _ {j k} \nabla_ {\theta} \log \left(\frac {\exp (s _ {j k})}{\sum_ {l} \exp (s _ {j l})}\right), \tag {1}
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
where the similarity between the query $j$ and the key $k$ as $s_{jk}$ . The ground-truth label corresponding to $s_{jk}$ is represented by $y_{jk} \in \{0,1\}$ . We omit the temperature parameter for simplification. Then, we derive the gradient item as:
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\begin{array}{l} \nabla_ {\theta} \mathcal {L} = \sum_ {j} \sum_ {k} \left(\frac {\exp (s _ {j k})}{\sum_ {l} \exp (s _ {j l})} - y _ {j k}\right) \nabla_ {\theta} s _ {j k} \tag {2} \\ = \sum_ {j} \sum_ {k} \left(\bar {p} _ {j k} - y _ {j k}\right) \nabla_ {\theta} s _ {j k} \\ \end{array}
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
where we could observe that the gradient term is related to the stop-gradient term $\bar{p}_{jk}$ , which reflects the similarities among training samples. Negative pairs are essential for self-supervised learning methods which are based on the InfoNCE loss [32]. However, as suggested in Figure 3, dataset bias makes the model easily separate negative samples from different data sources, resulting in the small $\bar{p}_{jk}$ and inferior gradient for negative pairs. Thus, the effectiveness of negative samples are damaged in the optimization process, especially for significant hard examples.
|
| 91 |
+
|
| 92 |
+
Debiased sampling. Knowledge of the dataset bias is not beneficial for downstream tasks and can be even harmful for learning essential semantic concepts. To tackle the dataset bias issue, the key factor is forcing the model to focus on helpful knowledge instead of the dataset bias. Inspired by this, we propose the debiased sampling strategy, as illustrated in Figure 2. Debiased sampling ensures
|
| 93 |
+
|
| 94 |
+
instances within each batch come from the same dataset. For example, the first batch consists of samples from only SBU, and the second batch is composed of samples of only CC3M. Under this regularization, models are not allowed to hack the optimization by remembering the dataset bias. As shown in Figure 3, the biased distributions of representations are significantly alleviated by our method, especially on the text modality. Besides, as shown in Figure 4, it could be observed that training with debiased sampling yields larger $\bar{p}_{jk}$ of negative pairs (on all datasets) than random sampling, i.e., debiased sampling successfully increases the effectiveness of negative samples. Figure 4 suggests that samples in smaller datasets could suffer from less effective gradient of negative samples, and our method alleviates this problem by increasing gradient of negative samples, especially for small datasets (i.e., VG and SBU). Moreover, downstream results are remarkably improved by the debiased sampling, which will be discussed later.
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
Fig. 4. $\log (\bar{p}_{jk})$ averaged over negative pairs on different datasets and scales. The larger value contributes to the larger gradient of negative samples.
|
| 98 |
+
|
| 99 |
+
# 3.2 Creating Extra Data with Coin Flipping Mixup
|
| 100 |
+
|
| 101 |
+
Intuitively, data augmentation is a ubiquitous method to create extra training data. With limited data resources, the augmentation plays an important role in boosting performances. This part introduces a novel data augmentation method, which bring in little computational complexity but remarkably improve model performance.
|
| 102 |
+
|
| 103 |
+
Coin flipping mixup. To the best of our knowledge, mixup [49,42,47,15,26] are seldom investigated in the vision-language pre-training task. In this part, we first formulate the common mixup strategy in the dual-encoder training scheme, and reveal the label assignment dilemma when calculating contrastive loss. To solve this dilemma, we further propose a novel coin flipping mixup.
|
| 104 |
+
|
| 105 |
+
(1) Formulations and the label assignment dilemma. We follow the previous works [49,15] by applying instance-level mixup. Given a batch of N image-text pairs, the image and text of the $j$ -th pair are denoted by $I_{j}$ and $T_{j}$ , respectively. Instead of randomly mixing image-text pairs within the batch, we leverage a more efficient mixing operation for easy implementations:
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\begin{array}{l} \tilde {I} _ {j} = \lambda * I _ {j} + (1 - \lambda) * I _ {N - j}, \\ \tilde {\bar {z}} = \bar {z} - \bar {z} (t - t _ {0}) - \bar {z}. \end{array} \tag {3}
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\tilde {T} _ {j} = \lambda * T _ {j} + (1 - \lambda) * T _ {N - j},
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
where $\tilde{I}_j$ and $\tilde{T}_j$ denote the $j$ -th mixed image and text. $\lambda$ is sampled from the distribution $Beta(\alpha, \alpha)$ . Therefore, the training batch after the mixing operation could be denoted by $\{(\tilde{I}_1, \tilde{T}_1), (\tilde{I}_2, \tilde{T}_2), \ldots, (\tilde{I}_N, \tilde{T}_N)\}$ . However, we will encounter a label assignment dilemma. For instance, both $(\tilde{I}_j, \tilde{T}_j)$ and $(\tilde{I}_{N - j}, \tilde{T}_{N - j})$ are contained in the batch but interpolated by the same instances. It is not feasible to measure the target matching score between $\tilde{I}_j$ and $\tilde{T}_{N - j}$ . Particularly, the $\tilde{I}_j$ and $\tilde{T}_{N - j}$ are written as:
|
| 116 |
+
|
| 117 |
+
$$
|
| 118 |
+
\tilde {I} _ {j} = \lambda * I _ {j} + (1 - \lambda) * I _ {N - j},
|
| 119 |
+
$$
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\tilde {T} _ {N - j} = (1 - \lambda) * T _ {j} + \lambda * T _ {N - j}, \tag {4}
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
where the similarity between $\lambda * I_{j}$ and $(1 - \lambda)*T_{j}$ is not measurable based on the prior knowledge of mixup [49].
|
| 126 |
+
|
| 127 |
+
(2) Coin flipping mixup. To tackle the above problem, we propose the coin flipping mixup strategy. Briefly, mixup is applied on one of the multiple modals in each training batch, avoiding the above label assignment dilemma. In our implementation, by uniformly sampling $\gamma$ from the range [0, 1], we enable the mixup on image modal if $\gamma > 0.5$ , otherwise text modal. Interestingly, as shown in Figure 5, the strategy is similar to the coin flipping decision-making procedure, from which its name derives.
|
| 128 |
+
|
| 129 |
+
We briefly formulate the learning objective of coin flipping mixup, assuming $\gamma > 0.5$ and the mixup on image modal is enabled. In literature [35,22], the contrastive loss could be disentangled to image-to-text and
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Fig. 5. Illustration of our proposed coin flipping mixup. Note that manifold mixup is applied on the text modality, since we empirically observe that interpolating sparse word embeddings could lead to significant performance drop.
|
| 133 |
+
|
| 134 |
+
text-to-image matching parts. Correspondingly, the mixup contrastive loss of image-to-text matching is written as:
|
| 135 |
+
|
| 136 |
+
$$
|
| 137 |
+
\begin{array}{l} \mathcal {L} _ {\tilde {I} 2 T} = \lambda * \left(- \frac {1}{N} \sum_ {j = 1} ^ {N} \log \frac {\exp \left(\tilde {i _ {j}} \cdot t _ {j}\right)}{\sum_ {k = 1} ^ {N} \exp \left(\tilde {i _ {j}} \cdot t _ {k}\right)}\right) \tag {5} \\ + (1 - \lambda) * \left(- \frac {1}{N} \sum_ {j = 1} ^ {N} \log \frac {\exp (\tilde {i _ {j}} \cdot t _ {N - j})}{\sum_ {k = 0} ^ {N - 1} \exp (\tilde {i _ {j}} \cdot t _ {N - k})}\right), \\ \end{array}
|
| 138 |
+
$$
|
| 139 |
+
|
| 140 |
+
where $\tilde{i}_j$ and $t_j$ respectively denote representations of the mixed image $\tilde{I}_j$ and the non-mixed text $T_{j}$ . The text-to-image matching part shares similar formulations.
|
| 141 |
+
|
| 142 |
+
# 3.3 Experiment Results and Discussions
|
| 143 |
+
|
| 144 |
+
Main results of debiased sampling and coin flipping mixup are reported in Table 3. Overall speaking, both methods benefit performances on both F30K and MS-COCO. Note that these experiments only involve 14M academic data. Stacking
|
| 145 |
+
|
| 146 |
+
these methods jointly contributes to $+31.2$ and $+35.9$ RSUM improvements on F30K and MS-COCO, respectively. Undoubtedly, properly leveraging limited data is of vital importance, and our methods are beneficial.
|
| 147 |
+
|
| 148 |
+
<table><tr><td rowspan="2"></td><td colspan="5">MS-COCO (5K test set)</td><td colspan="5">Flickr30K (1K test set)</td></tr><tr><td colspan="2">I → T</td><td colspan="3">T → I</td><td colspan="2">I → T</td><td colspan="3">T → I</td></tr><tr><td></td><td>R@1</td><td>R@10</td><td>R@1</td><td>R@10</td><td>RSUM</td><td>R@1</td><td>R@10</td><td>R@1</td><td>R@10</td><td>RSUM</td></tr><tr><td>baseline</td><td>45.9</td><td>82.8</td><td>35.0</td><td>73.1</td><td>371.6</td><td>66.0</td><td>95.1</td><td>58.6</td><td>90.6</td><td>483.3</td></tr><tr><td>+ debiased sampling</td><td>53.2</td><td>86.4</td><td>36.7</td><td>74.1</td><td>392.3</td><td>78.8</td><td>98.2</td><td>61.2</td><td>91.9</td><td>510.1</td></tr><tr><td>+ coin flipping mixup</td><td>53.0</td><td>87.6</td><td>39.6</td><td>76.5</td><td>402.8</td><td>80.1</td><td>98.4</td><td>63.7</td><td>93.1</td><td>519.2</td></tr></table>
|
| 149 |
+
|
| 150 |
+
Table 3. Results of stacking methods for training with limited data resource.
|
| 151 |
+
|
| 152 |
+
Effect of debiased sampling. Compared to the baseline, debiased sampling achieves consistent and remarkable improvements on all metrics, without any extra computational costs and hyper-parameters. It validates the effectiveness of our proposed debiased sampling, and debiased learning is a potential research direction in the contrastive language-image pre-training field.
|
| 153 |
+
|
| 154 |
+
Effect of coin flipping mixup. We set the alpha value of the beta distribution to 0.1, then apply input mixup on image modal and manifold mixup on text modal. Noticeable promotions are contributed by the coin flipping mixup, especially on text-to-image (T2I) metrics, i.e., text-to-image Recall@1 on F30K and MS-COCO are improved by +2.5 and +2.9.
|
| 155 |
+
|
| 156 |
+
Empirical observations on data augmentation. (1) The cropping area of RandomResizeCrop should be in a relatively large range for covering main objects. (2) AutoAugment [8] brings in satisfactory improvements but little computational overhead. (3) Randomly masking input words advances the model performance with no cost.
|
| 157 |
+
|
| 158 |
+
# 4 Training with Limited Computational Resource
|
| 159 |
+
|
| 160 |
+
In contrastive self-supervised learning [5,6], distributed large-batch training has become a standard practice, for increasing the training batch size and providing enough negative samples. Firstly, we demonstrate the remarkable benefits of distributed large-batch training in the multi-modal pre-training task; however, it relies on considerable computational resources (e.g., training our model with 16,384 batch size needs 128 V100 GPUs). Then, to tackle this problem, we study how to achieve comparable results with limited computational resources (e.g., 8 V100 GPUs) by proposing the decoupled gradient accumulation. Lastly, we discuss how to accelerate the training.
|
| 161 |
+
|
| 162 |
+
# 4.1 Large-Batch Training with Decoupled Gradient Accumulation
|
| 163 |
+
|
| 164 |
+
Benefits of large-batch distributed training. In the practical implementation of distributed InfoNCE loss, gather operations are frequently used to collect negative samples across machines. In multi-modal scenario, the InfoNCE loss
|
| 165 |
+
|
| 166 |
+
<table><tr><td rowspan="2"></td><td colspan="5">MS-COCO (5K test set)</td><td colspan="5">Flickr30K (1K test set)</td></tr><tr><td colspan="2">I → T</td><td colspan="3">T → I</td><td colspan="2">I → T</td><td colspan="3">T → I</td></tr><tr><td></td><td>R@1</td><td>R@10</td><td>R@1</td><td>R@10</td><td>RSUM</td><td>R@1</td><td>R@10</td><td>R@1</td><td>R@10</td><td>RSUM</td></tr><tr><td>baseline + data</td><td>53.0</td><td>87.6</td><td>39.6</td><td>76.5</td><td>402.8</td><td>80.1</td><td>98.4</td><td>63.7</td><td>93.1</td><td>519.2</td></tr><tr><td>+ gradient reserved gather</td><td>55.4</td><td>88.7</td><td>42.0</td><td>78.7</td><td>415.0</td><td>81.4</td><td>98.2</td><td>66.2</td><td>93.7</td><td>524.1</td></tr><tr><td>+ batch = 2,048</td><td>56.4</td><td>88.5</td><td>42.7</td><td>79.2</td><td>418.0</td><td>81.5</td><td>98.6</td><td>68.2</td><td>93.7</td><td>527.5</td></tr><tr><td>+ batch = 4,096</td><td>58.9</td><td>89.9</td><td>43.8</td><td>79.6</td><td>425.9</td><td>82.7</td><td>98.6</td><td>68.7</td><td>94.5</td><td>531.7</td></tr><tr><td>+ batch = 8,192</td><td>59.0</td><td>89.5</td><td>43.7</td><td>79.5</td><td>424.4</td><td>83.1</td><td>98.7</td><td>68.5</td><td>94.6</td><td>531.8</td></tr><tr><td>+ batch = 16,384</td><td>59.3</td><td>89.6</td><td>44.1</td><td>70.4</td><td>425.0</td><td>85.5</td><td>98.5</td><td>69.8</td><td>94.5</td><td>536.2</td></tr></table>
|
| 167 |
+
|
| 168 |
+
Table 4. Results of distributed large-batch training. "baseline + data" denotes the result of stacking methods proposed in Sec. 3.
|
| 169 |
+
|
| 170 |
+
could be separated into image-to-text (I2T) and text-to-image (T2I) matching parts. Similar to Eqn. (2), the gradient of the I2T part is as followed 4:
|
| 171 |
+
|
| 172 |
+
$$
|
| 173 |
+
\nabla_ {\theta} \mathcal {L} ^ {I 2 T} = \sum_ {j} \sum_ {k} \left(\bar {p} _ {j k} ^ {I 2 T} - y _ {j k} ^ {I 2 T}\right) \left(\bar {i} _ {j} \nabla_ {\theta} t _ {k} + \bar {t} _ {k} \nabla_ {\theta} i _ {j}\right), \tag {6}
|
| 174 |
+
$$
|
| 175 |
+
|
| 176 |
+
where we place a vinculum on a value to indicate its gradient is detached. For a pair $(i_j, t_k)$ from different machines, gather operations with detaching gradients would produce the following wrong gradient on the machine of sample $j$ :
|
| 177 |
+
|
| 178 |
+
$$
|
| 179 |
+
\tilde {\nabla} _ {\theta} \mathcal {L} _ {i j} ^ {I 2 T} = \left(\tilde {p} _ {j k} ^ {I 2 T} - y _ {j k} ^ {I 2 T}\right) \bar {t} _ {k} \nabla_ {\theta} i _ {j}. \tag {7}
|
| 180 |
+
$$
|
| 181 |
+
|
| 182 |
+
Therefore, preserving gradients of gathered embeddings would provide valuable gradients. As reported in Table 4, by preserving gradients of gathered embeddings, noticeable gains are achieved within expectations. Concretely, $+4.9$ RSUM on F30K and $+12.2$ RSUM on MS-COCO are contributed by the gradient reversed gather, further supporting our derivations.
|
| 183 |
+
|
| 184 |
+
Previous works have demonstrated that self-supervised contrastive learning could significantly benefit from the large training batch size, which provides more negative examples to facilitate the model convergence [5]. To further analyze the impact of varying batch sizes on multi-modal contrastive pre-training, we scale the batch size from 1,024 to 16,384 and keep training epochs consistent. Besides, previous works [5,17] empirically showed that linearly scaling the initial learning rate is necessary for large-batch training. Regarding large batch experiments, up to 128 Nvidia V100 GPUs are used. As shown in Table 4, increasing the batch size from 1,024 to 16,384 leads to significant improvements on all evaluated metrics, indicating the vital importance of large-batch training. However, substantial computational resources are used for containing large batches.
|
| 185 |
+
|
| 186 |
+
Decoupled gradient accumulation. A common strategy to mimic large-batch training is the multi-step gradient accumulation. Concretely, a training iteration of a large batch is divided into several sub-iterations, and, in each sub-iteration, the batch size is relatively small. Gradients of multiple sub-iterations are individually calculated, accumulated and jointly back-propagated. It is a practical strategy in deep learning tasks; however, to mimic the large batch InfoNCE loss, the calculation process unavoidably involves embeddings from
|
| 187 |
+
|
| 188 |
+
different training sub-iterations, which are, unfortunately, not accessible across sub-iterations. Therefore, the conventional multi-step gradient accumulation is not able to enlarge the effective batch size, greatly limiting final model performances.
|
| 189 |
+
|
| 190 |
+
We propose the decoupled gradient accumulation to make large-batch contrastive learning feasible for limited resources. According to Eqn. (6), we mathematically decouple the gradient of a large batch into two parts:
|
| 191 |
+
|
| 192 |
+
$$
|
| 193 |
+
\begin{array}{l} \nabla_ {\theta} \mathcal {L} = \nabla_ {\theta} \mathcal {L} ^ {I 2 T} + \nabla_ {\theta} \mathcal {L} ^ {T 2 I} \\ = \sum_ {j} \nabla_ {\theta} \underbrace {\left(\sum_ {k} \left(\bar {p} _ {j k} ^ {I 2 T} - y _ {j k} ^ {I 2 T} + \bar {p} _ {k j} ^ {T 2 I} - y _ {k j} ^ {T 2 I}\right) \bar {t} _ {k}\right)} _ {\text {s t o p - g r a d i e n t p a r t}} i _ {j} \tag {8} \\ + \sum_ {k} \nabla_ {\theta} \underbrace {\left(\sum_ {j} \left(\bar {p} _ {j k} ^ {I 2 T} - y _ {j k} ^ {I 2 T} + \bar {p} _ {k j} ^ {T 2 I} - y _ {k j} ^ {T 2 I}\right) \bar {i} _ {j}\right)} _ {\text {s t o p - g r a d i e n t p a r t}} t _ {k}, \\ \end{array}
|
| 194 |
+
$$
|
| 195 |
+
|
| 196 |
+
where one part of gradient is only related to embeddings within each sub-iteration, and the other part only depends on stop-gradient embeddings of the large batch, which can be obtained by forwarding the large batch for an extra time. In this manner, we are allowed to take advantages of the large batch size by sacrificing training time.
|
| 197 |
+
|
| 198 |
+
As reported in Table 5, it empirically shows that, by sacrificing extra $40\% - 50\%$ training time, our gradient accumulation successfully mimics large-batch training without damaging model performances. With 8 V100 GPUs, we are not allowed to train the model with batch sizes larger than 1,024, and thus achieved performances are relatively unsatisfactory. However, our method successfully allows us to train models with large effective batch sizes 8,192 and 16,384, achieving comparable RSUM scores with only 8 V100 GPUs.
|
| 199 |
+
|
| 200 |
+
<table><tr><td>batch</td><td>DGA step</td><td>effective batch</td><td># GPU</td><td>GPU time (hr)</td><td>MS-COCO RSUM</td><td>F30K RSUM</td></tr><tr><td>1,024</td><td>-</td><td>1,024</td><td>8</td><td>~430</td><td>415.0</td><td>524.1</td></tr><tr><td>8,192</td><td>-</td><td>8,192</td><td>64</td><td>-</td><td>424.4</td><td>531.8</td></tr><tr><td>16,384</td><td>-</td><td>16,384</td><td>128</td><td>-</td><td>425.0</td><td>536.2</td></tr><tr><td>1,024</td><td>8</td><td>8,192</td><td>8</td><td>~600</td><td>424.1</td><td>532.2</td></tr><tr><td>1,024</td><td>16</td><td>16,384</td><td>8</td><td>~680</td><td>425.2</td><td>535.9</td></tr></table>
|
| 201 |
+
|
| 202 |
+
Table 5. RSUM scores of decoupled gradient accumulation (DGA). For training with batch 8,192 and 16,384, 64 and 128 V100 GPUs are required, respectively.
|
| 203 |
+
|
| 204 |
+
Stable decoupled gradient accumulation. Note that encoders could contain modules of randomness, e.g., dropout layers are widely applied in the BERT [10]. Thus, forwarding the same sample two times could produce different embeddings. To this end, we set the identical random seed for twice forwarding processes, eliminating the randomness and stabilizing the training. In Table 6, we provide an ablation study related to the stable training. It demonstrates that significant
|
| 205 |
+
|
| 206 |
+
performance drops would be caused without considering the randomness. Forwarding the same sample for two times yields different embeddings results in the gradient in Eqn.(8) is wrongly calculated.
|
| 207 |
+
|
| 208 |
+
<table><tr><td>batch</td><td>DGA step</td><td>effective batch</td><td># GPU</td><td>stable</td><td>MS-COCO RSUM</td><td>F30K RSUM</td></tr><tr><td>1,024</td><td>16</td><td>16,384</td><td>8</td><td>✓</td><td>425.2</td><td>535.9</td></tr><tr><td>1,024</td><td>16</td><td>16,384</td><td>8</td><td>-</td><td>413.4</td><td>527.1</td></tr></table>
|
| 209 |
+
|
| 210 |
+
# 4.2 Fast Training with TokenDrop and Auxiliary Encoders
|
| 211 |
+
|
| 212 |
+
Thus far, all methods for better performances are elaborated. For real-scenario multi-modal applications, the training efficiency and model performance are equally significant for various deployment purposes. We introduce two methods on fast training for different purposes.
|
| 213 |
+
|
| 214 |
+
TokenDrop. Inspired by the recent work [16], we randomly drop a part of input pixels to speed-up the training of image encoders. Empirically, we observe that randomly masking $25\%$ input tokens of ViT introduces negligible performance drop, but considerably reduces training time. As shown in Table 7, enabling TokenDrop saves $\sim 30\%$ training time. Besides, training with TokenDrop compensates for the extra training time caused by DGA.
|
| 215 |
+
|
| 216 |
+
Table 6. Effects of stable training. “√” denotes setting the identical random seed for twice forwarding processes, and the achieved results correspond to Table 5.
|
| 217 |
+
|
| 218 |
+
<table><tr><td>batch</td><td>DGA step</td><td>Token Drop</td><td># GPU</td><td>GPU time (hr)</td><td>MS-COCO RSUM</td><td>F30K RSUM</td></tr><tr><td>1,024</td><td>16</td><td>-</td><td>8</td><td>~680</td><td>425.2</td><td>535.9</td></tr><tr><td>1,024</td><td>16</td><td>✓</td><td>8</td><td>~470</td><td>424.8</td><td>535.5</td></tr></table>
|
| 219 |
+
|
| 220 |
+
Table 7. Training time saved by TokenDrop.
|
| 221 |
+
|
| 222 |
+
Auxiliary Encoders. Assuming that we have trained a model with heavy encoders, we investigate how to fast obtain lightweight encoders with auxiliary heavy ones. Since the training of a dual-encoder model is driven by the InfoNCE loss, embeddings yielded by either encoder are regarded as the "learning target" of the other side. Thus, enlarging either encoder's capacity would contribute to more reliable and discriminative embeddings. Assuming that we have trained a dual-encoder model with heavy encoders, e.g., ViT-B/16 and BERT-Base, we can replace one of them to a lightweight one and re-train it with the guidance of the other one in a distillation manner [19,52]. For instance, we change the image encoder from ViT-B/16 to ViT-B/32, and then re-train it with the BERT-Base being frozen. With the guidance of the frozen encoder, the training process of the replaced encoder could be greatly accelerated, as reported in Table 8.
|
| 223 |
+
|
| 224 |
+
<table><tr><td>training method</td><td colspan="2">encoder</td><td>GPU time (hr)</td><td>MS-COCO RSUM</td><td>F30K RSUM</td></tr><tr><td rowspan="2">auxiliary</td><td>ViT-B/16</td><td>BERT-B</td><td>-</td><td>402.8</td><td>519.1</td></tr><tr><td>ViT-B/32</td><td>BERT-B♠</td><td>~110</td><td>381.2</td><td>493.9</td></tr><tr><td>baseline</td><td>ViT-B/32</td><td>BERT-B</td><td>~240</td><td>379.5</td><td>494.1</td></tr></table>
|
| 225 |
+
|
| 226 |
+
# 5 Comparisons with SOTA Methods
|
| 227 |
+
|
| 228 |
+
In this section, we focus on assessing the pre-training performances with cross-modal retrieval tasks, in both zero-shot and fine-tuned settings [35,22]. We name our method as "ZeroVL", where "Zero" means the motivation for designing a strong baseline with limited resources.
|
| 229 |
+
|
| 230 |
+
# 5.1 Zero-Shot Cross-Modal Retrieval
|
| 231 |
+
|
| 232 |
+
Table 8. Training time saved by the auxiliary encoder method. “♠” symbol denotes the model is frozen.
|
| 233 |
+
|
| 234 |
+
<table><tr><td rowspan="2"></td><td rowspan="2" colspan="2">computation device count</td><td rowspan="2">data</td><td rowspan="2">input size</td><td rowspan="2">batch size</td><td colspan="5">MS-COCO (5K test set)</td><td colspan="4">Flickr30K (1K test set)</td></tr><tr><td colspan="2">I → T</td><td colspan="3">T → I</td><td colspan="2">I → T</td><td colspan="2">T → I</td></tr><tr><td>zero-shot</td><td></td><td></td><td></td><td></td><td></td><td colspan="2">R@1 R@10</td><td colspan="2">R@1 R@10</td><td>RSUM</td><td colspan="2">R@1 R@10</td><td colspan="2">R@1 R@10</td></tr><tr><td>CLIP</td><td>V100</td><td>256</td><td>400M</td><td>336</td><td>32,768</td><td>58.4</td><td>88.1</td><td>37.8</td><td>72.2</td><td>400.2</td><td>88.0</td><td>99.4</td><td>68.7</td><td>95.2</td></tr><tr><td>ALIGN</td><td>TPUv3</td><td>1,024</td><td>1800M</td><td>289</td><td>16,384</td><td>58.6</td><td>89.7</td><td>45.6</td><td>78.6</td><td>425.3</td><td>88.6</td><td>99.7</td><td>75.7</td><td>96.8</td></tr><tr><td>baseline</td><td>V100</td><td>8</td><td>14M</td><td>224</td><td>1,024</td><td>45.9</td><td>82.8</td><td>35.0</td><td>73.1</td><td>371.6</td><td>66.0</td><td>95.1</td><td>58.6</td><td>90.6</td></tr><tr><td>CLIP (our impl.)</td><td>V100</td><td>8</td><td>14M</td><td>224</td><td>1,024</td><td>51.0</td><td>85.5</td><td>38.2</td><td>75.5</td><td>392.5</td><td>80.9</td><td>97.8</td><td>63.8</td><td>92.4</td></tr><tr><td>CLIP (our impl.)</td><td>V100</td><td>128</td><td>14M</td><td>224</td><td>16,384</td><td>57.7</td><td>88.7</td><td>41.6</td><td>77.8</td><td>416.0</td><td>83.1</td><td>98.3</td><td>67.2</td><td>93.9</td></tr><tr><td>ZeroVL (ours)</td><td>V100</td><td>8</td><td>14M</td><td>224</td><td>16,384</td><td>59.3</td><td>89.6</td><td>44.1</td><td>79.5</td><td>425.0</td><td>85.5</td><td>98.5</td><td>69.8</td><td>94.5</td></tr><tr><td>ZeroVL† (ours)</td><td>V100</td><td>8</td><td>100M</td><td>224</td><td>16,384</td><td>64.0</td><td>91.4</td><td>47.3</td><td>81.1</td><td>442.1</td><td>88.0</td><td>99.2</td><td>73.5</td><td>95.7</td></tr></table>
|
| 235 |
+
|
| 236 |
+
Table 9. Zero-shot cross-modal retrieval results. "baseline" is the naive baseline in Sec. 2. "†" means training with the 100M web data.
|
| 237 |
+
|
| 238 |
+
Setup. Training implementation details are as followed. On the ground of baseline settings (e.g., learning rate, training epoch, and weight decay) introduced in Sec. 2.2, we stack all proposed methods, i.e., debased sampling, coin flipping mixup, and decoupled gradient accumulation. For reproducibility, we mainly benchmark with publicly accessible academic datasets. For fair comparisons, we re-implement CLIP with 14M data to validate the performance drop caused by limited resources. Besides, CLIP and ALIGNN respectively collect 400M and 1.8B image-text pairs from the web. Due to training datasets of CLIP and ALIGNN are not available, we also collect $\sim 100\mathrm{M}$ web image-text pairs for validating the effectiveness of our method on large-scale data.
|
| 239 |
+
|
| 240 |
+
Main results. In Table 9, on both F30K and MS-COCO datasets, we achieve competitive results on the basis of 14M academic publicly accessible data and 8 V100 GPUs. It is worth mentioning that our ZeroVL already exceeds CLIP on the MS-COCO dataset in both image-to-text (I2T) and text-to-image (T2I) metrics, e.g., our I2T R@1 and T21 R@1 surpass CLIP by $+0.9$ and $+6.3$ , respectively. Results of our implemented CLIP further validate the contribution of our efforts, i.e., the performance of cross-modal retrieval would be greatly suppressed if the
|
| 241 |
+
|
| 242 |
+
resources were greatly limited. In addition, although our collected 100M web images are much less than those of CLIP and ALIGN, ZeroVL still successfully outperforms CLIP trained with 400M data and ALIGN trained with 1.8B data on MS-COCO. On F30K, we perform slightly worse than ALIGN but better than CLIP, which can result from the domain of ALIGN's data is larger than ours.
|
| 243 |
+
|
| 244 |
+
Resource costs. For computational resources, training CLIP requires 256 V100 GPUs, and training ALIGN needs 1,024 Could TPUv3 cores. Experiments in Table 9 involve 8 V100 32GB GPUs. For data resources, we mainly benchmark on 14M publicly accessible academic datasets to guarantee the reproducibility. Experiments of 100M web data demonstrate that our method is still effective on large-scale data, i.e., our method fits in different data scales without tuning hyperparameters. Additionally, only 2.4 days are required for training ZeroVL with 8 V100 and 14M academic data, which could be friendly to the most researchers.
|
| 245 |
+
|
| 246 |
+
# 5.2 Fine-Tuned Cross-Modal Retrieval
|
| 247 |
+
|
| 248 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">input size</td><td rowspan="2">encoder image (I) text (T)</td><td colspan="5">MS-COCO (5K test set)</td><td colspan="5">Flickr30K (1K test set)</td></tr><tr><td colspan="2">I → T</td><td colspan="3">T → I</td><td colspan="2">I → T</td><td colspan="3">T → I</td></tr><tr><td>fine-tuned</td><td></td><td></td><td>R@1</td><td>R@10</td><td>R@1</td><td>R@10</td><td>RSUM</td><td>R@1</td><td>R@10</td><td>R@1</td><td>R@10</td><td>RSUM</td></tr><tr><td>VSE++</td><td>512</td><td>RX101*</td><td>BERT-B</td><td>57.9</td><td>92.8</td><td>44.9</td><td>84.0</td><td>439.2</td><td>80.9</td><td>98.8</td><td>65.2</td><td>93.7</td></tr><tr><td>GPO</td><td>512</td><td>RX101*</td><td>BERT-B</td><td>68.1</td><td>95.2</td><td>52.7</td><td>88.3</td><td>474.8</td><td>88.7</td><td>99.8</td><td>76.1</td><td>97.1</td></tr><tr><td>ALIGN</td><td>289</td><td>EffNet-L2*</td><td>BERT-L</td><td>77.0</td><td>96.9</td><td>59.9</td><td>89.8</td><td>500.4</td><td>95.3</td><td>100.0</td><td>84.9</td><td>98.6</td></tr><tr><td>baseline</td><td>224</td><td>ViT-B/16</td><td>BERT-B</td><td>69.1</td><td>94.8</td><td>51.9</td><td>86.8</td><td>471.9</td><td>90.1</td><td>99.1</td><td>75.1</td><td>96.6</td></tr><tr><td>CLIP (our impl. 8V100)</td><td>224</td><td>ViT-B/16</td><td>BERT-B</td><td>69.9</td><td>94.9</td><td>52.5</td><td>87.0</td><td>473.8</td><td>90.4</td><td>99.2</td><td>75.6</td><td>96.5</td></tr><tr><td>CLIP (our impl. 128V100)</td><td>224</td><td>ViT-B/16</td><td>BERT-B</td><td>71.7</td><td>95.8</td><td>54.0</td><td>88.1</td><td>481.3</td><td>91.1</td><td>99.5</td><td>78.5</td><td>97.7</td></tr><tr><td>ZeroVL (ours)</td><td>224</td><td>ViT-B/16</td><td>BERT-B</td><td>72.9</td><td>95.9</td><td>55.1</td><td>88.6</td><td>485.0</td><td>91.7</td><td>99.5</td><td>79.2</td><td>97.1</td></tr><tr><td>ZeroVL† (ours)</td><td>288</td><td>ViT-B/16</td><td>BERT-B</td><td>77.2</td><td>97.1</td><td>59.3</td><td>90.2</td><td>500.5</td><td>95.0</td><td>100.0</td><td>83.7</td><td>98.6</td></tr></table>
|
| 249 |
+
|
| 250 |
+
Table 10. Fine-tuned cross-modal retrieval results of representative dual-encoder methods. "RX101*" correspond to the ResNeXt-101 model pre-trained on Instagram-1B [45]. "EffNet-L2*" denotes the large CNN model EfficientNet-L2 [41,44]. "†" denotes pre-training with the 100M web data.
|
| 251 |
+
|
| 252 |
+
Setup. After the pre-training phase, we fine-tune the model on downstream datasets F30K and MS-COCO. Fine-tuning hyper-parameters are identical to pre-training's, except the initial learning rate, training epoch, and batch size. The is learning rate is set to 1e-5. For F30K and MS-COCO, we optimize the model for 1K and 5K steps. Batch size is set to 2,048. Similar to zero-shot experiments, we also provide fine-tuning results with both 14M and 100M data.
|
| 253 |
+
|
| 254 |
+
Main results. In Table 10, with 14M academic pre-training data, we successfully outperforms state-of-the-art in-domain training method VSE++ [12] and GPO [4]. It is worth mentioning that GPO also involves large-scale pre-training on the image modal, i.e., weakly supervised pre-training with the Instagram-1B dataset [45]. Compared with GPO, ZeroVL can achieve better results with the more efficient image encoder and smaller training input size, strongly supporting the effectiveness of our pre-training method. For experiments with 100M web data, it is worth noting that ALIGN uses (1) significantly more pre-training data, (2) heavier image and text encoders, and (3) larger pre-training resolutions
|
| 255 |
+
|
| 256 |
+
than our method. Nevertheless, similar to results in zero-shot, we still achieve comparable results to ALIGN.
|
| 257 |
+
|
| 258 |
+
# 5.3 Linear Probing
|
| 259 |
+
|
| 260 |
+
<table><tr><td rowspan="2"></td><td colspan="5">pre-training</td><td colspan="3">linear probing</td></tr><tr><td colspan="2">computation device count</td><td>data</td><td>input size</td><td>batch size</td><td>backbone (#params)</td><td>input size</td><td>top-1 accuracy</td></tr><tr><td>CLIP</td><td>V100</td><td>256</td><td>400M</td><td>224</td><td>32,768</td><td>ViT-B/16 (87M)</td><td>224</td><td>80.2</td></tr><tr><td>ALIGN</td><td>TPUv3</td><td>1,024</td><td>1800M</td><td>289</td><td>16,384</td><td>EffNet-L2 (480M)</td><td>600</td><td>85.5</td></tr><tr><td>CLIP (our impl.)</td><td>V100</td><td>8</td><td>14M</td><td>224</td><td>1,024</td><td>ViT-B/16 (87M)</td><td>224</td><td>75.9</td></tr><tr><td>CLIP (our impl.)</td><td>V100</td><td>128</td><td>14M</td><td>224</td><td>16,384</td><td>ViT-B/16 (87M)</td><td>224</td><td>80.0</td></tr><tr><td>ZeroVL (ours)</td><td>V100</td><td>8</td><td>14M</td><td>224</td><td>16,384</td><td>ViT-B/16 (87M)</td><td>224</td><td>80.9</td></tr></table>
|
| 261 |
+
|
| 262 |
+
Table 11. Linear probing results on ImageNet-1K.
|
| 263 |
+
|
| 264 |
+
Setup. Following [35,22], we conduct the linear probing task on ImageNet-1K [9] after the pre-training phase. The batch size is set to 16,384 and learning rate is set to 6.4. We optimize the model for 90 epochs with the LARS optimizer [46], and weight decay is set to 0. To reveal the effects of our proposed methods on linear probing, we also evaluate the re-implemented CLIP as mentioned above. Main results. In Table 11, ZeroVL out-performs CLIP by $0.7\%$ . However, similar to fine-tuned cross-modal retrieval, ALIGN achieves better results than ZeroVL based on heavier pre-training costs, larger model capacity, and larger image resolutions. Moreover, there are two observations on re-implemented CLIP. Firstly, we observe that training with limited computation resource (8 V100) achieves unsatisfactory top-1 accuracy $75.9\%$ . Secondly, training CLIP with rich computation resource (128 V100) greatly improves the accuracy to $80.0\%$ . The differences between ZeroVL and re-implemented CLIP (with 128 V100) are methods proposed in Sec. 3, validating the effectiveness of our proposed debiased sampling and coin flipping mixup. Benefits of our methods for cutting down the heavy resources dependency are further confirmed.
|
| 265 |
+
|
| 266 |
+
# 6 Conclusion
|
| 267 |
+
|
| 268 |
+
This work provides a training guideline for conducting dual-encoder multi-modal representation contrastive learning with limited resources. The proposed methods significantly lower computational resources, while still achieving good performance to be applied in other vision-language downstream tasks. With only 14M publicly accessible academic datasets and 8 V100 GPUs, we provide a reproducible strong baseline. In addition, we achieve comparable or superior performances than state-of-the-art methods with 100M web data. We hope our training pipeline and benchmark will be useful for future researches in the multi-modal representation learning field and benefit the community.
|
| 269 |
+
|
| 270 |
+
# References
|
| 271 |
+
|
| 272 |
+
1. Antol, S., Agrawal, A., Lu, J., Mitchell, M., Batra, D., Zitnick, C.L., Parikh, D.: VQA: Visual Question Answering. In: ICCV (2015)
|
| 273 |
+
2. Changpinyo, S., Sharma, P., Ding, N., Soricut, R.: Conceptual 12M: Pushing web-scale image-text pre-training to recognize long-tail visual concepts. In: CVPR (2021)
|
| 274 |
+
3. Chen, H., Ding, G., Liu, X., Lin, Z., Liu, J., Han, J.: Imram: Iterative matching with recurrent attention memory for cross-modal image-text retrieval. In: CVPR (2020)
|
| 275 |
+
4. Chen, J., Hu, H., Wu, H., Jiang, Y., Wang, C.: Learning the best pooling strategy for visual semantic embedding. In: CVPR (2021)
|
| 276 |
+
5. Chen, T., Kornblith, S., Norouzi, M., Hinton, G.: A simple framework for contrastive learning of visual representations. In: ICML (2020)
|
| 277 |
+
6. Chen, T., Kornblith, S., Swersky, K., Norouzi, M., Hinton, G.: Big self-supervised models are strong semi-supervised learners. In: NeurIPS (2020)
|
| 278 |
+
7. Chen, Y.C., Li, L., Yu, L., El Kholy, A., Ahmed, F., Gan, Z., Cheng, Y., Liu, J.: UNITER: Universal image-text representation learning. In: ECCV (2020)
|
| 279 |
+
8. Cubuk, E.D., Zoph, B., Mane, D., Vasudevan, V., Le, Q.V.: AutoAugment: Learning augmentation strategies from data. In: CVPR (2019)
|
| 280 |
+
9. Deng, J., Dong, W., Socher, R., Li, L.J., Li, K., Fei-Fei, L.: Imagenet: A large-scale hierarchical image database. In: CVPR (2009)
|
| 281 |
+
0. Devlin, J., Chang, M.W., Lee, K., Toutanova, K.: BERT: Pre-training of deep bidirectional transformers for language understanding. arXiv:1810.04805 (2018)
|
| 282 |
+
1. Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., et al.: An image is worth 16x16 words: Transformers for image recognition at scale. In: ICLR (2021)
|
| 283 |
+
2. Faghri, F., Fleet, D.J., Kiros, J.R., Fidler, S.: VSE++: Improving visual-semantic embeddings with hard negatives. In: BMVC (2018)
|
| 284 |
+
3. Gan, Z., Chen, Y.C., Li, L., Zhu, C., Cheng, Y., Liu, J.: Large-scale adversarial training for vision-and-language representation learning. In: NeurIPS (2020)
|
| 285 |
+
4. Goyal, Y., Khot, T., Summers-Stay, D., Batra, D., Parikh, D.: Making the V in VQA matter: Elevating the role of image understanding in Visual Question Answering. In: CVPR (2017)
|
| 286 |
+
5. Guo, H., Mao, Y., Zhang, R.: Augmenting data with mixup for sentence classification: An empirical study. arXiv:1905.08941 (2019)
|
| 287 |
+
6. He, K., Chen, X., Xie, S., Li, Y., Dólar, P., Girshick, R.: Masked autoencoders are scalable vision learners. arXiv:2111.06377 (2021)
|
| 288 |
+
7. He, K., Fan, H., Wu, Y., Xie, S., Girshick, R.: Momentum contrast for unsupervised visual representation learning. In: CVPR (2020)
|
| 289 |
+
8. He, P., Liu, X., Gao, J., Chen, W.: Deberta: Decoding-enhanced bert with disentangled attention. In: ICLR (2021)
|
| 290 |
+
9. Hinton, G., Vinyals, O., Dean, J.: Distilling the knowledge in a neural network. arXiv:1503.02531 (2015)
|
| 291 |
+
20. Huang, Z., Zeng, Z., Huang, Y., Liu, B., Fu, D., Fu, J.: Seeing Out of tHe bOx: End-to-end pre-training for vision-language representation learning. In: CVPR (2021)
|
| 292 |
+
21. Jegou, H., Douze, M., Schmid, C.: Product quantization for nearest neighbor search. TPAMI (2010)
|
| 293 |
+
|
| 294 |
+
22. Jia, C., Yang, Y., Xia, Y., Chen, Y.T., Parekh, Z., Pham, H., Le, Q.V., Sung, Y., Li, Z., Duerig, T.: Scaling up visual and vision-language representation learning with noisy text supervision. In: ICML (2021)
|
| 295 |
+
23. Kim, W., Son, B., Kim, I.: ViLT: Vision-and-language transformer without convolution or region supervision. In: ICML (2021)
|
| 296 |
+
24. Kingma, D.P., Ba, J.: Adam: A method for stochastic optimization. In: ICLR (2015)
|
| 297 |
+
25. Krishna, R., Zhu, Y., Groth, O., Johnson, J., Hata, K., Kravitz, J., Chen, S., Kalantidis, Y., Li, L.J., Shamma, D.A., et al.: Visual Genome: Connecting language and vision using crowdsourced dense image annotations. In: IJCV (2017)
|
| 298 |
+
26. Lee, K., Zhu, Y., Sohn, K., Li, C.L., Shin, J., Lee, H.: i-mix: A domain-agnostic strategy for contrastive representation learning. In: ICLR (2021)
|
| 299 |
+
27. Li, J., Selvaraju, R.R., Gotmare, A.D., Joty, S., Xiong, C., Hoi, S.: Align before fuse: Vision and language representation learning with momentum distillation. In: NeurIPS (2021)
|
| 300 |
+
28. Li, L.H., Yatskar, M., Yin, D., Hsieh, C.J., Chang, K.W.: VisualBERT: A simple and performant baseline for vision and language. arXiv:1908.03557 (2019)
|
| 301 |
+
29. Li, X., Yin, X., Li, C., Zhang, P., Hu, X., Zhang, L., Wang, L., Hu, H., Dong, L., Wei, F., et al.: OSACR: Object-semantics aligned pre-training for vision-language tasks. In: ECCV (2020)
|
| 302 |
+
30. Liu, Y., Ott, M., Goyal, N., Du, J., Joshi, M., Chen, D., Levy, O., Lewis, M., Zettlemoyer, L., Stoyanov, V.: Roberta: A robustly optimized bert pretraining approach. arXiv:1907.11692 (2019)
|
| 303 |
+
31. Loshchilov, I., Hutter, F.: Decoupled weight decay regularization. In: ICLR (2019)
|
| 304 |
+
32. Oord, A.v.d., Li, Y., Vinyals, O.: Representation learning with contrastive predictive coding. arXiv:1807.03748 (2018)
|
| 305 |
+
33. Ordonez, V., Kulkarni, G., Berg, T.: Im2text: Describing images using 1 million captioned photographs. In: NeurIPS (2011)
|
| 306 |
+
34. Patashnik, O., Wu, Z., Shechtman, E., Cohen-Or, D., Lischinski, D.: StyleCLIP: Text-driven manipulation of stylegan imagery. In: ICCV (2021)
|
| 307 |
+
35. Radford, A., Kim, J.W., Hallacy, C., Ramesh, A., Goh, G., Agarwal, S., Sastry, G., Askell, A., Mishkin, P., Clark, J., et al.: Learning transferable visual models from natural language supervision. In: ICML (2021)
|
| 308 |
+
36. Sharma, P., Ding, N., Goodman, S., Soricut, R.: Conceptual Captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning. In: ACL (2018)
|
| 309 |
+
37. Su, W., Zhu, X., Cao, Y., Li, B., Lu, L., Wei, F., Dai, J.: VL-BERT: Pre-training of generic visual-linguistic representations. arXiv:1908.08530 (2019)
|
| 310 |
+
38. Suhr, A., Lewis, M., Yeh, J., Artzi, Y.: A corpus of natural language for visual reasoning. In: ACL (2017)
|
| 311 |
+
39. Suhr, A., Zhou, S., Zhang, A., Zhang, I., Bai, H., Artzi, Y.: A corpus for reasoning about natural language grounded in photographs. In: ACL (2019)
|
| 312 |
+
40. Sun, C., Myers, A., Vondrick, C., Murphy, K., Schmid, C.: VideoBERT: A joint model for video and language representation learning. In: ICCV (2019)
|
| 313 |
+
41. Tan, M., Le, Q.: Efficientnet: Rethinking model scaling for convolutional neural networks. In: ICML (2019)
|
| 314 |
+
42. Verma, V., Lamb, A., Beckham, C., Najafi, A., Mitliagkas, I., Lopez-Paz, D., Bengio, Y.: Manifold mixup: Better representations by interpolating hidden states. In: ICML (2019)
|
| 315 |
+
43. Wu, H., Mao, J., Zhang, Y., Jiang, Y., Li, L., Sun, W., Ma, W.Y.: Unified visual-semantic embeddings: Bridging vision and language with structured meaning representations. In: CVPR (2019)
|
| 316 |
+
|
| 317 |
+
44. Xie, Q., Luong, M.T., Hovy, E., Le, Q.V.: Self-training with noisy student improves imagenet classification. In: CVPR (2020)
|
| 318 |
+
45. Yaliniz, I.Z., Jégou, H., Chen, K., Paluri, M., Mahajan, D.: Billion-scale semi-supervised learning for image classification. arXiv:1905.00546 (2019)
|
| 319 |
+
46. You, Y., Gitman, I., Ginsburg, B.: Large batch training of convolutional networks. arXiv:1708.03888 (2017)
|
| 320 |
+
47. Yun, S., Han, D., Oh, S.J., Chun, S., Choe, J., Yoo, Y.: CutMix: Regularization strategy to train strong classifiers with localizable features. In: ICCV (2019)
|
| 321 |
+
48. Zellers, R., Bisk, Y., Farhadi, A., Choi, Y.: From recognition to cognition: Visual commonsense reasoning. In: CVPR (2019)
|
| 322 |
+
49. Zhang, H., Cisse, M., Dauphin, Y.N., Lopez-Paz, D.: Mixup: Beyond empirical risk minimization. In: ICLR (2018)
|
| 323 |
+
50. Zhang, P., Goyal, Y., Summers-Stay, D., Batra, D., Parikh, D.: Yin and Yang: Balancing and answering binary visual questions. In: CVPR (2016)
|
| 324 |
+
51. Zhang, P., Li, X., Hu, X., Yang, J., Zhang, L., Wang, L., Choi, Y., Gao, J.: VinVLA Revisiting visual representations in vision-language models. In: CVPR (2021)
|
| 325 |
+
52. Zhao, B., Cui, Q., Song, R., Qiu, Y., Liang, J.: Decoupled knowledge distillation In: CVPR (2022)
|
contrastivevisionlanguagepretrainingwithlimitedresources/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d3243baa9c0e267274a6de1cfd914c6ebaee241820a9350b343e47aca5f4df7b
|
| 3 |
+
size 526564
|
contrastivevisionlanguagepretrainingwithlimitedresources/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f4a4ce49a765418b0f796194190f4d23162712c7789276e33837048eeafa7078
|
| 3 |
+
size 389785
|
contributionsofshapetextureandcolorinvisualrecognition/f7c18fda-281b-44eb-8771-96b4ada85b30_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2a1d5be3e31a849a56ff82d5ada9b7fa6a5d276e237470b13ab12a2ddcdffa4c
|
| 3 |
+
size 78152
|
contributionsofshapetextureandcolorinvisualrecognition/f7c18fda-281b-44eb-8771-96b4ada85b30_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e5b606464809c7f03bf28bc0a0bb224d3213c6c15c9b0f55121dfbe4409d5f22
|
| 3 |
+
size 98782
|
contributionsofshapetextureandcolorinvisualrecognition/f7c18fda-281b-44eb-8771-96b4ada85b30_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:90ee872717c70f406b839d6568f96358a6058c3533a39bf78ebcadf439ec8d97
|
| 3 |
+
size 4214552
|
contributionsofshapetextureandcolorinvisualrecognition/full.md
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Contributions of Shape, Texture, and Color in Visual Recognition
|
| 2 |
+
|
| 3 |
+
Yunhao Ge*, Yao Xiao*, Zhi Xu, Xingrui Wang, and Laurent Itti
|
| 4 |
+
|
| 5 |
+
University of Southern California https://github.com/gyhandy/Humanoid-Vision-Engine
|
| 6 |
+
|
| 7 |
+
Abstract. We investigate the contributions of three important features of the human visual system (HVS) — shape, texture, and color — to object classification. We build a humanoid vision engine (HVE) that explicitly and separately computes shape, texture, and color features from images. The resulting feature vectors are then concatenated to support the final classification. We show that HVE can summarize and rank-order the contributions of the three features to object recognition. We use human experiments to confirm that both HVE and humans predominantly use some specific features to support the classification of specific classes (e.g., texture is the dominant feature to distinguish a zebra from other quadrupeds, both for humans and HVE). With the help of HVE, given any environment (dataset), we can summarize the most important features for the whole task (task-specific; e.g., color is the most important feature overall for classification with the CUB dataset), and for each class (class-specific; e.g., shape is the most important feature to recognize boats in the iLab-20M dataset). To demonstrate more usefulness of HVE, we use it to simulate the open-world zero-shot learning ability of humans with no attribute labeling. Finally, we show that HVE can also simulate human imagination ability with the combination of different features.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
The human vision system (HVS) is the gold standard for many current computer vision algorithms, on various challenging tasks: zero/few-shot learning [35,31,50,40,48], meta-learning [2,29], continual learning [43,52,57], novel view imagination [59,16], etc. Understanding the mechanism, function, and decision pipeline of HVS becomes more and more important. The vision systems of humans and other primates are highly differentiated. Although HVS provides us a unified image of the world around us, this picture has multiple facets or features, like shape, depth, motion, color, texture, etc. [15,22]. To understand the contributions of the most important three features — shape, texture, and color — in
|
| 12 |
+
|
| 13 |
+

|
| 14 |
+
Fig. 1: (a): Contributions of Shape, Texture, and Color may be different among different scenarios/tasks. Here, texture is most important to distinguish zebra from horse, but shape is most important for zebra vs. zebra car. (b): Humanoid Vision Engine takes dataset as input and summarizes how shape, texture, and color contribute to the given recognition task in a pure learning manner (E.g., In ImageNet classification, shape is the most discriminative feature and contributes most to visual recognition).
|
| 15 |
+
|
| 16 |
+
visual recognition, some research compares the HVS with an artificial convolutional Neural Network (CNN). A widely accepted intuition about the success of CNNs on perceptual tasks is that CNNs are the most predictive models for the human ventral stream object recognition [7,58]. To understand which feature is more important for CNN-based recognition, recent paper shows promising results: ImageNet-trained CNNs are biased towards texture while increasing shape bias improves accuracy and robustness [32].
|
| 17 |
+
|
| 18 |
+
Due to the superb success of HVS on various complex tasks [35,2,43,59,18], human bias may also represent the most efficient way to solve vision tasks. And it is likely task-dependent (Fig. 1). Here, inspired by HVS, we wish to find a general way to understand how shape, texture, and color contribute to a recognition task by pure data-driven learning. The summarized feature contribution is important both for the deep learning community (guide the design of accuracy-driven models [32,21,14,6]) and for the neuroscience community (understanding the contributions or biases in human visual recognition) [33,56].
|
| 19 |
+
|
| 20 |
+
It has been shown by neuroscientists that there are separate neural pathways to process these different visual features in primates [1,11]. Among the many kinds of features crucial to visual recognition in humans, the shape property is the one that we primarily rely on in static object recognition [15]. Meanwhile, some previous studies show that surface-based cues also play a key role in our vision system. For example, [20] shows that scene recognition is faster for color images compared with grayscale ones and [38,36] found a special region in our brain to analyze textures. In summary, [9,8] propose that shape, color and texture are three separate components to identify an object.
|
| 21 |
+
|
| 22 |
+
To better understand the task-dependent contributions of these features, we build a Humanoid Vision Engine (HVE) to simulate HVS by explicitly and separately computing shape, texture, and color features to support image classification in an objective learning pipeline. HVE has the following key contributions:
|
| 23 |
+
|
| 24 |
+
(1) Inspired by the specialist separation of the human brain on different features [1,11], for each feature among shape, texture, and color, we design a specific feature extraction pipeline and representation learning model. (2) To summarize the contribution of features by end-to-end learning, we design an interpretable humanoid Neural Network (HNN) that aggregates the learned representation of three features and achieves object recognition, while also showing the contribution of each feature during decision. (3) We use HVE to analyze the contribution of shape, texture, and color on three different tasks subsampled from ImageNet. We conduct human experiments on the same tasks and show that both HVE and humans predominantly use some specific features to support object recognition of specific classes. (4) We use HVE to explore the contribution, relationship, and interaction of shape, texture, and color in visual recognition. Given any environment (dataset), HVE can summarize the most important features (among shape, texture, and color) for the whole task (task-specific) and for each class (class-specific). To the best of our knowledge, we provide the first fully objective, data-driven, and indeed first-order, quantitative measure of the respective contributions. (5) HVE can help guide accuracy-driven model design and performs as an evaluation metric for model bias. For more applications, we use HVE to simulate the open-world zero-shot learning ability of humans which needs no attribute labels. HVE can also simulate human imagination ability across features.
|
| 25 |
+
|
| 26 |
+
# 2 Related Works
|
| 27 |
+
|
| 28 |
+
In recent years, more and more researchers focus on the interpretability and generalization of computer vision models like CNN [46,23] and vision transformer [12]. For CNN, many researchers try to explore what kind of information is most important for models to recognize objects. Some paper show that CNNs trained on the ImageNet are more sensitive to texture information [21,14,6]. But these works fail to quantitatively explain the contribution of shape, texture, color as different features, comprehensively in various datasets and situations. While most recent studies focus on the bias of Neural Networks, exploring the bias of humans or a humanoid learning manner is still under-explored and inspiring.
|
| 29 |
+
|
| 30 |
+
Besides, many researchers contribute to the generalization of computer vision models and focus on zero/few-shot learning [35,31,54,48,17,10], novel view imagination [59,16,19], open-world recognition [3,27,26], etc. Some of them tackled these problems by feature learning — representing an object by different features, and made significant progress in this area [53,37,59]. But, there still lacks a clear definition of what these properties look like or a uniform design of a system that can do humanoid tasks like generalized recognition and imagination.
|
| 31 |
+
|
| 32 |
+
# 3 Humanoid Vision Engine
|
| 33 |
+
|
| 34 |
+
The goal of the humanoid vision engine (HVE) is to summarize the contribution of shape, texture, and color in a given task (dataset) by separately computing the three features to support image classification, similar to humans' recognizing
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
Fig.2: Pipeline for humanoid vision engine (HVE). (a) shows how will humans' vision system deal with an image. After humans' eyes perceive the object, the different parts of the brain will be activated. The human brain will organize and summarize that information to get a conclusion. (b) shows how we design HVE to correspond to each part of the human's vision system.
|
| 38 |
+
|
| 39 |
+
objects. During the pipeline and model design, we borrow the findings of neuroscience on the structure, mechanism and function of HVS [1,11,15,20,38,36]. We use end-to-end learning with backpropagation to simulate the learning process of humans and to summarize the contribution of shape, texture, and color. The advantage of end-to-end training is that we can avoid human bias, which may influence the objective of contribution attribution (e.g., we avoid handcrafted elementary shapes as done in Recognition by Components [4]). We only use data-driven learning, a straightforward way to understand the contribution of each feature from an effectiveness perspective, and we can easily generalize HVE to different tasks (datasets). As shown in Fig. 2, HVE consists of (1) a humanoid image preprocessing pipeline, (2) feature representation for shape, texture, and color, and (3) a humanoid neural network that aggregates the representation of each feature and achieves interpretable object recognition.
|
| 40 |
+
|
| 41 |
+
# 3.1 Humanoid Image Preprocessing and Feature Extraction
|
| 42 |
+
|
| 43 |
+
As shown in Fig.2 (a), humans (or primates) can localize an object intuitively in a complex scene before we recognize what it is [28]. Also, there are different types of cells or receptors in our primary visual cortex extracting specific information (like color, shape, texture, shading, motion, etc) information from the image [15]. In our HVE (Fig. 2 (b)), for an input raw image $I \in \mathbb{R}^{H \times W \times C}$ , we first parse the object from the scene as preprocessing and then extract our defined shape, texture, and color features $I_{s}, I_{t}, I_{c}$ , for the following humanoid neural network.
|
| 44 |
+
|
| 45 |
+
Image Parsing and Foreground Identification. As shown in the preprocessing part of Fig.2 (b), we use the entity segmentation method [39] to simulate the process of parsing objects from a scene in our brain. Entity segmentation is
|
| 46 |
+
|
| 47 |
+
an open-world model and can segment the object from the image without labels. This method aligns with human behavior, which can (at least in some cases; e.g., autostereograms [28]) segment an object without deciding what it is. After we get the segmentation of the image, we use a pre-trained CNN and GradCam [45] to find the foreground object among all masks. (More details in appendix.)
|
| 48 |
+
|
| 49 |
+
We design three different feature extractors after identifying the foreground object segment: shape, texture, and color extractor, similar to the separate neural pathways in the human brain which focus on specific property [1,11]. The three extractors focus only on the corresponding features, and the extracted features, shape $I_{s}$ , texture $I_{t}$ , and color $I_{c}$ , are disentangled from each other.
|
| 50 |
+
|
| 51 |
+
Shape Feature Extractor For the shape extractor, we want to keep both 2D and 3D shape information while eliminating the information of texture and color. We first use a 3D depth prediction model [42,41] to obtain the 3D depth information of the whole image. After element-wise multiplying the 3D depth estimation and 2D mask of the object, we obtain our shape feature $I_{s}$ . We can notice that this feature only contains 2D shape and 3D structural information (the 3D depth) and without color or texture information (Fig. 2(b)).
|
| 52 |
+
|
| 53 |
+
Texture Feature Extractor In texture extractor, we want to keep both local and global texture information while eliminating shape and color information. Fig. 3 visualizes the extraction process. First, to remove the color information, we convert the RGB object segmentation to a grayscale image. Next, we cut this image into several square patches with an adaptive strategy (the patch size and location are adaptive with object sizes to cover more texture information). If the overlap ratio between the patch and the original 2D object segment is larger than a threshold $\tau$ , we add that patch to a patch pool (we set $\tau$ to be 0.99 in our experiments, which means the over $99\%$ of the area of the patch belongs to the object). Since we want to extract both local (one patch) and global (whole image) texture information, we randomly select 4 patches from the patch pool and concatenate them into a new texture image $(I_t)$ . (More details in appendix.)
|
| 54 |
+
|
| 55 |
+
Color Feature Extractor To represent the color feature for $I$ . We use phase scrambling, which is popular in psychophysics and in signal processing [34,51]. Phase scrambling transforms the image into the frequency domain using the fast Fourier transform (FFT). In the frequency domain, the phase of the signal is
|
| 56 |
+
|
| 57 |
+

|
| 58 |
+
Fig. 3: Pipeline for extracting texture feature: (a) Crop images and compute the overlap ratio between 2D mask and patches. Patches with overlap $>0.99$ are shown in a green shade. (b) add the valid patches to a patch pool. (c) randomly choose 4 patches from pool and concatenate them to obtain a texture image $I_{t}$ .
|
| 59 |
+
|
| 60 |
+
then randomly scrambled, which destroys shape information while preserving color statistics. Then we use IFFT to transfer back to image space and get $I_{c} \in \mathbb{R}^{H \times W \times C}$ . $I_{c}$ and $I$ have the same distribution of pixel color values (Fig. 2(b)).
|
| 61 |
+
|
| 62 |
+
# 3.2 Humanoid Neural Network
|
| 63 |
+
|
| 64 |
+
After preprocessing, we have three features, i.e. shape $I_{s}$ , texture $I_{t}$ , color $I_{c}$ of an input image $I$ . To simulate the separate neural pathways in humans' brains for different feature information [1,11], we design three feature representation encoders for shape, texture, and color, respectively. Shape feature encoder $E_{s}$ takes a 3D shape feature $I_{s}$ as input and outputs the shape representation $(V_{s} = E_{s}(I_{s}))$ . Similarly, texture encoder $E_{t}$ and color encoder $E_{c}$ take the texture patch image $I_{t}$ or color phase scrambled image $I_{c}$ as input, after embedded by $E_{t}$ (or $E_{c}$ ), we get the texture feature $V_{t}$ and color feature $V_{c}$ . We use ResNet-18 [23] as the backbone for all feature encoders to project the three types of features to the corresponding well-separated embedding spaces. It is hard to define the ground-truth label of the distance between features. Given that the objects from the same class are relatively consistent in shape, texture, and color, the encoders can be trained in the classification problem independently instead, with the supervision of class labels. After training our encoders as classifiers, the feature map of the last convolutional layer will serve as the final feature representation. To aggregate separated feature representations and conduct object recognition, we freeze the three encoders and train a contribution interpretable aggregation module Aggr $\theta$ , which is composed of two fully-connected layers (Fig. 2 (b) right). We concatenate $V_{s}, V_{t}, V_{c}$ and send it to Aggr $\theta$ . The output is denoted as $p \in \mathbb{R}^n$ , where $n$ is the number of classes. So we have $p = \mathrm{Aggr}_{\theta}(\mathrm{concat}(V_s, V_t, V_c))$ . (More details and exploration of our HNN are in appendix.)
|
| 65 |
+
|
| 66 |
+
We also propose a gradient-based contribution attribution method to interpret the contributions of shape, texture, and color to the classification decision, respectively. Take the shape feature as an example, given a prediction $p$ and the probability of class $k$ , namely $p^k$ , we compute the gradient of $p^k$ with respect to the shape feature $V^s$ . We define the gradient as shape importance weights $\alpha_s^k$ , i.e. $\alpha_s^k = \frac{\partial p^k}{\partial V_s}, \alpha_t^k = \frac{\partial p^k}{\partial V_t}, \alpha_c^k = \frac{\partial p^k}{\partial V_c}$ . Then we calculate element-wise product between $V_s$ and $\alpha_s^k$ to get the final shape contribution $S_s^k$ , i.e. $S_s^k = \mathrm{ReLU}\left(\sum \alpha_s^k V_s\right)$ . In other words, $S_s^k$ represents the "contribution" of shape feature to classifying this image as class $k$ . We can do the same thing to get texture contribution $S_t^k$ and color contribution $S_c^k$ . After getting the feature contributions for each image, we can calculate the average value of all images in this class to assign feature contributions to each class (class-specific bias) and the average value of all classes to assign feature contributions to the whole dataset (task-specific bias).
|
| 67 |
+
|
| 68 |
+
# 4 Experiments
|
| 69 |
+
|
| 70 |
+
In this section, we first show the effectiveness of feature encoders on representation learning (Sec. 4.1); then we show the contribution interpretation performance of Humanoid NN on different feature-biased datasets in ImageNet
|
| 71 |
+
|
| 72 |
+

|
| 73 |
+
Fig. 4: T-SNE results of feature encoders on their corresponding biased datasets
|
| 74 |
+
|
| 75 |
+
(Sec. 4.2); We use human experiments to confirm that both HVE and humans predominantly use some specific features to support the classification of specific classes (Sec. 4.3); Then we use HVE to summarize the contribution of shape, texture, and color on different datasets (CUB[55] and iLab-20M[5]) (Sec. 4.4).
|
| 76 |
+
|
| 77 |
+
# 4.1 Effectiveness of Feature Encoders
|
| 78 |
+
|
| 79 |
+
To show that our three feature encoders focus on embedding their corresponding sensitive features, we handcrafted three subsets of ImageNet [30]: shape-biased dataset $(D_{\mathrm{shape}})$ , texture-biased dataset $(D_{\mathrm{texture}})$ , and color-biased dataset $(D_{\mathrm{color}})$ . Shape-biased dataset containing 12 classes, where the classes were chosen which intuitively are strongly determined by shape (e.g., vehicles are defined by shape more than color). Texture-biased dataset uses 14 classes which we believed are more strongly determined by texture. Color-biased dataset includes 17 classes. The intuition of class selection of all three datasets will be verified by our results in Table 1 with further illustration in Sec. 4.2. All these datasets are randomly selected as around 800 training images and 200 testing images. The class details of biased datasets are shown in Fig. 4.
|
| 80 |
+
|
| 81 |
+
If our feature extractors actually learned their feature-constructive latent spaces, their T-SNE results will show clear clusters in the feature-biased datasets. "Bias" here means we can classify the objects based on the biased feature easily, but it is more difficult to make decisions based on the other two features.
|
| 82 |
+
|
| 83 |
+
After pre-processing the original images and getting their feature images, we input the feature images into feature encoders and get the T-SNE results shown in Fig. 4. Each row represents one feature-biased dataset and each column is bounded with one feature encoder, each image shows the results of one
|
| 84 |
+
|
| 85 |
+
Table 1: "Original" column means the accuracy of Resnet18 on the original images as our upper bound. Shape, texture and color columns represent the accuracy of feature nets. "all" means results of our HNN that combines the 3 feature nets. It approaches the upper bound, suggesting that the split into 3 feature nets preserved most information needed for image classification.
|
| 86 |
+
|
| 87 |
+
<table><tr><td>accuracy</td><td>original shape</td><td>texture color</td><td colspan="3">all</td></tr><tr><td>Shape biased dataset</td><td>97%</td><td>90%</td><td>84%</td><td>71%</td><td>95%</td></tr><tr><td>Texture biased dataset</td><td>96%</td><td>64%</td><td>81%</td><td>65%</td><td>91%</td></tr><tr><td>Color biased dataset</td><td>95%</td><td>70%</td><td>73%</td><td>82%</td><td>92%</td></tr></table>
|
| 88 |
+
|
| 89 |
+
combination. T-SNE results are separated perfectly on corresponding datasets (diagonal) but not as well on others' datasets (off-diagonal), which shows that our feature encoders are predominantly sensitive to the corresponding features.
|
| 90 |
+
|
| 91 |
+
# 4.2 Effectiveness of Humanoid Neural Network
|
| 92 |
+
|
| 93 |
+
We can use feature encoders to serve as classifiers after adding fully-connected layers. As these classifiers classify images based on corresponding feature representation, we call them feature nets. We tested the accuracy of feature nets on these three biased datasets. As shown in Table 1, a ResNet-18 trained on the original segmented images (without explicit separated features, e.g. Fig. 2 (b) tiger without background) provided an upper bound for the task. We find that feature net consistently obtains the best performance on their own biased dataset (e.g., on the shape-biased dataset, shape net classification performance is better than that of the color net or texture net). If we combine these three feature nets with the interpretable aggregation module, the classification accuracy is very close to the upper bound, which means our vision system can classify images based on these three features almost as well as based on the full original color images. This demonstrates that we can obtain most information of original images by our feature nets, and our aggregation and interpretable decision module actually learned how to combine those three features by end-to-end learning.
|
| 94 |
+
|
| 95 |
+
Table 2a shows the quantitative contribution summary results of Humanoid NN (Sec. 3.2). For task-specific bias, shape plays a dominant role in shape-biased tasks, and texture, color also contribute most to their related biased tasks.
|
| 96 |
+
|
| 97 |
+
# 4.3 Human Experiments
|
| 98 |
+
|
| 99 |
+
Intuitively, we expect that humans may rely on different features to classify different objects (Fig. 1). To show this, we designed human experiments that asked participants to classify reduced images with only shape, texture, or color features. If an object is mainly recognizable based on shape for humans, we could then check whether it is also the same for HVE, and also for color and texture.
|
| 100 |
+
|
| 101 |
+
Experiments Design Three datasets in Table. 1 have a clear bias towards corresponding features (Fig. 4). We asked the participants to classify objects in
|
| 102 |
+
|
| 103 |
+
(a) Contributions of features for different (b) Humans' accuracy of different feature biased datasets summarized by HVE. images on different biased datasets.
|
| 104 |
+
|
| 105 |
+
Table 2: Contributions of features from HVE and humans' recognition accuracy.
|
| 106 |
+
|
| 107 |
+
<table><tr><td>contribution ratio</td><td>shape</td><td>texture</td><td>color</td></tr><tr><td>Shape biased dataset</td><td>47%</td><td>34%</td><td>19%</td></tr><tr><td>Texture biased dataset</td><td>5%</td><td>65%</td><td>30%</td></tr><tr><td>Color biased dataset</td><td>11%</td><td>19%</td><td>70%</td></tr><tr><td>accuracy</td><td>shape</td><td>texture</td><td>color</td></tr><tr><td>Shape biased dataset</td><td>90.0%</td><td>49.0%</td><td>16.8%</td></tr><tr><td>Texture biased dataset</td><td>33.1%</td><td>40.0%</td><td>11.1%</td></tr><tr><td>Color biased dataset</td><td>32.3%</td><td>19.7%</td><td>46.5%</td></tr></table>
|
| 108 |
+
|
| 109 |
+
each dataset based on one single feature image computed by one of our feature extractors (Fig. 5). Participants were asked to choose the correct class label for the reduced image (from 12/14/17 classes in shape/texture/color datasets).
|
| 110 |
+
|
| 111 |
+
Human Performance Results The results here are based on 3270 trials, 109 participants. The accuracy for different feature questions on different biased datasets can be seen in Table 2b. Human performance is similar to our feature nets' performance (compare Table 1 with Table 2b). On shape-biased dataset, both human and feature nets attain the highest accuracy with shape. The same for the color and texture biased datasets. Both HVE and humans predominantly use some specific features to support recognition of specific classes. Interestingly, humans can perform not badly on all three biased datasets with shape features.
|
| 112 |
+
|
| 113 |
+
# 4.4 Contributions Attribution in Different Tasks
|
| 114 |
+
|
| 115 |
+
With our vision system, we can summarize the task-specific bias and class-specific bias for any dataset. This enables several applications: (1) Guide accuracy-driven model design [32,21,14,6]; Our method provides objective summarization of dataset bias. (2) Evaluation metric for model bias. Our method can help correct an initially wrong model bias on some datasets (e.g., that most CNN trained on ImageNet are texture biased [21,32]). (3) Substitute human intuition to obtain more objective summarization with end-to-end learning. We implemented
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Fig. 5: Sample question for the human experiment. (a) A test image (left) is first converted into shape, color, and texture images using our feature extractors. (b) On a given trial, human participants are presented with one shape, color, or texture image, along with 2 reference images for each class in the corresponding dataset (not shown here, see appendix. for a screenshot of an experiment trial). Participants are asked to guess the correct object class from the feature image.
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
(a) CUB dataset
|
| 122 |
+
|
| 123 |
+

|
| 124 |
+
(b) iLab-20M dataset
|
| 125 |
+
Fig. 6: Processed CUB and iLab-20M dataset examples
|
| 126 |
+
|
| 127 |
+
the biased summarization experiments on two datasets, CUB [55] and iLab-20M [5]. Fig. 1(b) shows the task-specific biased results. Since CUB is a dataset of birds, which means all the classes in CUB have a similar shape with feather textures, hence color may indeed be the most discriminative feature (Fig. 6 (a)).
|
| 128 |
+
|
| 129 |
+
As for iLab (Fig. 6 (b)), we also conduct the class-specific biased experiments on iLab and summarize the class biases in Table 3. It is interesting to find that the dominant feature is different for different classes. For instance, boat is shape-biased while military vehicle (mil) is color-biased. (More examples in appendix.)
|
| 130 |
+
|
| 131 |
+
# 5 More Humanoid Applications with HVE
|
| 132 |
+
|
| 133 |
+
To further explore more applications with HVE, we use HVE to simulate the visual reasoning process of humans and propose a new solution for conducting open-world zero-shot learning without predefined attribute labels (Sec. 5.1). We also use HVE to simulate human imagination ability through cross-feature retrieval and imagination (Sec. 5.2).
|
| 134 |
+
|
| 135 |
+
# 5.1 Open-world Zero-shot Learning with HVE
|
| 136 |
+
|
| 137 |
+
Zero-shot learning needs to classify samples from classes never seen during training. Most current methods [35,31,13] need humans to provide detailed attribute labels for each image, which is costly in time and energy. However, given an image from an unseen class, humans can still describe it with their learned knowledge. For example, we may use horse-like shape, panda-like color, and tiger-like texture to describe an unseen class zebra. In this section, we show how our HVE
|
| 138 |
+
|
| 139 |
+
Table 3: Class-specific bias for each class in iLab-20M
|
| 140 |
+
|
| 141 |
+
<table><tr><td>ratio</td><td>boat</td><td>bus</td><td>car</td><td>mil</td><td>monster</td><td>pickup</td><td>semi</td><td>tank</td><td>train</td><td>van</td></tr><tr><td>shape</td><td>40%</td><td>35%</td><td>44%</td><td>18%</td><td>36%</td><td>28%</td><td>40%</td><td>36%</td><td>31%</td><td>40%</td></tr><tr><td>texture</td><td>32%</td><td>31%</td><td>40%</td><td>30%</td><td>34%</td><td>20%</td><td>31%</td><td>32%</td><td>34%</td><td>27%</td></tr><tr><td>color</td><td>28%</td><td>34%</td><td>16%</td><td>52%</td><td>30%</td><td>53%</td><td>29%</td><td>32%</td><td>35%</td><td>33%</td></tr></table>
|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
Fig.7: The zero-shot learning method with HVE. We first describe the novel image in the perspective of shape, texture, and color. Then we use ConceptNet as common knowledge to reason and predict the label.
|
| 145 |
+
|
| 146 |
+
can simulate this feature-wise open-world image description by feature retrieval and ranking. And based on these image descriptions, we propose a feature-wise open-world zero-shot learning pipeline with the help of ConceptNet [49], like the reasoning or consulting process of humans. The whole process shows in Fig. 7.
|
| 147 |
+
|
| 148 |
+
Step 1: Description We use HVE to provide feature-wise descriptions for any unseen class images without predefined attribute labels. First, to represent learnt knowledge, we use trained three feature extractors (described in Sec. 3.2) to get the shape, texture, and color representation image of seen class $k$ . Then, given an unseen class image $I_{un}$ , we use the same feature extractors to get its feature-wise representation. To retrieve learnt classes as descriptions, we calculate the average distance between $I_{un}$ and images of other class $k$ in the latent space on shape, texture, and color features. In this way, we can find the top $K$ closest classes of $I_{un}$ from the perspective of each feature, and we call these $K$ classes "roots" of each feature. Now, we can describe $I_{un}$ using our three sets of roots. For example, as shown in Fig. 7(a), for the unseen class zebra, we can describe its shape by {horse, donkey}, texture by {tiger, piano keys}, and color by {panda}.
|
| 149 |
+
|
| 150 |
+
Step 2: Open-world classification To further predict the actual class of $I_{un}$ based on the feature-wise description, we use ConceptNet as common knowledge to conduct reasoning. As shown in Fig. 7(b), for every feature roots, we retrieve their common attribute in ConceptNet, (e.g., stripe the is common attribute root of {tiger, piano keys}). We form a reasoning root pool $R^{*}$ consisting of classes from feature roots obtained during image description and shared attribute roots. The reasoning roots will be our evidence for reasoning. For every root in $R^{*}$ , we can search its neighbors in ConceptNet, which are treated as possible candidate classes for $I_{un}$ . All candidates form a possible candidate pool $P$ , which contains all hypothesis classes. Now we have two pools, root pool $R^{*}$ and candidate pool $P$ . For every candidate $p_i \in P$ and $r_i \in R^{*}$ , we calculate the ranking score of $p_i$ as: $S(p_i) = \sum_{r_j \in R^*} \cos(\mathcal{E}(p_i), \mathcal{E}(r_j))$ . where $\mathcal{E}(\cdot)$ is the word embedding in ConceptNet and $\cos(A, B)$ means cosine similarity between $A$ and $B$ .
|
| 151 |
+
|
| 152 |
+
(a) Accuracy of unseen class for zero-shot (b) Cross-features imagination quality learning. One-shot on Prototype and zero- comparison. We compare HVE methods shot on ours with three pix2pix GANs as baselines
|
| 153 |
+
|
| 154 |
+
Table 4: Open-world zero-shot accuracy and FID of cross-features imagination.
|
| 155 |
+
|
| 156 |
+
<table><tr><td>Method</td><td>fowl</td><td>zebra</td><td>wolf</td><td>sheep</td><td>apple</td></tr><tr><td>Prototype</td><td>19%</td><td>16%</td><td>17%</td><td>21%</td><td>74%</td></tr><tr><td>Ours</td><td>78%</td><td>87%</td><td>63%</td><td>72%</td><td>98%</td></tr></table>
|
| 157 |
+
|
| 158 |
+
<table><tr><td>FID (↓)</td><td>shape input</td><td>texture input</td><td>color input</td></tr><tr><td>Baselines</td><td>123.915</td><td>188.854</td><td>203.527</td></tr><tr><td>Ours</td><td>96.871</td><td>105.921</td><td>52.846</td></tr></table>
|
| 159 |
+
|
| 160 |
+
We choose the candidate with the highest score as our predicted label. In our prototype zero-shot learning dataset, we select 34 seen classes as the training set and 5 unseen classes as the test set, with 200 images per class. We calculate the accuracy of the test set (Table 4a). As a comparison, we conduct prototypical networks [47] using its one-shot setting. More details are in the appendix.
|
| 161 |
+
|
| 162 |
+
# 5.2 Cross Feature Imagination with HVE
|
| 163 |
+
|
| 164 |
+
We show HVE has the potential to simulate human imagination ability. Humans can intuitively imagine an object when seeing one aspect of a feature, especially when this feature is prototypical (contribute most to classification). For instance, we can imagine a zebra when seeing its stripe (texture). This process is similar but harder than the classical image generation task since the input features modality here is dynamic which can be any feature among shape, texture, or color. To solve this problem, using HVE, we separate this procedure into two steps: (1) cross feature retrieval and (2) cross feature imagination. Given any feature (shape, texture, or color) as input, cross-feature retrieval finds the most possible two other features. Cross-feature imagination then generate a whole object based on a group of shapes, textures, and color features.
|
| 165 |
+
|
| 166 |
+
Cross Feature Retrieval. We learn a feature agnostic encoder that projects the three features into one same feature space and makes sure that the features belonging to the same class are in the nearby regions.
|
| 167 |
+
|
| 168 |
+
As shown in Fig. 8(a), during training, the shape $I_{s}$ , texture $I_{t}$ and color $I_{c}$ are first sent into the corresponding frozen encoders $E_{s}, E_{t}, E_{c}$ , which are the same encoders in Sec. 3.2. Then all of the outputs are projected into a cross-feature embedding space by a feature agnostic net $\mathcal{M}$ , which contains three convolution layers. We also add a fully connected layer to predict the class labels of the features. We use cross-entropy loss $\mathcal{L}_{\mathrm{cls}}$ to regularize the prediction label and a triplet loss $\mathcal{L}_{\mathrm{triplet}}$ [44] to regularize the projection of $\mathcal{M}$ . For any input feature $x$ (e.g., a bird A shape), positive sample $x_{\mathrm{pos}}$ are either same class same modality (another bird A shape) or same class different feature modality (a bird A texture or color); negative sample $x_{\mathrm{neg}}$ are any features from different class. $\mathcal{L}_{\mathrm{triplet}}$ pulls the embedding of $x$ closer to that of the positive sample $x_{\mathrm{pos}}$ , and pushes it apart from the embedding of the negative sample $x_{\mathrm{neg}}$ . The triplet
|
| 169 |
+
|
| 170 |
+

|
| 171 |
+
(a)
|
| 172 |
+
Fig. 8: (a) The structure and training process of the cross-feature retrieval model. $E_{s}$ , $E_{t}$ , $E_{c}$ are the same encoders in Sec. 3.2. The feature agnostic net then projects them to shared feature space for retrieval. (b) The process of cross-feature imagination. After retrieval, we design a cross-feature pixel2pixel GAN model to generate the final image.
|
| 173 |
+
|
| 174 |
+

|
| 175 |
+
(b)
|
| 176 |
+
|
| 177 |
+
loss is defined as $\mathcal{L}_{\mathrm{triplet}} = \max (\| \mathcal{F}(x) - \mathcal{F}(x_{\mathrm{pos}})\| _2 - \| \mathcal{F}(x) - \mathcal{F}(x_{\mathrm{neg}})\| _2 + \alpha ,0)$ , where $\mathcal{F}(\cdot)\coloneqq \mathcal{M}(E(\cdot))$ , $E$ is one of the feature encoders. $\alpha$ is the margin size in the feature space between classes, $\| \cdot \| _2$ represents $\ell_2$ norm.
|
| 178 |
+
|
| 179 |
+
We test the retrieval model in all three biased datasets (Fig. 4) separately. During retrieval, given any feature of any object, we can map it into the cross feature embedding space by the corresponding encoder net and the feature agnostic net. Then we apply the $\ell_2$ norm to find the other two features closest to the input one as output. The output is correct if they belong to the same class as the input. For each dataset, we retrieve the three features pair by pair (accuracy in appendix). The retrieval performs better when the input feature is the dominant of the dataset, which again verifies the feature bias in each dataset.
|
| 180 |
+
|
| 181 |
+
Cross Feature Imagination. To stimulate imagination, we propose a cross-feature imagination model to generate plausible final images with the input and retrieved features. The procedure of imagination is shown in Fig. 8(b). Inspired by the pixel2pixel GAN[25] and AdaIN[24], we design a cross-feature pixel2pixel GAN model to generate the final image. The GAN model is trained and tested on the three biased datasets. In Fig. 9, we show more results of the generation, which show that our model satisfyingly generates the object from a single feature. From the comparison between (c) and (e), we can clearly find that they are alike from the view of the corresponding input feature, but the imagination results preserve the retrieval features. The imagination variance also shows the feature contributions from a generative view: if the given feature is the dominant feature of a class (contribute most in classification. e.g., the stripe of zebra), then the retrieved features and imagined images have smaller variance (most are zebras); While non-dominant given feature (shape of zebra) lead to large imagination variance (can be any horse-like animals). We create a baseline generator by using three pix2pix GANs where each pix2pix GAN is responsible for one specific feature (take one modality of feature as input and imagine the raw image). The FID comparison is in Table. 4b. More details are in the appendix.
|
| 182 |
+
|
| 183 |
+

|
| 184 |
+
Fig. 9: Imagination with shape, texture, and color feature input (columns I, II, III). Line (a): input feature. Line (b): retrieved features given (a). Line (c): imagination results with HVE and our GAN model. Line (d): results of baseline 3 pix2pix GANs. Line (e): original images to which the input features belong. Our model can reasonably "imagine" the object given a single feature.
|
| 185 |
+
|
| 186 |
+
# 6 Conclusion
|
| 187 |
+
|
| 188 |
+
To explore the task-specific contribution of shape, texture, and color features in human visual recognition, we propose a humanoid vision engine (HVE) that explicitly and separately computes these features from images and then aggregates them to support image classification. With the proposed contribution attribution method, given any task (dataset), HVE can summarize and rank-order the tasks-specific contributions of the three features to object recognition. We use human experiments to show that HVE has a similar feature contribution to humans on specific tasks. We show that HVE can help simulate more complex and humanoid abilities (e.g., open-world zero-shot learning and cross-feature imagination) with promising performance. These results are the first step towards better understanding the contributions of object features to classification, zero-shot learning, imagination, and beyond.
|
| 189 |
+
|
| 190 |
+
Acknowledgments This work was supported by C-BRIC (one of six centers in JUMP, a Semiconductor Research Corporation (SRC) program sponsored by DARPA), DARPA (HR00112190134) and the Army Research Office (W911NF2020053). The authors affirm that the views expressed herein are solely their own, and do not represent the views of the United States government or any agency thereof.
|
| 191 |
+
|
| 192 |
+
# References
|
| 193 |
+
|
| 194 |
+
1. Amir, Y., Harel, M., Malach, R.: Cortical hierarchy reflected in the organization of intrinsic connections in macaque monkey visual cortex. Journal of Comparative Neurology 334(1), 19-46 (1993)
|
| 195 |
+
2. Andrychowicz, M., Denil, M., Gomez, S., Hoffman, M.W., Pfau, D., Schaul, T., Shillingford, B., De Freitas, N.: Learning to learn by gradient descent by gradient descent. In: Advances in neural information processing systems. pp. 3981-3989 (2016)
|
| 196 |
+
3. Bendale, A., Boult, T.: Towards open world recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 1893-1902 (2015)
|
| 197 |
+
4. Biederman, I.: Recognition-by-components: a theory of human image understanding. Psychological review 94(2), 115 (1987)
|
| 198 |
+
5. Borji, A., Izadi, S., Itti, L.: ilab-20m: A large-scale controlled object dataset to investigate deep learning. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 2221-2230 (2016)
|
| 199 |
+
6. Brendel, W., Bethge, M.: Approximating cnns with bag-of-local-features models works surprisingly well onImagenet. In: 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net (2019), https://openreview.net/forum?id=SskfMWhAqYQ
|
| 200 |
+
7. Cadieu, C.F., Hong, H., Yamins, D.L., Pinto, N., Ardila, D., Solomon, E.A., Majaj, N.J., DiCarlo, J.J.: Deep neural networks rival the representation of primate it cortex for core visual object recognition. PLoS computational biology 10(12), e1003963 (2014)
|
| 201 |
+
8. Cant, J.S., Goodale, M.A.: Attention to form or surface properties modulates different regions of human occipitotemporal cortex. Cerebral Cortex 17(3), 713-731 (2007)
|
| 202 |
+
9. Cant, J.S., Large, M.E., McCall, L., Goodale, M.A.: Independent processing of form, colour, and texture in object perception. Perception 37(1), 57-78 (2008)
|
| 203 |
+
10. Cheng, H., Wang, Y., Li, H., Kot, A.C., Wen, B.: Disentangled feature representation for few-shot image classification. CoRR abs/2109.12548 (2021), https://arxiv.org/abs/2109.12548
|
| 204 |
+
11. DeYoe, E.A., Carman, G.J., Bandettini, P., Glickman, S., Wieser, J., Cox, R., Miller, D., Neitz, J.: Mapping striate and extrastriate visual areas in human cerebral cortex. Proceedings of the National Academy of Sciences 93(6), 2382-2386 (1996)
|
| 205 |
+
12. Dosovitskiy, A., Beyer, L., Kolesnikov, A., Weissenborn, D., Zhai, X., Unterthiner, T., Dehghani, M., Minderer, M., Heigold, G., Gelly, S., Uszkoreit, J., Houlsby, N.: An image is worth 16x16 words: Transformers for image recognition at scale. In: 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net (2021), https://openreview.net/forum?id=YicbFdNTTy
|
| 206 |
+
13. Fu, Y., Xiang, T., Jiang, Y.G., Xue, X., Signal, L., Gong, S.: Recent advances in zero-shot recognition: Toward data-efficient understanding of visual content. IEEE Signal Processing Magazine 35(1), 112-125 (2018)
|
| 207 |
+
14. Gatys, L.A., Ecker, A.S., Bethge, M.: Texture and art with deep neural networks. Current opinion in neurobiology 46, 178-186 (2017)
|
| 208 |
+
15. Gazzaniga, M.S., Ivry, R.B., Mangun, G.: Cognitive neuroscience. the biology of the mind,(2014) (2006)
|
| 209 |
+
|
| 210 |
+
16. Ge, Y., Abu-El-Haija, S., Xin, G., Itti, L.: Zero-shot synthesis with group-supervised learning. In: 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net (2021), https://openreview.net/forum?id=8wqCDnBmnrT
|
| 211 |
+
17. Ge, Y., Xiao, Y., Xu, Z., Li, L., Wu, Z., Itti, L.: Towards generic interface for human-neural network knowledge exchange (2021)
|
| 212 |
+
18. Ge, Y., Xiao, Y., Xu, Z., Zheng, M., Karanam, S., Chen, T., Itti, L., Wu, Z.: A peek into the reasoning of neural networks: Interpreting with structural visual concepts. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 2195-2204 (2021)
|
| 213 |
+
19. Ge, Y., Xu, J., Zhao, B.N., Itti, L., Vineet, V.: Dall-e for detection: Language-driven context image synthesis for object detection. arXiv preprint arXiv:2206.09592 (2022)
|
| 214 |
+
20. Gegenfurtner, K.R., Rieger, J.: Sensory and cognitive contributions of color to the recognition of natural scenes. Current Biology 10(13), 805-808 (2000)
|
| 215 |
+
21. Geirhos, R., Rubisch, P., Michaelis, C., Bethge, M., Wichmann, F.A., Brendel, W.: Imagenet-trained cnns are biased towards texture; increasing shape bias improves accuracy and robustness. In: 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net (2019), https://openreview.net/forum?id=Bygh9j09KX
|
| 216 |
+
22. Grill-Spector, K., Malach, R.: The human visual cortex. Annu. Rev. Neurosci. 27, 649-677 (2004)
|
| 217 |
+
23. He, K., Zhang, X., Ren, S., Sun, J.: Deep residual learning for image recognition. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 770-778 (2016)
|
| 218 |
+
24. Huang, X., Belongie, S.: Arbitrary style transfer in real-time with adaptive instance normalization. In: Proceedings of the IEEE International Conference on Computer Vision. pp. 1501-1510 (2017)
|
| 219 |
+
25. Isola, P., Zhu, J.Y., Zhou, T., Efros, A.A.: Image-to-image translation with conditional adversarial networks. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 1125-1134 (2017)
|
| 220 |
+
26. Jain, L.P., Scheirer, W.J., Boult, T.E.: Multi-class open set recognition using probability of inclusion. In: European Conference on Computer Vision. pp. 393-409. Springer (2014)
|
| 221 |
+
27. Joseph, K., Khan, S., Khan, F.S., Balasubramanian, V.N.: Towards open world object detection. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 5830-5840 (2021)
|
| 222 |
+
28. Julesz, B.: Binocular depth perception without familiarity cues: Random-dot stereo images with controlled spatial and temporal properties clarify problems in stereopsis. Science 145(3630), 356-362 (1964)
|
| 223 |
+
29. Khodadadeh, S., Bölön, L., Shah, M.: Unsupervised meta-learning for few-shot image classification. In: Wallach, H.M., Larochelle, H., Beygelzimer, A., d'Alché-Buc, F., Fox, E.B., Garnett, R. (eds.) Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada. pp. 10132-10142 (2019), https://proceedings.neurips.cc/paper/2019/hash/fd0a5a5e367a0955d81278062ef37429-AAbstract.html
|
| 224 |
+
30. Krizhevsky, A., Sutskever, I., Hinton, G.E.: Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems 25, 1097-1105 (2012)
|
| 225 |
+
|
| 226 |
+
31. Lampert, C.H., Nickisch, H., Harmeling, S.: Learning to detect unseen object classes by between-class attribute transfer. In: 2009 IEEE Conference on Computer Vision and Pattern Recognition. pp. 951-958. IEEE (2009)
|
| 227 |
+
32. Li, Y., Yu, Q., Tan, M., Mei, J., Tang, P., Shen, W., Yuille, A., Xie, C.: Shape-texture debiased neural network training. arXiv preprint arXiv:2010.05981 (2020)
|
| 228 |
+
33. Oliva, A., Schyns, P.G.: Diagnostic colors mediate scene recognition. Cognitive Psychology 41(2), 176-210 (2000). https://doi.org/https://doi.org/10.1006/cogp.1999.0728, https://www.sciencedirect.com/science/article/pii/S0010028599907284
|
| 229 |
+
34. Oppenheim, A.V., Lim, J.S.: The importance of phase in signals. Proceedings of the IEEE 69(5), 529-541 (1981)
|
| 230 |
+
35. Palatucci, M., Pomerleau, D., Hinton, G.E., Mitchell, T.M.: Zero-shot learning with semantic output codes. In: Bengio, Y., Schuurmans, D., Lafferty, J.D., Williams, C.K.I., Culotta, A. (eds.) Advances in Neural Information Processing Systems 22: 23rd Annual Conference on Neural Information Processing Systems 2009. Proceedings of a meeting held 7-10 December 2009, Vancouver, British Columbia, Canada. pp. 1410-1418. Curran Associates, Inc. (2009), https://proceedings.neurips.cc/paper/2009/black/1543843a4723ed2ab08e18053ae6dc5b-Abscract.htm1
|
| 231 |
+
36. Peuskens, H., Claeys, K.G., Todd, J.T., Norman, J.F., Van Hecke, P., Orban, G.A.: Attention to 3-d shape, 3-d motion, and texture in 3-d structure from motion displays. Journal of cognitive neuroscience 16(4), 665-682 (2004)
|
| 232 |
+
37. Prabhudesai, M., Lal, S., Patil, D., Tung, H., Harley, A.W., Fragkiadaki, K.: Disentangling 3d prototypical networks for few-shot concept learning. In: 9th International Conference on Learning Representations, ICLR 2021, Virtual Event, Austria, May 3-7, 2021. OpenReview.net (2021), https://openreview.net/forum?id=-Lr-u0b42he
|
| 233 |
+
38. Puce, A., Allison, T., Asgari, M., Gore, J.C., McCarthy, G.: Differential sensitivity of human visual cortex to faces, letterstrings, and textures: a functional magnetic resonance imaging study. Journal of neuroscience 16(16), 5205-5215 (1996)
|
| 234 |
+
39. Qi, L., Kuen, J., Wang, Y., Gu, J., Zhao, H., Lin, Z., Torr, P., Jia, J.: Open-world entity segmentation. arXiv preprint arXiv:2107.14228 (2021)
|
| 235 |
+
40. Rahman, S., Khan, S., Porikli, F.: A unified approach for conventional zero-shot, generalized zero-shot, and few-shot learning. IEEE Transactions on Image Processing 27(11), 5652-5667 (2018)
|
| 236 |
+
41. Ranftl, R., Bochkovskiy, A., Koltun, V.: Vision transformers for dense prediction. ArXiv preprint (2021)
|
| 237 |
+
42. Ranftl, R., Lasinger, K., Hafner, D., Schindler, K., Koltun, V.: Towards robust monocular depth estimation: Mixing datasets for zero-shot cross-dataset transfer. IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI) (2020)
|
| 238 |
+
43. Schlimmer, J.C., Fisher, D.: A case study of incremental concept induction. In: AAAI. vol. 86, pp. 496-501 (1986)
|
| 239 |
+
44. Schroff, F., Kalenichenko, D., Philbin, J.: Facenet: A unified embedding for face recognition and clustering. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 815-823 (2015)
|
| 240 |
+
45. Selvaraju, R.R., Cogswell, M., Das, A., Vedantam, R., Parikh, D., Batra, D.: Gradcam: Visual explanations from deep networks via gradient-based localization. In: Proceedings of the IEEE international conference on computer vision. pp. 618-626 (2017)
|
| 241 |
+
46. Simonyan, K., Zisserman, A.: Very deep convolutional networks for large-scale image recognition. In: Bengio, Y., LeCun, Y. (eds.) 3rd International Conference
|
| 242 |
+
|
| 243 |
+
on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings (2015), http://arxiv.org/abs/1409.1556
|
| 244 |
+
47. Snell, J., Swersky, K., Zemel, R.: Prototypical networks for few-shot learning. Advances in neural information processing systems 30 (2017)
|
| 245 |
+
48. Snell, J., Swersky, K., Zemel, R.S.: Prototypical networks for few-shot learning. In: Guyon, I., von Luxburg, U., Bengio, S., Wallach, H.M., Fergus, R., Vishwanathan, S.V.N., Garnett, R. (eds.) Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, December 4-9, 2017, Long Beach, CA, USA. pp. 4077-4087 (2017), https://proceedings.neurips.cc/paper/2017/bit/cb8da6767461f2812ae4290eac7cbc42-AAbstract.html
|
| 246 |
+
49. Speer, R., Chin, J., Havasi, C.: Conceptnet 5.5: An open multilingual graph of general knowledge. In: Thirty-first AAAI conference on artificial intelligence (2017)
|
| 247 |
+
50. Sung, F., Yang, Y., Zhang, L., Xiang, T., Torr, P.H., Hospedales, T.M.: Learning to compare: Relation network for few-shot learning. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 1199-1208 (2018)
|
| 248 |
+
51. Thomson, M.G.: Visual coding and the phase structure of natural scenes. Network: Computation in Neural Systems 10(2), 123 (1999)
|
| 249 |
+
52. Thrun, S., Mitchell, T.M.: Lifelong robot learning. Robotics and autonomous systems 15(1-2), 25-46 (1995)
|
| 250 |
+
53. Tokmakov, P., Wang, Y.X., Hebert, M.: Learning compositional representations for few-shot recognition. In: Proceedings of the IEEE/CVF International Conference on Computer Vision. pp. 6372-6381 (2019)
|
| 251 |
+
54. Vinyals, O., Blundell, C., Lillicrap, T., Wierstra, D., et al.: Matching networks for one shot learning. Advances in neural information processing systems 29, 3630-3638 (2016)
|
| 252 |
+
55. Wah, C., Branson, S., Welinder, P., Perona, P., Belongie, S.: The caltech-ucsd birds-200-2011 dataset (2011)
|
| 253 |
+
56. Walther, D.B., Chai, B., Caddigan, E., Beck, D.M., Fei-Fei, L.: Simple line drawings suffice for functional mri decoding of natural scene categories. Proceedings of the National Academy of Sciences 108(23), 9661-9666 (2011). https://doi.org/10.1073/pnas.1015666108, https://www.pnas.org/doi/abs/10.1073/pnas.1015666108
|
| 254 |
+
57. Wen, S., Rios, A., Ge, Y., Itti, L.: Beneficial perturbation network for designing general adaptive artificial intelligence systems. IEEE Transactions on Neural Networks and Learning Systems (2021)
|
| 255 |
+
58. Yamins, D.L., Hong, H., Cadieu, C.F., Solomon, E.A., Seibert, D., DiCarlo, J.J.: Performance-optimized hierarchical models predict neural responses in higher visual cortex. Proceedings of the national academy of sciences 111(23), 8619-8624 (2014)
|
| 256 |
+
59. Zhu, J.Y., Zhang, Z., Zhang, C., Wu, J., Torralba, A., Tenenbaum, J., Freeman, B.: Visual object networks: Image generation with disentangled 3d representations. In: Bengio, S., Wallach, H., Larochelle, H., Grauman, K., Cesa-Bianchi, N., Garnett, R. (eds.) Advances in Neural Information Processing Systems. vol. 31. Curran Associates, Inc. (2018), https://proceedings.neurips.cc/paper/2018/file/92cc227532d17e56e07902b254dfad10-Paper.pdf
|
contributionsofshapetextureandcolorinvisualrecognition/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4f310fa4e7904b982f564d190338ad395ab1ab74ce0e6c5c16b104ec9718d1d7
|
| 3 |
+
size 496572
|
contributionsofshapetextureandcolorinvisualrecognition/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:097f03d1c9a79c1ed7a8cf31ac29a64d524bc50e53a4b345408afb3a8787df3c
|
| 3 |
+
size 403950
|
controllablevideogenerationthroughglobalandlocalmotiondynamics/0153e114-8b68-4c4a-b6fb-adf9fc9f290f_content_list.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ee338b6f4033fd095904fb8296626a47f8bd136c830c3e9cd62e63a9a84b9a02
|
| 3 |
+
size 75845
|
controllablevideogenerationthroughglobalandlocalmotiondynamics/0153e114-8b68-4c4a-b6fb-adf9fc9f290f_model.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:98a19e43e9b7dddd54d35d508059a9073be5b82a3feb9c746e04a690938a4aad
|
| 3 |
+
size 91988
|
controllablevideogenerationthroughglobalandlocalmotiondynamics/0153e114-8b68-4c4a-b6fb-adf9fc9f290f_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b109bb17f9753d3952ed7511f8495cdf8da356505800a166998582f78f0b6cff
|
| 3 |
+
size 9599514
|
controllablevideogenerationthroughglobalandlocalmotiondynamics/full.md
ADDED
|
@@ -0,0 +1,266 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Controllable Video Generation through Global and Local Motion Dynamics
|
| 2 |
+
|
| 3 |
+
Aram Davtyan and Paolo Favaro
|
| 4 |
+
|
| 5 |
+
Computer Vision Group, University of Bern, Switzerland {aram.davtyan, paolo.favaro}@inf.unibe.ch
|
| 6 |
+
|
| 7 |
+
Abstract. We present GLASS, a method for Global and Local Action-driven Sequence Synthesis. GLASS is a generative model that is trained on video sequences in an unsupervised manner and that can animate an input image at test time. The method learns to segment frames into foreground-background layers and to generate transitions of the foregrounds over time through a global and local action representation. Global actions are explicitly related to 2D shifts, while local actions are instead related to (both geometric and photometric) local deformations. GLASS uses a recurrent neural network to transition between frames and is trained through a reconstruction loss. We also introduce W-Sprites (Walking Sprites), a novel synthetic dataset with a predefined action space. We evaluate our method on both W-Sprites and real datasets, and find that GLASS is able to generate realistic video sequences from a single input image and to successfully learn a more advanced action space than in prior work. Further details, the code and example videos are available at https://araachie.github.io/glass/.
|
| 8 |
+
|
| 9 |
+
Keywords: video generation; unsupervised action discovery; controllable generation
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
A long-standing objective in machine learning and computer vision is to build agents that can learn how to operate in an environment through visual data [12]. A successful approach to do so is to use supervised learning, i.e., to train a model on a large, manually annotated dataset [25]. However, if we take inspiration from how infants learn to move, we are brought to conclude that they may not rely on extensive guidance. In fact, while supervision from adults might come through language [30], the signal is certainly not detailed enough to fully define the locomotion dynamics. One approach that does not require direct supervision is to learn just through direct scrutiny of other agents, i.e., through passive imitation. In fact, infants have an abundance of sensory exposure to the activities of adults before they themselves learn how to perform them [29].
|
| 14 |
+
|
| 15 |
+
The first step for an observing agent to learn how to operate in an environment through passive imitation and without explicit supervision is to build a model that: 1) separates an agent from its environment, 2) captures the appearance of the agent and its environment, and 3) builds a description of the agent's
|
| 16 |
+
|
| 17 |
+
Fig. 1: W-Sprites dataset sample videos. To play them use Acrobat Reader.
|
| 18 |
+
|
| 19 |
+
dynamics. The first requirement implies that the model incorporates some segmentation capability, and it allows to explain transitions over time more easily. The second requirement is dictated by the fact that we exploit the reconstruction of visual observations as our indirect supervision signal. Thus, our model also relates to the video generation literature. Finally, the third requirement is that the model includes an action space, which serves two purposes: i) it allows the model to decode a video into a sequence of actions (which is a representation of the agent's dynamics) and ii) it allows the model to control the generation of videos by editing the action sequence.
|
| 20 |
+
|
| 21 |
+
We introduce GLASS, a method for Global and Local Action-driven Sequence Synthesis. As shown in Fig. 2, GLASS first learns to segment each frame of a video into foreground and background layers. A basic principle to do that is to use motion as a cue, i.e., the fact that agents exhibit, on average, a distinct motion flow compared to the environment. Motion-based segmentation could be achieved through background subtraction, which is however restricted to stationary backgrounds, or instead, more in general, via optical flow. For simplicity, we propose to use an explicit foreground-background motion segmentation based on 2D shifts. Then, GLASS regresses the relative shift between the foregrounds of two subsequent frames, which we call the global action, and between the backgrounds (see Fig. 3). The local actions are learned only from the foregrounds. The decomposition of the agent's motion into global and local components provides a computationally efficient representation of the video. In contrast, a global action space would require the much larger Cartesian product of the local and global action spaces. In practice, given an action space of finite size, global models tend to learn only global motions and to ignore local deformations. We train an RNN to predict, through a decoder, the next foreground by using an encoding of a foreground, the previous state, and an encoding of the local and global actions as input. All networks are trained via reconstruction losses.
|
| 22 |
+
|
| 23 |
+
We evaluate GLASS on both synthetic and real data. As synthetic data we introduce W-Sprites (WalkingSprites [23,1,2]) (see Fig. 1), a dataset with a pre-defined action space, and where the action labels between pairs of frames (as well as the agent segmentation and location, and the background shift) are known. We find that GLASS learns a robust representation of both global and local dynamics on W-Sprites. Moreover, GLASS is able to decode videos into sequences of actions that strongly correlate with the ground truth action sequences. Finally, users can generate novel sequences by controlling the input
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Fig. 2: GLASS Global Motion Analysis. Two input frames $I_{t}$ and $I_{t + 1}$ are fed (separately) to a segmentation network $M$ to output the foreground masks $m_{t}$ and $m_{t + 1}$ respectively. The masks are used to separate the foregrounds $f_{t}$ and $f_{t + 1}$ from the backgrounds $b_{t}$ and $b_{t + 1}$ . The concatenated foregrounds are fed to the network $P_{f}$ to predict their relative shift $\varDelta_F$ . We use $\varDelta_F$ to shift $f_{t}$ and match it to $f_{t + 1}$ via an $L_{2}$ loss (foregrounds may not match exactly and this loss does not penalize small errors). In the case of the backgrounds we also train an inpainting network before shifting them with the predicted $\varDelta_B$ and matching them with an $L_{1}$ loss (unlike foregrounds, we can expect backgrounds to match).
|
| 27 |
+
|
| 28 |
+
action sequences to GLASS. On real data, we find that GLASS can also generate realistic sequences by controlling the actions between frames.
|
| 29 |
+
|
| 30 |
+
Contributions: i) We introduce GLASS, a novel generative model with a global and local action space; the shifts estimated and generated through the global actions have an accuracy comparable to or higher than SotA; moreover, local actions allow a fine-grained modeling of dynamics that is not available in prior work; ii) We introduce W-Sprites, a novel dataset for the evaluation of action identification and generation; iii) We demonstrate GLASS on both synthetic and real datasets and show that it can: 1) segment an agent from its environment and estimate its global shift over time; 2) learn a disentangled action space that is consistent across agents; 3) decode videos into sequences of actions; 4) synthesize realistic videos under the guidance of a novel action policy.
|
| 31 |
+
|
| 32 |
+
# 2 Prior work
|
| 33 |
+
|
| 34 |
+
Video generation. Because GLASS is trained based on reconstruction losses, and it is built as a generative model, it relates to the generation of videos. Recent success in deep generative models for images [10,17,28] has aroused renewed interest in video generation. Several formulations tackling the problem of video generation exploit adversarial losses [3,4,9,22,32,35,36,37], autoregressive models [39] and use a wide range of architectures from RNNs [31] to transformers [40].
|
| 35 |
+
|
| 36 |
+
Controllable video generation. Video generation models can also differ in how they apply conditioning. While some prior work uses per-video class labels [19,38], e.g., actions performed in a short sequence of frames, others, as in
|
| 37 |
+
|
| 38 |
+

|
| 39 |
+
Fig. 3: GLASS Local Motion Analysis. We feed the segmented foreground $f_{t}$ , its shifted version and $f_{t + 1}$ separately as inputs to an encoder network $E$ to obtain features $\phi_t$ , $\tilde{\phi}_t$ and $\phi_{t + 1}$ respectively. The latter two features are then mapped to an action $a_{t}$ by the action network $A$ . A further encoding of $\phi_t$ into $e_t$ , the previous state $s_t$ , and the local action $a_{t}$ and global action $\varDelta_F$ are fed as input to the RNN to predict the next state $s_{t + 1}$ . Finally, a decoder maps the state $s_{t + 1}$ to the next foreground $\hat{f}_{t + 1}$ , which is matched to the original foreground $f_{t + 1}$ via the reconstruction loss.
|
| 40 |
+
|
| 41 |
+
GLASS, use conditioning at each step [7,12,18,26,27]. For instance, in [12] the authors train a model to simulate the behavior of a robotic arm given the performed actions. Kim et al. [18] introduce GameGAN, a powerful generative model that can replace a game engine. It is trained to render the next frame given the current frame and the pressed keyboard action. One limitation of these methods is that they require knowledge of the ground truth actions and hence are restricted to synthetic data, such as video games. To become applicable to real data, several recent methods that learn an action space of the agent from raw videos without fine-grained annotations have been proposed. For instance, Rybkin et al. [29] propose a continuous latent space for the actions. They introduce arithmetical structure into their action space by exploiting the fact that two actions can be composed to get another action that would lead to the same result as when applying the original actions sequentially. [13] generates high-quality videos of moving agents with controllable actions. However, it builds an autoregressive model on top of pose maps obtained from supervised training, while our method is completely unsupervised. In [24] the continuous action space is replaced by a finite set. This allows a simpler control (playability) of the generated videos and favors interpretability of the learned actions. More recent work by Huang et al. [15] explicitly separates the foreground from the background and trains a network to predict the next frame given the current frame and the next segmentation mask. GLASS relates to this last family of methods as it also does not require any supervision signal.
|
| 42 |
+
|
| 43 |
+
Unsupervised learning of structured representations. In GLASS we propose to learn the global and local actions from video frames. While the global ones are defined as foreground 2D shifts, the local ones are represented as a discrete set of action codes. This leads to a latent clustering problem. In GLASS, we propose to solve it through variational inference [21]. Some recent work learns structured representations from raw input data [6,5]. The VQ-VAE [34] formula
|
| 44 |
+
|
| 45 |
+
tion instead uses a discrete latent space and assumes a uniform distribution over the latent features. Recent advances in image and video generation has shown that such VQ-VAE based models have a remarkable performance [28,40] and this has encouraged us to adopt this approach.
|
| 46 |
+
|
| 47 |
+
# 3 Training GLASS
|
| 48 |
+
|
| 49 |
+
GLASS consists of two stages: One is the Global Motion Analysis (GMA) (shown in Fig. 2) and the other is the Local Motion Analysis (LMA) (shown in Fig. 3). GMA aims to separate the foreground agent from the background and to also regress the 2D shifts between foregrounds and backgrounds. LMA aims to learn a representation for local actions that can describe deformations other than 2D shifts. Towards this purpose it uses a Recurrent Neural Network (RNN) and a feature encoding of a frame and of the global and local actions as input. Both GMA and LMA stages are jointly trained in an unsupervised manner.
|
| 50 |
+
|
| 51 |
+
# 3.1 Global Motion Analysis
|
| 52 |
+
|
| 53 |
+
Let us denote a video as a sequence of $T$ frames $I_{t} \in \mathbb{R}^{3 \times H \times W}$ , where $t = 1, \dots, T$ , and $H$ and $W$ denote the number of color channels, the height and the width of the frame. Although GLASS is trained with video sequences, we can illustrate all the training losses with a single pair $(I_{t}, I_{t+1})$ of frames. Each frame is fed to a mask network M to output masks $m_{t}$ and $m_{t+1}$ . The masks can take values between 0 and 1 (a sigmoid is used at the output), but are encouraged to take the extreme values through the following binarization loss
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\mathcal {L} _ {\mathrm {B I N}} = \sum_ {t} \min \left\{m _ {t}, 1 - m _ {t} \right\}. \tag {1}
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
We also discourage the mask from being empty or covering the whole frame by using a mask size loss
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\mathcal {L} _ {\text {S I Z E}} = \sum_ {t} | \mathbb {E} [ m _ {t} ] - \theta |, \tag {2}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
where $\mathbb{E}[\cdot]$ denotes the average over all pixels and $\theta \in [0,1]$ is a tuning parameter (the percentage of image pixels covered by a mask on average). The masks are then used to extract the foregrounds $f_{t} = I_{t}\odot m_{t}$ and $f_{t + 1} = I_{t + 1}\odot m_{t + 1}$ and the backgrounds $b_{t} = I_{t}\odot (1 - m_{t})$ and $b_{t + 1} = I_{t + 1}\odot (1 - m_{t + 1})$ ( $\odot$ denotes the element-wise product). We assume that the foregrounds are approximately matching up to a relative shift $\bar{\Delta}_F$ , i.e., that $f_{t + 1}[p]\simeq (f_t\circ \bar{\Delta}_F)[p]\doteq f_t[p + \bar{\Delta}_F]$ , for all pixel coordinates $p\in \Omega \subset \mathbb{R}^2$ . We then concatenate the foregrounds and feed them as input to the pose network $P_{f}$ to regress the relative shift $\varDelta_F=P_f([f_t,f_{t+1}])$ between $f_{t}$ and $f_{t + 1}$ . Since we do not have the ground truth shift $\bar{\Delta}_F$ , we cannot train $P_{f}$ via supervised learning. In alternative, we rely on the modeling assumption and define a reconstruction loss for the foreground by applying the estimated shift $\varDelta_F$ to $f_{t}$ and by matching it to the frame $f_{t + 1}$ in the $L_2$ norm (to allow for some error tolerance), i.e.,
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\mathcal {L} _ {\text {R E C F}} = \sum_ {t} \| f _ {t + 1} - f _ {t} \circ \Delta_ {F} \| _ {2} ^ {2}. \tag {3}
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
A similar derivation pertains to the backgrounds. We concatenate the backgrounds and feed them as input to the pose network $P_{b}$ to regress the relative shift $\varDelta_{B}=P_{b}([b_{t},b_{t+1}])$ between $b_{t}$ and $b_{t+1}$ . However, because of the holes left by the masks, learning the relative shift via a direct matching of the backgrounds would not work. Therefore, we also introduce an inpainting network N. To indicate the masked region to N we simply fill it with a value out of the image range (we use [-1.1,-1.1,-1.1] as RGB values at the masked pixels). The inpainted regions are then copied to the corresponding backgrounds so that we obtain $\hat{b}_{j}=b_{j}\odot(1-m_{j})+\mathrm{N}(b_{j})\odot m_{j}$ , with $j=\{t,t+1\}$ . The background reconstructions are then matched with both an $L_{1}$ norm and a perceptual loss $\mathcal{L}_{\mathrm{VGG}}$ based on VGG features<sup>1</sup> [16]
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\mathcal {L} _ {\mathrm {R E C B}} = \sum_ {t} \left\| \hat {b} _ {t + 1} - \hat {b} _ {t} \circ \varDelta_ {B} \right\| _ {1} + \lambda_ {\mathrm {V G G}} \mathcal {L} _ {\mathrm {V G G}} \left(\hat {b} _ {t + 1}, \hat {b} _ {t} \circ \varDelta_ {B}\right). \tag {4}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
Finally, we also have a joint reconstruction loss where we compose the foreground with the estimated foreground shift $\Delta_F$ and the inpainted background with the estimated background shift $\Delta_B$
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\mathcal {L} _ {\mathrm {R E C J}} = \sum_ {t} \left\| \left(f _ {t} \odot m _ {t}\right) \circ \Delta_ {F} + \left(\hat {b} _ {t} \circ \Delta_ {B}\right) \odot \left(1 - m _ {t} \circ \Delta_ {F}\right) - I _ {t + 1} \right\| _ {1}. \tag {5}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
These losses are all we use to train the mask network M, the inpainting network N and the pose estimation networks $P_{f}$ and $P_{b}$ . The inpainting network and the other networks could be further improved, but we find that the choices above are sufficient to obtain accurate segmentation masks and good shift estimates.
|
| 84 |
+
|
| 85 |
+
# 3.2 Local Motion Analysis
|
| 86 |
+
|
| 87 |
+
The LMA stage works directly on the foreground frames $f_{t}$ and $f_{t + 1}$ . It first shifts $f_{t}$ with $\Delta_F$ . This is done to remove the global shift information from the input frames and to make the action network focus on the local variations. It further encodes the foreground frames with a convolutional neural network $\mathrm{E}$ and obtains $\phi_t = \operatorname{E}(f_t)$ , $\dot{\phi}_t = \operatorname{E}(f_t \circ \Delta_F)$ and similarly for $\phi_{t + 1} = \operatorname{E}(f_{t + 1})$ . The convolutional feature $\phi_t$ is then projected via $\mathbf{C}$ to give $e_t = \mathrm{C}(\phi_t)$ .
|
| 88 |
+
|
| 89 |
+
In the action network A there are a few pre-processing steps. First, both feature maps $\tilde{\phi}_t$ and $\phi_{t + 1}$ are fed to a CNN and flat features $\psi_t$ and $\psi_{t + 1}$ are obtained from the resulting feature maps through global average pooling. In CADDY [24] the actions are determined through a direct difference between Gaussian samples around $\psi_t$ and $\psi_{t + 1}$ . On average this means that the difference between features of images with the same action must align with the same direction. Although this works very well for CADDY, we find that this may be restrictive, especially if one wants to represent periodic motion (e.g., in our case, an agent walking in place). Thus, we propose to learn a modified mapping of $\psi_{t + 1}$ conditioned on $\psi_t$ . We compute $\psi_{t + 1}^i = \mathrm{T}^i (\psi_t,\psi_{t + 1}^{i - 1})$ with $i = 1,\ldots ,P$
|
| 90 |
+
|
| 91 |
+
$\mathrm{T}^i$ are bilinear transformations, $\psi_{t + 1}^{0} = \psi_{t + 1}$ , and we choose $P = 4$ . We then compute the action direction $d_{t} = \psi_{t + 1}^{P} - \psi_{t}$ . Finally, the action $a_{t}$ is predicted through vector quantization after one additional MLP U to give $a_{t} = \mathrm{VQ}[\mathrm{U}(d_{t})]$ . The vector quantization VQ relies on $K$ learnable prototype vectors $c_{k}$ , with $k = 1,\ldots ,K$ . The method identifies the prototype $c_{q}$ closest in $L_{2}$ norm to $\mathrm{U}(d_t)$ , i.e., $q = \arg \min_k\| c_k - \mathrm{U}(d_t)\| _2^2$ , and uses that as the quantized action $\mathrm{VQ}[\mathrm{U}(d_t)] = c_q$ . To train the VQ prototypes, we use the following loss [34]
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\mathcal {L} _ {V Q} = \| \operatorname {s g} [ c _ {q} ] - U (d _ {t}) \| _ {2} ^ {2} + \lambda_ {\mathrm {V Q}} \| c _ {q} - \operatorname {s g} [ U (d _ {t}) ] \| _ {2} ^ {2}, \tag {6}
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
where $\lambda_{\mathrm{VQ}} > 0$ is a tuning parameter and $\mathrm{sg}[\cdot ]$ denotes stop-gradient. Vector quantization allows us to obtain latent space clustering in a simpler way compared to the Gaussian priors and the explicit tracking of cluster centroids as done in CADDY [24]. Moreover, our ablation studies show that VQ works better than the Gumbel-softmax trick (see Section 6 and Table 3).
|
| 98 |
+
|
| 99 |
+
Now, we have all the inputs needed for the RNN. We introduce an RNN state $s_t$ and feed it together with the encoding $e_t$ as input. Our RNN is split into 6 blocks as in CADDY [24]. Both the global action $\Delta_F$ and the local action $a_t$ are first mapped to embeddings of the same size and then fed to the modulated convolutional layers of the RNN similarly to StyleGAN [17]. To differentiate the roles of $\Delta_F$ and $a_t$ we feed the embeddings of $\Delta_F$ to the first two blocks of the RNN and that of $a_t$ to the remaining four blocks. The rationale is that early blocks correlate more with global changes, such as translations, and the later blocks correlate more with local deformations.
|
| 100 |
+
|
| 101 |
+
Finally, the decoder D takes the RNN prediction $s_{t + 1}$ as input and outputs the frame $\hat{f}_{t + 1} = D_f(s_{t + 1})$ and the predicted mask $\hat{m}_{t + 1} = D_m(s_{t + 1})$ . Moreover, the decoder predicts frames at 3 different scales (as also done in CADDY [24]). We introduce a reconstruction loss for each scale
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\mathcal {L} _ {\text {R E C U}} = \sum_ {t} \left\| \operatorname {s g} \left[ \omega_ {\text {U N S}} \right] \odot \left(f _ {t + 1} - \hat {f} _ {t + 1}\right) \right\| _ {1}, \tag {7}
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
where $\forall p\in \Omega$ , $\omega_{\mathrm{UNS}}[p] = \| f_t[p] - f_{t + 1}[p]\| _1 + \| \hat{f}_t[p] - \hat{f}_{t + 1}[p]\| _1$ are weights that enhance the minimization at pixels where the input and predicted foregrounds differ, and also a perceptual loss
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\mathcal {L} _ {\text {L M A - V G G}} = \mathcal {L} _ {\text {V G G}} \left(f _ {t + 1}, \hat {f} _ {t + 1}\right). \tag {8}
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
To better learn local deformations, we also introduce a reconstruction loss that focuses on the differences between the foregrounds after aligning them with the estimated relative shifts, i.e.,
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\mathcal {L} _ {\text {R E C S}} = \sum_ {t} \| \operatorname {s g} [ \omega_ {\text {A L I G N}} ] \odot \left(f _ {t + 1} - \hat {f} _ {t + 1}\right) \| _ {1}, \tag {9}
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
where $\omega_{\mathrm{ALIGN}}[p] = \| f_t \circ \Delta_F[p] - f_{t+1}[p]\|_1 + \|\hat{f}_{t+1}[p] - f_{t+1}[p]\|_1$ . To encourage the consistency between the predicted mask $\hat{m}_{t+1}$ and the mask $m_{t+1}$ obtained from $I_{t+1}$ , we also minimize
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\mathcal {L} _ {\mathrm {M S K}} = \sum_ {t} \| \hat {m} _ {t + 1} - m _ {t + 1} \| _ {1}. \tag {10}
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
Moreover, we encourage a cyclic consistency between the encoded features via
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
\mathcal {L} _ {\mathrm {C Y C}} = \sum_ {t} \| \operatorname {s g} \left[ \phi_ {t + 1} \right] - \mathrm {E} \left(\hat {f} _ {t + 1}\right) \| _ {1}. \tag {11}
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
Our final loss consists of a linear combination of all the above losses (both from the GMA and LMA) through corresponding positive scalars $\lambda_{\mathrm{VQ}}$ , $\lambda_{\mathrm{LMA - VGG}}$ , $\lambda_{\mathrm{RECU}}$ , $\lambda_{\mathrm{RECS}}$ , $\lambda_{\mathrm{MSK}}$ , $\lambda_{\mathrm{CYC}}$ , $\lambda_{\mathrm{RECF}}$ , $\lambda_{\mathrm{RECB}}$ , $\lambda_{\mathrm{RECJ}}$ , $\lambda_{\mathrm{BIN}}$ , and $\lambda_{\mathrm{SIZE}}$ .
|
| 132 |
+
|
| 133 |
+
# 4 Implementation details
|
| 134 |
+
|
| 135 |
+
At inference time, GLASS can generate a sequence of frames given only the first one. This setting is slightly different from training, where the model only predicts the next frame given the previous one. In order to prepare the model for test time, we adopt the mixed training procedure (Teacher Forcing) also used in [24]. That is, we select a video duration $T_f$ , $0 < T_f < T$ , and if $t \leq T_f$ we feed the encodings of the real frames to the RNN, otherwise if $t > T_f$ we use the encodings of the reconstructed frames. During the training we gradually decrease $T_f$ to 1 and increase $T$ to adapt the network to the generation of longer sequences. To speed up the convergence, we pretrain the GMA component for 3000 iterations. The coefficients before the loss terms are estimated on the training set. We found that the selected configuration works well across all datasets. The models are trained using the Adam optimizer [20] with a learning rate equal to 0.0004 and weight decay $10^{-6}$ . For more details, see the supplementary material.
|
| 136 |
+
|
| 137 |
+
# 5 W-Sprites dataset
|
| 138 |
+
|
| 139 |
+
In order to assess and ablate the components of GLASS, we build a synthetic video dataset of cartoon characters acting on a moving background. We call the dataset W-Sprites (for WalkingSprites). Each sequence is generated via the following procedure. First, one of 1296 different characters is sampled from theSprites dataset [1,23,2]. This character is then animated in two stages. A random walk module produces a sequence of global coordinates of the sprite within a $96 \times 128$ resolution frame. We then sample one of 9 local actions conditioned on the shift induced by the global motion component. Those actions include: walk front, walk left, walk right, spellcast front, spellcast left, spellcast right, slash front, slash left, and slash right. The intuition under conditioning is that the global actions and the local ones should be correlated for more realism. For instance, when the global action module dictates a right shift, the only possible local action should be walk right. Analogously, the left shift induces the walk left action. The up and down shifts are animated with the walk front action. The remaining actions are used to animate the static sprite. To incorporate more generality and to reduce the gap with real data, we apply an independent random walk to the background image (this simulates camera motion). We use a single background image sampled
|
| 140 |
+
|
| 141 |
+
Table 1: Global Motion Analysis (GMA). mIoU evaluations
|
| 142 |
+
|
| 143 |
+
<table><tr><td>Configuration</td><td>LRECB</td><td>LRECF</td><td>LSIZE</td><td>LRECJ</td><td>LBIN</td><td>LVGG</td><td>GLASS</td></tr><tr><td>mIoU</td><td>0.01</td><td>0.08</td><td>0.08</td><td>0.08</td><td>0.87</td><td>0.89</td><td>0.88</td></tr></table>
|
| 144 |
+
|
| 145 |
+
Table 2: Global Motion Analysis (GMA). Shift error estimation
|
| 146 |
+
|
| 147 |
+
<table><tr><td rowspan="2">Configuration</td><td colspan="4">Background Shift Error</td><td colspan="4">Foreground Shift Error</td></tr><tr><td>mean</td><td>min</td><td>max</td><td>∠-ACC</td><td>mean</td><td>min</td><td>max</td><td>∠-ACC</td></tr><tr><td>LBIN</td><td>0.55</td><td>0.01</td><td>1.16</td><td>1.00</td><td>4.46</td><td>0.05</td><td>8.50</td><td>1.00</td></tr><tr><td>LVGG</td><td>0.52</td><td>0.02</td><td>0.90</td><td>1.00</td><td>4.38</td><td>0.01</td><td>8.51</td><td>1.00</td></tr><tr><td>GLASS</td><td>0.51</td><td>0.00</td><td>0.86</td><td>1.00</td><td>4.34</td><td>0.02</td><td>8.32</td><td>1.00</td></tr></table>
|
| 148 |
+
|
| 149 |
+
from the "valleys" class of ImageNet [8]. Each video in the W-Sprites dataset is annotated with per frame actions (i.e., global shifts and local action identifiers), background shifts and character masks. We show sequence samples from our dataset in Fig. 1 (to play the videos view the pdf with Acrobat Reader). The dataset contains videos with 10 to 90 frames per sprite. For testing purposes, we split the dataset into training (about $8/9$ th) and validation sets (about $1/9$ th). The validation set contains sprites never seen during training. For more details, see the supplementary material.
|
| 150 |
+
|
| 151 |
+
# 6 Ablations
|
| 152 |
+
|
| 153 |
+
In this section we separately ablate the global and local components of GLASS. We run the ablations on W-Sprites, which has been introduced in section 5. GMA ablations. For the global motion analysis, we assess the impact of each loss function. Different loss terms are sequentially switched off and the performance of the model trained without those terms is reported. Given that W-Sprites is fully annotated, we propose several metrics to evaluate the training. First, we calculate the mean intersection over union (mIoU) between the ground truth and the predicted segmentation masks. Table 1 shows that the VGG loss seems to slightly hurt the segmentation performance. However, as shown in Table 2 the VGG loss benefits the shift estimation. Notice that in Table 2 we report only the cases where the masks are good enough $(\mathrm{mIoU} > 0.8)$ . For the shift errors we show the $L_{2}$ norm of the difference between the ground truth foreground/background shift and the predicted one (in pixels). We also show the accuracy of the predicted foreground/background shift directions ( $\angle$ -ACC). The direction is considered to be correctly predicted if the angle between the ground truth and the predicted shifts is less than $45^{\circ}$ . Each model is trained for 60K iterations with a batch size of 4. The results are calculated on the validation set. LMA ablations. For the local motion analysis module we specifically design 5 cases that differ from GLASS in its essential components and show the results in Table 3. First, we evaluate swapping the modified mapping $T$ of the
|
| 154 |
+
|
| 155 |
+
Table 3: Local Motion Analysis (LMA). Component ablation results
|
| 156 |
+
|
| 157 |
+
<table><tr><td>Configuration</td><td>LPIPS↓</td><td>FID↓</td><td>FVD↓</td><td>mIoURE↑</td><td>NMIG↑</td><td>NMIs↑</td><td>CON↓</td></tr><tr><td>Plain directions</td><td>0.402</td><td>12.8</td><td>204</td><td>0.83</td><td>0.14</td><td>0.17</td><td>0.03</td></tr><tr><td>Gumbel</td><td>0.402</td><td>16.8</td><td>327</td><td>0.84</td><td>0.00</td><td>0.02</td><td>0.02</td></tr><tr><td>No modulated convs</td><td>0.398</td><td>10.4</td><td>172</td><td>0.89</td><td>0.35</td><td>0.38</td><td>0.03</td></tr><tr><td>Joint input</td><td>0.399</td><td>9.8</td><td>146</td><td>0.89</td><td>0.34</td><td>0.37</td><td>0.03</td></tr><tr><td>LRECS</td><td>0.400</td><td>11.3</td><td>203</td><td>0.89</td><td>0.29</td><td>0.30</td><td>0.01</td></tr><tr><td>GLASS 200K</td><td>0.399</td><td>10.5</td><td>175</td><td>0.88</td><td>0.39</td><td>0.41</td><td>0.02</td></tr><tr><td>CADDY [24]</td><td>0.404</td><td>6.8</td><td>153</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>GLASS 470K</td><td>0.398</td><td>8.2</td><td>129</td><td>0.93</td><td>0.39</td><td>0.40</td><td>0.01</td></tr></table>
|
| 158 |
+
|
| 159 |
+
features $\psi_{t+1}$ for the direct difference between the features $\psi_{t+1} - \psi_t$ (as done in CADDY [24]). We refer to this configuration as "Plain directions". Second, we replace the vector quantization with an MLP that predicts the distribution over actions followed by the Gumbel-Softmax trick to sample a discrete action identifier. We name this model "Gumbel". We also ablate the impact of using modulated convolutional layers by feeding the action embeddings as normal inputs to common convolutional blocks. This cases is referred to as "No modulated convs". Also we consider the case where we feed the global and local action embeddings jointly to all RNN blocks instead of separate ones. We refer to this case as "Joint input". The last case that we evaluate for the ablations is the model trained without $\mathcal{L}_{\mathrm{RECS}}$ . All the models are trained for 200K iterations with a batch size of 4. Additionally we report the metrics of GLASS trained for 470K iterations. As a reference, we also show the performance of CADDY [24] trained on the W-Sprites dataset with the same configuration from the original paper for the Tennis dataset. For visual results, please, refer to the supplementary material.
|
| 160 |
+
|
| 161 |
+
Following CADDY [24], we generate the sequences from the first frames of the validation videos conditioned on the actions inferred from the remaining frames. We measure FID [14], FVD [33] and LPIPS [41] scores on the generated sequences to assess the quality of the generated videos. Additionally, we segment the reconstructed sequences and report the mean IoU with the ground truth masks to assess the ability of the RNN to condition on the input global and local action embeddings. However, the most important aspect of our (and prior) work on controllable models is the identification of the action space. Thus, one needs a metric to assess the quality of the learned action space. For this purpose, we propose to use the normalized mutual information score (NMI) between the ground truth and inferred local actions
|
| 162 |
+
|
| 163 |
+
$$
|
| 164 |
+
\operatorname {N M I} (X, Y) = \frac {2 I (X , Y)}{H (X) + H (Y)}, \tag {12}
|
| 165 |
+
$$
|
| 166 |
+
|
| 167 |
+
where $I(X,Y)$ is the mutual information between $X$ and $Y$ and $H(X)$ is the entropy of $X$ . In our formulation, $X$ and $Y$ correspond to the predicted and ground truth actions respectively. One appealing advantage of NMI for GLASS is that NMI is invariant to permutations of the labels. Another advantage of using
|
| 168 |
+
|
| 169 |
+
Tennis source video
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Fig. 4: Ablation of the number of actions fitted during the training of GLASS on the $W$ -Sprites dataset.
|
| 173 |
+
Fig.5: Example of transferring an action sequence decoded from the source video to the target. To play view the paper in Acrobat Reader.
|
| 174 |
+
|
| 175 |
+
Tennis target video
|
| 176 |
+
|
| 177 |
+
NMI is that NMI does not require the distributions to have the same number of actions. Thus, even with a given known number of ground truth actions, the model can be trained and assessed with a different number of actions. Indeed, the decomposition of a sequence into actions is not unique. For instance the walk left action can be decomposed into turn left and walk. We introduce two different protocols of measuring NMI. First, we use the trained model to map all the pairs of successive frames into actions. Then, the global $\mathrm{NMI}_{\mathrm{G}}$ is computed between the ground truth actions and those predictions. Additionally, we average the per sprite NMI scores to obtain $\mathrm{NMI}_{\mathrm{S}}$ . Normally $\mathrm{NMI}_{\mathrm{S}} > \mathrm{NMI}_{\mathrm{G}}$ . However, if the gap is large enough, this indicates the overfitting and the lack of consistency of the learned actions across different sprites. Therefore, we also report the consistency metric $\mathrm{CON} = \mathrm{NMI}_{\mathrm{S}} - \mathrm{NMI}_{\mathrm{G}}$ . As a reference we use the $\mathrm{NMI}_{\mathrm{RAND}}$ , that is the NMI measured between the ground truth actions and random actions. The results are provided in Table 3. Given that $\mathrm{NMI}_{\mathrm{RAND}} = 0.02$ on the W-Sprites test set, the full GLASS configuration with an NMI of 0.41 shows that the model estimates action sequences with a high correlation to the ground truth actions. Note that since our main focus is learning the action space of the agent, the NMI metric is of higher importance than FID/FVD. However, since the model is based on reconstruction as a supervision signal, it is also important that the FID/FVD are within the high-quality range. Furthermore, we ablate the number of actions $K$ used to train GLASS. In Fig. 4 one can see that $K = 6$ is optimal in both NMI and CON.
|
| 178 |
+
|
| 179 |
+
# 7 Experiments on real data
|
| 180 |
+
|
| 181 |
+
We evaluate GLASS on 3 datasets. For synthetic data we use W-Sprites. For real data we use: 1) the Tennis Dataset and 2) the BAIR Robot Pushing
|
| 182 |
+
|
| 183 |
+
Table 4: BAIR dataset evaluation
|
| 184 |
+
|
| 185 |
+
<table><tr><td>Method</td><td>LPIPS↓</td><td>FID↓</td><td>FVD↓</td></tr><tr><td>MoCoGAN [32]</td><td>0.466</td><td>198</td><td>1380</td></tr><tr><td>MoCoGAN+ [24]</td><td>0.201</td><td>66.1</td><td>849</td></tr><tr><td>SAVP [22]</td><td>0.433</td><td>220</td><td>1720</td></tr><tr><td>SAVP+ [24]</td><td>0.154</td><td>27.2</td><td>303</td></tr><tr><td>Huang et al. [15] w/ non-param control</td><td>0.176</td><td>29.3</td><td>293</td></tr><tr><td>CADDY [24]</td><td>0.202</td><td>35.9</td><td>423</td></tr><tr><td>Huang et al. [15] w/ positional control</td><td>0.202</td><td>28.5</td><td>333</td></tr><tr><td>Huang et al. [15] w/ affine control</td><td>0.201</td><td>30.1</td><td>292</td></tr><tr><td>GLASS</td><td>0.118</td><td>18.7</td><td>411</td></tr></table>
|
| 186 |
+
|
| 187 |
+
Table 5: Tennis dataset evaluation
|
| 188 |
+
|
| 189 |
+
<table><tr><td>Method</td><td>LPIPS↓</td><td>FID↓</td><td>FVD↓</td><td>ADD↓</td><td>MDR↓</td></tr><tr><td>MoCoGAN [32]</td><td>0.266</td><td>132</td><td>3400</td><td>28.5</td><td>20.2</td></tr><tr><td>MoCoGAN+ [24]</td><td>0.166</td><td>56.8</td><td>1410</td><td>48.2</td><td>27.0</td></tr><tr><td>SAVP [22]</td><td>0.245</td><td>156</td><td>3270</td><td>10.7</td><td>19.7</td></tr><tr><td>SAVP+ [24]</td><td>0.104</td><td>25.2</td><td>223</td><td>13.4</td><td>19.2</td></tr><tr><td>Huang et al. [15] w/ non-param control</td><td>0.100</td><td>8.68</td><td>204</td><td>1.76</td><td>0.306</td></tr><tr><td>CADDY [24]</td><td>0.102</td><td>13.7</td><td>239</td><td>8.85</td><td>1.01</td></tr><tr><td>Huang et al. [15] w/ positional control</td><td>0.122</td><td>10.1</td><td>215</td><td>4.30</td><td>0.300</td></tr><tr><td>Huang et al. [15] w/ affine control</td><td>0.115</td><td>11.2</td><td>207</td><td>3.40</td><td>0.317</td></tr><tr><td>GLASS</td><td>0.046</td><td>7.37</td><td>257</td><td>2.00</td><td>0.214</td></tr></table>
|
| 190 |
+
|
| 191 |
+
Dataset. The Tennis Dataset was introduced in [24] and contains $\sim 900$ videos extracted from 2 Tennis matches from YouTube at $96 \times 256$ pixel resolution. The videos are cropped to contain only one half of the court, so that only one player is visible. The BAIR Robot Pushing Dataset [11] contains around $44\mathrm{K}$ clips of a robot arm pushing toys on a flat square table at $256 \times 256$ pixel resolution.
|
| 192 |
+
|
| 193 |
+
Baselines. We compare to CADDY [24], because it allows frame-level playable control, and to Huang et al. [15]. However, the comparison to [15] is not fair, since it requires a prior knowledge of the future agent masks and also it lacks the ability to control the agent through discrete actions (playability). We also report the metrics on other conditional video generation models such as MoCoGAN [32], SAVP [22] and their large scale versions introduced in [24].
|
| 194 |
+
|
| 195 |
+
Quantitative analysis. Following [24] we evaluate GLASS on the video reconstruction task. Given a test video, we use GMA to predict the global shifts and LMA to estimate the discrete actions performed along the video. Further, the agent is segmented using the masking network and the foreground is animated and pasted back to the shifted background using both global and local actions to reconstruct the whole sequence from the first frame. We report FID, FVD and LPIPS scores on the generated videos. On the Tennis dataset we additionally report the Average Detection Distance (ADD) and the Missing Detection Rate
|
| 196 |
+
|
| 197 |
+

|
| 198 |
+
Fig.6: A sequence generated with GLASS trained on the W-Sprites dataset. Note that the level of control provided by GLASS allows to generate unseen motion such as jump. Use Acrobat Reader to play the first frame.
|
| 199 |
+
|
| 200 |
+
(MDR) suggested in [24]. Those metrics are supposed to assess the action space quality by detecting the tennis player with a pretrained human detector and by comparing the locations of the detected agents in the ground truth and generated sequences. On BAIR (see Table 4) our model performs almost $40\%$ better in terms of frame-level quality, but lacks in FVD compared to [15]. However, it is still slightly better than CADDY. On the Tennis dataset (see Table 5) GLASS is around $50\%$ better than the closest competitor in LPIPS, almost $30\%$ better in FID, but loses in FVD. However, GLASS provides finer control over the agent according to ADD and MDR. It is worth noting, that the FVD is largely affected by the background modeling choices. We found that even different interpolation methods had a major impact on the FVD. However, since the main focus of this work is the action space of the foreground agent, we chose the simplest background model that yielded a performance on par (or better) with the SotA.
|
| 201 |
+
|
| 202 |
+
Qualitative analysis. A trained GLASS allows a detailed control of the agent. On W-Sprites, we find that the LMA discovers such actions as turn right, turn left, turn front, spellcast and slash. Note that despite the difference between the discovered set of actions and the ground truth, all videos in the training set can be generated with this reduced set of actions (see Fig. 6). On Tennis we found that the local actions mostly correspond to some leg movements. On BAIR the LMA component discovers some small local deformations such as the state of the manipulator (closed or open).
|
| 203 |
+
|
| 204 |
+
In Fig. 7, we provide visual examples of the GLASS global action space. Given two different starting foregrounds from the BAIR and Tennis datasets (shown in the green channel), we show the generated foregrounds (in the red channel) after applying the right, left, down, up and no motion global shifts. We can also see that global actions apply consistently across different initial foregrounds. To show that the learned action space is consistent across different agents also in their fine-grained dynamics we use GLASS to transfer (both global and local) motion from one video to another. We first extract the sequence of actions in the first video using the GMA and LMA components of GLASS and then sequentially apply these actions to the first frame of the second video. In Fig. 5, we demonstrate it on the Tennis dataset.
|
| 205 |
+
|
| 206 |
+
Finally, in Fig. 8 we provide some sample outputs from our GMA module on test images from all three datasets. Given an input image, we can see that
|
| 207 |
+
|
| 208 |
+

|
| 209 |
+
Fig. 7: Learned global actions on the BAIR and Tennis datasets (foreground-only generation). We use the green channel for the given initial foreground and the red channel for the foreground generated with the selected action. For both datasets we show 2 examples to demonstrate the action consistency.
|
| 210 |
+
|
| 211 |
+

|
| 212 |
+
Fig. 8: Sample outputs from our GMA module. From left to right: original image, predicted segmentation, foreground, and inpainted background.
|
| 213 |
+
|
| 214 |
+
the segmentation network learns to extract accurate masks with which one can obtain high quality foreground images. These are necessary to model local dynamics. The inpainting of the background is sufficiently accurate to separate the two layers. For more visual examples, please see the supplementary material.
|
| 215 |
+
|
| 216 |
+
# 8 Conclusions and limitations
|
| 217 |
+
|
| 218 |
+
GLASS is a novel generative model with a global and local action space that enables a fine-grained modeling and control of dynamics not available in prior work. GLASS is trained in a completely unsupervised manner. We also introduce W-Sprites, a novel dataset for the evaluation of action identification and generation. Our experimental evaluation shows that GLASS learns consistent, and thus transferrable, action representations and is able to synthesize realistic videos with arbitrary action policies. One limitation of GLASS is that it works only on data where the background dynamics are 2D shifts. This does not capture, for example, the motion of the background objects in the BAIR dataset. GLASS is capable of rendering multiple agents within the same frame, but does not learn the separate action spaces of multiple agents. This remains a challenging task, which we plan to tackle in future work.
|
| 219 |
+
|
| 220 |
+
Acknowledgements This work was supported by grant 188690 of the Swiss National Science Foundation.
|
| 221 |
+
|
| 222 |
+
# References
|
| 223 |
+
|
| 224 |
+
1. Liberated pixel cup. https://lpc.opengameart.org, accessed on 2022-03-07
|
| 225 |
+
2. Universal lpc sprite sheet. https://github.com/makrohn/Universal-LPC-spritesheet/tree/7040e2fe85d2cb1e8154ec5fce382589d369bdd8, accessed on 2022-03-07
|
| 226 |
+
3. Acharya, D., Huang, Z., Paudel, D.P., Van Gool, L.: Towards high resolution video generation with progressive growing of sliced wasserstein gans. arXiv preprint arXiv:1810.02419 (2018)
|
| 227 |
+
4. Babaeizadeh, M., Finn, C., Erhan, D., Campbell, R.H., Levine, S.: Stochastic variational video prediction. arXiv preprint arXiv:1710.11252 (2017)
|
| 228 |
+
5. Burgess, C.P., Higgins, I., Pal, A., Matthew, L., Watters, N., Desjardins, G., Lerchner, A.: Understanding disentangling in $\beta$ -vae. arXiv preprint arXiv:1804.03599 (2018)
|
| 229 |
+
6. Caron, M., Bojanowski, P., Joulin, A., Douze, M.: Deep clustering for unsupervised learning of visual features. In: Proceedings of the European conference on computer vision (ECCV). pp. 132-149 (2018)
|
| 230 |
+
7. Chiappa, S., Racaniere, S., Wierstra, D., Mohamed, S.: Recurrent environment simulators. arXiv preprint arXiv:1704.02254 (2017)
|
| 231 |
+
8. Deng, J., Dong, W., Socher, R., Li, L.J., Li, K., Fei-Fei, L.: Imagenet: A large-scale hierarchical image database. In: 2009 IEEE conference on computer vision and pattern recognition. pp. 248-255. IEEE (2009)
|
| 232 |
+
9. Denton, E., Fergus, R.: Stochastic video generation with a learned prior. In: International conference on machine learning. pp. 1174-1183. PMLR (2018)
|
| 233 |
+
0. Dhariwal, P., Nichol, A.: Diffusion models beat gans on image synthesis. Advances in Neural Information Processing Systems 34 (2021)
|
| 234 |
+
1. Ebert, F., Finn, C., Lee, A.X., Levine, S.: Self-supervised visual planning with temporal skip connections. In: CoRL. pp. 344-356 (2017)
|
| 235 |
+
2. Finn, C., Goodfellow, I., Levine, S.: Unsupervised learning for physical interaction through video prediction. Advances in neural information processing systems 29 (2016)
|
| 236 |
+
3. Gafni, O., Wolf, L., Taigman, Y.: Vid2game: Controllable characters extracted from real-world videos. arXiv preprint arXiv:1904.08379 (2019)
|
| 237 |
+
4. Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., Hochreiter, S.: Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in neural information processing systems 30 (2017)
|
| 238 |
+
5. Huang, J., Jin, Y., Yi, K.M., Sigal, L.: Layered controllable video generation. arXiv preprint arXiv:2111.12747 (2021)
|
| 239 |
+
6. Johnson, J., Alahi, A., Fei-Fei, L.: Perceptual losses for real-time style transfer and super-resolution. In: European conference on computer vision. pp. 694-711. Springer (2016)
|
| 240 |
+
7. Karras, T., Aittala, M., Laine, S., Härkönen, E., Hellsten, J., Lehtinen, J., Aila, T.: Alias-free generative adversarial networks. Advances in Neural Information Processing Systems 34 (2021)
|
| 241 |
+
8. Kim, S.W., Zhou, Y., Philion, J., Torralba, A., Fidler, S.: Learning to simulate dynamic environments with gamean. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 1231-1240 (2020)
|
| 242 |
+
9. Kim, Y., Nam, S., Cho, I., Kim, S.J.: Unsupervised keypoint learning for guiding class-conditional video prediction. Advances in neural information processing systems 32 (2019)
|
| 243 |
+
|
| 244 |
+
20. Kingma, D.P., Ba, J.: Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 (2014)
|
| 245 |
+
21. Kingma, D.P., Welling, M.: Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114 (2013)
|
| 246 |
+
22. Lee, A.X., Zhang, R., Ebert, F., Abbeel, P., Finn, C., Levine, S.: Stochastic adversarial video prediction. arXiv preprint arXiv:1804.01523 (2018)
|
| 247 |
+
23. Li, Y., Mandt, S.: Disentangled sequential autoencoder. In: International Conference on Machine Learning (2018)
|
| 248 |
+
24. Menapace, W., Lathuilière, S., Tulyakov, S., Siarohin, A., Ricci, E.: Playable video generation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 10061-10070 (2021)
|
| 249 |
+
25. Mottaghi, R., Bagherinezhad, H., Rastegari, M., Farhadi, A.: Newtonian scene understanding: Unfolding the dynamics of objects in static images. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. pp. 3521-3529 (2016)
|
| 250 |
+
26. Nunes, M.S., Dehban, A., Moreno, P., Santos-Victor, J.: Action-conditioned benchmarking of robotic video prediction models: a comparative study. In: 2020 IEEE International Conference on Robotics and Automation (ICRA). pp. 8316-8322. IEEE (2020)
|
| 251 |
+
27. Oh, J., Guo, X., Lee, H., Lewis, R.L., Singh, S.: Action-conditional video prediction using deep networks in atari games. Advances in neural information processing systems 28 (2015)
|
| 252 |
+
28. Razavi, A., Van den Oord, A., Vinyals, O.: Generating diverse high-fidelity images with vq-vae-2. Advances in neural information processing systems 32 (2019)
|
| 253 |
+
29. Rybkin, O., Pertsch, K., Derpanis, K.G., Daniilidis, K., Jaegle, A.: Learning what you can do before doing anything. arXiv preprint arXiv:1806.09655 (2018)
|
| 254 |
+
30. Smith, L., Gasser, M.: The development of embodied cognition: Six lessons from babies. Artificial life 11(1-2), 13-29 (2005)
|
| 255 |
+
31. Srivastava, N., Mansimov, E., Salakhudinov, R.: Unsupervised learning of video representations using lstms. In: International conference on machine learning. pp. 843-852. PMLR (2015)
|
| 256 |
+
32. Tulyakov, S., Liu, M.Y., Yang, X., Kautz, J.: Mocogan: Decomposing motion and content for video generation. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 1526-1535 (2018)
|
| 257 |
+
33. Unterthiner, T., van Steenkiste, S., Kurach, K., Marinier, R., Michalski, M., Gelly, S.: Towards accurate generative models of video: A new metric & challenges. arXiv preprint arXiv:1812.01717 (2018)
|
| 258 |
+
34. Van Den Oord, A., Vinyals, O., et al.: Neural discrete representation learning. Advances in neural information processing systems 30 (2017)
|
| 259 |
+
35. Vondrick, C., Pirsiavash, H., Torralba, A.: Anticipating the future by watching unlabeled video. arXiv preprint arXiv:1504.08023 2, 2 (2015)
|
| 260 |
+
36. Vondrick, C., Pirsiavash, H., Torralba, A.: Generating videos with scene dynamics. Advances in neural information processing systems 29 (2016)
|
| 261 |
+
37. Wang, Y., Bilinski, P., Bremond, F., Dantcheva, A.: G3an: Disentangling appearance and motion for video generation. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. pp. 5264-5273 (2020)
|
| 262 |
+
38. Wang, Y., Bilinski, P., Bremond, F., Dantcheva, A.: Imaginar: Conditional spatio-temporal gan for video generation. In: Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision. pp. 1160-1169 (2020)
|
| 263 |
+
39. Weissenborn, D., Täckström, O., Uszkoreit, J.: Scaling autoregressive video models. arXiv preprint arXiv:1906.02634 (2019)
|
| 264 |
+
|
| 265 |
+
40. Yan, W., Zhang, Y., Abbeel, P., Srinivas, A.: Videogpt: Video generation using vq-vae and transformers. arXiv preprint arXiv:2104.10157 (2021)
|
| 266 |
+
41. Zhang, R., Isola, P., Efros, A.A., Shechtman, E., Wang, O.: The unreasonable effectiveness of deep features as a perceptual metric. In: Proceedings of the IEEE conference on computer vision and pattern recognition. pp. 586-595 (2018)
|
controllablevideogenerationthroughglobalandlocalmotiondynamics/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2a00ef59e546e470a0f6c4fe610f584b90ca8c281db99442f0cd443390bfabeb
|
| 3 |
+
size 384571
|
controllablevideogenerationthroughglobalandlocalmotiondynamics/layout.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:73d5a3d068703a80a6b3b7feae8a2a0625552fb7c87c3102fc278ff4f86fd77b
|
| 3 |
+
size 441686
|