Datasets:
Add files using upload-large-folder tool
Browse files- md/dev/09hVcSDkea/09hVcSDkea.md +392 -0
- md/dev/0RTJcuvHtIu/0RTJcuvHtIu.md +249 -0
- md/dev/1W0z96MFEoH/1W0z96MFEoH.md +250 -0
- md/dev/3tbTw2ga8K/3tbTw2ga8K.md +325 -0
- md/dev/4NpoSrT8uU-/4NpoSrT8uU-.md +307 -0
- md/dev/4hturzLcKX/4hturzLcKX.md +0 -0
- md/dev/7YTh6S8HIY/7YTh6S8HIY.md +256 -0
- md/dev/BIpTWmO_BY/BIpTWmO_BY.md +322 -0
- md/dev/BqxE86ufTzq/BqxE86ufTzq.md +416 -0
- md/dev/Czsdv-S4-w9/Czsdv-S4-w9.md +460 -0
- md/dev/Dl4LetuLdyK/Dl4LetuLdyK.md +368 -0
- md/dev/EJka_dVXEcr/EJka_dVXEcr.md +360 -0
- md/dev/EdIGMCHk4l/EdIGMCHk4l.md +333 -0
- md/dev/GKfNB4BegL/GKfNB4BegL.md +356 -0
- md/dev/HH3GHN_Q1Ba/HH3GHN_Q1Ba.md +611 -0
- md/dev/MWoZh1gvbxA/MWoZh1gvbxA.md +422 -0
- md/dev/NAQvF08TcyG/NAQvF08TcyG.md +578 -0
- md/dev/OnD9zGAGT0k/OnD9zGAGT0k.md +711 -0
- md/dev/QJb1-8NH2Ux/QJb1-8NH2Ux.md +351 -0
- md/dev/RFGkzxMFqby/RFGkzxMFqby.md +392 -0
- md/dev/S37hOerQLB/S37hOerQLB.md +0 -0
- md/dev/SHbhHHfePhP/SHbhHHfePhP.md +551 -0
- md/dev/UDqHhbqYJV/UDqHhbqYJV.md +0 -0
- md/dev/VnAwNNJiwDb/VnAwNNJiwDb.md +253 -0
- md/dev/XGzk5OKWFFc/XGzk5OKWFFc.md +318 -0
- md/dev/Y4cs1Z3HnqL/Y4cs1Z3HnqL.md +0 -0
- md/dev/ZWjEkv9rjo/ZWjEkv9rjo.md +341 -0
- md/dev/aNWiwR2HiOs/aNWiwR2HiOs.md +458 -0
- md/dev/e1u9PVnwNr/e1u9PVnwNr.md +0 -0
- md/dev/e8PVEkSa4Fq/e8PVEkSa4Fq.md +304 -0
- md/dev/g2YraF75Tj/g2YraF75Tj.md +0 -0
- md/dev/h0OYV0We3oh/h0OYV0We3oh.md +0 -0
- md/dev/hFCUPkSSRE/hFCUPkSSRE.md +0 -0
- md/dev/jlAjNL8z5cs/jlAjNL8z5cs.md +355 -0
- md/dev/k9bx1EfHI_-/k9bx1EfHI_-.md +389 -0
- md/dev/nL2lDlsrZU/nL2lDlsrZU.md +0 -0
- md/dev/nN3aVRQsxGd/nN3aVRQsxGd.md +323 -0
- md/dev/nUmCcZ5RKF/nUmCcZ5RKF.md +318 -0
- md/dev/o4neHaKMlse/o4neHaKMlse.md +287 -0
- md/dev/oDRQGo8I7P/oDRQGo8I7P.md +414 -0
- md/dev/oEsYs3WRc3/oEsYs3WRc3.md +486 -0
- md/dev/qHrADgAdYu/qHrADgAdYu.md +0 -0
- md/dev/qI4542Y2s1D/qI4542Y2s1D.md +371 -0
- md/dev/slHNW9yRie0/slHNW9yRie0.md +441 -0
- md/dev/ti6fH3EhFkv/ti6fH3EhFkv.md +283 -0
- md/dev/vSix3HPYKSU/vSix3HPYKSU.md +635 -0
- md/dev/vqGi8Kp0wM/vqGi8Kp0wM.md +324 -0
- md/dev/wqD6TfbYkrn/wqD6TfbYkrn.md +403 -0
- md/dev/zDiHoIWa0q1/zDiHoIWa0q1.md +306 -0
- md/dev/zSeoDvsDCe/zSeoDvsDCe.md +0 -0
md/dev/09hVcSDkea/09hVcSDkea.md
ADDED
|
@@ -0,0 +1,392 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CORRUPTED IMAGE MODELING FOR SELF-SUPERVISED VISUAL PRE-TRAINING
|
| 2 |
+
|
| 3 |
+
Yuxin Fang 1, 2∗ Li Dong 2 Hangbo Bao 2 Xinggang Wang 1† Furu Wei 2 1 School of EIC, Huazhong University of Science & Technology 2 Microsoft Research {yxf,xgwang}@hust.edu.cn
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We introduce Corrupted Image Modeling (CIM) for self-supervised visual pretraining. CIM uses an auxiliary generator with a small trainable BEiT (Bao et al., 2021) to corrupt the input image instead of using artificial [MASK] tokens, where some patches are randomly selected and replaced with plausible alternatives sampled from the BEiT output distribution. Given this corrupted image, an enhancer network learns to either recover all the original image pixels, or predict whether each visual token is replaced by a generator sample or not. The generator and the enhancer are simultaneously trained and synergistically updated. After pre-training, the enhancer can be used as a high-capacity visual encoder for downstream tasks. CIM is a general and flexible visual pre-training framework that is suitable for various network architectures. For the first time, CIM demonstrates that both ViT and CNN can learn rich visual representations using a unified, non-Siamese framework. Experimental results show that our approach achieves compelling results in vision benchmarks, such as ImageNet classification and ADE20K semantic segmentation.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Vision Transformers (ViTs) (Dosovitskiy et al., 2020) are transferring the landscape of computer vision, not only in terms of the network architecture design, but also the self-supervised pre-training recipe. Masked image modeling (MIM) (Bao et al., 2021), which randomly masks out some input tokens and then recovers the masked content by conditioning on the visible context, is able to learn rich visual representations and shows promising performance on various vision benchmarks (Zhou et al., 2021; He et al., 2021; Xie et al., 2021; Dong et al., 2021; Wei et al., 2021).
|
| 12 |
+
|
| 13 |
+
Originated in masked language modeling (Devlin et al., 2019), MIM (Figure 1a) is tailor-made for specific architectures (Vaswani et al., 2017), which is generally capable of receiving and processing tokenized inputs such as the artificial [MASK] tokens. Meanwhile, the more common and natural input signal in computer vision is the image in RGB domain with 2D regular grid structures. In order to apply MIM pre-training for images, ViT has to “patchify” the input image into a 1D sequence of non-overlapping patch embeddings, and then use [MASK] tokens to perturb them.
|
| 14 |
+
|
| 15 |
+
MIM is tightly coupled with the Transformer family, and the usage of [MASK] tokens limits its scope of application to some extent. More importantly, MIM is not directly suitable for convolutional neural networks (CNNs) (LeCun et al., 1989), the dominant architecture for computer vision in the last decade. Introducing [MASK] tokens in any intermediate stage of CNN is infeasible, as convolution’s intrinsic dense-sliding-window paradigm causes information leakage between visual features in previous layers and therefore impedes the MIM. Therefore the large CNN family cannot directly benefit from the upsurge of this new pre-training scheme. Moreover, the usage of [MASK] tokens causes a discrepancy between pre-training and fine-tuning (Devlin et al., 2019; Clark et al., 2020), as the artificial [MASK] tokens never appear in the fine-tuning stage.
|
| 16 |
+
|
| 17 |
+
In this paper, we present a new visual pre-training framework, called Corrupted Image Modeling (CIM, Figure 1b), which avoids directly manipulating [MASK] tokens on pre-trained models and generalizes quite well to both ViT and CNN architectures. Rather than directly using artificial [MASK] tokens to corrupt a portion of non-overlapping patch embeddings as in MIM, CIM uses a small trainable BEiT (Bao et al., 2021) as an auxiliary generator to corrupt the input image. Specifically, the BEiT generator learns to predict visual tokens at the masked positions, where we utilize the predicted distribution to sample visual tokens’ replacements. The replaced visual tokens together with the golden tokens that directly produced by a pre-trained frozen image tokenizer encoder (e.g., the DALL-E (Ramesh et al., 2021) dVAE encoder) given the same input as the small trainable BEiT are then mapped back to the image RGB domain by a pre-trained frozen tokenizer decoder (e.g., the DALL-E dVAE decoder). The resulting corrupted image serves as the input of the enhancer, which is the model to be pre-trained and transferred.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Overview of our Corrupted Image Modeling (CIM) and comparisons with Masked Image Modeling (MIM). MIM (Figure 1a) requires the pre-trained architecture to receive and process the artificial [MASK] tokens, while CIM (Figure 1b) relaxes these restrictions by using a trainable generator to sample corrupted images serving as the input for the enhancer. Similar to BEiT, the small generator learns to predict the golden visual token produced by the pre-trained frozen image tokenizer encoder (not shown in the figure) based on partial observations of the input. The enhancer can be various architectures including CNN and learns either a generative or a discriminative visual pre-training objective. After pre-training, we throw out the generator and fine-tune the enhancer on downstream tasks. The dice icon in Figure 1b refers to the visual tokens’ stochastic sampling process, and the lock icon means the pre-trained image tokenizer decoder is frozen.
|
| 21 |
+
|
| 22 |
+
For the enhancer, the choice of pre-training objectives is quite flexible. We study two representatives: a generative objective that regresses all the original image pixels given the corrupted image (Dosovitskiy et al., 2020; Chen et al., 2020a), dubbed as Pixel Residual learning (RESPIX), and a discriminative objective that predicts whether each visual token is replaced by the small generator or not (Clark et al., 2020), dubbed as Replaced Visual token Detection (REVDET). After pre-training, the enhancer can be used as a strong feature extractor for visual downstream tasks.
|
| 23 |
+
|
| 24 |
+
Overall, CIM is a general and flexible pre-training framework suited for different kinds of visual encoders. For the first time, we demonstrate that both ViT and CNN can learn rich visual representations using a unified non-Siamese structure. Experimental results show that our approach achieves compelling results in vision benchmarks, such as ImageNet classification and ADE20K semantic segmentation. We hope CIM can serve as a promising starting point for exploring flexible & unified visual representation learning of various architectures.
|
| 25 |
+
|
| 26 |
+
# 2 CORRUPTED IMAGE MODELING (CIM)
|
| 27 |
+
|
| 28 |
+
Figure 1b shows the overview of CIM. Our approach simultaneously learns two neural networks: an auxiliary generator and an enhancer. The generator is used to corrupt the input image, while the enhancer receives the corrupted image (Figure 2) and learns either a generative or a discriminative visual pretext task. After pre-training, we throw out the generator and fine-tune the enhancer on downstream tasks.
|
| 29 |
+
|
| 30 |
+
# 2.1 GENERATOR
|
| 31 |
+
|
| 32 |
+
Rather than using artificial [MASK] tokens to corrupt the input image, we learn a trainable auxiliary generator to relax the architectural constraints of MIM. Moreover, the generator enriches the diversity of corrupted images via stochastic sampling, which helps the enhancer generalize. The generator consists of a pre-trained frozen image tokenizer, and a small trainable BEiT (Bao et al., 2021).
|
| 33 |
+
|
| 34 |
+

|
| 35 |
+
(a) Corrupted image samples from ImageNet-1K training set. Although the model is trained using the same dataset, the corrupted image samples still vary to a certain extent. Therefore during pre-training, the generator is able to continuously provide abundant and diverse corrupted samples for the enhancer.
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
(b) Corrupted image samples from COCO val split (Lin et al., 2014) using ImageNet-1K pre-trained model.
|
| 39 |
+
Figure 2: Visualizations of some corrupted image samples. For each image set, we show (from left to right) the original image, the masked image, and four different corrupted images sampled from the generator output distribution with the same masked input. Simple stochastic sampling can greatly enrich the corrupted image distribution in terms of both low-level features and high-level semantics, which feeds the enhancer better.
|
| 40 |
+
|
| 41 |
+
The frozen image tokenizer in CIM is a pre-trained discrete variational autoencoder (dVAE) (Rolfe, 2016; Van Den Oord et al., 2017), consisting of a paired encoder and decoder. The tokenizer encoder maps the input image into a sequence of discrete visual tokens with a fixed vocabulary size. The tokenizer decoder can recover semantically plausible images given a permutation of appropriate and meaningful visual tokens. We directly use the DALL-E (Ramesh et al., 2021) tokenizer, following BEiT.
|
| 42 |
+
|
| 43 |
+
The small BEiT consists of several Transformer encoder layers and is trained to perform MIM, which uses two views for each input image, i.e., a sequence of non-overlapping patch embeddings, and their corresponding discrete visual tokens. Patch embeddings are linearly embedded from non-overlapping input image patches. Discrete visual tokens are from the DALL-E tokenizer encoder, serving as the prediction target for BEiT.
|
| 44 |
+
|
| 45 |
+
Given a sequence of patch embeddings, the small BEiT randomly masks out a set of positions. The patch embeddings at the masked positions are replaced with special mask embeddings. The small BEiT takes this corrupted sequence of patch embeddings as the input, and learns to predict the corresponding discrete visual tokens at all masked positions given the visible context only. In CIM pre-training, the size of the small BEiT we use is typically a quarter or a half of the enhancer.
|
| 46 |
+
|
| 47 |
+
Using discrete visual tokens to represent images enables CIM to perform stochastic sampling during the corrupted image’s generation process, which greatly enriches the output set of the generator. In this paper, we directly sample from softmax with a temperature of 1 at all the masked positions according to the small BEiT output distribution. All the masked tokens are replaced by the sampled visual tokens. The sampled tokens together with the golden tokens that are directly produced by the image tokenizer encoder at all the non-masked positions constitute the input for the image tokenizer decoder. Then the decoder maps those plausible visual tokens to a corrupted image (refer to examples in Figure 2), which serves as the input for the enhancer.
|
| 48 |
+
|
| 49 |
+

|
| 50 |
+
(a) CIM-RESPIX pre-training objective with sliding window normalized pixels as the enhancer prediction target.
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
(b) CIM-RESPIX pre-training objective with unnormalized pixels as the enhancer prediction target.
|
| 54 |
+
Figure 3: Example visualization results on COCO val split images from vanilla ViT-Base/16 model pre-trained with the RESPIX objective using ImageNet-1K training data. For each image quadruplet, we show the original input image (1st column), the masked input image for the generator (2nd column), the corrupted image sampled from the generator output (3rd column), and the enhancer output (4th column). Given the corrupted image, the enhancer is able to perform image denoising, deblurring and completion, etc., and learns to predict plausible output in terms of both low-level features as well as high-level semantics.
|
| 55 |
+
|
| 56 |
+
# 2.2 ENHANCER
|
| 57 |
+
|
| 58 |
+
Given the corrupted image sampled from the auxiliary generator, the enhancer learns either a generative or a discriminative visual pretext task. The prediction head is a simple linear layer, and the choice of pre-training objectives is quite flexible. In this paper, we study two representative objectives, coined as Pixel Residual learning (RESPIX) and Replaced Visual token Detection (REVDET).
|
| 59 |
+
|
| 60 |
+
RESPIX (Figure 3) is a generative visual pretext task that requires the enhancer to predict the uncorrupted pixel value for all positions given the corrupted input. Instead of directly regressing the original pixel, MAE (He et al., 2021) suggests learning the normalized counterpart. Specifically, the image is partitioned into a set of non-overlapping patches, and each pixel is normalized by the mean and standard deviation of all pixels in the patch it lives in, i.e., patches with layer normalization (Ba et al., 2016) are the reconstruction target.
|
| 61 |
+
|
| 62 |
+
In CIM, we further propose to normalize the prediction target inside a sliding window, i.e., each pixel is normalized by all pixels in a local $8 \times 8$ sized window centered at where the target pixel lives in. We observe improved representation quality using the sliding window normalization paradigm.
|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
Figure 4: Normalizations as learning templates for RESPIX. For each image triplet, we visualize the original image (left), the template of using non-overlapping window normalization (He et al., 2021), and the template of the proposed sliding window normalization paradigm. Our approach can provide more accurate and moderate hints that can boost the enhancer’s pre-training as well as improve its representation quantity.
|
| 66 |
+
|
| 67 |
+
Naive pixel recovery without normalization tends to waste modeling capability on learning short-range dependencies and high-frequency details (Ramesh et al., 2021; Bao et al., 2021), while the normalized target can mitigate irrelevant information fittings. From another perspective, normalizations are equal to providing learning templates, as shown in Figure 4. With the normalized prediction target, the enhancer only needs to learn the residual pixel value at each position given the normalized pixel value, while the unnormalized target provides no hint therefore the enhancer has to “learn to see in the dark” (i.e., regress from RGB: 0, 0, 0). It is also hard for the enhancer to learn without a template since the corrupted image usually provides bad priors (refer to the corrupted image samples in Figure 2 and Figure 3). Therefore, we believe appropriate and moderate hints will help the enhancer see better.
|
| 68 |
+
|
| 69 |
+
REVDET is a discriminative visual pretext task that requires the enhancer to determine whether each visual token is replaced by a generator sample or not. To be specific, the visual tokens produced by the pre-trained frozen image tokenizer encoder are considered as golden tokens. If a generated visual token is different from the golden token at the same position, that generated token is considered “replaced”, and vice versa.
|
| 70 |
+
|
| 71 |
+
REVDET is inspired by ELECTRA (Clark et al., 2020) in language modeling. The main difference is, in the proposed CIM, the determining criterion of replacement is hidden in the corrupted image. Token replacement is a kind of local, high-frequency operation by nature. However, the visual token set after sampling and replacement is further smoothed and processed by the image tokenizer decoder. Therefore the token sampling and replacement operations are finally embodied as non-local, high-level semantics changes in the corrupted image. The enhancer is required to “decrypt” it and identify all the replaced tokens given the corrupted input, which yields a nontrivial and meaningful visual pretext task1. To some extent, REVDET also learns the DALL-E dVAE’s visual codebook similar to BEiT, but in a discriminative manner.
|
| 72 |
+
|
| 73 |
+
The enhancer is regarded as the visual encoder after pre-training. Moreover, unlike masked image modeling, CIM does not assume too many architectural priors for the pre-trained network. We successfully pre-train a high-capacity vanilla ResNet-50 (He et al., 2016), ResNet-50x2 and ResNet$5 0 { \bf x } 4$ enhancers that achieve compelling transfer learning performance using a similar configuration as pre-training a ViT enhancer. For the first time, we demonstrate that both ViT and CNN can learn strong visual representations using a unified non-Siamese framework.
|
| 74 |
+
|
| 75 |
+
# 2.3 TRAINING AND OPTIMIZATION
|
| 76 |
+
|
| 77 |
+
The auxiliary generator and the enhancer are simultaneously trained and synergistically (rather than adversarially as GAN (Goodfellow et al., 2014)) updated. The trainable part of the generator, i.e., the small BEiT, learns a MIM objective in the same vein as in (Bao et al., 2021). The whole pre-trained image tokenizer is frozen.
|
| 78 |
+
|
| 79 |
+
For the RESPIX visual pretext task, the enhancer is optimized by a combination of $l _ { 1 }$ and $l _ { 2 }$ loss. For the REVDET visual pretext task, the enhancer is learned by binary cross-entropy loss. Notice that the gradients of the enhancer are not back-propagated through the generator. A detailed formulation is presented in Appendix A.3.
|
| 80 |
+
|
| 81 |
+
# 3 EXPERIMENTS
|
| 82 |
+
|
| 83 |
+
We study CIM self-supervised pre-trained vanilla ViT-Small/16 (Touvron et al., 2021a), vanilla ViT-Base/16 (Dosovitskiy et al., 2020) and vanilla ResNet-50 (He et al., 2016) models. We use the actual processed images / views to measure the pre-training epochs (PT epochs). ImageNet-1K (Deng et al., 2009) training data is used to pre-train the small BEiT and the enhancer. Our pre-training setting generally follows BEiT (Bao et al., 2021). Unlike BEiT, CIM only uses cropping and flipping for data argumentation, while dropout (Srivastava et al., 2014) and stochastic depth (Huang et al., 2016) are not applied. The detailed pre-training settings are summarized in the Appendix A.4. Notably, the pre-training configurations are almost the same for both ViT and CNN architectures.
|
| 84 |
+
|
| 85 |
+
In order to evaluate the pre-trained representations from CIM, for both ViT and CNN architectures, we conduct supervised end-to-end fine-tuning (FT) experiments on ImageNet-1K (Deng et al., 2009) image classification in $\ S 3 . 1$ , and ADE20K (Zhou et al., 2019) semantic segmentation in $\ S 3 . 2$ .
|
| 86 |
+
|
| 87 |
+
Table 1: ImageNet-1K end-to-end fine-tuning top-1 accuracy of vanilla ViT-Small/16 and ViT-Base/16 models. †Doubled attention heads. ‡Our reproduction.
|
| 88 |
+
|
| 89 |
+
<table><tr><td>Models PT Epochs Top-1 ViT-Small/16 model results</td></tr><tr><td>Scratch (Touvron et al., 2021a) MoCo-v3† (Chen et al., 2021) 600 DINO (Caron et al., 2021) 1600 81.5 BEiT (Bao et al., 2021) 300</td></tr><tr><td>CIM-RESPIX (Ours) 300 81.5 CIM-REVDET (Ours) 300 81.6</td></tr><tr><td>ViT-Base/l6 model results 81.8</td></tr><tr><td>Scratch (Touvron et al., 2021a)</td></tr><tr><td>Scratch (He et al., 2021) 82.3</td></tr><tr><td>DINO (Caron et al., 2021) 1600 82.8 MoCo-v3 (Chen et al.,2021) 600 83.2</td></tr><tr><td>BEiT (Bao et al.,2021) 300 82.9 BEiT (Bao et al., 2021) 800 83.2</td></tr></table>
|
| 90 |
+
|
| 91 |
+
Ablation study on ImageNet-1K is presented in $\ S 3 . 3$ . For ImageNet-1K, we observe ${ \sim } 0 . 2$ Top-1 acc. fluctuations. For ADE20K, we observe ${ \sim } 0 . 5$ mIoU fluctuations. We report key results using the median of 3 independent runs.
|
| 92 |
+
|
| 93 |
+
Table 2: ImageNet-1K end-to-end fine-tuning top-1 accuracy of vanilla ResNet-50 model. RSB (Wightman et al., 2021) is the current vanilla ResNet stateof-the-art training procedure.
|
| 94 |
+
|
| 95 |
+
<table><tr><td>Models</td><td>PT Epochs Top-1</td></tr><tr><td>Fine-tuning for l0o epochs RSB A3 (Wightman et al., 2021) CIM-REVDET (Ours) 300</td><td>78.1 78.8</td></tr><tr><td>Fine-tuning for 300 epochs RSB A2 (Wightman et al., 2021) SimSiam (Chen & He,2021) MoCo-v2 (Chen et al., 2020c) SimCLR (Chen et al., 2020b) SimCLR (Chen et al., 2020b) BYOL (Grill et al., 2020) SwAV (Caron et al., 2020) CIM-RESPIX(Ours) CIM-REVDET (Ours)</td><td>79.8 400 79.1 400 79.6 800 79.9 2000 80.0 400 80.0 600 80.1 300 79.9 300</td></tr><tr><td>Fine-tuning for 60o epochs</td><td>80.5</td></tr><tr><td>RSB A1 (Wightman et al., 2021) CIM-REVDET (Ours) 300</td><td>80.4 80.7</td></tr></table>
|
| 96 |
+
|
| 97 |
+
# 3.1 IMAGE CLASSIFICATION
|
| 98 |
+
|
| 99 |
+
ViT. The ImageNet-1K end-to-end fine-tuning top-1 accuracy of vanilla ViT-Small/16 and ViTBase/16 models are presented in Table 1. We fine-tune the small-sized model for 200 epochs, and the base-sized model for 100 epochs. Other self-supervised methods in Table 1 use the same or longer fine-tuning schedule. The fine-tuning hyperparameters mostly follow BEiT, while our layerwise lr decay rate is set to 0.8 as suggested by Clark et al. (2020). See Appendix A.4 for detailed configurations.
|
| 100 |
+
|
| 101 |
+
As shown in Table 1, CIM is able to achieve better accuracy with fewer pre-training epochs compared with other representative self-supervised vanilla ViT models. Moreover, we find both REVDET and RESPIX visual pretext task can help the ViT enhancer learn useful representations.
|
| 102 |
+
|
| 103 |
+
ResNet-50. We demonstrate that CIM can also pre-train a high-capacity ResNet-50 model with the fewest possible modifications from the ViT pre-training settings that can achieve compelling fine-tuning performances on ImageNet-1K. We use the AdamW optimizer (Loshchilov & Hutter, 2017) for fine-tuning, and other configurations basically follow the advanced training recipe of RSB (Wightman et al., 2021). For other self-supervised baselines, we select the best lr out of $\{ 5 \mathrm { e } \mathrm { - } 3$ , 8e-3, 12e-3} and keep other settings unchanged to ensure a fair and challenging competition. The detailed configurations are given in Appendix A.4.
|
| 104 |
+
|
| 105 |
+
As shown in Table 2, under such a demanding training procedure, CIM pre-trained ResNet-50 model can still outperform several representative self-supervised methods based on the Siamese framework as well as the modernized state-of-the-art ResNet-50 results. Using the improved fine-tuning recipe, we also observe performance degeneration for some self-supervised baselines compared with the RSB from scratch results. Notably, even with the extreme 600-epoch training schedule, the CIM representation can still improve the state-of-the-art RSB A1 by $0 . 3 \%$ .
|
| 106 |
+
|
| 107 |
+
# 3.2 SEMANTIC SEGMENTATION
|
| 108 |
+
|
| 109 |
+
We study the transfer learning performance of CIM pre-trained vanilla ViT-Base/16 and ResNet-50 models on the ADE20K semantic segmentation benchmark. The pre-trained models are used as an encoder, and we purposefully choose simple decoders to better reveal the pre-trained representations. Experiments are based on the code of Bao et al. (2021); MMSegmentation (2020).
|
| 110 |
+
|
| 111 |
+
Specifically, for ViT-Base/16 we use a simple linear layer as the decoder, and for ResNet-50 we choose the ubiquitous FCN (Long et al., 2015) as the decoder. For ViT, the baseline settings as well as the fine-tuning recipes are from (Bao et al., 2021). We select the best lr out of $\{ 1 \mathrm { e } { - } 4 , 3 \mathrm { e } { - } 4 , 5 \mathrm { e } { - } 4 , 7 \mathrm { e } { - } 4 \}$ for DINO. For BEiT we use the default setting (lr 7e4 with a decay rate of 0.65). For CIM pretrained ViT, we set the fine-tuning lr equal to 3e-4 with a decay rate of 0.8 as suggested by Clark et al. (2020). For ResNet-50, we use the canonical configuration for all methods, i.e., the optimizer is SGD with a momentum of 0.9, lr follows a poly decay schedule, and the batch size is 16. The training crop size is set to 512 for all models, and we use singlescale inference.
|
| 112 |
+
|
| 113 |
+
As summarized in Table 3, when transferred to semantic segmentation task, CIM pre-trained models can still achieve competitive performances compared with other approaches. Notably, for ResNet-50, as the fine-tuning schedule becomes longer (i.e., 80k iterations 160k iterations), the performance gain from the ImageNet-1K supervised pre-trained representation is small. Moreover, the performance is even worse than training from scratch. Meanwhile, the CIM pre-trained ResNet-50 representation can provide sustaining performance gain for a longer fine-tuning schedule.
|
| 114 |
+
|
| 115 |
+
Table 3: ADE20K semantic segmentation performances (mIoU) of ViT and ResNet-50 models.
|
| 116 |
+
|
| 117 |
+
<table><tr><td>Models PT Epochs Top-1</td></tr><tr><td>Fine-tuning for l60k iterations</td></tr><tr><td>DINO (Caron et al., 2021) 1600 43.0</td></tr><tr><td>BEiT (Bao et al., 2021) 300 43.2</td></tr><tr><td>CIM-RESPIX (Ours) 300 43.5</td></tr><tr><td>CIM-REVDET (Ours) 300 43.6</td></tr></table>
|
| 118 |
+
|
| 119 |
+
(a) Vanilla ViT-Base/16 as encoder with one linear layer as decoder.
|
| 120 |
+
|
| 121 |
+
<table><tr><td>Models PT Epochs mloU</td></tr><tr><td>Fine-tuning for 80k iterations Training from Scratch 29.9 IN1K Supervised† (He et al., 2019) 120 35.9 CIM-REVDET (Ours)</td></tr><tr><td>300 36.2 Fine-tuning forl6Ok iterations Training from Scratch 36.7 IN1K Supervised (He et al., 2019) 120 36.1 BYOL (Grill et al., 2020) 400 37.1</td></tr><tr><td>SimCLR (Chen et al.,2020b) 2000 37.7 CIM-RESPIX (Ours) 300 38.7</td></tr><tr><td>SimSiam (Chen & He,2021) 400 37.1 SwAV (Caron et al., 2020) 600 37.2 MoCo-v2 (Chen et al.,2020c) 400 37.5 SimCLR (Chen et al., 2020b) 800 37.6</td></tr></table>
|
| 122 |
+
|
| 123 |
+
(b) Vanilla ResNet-50 as encoder with a classic FCN as decoder.
|
| 124 |
+
|
| 125 |
+
Together with the observation from $\ S 3 . 1$ , we demonstrate CIM is a general, non-Siamese framework that is capable of pre-training both strong ViT and CNN visual encoders.
|
| 126 |
+
|
| 127 |
+
# 3.3 ABLATION STUDIES
|
| 128 |
+
|
| 129 |
+
Ablation studies are conducted using 300-epoch CIM-RESPIX pre-trained ViT-Base model with 100 epochs fine-tuning on ImageNet-1K unless specified. Some additional analysis is available in Appendix A.1.
|
| 130 |
+
|
| 131 |
+
Masking Strategy and Masking Ratio. As shown in Table 4, we observe CIM works better with simple random masking (He et al., 2021; Xie et al., 2021) compared with the blockwise masking strategy (Bao et al., 2021).
|
| 132 |
+
|
| 133 |
+
The optimal random masking ratio is around $50 \%$ , which we find also holds for the REVDET pretext task, in part because it provides almost equal amounts of positive and negative training samples.
|
| 134 |
+
|
| 135 |
+
The Small BEiT Depth and Weight Sharing. Following Meng et al. (2021); Chi et al. (2021), we adjust the size of the small trainable BEiT by varying its depth (i.e., the number of Transformer encoder layers) instead of its width (i.e., the feature dimension). As summarized in Table 5, the small BEiT with 4 to 6 layers is generally fine.
|
| 136 |
+
|
| 137 |
+
It is also beneficial to share the patch embedding layer as well as the first two Transformer encoder layers between the small BEiT and enhancer as long as the enhancer is also ViT. We hypothesize that sharing the earlier layers can help calibrate the enhancer since the small BEiT receives the real inputs while the enhancer sees the same sources but with corrupted views.
|
| 138 |
+
|
| 139 |
+
Table 4: Ablation study: masking strategy and masking ratio.
|
| 140 |
+
|
| 141 |
+
<table><tr><td>Masking Strategy</td><td>Masking Ratio</td><td>Top-1 Acc.</td></tr><tr><td>Blockwise</td><td>40%</td><td>82.8</td></tr><tr><td>Blockwise</td><td>50%</td><td>82.9</td></tr><tr><td>Blockwise</td><td>60%</td><td>82.8</td></tr><tr><td>Random</td><td>40%</td><td>83.0</td></tr><tr><td>Random</td><td>50%</td><td>83.3</td></tr><tr><td>Random</td><td>60%</td><td>83.1</td></tr></table>
|
| 142 |
+
|
| 143 |
+
Table 5: Ablation study: depth of the small BEiT in the generator and weight sharing.
|
| 144 |
+
|
| 145 |
+
<table><tr><td># Enc.Layers</td><td>Weight Sharing</td><td>Top-1 Acc.</td></tr><tr><td>4</td><td>X</td><td>83.1</td></tr><tr><td>4</td><td>√</td><td>83.3</td></tr><tr><td>5</td><td>√</td><td>83.2</td></tr><tr><td>6</td><td>√</td><td>83.2</td></tr><tr><td>7</td><td>√</td><td>83.1</td></tr><tr><td>8</td><td>√</td><td>82.9</td></tr></table>
|
| 146 |
+
|
| 147 |
+
Table 6: Ablation study: pixel reconstruction target for RESPIX pre-training objective.
|
| 148 |
+
|
| 149 |
+
<table><tr><td>REsPIX Recon. Target</td><td>Top-1 Acc.</td></tr><tr><td>w/o norm.</td><td>82.8</td></tr><tr><td>norm.w/ non-overlap win.</td><td>83.0</td></tr><tr><td>norm. w/ sliding win.</td><td>83.3</td></tr></table>
|
| 150 |
+
|
| 151 |
+
Table 7: Ablation study: sampling strategy for visual tokens.
|
| 152 |
+
|
| 153 |
+
<table><tr><td>Sampling Strategy</td><td>Top-1 Acc.</td></tr><tr><td>Uniform sampling</td><td>77.2</td></tr><tr><td>argmax sampling</td><td>78.5</td></tr><tr><td>softmax sampling</td><td>83.3</td></tr></table>
|
| 154 |
+
|
| 155 |
+
Target for RESPIX. We believe an appropriate normalization technique can provide moderate hints that can help improve the enhancer’s representation quality with the RESPIX visual pretext task (see our discussion of Figure 4). As shown in Table 6, the proposed sliding window normalization improves the fine-tuning accuracy by $0 . 5 \%$ vs. the reconstruction target without normalization, and is also $0 . 3 \%$ better than the normalization method proposed in He et al. (2021).
|
| 156 |
+
|
| 157 |
+
Sampling Strategy for Visual Tokens. Using discrete visual tokens to represent images enables CIM to use stochastic sampling techniques during the corrupted image’s generation process, which can greatly enrich the output set of the generator and help the enhancer generalize well. For masked image modeling, randomly masking out a portion of patch embeddings can help regularize the pre-training, while for our approach, regularization for the enhancer mainly comes from the diversity of the corrupted images, therefore regularizations such as dropout & droppath are not used in CIM.
|
| 158 |
+
|
| 159 |
+
As presented in Table 7, the visual token representation with simple stochastic sampling from the generator output distribution is crucial for CIM. In contrast, we find that uniform sampling from the codebook of the image tokenizer regardless of the generator distribution or argmax sampling from the distribution cannot provide meaningful or diverse samples and therefore fails to pre-train the enhancer as expected.
|
| 160 |
+
|
| 161 |
+
Image Corrupting Strategy. We find that it is crucial to use a generator with a small trainable BEiT to corrupt images in order to successfully pre-train CNN with the proposed CIM. We experiment with another generative visual pretext task for ResNet-50 pre-training, i.e., using $50 \%$ random erasing (Zhong et al., 2020) to corrupt the input image, and the model is required to recover the erased pixels based on the visible context. We find this pretext task fails to transfer well. A parallel work Tian et al. (2022) also finds that only using hand-crafted transformations to corrupt images is not quite satisfactory in generative visual pre-training of ViT.
|
| 162 |
+
|
| 163 |
+
Table 8: Scaling CIM pre-training to larger ResNet.
|
| 164 |
+
|
| 165 |
+
<table><tr><td>Methods</td><td>PT Epochs FT Epochs Top-1 Acc.</td><td></td><td></td></tr><tr><td>ResNet-50x2 (#params: 94M)</td><td></td><td></td><td></td></tr><tr><td>From Scratch</td><td>=</td><td>400</td><td>81.1</td></tr><tr><td>SimCLR (Chen et al., 2020b)</td><td>1000</td><td>100 /200</td><td>81.6 /82.1</td></tr><tr><td>CIM-REVDET (Ours)</td><td>300</td><td>100/200</td><td>81.7 /82.2</td></tr><tr><td>ResNet-50x4 (#params:375M)</td><td></td><td></td><td></td></tr><tr><td>From Scratch</td><td></td><td>400</td><td>80.9</td></tr><tr><td>SimCLR (Chen et al., 2020b)</td><td>1000</td><td>100</td><td>82.6</td></tr><tr><td>SimMIM (Xie et al.,2021)</td><td>300</td><td>100</td><td>81.6</td></tr><tr><td>CIM-REVDET (Ours)</td><td>300</td><td>100</td><td>82.6</td></tr></table>
|
| 166 |
+
|
| 167 |
+
Scaling CIM to Larger CNNs. We study the scaling behavior of our CIM to larger CNNs. We choose two popular architectures in self-supervised learning literature: ResNet- $5 0 \mathrm { x } 2$ and ResNet-50x4 (with width multipliers of $2 \mathbf { x }$ and $4 \mathbf { x }$ of vanilla ResNet50, respectively), and study the endto-end fine-tuning performance on ImageNet-1K in Table 8. We use an improved training recipe following Touvron et al. (2021a); Wightman et al. (2021), therefore our from
|
| 168 |
+
|
| 169 |
+
scratch and SimCLR baselines are much higher ( ${ \sim } 2$ points higher) than the original results in Chen et al. (2020b). Notice that it is non-trivial to pre-train those large CNNs (e.g., ResNet-50x4 is 14 times bigger than ResNet-50 in #params). Under the end-to-end fine-tuning protocol, CIM is better than the recent MIM-based approach SimMIM and competitive with the representative Siamese model SimCLR.
|
| 170 |
+
|
| 171 |
+
Scaling CIM to Larger ViT. We study the scaling behavior of our CIM to ViT-Large in Table 9. Indeed, our approach can give ViT-Large a better initialization compared with the random initialization, and can also achieve better performance than MoCov3 that based on the canonical Siamese framework. Meanwhile, CIM still lags behind the MIM-based BEiT. Nevertheless, we believe CIM can serve as a promising starting point for exploring unified visual pre-training of various architectures.
|
| 172 |
+
|
| 173 |
+
Table 9: Scaling CIM pre-training for ViT-Large.
|
| 174 |
+
|
| 175 |
+
<table><tr><td>Methods</td><td>Top-1 Acc.</td></tr><tr><td>ViT-Large (#params: 304M)</td><td></td></tr><tr><td>From Scratch (He et al., 2021)</td><td>82.6</td></tr><tr><td>MoCo-v3 (Chen et al., 2021)</td><td>84.1</td></tr><tr><td>BEiT (Bao et al., 2021)</td><td>85.2</td></tr><tr><td>CIM-RESPIX (Ours)</td><td>84.3</td></tr></table>
|
| 176 |
+
|
| 177 |
+
Limitation and Discussion. The image corrupting process of CIM still has a large room for improvement, which determines the characteristics and styles of the corrupted image distribution. The tokenizer we currently use is essentially a large CNN and adds nontrivial overhead during pre-training, i.e., the wall-clock time of 1-epoch training is about $2 \times$ of BEiT. Other image tokenizers, such as ViT-VQGAN (Yu et al., 2021), which report much higher throughput and better generation quality, deserve an in-depth study for CIM pre-training in the future.
|
| 178 |
+
|
| 179 |
+
# 4 RELATED WORK
|
| 180 |
+
|
| 181 |
+
Siamese Framework is the dominating self-supervised visual pre-training approach over the past few years, which typically relies on strong hand-crafted data augmentations to generate different views of the same image and learns in a contrastive manner. To maintain a large and informative negative sample set, memory banks (He et al., 2020) or large batch size (Chen et al., 2020b) is used. Follow-ups (Grill et al., 2020; Chen & He, 2021) further eliminate the requirement of using negative samples. Recent works (Caron et al., 2021; Chen et al., 2021) study self-supervised visual pre-training of ViT within Siamese frameworks.
|
| 182 |
+
|
| 183 |
+
Masked Image Modeling (MIM) learns rich visual representations via masked parts prediction by conditioning on visible context only. ViT (Dosovitskiy et al., 2020) and iGPT (Chen et al., 2020a) report the first meaningful MIM visual pre-training results. BEiT (Bao et al., 2021) greatly improves MIM’s performance via masked visual token prediction, and PeCo (Dong et al., 2021) finds injecting perceptual similarity during visual codebook learning benefits MIM pre-trained representation. Recent work (He et al., 2021; Xie et al., 2021; Wei et al., 2021) re-explore pixel / feature regression in MIM, while Li et al. (2021); Zhou et al. (2021); El-Nouby et al. (2021) incorporate MIM within Siamese frameworks. As MIM is originated in masked language modeling (Devlin et al., 2019), CIM is inspired by Clark et al. (2020). In CIM, visual-token-based MIM plays an important role during the corrupted image generation process, as the stochastic sampling ability greatly enriches the corrupted image set.
|
| 184 |
+
|
| 185 |
+
# 5 CONCLUSION
|
| 186 |
+
|
| 187 |
+
We introduce a general self-supervised visual pre-training framework with few architectural constraints for the model to be pre-trained and transferred. Unlike the mainstream Siamese pre-training methods based on strong artificial data augmentations as well as MIM pre-training relying on randomly inserting artificial [MASK] tokens to input embeddings, CIM pre-trained encoder learns from the corrupted view generated from a trainable neural network’s output distribution. Given the stochastic sampling ability, CIM defends using discrete visual token representations during pre-training to some extent. Experimental results show that our approach achieves competitive performance on canonical ViT and CNN models. We hope CIM can serve as a promising starting point for exploring flexible & unified visual representation learning of various architectures.
|
| 188 |
+
|
| 189 |
+
# ACKNOWLEDGMENT
|
| 190 |
+
|
| 191 |
+
This work is in part supported by the National Key Research and Development Program of China under Grant 2022YFB4500602. We would like to acknowledge Yaru Hao for the helpful discussions.
|
| 192 |
+
|
| 193 |
+
# REFERENCES
|
| 194 |
+
|
| 195 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 196 |
+
|
| 197 |
+
Hangbo Bao, Li Dong, and Furu Wei. BEiT: BERT pre-training of image transformers. arXiv preprint arXiv:2106.08254, 2021.
|
| 198 |
+
|
| 199 |
+
Maxim Berman, Hervé Jégou, Andrea Vedaldi, Iasonas Kokkinos, and Matthijs Douze. Multigrain: a unified image embedding for classes and instances. arXiv preprint arXiv:1902.05509, 2019.
|
| 200 |
+
|
| 201 |
+
Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. arXiv preprint arXiv:2006.09882, 2020.
|
| 202 |
+
|
| 203 |
+
Mathilde Caron, Hugo Touvron, Ishan Misra, Hervé Jégou, Julien Mairal, Piotr Bojanowski, and Armand Joulin. Emerging properties in self-supervised vision transformers. arXiv preprint arXiv:2104.14294, 2021.
|
| 204 |
+
|
| 205 |
+
Mark Chen, Alec Radford, Rewon Child, Jeffrey Wu, Heewoo Jun, David Luan, and Ilya Sutskever. Generative pretraining from pixels. In ICML, 2020a.
|
| 206 |
+
|
| 207 |
+
Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In ICML, 2020b.
|
| 208 |
+
|
| 209 |
+
Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. In CVPR, 2021.
|
| 210 |
+
|
| 211 |
+
Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020c.
|
| 212 |
+
|
| 213 |
+
Xinlei Chen, Saining Xie, and Kaiming He. An empirical study of training self-supervised vision transformers. arXiv preprint arXiv:2104.02057, 2021.
|
| 214 |
+
|
| 215 |
+
Zewen Chi, Shaohan Huang, Li Dong, Shuming Ma, Saksham Singhal, Payal Bajaj, Xia Song, and Furu Wei. Xlm-e: cross-lingual language model pre-training via electra. arXiv preprint arXiv:2106.16138, 2021.
|
| 216 |
+
|
| 217 |
+
Kevin Clark, Minh-Thang Luong, Quoc V Le, and Christopher D Manning. Electra: Pre-training text encoders as discriminators rather than generators. arXiv preprint arXiv:2003.10555, 2020.
|
| 218 |
+
|
| 219 |
+
Ekin D Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V Le. Randaugment: Practical automated data augmentation with a reduced search space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pp. 702–703, 2020.
|
| 220 |
+
|
| 221 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009.
|
| 222 |
+
|
| 223 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In NAACL, 2019.
|
| 224 |
+
|
| 225 |
+
Xiaoyi Dong, Jianmin Bao, Ting Zhang, Dongdong Chen, Weiming Zhang, Lu Yuan, Dong Chen, Fang Wen, and Nenghai Yu. Peco: Perceptual codebook for bert pre-training of vision transformers. arXiv preprint arXiv:2111.12710, 2021.
|
| 226 |
+
|
| 227 |
+
Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
|
| 228 |
+
|
| 229 |
+
Alaaeldin El-Nouby, Gautier Izacard, Hugo Touvron, Ivan Laptev, Hervé Jegou, and Edouard Grave. Are large-scale datasets necessary for self-supervised pre-training? arXiv preprint arXiv:2112.10740, 2021.
|
| 230 |
+
|
| 231 |
+
Patrick Esser, Robin Rombach, and Bjorn Ommer. Taming transformers for high-resolution image synthesis. In CVPR, 2021.
|
| 232 |
+
|
| 233 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NeurIPS, 2014.
|
| 234 |
+
|
| 235 |
+
Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre H Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent: A new approach to self-supervised learning. arXiv preprint arXiv:2006.07733, 2020.
|
| 236 |
+
|
| 237 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 238 |
+
|
| 239 |
+
Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020.
|
| 240 |
+
|
| 241 |
+
Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr Dollár, and Ross Girshick. Masked autoencoders are scalable vision learners. arXiv preprint arXiv:2111.06377, 2021.
|
| 242 |
+
|
| 243 |
+
Tong He, Zhi Zhang, Hang Zhang, Zhongyue Zhang, Junyuan Xie, and Mu Li. Bag of tricks for image classification with convolutional neural networks. In CVPR, 2019.
|
| 244 |
+
|
| 245 |
+
Elad Hoffer, Tal Ben-Nun, Itay Hubara, Niv Giladi, Torsten Hoefler, and Daniel Soudry. Augment your batch: better training with larger batches. arXiv preprint arXiv:1901.09335, 2019.
|
| 246 |
+
|
| 247 |
+
Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Q Weinberger. Deep networks with stochastic depth. In ECCV, 2016.
|
| 248 |
+
|
| 249 |
+
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. In CVPR, 2017.
|
| 250 |
+
|
| 251 |
+
Yann LeCun, Bernhard Boser, John S Denker, Donnie Henderson, Richard E Howard, Wayne Hubbard, and Lawrence D Jackel. Backpropagation applied to handwritten zip code recognition. Neural computation, 1989.
|
| 252 |
+
|
| 253 |
+
Zhaowen Li, Zhiyang Chen, Fan Yang, Wei Li, Yousong Zhu, Chaoyang Zhao, Rui Deng, Liwei Wu, Rui Zhao, Ming Tang, et al. Mst: Masked self-supervised transformer for visual representation. NeurIPS, 2021.
|
| 254 |
+
|
| 255 |
+
Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C Lawrence Zitnick. Microsoft coco: Common objects in context. In ECCV, 2014.
|
| 256 |
+
|
| 257 |
+
Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In CVPR, 2015.
|
| 258 |
+
|
| 259 |
+
Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017.
|
| 260 |
+
|
| 261 |
+
Yu Meng, Chenyan Xiong, Payal Bajaj, Saurabh Tiwary, Paul Bennett, Jiawei Han, and Xia Song. COCO-LM: Correcting and contrasting text sequences for language model pretraining. In NeurIPS, 2021.
|
| 262 |
+
|
| 263 |
+
MMSegmentation. MMSegmentation: Openmmlab semantic segmentation toolbox and benchmark. https://github.com/open-mmlab/mmsegmentation, 2020.
|
| 264 |
+
|
| 265 |
+
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, high-performance deep learning library. In NeurIPS, 2019.
|
| 266 |
+
|
| 267 |
+
Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. Zero-shot text-to-image generation. arXiv preprint arXiv:2102.12092, 2021.
|
| 268 |
+
|
| 269 |
+
Jason Tyler Rolfe. Discrete variational autoencoders. arXiv preprint arXiv:1609.02200, 2016.
|
| 270 |
+
|
| 271 |
+
Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-attention with relative position representations. arXiv preprint arXiv:1803.02155, 2018.
|
| 272 |
+
|
| 273 |
+
Nitish Srivastava, Geoffrey Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: A simple way to prevent neural networks from overfitting. JMLR, 2014.
|
| 274 |
+
|
| 275 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In CVPR, 2016.
|
| 276 |
+
|
| 277 |
+
Yunjie Tian, Lingxi Xie, Jiemin Fang, Mengnan Shi, Junran Peng, Xiaopeng Zhang, Jianbin Jiao, Qi Tian, and Qixiang Ye. Beyond masking: Demystifying token-based pre-training for vision transformers. arXiv preprint arXiv:2203.14313, 2022.
|
| 278 |
+
|
| 279 |
+
Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. In ICML, 2021a.
|
| 280 |
+
|
| 281 |
+
Hugo Touvron, Matthieu Cord, Alexandre Sablayrolles, Gabriel Synnaeve, and Hervé Jégou. Going deeper with image transformers. arXiv preprint arXiv:2103.17239, 2021b.
|
| 282 |
+
|
| 283 |
+
Aaron Van Den Oord, Oriol Vinyals, et al. Neural discrete representation learning. In NeurIPS, 2017.
|
| 284 |
+
|
| 285 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017.
|
| 286 |
+
|
| 287 |
+
Chen Wei, Haoqi Fan, Saining Xie, Chao-Yuan Wu, Alan Yuille, and Christoph Feichtenhofer. Masked feature prediction for self-supervised visual pre-training. arXiv preprint arXiv:2112.09133, 2021.
|
| 288 |
+
|
| 289 |
+
Ross Wightman, Hugo Touvron, and Hervé Jégou. Resnet strikes back: An improved training procedure in timm. arXiv preprint arXiv:2110.00476, 2021.
|
| 290 |
+
|
| 291 |
+
Zhenda Xie, Zheng Zhang, Yue Cao, Yutong Lin, Jianmin Bao, Zhuliang Yao, Qi Dai, and Han Hu. Simmim: A simple framework for masked image modeling. arXiv preprint arXiv:2111.09886, 2021.
|
| 292 |
+
|
| 293 |
+
Jiahui Yu, Xin Li, Jing Yu Koh, Han Zhang, Ruoming Pang, James Qin, Alexander Ku, Yuanzhong Xu, Jason Baldridge, and Yonghui Wu. Vector-quantized image modeling with improved vqgan. arXiv preprint arXiv:2110.04627, 2021.
|
| 294 |
+
|
| 295 |
+
Sangdoo Yun, Dongyoon Han, Seong Joon Oh, Sanghyuk Chun, Junsuk Choe, and Youngjoon Yoo. Cutmix: Regularization strategy to train strong classifiers with localizable features. In ICCV, 2019.
|
| 296 |
+
|
| 297 |
+
Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017.
|
| 298 |
+
|
| 299 |
+
Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In CVPR, 2018.
|
| 300 |
+
|
| 301 |
+
Zhun Zhong, Liang Zheng, Guoliang Kang, Shaozi Li, and Yi Yang. Random erasing data augmentation. In AAAI, 2020.
|
| 302 |
+
|
| 303 |
+
Bolei Zhou, Hang Zhao, Xavier Puig, Tete Xiao, Sanja Fidler, Adela Barriuso, and Antonio Torralba. Semantic understanding of scenes through the ade20k dataset. IJCV, 2019.
|
| 304 |
+
|
| 305 |
+
Jinghao Zhou, Chen Wei, Huiyu Wang, Wei Shen, Cihang Xie, Alan Yuille, and Tao Kong. ibot: Image bert pre-training with online tokenizer. arXiv preprint arXiv:2111.07832, 2021.
|
| 306 |
+
|
| 307 |
+
# A APPENDIX
|
| 308 |
+
|
| 309 |
+
# A.1 ADDITIONAL ANALYSIS
|
| 310 |
+
|
| 311 |
+
Relationship between the type of the generator and the performance of the enhancer. What makes a "good" generator for the enhancer? We believe there are three main factors that affect the output quality of the generator: (1) The masking strategy and masking ratio of the generator’s inputs. (2) The size / capacity of the small trainable BEiT. (3) The type of image tokenizers.
|
| 312 |
+
|
| 313 |
+
While there are many perspectives / ways to evaluate a generator, this study focuses on visual pretraining of the enhancer, so we are particularly interested in how these factors affect the enhancer’s fine-tuning performance on downstream visual recognition tasks.
|
| 314 |
+
|
| 315 |
+
Factor 1 & 2 has already been well studied in Table 4 & Table 5 respectively: either a too “weak” generator (e.g., too much masking or the size of the trainable BEiT is too small) or a too “strong” generator (e.g., too less masking or the trainable BEiT is too large) is harmful to the fine-tuning performance of the enhancer.
|
| 316 |
+
|
| 317 |
+
As for Factor 3, the image tokenizer represents a given image in the RGB domain as a permutation of discrete tokens with a fixed vocabulary size. This compact representation along with the stochastic sampling process can generate an abundant & diverse input set to feed the enhancer better. However, if the generator is too strong & robust that can always generate near ground truth output regardless of the stochastic sampling, the enhancer can hardly learn useful representations or even be wrongly penalized.
|
| 318 |
+
|
| 319 |
+
To show that, in Table 10 we study another well-established and open-sourced image tokenizer, VQGAN (Esser et al., 2021), on the ViT-B enhancer with 300 epochs pre-training & 100 epochs fine-tuning on ImageNet-1k. We also study the effects of directly using a MAE-Base model as the generator.
|
| 320 |
+
|
| 321 |
+
Table 10: Study of different generator tpye of CIM pre-training for ViT-Base.
|
| 322 |
+
|
| 323 |
+
<table><tr><td>Generator Type of CIM</td><td>Top-1 Acc.</td></tr><tr><td>MAE-style generator w/ 50% masking ratio</td><td>82.6 (-0.7)</td></tr><tr><td>BEiT-Style generator w/ VQGAN tokenizer</td><td>82.9 (-0.4)</td></tr><tr><td>BEiT-Style generator w/DALL-E tokenizer (our default seting)</td><td>83.3</td></tr></table>
|
| 324 |
+
|
| 325 |
+
For the MAE-style generator, we sample RGB color values at all masked positions of the MAE decoder outputs. Since the stochastic sampling is performed on the RGB domain, only some low-level features (mainly color) can be changed and corrupted. Therefore the enhancer only learns to correct low-level attributes.
|
| 326 |
+
|
| 327 |
+
For the BEiT-style generator w/ VQGAN tokenizer, compared with the DALL-E tokenizer used as default, the VQGAN tokenizer is trained with two additional losses, i.e., the perceptual loss (Zhang et al., 2018) as well as the GAN loss (Isola et al., 2017). These two additional losses are originally intended for high-quality image synthesis, but could make the tokenizer become too strong & robust to generate appropriate corrupted samples for the enhancer. We visualize the corrupted samples from the VQGAN tokenizer, and we find it nearly reconstructs the original input even with stochastic token sampling. Therefore the samples from the VQGAN tokenizer are not diverse enough and cannot provide rich supervision for the enhancer to learn transferable representations.
|
| 328 |
+
|
| 329 |
+
Overall, it is hard to find a good indicator from the generator that can directly reflect and measure the representation quality of the enhancer. By now, the best way is to honestly fine-tune the pre-trained enhancer on downstream tasks.
|
| 330 |
+
|
| 331 |
+
Study of training the generator first and keeping it fixed for the enhancer’s pre-training. We tried first train the generator separately for 300 epochs and then pre-train the enhancer for another 300 epochs while keeping the generator’s weights fixed. The performance suffers from a $0 . 4 \%$ degeneration. We hypothesize synergetic & simultaneous training provides a curriculum-like pretraining strategy for the enhancer where the generator starts off weak but gets better throughout training.
|
| 332 |
+
|
| 333 |
+
Additional training cost of CIM compared to simple mask prediction with the same mask ratio. We study the relationship between the pre-training time and downstream performances of different approaches for both ViTs and ConvNets in Table 11 and Table 12 respectively.
|
| 334 |
+
|
| 335 |
+
Since CIM is built upon BEiT, we choose BEiT as the masked image modeling baseline approach of ViTs. Here, we first study the ViT-B model’s 100-epoch fine-tuning performance on ImageNet-1k val set with different pre-training schedules in Table 11. The wall-clock time of 1-epoch pre-training of CIM is about $1 . 8 \mathrm { x }$ of BEiT (CIM has an additional tokenizer decoder compared with BEiT) on the same machine.
|
| 336 |
+
|
| 337 |
+
Table 11: Study of the training cost for ViT-Base pre-training.
|
| 338 |
+
|
| 339 |
+
<table><tr><td>Methods</td><td>PT Epochs</td><td>Relative PT Time</td><td>Top-1 Acc.</td></tr><tr><td>BEiT</td><td>300</td><td>1.0x</td><td>82.9</td></tr><tr><td>BEiT</td><td>800</td><td>2.7x</td><td>83.2</td></tr><tr><td>BEiT</td><td>1600</td><td>5.3x</td><td>83.3</td></tr><tr><td>CIM</td><td>800</td><td>1.8x</td><td>83.3</td></tr><tr><td>CIM</td><td>800</td><td>4.8x</td><td>83.4</td></tr></table>
|
| 340 |
+
|
| 341 |
+
In Table 12, we also study the ResNet-50x4 model’s 100-epoch fine-tuning performance on ImageNet1k val set with different pre-training schedules. We choose SimMIM as the masked image modeling baseline approach of ConvNets, for it reports the ResNet-50x4 model’s result in Appendix E of its paper. The wall-clock time of 1-epoch pre-training of CIM is about $2 . 6 \mathbf { x }$ of SimMIM (CIM has an additional generator, including a small BEiT and a tokenizer encoder & decoder compared with SimMIM) on the same machine.
|
| 342 |
+
|
| 343 |
+
Table 12: Study of the training cost for ResNet-50x4 pre-training.
|
| 344 |
+
|
| 345 |
+
<table><tr><td>Methods</td><td>PT Epochs</td><td>Relative PT Time</td><td> Top-1 Acc.</td></tr><tr><td>SimMIM</td><td>300</td><td>1.0x</td><td>81.6</td></tr><tr><td>CIM</td><td>100</td><td>0.9x</td><td>82.2</td></tr></table>
|
| 346 |
+
|
| 347 |
+
These results imply that CIM can obtain better fine-tuning performance with less pre-training time compared with baseline approaches for both ViTs and ConvNets.
|
| 348 |
+
|
| 349 |
+
# A.2 A NOTE ON VISUALIZATIONS IN $\ S 2 . 2$ AND FIGURE 3
|
| 350 |
+
|
| 351 |
+
Since there exists information loss in any form of normalization, we have to inject the original image’s information in order to visualize the enhancer output (4th column in Figure 3a). In order to comprehensively demonstrate our method’s behavior, we also include the unnormalized counterpart in Figure 3b for reference, where there is no additional information injection during visualization.
|
| 352 |
+
|
| 353 |
+
# A.3 TRAINING AND OPTIMIZATION DETAILS
|
| 354 |
+
|
| 355 |
+
The auxiliary generator and the enhancer are simultaneously trained and synergistically (rather than adversarially as GAN (Goodfellow et al., 2014)) updated. The trainable part of the generator, i.e., the small BEiT, learns a MIM objective in the same vein as in BEiT (Bao et al., 2021). Formally, given an input image’s patch embedding sequence $\pmb { x } = ( \pmb { x } _ { 1 } , . . . , \pmb { x } _ { n } )$ , we randomly mask $k$ embeddings at positions $\pmb { m } = ( m _ { 1 } , . . . , m _ { k } )$ using [MASK] token2. The resulting masked input sequence $_ { \textbf { \em x } }$ masked for BEiT is:
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
\begin{array} { r } { m _ { i } \sim \mathrm { u n i f o r m } \{ 1 , n \} , \mathrm { f o r } i = 1 , . . . , k , } \\ { \pmb { x } ^ { \mathrm { m a s k e d } } = \mathrm { r e p l a c e } ( \pmb { x } , \pmb { m } , [ \mathrm { M A S K } ] ) , \quad \quad } \end{array}
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
where the replace $( x , m$ , [MASK]) operation denotes using the special [MASK] token to replace patch embeddings of $_ { \textbf { \em x } }$ at positions $_ { m }$ . The small BEiT then encodes $x ^ { \mathrm { m a s k e d } }$ and learns to maximize
|
| 362 |
+
|
| 363 |
+
$\log p _ { \mathrm { B E i T } } ( \pmb { g } \mid \pmb { x } ^ { \mathrm { m a s k e d } } )$ , i.e., the log-likelihood of the golden visual tokens $\pmb { g } = ( g _ { 1 } , . . . , g _ { k } )$ at the masked positions $_ { \mathbf { \nabla } } \mathbf { m } _ { \mathbf { \nabla } }$ conditioned on $x ^ { \mathrm { m a s k e d } }$ . Notice that the golden tokens are obtained by feeding the original image to the image tokenizer encoder.
|
| 364 |
+
|
| 365 |
+
In order to generate corrupted image samples $\mathcal { T } ^ { \mathrm { c o r r u p t e d } }$ for the enhancer, we sample tokens’ replacements from the BEiT output distribution $p _ { \mathrm { B E i T } }$ at each masked position $j$ of the encoded $\pmb { x } ^ { \mathrm { m a s k } \bar { \mathrm { e } } \mathrm { d } }$ :
|
| 366 |
+
|
| 367 |
+
$$
|
| 368 |
+
\begin{array} { r l } & { x _ { j } ^ { \mathrm { s a m p l e d } } \sim p _ { \mathrm { B E i T } } ( x _ { j } ^ { \mathrm { s a m p l e d } } \mid x ^ { \mathrm { m a s k e d } } ) , \mathrm { f o r } j \in m , } \\ & { x ^ { \mathrm { c o r r u p t e d } } = \mathrm { r e p l a c e } ( g , m , x ^ { \mathrm { s a m p l e d } } ) , } \end{array}
|
| 369 |
+
$$
|
| 370 |
+
|
| 371 |
+
where the replace $( \pmb { g } , \pmb { m } , \pmb { x } ^ { \mathrm { s a m p l e d } } )$ operation denotes using the sampled visual token $x ^ { \mathrm { s a m p l e d } }$ to replace golden tokens of $\textbf { { g } }$ at positions $_ { m }$ . Next, the image tokenizer decoder maps $\pmb { x } ^ { \mathrm { c o r r u p t e d } }$ to a corrupted image $\mathcal { T } ^ { \mathrm { c o r r u p t e d } }$ . The whole image tokenizer is frozen (i.e., not updated throughout the pre-training phase), which directly uses the publicly available3 pre-trained DALL-E dVAE weight (Ramesh et al., 2021) following BEiT.
|
| 372 |
+
|
| 373 |
+
The enhancer takes the corrupted image $\mathcal { T } ^ { \mathrm { c o r r u p t e d } }$ as input. For the RESPIX visual pretext task, the enhancer is optimized by a combination of $l _ { 1 }$ and $l _ { 2 }$ loss for pixel regression. For the REVDET variant, the enhancer is learned by binary cross-entropy loss for replaced visual token detection. The gradients of the enhancer are not back-propagated through the generator.
|
| 374 |
+
|
| 375 |
+
In this paper, we study CIM self-supervised pre-trained vanilla ViT (Dosovitskiy et al., 2020) and vanilla ResNet (He et al., 2016) models. The vanilla ViT models refer to the design from (Dosovitskiy et al., 2020; Touvron et al., 2021a) without further architectural change such as using relative position embeddings (Shaw et al., 2018) and LayerScale (Touvron et al., 2021b). The vanilla ResNet-50 model refers to the torchvision ResNet-50 (Paszke et al., 2019) without any architectural change. The larger ResNet-50x2 and ResNet-50x4 models follows the canonical design in SimCLR (Chen et al., 2020b). We conduct experiments on $1 6 \times$ or $3 2 \times$ V100 GPUs with 32GB memory.
|
| 376 |
+
|
| 377 |
+
A.4 PRE-TRAINING & FINE-TUNING CONFIGURATIONS
|
| 378 |
+
|
| 379 |
+
A.4.1 THE IMAGENET-1K CIM PRE-TRAINING CONFIGURATIONS FOR VANILLA VIT AND RESNET MODELS
|
| 380 |
+
Table 13: The ImageNet-1K CIM pre-training settings for vanilla ViT-S/16, ViT-B/16 and ResNet-50 models. Notably, the pre-training configurations are almost the same for different architectures. We implement the pre-training using the codebase of BEiT (Bao et al., 2021). Mixed precision and deepspeed acceleration are used.
|
| 381 |
+
|
| 382 |
+
<table><tr><td>Pre-training Config. (ViT & ResNet)</td><td>Value</td></tr><tr><td>Optimizer</td><td>AdamW (Loshchilov & Hutter, 2017)</td></tr><tr><td>Pre-training Epochs</td><td>300</td></tr><tr><td>Peak Learning Rate</td><td>1.5e-3</td></tr><tr><td>Batch Size</td><td>2048</td></tr><tr><td>Weight Decay</td><td>0.05</td></tr><tr><td>Optimizer Momentum (β1,β2)</td><td>(0.9, 0.98) (Vaswani et al., 2017)</td></tr><tr><td>Learning Rate Schedule</td><td>Cosine Decay</td></tr><tr><td>Gradient Clipping</td><td>3.0</td></tr><tr><td>Warmup Epochs</td><td>10</td></tr><tr><td>#Masked Patches for the Generator</td><td>100 to 120, Random Masking</td></tr><tr><td>The Generator's Depth</td><td>4 to 6</td></tr><tr><td>The Generator's Width</td><td>Same to the Enhancer (ViT), 384 (ResNet)</td></tr><tr><td>The Enhancer's Loss Weight</td><td>1 forREVDET,1O forREsPIX</td></tr><tr><td>Data Augmentation</td><td>RandomResizedCrop Only</td></tr><tr><td>Dropout (Srivastava et al., 2014)</td><td>X X</td></tr><tr><td>Stochastic Depth (Huang et al., 2016)</td><td></td></tr><tr><td>LayerScale (Touvron et al., 2021b) Pos.Emb.in TransformerLayers</td><td>X</td></tr><tr><td></td><td>1-D Absolute Pos. Emb. (Dosovitskiy et al., 2020)</td></tr><tr><td>Patch Size</td><td>16 224</td></tr><tr><td>Pre-training Resolution</td><td></td></tr></table>
|
| 383 |
+
|
| 384 |
+
A.4.2 THE IMAGENET-1K IMAGE CLASSIFICATION FINE-TUNING CONFIGURATIONS FOR VANILLA VIT MODELS
|
| 385 |
+
Table 14: The ImageNet-1K image classification fine-tuning recipes for vanilla ViT-S/16 and ViT-B/16. We implement the fine-tuning using the codebase of BEiT (Bao et al., 2021). Mixed precision and deepspeed acceleration are used. We select the best learning rate out of $\{ 3 \mathrm { e } { - } 3 , 4 \mathrm { e } { - } 3 , 5 \mathrm { e } { - } 3 \}$ for different sized models and pre-training objectives, and the absolute difference between the worst and the best learning rate is less than 0.3 in terms of the top-1 accuracy.
|
| 386 |
+
|
| 387 |
+
<table><tr><td>Fine-tuning Config. (ViT)</td><td>Value</td></tr><tr><td>Optimizer</td><td>AdamW (Loshchilov & Hutter, 2017)</td></tr><tr><td>Fine-tuning Epochs</td><td>200 forViT-S/16,10O forViT-B/16</td></tr><tr><td>Peak Learning Rate</td><td>3e-3 forViT-B/16REsPIX,5e-3 forViT-B/16 REVDET,3e-3 or4e-3 forViT-S/16</td></tr><tr><td>Layer-wise Learning Rate Decay (Bao et al.,</td><td>0.8 (Clark et al., 2020)</td></tr><tr><td>2021) Batch Size</td><td>1024</td></tr><tr><td>Weight Decay</td><td>0.05</td></tr><tr><td>Optimizer Momentum (β1, β2)</td><td>(0.9, 0.999)</td></tr><tr><td>Learning Rate Schedule</td><td>Cosine Decay</td></tr><tr><td>Warmup Epochs</td><td>5</td></tr><tr><td>Gradient Clipping</td><td>X</td></tr><tr><td>Dropout (Srivastava et al., 2014)</td><td>X</td></tr><tr><td>Stochastic Depth (Huang et al., 2016)</td><td>0.1</td></tr><tr><td>Label Smoothing (Szegedy et al., 2016)</td><td>0.1</td></tr><tr><td>Mixup (Zhang et al., 2017)</td><td>0.8</td></tr><tr><td>CutMix (Yun et al., 2019)</td><td>1.0</td></tr><tr><td>Random Augmentation (Cubuk et al., 2020)</td><td>9 /0.5</td></tr><tr><td>Patch Size</td><td>16</td></tr><tr><td>Fine-tuning Resolution</td><td>224</td></tr><tr><td>Test Resolution</td><td>224</td></tr><tr><td>Test Crop Ratio</td><td>0.95</td></tr><tr><td>Loss Function</td><td>Cross Entropy Loss</td></tr></table>
|
| 388 |
+
|
| 389 |
+
A.4.3 THE IMAGENET-1K IMAGE CLASSIFICATION FINE-TUNING CONFIGURATIONS FOR VANILLA RESNET-50
|
| 390 |
+
Table 15: The ImageNet-1K image classification fine-tuning recipes for vanilla ResNet-50. We use the AdamW optimizer. The hyperparameter settings basically follows (Wightman et al., 2021). We implement the fine-tuning based on the codebase of BEiT (Bao et al., 2021). Mixed precision and deepspeed acceleration are used. For other self-supervised baseline approaches we compared in Table 2, we select the best learning rate out of $\{ 5 \mathrm { e } { - } 3 , 8 \mathrm { e } { - } 3 , 1 2 \mathrm { e } { - } 3 \}$ and keep other settings unchanged.
|
| 391 |
+
|
| 392 |
+
<table><tr><td>Fine-tuning Config. (ResNet-50)</td><td>100 Epoch FT</td><td>300Epoch FT</td><td>600 Epoch FT</td></tr><tr><td>Optimizer</td><td colspan="3">AdamW (Loshchilov & Hutter, 2017)</td></tr><tr><td>Peak Learning Rate</td><td colspan="3">12e-3</td></tr><tr><td>Layer-wise Learning Rate Decay (Bao et al., 2021)</td><td colspan="3">X</td></tr><tr><td>Batch Size</td><td colspan="3">2048</td></tr><tr><td>Learning Rate Schedule</td><td colspan="3">Cosine Decay</td></tr><tr><td>Loss Function</td><td colspan="3">Binary Cross Entropy Loss</td></tr><tr><td>Warmup Epochs</td><td colspan="3">5</td></tr><tr><td>Weight Decay</td><td>0.02</td><td>0.02</td><td>0.01</td></tr><tr><td>Fine-tuning Resolution</td><td>160</td><td>224</td><td>224</td></tr><tr><td>Test Resolution</td><td></td><td>224</td><td></td></tr><tr><td>Test Crop Ratio</td><td></td><td>0.95</td><td></td></tr><tr><td>Repeated Augmentation (Berman et al.,</td><td>X</td><td>√</td><td>1</td></tr><tr><td>2019; Hoffer et al., 2019) Random Augmentation (Cubuk et al.,</td><td>6/0.5</td><td>7 /0.5</td><td>7 /0.5</td></tr><tr><td>2020)</td><td></td><td></td><td></td></tr><tr><td>Mixup (Zhang et al., 2017) CutMix (Yun et al., 2019)</td><td>0.1</td><td>0.1 1.0</td><td>0.2</td></tr><tr><td>Label Smoothing (Szegedy et al., 2016)</td><td>0.1</td><td></td><td>0.1</td></tr><tr><td>Stochastic Depth (Huang et al.,2016)</td><td></td><td>X</td><td></td></tr><tr><td></td><td>X</td><td>X</td><td>0.05</td></tr><tr><td>Dropout (Srivastava et al., 2014)</td><td></td><td>X</td><td></td></tr><tr><td>Layer-wise Learning Rate Decay</td><td></td><td>X</td><td></td></tr></table>
|
md/dev/0RTJcuvHtIu/0RTJcuvHtIu.md
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Flexible Diffusion Modeling of Long Videos
|
| 2 |
+
|
| 3 |
+
William Harvey, Saeid Naderiparizi, Vaden Masrani, Christian Weilbach, Frank Wood∗
|
| 4 |
+
|
| 5 |
+
Department of Computer Science University of British Columbia Vancouver, Canada {wsgh,saeidnp,vadmas,weilbach,fwood}@cs.ubc.ca
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
We present a framework for video modeling based on denoising diffusion probabilistic models that produces long-duration video completions in a variety of realistic environments. We introduce a generative model that can at test-time sample any arbitrary subset of video frames conditioned on any other subset and present an architecture adapted for this purpose. Doing so allows us to efficiently compare and optimize a variety of schedules for the order in which frames in a long video are sampled and use selective sparse and long-range conditioning on previously sampled frames. We demonstrate improved video modeling over prior work on a number of datasets and sample temporally coherent videos over 25 minutes in length. We additionally release a new video modeling dataset and semantically meaningful metrics based on videos generated in the CARLA autonomous driving simulator.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Generative modeling of photo-realistic videos is at the frontier of what is possible with deep learning on currently-available hardware. Although related work has demonstrated modeling of short photorealistic videos (e.g. 30 frames [36], 48 frames [6] or 64 frames [16]), generating longer videos that are both coherent and photo-realistic remains an open challenge. A major difficulty is scaling: photorealistic image generative models [4, 8] are already close to the memory and processing limits of modern hardware. A long video is at very least a concatenation of many photorealistic frames, implying resource requirements, long-range coherence notwithstanding, that scale with frame count.
|
| 14 |
+
|
| 15 |
+
Attempting to model such long-range coherence makes the problem harder still, especially because in general every frame can have statistical dependencies on other frames arbitrarily far back in the video. Unfortunately fixed-lag autoregressive models impose unrealistic conditional independence assumptions (the next frame being independent of frames further back in time than the autoregressive lag is problematic for generating videos with long-range coherence). And while deep generative models based on recurrent neural networks (RNN) theoretically impose no such conditional independence assumptions, in practice they must be trained over short sequences [12, 26] or with truncated gradients [31]. Despite this, some RNN-based video generative models have demonstrated longer-range coherence, albeit without yet achieving convincing photorealistic video generation [26, 3, 7, 20, 2].
|
| 16 |
+
|
| 17 |
+
In this work we embrace the fact that finite architectures will always impose conditional independences. The question we ask is: given an explicit limit $K$ on the number of video frames we can jointly model, how can we best allocate these frames to generate a video of length $N > K ?$ One option is to use the previously-described autoregressive model but, if $K = N / 4$ , we could instead follow Ho et al. [16] by training two models: one which first samples every 4th frame in the video, and another which (in multiple stages) infills the remaining frames conditioned on those. To enable efficient exploration of the space of such sampling schemes, we propose a flexible architecture based on the denoising diffusion probabilistic model (DDPM) framework. This can sample any subset of video frames conditioned on observed values of any other subset of video frames. It therefore lets us explore a wide variety of previously untested sampling schemes while being easily repurposed for different generation tasks such as unconditional generation, video completion, and generation of videos of different lengths. Since our model can be flexibly applied to sample any frames given any others we call it a Flexible Diffusion Model, or FDM.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: A long video (25 minutes, or approximately 15 000 frames) generated by FDM for each of CARLA Town01 and MineRL, conditioned on 500 and 250 prior frames respectively. We show blocks of frames from three points within each video, starting from the final observed frame on the left. Blocks are marked with the time elapsed since the last observation and frames within them are one second apart. We observe no degradation in sample quality even after $> 1 5 0 0 0$ frames.
|
| 21 |
+
|
| 22 |
+
Contributions (1) At the highest level, we claim to have concurrently developed one of the first denoising diffusion probabilistic model (DDPM)-based video generative models [16, 40]. To do so we augment a previously-used DDPM image architecture [15, 22] with a temporal attention mechanism including a novel relative (frame) position encoding network. (2) The principal contribution of this paper, regardless, is a “meta-learning” training objective that encourages learning of a video generative model that can (a) be flexibly conditioned on any number of frames (up to computational resource constraints) at any time in the past and future and (b) be flexibly marginalized (to achieve this within computational resource constraints). (3) We demonstrate that our model can be used to efficiently explore the space of resource constrained video generation schemes, leading to improvements over prior work on several long-range video modeling tasks. (4) Finally, we release a new autonomous driving video dataset along with a new video generative model performance metric that captures semantics more directly than the visual quality and comparison metrics currently in widespread use.
|
| 23 |
+
|
| 24 |
+
# 2 Sampling long videos
|
| 25 |
+
|
| 26 |
+
Our goal in this paper is to sample coherent photo-realistic videos v with thousands of frames (see Fig. 1). To sample an arbitrarily long video with a generative model that can sample or condition on only a small number of frames at once, we must use a sequential procedure. The simplest example of this is an autoregressive scheme, an example of which is shown in Fig. 2a for a video completion task. In this example it takes seven stages to sample a complete video, in that we must run the generative model’s sampling procedure seven times. At each stage three frames are sampled conditioned on the immediately preceding four frames. This scheme is appealing for its simplicity but imposes a strong assumption that, given the set of four frames that are conditioned on at a particular stage, all frames that come afterwards are conditionally independent of all frames that came before. This restriction can be partially ameliorated with the sampling scheme shown in Fig. 2b where, in the first three stages, every second frame is sampled and then, in the remaining four stages, the remaining frames are infilled. One way to implement this would be to train two different models operating at the two different temporal resolutions. In the language of Ho et al. [16], who use a similar approach, sampling would be carried out in the first three stages by a “frameskip-2” model and, in the remaining stages, by a “frameskip-1” model. Both this approach and the autoregressive approach are examples of what we call sampling schemes. More generally, we characterize a sampling scheme as a sequence of tuples $[ ( \mathcal { X } _ { s } , \mathcal { Y } _ { s } ) ] _ { s = 1 } ^ { \bar { S } }$ , each containing a vector $\mathcal { X } _ { s }$ of indices of frames to sample and a vector $\mathcal { { D } } _ { s }$ of indices of frames to condition on for stages $s = 1 , \ldots , S$ .
|
| 27 |
+
|
| 28 |
+
Algorithm 1 Sample a video v given a sampling scheme $[ ( \mathcal { X } _ { s } , \mathcal { Y } _ { s } ) ] _ { s = 1 } ^ { S }$ . For unconditional generation, the input v can be a tensor of zeros. For conditional generation, the observed input frames should contain their observed values.
|
| 29 |
+
|
| 30 |
+

|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
Figure 2: Sampling schemes to complete a video of length $N = 3 0$ conditioned on the first 10 frames, with access to at most $K = 7$ frames at a time. Each stage $s$ of the sampling procedure is represented by one row in the figure, going from top to bottom. Within each subfigure, one column represents one frame of the video, from frame one on the left to frame 30 on the right. At each stage, the values of frames marked in blue are sampled conditioned on the (observed or previously sampled) values of frames marked in red; frames marked in gray are ignored; and frames marked in white are yet to be sampled. For every sampling scheme, all video frames have been sampled after the final row.
|
| 34 |
+
|
| 35 |
+
Algorithm 1 lays out how such a sampling scheme is used to sample a video. If the underlying generative model is trained specifically to model sequences of consecutive frames, or sequences of regularly-spaced frames, then the design space for sampling schemes compatible with these models is severely constrained. In this paper we take a different approach. We design and train a generative model to sample any arbitrarily-chosen subset of video frames conditioned on any other subset and train it using an entirely novel distribution of such tasks. In short, our model is trained to generate frames for any choice of $\mathcal { X }$ and $\mathcal { V }$ . The only constraint we impose on our sampling schemes is therefore a computational consideration that $| \mathcal { X } _ { s } | + | \mathcal { V } _ { s } | \le K$ for all $s$ but, to generate meaningful videos, any valid sampling scheme must also satisfy two more constraints: (1) all frames are sampled at at least one stage and (2) frames are never conditioned upon before they are sampled.
|
| 36 |
+
|
| 37 |
+
Such a flexible generative model allows us to explore and use sampling schemes like those in Fig. 2c and Fig. 2d. We find in our experiments that the best video sampling scheme is dataset dependent. Accordingly, we have developed methodology to optimize such sampling schemes in a dataset dependent way, leading to improved video quality as measured by the Fréchet Video Distance [33] among other metrics. We now review conditional DDPMs (Section 3), before discussing the FDM’s architecture, the specific task distribution used to train it, and the choice and optimization of sampling schemes in Section 4.
|
| 38 |
+
|
| 39 |
+
# 3 A review of conditional denoising diffusion probabilistic models
|
| 40 |
+
|
| 41 |
+
Denoising diffusion probabilistic models, or DDPMs [28, 15, 22, 30], are a class of generative model for data $\mathbf { x }$ , which throughout this paper will take the form of a 4-dimensional tensor representing multiple video frames. We will describe the conditional extension [32], in which the modeled $\mathbf { x }$ is conditioned on observations $\mathbf { y }$ . DDPMs simulate a diffusion process which transforms $\mathbf { x }$ to noise, and generate data by learning the probabilistic inverse of the diffusion process. The diffusion process happens over timesteps $0 , \ldots , T$ such that $\mathbf { x } _ { 0 } = \mathbf { x }$ is data without noise, $\mathbf { x } _ { 1 }$ has a very small amount of noise added, and so on until $\mathbf { x } _ { T }$ is almost independent of $\mathbf { x } _ { \mathrm { 0 } }$ and approximates a random sample from a unit Gaussian. In the diffusion process we consider, the distribution over $\mathbf { x } _ { t }$ depends only on $\mathbf { x } _ { t - 1 }$ :
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\begin{array} { r } { q ( \mathbf x _ { t } | \mathbf x _ { t - 1 } ) = \mathcal N ( \mathbf x _ { t } ; \sqrt { \alpha _ { t } } \mathbf x _ { t - 1 } , ( 1 - \alpha _ { t } ) \mathbf I ) . } \end{array}
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
Hyperparameters $\alpha _ { 1 } , \ldots , \alpha _ { T }$ are chosen to all be close to but slightly less than 1 so that the amount of noise added at each step is small. The combination of this diffusion process and a data distribution
|
| 48 |
+
|
| 49 |
+

|
| 50 |
+
Figure 3: Left: Our DDPM iteratively transforms Gaussian noise $\mathbf { x } _ { T }$ to video frames $\mathbf { x } _ { \mathrm { 0 } }$ (shown with blue borders), conditioning on observed frames $\mathbf { y }$ (red borders) at every step. Right: The U-net architecture used within each DDPM step. It computes $\epsilon _ { \theta } ( \mathbf x _ { t } , \mathbf y , t )$ , with which the Gaussian transition $p _ { \theta } ( \mathbf { x } _ { t - 1 } | \mathbf { x } _ { t } )$ is parameterized.
|
| 51 |
+
|
| 52 |
+
$q ( \mathbf { x } _ { 0 } , \mathbf { y } )$ (recalling that $\mathbf { x } _ { 0 } = \mathbf { x }$ ) defines the joint distribution
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
q ( \mathbf x _ { 0 : T } , \mathbf y ) = q ( \mathbf x _ { 0 } , \mathbf y ) \prod _ { t = 1 } ^ { T } q ( \mathbf x _ { t } | \mathbf x _ { t - 1 } ) .
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
DDPMs work by “inverting” the diffusion process: given values of $\mathbf { x } _ { t }$ and $\mathbf { y }$ a neural network is used to parameterize $p _ { \theta } ( \mathbf { x } _ { t - 1 } | \mathbf { x } _ { t } , \mathbf { y } )$ , an approximation of $q ( \mathbf { x } _ { t - 1 } | \mathbf { x } _ { t } , \mathbf { y } )$ . This neural network lets us draw samples of $\mathbf { x } _ { \mathrm { 0 } }$ by first sampling $\mathbf { x } _ { T }$ from a unit Gaussian (recall that the diffusion process was chosen so that $q ( \mathbf { x } _ { T } )$ is well approximated by a unit Gaussian), and then iteratively sampling $\mathbf { x } _ { t - 1 } \sim p _ { \theta } ( \cdot | \mathbf { x } _ { t } , \mathbf { y } )$ for $t = T , T - 1 , \dots , 1$ . The joint distribution of sampled $\mathbf { x } _ { \mathrm { 0 : } T }$ given $\mathbf { y }$ is
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
p _ { \theta } ( \mathbf { x } _ { 0 : T } | \mathbf { y } ) = p ( \mathbf { x } _ { T } ) \prod _ { t = 1 } ^ { T } p _ { \theta } ( \mathbf { x } _ { t - 1 } | \mathbf { x } _ { t } , \mathbf { y } )
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where $p ( \mathbf { x } _ { T } )$ is a unit Gaussian that does not depend on $\theta$ . Training the conditional DDPM therefore involves fitting $p _ { \theta } ( \mathbf { x } _ { t - 1 } | \mathbf { x } _ { t } , \mathbf { y } )$ to approximate $q ( \mathbf { x } _ { t - 1 } | \mathbf { x } _ { t } , \mathbf { y } )$ for all choices of $t$ , $\mathbf { x } _ { t }$ , and $\mathbf { y }$ .
|
| 65 |
+
|
| 66 |
+
Several observations have been made in recent years which simplify the learning of $p _ { \theta } ( \mathbf { x } _ { t - 1 } | \mathbf { x } _ { t } , \mathbf { y } )$ . Sohl-Dickstein et al. [28] showed that when $\alpha _ { t }$ is close to 1, $p _ { \theta } ( \mathbf { x } _ { t - 1 } | \mathbf { x } _ { t } )$ is approximately Gaussian [28]. Furthermore, Ho et al. [15] showed that this Gaussian’s variance can be modeled well with a non-learned function of $t$ , and that a good estimate of the Gaussian’s mean can be obtained from a “denoising model” as follows. Given data $\mathbf { x } _ { \mathrm { 0 } }$ and unit Gaussian noise $\epsilon$ , the denoising model (in the form of a neural network) is fed “noisy” data $\mathbf { x } _ { t } : = \sqrt { \tilde { \alpha } _ { t } } \mathbf { x } _ { 0 } + \sqrt { 1 - \tilde { \alpha } _ { t } } \epsilon$ and trained to recover $\epsilon$ via a mean squared error loss. The parameters $\begin{array} { r } { \tilde { \alpha } _ { t } : = \prod _ { i = 1 } ^ { t } \alpha _ { i } } \end{array}$ are chosen to ensure that the marginal distribution of $\mathbf { x } _ { t }$ given $\mathbf { x } _ { \mathrm { 0 } }$ is $q ( \mathbf { x } _ { t } | \mathbf { x } _ { 0 } )$ as derived from Eq. (1). Given a weighting function $\lambda ( t )$ , the denoising loss is
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\mathcal { L } ( \theta ) = \mathbb { E } _ { q ( \mathbf { x } _ { 0 } , \mathbf { y } , \epsilon ) } \left[ \sum _ { t = 1 } ^ { T } \lambda ( t ) | | \epsilon - \epsilon _ { \theta } ( \mathbf { x } _ { t } , \mathbf { y } , t ) | | _ { 2 } ^ { 2 } \right] \quad \mathrm { w i t h } \quad \mathbf { x } _ { t } = \sqrt { \tilde { \alpha } _ { t } } \mathbf { x } _ { 0 } + \sqrt { 1 - \tilde { \alpha } _ { t } } \epsilon .
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
The mean of $p _ { \theta } ( \mathbf { x } _ { t - 1 } | \mathbf { x } _ { t } , \mathbf { y } )$ is obtained from the denoising model’s output $\epsilon _ { \theta } ( \mathbf x _ { t } , \mathbf y , t )$ as $\begin{array} { r } { \frac { 1 } { \alpha _ { t } } \mathbf { x } _ { t } - \frac { 1 - \alpha _ { t } } { \sqrt { 1 - \tilde { \alpha } _ { t } } } \epsilon _ { \theta } \big ( \mathbf { x } _ { t } , \mathbf { y } , t \big ) } \end{array}$ . If the weighting function $\lambda ( t )$ is chosen appropriately, optimising Eq. (4) is equivalent to optimising a lower-bound on the data likelihood under $p _ { \theta }$ . In practice, simply setting $\lambda ( t ) : = 1$ for all $t$ can produce more visually compelling results in the image domain [15].
|
| 73 |
+
|
| 74 |
+
In our proposed method, as in Tashiro et al. [32], the shapes of $\mathbf { x } _ { \mathrm { 0 } }$ and $\mathbf { y }$ sampled from $q ( \cdot )$ vary. This is because we want to train a model which can flexibly adapt to e.g. varying numbers of observed frames. To map Eq. (4) to this scenario, note that both $\mathbf { x } _ { \mathrm { 0 } }$ and $\mathbf { y }$ implicitly contain information about which frames in the video they represent (via the index vectors $\mathcal { X }$ and $\mathcal { V }$ introduced in the previous section). This information is used inside the neural network $\epsilon _ { \theta } ( \mathbf x _ { t } , \mathbf y , t )$ so that interactions between frames can be conditioned on the distance between them (as described in the following section) and also to ensure that the sampled noise vector $\epsilon$ has the same shape as $\mathbf { x } _ { \mathrm { 0 } }$ .
|
| 75 |
+
|
| 76 |
+
$: \mathcal { X } : = \{ \} ; \mathcal { Y } : = \{ \}$
|
| 77 |
+
2: while True do
|
| 78 |
+
3: $n _ { \mathrm { g r o u p } } \sim$ UniformDiscrete $( 1 , K )$
|
| 79 |
+
4: $s _ { \mathrm { g r o u p } } \sim \mathrm { L o g U n i f o r m } ( 1 , ( N - 1 ) / n _ { \mathrm { g r o u p } } )$
|
| 80 |
+
5: $x _ { \mathrm { g r o u p } } \sim \mathrm { U n i f o r m } ( 0 , N - ( n _ { \mathrm { g r o u p } } - 1 ) \cdot s _ { \mathrm { g r o u p } } )$
|
| 81 |
+
6: ogroup ∼ Bernoulli(0.5)
|
| 82 |
+
7: $\tilde { \mathcal { G } } : = \{ \lfloor x _ { \mathrm { g r o u p } } + s _ { \mathrm { g r o u p } } \cdot i \rfloor | i \in \{ 0 , \ldots , n _ { \mathrm { g r o u p } } - 1 \} \} \backslash \mathcal { X } \backslash \mathcal { Y }$
|
| 83 |
+
8: if $| \mathcal { X } | + | \mathcal { Y } | + | \mathcal { G } | > K$ then
|
| 84 |
+
9: return set2vector $( \mathcal { X } )$ , set2vector $( { \mathcal { V } } )$
|
| 85 |
+
10: else if $| \mathcal { X } | = 0$ or $o _ { \mathrm { g r o u p } } = 0$ then
|
| 86 |
+
11: $\mathcal { X } : = \mathcal { X } \cup \mathcal { G }$
|
| 87 |
+
12: else
|
| 88 |
+
13: $y : = \mathcal { y } \cup \mathcal { G }$
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
Figure 4: Left: Samples from $u ( \mathcal { X } , \mathcal { Y } )$ with video length $N = 3 0$ and limit $K = 1 0$ on the number of sampled indices. Each row shows one sample and columns map to frames, with frame 1 on the left and frame $N$ on the right. Blue and red denote latent and observed frames respectively. All other frames are ignored and shown as white. Right: Pseudocode for drawing these samples. The while loop iterates over a series of regularly-spaced groups of latent variables. Each group is parameterized by: the number of indices in it, $n _ { \mathrm { g r o u p } }$ ; the spacing between indices in it, $s _ { \mathrm { g r o u p } }$ ; the position of the first frame in it, $x _ { \mathrm { g r o u p } }$ , and an indicator variable for whether this group is observed, $O _ { \mathrm { { g r o u p } } }$ (which is ignored on line 10 if $\mathcal { X }$ is empty to ensure that the returned value of $\mathcal { X }$ is never empty). These quantities are sampled in a continuous space and then discretized to make a set of integer coordinates on line 7. The process repeats until a group is sampled which, if added to $\mathcal { X }$ or $\mathcal { V }$ , will cause the number of frames to exceed $K$ . That group is then discarded and $\mathcal { X }$ and $\mathcal { V }$ are returned as vectors. The FDM’s training objective forces it to work well for any $( \mathcal { X } , \mathcal { Y } )$ pair from this broad distribution.
|
| 92 |
+
|
| 93 |
+
# 4 Training procedure and architecture
|
| 94 |
+
|
| 95 |
+
Training task distribution Different choices of latent and observed indices $\mathcal { X }$ and $\mathcal { V }$ can be regarded as defining different conditional generation tasks. In this sense, we aim to learn a model which can work well on any task (i.e. any choice of $\mathcal { X }$ and $\mathcal { V }$ ) and so we randomly sample these vectors of indices during training. We do so with the distribution $u ( \mathcal { X } , \mathcal { Y } )$ described in Fig. 4. This provides a broad distribution covering many plausible test-time use cases while still providing sufficient structure to improve learning (see ablation in Section 6 and more details in Appendix C). To cope with constrained computational resources, the distribution is designed such that $\left| \mathcal { X } \right| + \left| \mathcal { V } \right|$ is upper-bounded by some pre-specified $K$ . Sampling from $q ( \mathbf { x } _ { 0 } , \mathbf { y } )$ in Eq. (4) is then accomplished by randomly selecting both a full training video $\mathbf { v }$ and indices $\mathcal { X } , \mathcal { Y } \sim u ( \cdot , \cdot )$ . We then extract the specified frames $\mathbf { x } = \mathbf { v } [ \mathcal { X } ]$ and $\mathbf { y } = \mathbf { v } [ \mathcal { V } ]$ (where we use $\mathbf { v } [ \mathcal { X } ]$ to denote the concatenation of all frames in $\mathbf { v }$ with indices in $\mathcal { X }$ and and $\mathbf { v } [ \mathcal { V } ]$ similarly).
|
| 96 |
+
|
| 97 |
+
Architecture DDPM image models [15, 22] typically use a U-net architecture [24]. Its distinguishing feature is a series of spatial downsampling layers followed by a series of upsampling layers, and these are interspersed with convolutional res-net blocks [14] and spatial attention layers. Since we require an architecture which operates on 4-D video tensors rather than 3-D image tensors we add an extra frame dimension to its input, output and hidden state, resulting in the architecture shown on the right of Fig. 3. We create the input to this architecture as a concatenation $\mathbf x _ { t } \oplus \mathbf y$ , adding an extra input channel which is all ones for observed frames and all zeros for latent frames. For RGB video, the input shape is therefore ( $K$ , image height, image width, 4). Since the output should have the same shape as $\mathbf { x } _ { t }$ we only return outputs corresponding to the latent frames, giving output shape $\vert \mathcal { X } \vert$ , image height, image width, 3). We run all layers from the original model (including convolution, resizing, group normalization, and spatial attention) independently for each of the $K$ frames. To allow communication between the frames, we add a temporal attention layer after each spatial attention layer, described in more detail in the appendix. The spatial attention layer allows each spatial location to attend to all other spatial locations within the same frame, while the temporal attention layer allows each spatial location to attend to the same spatial location across all other frames. This combination of a temporal attention layer with a spatial attention layer is sometimes referred to as factorized attention [32, 16]. We found that, when using this architecture in conjunction with our meta-learning approach, performance could be improved by using a novel form of relative position encoding [27, 38]. This is included in our released source code but we leave its exposition to the supplementary material.
|
| 98 |
+
|
| 99 |
+
Training batch padding Although the size $| \mathcal { X } \oplus \mathcal { Y } |$ of index vectors sampled from our training distribution is bounded above by $K$ , it can vary. To fit examples with various sizes of index vectors into the same batch, one option would be to pad them all to length $K$ with zeros and use masks so that the zeros cannot affect the loss. This, however, would waste computation on processing tensors of zeros. We instead use this computation to obtain a lower-variance loss estimate by processing additional data with “training batch padding”. This means that, for training examples where $| x \oplus y | < K$ , we concatenate frames uniformly sampled from a second video to increase the length along the frame-dimension to $K$ . Masks are applied to the temporal attention mechanisms so that frames from different videos cannot attend to eachother and the output for each is the same as that achieved by processing the videos in different batches.
|
| 100 |
+
|
| 101 |
+
Sampling schemes Before describing the sampling schemes we explore experimentally, we emphasize that the relative performance of each is dataset-dependent and there is no single best choice. A central benefit of FDM is that it can be used at test-time with different sampling schemes without retraining. Our simplest sampling scheme, Autoreg, samples ten consecutives frames at each stage conditioned on the previous ten frames. Long-range is similar to Autoreg but conditions on only the five most recent frames as well as five of the original 36 observed frames. Hierarchy-2 uses a multi-level sampling procedure. In the first level, ten evenly spaced frames spanning the non-observed portion of the video are sampled (conditioned on ten observed frames). In the second level, groups of consecutive frames are sampled conditioned on the closest past and future frames until all frames have been sampled. Hierarchy-3 adds an intermediate stage where several groups of variables with an intermediate spacing between them are sampled. We include adaptive hierarchy-2, abbreviated Ad. hierarchy-2, as a demonstration of a sampling scheme only possible with a model like FDM. It samples the same frames at each stage as Hierarchy-2 but selects which frames to condition on adaptively at test-time with a heuristic aimed at collecting the maximally diverse set of frames, as measured by the pairwise LPIPS distance [41] between them.
|
| 102 |
+
|
| 103 |
+
Optimizing sampling schemes An appealing alternative to the heuristic sampling schemes described in the previous paragraph would be to find a sampling scheme that is, in some sense, optimal for a given model and video generation/completion task. While it is unclear how to tractably choose which frames should be sampled at each stage, we suggest that the frames to condition on at each stage can be chosen by greedily optimizing the diffusion model loss which, as mentioned in Section 3, is closely related to the data log-likelihood. Given a fixed sequence of frames to sample at each stage $[ \mathcal { X } _ { s } ] _ { s = 1 } ^ { S }$ we select $\mathcal { \partial } _ { s }$ for each $s$ to minimize Eq. (4). This is estimated using a set of 100 training videos and by iterating over 10 evenly-spaced values of $t$ (which reduced variance relative to random sampling of $t$ ). See the appendix for further details. We create two optimized sampling schemes: one with the same latent indices as Autoreg, and one with the same latent indices as Hierarchy-2. We call the corresponding optimized schemes Opt. autoreg and Opt. hierarchy-2.
|
| 104 |
+
|
| 105 |
+
# 5 CARLA Town01 Dataset
|
| 106 |
+
|
| 107 |
+
In addition to our methodological contributions, we propose a new video-modeling dataset and benchmark which provides an interpretable measure of video completion quality. The dataset consists of videos of a car driving with a first-person view, produced using the CARLA autonomous driving simulator [9]. All 408 training and 100 test videos (of length 1000 frames and resolution $1 2 8 \times 1 2 8 )$ ) are produced within a single small town, CARLA’s Town01. As such, when a sufficiently expressive video model is trained on this dataset it memorizes the layout of the town and videos sampled from the model will be recognisable as corresponding to routes travelled within the town. We train a regression model in the form of a neural network which maps with high accuracy from any single rendered frame to $( x , y )$ coordinates representing the car’s position. Doing so allows us to plot the routes corresponding to sampled videos (see left of Fig. 5) and compute semantically-meaningful yet quantitative measures of the validity of these routes. Specifically, we compute histograms of speeds, where each speed is estimated by measuring the distance between the regressed locations for frames spaced ten apart (1 second at the dataset’s frame rate). Sampled videos occasionally “jump” between disparate locations in the town, resulting in unrealistically large estimated speeds. To measure the frequency of these events for each method, we compute the percentage of our point-speed estimates that exceed a threshold of $1 0 \mathrm { m / s }$ (the dataset was generated with a maximum simulated speed of $\mathrm { 3 m / s }$ ). We report this metric as the outlier percentage (OP). After filtering out these outliers, we compute the Wasserstein distance (WD) between the resulting empirical distribution and that of the original dataset, giving a measure of how well generated videos match the speed of videos in the dataset. We release the CARLA Town 01 dataset along with code and our trained regression model to allow future comparisons.2
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
Figure 5: Left: Map of the town featured in the CARLA Town01 dataset. We visualize two video completions by FDM by showing coordinates output by our regressor (discussed in Section 5) for each frame. Those corresponding to the initial 36 observed frames are shown in red and those for the 964 sampled frames are shown in blue. Right: For each completion, we show one of the initially observed frames followed by four of the sampled frames (at positions chosen to show the progression with respect to visible landmarks and marked by black dots on the map). The town’s landmarks are usually sampled with high-fidelity, which is key to allowing the regressor to produce a coherent trajectory on the left. However there are sometimes failures: a blue square near the top-right of the map shows where the video model “jumped” to a wrong location for a single frame.
|
| 111 |
+
|
| 112 |
+
# 6 Experiments
|
| 113 |
+
|
| 114 |
+
We perform our main comparisons on the video completion task. In keeping with Saxena et al. [26], we condition on the first 36 frames of each video and sample the remainder. We present results on three datasets: GQN-Mazes [10], in which videos are 300 frames long; MineRL Navigate [13, 26] (which we will from now on refer to as simply MineRL), in which videos are 500 frames long; and the CARLA Town01 dataset we release, for which videos are 1000 frames long. We train FDM in all cases with the maximum number of represented frames $K = 2 0$ . We host non-cherry-picked video samples (both conditional and unconditional) from FDM and all baselines online3.
|
| 115 |
+
|
| 116 |
+
Comparison of sampling schemes The relative performance of different sampling schemes varies significantly between datasets as shown in Table 1. We report Fréchet Video Distances (FVDs) [33], a measure of how similar sampled completions are to the test set, on all datasets. In addition on GQN-Mazes we we report the accuracy metric [26], which classifies videos based on which rooms are visited and measures how often a completion is given the same class as the corresponding test video. For CARLA Town01 we report the previously described percentage outliers (PO) and Wasserstein distance (WD) metrics.
|
| 117 |
+
|
| 118 |
+

|
| 119 |
+
Figure 6: Speed distributions measured from sampled and ground-truth dataset videos.
|
| 120 |
+
|
| 121 |
+
We can broadly consider the aforementioned sampling schemes as either being in the “autoregressive” family (Autoreg and Long-range) or in the “hierarchical”
|
| 122 |
+
|
| 123 |
+
Table 1: Evaluation on video completion with various modes of our method along with several baselines from the literature. Error bars denote the standard error computed with 5 random seeds. Higher is better for the accuracy metric [26] and lower is better for all other metrics shown.
|
| 124 |
+
|
| 125 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">Sampling scheme</td><td colspan="2">GQN-Mazes</td><td>MineRL</td><td colspan="3">CARLA Town01</td></tr><tr><td>FVD</td><td> Accuracy</td><td>FVD</td><td>FVD</td><td>WD</td><td>OP</td></tr><tr><td>CWVAE [26]</td><td>CWVAE</td><td>837±8</td><td>82.6± 0.5</td><td>1573±5</td><td>1161</td><td>0.666</td><td>44.4</td></tr><tr><td>TATS [11]</td><td>TATS</td><td>163 ± 2.6</td><td>77.0± 0.8</td><td>807±14</td><td>329</td><td>1.648</td><td>42.4</td></tr><tr><td>VDM [16]</td><td>VDM</td><td>66.7 ± 1.5</td><td>77.8± 0.5</td><td>271±8.8</td><td>169</td><td>0.501</td><td>16.9</td></tr><tr><td rowspan="5">FDM (ours)</td><td>Autoreg</td><td>86.4± 5.2</td><td>69.6 ± 1.3</td><td>281±10</td><td>222</td><td>0.579</td><td>0.51</td></tr><tr><td>Long-range</td><td>64.5 ± 1.9</td><td>77.0 ± 1.4</td><td>267 ±4.0</td><td>213</td><td>0.653</td><td>0.47</td></tr><tr><td>Hierarchy-2</td><td>53.1 ± 1.1</td><td>82.8± 0.7</td><td>275±7.7</td><td>120</td><td>0.318</td><td>3.28</td></tr><tr><td>Hierarchy-3</td><td>53.7 ± 1.9</td><td>83.8 ± 1.1</td><td>311± 6.8</td><td>149</td><td>0.363</td><td>4.53</td></tr><tr><td>Ad. hierarchy-2</td><td>55.0 ± 1.4</td><td>83.2 ± 1.3</td><td>316 ±8.9</td><td>117</td><td>0.311</td><td>3.44</td></tr></table>
|
| 126 |
+
|
| 127 |
+
family (the remainder). Those in the hierarchical family achieve significantly better FVDs [33] on GQN-Mazes. Our samples in the appendix suggest that this is related to the autoregressive methods “forgetting” the colors of walls after looking away from them for a short time. In contrast, for MineRL the autoregressive methods tend to achieve the best FVDs. This may relate to the fact that trajectories in MineRL tend to travel in straight lines through procedurally-generated “worlds”[13, 26], limiting the number of long-range dependencies. Finally on CARLA Town01 we notice qualitatively different behaviours from our autoregressive and hierarchical sampling schemes. The hierarchical sampling schemes have a tendency to occasionally lose coherence and “jump” to different locations in the town. This is reflected by higher outlier percentages (OP) in Table 1. On the other hand the autoregressive schemes often stay stationary for unrealistically long times at traffic lights. This is reflected in the histogram of speeds in Fig. 6, which has a larger peak around zero than the ground truth. The high variance of the sampling scheme’s relative performance over different datasets points to a strength of our method, which need only be trained once and then used to explore a variety of sampling schemes. Furthermore, we point out that the best FVDs in Table 1 on all datasets were obtained using sampling schemes that could not be implemented using models trained in prior work, or over evenly spaced frames.
|
| 128 |
+
|
| 129 |
+
Comparison with baselines The related work most relevant to ours is the concurrent work of Ho et al. [16], who model 64-frame videos using two trained DDPMs. The first is a “frameskip-4” model trained to generate every fourth frame and the second is a “frameskip-1” model trained on sequences of nine consecutive frames and used to “fill in” the gaps between frames generated in the first stage. To compare against this approach, which we denote VDM, we train both a “frameskip-4” and a “frameskip-1” model with architectures identical to our own.4 Since VDM requires two trained DDPMs, we train it for more GPU-hours than FDM despite the fact that FDM is meta-learning over a far broader task distribution. We also compare against TATS [11], which embeds videos into a discrete latent space before modelling them with a transformers, and the clockwork VAE (CWVAE) [26], a VAE-based model specifically designed to maintain long-range dependencies within video.
|
| 130 |
+
|
| 131 |
+
Both the diffusion-based methods, FDM and VDM, achieve significantly higher FVD scores than TATS and CWVAE. This may point toward the utility of diffusion models in general for modeling images and video. Table 1 also makes clear the main benefit of FDM over VDM: although there is no sampling scheme for FDM which always outperforms VDM, there is at least one sampling scheme that outperforms it on each dataset. This speaks to the utility of learning a flexible model like FDM that allows different sampling schemes to be experimented with after training.
|
| 132 |
+
|
| 133 |
+
Optimized sampling schemes As mentioned in Section 4, another advantage of FDM is that it makes possible a model- and dataset-specific optimization procedure to determine on which frames to condition. Table 2 shows the results when this procedure is used to create sampling schemes for different datasets. In the first row we show results where the latent frames are fixed to be those of the Autoreg sampling scheme, and in the second row the latent frames are fixed to match those of Hierarchy-2. On two of the three datasets the best results in Table 1 are improved upon, showing the utility of this optimization procedure.
|
| 134 |
+
|
| 135 |
+
Table 2: FVD scores for our sampling schemes with observed indices optimized offline as described in Section 4. We mark with an asterisk $( ^ { * } )$ the eight numbers which improve on the corresponding non-optimized sampling schemes and highlight in bold those that are better than any in Table 1.
|
| 136 |
+
|
| 137 |
+
<table><tr><td></td><td colspan="2">GQN-Mazes</td><td>MineRL</td><td colspan="3">CARLA Town01</td></tr><tr><td>Sampling scheme</td><td>FVD</td><td>Accuracy</td><td>FVD</td><td>FVD</td><td>WD</td><td>OP</td></tr><tr><td> Opt. autoreg</td><td>53.6±1.2*</td><td>80.2±1.2*</td><td>257±6.8*</td><td>146*</td><td>0.452*</td><td>0.65</td></tr><tr><td>Opt. hierarchy-2</td><td>51.1 ± 1.3*</td><td>84.6±0.7*</td><td>320 ± 7.0</td><td>124</td><td>0.349</td><td>4.11*</td></tr></table>
|
| 138 |
+
|
| 139 |
+
Comparison with training on a single task Training a network with our distribution over training tasks could be expected to lead to worse performance on a single task than training specifically for that task. To test whether this is the case, we train an ablation of FDM with training tasks exclusively of the type used in our Autoreg sampling scheme, i.e. “predict ten consecutive frames given the previous ten.” Tested with the Autoreg sampling scheme, it obtained an FVD of 82.0 on GQN-Mazes and 234 on MineRL. As expected given the specialization to a single task, this is better than when FDM is run with the Autoreg sampling scheme (obtaining FVDs of 86.4 and 281 respectively).
|
| 140 |
+
|
| 141 |
+
Ablation on training task distribution To test how important our proposed structured training distribution is to FDM’s performance, we perform an ablation with a different task distribution that samples $\mathcal { X }$ and $\mathcal { V }$ from uniform distributions instead of our proposed structured task distribution We provide full details in the appendix, but report here that switching away form our structured training distribution made the FVD scores worse on all five tested sampling schemes on both GQN-Mazes and MineRL. The reduction in the average FVD was $3 1 \%$ on GQN-Mazes and $5 2 \%$ on MineRL. This implies that our structured training distribution has a significant positive effect.
|
| 142 |
+
|
| 143 |
+
# 7 Related work
|
| 144 |
+
|
| 145 |
+
Some related work creates conditional models by adapting the sampling procedure of an unconditional DDPM [30, 18, 21, 16]. These approaches require approximations and the more direct approach that we use (explcitly training a conditional DDPM) was shown to have benefits by Tashiro et al. [32]. We consider further comparison of these competing approaches to be outside the focus of this work, which is on modeling a small portion of video frames at a time, essentially performing marginalization in addition to conditioning.
|
| 146 |
+
|
| 147 |
+
There are a number of approaches in the literature which use VAEs rather than DDPMs for video modelling. Babaeizadeh et al. [2] use a VAE model which predicts frames autoregressively conditioned on a global time-invariant latent variable. A related approach by Denton and Fergus [7] also uses a VAE with convolutional LSTM architectures in both the encoder and decoder. Unlike Babaeizadeh et al. [2] the prior is learned and a different latent variable is sampled for each frame. Babaeizadeh et al. [3] use a VAE with one set of latent variables per frame and inter-frame dependencies tracked by a two-layer LSTM. Their architecture intentionally overfits to the training data, which when coupled with image augmentations techniques achieves SOTA on various video prediction tasks. Kim et al. [20] use a variational RNN [5] with a hierarchical latent space that includes binary indicator variables which specify how the video is divided into a series of subsequences. Both Villegas et al. [35] and Wichers et al. [37] target long-term video prediction using a hierarchical variational LSTM architecture, wherein high-level features such as landmarks are predicted first, then decoded into low-level pixel space. The two approaches differ in that Villegas et al. [35] requires ground truth landmark labels, while [37] removes this dependence using an unsupervised adversarial approach. Fully GAN-based video models have also been proposed [1, 6] but generally suffer from “low quality frames or low number of frames or both” [1].
|
| 148 |
+
|
| 149 |
+
# 8 Discussion
|
| 150 |
+
|
| 151 |
+
We have defined and empirically explored a new method for generating photorealistic videos with long-range coherence that respects and efficiently uses fixed, finite computational resources. Our approach outperforms prior work on long-duration video modeling as measured by quantitative and semantically meaningful metrics and opens up several avenues for future research. For one, similar to using DDPMs for image generation, our method is slow to sample from (it takes approximately 16 minutes to generate a 300 frame video on a GPU). Ideas for making sampling faster by decreasing the number of integration steps [25, 29, 39] could be applied to our video model.
|
| 152 |
+
|
| 153 |
+
On a different note, consider the datasets on which our artifact was trained. In each there was a policy for generating the sequences of actions that causally led to the frame-to-frame changes in camera pose. In MineRL the video was generated by agents that were trained to explore novel Minecraft worlds to find a goal block approximately 64 meters away [13]. The CARLA data was produced by a camera attached to an agent driven by a low level proportional–integral–derivative controller following waypoints laid down by a high level planner that was given new, random location goals to drive to intermittently. In both cases our video model had no access to either the policy or the specific actions taken by these agents and, so, in a formal sense, our models integrate or marginalize over actions drawn from the stochastic policy used to generate the videos in the first place. Near-term future work could involve adding other modalities (e.g. audio) to FDM as well as explicitly adding actions and rewards, transforming our video generative model into a vision-based world model in the reinforcement learning sense [17, 19]. Furthermore, we point out that FDM trained on CARLA Town01 is in theory capable of creating 100-second videos conditioned on both the first and final frame. Doing so can be interpreted as running a “visual” controller which proposes a path between a current state and a specified goal. Preliminary attempts to run in FDM in this way yielded inconsistent results but we believe that this could be a fruitful direction for further investigation.
|
| 154 |
+
|
| 155 |
+
# Acknowledgments
|
| 156 |
+
|
| 157 |
+
We would like to thank Inverted AI, and especially Alireza Morsali, for generating the CARLA Town01 dataset. We acknowledge the support of the Natural Sciences and Engineering Research Council of Canada (NSERC), the Canada CIFAR AI Chairs Program, and the Intel Parallel Computing Centers program. Additional support was provided by UBC’s Composites Research Network (CRN), and Data Science Institute (DSI). This research was enabled in part by technical support and computational resources provided by WestGrid (www.westgrid.ca), Compute Canada (www.computecanada.ca), and Advanced Research Computing at the University of British Columbia (arc.ubc.ca). WH acknowledges support by the University of British Columbia’s Four Year Doctoral Fellowship (4YF) program.
|
| 158 |
+
|
| 159 |
+
# References
|
| 160 |
+
|
| 161 |
+
[1] Nuha Aldausari, Arcot Sowmya, Nadine Marcus, and Gelareh Mohammadi. Video generative adversarial networks: a review. ACM Computing Surveys (CSUR), 55(2):1–25, 2022.
|
| 162 |
+
[2] Mohammad Babaeizadeh, Chelsea Finn, Dumitru Erhan, Roy H Campbell, and Sergey Levine. Stochastic variational video prediction. arXiv preprint arXiv:1710.11252, 2017.
|
| 163 |
+
[3] Mohammad Babaeizadeh, Mohammad Taghi Saffar, Suraj Nair, Sergey Levine, Chelsea Finn, and Dumitru Erhan. Fitvid: Overfitting in pixel-level video prediction. arXiv preprint arXiv:2106.13195, 2021.
|
| 164 |
+
[4] Rewon Child. Very deep vaes generalize autoregressive models and can outperform them on images. arXiv preprint arXiv:2011.10650, 2020.
|
| 165 |
+
[5] Junyoung Chung, Kyle Kastner, Laurent Dinh, Kratarth Goel, Aaron C Courville, and Yoshua Bengio. A recurrent latent variable model for sequential data. Advances in neural information processing systems, 28, 2015.
|
| 166 |
+
[6] Aidan Clark, Jeff Donahue, and Karen Simonyan. Adversarial video generation on complex datasets. arXiv preprint arXiv:1907.06571, 2019. [7] Emily Denton and Rob Fergus. Stochastic video generation with a learned prior. In International conference on machine learning, pages 1174–1183. PMLR, 2018. [8] Prafulla Dhariwal and Alexander Nichol. Diffusion models beat gans on image synthesis. Advances in Neural Information Processing Systems, 34, 2021.
|
| 167 |
+
[9] Alexey Dosovitskiy, German Ros, Felipe Codevilla, Antonio Lopez, and Vladlen Koltun. Carla: An open urban driving simulator. In Conference on robot learning, pages 1–16. PMLR, 2017.
|
| 168 |
+
[10] SM Ali Eslami, Danilo Jimenez Rezende, Frederic Besse, Fabio Viola, Ari S Morcos, Marta Garnelo, Avraham Ruderman, Andrei A Rusu, Ivo Danihelka, Karol Gregor, et al. Neural scene representation and rendering. Science, 360(6394):1204–1210, 2018.
|
| 169 |
+
[11] Songwei Ge, Thomas Hayes, Harry Yang, Xi Yin, Guan Pang, David Jacobs, Jia-Bin Huang, and Devi Parikh. Long video generation with time-agnostic vqgan and time-sensitive transformer. arXiv preprint arXiv:2204.03638, 2022.
|
| 170 |
+
[12] Audrunas Gruslys, Rémi Munos, Ivo Danihelka, Marc Lanctot, and Alex Graves. Memoryefficient backpropagation through time. Advances in Neural Information Processing Systems, 29, 2016.
|
| 171 |
+
[13] William H Guss, Brandon Houghton, Nicholay Topin, Phillip Wang, Cayden Codel, Manuela Veloso, and Ruslan Salakhutdinov. Minerl: A large-scale dataset of minecraft demonstrations. arXiv preprint arXiv:1907.13440, 2019.
|
| 172 |
+
[14] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arxiv 2015. arXiv preprint arXiv:1512.03385, 2015.
|
| 173 |
+
[15] Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 33:6840–6851, 2020.
|
| 174 |
+
[16] Jonathan Ho, Tim Salimans, Alexey Gritsenko, William Chan, Mohammad Norouzi, and David J Fleet. Video diffusion models. arXiv preprint arXiv:2204.03458, 2022.
|
| 175 |
+
[17] Maximilian Igl, Luisa Zintgraf, Tuan Anh Le, Frank Wood, and Shimon Whiteson. Deep variational reinforcement learning for pomdps. In International Conference on Machine Learning, pages 2117–2126. PMLR, 2018.
|
| 176 |
+
[18] Zahra Kadkhodaie and Eero P Simoncelli. Solving linear inverse problems using the prior implicit in a denoiser. arXiv preprint arXiv:2007.13640, 2020.
|
| 177 |
+
[19] Lukasz Kaiser, Mohammad Babaeizadeh, Piotr Milos, Blazej Osinski, Roy H Campbell, Konrad Czechowski, Dumitru Erhan, Chelsea Finn, Piotr Kozakowski, Sergey Levine, et al. Modelbased reinforcement learning for atari. arXiv preprint arXiv:1903.00374, 2019.
|
| 178 |
+
[20] Taesup Kim, Sungjin Ahn, and Yoshua Bengio. Variational temporal abstraction. Advances in Neural Information Processing Systems, 32, 2019.
|
| 179 |
+
[21] Gautam Mittal, Jesse Engel, Curtis Hawthorne, and Ian Simon. Symbolic music generation with diffusion models. arXiv preprint arXiv:2103.16091, 2021.
|
| 180 |
+
[22] Alexander Quinn Nichol and Prafulla Dhariwal. Improved denoising diffusion probabilistic models. In International Conference on Machine Learning, pages 8162–8171. PMLR, 2021.
|
| 181 |
+
[23] Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. In NIPS-W, 2017.
|
| 182 |
+
[24] Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, pages 234–241. Springer, 2015.
|
| 183 |
+
[25] Tim Salimans and Jonathan Ho. Progressive distillation for fast sampling of diffusion models. arXiv preprint arXiv:2202.00512, 2022.
|
| 184 |
+
|
| 185 |
+
[26] Vaibhav Saxena, Jimmy Ba, and Danijar Hafner. Clockwork variational autoencoders. Advances in Neural Information Processing Systems, 34, 2021.
|
| 186 |
+
|
| 187 |
+
[27] Peter Shaw, Jakob Uszkoreit, and Ashish Vaswani. Self-attention with relative position representations. arXiv preprint arXiv:1803.02155, 2018.
|
| 188 |
+
|
| 189 |
+
[28] Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In International Conference on Machine Learning, pages 2256–2265. PMLR, 2015.
|
| 190 |
+
|
| 191 |
+
[29] Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. arXiv preprint arXiv:2010.02502, 2020.
|
| 192 |
+
|
| 193 |
+
[30] Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. arXiv preprint arXiv:2011.13456, 2020.
|
| 194 |
+
|
| 195 |
+
[31] Corentin Tallec and Yann Ollivier. Unbiasing truncated backpropagation through time. arXiv preprint arXiv:1705.08209, 2017.
|
| 196 |
+
|
| 197 |
+
[32] Yusuke Tashiro, Jiaming Song, Yang Song, and Stefano Ermon. Csdi: Conditional score-based diffusion models for probabilistic time series imputation. Advances in Neural Information Processing Systems, 34, 2021.
|
| 198 |
+
|
| 199 |
+
[33] Thomas Unterthiner, Sjoerd van Steenkiste, Karol Kurach, Raphael Marinier, Marcin Michalski, and Sylvain Gelly. Towards accurate generative models of video: A new metric & challenges. arXiv preprint arXiv:1812.01717, 2018.
|
| 200 |
+
|
| 201 |
+
[34] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. Advances in neural information processing systems, 30, 2017.
|
| 202 |
+
|
| 203 |
+
[35] Ruben Villegas, Dumitru Erhan, Honglak Lee, et al. Hierarchical long-term video prediction without supervision. In International Conference on Machine Learning, pages 6038–6046. PMLR, 2018.
|
| 204 |
+
|
| 205 |
+
[36] Dirk Weissenborn, Oscar Täckström, and Jakob Uszkoreit. Scaling autoregressive video models. arXiv preprint arXiv:1906.02634, 2019.
|
| 206 |
+
|
| 207 |
+
[37] Nevan Wichers, Ruben Villegas, Dumitru Erhan, and Honglak Lee. Hierarchical Long-term Video Prediction without Supervision. June 2018. doi: 10.48550/arXiv.1806.04768.
|
| 208 |
+
|
| 209 |
+
[38] Kan Wu, Houwen Peng, Minghao Chen, Jianlong Fu, and Hongyang Chao. Rethinking and improving relative position encoding for vision transformer. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 10033–10041, 2021.
|
| 210 |
+
|
| 211 |
+
[39] Zhisheng Xiao, Karsten Kreis, and Arash Vahdat. Tackling the generative learning trilemma with denoising diffusion GANs. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id $\equiv$ JprM0p-q0Co.
|
| 212 |
+
|
| 213 |
+
[40] Ruihan Yang, Prakhar Srivastava, and Stephan Mandt. Diffusion probabilistic modeling for video generation. arXiv preprint arXiv:2203.09481, 2022.
|
| 214 |
+
|
| 215 |
+
[41] Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 586–595, 2018.
|
| 216 |
+
|
| 217 |
+
# Checklist
|
| 218 |
+
|
| 219 |
+
1. For all authors...
|
| 220 |
+
|
| 221 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 222 |
+
(b) Did you describe the limitations of your work? [Yes]
|
| 223 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes]
|
| 224 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 225 |
+
|
| 226 |
+
2. If you are including theoretical results...
|
| 227 |
+
|
| 228 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 229 |
+
|
| 230 |
+
3. If you ran experiments...
|
| 231 |
+
|
| 232 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes]
|
| 233 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
|
| 234 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes]
|
| 235 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See appendix.
|
| 236 |
+
|
| 237 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 238 |
+
|
| 239 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 240 |
+
(b) Did you mention the license of the assets? [Yes]
|
| 241 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes]
|
| 242 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 243 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 244 |
+
|
| 245 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 246 |
+
|
| 247 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 248 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 249 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/dev/1W0z96MFEoH/1W0z96MFEoH.md
ADDED
|
@@ -0,0 +1,250 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BENCHMARKING THE SPECTRUM OF AGENT CAPABILITIES
|
| 2 |
+
|
| 3 |
+
# Danijar Hafner
|
| 4 |
+
|
| 5 |
+
Google Research, Brain Team University of Toronto mail@danijar.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Evaluating the general abilities of intelligent agents requires complex simulation environments. Existing benchmarks typically evaluate only one narrow task per environment, requiring researchers to perform expensive training runs on many different environments. We introduce Crafter, an open world survival game with visual inputs that evaluates a wide range of general abilities within a single environment. Agents either learn from the provided reward signal or through intrinsic objectives and are evaluated by semantically meaningful achievements that can be unlocked during each episode, such as discovering resources and crafting tools. Consistently unlocking all achievements requires strong generalization, deep exploration, and long-term reasoning. We experimentally verify that Crafter is of appropriate difficulty to drive future research and provide baselines scores of reward agents and unsupervised agents. Furthermore, we observe sophisticated behaviors emerging from maximizing the reward signal, such as building tunnel systems, bridges, houses, and plantations. We hope that Crafter will accelerate research progress by quickly evaluating a wide spectrum of abilities.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Crafter is an open world survival game for reinforcement learning research. Shown in Figure 1, Crafter features randomly generated 2D worlds with forests, lakes, mountains, and caves. The player needs to forage for food and water, find shelter to sleep, defend against monsters, collect materials, and build tools. The game mechanics are inspired by the popular game Minecraft and were simplified and optimized for research productivity. Crafter aims to be a fruitful benchmark for reinforcement learning by focusing on the following design goals:
|
| 14 |
+
|
| 15 |
+
Research challenges Crafter poses substantial challenges to current methods. Procedural generation requires strong generalization, the technology tree evaluates wide and deep exploration, image observations calls for representation learning, repeated subtasks and sparse rewards evaluate long-term reasoning and credit assignment.
|
| 16 |
+
|
| 17 |
+
Meaningful evaluation Agents are evaluated by a range of achievements that can be unlocked in each episode. The achievements correspond to meaningful milestones in behavior, offering insights into ability spectrum of both reward agents and unsupervised agents.
|
| 18 |
+
|
| 19 |
+
Iteration speed Crafter evaluates many agent abilities within a single environment, vastly reducing the computational requirements over benchmarks suites that require training on many separate environments from scratch, while making it more likely that the measured performance is representative of new domains.
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: Agent view of a procedurally generated world in Crafter, showing terrain types, resources, and creatures. Agents learn from image inputs and aim to unlock a range of semantically meaningful achievements during each episode. The achievements evaluate strong generalization, wide and deep exploration, and long-term reasoning.
|
| 23 |
+
|
| 24 |
+

|
| 25 |
+
Figure 2: Play Crafter yourself through the human interface.
|
| 26 |
+
|
| 27 |
+
# 2 RELATED WORK
|
| 28 |
+
|
| 29 |
+
Benchmarks have been a driving force behind the progress and successes of reinforcement learning as a field (Bellemare et al., 2013; Brockman et al., 2016; Kempka et al., 2016; Beattie et al., 2016; Tassa et al., 2018; Juliani et al., 2018). Benchmarks often require a large amount of computational resources and yet only test a small fraction of the abilities that a general agent should master (Cobbe et al., 2020). This section directly compares Crafter to four particularly related benchmarks.
|
| 30 |
+
|
| 31 |
+
Minecraft Crafter is inspired by the successful 3D video game Minecraft, which is available to researchers via Malmo (Johnson et al., 2016) and MineRL (Guss et al., 2019). Minecraft features diverse open worlds with randomly generated and modifiable terrain, as well as many different resources, tools, and monsters. However, Minecraft is too complex to be solved by current methods (Milani et al., 2020), it is unclear by what metric agents should be evaluated by, the environment is slow, and can be difficult to use because it requires Java and a window server. In comparison, Crafter captures many principles of Minecraft in a simple and fast environment, where results can be obtained in a matter of hours, and where a large number of semantically meaningful evaluation metrics are available for reinforcement learning with or without extrinsic reward. The goal of Crafter is not to replace Minecraft but progress faster towards it.
|
| 32 |
+
|
| 33 |
+
Atari The Atari Learning Environment (Bellemare et al., 2013) has been the gold standard benchmark in reinforcement learning. It comprises around 54 individual games, depending on the evaluation protocol (Mnih et al., 2015; Schulman et al., 2017; Badia et al., 2020; Hafner et al., 2020). While the large number of games tests different abilities of agents, they require a large amount of computation. The recommended protocol of training the agent with 5 random seeds on each game for 200M steps requires over 2000 GPU days (Castro et al., 2018; Hessel et al., 2018). This substantially slows down experimentation and makes the complete benchmark infeasible for most academic labs. Moreover, Atari games are nearly deterministic, so agents can approximately memorize their action sequences and are not required to generalize to new situations (Machado et al., 2018).
|
| 34 |
+
|
| 35 |
+
ProcGen ProcGen (Cobbe et al., 2020) provides a benchmark that is similar to Atari but explicitly addresses the determinism present in Atari through the use of procedural generation and randomized textures. It consists of 16 games, where each episode features a randomly generated level layout. Similarly, Crafter relies on procedural generation to provide a different world map with different distribution of resources and monsters for every episode. However, ProcGen still requires training methods on 16 individual games for 200M environment steps, which each focus on a narrow aspect of an agent’s general abilities. In comparison, Crafter evaluates many different abilities of an agent by training only on a single environment for 5M steps, substantially accelerating experimentation.
|
| 36 |
+
|
| 37 |
+
NetHack NetHack (Küttler et al., 2020) is a text-based game, where the player traverses a randomly generated system of dungeons with many different items and creatures. Unlike the other discussed environments, NetHack uses symbolic inputs and thus does not evaluate an agent’s ability to learn representations of high-dimensional inputs. The game is challenging due to the large amount of knowledge required about the many different items and their effects, even for human players. As a result, NetHack requires many environment steps for agents to acquire this domain-specific knowledge; 1B steps were used in the original paper. In contrast, Crafter generates diverse complex worlds from simple underlying rules, focusing more on generalization than memorization of facts.
|
| 38 |
+
|
| 39 |
+
# 3 CRAFTER BENCHMARK
|
| 40 |
+
|
| 41 |
+
We introduce Crafter, a benchmark that evaluates a variety of agent abilities in a single environment. This section describes the game mechanics of the environment, the interface of agent inputs and actions, the evaluation protocol that is based on a range of semantically meaningful achievements, and the open challenges that Crafter poses for future research.
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 3: Crafter procedurally generates a unique world for every episode that features several terrain types: grasslands, forests, lakes, mountains, caves. Memorizing action sequences is thus not a viable strategy and agents are forced to learn behaviors that generalize to new situations.
|
| 45 |
+
|
| 46 |
+
# 3.1 GAME MECHANICS
|
| 47 |
+
|
| 48 |
+
This section describes the game mechanics of Crafter, namely its randomly generated world maps, the levels of health and other internal quantities that the player has to maintain, the resources it can collect and objects and tools it can make from them, as well as the creatures and how they are influenced by the time of day. The images of all materials and objects are shown in Figure E.1. All randomness in the environment is uniquely determined by an integer seed that is derived from the initial seed passed to the environment and the episode number.
|
| 49 |
+
|
| 50 |
+
Terrain generation A unique world is generated for every episode, shown in Figure 3. The world leverages an underlying grid of $6 4 \times 6 4$ cells but the agent only observes the world through pixel images. The terrain features grasslands, lakes, and mountains. Lakes can have shores, grasslands can have forests, and mountains can have caves, ores, and lava. These are determined by OpenSimplex noise (Spencer, 2014), a form of locally smooth noise. Within the areas determined by noise, objects appear with equal probability at any location, such as trees in forests and skeletons in caves.
|
| 51 |
+
|
| 52 |
+
Health and survival The player has levels of health, food, water, and rest that it must prevent from reaching zero. The levels for food, water, and rest decrease over time and are restored by drinking from a lake, chasing cows or growing fruits to eat, and sleeping in places where monsters cannot attack. Once one of the three levels reaches zero, the player starts losing health points. It can also lose health points when attacked by monsters. When the health points reach zero, the player dies. Health points regenerate over time when the player is not hungry, thirsty, or sleepy.
|
| 53 |
+
|
| 54 |
+
Resources and crafting There are many resources, such as saplings, wood, stone, coal, iron, and diamonds, the player can collect in its inventory and use to build tools and place objects in the world. Many of the resources require tools that the place must first build from more basic resources, leading to a technology tree with several levels. Standing nearby a table enables the player to craft wood pickaxes and swords, as well as stone pickaxes and stone swords. Crafting a furnace from stone enables crafting iron pickaxes and iron swords from both iron, coal, and wood.
|
| 55 |
+
|
| 56 |
+
Creatures and night Creatures are initialized in random locations and move randomly. Zombies and cows live in grasslands and are automatically spawned and despawned to ensure a given amount of creatures. At night, the agent’s view is restricted and noisy and a larger number of zombies is spawned. This makes it difficult to survive without securing a shelter, such as a cave. Skeletons live in caves and try to keep the player at a distance to shoot arrows at the player. The player can interact with creatures to decrease their health points. Cows move randomly and offer a food source.
|
| 57 |
+
|
| 58 |
+
# 3.2 ENVIRONMENT INTERFACE
|
| 59 |
+
|
| 60 |
+
This section defines the specification of the environment, explains the available actions, agent inputs, episode termination, and additional information provided by the environment. The design goal of these is to make the environment easy to use and inspect. The environment uses the Gym interface (Brockman et al., 2016) with visual agent inputs and flat categorical actions.
|
| 61 |
+
|
| 62 |
+

|
| 63 |
+
Figure 4: The 22 achievements that can be unlocked within each episode. The arrows indicate which achievements will be completed along the way of working toward more challenging achievements. Several of the earlier tasks have to be repeated multiple times, such as collecting resources, to progress further. A reward is only given when an achievement is unlocked for the first time during the episode.
|
| 64 |
+
|
| 65 |
+
Observations Agent receive color images of size $6 4 \times 6 4 \times 3$ as their only inputs. The image shows a local top-down view of the map, reaching 4 cells west and east and 3 cells north and south of the player position. Below this view of the world, the image shows the current inventory state of the player, including its health points, food, water, and rest levels, collected materials, and crafted tools. The agent needs to learn to read its inventory state out of the image.
|
| 66 |
+
|
| 67 |
+
Actions The action space is a flat categorical space with 17 actions, represented by integer indices. The actions allow the player to move in all 4 directions along the grid, interact with the object in front of it, go to sleep, place objects, and make tools. Each object and tool has a separate action associated with it. Tools are kept in the inventory whereas objects are automatically placed in front of the player. If the agent does not hold the required materials for making an object or tool, the action has no effect.
|
| 68 |
+
|
| 69 |
+
Termination Each episode terminates when the player’s health points reach 0. This can happen when the player dies out of hunger, thirst, or tiredness, when attacked by a zombie or skeleton, or when falling into lava. Health points automatically regenerate, as long as the agent is not too hungry, thirsty, or sleepy. There is no negative reward for dying, as the reward signal already includes a penalty for losing health points. Episodes also end when reaching the time limit of 10,000 steps.
|
| 70 |
+
|
| 71 |
+
Additional information The environment allows access to privileged information about the world state that the agent is forbidden to observe. This includes numeric inventory counts, achievement counts, the current coordinate of the player on the grid, and a semantic grid representation of the map. These can be used for debugging purposes or for other research scenarios, such as predicting the underlying environment state to evaluate representation learning or video prediction models.
|
| 72 |
+
|
| 73 |
+
# 3.3 EVALUATION PROTOCOL
|
| 74 |
+
|
| 75 |
+
To evaluate the diverse abilities of artificial agents on Crafter, we define two benchmarks. The first benchmark allows agents to access a provided reward signal, while the second benchmark does not and requires agents to purely learn from intrinsic objectives. Besides access to the provided reward signal, the evaluation protocols are identical. An agent is granted a budget of 1M environment steps to interact with the environment. The agent performance is evaluated through success rates of the individual achievements throughout its training, as well as an aggregated score.
|
| 76 |
+
|
| 77 |
+
Achievements To evaluate a wide spectrum of agent abilities, Crafter defines 22 achievements. The achievements are shown in Figure 4 and correspond to semantically meaningful behaviors, such as collecting various resources, building objects and tools, finding food and water, defeating monsters, and waking up safely after sleeping. The achievements cover a wide range of difficulties, making them suitable to evaluate both weak and strong players and providing continuous feedback throughout the development process of new methods. Some achievements are independent of each other to test for breadth of exploration, while others depend on each other to test for deep exploration.
|
| 78 |
+
|
| 79 |
+
Reward Crafter provides a sparse reward signal that is the sum of two components. The main component is a reward of $+ 1$ every time the agent unlocks each achievement for the first time during the current episode. The second component is a reward of $- 0 . 1$ for every health point lost and a reward of $+ 0 . 1$ for every health point that is regenerated. Because the maximum number of health points is 9, the second reward component only affects the first decimal of the episode return, and ceiling the episode return yields the number of achievements unlocked during the episode.
|
| 80 |
+
|
| 81 |
+
Success rates The success rates offer insights into the breadth of abilities learned by an agent. The success rates are computed separately for each of the achievements, as the fraction of training episodes during which the agent has unlocked the achievement at least once. It is computed across all episodes that lead up to the budget of 1M environment steps, requiring agents to be data-efficient.1 Note that the number of environment steps is fixed but the number of episodes can differ between agents. Unlocking an achievement more than once per episode does not affect the success rate.
|
| 82 |
+
|
| 83 |
+
Score The score summarizes the agent abilities into a single number. It is computed by aggregating the success rates for the individual achievements. Unlocking difficult achievements, even if it happens rarely, should contribute more than increasing the success rate of achievements that are already unlocked frequently even further. To account for the range of difficulties of the achievements, we average the success rates in log-space, known as the geometric mean.2 Unlike the reward, the score thus takes the achievement’s difficulties into account, without having to know them beforehand.
|
| 84 |
+
|
| 85 |
+
Discussion Aggregating across tasks via a geometric mean weighs tasks based on their difficulty to the agent, resulting in higher scores for agents that explore more broadly. For example, collecting a diamond $1 \%$ of the time instead of $0 \%$ is a meaningful improvement, whereas collecting wood $9 5 \%$ of the time instead of $90 \%$ is not. This allows distinguishing how broadly agents have explored their environment even if they achieve similar rewards. The geometric mean also establishes a meaningful metric for unsupervised agents, which may get bored of tasks after performing them a few times and then move on to new tasks. A caveat of the geometric mean is that agents with rewards are evaluated by something they only indirectly optimize for, which can change their ranking order. Increasing reward and score is generally correlated, but capacity-limited agents may choose to optimize reward by mastering easy tasks and ignoring hard tasks, which only slowly increases the geometric mean.
|
| 86 |
+
|
| 87 |
+
# 3.4 RESEARCH CHALLENGES
|
| 88 |
+
|
| 89 |
+
Crafter aims to evaluate a diverse range of agent abilities within a single environment. Thus, if a method performs well on Crafter there should be a high chance that it also handles the challenges of other environments. The challenges also make Crafter suitable for evaluating progress on open research questions, such as strong generalization, wide and deep exploration, discovering reusable skills, and long-term memory and reasoning. Crafter is designed to pose the following challenges:
|
| 90 |
+
|
| 91 |
+
Exploration Independent achievements evaluate wide exploration, without offering a linear path for the agent to follow. Dependent achievements evaluate deep exploration of the technology tree. Collecting a diamond requires an iron pickaxe, which in turn requires a furnace, table, coal, iron, and wood. The furnace requires collecting stone, which requires building a wood pickaxe at a table.
|
| 92 |
+
|
| 93 |
+
Generalization Every episode is situated in a unique world that is procedurally generated. Moreover, many aspects of the game reoccur in different contexts, such as creatures and resources that can be found in different landscapes and times of day. This forces successful agents to recognize similar situations in different circumstances and be robust to changes in irrelevant details.
|
| 94 |
+
|
| 95 |
+

|
| 96 |
+
Figure 5: Crafter Benchmark Scores for various agents with and without rewards. Current top methods achieve scores of up to $10 \%$ that are far from the $50 \%$ of human experts, posing a substantial challenge for future research. Crafter scores are computed as the geometric mean across achievements of their success rates within the budget of 1M environment steps. Numbers in Table 1.
|
| 97 |
+
|
| 98 |
+
Reusable skills Advancing in the game requires the agent to repeat several behaviors over long horizons, such as finding food, defending against monsters, and collecting common materials that are needed many times. The behavior of a successful agent naturally decomposes into sub-tasks, making Crafter suitable for studying hierarchical reinforcement learning.
|
| 99 |
+
|
| 100 |
+
Credit assignment Only sparse rewards are given for unlocking an achievement for the first time during each episode. Moreover, several achievements require long-term reasoning, such as collecting the necessary resources for crafting a particular tool or planting saplings that can be harvested many hundred time steps later. This makes Crafter a challenge for temporal credit assignment.
|
| 101 |
+
|
| 102 |
+
Memory The agent inputs only show the player’s immediate surroundings, making Crafter partially observed. To survive for a long time, agents need to remember where to find lakes to drink and open grasslands to hunt. Moreover, to effectively find rare resources, such as iron and diamonds, the agent needs to remember what parts of the map it has already searched.
|
| 103 |
+
|
| 104 |
+
Representation The agent observes its environment via high-dimensional images, from which it has to extract entities that are meaningful for decision making. Similar to applications in the real world, the reward signal is sparse and the amount of environment interaction limited. As a result, successful agents will likely rely on explicit representation learning techniques.
|
| 105 |
+
|
| 106 |
+
Survival In previous environments, the player can often survive by doing nothing. This allows for degenerate solutions to intrinsic objectives, unlike the real world where animals are forced to adapt to survive and maintain homeostasis and allostasis. In Crafter, the player struggles to survive through the constant pressure of maintaining enough water, food, rest, and defending against zombies.
|
| 107 |
+
|
| 108 |
+
<table><tr><td>Method</td><td>Score (%)</td><td>Return</td></tr><tr><td>Human Experts</td><td>50.5±6.8</td><td>14.3±2.3</td></tr><tr><td>DreamerV2</td><td>10.0±1.2</td><td>9.0±1.7</td></tr><tr><td>PPO</td><td>4.6±0.3</td><td>4.2±1.2</td></tr><tr><td>Rainbow</td><td>4.3±0.2</td><td>5.0±1.3</td></tr><tr><td>Plan2Explore (Unsup)</td><td>2.1±0.1</td><td>2.1±1.5</td></tr><tr><td>RND (Unsup)</td><td>2.0±0.1</td><td>0.7±1.3</td></tr><tr><td>Random</td><td>1.6±0.0</td><td>2.1±1.3</td></tr></table>
|
| 109 |
+
|
| 110 |
+
Table 1: Crafter benchmark scores. The Crafter score is computed as the geometric mean of success rates for all 22 achievements available in the environment. The score prefers general agents that unlock a wide range of achievements over those that unlock a small number of achievements very frequently. For example, an agent that explores many different achievements over the course of training achieves a higher score than one that only performs same simple tasks over an over. The score thus establishes a meaningful metric both for agents with and without reward.
|
| 111 |
+
|
| 112 |
+

|
| 113 |
+
Figure 6: Agent ability spectrum showing the success rates of agents with rewards. These are unlocking percentages for all 22 achievements, computed over all training episodes. Rainbow manages to drink water and forage for food. PPO additionally rarely collects coal and builds stone tools. DreamerV2 achieves these more frequently and additionally sometimes grows and eats fruits. Numbers in Appendix A.
|
| 114 |
+
|
| 115 |
+
# 4 EXPERIMENTS
|
| 116 |
+
|
| 117 |
+
To established baselines for future work, we train various reinforcement learning methods on Crafter either with and without rewards. The two benchmarks follow the evaluation protocol in Section 3.3, which grants each agent a budget of 1M environment frames and computes the success rates of the individual achievements across all training episodes, as well as an aggregate score for the agent. Furthermore, we analyze the emergent agent behaviors qualitatively and record a dataset of human expert players to estimate the difficulty of the environment. The environment, code for the baseline agents and figures in this paper, and the human dataset are available on the project website. 3
|
| 118 |
+
|
| 119 |
+
# 4.1 BENCHMARK WITH REWARDS
|
| 120 |
+
|
| 121 |
+
We provide baselines scores for three reinforcement learning algorithms on Crafter with rewards. DreamerV2 (Hafner et al., 2020) learns a world model and optimizes a policy through planning in latent space. We used its default hyper parameters for Atari and increased the model size. PPO (Schulman et al., 2017) is a popular method that learns to map input images to actions through policy gradients. We use a convolutional neural network policy with hyper parameters that were tuned for Atari (Hill et al., 2018). Rainbow (Hessel et al., 2018) is based on Q-Learning and combines several advances, including for exploration. The defaults for Atari did not work well, so we tuned the hyper parameters for Crafter and found a compromise between Atari defaults and the data-efficient version of the method (van Hasselt et al., 2019) to be ideal. All agents trained for 1M environment steps in under 24 hours on a single GPU and we repeated the training for 10 random seeds per method. The training reward curves are included in Appendix D.
|
| 122 |
+
|
| 123 |
+
The scores are listed in Table 1 and visualized in Figure 5. DreamerV2 achieves a score of $1 0 . 0 \%$ , followed by PPO with $4 . 6 \%$ and Rainbow of $4 . 3 \%$ . Despite these being top reinforcement learning methods, they lack behind the score of expert human players of $5 0 . 5 \%$ , which we describe in further detail in Section 4.3. We conclude that Crafter is a challenging benchmark, where current methods make learning progress but future research is needed to achieve high performance. For comparison, we report the episode returns in Table 1, computed over the episodes within the last $1 0 ^ { 5 }$ environment steps of training. We find a trend similar to the scores but notice that the methods are harder to tell apart, because differences on hard tasks that are rarely achieved affect the return less. Moreover, the scores are more meaningful for unsupervised agents, which should explore many achievements over time, but not necessarily remain interested in them until the end of training. The success rates for individual achievements are visualized in Figure 7, which offer insights into the breadth and depth of agent abilities. Rainbow displays high success rates on easier achievements. PPO learned to additionally make stone tools and furnaces. DreamerV2 achieved these more frequently and discovered growing and harvesting plants. None of the agents learned to collect and use iron for tools or to collect diamonds, or to achieve high success rates on many of the achievements.
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
Figure 7: Agent ability spectrum showing the success rates for Crafter without rewards. Random actions unlock the 6 easiest achievements sometimes, such as drinking water and collecting wood. Plan2Explore forages for food and defeats monsters more frequently, to ensure longer survival. RND additionally collects stones and rarely even collects coal and builds furnaces. Numbers in Appendix B.
|
| 127 |
+
|
| 128 |
+
# 4.2 UNSUPERVISED BENCHMARK
|
| 129 |
+
|
| 130 |
+
We provide baselines scores for two unsupervised reinforcement learning agents on Crafter without rewards. We also include a baseline that simply chooses random actions. RND (Burda et al., 2018b) is a popular exploration method that seeks out novel inputs, estimated as the prediction error of a network that aims to predict fixed random embeddings of the input images. We use its default parameters for Atari. Plan2Explore (Sekar et al., 2020) learns a world model to plan for the expected information gain of imagined trajectories, allowing it to directly seek out imagined states that have not been experienced before. We implement Plan2Explore on top of DreamerV2 and keep the same hyper parameters. We use a non-episodic value function as RND does, which helps exploration in episodic environments (Burda et al., 2018b). All agents trained for 1M environment steps in under 24 hours on a single GPU and we repeated the training for 10 random seeds per method.
|
| 131 |
+
|
| 132 |
+
The scores are listed in Table 1 and in Figure 5. Plan2Explore achieves a score of $2 . 1 \%$ , followed by RND at $2 . 0 \%$ , both ahead of the random agent at $1 . 6 \%$ . Despite these being top unsupervised reinforcement learning methods, they lack far behind optimal performance or even the performance of agents that learn with rewards, posing a substantial challenge for future research. The results are encouraging, showing that unsupervised objectives by themselves can lead to meaningful behaviors (Burda et al., 2018a) in Crafter. Inspecting the success rates for individual achievements in Figure 6 confirms that Plan2Explore and RND make progress in exploring the different behaviors compared to the random agent, including occasionally collecting coal, placing furnaces, and making stone swords, which are several steps deep into the technology tree.
|
| 133 |
+
|
| 134 |
+
# 4.3 EMERGENT BEHAVIORS
|
| 135 |
+
|
| 136 |
+
To better understand the potential of the environment, we train DreamerV2 for 50M steps and investigate the behaviors qualitatively. In this amount of time, the agent learns to build stone tools and even iron tools on individual occurrences. Interestingly, we observe a range of sophisticated emergent behaviors, such as building tunnel systems, building bridges to cross lakes, and outsmarting skeletons by dodging arrows, blocking arrows with stones, and digging through walls to surprise skeletons from the side. Furthermore, DreamerV2 learns to seek shelter to protect itself from the zombies at night by hiding in caves and even digging its own caves and closing the entrances with stones. Finally, we find that the agent sometimes manages to build plantations of many saplings, defends them against monsters, and eats the growing fruits in order to ensure a reliable and steady food supply. A video of the emergent behaviors is available on the project website.
|
| 137 |
+
|
| 138 |
+
# 4.4 HUMAN EXPERTS DATASET
|
| 139 |
+
|
| 140 |
+
Crafter includes a graphical user interface that allows humans to play the game via the keyboard and record the trajectories of the game. The human interface can be installed via the command shown in Figure 2. Through the human interface, we recorded the games of 5 human experts for a combined total of 100 episodes. The experts were given the instructions of the game and allowed several hours of practice. Out of the 100 episodes, 5 episodes unlock all 22 achievements. The human experts achieved a score of $5 0 . 5 \%$ , unlocking all achievements as shown in Table C.1. The achievements most difficult to humans were to collect diamonds and grow and harvest plans, with success rates of $12 \%$ and $8 \%$ , respectively. While the human dataset is separate from the Crafter benchmark, it provides an estimate of human performance and can be used for research on learning from demonstrations and imitation learning. The human dataset is available on the project website.
|
| 141 |
+
|
| 142 |
+
# 5 DISCUSSION
|
| 143 |
+
|
| 144 |
+
Future work We selected the difficulty of Crafter to be challenging yet not hopeless for current methods. As research progresses towards solving the challenges that are currently present, it may become necessary to extend Crafter by new enemies, resources, items, and achievements. Being written purely in Python, Crafter can easily be extended in this way. Moreover, grouping the 22 achievements into categories, such as memory, generalization, and exploration, would allow us to summarize agent abilities more abstractly (Osband et al., 2019). We did not attempt such a categorization because it is subjective and will become clearer as more researchers use the environment.
|
| 145 |
+
|
| 146 |
+
Summary We introduced Crafter, a benchmark with visual inputs that evaluates a variety of general agent abilities in a single environment. We described the game mechanics, evaluation protocol, and open challenges posed by the benchmark, and performed experiments with several agents with and without rewards to provide baseline scores. Agents are evaluated based on how frequently they manage to unlock achievements that correspond to semantically meaningful milestones of behavior. We conclude that Crafter is well suited and of appropriate difficulty to guide future research on intelligent agents, both for learning from extrinsic rewards and purely from intrinsic objectives.
|
| 147 |
+
|
| 148 |
+
Acknowledgements We would like to thank Oleh Rybkin, Ben Eysenbach, Sherjil Ozair, Julius Kunze, Feryal Behbahani, Timothy Lillicrap, Jimmy Ba, Nicolas Heess, Kory Mathewson, Mohammad Norouzi, Hamza Merzic, and Sergey Levine for discussions and feedback.
|
| 149 |
+
|
| 150 |
+
# REFERENCES
|
| 151 |
+
|
| 152 |
+
Adrià Puigdomènech Badia, Bilal Piot, Steven Kapturowski, Pablo Sprechmann, Alex Vitvitskyi, Zhaohan Daniel Guo, and Charles Blundell. Agent57: Outperforming the atari human benchmark. In International Conference on Machine Learning, pp. 507–517. PMLR, 2020.
|
| 153 |
+
|
| 154 |
+
Charles Beattie, Joel Z Leibo, Denis Teplyashin, Tom Ward, Marcus Wainwright, Heinrich Küttler, Andrew Lefrancq, Simon Green, Víctor Valdés, Amir Sadik, et al. Deepmind lab. arXiv preprint arXiv:1612.03801, 2016.
|
| 155 |
+
|
| 156 |
+
Marc G Bellemare, Yavar Naddaf, Joel Veness, and Michael Bowling. The arcade learning environment: An evaluation platform for general agents. Journal of Artificial Intelligence Research, 47:253–279, 2013.
|
| 157 |
+
|
| 158 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym, 2016.
|
| 159 |
+
|
| 160 |
+
Yuri Burda, Harri Edwards, Deepak Pathak, Amos Storkey, Trevor Darrell, and Alexei A Efros. Large-scale study of curiosity-driven learning. arXiv preprint arXiv:1808.04355, 2018a.
|
| 161 |
+
|
| 162 |
+
Yuri Burda, Harrison Edwards, Amos Storkey, and Oleg Klimov. Exploration by random network distillation. arXiv preprint arXiv:1810.12894, 2018b.
|
| 163 |
+
|
| 164 |
+
Pablo Samuel Castro, Subhodeep Moitra, Carles Gelada, Saurabh Kumar, and Marc G Bellemare. Dopamine: A research framework for deep reinforcement learning. arXiv preprint arXiv:1812.06110, 2018.
|
| 165 |
+
|
| 166 |
+
Karl Cobbe, Chris Hesse, Jacob Hilton, and John Schulman. Leveraging procedural generation to benchmark reinforcement learning. In International conference on machine learning, pp. 2048–2056. PMLR, 2020.
|
| 167 |
+
|
| 168 |
+
William H Guss, Cayden Codel, Katja Hofmann, Brandon Houghton, Noboru Kuno, Stephanie Milani, Sharada Mohanty, Diego Perez Liebana, Ruslan Salakhutdinov, Nicholay Topin, et al. The minerl competition on sample efficient reinforcement learning using human priors. arXiv e-prints, pp. arXiv–1904, 2019.
|
| 169 |
+
|
| 170 |
+
Danijar Hafner, Timothy Lillicrap, Mohammad Norouzi, and Jimmy Ba. Mastering atari with discrete world models. arXiv preprint arXiv:2010.02193, 2020.
|
| 171 |
+
|
| 172 |
+
Matteo Hessel, Joseph Modayil, Hado Van Hasselt, Tom Schaul, Georg Ostrovski, Will Dabney, Dan Horgan, Bilal Piot, Mohammad Azar, and David Silver. Rainbow: Combining improvements in deep reinforcement learning. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 173 |
+
|
| 174 |
+
Ashley Hill, Antonin Raffin, Maximilian Ernestus, Adam Gleave, Anssi Kanervisto, Rene Traore, Prafulla Dhariwal, Christopher Hesse, Oleg Klimov, Alex Nichol, Matthias Plappert, Alec Radford, John Schulman, Szymon Sidor, and Yuhuai Wu. Stable baselines. https://github.com/ hill-a/stable-baselines, 2018.
|
| 175 |
+
|
| 176 |
+
Matthew Johnson, Katja Hofmann, Tim Hutton, and David Bignell. The malmo platform for artificial intelligence experimentation. In IJCAI, pp. 4246–4247. Citeseer, 2016.
|
| 177 |
+
|
| 178 |
+
Arthur Juliani, Vincent-Pierre Berges, Ervin Teng, Andrew Cohen, Jonathan Harper, Chris Elion, Chris Goy, Yuan Gao, Hunter Henry, Marwan Mattar, et al. Unity: A general platform for intelligent agents. arXiv preprint arXiv:1809.02627, 2018.
|
| 179 |
+
|
| 180 |
+
Michał Kempka, Marek Wydmuch, Grzegorz Runc, Jakub Toczek, and Wojciech Jaskowski. Vizdoom: ´ A doom-based ai research platform for visual reinforcement learning. In 2016 IEEE Conference on Computational Intelligence and Games (CIG), pp. 1–8. IEEE, 2016.
|
| 181 |
+
|
| 182 |
+
Heinrich Küttler, Nantas Nardelli, Alexander H Miller, Roberta Raileanu, Marco Selvatici, Edward Grefenstette, and Tim Rocktäschel. The nethack learning environment. arXiv preprint arXiv:2006.13760, 2020.
|
| 183 |
+
|
| 184 |
+
Marlos C Machado, Marc G Bellemare, Erik Talvitie, Joel Veness, Matthew Hausknecht, and Michael Bowling. Revisiting the arcade learning environment: Evaluation protocols and open problems for general agents. Journal of Artificial Intelligence Research, 61:523–562, 2018.
|
| 185 |
+
Stephanie Milani, Nicholay Topin, Brandon Houghton, William H Guss, Sharada P Mohanty, Keisuke Nakata, Oriol Vinyals, and Noboru Sean Kuno. Retrospective analysis of the 2019 minerl competition on sample efficient reinforcement learning. In NeurIPS 2019 Competition and Demonstration Track, pp. 203–214. PMLR, 2020.
|
| 186 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Andrei A Rusu, Joel Veness, Marc G Bellemare, Alex Graves, Martin Riedmiller, Andreas K Fidjeland, Georg Ostrovski, et al. Human-level control through deep reinforcement learning. Nature, 518(7540):529, 2015.
|
| 187 |
+
Ian Osband, Yotam Doron, Matteo Hessel, John Aslanides, Eren Sezener, Andre Saraiva, Katrina McKinney, Tor Lattimore, Csaba Szepesvari, Satinder Singh, et al. Behaviour suite for reinforcement learning. arXiv preprint arXiv:1908.03568, 2019.
|
| 188 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 189 |
+
Ramanan Sekar, Oleh Rybkin, Kostas Daniilidis, Pieter Abbeel, Danijar Hafner, and Deepak Pathak. Planning to explore via self-supervised world models. arXiv preprint arXiv:2005.05960, 2020.
|
| 190 |
+
Kurt Spencer. Noise!, 2014. URL https://uniblock.tumblr.com/post/ 97868843242/noise.
|
| 191 |
+
Yuval Tassa, Yotam Doron, Alistair Muldal, Tom Erez, Yazhe Li, Diego de Las Casas, David Budden, Abbas Abdolmaleki, Josh Merel, Andrew Lefrancq, et al. Deepmind control suite. arXiv preprint arXiv:1801.00690, 2018.
|
| 192 |
+
Hado $\mathrm { \bf P }$ van Hasselt, Matteo Hessel, and John Aslanides. When to use parametric models in reinforcement learning? Advances in Neural Information Processing Systems, 32:14322–14333, 2019.
|
| 193 |
+
|
| 194 |
+
# A SUCCESS RATES WITH REWARDS
|
| 195 |
+
|
| 196 |
+
Table A.1: Success rates on Crafter with rewards. Success rates are computed as the fraction of episodes during which the achievement has been unlocked at least once. It is computed across all training episodes within the budget of 1M environment steps. The score is the geometric mean of success rates over all achievements, as described in Section 3.3. Note that the score is computed for each seed separately before averaging over seeds and not the other way around. Numbers within $9 5 \%$ of the best number in each row are highlighted in bold.
|
| 197 |
+
|
| 198 |
+
<table><tr><td>Achievement</td><td>Rainbow</td><td>PPO</td><td>DreamerV2</td></tr><tr><td>Collect Coal</td><td>0.0%</td><td>0.4%</td><td>14.7%</td></tr><tr><td>Collect Diamond</td><td>0.0%</td><td>0.0%</td><td>0.0%</td></tr><tr><td>Collect Drink</td><td>24.0%</td><td>30.3%</td><td>80.0%</td></tr><tr><td>Collect Iron</td><td>0.0%</td><td>0.0%</td><td>0.0%</td></tr><tr><td>Collect Sapling</td><td>97.4%</td><td>66.7%</td><td>86.6%</td></tr><tr><td>Collect Stone</td><td>0.2%</td><td>3.0%</td><td>42.7%</td></tr><tr><td>Collect Wood</td><td>74.9%</td><td>83.0%</td><td>92.7%</td></tr><tr><td>Defeat Skeleton</td><td>0.7%</td><td>0.2%</td><td>2.6%</td></tr><tr><td>Defeat Zombie</td><td>39.6%</td><td>2.0%</td><td>53.1%</td></tr><tr><td>Eat Cow Eat Plant</td><td>26.1%</td><td>12.0%</td><td>17.1%</td></tr><tr><td>Make Iron Pickaxe</td><td>0.0%</td><td>0.0%</td><td>0.1%</td></tr><tr><td>Make Iron Sword</td><td>0.0%</td><td>0.0%</td><td>0.0%</td></tr><tr><td>Make Stone Pickaxe</td><td>0.0%</td><td>0.0%</td><td>0.0%</td></tr><tr><td></td><td>0.0%</td><td>0.0%</td><td>0.2%</td></tr><tr><td>Make Stone Sword</td><td>0.0%</td><td>0.0%</td><td>0.3%</td></tr><tr><td>MakeWood Pickaxe</td><td>4.8%</td><td>21.1%</td><td>59.6%</td></tr><tr><td>MakeWood Sword</td><td>9.8%</td><td>20.1%</td><td>40.2%</td></tr><tr><td>Place Furnace</td><td>0.0%</td><td>0.1%</td><td>1.8%</td></tr><tr><td>Place Plant</td><td>94.2%</td><td>65.0%</td><td>84.4%</td></tr><tr><td>Place Stone</td><td>0.0%</td><td>1.7%</td><td>29.0%</td></tr><tr><td>Place Table Wake Up</td><td>52.3%</td><td>66.1%</td><td>85.7%</td></tr><tr><td></td><td>93.3%</td><td>92.5%</td><td>92.8%</td></tr><tr><td>Score</td><td>4.3%</td><td>4.6%</td><td>10.0%</td></tr></table>
|
| 199 |
+
|
| 200 |
+
# B SUCCESS RATES WITHOUT REWARDS
|
| 201 |
+
|
| 202 |
+
Table B.1: Success rates on Crafter without rewards. Success rates are computed as the fraction of episodes during which the achievement has been unlocked at least once. It is computed across all training episodes within the budget of 1M environment steps. The score is the geometric mean of success rates over all achievements, as described in Section 3.3. Note that the score is computed for each seed separately before averaging over seeds and not the other way around. Numbers within $9 5 \%$ of the best number in each row are highlighted in bold.
|
| 203 |
+
|
| 204 |
+
<table><tr><td>Achievement</td><td>Random</td><td>RND</td><td>Plan2Explore</td></tr><tr><td>Collect Coal</td><td>0.0%</td><td>0.1%</td><td>0.1%</td></tr><tr><td>Collect Diamond</td><td>0.0%</td><td>0.0%</td><td>0.0%</td></tr><tr><td>Collect Drink</td><td>9.3%</td><td>52.1%</td><td>48.7%</td></tr><tr><td>Collect Iron</td><td>0.0%</td><td>0.0%</td><td>0.0%</td></tr><tr><td>Collect Sapling</td><td>50.2%</td><td>34.1%</td><td>25.5%</td></tr><tr><td>Collect Stone</td><td>0.0%</td><td>0.6%</td><td>0.5%</td></tr><tr><td>Collect Wood</td><td>24.4%</td><td>49.6%</td><td>46.8%</td></tr><tr><td>Defeat Skeleton</td><td>0.0%</td><td>0.3%</td><td>0.2%</td></tr><tr><td>Defeat Zombie</td><td>0.1%</td><td>0.3%</td><td>0.2%</td></tr><tr><td>Eat Cow</td><td>0.4%</td><td>0.9%</td><td>0.7%</td></tr><tr><td>Eat Plant</td><td>0.0%</td><td>0.0%</td><td>0.0%</td></tr><tr><td>Make Iron Pickaxe</td><td>0.0%</td><td>0.0%</td><td>0.0%</td></tr><tr><td>Make Iron Sword</td><td>0.0%</td><td>0.0%</td><td>0.0%</td></tr><tr><td>Make Stone Pickaxe</td><td>0.0%</td><td>0.0%</td><td>0.0%</td></tr><tr><td>Make Stone Sword</td><td>0.0%</td><td>0.0%</td><td>0.0%</td></tr><tr><td>Make Wood Pickaxe</td><td>0.3%</td><td>2.5%</td><td>3.3%</td></tr><tr><td>Make Wood Sword</td><td>0.3%</td><td>2.6%</td><td>3.3%</td></tr><tr><td>Place Furnace</td><td>0.0%</td><td>0.1%</td><td>0.0%</td></tr><tr><td>Place Plant</td><td>44.6%</td><td>21.4%</td><td>14.0%</td></tr><tr><td>Place Stone</td><td>0.0%</td><td>0.4%</td><td>0.3%</td></tr><tr><td>Place Table</td><td>4.4%</td><td>16.7%</td><td>16.3%</td></tr><tr><td>Wake Up</td><td>93.6%</td><td>7.8%</td><td>47.8%</td></tr><tr><td>Score</td><td>1.6%</td><td>2.0%</td><td>2.1%</td></tr></table>
|
| 205 |
+
|
| 206 |
+
C SUCCESS RATES OF HUMAN EXPERTS
|
| 207 |
+
|
| 208 |
+
<table><tr><td rowspan=1 colspan=1>Achievement</td><td rowspan=1 colspan=1>Human Experts</td></tr><tr><td rowspan=2 colspan=1>Collect CoalCollect DiamondCollect DrinkCollect IronCollect SaplingCollect StoneCollect WoodDefeat SkeletonDefeat ZombieEat CowEat PlantMake Iron PickaxeMake Iron SwordMake Stone PickaxeMake Stone SwordMake Wood PickaxeMake Wood SwordPlace FurnacePlace PlantPlace StonePlace TableWake Up</td><td rowspan=1 colspan=1>86.0%</td></tr><tr><td rowspan=1 colspan=1>12.0%92.0%53.0%67.0%100.0%100.0%31.0%84.0%89.0%8.0%26.0%22.0%78.0%78.0%100.0%45.0%32.0%24.0%90.0%100.0%73.0%</td></tr><tr><td rowspan=1 colspan=1>Score</td><td rowspan=1 colspan=1>50.5%</td></tr></table>
|
| 209 |
+
|
| 210 |
+
Table C.1: Success rates of human experts on Crafter. The success rates of human experts are computed as the fraction of all 100 recorded games during which the achievement has been unlocked at least once. To compute the score analogously to the artificial agents, we randomly split the 100 games into 5 groups that are treated as the different seeds. We then follow the same procedure as for the artificial agents.
|
| 211 |
+
|
| 212 |
+
# D EPISODE REWARD
|
| 213 |
+
|
| 214 |
+

|
| 215 |
+
Figure D.1: Total episode reward with shaded standard deviation. The optimal achievable episode reward is 22. While visualizing rewards can be informative for debugging, final performance on Crafter should be reported by computing the score instead. The score takes the different difficulties of the achievements into account and is defined as the geometric mean of the success rates for all achievements, as described in Section 3.3.
|
| 216 |
+
|
| 217 |
+
# E TEXTURES
|
| 218 |
+
|
| 219 |
+

|
| 220 |
+
Figure E.1: Crafter features worlds with several materials, resources, objects, and creatures. The player can interact with these to collect resources, maintain its food and water supplies, craft pickaxes and swords, and defend itself. The textures were specifically created for Crafter.
|
| 221 |
+
|
| 222 |
+
Table F.1: The action space is a flat categorical space, making Crafter easy to use. The 17 actions enable the agent to move, collect materials, place objects, craft objects, and interact with what is in front of the player. Actions whose requirements are not satisfied have no effect.
|
| 223 |
+
|
| 224 |
+
<table><tr><td>Integer</td><td>Name</td><td>Requirement</td></tr><tr><td>0</td><td>Noop</td><td>Always applicable.</td></tr><tr><td>1</td><td>Move Left</td><td>Flat ground left to the agent.</td></tr><tr><td>2</td><td>Move Right</td><td>Flat ground right to the agent.</td></tr><tr><td></td><td>Move Up</td><td>Flat ground above the agent.</td></tr><tr><td>34</td><td>Move Down</td><td>Flat ground below the agent.</td></tr><tr><td>5</td><td>Do</td><td>Facing creature or material; have necessary tool.</td></tr><tr><td>6</td><td>Sleep</td><td>Energy level is below maximum.</td></tr><tr><td>7</td><td>Place Stone</td><td>Stone in inventory.</td></tr><tr><td>8</td><td>Place Table</td><td>Wood in inventory.</td></tr><tr><td>9</td><td>Place Furnace</td><td>Stone in inventory.</td></tr><tr><td>10</td><td>Place Plant</td><td>Sapling in inventory.</td></tr><tr><td>11</td><td>MakeWood Pickaxe</td><td>Nearby table;wood in inventory.</td></tr><tr><td>12</td><td>Make Stone Pickaxe</td><td>Nearby table; wood, stone in inventory.</td></tr><tr><td>13</td><td>Make Iron Pickaxe</td><td>Nearby table, furnace; wood, coal, iron an inventory.</td></tr><tr><td>14</td><td>MakeWoodSword</td><td>Nearby table; wood in inventory.</td></tr><tr><td>15</td><td>Make Stone Sword</td><td>Nearby table; wood, stone in inventory.</td></tr><tr><td>16</td><td>Make Iron Sword</td><td>Nearby table,furnace; wood,coal, iron in inventory.</td></tr></table>
|
| 225 |
+
|
| 226 |
+
# G ACHIEVEMENT CURVES OF RAINBOW
|
| 227 |
+
|
| 228 |
+

|
| 229 |
+
Figure G.1: Achievement counts of Rainbow with shaded min and max.
|
| 230 |
+
|
| 231 |
+
# H ACHIEVEMENT CURVES OF PPO
|
| 232 |
+
|
| 233 |
+

|
| 234 |
+
Figure H.1: Achievement counts of PPO with shaded min and max.
|
| 235 |
+
|
| 236 |
+
# I ACHIEVEMENT CURVES OF DREAMERV2
|
| 237 |
+
|
| 238 |
+

|
| 239 |
+
Figure I.1: Achievement counts of DreamerV2 with shaded min and max.
|
| 240 |
+
|
| 241 |
+

|
| 242 |
+
Figure J.1: Achievement counts of random actions with shaded min and max.
|
| 243 |
+
|
| 244 |
+
# K ACHIEVEMENT CURVES OF UNSUPERVISED RND
|
| 245 |
+
|
| 246 |
+

|
| 247 |
+
Figure K.1: Achievement counts of unsupervised RND with shaded min and max.
|
| 248 |
+
|
| 249 |
+

|
| 250 |
+
Figure L.1: Achievement counts of unsupervised Plan2Explore with shaded min and max.
|
md/dev/3tbTw2ga8K/3tbTw2ga8K.md
ADDED
|
@@ -0,0 +1,325 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# The Quantization Model of Neural Scaling
|
| 2 |
+
|
| 3 |
+
Eric J. Michaud∗, Ziming Liu, Uzay Girit, and Max Tegmark MIT & IAIFI
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
We propose the Quantization Model of neural scaling laws, explaining both the observed power law dropoff of loss with model and data size, and also the sudden emergence of new capabilities with scale. We derive this model from what we call the Quantization Hypothesis, where network knowledge and skills are “quantized” into discrete chunks (quanta). We show that when quanta are learned in order of decreasing use frequency, then a power law in use frequencies explains observed power law scaling of loss. We validate this prediction on toy datasets, then study how scaling curves decompose for large language models. Using language model gradients, we automatically decompose model behavior into a diverse set of skills (quanta). We tentatively find that the frequency at which these quanta are used in the training distribution roughly follows a power law corresponding with the empirical scaling exponent for language models, a prediction of our theory.2
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
In the aggregate, larger neural networks trained on more data perform better than smaller neural networks trained on less data, in a predictable way. Across a range of studies, mean test loss has been observed to decrease as a power law in both the number of network parameters $( L \propto N ^ { - \alpha _ { N } } )$ ) and the number of training samples $( L \propto D ^ { - \alpha _ { D } }$ ) [1, 2, 3, 4, 5, 6, 7]. Although aggregate performance changes smoothly with scale, when particular capabilities are examined, larger models often have emergent abilities, i.e., qualitatively different performance than smaller models [8, 9]. Understanding and reconciling both facets of scaling – the predictable power law decrease in loss and the emergence of new capabilities at scale – is of both theoretical and practical interest [10]. Understanding how scaling changes what neural networks learn is entangled with core questions: what are deep neural networks doing internally, and will they will continue to improve with scale?
|
| 12 |
+
|
| 13 |
+
Recent studies of the internals of neural networks have found a variety of impressive algorithms learned by gradient descent [11, 12, 13, 14, 15]. As more work is put into understanding the structures learned by neural networks (the task of mechanistic interpretability), we may find more and more circuits [11, 16] in models, intelligible internal algorithms for accomplishing prediction in specific contexts. Can such analysis be scaled up to frontier models [17]? Two assumptions which, if true, would make us more optimistic about mechanistically understanding large models include (1) decomposability/modularity/sparsity [18, 19, 20, 21] – that large models are decomposable into parts, and only a small number of these parts are relevant to the model’s behavior on any given sample and (2) universality [22, 11, 23, 24] – that similar structures recur across models of increasing size. Recently, Olsson et al. [25] found encouraging evidence for universality of “induction heads” across LLMs and found that these emerge in a discrete transition during training.
|
| 14 |
+
|
| 15 |
+
In this paper, we articulate the Quantization Hypothesis, a set of informal conjectures about the decomposability of networks into smaller parts, the universality of computations performed across model scales, the discreteness of what models learn, and about how properties of the data distribution produce power law neural scaling. In particular, we hypothesize that to many prediction problems, there corresponds a particular enumerable set of indivisible pieces of knowledge or skills that models must learn, and that model performance is determined by which of these elements models successfully learn. We call these basic building blocks of model performance the quanta:
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: We auto-discover quanta – basic units of model knowledge/skill – for a language model. Here we show collections of next-token prediction samples which our method clustered together, each corresponding to some coherent model behavior. We indicate the token which was predicted from the context before it with a red highlight. We indicate newlines using $\ " \mathrm { \Omega } ^ { 6 6 } \mathrm { \Omega } \backslash \underline { { \mathrm { \Omega } } } \mathrm { \Omega } \mathrm { \Omega }$ . See Section 5 for explanation.
|
| 19 |
+
|
| 20 |
+
Quantum (plural quanta): An indivisible computational module that, for example, retrieves a fact, implements an algorithm, or more generally corresponds to some basic skill possessed by a model.
|
| 21 |
+
|
| 22 |
+
We use this terminology in analogy to Max Planck’s assumption in 1900 that energy is quantized into discrete chunks (quanta) – here we imagine that knowledge/skills are quantized into discrete chunks (quanta). Since “quantization” is commonly used in machine learning in the context of low-precision arithmetic, we suggest “knowledge quantization��� or “skill quantization” to refer to our notion of quantization. We will see that a Zipfian distribution governing the “use frequency” of the quanta produces power law neural scaling, where the effect of scaling is to learn an increasing number of discrete quanta, and smooth scaling laws average over small discrete jumps in model performance.
|
| 23 |
+
|
| 24 |
+
This paper is organized as follows: in Section 2 we give a theoretical model of power law neural scaling from the Quantization Hypothesis. In Section 3 we construct toy datasets satisfying the hypothesis, where smooth power laws average over many discrete jumps in model performance. In Section 4 we then analyze how power law scaling decomposes for real LLMs. In Section 5, we develop a method for automatically discovering quanta in language models by clustering their behavior into basic coherent skills, and analyze the statistics of these clusters, concluding in Section 7.
|
| 25 |
+
|
| 26 |
+
# 2 Theory
|
| 27 |
+
|
| 28 |
+
Consider the task of modeling the distribution of text on the internet. Successful prediction requires an immense amount of knowledge, and the ability to perform diverse computations, due to the immense complexity and diversity of the world and therefore of human language. For instance, in order to predict what word will come next in a conversation between two physicists, one must “know” much about physics. In order to continue the text $^ { \cdot \cdot } 2 5 3 4 ~ + ~ 7 2 6 1 ~ = ~ ^ { \cdot \cdot }$ , one must be able to perform arithmetic (for large enough numbers, memorization becomes a highly inefficient strategy) [26]. A great many distinct types of computations are present in the world in the processes that produce text, and so predicting text requires those computations to be present in our models.
|
| 29 |
+
|
| 30 |
+
In this paper, we conjecture the Quantization (or Quanta) Hypothesis:
|
| 31 |
+
|
| 32 |
+
QH1 Many natural prediction problems decompose into an enumerable set of computations, pieces of knowledge, or skills, which models must learn to reduce loss. We call these quanta, and model them as being discrete, – they are either learned or not learned. Model performance is determined by which quanta have been learned.
|
| 33 |
+
|
| 34 |
+
QH2 Some quanta are more useful for reducing loss than others, leading to a natural ordering of the quanta. We call the ordered quanta the Q Sequence. Optimally trained networks should therefore learn the quanta in that order. The effect of scaling is to learn more of the quanta in the Q Sequence, so scaling performance is simply determined by how many quanta are successfully learned.
|
| 35 |
+
|
| 36 |
+
QH3 The frequencies at which the quanta are used for prediction follow a power law.
|
| 37 |
+
|
| 38 |
+
Together these can result in power law neural scaling. We model the Quantization Hypothesis as follows, referring to the below as the “Quantization (or Quanta) Model”. Let q denote a bit string whose $k ^ { \mathrm { t h } }$ bit $\mathbf { q } _ { k } = 1$ if the $k ^ { \mathrm { t h } }$ quantum in the Q Sequence has been learned, and $\mathbf { q } _ { k } = 0$ otherwise. QH1 implies that the mean loss $L$ is simply a function of $\mathbf { q }$ . QH2 implies that when $n \equiv \textstyle \sum _ { k } \mathbf { q } _ { k }$ quanta have been learned, we have $\mathbf { q } _ { k } = 1$ for $k \leq n$ . Let $L _ { n }$ denote the mean loss in this case. From QH3, we have that the $k ^ { \mathrm { t h } }$ quantum benefits prediction on a randomly chosen sample with probability
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
p _ { k } = \frac { 1 } { \zeta ( \alpha + 1 ) } k ^ { - ( \alpha + 1 ) } \propto k ^ { - ( \alpha + 1 ) }
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
for a Zipf power law α > 0, where ζ(s) ≡ P∞k=1 k−s. Let us also assume that learning the kth where it is utilized. If $a _ { k }$ and $b _ { k }$ are $k$ -independent $\mathit { a } _ { k } = { a } , { b } _ { k } = { b } )$ , then a model that has learned the first $n$ quanta will have expected loss
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\begin{array} { r c l } { { { \cal L } _ { n } } } & { { = } } & { { \displaystyle \sum _ { k = 1 } ^ { n } a p _ { k } + \sum _ { k = n + 1 } ^ { \infty } b p _ { k } = \sum _ { k = 1 } ^ { \infty } a p _ { k } + \sum _ { k = n + 1 } ^ { \infty } ( b - a ) p _ { k } } } \\ { { } } & { { \approx } } & { { \displaystyle a + \frac { b - a } { \zeta ( \alpha + 1 ) } \int _ { n } ^ { \infty } k ^ { - ( \alpha + 1 ) } d k = a + \frac { b - a } { \alpha \zeta ( \alpha + 1 ) } n ^ { - \alpha } . } } \end{array}
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
In other words, $L _ { \infty } = a$ and $\left( L _ { n } - L _ { \infty } \right) \propto n ^ { - \alpha }$ is a power law.
|
| 51 |
+
|
| 52 |
+
In Appendix A, we provide analogous derivations for other assumptions for $a _ { k }$ and $b _ { k }$ , and find that a range of assumptions produce curves that are exact or approximate power laws – the latter include a small logarithmic correction.
|
| 53 |
+
|
| 54 |
+
In the derivation above, we assumed that all samples are what we will refer to as monogenic, meaning that prediction relies on at most a single quantum, akin to how monogenic traits in biology (e.g. cystic fibrosis) depend on a single gene. By assuming that all samples are monogenic, we can write the expected loss as a sum over quanta, weighted by the fraction of samples which rely on that quanta $p _ { k }$ . We further explore the idea of monogenic vs. polygenic samples in Section 4.2. So far we have seen how the Quantization Hypothesis can produce power law scaling as a function of the number of quanta learned $n$ . We will now give one possible mechanism by which this can translate into power law scaling in parameters, data, etc.:
|
| 55 |
+
|
| 56 |
+
Parameter scaling: In networks of finite size, network capacity can bottleneck how many quanta are learned. If we assume that all quanta require the same capacity of $C$ network parameters, then a network with $N$ parameters can learn roughly $n \approx N / C$ quanta. Therefore $L ( N ) - L _ { \infty } \propto n ^ { - \alpha } \approx$ $( N / C ) ^ { - \alpha } \propto N ^ { - \mathrm { \tilde { \alpha } } }$ , we so we get power law scaling in $N$ with exponent $\alpha _ { N } = \alpha$ .
|
| 57 |
+
|
| 58 |
+
Data scaling (multi-epoch): For data scaling, we assume that for each quantum, a threshold of $\tau$ examples utilizing quantum $k$ are needed in the training set for quantum $k$ to be learned3. With $D$ training samples, approximately $D p _ { k }$ samples relying on quantum $k$ will be present, and solving for $D p _ { n } = \tau$ we get the last quantum to be learned will be $\bar { n } \propto ( D / \tau ) ^ { 1 / ( \alpha + 1 ) }$ since $p _ { k } \propto k ^ { - ( \alpha + 1 ) }$ Under this model, we get scaling in data samples $L ( D ) - L _ { \infty } \propto n ^ { - \alpha } \propto \left( D / \tau \right) ) ^ { - \alpha / \left( \alpha + 1 \right) } \propto$ $D ^ { - \alpha / ( \alpha + 1 ) }$ , and so $\alpha _ { D } = \alpha / ( \alpha + 1 )$ . From our earlier result that $\alpha _ { N } = \alpha$ , we would therefore predict that $\alpha _ { D } = \alpha _ { N } / ( \alpha _ { N } + 1 )$ . We discuss whether this relationship holds empirically for data and parameter scaling exponents observed across a variety of studies in Appendix F.
|
| 59 |
+
|
| 60 |
+
Data scaling (single-epoch): In multi-epoch training, the information contained in the training dataset can bottleneck which quanta are learned. However, the rate of convergence of SGD can also bottleneck performance. For single-epoch training, a greater number of training samples allows one to train for longer. In our model, the amount that each quantum reduces mean loss by follows a power law. If the magnitude of the gradients for learning these quanta also follow a power law, then the convergence time for each quanta may follow a power law too. If the number of steps to learn quantum $k$ is $\propto 1 / p _ { k }$ , then if the first quantum requires $T$ steps to be learned, quantum $n$ will require $T n ^ { \alpha + 1 }$ steps, and so $n = ( S / T ) ^ { 1 / ( \alpha + 1 ) }$ quanta can be learned in $S$ steps. This gives scaling in training steps $L ( S ) - L _ { \infty } \propto n ^ { - \alpha } \approx ( S / T ) ^ { - \alpha / ( \alpha + 1 ) } \propto S ^ { - \alpha / ( \alpha + 1 ) }$ , and so $\alpha _ { S } = \alpha / ( \alpha + 1 )$ . Under this model, multi-epoch and single-epoch data scaling exponents coincide: $\alpha _ { D } = \alpha _ { S }$ .
|
| 61 |
+
|
| 62 |
+
# 3 Proof of concept: a toy dataset
|
| 63 |
+
|
| 64 |
+
In this section, we will describe a toy dataset consisting of distinct subtasks which are power law distributed in frequency. We observe power law neural scaling in data and parameters on this task, and find that the mechanism of neural scaling coincides with our theory from Section 2. It is therefore possible for scaling laws to arise from the Quantization Model for data with the right structure. We leave a study of whether natural datasets (e.g. natural modeling) possess such structure to Section 4.
|
| 65 |
+
|
| 66 |
+
# 3.1 The “multitask sparse parity” dataset
|
| 67 |
+
|
| 68 |
+
The toy task we will construct consists of many subtasks – distinct types of inputs which each require corresponding distinct computations (quanta). For each subtask, we choose a variant of the “sparse parity” problem, recently studied in [28]. The sparse parity prediction problem is simple: given a bit string of length $n$ , compute the parity (sum mod 2) of a fixed subset of $k$ of those bits. We introduce an extension of this task, which we call “multitask sparse parity”. Beyond $n$ and $k$ , multitask sparse parity adds an additional parameter $n _ { \mathrm { t a s k s } }$ , the number of subtasks (number of distinct versions of sparse parity) present in the dataset. To construct the task, we first choose $n _ { \mathrm { t a s k s } }$ random subsets $S _ { i }$ of $k$ indices from $\{ 1 , 2 , \ldots , n \}$ : $S _ { i } \subset \{ 1 , 2 , . . . , n \}$ and $| S _ { i } | = k$ , where $i = 1 , 2 , \dots , n _ { \mathrm { t a s k s } }$ . Input bit strings are length $n _ { \mathrm { t a s k s } } + n$ . We call the first $n _ { \mathrm { t a s k s } }$ bits the control bits and the last $n$ bits the task bits. If control bit $i$ is active, then the parity is computed from the subset $S _ { i }$ of the task bits. The control bits 1-hot encode the task number: on a given input, only one control bit is set to 1 at a time – the rest are zero. For the sample shown below, since control bit 2 is active, the answer is the parity of the task bits $S _ { 2 } = \{ 2 , 7 \}$ , which is 0 for this input:
|
| 69 |
+
|
| 70 |
+

|
| 71 |
+
|
| 72 |
+

|
| 73 |
+
Figure 2: Top: Neural networks exhibit power law scaling in loss w.r.t. parameters $N$ , training time $S$ , and training samples $D$ (for multi-epoch training) when trained on the multitask sparse parity dataset. Here $\alpha = 0 . 4$ and we plot lines $\propto N ^ { - \alpha }$ , $\stackrel { \cdot } { \propto } S ^ { - \alpha / ( \alpha + 1 ) }$ , $\propto D ^ { - \alpha / ( \alpha + 1 ) }$ . Bottom: neural scaling broken down by subtask. Scaling behavior on individual subtasks exhibits emergence, where subtasks are suddenly learned above a particular scale. Power law neural scaling of mean test loss averages over a large number of qualitative changes in network performance (when broken down by subtask), with loss being driven to zero on an increasing number of subtasks which are power law distributed in frequency, a realization of the mechanism of neural scaling discussed in Section 2.
|
| 74 |
+
|
| 75 |
+
We impose a uniform distribution over the task bits. On the control bits, we impose a Zipfian distribution: the probability that a sample has control bit $i$ active (and therefore the parity must be computed from the subset $S _ { i }$ of the task bits) is ${ \scriptstyle { \frac { 1 } { Z } } } i ^ { - ( \alpha + 1 ) }$ where $\begin{array} { r } { Z = \sum _ { i = 1 } ^ { n _ { \mathrm { t a s k s } } } i ^ { - ( \alpha + 1 ) } } \end{array}$ . This imposes a power law distribution over subtasks in data. Since answers are parities, this task can be treated as a binary classification problem on the subset of bit strings $\{ 0 , 1 \} ^ { \bar { n _ { \mathrm { t a s k s } } } + n }$ where for each string all but one bit of the first $n _ { \mathrm { t a s k s } }$ bits are zero.
|
| 76 |
+
|
| 77 |
+
# 3.2 Power law scaling and emergence
|
| 78 |
+
|
| 79 |
+
We train ReLU MLPs with a single hidden layer to solve this task with cross-entropy loss. The input dimension is $n _ { \mathrm { t a s k s } } + n$ . We use the Adam optimizer with a learning rate of $1 0 ^ { - 3 }$ . To study scaling with respect to the number of model parameters, we train networks of varying width by sampling batches online. Within an individual single-epoch training run, we can study scaling in steps $S$ . To study scaling with respect to multi-epoch training dataset size $D$ , we use a network of sufficient width for capacity to not be a bottleneck, and for varying $D$ we sample a training set of $D$ samples and train for multiple epochs, recording model performance when mean test loss is lowest (early-stopping).
|
| 80 |
+
|
| 81 |
+
Training dynamics on the multitask sparse parity problem are highly nontrivial – on each individual subtask, loss follows a reverse-S curve, dropping after an initial plateau. This transition happens at different times for different subtasks, so the overall loss decreases smoothly, averaging over these transitions. See Appendix B for more discussion of training dynamics.
|
| 82 |
+
|
| 83 |
+
Figure 2 shows scaling curves on the multitask sparse parity problem. For the results shown, we used $n _ { \mathrm { t a s k s } } = 5 0 0$ , $n = 1 0 0$ , $k = 3$ , $\alpha = 0 . 4$ , and a batch size of 20000. We vary training dataset size from 1e4 to 5e6 and vary hidden-layer width from 10 to 500 neurons. We train for 2e5 steps. In line with the theory from Section 2, we find that as we scale training data and parameters, networks learn more and more quanta (reducing loss on more and more subtasks), roughly in order of their frequency, and that this is what drives neural scaling. We see that scaling w.r.t. parameters is noisier than data scaling, possibly due to model initialization having some influence on which quanta are learned (for our data scaling experiments, we use the same seed and same model size for all runs). We also see that for scaling on individual subtasks, there is a rough scale of data or parameters below which networks do not learn the task, and above which they do. Smooth power law scaling therefore averages over a large number of emergent changes in model performance when properly decomposed by subtask, a proof of concept that the Quantization Model can be the mechanism of neural scaling for data with the right structure. See Appendix B for additional results and discussion on how the scaling exponents $\alpha _ { N } , \alpha _ { S } , \alpha _ { D }$ relate to the subtask distribution power law exponent $\alpha + 1$ empirically.
|
| 84 |
+
|
| 85 |
+

|
| 86 |
+
Figure 3: Left: Scaling of mean test loss w.r.t. non-embedding parameters for the Pythia models [29]. The parameter scaling exponent $\alpha _ { N }$ is measured to be $\approx 0 . 0 8 3$ from the first six points along the curve (the seventh model appears to break the trend). Center: the distribution $p ( L )$ over losses on individual samples for models of different size. Losses $\approx 0$ are by far the most common, and larger models achieve $\approx 0$ loss on an increasing fraction of samples. Right: the expected loss integrand $L p ( L )$ for models of different sizes. Low-loss samples contribute minimal mass to the mean loss, which is instead dominated by samples with much higher loss of 5-10 bits (depending on scale).
|
| 87 |
+
|
| 88 |
+
# 4 Decomposing LLM scaling laws
|
| 89 |
+
|
| 90 |
+
We now study how scaling curves for large language models decompose. For our experiments, we use the Pythia model suite from Eleuther AI [29], a set of decoder-only transformers of varying size trained on approximately 300 billion tokens of The Pile [30]. We evaluate several models in the suite (ranging from $1 9 \mathrm m$ to $6 . 4 \mathrm { b }$ non-embedding parameters) on approximately 10 million tokens from the test set of The Pile. We record cross-entropy loss on every token, enabling us to study how loss on individual tokens, as well as how the distribution over losses, changes with model scale.
|
| 91 |
+
|
| 92 |
+
# 4.1 The distribution over per-token losses
|
| 93 |
+
|
| 94 |
+
In Figure 3, we show how the distribution over losses scales with model size. First, we find that for the first six models in the Pythia sequence, the mean loss scales as a power law with exponent $\alpha _ { N } = 0 . 0 8 3$ , roughly in line with the parameter scaling exponent of 0.076 measured in [3]. The 6.4b model does not fit the scaling curve well, so we excluded its loss when measuring the scaling exponent. Next, we plot the probability distribution over per-token losses $p ( L )$ . We find that losses close to zero are by far the most common, and that scaling increases the portion of approximately-zero losses. We also plot $L p ( L )$ , the probability density over losses weighted by loss. The mean loss is the area under this curve. We see that despite approximately-zero-loss tokens being by far the most common, they do not contribute much mass to the mean loss. See Figure 11 for how these distributions change over training steps rather than across model size. We note that neural scaling in the wild is much more complicated than for multitask sparse parity – notably, the distribution over losses is not bimodal. We leave a detailed study of whether the statistics of neural scaling in LLMs are compatible with prior models of neural scaling to future work.
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
Figure 4: Per-sample scaling curves can have diverse behavior. Here we show extreme examples where scaling (of loss on predicting the highlighted token) is abrupt versus smooth. If the Quantization Hypothesis describes language modeling, then samples with sharp scaling would be monogenic, displaying sharp emergence at a particular model scale when the relevant quantum is learned. Samples with gradual scaling would be polygenic, where many quanta, emerging at different scales, marginally improve the loss. We show additional examples in Figure 12.
|
| 98 |
+
|
| 99 |
+
# 4.2 Monogenic versus polygenic scaling curves
|
| 100 |
+
|
| 101 |
+
In our introduction of the Quantization Hypothesis in Section 2 and our multitask sparse parity study in Section 3 we modeled network performance on individual samples as benefitting from a single quantum – all samples belong to a single subtask, which is either solved or not solved in a binary fashion. In our model and on multitask sparse parity, scaling curves on individual examples all exhibit emergence – loss on individual examples undergoes a sharp transition at a particular scale of parameters or data. Do we observe this in large language models?
|
| 102 |
+
|
| 103 |
+
Inspecting a large number of per-token (per-sample) scaling curves, we observe a variety of scaling behaviors. On some samples, loss drops at a particular scale. More typically though, loss improves at multiple scales. If the Quantization Hypothesis is true and the effect of scaling is to simply add new quanta to the model, then for per-sample loss curves to show progress at multiple scales, those samples must benefit from multiple quanta additively. As first mentioned in Section 2, we borrow terminology from genetics and refer to prediction problems for which the model’s performance is determined by a single quantum as monogenic (akin to when a single gene determines a trait) and as polygenic when multiple quanta influence performance (in analogy to when multiple genes contribute to a trait). In multitask sparse parity, all prediction problems are monogenic. In natural language, we observe that model performance on most tokens improves at multiple scales, suggesting that most tokens are polygenic, but we can find tokens for which loss drops as a single phase transition in scale. Polygenicity forms a spectrum: the smoothness of the loss curve can vary substantially between examples, presumably with some prediction problems using few quanta and others using many. In Figure 4, we show extreme examples of both monogenic and polygenic samples.
|
| 104 |
+
|
| 105 |
+
Note that our monogenic/polygenic taxonomy of model behaviors assumes that QH1 and QH2 are true. However, it could be the case that there isn’t an underlying discreteness to what is learned, or that scaling totally changes what networks learn, rather than simply adding additional quanta. Whether scaling truly has the effect we described will have to be investigated in future studies of the internals of neural networks. We also note that it is possible that sharp transitions in the per-token loss curves could be due to noise – if we had multiple runs with different random seeds for each model scale, we could better test whether the mean loss across seeds decreases smoothly or if there is a genuine discreteness where gradual progress is impossible for apparently “monogenic” tokens.
|
| 106 |
+
|
| 107 |
+
# 5 The quanta of language modeling
|
| 108 |
+
|
| 109 |
+
We have conjectured that the internals and behavior of language models are decomposable into an enumerable set of modules and associated skills (quanta). What might these basic building blocks of LLMs be? In this section, we develop a preliminary method to discover quanta. In particular, we will attempt to cluster tokens in a language corpus according to what knowledge or skill LLMs use to predict those tokens from their context. Our goal is to find coherent clusters of language model behavior that each reveal some distinct skill that the model has learned. Note that in clustering tokens to discover quanta, we are making the likely unrealistic assumption that these tokens are monogenic – that there is only one quantum involved in predicting each token. Not also that these clusters of behavior will not give us a mechanistic understanding of the quanta, but simply provide examples of LLM skills which could be studied further in future work.
|
| 110 |
+
|
| 111 |
+
We propose the use of gradients to cluster next-token prediction samples, where a “sample” consists of a token and its context in some document. Given some model, we will cluster two samples together if the gradient of the model’s loss on each sample w.r.t. the model’s parameters is similar for the two samples. The intuition for using gradients is as follows: if a model uses the same internal module to generate its prediction on two samples, then the gradients for parameters within the module may be nonzero and similar for the two samples (and possibly $\approx 0$ for parameters in irrelevant modules). If a model uses different modules to generate its prediction on different samples, then the gradients may not overlap. We therefore use gradient similarity as a proxy for mechanistic similarity – whether a model uses similar mechanisms/modules to generate its prediction on distinct samples. While crude, we find that gradients contain enough information to allow us to automatically discover many coherent clusters of LLM behavior using the following algorithm:
|
| 112 |
+
|
| 113 |
+
Quanta Discovery from Gradients (QDG): We will use spectral clustering on gradients to find clusters of samples whose gradient has nonzero cosine similarity. Given a set of samples $( x _ { i } , y _ { i } )$ and a model $f _ { \theta }$ , we compute gradients for each sample $g _ { i } = \nabla _ { \theta } \dot { L } ( f _ { \theta } ( x _ { i } ) , y _ { i } )$ . We then normalize these gradients $g _ { i } \mapsto { \hat { g } } _ { i }$ so that ${ \hat { g } } _ { i } \cdot { \hat { g } } _ { i } = 1$ . Let $A$ be a matrix whose rows are the normalized gradients: $A _ { i , \cdot } = \hat { g } _ { i }$ . If we are clustering $d$ samples and our model has $n$ parameters, $A$ has shape $( d , n )$ . We compute an affinity matrix $C = A A ^ { T }$ , a matrix of shape $( d , d )$ where $C _ { i j } = \hat { g } _ { i } \cdot \hat { g } _ { j }$ , the cosine similarity between gradients $g _ { i } , g _ { j }$ . From this, we compute an affinity matrix of the angular similarities $\hat { C }$ (which take values in $[ 0 , 1 ] )$ via $\begin{array} { r } { \hat { C } _ { i j } = 1 - \operatorname { a r c c o s } ( C _ { i j } ) / \pi } \end{array}$ . We then perform spectral clustering with $\hat { C }$ to cluster samples.
|
| 114 |
+
|
| 115 |
+
QDG is expensive to compute for large models and for large numbers of samples. We therefore only apply it to the smallest model in the Pythia suite, which has $1 9 \mathrm m$ non-embedding parameters. We cluster 10000 tokens on which this model is confident and correct in its prediction, achieving less than 0.1 nats of cross-entropy. See Appendix C.1 for more detail.
|
| 116 |
+
|
| 117 |
+
We find that many, though not all, QDG clusters reveal some coherent model behavior. We show examples from clusters in Figure 1 and Figure 13. These clusters were found with the spectral clustering hyperparameter n_clusters $= ~ 4 0 0$ . While most clusters involve the prediction of the same token, manually inspecting these clusters we find that they usually involve predicting the same token for a coherent reason, rather than being based merely on having the same output. We also find clusters for more abstract prediction rules. For instance, the quantum shown on the left column of Figure 1 is the skill of incrementing a numerical sequence, and the examples involve predicting a variety of different tokens representing numbers.
|
| 118 |
+
|
| 119 |
+
# 5.1 The natural distribution over language modeling quanta
|
| 120 |
+
|
| 121 |
+
In our model, some quanta are more frequently used than others. If these frequencies follow a power law in accordance with the Quantization Hypothesis, then we may expect QDG cluster sizes to be governed by a power law. The measured scaling exponent of $\alpha _ { N } = 0 . 0 8 3$ from Figure 3 implies a power law distribution over quanta with exponent $- 1 . 0 8 3$ . Do the cluster sizes follow this?
|
| 122 |
+
|
| 123 |
+
Figure 5 shows rank-frequency curves for clusters discovered with QDG for varying choices of n_clusters. These curves sort the clusters according to their size and then plot size against cluster index (rank). We plot rank-frequency curves for many choices of n_clusters since it is unclear a priori which n_clusters to use. When we measure the slope of the rank-frequency curve, we measure it from the envelope formed by the many rank-frequency curves, a practice which we discuss in Appendix E. Biases in the clustering algorithm and inherent noise in model gradients make clustering imperfect, and lead to high uncertainty of our the measured power law exponent. From our analysis in Appendix E, we think that extracting the power law exponent over quanta utilization frequency by measuring the slope of the rank-frequency curve should have uncertainty of at least 0.2. We also note that some rank-frequency curves don’t look like a clean power law. In Appendix E, Figure 16 we find that we can get similar-looking curves in a toy model of this clustering process when the dimension and noise is high. Between ranks 100-1000, we measure a slope of $\approx - 1 . 2 4$ , about 0.16 off our expected slope of $- 1 . 0 8$ , and so within the margin of error. We are encouraged that the size of our discovered clusters seem to decay at a rate (very roughly) compatible with observed neural scaling exponents, in line with our theory. However, less naive clustering schemes, operating on more samples with more clusters, could be useful to sharpen this measurement.
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
Figure 5: Left: angular similarity between model gradients for a variety of natural language samples. Samples are reordered according to their QDG cluster (with 400 clusters) to reveal the block-diagonal structure of the similarity matrix. We visualize a small part of the overall similarity matrix in this plot – note that not all clusters are as visibly distinct as the ones shown. Right: rank-frequency plot of QDG clusters. We measure the slope of the envelope of the rank-frequency curves from cluster rank 100-1000 to be $\approx - 1 . 2 4$ , which is a steeper than the slope of -1.08 expected from the measured parameter-scaling exponent from Figure 3, though within the margin of error given the uncertainty of our clustering methodology. See Appendix E for a discussion of the bias/uncertainty of our method.
|
| 127 |
+
|
| 128 |
+
# 6 Related Work
|
| 129 |
+
|
| 130 |
+
Models of neural scaling: Several models of neural scaling laws have been proposed in prior work. Sharma and Kaplan [31] explain power law scaling w.r.t. model parameters using an argument from approximation theory, which relates neural scaling exponents to the dimension of the data manifold $d$ . Michaud et al. [32] point out that effective dimension $d$ could be generalized to the maximum arity of the target function’s computation graph for sparse compositional problems. Bahri et al. [33] generalized the model of Sharma and Kaplan [31] to scaling w.r.t. dataset size, additionally relating scaling exponents to the power law spectrum of certain kernels. Maloney et al. [34] develop an exactly solvable random-feature model of scaling, from which they derive a joint parameter-data scaling law. Bordelon et al. [35] develop a model of data scaling for kernels, decomposing the generalization error into a sum over eigenmodes, whereas we decompose error into a sum over quanta. Arguably the closest prior work to ours is Hutter [36], who develops a model of data scaling wherein a discrete set of “features” must be learned. In this model, a feature is learned if it occurs at least once in the training set. If the features are Zipfian distributed, this produces power law scaling in expectation but with high variance. In our model, using a data threshold $\tau \gg 1$ lowers the variance in the scaling curve, and we also considered scaling w.r.t. parameters and applied the model to real networks.
|
| 131 |
+
|
| 132 |
+
Understanding emergent abilities: Wei et al. [8] and Srivastava et al. [37] document examples of emergent abilities in large language models, though Schaeffer et al. [38] suggest that these examples are an artifact of the metric used to evaluate performance. Arora and Goyal [39] develop a framework for the emergence of “skills”, where predicting text requires combining multiple different skills from an underlying set of language skills.
|
| 133 |
+
|
| 134 |
+
Miscellaneous: The topic of phase transitions in machine learning is not new [40], but our work was strongly influenced by the recent work of Olsson et al. [25] who observe a phase change from the formation of induction heads and especially Nanda et al. [13] who conjecture that phase changes may be ubiquitous. Simon et al. [41] also exhibit a task where learning proceeds as a series of discrete steps. Chen et al. [42] develop a framework for understanding LLM “skills” in a hierarchy and for choosing data to more efficiently learn desired skills. Chan et al. [43] study how a Zipfian data distribution influences in-context learning.
|
| 135 |
+
|
| 136 |
+
# 7 Discussion
|
| 137 |
+
|
| 138 |
+
Summary: The Quantization Hypothesis posits that for some types of prediction problems, models must learn a discrete (quantized) set of modules/knowledge/skills (quanta). When data is distributed in such a way that the “use frequencies” of these quanta follow a power law, then power law neural scaling can arise as models learn more and more quanta, with smooth scaling curves averaging over many small cases of emergence. We presented a toy dataset where neural scaling exhibits these properties. We then documented how language model scaling curves decompose, beyond simply how the mean loss scales. Lastly, we developed a method to discover quanta from the internal structure of trained models, from which we were able to enumerate a large number of skills of a small language model. The frequencies at which the quanta we discover are used for prediction in natural text seem to roughly track the power law our theory would predict, though this measurement is quite imprecise.
|
| 139 |
+
|
| 140 |
+
Limitations: While the Quantization Hypothesis appears to hold for our toy datasets, much work remains in investigating to what extent it holds for natural tasks like language modeling. Probably our riskiest assumption was that there is an underlying discreteness to everything that models learn. Gradual scaling seems typical in LLMs [38], and it could be more parsimonious to model neural scaling as an underlying smooth process rather than to assume that most tasks are highly polygenic with underlying discrete quanta. Note also that in our model of scaling w.r.t. parameters $N$ , having more parameters merely increases the capacity of the network. In practice however, larger networks are more efficient learners [7], and one can trade off between parameters and data, whereas in our model parameters and data independently bottleneck the number of quanta that can be learned. Additionally, we modeled the quanta as being independent, where learning order is given just by the use frequencies, but it could make more sense to think of the quanta as living in a hierarchical dependency graph. Lastly, our QDG method is neither very principled nor scalable, and much better methods could likely be developed to discover quanta and study their statistics for larger models and across more samples.
|
| 141 |
+
|
| 142 |
+
Implications for emergence and forecasting: Srivastava et al. [37] find that on some tasks, neural scaling has high “linearity”, with gradual improvements to scale, with other tasks displaying “breakthroughness”, where performance improves sharply at some scale. In our model, high linearly would result from a task’s relevant quanta being widely spread along the Q Sequence, and high breakthroughness would result from a task being monogenic or from the relevant quanta being close together in the Q Sequence. Our model also suggests that future capabilities could be forecasted if one could estimate the frequency at which that skill would benefit prediction in the training corpus.
|
| 143 |
+
|
| 144 |
+
Implications for mechanistic interpretability: If the Quantization Hypothesis is correct, then understanding a network reduces to enumerating its quanta. Having done this, the quanta could perhaps then be translated into a more interpretable format (something like code), studied in this format, and eventually executed in this format, rather than via the operation of the network.
|
| 145 |
+
|
| 146 |
+
Outlook: Lastly, our decomposition of networks into quanta is reminiscent of Minsky’s Society of Mind [44] perspective that minds are decomposable into individually mindless “agents”. If this decomposition is indeed possible, then the quanta (agents) become natural objects of study within networks. This mesoscale understanding of networks, in terms of the internal modules which collectively constitute their performance, could perhaps act like statistical physics for deep learning, allowing us to bridge our microscale understanding of low-level training dynamics and our macroscale understanding of model performance.
|
| 147 |
+
|
| 148 |
+
# Acknowledgments and Disclosure of Funding
|
| 149 |
+
|
| 150 |
+
We thank Tamay Besiroglu, Neel Nanda, Tony Wang, David Bau, Ben Edelman, Brian Cheung, Wes Gurnee, Stephen Casper, Peter Hase, Davis Brown, Eleni Shor, Max Nadeau, and Xander Davies for helpful conversations and feedback. We thank Lauro Langosco for helping with code to visualize samples from The Pile. This work was supported by the Foundational Questions Institute, the Rothberg Family Fund for Cognitive Science, the NSF Graduate Research Fellowship (Grant No. 2141064), and IAIFI through NSF grant PHY-2019786.
|
| 151 |
+
|
| 152 |
+
# References
|
| 153 |
+
|
| 154 |
+
[1] Joel Hestness, Sharan Narang, Newsha Ardalani, Gregory Diamos, Heewoo Jun, Hassan Kianinejad, Md Patwary, Mostofa Ali, Yang Yang, and Yanqi Zhou. “Deep learning scaling is predictable, empirically”. In: arXiv preprint arXiv:1712.00409 (2017).
|
| 155 |
+
[2] Jonathan S Rosenfeld, Amir Rosenfeld, Yonatan Belinkov, and Nir Shavit. “A constructive prediction of the generalization error across scales”. In: arXiv preprint arXiv:1909.12673 (2019).
|
| 156 |
+
[3] Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. “Scaling laws for neural language models”. In: arXiv preprint arXiv:2001.08361 (2020).
|
| 157 |
+
[4] Tom Henighan, Jared Kaplan, Mor Katz, Mark Chen, Christopher Hesse, Jacob Jackson, Heewoo Jun, Tom B Brown, Prafulla Dhariwal, Scott Gray, et al. “Scaling laws for autoregressive generative modeling”. In: arXiv preprint arXiv:2010.14701 (2020).
|
| 158 |
+
[5] Mitchell A Gordon, Kevin Duh, and Jared Kaplan. “Data and parameter scaling laws for neural machine translation”. In: Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing. 2021, pp. 5915–5922.
|
| 159 |
+
[6] Xiaohua Zhai, Alexander Kolesnikov, Neil Houlsby, and Lucas Beyer. “Scaling vision transformers”. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2022, pp. 12104–12113.
|
| 160 |
+
[7] Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford, Diego de Las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark, et al. “Training compute-optimal large language models”. In: arXiv preprint arXiv:2203.15556 (2022).
|
| 161 |
+
[8] Jason Wei, Yi Tay, Rishi Bommasani, Colin Raffel, Barret Zoph, Sebastian Borgeaud, Dani Yogatama, Maarten Bosma, Denny Zhou, Donald Metzler, Ed H. Chi, Tatsunori Hashimoto, Oriol Vinyals, Percy Liang, Jeff Dean, and William Fedus. “Emergent Abilities of Large Language Models”. In: Transactions on Machine Learning Research (2022). Survey Certification. ISSN: 2835-8856. URL: https://openreview.net/forum?id $\equiv$ yzkSU5zdwD.
|
| 162 |
+
[9] Jacob Steinhardt. Future ML Systems Will Be Qualitatively Different. Accessed: 2023-10-26. Jan. 2022. URL: https://bounded-regret.ghost.io/future-ml-systems-will-bequalitatively-different/.
|
| 163 |
+
[10] Deep Ganguli, Danny Hernandez, Liane Lovitt, Amanda Askell, Yuntao Bai, Anna Chen, Tom Conerly, Nova Dassarma, Dawn Drain, Nelson Elhage, et al. “Predictability and surprise in large generative models”. In: 2022 ACM Conference on Fairness, Accountability, and Transparency. 2022, pp. 1747–1764.
|
| 164 |
+
[11] Chris Olah, Nick Cammarata, Ludwig Schubert, Gabriel Goh, Michael Petrov, and Shan Carter. “Zoom In: An Introduction to Circuits”. In: Distill (2020). https://distill.pub/2020/ circuits/zoom-in. DOI: 10.23915/distill.00024.001.
|
| 165 |
+
[12] Nick Cammarata, Gabriel Goh, Shan Carter, Ludwig Schubert, Michael Petrov, and Chris Olah. “Curve detectors”. In: Distill 5.6 (2020), e00024–003.
|
| 166 |
+
[13] Neel Nanda, Lawrence Chan, Tom Liberum, Jess Smith, and Jacob Steinhardt. “Progress measures for grokking via mechanistic interpretability”. In: arXiv preprint arXiv:2301.05217 (2023).
|
| 167 |
+
[14] Kenneth Li, Aspen K Hopkins, David Bau, Fernanda Viégas, Hanspeter Pfister, and Martin Wattenberg. “Emergent world representations: Exploring a sequence model trained on a synthetic task”. In: arXiv preprint arXiv:2210.13382 (2022).
|
| 168 |
+
[15] Kevin Wang, Alexandre Variengien, Arthur Conmy, Buck Shlegeris, and Jacob Steinhardt. “Interpretability in the Wild: a Circuit for Indirect Object Identification in GPT-2 small”. In: arXiv preprint arXiv:2211.00593 (2022).
|
| 169 |
+
[16] Nelson Elhage, Neel Nanda, Catherine Olsson, Tom Henighan, Nicholas Joseph, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen, Tom Conerly, Nova DasSarma, Dawn Drain, Deep Ganguli, Zac Hatfield-Dodds, Danny Hernandez, Andy Jones, Jackson Kernion, Liane Lovitt, Kamal Ndousse, Dario Amodei, Tom Brown, Jack Clark, Jared Kaplan, Sam McCandlish, and Chris Olah. “A Mathematical Framework for Transformer Circuits”. In: Transformer Circuits Thread (2021). https://transformer-circuits.pub/2021/framework/index.html.
|
| 170 |
+
[17] Tom Lieberum, Matthew Rahtz, János Kramár, Geoffrey Irving, Rohin Shah, and Vladimir Mikulik. “Does circuit analysis interpretability scale? evidence from multiple choice capabilities in chinchilla”. In: arXiv preprint arXiv:2307.09458 (2023).
|
| 171 |
+
[18] Stephen Casper, Shlomi Hod, Daniel Filan, Cody Wild, Andrew Critch, and Stuart Russell. “Graphical clusterability and local specialization in deep neural networks”. In: ICLR 2022 Workshop on PAIR {\textasciicircum} 2Struct: Privacy, Accountability, Interpretability, Robustness, Reasoning on Structured Data. 2022.
|
| 172 |
+
[19] Trenton Bricken, Adly Templeton, Joshua Batson, Brian Chen, Adam Jermyn, Tom Conerly, Nick Turner, Cem Anil, Carson Denison, Amanda Askell, Robert Lasenby, Yifan Wu, Shauna Kravec, Nicholas Schiefer, Tim Maxwell, Nicholas Joseph, Zac Hatfield-Dodds, Alex Tamkin, Karina Nguyen, Brayden McLean, Josiah E Burke, Tristan Hume, Shan Carter, Tom Henighan, and Christopher Olah. “Towards Monosemanticity: Decomposing Language Models With Dictionary Learning”. In: Transformer Circuits Thread (2023). https://transformercircuits.pub/2023/monosemantic-features/index.html.
|
| 173 |
+
[20] Jonathan Frankle and Michael Carbin. “The lottery ticket hypothesis: Finding sparse, trainable neural networks”. In: arXiv preprint arXiv:1803.03635 (2018).
|
| 174 |
+
[21] Deniz Bayazit, Negar Foroutan, Zeming Chen, Gail Weiss, and Antoine Bosselut. “Discovering Knowledge-Critical Subnetworks in Pretrained Language Models”. In: arXiv preprint arXiv:2310.03084 (2023).
|
| 175 |
+
[22] Yixuan Li, Jason Yosinski, Jeff Clune, Hod Lipson, and John Hopcroft. Convergent Learning: Do different neural networks learn the same representations? arXiv:1511.07543 [cs]. Feb. 2016. URL: http://arxiv.org/abs/1511.07543 (visited on 08/19/2022).
|
| 176 |
+
[23] Thao Nguyen, Maithra Raghu, and Simon Kornblith. Do Wide and Deep Networks Learn the Same Things? Uncovering How Neural Network Representations Vary with Width and Depth. arXiv:2010.15327 [cs]. Apr. 2021. URL: http://arxiv.org/abs/2010.15327.
|
| 177 |
+
[24] Amil Dravid, Yossi Gandelsman, Alexei A. Efros, and Assaf Shocher. Rosetta Neurons: Mining the Common Units in a Model Zoo. arXiv:2306.09346 [cs]. June 2023. DOI: 10.48550/arXiv. 2306.09346. URL: http://arxiv.org/abs/2306.09346.
|
| 178 |
+
[25] Catherine Olsson, Nelson Elhage, Neel Nanda, Nicholas Joseph, Nova DasSarma, Tom Henighan, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen, Tom Conerly, Dawn Drain, Deep Ganguli, Zac Hatfield-Dodds, Danny Hernandez, Scott Johnston, Andy Jones, Jackson Kernion, Liane Lovitt, Kamal Ndousse, Dario Amodei, Tom Brown, Jack Clark, Jared Kaplan, Sam McCandlish, and Chris Olah. “In-context Learning and Induction Heads”. In: Transformer Circuits Thread (2022). https://transformer-circuits.pub/2022/incontext-learning-and-induction-heads/index.html.
|
| 179 |
+
[26] Gwern Branwen. The scaling hypothesis. 2021. URL: https : / / gwern . net / scaling - hypothesis.
|
| 180 |
+
[27] Alethea Power, Yuri Burda, Harri Edwards, Igor Babuschkin, and Vedant Misra. “Grokking: Generalization beyond overfitting on small algorithmic datasets”. In: arXiv preprint arXiv:2201.02177 (2022).
|
| 181 |
+
[28] Boaz Barak, Benjamin L Edelman, Surbhi Goel, Sham Kakade, Eran Malach, and Cyril Zhang. “Hidden progress in deep learning: Sgd learns parities near the computational limit”. In: arXiv preprint arXiv:2207.08799 (2022).
|
| 182 |
+
[29] Stella Biderman, Hailey Schoelkopf, Quentin Anthony, Herbie Bradley, Kyle O’Brien, Eric Hallahan, Mohammad Aflah Khan, Shivanshu Purohit, USVSN Sai Prashanth, Edward Raff, et al. “Pythia: A suite for analyzing large language models across training and scaling”. In: arXiv preprint arXiv:2304.01373 (2023).
|
| 183 |
+
[30] Leo Gao, Stella Biderman, Sid Black, Laurence Golding, Travis Hoppe, Charles Foster, Jason Phang, Horace He, Anish Thite, Noa Nabeshima, et al. “The pile: An 800gb dataset of diverse text for language modeling”. In: arXiv preprint arXiv:2101.00027 (2020).
|
| 184 |
+
[31] Utkarsh Sharma and Jared Kaplan. “Scaling Laws from the Data Manifold Dimension”. In: Journal of Machine Learning Research 23.9 (2022), pp. 1–34. URL: http://jmlr.org/ papers/v23/20-1111.html.
|
| 185 |
+
[32] Eric J. Michaud, Ziming Liu, and Max Tegmark. “Precision Machine Learning”. In: Entropy 25.1 (2023). ISSN: 1099-4300. DOI: 10.3390/e25010175. URL: https://www.mdpi.com/ 1099-4300/25/1/175.
|
| 186 |
+
[33] Yasaman Bahri, Ethan Dyer, Jared Kaplan, Jaehoon Lee, and Utkarsh Sharma. “Explaining neural scaling laws”. In: arXiv preprint arXiv:2102.06701 (2021).
|
| 187 |
+
[34] Alexander Maloney, Daniel A Roberts, and James Sully. “A Solvable Model of Neural Scaling Laws”. In: arXiv preprint arXiv:2210.16859 (2022).
|
| 188 |
+
[35] Blake Bordelon, Abdulkadir Canatar, and Cengiz Pehlevan. “Spectrum dependent learning curves in kernel regression and wide neural networks”. In: International Conference on Machine Learning. PMLR. 2020, pp. 1024–1034.
|
| 189 |
+
[36] Marcus Hutter. “Learning curve theory”. In: arXiv preprint arXiv:2102.04074 (2021).
|
| 190 |
+
[37] Aarohi Srivastava, Abhinav Rastogi, Abhishek Rao, Abu Awal Md Shoeb, Abubakar Abid, Adam Fisch, Adam R Brown, Adam Santoro, Aditya Gupta, Adrià Garriga-Alonso, et al. “Beyond the imitation game: Quantifying and extrapolating the capabilities of language models”. In: arXiv preprint arXiv:2206.04615 (2022).
|
| 191 |
+
[38] Rylan Schaeffer, Brando Miranda, and Sanmi Koyejo. “Are Emergent Abilities of Large Language Models a Mirage?” In: arXiv preprint arXiv:2304.15004 (2023).
|
| 192 |
+
[39] Sanjeev Arora and Anirudh Goyal. “A theory for emergence of complex skills in language models”. In: arXiv preprint arXiv:2307.15936 (2023).
|
| 193 |
+
[40] Lorenza Saitta, Attilio Giordana, and Antoine Cornuejols. Phase transitions in machine learning. Cambridge University Press, 2011.
|
| 194 |
+
[41] James B Simon, Maksis Knutins, Liu Ziyin, Daniel Geisz, Abraham J Fetterman, and Joshua Albrecht. “On the stepwise nature of self-supervised learning”. In: arXiv preprint arXiv:2303.15438 (2023).
|
| 195 |
+
[42] Mayee F Chen, Nicholas Roberts, Kush Bhatia, Jue Wang, Ce Zhang, Frederic Sala, and Christopher Ré. “Skill-it! A Data-Driven Skills Framework for Understanding and Training Language Models”. In: arXiv preprint arXiv:2307.14430 (2023).
|
| 196 |
+
[43] Stephanie Chan, Adam Santoro, Andrew Lampinen, Jane Wang, Aaditya Singh, Pierre Richemond, James McClelland, and Felix Hill. “Data distributional properties drive emergent in-context learning in transformers”. In: Advances in Neural Information Processing Systems 35 (2022), pp. 18878–18891.
|
| 197 |
+
[44] Marvin Minsky. Society of mind. Simon and Schuster, 1988.
|
| 198 |
+
[45] F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. “Scikit-learn: Machine Learning in Python”. In: Journal of Machine Learning Research 12 (2011), pp. 2825–2830.
|
| 199 |
+
[46] Ronen Eldan and Yuanzhi Li. “TinyStories: How Small Can Language Models Be and Still Speak Coherent English?” In: arXiv preprint arXiv:2305.07759 (2023).
|
| 200 |
+
[47] Pablo Villalobos. Scaling Laws Literature Review. https://epochai.org/blog/scalinglaws-literature-review. Accessed: 2023-01-31. 2023.
|
| 201 |
+
[48] Jasha Droppo and Oguz Elibol. “Scaling laws for acoustic models”. In: arXiv preprint arXiv:2106.09488 (2021).
|
| 202 |
+
[49] Newsha Ardalani, Carole-Jean Wu, Zeliang Chen, Bhargav Bhushanam, and Adnan Aziz. “Understanding Scaling Laws for Recommendation Models”. In: arXiv preprint arXiv:2208.08489 (2022).
|
| 203 |
+
|
| 204 |
+
# Appendix
|
| 205 |
+
|
| 206 |
+
# A More general scaling laws
|
| 207 |
+
|
| 208 |
+
If one learns the first $n$ quanta, reducing the loss from $b _ { k }$ to $a _ { k }$ ( $1 \leq k \leq n$ ), while the loss remains $b _ { k }$ for $k > n$ , the expected loss is given by:
|
| 209 |
+
|
| 210 |
+
$$
|
| 211 |
+
L _ { n } = \sum _ { k = 1 } ^ { n } a _ { k } p _ { k } + \sum _ { k = n + 1 } ^ { \infty } b _ { k } p _ { k } .
|
| 212 |
+
$$
|
| 213 |
+
|
| 214 |
+
In the main text, we used $a _ { k } = a$ and $b _ { k } = b$ for our model. However, one can imagine a variety of other choices for $a _ { k }$ and $b _ { k }$ .
|
| 215 |
+
|
| 216 |
+
Case 1 $b _ { k } = - \mathrm { l o g } p _ { k }$ and $a _ { k } = 0$ , where $p _ { k } = k ^ { - ( \alpha + 1 ) } / \zeta ( \alpha + 1 )$ . This baseline for $b _ { k }$ is the error of a model which outputs the token frequencies, independent of the context (assuming that quanta involve the prediction of a particular token). The expected loss is given by:
|
| 217 |
+
|
| 218 |
+
$$
|
| 219 |
+
L _ { n } = \sum _ { k = 1 } ^ { n } 0 \cdot p _ { k } + \sum _ { k = n + 1 } ^ { \infty } \left( - \log p _ { k } \right) \cdot p _ { k } \approx { \frac { 1 + \alpha + \alpha \log \zeta ( \alpha + 1 ) } { \alpha ^ { 2 } \zeta ( \alpha + 1 ) } } n ^ { - \alpha } + { \frac { \alpha + 1 } { \alpha \zeta ( \alpha + 1 ) } } n ^ { - \alpha } \log n ,
|
| 220 |
+
$$
|
| 221 |
+
|
| 222 |
+
which contains a power law term $n ^ { - \alpha }$ plus a log term $n ^ { - \alpha } \log n$ . For very large $n$ , the log term can be ignored, so $L$ is still approximately a power law of $n$ with exponent $- \alpha$ , shown in Figure 6.
|
| 223 |
+
|
| 224 |
+

|
| 225 |
+
Figure 6: Comparing different scaling laws. Setting $a _ { k } = 0$ , we compare $b _ { k } = - \mathrm { l o g } p _ { k }$ (solid lines) and $b _ { k } = 1$ (dashed lines) for different alphas. Although the $b _ { k } = - \mathrm { l o g } \ p _ { k }$ case would cause an extra loss term $n ^ { - \alpha } \mathrm { l o g } n$ in additional to the power law term $n ^ { - \alpha }$ , the loss becomes a power law asymptotically when $n$ becomes large.
|
| 226 |
+
|
| 227 |
+
Case 2 $b _ { k } = - \mathrm { l o g } p _ { k }$ and $a _ { k } = - \mathrm { l o g } \left( C p _ { k } \right) \left( C > 1 \right)$ , where $p _ { k } = k ^ { - ( \alpha + 1 ) } / \zeta ( \alpha + 1 )$ . The expected loss is given by:
|
| 228 |
+
|
| 229 |
+
$$
|
| 230 |
+
\therefore = \sum _ { k = 1 } ^ { n } ( - \log { ( C p _ { k } ) } ) \cdot p _ { k } + \sum _ { k = n + 1 } ^ { \infty } ( - \log { p _ { k } } ) \cdot p _ { k } \approx \frac { \log { C } } { \alpha \zeta ( \alpha + 1 ) } n ^ { - \alpha } - \log { C } + \frac { 1 + \alpha + \alpha \log { \zeta ( \alpha + 1 ) } } { \alpha ^ { 2 } \zeta ( \alpha + 1 ) } ,
|
| 231 |
+
$$
|
| 232 |
+
|
| 233 |
+
which is a power law $n ^ { - \alpha }$ plus a constant.
|
| 234 |
+
|
| 235 |
+
# B Additional results on multitask sparse parity
|
| 236 |
+
|
| 237 |
+
Training dynamics: When loss is broken down by subtask on multitask sparse parity, learning curves consist of many reverse-S shaped curves, and mean loss decreases smoothly as an average over these curves. In Figure 7, we show loss versus time for each subtask for training runs in both the single-epoch and multi-epoch regimes. In Figure 8 we show how convergence time for each subtask relates to the frequency of that subtask.
|
| 238 |
+
|
| 239 |
+

|
| 240 |
+
Figure 7: Training dynamics on the multitask sparse parity dataset consist of many “phase transitions” when decomposed by subtask – the loss curve for each subtask drops following an initial plateau of no apparent progress, in line with [28]. The mean loss decreases smoothly, averaging over these phase transitions in the model’s performance on subtasks. We show curves for single-epoch training (top) and multi-epoch training on 5 million samples (bottom). The dashed red line indicates the early stopping point where mean test loss is minimized. For these runs, $\alpha = 0 . 4$ .
|
| 241 |
+
|
| 242 |
+

|
| 243 |
+
Figure 8: Convergence time for each subtask versus the frequency of that subtask. We see that convergence time $S _ { k }$ on subtask $k$ is $S _ { k } \propto p _ { k } ^ { - 0 . 8 1 }$ rather than $\bar { S } _ { k } \propto p _ { k } ^ { - 1 }$ as we had expected. This leads to a steeper scaling w.r.t. $S$ than expected from theory. For these experiments, we used $\alpha = 0 . 4$ , and so we would have predicted $\alpha _ { S } \approx 0 . 2 9$ but instead we get $\alpha _ { S } \approx 0 . 4 5$ . We consider the model to have converged on a subtask once it gets mean test loss less than 0.1 bits on that subtask.
|
| 244 |
+
|
| 245 |
+
Scaling for varying $\alpha$ : In Figure 10 we show scaling curves on multitask sparse parity in $N , S , D$ for a variety of quanta distribution parameters $\alpha$ . While all scaling curves appear to be power laws, the relationship between $\alpha _ { N } , \alpha _ { S } , \alpha _ { D }$ and $\alpha$ is not precisely as predicted by theory:
|
| 246 |
+
|
| 247 |
+
1. Parameter scaling: We observe that the relationship between $\alpha _ { N }$ and $\alpha$ deviates a bit from the prediction $\alpha _ { N } = \alpha$ , with $\alpha _ { N } < \alpha$ for small $\alpha$ and $\alpha _ { N } > \alpha$ for large $\alpha$ . Perhaps model size does not influence learning just by changing capacity, but also by affecting optimization.
|
| 248 |
+
|
| 249 |
+

|
| 250 |
+
Figure 9: Number of subtasks learned $( n )$ , including subtasks learned after early-stopping would have terminated the training run, versus training samples $D$ for a variety of $\alpha$ . We see that the relation $n \propto D ^ { 1 / ( \alpha + 1 ) }$ approximately holds, in line with theory. Deviation from theory for the scaling exponent of loss $L$ w.r.t. $D$ therefore likely originates from our failure to regularize network training, leading to early-stopping ending training before some subtasks can be learned.
|
| 251 |
+
|
| 252 |
+
2. Step scaling: We observe that $\alpha _ { S }$ is consistently higher than the theoretical prediction $\alpha / ( \alpha + 1 )$ . In Figure 8, we saw that the number of steps to convergence for each subtask did not precisely follow $S _ { k } \propto p _ { k } ^ { - 1 }$ , but was closer to $S _ { k } \propto p _ { k } ^ { - 0 . 8 1 }$ −0.81. This means that many subtasks converge faster than we would expect, producing a steeper scaling curve.
|
| 253 |
+
|
| 254 |
+
3. Data scalaing: We observe that $\alpha _ { D }$ is substantially higher than the theoretical prediction $\alpha / ( \alpha + 1 )$ for small $\alpha$ . We think this may be related to the fact that early-stopping cuts off training before all subtasks are learned as observed in Figure 7. In Figure 9, we show how the number of subtasks learned $n$ , when we include subtasks learned after early-stopping, seems to be in line with theory: $n \propto D ^ { 1 / ( \alpha + 1 ) }$ .
|
| 255 |
+
|
| 256 |
+
Better understanding the precise nature of power law scaling on multitask sparse parity is an interesting avenue for future work.
|
| 257 |
+
|
| 258 |
+

|
| 259 |
+
Figure 10: Scaling in parameters $( N )$ , single-epoch training time $( S )$ , and multi-epoch training samples $( D )$ for varying quanta power law distribution parameter $\alpha$ on multitask sparse parity. We notice that scaling curves in steps $S$ are typically steeper than the $\alpha _ { S } = \alpha / ( \alpha + 1 \bar { ) }$ predicted from theory, and that for low $\alpha$ the scaling curves in $D$ also deviate from theory substantially.
|
| 260 |
+
|
| 261 |
+
# C Additional results on language models
|
| 262 |
+
|
| 263 |
+
In Figure 11 we show how the distribution over losses changes across time during a training run, rather than across model scales like in Figure 3.
|
| 264 |
+
|
| 265 |
+
In Figure 13 we show additional examples from clusters discovered with QDG.
|
| 266 |
+
|
| 267 |
+

|
| 268 |
+
Figure 11: Left: Training curves (scaling w.r.t. steps $S$ ) of mean test loss for Pythia models. We measure exponents $\alpha _ { S }$ between 0.037 and 0.06. Center: the distribution $p ( L )$ over time. Over time, models achieve $\approx 0$ loss on an increasing fraction of tokens, similar to scaling in model size. Right: The distribution $L \cdot p ( L )$ over time.
|
| 269 |
+
|
| 270 |
+
# C.1 Details of application of QDG to LLMs
|
| 271 |
+
|
| 272 |
+
When applying QDG to language models, we use gradients within self-attention and MLP layers, but do not include embed, unembed, or layer norm gradients when we flatten and concatenate gradients into a vector $g$ .4 We choose samples $( x _ { i } , y _ { i } )$ for which our $1 9 \mathrm { m }$ -parameter model achieves a crossentropy loss less than 0.1 nats. We filter based on this criteria since (1) we cannot cluster samples based on model mechanism if the model does not have such a mechanism for performing prediction correctly on those samples and (2) our intuition that samples with particularly low loss are more likely to be monogenic. We further exclude samples which can be solved via induction on the context5, since such samples are quite common (possibly interfering with our task of finding diverse quanta) and since early experiments indicated that QDG had trouble clustering such samples together. We choose 10000 such samples to perform clustering on from the test set of The Pile. After computing the affinity matrix $\hat { C }$ , we use the spectral clustering implementation from scikit-learn [45] with labels assigned via k-means.
|
| 273 |
+
|
| 274 |
+
# D Quanta discovery on TinyStories
|
| 275 |
+
|
| 276 |
+
We also apply QDG to TinyStories-33M, a language model trained on the TinyStories dataset [46]. We consider only tokens on which TinyStories-33M achieves a loss less than 1 bit of cross-entropy. We apply QDG to 10000 such samples, clustering their gradients with spectral clustering with n_clusters $= ~ 4 0 0$ . We show some samples from the resulting clusters in Figure 14. Many of these clusters reflect some simple recurring pattern in the TinyStories dataset, like predicting “ time” after “Once upon a”, which many documents in the dataset start with. Some other clusters are more interesting however, like Cluster 11, which seems to involve predicting the correct noun in a sentence where that noun was referred to earlier in the sentence or in previous sentences.
|
| 277 |
+
|
| 278 |
+

|
| 279 |
+
Figure 12: Additional LLM scaling curves on individual samples which exhibit sharp vs smooth improvement. If the Quantization Hypothesis is true for language modeling, then we would interpret samples with sharp drops as “monogenic” and samples with gradual progress as “polygenic”.
|
| 280 |
+
|
| 281 |
+
# E The difficulty of estimating the power law exponent from clusters
|
| 282 |
+
|
| 283 |
+
In Section 5.1, when we looked at the distribution over elements in each cluster, we did not perfectly recover a Zipf distribution with exponent $\approx 1 . 0 8$ that we expected from our theory. In this section, we describe the difficulty of accurately estimating such an exponent with our method.
|
| 284 |
+
|
| 285 |
+
# E.1 QDG on multitask sparse parity
|
| 286 |
+
|
| 287 |
+
As a first experiment, we performed QDG on multitask sparse parity, where there is a known, artificially-imposed power law distribution over subtasks. We train a width-500 single-hidden-layer ReLU MLP on multitask sparse parity with $\alpha = 0 . 4$ and with $n = 1 0 0$ , $k = 3$ , and $n _ { \mathrm { t a s k s } } = 5 0 0$ We then took 10000 samples which the network achieves $\approx 0$ loss on (sampled from the Zipf distribution over subtasks with exponent 1.4). We compute gradients of cross-entropy loss w.r.t. all model parameters for these samples, and then perform QDG just like for LLMs. We show results in Figure 15. We plot the full similarity matrix where samples are ordered according to their a priori known subtask, rather than their cluster from QDG, and see a clear pattern where elements from the same subtask have on average higher angular similarity than elements between subtasks. However, from the rank-frequency plot of the clusters, we do not recover a slope of -1.4, but rather a lower slope of $\approx - 1 . 1$ . This shows that even when there is an exact decomposition of inputs into subtasks with a known Zipf distribution over these subtasks, that we do not perfectly recover this Zipf distribution from QDG.
|
| 288 |
+
|
| 289 |
+

|
| 290 |
+
Figure 13: Additional examples of clusters of inputs discovered by QDG. Like in Figure 1, we used 10000 samples and n_clusters of 400.
|
| 291 |
+
|
| 292 |
+
# E.2 A toy model of QDG uncertainty and bias
|
| 293 |
+
|
| 294 |
+
A toy model: To understand the bias of spectral clustering, we develop the following toy model. We assume the dataset has $N = 1 0 0 0$ subtasks, each subtask containing $\begin{array} { r } { \dot { n } _ { i } = \lfloor \frac { A } { i ^ { \alpha } } \rfloor ( 1 \leq i \dot { \leq } N ) } \end{array}$ tokens $\textstyle \mathcal { A } = 1 0 0 0 )$ . We use a Gaussian distribution $\mathcal { N } ( \mathbf { m } _ { i } , \sigma ^ { 2 } \mathbf { I } _ { d \times d } )$ to model gradients within a subtask $i$ where $d$ is the embedding dimension, $\sigma$ is the noise level, and $\mathbf { m } _ { i }$ is the Gaussian mean. $\mathbf { m } _ { i }$ itself is drawn from the standard Gaussian distribution $\mathbf { m } _ { i } \sim \mathcal { N } ( \mathbf { 0 } , \mathbf { I } _ { d \times d } )$ . We define the similarity between two vectors $\mathbf x , \mathbf y$ to be $\begin{array} { r } { \sin \equiv 1 + \frac { \mathbf x } { | \mathbf x | } \cdot \frac { \mathbf y } { | \mathbf y | } } \end{array}$ . We compute pairwise similarity between all $\textstyle \sum _ { i = 1 } ^ { N } n _ { i }$ tokens, and input the similarity matrix to the spectral clustering algorithm. We also need to specify the number of clusters $k$ .
|
| 295 |
+
|
| 296 |
+
We have two hyperparameters in the toy model, the embedding dimension $d$ and the noise level $\sigma$ We need to determine them such that this toy model can decently imitate LLM results (Figure 5). We fix $\alpha = 1$ , sweeping $d = \{ 3 0 , 1 0 0 , 1 0 0 0 \}$ , $\sigma = \{ 0 , 0 . 5 , 2 . 0 \}$ , and $k = \{ 1 0 0 , 2 0 0 , 5 0 0 \}$ . As shown in Figure 16, the high-dimension $d = 1 0 0 0 ^ { \circ } ,$ ) large-noise $\sigma = 2 . 0$ ) scheme seem to best agree with the LLM results, since the $k = 2 0 0$ curve can reproduce the sag and the cliff present in LLM curves.
|
| 297 |
+
|
| 298 |
+
Estimating $\alpha$ from the frequency curve is hard, in fact, the slope depends on $k$ and the region used to estimate it. However, we observe that different $k$ curves form a clear envelope, whose slope is robust in a reasonably wide region. The envelope slope seems to indicate $\alpha$ . We fix $d = 1 0 0 0$ and $\sigma = 2 . 0$ , sweeping $\alpha = \{ 0 . 8 , 0 . 9 , 1 . 0 , 1 . 1 , 1 . 2 , 1 . 3 , 1 . 4 , 1 . 5 \}$ . For each $\alpha$ , we estimate the slope of the envelope. Although there is clear correlation between the estimated envelope and $\alpha$ , if we use the envelope slope to estimate $\alpha$ , the error is on the order of 0.2, as shown in Figure 17.
|
| 299 |
+
|
| 300 |
+

|
| 301 |
+
Figure 14: Examples of clusters within the TinyStories dataset, discovered by QDG on the TinyStories-33M model. Here we just show samples from four out of $4 0 0 \mathtt { n }$ _clusters
|
| 302 |
+
|
| 303 |
+

|
| 304 |
+
Figure 15: Similarity matrix and rank-frequency plots from QDG on multitask sparse parity. Despite sparse parity having a known decomposition into subtasks which are power law distributed in frequency, we do not recover this same power law from samples. We used $\alpha = 0 . 4$ for the frequency distribution for an expected rank-frequency power law exponent of -1.4, but measure a rank-frequency envelope slope closer to -1.1.
|
| 305 |
+
|
| 306 |
+
# F Parameter and data scaling exponents across studies
|
| 307 |
+
|
| 308 |
+
In Figure 18, we show $\alpha _ { N }$ and $\alpha _ { D }$ (or possibly $\alpha _ { S }$ , depending on the study) for a variety of prior studies of deep learning scaling, as compiled by Villalobos [47]. While the data is messy, it is intriguing that most of the Rosenfeld et al. [2] samples lie below the $\alpha _ { D } = \alpha _ { N }$ line, as our model would predict. The scaling exponents from Hoffmann et al. [7] are slightly closer to our prediction than the relation $\alpha _ { D } = \alpha _ { N }$ , which has been proposed by other models of neural scaling laws. Overall though, the existing empirical results are too messy to definitively support or contradict our model.
|
| 309 |
+
|
| 310 |
+
# G Estimates of compute used for our experiments
|
| 311 |
+
|
| 312 |
+
Multitask sparse parity: Our training script takes roughly 1-4 hours (depending on network size) to perform a single-epoch training run on a GPU. When training multi-epoch on a fixed dataset, runs take typically between 3-10 minutes, with some outliers taking much longer. Our largest experiment was for Figure 10, where we trained networks of varying width on data with varying distributions over subtasks (with different power law exponents). 467 runs completed with a total running time of approximately 1450 hours. These experiments were run on a cluster with heterogeneous hardware. Availble GPUs include NVIDIA A100, RTXA6000, QUADRORTX6000, GEFORCERTX2080TI, GEFORCERTX2080, GEFORCEGTX1080TI, titan-x, and tesla-v100.
|
| 313 |
+
|
| 314 |
+
Pythia model scaling evaluations: We evaluated Pythia models on NVIDIA A100 80GBs. We do not have available the running time used when computing loss on approximately ten million tokens (for which we reported scaling statistics on), although it was likely less than an hour per model. The most expensive experiments were for Figure 11, where we evaluated the first four models in the Pythia suite across 143 checkpoints for a total of 572 evaluations. We likely used some hundreds of A100-hours for this, though possibly less than 100 hours.
|
| 315 |
+
|
| 316 |
+
QDG: We ran our QDG experiments on an NVIDIA A100 80GB. For the smallest Pythia model and for 10000 samples, it takes a few hours to compute the similarity matrix. We performed this computation only a handful of times.
|
| 317 |
+
|
| 318 |
+

|
| 319 |
+
Figure 16: To understand the bias of spectral clustering, we apply spectral clustering to a toy model with different embedding dimension $d$ , noise scale $\sigma$ and number of cluster $k$ . The high-dimension $d = 1 0 0 0$ ) large-noise $\sigma = 2 . 0$ ) scheme seems to best agree with the LLM results (Figure 5).
|
| 320 |
+
|
| 321 |
+

|
| 322 |
+
Figure 17: The difficulty of measuring $\alpha$ from curves. We apply spectral clustering to a toy model with different $\alpha$ and number of clusters $k$ . For a fixed $\alpha$ , different $k$ curves define an envelope. One could use the envelope slope to infer $\alpha$ , but this incurs errors around 0.2.
|
| 323 |
+
|
| 324 |
+

|
| 325 |
+
Figure 18: Parameter and data scaling exponents from various studies of deep learning scaling, compiled from the database of neural scaling laws from [47]. Our model of scaling predicts that $\alpha _ { D } \bar { = } \alpha _ { N } / ( \alpha _ { N } + 1 )$ , indicated with the solid black line. Visible points are from [2, 3, 7, 5, 48]. [49] is above the visible window of the figure.
|
md/dev/4NpoSrT8uU-/4NpoSrT8uU-.md
ADDED
|
@@ -0,0 +1,307 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Deep Bidirectional Language-Knowledge Graph Pretraining
|
| 2 |
+
|
| 3 |
+
Michihiro Yasunaga,1 Antoine Bosselut,2 Hongyu Ren,1 Xikun Zhang1 Christopher D Manning,1 Percy Liang,1⇤ Jure Leskovec1⇤
|
| 4 |
+
|
| 5 |
+
1Stanford University 2EPFL ⇤Equal senior authorship {myasu,antoineb,hyren,xikunz2,manning,pliang,jure}@cs.stanford.edu
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Pretraining a language model (LM) on text has been shown to help various downstream NLP tasks. Recent works show that a knowledge graph (KG) can complement text data, offering structured background knowledge that provides a useful scaffold for reasoning. However, these works are not pretrained to learn a deep fusion of the two modalities at scale, limiting the potential to acquire fully joint representations of text and KG. Here we propose DRAGON (Deep Bidirectional Language-Knowledge Graph Pretraining), a self-supervised method to pretrain a deeply joint language-knowledge foundation model from text and KG at scale. Specifically, our model takes pairs of text segments and relevant KG subgraphs as input and bidirectionally fuses information from both modalities. We pretrain this model by unifying two self-supervised reasoning tasks, masked language modeling and KG link prediction. DRAGON outperforms existing LM and $_ { \mathrm { L M + K G } }$ models on diverse downstream tasks including question answering across general and biomedical domains, with $+ 5 \%$ absolute gain on average. In particular, DRAGON achieves strong performance on complex reasoning about language and knowledge $( + 1 0 \%$ on questions involving long contexts or multi-step reasoning) and low-resource QA $+ 8 \%$ on OBQA and RiddleSense), and new state-of-the-art results on various BioNLP tasks. Our code and trained models are available at https://github.com/michiyasunaga/dragon.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Pretraining learns self-supervised representations from massive raw data to help various downstream tasks [1]. Language models (LMs) pretrained on large amounts of text data, such as BERT [2] and GPTs [3], have shown strong performance on many natural language processing (NLP) tasks. The success of these models comes from deeply interactive (contextualized) representations of input tokens learned at scale via self-supervision [2, 4]. Meanwhile, large knowledge graphs (KGs), such as Freebase [5], Wikidata [6] and ConceptNet [7], can provide complementary information to text data. KGs offer structured background knowledge by representing entities as nodes and relations between them as edges, and also offer scaffolds for structured, multi-step reasoning about entities [8, 9, 10, 11] (§3.4.1). The dual strengths of text data and KGs motivate research in pretraining deeply interactive representations of the two modalities at scale.
|
| 14 |
+
|
| 15 |
+
How to effectively combine text and KGs for pretraining is an open problem and presents challenges. Given text and KG, we need both (i) a deeply bidirectional model for the two modalities to interact, and (ii) a self-supervised objective to learn joint reasoning over text and KG at scale. Several existing works [12, 13, 14, 15, 16] propose methods for self-supervised pretraining, but they fuse text and KG in a shallow or uni-directional manner. Another line of work [8, 9] proposes bidirectional models for text and KG, but these models focus on finetuning on labeled downstream tasks and do not perform self-supervised learning. Consequently, existing methods may have limited their potential to model and learn deep interactions over text and KG.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Overview of our approach, DRAGON. Left: Given raw data of a text corpus and a large knowledge graph, we create aligned (text, local KG) pairs by sampling a text segment from the corpus and extracting a relevant subgraph from the KG (§2.1). As the structured knowledge in KG can ground the text and the text can provide the KG with rich context for reasoning, we aim to pretrain a language-knowledge model jointly from the text-KG pairs (DRAGON). Right: To model the interactions over text and KG, DRAGON uses a cross-modal encoder that bidirectionally exchanges information between them to produce fused text token and KG node representations (§2.2). To pretrain DRAGON jointly on text and KG, we unify two self-supervised reasoning tasks: (1) masked language modeling, which masks some tokens in the input text and then predicts them, and (2) link prediction, which holds out some edges from the input KG and then predicts them. This joint objective encourages text and KG to mutually inform each other, facilitating the model to learn joint reasoning over text and KG (§2.3).
|
| 19 |
+
|
| 20 |
+
To address both of the above challenges and fully unify the strengths of text and KG, we propose DRAGON (Deep Bidirectional Language-Knowledge Graph Pretraining), an approach that performs deeply bidirectional, self-supervised pretraining of a language-knowledge model from text and KG. DRAGON has two core components: a cross-modal model that bidirectionally fuses text and KG, and a bidirectional self-supervised objective that learns joint reasoning over text and KG. Concretely, as in Figure 1, we take a text corpus and a KG as raw data, and create inputs for the model by sampling a text segment from the corpus and extracting a relevant subgraph from the KG via entity linking, obtaining a (text, local $K G$ ) pair. We use a cross-modal model to encode this input into fused representations, where each layer of the model encodes the text with an LM and the KG with a graph neural network (GNN), and fuses the two with a bidirectional modality interaction module (GreaseLM [9]). We pretrain this model by unifying two self-supervised reasoning tasks: (1) masked language modeling (MLM), which masks and predicts tokens in the input text, and (2) link prediction, which drops and predicts edges in the input KG. The intuition is that by combining the two tasks, MLM makes the model use the text jointly with structured knowledge in the KG to reason about masked tokens in the text (e.g., in Figure 1, using the “round brush”–“art supply” multi-hop path from the KG helps), and link prediction makes the model use the KG structure jointly with the textual context to reason about missing links in the KG (e.g., recognizing that “round brush could be used for hair” from the text helps). This joint objective thus enables text to be grounded by KG structure and KG to be contextualized by text simultaneously, producing a deeply-unified language-knowledge pretrained model where information flows bidirectionally between text and KG for reasoning.
|
| 21 |
+
|
| 22 |
+
We pretrain DRAGON in two domains: a general domain, using the Book corpus and ConceptNet KG [7] (§3), and a biomedical domain, using the PubMed corpus and UMLS KG [17] (§4). We show that DRAGON improves on existing LM and $_ { \mathrm { L M + K G } }$ models on diverse downstream tasks across domains. For the general domain, DRAGON outperforms RoBERTa [18], our base LM without KGs, on various commonsense reasoning tasks such as CSQA, OBQA, RiddleSense and HellaSwag, with $+ 8 \%$ absolute accuracy gain on average. For the biomedical domain, DRAGON improves on the previous best LM, BioLinkBERT [19], and sets a new state of the art on BioNLP tasks such as MedQA and PubMedQA, with $+ 3 \%$ accuracy gain. In particular, DRAGON exhibits notable improvements on QA tasks involving complex reasoning $+ 1 0 \%$ gain on multi-step, negation, hedge, or long context reasoning) and on downstream tasks with limited training data $( + 8 \%$ gain). These results show that our deep bidirectional self-supervision over text and KG produces significantly improved language-knowledge representations compared to existing models.
|
| 23 |
+
|
| 24 |
+
# 1.1 Related work
|
| 25 |
+
|
| 26 |
+
Knowledge-augmented LM pretraining. Knowledge integration is active research for improving LMs. One line of works is retrieval-augmented LMs [20, 21, 22], which retrieve relevant text from a corpus and integrate it into LMs as additional knowledge. Orthogonal to these works, we focus on using knowledge bases as background knowledge, to ground reasoning about entities and facts.
|
| 27 |
+
|
| 28 |
+
Closest to our work are works that integrate knowledge bases in LM pretraining. One line of research aims to add entity features to LMs [12, 23, 24]; Some works use the KG entity information or structure to create additional training signals [13, 25, 14, 26, 27, 28]; Several works add KG triplet information directly to the LM input [29, 16, 15, 30, 31]. While these methods have achieved substantial progress, they typically propagate information between text and KG in a shallow or uni-directional (e.g., KG to text) manner, which might limit the potential to perform fully joint reasoning over the two modalities. To improve on the above works, we propose to bidirectionally interact text and KG via a deep cross-modal model and joint self-supervision, so that text and KG are grounded and contextualized by each other. We find that this improves model performance on various reasoning tasks (§3). Another distinction is that existing works in this space typically focus on adding entity- or triplet-level knowledge from KGs to LMs, and focus on solving entity/relation classification tasks. Our work significantly expands this scope in that we use larger KG subgraphs (200 nodes) as input to enable richer contextualization between KG and text, and we achieve performance improvements on a broader set of NLP tasks including QA, reasoning and text classification tasks.
|
| 29 |
+
|
| 30 |
+
KG-augmented question answering. Various works designed KG-augmented reasoning models for question answering [32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42]. In particular, recent works such as QA-GNN [8] and GreaseLM [9] suggest that a KG can scaffold reasoning about entities with its graph structure, and help for complex question answering (e.g., negation, multi-hop reasoning). These works typically focus on training or finetuning models on particular QA datasets. In contrast, we generalize this and integrate KG-augmented reasoning into general-purpose pretraining. Our motivation is that self-supervised pretraining allows the model to learn from larger and more diverse data, helping to learn richer interactions between text and KGs and to acquire more diverse reasoning abilities beyond specific QA tasks. We find that our proposed pretraining approach (DRAGON) offers significant boosts over the baseline QA models (e.g. GreaseLM) on diverse downstream tasks (§3). This opens a new research avenue in scaling up various carefully-designed QA models to pretraining.
|
| 31 |
+
|
| 32 |
+
KG representation learning. Our link prediction task used in pretraining is motivated by research in KG representation learning. Link prediction is a fundamental task in KGs [43, 44], and various works study methods to learn KG entity and relation embeddings for link prediction, such as TransE [45], DistMult [46] and RotatE [47]. Several works additionally use textual data or pretrained LMs to help learn KG embeddings and link prediction [48, 49, 50, 51, 52, 53]. While these works focus on the KG-side representations, we extend the scope and use the KG-side objective (link prediction) jointly with a text-side objective (language modeling) to train a mutually-interactive text-KG model.
|
| 33 |
+
|
| 34 |
+
# 2 Deep Bidirectional Language-Knowledge Graph Pretraining (DRAGON)
|
| 35 |
+
|
| 36 |
+
We propose DRAGON, an approach that performs deeply bidirectional, self-supervised pretraining of a language-knowledge model from text and KG. Specifically, as illustrated in Figure 1, we take a text corpus and a large knowledge graph as raw data, and create input instances for the model by sampling coarsely-aligned (text segment, local KG) pairs (§2.1). To learn mutual interactions over text and KG, DRAGON consists of a cross-modal encoder (GreaseLM) that fuses the input text-KG pair bidirectionally $( \ S 2 . 2 )$ , and a pretraining objective that performs bidirectional self-supervision on the text-KG input $( \ S 2 . 3 )$ . Our pretraining objective unifies masked language modeling (MLM) and KG link prediction (LinkPred) to make text and KG mutually inform each other and learn joint reasoning over them. Finally, we describe how we finetune the pretrained DRAGON model for downstream tasks (§2.4). While each individual piece of our approach (GreaseLM, MLM, LinkPred) is not new in itself, we are the first to bring them together effectively and demonstrate that the resulting model has strong empirical results (§3, §4).
|
| 37 |
+
|
| 38 |
+
Definitions. We define a text corpus $\mathcal { W }$ as a set of text segments $\mathcal { W } = \{ W \}$ , and each text segment $W$ as a sequence of tokens (words), $W = ( w _ { 1 } , . . . , w _ { I } )$ . We define a knowledge graph (KG) as a multi-relational graph $\mathcal { G } = ( \nu , \mathcal { E } )$ , where $\nu$ is the set of entity nodes in the KG and $\mathcal { E } \subseteq \mathcal { V } \times \mathcal { R } \times \mathcal { V }$ is the set of edges (triplets) that connect nodes in $\nu$ , with $\mathcal { R }$ being the set of relation types $\{ r \}$
|
| 39 |
+
|
| 40 |
+
Each triplet $( h , r , t )$ in a KG can represent a knowledge fact such as (Paris, in, France). As a raw KG is often large, with millions of nodes, a subgraph of the raw KG (local KG) is considered: $G = ( V , E )$ where $\bar { V } = \{ v _ { 1 } , . . . , v _ { J } \} \subseteq \mathcal { V }$ and $E \subseteq { \mathcal { E } }$ . We define a language-knowledge model to be a composition of two functions, $f _ { \mathrm { h e a d } } ( f _ { \mathrm { e n c } } ( X ) )$ , where the encoder $f _ { \mathrm { e n c } }$ takes in an input $X =$ (text segment $W$ , local ${ \bf K G } \breve { G }$ ), and produces a contextualized vector representation for each text token, $( \mathbf { H } _ { 1 } , . . . , \mathbf { H } _ { I } )$ , and for each KG node, $( \mathbf { V } _ { 1 } , . . . , \mathbf { V } _ { J } )$ . A language model is a special case of a language-knowledge model with no KG ( $J = 0$ ). The head $f _ { \mathrm { h e a d } }$ uses these representations to perform self-supervised tasks in the pretraining step and to perform downstream tasks in the finetuning step.
|
| 41 |
+
|
| 42 |
+
# 2.1 Input representation
|
| 43 |
+
|
| 44 |
+
Given a text corpus $\mathcal { W }$ and a large knowledge graph $\mathcal { G }$ , we create input instances for the model by preparing (text segment $W$ , local KG $G$ ) pairs. We want each pair’s text and KG to be (roughly) semantically aligned so that the text and KG can mutually inform each other and facilitate the model to learn interactive reasoning between the two modalities. Specifically, for each text segment $W$ from $\mathcal { W }$ , we extract a relevant local KG $G$ for it from $\mathcal { G }$ via the following KG retrieval process.
|
| 45 |
+
|
| 46 |
+
KG retrieval. Given a text segment $W$ , we link entity mentions in $W$ to entity nodes in $\mathcal { G }$ to get an initial set of nodes $V _ { \mathrm { e l } }$ . We then add their 2-hop bridge nodes from $\mathcal { G }$ to get the total retrieved nodes $V \subseteq \mathcal { V }$ . Lastly, we add all edges that span these nodes in $\mathcal { G }$ to get $E \subseteq { \mathcal { E } }$ , which yields the final local KG, $G = ( V , E )$ , as well as our final input instance $X = ( W , G )$ . Appendix B.1 provides more details on KG retrieval. Henceforth, we use “KG” to refer to this local KG $G$ unless noted otherwise.
|
| 47 |
+
|
| 48 |
+
Modality interaction token/node. For each resulting (text, KG) pair, we further add a special token (interaction token) $w _ { \mathrm { i n t } }$ to the text and a special node (interaction node) $v _ { \mathrm { i n t } }$ to the KG, which will serve as an information pooling point for each modality as well as an interface for modality interaction in our cross-modal encoder (§2.2). Specifically, we prepend $w _ { \mathrm { i n t } }$ to the original text $W { = } ( w _ { 1 } , . . . , w _ { I } )$ , and connect $v _ { \mathrm { i n t } }$ to the entity-linked nodes in the original KG, $V _ { \mathrm { e l } } \subseteq V = \{ v _ { 1 } , . . . , v _ { J } \}$ , using a new relation type $r _ { \mathrm { e l } }$ . The interaction token and node can also be used to produce a pooled representation of the whole input, e.g., when finetuning for classification tasks (§2.4).
|
| 49 |
+
|
| 50 |
+
# 2.2 Cross-modal encoder
|
| 51 |
+
|
| 52 |
+
To model mutual interactions over the text and KG, we use a bidirectional sequence-graph encoder for $f _ { \mathrm { e n c } }$ which takes in the text tokens and KG nodes and exchanges information across them for multiple layers to produce a fused representation of each token and node (Figure 1 right):
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\mathbf { \boldsymbol { \mathbf { V } } } _ { 1 } , . . . , \mathbf { \boldsymbol { \mathbf { V } } } _ { J } ) = f _ { \mathrm { e n c } } \big ( \big ( \boldsymbol { w } _ { \mathrm { i n t } } , \boldsymbol { w } _ { 1 } , . . . , \boldsymbol { w } _ { I } \big ) , \big ( \boldsymbol { v } _ { \mathrm { i n t } } , \boldsymbol { v } _ { 1 } , . . . , \boldsymbol { v } _ { J } \big )
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
While we may use any deep bidirectional sequence-graph encoder for $f _ { \mathrm { e n c } }$ , for controlled comparison with existing works, we adopt the existing top-performing sequence-graph architecture, GreaseLM [9], which combines Transformers [54] and graph neural networks (GNNs) to fuse text-KG inputs.
|
| 59 |
+
|
| 60 |
+
Specifically, GreaseLM first uses $N$ layers of Transformer language model (LM) layers to map the input text into initial token representations, and uses KG node embeddings to map the input KG nodes into initial node representations,
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\begin{array} { r l } & { ( \mathbf { H } _ { \mathrm { i n t } } ^ { ( 0 ) } , \mathbf { H } _ { 1 } ^ { ( 0 ) } , . . . , \mathbf { H } _ { I } ^ { ( 0 ) } ) = \mathrm { L M } \mathrm { - } \mathrm { L a y e r s } ( w _ { \mathrm { i n t } } , w _ { 1 } . . . , w _ { I } ) , } \\ & { ( \mathbf { V } _ { \mathrm { i n t } } ^ { ( 0 ) } , \mathbf { V } _ { 1 } ^ { ( 0 ) } , . . . , \mathbf { V } _ { J } ^ { ( 0 ) } ) = \mathrm { N o d e - } \mathrm { E m b e d d i n g } ( v _ { \mathrm { i n t } } , v _ { 1 } , . . . , v _ { J } ) . } \end{array}
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
Then it uses $M$ layers of text-KG fusion layers to encode these token/node representations jointly into the final token/node representations,
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
( \mathbf { H } _ { \mathrm { i n t } } , . . . , \mathbf { H } _ { I } ) , ( { \mathbf { V } } _ { \mathrm { i n t } } , . . . , \mathbf { V } _ { J } ) = \mathrm { F u s i o n } . \mathrm { L a y e r s } ( ( \mathbf { H } _ { \mathrm { i n t } } ^ { ( 0 ) } , . . . , \mathbf { H } _ { I } ^ { ( 0 ) } ) , ( { \mathbf { V } } _ { \mathrm { i n t } } ^ { ( 0 ) } , . . . , \mathbf { V } _ { J } ^ { ( 0 ) } ) ) ,
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
where each of the fusion layers $( \ell { = } 1 , . . . , M )$ performs the following:
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\begin{array} { r l } & { ( \widetilde { \mathbf { H } } _ { \mathrm { i n t } } ^ { ( \ell ) } , \mathbf { H } _ { 1 } ^ { ( \ell ) } , . . . , \mathbf { H } _ { I } ^ { ( \ell ) } ) = \mathrm { L M } \mathrm { L a y e r } ( \mathbf { H } _ { \mathrm { i n t } } ^ { ( \ell - 1 ) } , \mathbf { H } _ { 1 } ^ { ( \ell - 1 ) } , . . . , \mathbf { H } _ { I } ^ { ( \ell - 1 ) } ) , } \\ & { ( \widetilde { \mathbf { V } } _ { \mathrm { i n t } } ^ { ( \ell ) } , \mathbf { V } _ { 1 } ^ { ( \ell ) } , . . . , \mathbf { V } _ { J } ^ { ( \ell ) } ) = \mathrm { G N N } \mathrm { - L a y e r } ( \mathbf { V } _ { \mathrm { i n t } } ^ { ( \ell - 1 ) } , \mathbf { V } _ { 1 } ^ { ( \ell - 1 ) } , . . . , \mathbf { V } _ { J } ^ { ( \ell - 1 ) } ) , } \\ & { \qquad [ \mathbf { H } _ { \mathrm { i n t } } ^ { ( \ell ) } ; \mathbf { V } _ { \mathrm { i n t } } ^ { ( \ell ) } ] = \mathrm { M I n t } ( [ \widetilde { \mathbf { H } } _ { \mathrm { i n t } } ^ { ( \ell ) } ; \widetilde { \mathbf { V } } _ { \mathrm { i n t } } ^ { ( \ell ) } ] ) . } \end{array}
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
Here GNN induces graph structure-aware representations of KG nodes, $[ \cdot ; \cdot ]$ does concatenation, and MInt (modality interaction module) exchanges information between the interaction token (text side) and interaction node (KG side) via an MLP. For more details on GreaseLM, we refer readers to [9].
|
| 79 |
+
|
| 80 |
+
# 2.3 Pretraining objective
|
| 81 |
+
|
| 82 |
+
We aim to pretrain the DRAGON model so that it learns joint reasoning over text and a KG. To ensure that the text and KG mutually inform each other and the model learns bidirectional information flow, we unify two self-supervised reasoning tasks: masked language modeling and KG link prediction.
|
| 83 |
+
|
| 84 |
+
Masked language modeling (MLM). MLM is a common pretraining task used for language models (e.g., BERT [2], RoBERTa [18]), which masks some tokens in the input text and predicts them. This task makes the model use non-masked context to reason about masked tokens, and in particular, as our approach takes a joint text-KG pair as input, we expect that MLM can encourage the model to learn to use the text jointly with structured knowledge in the KG to reason about masks in the text (e.g., in the example of Figure 1, besides the textual context, recognizing the “round brush”–“art supply” path from the KG can help together to predict the masked tokens “art supplies”).
|
| 85 |
+
|
| 86 |
+
Concretely, to perform the MLM task, we mask a subset of tokens in the input text, $M \subseteq W$ , with a special token [MASK], and let the task head $f _ { \mathrm { h e a d } }$ be a linear layer that takes the contextualized token vectors $\left\{ \mathbf { H } _ { i } \right\}$ from the encoder to predict the original tokens. The objective is a cross-entropy loss:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\mathcal { L } _ { \mathrm { M L M } } = - \sum _ { i \in M } \log p ( w _ { i } \mid \mathbf { H } _ { i } ) .
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
Link prediction (LinkPred). While the MLM task predicts for the text side, link prediction holds out some edges and predicts them for the input KG. Link prediction is a fundamental task in KGs [47] and makes the model use the structure of KGs to perform reasoning (e.g., using a compositional path “X’s mother’s husband is $\mathbf { Y } ^ { \ast }$ to deduce a missing link “X’s father is $\mathbf { Y } ^ { \prime \prime }$ ). In particular, as our approach takes a joint text-KG pair as input, we expect that link prediction can encourage the model to learn to use the KG structure jointly with the textual context to reason about missing links in the KG (e.g., in Figure 1, besides the KG structure, recognizing that “round brush could be used for hair” from the text can help together to predict the held-out edge (round_brush, at, hair)).
|
| 93 |
+
|
| 94 |
+
Concretely, to perform the link prediction task, we hold out a subset of edge triplets from the input KG, $S = \mathcal { \bar { \{ } ( h , r , t ) \} } \subseteq E$ . For the task head $f _ { \mathrm { h e a d } }$ , we adopt a KG representation learning framework, which maps each entity node $h$ or $t$ ) and relation $( r )$ in the KG to a vector, $\mathbf { h } , \mathbf { t } , \mathbf { r }$ , and defines a scoring function $\phi _ { r } ( \mathbf { h } , \mathbf { t } )$ to model positive/negative triplets. Specifically, we let $\mathbf { h } = \mathbf { V } _ { h }$ , $\mathbf { t } = \mathbf { V } _ { t }$ , $\mathbf { r } = \mathbf { R } _ { r }$ , with $\{ \mathbf { V } _ { j } \}$ being the contextualized node vectors from the encoder, and $\mathbf { R } = \{ \mathbf { r } _ { 1 } , . . . , \mathbf { r } _ { | \mathcal { R } | } \}$ being learnable relation embeddings. We consider a KG triplet scoring function $\phi _ { r } ( \mathbf { h } , \mathbf { t } )$ such as
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\mathrm { D i s t M u l t } \ [ 4 6 ] \cdot \langle \mathbf { h } , \mathbf { r } , \mathbf { t } \rangle , \quad \mathrm { T r a n s E } \ [ 4 5 ] \colon - \| \mathbf { h } + \mathbf { r } - \mathbf { t } \| , \quad \mathrm { R o t a t E } \ [ 4 7 ] \colon - \| \mathbf { h } \odot \mathbf { r } - \mathbf { t } \| ,
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where $\langle \cdot , \cdot , \cdot \rangle$ denotes the trilinear dot product and $\odot$ the Hadamard product. A higher $\phi$ indicates a higher chance of $( h , r , t )$ being a positive triplet (edge) instead of negative (no edge). We analyze the choices of scoring functions in $\ S 3 . 4 . 3$ . For training, we optimize the objective:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\mathcal { L } _ { \mathrm { L i n k P r e d } } = \sum _ { ( h , r , t ) \in S } \left( - \log \sigma ( \phi _ { r } ( \mathbf { h } , \mathbf { t } ) + \gamma ) + \frac { 1 } { n } \sum _ { ( h ^ { \prime } , r , t ^ { \prime } ) } \log \sigma ( \phi _ { r } ( \mathbf { h } ^ { \prime } , \mathbf { t } ^ { \prime } ) + \gamma ) \right) ,
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where $( h ^ { \prime } , r , t ^ { \prime } )$ are $n$ negative samples corresponding to the positive triplet $( h , r , t )$ , $\gamma$ is the margin, and $\sigma$ is the sigmoid function. The intuition of this objective is to make the model predict triplets of the held-out edges $S$ as positive and other random triplets as negative.
|
| 107 |
+
|
| 108 |
+
Joint training. To pretrain DRAGON, we optimize the MLM and LinkPred objectives jointly: $\begin{array} { r } { \mathcal { L } = \mathcal { L } _ { \mathrm { M L M } } + \mathcal { L } _ { \mathrm { L i n k P r e d } } } \end{array}$ . This joint objective unifies the effects of MLM and LinkPred, which encourage the model to simultaneously ground text with KG structure and contextualize KG with text, facilitating bidirectional information flow between text and KGs for reasoning. We show in $\ S 3 . 4 . 3$ that the joint objective yields a more performant model than using one of the objectives alone.
|
| 109 |
+
|
| 110 |
+
# 2.4 Finetuning
|
| 111 |
+
|
| 112 |
+
Lastly, we describe how we finetune DRAGON for downstream tasks such as text classification and multiple-choice QA (MCQA). Given an input text $W$ (e.g., concatenation of a question and an answer choice in the case of MCQA), we follow the same steps as $\ S 2 . 1$ and $\ S 2 . 2$ to retrieve a relevant local KG $G$ and encode them jointly into contextualized token/node vectors, $( \mathbf { H } _ { \mathrm { i n t } } , \mathbf { H } _ { 1 } , \ldots$ , ${ \mathbf { H } } _ { I }$ ), $( \mathbf { V } _ { \mathrm { i n t } } , \mathbf { V } _ { 1 } , . . . , \mathbf { V } _ { J } )$ . We then compute a pooled representation of the whole input as $\mathbf { X } =$ $\mathbf { M L P } ( \mathbf { H } _ { \mathrm { i n t } } , \mathbf { V } _ { \mathrm { i n t } } , \mathbf { G } )$ , where $\mathbf { G }$ denotes attention-based pooling of $\{ \mathbf { V } _ { j } \mid v _ { j } \in \{ v _ { 1 } , . . . , \bar { v } _ { J } \} \}$ using $\mathbf { H } _ { \mathrm { i n t } }$ as a query. Finally, the pooled representation $\mathbf { X }$ is used to perform the downstream task, in the same way as how the [CLS] representation is used in LMs such as BERT and RoBERTa.
|
| 113 |
+
|
| 114 |
+
The difference from GreaseLM is that while GreaseLM only performs finetuning as described in this section (hence, it is an LM finetuned with KGs), DRAGON performs self-supervised pretraining as described in $\ S 2 . 3$ (hence, it can be viewed as an LM pretrained $^ +$ finetuned with KGs).
|
| 115 |
+
|
| 116 |
+
# 3 Experiments: General domain
|
| 117 |
+
|
| 118 |
+
We experiment with the proposed approach DRAGON in a general domain first. We pretrain DRAGON using the Book corpus and ConceptNet KG (§3.1), and evaluate on diverse downstream tasks (§3.2). We show that DRAGON significantly improves on existing models (§3.4). We extensively analyze the effect of DRAGON’s key design choices such as self-supervision and use of KGs (§3.4.1, 3.4.2, 3.4.3). We also experiment in the biomedical domain in $\ S 4$ .
|
| 119 |
+
|
| 120 |
+
# 3.1 Pretraining setup
|
| 121 |
+
|
| 122 |
+
Data. For the text data, we use documents involving commonsense, BookCorpus [55]. BookCorpus has 6GB of text from online books and is widely used in LM pretraining (e.g., BERT, RoBERTa). For the KG data, we use ConceptNet [7], a general-domain knowledge graph designed to capture background commonsense knowledge. It has 800K nodes and 2M edges in total. To create a training instance, we sample a text segment of length up to 512 tokens from the text corpus, then retrieve a relevant KG subgraph of size up to 200 nodes (details in Appendix B.1), by which we obtain an aligned (text, local KG) pair.
|
| 123 |
+
|
| 124 |
+
Implementation. For our encoder (§2.2), we use the exact same architecture as GreaseLM [9] (19 LM layers followed by 5 text-KG fusion layers; 360M parameters in total). As done by [9], we initialize parameters in the LM component with the RoBERTa-Large release [18] and initialize the KG node embeddings with pre-computed ConceptNet entity embeddings (details in Appendix B.2). For the link prediction objective (§2.3, Equation 10), we use DistMult [46] for KG triplet scoring, with a negative exampling of 128 triplets and a margin of $\gamma = 0$ . To pretrain the model, we perform MLM with a token masking rate of $15 \%$ and link prediction with an edge drop rate of $15 \%$ . We pretrain for 20,000 steps with a batch size of 8,192 and a learning rate of 2e-5 for parameters in the LM component and 3e-4 for the others. Training took 7 days on eight A100 GPUs using FP16. Additional details on the hyperparameters can be found in Appendix B.3.
|
| 125 |
+
|
| 126 |
+
# 3.2 Downstream evaluation tasks
|
| 127 |
+
|
| 128 |
+
We finetune and evaluate DRAGON on nine diverse commonsense reasoning benchmarks: CommonsenseQA (CSQA) [56], OpenbookQA (OBQA) [57], RiddleSense (Riddle) [58], AI2 Reasoning Challenge–Challenge Set (ARC) [59], CosmosQA [60], HellaSwag [61], Physical Interaction QA (PIQA) [62], Social Interaction QA (SIQA) [63], and Abductive Natural Language Inference (aNLI) [64]. For CSQA, we follow the in-house data splits used by prior works [32]. For OBQA, we follow the original setting where the models only use the question as input and do not use the extra science facts. Appendix B.4 provides the full details on these tasks and data splits. Hyperparameters used for finetuning can be found in Appendix B.3.
|
| 129 |
+
|
| 130 |
+
# 3.3 Baselines
|
| 131 |
+
|
| 132 |
+
LM. To study the effect of using KGs, we compare DRAGON with the vanilla language model, RoBERTa [18]. As we initialize DRAGON’s parameters using the RoBERTa-Large release (§3.1), for fair comparison, we let the baseline be such that we take the RoBERTa-Large release and continue pretraining it with the vanilla MLM objective on the same text data for the same number of steps as DRAGON. Hence, the only difference is that DRAGON uses KGs during pretraining while RoBERTa does not. We then perform standard LM finetuning of RoBERTa on downstream tasks.
|
| 133 |
+
|
| 134 |
+
LM finetuned with KG. We also compare with existing KG-augmented QA models, QAGNN [8] and GreaseLM [9], which finetune a vanilla LM (i.e. RoBERTa-Large) with a KG on downstream tasks, but do not pretrain with a KG. GreaseLM is the existing top-performing model in this paradigm. As we use the same encoder architecture as GreaseLM for DRAGON, the only difference from GreaseLM is that DRAGON performs self-supervised pretraining while GreaseLM does not.
|
| 135 |
+
|
| 136 |
+
Table 1: Accuracy on downstream commonsense reasoning tasks. DRAGON consistently outperforms the existing LM (RoBERTa) and KG-augmented QA models (QAGNN, GreaseLM) on all tasks. The gain is especially significant on tasks that have small training data (OBQA, Riddle, ARC) and tasks that require complex reasoning (CosmosQA, HellaSwag).
|
| 137 |
+
|
| 138 |
+
<table><tr><td></td><td>CSQA</td><td>OBQA</td><td>Riddle</td><td>ARC</td><td>CosmosQA</td><td>HellaSwag</td><td>PIQA</td><td>SIQA</td><td>aNLI</td></tr><tr><td>RoBERTa [18]</td><td>68.7</td><td>64.9</td><td>60.7</td><td>43.0</td><td>80.5</td><td>82.3</td><td>79.4</td><td>75.9</td><td>82.7</td></tr><tr><td>QAGNN [8]</td><td>73.4</td><td>67.8</td><td>67.0</td><td>44.4</td><td>80.7</td><td>82.6</td><td>79.6</td><td>75.7</td><td>83.0</td></tr><tr><td>GreaseLM[9]</td><td>74.2</td><td>66.9</td><td>67.2</td><td>44.7</td><td>80.6</td><td>82.8</td><td>79.6</td><td>75.5</td><td>83.3</td></tr><tr><td>DRAGON (Ours)</td><td>76.0</td><td>72.0</td><td>71.3</td><td>48.6</td><td>82.3</td><td>85.2</td><td>81.1</td><td>76.8</td><td>84.0</td></tr></table>
|
| 139 |
+
|
| 140 |
+
Table 2: Accuracy of DRAGON on $C S Q A + O B Q A$ dev sets for questions involving complex reasoning such as negation terms, conjunction terms, hedge terms, prepositional phrases, and more entity mentions. DRAGON consistently outperforms the existing LM (RoBERTa) and KG-augmented QA models (QAGNN, GreaseLM) in these complex reasoning settings.
|
| 141 |
+
|
| 142 |
+
<table><tr><td></td><td>Negation</td><td>Conjunction</td><td>Hedge</td><td colspan="4">#Prepositional Phrases</td><td>#Entities</td></tr><tr><td></td><td></td><td></td><td></td><td>0</td><td>1</td><td>2</td><td>3</td><td>>10</td></tr><tr><td>RoBERTa</td><td>61.7</td><td>70.9</td><td>68.6</td><td>67.6</td><td>71.0</td><td>71.1</td><td>73.1</td><td>74.5</td></tr><tr><td>QAGNN</td><td>65.1</td><td>74.5</td><td>74.2</td><td>72.1</td><td>71.6</td><td>75.6</td><td>71.3</td><td>78.6</td></tr><tr><td>GreaseLM</td><td>65.1</td><td>74.9</td><td>76.6</td><td>75.6</td><td>73.8</td><td>74.7</td><td>73.6</td><td>79.4</td></tr><tr><td>DRAGON (Ours)</td><td>75.2</td><td>79.6</td><td>77.5</td><td>79.1</td><td>78.2</td><td>77.8</td><td>80.9</td><td>83.5</td></tr></table>
|
| 143 |
+
|
| 144 |
+
# 3.4 Results
|
| 145 |
+
|
| 146 |
+
Table 1 shows performance on the 9 downstream commonsense reasoning tasks. Across all tasks, DRAGON consistently outperforms the existing LM (RoBERTa) and KG-augmented QA models (QAGNN, GreaseLM), e.g., $+ 7 \%$ absolute accuracy boost over RoBERTa and $+ 5 \%$ over GreaseLM on OBQA. These accuracy boosts indicate the advantage of DRAGON over RoBERTa (KG reasoning) and over GreaseLM (pretraining). The gain is especially significant on datasets that have small training data such as ARC, Riddle and $O B Q A$ , and datasets that require complex reasoning such as CosmosQA and HellaSwag, which we analyze in more detail in the following sections.
|
| 147 |
+
|
| 148 |
+
# 3.4.1 Analysis: Effect of knowledge graph
|
| 149 |
+
|
| 150 |
+
The first key contribution of DRAGON (w.r.t. existing LM pretraining methods) is that we incorporate KGs. We find that this significantly improves the model’s performance for robust and complex reasoning, such as resolving multi-step reasoning and negation, as we discuss below.
|
| 151 |
+
|
| 152 |
+
Quantitative analysis. In Table 2, we study downstream task performance of DRAGON on questions involving complex reasoning. Building on [8, 9], we consider several proxies to categorize complex questions: (i) presence of negation (e.g. no, never), (ii) presence of conjunction (e.g. and, but), (iii) presence of hedge (e.g. sometimes, maybe), (iv) number of prepositional phrases, and (v) number of entity mentions. Having negation or conjunction indicates logical multi-step reasoning, having more prepositional phrases or entity mentions indicates involving more reasoning steps or constraints, and having hedge terms indicates involving complex textual nuance. DRAGON significantly outperforms the baseline LM (RoBERTa) across all these categories (e.g., $+ 1 4 \%$ accuracy for negation), which confirms that our joint language-knowledge pretraining boosts reasoning performance. DRAGON also consistently outperforms the existing KG-augmented QA models (QAGNN, GreaseLM). We find that QAGNN and GreaseLM only improve moderately on RoBERTa for some categories like conjunction or many prepositional phrases $( = 2 , 3 )$ , but DRAGON provides substantial boosts. This suggests that through self-supervised pretraining with larger and diverse data, DRAGON has learned more general-purpose reasoning abilities than the finetuning-only models like GreaseLM.
|
| 153 |
+
|
| 154 |
+
Qualitative analysis. Using the CSQA dataset, we further conducted case studies on the behavior of DRAGON’s KG reasoning component, where we visualize how graph attention weights change given different question variations (Figure 2). We find that DRAGON exhibits abilities to extrapolate and perform robust reasoning. For instance, DRAGON adjusts the entity attention weights and final predictions accordingly when we add conjunction or negation about entities (A1, A2) or when we add extra context to an original question $\mathbf { B } 1 \mathbf { B } 2$ ), but existing models, RoBERTa and GreaseLM, struggle to predict the correct answers. As these questions are more complex than ones typically seen in the CSQA training set, our insight is that while vanilla LMs (RoBERTa) and finetuning (GreaseLM)
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 2: Analysis of DRAGON’s graph reasoning, where we visualize how graph attention weights and final predictions change given question variations. Darker and thicker edges indicate higher attention weights. DRAGON exhibits abilities to extrapolate and perform robust reasoning. DRAGON adjusts the entity attention weights and final predictions accordingly when conjunction or negation is given about entities (A1, A2) or when extra context is added to an original question $( \mathbf { B } 1 \to \mathbf { B } 2$ ), but existing models, RoBERTa and GreaseLM, struggle to predict the correct answers. A1: DRAGON’s final GNN layer shows strong attention to “school” but weak attention to “trip”, likely because the question states “and store one”—hence, the chair is not used for a trip. A2: DRAGON shows strong attention to “trip” and “beach”, likely because the question now states “but not store one”—hence, the chair is used for a trip. $\mathbf { B } \mathbf { 1 } \to \mathbf { B } 2$ : DRAGON’s final GNN layer shows strong attention to “movie” in the original question (B1), but after adding the extra context “don’t enjoy pre-record” (B2), DRAGON shows strong attention to “live” and “concert”, leading to making the correctly adjusted prediction “concert hall”. One interpretation of these findings is that DRAGON leverages the KG’s graph structure as a scaffold for performing complex reasoning. This insight is related to recent works that provide LMs with scratch space for intermediate reasoning [8, 65, 66].
|
| 158 |
+
|
| 159 |
+
Table 3: Performance in low-resource setting where $10 \%$ of finetuning data is used. DRAGON attains large gains, suggesting its benefit for downstream data efficiency.
|
| 160 |
+
|
| 161 |
+
<table><tr><td>Method</td><td>CosmosQA (10% train)</td><td>PIQA (10% train)</td></tr><tr><td>RoBERTa</td><td>72.2</td><td>66.4</td></tr><tr><td>GreaseLM</td><td>73.0</td><td>67.0</td></tr><tr><td>DRAGON (Ours)</td><td>77.9</td><td>72.3</td></tr></table>
|
| 162 |
+
|
| 163 |
+
Table 4: Downstream performance when model capacity—number of text-KG fusion layers—is increased (“-Ex”). Increased capacity does not help for the finetuning-only model (GreaseLM), but helps when pretrained (DRAGON), suggesting the promise of DRAGON to be further scaled up.
|
| 164 |
+
|
| 165 |
+
<table><tr><td>Method</td><td>CSQA</td><td>OBQA</td></tr><tr><td>GreaseLM</td><td>74.2</td><td>66.9</td></tr><tr><td>GreaseLM-Ex</td><td>73.9</td><td>66.2</td></tr><tr><td>DRAGON (Ours)</td><td>76.0</td><td>72.0</td></tr><tr><td>DRAGON-Ex (Ours)</td><td>76.3</td><td>72.8</td></tr></table>
|
| 166 |
+
|
| 167 |
+
Table 5: Ablation study of DRAGON. Using joint pretraining objective $\mathbf { M L M + }$ LinkPred (§2.3) outperforms using one of them only. All variants of LinkPred scoring models (DistMult, TransE, RotatE) outperform the baseline without LinkPred (“MLM only”), suggesting that DRAGON can be combined with various KG representation learning models. Cross-modal model with bidirectional modality interaction (§2.2) outperforms combining text and KG representations only at the end. Finally, using KG as graph outperforms converting KG as sentences, suggesting the benefit of graph structure for reasoning.
|
| 168 |
+
|
| 169 |
+
<table><tr><td>Ablation Type</td><td>Ablation</td><td>CSQA</td><td>OBQA</td></tr><tr><td rowspan="3">Pretraining objective</td><td>MLM + LinkPred (final)</td><td>76.0</td><td>72.0</td></tr><tr><td>MLM only</td><td>74.3</td><td>67.2</td></tr><tr><td>LinkPred only</td><td>73.8</td><td>66.4</td></tr><tr><td rowspan="3">LinkPred head </td><td>DistMult (final)</td><td>76.0</td><td>72.0</td></tr><tr><td>TransE</td><td>75.7</td><td>71.4</td></tr><tr><td>RotatE</td><td>75.8</td><td>71.7</td></tr><tr><td rowspan="2">Cross-modal model</td><td>Bidirectional interaction (final)</td><td>76.0</td><td>72.0</td></tr><tr><td>Concatenate at end</td><td>74.5</td><td>68.0</td></tr><tr><td rowspan="2">KG structure</td><td>Use graph (final)</td><td>76.0</td><td>72.0</td></tr><tr><td>Convert to sentence</td><td>74.7</td><td>70.1</td></tr></table>
|
| 170 |
+
|
| 171 |
+
have limitation in learning complex reasoning, KG-augmented pretraining (DRAGON) helps acquire generalizable reasoning abilities that extrapolate to harder test examples.
|
| 172 |
+
|
| 173 |
+
# 3.4.2 Analysis: Effect of pretraining
|
| 174 |
+
|
| 175 |
+
Another key contribution of DRAGON (w.r.t. existing QA models like GreaseLM) is pretraining. Here we discuss when and why our pretraining is useful. Considering the three core factors in machine learning (data, task complexity, and model capacity), pretraining helps when the available downstream task data is smaller compared to the downstream task complexity or model capacity. Concretely, we find that DRAGON is especially helpful for the following three scenarios.
|
| 176 |
+
|
| 177 |
+
Downstream tasks with limited data. In Table 1, we find that DRAGON provides significant boosts over GreaseLM on downstream tasks with limited finetuning data available, such as ARC (3K training instances; $+ 4 \%$ accuracy gain), Riddle (3K instances; $+ 4 \%$ accuracy) and OBQA (5K instances; $+ 5 \%$ accuracy). For other tasks, we also experimented with a low-resource setting where $10 \%$ of finetuning data is used (Table 3). Here we also see that DRAGON attains significant gains over GreaseLM $+ 5 \%$ accuracy on PIQA), suggesting the improved data-efficiency of DRAGON.
|
| 178 |
+
|
| 179 |
+
Complex downstream tasks. In Table 1, we find that DRAGON provides substantial gains over GreaseLM on downstream tasks involving more complex reasoning, such as CosmosQA and HellaSwag, where the inputs have longer context and more entities (thus bigger local KGs). For these tasks, improvements of GreaesLM over RoBERTa were small $( + 0 . 1 \%$ on CosmosQA), but DRAGON provides substantial boosts $( + 1 . 8 \% )$ . Our insight is that through self-supervised pretraining with larger and more diverse data, DRAGON has learned richer text-KG interactions than GreaseLM, enabling solving more complex downstream tasks. Similarly, as seen in $\ S 3 . 4 . 1$ , DRAGON also attains large gains over GreaseLM on complex questions containing negation, conjunction and prepositional phrases (Table 2), and extrapolates to questions more complex than seen in training sets (Figure 2).
|
| 180 |
+
|
| 181 |
+
Increased model capacity. In Table 4, we study downstream performance when the model capacity is increased—the number of text-KG fusion layers is increased from 5 to 7—for both GreaseLM and DRAGON. We find that increased capacity does not help for the finetuning-only model (GreaseLM) as was also reported in the original GreaseLM paper, but it helps when pretrained (DRAGON). This result reveals that increased model capacity can actually be beneficial when combined with pretraining, and suggests the promise of DRAGON to be further scaled up.
|
| 182 |
+
|
| 183 |
+
# 3.4.3 Analysis: Design choices of DRAGON
|
| 184 |
+
|
| 185 |
+
Pretraining objective (Table 5 top). The first important design choice of DRAGON is the joint pretraining objective: ${ \bf M L M + }$ LinkPred (§2.3). Using the joint objective outperforms using MLM or LinkPred alone ( $+ 5 \%$ accuracy on OBQA). This suggests that having the bidirectional self-supervised tasks on text and KG facilitates the model to fuse the two modalities for reasoning.
|
| 186 |
+
|
| 187 |
+
Link prediction head choice (Table 5 middle 1). KG representation learning is an active area of research, and various KG triplet scoring models are proposed (Equation 9). We hence experimented with using different scoring models for DRAGON’s link prediction head (§2.3). We find that while DistMult has a slight edge, all variants we tried (DistMult, TransE, RotatE) are effective, outperforming the baseline without LinkPred (“MLM only”). This result suggests the generality of DRAGON and its promise to be combined with various KG representation learning techniques.
|
| 188 |
+
|
| 189 |
+
Cross-modal model (Table 5 middle 2). Another core component of DRAGON is the cross-modal encoder with bidirectional text-KG fusion layers (§2.2). We find that if we ablate them and simply concatenate text and KG representations at the end, the performance drops substantially. This result suggests that deep bidirectional fusion is crucial to model interactions over text and KG for reasoning.
|
| 190 |
+
|
| 191 |
+
KG structure (Table 5 bottom). The final key design of DRAGON is that we leverage the graph structure of KGs via a sequence-graph encoder and link prediction objective. Here we experimented with an alternative pretraining method that drops the graph structure: we convert triplets in the local KG into sentences using a template [33], append them to the main text input, and perform vanilla MLM pretraining. We find that DRAGON substantially outperforms this variant $+ 2 \%$ accuracy on OBQA), which suggests that the graph structure of KGs helps the model perform reasoning.
|
| 192 |
+
|
| 193 |
+
# 4 Experiments: Biomedical domain
|
| 194 |
+
|
| 195 |
+
Biomedicine is a domain with extensive background knowledge [67, 68, 69, 1], and experts curate various knowledge bases for it [70, 17, 71, 72]. We hypothesize that these biomedical KGs can enable deeper understanding and reasoning about biomedical text. With this motivation, we pretrain DRAGON on a biomedical corpus and KG, and evaluate on biomedical downstream tasks.
|
| 196 |
+
|
| 197 |
+
Pretraining setup. For the text data, we use PubMed [73], a widely-used corpus in biomedial LM training (e.g., BioBERT [74], PubmedBERT [75]). It contains the abstracts of biomedical papers on PubMed and has 21GB of text. For the KG data, we use the Unified Medical Language System (UMLS) [17], a widely-used knowledge graph in biomedicine. It has 300K nodes and 1M edges in total. For training, we follow the same procedure as the experiment in the general domain (§3.1), except that we initialize DRAGON’s LM component with BioLinkBERT-Large [19], the state-of-theart biomedical LM, instead of RoBERTa-Large. Note that while “BioLinkBERT” has “Link” in its name, it is not about KG links but about citation links that the model was originally pretrained with.
|
| 198 |
+
|
| 199 |
+
Downstream evaluation tasks. We finetune and evaluate DRAGON on three popular biomedical NLP and reasoning benchmarks: MedQA-USMLE (MedQA) [76], PubMedQA [77], and BioASQ [78]. Appendix B.4 provides details on these tasks and data splits.
|
| 200 |
+
|
| 201 |
+
Baselines. We compare DRAGON with the vanilla LM (BioLinkBERT) and LMs finetuned with the KG (QAGNN and GreaseLM seeded with BioLinkBERT).
|
| 202 |
+
|
| 203 |
+
<table><tr><td>Method</td><td>MedQA</td><td>PubMedQA</td><td>BioASQ</td></tr><tr><td>BioBERT[74]</td><td>36.7</td><td>60.2</td><td>84.1</td></tr><tr><td>PubmedBERT[75]</td><td>38.1</td><td>55.8</td><td>87.5</td></tr><tr><td>BioLinkBERT[19]</td><td>44.6</td><td>72.2</td><td>94.8</td></tr><tr><td>+ QAGNN</td><td>45.0</td><td>72.1</td><td>95.0</td></tr><tr><td>+ GreaseLM</td><td>45.1</td><td>72.4</td><td>94.9</td></tr><tr><td>DRAGON (Ours)</td><td>47.5</td><td>73.4</td><td>96.4</td></tr></table>
|
| 204 |
+
|
| 205 |
+
Table 6: Accuracy on biomedical NLP tasks. DRAGON outperforms all previous biomedical LMs.
|
| 206 |
+
|
| 207 |
+
Results. Table 6 summarizes model performance on the downstream tasks. Across tasks, DRAGON outperforms all the existing biomedical LMs and KG-augmented QA models, e.g., $+ 3 \%$ absolute accuracy boost over BioLinkBERT and $+ 2 \%$ over GreaseLM on MedQA, achieving new state-of-theart performance on these tasks. This result suggests significant efficacy of KG-augmented pretraining for improving biomedical reasoning tasks. Combined with the results in the general commonsense domain (§3.4), our experiments also suggest the domain-generality of DRAGON, serving as an effective pretraining method across domains with different combinations of text, KGs and seed LMs.
|
| 208 |
+
|
| 209 |
+
# 5 Conclusion
|
| 210 |
+
|
| 211 |
+
We presented DRAGON, a self-supervised pretraining method to learn a deeply bidirectional languageknowledge model from text and knowledge graphs (KGs) at scale. In both general and biomedical domains, DRAGON outperforms existing language models and KG-augmented models on various NLP tasks, and exhibits strong performance on complex reasoning such as answering questions involving long context or multi-step reasoning.
|
| 212 |
+
|
| 213 |
+
One limitation of DRAGON is that it is currently an encoder model (analogous to BERT) and does not perform language generation. An important future research would be to extend DRAGON to generation, and advance KG-enhanced language generation [28, 79].
|
| 214 |
+
|
| 215 |
+
# Reproducibility
|
| 216 |
+
|
| 217 |
+
Pretrained models, code and data are available at https://github.com/michiyasunaga/dragon. Experiments are available at https://worksheets.codalab.org/worksheets/0xcf9cddffff864fb382e1a2f1393c8934.
|
| 218 |
+
|
| 219 |
+
# Acknowledgment
|
| 220 |
+
|
| 221 |
+
We thank Rok Sosic, Hamed Nilforoshan, Michael Moor, Qian Huang, members of the Stanford SNAP, P-Lambda, and NLP groups, as well as our anonymous reviewers for valuable feedback. We also gratefully acknowledge the support of HAI Google Cloud Credits 1051203844499; DARPA under Nos. HR00112190039 (TAMI), N660011924033 (MCS); ARO under Nos. W911NF-16-1-0342 (MURI), W911NF-16-1-0171 (DURIP); NSF under Nos. OAC-1835598 (CINES), OAC-1934578 (HDR), CCF-1918940 (Expeditions), IIS-2030477 (RAPID), NIH under No. R56LM013365; Stanford Data Science Initiative, Wu Tsai Neurosciences Institute, Chan Zuckerberg Biohub, Amazon, JPMorgan Chase, Docomo, Hitachi, Intel, JD.com, KDDI, Toshiba, NEC, and UnitedHealth Group. The content is solely the responsibility of the authors and does not necessarily represent the official views of the funding entities.
|
| 222 |
+
|
| 223 |
+
# References
|
| 224 |
+
|
| 225 |
+
[1] Rishi Bommasani et al. On the opportunities and risks of foundation models. arXiv preprint arXiv:2108.07258, 2021.
|
| 226 |
+
[2] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In North American Chapter of the Association for Computational Linguistics (NAACL), 2019.
|
| 227 |
+
[3] Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 228 |
+
[4] Matthew E Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In North American Chapter of the Association for Computational Linguistics (NAACL), 2018.
|
| 229 |
+
[5] Kurt Bollacker, Colin Evans, Praveen Paritosh, Tim Sturge, and Jamie Taylor. Freebase: a collaboratively created graph database for structuring human knowledge. In SIGMOD, 2008.
|
| 230 |
+
[6] Denny Vrandeciˇ c and Markus Krötzsch. Wikidata: A free collaborative knowledgebase. ´ Communications of the ACM, 2014.
|
| 231 |
+
[7] Robyn Speer, Joshua Chin, and Catherine Havasi. Conceptnet 5.5: An open multilingual graph of general knowledge. In Proceedings of the AAAI Conference on Artificial Intelligence, 2017.
|
| 232 |
+
[8] Michihiro Yasunaga, Hongyu Ren, Antoine Bosselut, Percy Liang, and Jure Leskovec. QAGNN: Reasoning with language models and knowledge graphs for question answering. In North American Chapter of the Association for Computational Linguistics (NAACL), 2021.
|
| 233 |
+
[9] Xikun Zhang, Antoine Bosselut, Michihiro Yasunaga, Hongyu Ren, Percy Liang, Christopher D Manning, and Jure Leskovec. Greaselm: Graph reasoning enhanced language models for question answering. In International Conference on Learning Representations (ICLR), 2022.
|
| 234 |
+
[10] Hongyu Ren, Weihua Hu, and Jure Leskovec. Query2box: Reasoning over knowledge graphs in vector space using box embeddings. In International Conference on Learning Representations (ICLR), 2020.
|
| 235 |
+
[11] Hongyu Ren, Hanjun Dai, Bo Dai, Xinyun Chen, Michihiro Yasunaga, Haitian Sun, Dale Schuurmans, Jure Leskovec, and Denny Zhou. Lego: Latent execution-guided reasoning for multi-hop question answering on knowledge graphs. In International Conference on Machine Learning (ICML), 2021.
|
| 236 |
+
[12] Zhengyan Zhang, Xu Han, Zhiyuan Liu, Xin Jiang, Maosong Sun, and Qun Liu. Ernie: Enhanced language representation with informative entities. In Association for Computational Linguistics (ACL), 2019.
|
| 237 |
+
[13] Wenhan Xiong, Jingfei Du, William Yang Wang, and Veselin Stoyanov. Pretrained encyclopedia: Weakly supervised knowledge-pretrained language model. In International Conference on Learning Representations (ICLR), 2020.
|
| 238 |
+
[14] Xiaozhi Wang, Tianyu Gao, Zhaocheng Zhu, Zhengyan Zhang, Zhiyuan Liu, Juanzi Li, and Jian Tang. Kepler: A unified model for knowledge embedding and pre-trained language representation. Transactions of the Association for Computational Linguistics (TACL), 2021.
|
| 239 |
+
[15] Oshin Agarwal, Heming Ge, Siamak Shakeri, and Rami Al-Rfou. Knowledge graph based synthetic corpus generation for knowledge-enhanced language model pre-training. In North American Chapter of the Association for Computational Linguistics (NAACL), 2021.
|
| 240 |
+
[16] Yu Sun, Shuohuan Wang, Shikun Feng, Siyu Ding, Chao Pang, Junyuan Shang, Jiaxiang Liu, Xuyi Chen, Yanbin Zhao, Yuxiang Lu, et al. Ernie 3.0: Large-scale knowledge enhanced pre-training for language understanding and generation. arXiv preprint arXiv:2107.02137, 2021.
|
| 241 |
+
[17] Olivier Bodenreider. The unified medical language system (UMLS): Integrating biomedical terminology. Nucleic acids research, 2004.
|
| 242 |
+
[18] Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. Roberta: A robustly optimized bert pretraining approach. arXiv preprint arXiv:1907.11692, 2019.
|
| 243 |
+
[19] Michihiro Yasunaga, Jure Leskovec, and Percy Liang. LinkBERT: Pretraining language models with document links. In Association for Computational Linguistics (ACL), 2022.
|
| 244 |
+
[20] Kelvin Guu, Kenton Lee, Zora Tung, Panupong Pasupat, and Ming-Wei Chang. Realm: Retrieval-augmented language model pre-training. In International Conference on Machine Learning (ICML), 2020.
|
| 245 |
+
[21] Patrick Lewis, Ethan Perez, Aleksandra Piktus, Fabio Petroni, Vladimir Karpukhin, Naman Goyal, Heinrich Küttler, Mike Lewis, Wen-tau Yih, Tim Rocktäschel, et al. Retrieval-augmented generation for knowledge-intensive nlp tasks. In Advances in Neural Information Processing Systems (NeurIPS), 2020.
|
| 246 |
+
[22] Sebastian Borgeaud, Arthur Mensch, Jordan Hoffmann, Trevor Cai, Eliza Rutherford, Katie Millican, George van den Driessche, Jean-Baptiste Lespiau, Bogdan Damoc, Aidan Clark, et al. Improving language models by retrieving from trillions of tokens. arXiv preprint arXiv:2112.04426, 2021.
|
| 247 |
+
[23] Matthew E. Peters, Mark Neumann, IV RobertLLogan, Roy Schwartz, V. Joshi, Sameer Singh, and Noah A. Smith. Knowledge enhanced contextual word representations. In Empirical Methods in Natural Language Processing (EMNLP), 2019.
|
| 248 |
+
[24] Corby Rosset, Chenyan Xiong, Minh Phan, Xia Song, Paul Bennett, and Saurabh Tiwary. Knowledge-aware language model pretraining. arXiv preprint arXiv:2007.00655, 2020.
|
| 249 |
+
[25] Tao Shen, Yi Mao, Pengcheng He, Guodong Long, Adam Trischler, and Weizhu Chen. Exploiting structured knowledge in text via graph-guided representation learning. In Empirical Methods in Natural Language Processing (EMNLP), 2020.
|
| 250 |
+
[26] Fangyu Liu, Ehsan Shareghi, Zaiqiao Meng, Marco Basaldella, and Nigel Collier. Self-alignment pretraining for biomedical entity representations. In North American Chapter of the Association for Computational Linguistics (NAACL), 2021.
|
| 251 |
+
[27] Donghan Yu, Chenguang Zhu, Yiming Yang, and Michael Zeng. Jaket: Joint pre-training of knowledge graph and language understanding. In AAAI Conference on Artificial Intelligence, 2022.
|
| 252 |
+
[28] Pei Ke, Haozhe Ji, Yu Ran, Xin Cui, Liwei Wang, Linfeng Song, Xiaoyan Zhu, and Minlie Huang. Jointgt: Graph-text joint representation learning for text generation from knowledge graphs. In Findings of ACL, 2021.
|
| 253 |
+
[29] Weijie Liu, Peng Zhou, Zhe Zhao, Zhiruo Wang, Qi Ju, Haotang Deng, and P. Wang. K-bert: Enabling language representation with knowledge graph. In AAAI Conference on Artificial Intelligence, 2020.
|
| 254 |
+
[30] Tianxiang Sun, Yunfan Shao, Xipeng Qiu, Qipeng Guo, Yaru Hu, Xuan-Jing Huang, and Zheng Zhang. Colake: Contextualized language and knowledge embedding. In International Conference on Computational Linguistics (COLING), 2020.
|
| 255 |
+
[31] Bin He, Di Zhou, Jinghui Xiao, Xin Jiang, Qun Liu, Nicholas Jing Yuan, and Tong Xu. Integrating graph contextualized knowledge into pre-trained language models. In Findings of EMNLP, 2020.
|
| 256 |
+
[32] Bill Yuchen Lin, Xinyue Chen, Jamin Chen, and Xiang Ren. Kagnet: Knowledge-aware graph networks for commonsense reasoning. In Empirical Methods in Natural Language Processing (EMNLP), 2019.
|
| 257 |
+
[33] Yanlin Feng, Xinyue Chen, Bill Yuchen Lin, Peifeng Wang, Jun Yan, and Xiang Ren. Scalable multi-hop relational reasoning for knowledge-aware question answering. In Empirical Methods in Natural Language Processing (EMNLP), 2020.
|
| 258 |
+
[34] Shangwen Lv, Daya Guo, Jingjing Xu, Duyu Tang, Nan Duan, Ming Gong, Linjun Shou, Daxin Jiang, Guihong Cao, and Songlin Hu. Graph-based reasoning over heterogeneous external knowledge for commonsense question answering. In Proceedings of the AAAI Conference on Artificial Intelligence, 2020.
|
| 259 |
+
[35] Kuan Wang, Yuyu Zhang, Diyi Yang, Le Song, and Tao Qin. Gnn is a counter? revisiting gnn for question answering. In International Conference on Learning Representations (ICLR), 2022.
|
| 260 |
+
[36] Todor Mihaylov and Anette Frank. Knowledgeable reader: Enhancing cloze-style reading comprehension with external commonsense knowledge. In Association for Computational Linguistics (ACL), 2018.
|
| 261 |
+
[37] An Yang, Quan Wang, Jing Liu, Kai Liu, Yajuan Lyu, Hua Wu, Qiaoqiao She, and Sujian Li. Enhancing pre-trained language representations with rich knowledge for machine reading comprehension. In Association for Computational Linguistics (ACL), 2019.
|
| 262 |
+
[38] Haitian Sun, Bhuwan Dhingra, Manzil Zaheer, Kathryn Mazaitis, Ruslan Salakhutdinov, and William W Cohen. Open domain question answering using early fusion of knowledge bases and text. In Empirical Methods in Natural Language Processing (EMNLP), 2018.
|
| 263 |
+
[39] Haitian Sun, Tania Bedrax-Weiss, and William W Cohen. Pullnet: Open domain question answering with iterative retrieval on knowledge bases and text. In Empirical Methods in Natural Language Processing (EMNLP), 2019.
|
| 264 |
+
[40] Jun Yan, Mrigank Raman, Aaron Chan, Tianyu Zhang, Ryan Rossi, Handong Zhao, Sungchul Kim, Nedim Lipka, and Xiang Ren. Learning contextualized knowledge structures for commonsense reasoning. In Findings of ACL, 2021.
|
| 265 |
+
[41] Yueqing Sun, Qi Shi, Le Qi, and Yu Zhang. Jointlk: Joint reasoning with language models and knowledge graphs for commonsense question answering. In North American Chapter of the Association for Computational Linguistics (NAACL), 2022.
|
| 266 |
+
[42] Yichong Xu, Chenguang Zhu, Shuohang Wang, Siqi Sun, Hao Cheng, Xiaodong Liu, Jianfeng Gao, Pengcheng He, Michael Zeng, and Xuedong Huang. Human parity on commonsenseqa: Augmenting self-attention with external attention. In Association for Computational Linguistics (ACL), 2022.
|
| 267 |
+
[43] Théo Trouillon, Johannes Welbl, Sebastian Riedel, Éric Gaussier, and Guillaume Bouchard. Complex embeddings for simple link prediction. In International conference on machine learning (ICML), 2016.
|
| 268 |
+
[44] Seyed Mehran Kazemi and David Poole. Simple embedding for link prediction in knowledge graphs. In Advances in Neural Information Processing Systems (NeurIPS), 2018.
|
| 269 |
+
[45] Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. Translating embeddings for modeling multi-relational data. In Advances in Neural Information Processing Systems (NeurIPS), 2013.
|
| 270 |
+
[46] Bishan Yang, Wen-tau Yih, Xiaodong He, Jianfeng Gao, and Li Deng. Embedding entities and relations for learning and inference in knowledge bases. In International Conference on Learning Representations (ICLR), 2015.
|
| 271 |
+
[47] Zhiqing Sun, Zhi-Hong Deng, Jian-Yun Nie, and Jian Tang. Rotate: Knowledge graph embedding by relational rotation in complex space. In International Conference on Learning Representations (ICLR), 2019.
|
| 272 |
+
[48] Sebastian Riedel, Limin Yao, Andrew McCallum, and Benjamin M Marlin. Relation extraction with matrix factorization and universal schemas. In North American Chapter of the Association for Computational Linguistics (NAACL), 2013.
|
| 273 |
+
[49] Kristina Toutanova, Danqi Chen, Patrick Pantel, Hoifung Poon, Pallavi Choudhury, and Michael Gamon. Representing text for joint embedding of text and knowledge bases. In Empirical Methods in Natural Language Processing (EMNLP), 2015.
|
| 274 |
+
[50] Ruobing Xie, Zhiyuan Liu, Jia Jia, Huanbo Luan, and Maosong Sun. Representation learning of knowledge graphs with entity descriptions. In Proceedings of the AAAI Conference on Artificial Intelligence, 2016.
|
| 275 |
+
[51] Liang Yao, Chengsheng Mao, and Yuan Luo. Kg-bert: Bert for knowledge graph completion. arXiv preprint arXiv:1909.03193, 2019.
|
| 276 |
+
[52] Bosung Kim, Taesuk Hong, Youngjoong Ko, and Jungyun Seo. Multi-task learning for knowledge graph completion with pre-trained language models. In International Conference on Computational Linguistics (COLING), 2020.
|
| 277 |
+
[53] Da Li, Sen Yang, Kele Xu, Ming Yi, Yukai He, and Huaimin Wang. Multi-task pre-training language model for semantic network completion. arXiv preprint arXiv:2201.04843, 2022.
|
| 278 |
+
[54] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems (NeurIPS), 2017.
|
| 279 |
+
[55] Yukun Zhu, Ryan Kiros, Rich Zemel, Ruslan Salakhutdinov, Raquel Urtasun, Antonio Torralba, and Sanja Fidler. Aligning books and movies: Towards story-like visual explanations by watching movies and reading books. In International Conference on Computer Vision (ICCV), 2015.
|
| 280 |
+
[56] Alon Talmor, Jonathan Herzig, Nicholas Lourie, and Jonathan Berant. Commonsenseqa: A question answering challenge targeting commonsense knowledge. In North American Chapter of the Association for Computational Linguistics (NAACL), 2019.
|
| 281 |
+
[57] Todor Mihaylov, Peter Clark, Tushar Khot, and Ashish Sabharwal. Can a suit of armor conduct electricity? a new dataset for open book question answering. In Empirical Methods in Natural Language Processing (EMNLP), 2018.
|
| 282 |
+
[58] Bill Yuchen Lin, Ziyi Wu, Yichi Yang, Dong-Ho Lee, and Xiang Ren. Riddlesense: Reasoning about riddle questions featuring linguistic creativity and commonsense knowledge. In Findings of ACL, 2021.
|
| 283 |
+
[59] Peter Clark, Isaac Cowhey, Oren Etzioni, Tushar Khot, Ashish Sabharwal, Carissa Schoenick, and Oyvind Tafjord. Think you have solved question answering? try arc, the ai2 reasoning challenge. arXiv preprint arXiv:1803.05457, 2018.
|
| 284 |
+
[60] Lifu Huang, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. Cosmos qa: Machine reading comprehension with contextual commonsense reasoning. In Empirical Methods in Natural Language Processing (EMNLP), 2019.
|
| 285 |
+
[61] Rowan Zellers, Ari Holtzman, Yonatan Bisk, Ali Farhadi, and Yejin Choi. Hellaswag: Can a machine really finish your sentence? In Association for Computational Linguistics (ACL), 2019.
|
| 286 |
+
[62] Yonatan Bisk, Rowan Zellers, Jianfeng Gao, Yejin Choi, et al. Piqa: Reasoning about physical commonsense in natural language. In AAAI Conference on Artificial Intelligence, 2020.
|
| 287 |
+
[63] Maarten Sap, Hannah Rashkin, Derek Chen, Ronan LeBras, and Yejin Choi. Socialiqa: Commonsense reasoning about social interactions. In Empirical Methods in Natural Language Processing (EMNLP), 2019.
|
| 288 |
+
[64] Chandra Bhagavatula, Ronan Le Bras, Chaitanya Malaviya, Keisuke Sakaguchi, Ari Holtzman, Hannah Rashkin, Doug Downey, Scott Wen-tau Yih, and Yejin Choi. Abductive commonsense reasoning. In International Conference on Learning Representations (ICLR), 2020.
|
| 289 |
+
[65] Maxwell Nye, Anders Johan Andreassen, Guy Gur-Ari, Henryk Michalewski, Jacob Austin, David Bieber, David Dohan, Aitor Lewkowycz, Maarten Bosma, David Luan, et al. Show your work: Scratchpads for intermediate computation with language models. arXiv preprint arXiv:2112.00114, 2021.
|
| 290 |
+
[66] Jason Wei, Xuezhi Wang, Dale Schuurmans, Maarten Bosma, Ed Chi, Quoc Le, and Denny Zhou. Chain of thought prompting elicits reasoning in large language models. arXiv preprint arXiv:2201.11903, 2022.
|
| 291 |
+
[67] Elliot G Brown, Louise Wood, and Sue Wood. The medical dictionary for regulatory activities (meddra). Drug safety, 20(2):109–117, 1999.
|
| 292 |
+
[68] Carolyn E Lipscomb. Medical subject headings (mesh). Bulletin of the Medical Library Association, 88(3):265, 2000.
|
| 293 |
+
[69] Marinka Zitnik, Monica Agrawal, and Jure Leskovec. Modeling polypharmacy side effects with graph convolutional networks. Bioinformatics, 34(13):i457–i466, 2018.
|
| 294 |
+
[70] Michael Ashburner, Catherine A Ball, Judith A Blake, David Botstein, Heather Butler, J Michael Cherry, Allan P Davis, Kara Dolinski, Selina S Dwight, Janan T Eppig, et al. Gene ontology: tool for the unification of biology. Nature genetics, 25(1):25–29, 2000.
|
| 295 |
+
[71] David S Wishart, Yannick D Feunang, An C Guo, Elvis J Lo, Ana Marcu, Jason R Grant, Tanvir Sajed, Daniel Johnson, Carin Li, Zinat Sayeeda, et al. Drugbank 5.0: a major update to the drugbank database for 2018. Nucleic acids research, 2018.
|
| 296 |
+
[72] Camilo Ruiz, Marinka Zitnik, and Jure Leskovec. Identification of disease treatment mechanisms through the multiscale interactome. Nature communications, 12(1):1–15, 2021.
|
| 297 |
+
[73] PubMed. https://pubmed.ncbi.nlm.nih.gov/.
|
| 298 |
+
[74] Jinhyuk Lee, Wonjin Yoon, Sungdong Kim, Donghyeon Kim, Sunkyu Kim, Chan Ho So, and Jaewoo Kang. Biobert: a pre-trained biomedical language representation model for biomedical text mining. Bioinformatics, 2020.
|
| 299 |
+
[75] Yu Gu, Robert Tinn, Hao Cheng, Michael Lucas, Naoto Usuyama, Xiaodong Liu, Tristan Naumann, Jianfeng Gao, and Hoifung Poon. Domain-specific language model pretraining for biomedical natural language processing. arXiv preprint arXiv:2007.15779, 2020.
|
| 300 |
+
[76] Di Jin, Eileen Pan, Nassim Oufattole, Wei-Hung Weng, Hanyi Fang, and Peter Szolovits. What disease does this patient have? a large-scale open domain question answering dataset from medical exams. Applied Sciences, 2021.
|
| 301 |
+
[77] Qiao Jin, Bhuwan Dhingra, Zhengping Liu, William W Cohen, and Xinghua Lu. Pubmedqa: A dataset for biomedical research question answering. In Empirical Methods in Natural Language Processing (EMNLP), 2019.
|
| 302 |
+
[78] Anastasios Nentidis, Konstantinos Bougiatiotis, Anastasia Krithara, and Georgios Paliouras. Results of the seventh edition of the bioasq challenge. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, 2019.
|
| 303 |
+
[79] Wenhao Yu, Chenguang Zhu, Zaitang Li, Zhiting Hu, Qingyun Wang, Heng Ji, and Meng Jiang. A survey of knowledge-enhanced text generation. ACM Computing Surveys (CSUR), 2022.
|
| 304 |
+
[80] Emily Sheng, Kai-Wei Chang, Premkumar Natarajan, and Nanyun Peng. Towards controllable biases in language generation. In the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP)-Findings, long, 2020.
|
| 305 |
+
[81] Laura Weidinger, John Mellor, Maribeth Rauh, Conor Griffin, Jonathan Uesato, Po-Sen Huang, Myra Cheng, Mia Glaese, Borja Balle, Atoosa Kasirzadeh, et al. Ethical and social risks of harm from language models. arXiv preprint arXiv:2112.04359, 2021.
|
| 306 |
+
[82] Samuel Gehman, Suchin Gururangan, Maarten Sap, Yejin Choi, and Noah A Smith. Realtoxicityprompts: Evaluating neural toxic degeneration in language models. In Findings of EMNLP, 2020.
|
| 307 |
+
[83] Ninareh Mehrabi, Pei Zhou, Fred Morstatter, Jay Pujara, Xiang Ren, and A. G. Galstyan. Lawyers are dishonest? quantifying representational harms in commonsense knowledge resources. ArXiv, abs/2103.11320, 2021.
|
md/dev/4hturzLcKX/4hturzLcKX.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/7YTh6S8HIY/7YTh6S8HIY.md
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PyramidCLIP: Hierarchical Feature Alignment for Vision-language Model Pretraining
|
| 2 |
+
|
| 3 |
+
Yuting Gao1∗ Jinfeng Liu1,2,∗ Zihan $\mathbf { X } \mathbf { u } ^ { 1 , * }$ Jun Zhang1 Ke Li1 Chunhua Shen3
|
| 4 |
+
|
| 5 |
+
1Tencent Youtu Lab 2Shanghai Jiaotong University 3Zhejiang University {yutinggao,ianxxu,bobbyjzhang,tristanli}@tencent.com
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Large-scale vision-language pre-training has achieved promising results on downstream tasks. Existing methods highly rely on the assumption that the image-text pairs crawled from the Internet are in perfect one-to-one correspondence. However, in real scenarios, this assumption can be difficult to hold: the text description, obtained by crawling the affiliated metadata of the image, often suffers from the semantic mismatch and the mutual compatibility. To address these issues, we introduce PyramidCLIP, which constructs an input pyramid with different semantic levels for each modality, and aligns visual elements and linguistic elements in the form of hierarchy via peer-level semantics alignment and cross-level relation alignment. Furthermore, we soften the loss of negative samples (unpaired samples) so as to weaken the strict constraint during the pre-training stage, thus mitigating the risk of forcing the model to distinguish compatible negative pairs. Experiments on five downstream tasks demonstrate the effectiveness of the proposed PyramidCLIP. In particular, with the same amount of 15 million pre-training image-text pairs, PyramidCLIP exceeds CLIP on ImageNet zero-shot classification top-1 accuracy by $1 0 . 6 \% / 1 3 . 2 \% / 1 0 . 0 \%$ with ResNet50/ViT-B32/ViT-B16 based image encoder respectively. When scaling to larger datasets, PyramidCLIP achieves the state-of-the-art results on several downstream tasks. In particular, the results of PyramidCLIP-ResNet50 trained on $1 4 3 \mathbf { M }$ image-text pairs surpass that of CLIP using 400M data on ImageNet zero-shot classification task, significantly improving the data efficiency of CLIP.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Recently, vision-language pre-training (VLP) has achieved great success, which aims to improve the accuracy of downstream vision-language tasks by pre-training a model on large-scale image-text pairs harvested from the web without any manual annotation. The mainstream VLP methods can be categorized into two paradigms, single-stream (1; 2; 3; 4; 5) and dual-stream (6; 7; 8; 9; 10). Compared to the single-stream counterpart, the dual-stream paradigm decouples the image encoder and text encoder and extracts features for images and texts respectively. Due to its simplicity and flexibility for downstream applications, the dual-stream paradigm dominates. The representative dual-stream model CLIP (6) performs contrastive vision-language pre-training on 400M imagetext pairs collected from the Internet, which achieves astounding results. Later, DeCLIP (10) and FILIP (8) improve CLIP by introducing more supervisions, and bringing in fine-grained cross-modal interaction.
|
| 14 |
+
|
| 15 |
+
Although existing CLIP-alike methods have achieved promising results on downstream tasks, they strongly rely on the assumption that the image-text pairs are of high quality, i.e., the pairs are in perfect one-to-one correspondence and have no correlation with other unpaired samples. However, this ideal assumption is hard to satisfy in practice as shown in Figure 1. Firstly, semantic mismatch
|
| 16 |
+
|
| 17 |
+
between the visual modality and linguistic modality exists, e.g., (a) Caption Redundancy: the affiliated text description is redundant and contains irrelevant information; (b) Image Redundancy: the Regionof-Interest (ROI) corresponding to the text is only a sub-region of the image; and (c) Cast Deficiency: text misses the descriptions of main objects in the image, while visual modelling needs to reason about the relationship among salient instances. Secondly, captions might be compatible to some extent among pairs, as illustrated in Figure 1(d). Existing methods directly treat other pairs as negative samples regardless the potential correlation, which may confuse the model.
|
| 18 |
+
|
| 19 |
+
# In order to tackle the issues mentioned
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: Problems in the web-crawled image-text pairs. (a)(b)(c) suffer the semantic mismatch between visual modality and linguistic modality, while (d) shows an example of the mutual compatibility with (a). Note that, in (a) the red caption is redundant; in (b) the image outside the red bounding box is the redundant; in (c) the descriptions for the casts in the red boxes are missing; and in (d) the red caption is compatible with the image of (a).
|
| 23 |
+
|
| 24 |
+
above, we propose PyramidCLIP in this paper, which attempts to align image-text pairs more precisely in the form of hierarchy. PyramidCLIP constructs two input pyramids with different semantic levels at both sides of the dual-stream network, i.e., the global image, local image region, and ROI features of the salient objects in the image for visual modelling; text summarization, the original caption and categories with attribute descriptions of salient objects for linguistic modelling. Then we contrast visual elements and linguistic elements via peer-level semantics alignment and cross-level relation alignment, tackling the issues of mentioned in (a), (b) and (c). Specifically, for peer-level semantics alignment, since the global image and text summarization both contain global semantic information, and the local region and original caption both contain more fine-grained semantic information, they are treated as two pairs of positive samples. For cross-level relation alignment, to avoid the modelling of object relationship being overwhelmed by the semantics modelling, we explicitly align the fine-grained object relation with cross-layer elements in another modality. Moreover, for the issue of the mutual compatibility, we soften the loss term of the negative unpaired samples during the contrast process to ease the strict constraint, alleviating the negative effect of unpaired similarities.
|
| 25 |
+
|
| 26 |
+
Extensive experiments demonstrate the effectiveness of our proposed PyramidCLIP. For fair comparison, when trained on YFCC15M-V2 (10) dataset, with ResNet50 (11)/ViT-B32 (12)/ViT-B16 (12) as the image encoder and Transformer as the text encoder, our model achieves the state-of-the-art (SoTA) zero-shot classification on ImageNet (13) with $4 7 . 8 \% / 4 6 . 0 \% / 5 0 . 7 \%$ top-1 accuracy. In comparison, the CLIP achieves $3 7 . 2 \% / 3 2 . 8 \% / 4 0 . 7 \%$ respectively. Furthermore, when scaling to the large-scale dataset, the results of PyramidCLIP achieve SoTA on several downstream tasks, in particular, the results of PyramidCLIP-ResNet50 trained on 143M image-text pairs surpass that of CLIP trained on 400M data on ImageNet zero-shot classification task, improving the data efficiency of CLIP significantly.
|
| 27 |
+
|
| 28 |
+
Our main contributions are summarized as follows: (i) We propose PyramidCLIP for more accurate image-text alignment for vision-language model pre-training, which effectively constructs two input pyramids at both sides of the visual encoder and linguistic encoder, and then align the visual elements and linguistic elements via peer-level semantics alignment and cross-level relation alignment. (ii) We soften the loss term of negative samples during the contrast process to ease the strict constraint, so as to alleviate the negative effect caused by local similarities. (iii) Extensive experiments demonstrate the effectiveness of PyramidCLIP, which achieves SoTA on several downstream tasks.
|
| 29 |
+
|
| 30 |
+
# 2 Related Work
|
| 31 |
+
|
| 32 |
+
Vision-Language Pre-training Vision-Language Pre-training (VLP) learns a strong joint representation between two modalities by pre-training models on large-scale image-text pairs. In terms of the model architecture, the mainstream VLP models can be divided into two types: single-stream and dual-stream. The former one uses a single transformer to model both image and text representations in a unified semantic space by concatenating image and text input embeddings, including VisualBERT (2), UNITER (1), UNICODER (4), OSCAR (3) and UNIMO (14). The latter one encodes images and texts separately with decoupled image encoder and text encoder, such as ViLBERT (15), LXMERT (9), ALIGN (7), CLIP (6), and DeCLIP (10). From a different perspective, the pre-training objective mainly comprises two categories: image-text contrastive learning and masked token tasks based on Language Modeling (LM). Among the methods mentioned above, UNIMO, ALIGN, CLIP and DeCLIP adopt contrastive learning to align the textual and visual representation in a unified semantic space. In contrast, VisualBERT, UNITER, LXMERT and UNICODER use masked token tasks, including Masked Language/Region Modeling and autoregressive LM. In this paper, we employ dual-stream architecture and contrastive learning for simplicity, flexibility, and relatively cheaper computation cost.
|
| 33 |
+
|
| 34 |
+
Fine-grained Alignment Due to the semantic gap between image and text, there may be some troubles in directly performing the alignment between these two modalities. For example, some words or phrases in the descriptions may be irrelevant to the images, or the corresponding descriptions of the objects in an image may not always be available in the caption. Thus, finer-grained alignment is indispensable, as it can provide more accurate and richer supervision signals of multiple granularity, improving the performance significantly. FILIP (8) improves the contrastive objective to achieve finer-level alignment by using a token-wise maximum similarity between visual and textual tokens. Methods in (3; 16; 17; 18) construct multi-level semantic concepts for finer-grained alignment. OSCAR (3) first introduces multi-level semantics, capturing object region features and the corresponding tags with a pre-trained object detector, then concatenates text, object tags and region features together to learn the joint representations. VinVL (16) enhances the visual representations of OSCAR by pre-trianing a more powerful object-attribute detector. Both OSCAR and $\mathrm { V i n V L }$ form the multi-level semantics only in the visual modality. MVPTR (17) and X-VLM (18) obtain their multi-level semantics concepts in both visual and linguistic modalities. MVPTR limits the interaction between object tags and textual tokens, and learns the object-tag alignment in an explicit manner. It also models the nested property of language by learning phrase-level semantics. X-VLM learns multi-level alignments by positioning vision concepts using given texts, and makes alignments between these two parts. However, in addition to the image encoder and the text encoder, the two methods both have an additional cross-modal encoder, bringing computation overhead.
|
| 35 |
+
|
| 36 |
+
In this paper, we follow the dual-stream design of CLIP and construct three visual semantics levels and three linguistic semantics levels to form our PyramidCLIP. Different from methods mentioned above, each level is input to the corresponding encoder individually, without concatenating. The obtained three visual representations and three linguistic representations are used to compute six contrastive loss terms, which helps to achieve multi-level alignments.
|
| 37 |
+
|
| 38 |
+
# 3 Method
|
| 39 |
+
|
| 40 |
+
In this section, we introduce the proposed PyramidCLIP for more accurate alignment of image and text for vision-language model pre-training.
|
| 41 |
+
|
| 42 |
+
# 3.1 Overall Architecture
|
| 43 |
+
|
| 44 |
+
The entire framework of the proposed PyramidCLIP is presented in Figure 2. PyramidCLIP is a dual-stream network, including a text encoder $h$ and an image encoder $f = f _ { 2 } \circ f _ { 1 }$ , where $f _ { 1 }$ and $f _ { 2 }$ denote the front part and the rear part of the image encoder respectively. Each encoder consists of a linear projector and a normalization operator in the end, which project the final class token into a unified dimension and then normalize it, obtaining the corresponding visual or linguistic representation vector in the same embedded space.
|
| 45 |
+
|
| 46 |
+
During the training, for each image-text pair $( I , T )$ , the image $I$ is transformed into two views, i.e., local view $L$ and global view $G$ , through random crop with different ratios. And text $T$ is input to a summary extractor (19) to generate text summarization $T _ { \mathrm { { S } } }$ with higher level semantics. The image global view $G$ and text summarization $T _ { \mathrm { { S } } }$ both capture global context information, while the image local view $L$ and original text $T$ contain more detailed information. Therefore, $G$ and $T _ { \mathrm { { S } } }$ are regarded as a pair of positive samples, while $L$ and $T$ are regarded as another pair of positive samples, denoted as $( G , T _ { \mathrm { S } } )$ and $( L , T )$ . These two pairs are input to the dual-stream encoder to extract global and local representation pairs, $( v ^ { g } , l ^ { s } )$ and $( { \boldsymbol { v } } ^ { l } , l ^ { t } )$ , where $v ^ { g } = f ( G )$ , $l ^ { s } = h ( T _ { \mathrm { S } } )$ , $v ^ { l } = f ( L )$ and $l ^ { t } = h ( T )$ . Finally, $( v ^ { g } , l ^ { s } )$ and $( { \boldsymbol { \mathbf { \mathit { v } } } } ^ { l } , l ^ { t } )$ are pulled together through contrastive learning losses $\textcircled{1}$ and $\textcircled{2}$ respectively (refer to Figure 2), and other samples in the same batch are treated as negative samples. We term this contrasting process as Peer-level Semantics Alignment.
|
| 47 |
+
|
| 48 |
+

|
| 49 |
+
Figure 2: Overall architecture of the proposed PyramidCLIP which is a dual-stream network. The input elements of visual modelling and linguistic modelling both have three-level semantics. The elements of the two modalities interact through peer-level semantics alignment and cross-level relation alignment.
|
| 50 |
+
|
| 51 |
+
Furthermore, in order to explicitly model the relationship between salient objects in the image, the ROI feature sequence $\mathcal { R } = \{ o _ { 1 } , o _ { 2 } , . . . , o _ { M } \}$ of $M$ detected salient objects in the image $I$ , with the category and attribute information for each object, are extracted through a pre-trained object-attribute detector. Then a linear embedding module $\varphi$ is used to transform $\mathcal { R }$ into the latent dimension of Multi-head Self-attention (MHSA) layer (12) in the image encoder. The feature sequence is successively fed into the rear part $f _ { 2 }$ , which contains one or more MHSA layers, to adaptively capture the relation between these salient instances, generating the final representation vector ${ \pmb v } ^ { r }$ , i.e., ${ \pmb v } ^ { r } = f _ { 2 } ( \varphi ( \mathscr { R } ) )$ . For the object categories with attributes, we join them together, constructing another text description $T _ { \mathrm { O A } }$ , to provide a more granular, comprehensive and accurate caption for the image. Then we feed it into the text encoder, generating the representation vector $l ^ { a } = h ( T _ { \mathrm { O A } } )$ . To avoid the relation modelling being overwhelmed by the context semantic modelling, we have $( { \pmb v } ^ { g } , l ^ { a } ) , ( { \pmb v } ^ { r } , l ^ { s } ) , ( { \pmb v } ^ { l } , l ^ { a } )$ and $( v ^ { r } , l ^ { \bar { t } } )$ as another four positive pairs, and the distances between which are narrowed through contrastive learning losses $\textcircled{3} , \textcircled{4} , \textcircled{5}$ and $\textcircled{6}$ respectively, termed as Cross-level Relation Alignment.
|
| 52 |
+
|
| 53 |
+
It is worth noting that at the inference stage, only the original image-text pair $( I , T )$ is used, i.e., the visual representation $v ^ { i }$ from $I$ and the linguistic representation $l ^ { \bar { t } }$ from $T$ .
|
| 54 |
+
|
| 55 |
+
# 3.2 Peer-level Semantics Alignment
|
| 56 |
+
|
| 57 |
+
Now we present the details of the peer-level semantics alignment. As mentioned above, the dualstream vision-language contrastive learning methods such as CLIP strongly rely on the assumption that the image-text pairs are of good quality of one-to-one correspondence. However, semantic mismatch between images and text captions often occurs in the automatically harvested data. Therefore, we construct an input pyramid with multi-level semantics on both sides of the dual-stream network, and then align image and text within the same semantics level. Specifically, the image $I$ is transformed to the global view $G$ and the local view $L$ through two random crops with different ratios. For the text caption, besides the original caption $T$ , text summarization $T _ { \mathrm { { S } } }$ with more compact semantics is extracted using a pre-trained text summarization extractor.
|
| 58 |
+
|
| 59 |
+
Coarse-grained Global Contrast We set the random crop ratio for generating global view $G$ to be [0.9, 1], which basically contains all the information in the original image. Text summarization $T _ { \mathrm { { S } } }$ condenses the original caption $T$ , removing some redundant and overly detailed information in the $T$ . $G$ and $T _ { \mathrm { { S } } }$ both capture global information and can be used as pairs of positive samples. The projected embedding $v ^ { g }$ and $\iota ^ { s }$ of $G$ and $T _ { \mathrm { { S } } }$ are pulled closer through contrastive learning.
|
| 60 |
+
|
| 61 |
+
Fine-grained Local Contrast Since the alignment of the global view $G$ with the text summarization $T _ { \mathrm { { S } } }$ described above is relatively coarse, finer-grained information is largely discarded. Intuitively, some image sub-regions can be aligned with the original caption $T$ . To this end, we introduce fine-grained local contrast. We set the random cropping ratio for generating local view $L$ to be [0.5, 1], which focuses on the sub-region of the image $I$ . Then the projected embeddings $\mathbf { \nabla } _ { \mathbf { \pmb { v } } ^ { l } }$ and $\displaystyle { l ^ { t } }$ of $L$ and $T$ are also brought together through contrastive loss (refer to Section 3.4).
|
| 62 |
+
|
| 63 |
+
Naturally, we have also tried to bring the finer-grained, peer-level $( v ^ { r } , l ^ { a } )$ closer, but there is no further gain (see Appendix F).
|
| 64 |
+
|
| 65 |
+
# 3.3 Cross-level Relation Alignment
|
| 66 |
+
|
| 67 |
+
To further improve the alignment precision, we introduce the ROI feature of each salient object in the image and the corresponding description with category and attributes, using a pre-trained objectattribute detector, as the most fine-grained semantic level to provide more accurate supervisions. Specifically, given an image $I$ with $M$ salient objects, the extracted visual semantics of each object region is formulated as $[ o _ { m } ^ { \prime } , z _ { m } ]$ , where $m$ denotes the $m _ { t h }$ object, $\pmb { o } _ { m } ^ { \prime }$ is a 2048-dimensional feature vector and $z _ { m }$ is a 4-dimensional normalized position vector indicating the coordinates of top-left and bottom-right corners. By concatenating $\pmb { o } _ { m } ^ { \prime }$ and $z _ { m }$ , we have the 2052-dimensional position-sensitive ROI feature vector $\mathbf { o } _ { m }$ , forming the ROI feature sequence $\mathcal { R } = \{ o _ { 1 } , o _ { 2 } , . . . , o _ { M } \}$ with the order organized from high confidence to low. Then $\mathcal { R } \in \mathbb { R } ^ { M \times { 2 0 5 2 } }$ is transformed into $\mathbb { R } ^ { M \times d }$ using the projector in the embedding module $\varphi$ , where $d$ indicates the latent dimension of the MHSA layers in the image encoder. A randomly initialized $d$ -dimensional class token is additionally appended at the front, resulting $\mathcal { F } \in \mathbb { R } ^ { ( 1 + M ) \times d }$ , which is further feed into the rear part $f _ { 2 }$ of the image encoder to compute the normalized ROI relation embedding ${ \pmb v } ^ { r }$ , i.e., ${ \mathcal { F } } = \varphi ( { \mathcal { R } } )$ and ${ \pmb v } ^ { r } = f _ { 2 } ( \mathscr { F } )$ . Note that feature sequence $\mathcal { F }$ is position-sensitive following $\mathcal { R }$ . Thus, positional embedding is not applied before it enters into the MHSA layer. Meanwhile, the detected names of category and attributes for each salient object form a phrase with one or more adjectives (attributes) modifying a noun (category), like “gold round brown table” in Figure 2. Then all the $M$ phrases from $M$ salient objects are joint into a text description $T _ { \mathrm { O A } }$ with the same order as the ROI feature sequence, and the phrases are separated by commas. Next, $T _ { \mathrm { O A } }$ is input to the text encoder to obtain the embedding $l ^ { a } \bar { = } h ( T _ { \mathrm { O A } } )$ .
|
| 68 |
+
|
| 69 |
+
To enhance the relation modelling capacity of the text encoder, while avoiding weakening the reasoning ability of the image encoder, $( \bar { \boldsymbol { v } } ^ { g } , \bar { l ^ { a } } ) , ( \boldsymbol { v } ^ { r } , l ^ { s } ) , ( \boldsymbol { v } ^ { l } , l ^ { a } )$ and $( v ^ { r } , l ^ { t } )$ are used as another four positive pairs, and the distance between each pair is minimized simultaneously. Since the object-level inputs $\mathcal { R }$ and $T _ { \mathrm { O A } }$ are direct concatenation of feature vectors and phrases respectively, hence very fine-grained, while other inputs $G$ , $L$ , $T _ { \mathrm { { S } } }$ and $T$ are complete images or sentences, we term this contrasting process cross-level relation alignment.
|
| 70 |
+
|
| 71 |
+
In the case that the visual model is a convolution neural network (CNN), the traditional pooling layer is replaced by attention pooling, which actually is a MHSA layer. So the embedded ROI feature sequence $\mathcal { F }$ is input to the attention pooling layer, i.e., $f _ { 2 }$ , which indicates the final attention pooling layer, as shown in Figure 3(a). For the transformer-based visual model (ViT), the sequence $\mathcal { F }$ can be directly input to a transformer layer. Considering that $\mathcal { F }$ already encodes high-level visual semantics, we feed it into the rear part $f _ { 2 }$ of the ViT encoder, see Figure 3(b).
|
| 72 |
+
|
| 73 |
+

|
| 74 |
+
Figure 3: (a) The schematic of CNN-based image encoder. (b) The schematic of ViT-based image encoder. (c) The structure of LeFF module in ViT.
|
| 75 |
+
|
| 76 |
+
Besides, as pointed out in (20; 21), the standard ViT may not fully leverage the local context information, which limits the visual representation capacity of ViT-based image encoder. Following (21), we incorporate a depth-wise convolution into the Feed-Forward module of ViT, termed Locally-enhanced Feed-Forward (LeFF), improving the patch-level local perception and interaction. The structure of LeFF is shown in Figure 3(c). First, the patch tokens are projected into a higher dimension through a linear projection layer and reshaped. Next, a $3 \times 3$ depth-wise convolution is utilized to capture the local information. Then the feature maps are flattened to a token sequence and re-projected into the initial dimension. While the class token is identical during the process and is concatenated with locally-enhanced patch tokens, generating the final output. As depicted in Figure 3(b), LeFF is only applied in the front part $f _ { 1 }$ of the ViT-based image encoder, since it is clearly not suitable for the embedded ROI feature sequence $\mathcal { F }$ . In Figure 3(b), $L$ denotes the total number of transformer layers in ViT and $L _ { s }$ is the number of transformer layers with LeFF in $f _ { 1 }$ . And $L = 1 2$ and $L _ { s } = 9$ in the experiments. The influence of different settings of $L _ { s }$ can be seen in Appendix F.
|
| 77 |
+
|
| 78 |
+
# 3.4 Softened Objective Function
|
| 79 |
+
|
| 80 |
+
For a batch of $N$ image-text pairs $\{ ( I _ { i } , T _ { i } ) \} _ { i = 1 } ^ { N }$ , where $i$ indicates the $i _ { t h }$ pair, the normalized embedded vectors $\{ v _ { i } ^ { g } , v _ { i } ^ { l } , v _ { i } ^ { r } , l _ { i } ^ { s } , l _ { i } ^ { t } , l _ { i } ^ { a } \} _ { i = 1 } ^ { N }$ i=1 of the same dimension are obtained by the dual-stream encoders. In this formulation, $\pmb { v } _ { i } ^ { g }$ , $\pmb { v } _ { i } ^ { l }$ and $\pmb { v } _ { i } ^ { r }$ are generated by the image encoder from global-crop image $G$ , local-crop image $L$ and ROI feature sequence $\mathcal { R }$ respectively, while $l _ { i } ^ { s }$ , $l _ { i } ^ { t }$ and $\mathbf { \Delta } l _ { i } ^ { a }$ are generated by the text encoder from text summarization $T _ { \mathrm { { S } } }$ , original text $T$ and object-attribute description $T _ { \mathrm { O A } }$ respectively. Then we use this vector group to construct six supervision signals $\mathcal { L } _ { \mathrm { G S } }$ , $\mathcal { L } _ { \mathrm { L T } }$ , $\mathcal { L } _ { \mathrm { G A } }$ , $\mathcal { L } _ { \mathrm { R S } }$ , $\mathcal { L } _ { \mathrm { L A } }$ and $\mathcal { L } _ { \mathrm { R T } }$ for in-batch contrastive learning, which can be calculated with $\{ ( v _ { i } ^ { g } , l _ { i } ^ { s } ) \} _ { i = 1 } ^ { N } , \{ ( v _ { i } ^ { l } , l _ { i } ^ { t } ) \} _ { i = 1 } ^ { N } , \{ ( v _ { i } ^ { g } , l _ { i } ^ { a } ) \} _ { i = 1 } ^ { N } , \{ ( v _ { i } ^ { r } , l _ { i } ^ { s } ) \} _ { i = 1 } ^ { N } , \{ ( v _ { i } ^ { l } , l _ { i } ^ { a } ) \} _ { i = 1 } ^ { N }$ and $\{ ( v _ { i } ^ { r } , l _ { i } ^ { t } ) \} _ { i = 1 } ^ { N }$ respectively. Our six contrastive losses, with the formulation of InfoNCE (22), are designed to achieve the alignment between visual representation and linguistic representation from disparate semantic levels. Take the first loss term $\mathcal { L } _ { \mathrm { G S } }$ from $\{ ( v _ { i } ^ { g } , \bar { l } _ { i } ^ { s } ) \} _ { i = 1 } ^ { N }$ as an example. For the $i _ { t h }$ pair, the normalized vision-to-language similarity $p _ { i } ^ { v } ( G ) = \{ p _ { i j } ^ { v } ( G ) \} _ { j = 1 } ^ { N }$ and language-to-vision similarity $p _ { i } ^ { l } ( T _ { \mathrm { S } } ) = \{ p _ { i j } ^ { l } ( T _ { \mathrm { S } } ) \} _ { j = 1 } ^ { N }$ can be calculated through:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
p _ { i j } ^ { v } ( G ) = \frac { \exp ( \sin ( v _ { i } ^ { g } , l _ { j } ^ { s } ) / \tau ) } { \sum _ { j = 1 } ^ { N } \exp ( \sin ( v _ { i } ^ { g } , l _ { j } ^ { s } ) / \tau ) } , \quad p _ { i j } ^ { l } ( T _ { \mathrm { S } } ) = \frac { \exp ( \sin ( l _ { i } ^ { s } , v _ { j } ^ { g } ) / \tau ) } { \sum _ { j = 1 } ^ { N } \exp ( \sin ( l _ { i } ^ { s } , v _ { j } ^ { g } ) / \tau ) } ,
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $\tau$ is a learnable temperature parameter initialized with 0.07 and the function $\mathrm { s i m } ( \cdot )$ conducts dot product to measure the similarity scores.
|
| 87 |
+
|
| 88 |
+
In standard practice, for the $i _ { t h }$ pair, the corresponding one-hot label vectors of the ground-truth $\pmb { y } _ { i } ^ { v } ( G ) = \{ \hat { y _ { i j } ^ { v } } ( G ) \} _ { j = 1 } ^ { N }$ and $\pmb { y } _ { i } ^ { l } ( T _ { \mathrm { S } } ) = \{ y _ { i j } ^ { l } ( T _ { \mathrm { S } } ) \} _ { j = 1 } ^ { N }$ , with positive pair denoted by 1 and negatives by 0, are used as the targets to calculate cross-entropy. This kind of hard targets assumes there is absolutely no similarity between unpaired image and text. However, within a large-size batch, unpaired image and text may have more or less local similarities, i.e., some local regions in an image may be matched with some words or phrases in other unpaired texts. To address this problem for better generalization, we use label smoothing to soften the hard targets. The corresponding softened targets $\widetilde { \mathbf { } y } _ { i } ^ { v } ( G )$ and $\widetilde { \pmb { y } } _ { i } ^ { l } ( T _ { \mathrm { S } } )$ for the $i _ { t h }$ pair can be formulated as:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\begin{array} { r } { \widetilde { y } _ { i } ^ { v } ( G ) = ( 1 - \alpha ) { y } _ { i } ^ { v } ( G ) + \alpha / ( N - 1 ) , \quad \widetilde { y } _ { i } ^ { l } ( T _ { \mathrm { S } } ) = ( 1 - \alpha ) { y } _ { i } ^ { l } ( T _ { \mathrm { S } } ) + \alpha / ( N - 1 ) , } \end{array}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where $\alpha$ is the smoothing hyper-parameter set to 0.2 in our experiments. Then $\mathcal { L } _ { \mathrm { G S } }$ can be written as:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\mathcal { L } _ { \mathrm { G S } } = - \frac { 1 } { 2 N } \sum _ { i = 1 } ^ { N } \sum _ { j = 1 } ^ { N } ( \widetilde { y } _ { i j } ^ { v } ( G ) \cdot \log ( p _ { i j } ^ { v } ( G ) ) + \widetilde { y } _ { i j } ^ { l } ( T _ { \mathrm { S } } ) \cdot \log ( p _ { i j } ^ { l } ( T _ { \mathrm { S } } ) ) ) .
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
The other loss terms $\mathcal { L } _ { \mathrm { L T } } , \mathcal { L } _ { \mathrm { G A } } , \mathcal { L } _ { \mathrm { R S } } , \mathcal { L } _ { \mathrm { L A } }$ and $\mathcal { L } _ { \mathrm { R T } }$ can be calculated similarly. We then divide them into three groups that are respectively the peer-level alignment $\mathcal { L } _ { \mathrm { p e e r } } = ( \mathcal { L } _ { \mathrm { G S } } + \mathcal { L } _ { \mathrm { L T } } ) / 2$ , the global-relation cross-level alignment $\mathcal { L } _ { \mathrm { c r o s s } } ^ { \mathrm { g l o b a l } } = ( \mathcal { L } _ { \mathrm { G A } } + \mathcal { L } _ { \mathrm { R S } } ) / 2$ and the local-relation cross-level alignment $\mathcal { L } _ { \mathrm { c r o s s } } ^ { \mathrm { l o c a l } } = ( \mathcal { L } _ { \mathrm { L A } } + \mathcal { L } _ { \mathrm { R T } } ) / 2$ . Therefore, the overall objective function of PyramidCLIP is:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\begin{array} { r } { \mathcal { L } = ( 1 - \lambda - \mu ) \mathcal { L } _ { \mathrm { p e e r } } + \lambda \mathcal { L } _ { \mathrm { c r o s s } } ^ { \mathrm { g l o b a l } } + \mu \mathcal { L } _ { \mathrm { c r o s s } } ^ { \mathrm { l o c a l } } , } \end{array}
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where the loss weights $\lambda$ and $\mu$ are both set to $^ 1 / 3$ in our experiments.
|
| 107 |
+
|
| 108 |
+
# 4 Experiments
|
| 109 |
+
|
| 110 |
+
# 4.1 Implementation Details and Datasets
|
| 111 |
+
|
| 112 |
+
Pre-training Stage We experiment on three different architectures, PyramidCLIP-ResNet50/ViTB32/ViT-B16, according to the choice of image encoder. Their detailed architecture designs follow that of CLIP (6). LAION99M contains 99M image-text pairs with the highest similarity selected from LAION400M (23) according to the similarity scores provided by the producer. We use the publicly released T5 model (19) to extract text summarization for all texts and utilize an object-attribute detector pre-trained by VinVL (16) to extract salient object features together with category and attribute information in the image. Please refer to Appendix A for details.
|
| 113 |
+
|
| 114 |
+
Downstream Tasks We validate the effectiveness of our proposed method on five downstream tasks: zero-shot image classification, zero-shot image-text retrieval, linear probe, object detection and instance segmentation. For classification, experiments are carried out on 11 datasets, such as ImageNet (13), CIFAR-100 (28). For image-text retrieval, experiments are conducted on Flickr30K (29)
|
| 115 |
+
|
| 116 |
+
Table 1: Pre-training datasets.
|
| 117 |
+
|
| 118 |
+
<table><tr><td>Dataset</td><td>Size</td></tr><tr><td>SBU (24)</td><td>1M</td></tr><tr><td>CC3M (25)</td><td>3M</td></tr><tr><td>CC12M (26)</td><td>10M</td></tr><tr><td>YFCC15M-V1 (27)</td><td>15M</td></tr><tr><td>YFCC15M-V2 (10) LAION99M (23)</td><td>15M</td></tr><tr><td></td><td>99M</td></tr><tr><td>Total</td><td>143M</td></tr></table>
|
| 119 |
+
|
| 120 |
+
and MS-COCO (30). For object detection and instance segmentation, the proposed method is verified on PASCAL VOC (31) and MS-COCO. More details can be found in Appendix B.
|
| 121 |
+
|
| 122 |
+
# 4.2 Fair Comparison against SoTA
|
| 123 |
+
|
| 124 |
+
We first compare our method against other SoTA approaches on ImageNet zero-shot classification task using the same amount of pre-training data YFCC15M-V2 and the results are shown in Table 2. It can be seen that compared to CLIP, PyramidCLIP improves the top-1 accuracy by $1 0 . 6 \% / 1 \dot { 3 } . 2 \% / 1 0 . 0 \%$ when the visual model is ResNet50/ViT-B32/ViT-B16 respectively. Furthermore, PyramidCLIP outperforms all other SoTA approaches by a large margin. In addition, since the distribution of different datasets can vary vastly, we also conduct experiments on YFCC15M-V1 and LAION15M, which is obtained by sampling 15 million image-text pairs from LAION99M for fair comparison. The results can be seen in Appendix C and our PyramidCLIP still shows great superiority.
|
| 125 |
+
|
| 126 |
+
Table 2: Zero-shot(ZS) classification results on ImageNet.
|
| 127 |
+
|
| 128 |
+
<table><tr><td>Method</td><td>Image Encoder</td><td>ImageNet ZS Top1</td></tr><tr><td>CLIP (6) SLIP (32) FILIP (8) DECLIP (10) PyramidCLIP</td><td>ResNet50</td><td>37.2+ 28.5† 21.3† 44.4† 47.8</td></tr><tr><td>CLIP (6) SLIP(32) FILIP (8) DECLIP (10) DeFILIP (33)</td><td>ViT-B/32</td><td>32.8t 34.3t 39.5† 43.2† 45.0+</td></tr><tr><td>PyramidCLIP CLIP PyramidCLIP</td><td>ViT-B/16</td><td>46.0 40.7 50.7</td></tr></table>
|
| 129 |
+
|
| 130 |
+
⋄ Our Implementation † Reported in (33)
|
| 131 |
+
|
| 132 |
+
# 4.3 Comparison on Large-scale Datasets
|
| 133 |
+
|
| 134 |
+
We further validate the effectiveness of our method on a large-scale dataset, i.e., 143M image-text pairs, and downstream zero-shot image-text retrieval and image classification results are shown in Table 3. It can be seen that on image-text retrieval task, PyramidCLIP exceeds CLIP trained on $4 0 0 \mathbf { M }$ data and DECLIP by a large margin. And on ImageNet classification task, with the same amount of pre-training data, PyramidCLIP significantly exceeds the results of CLIP by $6 . 1 \% / 3 . 8 \% / 3 . 5 \%$ using ResNet50/ViT-B32/ViT-B16 as image encoder. Furthermore, it is worth noting that, when the vision model is ResNet50, PyramidCLIP trained on 143M data surpass CLIP using 400M data, which greatly improves data efficiency.
|
| 135 |
+
|
| 136 |
+
# 4.4 Transferability to Small-scale Classification Datasets
|
| 137 |
+
|
| 138 |
+
In this section, we validate the transferability of our method on 10 relatively small downstream classification datasets, both on zero-shot and linear probe tasks. The results are shown in Table 4. It can be seen that the average accuracy of PyramidCLIP on 10 datasets all exceed CLIP trained on 400M data on two kinds of tasks. It is worth noting that our pre-training data is less than $36 \%$ of CLIP, but the average accuracy is better, indicating higher data utilization.
|
| 139 |
+
|
| 140 |
+
# 4.5 Transferability to Object Detection and Instance Segmentation
|
| 141 |
+
|
| 142 |
+
In order to verify that our model can better exploit the relationship between objects in the image, we further validate our models on object detection and instance segmentation tasks. Specifically, we take the visual model ResNet50 to initialize the backbone of Faster R-CNN (34) and Mask R-CNN (35) and then all the parameters are fine-tuned. The results are shown in the Table 6. It can be seen that our model significantly outperforms random initialization and surpasses CLIP and DECLIP model.
|
| 143 |
+
|
| 144 |
+
Table 3: Zero-shot image-text retrieval results and image classification top-1 accuracy. IN denotes ImageNet.
|
| 145 |
+
|
| 146 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Image Encoder</td><td rowspan="2">Pretrain Dataset</td><td colspan="4">Flickr30K</td><td colspan="4">MS-COCO</td><td rowspan="2">IN ZS Top1</td></tr><tr><td>I2T</td><td></td><td>T21</td><td></td><td>12T</td><td></td><td>T21</td><td></td></tr><tr><td>CLIP*</td><td></td><td>400M</td><td>79.2</td><td>95.2</td><td>R@1 R@5 R@1 R@5</td><td></td><td>R@1</td><td>R@5</td><td>R@1 R@5 27.4</td><td></td><td>59.6</td></tr><tr><td rowspan="4">DECLIP+ CLIP PyramidCLIP</td><td rowspan="4">ResNet50</td><td>88M</td><td>60.4</td><td>85.3</td><td>57.9 46.3</td><td>84.1 74.4</td><td>47.6</td><td>73.1</td><td></td><td>51.8</td><td>62.5</td></tr><tr><td></td><td>80.6</td><td>95.7</td><td></td><td></td><td>32.0</td><td>57.8</td><td>21.7</td><td>44.6</td><td></td></tr><tr><td>143M</td><td>86.3</td><td>98.0</td><td>63.6 71.6</td><td>87.3 91.3</td><td>51.8</td><td>76.4</td><td>34.0</td><td>60.0</td><td>55.3</td></tr><tr><td>143M</td><td></td><td></td><td></td><td></td><td>55.0</td><td>79.8</td><td>39.6</td><td>66.2</td><td>61.4</td></tr><tr><td>CLIP* DECLIP†</td><td>ViT-B/32</td><td>400M 88M</td><td>77.6 59.8</td><td>93.6 84.4</td><td>59.0 46.2</td><td>83.7 74.5</td><td>49.2 32.6</td><td>74.1 59.1</td><td>29.8 22.1</td><td>54.4 45.8</td><td>63.2 66.6</td></tr><tr><td rowspan="4">CLIP PyramidCLIP</td><td rowspan="4"></td><td>143M</td><td>81.3</td><td>95.4</td><td>63.3</td><td>87.0</td><td>51.1</td><td>76.4</td><td>34.4</td><td>60.6</td><td>58.0</td></tr><tr><td>143M</td><td>84.2</td><td>96.4</td><td>69.1</td><td>89.8</td><td>52.8</td><td>78.1</td><td>38.8</td><td>64.9</td><td>61.8</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>400M</td><td>84.6</td><td>97.3</td><td>65.0</td><td>87.8</td><td>51.7</td><td>76.1</td><td>32.5</td><td>57.7</td><td>68.8</td></tr><tr><td>CLIP* CLIP</td><td>ViT-B/16</td><td>143M</td><td>84.5</td><td>97.4</td><td>70.5</td><td>90.9</td><td>56.9</td><td>79.6</td><td>38.8</td><td>65.0</td><td>63.4</td></tr><tr><td colspan="2">PyramidCLIP</td><td>143M</td><td>85.6</td><td>97.7</td><td>74.5</td><td>92.9</td><td>55.7</td><td>80.8</td><td>42.6</td><td>68.6</td><td>66.9</td></tr></table>
|
| 147 |
+
|
| 148 |
+
⋆ Tested with the released model: https://github.com/openai/CLIP#api ⋄ Our Implementation † Tested with: https://github.com/Sense-GVT/DeCLIP#our-pretrain-declip-model-w-text-encoder
|
| 149 |
+
|
| 150 |
+
Table 4: Accuracy on 10 datasets with ResNet50 image encoder. C10/100/F101/FLOW/CAL/AIR is CIFAR10/CIFAR-100/Food101/Flowers/Caltech/Aircraft. AVG represents average accuracy across 10 datasets.
|
| 151 |
+
|
| 152 |
+
<table><tr><td>Task</td><td>Method</td><td>Pretrain Dataset</td><td>PETS</td><td>C10 C10O DTD CARS F101 FLOW AIR SUN CAL AVG</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan="3">Zero Shot</td><td>CLIP</td><td>400M</td><td>85.4</td><td>75.6</td><td>41.6</td><td>41.7</td><td>55.8</td><td>81.1</td><td>65.9</td><td>19.3</td><td>59.6</td><td>82.1</td><td>60.8</td></tr><tr><td>CLIP</td><td>143M</td><td>77.0</td><td>56.4</td><td>26.7</td><td>41.4</td><td>54.6</td><td>69.8</td><td>60.4</td><td>7.3</td><td>60.6</td><td>76.1</td><td>53.6</td></tr><tr><td>PyramidCLIP</td><td>143M</td><td>83.7</td><td>81.5</td><td>53.7</td><td>47.2</td><td>65.0</td><td>67.8</td><td>65.8</td><td>12.6</td><td>65.8</td><td>81.7</td><td>62.4</td></tr><tr><td rowspan="4">Linear Probe</td><td>CLIP</td><td>400M</td><td>85.1</td><td>88.7</td><td>70.3</td><td>76.4</td><td>78.3</td><td>86.4</td><td>96.1</td><td>49.1</td><td>73.3</td><td>89.6</td><td>79.3</td></tr><tr><td>DECLIP</td><td>88M</td><td>88.7</td><td>89.8</td><td>71.2</td><td>76.8</td><td>81.7</td><td>82.7</td><td>99.2</td><td>48.4</td><td>72.8</td><td>93.9</td><td>80.5</td></tr><tr><td>CLIP</td><td>143M</td><td>82.9</td><td>84.5</td><td>64.5</td><td>74.3</td><td>79.3</td><td>80.5</td><td>93.2</td><td>45.4</td><td>74.7</td><td>91.5</td><td>77.1</td></tr><tr><td>PyramidCLIP</td><td>143M</td><td>87.8</td><td>91.8</td><td>75.6</td><td>75.8</td><td>81.8</td><td>81.9</td><td>93.0</td><td>53.1</td><td>76.1</td><td>94.2</td><td>81.3</td></tr></table>
|
| 153 |
+
|
| 154 |
+
⋄ Our Implementation
|
| 155 |
+
|
| 156 |
+
# 4.6 Ablation Study
|
| 157 |
+
|
| 158 |
+
In this section, we verify the effectiveness of each component in PyramidCLIP on downstream zeroshot ImageNet classification task, and all the experiments are pre-trained for 8 epochs on YFCC15M-V1. The results are listed in Table 5, which indicate that on the basis of the peer-level alignment, all the other components including cross-level global-relation and local-relation alignment, LeFF in ViT and softened objectives can bring significant gains individually. More ablation results can be seen in Appendix F, including the detailed ablation on $L _ { s }$ , the choice of peer-level alignment and the effectiveness each component on downstream object detection task.
|
| 159 |
+
|
| 160 |
+
Table 5: Ablation study of each component on ImageNet zero-shot classification task. “Soften” means all the objectives are softened.
|
| 161 |
+
|
| 162 |
+
<table><tr><td rowspan="2">Image Encoder</td><td colspan="4">Components</td><td rowspan="2">ImageNet ZS Top1</td></tr><tr><td>Lpeer</td><td>Lglobal cross</td><td>Clocal cross</td><td>Soften LeFF</td></tr><tr><td rowspan="4">ResNet50</td><td>>>></td><td></td><td></td><td>=</td><td>32.8</td></tr><tr><td></td><td></td><td></td><td></td><td>35.0(+2.2)</td></tr><tr><td></td><td>?</td><td>√</td><td></td><td>36.7(+3.9)</td></tr><tr><td>√</td><td>√</td><td></td><td></td><td>38.6(+5.8)</td></tr><tr><td rowspan="5">ViT-B/32</td><td>√</td><td></td><td></td><td></td><td>28.8</td></tr><tr><td>√</td><td>√</td><td></td><td></td><td>32.1(+3.3)</td></tr><tr><td>√</td><td>√</td><td>√</td><td></td><td>33.4(+4.6)</td></tr><tr><td>√</td><td></td><td></td><td></td><td>35.0(+6.2)</td></tr><tr><td>√</td><td>1</td><td></td><td></td><td>35.9(+7.1) 厂</td></tr></table>
|
| 163 |
+
|
| 164 |
+
# 4.7 Visualization
|
| 165 |
+
|
| 166 |
+
Semantic Features We utilize $t$ -SNE (36) to visualize the learned semantic features of CIFAR-10 (28). Each text feature of 10 categories is obtained using the ensemble of 80 prompt templates. And image features are extracted with ResNet50 visual encoder. As depicted in Figure 4, CLIP pre-trained on 143M data has a poor clustering performance, with the visual features of most categories overlapping heavily and the textual features of some two categories being very close, such as (automobile, truck) and (frog, deer). Although CLIP pre-trained on 400M data (6) performs better than CLIP on 143M data, the visual features of some categories like dog and cat still have a large overlap. In comparison, the semantic features extracted by PyramidCLIP on 143M data, are well separated with each textual feature surrounded by most visual features of the same category.
|
| 167 |
+
|
| 168 |
+
Table 6: Object detection and instance segmentation results on VOC and COCO with ResNet50 as backbone.
|
| 169 |
+
|
| 170 |
+
<table><tr><td rowspan="2">Initialized Weights</td><td rowspan="2">Pre-train Dataset</td><td colspan="6">Object Detection</td><td colspan="3">Instance Segmentation</td></tr><tr><td colspan="3">vOC</td><td colspan="3">CoCo</td><td colspan="3">Coco</td></tr><tr><td></td><td></td><td>Apbb</td><td>AP6</td><td>AP</td><td>Apbb</td><td>AP6</td><td>AP</td><td>Apmk</td><td>APmk</td><td>AP</td></tr><tr><td>Random</td><td>1</td><td>26.5</td><td>51.6</td><td>22.8</td><td>28.5</td><td>46.2</td><td>29.8</td><td>25.6</td><td>43.4</td><td>26.8</td></tr><tr><td>CLIP (6)</td><td>400M</td><td>45.5</td><td>73.5</td><td>47.9</td><td>36.5</td><td>56.1</td><td>38.8</td><td>31.9</td><td>52.7</td><td>33.5</td></tr><tr><td>DECLIP (10)</td><td>88M</td><td>50.0</td><td>77.4</td><td>53.6</td><td>37.4</td><td>57.2</td><td>40.1</td><td>32.5</td><td>53.6</td><td>34.4</td></tr><tr><td>PyramidCLIP</td><td>143M</td><td>50.9</td><td>78.7</td><td>54.7</td><td>38.0</td><td>58.1</td><td>40.8</td><td>33.0</td><td>54.6</td><td>35.1</td></tr></table>
|
| 171 |
+
|
| 172 |
+

|
| 173 |
+
Figure 4: Visualization of semantic features of CIFAR-10 test set. Big points represent text features and small points indicate image features. Different colors represent different categories.
|
| 174 |
+
|
| 175 |
+
Grad-CAM Heatmaps Grad-CAM (37) is also utilized to help understand why PyramidCLIP outperforms CLIP. Specifically, we conduct this through text-to-image retrieval on MS-COCO, using CLIP/PyramidCLIP-ResNet50 pre-trained on 143M data. For each query text, the model retrieves top5 images with highest similarities. Then for each of the five retrieved images, we use Grad-CAM to find which areas have the highest activation to the query text. As shown in Figure 5, PyramidCLIP has better retrieval performance than CLIP. Moreover, PyramidCLIP can accurately capture the complete object regions that are highly matched with the query texts, while CLIP captures regions with either components missing or additional noises, or even obtains completely irrelevant matches. More visualization results can be found in Appendix G.
|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
Figure 5: Grad-CAM heatmaps for top5 retrieved images. From left to right are images from rank1 to rank5. Red box indicates the groundtruth image matched with the query text.
|
| 179 |
+
|
| 180 |
+
# 5 Conclusion
|
| 181 |
+
|
| 182 |
+
In this paper, we have proposed a hierarchical pre-training method, termed PyramidCLIP, to achieve improved alignment between visual and linguistic modalities. It resolves the issue that the weblycrawled data is not in perfect one-to-one correspondence by explicitly constructing pyramidal semantic inputs at the both sides of dual-stream network. We also show that softened peer-level semantics alignment and cross-level relation alignment can interact between two modalities and are beneficial. PyramidCLIP achieves the state-of-the-art results on five downstream tasks, which demonstrates the superiority.
|
| 183 |
+
|
| 184 |
+
# Checklist
|
| 185 |
+
|
| 186 |
+
1. For all authors...
|
| 187 |
+
|
| 188 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 189 |
+
(b) Did you describe the limitations of your work? [No]
|
| 190 |
+
(c) Did you discuss any potential negative societal impacts of your work? [No] Our work does not have any potential negative societal impacts.
|
| 191 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 192 |
+
|
| 193 |
+
2. If you are including theoretical results...
|
| 194 |
+
|
| 195 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 196 |
+
|
| 197 |
+
3. If you ran experiments...
|
| 198 |
+
|
| 199 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [No] Our codes may be released in the future.
|
| 200 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Appendix A.
|
| 201 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] We did not run the same experiment for multiple times.
|
| 202 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Appendix A.
|
| 203 |
+
|
| 204 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 205 |
+
|
| 206 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 207 |
+
(b) Did you mention the license of the assets? [No]
|
| 208 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [No] Our codes may be released in the future.
|
| 209 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [No] Existing assets used in our work are all publicly released.
|
| 210 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [No] Datasets used in our work are all publicly released without this problem.
|
| 211 |
+
|
| 212 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 213 |
+
|
| 214 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 215 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 216 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
| 217 |
+
|
| 218 |
+
# References
|
| 219 |
+
|
| 220 |
+
[1] Y.-C. Chen, L. Li, L. Yu, A. El Kholy, F. Ahmed, Z. Gan, Y. Cheng, and J. Liu, “Uniter: Universal image-text representation learning,” in Proc. European Conf. Computer Vision, 2020, pp. 104–120.
|
| 221 |
+
[2] L. H. Li, M. Yatskar, D. Yin, C.-J. Hsieh, and K.-W. Chang, “Visualbert: A simple and performant baseline for vision and language,” arXiv preprint arXiv:1908.03557, 2019.
|
| 222 |
+
[3] X. Li, X. Yin, C. Li, P. Zhang, X. Hu, L. Zhang, L. Wang, H. Hu, L. Dong, F. Wei et al., “Oscar: Objectsemantics aligned pre-training for vision-language tasks,” in Proc. European Conf. Computer Vision, 2020, pp. 121–137.
|
| 223 |
+
[4] G. Li, N. Duan, Y. Fang, M. Gong, and D. Jiang, “Unicoder-vl: A universal encoder for vision and language by cross-modal pre-training,” in Proceedings of the AAAI Conference on Artificial Intelligence, vol. 34, no. 07, 2020, pp. 11 336–11 344.
|
| 224 |
+
[5] W. Su, X. Zhu, Y. Cao, B. Li, L. Lu, F. Wei, and J. Dai, “Vl-bert: Pre-training of generic visual-linguistic representations,” arXiv preprint arXiv:1908.08530, 2019.
|
| 225 |
+
[6] A. Radford, J. W. Kim, C. Hallacy, A. Ramesh, G. Goh, S. Agarwal, G. Sastry, A. Askell, P. Mishkin, J. Clark et al., “Learning transferable visual models from natural language supervision,” in Proc. International Conf. Machine Learning, 2021, pp. 8748–8763.
|
| 226 |
+
[7] C. Jia, Y. Yang, Y. Xia, Y.-T. Chen, Z. Parekh, H. Pham, Q. Le, Y.-H. Sung, Z. Li, and T. Duerig, “Scaling up visual and vision-language representation learning with noisy text supervision,” in International Conference on Machine Learning. PMLR, 2021, pp. 4904–4916.
|
| 227 |
+
[8] L. Yao, R. Huang, L. Hou, G. Lu, M. Niu, H. Xu, X. Liang, Z. Li, X. Jiang, and C. Xu, “Filip: Fine-grained interactive language-image pre-training,” arXiv preprint arXiv:2111.07783, 2021.
|
| 228 |
+
[9] H. Tan and M. Bansal, “Lxmert: Learning cross-modality encoder representations from transformers,” arXiv preprint arXiv:1908.07490, 2019.
|
| 229 |
+
[10] Y. Li, F. Liang, L. Zhao, Y. Cui, W. Ouyang, J. Shao, F. Yu, and J. Yan, “Supervision exists everywhere: A data efficient contrastive language-image pre-training paradigm,” arXiv preprint arXiv:2110.05208, 2021.
|
| 230 |
+
[11] K. He, X. Zhang, S. Ren, and J. Sun, “Deep residual learning for image recognition,” in Proc. IEEE Conf. Computer Vision and Pattern Recognition, 2016, pp. 770–778.
|
| 231 |
+
[12] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly et al., “An image is worth 16x16 words: Transformers for image recognition at scale,” arXiv preprint arXiv:2010.11929, 2020.
|
| 232 |
+
[13] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei, “Imagenet: A large-scale hierarchical image database,” in Proc. IEEE Conf. Computer Vision and Pattern Recognition, 2009, pp. 248–255.
|
| 233 |
+
[14] W. Li, C. Gao, G. Niu, X. Xiao, H. Liu, J. Liu, H. Wu, and H. Wang, “Unimo: Towards unified-modal understanding and generation via cross-modal contrastive learning,” arXiv preprint arXiv:2012.15409, 2020.
|
| 234 |
+
[15] J. Lu, D. Batra, D. Parikh, and S. Lee, “Vilbert: Pretraining task-agnostic visiolinguistic representations for vision-and-language tasks,” Proc. Advances in Neural Information Processing Systems, vol. 32, 2019.
|
| 235 |
+
[16] P. Zhang, X. Li, X. Hu, J. Yang, L. Zhang, L. Wang, Y. Choi, and J. Gao, “Vinvl: Revisiting visual representations in vision-language models,” in Proc. IEEE/CVF Conf. Computer Vision & Pattern Recognition, 2021, pp. 5579–5588.
|
| 236 |
+
[17] Z. Li, Z. Fan, H. Tou, Z. Wei, and X. Huang, “Mvptr: Multi-stage vision-language pre-training via multi-level semantic alignment,” arXiv preprint arXiv:2201.12596, 2022.
|
| 237 |
+
[18] Y. Zeng, X. Zhang, and H. Li, “Multi-grained vision language pre-training: Aligning texts with visual concepts,” arXiv preprint arXiv:2111.08276, 2021.
|
| 238 |
+
[19] C. Raffel, N. Shazeer, A. Roberts, K. Lee, S. Narang, M. Matena, Y. Zhou, W. Li, and P. J. Liu, “Exploring the limits of transfer learning with a unified text-to-text transformer,” arXiv preprint arXiv:1910.10683, 2019.
|
| 239 |
+
[20] J. Guo, K. Han, H. Wu, C. Xu, Y. Tang, C. Xu, and Y. Wang, “Cmt: Convolutional neural networks meet vision transformers,” arXiv preprint arXiv:2107.06263, 2021.
|
| 240 |
+
[21] K. Yuan, S. Guo, Z. Liu, A. Zhou, F. Yu, and W. Wu, “Incorporating convolution designs into visual transformers,” in Proceedings of the IEEE/CVF International Conference on Computer Vision, 2021, pp. 579–588.
|
| 241 |
+
[22] A. Van den Oord, Y. Li, O. Vinyals et al., “Representation learning with contrastive predictive coding,” arXiv preprint arXiv:1807.03748, vol. 2, no. 3, p. 4, 2018.
|
| 242 |
+
[23] C. Schuhmann, R. Vencu, R. Beaumont, R. Kaczmarczyk, C. Mullis, A. Katta, T. Coombes, J. Jitsev, and A. Komatsuzaki, “Laion-400m: Open dataset of clip-filtered 400 million image-text pairs,” arXiv preprint arXiv:2111.02114, 2021.
|
| 243 |
+
[24] V. Ordonez, G. Kulkarni, and T. Berg, “Im2text: Describing images using 1 million captioned photographs,” Proc. Advances in Neural Information Processing Systems, vol. 24, 2011.
|
| 244 |
+
[25] P. Sharma, N. Ding, S. Goodman, and R. Soricut, “Conceptual captions: A cleaned, hypernymed, image alttext dataset for automatic image captioning,” in Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 2018, pp. 2556–2565.
|
| 245 |
+
[26] S. Changpinyo, P. Sharma, N. Ding, and R. Soricut, “Conceptual 12m: Pushing web-scale image-text pre-training to recognize long-tail visual concepts,” in Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2021, pp. 3558–3568.
|
| 246 |
+
[27] B. Thomee, D. A. Shamma, G. Friedland, B. Elizalde, K. Ni, D. Poland, D. Borth, and L.-J. Li, “Yfcc100m: The new data in multimedia research,” Communications of the ACM, vol. 59, no. 2, pp. 64–73, 2016.
|
| 247 |
+
[28] A. Krizhevsky, G. Hinton et al., “Learning multiple layers of features from tiny images,” Tech. Rep., 2009.
|
| 248 |
+
[29] M. Hodosh, P. Young, and J. Hockenmaier, “Framing image description as a ranking task: Data, models and evaluation metrics,” Journal of Artificial Intelligence Research, vol. 47, pp. 853–899, 2013.
|
| 249 |
+
[30] T.-Y. Lin, M. Maire, S. Belongie, J. Hays, P. Perona, D. Ramanan, P. Dollár, and C. L. Zitnick, “Microsoft coco: Common objects in context,” in Proc. European Conf. Computer Vision, 2014, pp. 740–755.
|
| 250 |
+
[31] M. Everingham, S. Eslami, L. Van Gool, C. K. Williams, J. Winn, and A. Zisserman, “The pascal visual object classes challenge: A retrospective,” International journal of computer vision, vol. 111, no. 1, pp. 98–136, 2015.
|
| 251 |
+
[32] N. Mu, A. Kirillov, D. Wagner, and S. Xie, “Slip: Self-supervision meets language-image pre-training,” arXiv preprint arXiv:2112.12750, 2021.
|
| 252 |
+
[33] Y. Cui, L. Zhao, F. Liang, Y. Li, and J. Shao, “Democratizing contrastive language-image pre-training: A clip benchmark of data, model, and supervision,” arXiv preprint arXiv:2203.05796, 2022.
|
| 253 |
+
[34] S. Ren, K. He, R. Girshick, and J. Sun, “Faster R-CNN: Towards real-time object detection with region proposal networks,” Proc. Advances in Neural Information Processing Systems, vol. 28, 2015.
|
| 254 |
+
[35] K. He, G. Gkioxari, P. Dollár, and R. Girshick, “Mask r-cnn,” in Proceedings of the IEEE international conference on computer vision, 2017, pp. 2961–2969.
|
| 255 |
+
[36] L. van der Maaten and G. Hinton, “Viualizing data using t-sne,” Journal of Machine Learning Research, pp. 2579–2605, 2008.
|
| 256 |
+
[37] R. R. Selvaraju, M. Cogswell, A. Das, R. Vedantam, D. Parikh, and D. Batra, “Grad-cam: Visual explanations from deep networks via gradient-based localization,” in Proceedings of the IEEE international conference on computer vision, 2017, p. 618–626.
|
md/dev/BIpTWmO_BY/BIpTWmO_BY.md
ADDED
|
@@ -0,0 +1,322 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SLEEPER AGENT: SCALABLE HIDDEN TRIGGER BACKDOORS FOR NEURAL NETWORKS TRAINED FROM SCRATCH
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
As the curation of data for machine learning becomes increasingly automated, dataset tampering is a mounting threat. Backdoor attackers tamper with training data to embed a vulnerability in models that are trained on that data. This vulnerability is then activated at inference time by placing a “trigger” into the model’s input. Typical backdoor attacks insert the trigger directly into the training data, although the presence of such an attack may be visible upon inspection. In contrast, the Hidden Trigger Backdoor Attack achieves poisoning without placing a trigger into the training data at all. However, this hidden trigger attack is ineffective at poisoning neural networks trained from scratch. We develop a new hidden trigger attack, Sleeper Agent, which employs gradient matching, data selection, and target model re-training during the crafting process. Sleeper Agent is the first hidden trigger backdoor attack to be effective against neural networks trained from scratch. We demonstrate its effectiveness on ImageNet and in black-box settings.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
High-performance deep learning systems have grown in scale at a rapid pace. As a result, practitioners seek larger and larger datasets with which to train their data-hungry models. Due to the surging demand for training data along with improved accessibility via the web, the data curation process is increasingly automated. Dataset manipulation attacks exploit vulnerabilities in the curation pipeline to manipulate training data so that downstream machine learning models contain exploitable behaviors. Some attacks degrade inference across samples (Biggio et al., 2012; Fowl et al., 2021), while targeted data poisoning attacks induce a malfunction on a specific target sample (Shafahi et al., 2018; Geiping et al., 2020).
|
| 12 |
+
|
| 13 |
+
Backdoor attacks are a style of dataset manipulation that induces a model to execute the attacker’s desired behavior when its input contains a backdoor trigger (Gu et al., 2017; Bagdasaryan et al., 2020). To this end, typical backdoor attacks inject the trigger directly into training data so that models trained on this data rely on the trigger to perform inference (Gu et al., 2017; Chen et al., 2017). Such threat models for classification problems typically incorporate label flips as well. However, images poisoned under this style of attack are often easily identifiable since they belong to the incorrect class and contain a visible trigger. One line of work uses only small or realistic-looking triggers, but these may still be visible and are often placed in conspicuous image regions (Chen et al., 2017; Gu et al., 2017; Li et al., 2020). Another recent method, Hidden Trigger Backdoor Attack (HTBD), instead crafts correctly labeled poisons which do not contain the trigger at all, but this feature collision method is not effective on models trained from scratch (Saha et al., 2019; Schwarzschild et al., 2020). The task of crafting backdoor poisons which simultaneously hide the trigger and are also effective at compromising deep models remains an open and challenging problem. This is especially the case in the black-box scenario, where the attacker does not know the victim’s architecture and training routine, and in the clean-label scenario where the attacker cannot flip labels.
|
| 14 |
+
|
| 15 |
+
In this work, we develop the first hidden trigger attack that can reliably backdoor deep neural networks trained from scratch. Our threat model is illustrated in Figure 1. Our attack, Sleeper Agent, contains the following essential features:
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: High-level schematic of our attack. A small proportion of slightly perturbed data is added to the training set which “backdoors” the model so that it misclassifies patched images at inference.
|
| 19 |
+
|
| 20 |
+
• Gradient matching: our attack is based on recent advances which replace direct solvers for bi-level optimization problems with a gradient alignment objective (Geiping et al., 2020). However, we will see that the following technical additions are necessary to successfully backdoor neural networks (see Table 9).
|
| 21 |
+
• Data selection: we specifically poison images that have a high impact on training in order to maximize the attack’s effect.
|
| 22 |
+
• Adaptive retraining: while crafting poisons, we periodically retrain the surrogate models to better reflect how models respond to our poisoned data during training.
|
| 23 |
+
• Ensembles: Sleeper Agent incorporates an ensemble of distinct surrogate architectures in order to achieve transferability across models.
|
| 24 |
+
• Black-box: our method succeeds in crafting poisons on a surrogate network or ensemble, knowing nothing about the victim’s architecture and training hyperparameters.
|
| 25 |
+
|
| 26 |
+
We demonstrate empirically that Sleeper Agent is effective against a variety of architectures and in the black-box scenario where the attacker does not know the victim’s architecture. The latter scenario has proved very difficult for existing methods (Schwarzschild et al., 2020), although it is more realistic. An added benefit of the gradient matching strategy is that it scales to large tasks. We demonstrate this property by backdooring models on ImageNet (Russakovsky et al., 2015). Some random clean and poisoned samples from the ImageNet dataset are shown in Figure 2.
|
| 27 |
+
|
| 28 |
+
# 2 RELATED WORK
|
| 29 |
+
|
| 30 |
+
Data poisoning attacks come in many shapes and sizes. For a detailed taxonomy of data poisoning attacks, refer to Goldblum et al. (2020). Early data poisoning attacks often focused simply on degrading clean validation performance on simple models like SVMs, logistic regression models, and linear classifiers (Biggio et al., 2012; Munoz-Gonz ˜ alez et al., 2017; Steinhardt et al., 2017). ´ These methods often relied upon the learning problems being convex in order to exactly anticipate the impact of perturbations to training data. Following these early works, attacks quickly became more specialized in their scope and approach. Modern availability attacks on deep networks degrade overall performance via gradient minimization (Shen et al., 2019), easily learnable patterns (Huang et al., 2021), or adversarial noise generated by autoencoders (Feng et al., 2019). However, these works often perturb the entire training set - an unrealistic assumption for many poisoning settings.
|
| 31 |
+
|
| 32 |
+
Another flavor of poisoning, commonly referred to as targeted poisoning, modifies training data to cause a victim model to misclassify a certain target image or set of target images. Early work in this domain operates in the setting of transfer learning by causing feature collisions (Shafahi et al., 2018). Subsequent work improved results by surrounding a target image in feature space with poisoned features (Zhu et al., 2019). Follow up works further improved targeted poisoning by proposing methods that are effective against from-scratch training regimes (Huang et al., 2020; Geiping et al., 2020). These attacks remain limited in scope, however, and often fail to induce misclassification on more than one target image (Geiping et al., 2020).
|
| 33 |
+
|
| 34 |
+

|
| 35 |
+
Figure 2: Sample clean source (first column), patched source (second column), clean target (third column), and poisoned target (fourth column) from the ImageNet dataset. The last column is slightly perturbed, but the perturbed and corresponding clean images are hardly distinguishable by the human eye. More visualizations can be found in the Appendix B.
|
| 36 |
+
|
| 37 |
+
Adjacent to targeted data poisoning are backdoor attacks. Generally speaking, backdoor attacks, sometimes called Trojan attacks, modify training data in order to embed a trigger vulnerability that can then be activated at test time. Crucially, this attack requires the attacker to modify data at inference time. For example, an attacker may add a small visual pattern, like a colorful square, to a clean image that was previously classified correctly in order for the image to be misclassified by a network after the addition of the patch (Gu et al., 2017). However, these works can require training labels to be flipped, and/or a conspicuous patch to be added to training data.
|
| 38 |
+
|
| 39 |
+
Of particular relevance to this work is a subset of backdoor attacks that are clean label, meaning that modifications to training data must not change the semantic label of that data. This is especially important because an attacker may not control the labeling method of the victim and therefore cannot rely upon techniques like label flipping in order to induce poisoning. One previous work enforces this criterion by applying patches to adversarial examples, but the patches are clearly visible, even when they are not fully opaque, and the attack fails when patches are transparent enough to be unnoticeable (Turner et al., 2019; Schwarzschild et al., 2020). Another work, “Hidden Trigger Backdoor Attacks” enforces an $\ell _ { \infty }$ constraint on the entire perturbation (as is common in the adversarial attack literature), but this method is only effective on hand selected class pairs and only works in transfer learning scenarios where the pretrained victim model is both fixed and known to the attacker (Saha et al., 2019; Schwarzschild et al., 2020). Another clean label backdoor attack hides the trigger in training data via steganography (Li et al., 2019), however this attack also assumes access to the pretrained model that a victim will use to fine tune on poisoned data. Moreover, the latter attack uses triggers that cover the entire image, and these triggers cannot be chosen by the user.
|
| 40 |
+
|
| 41 |
+
In contrast to these existing methods, Sleeper Agent does not require knowledge of the victim model, the perturbations are not visible in poisoned training data, and poisons can be adapted to any patch.
|
| 42 |
+
|
| 43 |
+
# 3 METHOD
|
| 44 |
+
|
| 45 |
+
# 3.1 THREAT MODEL
|
| 46 |
+
|
| 47 |
+
We follow commonly used threat models used in the backdoor literature (Gu et al., 2017; Saha et al., 2019). We define two parties, the attacker and the victim. We assume that the attacker perturbs and disseminates data. As in Saha et al. (2019); Geiping et al. (2020), we assume the training data modifications are bounded in $\ell _ { \infty }$ norm. The victim then trains a model on data - a portion of which has been perturbed by the attacker. Once the victim’s model is trained and deployed, we also assume that the attacker can then apply a patch to select images at test time to trigger the backdoor attack.
|
| 48 |
+
|
| 49 |
+
However, we diverge from Gu et al. (2017); Saha et al. (2019) in our assumptions about the knowledge of the victim. We assume a far more strict threat model wherein the attacker does not have access to the parameters, architecture, or learning procedure of the victim. This represents a realistic scenario wherein a victim trains a randomly initialized deep network from scratch on scraped data.
|
| 50 |
+
|
| 51 |
+
# 3.2 PROBLEM SETUP
|
| 52 |
+
|
| 53 |
+
Formally, we aim to craft perturbations $\delta = \{ \delta _ { i } \} _ { i = 1 } ^ { N }$ to training data $\mathcal { T } = \{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { N }$ for a loss function, $\mathcal { L }$ , and a surrogate network, $F$ , with parameters $\theta$ that solve the following bilevel problem:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\begin{array} { r } { \underset { \delta \in \mathcal { C } } { \operatorname* { m i n } } \ \mathbb { E } _ { ( x , y ) \sim \mathcal { D } } \bigg [ \mathcal { L } \left( F ( x + p ; \theta ( \delta ) ) , y _ { t } \right) \bigg ] } \\ { \mathrm { s . t . } \ \theta ( \delta ) \in \underset { \theta } { \arg \operatorname* { m i n } } \displaystyle \sum _ { ( x _ { i } , y _ { i } ) \in \mathcal { T } } \mathcal { L } ( F ( x _ { i } + \delta _ { i } ; \theta ) , y _ { i } ) , } \end{array}
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where $p$ denotes the trigger, $y _ { t }$ denotes the intended target label of the attacker, and $\mathcal { C }$ denotes a set of constraints on the perturbations. Naive backdoor attacks often solve this bilevel problem by inserting $p$ directly into training data (belonging to class $y _ { t }$ ) so that the network learns to associate the trigger pattern with the desired class label. However, our threat model is more strict, which is reflected in our constraints on $\delta$ . We require that $\delta$ is bounded in $\ell _ { \infty }$ norm and that $\delta _ { i } = \mathbf { 0 }$ for all but a small fraction of indices, $i$ . WLOG, assume that the first $M \leq N$ perturbations are allowed to be nonzero. In the black-box scenario, the surrogate model, $F$ , may not resemble the victim, in terms of either architecture or training hyperparameters, and yet the attack is effective nonetheless.
|
| 60 |
+
|
| 61 |
+
We stress that unlike Saha et al. (2019), our primary area of interest is not transfer learning, but rather from-scratch training. This threat model results in a more complex optimization procedure - one where simpler objectives, like feature collision, have failed (Schwarzschild et al., 2020). Due to the inner optimization problem posed in Equation 2, directly computing optimal perturbations is intractable for deep networks as it would require differentiating through the training procedure of $F$ . Thus, heuristics must be used to optimize the poisons.
|
| 62 |
+
|
| 63 |
+
# 3.3 OUR APPROACH
|
| 64 |
+
|
| 65 |
+
Recently, several works have proposed solving bilevel problems for deep networks by utilizing gradient alignment. Gradient alignment modifies training data to align the training gradient with the gradient of some desired objective. It has proven useful for dataset condensation (Zhao et al., 2020), as well as integrity and availability poisoning attacks (Geiping et al., 2020; Fowl et al., 2021). Unlike other heuristics like partial unrolling of the computation graph or feature collision, gradient alignment has proven to be a stable way to solve a bilevel problem that involves training a deep network in the inner objective. However, poisoning approaches utilizing gradient alignment have often come with limitations, such as poor performance on multiple target images (Geiping et al., 2020), or strict requirements about poisoning an entire dataset (Fowl et al., 2021).
|
| 66 |
+
|
| 67 |
+
In contrast, we study the behaviour of a class of attacks capable of causing misclassification of a large proportion of unseen patched images of a selected class, all while modifying only a small fraction of training data. We first define the adversarial objective:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\mathcal { L } _ { a d v } = \mathbb { E } _ { ( x , y ) \sim \mathcal { D } _ { s } } \bigg [ \mathcal { L } \big ( F ( x + p ; \theta ) , y _ { t } \big ) \bigg ] ,
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $\mathcal { D } _ { s }$ denotes the source class distribution, $p$ is a patch that the attacker uses to trigger misclassification at test-time, and $y _ { t }$ is the intended target label. This objective is minimized when an image becomes misclassified into a desired class after the attacker’s patch is added to it. For example, an attacker may aim for a network to classify images of dogs correctly but to misclassify the same dog images as cats when a patch is added to the dog images.
|
| 74 |
+
|
| 75 |
+
To achieve this behavior, we perturb training data by optimizing the following alignment objective:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\mathcal { A } = 1 - \frac { \nabla _ { \theta } \mathcal { L } _ { t r a i n } \cdot \nabla _ { \theta } \mathcal { L } _ { a d v } } { \left| \left| \nabla _ { \theta } \mathcal { L } _ { t r a i n } \right| \right| \cdot \left| \left| \nabla _ { \theta } \mathcal { L } _ { a d v } \right| \right| } ,
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\nabla _ { \boldsymbol { \theta } } \mathcal { L } _ { t r a i n } = \frac { 1 } { M } \sum _ { i = 1 } ^ { M } \nabla _ { \boldsymbol { \theta } } \mathcal { L } \big ( F ( x _ { i } + \delta _ { i } ; \boldsymbol { \theta } ) , y _ { i } \big )
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
is the training gradient involving the nonzero perturbations. We then estimate the expectation in Equation 3 by calculating the average adversarial loss over $K$ training points from the source class:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\nabla _ { \theta } \mathcal { L } _ { a d v } = \frac { 1 } { K } \sum _ { ( x , y _ { s } ) \in \mathcal { T } } \nabla _ { \theta } \bigg ( \mathcal { L } \big ( F ( x + p ; \theta ) , y _ { t } \big ) \bigg )
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
In our most basic attack, we begin optimizing the objective in Equation 4 by fixing a parameter vector $\theta ^ { * }$ in order to calculate $\mathcal { A }$ . This parameter vector is trained on clean data and is used to calculate the training and adversarial gradients. We then optimize using 250 steps of signed Adam. Note that while this is not a general constraint for our method, we follow the setup in Saha et al. (2019) where all poisons are drawn from a single target class. That is to say, the $M$ poisons the attacker is allowed to perturb have the form $\{ ( x _ { i } , y _ { t } ) \} _ { i = 1 } ^ { \overline { { M } } }$ .
|
| 92 |
+
|
| 93 |
+
We also employ differentiable data augmentation which has shown to improve stability of poisons in Geiping et al. (2020). While gradient alignment proves more successful than other approaches to the bilevel problem, we additionally introduce two novel techniques that boost success by $> 2 5 0 \%$ :
|
| 94 |
+
|
| 95 |
+
Poison Selection: Our threat model assumes the attacker disseminates perturbed images online through avenues such as social media. With this in mind, the attacker can choose which images to perturb. For example, the attacker could choose images of dogs in which to “hide” the trigger. While random selection with our objective does successfully poison victims trained from scratch, we experiment with selection by gradient norm. Because we aim to align the training gradient with our adversarial objective, source images which have larger gradients could prove to be more potent poisons. We find that choosing source poison images by taking images with the maximum training gradient norm at the parameter vector $\theta ^ { * }$ noticeably improves poison performance (see Tables 3, 9).
|
| 96 |
+
|
| 97 |
+
Model Retraining: In the most straightforward version of our attack, the attacker optimizes the perturbations using fixed model parameters for a number of steps (usually 250). However, this may lead to perturbations overfitting to a clean-trained model; during a real attack a model is trained on poisoned data, but we optimize the poisons on a model that trained only with clean data. To close the gap, we introduce model retraining during the poison crafting procedure. After retraining our model on the perturbed data, we again take optimization steps on the perturbations, but this time evaluating the training and adversarial losses at the new parameter vector. We repeat this process of retraining/optimizing several times and find that this noticeably improves the success of the poisons - often boosting success by more than $2 0 \%$ (see Tables 3, 9).
|
| 98 |
+
|
| 99 |
+
# 4 EXPERIMENTS
|
| 100 |
+
|
| 101 |
+
In this section, we empirically test the proposed Sleeper Agent backdoor attack on multiple datasets, against black-box settings, using a benchmark, and against popular defenses.
|
| 102 |
+
|
| 103 |
+
Table 1: Baseline evaluations on CIFAR-10. Perturbations have $\ell _ { \infty }$ -norm bounded above by 16/255, and poison budget is $1 \%$ of training images. Each number denotes an average (and std. error) over 24 crafting and training runs along with randomly sampled source/target class pairs.
|
| 104 |
+
|
| 105 |
+
<table><tr><td>Architecture</td><td>ResNet-18</td><td>MobileNetV2</td><td>VGG11</td></tr><tr><td>Clean validation accuracy(%)</td><td>92.31 (±0.08)</td><td>88.19 (±0.05)</td><td>89.00 (±0.03)</td></tr><tr><td>Poison validation accuracy(%)</td><td>92.16 (±0.05)</td><td>88.03 (±0.05)</td><td>88.70 (±0.04)</td></tr><tr><td>Clean source accuracy(%)</td><td>92.36 (±0.93)</td><td>88.55 (±1.64)</td><td>90.62 (±1.23)</td></tr><tr><td>Poison source accuracy(%)</td><td>91.50 (±0.88)</td><td>87.79 (±1.60)</td><td>89.45 (±1.19)</td></tr><tr><td>Triggered source accuracy(%)</td><td>12.96 (±5.40)</td><td>21.09 (±5.41)</td><td>17.97 (±4.00)</td></tr><tr><td>Attack Success Rate(%)</td><td>85.27 (±5.90)</td><td>72.92 (±6.09)</td><td>75.15 (±5.40)</td></tr></table>
|
| 106 |
+
|
| 107 |
+
Table 2: The effect of poison budget. Experiments on CIFAR-10 with ResNet-18 models (He et al., 2016). Perturbations have $\ell _ { \infty } \mathrm { - n o r m } \le 1 6 / 2 5 5$ . Each number denotes an average (and std. error) over 32 crafting and training runs along with randomly sampled source/target class pairs.
|
| 108 |
+
|
| 109 |
+
<table><tr><td>Poison Budget</td><td>50 (0.1%)</td><td>100 (0.2%)</td><td>250 (0.5%)</td><td>400 (0.6%)</td><td>500 (1%)</td></tr><tr><td>Clean validation accuracy(%)</td><td>92.34 (±0.05)</td><td>92.36 (±0.04)</td><td>92.31 (±0.04)</td><td>92.15 (±0.08)</td><td>92.26 (±0.06)</td></tr><tr><td>Poison validation accuracy(%)</td><td>92.33 (±0.04)</td><td>92.34 (±0.05)</td><td>92.25 (±0.04)</td><td>92.12 (±0.06)</td><td>92.17 (±0.04)</td></tr><tr><td>Clean source accuracy(%)</td><td>93.01 (±0.69)</td><td>91.08 (±0.85)</td><td>92.43 (±0.74)</td><td>92.42 (±0.80)</td><td>92.14 (±0.78)</td></tr><tr><td>Poison source accuracy(%)</td><td>93.03 (±0.67)</td><td>90.61 (±0.86)</td><td>91.83 (±0.75)</td><td>91.88 (±0.79)</td><td>91.56 (±0.77)</td></tr><tr><td>Triggered source accuracy(%)</td><td>61.04 (±4.27)</td><td>40.07 (±5.72)</td><td>22.77 (±4.77)</td><td>15.88 (±4.91)</td><td>13.07 (±4.57)</td></tr><tr><td>Attack Success Rate(%)</td><td>24.71 (±4.10)</td><td>49.76 (±6.21)</td><td>72.48 (±5.24)</td><td>81.44 (±5.25)</td><td>85.11 (±5.04)</td></tr></table>
|
| 110 |
+
|
| 111 |
+
# 4.1 BASELINE EVALUATIONS
|
| 112 |
+
|
| 113 |
+
Typically, backdoor attacks are considered successful if poisoned models do not suffer from a significant drop in validation accuracy on images without triggers, but they reliably misclassify images from the source class into the target class when a trigger is applied. We begin by testing our method in the gray-box setting. In the gray-box setting, we use the same architecture but different random initialization for crafting poisons and testing. Table 1 depicts the performance of Sleeper Agent on CIFAR-10 when perturbing $1 \%$ of images in the training set with each perturbation constrained in an $\ell _ { \infty }$ -norm ball of radius 16/255. During poison crafting, the surrogate model undergoes four evenly spaced retraining periods $T = 4$ ), and we test the effectiveness of each surrogate model architecture at generating poisons for victim models of the same architecture. In subsequent sections, we will extend these experiments to the black-box setting and to an ensemblized attacker. We observe in these experiments that the poisoned models indeed achieve very similar validation accuracy to their clean counterparts, yet the application of triggers to source class images causes them to be misclassified into the target class as desired. In Table 2, we observe that Sleeper Agent can even be effective when the attacker is only able to poison a very small percentage of the training set. Note that the success of backdoor attacks depends greatly on the choice of source and target classes, especially since some classes contain very large objects which may dominate the image, even when a trigger is inserted. As a result, the variance of attack performance is high since we sample class pairs randomly. The poisoning and victim hyperparameters we use for our experiments can be found in Appendix A.
|
| 114 |
+
|
| 115 |
+
The benefits of ensembling: One simple way we can improve the transferability of our backdoor attack across initializations of the same architecture is to craft our poisons on an ensemble of multiple copies of the same architecture but trained using different initializations and different batch sampling during their training procedures. In Table 3, we observe that this ensembling strategy indeed can offer major performance boosts, both with and without retraining.
|
| 116 |
+
|
| 117 |
+
The black-box setting: Now that we have established the transferability of Sleeper Agent across models of the same architecture, we test on the hard black-box scenario where the victim’s architecture is completely unknown to the attacker. This setting has proven extremely challenging for existing methods (Schwarzschild et al., 2020). Table 4 contains four settings. In the first row, we simply craft the poisons on a single ResNet-18 and transfer these to other models. Second, we craft poisons on an ensemble consisting of two MobileNet-V2 and two ResNet-34 architectures and transfer to the remaining models. Third, for each architecture, we craft poisons with an ensemble consisting of the other two architectures and test on the remaining one. The second and third scenarios are ensemblized black-box attacks, and we see that Sleeper Agent is effective. In the last row, we perform the same experiment but with the testing model included in the ensemble, and we observe that a single ensemble can craft poisons that are extremely effective on a range of architectures. We choose ResNet-18, MobileNet-V2, and VGG11 as these are common and contain a wide array of structural diversity (He et al., 2016; Sandler et al., 2018; Simonyan & Zisserman, 2014).
|
| 118 |
+
|
| 119 |
+
Table 3: Ensembles consisting of copies of the same architecture (ResNet-18). $S$ denotes the size of the ensemble, and $T$ denotes the retraining factor. Experiments are conducted on CIFAR-10, perturbations have $\ell _ { \infty }$ -norm bounded by 16/255, and the attacker can poison $1 \%$ of training images.
|
| 120 |
+
|
| 121 |
+
<table><tr><td>Attack</td><td>Clean validation (%)</td><td>Poison validation (%)</td><td>Attack Success Rate (%)</td></tr><tr><td>Sleeper Agent (S = 1,T = 0)</td><td>92.36 (±0.05)</td><td>92.08 (±0.08)</td><td>63.49 (±6.13)</td></tr><tr><td>Sleeper Agent (S= 2,T=0)</td><td>92.10 (±0.04)</td><td>92.12 (±0.06)</td><td>64.70 (±5.65)</td></tr><tr><td>Sleeper Agent (S = 4,T= 0)</td><td>92.14 (±0.03)</td><td>91.98(±0.05)</td><td>74.81 (±4.10)</td></tr><tr><td>Sleeper Agent (S=2,T= 4)</td><td>92.11 (±0.07)</td><td>92.08 (±0.13)</td><td>87.40(±6.23)</td></tr><tr><td>Sleeper Agent (S=4,T=4)</td><td>92.17 (±0.03)</td><td>91.81 (±0.06)</td><td>88.45 (±6.00)</td></tr></table>
|
| 122 |
+
|
| 123 |
+
Table 4: Black-box attacks: First row: Attacks crafted on a single ResNet-18 and transferred. Second row: attacks crafted on MobileNet-V2 and ResNet-34 and transfered. Third row: attacks crafted on the remaining architectures excluding the victim. The ensemble used in the last row includes the victim architecture. Experiments are conducted on CIFAR-10 and perturbations have $\ell _ { \infty }$ -norm bounded above by 16/255, and the attacker can poison $1 \%$ of training images.
|
| 124 |
+
|
| 125 |
+
<table><tr><td>Attack</td><td>ResNet-18</td><td>MobileNet-V2</td><td>VGG11</td><td>Average</td></tr><tr><td>Sleeper Agent (S=1,T=4,ResNet-18)</td><td></td><td>29.10%</td><td>31.96%</td><td>29.86%</td></tr><tr><td>Sleeper Agent (S = 4,T= 0,MobileNet-V2,ResNet-34)</td><td>70.30%</td><td>一</td><td>46.48%</td><td>58.44%</td></tr><tr><td>Sleeper Agent (S= 4,T= 0, victim excluded)</td><td>63.11%</td><td>42.40%</td><td>55.28%</td><td>53.60%</td></tr><tr><td>Sleeper Agent (S= 6,T= O,victim included)</td><td>68.46%</td><td>67.28%</td><td>85.37%</td><td>73.30%</td></tr></table>
|
| 126 |
+
|
| 127 |
+
ImageNet evaluations: In addition to CIFAR-10, we perform experiments on ImageNet. Table 5 contains the performance of Sleeper Agent on ImageNet where attacks are crafted and tested on randomly initialized ResNet-18 models. Perturbations are constrained in an $\ell _ { \infty }$ -norm ball of radius 16/255 - a bound seen in prior poisoning works on ImageNet (Fowl et al., 2021; Geiping et al., 2020; Saha et al., 2019). We first study the effect of re-training during poison crafting. Even performing only two equally spaced re-training periods improves the success rate significantly. Additionally, we observe that our data selection technique allows Sleeper Agent to maintain a high success rate even with a lower poison budget. Figure 2 contains visualizations of the patched sources and the crafted targets. The poisoning and victim hyperparameters from experiments can be found in Appendix A. Further visualizations and additional experiments are presented in Appendices B and C.
|
| 128 |
+
|
| 129 |
+
# 4.2 COMPARISON TO OTHER METHODS
|
| 130 |
+
|
| 131 |
+
There are several existing clean-label hidden-trigger backdoor attacks that claim success in settings different than ours. In order to further demonstrate the success of our method, we compare our poisons to ones generated from these methods in our more strict threat model of from-scratch training. In these experiments, poisons are generated from our attack, clean label backdoor, and hidden trigger backdoor. All poison trials have the same randomly selected source-target class pairs, the same budget, and the same $\varepsilon$ -bound (Note: clean-label backdoor originally did not use $\ell _ { \infty }$ bounds, so we adjust the opacity of their perturbations to ensure the constraint is satisfied). We then train a randomly initialized network from scratch on these poisons and evaluate success over 1000 patched target images. We test three popular network architectures and find that our attack significantly outperforms both methods and is the only backdoor method to exceed single digit success rates, confirming the findings of Schwarzschild et al. (2020) on the fragility of these existing methods. See Table 6 for full results. Note that the difference in results between Table 1 and these results may arise from saving the poisoned images and loading them into this benchmark setup.
|
| 132 |
+
|
| 133 |
+
Table 5: ImageNet evaluations. Attacks are conducted on ResNet-18 models and perturbations have $\ell _ { \infty }$ -norm bounded above by 16/255. The high standard errors are due to the high variance of the sampling of source/target pairs, and limited number of runs to maintain computational feasibility.
|
| 134 |
+
|
| 135 |
+
<table><tr><td>Attack</td><td>Poison budget</td><td>Clean validation (%)</td><td>Poison validation (%)</td><td>Attack Success Rate (%)</td></tr><tr><td>Sleeper Agent (S=1,T=0)</td><td>0.05%</td><td>69.27 (±0.03)</td><td>67.87 (±0.03)</td><td>22.00 (±5.65)</td></tr><tr><td>Sleeper Agent (S=1,T=0)</td><td>0.10%</td><td>69.23 (±0.03)</td><td>67.80 (±0.04)</td><td>23.25 (±5.50)</td></tr><tr><td>Sleeper Agent (S=1,T=2)</td><td>0.05%</td><td>69.21 (±0.04)</td><td>67.84 (±0.10)</td><td>44.00(±6.73)</td></tr><tr><td>Sleeper Agent (S=1,T=2)</td><td>0.10%</td><td>69.14 (±0.03)</td><td>67.75 (±0.08)</td><td>41.00 (±14.45)</td></tr></table>
|
| 136 |
+
|
| 137 |
+
Table 6: Benchmark results on CIFAR-10. Comparison of our method to popular “clean-label” attacks. Results averaged over the same source/target pairs with $\epsilon = 1 6 / 2 5 5$ and poison budget $1 \%$ .
|
| 138 |
+
|
| 139 |
+
<table><tr><td>Attack</td><td>ResNet-18</td><td>MobileNetV2</td><td>VGG11</td><td>Average</td></tr><tr><td>Hidden-Trigger Backdoor (Saha et al.,2019)</td><td>3.50%</td><td>3.76%</td><td>5.02%</td><td>4.09%</td></tr><tr><td>Clean-Label Backdoor (Turner et al., 2019)</td><td>2.78%</td><td>3.50%</td><td>4.70%</td><td>3.66%</td></tr><tr><td>Sleeper Agent (Ours)</td><td>50.72%</td><td>58.21%</td><td>57.86%</td><td>55.59%</td></tr></table>
|
| 140 |
+
|
| 141 |
+
# 4.3 DEFENSES
|
| 142 |
+
|
| 143 |
+
A selling point for hidden trigger backdoor attacks is that the trigger that is used to induce misclassification at test-time is not present in any training data, thus making inspection based defenses, or automated pattern matching more difficult. However, there exist numerous defenses, aside from visual inspection, that have been proposed to mitigate the effects of poisoning - both backdoor and other attacks. We test our method against a number of popular defenses.
|
| 144 |
+
|
| 145 |
+
Spectral Signatures: This defense, proposed in Tran et al. (2018), aims to filter a pre-selected amount of training data based upon correlations with singular vectors of the feature covariance matrix. This defense was originally intended to detect triggers used in backdoor attacks.
|
| 146 |
+
|
| 147 |
+
Activation Clustering: Chen et al. (2018) cluster activation patterns to detect anomalous inputs.
|
| 148 |
+
Unlike the spectral signatures defense, this defense does not filter a pre-selected volume of data.
|
| 149 |
+
|
| 150 |
+
DPSGD: Poison defenses based on differentially private SGD (Abadi et al., 2016) have also been proposed (Hong et al., 2020). Differentially private learning inures models to small changes in training data, which provably imbues robustness to poisoned data.
|
| 151 |
+
|
| 152 |
+
Data Augmentations: Recent work has suggested that strong data augmentations, such as mixup, break data poisoning (Borgnia et al., 2021). This has been confirmed in recent benchmark tests which demonstrate many poisoning techniques are brittle to slight changes in victim training routine (Schwarzschild et al., 2020). We test against mixup augmentation (Zhang et al., 2017).
|
| 153 |
+
|
| 154 |
+
STRIP: Gao et al. (2019) propose to add strong perturbations by superimposing input images at test time to detect the backdoored inputs based on the entropy of the predicted class distribution. If the entropy is lower than a predefined threshold, the input is considered backdoored and is rejected.
|
| 155 |
+
|
| 156 |
+
NeuralCleanse: Wang et al. (2019) propose a defense designed for traditional backdoor attacks by reconstructing the maximally adversarial trigger used to backdoor a model. While this defense was not designed for hidden trigger backdoor attacks, we experiment with this as a detection defense wherein we test whether NeuralCleanse can detect the backdoored class. This modification is denoted by NeuralCleanse\*. In our trials, NeuralCleanse\* does not detect any of the backdoored classes - as determined by taking the maximum mask MAD (see Wang et al. (2019)).
|
| 157 |
+
|
| 158 |
+
We find that across the board, all of these defenses exhibit a robustness-accuracy trade-off. Many of these defenses do not reliably nullify the attack, and defenses that do degrade attack success also induce such a large drop in validation accuracy that they are unattractive options for practitioners. For example, to lower the attack success to an average of $1 3 . 1 4 \%$ , training with DPSGD degrades natural accuracy on CIFAR-10 to $7 0 \%$ . See Table 7 for the complete results of these experiments.
|
| 159 |
+
|
| 160 |
+
# 4.4 SLEEPER AGENT CAN POISON IMAGES IN ANY CLASS
|
| 161 |
+
|
| 162 |
+
Typical backdoor attacks which rely on label flips or feature collisions can only function when poisons come from the source and/or target classes (Saha et al., 2019; Turner et al., 2019). This restriction may be a serious limitation in practice. In contrast, we show that Sleeper Agent can be
|
| 163 |
+
|
| 164 |
+
Table 7: Defenses. Experiments are conducted on CIFAR-10 with ResNet-18 models, perturbations have $\ell _ { \infty }$ -norm bounded above by 16/255, and poison budget is $1 \%$ of training images.
|
| 165 |
+
|
| 166 |
+
<table><tr><td>Defense</td><td>Attack Success Rate (%)</td><td>Clean Validation Accuracy (%)</td></tr><tr><td>Spectral Signatures</td><td>37.17 (±10.10)</td><td>89.94 (±0.19)</td></tr><tr><td>Activation Clustering</td><td>15.17 (±5.38)</td><td>72.38 (±0.48)</td></tr><tr><td>DPSGD</td><td>13.14 (±4.49)</td><td>70.00 (±0.17)</td></tr><tr><td>Data Augmentation</td><td>69.75 (±10.77)</td><td>91.32 (±0.12)</td></tr><tr><td>STRIP</td><td>62.68 (±4.90)</td><td>92.23 (±0.05)</td></tr><tr><td>NeuralCleanse*</td><td>53.20 (±10.49)</td><td>91.92 (±0.12)</td></tr></table>
|
| 167 |
+
|
| 168 |
+
effective even when we poison images drawn from all classes. To take advantage of our data selection strategy, we select poisons with maximum gradient norm across all classes. Table 8 contains the performance of Sleeper Agent in the aforementioned setting.
|
| 169 |
+
|
| 170 |
+
Table 8: Random poisons. Experiments are conducted on CIFAR-10 with ResNet-18 models. Perturbations have $\ell _ { \infty }$ -norm bounded above by $1 6 / 2 5 5$ and poisons are drawn from all classes. Each number denotes an average (and standard error) over 16 independent crafting and training runs along with randomly sampled source/target class pairs.
|
| 171 |
+
|
| 172 |
+
<table><tr><td>Attack</td><td>Poison budget</td><td>Attack Success Rate (%)</td></tr><tr><td>Sleeper Agent (S = 1,T= 4)</td><td>1%</td><td>41.90 (±7.16)</td></tr><tr><td>Sleeper Agent (S=1,T= 4)</td><td>3%</td><td>66.51 (±6.90)</td></tr></table>
|
| 173 |
+
|
| 174 |
+
# 4.5 ABLATION STUDIES
|
| 175 |
+
|
| 176 |
+
Here we analyze the importance of each technique in our algorithm via ablation studies. We focus on three aspects of our method: 1) patch location, 2) retraining during poison crafting, 3) poison selection. Table 9 details several combinations and their effects on poison success. We find that randomizing patch location improves poisoning success, and both retraining and data selection based on maximum gradient significantly improve poison performance. Combining all three boosts poison success more than four-fold. See Section 3.3 for a description of these techniques. Additional experiments and more ablation studies can be found in the Appendix C.
|
| 177 |
+
|
| 178 |
+
Table 9: Ablation studies. Investigation the effects of random patch-location, retraining, and data selection. Experiments are conducted on CIFAR-10 with ResNet-18 models, perturbations have $\ell _ { \infty }$ -norm bounded above by 16/255, and poison budget is $1 \%$ of training images.
|
| 179 |
+
|
| 180 |
+
<table><tr><td>Attack Setup</td><td>Attack Success Rate (%)</td></tr><tr><td>Fix patch-location (bottom-right corner)</td><td>19.25 (±3.01)</td></tr><tr><td>Random patch-location</td><td>33.95 (±4.57)</td></tr><tr><td>Randompatch-location+retraining</td><td>59.42 (±5.78)</td></tr><tr><td>Randompatch-location+ data selection</td><td>63.49 (±6.13)</td></tr><tr><td>Random patch-location + retraining + data selection</td><td>85.27 (±5.90)</td></tr></table>
|
| 181 |
+
|
| 182 |
+
# 5 CONCLUSION
|
| 183 |
+
|
| 184 |
+
In this work, we develop the first hidden-trigger backdoor attack that is effective against deep networks trained from scratch. This is a challenging setting for backdoor attacks, and existing attacks typically operate in less strict settings. Nonetheless, we choose the strict setting because practitioners often train networks from scratch in real-world applications, and patched poisons may be easily visible upon human inspection. In order to accomplish the above goal, we use a gradient matching objective as a surrogate for the bilevel optimization problem, and we add features such as re-training and data selection in order to significantly enhance the performance of our method, Sleeper Agent.
|
| 185 |
+
|
| 186 |
+
# REPRODUCIBILITY STATEMENT
|
| 187 |
+
|
| 188 |
+
Our full implementation and instructions needed to reproduce the experimental results are included in the supplementary materials, and we explain the training details, models, hyperparameters, and computational resources in Appendix A.
|
| 189 |
+
|
| 190 |
+
# ETHICS STATEMENT
|
| 191 |
+
|
| 192 |
+
In this work, we illuminate a new scalable backdoor attack that could be used to stealthily compromise security-critical systems. We hope that by highlighting the potential danger of this nefarious threat model, our work will give rise to stronger defenses and will encourage caution on the part of practitioners.
|
| 193 |
+
|
| 194 |
+
# REFERENCES
|
| 195 |
+
|
| 196 |
+
Martin Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In Proceedings of the 2016 ACM SIGSAC conference on computer and communications security, pp. 308–318, 2016.
|
| 197 |
+
|
| 198 |
+
Eugene Bagdasaryan, Andreas Veit, Yiqing Hua, Deborah Estrin, and Vitaly Shmatikov. How to backdoor federated learning. In International Conference on Artificial Intelligence and Statistics, pp. 2938–2948. PMLR, 2020.
|
| 199 |
+
|
| 200 |
+
Battista Biggio, Blaine Nelson, and Pavel Laskov. Poisoning attacks against support vector machines. arXiv preprint arXiv:1206.6389, 2012.
|
| 201 |
+
|
| 202 |
+
Eitan Borgnia, Jonas Geiping, Valeriia Cherepanova, Liam Fowl, Arjun Gupta, Amin Ghiasi, Furong Huang, Micah Goldblum, and Tom Goldstein. Dp-instahide: Provably defusing poisoning and backdoor attacks with differentially private data augmentations. arXiv preprint arXiv:2103.02079, 2021.
|
| 203 |
+
|
| 204 |
+
Bryant Chen, Wilka Carvalho, Nathalie Baracaldo, Heiko Ludwig, Benjamin Edwards, Taesung Lee, Ian Molloy, and Biplav Srivastava. Detecting backdoor attacks on deep neural networks by activation clustering. arXiv preprint arXiv:1811.03728, 2018.
|
| 205 |
+
|
| 206 |
+
Xinyun Chen, Chang Liu, Bo Li, Kimberly Lu, and Dawn Song. Targeted backdoor attacks on deep learning systems using data poisoning. arXiv preprint arXiv:1712.05526, 2017.
|
| 207 |
+
|
| 208 |
+
Ji Feng, Qi-Zhi Cai, and Zhi-Hua Zhou. Learning to confuse: generating training time adversarial data with auto-encoder. arXiv preprint arXiv:1905.09027, 2019.
|
| 209 |
+
|
| 210 |
+
Liam Fowl, Ping-yeh Chiang, Micah Goldblum, Jonas Geiping, Arpit Bansal, Wojtek Czaja, and Tom Goldstein. Preventing unauthorized use of proprietary data: Poisoning for secure dataset release. arXiv preprint arXiv:2103.02683, 2021.
|
| 211 |
+
|
| 212 |
+
Yansong Gao, Change Xu, Derui Wang, Shiping Chen, Damith C Ranasinghe, and Surya Nepal. Strip: A defence against trojan attacks on deep neural networks. In Proceedings of the 35th Annual Computer Security Applications Conference, pp. 113–125, 2019.
|
| 213 |
+
|
| 214 |
+
Jonas Geiping, Liam Fowl, W Ronny Huang, Wojciech Czaja, Gavin Taylor, Michael Moeller, and Tom Goldstein. Witches’ brew: Industrial scale data poisoning via gradient matching. arXiv preprint arXiv:2009.02276, 2020.
|
| 215 |
+
|
| 216 |
+
Micah Goldblum, Dimitris Tsipras, Chulin Xie, Xinyun Chen, Avi Schwarzschild, Dawn Song, Aleksander Madry, Bo Li, and Tom Goldstein. Data security for machine learning: Data poisoning, backdoor attacks, and defenses. arXiv preprint arXiv:2012.10544, 2020.
|
| 217 |
+
|
| 218 |
+
Tianyu Gu, Brendan Dolan-Gavitt, and Siddharth Garg. Badnets: Identifying vulnerabilities in the machine learning model supply chain. arXiv preprint arXiv:1708.06733, 2017.
|
| 219 |
+
|
| 220 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
|
| 221 |
+
|
| 222 |
+
Sanghyun Hong, Varun Chandrasekaran, Yigitcan Kaya, Tudor Dumitras¸, and Nicolas Papernot. ˘ On the effectiveness of mitigating data poisoning attacks with gradient shaping. arXiv preprint arXiv:2002.11497, 2020.
|
| 223 |
+
|
| 224 |
+
Hanxun Huang, Xingjun Ma, Sarah Monazam Erfani, James Bailey, and Yisen Wang. Unlearnable examples: Making personal data unexploitable. arXiv preprint arXiv:2101.04898, 2021.
|
| 225 |
+
|
| 226 |
+
W Ronny Huang, Jonas Geiping, Liam Fowl, Gavin Taylor, and Tom Goldstein. Metapoison: Practical general-purpose clean-label data poisoning. arXiv preprint arXiv:2004.00225, 2020.
|
| 227 |
+
|
| 228 |
+
Shaofeng Li, Benjamin Zi Hao Zhao, Jiahao Yu, Minhui Xue, Dali Kaafar, and Haojin Zhu. Invisible backdoor attacks against deep neural networks. arXiv preprint arXiv:1909.02742, 2019.
|
| 229 |
+
|
| 230 |
+
Shaofeng Li, Minhui Xue, Benjamin Zhao, Haojin Zhu, and Xinpeng Zhang. Invisible backdoor attacks on deep neural networks via steganography and regularization. IEEE Transactions on Dependable and Secure Computing, 2020.
|
| 231 |
+
|
| 232 |
+
Luis Munoz-Gonz ˜ alez, Battista Biggio, Ambra Demontis, Andrea Paudice, Vasin Wongrassamee, ´ Emil C. Lupu, and Fabio Roli. Towards Poisoning of Deep Learning Algorithms with Backgradient Optimization. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, AISec ’17, pp. 27–38, New York, NY, USA, 2017. ACM. ISBN 978-1-4503-5202-4. doi: 10.1145/3128572.3140451.
|
| 233 |
+
|
| 234 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211–252, 2015.
|
| 235 |
+
|
| 236 |
+
Aniruddha Saha, Akshayvarun Subramanya, and Hamed Pirsiavash. Hidden trigger backdoor attacks. arXiv preprint arXiv:1910.00033, 2019.
|
| 237 |
+
|
| 238 |
+
Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. Mobilenetv2: Inverted residuals and linear bottlenecks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4510–4520, 2018.
|
| 239 |
+
|
| 240 |
+
Avi Schwarzschild, Micah Goldblum, Arjun Gupta, John P Dickerson, and Tom Goldstein. Just how toxic is data poisoning? a unified benchmark for backdoor and data poisoning attacks. arXiv preprint arXiv:2006.12557, 2020.
|
| 241 |
+
|
| 242 |
+
Ali Shafahi, W Ronny Huang, Mahyar Najibi, Octavian Suciu, Christoph Studer, Tudor Dumitras, and Tom Goldstein. Poison frogs! targeted clean-label poisoning attacks on neural networks. arXiv preprint arXiv:1804.00792, 2018.
|
| 243 |
+
|
| 244 |
+
Juncheng Shen, Xiaolei Zhu, and De Ma. Tensorclog: An imperceptible poisoning attack on deep neural network applications. IEEE Access, 7:41498–41506, 2019.
|
| 245 |
+
|
| 246 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 247 |
+
|
| 248 |
+
Jacob Steinhardt, Pang Wei W Koh, and Percy S Liang. Certified Defenses for Data Poisoning Attacks. In Advances in Neural Information Processing Systems 30, pp. 3517–3529. Curran Associates, Inc., 2017.
|
| 249 |
+
|
| 250 |
+
Brandon Tran, Jerry Li, and Aleksander Madry. Spectral signatures in backdoor attacks. arXiv preprint arXiv:1811.00636, 2018.
|
| 251 |
+
|
| 252 |
+
Alexander Turner, Dimitris Tsipras, and Aleksander Madry. Label-consistent backdoor attacks. arXiv preprint arXiv:1912.02771, 2019.
|
| 253 |
+
|
| 254 |
+
Bolun Wang, Yuanshun Yao, Shawn Shan, Huiying Li, Bimal Viswanath, Haitao Zheng, and Ben Y Zhao. Neural cleanse: Identifying and mitigating backdoor attacks in neural networks. In 2019 IEEE Symposium on Security and Privacy (SP), pp. 707–723. IEEE, 2019.
|
| 255 |
+
|
| 256 |
+
Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017.
|
| 257 |
+
|
| 258 |
+
Bo Zhao, Konda Reddy Mopuri, and Hakan Bilen. Dataset condensation with gradient matching. arXiv preprint arXiv:2006.05929, 2020.
|
| 259 |
+
|
| 260 |
+
Chen Zhu, W Ronny Huang, Hengduo Li, Gavin Taylor, Christoph Studer, and Tom Goldstein. Transferable clean-label poisoning attacks on deep neural nets. In International Conference on Machine Learning, pp. 7614–7623. PMLR, 2019.
|
| 261 |
+
|
| 262 |
+
# APPENDIX
|
| 263 |
+
|
| 264 |
+
# A IMPLEMENTATION DETAILS
|
| 265 |
+
|
| 266 |
+
The most challenging setting for evaluating a backdoor attack involves training a model from scratch. It is crucial to compute the average attack success rate on all patched source images in the validation set to evaluate effectiveness reliably. Following the discussion above, for all experiments, we select random source-target pairs. During training, we add our patch to all images from the source class in the training set. To compute the attack success rate, followed by Geiping et al. (2020), we measure the average rate at which patched source images are successfully classified as the target class. To be consistent and to provide a fair comparison to Saha et al. (2019), we use a random patch selected from Saha et al. (2019). Our choice of patch size in the baseline experiments is the same as Saha et al. (2019), which is, $8 \times 8$ for CIFAR-10 $6 . 2 5 \%$ of the pixels) and $3 0 \times 3 0$ for the ImageNet $( 1 . 7 9 \%$ of the pixels). Figure 3 (right) shows the patch we utilize in all of our experiments. Note that the choice of the patch in our implementation is not essential. To show this, we conduct the same baseline evaluation discussed in 4.1 using a random patch generated using a Bernoulli distribution. From table 10, we observe that the choice of the patch does not affect Sleeper Agent’s success rate.
|
| 267 |
+
|
| 268 |
+

|
| 269 |
+
Figure 3: Sample random patch (left) and HTBD patch (right)
|
| 270 |
+
|
| 271 |
+
Table 10: Baseline evaluations using random patches on CIFAR-10. Perturbations have $\ell _ { \infty }$ -norm bounded above by 16/255, and poison budget is $1 \%$ of training images. Each number denotes an average (and standard error) over 24 independent crafting and training runs along with randomly sampled source/target class pairs. Each run has a unique patch generated randomly. Figure 3 (left) shows a sample random patch we use for the experiments presented in this table.
|
| 272 |
+
|
| 273 |
+
<table><tr><td>Architecture</td><td>ResNet-18</td></tr><tr><td>Clean validation accuracy(%)</td><td>92.16 (±0.08)</td></tr><tr><td>Poison validation accuracy(%)</td><td>92.00 (±0.07)</td></tr><tr><td>Clean source accuracy(%)</td><td>92.55 (±0.98)</td></tr><tr><td>Poison source accuracy(%)</td><td>91.77 (±1.09)</td></tr><tr><td>Triggered source accuracy(%)</td><td>14.86 (±5.06)</td></tr><tr><td>Attack Success Rate(%)</td><td>82.05 (±5.80)</td></tr></table>
|
| 274 |
+
|
| 275 |
+
# A.1 MODELS AND HYPERPARAMETERS
|
| 276 |
+
|
| 277 |
+
For our evaluations we use ResNet-18, ResNet-34, MobileNet-v2, and VGG11 (He et al., 2016; Sandler et al., 2018; Simonyan & Zisserman, 2014). For training ResNet-18 and ResNet-34, we use initial learning rate 0.1, and for MobileNet-v2 and VGG11, we use initial learning rate 0.01. We schedule learning rate drops at epochs 14, 24, and 35 by a factor of 0.1. For all models, we employ SGD with Nesterov momentum, and we set the momentum coefficient to 0.9. We use batches of 128 images and weight decay with a coefficient of $4 \times 1 0 ^ { - 4 }$ . For all CIFAR-10 experiments, we train and retrain for 40 epochs, and for validation, we train the re-initialized model for 80 epochs. For the ImageNet experiments, we employ pre-trained models from torchvision to start crafting, and for retraining and validation, we apply a similar procedure explained: training for 80 epochs for both retraining and validation while we schedule learning rate drops at epochs 30, 50, and 70 by a factor of 0.1. To incorporate data augmentation, for CIFAR-10, we apply horizontal flips with probability 0.5 and random crops of size $3 2 \times 3 2$ with zero-padding of 4. And for the ImageNet, we use the following data augmentations: 1) resize to $2 5 6 \times 2 5 6 , 2$ ) central crop of size $2 2 4 \times 2 2 4$ , 3) horizontal flip with probability 0.5, 4) random crops of size $2 2 4 \times 2 2 4$ with zero-padding of 28. Our complete implementation code is attached.
|
| 278 |
+
|
| 279 |
+

|
| 280 |
+
Figure 4: Average poisoning time for various Sleeper Agent setups. All experiments are conducted on CIFAR-10 with ResNet-18 models. Perturbations have $\ell _ { \infty }$ -norm bounded above by 16/255, and the poison budget is $1 \%$ of training images.
|
| 281 |
+
|
| 282 |
+
# A.2 RUNTIME COST
|
| 283 |
+
|
| 284 |
+
We use two NVIDIA GEFORCE RTX 2080 Ti GPUs for baseline evaluations on CIFAR-10 and four of the aforementioned GPUs for ImageNet baseline evaluations. Figure 4 shows the time cost of the Sleeper Agent with different settings.
|
| 285 |
+
|
| 286 |
+
# B VISUALIZATIONS
|
| 287 |
+
|
| 288 |
+
In this section, we present more triggered source and poisoned targets drawn from the ImageNet dataset. Figures 5 and 6 show patched sources and poisoned targets generated by Sleeper Agent. We observe that the generated perturbed images and their corresponding clean images are hardly distinguishable by the human eye.
|
| 289 |
+
|
| 290 |
+
# C ADDITIONAL EXPERIMENTS
|
| 291 |
+
|
| 292 |
+
In this section, we present additional experiments.
|
| 293 |
+
|
| 294 |
+
# C.1 PATCH SIZE
|
| 295 |
+
|
| 296 |
+
To further investigate the effect of patch size on the attack success rate, we perform the baseline evaluation discussed in 4.1 using different patch sizes. From Table 11, we observe that by poisoning only $0 . 0 5 \%$ of the training set and using a larger patch, we can effectively poison ImageNet. Furthermore, by using a proper amount of perturbation, Sleeper Agent works well with the smaller patches. Visualizations of patched sources using patch size of $4 5 \times 4 5$ are shown in Figure 6.
|
| 297 |
+
|
| 298 |
+
# C.2 ARCHITECTURE
|
| 299 |
+
|
| 300 |
+
Our experiments show that Sleeper Agent works well on other architectures. To explore this, we conduct our ImageNet baseline experiments on MobileNet-v2. Table 12 depicts the performance of Sleeper Agent on MobileNet-v2 when perturbing $0 . 0 5 \%$ of images in the ImageNet training set with each perturbation constrained in an $\ell _ { \infty }$ -norm ball of radius 16/255.
|
| 301 |
+
|
| 302 |
+

|
| 303 |
+
Figure 5: Sample clean source (first column), patched source (second column), clean target (third column), and poisoned target (fourth column) from the ImageNet dataset. Perturbations have $\ell _ { \infty }$ - norm bounded above by 16/255, and the patch size is $3 0 \times 3 0$ .
|
| 304 |
+
|
| 305 |
+

|
| 306 |
+
Figure 6: Sample clean source (first column), patched source (second column), clean target (third column), and poisoned target (fourth column) from the ImageNet dataset. Perturbations have $\ell _ { \infty }$ - norm bounded above by 16/255, and the patch size is $4 5 \times 4 5$ .
|
| 307 |
+
|
| 308 |
+
Table 11: The effect of patch size. Experiments are conducted on CIFAR-10 and ImageNet datasets with ResNet-18 models.
|
| 309 |
+
|
| 310 |
+
<table><tr><td>Attack</td><td>Dataset</td><td>Poison budget</td><td>Patch size</td><td>loo-norm</td><td>Attack Success Rate (%)</td></tr><tr><td>Sleeper Agent (S = 1,T = 4)</td><td>CIFAR-10</td><td>1%</td><td>6×6</td><td>20/255</td><td>64.78</td></tr><tr><td>Sleeper Agent (S = 1, T= 4)</td><td>CIFAR-10</td><td>1%</td><td>8×8</td><td>16/255</td><td>85.27</td></tr><tr><td>Sleeper Agent (S=1,T=2)</td><td>ImageNet</td><td>0.05%</td><td>25×25</td><td>16/255</td><td>38.00</td></tr><tr><td>Sleeper Agent (S=1,T=2)</td><td>ImageNet</td><td>0.05%</td><td>25×25</td><td>24/255</td><td>52.00</td></tr><tr><td>Sleeper Agent (S=1,T=2)</td><td>ImageNet</td><td>0.05%</td><td>30×30</td><td>16/255</td><td>44.00</td></tr><tr><td>Sleeper Agent (S =1,T= 2)</td><td>ImageNet</td><td>0.05%</td><td>45×45</td><td>16/255</td><td>50.50</td></tr></table>
|
| 311 |
+
|
| 312 |
+
Table 12: ImageNet evaluations on MobileNet-v2. Perturbations have $\ell _ { \infty }$ -norm bounded above by 16/255, and the patch size is $3 0 \times 3 0$ .
|
| 313 |
+
|
| 314 |
+
<table><tr><td>Attack</td><td>Poison budget</td><td></td><td>Patch sizeAttack Success Rate (%)</td></tr><tr><td>Sleeper Agent (S=1, T=2)</td><td>0.05%</td><td>30</td><td>41.00</td></tr></table>
|
| 315 |
+
|
| 316 |
+
# C.3 RETRAINING FACTOR
|
| 317 |
+
|
| 318 |
+
Table 13 shows the effect of the retraining factor on the attack success rate on the CIFAR-10 dataset. As can be observed from the table, for $T$ larger than 4, we do not see a considerable improvement in the attack success rate. Since increasing $T$ is costly, we choose $T = 4$ as it simultaneously gives us a high success rate and is also significantly faster than $T = 6$ and $T = 8$ . We observe that even with $T = 4$ , the attack success rate is above $9 5 \%$ in most trials.
|
| 319 |
+
|
| 320 |
+
Table 13: Ablation studies. Investigation of the effects of retraining factor $T$ . Experiments are conducted on CIFAR-10 with ResNet-18 models, perturbations have $\ell _ { \infty }$ -norm bounded above by 16/255, and the poison budget is $1 \%$ of the training images.
|
| 321 |
+
|
| 322 |
+
<table><tr><td>Retraining factor</td><td>T= 2</td><td>T=4</td><td>T=6</td><td>T=8</td></tr><tr><td>Attack Success Rate (%)</td><td>70.66 (±6.66)</td><td>84.64 (±6.64)</td><td>84.95 (±6.42)</td><td>86.48 (±6.26)</td></tr></table>
|
md/dev/BqxE86ufTzq/BqxE86ufTzq.md
ADDED
|
@@ -0,0 +1,416 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GRADIENT ESTIMATION FOR UNSEEN DOMAIN RISK MINIMIZATION WITH PRE-TRAINED MODELS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Domain generalization aims to build generalized models that perform well on unseen domains when only source domains are available for model optimization. Recent studies have demonstrated that large-scale pre-trained models could play an important role in domain generalization by providing their generalization power. However, large-scale pre-trained models are not fully equipped with target task-specific knowledge due to a discrepancy between the pre-training objective and the target task. Although the task-specific knowledge could be learned from source domains by fine-tuning, this hurts the generalization power of the pretrained models because of gradient bias toward the source domains. To address this issue, we propose a new domain generalization method that estimates unobservable gradients that reduce potential risks in unseen domains, using a largescale pre-trained model. Our proposed method allows the pre-trained model to learn task-specific knowledge further while preserving its generalization ability with the estimated gradients. Experimental results show that our proposed method outperforms baseline methods on DOMAINBED, a standard benchmark in domain generalization. We also provide extensive analyses to demonstrate that the estimated unobserved gradients relieve the gradient bias, and the pre-trained model learns the task-specific knowledge without sacrificing its generalization power.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Many machine learning studies assume that training and test data are independent and identically distributed (i.i.d). However, this i.i.d assumption does not always hold in real-world scenarios where distribution shifts between training and test data occur frequently. Thus, traditional machine learning models often show poor performance on unseen domains shifted from source (training) domains (Quinonero-Candela et al., 2008; Torralba & Efros, 2011). To tackle this problem, domain generalization has attracted much attention recently.
|
| 12 |
+
|
| 13 |
+
The main goal of domain generalization is to build generalized models that also perform the target task (e.g., classification) well on unseen domains (e.g., painted images) when only source domains (e.g., realistic images) are accessible during model optimization. Early domain generalization studies (Muandet et al., 2013; Ganin et al., 2016; Li et al., 2018b) have focused on learning domaininvariant representations across the source domains. However, Gulrajani & Lopez-Paz (2021) have recently shown that simple empirical risk minimization (ERM) (Vapnik, 1999) outperforms the previous methods on DOMAINBED, a benchmark for domain generalization, with pre-trained ResNet50 (He et al., 2016). Moreover, Yu et al. (2021) provide empirical evidence that large-scale pretrained models could play an important role in domain generalization by providing their generalization power.
|
| 14 |
+
|
| 15 |
+
Motivated by this, several studies have begun to leverage the generalization power of large-scale pre-trained models. Cha et al. (2022) employ a pre-trained model for regularization, considering it as an approximation of the oracle model on any domain, and Li et al. (2022) utilize a frozen pre-trained model as a feature extractor. These studies have proven the usefulness of pre-trained models in domain generalization. However, the pre-trained models used in those studies cannot learn task-specific knowledge further since they are frozen during model optimization to preserve their generalization ability. To learn the task-specific knowledge, one can choose fine-tuning that updates all the parameters of pre-trained models by optimizing the models on the source domains.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: (a): model optimization is influenced by the gradient $\mathbf { g }$ biased toward the source domains, neglecting the unobservable gradient $\mathbf { g } _ { u }$ that could minimize risks in the unseen domains. (b): Gradient “conflicts” (Yu et al., 2020; Mansilla et al., 2021) between $\mathbf { g }$ and $\mathbf { g } _ { u }$ (i.e., $\mathbf { g } \cdot \mathbf { g } _ { u } < 0 )$ constantly occur throughout the whole fine-tuning iterations due to the gradient bias. Our proposed method reduces the number of gradient conflicts by adding the estimated unobservable gradient $\tilde { \bf g } _ { u }$ to the biased gradient g. This observation indicates that the gradient bias is relieved with the estimated gradient during model optimization. The more details are described in $\ S \ 3 . 4$ .
|
| 19 |
+
|
| 20 |
+
However, Kumar et al. (2022) demonstrate that fine-tuning distorts generalized representations of the pre-trained models. Namely, fine-tuning hurts the generalization ability of pre-trained models.
|
| 21 |
+
|
| 22 |
+
In this paper, we interpret the above issue in terms of gradient bias during model optimization. As shown in Figure 1a, the gradient of naive fine-tuning is biased toward the source domains because it is computed by only the source domains, disregarding unseen domains. Although this biased gradient reduces empirical risks in the source domains with the learning of task-specific knowledge, it probably increases risks in the unseen domains. We argue that the gradient bias would be relieved if gradients that lower the risks in the unseen domains are observable.
|
| 23 |
+
|
| 24 |
+
To this end, we propose a new domain generalization method, called GESTUR, which estimates the unobservable gradients with a large-scale pre-trained model. GESTUR consists of two key components: a task expert (TE) and a generalization expert (GE). Based on ERM where gradients tend to be biased to the source domains, TE learns task-specific knowledge from source domains directly to transfer the knowledge to GE. Meanwhile, GE learns the task-specific knowledge from TE indirectly via exponential moving average (EMA) while preserving the generalization ability of a large-scale pre-trained model. Still, the gradient bias of TE might impair the generalization ability of GE. To mitigate this, GE is utilized to estimate the unobservable gradient that minimizes risks in unseen domains for TE based on the assumption that large-scale pre-trained models could act as a loose approximation of the oracle model of unseen domains $( \ S \ 2 )$ . As shown in Figure 1b, the biased gradient of TE is relieved by simply adding the estimated unobservable gradient to the biased gradient, improving domain generalization performance $( \ S \ 3 )$ . Extensive experiments and analyses demonstrate that GESTUR outperforms baseline methods by learning the task-specific knowledge appropriately from source domains while preserving the generalization ability of large-scale pretrained models.
|
| 25 |
+
|
| 26 |
+
Contributions: (1) We propose a simple yet effective domain generalization method that learns task-specific knowledge while preserving the generalization ability of large-scale pre-trained models. Our proposed method estimates the unobservable gradients that reduce potential risks in unseen domains to relieve the gradient bias toward source domains, based on the two experts, TE and GE. (2) We conduct extensive experiments to show the effectiveness of our proposed method in domain generalization. By providing careful analyses, we demonstrate that the unobservable gradients could be estimated with a large-scale pre-trained model, and it relieves the gradient bias. We also demonstrate that our proposed method learns task-specific knowledge without sacrificing the generalization ability of the large-scale pre-trained model.
|
| 27 |
+
|
| 28 |
+
# 2 METHODOLOGY
|
| 29 |
+
|
| 30 |
+
# 2.1 PRELIMINARIES
|
| 31 |
+
|
| 32 |
+
Problem formulation. Let $\mathcal { D } _ { s }$ and $\mathcal { D } _ { u }$ be sets of source domains and unseen domains, respectively. Each domain $\mathcal { D }$ contains the total number of $n _ { D }$ data samples, $\{ ( x _ { i } , y _ { i } ) \} _ { i = 1 } ^ { n _ { \mathcal { D } } } \sim \mathcal { D }$ , where each data sample $( x _ { i } , y _ { i } )$ consists of an input $x _ { i }$ and its target label $y _ { i }$ . The $n _ { D }$ data samples are i.i.d over some probability distribution. The main goal of domain generalization is to build a model $\theta$ that performs well on the unseen domains $\mathcal { D } _ { u }$ when the source domains $\mathcal { D } _ { s }$ are only available:
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
\operatorname* { m i n } _ { \theta } \mathbb { E } _ { \mathcal { D } \sim \mathcal { D } _ { u } } \mathbb { E } _ { ( { x , y } ) \sim \mathcal { D } } [ \ell ( ( { x , y } ) ; { \theta } ) ] ,
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
where $\ell ( ( x , y ) ; \theta )$ is the loss function defined for the model $\theta$ on the data sample $( x , y )$ . Note that this study focuses on solving classification tasks. Hence, we denote the model in detail as $\theta = \{ \theta ^ { f } ; \theta ^ { c } \}$ consisting of its feature extractor $\theta ^ { f }$ and classifier $\theta ^ { c }$ .
|
| 39 |
+
|
| 40 |
+
Motivation. With success in many downstream tasks, it has become a convention to initialize the feature extractor $\theta ^ { f }$ with a large-scale pre-trained model. Although pre-trained models provide better feature representations than randomly initialized parameters, they do not fully equip taskspecific knowledge yet. It is because there is a discrepancy between the pre-training objective and the target task. For example, CLIP (Radford et al., 2021) is pre-trained to match web-crawled imagecaption pairs, whereas the target task is to classify data into seven classes (e.g., horse and dog), in the case of PACS (Li et al., 2017). Therefore, many studies have adopted fine-tuning that updates all the parameters of the feature extractor $\theta ^ { f }$ to learn the task-specific knowledge by optimizing the model on source domains $\mathcal { D } _ { s }$ . However, Kumar et al. (2022) observe that fine-tuning impairs generalization ability of pre-trained models during the learning of task-specific knowledge.
|
| 41 |
+
|
| 42 |
+
We try to interpret this issue at the gradient level. Based on ERM (Vapnik, 1999), the gradient $\mathbf { g }$ of fine-tuning is computed for the model $\theta$ on the source domains $\mathcal { D } _ { s }$ , as follows:
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\mathbf { g } = \nabla _ { \boldsymbol { \theta } } \mathbb { E } _ { ( \boldsymbol { x } , \boldsymbol { y } ) \sim \boldsymbol { B } } [ \ell ( ( \boldsymbol { x } , \boldsymbol { y } ) ; \boldsymbol { \theta } ) ] ,
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
where $\boldsymbol { B }$ is a mini-batch sampled from the source domains $\mathcal { D } _ { s }$ . The gradient $\mathbf { g }$ is influenced by only the source domains $\mathcal { D } _ { s }$ because the unseen domains $\mathcal { D } _ { u }$ are not accessible. Namely, the gradient is biased toward the source domains. We presume that this gradient bias degrades generalization performance in the unseen domains.
|
| 49 |
+
|
| 50 |
+
# 2.2 GESTUR: GRDIENT ESTIMATION FOR UNSEEN DOMAIN RISK MINIMIZATION WITH PRE-TRAINED MODELS
|
| 51 |
+
|
| 52 |
+
We hypothesize that the gradient bias mentioned above could be relieved if the unobservable gradient $\mathbf { g } _ { u }$ minimizing risks in the unseen domains is computable. To achieve this, we borrow the assumption of Cha et al. (2022) that large-scale pre-trained models are the approximation of the oracle model $\theta ^ { * }$ which is optimally generalized for any domain $\mathcal { D }$ . Since the unobservable gradient $\mathbf { g } _ { u }$ cannot be computed from the unseen domains $\mathcal { D } _ { u }$ directly, we consider the direction from the current model $\theta$ to the oracle model $\theta ^ { * }$ as the unobservable gradient $\mathbf { g } _ { u }$ . However, the oracle model is inaccessible in practice. Hence, we estimate the unobservable gradient using a large-scale pre-trained model as the approximation of the oracle model.
|
| 53 |
+
|
| 54 |
+
Note that we aim to estimate the unobservable gradient $\mathbf { g } _ { u }$ for the unseen domains $\mathcal { D } _ { u }$ to alleviate the gradient bias, so the above assumption needs to be more elaborate due to the following reasons. First, we intend to design the unobservable gradient for the unseen domains only rather than any domain. Second, pre-trained models do not have task-specific knowledge yet, as described in $\ S \ : 2 . 1$ . Therefore, we slightly modify the assumption as follows: pre-trained models are the loose approximation of the oracle model $\theta _ { u } ^ { * }$ of the unseen domains $\mathcal { D } _ { u }$ , and they could get closer to the oracle model by learning task-specific knowledge. Based on this assumption, we propose a simple yet effective domain generalization method, GESTUR, which estimates the unobservable gradient $\mathbf { g } _ { u }$ for unseen domain risk minimization with a large-scale pre-trained model.
|
| 55 |
+
|
| 56 |
+
Task expert and generalization expert. GESTUR consists of two classification models: a task expert (TE, $\theta _ { \mathrm { T E } } \mathrm { ~ , ~ }$ ) and a generalization expert (GE, $\theta _ { \mathrm { G E } } \mathrm { . }$ ), which are complementary to each other.
|
| 57 |
+
|
| 58 |
+
Their feature extractors are both initialized with a large-scale pre-trained model $\theta _ { 0 }$ , respectively. TE learns task-specific knowledge from the source domains $\mathcal { D } _ { s }$ directly to transfer the knowledge to GE. Meanwhile, GE also learns task-specific knowledge from TE via EMA, but it preserves the generalization ability of the pre-trained model deliberately. Here, the gradient bias of TE might hurt the generalization ability of GE because the knowledge of TE is injected into GE. To relieve the gradient bias, GE is used to estimate the unobservable gradient $\mathbf { g } _ { u }$ as the loose approximation of the oracle model $\theta _ { u } ^ { * }$ for the unseen domains $\mathcal { D } _ { u }$ . Our proposed GESTUR is summarized in Algorithm 1.
|
| 59 |
+
|
| 60 |
+
Gradient estimation. Using Equation 2, the gradient $\mathbf { g }$ for TE is computed as $\mathbf { g } = \nabla _ { \boldsymbol { \theta } } \mathbb { E } _ { ( \boldsymbol { x } , \boldsymbol { y } ) \sim \boldsymbol { B } } [ \ell ( ( \boldsymbol { x } , \boldsymbol { y } ) ; \boldsymbol { \theta } _ { \mathrm { T E } } ) ]$ while learning task-specific knowledge. The gradient $\mathbf { g }$ is biased toward the source domains $\mathcal { D } _ { s }$ . A gradient that minimizes risks in the unseen domains could relieve the gradient bias, but it is unobservable. When we have access to the oracle model $\theta _ { u } ^ { * }$ of the unseen domains $\mathcal { D } _ { u }$ , we can direct the current model to head to the oracle model instead of empirically calculating the unobservable gradient from the unseen domains. Hence, we treat the direction from the current model $\theta _ { \mathrm { T E } }$ to the oracle model $\theta _ { u } ^ { * }$ as the unobservable gradient $\mathbf { g } _ { u }$ :
|
| 61 |
+
|
| 62 |
+
# Algorithm 1 GESTUR
|
| 63 |
+
|
| 64 |
+
1: Input: task expert $\theta _ { \mathrm { T E } }$ , generalization expert $\theta _ { \mathrm { G E } }$ , gradient scale factor $\lambda$ , and moving average coefficient $m$ .
|
| 65 |
+
2: Init: initialize the feature extractors $\theta _ { \mathrm { T E } } ^ { f }$ and $\theta _ { \mathrm { G E } } ^ { f }$ with a pre-trained model $\theta _ { 0 }$ and randomly initialize the classifiers $\theta _ { \mathrm { T E } } ^ { c }$ and $\theta _ { \mathrm { G E } } ^ { c }$ .
|
| 66 |
+
3: Output: the updated generalization expert $\theta _ { \mathrm { G E } }$
|
| 67 |
+
4: for sampled mini-batch $\boldsymbol { B }$ from the source domains $\mathcal { D } _ { s }$ do
|
| 68 |
+
5: $\begin{array} { r l } & { \mathbf { g } \stackrel { } { = } \nabla _ { \theta } \mathbb { E } _ { ( x , y ) \sim \mathcal { B } } [ \ell ( ( x , y ) ; \theta _ { \mathrm { T E } } ) ] } \\ & { \tilde { \mathbf { g } } _ { u } ^ { f } = \theta _ { \mathrm { G E } } ^ { f } - \theta _ { \mathrm { T E } } ^ { f } } \\ & { \tilde { \mathbf { g } } _ { u } ^ { f } = \lambda \| \mathbf { g } ^ { f } \| _ { 2 } \cdot \frac { \tilde { \mathbf { g } } _ { u } ^ { f } } { \| \tilde { \mathbf { g } } _ { u } ^ { f } \| _ { 2 } } } \\ & { \mathbf { g } ^ { f } = ( \mathbf { g } ^ { f } + \tilde { \mathbf { g } } _ { u } ^ { f } ) / 2 } \end{array}$
|
| 69 |
+
6:
|
| 70 |
+
7:
|
| 71 |
+
8:
|
| 72 |
+
9: update $\theta _ { \mathrm { T E } } ^ { f }$ with $\mathbf { g } ^ { f }$ and update $\theta _ { \mathrm { T E } } ^ { c }$ with $\mathbf { g } ^ { c }$
|
| 73 |
+
10: update $\theta _ { \mathrm { G E } } = m \theta _ { \mathrm { G E } } + ( 1 - m ) \theta _ { \mathrm { T E } }$
|
| 74 |
+
11: end for
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\mathbf { g } _ { u } = \boldsymbol { \theta } _ { u } ^ { * } - \boldsymbol { \theta } _ { \mathrm { T E } } .
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
In fact, it is infeasible to access the oracle model. Thus, we estimate the unobservable gradient using GE that approximates the oracle model loosely, as follows:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\begin{array} { r } { \tilde { \mathbf { g } } _ { u } = \theta _ { \mathrm { G E } } - \theta _ { \mathrm { T E } } . } \end{array}
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
This estimated gradient $\tilde { \bf g } _ { u }$ is used to relieve the gradient bias during the parameter optimization.
|
| 87 |
+
|
| 88 |
+
Parameter optimization. We want to emphasize again that GESTUR leverages the generalization power of large-scale pre-trained models to relieve the gradient bias which distorts the generalized feature representations of the feature extractor $\theta ^ { f }$ . Hence, we limit the scope of usage of the estimated unobservable gradient $\tilde { \bf g } _ { u }$ only to the feature extractor $\theta ^ { f }$ , not the classifier $\theta ^ { c }$ .
|
| 89 |
+
|
| 90 |
+
For TE, the estimated gradient $\tilde { \mathbf { g } } _ { u } ^ { f }$ for the feature extractor $\theta _ { \mathrm { T E } } ^ { f }$ is added to the biased gradient $\mathbf { g } ^ { f }$ for the same feature extractor, as follows:
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
\mathbf { g } ^ { f } = \frac { 1 } { 2 } \Big ( \mathbf { g } ^ { f } + \lambda \| \mathbf { g } ^ { f } \| _ { 2 } \cdot \frac { \tilde { \mathbf { g } } _ { u } ^ { f } } { \| \tilde { \mathbf { g } } _ { u } ^ { f } \| _ { 2 } } \Big ) ,
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
where $\lambda$ is a gradient scale factor that controls the influence of the normalized $\tilde { \mathbf { g } } _ { u } ^ { f }$ . The feature extractor $\theta _ { \mathrm { T E } } ^ { f }$ is updated with the gradient $\mathbf { g } ^ { f }$ adjusted by $\tilde { \mathbf { g } } _ { u } ^ { f }$ . On the other hand, the classifier $\theta _ { \mathrm { T E } } ^ { c }$ of TE is updated with its original gradient $\mathbf { g } ^ { c }$ .
|
| 97 |
+
|
| 98 |
+
As our assumption, GE can get closer to the oracle model $\theta ^ { * }$ by learning task-specific knowledge. However, the generalization ability of GE decreases when we optimize GE on the source domains $\mathcal { D } _ { s }$ directly to learn the task-specific knowledge. Therefore, we inject the learned task-specific knowledge of TE into GE delicately via EMA:
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\theta _ { \mathrm { G E } } = m \theta _ { \mathrm { G E } } + ( 1 - m ) \theta _ { \mathrm { T E } } ,
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
where $m$ is the moving average coefficient. By encouraging the parameters of GE to change slowly, EMA is helpful in preserving the generalization ability of GE. Since the goal of domain generalization is to build a model that minimizes the risk of the unseen domains, we choose GE, designed to approximate the oracle model of the domains, as our final model $\theta$ .
|
| 105 |
+
|
| 106 |
+
Table 1: Evaluation results $( \% )$ on the five datasets with the three different pre-trained models.
|
| 107 |
+
|
| 108 |
+
<table><tr><td>Method</td><td>PACS</td><td>VLCS</td><td>OfficeHome</td><td>TerraInc</td><td>DomainNet</td><td>Avg.</td></tr><tr><td colspan="7">Using ResNet-50 pre-trained on ImageNet.</td></tr><tr><td>ERM SagNet</td><td>84.2 ±0.1 86.3 ±0.2</td><td>77.3 ±0.1</td><td>67.6 ±0.2</td><td>47.8 ±0.6</td><td>44.0 ±0.1</td><td>64.2</td></tr><tr><td>SelfReg</td><td>85.6 ±0.4</td><td>77.8 ±0.5 77.8 ±0.9</td><td>68.1 ±0.1 67.9 ±0.7</td><td>48.6 ±1.0 47.0 ±0.3</td><td>40.3 ±0.1 42.8 ±0.0</td><td>64.2 64.2</td></tr><tr><td>CORAL</td><td>86.2 ±0.3</td><td>78.8 ±0.6</td><td>68.7 ±0.3</td><td>47.6 ±1.0</td><td>41.5 ±0.1</td><td>64.5</td></tr><tr><td>mDSDI</td><td>86.2 ±0.2</td><td>79.0 ±0.3</td><td>69.2 ±0.4</td><td>48.1 ±1.4</td><td>42.8 ±0.1</td><td>65.1</td></tr><tr><td>GVRT</td><td>85.1 ±0.3</td><td>79.0 ±0.2</td><td></td><td></td><td></td><td>65.2</td></tr><tr><td>MIRO</td><td>85.4 ±0.4</td><td></td><td>70.1 ±0.1</td><td>48.0 ±1.4</td><td>44.1 ±0.1</td><td>65.9</td></tr><tr><td>SMA</td><td></td><td>79.0 ±0.0</td><td>70.5 ±0.4</td><td>50.4 ±1.1</td><td>44.3 ±0.2</td><td></td></tr><tr><td>SWAD</td><td>87.5 ±0.2</td><td>78.2 ±0.2</td><td>70.6 ±0.1</td><td>50.3 ±0.5</td><td>46.0 ±0.1</td><td>66.5</td></tr><tr><td>GESTUR</td><td>88.1 ±0.1</td><td>79.1 ±0.1</td><td>70.6 ±0.2</td><td>50.0 ±0.3</td><td>46.5 ±0.1</td><td>66.9</td></tr><tr><td></td><td>88.0 ±0.2</td><td>80.1 ±0.2</td><td>71.1 ±0.0</td><td>51.3 ±0.2</td><td>46.3 ±0.1</td><td>67.4</td></tr><tr><td colspan="7">Using ViT-B/16 with CLIP.</td></tr><tr><td>ERM</td><td>83.4 ±0.5</td><td>75.9 ±1.3</td><td>66.4 ±0.5</td><td>35.3 ±0.8</td><td>44.4 ±0.6</td><td>61.1</td></tr><tr><td>SWAD</td><td>91.3 ±0.1</td><td>79.4 ±0.4</td><td>76.9 ±0.1</td><td>45.4 ±0.5</td><td>51.7 ±0.8</td><td>68.9</td></tr><tr><td>MIRO</td><td>95.6 ±0.8</td><td>82.2 ±0.3</td><td>82.5 ±0.1</td><td>54.3 ±0.4</td><td>54.0 ±0.3</td><td>73.7</td></tr><tr><td>GESTUR</td><td>96.0 ±0.0</td><td>82.8 ±0.1</td><td>84.2 ±0.1</td><td>55.7 ±0.2</td><td>58.9 ±0.1</td><td>75.5</td></tr><tr><td colspan="7">Using RegNetY-16GF with SWAG.</td></tr><tr><td>ERM</td><td>89.6 ±0.4</td><td>78.6 ±0.3</td><td>71.9 ±0.6</td><td>51.4 ±1.8</td><td>48.5 ±0.6</td><td>68.0</td></tr><tr><td>SWAD</td><td>94.7 ±0.2</td><td>79.7 ±0.2</td><td>80.0 ±0.1</td><td>57.9 ±0.7</td><td>53.6 ±0.6</td><td>73.2</td></tr><tr><td>MIRO</td><td>97.4 ±0.2</td><td>79.9 ±0.6</td><td>80.4 ±0.2</td><td>58.9 ±1.3</td><td>53.8 ±0.1</td><td>74.1</td></tr><tr><td>SMA</td><td>95.5 ±0.0</td><td>80.7 ±0.1</td><td>82.0 ±0.0</td><td>59.7 ±0.0</td><td>60.0 ±0.0</td><td>75.6</td></tr><tr><td>GESTUR</td><td>96.9 ±0.1</td><td>83.5 ±0.1</td><td>83.1 ±0.0</td><td>61.1 ±0.4</td><td>60.1 ±0.0</td><td>76.9</td></tr></table>
|
| 109 |
+
|
| 110 |
+
# 3 EXPERIMENTS
|
| 111 |
+
|
| 112 |
+
# 3.1 EXPERIMENTAL SETUP
|
| 113 |
+
|
| 114 |
+
Datasets. We conduct experiments using five popular domain generalization benchmark datasets: PACS (Li et al., 2017) (4 domains & 7 classes), VLCS (Fang et al., 2013) (4 domains & 5 classes), OfficeHome (Venkateswara et al., 2017) (4 domains & 65 classes), TerraIncognita (Beery et al., 2018) (4 domains & 10 classes), and DomainNet (Peng et al., 2019) (6 domains & 345 classes).
|
| 115 |
+
|
| 116 |
+
Pre-trained models. GESTUR heavily relies on pre-trained models. Therefore, we employ three pre-trained models of different sizes to verify that the proposed method performs well with various pre-trained models generally: ResNet-50 (He et al., 2016) pre-trained on ImageNet (Deng et al., 2009) (RN50), ViT-B/16 (Dosovitskiy et al., 2021) with CLIP (Radford et al., 2021) (CLIP), and RegNetY-16GF (Radosavovic et al., 2020) with SWAG (Singh et al., 2022) (SWAG).
|
| 117 |
+
|
| 118 |
+
Evaluation protocol. We adopt the experimental protocol of DOMAINBED, which enforces fair and realistic evaluations (e.g., same model selection criterion) across competitors. We divide the data from each domain into $80 \%$ and $20 \%$ splits and follow training-domain validation set strategy for the model selection and the hyperparameter search in every experiment. We also repeat every experiment three times to reduce the randomness in dataset splits and parameter initialization, similar to Gulrajani & Lopez-Paz (2021), and report the mean and standard error of the experimental results.
|
| 119 |
+
|
| 120 |
+
Implementation details. Our implementation is built on the codebase of Cha et al. (2022). We use Adam optimizer (Kingma & Ba, 2015) for parameter optimization. GESTUR has two hyperparameters, the gradient scale factor $( \lambda )$ and the moving average coefficient $( m )$ . In every experiment, we search the optimal $\lambda$ from $\{ 0 . 0 1 , 0 . 0 5 , 0 . 1 , 0 . 5 \}$ and fix $m$ as 0.999. Other hyperparameters such as learning rate, weight decay, and dropout are searched in the same way as Cha et al. (2022). We explain more details of implementation in Appendix A.
|
| 121 |
+
|
| 122 |
+
Table 2: Evaluation results $( \% )$ on the four datasets with the three different pre-trained models. We separate the cases where GESTUR uses TE and GE as the final model, respectively.
|
| 123 |
+
|
| 124 |
+
<table><tr><td>Method</td><td>PACS</td><td>VLCS</td><td>OfficeHome</td><td>TerraInc|Avg.</td><td></td></tr><tr><td colspan="6">Using ResNet-50 pre-trained on ImageNet.</td></tr><tr><td>ERM</td><td>84.2 ±0.1</td><td>77.3 ±0.1</td><td>67.6±0.2</td><td>47.8 ±0.6</td><td>69.2</td></tr><tr><td>GESTUR w/ TE</td><td>84.9 ±0.1</td><td>79.2 ±0.5</td><td>66.3 ±0.2</td><td>45.6 ±1.3</td><td>69.0</td></tr><tr><td>GESTUR w/ GE</td><td>88.0 ±0.2</td><td>80.1 ±0.2</td><td>71.1 ±0.0</td><td>51.3 ±0.2</td><td>72.6</td></tr><tr><td colspan="6">Using ViT-B/16with CLIP.</td></tr><tr><td>ERM</td><td>83.4 ±0.5</td><td>75.9 ±1.3</td><td>66.4 ±0.5</td><td>35.3±0.8</td><td>65.3</td></tr><tr><td>GESTUR w/ TE</td><td>90.7 ±0.9</td><td>82.4 ±0.4</td><td>76.9 ±0.5</td><td>50.4 ±0.2</td><td>75.1</td></tr><tr><td>GESTUR w/ GE</td><td>96.0 ±0.1</td><td>82.8 ±0.1</td><td>84.2 ±0.1</td><td>55.7 ±0.2</td><td>79.7</td></tr><tr><td colspan="6">Using RegNetY-16GF with SWAG.</td></tr><tr><td>ERM</td><td>89.6 ±0.4</td><td>78.6 ±0.3</td><td>71.9 ±0.6</td><td>51.4 ±1.8</td><td>72.9</td></tr><tr><td>GESTUR w/ TE</td><td>94.8±0.5</td><td>82.5 ±0.4</td><td>77.7 ±0.2</td><td>54.7 ±2.0</td><td>77.4</td></tr><tr><td>GESTUR w/GE</td><td>96.9 ±0.1</td><td>83.5 ±0.1</td><td>83.1 ±0.0</td><td>61.1 ±0.4</td><td>81.2</td></tr></table>
|
| 125 |
+
|
| 126 |
+
Baselines. We exhaustively compare our proposed method with various baseline methods in the experiment. For simplicity, we report only the experimental results of baseline methods that show the higher performance than ERM (Vapnik, 1999), the simplest baseline method. We describe the baseline methods and report the full version of the results in Appendix B.1.
|
| 127 |
+
|
| 128 |
+
# 3.2 MAIN RESULTS
|
| 129 |
+
|
| 130 |
+
Results on RN50. The first part of Table 1 shows the experimental results where RN50 is used to initialize the feature extractor. GESTUR achieves the best performance for all the datasets except DomainNet. In detail, the proposed method outperforms ERM by an average of $3 . 2 \% p$ . Furthermore, our proposed method improves the runner-up by: $1 . 0 \% p$ in VLCS, $0 . 5 \% p$ in OfficeHome, and $1 . 3 \% p$ in TerraIncognita. Especially, the proposed method outperforms the state-of-the-art method (SWAD (Cha et al., 2021)) by an average of $0 . 5 \% p$ .
|
| 131 |
+
|
| 132 |
+
Results on CLIP and SWAG. In the second and third parts of Table 1, we show the experimental results where the larger pre-trained models, CLIP and SWAG, are used to initialize the feature extractor, respectively. In summary, GESTUR achieves the best performance in all the datasets. In detail, the proposed method outperforms MIRO that also leverages generalization power of large-scale pretrained models by $1 . 8 \% p$ and $2 . 8 \% p$ on CLIP and SWAG, respectively. From this, we verify that the proposed method successfully leverages the generalization ability of pre-trained models compared to other baseline methods. Interestingly, we observe that the performance gap between the proposed method and ERM increases as the size of the pre-trained model increases.
|
| 133 |
+
|
| 134 |
+
# 3.3 COMPARISON BETWEEN THE TASK EXPERT AND THE GENERALIZATION EXPERT
|
| 135 |
+
|
| 136 |
+
Setup. GESTUR consists of two essential components: the task expert (TE) and the generalization expert (GE). In this paper, we use GE as the final model based on the assumption that GE is set as the approximation of the oracle model of unseen domains. Nevertheless, TE is also designed to preserve the generalization ability of pre-trained models since it also considers the estimated unobservable gradient in every update to relieve its gradient bias. Therefore, we compare the performance of ERM, GESTUR w/ GE, and its variant GESTUR w/ TE based on the hyperparameters searched in $\ S 3 . 2$ to show that they preserve the generalization ability of large-scale pre-trained models.
|
| 137 |
+
|
| 138 |
+
Results. As shown in Table 2, GESTUR w/ GE achieves the best performance in all experiments. Also, GESTUR w/ TE outperforms ERM by averages of $9 . 8 \% p$ and $4 . 5 \% p$ when using CLIP and SWAG, respectively. The performance of GESTUR w/ TE is higher when the larger pre-trained models are given, similar to the observation in $\ S \ 3 . 2$ . These observations demonstrate that GESTUR w/
|
| 139 |
+
|
| 140 |
+
TE could preserve the generalization ability of the pre-trained models with the estimated unobservable gradient, i.e., the gradient bias of TE is relieved. Moreover, GESTUR w/ GE shows a higher performance than GESTUR w/ TE, which indicates that EMA ensures the model preserves generalization ability during the learning of task-specific knowledge stable. From these, we reaffirm the justification for our choice of GE as the final model.
|
| 141 |
+
|
| 142 |
+
# 3.4 COMPARISON WITH ERM IN TERMS OF GRADIENT BIAS
|
| 143 |
+
|
| 144 |
+
Setup. As described in $\ S \ O 1$ , we suspect that the gradient bias degrades the domain generalization performance. We further conduct analysis to check how much gradient bias occurs during the fine-tuning and how much gradient bias is alleviated by our proposed method. To quantify the gradient bias, we borrow the concept of gradient conflict (Yu et al., 2020; Mansilla et al., 2021): there is a conflict between two gradients $\mathbf { g } _ { i }$ and $\mathbf { g } _ { j }$ if $\mathbf { g } _ { i } \cdot \mathbf { g } _ { j } < 0$ . For every iteration, we first sample two mini-batches from both source domains and an unseen domain, respectively. We then compute losses of the mini-batches, and calculate gradients $\mathbf { g }$ and $\mathbf { g } _ { u }$ from the losses, respectively. Finally, we count the
|
| 145 |
+
|
| 146 |
+
Table 3: The percentage $( \% )$ of gradient conflicts between $\mathbf { g }$ and $\mathbf { g } _ { u }$ to the whole training iterations.
|
| 147 |
+
|
| 148 |
+
<table><tr><td>Method</td><td>PACS</td><td>VLCS</td><td>OH</td><td>TI</td><td>Avg.</td></tr><tr><td colspan="6">Using ResNet-50 pre-trained on l ImageNet.</td></tr><tr><td>ERM GESTUR</td><td>28.6 26.2</td><td>37.3 29.8</td><td>20.3 21.0</td><td>35.4 30.7</td><td>30.4 26.9</td></tr><tr><td colspan="6">Using ViT-B/16 with ( CLIP.</td></tr><tr><td>ERM</td><td>35.3</td><td>43.1</td><td>33.4</td><td>42.6</td><td>38.6</td></tr><tr><td>GESTUR</td><td>28.7</td><td>37.4</td><td>25.0</td><td>30.8</td><td>30.5</td></tr><tr><td colspan="6">Using RegNetY-16GF with SWAG.</td></tr><tr><td>ERM</td><td>31.7</td><td>39.7</td><td>30.0</td><td>37.5</td><td>34.7</td></tr><tr><td>GESTUR</td><td>24.5</td><td>34.8</td><td>16.5</td><td>23.7</td><td>24.9</td></tr></table>
|
| 149 |
+
|
| 150 |
+
number of iterations where the gradient conflict $( { \bf g } \cdot { \bf g } _ { u } < 0 )$ ) occurs, for ERM and GESTUR. Here, we update the model using only the gradient $\mathbf { g }$ since unseen domains are inaccessible in practice.
|
| 151 |
+
|
| 152 |
+
Results. As shown in Table 3, GESTUR reduces the gradient conflicts of ERM by around $1 1 . 5 \%$ , $21 \%$ , and $2 8 . 2 \%$ for the pre-trained models, respectively. From this, we verify that our proposed method relieves gradient bias by estimating unobservable gradients with the pre-trained model. We observe that gradient conflicts occur more often in GESTUR than ERM on only the experimental setup (OfficeHome w/ RN50), which is consistent with the performance in Table 2 where ERM outperforms GESTUR w/ TE. This observation indicates that the domain generalization performance is affected by the gradient bias represented as the gradient conflicts in this analysis. Additional analysis on the similarity of the true and estimated unobservable gradients is provided in Appendix C.3.
|
| 153 |
+
|
| 154 |
+
# 3.5 TASK-SPECIFIC KNOWLEDGE LEARNED BY THE GENERALIZATION EXPERT
|
| 155 |
+
|
| 156 |
+
Table 4: Linear probing performance $( \% )$ with the two different pre-trained feature extractors: frozen pre-trained model $\theta _ { 0 }$ and the feature extractor $\theta _ { \mathrm { G E } } ^ { f }$ of GE.
|
| 157 |
+
|
| 158 |
+
<table><tr><td>Model</td><td>PACS</td><td>VLCS</td><td>OfficeHome</td><td>TerraInc|Avg.</td><td></td></tr><tr><td colspan="6">Using ViT-B/16 with CLIP.</td></tr><tr><td>frozen</td><td>98.5 ±0.1</td><td>88.5 ±0.2</td><td>89.3 ±0.1</td><td>83.4 ±0.2</td><td>89.9</td></tr><tr><td>GE</td><td>98.7 ±0.1</td><td>90.0 ±0.6</td><td>89.4 ±0.3</td><td>88.3 ±0.1</td><td>91.6</td></tr><tr><td colspan="6">Using RegNetY-16GF with SWAG.</td></tr><tr><td>frozen</td><td>98.9 ±0.1</td><td>87.1 ±0.2</td><td>89.6±0.0</td><td>89.3 ±0.0</td><td>91.2</td></tr><tr><td>GE</td><td>98.7 ±0.1</td><td>88.8 ±0.2</td><td>90.1 ±0.2</td><td>90.2 ±0.1</td><td>92.0</td></tr></table>
|
| 159 |
+
|
| 160 |
+
Setup. We conduct additional experiments to show that the feature extractor $\theta _ { \mathrm { G E } } ^ { f }$ of GE learns taskspecific knowledge successfully. Linear probing that updates parameters of only the classifier while freezing those of the feature extractor is common practice for assessing representation quality. We assume that the more task-specific knowledge the feature extractor learns, the better linear probing performance it exhibits in unseen domains targeting the same task. In detail, we first train GE on source domains and then evaluate linear probing performance on an unseen domain with the trained feature extractor of GE. We compare it with the case that a frozen pre-trained model is used as the feature extractor. For linear probing, we simply train a logistic regression classifier on the output feature representations of each feature extractor using the unseen domain only. Note that, in this analysis, we use CLIP and SWAG which are pre-trained with objectives significantly different from the target task to demonstrate the effectiveness of the newly learned task-specific knowledge clearly.
|
| 161 |
+
|
| 162 |
+
Results. As shown in Table 4, GE outperforms frozen in all benchmark datasets except the one case where the two models reach the near $9 9 \%$ performance. This shows that GE is learning task-specific knowledge further during training, which makes it a better approximation of the oracle model. The result supports our claim that pre-trained models are not fully equipped with target task-specific knowledge, and injecting the knowledge further increases performance.
|
| 163 |
+
|
| 164 |
+
# 3.6 RELATIONSHIP BETWEEN $\lambda$ AND THE SIZE OF THE PRE-TRAINED MODEL
|
| 165 |
+
|
| 166 |
+
Table 5: Evaluation results $( \% )$ on PACS with the three different pre-trained models varying $\lambda$
|
| 167 |
+
|
| 168 |
+
<table><tr><td rowspan="2">Dataset (size)</td><td rowspan="2"> Pre-training</td><td rowspan="2"> Architecture</td><td colspan="4">入</td></tr><tr><td>0.01</td><td>0.05</td><td>0.1</td><td>0.5</td></tr><tr><td>ImageNet (1.3M)</td><td>ERM</td><td>ResNet-50</td><td>88.0 ±0.2</td><td>86.0 ±0.2</td><td>82.1 ±0.2</td><td>73.4 ±0.4</td></tr><tr><td>CLIP (400M)</td><td>CLIP</td><td>ViT-B/16</td><td>94.8±0.2</td><td>96.0±0.0</td><td>96.2 ±0.1</td><td>96.0 ±0.0</td></tr><tr><td>Instagram (3.6B)</td><td>SWAG</td><td>RegNetY-16GF</td><td>96.3 ±0.2</td><td>96.9 ±0.1</td><td>97.6 ±0.1</td><td>97.9 ±0.1</td></tr></table>
|
| 169 |
+
|
| 170 |
+
Setup. Our proposed GESTUR controls the scale of the estimated unobservable gradients that reduce risks in unseen domains using the gradient scale factor $\lambda$ . To verify the effect of the scale factor, we observe the performance change varying the scale factor.
|
| 171 |
+
|
| 172 |
+
Results. In Table 5, RN50 achieves the best performance with $\lambda = 0 . 0 1$ . On the other hand, the larger pre-trained models, CLIP and SWAG achieve the best performance with the relatively larger $\lambda = 0 . 1$ and $\lambda = 0 . 5$ , respectively. We summarize more results on other datasets (i.e., VLCS, OfficeHome, and TerraIncognita) in Appendix C.1, and they show the similar pattern as in PACS.
|
| 173 |
+
|
| 174 |
+
Intuitively, the larger pre-trained models act as a better approximation of the oracle model than the small one because they are likely to encounter various domains from the huge web-crawled datasets during pre-training. They help to estimate unobservable gradients more accurately. The larger gradient scale factor, gradients $\mathbf { g }$ of TE is more affected by the estimated unobservable gradients $\tilde { \bf g } _ { u }$ while optimizing the model on source domains. From this, we can conclude that the larger scale factor improves the generalization performance when larger pre-trained models are given.
|
| 175 |
+
|
| 176 |
+
# 4 RELATED WORK
|
| 177 |
+
|
| 178 |
+
# 4.1 DOMAIN GENERALIZATION
|
| 179 |
+
|
| 180 |
+
Domain alignment. Domain alignment is to learn domain-invariant feature representations by removing domain-specific knowledge in the representations. Adversarial training is widely adopted to learn domain invariant features through a min-max game between a feature extractor and a domain discriminator (Ganin et al., 2016; Li et al., 2018c; Matsuura & Harada, 2020; Zhu et al., 2022). On the other hand, several studies (Muandet et al., 2013; Sun & Saenko, 2016; Li et al., 2018b) aim to minimize feature divergence across source domains. Recently, contrastive learning-based algorithms (Kim et al., 2021; Yao et al., 2022) have been proposed to minimize distances between feature representations of samples in the same class, regardless their domains.
|
| 181 |
+
|
| 182 |
+
Data augmentation. Many studies have employed data augmentation techniques to improve domain generalization performance. For example, Gulrajani & Lopez-Paz (2021) apply simple data augmentation techniques as a default setup in DOMAINBED and some studies (Wang et al., 2020; Xu et al., 2020; Yan et al., 2020) utilize Mixup (Zhang et al., 2017). Recently, a few works (Zhou et al., 2021; Nam et al., 2021; Kang et al., 2022) focus on image style, based on the idea that domain gap is closely related to image style. On the other side, some works on single domain generalization introduce adversarial data augmentation (Volpi et al., 2018; Fan et al., 2021; Qiao et al., 2020) to generate hard samples adversarially while assuring their reliability.
|
| 183 |
+
|
| 184 |
+
Gradient-based. Recently, several studies utilize gradients to build generalized models, especially by aligning gradients from different domains. Mansilla et al. (2021) exploit gradient agreement for gradient surgery, based on the hypothesis that conflicting gradients contain domain-specific information. Shi et al. (2022) propose a training method that maximizes inner product between source domain gradients to match optimization paths across domains. Similarly, Rame et al. (2022) try to match domain-level Hessian to align loss landscapes across domains. As another line of work, Huang et al. (2020) introduce the self-challenging algorithm that iteratively masks dominant features, which are selected by the scale of the gradients.
|
| 185 |
+
|
| 186 |
+
Meta-learning-based. Since simulating domain shift by dividing source domains into meta-train and meta-test domains was first introduced in MLDG (Li et al., 2018a), several approaches have been proposed in a similar setting. For example, Balaji et al. (2018) propose to learn a regularizer for classifier weights and Zhang et al. (2021a) bring the idea of Reptile (Nichol et al., 2018) to MLDG to further increase performance with a multi-view framework. On the other hand, Zhang et al. (2021b) employ meta-learning to adaptively predict model parameters from a batch of inputs.
|
| 187 |
+
|
| 188 |
+
Others. Some of the works bring concepts of causality (Lv et al., 2022), optimize the worst-case performance (Sagawa et al., 2019; Krueger et al., 2021), utilize text labels (Min et al., 2022), or average model weights from different epochs (Cha et al., 2021; Arpit et al., 2022).
|
| 189 |
+
|
| 190 |
+
Our work differs from aforementioned approaches in that we mainly concentrate on effectively utilizing large-scale pre-trained models.
|
| 191 |
+
|
| 192 |
+
# 4.2 DOMAIN GENERALIZATION WITH PRE-TRAINED MODELS
|
| 193 |
+
|
| 194 |
+
Recently, Gulrajani & Lopez-Paz (2021) empirically show that simple ERM (Vapnik, 1999) outperforms most of early methods with pre-trained ResNet-50 (He et al., 2016). Yu et al. (2021) show that using large-scale models pre-trained on massive datasets improves out-of-distribution performance. Kumar et al. (2022) find that fine-tuning distorts pre-trained features and propose the linear-probing then fine-tuning to mitigate the feature distortion. Wortsman et al. (2022) find that linearly interpolating the zero-shot and fine-tuned parameters of a pre-trained model improves performance in both source and unseen domains. Although GESTUR’s EMA (Equation 6) looks similar to their interpolation, GESTUR updates the pre-trained model to inject task-specific knowledge. Li et al. (2022) propose a method to efficiently leverage a pool of large-scale pre-trained models through specialtyaware ensemble learning. Cha et al. (2022) propose MIRO, a regularization method that targets to minimize mutual information with pre-trained models which approximate the oracle model. In this work, we share similar motivation with MIRO in that we initially approximate the oracle model with a large-scale pre-trained model. However, we iteratively inject task-specific knowledge into the approximation of the oracle model, resulting in a better approximation.
|
| 195 |
+
|
| 196 |
+
# 5 CONCLUSION AND FUTURE WORK
|
| 197 |
+
|
| 198 |
+
In this paper, we propose a new domain generalization method that learns task-specific knowledge while preserving the generalization ability of large-scale pre-trained models. We point out that gradient bias toward source domains hurts the generalization ability of pre-trained models during finetuning. To alleviate the gradient bias, our proposed method estimates unobservable gradients that minimize risk in unseen domains based on two key components: a task expert and a generalization expert. Experimental results on DOMAINBED show that our proposed method outperforms baseline methods in domain generalization. Through extensive analyses, we also demonstrate that the estimated unobservable gradients effectively reduce gradient bias, thereby helping to learn task-specific knowledge without hurting the generalization power of large-scale pre-trained models.
|
| 199 |
+
|
| 200 |
+
Although we verify the effectiveness of our proposed method, it heavily relies on the capability of pre-trained models. When unseen domains that pre-trained models did not encounter are given (e.g. ResNet trained on ImageNet does not see medical images), the pre-trained models might not act as an approximation of the oracle model of the domains. We will address this issue in future work.
|
| 201 |
+
|
| 202 |
+
# REPRODUCIBILITY STATEMENT
|
| 203 |
+
|
| 204 |
+
We provide the source code for reproduction in the supplementary materials. See Appendix A for the hyperparameters used for the experiments.
|
| 205 |
+
|
| 206 |
+
# REFERENCES
|
| 207 |
+
|
| 208 |
+
Martin Arjovsky, Leon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. ´ arXiv preprint arXiv:1907.02893, 2019.
|
| 209 |
+
|
| 210 |
+
Devansh Arpit, Huan Wang, Yingbo Zhou, and Caiming Xiong. Ensemble of averages: Improving model selection and boosting performance in domain generalization. In Alice H. Oh, Alekh Agarwal, Danielle Belgrave, and Kyunghyun Cho (eds.), Advances in Neural Information Processing Systems, 2022. URL https://openreview.net/forum?id=peZSbfNnBp4.
|
| 211 |
+
|
| 212 |
+
Yogesh Balaji, Swami Sankaranarayanan, and Rama Chellappa. Metareg: Towards domain generalization using meta-regularization. Advances in neural information processing systems, 31, 2018.
|
| 213 |
+
|
| 214 |
+
Sara Beery, Grant Van Horn, and Pietro Perona. Recognition in terra incognita. In Proceedings of the European conference on computer vision (ECCV), pp. 456–473, 2018.
|
| 215 |
+
|
| 216 |
+
Gilles Blanchard, Aniket Anand Deshmukh, Urun Dogan, Gyemin Lee, and Clayton Scott. Domain ¨ generalization by marginal transfer learning. The Journal of Machine Learning Research, 22(1): 46–100, 2021.
|
| 217 |
+
|
| 218 |
+
Manh-Ha Bui, Toan Tran, Anh Tran, and Dinh Phung. Exploiting domain-specific features to enhance domain generalization. Advances in Neural Information Processing Systems, 34:21189– 21201, 2021.
|
| 219 |
+
|
| 220 |
+
Junbum Cha, Sanghyuk Chun, Kyungjae Lee, Han-Cheol Cho, Seunghyun Park, Yunsung Lee, and Sungrae Park. Swad: Domain generalization by seeking flat minima. In Advances in Neural Information Processing Systems (NeurIPS), 2021.
|
| 221 |
+
|
| 222 |
+
Junbum Cha, Kyungjae Lee, Sungrae Park, and Sanghyuk Chun. Domain generalization by mutualinformation regularization with pre-trained models. arXiv preprint arXiv:2203.10789, 2022.
|
| 223 |
+
|
| 224 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE Conference on Computer Vision and Pattern Recognition, pp. 248–255, 2009. doi: 10.1109/CVPR.2009.5206848.
|
| 225 |
+
|
| 226 |
+
Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, Jakob Uszkoreit, and Neil Houlsby. An image is worth 16x16 words: Transformers for image recognition at scale. In International Conference on Learning Representations, 2021. URL https: //openreview.net/forum?id $=$ YicbFdNTTy.
|
| 227 |
+
|
| 228 |
+
Xinjie Fan, Qifei Wang, Junjie Ke, Feng Yang, Boqing Gong, and Mingyuan Zhou. Adversarially adaptive normalization for single domain generalization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8208–8217, 2021.
|
| 229 |
+
|
| 230 |
+
Chen Fang, Ye Xu, and Daniel N Rockmore. Unbiased metric learning: On the utilization of multiple datasets and web images for softening bias. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1657–1664, 2013.
|
| 231 |
+
|
| 232 |
+
Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, Franc¸ois Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. The journal of machine learning research, 17(1):2096–2030, 2016.
|
| 233 |
+
|
| 234 |
+
Ishaan Gulrajani and David Lopez-Paz. In search of lost domain generalization. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum? id $=$ lQdXeXDoWtI.
|
| 235 |
+
|
| 236 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
|
| 237 |
+
|
| 238 |
+
Zeyi Huang, Haohan Wang, Eric P Xing, and Dong Huang. Self-challenging improves cross-domain generalization. In European Conference on Computer Vision, pp. 124–140. Springer, 2020.
|
| 239 |
+
|
| 240 |
+
Juwon Kang, Sohyun Lee, Namyup Kim, and Suha Kwak. Style neophile: Constantly seeking novel styles for domain generalization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7130–7140, 2022.
|
| 241 |
+
|
| 242 |
+
Daehee Kim, Youngjun Yoo, Seunghyun Park, Jinkyu Kim, and Jaekoo Lee. Selfreg: Selfsupervised contrastive regularization for domain generalization. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 9619–9628, 2021.
|
| 243 |
+
|
| 244 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR (Poster), 2015.
|
| 245 |
+
|
| 246 |
+
David Krueger, Ethan Caballero, Joern-Henrik Jacobsen, Amy Zhang, Jonathan Binas, Dinghuai Zhang, Remi Le Priol, and Aaron Courville. Out-of-distribution generalization via risk extrapolation (rex). In International Conference on Machine Learning, pp. 5815–5826. PMLR, 2021.
|
| 247 |
+
|
| 248 |
+
Ananya Kumar, Aditi Raghunathan, Robbie Matthew Jones, Tengyu Ma, and Percy Liang. Finetuning can distort pretrained features and underperform out-of-distribution. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum? id $=$ UYneFzXSJWh.
|
| 249 |
+
|
| 250 |
+
Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M Hospedales. Deeper, broader and artier domain generalization. In Proceedings of the IEEE international conference on computer vision, pp. 5542–5550, 2017.
|
| 251 |
+
|
| 252 |
+
Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy Hospedales. Learning to generalize: Meta-learning for domain generalization. In Proceedings of the AAAI conference on artificial intelligence, volume 32, 2018a.
|
| 253 |
+
|
| 254 |
+
Haoliang Li, Sinno Jialin Pan, Shiqi Wang, and Alex C Kot. Domain generalization with adversarial feature learning. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 5400–5409, 2018b.
|
| 255 |
+
|
| 256 |
+
Ya Li, Xinmei Tian, Mingming Gong, Yajing Liu, Tongliang Liu, Kun Zhang, and Dacheng Tao. Deep domain generalization via conditional invariant adversarial networks. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 624–639, 2018c.
|
| 257 |
+
|
| 258 |
+
Ziyue Li, Kan Ren, Xinyang Jiang, Bo Li, Haipeng Zhang, and Dongsheng Li. Domain generalization using pretrained models without fine-tuning. arXiv preprint arXiv:2203.04600, 2022.
|
| 259 |
+
|
| 260 |
+
Fangrui Lv, Jian Liang, Shuang Li, Bin Zang, Chi Harold Liu, Ziteng Wang, and Di Liu. Causality inspired representation learning for domain generalization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8046–8056, 2022.
|
| 261 |
+
|
| 262 |
+
Lucas Mansilla, Rodrigo Echeveste, Diego H Milone, and Enzo Ferrante. Domain generalization via gradient surgery. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 6630–6638, 2021.
|
| 263 |
+
|
| 264 |
+
Toshihiko Matsuura and Tatsuya Harada. Domain generalization using a mixture of multiple latent domains. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 11749– 11756, 2020.
|
| 265 |
+
|
| 266 |
+
Seonwoo Min, Nokyung Park, Siwon Kim, Seunghyun Park, and Jinkyu Kim. Grounding visual representations with texts for domain generalization. arXiv preprint arXiv:2207.10285, 2022.
|
| 267 |
+
|
| 268 |
+
Krikamol Muandet, David Balduzzi, and Bernhard Scholkopf. Domain generalization via invariant ¨ feature representation. In International Conference on Machine Learning, pp. 10–18. PMLR, 2013.
|
| 269 |
+
|
| 270 |
+
Hyeonseob Nam, HyunJae Lee, Jongchan Park, Wonjun Yoon, and Donggeun Yoo. Reducing domain gap by reducing style bias. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8690–8699, 2021.
|
| 271 |
+
|
| 272 |
+
Alex Nichol, Joshua Achiam, and John Schulman. On first-order meta-learning algorithms. arXiv preprint arXiv:1803.02999, 2018.
|
| 273 |
+
|
| 274 |
+
Xingchao Peng, Qinxun Bai, Xide Xia, Zijun Huang, Kate Saenko, and Bo Wang. Moment matching for multi-source domain adaptation. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 1406–1415, 2019.
|
| 275 |
+
|
| 276 |
+
Fengchun Qiao, Long Zhao, and Xi Peng. Learning to learn single domain generalization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12556– 12565, 2020.
|
| 277 |
+
|
| 278 |
+
Joaquin Quinonero-Candela, Masashi Sugiyama, Anton Schwaighofer, and Neil D Lawrence. Dataset shift in machine learning. Mit Press, 2008.
|
| 279 |
+
|
| 280 |
+
Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning, pp. 8748–8763. PMLR, 2021.
|
| 281 |
+
|
| 282 |
+
Ilija Radosavovic, Raj Prateek Kosaraju, Ross Girshick, Kaiming He, and Piotr Dollar. Designing ´ network design spaces. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 10428–10436, 2020.
|
| 283 |
+
|
| 284 |
+
Alexandre Rame, Corentin Dancette, and Matthieu Cord. Fishr: Invariant gradient variances for out-of-distribution generalization. In International Conference on Machine Learning, pp. 18347– 18377. PMLR, 2022.
|
| 285 |
+
|
| 286 |
+
Shiori Sagawa, Pang Wei Koh, Tatsunori B Hashimoto, and Percy Liang. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. arXiv preprint arXiv:1911.08731, 2019.
|
| 287 |
+
|
| 288 |
+
Yuge Shi, Jeffrey Seely, Philip Torr, Siddharth N, Awni Hannun, Nicolas Usunier, and Gabriel Synnaeve. Gradient matching for domain generalization. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ vDwBW49HmO.
|
| 289 |
+
|
| 290 |
+
Mannat Singh, Laura Gustafson, Aaron Adcock, Vinicius de Freitas Reis, Bugra Gedik, Raj Prateek Kosaraju, Dhruv Mahajan, Ross Girshick, Piotr Dollar, and Laurens van der Maaten. Revisiting ´ weakly supervised pre-training of visual perception models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 804–814, June 2022.
|
| 291 |
+
|
| 292 |
+
Baochen Sun and Kate Saenko. Deep coral: Correlation alignment for deep domain adaptation. In European conference on computer vision, pp. 443–450. Springer, 2016.
|
| 293 |
+
|
| 294 |
+
Antonio Torralba and Alexei A Efros. Unbiased look at dataset bias. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1521–1528. IEEE, 2011.
|
| 295 |
+
|
| 296 |
+
Vladimir Vapnik. The nature of statistical learning theory. Springer science & business media, 1999.
|
| 297 |
+
|
| 298 |
+
Hemanth Venkateswara, Jose Eusebio, Shayok Chakraborty, and Sethuraman Panchanathan. Deep hashing network for unsupervised domain adaptation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 5018–5027, 2017.
|
| 299 |
+
|
| 300 |
+
Riccardo Volpi, Hongseok Namkoong, Ozan Sener, John C Duchi, Vittorio Murino, and Silvio Savarese. Generalizing to unseen domains via adversarial data augmentation. Advances in neural information processing systems, 31, 2018.
|
| 301 |
+
|
| 302 |
+
Yufei Wang, Haoliang Li, and Alex C Kot. Heterogeneous domain generalization via domain mixup. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 3622–3626. IEEE, 2020.
|
| 303 |
+
|
| 304 |
+
Mitchell Wortsman, Gabriel Ilharco, Jong Wook Kim, Mike Li, Simon Kornblith, Rebecca Roelofs, Raphael Gontijo Lopes, Hannaneh Hajishirzi, Ali Farhadi, Hongseok Namkoong, and Ludwig Schmidt. Robust fine-tuning of zero-shot models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 7959–7971, June 2022.
|
| 305 |
+
|
| 306 |
+
Minghao Xu, Jian Zhang, Bingbing Ni, Teng Li, Chengjie Wang, Qi Tian, and Wenjun Zhang. Adversarial domain adaptation with domain mixup. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 6502–6509, 2020.
|
| 307 |
+
|
| 308 |
+
Shen Yan, Huan Song, Nanxiang Li, Lincan Zou, and Liu Ren. Improve unsupervised domain adaptation with mixup training. arXiv preprint arXiv:2001.00677, 2020.
|
| 309 |
+
|
| 310 |
+
Xufeng Yao, Yang Bai, Xinyun Zhang, Yuechen Zhang, Qi Sun, Ran Chen, Ruiyu Li, and Bei Yu. Pcl: Proxy-based contrastive learning for domain generalization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7097–7107, 2022.
|
| 311 |
+
|
| 312 |
+
Tianhe Yu, Saurabh Kumar, Abhishek Gupta, Sergey Levine, Karol Hausman, and Chelsea Finn. Gradient surgery for multi-task learning. Advances in Neural Information Processing Systems, 33:5824–5836, 2020.
|
| 313 |
+
|
| 314 |
+
Yaodong Yu, Heinrich Jiang, Dara Bahri, Hossein Mobahi, Seungyeon Kim, Ankit Singh Rawat, Andreas Veit, and Yi Ma. An empirical study of pre-trained vision models on out-of-distribution generalization. In NeurIPS 2021 Workshop on Distribution Shifts: Connecting Methods and Applications, 2021.
|
| 315 |
+
|
| 316 |
+
Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017.
|
| 317 |
+
|
| 318 |
+
Jian Zhang, Lei Qi, Yinghuan Shi, and Yang Gao. Mvdg: A unified multi-view framework for domain generalization, 2021a.
|
| 319 |
+
|
| 320 |
+
Marvin Zhang, Henrik Marklund, Nikita Dhawan, Abhishek Gupta, Sergey Levine, and Chelsea Finn. Adaptive risk minimization: Learning to adapt to domain shift. Advances in Neural Information Processing Systems, 34:23664–23678, 2021b.
|
| 321 |
+
|
| 322 |
+
Kaiyang Zhou, Yongxin Yang, Yu Qiao, and Tao Xiang. Domain generalization with mixstyle. In International Conference on Learning Representations, 2021. URL https://openreview. net/forum?id ${ . } = { }$ 6xHJ37MVxxp.
|
| 323 |
+
|
| 324 |
+
Wei Zhu, Le Lu, Jing Xiao, Mei Han, Jiebo Luo, and Adam P Harrison. Localized adversarial domain generalization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7108–7118, 2022.
|
| 325 |
+
|
| 326 |
+
# APPENDIX
|
| 327 |
+
|
| 328 |
+
# A IMPLEMENTATION DETAILS
|
| 329 |
+
|
| 330 |
+
Hyperparameter search strategy. Similar to Cha et al. (2022), the hyperparameter tuning strategy differs depending on which pre-trained model is used. In the experiments of this work, we use three different pre-trained models: ResNet-50 (He et al., 2016) pre-trained on ImageNet (Deng et al., 2009) (RN50), ViT-B/16 (Dosovitskiy et al., 2021) with CLIP (Radford et al., 2021) (CLIP), and RegNetY-16GF (Radosavovic et al., 2020) with SWAG (Singh et al., 2022) (SWAG).
|
| 331 |
+
|
| 332 |
+
Table 6: Hyperparameters used for RN50 in the experiments.
|
| 333 |
+
|
| 334 |
+
<table><tr><td>Hyperparameter</td><td>PACS</td><td>VLCS</td><td>OfficeHome</td><td>TerraInc</td><td>DomainNet</td></tr><tr><td>入</td><td>0.01</td><td>0.05</td><td>0.01</td><td>0.01</td><td>0.01</td></tr><tr><td>Learning rate</td><td>5e-5</td><td>5e-5</td><td>5e-5</td><td>5e-5</td><td>5e-5</td></tr><tr><td>Weight decay</td><td>0.0</td><td>1e-4</td><td>1e-6</td><td>0.0</td><td>1e-4</td></tr><tr><td>Dropout</td><td>0.0</td><td>0.5</td><td>0.5</td><td>0.0</td><td>0.1</td></tr></table>
|
| 335 |
+
|
| 336 |
+
A two-stage hyperparameter search strategy is used for experiments with $\mathtt { R N S O }$ . Here, the batch size and the moving average coefficient $( m )$ are fixed as 32 and 0.999 in the entire search procedure, respectively. In the first stage, we search the gradient scale factor $( \lambda )$ from $\{ 0 . 0 1 , 0 . 0 5 , 0 . 1 , 0 . 5 \}$ . In this stage, we fix the learning rate as 5e-5 and do not use weight decay and dropout (i.e., weight decay and dropout are equal to 0). In the second stage, we fix $\lambda$ as the one searched in the first stage. Then, we search the learning rate from $\{ 1 \mathrm { e } { - } 5 , 3 \mathrm { e } { - } 5 , 5 \mathrm { e } { - } 5 \}$ , weight decay from $\{ 0 , 1 { \mathrm { e } } { - } 6 , 1 { \mathrm { e } } { - } 4 \}$ , and dropout from $\{ 0 , 0 . 1 , 0 . 5 \}$ . We provide the hyperparameters we use for RN50 in Table 6.
|
| 337 |
+
|
| 338 |
+
Table 7: $\lambda$ used for CLIP and SWAG in the experiments.
|
| 339 |
+
|
| 340 |
+
<table><tr><td>Pre-trained Model</td><td>PACS</td><td>VLCS</td><td>OfficeHome</td><td>TerraInc</td><td>DomainNet</td></tr><tr><td>CLIP</td><td>0.05</td><td>0.1</td><td>0.05</td><td>0.05</td><td>0.05</td></tr><tr><td>SWAG</td><td>0.05</td><td>0.1</td><td>0.05</td><td>0.05</td><td>0.05</td></tr></table>
|
| 341 |
+
|
| 342 |
+
Unlike the experiments with RN50, we apply single-stage hyperparameter search strategy to CLIP and SWAG. Here, we only search $\lambda$ from $\left\{ 0 . 0 1 , \mathrm { { \bar { 0 } } } . 0 5 , 0 . 1 , \mathrm { { \bar { 0 . 5 } } } \right\}$ with hyperparameters such as the batch size, learning rate, weight decay, and dropout fixed. In particular, we fix the learning rate, weight decay, and dropout as the first stage of the hyperparameter search of RN50. For the batch size, we fix the batch size as 32 except for the experiments with DomainNet (Peng et al., 2019) where the batch size is fixed as 24 for the experiments with CLIP. For SWAG, we fix the batch size as 16 for all experiments. In Table 7, we show what $\lambda$ we use for CLIP and SWAG. Similar to Cha et al. (2022), we fix the number of iterations as 15,000 for DomainNet and 5,000 for the others regardless of pre-trained models.
|
| 343 |
+
|
| 344 |
+
# B ADDITIONAL RESULTS
|
| 345 |
+
|
| 346 |
+
# B.1 MAIN RESULTS
|
| 347 |
+
|
| 348 |
+
Table 8: Domain generalization accuracy $( \% )$ on the five domain generalization benchmark datasets with the three different pre-trained models. We mark $* , \dagger$ , and $\ddagger$ for the results from Gulrajani & Lopez-Paz (2021), Cha et al. (2021) and Cha et al. (2022) respectively. We use the reported numbers from each paper for Fish, Fishr, SelfReg, mDSDI, GVRT, and SMA.
|
| 349 |
+
|
| 350 |
+
<table><tr><td>Method</td><td>PACS</td><td>VLCS</td><td>OfficeHome</td><td>TerraInc</td><td>DomainNet</td><td>Avg.</td></tr><tr><td colspan="7">Using ResNet-50 pre-trained on ImageNet.</td></tr><tr><td>MMD*</td><td>84.7 ±0.5</td><td>77.5 ±0.9</td><td>66.3 ±0.1</td><td>42.2 ±1.6</td><td>23.4 ±9.5</td><td>58.8</td></tr><tr><td>MixStyle†</td><td>85.2 ±0.3</td><td>77.9 ±0.5</td><td>60.4 ±0.3</td><td>44.0 ±0.7</td><td>34.0 ±0.1</td><td>60.3</td></tr><tr><td>GroupDRO*</td><td>84.4 ±0.8</td><td>76.7 ±0.6</td><td>66.0 ±0.7</td><td>43.2 ±1.1</td><td>33.3 ±0.2</td><td>60.7</td></tr><tr><td>IRM*</td><td>83.5 ±0.8</td><td>78.5 ±0.5</td><td>64.3 ±2.2</td><td>47.6 ±0.8</td><td>33.9 ±2.8</td><td>61.6</td></tr><tr><td>ARM*</td><td>85.1 ±0.4</td><td>77.6 ±0.3</td><td>64.8 ±0.3</td><td>45.5 ±0.3</td><td>35.5 ±0.2</td><td>61.7</td></tr><tr><td>VREx*</td><td>84.9 ±0.6</td><td>78.3 ±0.2</td><td>66.4 ±0.6</td><td>46.4 ±0.6</td><td>33.6 ±2.9</td><td>61.9</td></tr><tr><td>CDANN*</td><td>82.6 ±0.9</td><td>77.5 ±0.1</td><td>65.8 ±1.3</td><td>45.8 ±1.6</td><td>38.3 ±0.3</td><td>62.0</td></tr><tr><td>DANN*</td><td>83.6 ±0.4</td><td>78.6 ±0.4</td><td>65.9 ±0.6</td><td>46.7 ±0.5</td><td>38.3 ±0.1</td><td>62.6</td></tr><tr><td>RSC*</td><td>85.2 ±0.9</td><td>77.1 ±0.5</td><td>65.5 ±0.9</td><td>46.6 ±1.0</td><td>38.9 ±0.5</td><td>62.7</td></tr><tr><td>MTL*</td><td>84.6 ±0.5</td><td>77.2 ±0.4</td><td>66.4 ±0.5</td><td>45.6 ±1.2</td><td>40.6 ±0.1</td><td>62.9</td></tr><tr><td>Mixup*</td><td>84.6±0.6</td><td>77.4 ±0.6</td><td>68.1 ±0.3</td><td>47.9 ±0.8</td><td>39.2 ±0.1</td><td>63.4</td></tr><tr><td>MLDG*</td><td>84.9 ±1.0</td><td>77.2 ±0.4</td><td>66.8 ±0.6</td><td>47.7 ±0.9</td><td>41.2 ±0.1</td><td>63.6</td></tr><tr><td>Fish</td><td>85.5 ±0.3</td><td>77.8 ±0.3</td><td>68.6 ±0.4</td><td>45.1 ±1.3</td><td>42.7 ±0.2</td><td>63.9</td></tr><tr><td>Fishr</td><td>85.5 ±0.4</td><td>77.8 ±0.1</td><td>67.8 ±0.1</td><td>47.4 ±1.6</td><td>41.7 ±0.0</td><td>64.0</td></tr><tr><td>ERM+</td><td>84.2 ±0.1</td><td>77.3 ±0.1</td><td>67.6 ±0.2</td><td>47.8 ±0.6</td><td>44.0 ±0.1</td><td>64.2</td></tr><tr><td>SagNet*</td><td>86.3 ±0.2</td><td>77.8 ±0.5</td><td>68.1 ±0.1</td><td>48.6 ±1.0</td><td>40.3 ±0.1</td><td>64.2</td></tr><tr><td>SelfReg</td><td>85.6 ±0.4</td><td>77.8 ±0.9</td><td>67.9 ±0.7</td><td>47.0 ±0.3</td><td>42.8 ±0.0</td><td>64.2</td></tr><tr><td>CORAL*</td><td>86.2 ±0.3</td><td>78.8 ±0.6</td><td>68.7 ±0.3</td><td>47.6 ±1.0</td><td>41.5 ±0.1</td><td>64.5</td></tr><tr><td>mDSDI GVRT</td><td>86.2 ±0.2</td><td>79.0 ±0.3</td><td>69.2 ±0.4</td><td>48.1 ±1.4</td><td>42.8 ±0.1</td><td>65.1</td></tr><tr><td>MIRO</td><td>85.1 ±0.3</td><td>79.0 ±0.2</td><td>70.1 ±0.1</td><td>48.0 ±1.4</td><td>44.1 ±0.1</td><td>65.2</td></tr><tr><td></td><td>85.4 ±0.4</td><td>79.0 ±0.0</td><td>70.5 ±0.4</td><td>50.4 ±1.1</td><td>44.3 ±0.2</td><td>65.9</td></tr><tr><td>SMA</td><td>87.5 ±0.2</td><td>78.2 ±0.2</td><td>70.6 ±0.1</td><td>50.3 ±0.5</td><td>46.0 ±0.1</td><td>66.5</td></tr><tr><td>SWAD+</td><td>88.1 ±0.1</td><td>79.1 ±0.1</td><td>70.6 ±0.2</td><td>50.0 ±0.3</td><td>46.5 ±0.1</td><td>66.9</td></tr><tr><td>GESTUR</td><td>88.0 ±0.2</td><td>80.1 ±0.2</td><td>71.1 ±0.0</td><td>51.3 ±0.2</td><td>46.3 ±0.1</td><td>67.4</td></tr><tr><td colspan="7">Using ViT-B/16 with CLIP.</td></tr><tr><td>ERM</td><td>83.4 ±0.5</td><td>75.9 ±1.3</td><td>66.4 ±0.5</td><td>35.3 ±0.8</td><td>44.4 ±0.6</td><td>61.1</td></tr><tr><td>SWAD</td><td>91.3 ±0.1</td><td>79.4 ±0.4</td><td>76.9 ±0.1</td><td>45.4 ±0.5</td><td>51.7 ±0.8</td><td>68.9</td></tr><tr><td>MIROt</td><td>95.6 ±0.8</td><td>82.2 ±0.3</td><td>82.5 ±0.1</td><td>54.3 ±0.4</td><td>54.0 ±0.3</td><td>73.7</td></tr><tr><td>GESTUR</td><td>96.0 ±0.0</td><td>82.8 ±0.1</td><td>84.2 ±0.1</td><td>55.7 ±0.2</td><td>58.9 ±0.1</td><td>75.5</td></tr><tr><td colspan="7">Using RegNetY-16GF with SWAG.</td></tr><tr><td>ERM</td><td>89.6 ±0.4</td><td>78.6 ±0.3</td><td>71.9 ±0.6</td><td>51.4 ±1.8</td><td>48.5 ±0.6</td><td>68.0</td></tr><tr><td>SWAD</td><td>94.7 ±0.2</td><td>79.7 ±0.2</td><td>80.0 ±0.1</td><td>57.9 ±0.7</td><td>53.6 ±0.6</td><td>73.2</td></tr><tr><td>MIRO</td><td>97.4 ±0.2</td><td>79.9 ±0.6</td><td>80.4 ±0.2</td><td>58.9 ±1.3</td><td>53.8 ±0.1</td><td>74.1</td></tr><tr><td>SMA</td><td>95.5 ±0.0</td><td>80.7 ±0.1</td><td>82.0 ±0.0</td><td>59.7 ±0.0</td><td>60.0±0.0</td><td>75.6</td></tr><tr><td>GESTUR</td><td>96.9 ±0.1</td><td>83.5 ±0.1</td><td>83.1 ±0.0</td><td>61.1 ±0.4</td><td>60.1 ±0.0</td><td>76.9</td></tr></table>
|
| 351 |
+
|
| 352 |
+
In $\ S 3 . 2$ , we only compare baselines superior to ERM (Vapnik, 1999) with GESTUR for simplicity.
|
| 353 |
+
Here, we provide the entire results of the main experiment in Table 8.
|
| 354 |
+
|
| 355 |
+
Baselines. In the main experiment, we compare GESTUR against a number of baselines: MMD (Li et al., 2018b), MixStyle (Zhou et al., 2021), GroupDRO (Sagawa et al., 2019), IRM (Arjovsky et al., 2019), ARM (Zhang et al., 2021b), VREx (Krueger et al., 2021), CDANN (Li et al., 2018c), DANN (Ganin et al., 2016), RSC (Huang et al., 2020), MTL (Blanchard et al., 2021), Mixup (Wang et al., 2020; Xu et al., 2020; Yan et al., 2020), MLDG (Li et al., 2018a), Fish (Shi et al., 2022), Fishr (Rame et al., 2022), ERM (Vapnik, 1999), SagNet (Nam et al., 2021), Self
|
| 356 |
+
|
| 357 |
+
Reg (Kim et al., 2021), CORAL (Sun & Saenko, 2016), mDSDI (Bui et al., 2021), GVRT (Min et al., 2022), MIRO (Cha et al., 2022), SWAD (Cha et al., 2021), and SMA (Arpit et al., 2022).
|
| 358 |
+
|
| 359 |
+
B.2 APPLICABILITY OF SWAD (CHA ET AL., 2021) TO GESTUR
|
| 360 |
+
|
| 361 |
+
Table 9: Evaluation results $( \% )$ of combination of SWAD and GESTUR on the four datasets with the three different pre-trained models.
|
| 362 |
+
|
| 363 |
+
<table><tr><td>Method</td><td>PACS</td><td>VLCS</td><td>OfficeHome</td><td>TerraInc|Avg.</td><td></td></tr><tr><td colspan="6">Using ResNet-50 pre-trained on ImageNet.</td></tr><tr><td>GESTUR</td><td>88.0 ±0.2</td><td>80.1 ±0.2</td><td>71.1 ±0.0</td><td>51.3 ±0.2</td><td>72.6</td></tr><tr><td>GESTUR + SWAD</td><td>88.3 ±0.1</td><td>80.1 ±0.1</td><td>71.0 ±0.0</td><td>51.2 ±0.2</td><td>72.7</td></tr><tr><td colspan="6">Using ViT-B/16 with CLIP.</td></tr><tr><td>GESTUR</td><td>96.0 ±0.0</td><td>82.8 ±0.1</td><td>84.2 ±0.1</td><td>55.7 ±0.2</td><td>79.7</td></tr><tr><td>GESTUR + SWAD</td><td>95.9 ±0.0</td><td>82.8 ±0.1</td><td>84.3 ±0.0</td><td>55.3 ±0.6</td><td>79.6</td></tr><tr><td colspan="6">Using RegNetY-16GF with SWAG.</td></tr><tr><td>GESTUR</td><td>96.9 ±0.1</td><td>83.5 ±0.1</td><td>83.1 ±0.0</td><td>61.1 ±0.4</td><td>81.2</td></tr><tr><td>GESTUR + SWAD</td><td>96.8 ±0.0</td><td>83.0±0.1</td><td>83.4 ±0.1</td><td>60.6 ±0.8</td><td>81.0</td></tr></table>
|
| 364 |
+
|
| 365 |
+
Setup. The recent study (Cha et al., 2022) has observed that SWAD (Cha et al., 2021) that seeks the flat minima is a good optimizer for domain generalization, improving the generalization performance of several baselines by applying it to the baselines as a optimizer. Motivated by this observation, we evaluate the performance of our GESTUR applied with SWAD as a optimizer to verify whether GESTUR and SWAD are orthogonal directions to each other.
|
| 366 |
+
|
| 367 |
+
Results. Table 9 shows that SWAD does not improve the performance of GESTUR. We conjecture that it is because EMA used to transfer the knowledge of TE to GE has a similar effect as SWAD to find a flat minima by averaging the model’s weights.
|
| 368 |
+
|
| 369 |
+
# B.3 COMPARISON WITH CLIP-BASED BASELINES
|
| 370 |
+
|
| 371 |
+
Table 10: Evaluation results $( \% )$ on the four datasets with CLIP. Here, we compare GESTUR with CLIP-based baelines, CILP Zero-shot and WiSE-FT (Wortsman et al., 2022).
|
| 372 |
+
|
| 373 |
+
<table><tr><td>Method</td><td>PACS</td><td>VLCS</td><td>OfficeHome</td><td>TerraInc</td><td>Avg.</td></tr><tr><td>CLIP Zero-shot</td><td>96.8 ±0.0</td><td>81.7 ±0.3</td><td>83.0±0.3</td><td>31.3 ±0.2</td><td>73.2</td></tr><tr><td>WiSE-FT (α = 0.5)</td><td>94.5 ±0.0</td><td>83.9 ±0.3</td><td>83.9 ±0.2</td><td>47.5 ±1.2</td><td>77.5</td></tr><tr><td>GESTUR</td><td>96.0 ±0.0</td><td>82.8 ±0.1</td><td>84.2 ±0.1</td><td>55.7 ±0.2</td><td>79.7</td></tr></table>
|
| 374 |
+
|
| 375 |
+
Setup. CLIP (Radford et al., 2021) is pre-trained on the huge web-crawled image-caption pair dataset and has been widely adopted in various computer vision tasks due to its generalization ability. CLIP-based methods could be strong baselines in domain generalization because the text content they used in pre-training could act as a robust anchor to the domain shift of images. Therefore, we conduct additional experiments using CLIP-based methods, CLIP Zero-shot and WiSE-FT (Wortsman et al., 2022). The CLIP-based methods require text-based queries to output text-based representations of target classes. Following the previous study, we obtain the 80 text-based queries from the official repository1 of CLIP and compute the final text-based representation of each target class by averaging the text-based representations of the queries. Finally, the model predictions are computed with the text-based representations and the representations of input images. For WiSE-FT, an ensemble of the fine-tuned and zero-shot models, we set the balance factor $\alpha$ as 0.5 following its original paper since target unseen domains are inaccessible in the domain generalization setting.
|
| 376 |
+
|
| 377 |
+
Results. Table 10 shows the evaluation results where GESTUR achieves the best averaged performance. In detail, GESTUR outperforms CLIP Zero-shot on VLCS, OfficeHome, and TerraInc, and shows comparable performance on PACS. Likewise, GESTUR achieves better performance on PACS, OfficeHome, and TerraInc than WiSE-FT and comparable performance on VLCS.
|
| 378 |
+
|
| 379 |
+
Interestingly, the CLIP-based methods exhibit severe performance degradation on TerraInc. We conjecture that their performance is sensitive to pre-defined text-based queries. For example, the query “a sketch of a $\{ \} ^ { , , }$ is helpful for the “Sketch” domain of PACS. On the other hand, the queries “a plastic $\{ \} ^ { \ast }$ and “a $\{ \}$ in a video game” are not helpful for TerraInc, which is composed of animal images taken from the wild. These observations indicate that the CLIP-based methods require hard prompt engineering for each target dataset. Moreover, the CLIP-based methods solely depend on CLIP, which cannot be extended to other architecture or learning methods trained on only visual modality, such as ResNet with ImageNet and RegNet with SWAG. Considering these, our GESTUR achieves a meaningful performance.
|
| 380 |
+
|
| 381 |
+
# C FURTHER ANALYSIS
|
| 382 |
+
|
| 383 |
+
C.1 RELATIONSHIP BETWEEN $\lambda$ AND THE TYPES OF THE PRE-TRAINED MODEL
|
| 384 |
+
|
| 385 |
+
Table 11: Evaluation results $( \% )$ on VLCS with the three different pre-trained models varying $\lambda$
|
| 386 |
+
|
| 387 |
+
<table><tr><td rowspan="2">Dataset (size)</td><td rowspan="2">Pre-training</td><td rowspan="2"> Architecture</td><td colspan="4">入</td></tr><tr><td>0.01</td><td>0.05</td><td>0.1</td><td>0.5</td></tr><tr><td>ImageNet (1.3M)</td><td>ERM</td><td>ResNet-50</td><td>78.9 ±0.3</td><td>80.1 ±0.2</td><td>80.0 ±0.1</td><td>77.6 ±0.1</td></tr><tr><td>CLIP (400M)</td><td>CLIP</td><td>ViT-B/16</td><td>81.3 ±0.4</td><td>82.7 ±0.1</td><td>82.8 ±0.1</td><td>82.1 ±0.3</td></tr><tr><td>Instagram (3.6B)</td><td>SWAG</td><td>RegNetY-16GF</td><td>81.7 ±0.0</td><td>82.7 ±0.2</td><td>83.5 ±0.1</td><td>82.4 ±0.2</td></tr></table>
|
| 388 |
+
|
| 389 |
+
Table 12: Evaluation results $( \% )$ on OfficeHome with the three different pre-trained models varying λ.
|
| 390 |
+
|
| 391 |
+
<table><tr><td rowspan="2">Dataset (size)</td><td rowspan="2"> Pre-training</td><td rowspan="2"> Architecture</td><td colspan="4">入</td></tr><tr><td>0.01</td><td>0.05</td><td>0.1</td><td>0.5</td></tr><tr><td>ImageNet (1.3M)</td><td>ERM</td><td>ResNet-50</td><td>71.1 ±0.0</td><td>71.1 ±0.1</td><td>70.4 ±0.2</td><td>68.9 ±0.1</td></tr><tr><td>CLIP (400M)</td><td>CLIP</td><td>ViT-B/16</td><td>82.5±0.2</td><td>84.2 ±0.1</td><td>84.4 ±0.0</td><td>84.7 ±0.0</td></tr><tr><td>Instagram (3.6B)</td><td>SWAG</td><td>RegNetY-16GF</td><td>81.5 ±0.2</td><td>83.1 ±0.0</td><td>83.5±0.0</td><td>81.1 ±0.1</td></tr></table>
|
| 392 |
+
|
| 393 |
+
Table 13: Evaluation results $( \% )$ on TerraIncognita with the three different pre-trained models varying $\lambda$ .
|
| 394 |
+
|
| 395 |
+
<table><tr><td rowspan="2">Dataset (size)</td><td rowspan="2"> Pre-training</td><td rowspan="2">Architecture</td><td colspan="4">入</td></tr><tr><td>0.01</td><td>0.05</td><td>0.1</td><td>0.5</td></tr><tr><td>ImageNet (1.3M)</td><td>ERM</td><td>ResNet-50</td><td>51.3 ±0.2</td><td>50.0 ±0.4</td><td>45.5 ±0.2</td><td>31.2 ±0.1</td></tr><tr><td>CLIP (400M)</td><td>CLIP</td><td>ViT-B/16</td><td>51.3±0.2</td><td>55.7 ±0.2</td><td>54.0±0.3</td><td>42.3 ±0.9</td></tr><tr><td>Instagram (3.6B)</td><td>SWAG</td><td>RegNetY-16GF</td><td>57.6±0.9</td><td>61.1 ±0.4</td><td>62.1 ±0.3</td><td>54.9 ±0.1</td></tr></table>
|
| 396 |
+
|
| 397 |
+
In $\ S \ 3 . 6$ , we analyze the relationship between $\lambda$ and the size of the pre-trained model. However, we only present the results from PACS (Li et al., 2017) in Table 5 for simplicity. Here, we provide the additional results from VLCS (Fang et al., 2013), OfficeHome (Venkateswara et al., 2017), and TerraIncognita (Beery et al., 2018) in Table 11, Table 12, and Table 13, respectively.
|
| 398 |
+
|
| 399 |
+
# C.2 PERFORMANCE ON SOURCE DOMAINS
|
| 400 |
+
|
| 401 |
+
Table 14: Evaluation results $( \% )$ on the four datasets with RN50. Here, we average the performances in the source domains, not the performance in the unseen target domain.
|
| 402 |
+
|
| 403 |
+
<table><tr><td>Method</td><td>PACS</td><td>VLCS</td><td>OfficeHome</td><td>TerraInc</td><td>Avg.</td></tr><tr><td>ERM</td><td>97.4 ±0.2</td><td>86.7 ±0.1</td><td>82.9 ±0.3</td><td>92.2 ±0.1</td><td>89.8</td></tr><tr><td>GESTUR w/ TE</td><td>97.1 ±0.1</td><td>86.9 ±0.2</td><td>81.7 ±0.2</td><td>89.4 ±0.1</td><td>88.8</td></tr><tr><td>GESTUR w/ GE</td><td>98.2 ±0.1</td><td>87.4 ±0.2</td><td>84.8 ±0.3</td><td>91.4 ±0.1</td><td>90.5</td></tr></table>
|
| 404 |
+
|
| 405 |
+
Setup. Domain generalization aims to improve the generalization performance on unseen domains shifted from source domains. Thus, domain generalization studies often do not consider situations where the source domains and the target domains are similar. To verify whether estimated unobservable gradients are useful when the unseen domains are similar to the source domains, we report the performance on the training-domain validation set, simulating the situations when the testing domains are exactly the same as the training domains.
|
| 406 |
+
|
| 407 |
+
Results. The evaluation results are summarized in Table 14. GESTUR w/ TE shows worse performance than ERM, indicating that the estimated unobservable gradients act as noisy gradients. Namely, gradients biased toward the source domains are more helpful than estimated unobservable gradients when the source domains and the target domains are similar. Nonetheless, GESTUR w/ GE performs better than ERM, demonstrating that our two-expert architecture is robust to various situations even when source domains and unseen domains are similar or not.
|
| 408 |
+
|
| 409 |
+
# C.3 SIMILARITY BETWEEN TRUE UNOBSERVABLE GRADIENTS $\mathbf { g } _ { u }$ AND ESTIMATED UNOBSERVABLE GRADIENTS $\tilde { \bf g } _ { u }$ OF GESTUR
|
| 410 |
+
|
| 411 |
+
Setup. In this paper, we argue that gradient bias is a major culprit in degrading domain generalization performance (Figure 1a) and our proposed method relieves the gradient bias by estimating unobservable gradients. To support this argument, we reported the number of iterations where gradient conflicts exist in Figure 1b and Table 3. To examine whether the estimated unobservable gradients $\tilde { \bf g } _ { u }$ are similar to the true unobservable gradients $\mathbf { g } _ { u }$ , we add the analysis calculating the cosine similarity of the true and estimated unobservable gradients. Note that the true unobservable gradients are computed by cross-entropy loss using true labels of unseen domain datasets $\mathcal { D } _ { u }$ . On the other hand, the estimated unobservable gradients are just computed as the parameter difference between GE and TE $( \theta _ { G E } - \theta _ { T E } )$ .
|
| 412 |
+
|
| 413 |
+
Results. Figure 2 shows that our estimated gradients display positive similarity scores with the true gradients. This trend demonstrates that the estimated gradients reduce the number of gradient conflicts, leading models to reduce the risks of unseen domains without accessing unseen domain data.
|
| 414 |
+
|
| 415 |
+

|
| 416 |
+
Figure 2: Cosine similarity between the true unobservable gradients $\mathbf { g } _ { u }$ and the estimated unobservable gradients $\tilde { \bf g } _ { u }$
|
md/dev/Czsdv-S4-w9/Czsdv-S4-w9.md
ADDED
|
@@ -0,0 +1,460 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GENERATING VIDEOS WITH DYNAMICS-AWARE IMPLICIT GENERATIVE ADVERSARIAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Sihyun $\mathbf { V } \mathbf { u } ^ { * , 1 }$ , Jihoon Tack $^ { * , 1 }$ , Sangwoo $\mathbf { M _ { 0 } } { ^ { * , 1 } }$ , Hyunsu $\mathbf { K i m ^ { 2 } }$ , Junho $\mathbf { K i m ^ { 2 } }$ , Jung-Woo $\mathbf { H } \mathbf { a } ^ { 2 }$ , Jinwoo Shin1 1Korea Advanced Institute of Science and Technology (KAIST), 2NAVER AI Lab {sihyun.yu, jihoontack, swmo, jinwoos}@kaist.ac.kr, {hyunsu1125.kim, jhkim.ai, jungwoo.ha}@navercorp.com
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
In the deep learning era, long video generation of high-quality still remains challenging due to the spatio-temporal complexity and continuity of videos. Existing prior works have attempted to model video distribution by representing videos as 3D grids of RGB values, which impedes the scale of generated videos and neglects continuous dynamics. In this paper, we found that the recent emerging paradigm of implicit neural representations (INRs) that encodes a continuous signal into a parameterized neural network effectively mitigates the issue. By utilizing INRs of video, we propose dynamics-aware implicit generative adversarial network (DIGAN), a novel generative adversarial network for video generation. Specifically, we introduce (a) an INR-based video generator that improves the motion dynamics by manipulating the space and time coordinates differently and (b) a motion discriminator that efficiently identifies the unnatural motions without observing the entire long frame sequences. We demonstrate the superiority of DIGAN under various datasets, along with multiple intriguing properties, e.g., long video synthesis, video extrapolation, and non-autoregressive video generation. For example, DIGAN improves the previous state-of-the-art FVD score on UCF-101 by $3 0 . 7 \%$ and can be trained on 128 frame videos of $1 2 8 \times 1 2 8$ resolution, 80 frames longer than the 48 frames of the previous state-of-the-art method.1\*
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep generative models have successfully synthesized realistic samples on various domains, including image (Brock et al., 2019; Karras et al., 2020b; 2021; Dhariwal & Nichol, 2021), text (Adiwardana et al., 2020; Brown et al., 2020), and audio (Dhariwal et al., 2020; Lakhotia et al., 2021). Recently, video generation has emerged as the next challenge of deep generative models, and thus a long line of work has been proposed to learn the video distribution (Vondrick et al., 2016; Kalchbrenner et al., 2017; Saito et al., 2017; 2020; Tulyakov et al., 2018; Acharya et al., 2018; Clark et al., 2019; Weissenborn et al., 2020; Rakhimov et al., 2020; Tian et al., 2021; Yan et al., 2021).
|
| 12 |
+
|
| 13 |
+
Despite their significant efforts, a substantial gap still exists from large-scale real-world videos. The difficulty of video generation mainly stems from the complexity of video signals; they are continuously correlated across spatio-temporal directions. Specifically, most prior works interpret the video as a 3D grid of RGB values, i.e., a sequence of 2D images, and model them with discrete decoders such as convolutional (Tian et al., 2021) or autoregressive (Yan et al., 2021) networks. However, such discrete modeling limits the scalability of generated videos due to the cubic complexity (Saito et al., 2020) and ignores the inherent continuous temporal dynamics (Gordon & Parde, 2021).
|
| 14 |
+
|
| 15 |
+
Meanwhile, implicit neural representations (INRs; Sitzmann et al. (2020); Tancik et al. (2020)) have emerged as a new paradigm for representing continuous signals. INR encodes a signal into a neural network that maps input coordinates to corresponding signal values, e.g., 2D coordinates of images to RGB values. Consequently, INR amortizes the signal values of arbitrary coordinates into a compact neural representation instead of discrete grid-wise signal values, requiring a large memory proportional to coordinate dimension and resolution. In this respect, INRs have shown to be highly effective at modeling complex signals such as 3D scenes (Mildenhall et al., 2020; Li et al., 2021a). Furthermore, INR has intriguing properties from its compactness and continuity, e.g., reduced data memory (Dupont et al., 2021a) and upsampling to arbitrary resolution (Chen et al., 2021b).
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: 128 frame video of $1 2 8 \times 1 2 8$ resolution generated by DIGAN on the Tai-Chi-HD dataset. DIGAN can train these videos with 4 NVIDIA V100 GPUs, while the prior state-of-the-art method, DVD-GAN, uses more than 32 (up to 512) TPUs for training 48 frame videos of the same resolution.
|
| 19 |
+
|
| 20 |
+
Several works utilize INRs for generative modeling, i.e., samples are generated through INRs (Chan et al., 2021; Dupont et al., 2021b; Kosiorek et al., 2021). In particular, Skorokhodov et al. (2021a) and Anokhin et al. (2021) exposed that INR-based image generative adversarial networks (GANs; Goodfellow et al. (2014)), which generate images as INRs, show impressive generation performance. Interestingly, they further merit various advantages of INRs, e.g., natural inter- and extra-polation, anycost inference (i.e., control the trade-off of quality and cost), and parallel computation, which needs a non-trivial modification to apply under other generative model architectures.
|
| 21 |
+
|
| 22 |
+
Inspired by this, we aim to design an INR-based (or implicit) video generation model by interpreting videos as continuous signals. This alternative view is surprisingly effective as INRs compactly encode the videos without 3D grids and naturally model the continuous spatio-temporal dynamics. While na¨ıvely applying INRs for videos is already fairly effective, we found that a careful design of separately manipulating space and time significantly improves the video generation.
|
| 23 |
+
|
| 24 |
+
Contribution. We introduce dynamics-aware implicit generative adversarial network (DIGAN), a novel INR-based GAN architecture for video generation. Our idea is two-fold (see Figure 2):
|
| 25 |
+
|
| 26 |
+
• Generator: We propose an INR-based video generator that decomposes the motion and content (image) features, and incorporates the temporal dynamics into the motion features.2 To be specific, our generator encourages the temporal coherency of videos by regulating the variations of motion features with a smaller temporal frequency and enhancing the expressive power of motions with an extra non-linear mapping. Moreover, our generator can create videos with diverse motions sharing the initial frame by conditioning a random motion vector to the content vector. • Discriminator: We propose a motion discriminator that efficiently detects unnatural motions from a pair of images (and their time difference) instead of a long sequence of images. Specifically, DIGAN utilizes a 2D convolutional network for the motion discriminator, unlike prior works that utilize computationally heavier 3D convolutional networks to handle the entire video at once. Such an efficient discriminating scheme is possible since INRs of videos can nonautoregressively synthesize highly correlated frames at arbitrary times.
|
| 27 |
+
|
| 28 |
+
We demonstrate the superiority of DIGAN on various datasets, including UCF-101 (Soomro et al., 2012), Tai-Chi-HD (Siarohin et al., 2019), Sky Time-lapse (Xiong et al., 2018), and a food class subset of Kinetics-600 (Carreira et al., 2018) datasets, e.g., it improves the state-of-the-art results of Frechet video distance (FVD;´ Unterthiner et al. (2018), lower is better) on UCF-101 from 833 to 577 $( + 3 0 . 7 \% )$ . Furthermore, DIGAN appreciates various intriguing properties, including,
|
| 29 |
+
|
| 30 |
+
• Long video generation: synthesize long videos of high-resolution without demanding resources on training, e.g., 128 frame video of $1 2 8 \times 1 2 8$ resolution (Figure 1)
|
| 31 |
+
• Time interpolation and extrapolation: fill in the interim frames to make videos transit smoother, and synthesize the out-of-frame videos (Figure 4, Table 2)
|
| 32 |
+
• Non-autoregressive generation: generate arbitrary time frames, e.g., previous scenes (Figure 5), and fast inference via parallel computing of multiple frames (Table 3)
|
| 33 |
+
• Diverse motion sampling: sample diverse motions from the shared initial frames (Figure 6)
|
| 34 |
+
• Space interpolation and extrapolation: upsample the resolution of videos (Figure 7, Table 4) and create zoomed-out videos while preserving temporal consistency (Figure 8)
|
| 35 |
+
|
| 36 |
+
To the best of our knowledge, we are the first to leverage INRs for video generation. We hope that our work would guide new intriguing directions for both video generation and INRs in the future.
|
| 37 |
+
|
| 38 |
+
# 2 RELATED WORK
|
| 39 |
+
|
| 40 |
+
Image generation. Image generation has achieved remarkable progress, with the advance of various techniques, including generative adversarial networks (GANs; Goodfellow et al. (2014)), autoregressive models (Ramesh et al., 2021), and diffusion models (Dhariwal & Nichol, 2021). In particular, GANs have been considered as one of the common practices for image generation, due to the fast inference at synthesizing high-resolution images (Brock et al., 2019; Karras et al., 2020b; 2021). Inspired by recent GAN architectures (Karras et al., 2020b; Skorokhodov et al., 2021a) and training techniques, (Zhao et al., 2020; Karras et al., 2020a), we extend these methods for video generation.
|
| 41 |
+
|
| 42 |
+
Video generation. Following the success of GANs on images, most prior works on video generation considered the temporal extension of image GANs (Vondrick et al., 2016; Saito et al., 2017; 2020; Tulyakov et al., 2018; Acharya et al., 2018; Clark et al., 2019; Yushchenko et al., 2019; Kahembwe & Ramamoorthy, 2020; Gordon & Parde, 2021; Tian et al., 2021; Fox et al., 2021; Munoz et al., 2021). Another line of works (Kalchbrenner et al., 2017; Weissenborn et al., 2020; Rakhimov et al., 2020; Yan et al., 2021) train autoregressive models over pixels or discretized embeddings. Despite their significant achievement, a large gap still exists between generated results and large-scale realworld videos. We aim to move towards longer video generation by exploiting the power of implicit neural representations. We provide more discussion on related fields in Appendix C.
|
| 43 |
+
|
| 44 |
+
Implicit neural representations. Implicit neural representations (INRs) have recently gained considerable attention, observing that high-frequency sinusoidal activations significantly improve continuous signal modeling (Sitzmann et al., 2020; Tancik et al., 2020). In particular, INR has proven its efficacy in modeling complex signals such as static (Chen et al., 2021b; Park et al., 2021; MartinBrualla et al., 2021) and dynamic (Li et al., 2021a;b; Pumarola et al., 2021; Xian et al., 2021) 3D scenes, and 2D videos (Chen et al., 2021a). Unlike prior works on INRs focusing on modeling a single signal, we learn a generative model over 2D videos. Moreover, while prior works focus more on rendering visually appealing 3D scenes, we aim to learn the diverse motion dynamics of videos.
|
| 45 |
+
|
| 46 |
+
Generative models with INRs. Following the success of single signals, several works utilize INRs for generative modeling. One line of works synthesizes the INR weights correspond to the signals via hypernetwork (Skorokhodov et al., 2021a; Anokhin et al., 2021; Chan et al., 2021; Dupont et al., 2021b). The other line of works controls the generated signals via input condition, i.e., concatenate the latent code corresponding to the signal to the input coordinates (Schwarz et al., 2020; Kosiorek et al., 2021). In particular, Skorokhodov et al. (2021a) and Anokhin et al. (2021) have demonstrated the effectiveness of INR-based generative models for image synthesis. We extend the applicability of INR-based GANs for video generation by incorporating temporal dynamics.
|
| 47 |
+
|
| 48 |
+
# 3 DYNAMICS-AWARE IMPLICIT GENERATIVE ADVERSARIAL NETWORK
|
| 49 |
+
|
| 50 |
+
The goal of video generation is to learn the model distribution $p _ { G } ( \mathbf { v } )$ to match with the data distribution $p _ { \mathrm { d a t a } } ( \mathbf { v } )$ , where a video $\mathbf { v }$ is defined as a continuous function of images $\mathbf { i } _ { t }$ for time $t \in \mathbb { R }$ , and an image $\mathbf { i } _ { t }$ is a function of spatial coordinates $( x , y ) \in \mathbb { R } ^ { 2 }$ . To this end, most prior works considered videos as the discretized sequence of images, i.e., 3D grid of RGB values of size $H \times W \times T$ , and generated videos with discrete decoders such as convolutional (Tian et al., 2021) or autoregressive (Yan et al., 2021) networks. However, the discretization limits video generation hard to scale due to the cubic complexity of generated videos and ignores the continuous dynamics.
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
Figure 2: Illustration of the (a) generator and (b) discriminator of DIGAN. The generator creates a video INR weight from random content and motion vectors, which produces an image that corresponds to the input 2D grids $\{ ( x , y ) \}$ and time $t$ . Two discriminators determine the reality of each image and motion (from a pair of images and their time difference), respectively.
|
| 54 |
+
|
| 55 |
+
Our key idea is to directly model the videos as continuous signals using implicit neural representations (INRs; Sitzmann et al. (2020); Tancik et al. (2020)). Specifically, we propose dynamics-aware implicit generative adversarial network (DIGAN), an INR-based generative adversarial network (GAN; Goodfellow et al. (2014)) for video generation. Inspired by the success of INR-based GANs for image synthesis (Skorokhodov et al., 2021a; Anokhin et al., 2021), DIGAN extends the implicit image GANs for video generation by incorporating temporal dynamics. We briefly review INRs and INR-based GANs in Section 3.1 and then introduce our method DIGAN in Section 3.2.
|
| 56 |
+
|
| 57 |
+
# 3.1 GENERATIVE MODELING WITH IMPLICIT NEURAL REPRESENTATIONS
|
| 58 |
+
|
| 59 |
+
Consider a signal $\mathbf { v } ( \cdot ) : \mathbb { R } ^ { m } \mathbb { R } ^ { n }$ of a coordinate mapping to the corresponding signal values, e.g., videos as ${ \bf v } ( x , y , t ) = ( r , g , b )$ with $m , n = 3$ , where $( x , y , t )$ are space-time coordinates and $( r , g , b )$ are RGB values. Without loss of generality, we assume that the range of coordinates for signals are $[ 0 , 1 ]$ , e.g., $[ 0 , 1 ] ^ { 3 }$ for videos. INR aims to directly model the signal with a neural network $\mathbf { v } ( \cdot ; \boldsymbol { \phi } ) : \mathbb { R } ^ { m } \to \mathbb { R } ^ { n }$ parametrized by $\phi , e . g .$ , using a multi-layer perceptron (MLP). Recently, Tancik et al. (2020) and Sitzmann et al. (2020) found that sinusoidal activations with a high-frequency input $\sigma x$ , i.e., $\sin ( \sigma x )$ for $\sigma \gg 1$ , significantly improve the modeling of complex signals like 3D scenes (Mildenhall et al., 2020) when applied on the first layer (or entire layers). Here, one can decode the INR $\mathbf { v } ( \cdot ; \phi )$ as a standard discrete grid interpretation of signals by computing the values of predefined grid of input coordinates, e.g., $\textstyle { \bar { \left\{ \left( { \frac { i - 1 } { H - 1 } } , { \frac { \bar { j } - 1 } { W - 1 } } , { \frac { k - 1 } { T - 1 } } \right) \right\} } } \subset [ 0 , 1 ] ^ { 3 }$ for videos of size $H \times W \times T$
|
| 60 |
+
|
| 61 |
+
Leveraging the power of INRs, several works utilize them for generative models, i.e., the generator $G ( \cdot )$ maps a latent $z \sim p ( z )$ from a given prior distribution $p ( z )$ to an INR parameter $\phi = G ( z )$ that corresponds to the generated signal $\mathbf { v } ( \cdot ; \phi )$ , e.g., Chan et al. (2021). Remark that INR-based generative models synthesize the function of coordinates, unlike previous approaches that directly predict the outputs of such a function, e.g., 2D grid of RGB values for image synthesis. Hence, INR-based generative models only need to synthesize a fixed size parameter $\phi$ , which reduces the complexity of the generated outputs for complicated signals. It is especially important for higherdimensional signals than 2D images, e.g., video synthesis of grids require cubic complexity.
|
| 62 |
+
|
| 63 |
+
Specifically, Skorokhodov et al. (2021a) and Anokhin et al. (2021) propose GAN frameworks for training INR-based (or implicit) model for image generation, i.e., joint training of the discriminator $D ( \cdot )$ to distinguish the real and generated samples, while the generator $G ( \cdot )$ aims to fool the discriminator.3 In particular, they present a new generator to synthesize weights of INRs and employ conventional convolutional GAN discriminator architectures to identify the fake images decoded from INRs. Remarkably, they have shown comparable results with state-of-the-art GANs while meriting intriguing properties, e.g., inter- and extra-polation and fast inference (Skorokhodov et al., 2021a).
|
| 64 |
+
|
| 65 |
+

|
| 66 |
+
Figure 3: Generated video results of DIGAN on UCF-101 and Kinetics-food datasets.
|
| 67 |
+
|
| 68 |
+
# 3.2 INCORPORATING TEMPORAL DYNAMICS FOR IMPLICIT GANS
|
| 69 |
+
|
| 70 |
+
Our method, DIGAN, is an INR-based video GAN that incorporates the temporal dynamics into the INRs. Recall that the video INRs only differ from the image INRs by an extra time coordinate, i.e., an input becomes a 3D coordinate $( x , y , t )$ from a 2D coordinate $( x , y )$ ; hence, one can utilize the implicit image GANs for video generation by only expanding the input dimension of INRs by one (for the time coordinate). However, we found that a careful generator and discriminator design notably improves the generation quality and training efficiency. We provide the overall illustration of DIGAN in Figure 2, and explain the details of DIGAN in the remaining section.
|
| 71 |
+
|
| 72 |
+
Generator. A na¨ıve extension of implicit image GANs for synthesizing video INRs $\mathbf { v } ( x , y , t ; \phi )$ is to utilize them intactly, only modifying the first layer of INRs to handle the extra time coordinate (we assume that the INRs follow the MLP structure). This approach synthesizes the entire INR parameter $\phi$ at once, which overlooks the difference in space and time of videos, e.g., the smooth change of frames over the time direction. To alleviate this issue, we first notice that the spatial and temporal terms of video INRs can be easily decomposed. Specifically, the output of the first layer (without sinusoidal activations) of video INRs can be interpreted as $\sigma _ { x } \pmb { w } _ { x } x + \sigma _ { y } \pmb { w } _ { y } y + \sigma _ { t } \pmb { w } _ { t } t + \pmb { b } .$ , where ${ \pmb w } _ { x } , { \pmb w } _ { y } , { \pmb w } _ { t } , { \pmb b }$ are weights and biases of the first layer and $\sigma _ { x } , \sigma _ { y } , \sigma _ { t } > 0$ are frequencies of coordinates $x , y , t$ . Here, note that only the term $\sigma _ { t } \mathbf { \boldsymbol { w } } _ { t } t$ differs from the image INRs, so the outputs (of the first layer) of video INRs can be viewed as a continuous trajectory over time $t$ from the initial frame (at $t = 0$ ) determined by the content parameter $\phi _ { I } : = \phi \setminus \overline { { \{ } w _ { t } \} }$ . Inspired by this space-time decomposition view, we incorporate the temporal dynamics into the motion parameter ${ \pmb w } _ { t }$ .
|
| 73 |
+
|
| 74 |
+
To be specific, we propose three components to improve the motion parameter ${ \pmb w } _ { t }$ considering the temporal behaviors. First, we use a smaller time-frequency $\sigma _ { t }$ than space-frequencies $\sigma _ { x } , \sigma _ { y }$ since the video frames change relatively slowly over time compared to the spatial variations covering diverse objects in images. It encourages the videos to be coherent over time. Second, we sample a latent vector for motion diversity $z _ { M } \sim p _ { M } ( z _ { M } )$ in addition to the original content (image) latent vector $z _ { I } \sim p _ { I } ( z _ { I } )$ . Here, the content parameter $\phi _ { I } = G _ { I } ( z _ { I } )$ is generated as the prior implicit image GANs, but the motion parameter ${ \pmb w } _ { t } = G _ { M } ( \pmb { z } _ { I } , \pmb { z } _ { M } )$ is conditioned on both content and motion vectors; since possible motions of a video often depend on the content. Finally, we apply a non-linear mapping $f _ { M } ( \cdot )$ on top of the motion features at time $t$ to give more freedoms to motions, i.e., $f _ { M } ( \pmb { w } _ { t } t )$ . These simple modifications further improves the generation quality (Section 4.1) while creates diverse motions (Section 4.2).
|
| 75 |
+
|
| 76 |
+
Table 1: IS, FVD, and KVD values of video generation models on (a) UCF-101, (b) Sky, (c) TaiChi, and (d) Kinetics-food datasets. $\uparrow$ and $\downarrow$ imply higher and lower values are better, respectively. Subscripts denote standard deviations, and bolds indicate the best results. “Train split” and “Train+test split” denote whether the model is trained with the train split (following the setup in Saito et al. (2020)) or with the full dataset (following the setup in Tian et al. (2021)), respectively.
|
| 77 |
+
|
| 78 |
+
<table><tr><td colspan="3">(a) UCF-101</td></tr><tr><td>Method</td><td>IS (↑)</td><td>FVD (↓)</td></tr><tr><td colspan="3">Train split</td></tr><tr><td>VGAN</td><td>8.31±.09</td><td></td></tr><tr><td>TGAN</td><td>11.85±.07</td><td></td></tr><tr><td>MoCoGAN</td><td>12.42±.07</td><td></td></tr><tr><td>ProgressiveVGAN</td><td>14.56±.05</td><td></td></tr><tr><td>LDVD-GAN</td><td>22.91±.19</td><td></td></tr><tr><td>VideoGPT</td><td>24.69±.30</td><td>=</td></tr><tr><td>TGANv2</td><td>28.87±.67</td><td>1209±28</td></tr><tr><td>DIGAN (ours)</td><td>29.71±.53</td><td>655±22</td></tr><tr><td colspan="3">Train+test split</td></tr><tr><td>DVD-GAN</td><td>27.38±.53</td><td>=</td></tr><tr><td>MoCoGAN-HD DIGAN (ours)</td><td>32.36 32.70±.35</td><td>838 577±21</td></tr></table>
|
| 79 |
+
|
| 80 |
+
<table><tr><td colspan="3">(b) Sky</td></tr><tr><td>Method</td><td>FVD (↓)</td><td>KVD (↓)</td></tr><tr><td>MoCoGAN-HD DIGAN (ours)</td><td>183.6±5.2 114.6±4.3</td><td>13.9±0.7 6.8±0.5</td></tr><tr><td colspan="3">(c) TaiChi</td></tr><tr><td colspan="3">Method FVD (↓)</td></tr><tr><td colspan="3">MoCoGAN-HD 144.7±6.0 DIGAN (ours) 128.1±4.9</td></tr><tr><td colspan="3">(d) Kinetics-food</td></tr><tr><td colspan="3">Method FVD (↓)</td></tr><tr><td colspan="3">MoCoGAN-HD 430.4±29.9 DIGAN (ours) 313.3±36.9</td></tr></table>
|
| 81 |
+
|
| 82 |
+
Discriminator. As the generated videos should be natural in both images and motions, prior works on video GANs are commonly equipped with two discriminators: an image discriminator $D _ { I }$ and a motion (or video) discriminator $D _ { M }$ (Clark et al., 2019; Tian et al., 2021).4 For the image discriminator, one can utilize the well-known 2D convolutional architectures from the image GANs. However, the motion discriminator needs an additional design, e.g., 3D convolutional networks, where inputs are a sequence of images (e.g., the entire videos). The 3D convolutional motion discriminators are the main computational bottleneck of video GANs, and designing an efficient video discriminator has been widely investigated (Saito et al., 2020; Kahembwe & Ramamoorthy, 2020).
|
| 83 |
+
|
| 84 |
+
Instead of the computationally expensive 3D architectures, we propose an efficient 2D convolutional video discriminator. Here, we emphasize that video INRs can efficiently generate two frames of arbitrary times $t _ { 1 } , t _ { 2 }$ unlike autoregressive models which require generating the entire sequence. Utilizing this unique property of INRs, we adopt the image discriminator to distinguish the triplet consists of a pair of images and their time difference $( \mathbf { i } _ { t _ { 1 } } , \mathbf { i } _ { t _ { 2 } } , \Delta t )$ for $\Delta t : = | t _ { 1 } - t _ { 2 } |$ , by expanding the input channel from 3 to 7. Intriguingly, this discriminator can learn the dynamics without observing the whole sequence (Section 4.1). Moreover, we note that the two frames of INRs are highly correlated due to their continuity; the discriminator can focus on the artifacts in the motion.
|
| 85 |
+
|
| 86 |
+
# 4 EXPERIMENTS
|
| 87 |
+
|
| 88 |
+
We present the setups and main video generation results in Section 4.1. We then exhibit the intriguing properties of DIGAN in Section 4.2. Finally, we conduct ablation studies in Section 4.3.
|
| 89 |
+
|
| 90 |
+
# 4.1 VIDEO GENERATION
|
| 91 |
+
|
| 92 |
+
Model. We implement DIGAN upon the INR-GAN (Skorokhodov et al., 2021a) architecture, an INR-based GAN for image generation. The content generator $G _ { I }$ is identical to the INR-GAN gen-√ erator, but the motion generator $G _ { M }$ is added. We set the spatial frequencies $\sigma _ { x } = \sigma _ { y } = \sqrt { 1 0 }$ following the original configuration of INR-GAN, but we found that using a smaller value for the temporal frequency $\sigma _ { t }$ performs better; we use $\sigma _ { t } = 0 . 2 5$ for all experiments ff We use the same discriminator of INR-GAN for both image and motion discriminators but only differ for the input channels: 3 and 7. See Appendix A.1 for details.
|
| 93 |
+
|
| 94 |
+
Table 2: FVD values of generated videos inter- and extra-polated over time. All models are trained on 16 frame videos of $1 2 8 \times 1 2 8$ resolution. The videos are interpolated to 64 frames (i.e., $4 \times$ finer) and extrapolated 16 more frames. We measure FVD with 512 samples for Sky, since the test data size becomes less than 2,048.
|
| 95 |
+
|
| 96 |
+
<table><tr><td></td><td colspan="3">Interpolation</td><td colspan="3">Extrapolation</td></tr><tr><td>Method</td><td>Sky</td><td>TaiChi</td><td>Kinetics-food</td><td>Sky</td><td>TaiChi</td><td>Kinetics-food</td></tr><tr><td>MoCoGAN-HD</td><td>402.2±18.9</td><td>249.0±12.7</td><td>1029.8±28.4</td><td>303.2±4.3</td><td>337.8±3.7</td><td>877.8±22.6</td></tr><tr><td>DIGAN (ours)</td><td>324.2±20.5</td><td>241.6±7.5</td><td>722.2±20.1</td><td>224.3±6.2</td><td>289.3±15.6</td><td>693.7±14.1</td></tr></table>
|
| 97 |
+
|
| 98 |
+

|
| 99 |
+
|
| 100 |
+

|
| 101 |
+
Figure 4: Generated videos of MoCoGAN-HD and DIGAN, trained on 16 frame videos of $1 2 8 \times 1 2 8$ resolution on the Sky dataset. Yellow box indicates the extrapolated results until 64 frames.
|
| 102 |
+
Figure 5: Forward and backward prediction results of DIGAN. Yellow box indicates the given frame.
|
| 103 |
+
|
| 104 |
+
Table 3: Time (sec) for generating a $1 2 8 \times 1 2 8$ video for VideoGPT, MoCoGAN-HD, and DIGAN. Bolds indicate the best results.
|
| 105 |
+
|
| 106 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3">Video length</td></tr><tr><td>16</td><td>32</td><td>64</td></tr><tr><td>VideoGPT</td><td>~40</td><td>~80</td><td>~170</td></tr><tr><td>MoCoGAN-HD</td><td>0.154</td><td>0.303</td><td>0.612</td></tr><tr><td>DIGAN (ours)</td><td>0.069</td><td>0.132</td><td>0.260</td></tr></table>
|
| 107 |
+
|
| 108 |
+
Datasets and evaluation. We conduct the experiments on UCF-101 (Soomro et al., 2012), Tai-ChiHD (TaiChi; Siarohin et al. (2019)), Sky Time-lapse (Sky; Xiong et al. (2018)), and a food class subset of Kinetics-600 (Kinetics-food; Carreira et al. (2018)) datasets. All models are trained on 16 frame videos of $1 2 8 \times 1 2 8$ resolution unless otherwise specified. Specifically, we use the consecutive 16 frames for UCF-101, Sky, and Kinetics-food, but stride 4 (i.e., skip 3 frames after the chosen frame) for TaiChi to make motion more dynamic. Following prior works, we report the Inception score (IS; Salimans et al. (2016)), Frechet video distance (FVD; ´ Unterthiner et al. (2018)), and kernel video distance (KVD; Unterthiner et al. (2018)). We average 10 runs for main results and 5 runs for analysis with standard deviations. See Appendix A.2 for more details.
|
| 109 |
+
|
| 110 |
+
Baselines. We mainly compare DIGAN with prior works on UCF-101, a commonly used benchmark dataset for video generation. Specifically, we consider VGAN (Vondrick et al., 2016), TGAN (Saito et al., 2017), MoCoGAN (Tulyakov et al., 2018), ProgressiveVGAN (Acharya et al., 2018), LDVDGAN (Kahembwe & Ramamoorthy, 2020), VideoGPT (Yan et al., 2021), TGANv2 (Saito et al., 2020), DVD-GAN (Clark et al., 2019), and MoCoGAN-HD (Tian et al., 2021), where the values are collected from the references. For other experiments, we compare DIGAN with the state-of-the-art method, MoCoGAN-HD, tested using the official code. See Appendix B for details.
|
| 111 |
+
|
| 112 |
+
Main results. Figure 3 and Table 1 present the qualitative and quantitative video generation results of DIGAN, respectively. DIGAN can model various video distributions, including unimodal videos like Sky and TaiChi and multimodal videos like UCF-101 and Kinetics-food. In particular, Figure 3 presents that DIGAN produces reasonably good videos for challenging multimodal videos. Also, Table 1 exhibits that DIGAN significantly outperforms the prior work on all datasets, e.g., improves the FVD of MoCoGAN-HD from 833 to 577 $( + 3 0 . 7 \% )$ on UCF-101. We remark that the Frechet ´ inception distance (FID; Heusel et al. (2017)), a metric for image quality, of DIGAN is similar to the MoCoGAN-HD. Thus, the FVD gains of DIGAN come from better dynamics modeling.
|
| 113 |
+
|
| 114 |
+

|
| 115 |
+
Figure 6: Videos sampled from two random motion vectors. The first two rows are generated videos, and the third row is the pixel difference between the two videos (yellow implies more differences).
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 7: Videos upsampled from $1 2 8 \times 1 2 8$ to $5 1 2 \times 5 1 2$ resolution $4 \times$ larger) on TaiChi dataset.
|
| 119 |
+
|
| 120 |
+
Table 4: FVD values of videos upsampled from $1 2 8 \times 1 2 8$ to $2 5 6 \times 2 5 6$ resolution $2 \times$ larger) on TaiChi dataset.
|
| 121 |
+
|
| 122 |
+
<table><tr><td>Method</td><td>FVD (↓)</td></tr><tr><td>Nearest</td><td>180.6±5.1</td></tr><tr><td>Bilinear</td><td>236.7±6.7</td></tr><tr><td>Bicubic</td><td>175.9±5.4</td></tr><tr><td>DIGAN (ours)</td><td>156.7±6.2</td></tr></table>
|
| 123 |
+
|
| 124 |
+
# 4.2 INTRIGUING PROPERTIES
|
| 125 |
+
|
| 126 |
+
Long video generation. The primary advantage of DIGAN is an effective generation of long and high-quality videos, leveraging the compact representations of INRs. We also remark that DIGAN can be efficiently trained on the long videos, as the motion discriminator of DIGAN only handles a pair of images instead of long image sequences. To verify the efficacy of DIGAN, we train a model using 128 frame videos of $1 2 8 \times 1 2 8$ resolution from the TaiChi dataset. Figure 1 shows that DIGAN produces a long and natural motion with reasonable visual quality. To our best knowledge, we are the first to report 128 frame videos of this quality. See Appendix F for more results.
|
| 127 |
+
|
| 128 |
+
Time interpolation and extrapolation. DIGAN can easily interpolate (i.e., fill in interim frames) or extrapolate (i.e., create out-of-frame videos) videos over time by controlling input coordinates. The videos inter- or extra-polated by DIGAN are more natural than those from discrete generative models, as INRs model videos continuously. Table 2 shows that DIGAN outperforms MoCoGAN-HD on all considered inter- and extra-polation scenarios. In particular, DIGAN is remarkably effective for time extrapolation as INRs regularize the videos smoothly follow the scene flows defined by previous dynamics. Figure 4 shows that DIGAN can even extrapolate to $4 \times$ longer frames while MoCoGAN-HD fails on the Sky dataset. See Appendix G for more results.
|
| 129 |
+
|
| 130 |
+
Non-autoregressive generation. DIGAN can generate samples of arbitrary time: it enables DIGAN to infer the past or interim frames from future frames or parallelly compute the entire video at once. It is impossible for many prior video generation approaches that sample the next frame conditioned on the previous frames in an autoregressive manner. Figure 5 visualizes the forward and backward prediction results of DIGAN on the TaiChi dataset, conditioned on the initial frame indicated by the yellow box. Here, we find the content and motion latent codes by projecting the initial frames of $i = \{ 6 , 7 , 8 \}$ and predict the frames of $t \in \{ 3 , \ldots , 1 1 \}$ . DIGAN well predicts both past and future motions, e.g., slowly lowering arms. DIGAN can also infer the interim frames from past and future frames, as shown in Appendix E.2. On the other hand, Table 3 shows the generation speed of DIGAN is much faster than its competitors, VideoGPT and MoCoGAN-HD. Different from prior works, we remark that DIGAN can compute multiple frames in parallel; generation can be $N$ times further faster under $N$ number of GPUs. For more analysis about the efficiency, see Appendix I.
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 8: Zoomed-out samples. Red boxes indicate the original frames.
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 9: Samples of linearly interpolated INR weights $\phi _ { i }$ over $\lambda$ , i.e., $( 1 - \lambda ) \phi _ { 1 } + \lambda \phi _ { 2 }$ on TaiChi dataset.
|
| 137 |
+
|
| 138 |
+
Table 5: Ablation study of the generator components: smaller frequency $\sigma _ { t }$ , motion vector $z _ { M }$ , and non-linearity by MLP $f _ { M } ( \cdot )$ .
|
| 139 |
+
|
| 140 |
+
<table><tr><td>Freq. Ot</td><td>Motion zM</td><td>MLP fm(-)</td><td>FVD (↓)</td></tr><tr><td>-</td><td></td><td></td><td>686±25</td></tr><tr><td>√</td><td>=</td><td></td><td>640±22</td></tr><tr><td>√</td><td>√</td><td></td><td>585±27</td></tr><tr><td>√</td><td>√</td><td>厂</td><td>577±21</td></tr></table>
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
Figure 10: Discriminator logits for a far image pair $( i _ { 0 } , i _ { 1 } )$ , conditioned over different $\Delta t$ .
|
| 144 |
+
|
| 145 |
+
Diverse motion sampling. DIGAN can generate diverse videos from the initial frame by controlling the motion vectors. Figure 6 shows the videos from two random motion vectors on the Sky dataset. Note that the shape of clouds moves differently, but the tree in the left below stays. The freedom of variations conditioned on the initial frame depends on datasets, as discussed in Appendix D.
|
| 146 |
+
|
| 147 |
+
Space interpolation and extrapolation. DIGAN can also inter- and extra-polate videos in the space directions. Figure 7 and Table 4 show the qualitative and quantitative results for space interpolation (i.e., upsampling) on the TaiChi dataset. DIGAN produces $4 \times$ higher resolution videos without ad-hoc training tricks, outperforming na¨ıve heuristics such as bicubic interpolation. Figure 8 visualizes the space extrapolation (i.e., zoom-out) results on various datasets. DIGAN creates out-of-box scenes while preserving temporal consistency. See Appendix H for more results.
|
| 148 |
+
|
| 149 |
+
INR weight interpolation. Interpolation of INR parameter sampled from DIGAN produces semantically meaningful videos. Figure 9 visualizes the videos from the linearly interpolated INR parameters on the TaiChi dataset. The videos smoothly vary over interpolation, e.g., cloth color changes from white to blue. It is not obvious as the INR weights lie in a structured, high-dimensional space.
|
| 150 |
+
|
| 151 |
+
# 4.3 ABLATION STUDIES
|
| 152 |
+
|
| 153 |
+
We conduct the ablation studies on the components of DIGAN. Table 5 shows that all the proposed generator components: smaller frequency $\sigma _ { t }$ , motion vector $z _ { M }$ , and non-linear MLP mapping $f _ { M } ( \cdot )$ contribute to the generation performance measured by FVD scores on the UCF-101 dataset. We note that the motion vector $z _ { M }$ and MLP $f _ { M } ( \cdot )$ remarkably affect FVD when applied solely, but the allcombination result is saturated. On the other hand, Figure 10 verifies that the motion discriminator considers the time difference $\Delta t$ of a given pair of images. Specifically, we provide a far image pair $( i _ { 0 } , i _ { 1 } )$ , i.e., the first and the last frames, with the time difference $\Delta t$ . The motion discriminator thinks the triplet $( i _ { 0 } , i _ { 1 } , \Delta t )$ is fake if $\Delta t \approx 0$ and real if $\Delta t \approx 1$ , as the real difference is $\Delta t = 1$ . Namely, the discriminator leverages $\Delta t$ to identify whether the input triplets are real or fake.
|
| 154 |
+
|
| 155 |
+
# 5 CONCLUSION
|
| 156 |
+
|
| 157 |
+
We proposed DIGAN, an implicit neural representation (INR)-based generative adversarial network (GAN) for video generation, incorporating the temporal dynamics of videos. Extensive experiments verified the superiority of DIGAN with multiple intriguing properties. We believe our work would guide various directions in video generation and INR research in the future.
|
| 158 |
+
|
| 159 |
+
# ETHICS STATEMENT
|
| 160 |
+
|
| 161 |
+
Video generation has potential threats of creating videos for unethical purposes, e.g., fake propaganda videos of politicians or sexual videos of any individuals. The generated videos, often called DeepFake, have arisen as an important social problem (Westerlund, 2019). To tackle the issue, there have been enormous efforts in detecting fake videos (e.g., Guera & Delp (2018)). Here, we claim that the generation and detection techniques should be developed in parallel, rather than prohibiting the generation research itself. This is because the advance of technology is inevitable, and such prohibition only promotes the technology hide in the dark, making them hard to pick out.
|
| 162 |
+
|
| 163 |
+
In this respect, the generative adversarial network (GAN) is a neat solution as it naturally trains both generator and discriminator (or detector). Notably, the discriminator trained by GAN can effectively detect the fake samples created by other generative models (Wang et al., 2020). Our proposed video generation method, DIGAN, is also built upon the GAN framework. In particular, we introduced a discriminator that identifies the fake videos without observing long sequences. We believe our proposed discriminator would be a step towards designing an efficient DeepFake detector.
|
| 164 |
+
|
| 165 |
+
# REPRODUCIBILITY STATEMENT
|
| 166 |
+
|
| 167 |
+
We describe the implementation details of the model in Appendix A.1, and details of the datasets and evaluation in Appendix A.2. We also provide our code in the supplementary material.
|
| 168 |
+
|
| 169 |
+
# ACKNOWLEDGMENTS AND DISCLOSURE OF FUNDING
|
| 170 |
+
|
| 171 |
+
SY thanks Jaeho Lee, Younggyo Seo, Minkyu Kim, Soojung Yang, Seokhyun Moon, Jin-Hwa Kim, and anonymous reviewers for their helpful feedbacks on the early version of the manuscript. SY also acknowledges Ivan Skorokhodov for providing the implementation of INR-GAN. This work was mainly supported by Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) (No.2021-0-02068, Artificial Intelligence Innovation Hub; No.2019-0-00075, Artificial Intelligence Graduate School Program (KAIST)). This work was partly experimented on the NAVER Smart Machine Learning (NSML) platform (Sung et al., 2017; Kim et al., 2018). This work was partly supported by KAIST-NAVER Hypercreative AI Center.
|
| 172 |
+
|
| 173 |
+
# REFERENCES
|
| 174 |
+
|
| 175 |
+
Dinesh Acharya, Zhiwu Huang, Danda Pani Paudel, and Luc Van Gool. Towards high resolution video generation with progressive growing of sliced Wasserstein GANs. arXiv preprint arXiv:1810.02419, 2018.
|
| 176 |
+
Daniel Adiwardana, Minh-Thang Luong, David R So, Jamie Hall, Noah Fiedel, Romal Thoppilan, Zi Yang, Apoorv Kulshreshtha, Gaurav Nemade, Yifeng Lu, et al. Towards a human-like opendomain chatbot. arXiv preprint arXiv:2001.09977, 2020.
|
| 177 |
+
Ivan Anokhin, Kirill Demochkin, Taras Khakhulin, Gleb Sterkin, Victor Lempitsky, and Denis Korzhenkov. Image generators with conditionally-independent pixel synthesis. In IEEE Conference on Computer Vision and Pattern Recognition, 2021.
|
| 178 |
+
Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein generative adversarial networks. ´ In International Conference on Machine Learning, 2017.
|
| 179 |
+
Mohammad Babaeizadeh, Chelsea Finn, Dumitru Erhan, Roy H Campbell, and Sergey Levine. Stochastic variational video prediction. In International Conference on Learning Representations, 2018.
|
| 180 |
+
Mohammad Babaeizadeh, Mohammad Taghi Saffar, Suraj Nair, Sergey Levine, Chelsea Finn, and Dumitru Erhan. FitVid: Overfitting in pixel-level video prediction. arXiv preprint arXiv:2106.13195, 2021.
|
| 181 |
+
|
| 182 |
+
Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. In International Conference on Learning Representations, 2019.
|
| 183 |
+
|
| 184 |
+
Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In Advances in Neural Information Processing Systems, 2020.
|
| 185 |
+
|
| 186 |
+
Joao Carreira, Eric Noland, Andras Banki-Horvath, Chloe Hillier, and Andrew Zisserman. A short note about Kinetics-600. arXiv preprint arXiv:1808.01340, 2018.
|
| 187 |
+
|
| 188 |
+
Eric R Chan, Marco Monteiro, Petr Kellnhofer, Jiajun Wu, and Gordon Wetzstein. Pi-GAN: Periodic implicit generative adversarial networks for 3D-aware image synthesis. In IEEE Conference on Computer Vision and Pattern Recognition, 2021.
|
| 189 |
+
|
| 190 |
+
Hao Chen, Bo He, Hanyu Wang, Yixuan Ren, Ser Nam Lim, and Abhinav Shrivastava. NeRV: Neural representations for videos. Advances in Neural Information Processing Systems, 34, 2021a.
|
| 191 |
+
|
| 192 |
+
Yinbo Chen, Sifei Liu, and Xiaolong Wang. Learning continuous image representation with local implicit image function. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2021b.
|
| 193 |
+
|
| 194 |
+
Aidan Clark, Jeff Donahue, and Karen Simonyan. Adversarial video generation on complex datasets. arXiv preprint arXiv:1907.06571, 2019.
|
| 195 |
+
|
| 196 |
+
Emily Denton and Vighnesh Birodkar. Unsupervised learning of disentangled representations from video. In Advances in Neural Information Processing Systems, 2017.
|
| 197 |
+
|
| 198 |
+
Emily Denton and Rob Fergus. Stochastic video generation with a learned prior. In International Conference on Machine Learning, 2018.
|
| 199 |
+
|
| 200 |
+
Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with Cutout. arXiv preprint arXiv:1708.04552, 2017.
|
| 201 |
+
|
| 202 |
+
Prafulla Dhariwal and Alex Nichol. Diffusion models beat GANs on image synthesis. arXiv preprint arXiv:2105.05233, 2021.
|
| 203 |
+
|
| 204 |
+
Prafulla Dhariwal, Heewoo Jun, Christine Payne, Jong Wook Kim, Alec Radford, and Ilya Sutskever. Jukebox: A generative model for music. arXiv preprint arXiv:2005.00341, 2020.
|
| 205 |
+
|
| 206 |
+
Emilien Dupont, Adam Golinski, Milad Alizadeh, Yee Whye Teh, and Arnaud Doucet. COIN: ´ Compression with implicit neural representations. arXiv preprint arXiv:2103.03123, 2021a.
|
| 207 |
+
|
| 208 |
+
Emilien Dupont, Yee Whye Teh, and Arnaud Doucet. Generative models as distributions of functions. arXiv preprint arXiv:2102.04776, 2021b.
|
| 209 |
+
|
| 210 |
+
Chelsea Finn, Ian Goodfellow, and Sergey Levine. Unsupervised learning for physical interaction through video prediction. In Advances in Neural Information Processing Systems, 2016.
|
| 211 |
+
|
| 212 |
+
Gereon Fox, Ayush Tewari, Mohamed Elgharib, and Christian Theobalt. StyleVideoGAN: A temporal generative model using a pretrained StyleGAN. arXiv preprint arXiv:2107.07224, 2021.
|
| 213 |
+
|
| 214 |
+
Jean-Yves Franceschi, Edouard Delasalles, Mickael Chen, Sylvain Lamprier, and Patrick Gallinari. ¨ Stochastic latent residual video prediction. In International Conference on Machine Learning, 2020.
|
| 215 |
+
|
| 216 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. Advances in neural information processing systems, 2014.
|
| 217 |
+
|
| 218 |
+
Cade Gordon and Natalie Parde. Latent neural differential equations for video generation. In NeurIPS 2020 Workshop on Pre-registration in Machine Learning, 2021.
|
| 219 |
+
|
| 220 |
+
David Guera and Edward J. Delp. Deepfake video detection using recurrent neural networks. IEEE International Conference on Advanced Video and Signal Based Surveillance, 2018.
|
| 221 |
+
|
| 222 |
+
Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. GANs trained by a two time-scale update rule converge to a local nash equilibrium. In Advances in Neural Information Processing Systems, 2017.
|
| 223 |
+
|
| 224 |
+
Jun-Ting Hsieh, Bingbin Liu, De-An Huang, Li Fei-Fei, and Juan Carlos Niebles. Learning to decompose and disentangle representations for video prediction. In Advances in Neural Information Processing Systems, 2018.
|
| 225 |
+
|
| 226 |
+
Emmanuel Kahembwe and Subramanian Ramamoorthy. Lower dimensional kernels for video discriminators. Neural Networks, 132:506–520, 2020.
|
| 227 |
+
|
| 228 |
+
Nal Kalchbrenner, Aaron Oord, Karen Simonyan, Ivo Danihelka, Oriol Vinyals, Alex Graves, and ¨ Koray Kavukcuoglu. Video pixel networks. In International Conference on Machine Learning, 2017.
|
| 229 |
+
|
| 230 |
+
Andrej Karpathy, George Toderici, Sanketh Shetty, Thomas Leung, Rahul Sukthankar, and Li FeiFei. Large-scale video classification with convolutional neural networks. In IEEE Conference on Computer Vision and Pattern Recognition, 2014.
|
| 231 |
+
|
| 232 |
+
Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of GANs for improved quality, stability, and variation. International Conference on Learning Representations, 2017.
|
| 233 |
+
|
| 234 |
+
Tero Karras, Miika Aittala, Janne Hellsten, Samuli Laine, Jaakko Lehtinen, and Timo Aila. Training generative adversarial networks with limited data. In Advances in Neural Information Processing Systems, 2020a.
|
| 235 |
+
|
| 236 |
+
Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Analyzing and improving the image quality of StyleGAN. In IEEE Conference on Computer Vision and Pattern Recognition, 2020b.
|
| 237 |
+
|
| 238 |
+
Tero Karras, Miika Aittala, Samuli Laine, Erik Hark ¨ onen, Janne Hellsten, Jaakko Lehtinen, and ¨ Timo Aila. Alias-free generative adversarial networks. arXiv preprint arXiv:2106.12423, 2021.
|
| 239 |
+
|
| 240 |
+
Will Kay, Joao Carreira, Karen Simonyan, Brian Zhang, Chloe Hillier, Sudheendra Vijayanarasimhan, Fabio Viola, Tim Green, Trevor Back, Paul Natsev, et al. The kinetics human action video dataset. arXiv preprint arXiv:1705.06950, 2017.
|
| 241 |
+
|
| 242 |
+
Hanjoo Kim, Minkyu Kim, Dongjoo Seo, Jinwoong Kim, Heungseok Park, Soeun Park, Hyunwoo Jo, KyungHyun Kim, Youngil Yang, Youngkwan Kim, et al. Nsml: Meet the MLaaS platform with a real-world case study. arXiv preprint arXiv:1810.09957, 2018.
|
| 243 |
+
|
| 244 |
+
Adam R Kosiorek, Heiko Strathmann, Daniel Zoran, Pol Moreno, Rosalia Schneider, Sona Mokr ˇ a,´ and Danilo J Rezende. NeRF-VAE: A geometry aware 3D scene generative model. International Conference on Machine Learning, 2021.
|
| 245 |
+
|
| 246 |
+
Manoj Kumar, Mohammad Babaeizadeh, Dumitru Erhan, Chelsea Finn, Sergey Levine, Laurent Dinh, and Durk Kingma. Videoflow: A conditional flow-based model for stochastic video generation. In International Conference on Learning Representations, 2020.
|
| 247 |
+
|
| 248 |
+
Kushal Lakhotia, Evgeny Kharitonov, Wei-Ning Hsu, Yossi Adi, Adam Polyak, Benjamin Bolte, Tu-Anh Nguyen, Jade Copet, Alexei Baevski, Adelrahman Mohamed, et al. Generative spoken language modeling from raw audio. arXiv preprint arXiv:2102.01192, 2021.
|
| 249 |
+
|
| 250 |
+
Alex X Lee, Richard Zhang, Frederik Ebert, Pieter Abbeel, Chelsea Finn, and Sergey Levine. Stochastic adversarial video prediction. arXiv preprint arXiv:1804.01523, 2018.
|
| 251 |
+
|
| 252 |
+
Wonkwang Lee, Whie Jung, Han Zhang, Ting Chen, Jing Yu Koh, Thomas Huang, Hyungsuk Yoon, Honglak Lee, and Seunghoon Hong. Revisiting hierarchical approach for persistent long-term video prediction. In International Conference on Learning Representations, 2021.
|
| 253 |
+
|
| 254 |
+
Tianye Li, Mira Slavcheva, Michael Zollhoefer, Simon Green, Christoph Lassner, Changil Kim, Tanner Schmidt, Steven Lovegrove, Michael Goesele, and Zhaoyang Lv. Neural 3D video synthesis. arXiv preprint arXiv:2103.02597, 2021a.
|
| 255 |
+
|
| 256 |
+
Zhengqi Li, Simon Niklaus, Noah Snavely, and Oliver Wang. Neural scene flow fields for spacetime view synthesis of dynamic scenes. In IEEE Conference on Computer Vision and Pattern Recognition, 2021b.
|
| 257 |
+
|
| 258 |
+
Yuchen Liu, Zhixin Shu, Yijun Li, Zhe Lin, Federico Perazzi, and Sun-Yuan Kung. Content-aware GAN compression. In IEEE Conference on Computer Vision and Pattern Recognition, 2021.
|
| 259 |
+
|
| 260 |
+
Pauline Luc, Aidan Clark, Sander Dieleman, Diego de Las Casas, Yotam Doron, Albin Cassirer, and Karen Simonyan. Transformation-based adversarial video prediction on large-scale data. arXiv preprint arXiv:2003.04035, 2020.
|
| 261 |
+
|
| 262 |
+
Ricardo Martin-Brualla, Noha Radwan, Mehdi SM Sajjadi, Jonathan T Barron, Alexey Dosovitskiy, and Daniel Duckworth. NeRF in the wild: Neural radiance fields for unconstrained photo collections. In IEEE Conference on Computer Vision and Pattern Recognition, 2021.
|
| 263 |
+
|
| 264 |
+
Lars Mescheder, Andreas Geiger, and Sebastian Nowozin. Which training methods for GANs do actually converge? In International Conference on Machine Learning, 2018.
|
| 265 |
+
|
| 266 |
+
Ben Mildenhall, Pratul P Srinivasan, Matthew Tancik, Jonathan T Barron, Ravi Ramamoorthi, and Ren Ng. NeRF: Representing scenes as neural radiance fields for view synthesis. In European Conference on Computer Vision, 2020.
|
| 267 |
+
|
| 268 |
+
Andres Munoz, Mohammadreza Zolfaghari, Max Argus, and Thomas Brox. Temporal shift GAN for large scale video generation. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, 2021.
|
| 269 |
+
|
| 270 |
+
Keunhong Park, Utkarsh Sinha, Jonathan T Barron, Sofien Bouaziz, Dan B Goldman, Steven M Seitz, and Ricardo Martin-Brualla. Deformable neural radiance fields. In IEEE International Conference on Computer Vision, 2021.
|
| 271 |
+
|
| 272 |
+
Albert Pumarola, Enric Corona, Gerard Pons-Moll, and Francesc Moreno-Noguer. D-NeRF: Neural radiance fields for dynamic scenes. In IEEE Conference on Computer Vision and Pattern Recognition, 2021.
|
| 273 |
+
|
| 274 |
+
Ruslan Rakhimov, Denis Volkhonskiy, Alexey Artemov, Denis Zorin, and Evgeny Burnaev. Latent video transformer. arXiv preprint arXiv:2006.10704, 2020.
|
| 275 |
+
|
| 276 |
+
Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. Zero-shot text-to-image generation. arXiv preprint arXiv:2102.12092, 2021.
|
| 277 |
+
|
| 278 |
+
Masaki Saito, Eiichi Matsumoto, and Shunta Saito. Temporal generative adversarial nets with singular value clipping. In IEEE International Conference on Computer Vision, 2017.
|
| 279 |
+
|
| 280 |
+
Masaki Saito, Shunta Saito, Masanori Koyama, and Sosuke Kobayashi. Train sparsely, generate densely: Memory-efficient unsupervised training of high-resolution temporal GAN. International Journal of Computer Vision, 128:2586–2606, 2020.
|
| 281 |
+
|
| 282 |
+
Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training GANs. Advances in Neural Information Processing Systems, 2016.
|
| 283 |
+
|
| 284 |
+
Katja Schwarz, Yiyi Liao, Michael Niemeyer, and Andreas Geiger. GRAF: Generative radiance fields for 3D-aware image synthesis. In Advances in Neural Information Processing Systems, 2020.
|
| 285 |
+
|
| 286 |
+
Aliaksandr Siarohin, Stephane Lathuili ´ ere, Sergey Tulyakov, Elisa Ricci, and Nicu Sebe. First order \` motion model for image animation. In Advances in Neural Information Processing Systems, 2019.
|
| 287 |
+
|
| 288 |
+
Vincent Sitzmann, Julien Martel, Alexander Bergman, David Lindell, and Gordon Wetzstein. Implicit neural representations with periodic activation functions. Advances in Neural Information Processing Systems, 2020.
|
| 289 |
+
|
| 290 |
+
Ivan Skorokhodov, Savva Ignatyev, and Mohamed Elhoseiny. Adversarial generation of continuous images. In IEEE Conference on Computer Vision and Pattern Recognition, 2021a.
|
| 291 |
+
|
| 292 |
+
Ivan Skorokhodov, Sergey Tulyakov, and Mohamed Elhoseiny. StyleGAN-V: A continuous video generator with the price, image quality and perks of StyleGAN2. arXiv preprint arXiv:2112.14683, 2021b.
|
| 293 |
+
|
| 294 |
+
Khurram Soomro, Amir Roshan Zamir, and Mubarak Shah. UCF101: A dataset of 101 human actions classes from videos in the wild. arXiv preprint arXiv:1212.0402, 2012.
|
| 295 |
+
|
| 296 |
+
Nitish Srivastava, Elman Mansimov, and Ruslan Salakhudinov. Unsupervised learning of video representations using LSTMs. In International Conference on Machine Learning, 2015.
|
| 297 |
+
|
| 298 |
+
Nako Sung, Minkyu Kim, Hyunwoo Jo, Youngil Yang, Jingwoong Kim, Leonard Lausen, Youngkwan Kim, Gayoung Lee, Donghyun Kwak, Jung-Woo Ha, and Sunghun Kim. NSML: A machine learning platform that enables you to focus on your models. In arXiv, 2017.
|
| 299 |
+
|
| 300 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. In IEEE Conference on Computer Vision and Pattern Recognition, 2016.
|
| 301 |
+
|
| 302 |
+
Matthew Tancik, Pratul P Srinivasan, Ben Mildenhall, Sara Fridovich-Keil, Nithin Raghavan, Utkarsh Singhal, Ravi Ramamoorthi, Jonathan T Barron, and Ren $\mathrm { N g }$ . Fourier features let networks learn high frequency functions in low dimensional domains. arXiv preprint arXiv:2006.10739, 2020.
|
| 303 |
+
|
| 304 |
+
Yu Tian, Jian Ren, Menglei Chai, Kyle Olszewski, Xi Peng, Dimitris N Metaxas, and Sergey Tulyakov. A good image generator is what you need for high-resolution video synthesis. In International Conference on Learning Representations, 2021.
|
| 305 |
+
|
| 306 |
+
Du Tran, Lubomir Bourdev, Rob Fergus, Lorenzo Torresani, and Manohar Paluri. Learning spatiotemporal features with 3D convolutional networks. In IEEE International Conference on Computer Vision, 2015.
|
| 307 |
+
|
| 308 |
+
Sergey Tulyakov, Ming-Yu Liu, Xiaodong Yang, and Jan Kautz. MoCoGAN: Decomposing motion and content for video generation. In IEEE Conference on Computer Vision and Pattern Recognition, 2018.
|
| 309 |
+
|
| 310 |
+
Thomas Unterthiner, Sjoerd van Steenkiste, Karol Kurach, Raphael Marinier, Marcin Michalski, and Sylvain Gelly. Towards accurate generative models of video: A new metric & challenges. arXiv preprint arXiv:1812.01717, 2018.
|
| 311 |
+
|
| 312 |
+
Aaron van den Oord, Oriol Vinyals, and Koray Kavukcuoglu. Neural discrete representation learning. In Advances in Neural Information Processing Systems, 2017.
|
| 313 |
+
|
| 314 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems, 2017.
|
| 315 |
+
|
| 316 |
+
Ruben Villegas, Jimei Yang, Seunghoon Hong, Xunyu Lin, and Honglak Lee. Decomposing motion and content for natural video sequence prediction. In International Conference on Learning Representations, 2017.
|
| 317 |
+
|
| 318 |
+
Ruben Villegas, Arkanath Pathak, Harini Kannan, Dumitru Erhan, Quoc V Le, and Honglak Lee. High fidelity video prediction with large stochastic recurrent neural networks. In Advances in Neural Information Processing Systems, 2019.
|
| 319 |
+
|
| 320 |
+
Carl Vondrick, Hamed Pirsiavash, and Antonio Torralba. Generating videos with scene dynamics. In Advances in Neural Information Processing Systems, 2016.
|
| 321 |
+
|
| 322 |
+
Sheng-Yu Wang, Oliver Wang, Richard Zhang, Andrew Owens, and Alexei A Efros. CNN-generated images are surprisingly easy to spot... for now. In IEEE Conference on Computer Vision and Pattern Recognition, 2020.
|
| 323 |
+
|
| 324 |
+
Dirk Weissenborn, Oscar Tackstr ¨ om, and Jakob Uszkoreit. Scaling autoregressive video models. In ¨ International Conference on Learning Representations, 2020.
|
| 325 |
+
|
| 326 |
+
Mika Westerlund. The emergence of deepfake technology: A review. Technology Innovation Management Review, 9:40–53, 11/2019 2019.
|
| 327 |
+
|
| 328 |
+
Wenqi Xian, Jia-Bin Huang, Johannes Kopf, and Changil Kim. Space-time neural irradiance fields for free-viewpoint video. In IEEE Conference on Computer Vision and Pattern Recognition, 2021.
|
| 329 |
+
|
| 330 |
+
Wei Xiong, Wenhan Luo, Lin Ma, Wei Liu, and Jiebo Luo. Learning to generate time-lapse videos using multi-stage dynamic generative adversarial networks. In IEEE Conference on Computer Vision and Pattern Recognition, 2018.
|
| 331 |
+
|
| 332 |
+
Wilson Yan, Yunzhi Zhang, Pieter Abbeel, and Aravind Srinivas. VideoGPT: Video generation using VQ-VAE and transformers. arXiv preprint arXiv:2104.10157, 2021.
|
| 333 |
+
|
| 334 |
+
Vladyslav Yushchenko, Nikita Araslanov, and Stefan Roth. Markov decision process for video generation. In Proceedings of the IEEE/CVF International Conference on Computer Vision Workshops, 2019.
|
| 335 |
+
|
| 336 |
+
Shengyu Zhao, Zhijian Liu, Ji Lin, Jun-Yan Zhu, and Song Han. Differentiable augmentation for data-efficient GAN training. In Advances in Neural Information Processing Systems, 2020.
|
| 337 |
+
|
| 338 |
+
# A IMPLEMENTATION DETAILS
|
| 339 |
+
|
| 340 |
+
# A.1 MODEL DETAILS
|
| 341 |
+
|
| 342 |
+
Following the original configuration of INR-GAN (Skorokhodov et al., 2021a), we set the same spatial frequencies $\sigma _ { x } = \sigma _ { y } = \sqrt { 1 0 }$ and StyleGAN2 (Karras et al., 2020b) discriminator. We use a small temporal frequency $\sigma _ { t } = 0 . 2 5$ to encourage temporal coherence. Here, we remark that the number of frames used in most experiments (16) is much smaller than the image resolution (128), which also affects choosing the $\sigma _ { t }$ . In this respect, choosing a larger $\sigma _ { t }$ (but still smaller than $\sigma _ { x } , \sigma _ { y } )$ can boost the performance for longer videos, e.g., we use $\sigma _ { t } = 0 . 5$ for training on 128 frame videos.
|
| 343 |
+
|
| 344 |
+
In all experiments, we sample $\Delta t : = | t _ { 1 } - t _ { 2 } |$ by subtracting the values from two different beta distributions $t _ { 1 } \sim \tt B e t a ( 2 , 1 )$ , $t _ { 2 } \sim \tt B e t a ( 1 , 2 )$ for both real and generated videos. Such distributions can sample $\Delta t$ diversely (e.g., measured with 10,000 samples, $3 6 . 5 \%$ , $4 2 . 7 \%$ , and $2 0 . 8 \%$ of $\Delta t$ is in the interval of $[ 0 , { \frac { 1 } { 3 } } ] , [ { \frac { 1 } { 3 } } , { \frac { 2 } { 3 } } ]$ , and $[ \tilde { \frac { 2 } { 3 } } , 1 ]$ , respectively), and indeed worked well in our experiments.
|
| 345 |
+
|
| 346 |
+
Like in INR-GAN, we also use a progressive multi-layer perception (MLP) with a factorized multiplicative modulation layers as implicit neural representation architecture. For non-linear mapping ${ \bar { f _ { M } } } ( \cdot )$ , we use the 2-layer MLP with leaky ReLU activation and, no bias are applied for motion vectors. We also apply DiffAug (Zhao et al., 2020) to mitigate overfitting from the limited number of videos like in Tian et al. (2021). Specifically, we use all augmentations proposed from DiffAug except CutOut (DeVries & Taylor, 2017), and use the same augmentation to the same video. All other hyperparameters are identical to StyleGAN2 except for $R _ { 1 }$ regularization coefficient $\gamma$ : we use $\gamma = 1$ in all experiments. With these setups, all the experiments are processed with 4 NVIDIA V100 32GB GPUs where it takes at most ${ \sim } 4 . 4$ days to complete.
|
| 347 |
+
|
| 348 |
+
We note that standard generative adversarial networks (GANs; Goodfellow et al. (2014)) and implicit GANs are in a dual relation as the former samples the input latent while the latter samples the network parameters, which are combined to compute the final outputs. However, the generator of implicit GAN resembles the one of StyleGAN2 in practice since StyleGAN2 injects the input latent to the intermediate layers through the mapping network and modulates the weights with them.
|
| 349 |
+
|
| 350 |
+
# A.2 DATASET AND EVALUATION DETAILS
|
| 351 |
+
|
| 352 |
+
Datasets. In what follows, we describe datasets that we used for the evaluation of our method. All videos are first pre-processed to video clips of consecutive 16 frames, unless otherwise specified.
|
| 353 |
+
|
| 354 |
+
• UCF-101 (Soomro et al., 2012) is a 101-class video action dataset total of 13,320 videos with $3 2 0 \times 2 4 0$ resolution. Each video clip is center-cropped to $2 4 0 \times 2 4 0$ and resized into $1 2 8 \times 1 2 8$ resolution. We conducted two different experiments for a fair comparison: training the model with the train split of 9,357 videos or with all 13,320 videos without the split (following the setup of prior state-of-the-art baselines (Clark et al., 2019; Tian et al., 2021)).
|
| 355 |
+
|
| 356 |
+
• Tai-Chi-HD (Siarohin et al., 2019) is a video dataset total of 280 long videos of people doing Tai-Chi. We use the official link for downloading and cropping the dataset as the rectangle videos of $1 2 8 \times 1 2 8$ resolution.5 We use 16 frame video clips of stride 4 (i.e., skip 3 frames after the chosen frame) for dynamic motion. We use all data without the split on training. We exclude the following videos due to the broken link: 8xSkbMUpegs, RCiy2FYViEg, iFMbu9-Mejc, ceoe2fz648U, 6jHyn4z0KLk, VMSqvTE90hk, xmwGBXYofEE, Dn0mNZmAh2k, VhprHat04dk, KYdyIdusD0g, EaEZVfhn07o, L745tFFmCQ, ytT4iU7h-A8, 5ujMzSyHO 8, JdiIQg47Wc4, aAwbJ9MO91I, and XRyc2kiTlM.
|
| 357 |
+
|
| 358 |
+
• Sky Time-lapse (Xiong et al., 2018) is a collection of sky time-lapse total of 5,000 videos. We use the same data pre-processing following the official link.6 We use the train split for training the model and test split for the evaluation, following the setups in prior works.
|
| 359 |
+
|
| 360 |
+
• Kinetics-600 (Carreira et al., 2018) is a large-scale 600-class video action dataset, consists of a total of 495,547 videos. We sub-sampled a food subclass in the dataset to train the model, where we follow the list of such a subclass from Weissenborn et al. (2020), namely: (baking, barbequing, breading, cooking, cutting, pancake, vegetables, meat, cake, sandwich, pizza, sushi, tea, peeling, fruit, eggs, and salad. We use train split for the model training and use the validation set for the evaluation. Note that we only use these classes, different from Weissenborn et al. (2020) to train the model with the whole dataset.
|
| 361 |
+
|
| 362 |
+
Evaluation metrics. We follow the prior setups for evaluation for a fair comparison. We use the C3D network (Tran et al., 2015) pre-trained on Sports-1M (Karpathy et al., 2014) and fine-tuned on UCF-101 datasets for the Inception score (IS; Salimans et al. (2016)). We use the official TGAN (Saito et al., 2017) implementation for computing IS: the score is evaluated over 10,000 generated videos.7 We note this metric does not use the Inception network (Szegedy et al., 2016) have been used in evaluating IS in image generation, but only the formula for evaluation is identical.
|
| 363 |
+
|
| 364 |
+
For Frechet video distance (FVD; ´ Unterthiner et al. (2018)), and kernel video distance (KVD; Unterthiner et al. (2018)), we use the I3D network trained on Kinetics-400 (Kay et al., 2017). All evaluations are done by averaging 10 runs of scores computed from 2,048 sampled real and generated videos, following the setup in TGANv2 (Saito et al., 2020).
|
| 365 |
+
|
| 366 |
+
Forward and backward prediction. For the forward and backward prediction in Figure 5, one should project the given frame into the latent code. To this end, we follow StyleGAN2 projection procedure Karras et al. (2020a) and optimize for 20,000 iteration.
|
| 367 |
+
|
| 368 |
+
Generation time. To fairly compare the generation time with the baselines in Table 3, we utilize the same machine and stop other processes. We used Intel(R) Xeon(R) CPU E5-2630 v4 $@$ 2.20GHz and a Titan XP GPU for the measurement.
|
| 369 |
+
|
| 370 |
+
Space extrapolation. We generate the video by 2D grid of range $[ - 0 . 2 5 , 1 . 2 5 ] ^ { 2 }$
|
| 371 |
+
|
| 372 |
+
# B BASELINES
|
| 373 |
+
|
| 374 |
+
In this section, we explain video generation baselines we used for evaluating DIGAN at a high level.
|
| 375 |
+
|
| 376 |
+
• VGAN (Vondrick et al., 2016) extends image generative adversarial network (GAN; (Goodfellow et al., 2014)) by replacing 2D spatial architecture with 3D spatio-temporal architecture.
|
| 377 |
+
• TGAN (Saito et al., 2017) separates the spatial (image) generator and temporal (latent dynamics) build on Wasserstein GAN (Arjovsky et al., 2017) model for image generation.
|
| 378 |
+
• MoCoGAN (Tulyakov et al., 2018) proposes GAN to disentangle videos by the content of single latent and motion of stochastic latent trajectory and generate these two components.
|
| 379 |
+
• ProgressiveVGAN (Acharya et al., 2018) progressively generates videos both in spatial and temporal directions, like pregressive image generation in ProgressiveGAN (Karras et al., 2017).
|
| 380 |
+
• LDVD-GAN (Kahembwe & Ramamoorthy, 2020) proposes a efficient video discriminator for training video GANs by considering its kernel dimension to be low.
|
| 381 |
+
• VideoGPT (Yan et al., 2021) compresses videos as a sequence of discrete latent vectors via vector-quantized variational auto-encoder (van den Oord et al., 2017), then trains autoregressive Transformer model (Vaswani et al., 2017) with these latent sequences.
|
| 382 |
+
• TGANv2 (Saito et al., 2020) designs a new video GAN of computationally efficient generator and discriminator by proposing sub-modules on each component.
|
| 383 |
+
• DVD-GAN (Clark et al., 2019) uses spatial and temporal discriminators, where the input of the temporal discriminator is spatially down-sampled to reduce the computational bottleneck.
|
| 384 |
+
• MoCoGAN-HD (Tian et al., 2021) leverages a pre-trained image generator to additionally train a motion generator on the image latent space to synthesize the video with those two generators.
|
| 385 |
+
|
| 386 |
+
# C ADDITIONAL RELATED WORK
|
| 387 |
+
|
| 388 |
+
Video prediction. A related but distinct area, video prediction, aims to forecast future video frames from early frames (Srivastava et al., 2015; Finn et al., 2016; Denton & Birodkar, 2017; Babaeizadeh et al., 2018; Denton & Fergus, 2018; Lee et al., 2018; Villegas et al., 2019; Kumar et al., 2020; Franceschi et al., 2020; Luc et al., 2020; Lee et al., 2021). By restricting the distribution conditioned on initial frames, video prediction models often show better visual quality than video generation (Babaeizadeh et al., 2021). Also, video prediction models employ image-to-image architectures as they only need to modify the initial frames regarding the motion, while video generation models use latent-to-image architectures. While our primary focus is video generation, one can utilize our model for video prediction by projecting initial frames into the corresponding latent codes.
|
| 389 |
+
|
| 390 |
+
Video synthesis with motion and content decomposition. For better video generation or prediction with controllability, several works have proposed methods to decompose the motion and contents. Specifically, they model videos with a content vector and a sequence of motion vectors from different subspaces, incorporating distinct motion and content encoders for a prediction (Villegas et al., 2017; Hsieh et al., 2018) or generators for a generation (Tulyakov et al., 2018; Tian et al., 2021; Munoz et al., 2021). Similarly, we utilize two generators, but the motion is represented as a single vector of the weight of implicit neural representations rather than a sequence of latents.
|
| 391 |
+
|
| 392 |
+
Concurrent work. A concurrent work, StyleGAN-V (Skorokhodov et al., 2021b), also focuses on generative modeling of videos by interpreting videos as continuous signals. Moreover, it shares many similar ideas with DIGAN, e.g., a motion discriminator without 3D convolution networks. However, it has a core difference to DIGAN; DIGAN treats videos as spatiotemporally continuous signals, while StyleGAN-V extends StyleGAN2 (Karras et al., 2020b) by interpreting videos as temporally continuous signals (but not spatially continuous), i.e., video frames are discrete 2D grids.
|
| 393 |
+
|
| 394 |
+

|
| 395 |
+
Figure 11: Latent trajectories of the motion features on UCF-101, Sky, and TaiChi datasets. Resolution denotes the location of motion features injected into the progressive generator; lower-resolution controls the high-level semantics, and higher-resolution controls the low-level variations. Dot colors gradually changes from blue $( t = 0$ ) to red $\mathit { t } = 1 \mathit { i }$ ), and 5 random motion vectors are sampled. The features are projected onto 2D space via principal component analysis (PCA) for visualization.
|
| 396 |
+
|
| 397 |
+
Figure 11 visualizes the latent dynamics of motion features on various datasets. Note that the freedom of motion features vary for different datasets: UCF-101 allows high-level (resolution 32) and low-level (resolution 128) variations, Sky only allows low-level variations, and TaiChi does not permit the variations much. Intuitively, the next move of TaiChi is mostly determined by the prior frames: the movement follows the pre-defined gestures. Sky permits some variations as shown in Figure 6, but the wind direction determines the global motion. UCF-101 has the largest freedom of motion as the dataset contains videos of various actions and diverse objects.
|
| 398 |
+
|
| 399 |
+
# E.1 MORE BACKWARD PREDICTION
|
| 400 |
+
|
| 401 |
+

|
| 402 |
+
Figure 12: More examples on forward and backward prediction results of DIGAN. Yellow box indicates the given frame.
|
| 403 |
+
|
| 404 |
+
# E.2 INTERMEDIATE SCENE PREDICTION
|
| 405 |
+
|
| 406 |
+

|
| 407 |
+
Figure 13: Intermediate scene (i.e., frame) prediction results of our method, DIGAN. The yellow boxes indicate the given initial and last frames.
|
| 408 |
+
|
| 409 |
+
We show that our proposed method, DIGAN, can predict the intermediate frames between the two frames of the different time steps. To this end, we find the inverse content and motion latent codes by projecting two given frames into the generator (we follow the StyleGAN2 projection procedure (Karras et al., 2020b) and optimize 20,000 iteration for the projection). As shown in Figure 13, DIGAN can well predict the intermediate dynamics even the given frames are somewhat far apart. This result implies that DIGAN indeed has learned the dynamics of the ground truth distribution.
|
| 410 |
+
|
| 411 |
+

|
| 412 |
+
Figure 14: Comparison of intermediate scene (i.e., frame) prediction results by StyleGAN2 and our method, DIGAN. The yellow boxes indicate the given initial and last frames.
|
| 413 |
+
|
| 414 |
+
Table 6: SSIM of intermediate scenes predicted by StyleGAN2 and our method, DIGAN.
|
| 415 |
+
|
| 416 |
+
<table><tr><td></td><td>SSIM (↑)</td></tr><tr><td>StyleGAN2 latent interpolation</td><td>0.5639</td></tr><tr><td>DIGAN (ours)</td><td>0.6753</td></tr></table>
|
| 417 |
+
|
| 418 |
+
We also report structural similarity index measure (SSIM) to quantitatively compare predicted videos from DIGAN and linearly interpolated image sequences in StyleGAN2 latent space. For StyleGAN2, we use the official StyleGAN2 inversion method, namely, we project each of the initial and final frames to the StyleGAN2 latent space trained on the Taichi dataset. After that, we linearly interpolate on these two projected latent vectors. As shown in Table 6, DIGAN shows better prediction than StyleGAN2 interpolation. Moreover, as shown in Figure 14, one can observe that DIGAN preserves semantics like background across the temporal direction, while the StyleGAN2 latent interpolation cannot.
|
| 419 |
+
|
| 420 |
+
# F MORE EXAMPLES FOR LONG VIDEO GENERATION
|
| 421 |
+
|
| 422 |
+
Follow the arrow direction, and move to the next line at the end
|
| 423 |
+
|
| 424 |
+

|
| 425 |
+
Figure 15: Additional 128 frame videos of $1 2 8 \times 1 2 8$ resolution by DIGAN, on the TaiChi dataset.
|
| 426 |
+
|
| 427 |
+

|
| 428 |
+
Figure 16: Additional time extrapolation videos of MoCoGAN-HD and DIGAN, trained on 16 frame videos of $1 2 8 \times 1 2 8$ resolution on the Sky dataset. Yellow box indicates the extrapolated frames.
|
| 429 |
+
|
| 430 |
+
# H MORE EXAMPLES FOR SPACE EXTRAPOLATION
|
| 431 |
+
|
| 432 |
+

|
| 433 |
+
Figure 17: Additional zoomed-out samples. Red boxes indicate the original frames.
|
| 434 |
+
|
| 435 |
+
# I EFFICIENCY OF DIGAN
|
| 436 |
+
|
| 437 |
+
In addition to the computational efficiency on inference (in Table 3), we provide the analysis of our method on efficiencies of diverse aspects, including computation, energy, memory, and time efficiency. Here, we mainly compare our method with MoCoGAN-HD (Tian et al., 2021), which is an energy-efficient (i.e., shorter GPU days for training) and state-of-the-art method on the generation quality. All experiments are performed under the same machine (NVIDIA V100 32GB GPUs).
|
| 438 |
+
|
| 439 |
+
• Computational efficiency. We report floating point operations per second (FLOPS)8 of video GAN generators (following Liu et al. (2021)). The DIGAN generator requires 147.9 GFLOPS to generate a 16 frame video of $1 2 8 \times 1 2 8$ resolution, 4.6 times smaller than 682.3 GFLOPS of the MoCoGAN-HD generator.
|
| 440 |
+
• Energy efficiency on training (GPU days for training). The FVD value of DIGAN trained on UCF-101 for 8 GPU days achieves $6 8 9 \pm 2 4$ , which is better than 838 of MoCoGAN-HD trained for 16 GPU days. This implies that DIGAN is (at least 2 times) more energy-efficient than MoCoGAN-HD.
|
| 441 |
+
• Memory efficiency on training. We report the memory size per GPU to load 16 frame videos of $1 2 8 \times 1 2 8$ resolution of batch size 4 for training video GANs. DIGAN allocates 9.7GB memory, 2.9 times smaller than 28.0GB of MoCoGAN-HD.
|
| 442 |
+
• Time efficiency on inference. Per each GPU, DIGAN discriminators can (forward) compute 195.6 video clips/sec, 3.2 times larger than 60.3 video clips/sec of MoCoGAN-HD discriminators with 128 frame videos of $1 2 8 \times 1 2 8$ resolution and a batch size of 16. It confirms that both the generator and discriminator of our method are much more time-efficient; recall that we already demonstrated that our generator is ${ \sim } 2 . 3$ times faster per each GPU in Table 3.
|
| 443 |
+
|
| 444 |
+
In summary, DIGAN is more computation-efficient $> 4 . 6$ times), energy-efficient on training $( > 2$ times), memory-efficient on training $> 2 . 9$ times), and time-efficient on inference $( > 3 . 2$ times) under each machine setup above. Such gaps stem from the fact that our method utilizes: (a) INR-based generator without time-consuming autoregressive modeling and (b) 2D convolutional discriminator rather than computationally heavy 3D convolutional discriminator. Finally, we emphasize that DIGAN can synthesize multiple frames of a video in parallel (which is impossible under prior autoregressive or convolutional network-based methods), resulting in $N$ times improved time-efficiency to generate a single video under $N$ number of GPUs. It can be particularly important for synthesizing extremely long videos; since it requires tremendous time if utilizing prior methods that are impossible to compute frames in parallel. Like this, the superiority of computational efficiency of DIGAN can be further dramatically improved in the presence of multiple GPUs.
|
| 445 |
+
|
| 446 |
+
# J EFFECT OF CONTENT VECTOR FOR GENERATING MOTION
|
| 447 |
+
|
| 448 |
+
Table 7: Effect of the motion vector $z _ { I }$ for generating the motion. We report the mean and standard deviation of the FVD values over 10 runs.
|
| 449 |
+
|
| 450 |
+
<table><tr><td></td><td>UCF-101</td><td>TaiChi</td></tr><tr><td>Motion only</td><td>596±26</td><td>147.9±4.9</td></tr><tr><td>Motion + content (ours)</td><td>577±21</td><td>128.1±4.9</td></tr></table>
|
| 451 |
+
|
| 452 |
+
We provide the result when only the motion vector is used as input (i.e., without the content vector); we report the FVD values of the models on the UCF-101 and the TaiChi dataset. The result in Table 7 confirms that the consideration of content vectors improves the result, as video motions often depend on the content (i.e., initial frame determines the possible future motions).
|
| 453 |
+
|
| 454 |
+
# K CLASS-CONDITIONAL GENERATION OF DIGAN
|
| 455 |
+
|
| 456 |
+
Table 8: IS, FVD, and KVD values of video generation models on the UCF-101 dataset. $\uparrow$ and $\downarrow$ imply higher and lower values are better, respectively. Subscripts denote standard deviations, and bolds indicate the best results.
|
| 457 |
+
|
| 458 |
+
<table><tr><td>Method</td><td>IS (↑)</td><td>FVD (↓)</td><td>KVD (↓)</td></tr><tr><td>DVD-GAN</td><td>32.97±1.7</td><td>=</td><td></td></tr><tr><td>TSB</td><td>42.79±0.63</td><td>-</td><td>1</td></tr><tr><td>DIGAN (ours)</td><td>59.68±0.45</td><td>465±12</td><td>39.6±2.9</td></tr></table>
|
| 459 |
+
|
| 460 |
+
We provide both qualitative and quantitative results of DIGAN on a class-conditional setup to compare several recent works on video synthesis that reported class-conditional generation results, such as DVD-GAN (Clark et al., 2019) and TSB (Munoz et al., 2021). Specifically, we report classconditional generation results trained on UCF-101 in Table 8 and the project page,9 which demonstrate the superiority of DIGAN even on the conditional setup compared to existing baselines.
|
md/dev/Dl4LetuLdyK/Dl4LetuLdyK.md
ADDED
|
@@ -0,0 +1,368 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A FINE-GRAINED ANALYSIS ON DISTRIBUTION SHIFT
|
| 2 |
+
|
| 3 |
+
Olivia Wiles Sven Gowal Florian Stimberg Sylvestre-Alvise Rebuffi Ira Ktena Krishnamurthy (Dj) Dvijotham Taylan Cemgil
|
| 4 |
+
|
| 5 |
+
DeepMind, London, UK
|
| 6 |
+
|
| 7 |
+
{oawiles,sgowal,stimberg,sylvestre,iraktena,taylancemgil}@deepmind.com dvij@google.com
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Robustness to distribution shifts is critical for deploying machine learning models in the real world. Despite this necessity, there has been little work in defining the underlying mechanisms that cause these shifts and evaluating the robustness of algorithms across multiple, different distribution shifts. To this end, we introduce a framework that enables fine-grained analysis of various distribution shifts. We provide a holistic analysis of current state-of-the-art methods by evaluating 19 distinct methods grouped into five categories across both synthetic and real-world datasets. Overall, we train more than 85K models. Our experimental framework can be easily extended to include new methods, shifts, and datasets. We find, unlike previous work (Gulrajani & Lopez-Paz, 2021), that progress has been made over a standard ERM baseline; in particular, pretraining and augmentations (learned or heuristic) offer large gains in many cases. However, the best methods are not consistent over different datasets and shifts. Code is available at github.com/deepmind/distribution_shift_framework.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
If machine learning models are to be ubiquitous in critical applications such as driverless cars (Janai et al., 2020), medical imaging (Erickson et al., 2017), and science (Jumper et al., 2021), it is pivotal to build models that are robust to distribution shifts. Otherwise, models may fail surprisingly in ways that derail trust in the system. For example, Koh et al. (2020); Perone et al. (2019); AlBadawy et al. (2018); Heaven (2020); Castro et al. (2020) find that a model trained on one set of hospitals may not generalise to the imaging conditions of another; Alcorn et al. (2019); Dai & Van Gool (2018) find that a model for driverless cars may not generalise to new lighting conditions or object poses; and Buolamwini & Gebru (2018) find that a model may perform worse on subsets of the distribution, such as different ethnicities, if the training set has an imbalanced distribution. Thus, it is important to understand when we expect a model to generalise and when we do not. This would allow a practitioner to have confidence in the system (e.g. if a model is demonstrated to be robust to the imaging conditions of different hospitals, then it can be deployed in new hospitals with confidence).
|
| 16 |
+
|
| 17 |
+
While domain generalization is a well studied area, Gulrajani & Lopez-Paz (2021); Schott et al. (2021) have cast doubt on the efficacy of existing methods, raising the question: has any progress been made in domain generalization over a standard expectation risk minimization (ERM) algorithm? Despite these discouraging results, there are many examples that machine learning models do generalise across datasets with different distributions. For example, CLIP (Radford et al., 2021), with well engineered prompts, generalizes to many standard image datasets. Taori et al. (2020) found that models trained on one image dataset generalise to another, albeit with some drop in performance; in particular, higher performing models generalise better. However, there is little understanding and experimentation on when and why models generalise, especially in realistic settings inspired by real-world applications. This begs the following question:
|
| 18 |
+
|
| 19 |
+
Can we define the important distribution shifts to be robust to and then systematically evaluate the robustness of different methods?
|
| 20 |
+
|
| 21 |
+
To answer the above question, we present a grounded understanding of robustness to distribution shifts. We draw inspiration from disentanglement literature (see section 6), which aims to separate images into an independent set of factors of variation (or attributes). In brief, we assume the data is composed of some (possibly extremely large) set of attributes. We expect models, having seen some distribution of values for an attribute, to be able to learn invariance to that attribute and so to generalise to unseen examples of the attribute and different distributions over that attribute. Using a simple example to clarify the setup, assume our data has two attributes (shape and color) among others. Given data with some distribution over the set of possible colors (e.g. red and blue) and the task of predicting shape (e.g. circle or square), we want our model to generalise to unseen colors (e.g. green) or a different distribution of colors (e.g. there are very few red circles in the training set, but the samples at evaluation are uniformly sampled from the set of possible colors and shapes).
|
| 22 |
+
|
| 23 |
+
Using this framework, we evaluate models across three distribution shifts: spurious correlation, lowdata drift, and unseen data shift (illustrated in figure 1) and two additional conditions (label noise and dataset size). We choose these settings as they arise in the real world and harm generalization performance. Moreover, in our framework, these distribution shifts are the fundamental blocks of building more complex distribution shifts. We additionally evaluate models when there is varying amounts of label noise (as inspired by noise arising from human raters) and when the total size of the train set varies (to understand how models perform as the number of training examples changes). The unique ability of our framework to evaluate fine-grained performance of models across different distribution shifts and under different conditions is of critical importance to analyze methods under a variety of real-world settings. This work makes the following contributions:
|
| 24 |
+
|
| 25 |
+
• We propose a framework to define when and why we expect methods to generalise. We use this framework to define three, real world inspired distribution shifts. We then use this framework to create a systematic evaluation setup across real and synthetic datasets for different distribution shifts. Our evaluation framework is easily extendable to new distribution shifts, datasets, or methods to be evaluated. We evaluate and compare 19 different methods (training more than 85K models) in these settings. These methods span the following 5 common approaches: architecture choice, data augmentation, domain generalization, adaptive algorithms, and representation learning. This allows for a direct comparison across different areas in machine learning. We find that simple techniques, such as data augmentation and pretraining are often effective and that domain generalization algorithms do work for certain datasets and distribution shifts. However, there is no easy way to select the best approach a-priori and results are inconsistent over different datasets and attributes, demonstrating there is still much work to be done to improve robustness in real-world settings.
|
| 26 |
+
|
| 27 |
+
# 2 FRAMEWORK TO EVALUATE GENERALIZATION
|
| 28 |
+
|
| 29 |
+
In this section we introduce our robustness framework for characterizing distribution shifts in a principled manner. We then relate three common, real world inspired distribution shifts.
|
| 30 |
+
|
| 31 |
+
# 2.1 LATENT FACTORISATION
|
| 32 |
+
|
| 33 |
+
We assume a joint distribution $p$ of inputs $_ { \textbf { \em x } }$ and corresponding attributes $y ^ { 1 } , y ^ { 2 } , \ldots , y ^ { K }$ (denoted as $y ^ { 1 : K }$ ) with $y ^ { k } \in \mathbb { A } ^ { k }$ where $\mathbb { A } ^ { k }$ is a finite set. One of these $K$ attributes is a label of interest, denoted as $y ^ { l }$ (in a mammogram, the label could be cancer/benign and a nuisance attribute $y ^ { i }$ with $i \neq l$ could be the identity of the hospital where the mammogram was taken). Our aim is to build a classifier $f$ that minimizes the risk $R$ . However, in real-world applications, we only have access to a finite set of inputs and attributes of size $n$ . Hence, we minimize the empirical risk $\hat { R }$ instead:
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
R ( f ) = \mathbb { E } _ { ( { \pmb x } , { \pmb y } ^ { l } ) \sim p } \left[ { \mathcal L } ( { \pmb y } ^ { l } , f ( { \pmb x } ) ) \right] \qquad \hat { R } ( f ; p ) = \frac { 1 } { n } \sum _ { \{ ( { \pmb y } _ { i } ^ { l } , { \pmb x } _ { i } ) \sim p \} _ { i = 1 } ^ { n } } { \mathcal L } ( { \pmb y } _ { i } ^ { l } , f ( { \pmb x } _ { i } ) ) .
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where $\mathcal { L }$ is a suitable loss function. Here, all nuisance attributes $y ^ { k }$ with $k \neq l$ are ignored and we work with samples obtained from the marginal $p ( y ^ { l } , \pmb { x } )$ . In practice, however, due to selection bias or other confounding factors in data collection, we are only able to train and test our models on data collected from two related but distinct distributions: $p _ { \mathrm { t r a i n } } , p _ { \mathrm { t e s t } }$ . For example, $p _ { \mathrm { t r a i n } }$ and $p _ { \mathrm { t e s t } }$ may be concentrated on different subsets of hospitals and this discrepancy may result in a distribution shift; for example, hospitals may use different equipment, leading to different staining on their cell images. While we train $f$ on data from $p _ { \mathrm { t r a i n } }$ by minimizing $\hat { R } ( f ; p _ { \mathrm { t r a i n } } )$ , we aim to learn a model that generalises well to data from $p _ { \mathrm { t e s t } }$ ; that is, it should achieve a small $\hat { R } ( f ; p _ { \mathrm { t e s t } } )$ .
|
| 40 |
+
|
| 41 |
+

|
| 42 |
+
Figure 1: Visualization of the joint distribution for the different shifts we consider on the DSPRITES example. The lighter the color, the more likely the given sample. figure 1a-1c visualise different shifts over $p _ { \mathrm { t r a i n } } \breve { ( } y ^ { l } , y ^ { a } )$ discussed in 2.2: spurious correlation (SC), low-data drift (LDD), and unseen data shift (UDS). figure 1d visualises the test set, where the attributes are uniformly distributed.
|
| 43 |
+
|
| 44 |
+
While generalization in the above sense is desirable for machine learning models, it is not clear why a model $f$ trained on data from $p _ { \mathrm { t r a i n } }$ should generalise to $p _ { \mathrm { t e s t } }$ . It is worth noting that while $p _ { \mathrm { t r a i n } }$ and $p _ { \mathrm { t e s t } }$ can be different, they are both related to the true distribution $p$ . We take inspiration from disentanglement literature to express this relationship. In particular, that we can view data as being decomposed into an underlying set of factors of variations. We formalise various distribution shifts using a latent variable model for the true data generation process:
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
z \sim p ( z ) \qquad y ^ { i } \sim p ( y ^ { i } | z ) \quad i = 1 \ldots K \qquad x \sim p ( x | z )
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
where $z$ denotes latent factors. By a simple refactorization, we can write
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
p ( y ^ { 1 : K } , \pmb { x } ) = p ( y ^ { 1 : K } ) \int p ( \pmb { x } | z ) p ( z | y ^ { 1 : K } ) d z = p ( y ^ { 1 : K } ) p ( \pmb { x } | y ^ { 1 : K } ) .
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
Thus, the true distribution can be expressed as the product of the marginal distribution of the attributes with a conditional generative model. We assume that distribution shifts arise when a new marginal distribution for the attributes is chosen, such as $p ( y ^ { 1 : K } ) \neq p _ { \mathrm { t r a i n } } ( y ^ { 1 : K } ) \neq p _ { \mathrm { t e s t } } ( y ^ { 1 : K } )$ , but otherwise the conditional generative model is shared across all distributions, i.e., we have $\begin{array} { r } { p _ { \mathrm { t e s t } } ( y ^ { 1 : K } , \pmb { x } ) = p _ { \mathrm { t e s t } } ( y ^ { 1 : K } ) \int \breve { p } ( \pmb { x } | z ) p ( z | y ^ { 1 : K } ) d z } \end{array}$ , and similarly for $p _ { \mathrm { t r a i n } }$ .
|
| 57 |
+
|
| 58 |
+
To provide more context, as a running example, we use the color DSPRITES dataset (Matthey et al., 2017); where in our notation $y ^ { 1 }$ defines the color with $\mathbb { A } ^ { 1 } = \{ { \mathrm { r e d } } , { \mathrm { g r e e n } } , { \mathrm { b l u e } } \}$ , and $y ^ { 2 }$ defines the shape with $\mathbb { A } ^ { 2 } = \{ { \mathrm { e l l i p s e } }$ , heart, square $\}$ . We can imagine that a data collector (intentionally or implicitly) selects some marginal distribution over attributes $p _ { \mathrm { t r a i n } } ( y ^ { 1 : K } )$ when training; for example they select mostly blue ellipses and red hearts. This induces a new joint distribution over latent factors and attributes: $p _ { \mathrm { t r a i n } } ( \acute { z } , y ^ { 1 : K } ) = p ( z | y ^ { 1 : K } ) p _ { \mathrm { t r a i n } } ( y ^ { 1 : K } )$ . Consequently, during training, we get images with a different joint distribution $\begin{array} { r } { \bar { p } _ { \mathrm { t r a i n } } \bar { ( } x , y ^ { 1 : K } ) = \bar { \int } p ( x | z ) \bar { p _ { \mathrm { t r a i n } } } \bar { ( } z , y ^ { 1 : K } ) } \end{array}$ . This similarly applies when collecting data for the test distribution. We focus on common cases of distribution shifts visualized in figure 1; we discuss these in more detail in section 2.2.
|
| 59 |
+
|
| 60 |
+
The goal of enforcing robustness to distribution shifts is to maintain performance when the data generating distribution $p _ { \mathrm { t r a i n } }$ changes. In other words, we would like to minimize risk on $p , p _ { \mathrm { t e s t } }$ given only access to $p _ { \mathrm { t r a i n } }$ . We can achieve robustness in the following ways:
|
| 61 |
+
|
| 62 |
+
• Weighted resampling. We can resample the training set using importance weights $W ( \breve { y } ^ { 1 : K } ) = p ( y ^ { 1 : K } ) / \breve { p } _ { \mathrm { t r a i n } } ( y ^ { 1 : K } )$ . This means that given the attributes, the $i$ -th data point $( y _ { i } ^ { 1 : K } , x _ { i } )$ trainin the training set is used with probability $\textstyle W ( y _ { i } ^ { 1 : K } ) / \sum _ { i ^ { \prime } = 1 } ^ { n } W ( y _ { i ^ { \prime } } ^ { 1 : K } )$ rather than $1 / n$ . We refer to this empirical distribution as $p _ { \mathrm { r e w e i g h t } }$ . This procedure requires access to the true distribution of attributes $p ( \boldsymbol { y } ^ { 1 : K } )$ , so to avoid bias and improve fairness, it is often assumed that all combinations of attributes happen uniformly at random.
|
| 63 |
+
|
| 64 |
+
• Data Augmentation: Alternatively, we can learn a generative model $\hat { p } ( { \pmb x } | { \pmb y } ^ { 1 : K } )$ from the training data that aims to approximate $\begin{array} { r } { \int p ( { \pmb x } | z ) p ( \bar { z } | y ^ { 1 : K } ) d z } \end{array}$ , as the true conditional generator is by our assumption the same over all (e.g. train and test) distributions. If such a conditional generative model can be learned, we can sample new synthetic data at training time (e.g. according to the true distribution $p ( \boldsymbol { y } ^ { 1 : K } ) )$ to correct for the distribution shift. More precisely, we can generate data from the augmented distribution $p _ { \mathrm { a u g } } = ( 1 - \alpha ) p _ { \mathrm { r e w e i g h t } } \dot { + } \alpha \hat { p } ( \dot { x } | y ^ { 1 : K } ) p ( y ^ { 1 : K } )$ and train a supervised classifier on this augmented dataset. Here, $\alpha \in [ 0 , 1 ]$ is the percentage of synthetic data used for training.
|
| 65 |
+
|
| 66 |
+

|
| 67 |
+
Figure 2: Dataset samples. Each row fixes an attribute (e.g. color for DSPRITES, MPI3D, SHAPES3D; azimuth for SMALLNORB; hospital for CAMELYON17; and location for IWILDCAM).
|
| 68 |
+
|
| 69 |
+
• Representation Learning: An alternative factorization of a data generating distribution (e.g. train) is $\begin{array} { r } { p _ { \mathrm { t r a i n } } ( y ^ { 1 : K } , \mathbf { \bar { x } } ) = \int p ( z | \mathbf { x } ) p _ { \mathrm { t r a i n } } ( y ^ { 1 : K } | z ) d z } \end{array}$ . We can learn an unsupervised representation that approximates $p ( z | \pmb { x } )$ using the training data only, and attach a classifier to learn a task specific head that approximates $p _ { \mathrm { t r a i n } } ( y ^ { \top } | z )$ . Again, by our assumption $p ( z | \pmb { x } ) \propto p ( \pmb { x } | z ) p ( z )$ . Given a good guess of the true prior, the learned representation would not be impacted by the specific attribute distribution and so generalise to $p _ { \mathrm { t e s t } } , p$ .
|
| 70 |
+
|
| 71 |
+
# 2.2 DISTRIBUTION SHIFTS
|
| 72 |
+
|
| 73 |
+
While distribution shifts can happen in a continuum, we consider three types of shifts, inspired by real-world challenges. We discuss these shifts and two additional, real-world inspired conditions.
|
| 74 |
+
|
| 75 |
+
Test distribution $p _ { \mathrm { t e s t } }$ . We assume that the attributes are distributed uniformly: $p _ { \mathrm { t e s t } } ( y ^ { 1 : K } ) =$ $1 / \prod _ { i } \left| \mathbb { A } ^ { i } \right|$ . This is desirable, as all attributes are represented and a-priori independent.
|
| 76 |
+
|
| 77 |
+
Shift 1: Spurious correlation – Attributes are correlated under $p _ { \mathrm { t r a i n } }$ but not $p _ { \mathrm { t e s t } }$ . Spurious correlation arises in the wild for a number of reasons including capture bias, environmental factors, and geographical bias (Beery et al., 2018; Torralba & Efros, 2011). These spurious correlations lead to surprising results and poor generalization. Therefore, it is important to be able to build models that are robust to such challenges. In our framework, spurious correlation arises when two attributes $y ^ { a }$ , $y ^ { b }$ are correlated at training time, but this is not true of $p _ { \mathrm { t e s t } }$ , for which attributes are independent: $p _ { \mathrm { t r a i n } } ( y ^ { a } | y ^ { 1 } \ldots y ^ { b } \ldots y ^ { K } ) ^ { \smile } > p _ { \mathrm { t r a i n } } ( y ^ { a } | y ^ { 1 } \ldots y ^ { b - 1 } , y ^ { b + 1 } \ldots y ^ { K } )$ . This is especially problematic when one attribute $y ^ { b }$ is $y ^ { l }$ , the label. Using the running DSPRITES example, shape and color may be correlated and the model may find it easier to predict color. If color is the label, the model will generalise well. However, if the aim is to predict shape, the model’s reliance on color will lead to poor generalization.
|
| 78 |
+
|
| 79 |
+
Shift 2: Low-data drift – Attribute values are unevenly distributed under $p _ { \mathrm { t r a i n } }$ but not under $p _ { \mathrm { t e s t } }$ . Low-data drift arises in the wild (e.g. in (Buolamwini & Gebru, 2018) for different ethnicities) when data has not been collected uniformly across different attributes. When deploying models in the wild, it is important to be able to reason and have confidence that the final predictions will be consistent and fair across different attributes. In the framework above, low-data shifts arise when certain values in the set $\mathbb { A } ^ { a }$ of an attribute $y ^ { a }$ are sampled with a much smaller probability than in $p _ { \mathrm { t e s t } }$ : $p _ { \mathrm { t r a i n } } ( y ^ { a } = v ) \ll p _ { \mathrm { t e s t } } ( y ^ { a } = v )$ . Using the DSPRITES example, only a handful of red shapes may be seen at training time, yet in $p _ { \mathrm { t e s t } }$ all colors are sampled with equal probability.
|
| 80 |
+
|
| 81 |
+

|
| 82 |
+
Figure 3: Spurious Correlation. We use all correlated samples and vary the number of samples $N$ from the true, uncorrelated distribution. We plot the percentage change over the baseline ResNet, averaged over all seeds and datasets. Blue is better, red worse. CYCLEGAN performs consistently best while ImageNet augmentation and pretraining on ImageNet also consistently boosts performance.
|
| 83 |
+
|
| 84 |
+

|
| 85 |
+
Figure 4: Low-data drift. We use all samples from the high data regions and vary the number of samples $N$ from the low-data region. We plot the percentage change over the baseline ResNet, averaged over all seeds and datasets. Blue is better, red worse. Pretraining on ImageNet performs consistently best, while CYCLEGAN, most domain generalization methods and ImageNet augmentation also provide some boost in performance.
|
| 86 |
+
|
| 87 |
+
Shift 3: Unseen data shift – Some attribute values are unseen under $p _ { \mathrm { t r a i n } }$ but are under $p _ { \mathrm { t e s t } }$ . This is a special case of shift 2: low-data drift which we make explicit due to its important real world applications. Unseen data shift arises when a model, trained in one setting is expected to work in another, disjoint setting. For example: a model trained to classify animals on images at certain times of day should generalise to other times of day. In our framework, unseen data shift arises when some values in the set $\mathbb { A } ^ { a }$ of an attribute $y ^ { a }$ are unseen in $p _ { \mathrm { t r a i n } }$ but are in $p _ { \mathrm { t e s t } }$ :
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
p _ { \mathrm { t r a i n } } ( y ^ { a } = v ) = 0 \qquad \quad p _ { \mathrm { t e s t } } ( y ^ { a } = v ) > 0 \qquad | \{ v | p _ { \mathrm { t r a i n } } ( y ^ { a } = v ) \} | > 1
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
This is a stronger constraint than in standard out-of-distribution generalization (see section 6), as multiple values for $\mathbb { A } ^ { a }$ must be seen under $p _ { \mathrm { t r a i n } }$ , which allows the model to learn invariance to $y ^ { a }$ . In the DSPRITES example, the color red may be unseen at train time but all colors are in $p _ { \mathrm { t e s t } }$ .
|
| 94 |
+
|
| 95 |
+
Discussion. We choose these sets of shifts as they are the building blocks of more complex distribution shifts. Consider the simplest case of two attributes: the label and a nuisance attribute. If we consider the marginal distribution of the label, it decomposes into two terms: the conditional probability and the probability of a given attribute value: $\begin{array} { r } { p ( \dot { y } ^ { l } ) = \sum _ { y ^ { a } } p ( y ^ { l } | y ^ { a } ) p ( y ^ { a } ) } \end{array}$ . The three shifts we consider control these terms independently: unseen data shift and low-data drift control $p ( y ^ { a } )$ whereas spurious correlation controls $p ( y ^ { l } | y ^ { a } )$ . The composition of these terms describes any distribution shift for these two variables.
|
| 96 |
+
|
| 97 |
+
# 2.3 CONDITIONS
|
| 98 |
+
|
| 99 |
+
Label noise. We investigate the change in performance due to noisy information. This can arise when there are disagreements and errors among the labellers (e.g. in medical imaging (Castro et al., 2020)). We model this as an observed attribute (e.g. the label) being corrupted by noise. ${ \hat { y } } ^ { i } \sim c ( y ^ { i } )$ , where $y ^ { i } \in \mathbb { A } ^ { i }$ is the true label, $\hat { y } ^ { i } \in \mathbb { A } ^ { i }$ the corrupted, observed one, and $c$ the corrupting function.
|
| 100 |
+
|
| 101 |
+
Dataset size. We investigate how performance changes with the size of the training dataset. This setting arises when it is unrealistic or expensive to collect additional data (e.g. in medical imaging or in camera trap imagery). Therefore, it is important to understand how performance degrades given fewer total samples. We do this by limiting the total number of samples from $p _ { \mathrm { t r a i n } }$ .
|
| 102 |
+
|
| 103 |
+
# 3 MODELS EVALUATED
|
| 104 |
+
|
| 105 |
+
We evaluate 19 algorithms to cover a broad range of approaches that can be used to improve model robustness to distribution shifts and demonstrate how they relate to the three ways to achieve robustness, outlined in section 2. We believe this is the first paper to comprehensively evaluate a large set of different approaches in a variety of settings. These algorithms cover the following areas: architecture choice, data augmentation, domain adaptation, adaptive approaches and representation learning. Further discussion on how these models relate to our robustness framework is in appendix E.
|
| 106 |
+
|
| 107 |
+
Architecture choice. We evaluate the following standard vision models: ResNet18, ResNet50, ResNet101 (He et al., 2016), ViT (Dosovitskiy et al., 2021), and an MLP (Vapnik, 1992). We use weighted resampling $p _ { \mathrm { r e w e i g h t } }$ to oversample from the parts of the distribution that have a lower probability of being sampled from under $p _ { \mathrm { t r a i n } }$ . Performance depends on how robust the learned representation is to distribution shift.
|
| 108 |
+
|
| 109 |
+
Heuristic data augmentation. These approaches attempt to approximate the true underlying generative model $p ( \pmb { x } | p ^ { 1 : K } )$ in order to improve robustness. We analyze the following augmentation methods: standard ImageNet augmentation (He et al., 2016), AugMix without JSD (Hendrycks et al., 2020), RandAugment (Cubuk et al., 2020), and AutoAugment (Cubuk et al., 2019). Performance depends on how well the heuristic augmentations approximate the true generative model.
|
| 110 |
+
|
| 111 |
+
Learned data augmentation. These approaches approximate the true underlying generative model $p ( \pmb { x } | \pmb { y } ^ { 1 : K } )$ by learning augmentations conditioned on the nuisance attribute. The learned augmentations can be used to transform any image $_ { \textbf { \em x } }$ to have a new attribute, while keeping the other attributes fixed. We follow Goel et al. (2020), who use CYCLEGAN (Zhu et al., 2017), but we do not use their SGDRO objective in order to evaluate the performance of learned data augmentation alone. Performance depends on how well the learned augmentations approximate the true generative model.
|
| 112 |
+
|
| 113 |
+
Domain generalization. These approaches aim to recover a representation $z$ that is independent of the attribute: $p ( y ^ { a } , z ) = p ( y ^ { a } ) p \bar { ( z ) }$ to allow generalization over that attribute. We evaluate IRM (Arjovsky et al., 2019), DeepCORAL (Sun & Saenko, 2016), domain MixUp (Gulrajani & LopezPaz, 2021), DANN (Ganin et al., 2016), and SagNet (Nam et al., 2021). Performance depends on the invariance of the learned representation $z$ .
|
| 114 |
+
|
| 115 |
+
Adaptive approaches. These works modify $p$ reweight dynamically. We evaluate JTT (Liu et al., 2021) and BN-Adapt (Schneider et al., 2020). These methods do not give performance guarantees.
|
| 116 |
+
|
| 117 |
+
Representation learning. These works aim to learn a robust representation of $z$ that describes the true prior. We evaluate using a $\beta$ -VAE (Higgins et al., 2017a) and pretraining on ImageNet (Deng et al., 2009). Performance depends on the quality of the learned representation for the specific task.
|
| 118 |
+
|
| 119 |
+
# 4 EXPERIMENTS
|
| 120 |
+
|
| 121 |
+
We first introduce the datasets and experimental setup. We evaluate the 19 different methods across these six datasets, three distribution shifts, varying label noise, and dataset size. We plot aggregate results in figures 3-7 and complete results in the appendix in figures 10-12. We discuss the results by distilling them into seven concrete takeaways in section 4.1 and four practical tips in section 4.2.
|
| 122 |
+
|
| 123 |
+
Datasets. We evaluate these approaches on six vision, classification datasets – DSPRITES (Matthey et al., 2017), MPI3D (Gondal et al., 2019), SMALLNORB (LeCun et al., 2004), SHAPES3D (Burgess & Kim, 2018), CAMELYON17 (Koh et al., 2020; Bandi et al., 2018), and IWILDCAM (Koh et al., 2020; Beery et al., 2018). These datasets consist of multiple (potentially an arbitrarily large number) attributes. We select two attributes $y ^ { l } , y ^ { a }$ for each dataset and make one $y ^ { l }$ the label. We then use these two attributes to build the three shifts. Visualizations of samples from the datasets are given in figure 2 and further description in appendix D.1. We discuss precisely how we set up the shifts, choose the attributes, and additional conditions for these datasets in appendix D.2.
|
| 124 |
+
|
| 125 |
+
Model selection. When investigating heuristic data augmentation, domain generalization, learned augmentation, adaptive approaches, and representation learning, we use a ResNet18 for the simpler, synthetic datasets (DSPRITES, MPI3D, SHAPES3D, and SMALLNORB) but a ResNet50 for the more complex, real world ones (CAMELYON17 and IWILDCAM). To perform model selection, we choose the best model according to the validation set which matches the distribution of the test set. In the unseen data shift setting for the CAMELYON17 and IWILDCAM, we use the given out-ofdistribution validation set, which is a different, distinct set in $\mathcal { D }$ that is independent of $\mathcal { D } _ { \mathrm { t r a i n } } , \mathcal { D } _ { \mathrm { t e s t } }$ . (We consider using the in-distribution validation set in appendix B.4.)
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 5: Unseen data shift. We rank the methods (where best is 1, worst 19) for each dataset and seed and plot the rankings, with the overall median rank as the black bar. Pretraining on ImageNet and ImageNet augmentation perform consistently best. DANN, CycleGAN and other heuristic augmentations perform consistently well.
|
| 129 |
+
|
| 130 |
+
Hyperparameter choices. We perform a sweep over the hyperparameters (the precise sweeps are given in appendix F.8). We run each set of hyperparameters for five seeds for each setting. To choose the best model for each seed, we perform model selection over all hyperparameters using the top-1 accuracy on the validation set. In the low-data and spurious correlation settings, we choose a different set of samples from the low-data region with each seed. We report the mean and standard deviation over the five seeds.
|
| 131 |
+
|
| 132 |
+
# 4.1 TAKEAWAYS
|
| 133 |
+
|
| 134 |
+
Takeaway 1: While we can improve over ERM, no one method always performs best. The relative performance between methods varies across datasets and shifts. Under spurious correlation (figure 3), CYCLEGAN consistently performs best but in figure 4, under low-data drift, pretraining consistently performs best. Under unseen data shift (figure 5), pretraining is again one of the best performing models. However, if we drill down on the results in figure 10 (appendix B.1), we can see pretraining performs best on the synthetic datasets, but not on CAMELYON17 (where using augmentation or DANN is best) or IWILDCAM (where using ViT or an MLP is best).
|
| 135 |
+
|
| 136 |
+
Takeaway 2: Pretraining is a powerful tool across different shifts and datasets. While pretraining is not always helpful (e.g. in appendix B.1 on CAMELYON17 in figures 10-11, IWILDCAM in figures 10-11), it often provides a strong boost in performance. This is presumably because the representation $z$ learned during pretraining is helpful for the downstream task. For example, the representation may have been trained to be invariant to certain useful properties (e.g. scale, shift, and color). If these properties are useful on the downstream tasks, then the learned representation should improve generalization.
|
| 137 |
+
|
| 138 |
+
Takeaway 3: Heuristic augmentation improves generalization if the augmentation describes an attribute. In all settings (figures 3-5), ImageNet augmentation generally improves performance. However, RandAugment, AugMix, and AutoAugment have more variable performance (as further shown in figures 10-12). These methods are compositions of different augmentations. We investigate the impact of each augmentation in RandAugment in appendix B.2 and find variable performance. Augmentations that approximate the true underlying generative model $p ( \pmb { x } | \pmb { y } ^ { 1 : K } )$ lead to the best results; otherwise, the model may waste capacity. For example, on CAMELYON17 (which consists of cell images), color jitter harms performance but on SHAPES3D and MPI3D it is essential.
|
| 139 |
+
|
| 140 |
+
Takeaway 4: Learned data augmentation is effective across different conditions and distribution shifts. This approach is highly effective in the spurious correlation setting (figure 3). It can also help in the low-data and unseen data shift settings (figure 4,5) (though the gains for these two shifts are not as large as for pretraining). The effectiveness of this approach can be explained by the fact that if the augmentations are learned perfectly, then augmented samples by design are from the true underlying generative model and can cover missing parts of the distribution.
|
| 141 |
+
|
| 142 |
+
Takeaway 5: Domain generalization algorithms offer limited performance improvement. In some cases these methods (in particular DANN) do improve performance, most notably in the lowdata drift and unseen data shift settings (figures 4-5). However, this depends on the dataset (see figures 10-12) and performance is rarely much better than using heuristic augmentation.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 6: Condition 1: Noisy labels. We vary the amount of noise $p$ in the labels. We plot the percentage change over the baseline ResNet, averaged over all seeds and datasets.
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 7: Condition 2: Fixed data. We vary the total size of the dataset $T$ . We plot the percentage change over the baseline ResNet, averaged over all seeds and datasets.
|
| 149 |
+
|
| 150 |
+
Takeaway 6: The best algorithms may differ under the precise conditions. When labels have varying noise in figure 6, relative performance is reasonably consistent. When the dataset size decreases in figure 7, heuristic augmentation methods perform poorly. However, using pretraining and learned augmentation is consistently robust.
|
| 151 |
+
|
| 152 |
+
Takeaway 7: The precise attributes we consider directly impacts the results. For example, on DSPRITES, if we make color $y ^ { l }$ and shape $y ^ { a }$ , we find that all methods generalise perfectly in the unseen data shift setting (as demonstrated in appendix B.3) unlike when shape is $y ^ { l }$ (figure 10).
|
| 153 |
+
|
| 154 |
+
# 4.2 PRACTICAL TIPS
|
| 155 |
+
|
| 156 |
+
While there is no free lunch in terms of the method to choose, we recommend the following tips.
|
| 157 |
+
|
| 158 |
+
Tip 1: If heuristic augmentations approximate part of the true underlying generative model, use them. Under this constraint, heuristic augmentations can significantly improve performance; this should be a first point of call. How to heuristically choose these augmentations without exhaustively trying all possible combinations is an open research question.
|
| 159 |
+
|
| 160 |
+
Tip 2: If heuristic augmentations do not help, learn the augmentation. If the true underlying generative model cannot be readily approximated with heuristic techniques, but some subset of the generative model can be learned by conditioning on known attributes, this is a promising way to further improve performance. How to learn the underlying generative model directly from data and use this for augmentation is a promising area to explore more thoroughly.
|
| 161 |
+
|
| 162 |
+
Tip 3: Use pretraining. In general, pretraining was found to be a useful way to learn a robust representation. While this was not true for all datasets (e.g. CAMELYON17, IWILDCAM), performance could be dramatically improved by pretraining (DSPRITES, MPI3D, SMALLNORB, SHAPES3D). An area to be investigated is the utility of self-supervised pre-training.
|
| 163 |
+
|
| 164 |
+
Tip 4: More complex approaches lead to limited improvements. Domain generalization, adaptive approaches and disentangling lead to limited improvements, if any, across the different datasets and shifts. Of these approaches, DANN performs generally best. How to make these approaches generically useful for robustness is still an open research question.
|
| 165 |
+
|
| 166 |
+
# 5 DISCUSSION
|
| 167 |
+
|
| 168 |
+
Our experiments demonstrate that no one method performs best over all shifts and that performance is dependent on the precise attribute being considered. This leads to the following considerations.
|
| 169 |
+
|
| 170 |
+
There is no way to decide a-priori on the best method given only the dataset. It would be helpful for practitioners to be able to select the best approaches without requiring comprehensive evaluations and comparisons. Moreover, it is unclear how to pinpoint the precise distribution shift (and thereby methods to explore) in a given application. This should be an important future area of investigation.
|
| 171 |
+
|
| 172 |
+
We should focus on the cases where we have knowledge about the distribution shift. We found that the ability of a given algorithm to generalize depends heavily on the attribute and dataset being considered. Instead of trying to make one algorithm for any possible shift, it makes sense to have adaptable algorithms which can use auxiliary information if given. Moreover, algorithms should be evaluated in the context for which we will use them.
|
| 173 |
+
|
| 174 |
+
It is pivotal to evaluate methods in a variety of conditions. Performance varies due to the number of examples, amount of noise, and size of the dataset. Thus it is important to perform comprehensive evaluations when comparing different methods, as in our framework. This gives others a more realistic view of different models’ relative performance in practice.
|
| 175 |
+
|
| 176 |
+
# 6 RELATED WORK
|
| 177 |
+
|
| 178 |
+
We briefly summarize benchmarks on distribution shift, leaving a complete review to appendix C.
|
| 179 |
+
|
| 180 |
+
Benchmarking robustness to out of distribution (OOD) generalization. While a multitude of methods exist that report improved OOD generalization, Gulrajani & Lopez-Paz (2021) found that in actuality no evaluated method performed significantly better than a strong ERM baseline on a variety of datasets. However, Hendrycks et al. (2021) found that, when we focus on better augmentation, larger models and pretraining, we can get a sizeable boost in performance. This can be seen on the Koh et al. (2020) benchmark (the largest boosts come from larger models and better augmentation). Our work is complementary to these methods, as we look at a range of approaches (pretraining, heuristic augmentation, learned augmentation, domain generalisation, adaptive, disentangled representations) on a range of both synthetic and real-world datasets. Moreover, we allow for a fine-grained analysis of methods over different distribution shifts.
|
| 181 |
+
|
| 182 |
+
Benchmarking spurious correlation and low-data drift. Studies on fairness and bias (surveyed by Mehrabi et al. (2021)) have demonstrated the pernicious impact of low-data in face recognition (Buolamwini & Gebru, 2018), medical imaging (Castro et al., 2020), and conservation (Beery et al., 2018) and spurious correlation in classification (Geirhos et al., 2019) and conservation (Beery et al., 2020). Arjovsky et al. (2019) hypothesized that spurious correlation may be the underlying reason for poor generalization of models to unseen data. To our knowledge, there has been no large scale work focused on understanding the benefits of different methods across these distribution shifts systematically across multiple datasets and with fine-grained control on the amount of shift. Here we introduce a framework for creating these shifts in a controllable way to allow such challenges to be investigated robustly.
|
| 183 |
+
|
| 184 |
+
Benchmarking disentangled representations. A related area, disentangled representation learning, aims to learn a representation where the factors of variation in the data are separated. If this could be achieved, then models should be able to generalise effortlessly to unseen data as investigated in multiple settings such as reinforcement learning (Higgins et al., 2017b). Despite many years of work in disentangled representations (Higgins et al., 2017a; Burgess et al., 2017; Kim & Mnih, 2018; Chen et al., 2018), a benchmark study by Locatello et al. (2019) found that, without supervision or implicit model or data assumptions, one cannot reliably perform disentanglement; however, weak supervision appears sufficient to do so (Locatello et al., 2020). Dittadi et al. (2021); Schott et al. (2021); Montero et al. (2020) further investigated whether representations (disentangled or not) can interpolate, extrapolate, or compose properties; they found that when considering complex combinations of properties and multiple datasets, representations do not do so reliably.
|
| 185 |
+
|
| 186 |
+
# 7 CONCLUSIONS
|
| 187 |
+
|
| 188 |
+
This work has put forward a general, comprehensive framework to reason about distribution shifts. We analyzed 19 different methods, spanning a range of techniques, over three distribution shifts – spurious correlation, low-data drift, and unseen data shift, and two additional conditions – label noise and dataset size. We found that while results are not consistent across datasets and methods, a number of methods do better than an ERM baseline in some settings. We then put forward a number of practical tips, promising directions, and open research questions. We hope that our framework and comprehensive benchmark spurs research on in this area and provides a useful tool for practitioners to evaluate which methods work best under which conditions and shifts.
|
| 189 |
+
|
| 190 |
+
# ACKNOWLEDGMENTS
|
| 191 |
+
|
| 192 |
+
The authors thank Irina Higgins and Timothy Mann for feedback and discussions while developing their work. They also thank Irina, Rosemary Ke, and Dilan Gorur for reviewing earlier drafts.
|
| 193 |
+
|
| 194 |
+
# REFERENCES
|
| 195 |
+
|
| 196 |
+
Ehab A AlBadawy, Ashirbani Saha, and Maciej A Mazurowski. Deep learning for segmentation of brain tumors: Impact of cross-institutional training and testing. Medical physics, 2018.
|
| 197 |
+
|
| 198 |
+
Michael A Alcorn, Qi Li, Zhitao Gong, Chengfei Wang, Long Mai, Wei-Shinn Ku, and Anh Nguyen. Strike (with) a pose: Neural networks are easily fooled by strange poses of familiar objects. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2019.
|
| 199 |
+
|
| 200 |
+
Martin Arjovsky, Leon Bottou, Ishaan Gulrajani, and David Lopez-Paz. Invariant risk minimization. ´ arXiv preprint arXiv:1907.02893, 2019.
|
| 201 |
+
|
| 202 |
+
Peter Bandi, Oscar Geessink, Quirine Manson, Marcory Van Dijk, Maschenka Balkenhol, Meyke Hermsen, Babak Ehteshami Bejnordi, Byungjae Lee, Kyunghyun Paeng, Aoxiao Zhong, et al. From detection of individual metastases to classification of lymph node status at the patient level: the CAMELYON17 challenge. IEEE Transactions on Medical Imaging, 2018.
|
| 203 |
+
|
| 204 |
+
Sara Beery, Grant Van Horn, and Pietro Perona. Recognition in terra incognita. In Proceedings of the European Conference on Computer Vision, 2018.
|
| 205 |
+
|
| 206 |
+
Sara Beery, Yang Liu, Dan Morris, Jim Piavis, Ashish Kapoor, Neel Joshi, Markus Meister, and Pietro Perona. Synthetic examples improve generalization for rare classes. In Proceedings of the IEEE Workshop on Applications of Computer Vision, 2020.
|
| 207 |
+
|
| 208 |
+
Joy Buolamwini and Timnit Gebru. Gender shades: Intersectional accuracy disparities in commercial gender classification. In Conference on fairness, accountability and transparency, 2018.
|
| 209 |
+
|
| 210 |
+
Chris Burgess and Hyunjik Kim. 3D shapes dataset. https://github.com/deepmind/3dshapes-dataset/, 2018.
|
| 211 |
+
|
| 212 |
+
Christopher P Burgess, Irina Higgins, Arka Pal, Loic Matthey, Nick Watters, Guillaume Desjardins, and Alexander Lerchner. Understanding disentangling in $\beta$ -VAE. In Workshop on Learning Disentangled Representations at the 31st Conference on Neural Information Processing Systems, 2017.
|
| 213 |
+
|
| 214 |
+
Fabio M Carlucci, Paolo Russo, Tatiana Tommasi, and Barbara Caputo. Hallucinating agnostic images to generalize across domains. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, 2019.
|
| 215 |
+
|
| 216 |
+
Daniel C Castro, Ian Walker, and Ben Glocker. Causality matters in medical imaging. Nature Communications, 2020.
|
| 217 |
+
|
| 218 |
+
Ricky TQ Chen, Xuechen Li, Roger Grosse, and David Duvenaud. Isolating sources of disentanglement in variational autoencoders. In Advances in Neural Information Processing Systems, 2018.
|
| 219 |
+
|
| 220 |
+
Xi Chen, Yan Duan, Rein Houthooft, John Schulman, Ilya Sutskever, and Pieter Abbeel. InfoGAN: Interpretable representation learning by information maximizing generative adversarial nets. In Advances in Neural Information Processing Systems, 2016.
|
| 221 |
+
|
| 222 |
+
Yunjey Choi, Minje Choi, Munyoung Kim, Jung-Woo Ha, Sunghun Kim, and Jaegul Choo. StarGan: Unified generative adversarial networks for multi-domain image-to-image translation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2018.
|
| 223 |
+
|
| 224 |
+
Ekin D Cubuk, Barret Zoph, Dandelion Mane, Vijay Vasudevan, and Quoc V Le. AutoAugment: Learning augmentation strategies from data. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2019.
|
| 225 |
+
|
| 226 |
+
Ekin D Cubuk, Barret Zoph, Jonathon Shlens, and Quoc V Le. RandAugment: Practical automated data augmentation with a reduced search space. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, 2020.
|
| 227 |
+
|
| 228 |
+
Dengxin Dai and Luc Van Gool. Dark model adaptation: Semantic image segmentation from daytime to nighttime. In International Conference on Intelligent Transportation Systems, 2018.
|
| 229 |
+
|
| 230 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2009.
|
| 231 |
+
|
| 232 |
+
Andrea Dittadi, Frederik Trauble, Francesco Locatello, Manuel W ¨ uthrich, Vaibhav Agrawal, Ole ¨ Winther, Stefan Bauer, and Bernhard Scholkopf. On the transfer of disentangled representations ¨ in realistic settings. In Proceedings of the International Conference on Learning Representations, 2021.
|
| 233 |
+
|
| 234 |
+
Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In Proceedings of the International Conference on Learning Representations, 2021.
|
| 235 |
+
|
| 236 |
+
Bradley J Erickson, Panagiotis Korfiatis, Zeynettin Akkus, and Timothy L Kline. Machine learning for medical imaging. Radiographics, 2017.
|
| 237 |
+
|
| 238 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Proceedings of the International Conference on Machine Learning, 2017.
|
| 239 |
+
|
| 240 |
+
Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, Franc¸ois Laviolette, Mario Marchand, and Victor Lempitsky. Domain-adversarial training of neural networks. Journal of Machine Learning Research, 17(1):2096–2030, 2016.
|
| 241 |
+
|
| 242 |
+
Robert Geirhos, Patricia Rubisch, Claudio Michaelis, Matthias Bethge, Felix A Wichmann, and Wieland Brendel. Imagenet-trained cnns are biased towards texture; increasing shape bias improves accuracy and robustness. In Proceedings of the International Conference on Learning Representations, 2019.
|
| 243 |
+
|
| 244 |
+
Karan Goel, Albert Gu, Yixuan Li, and Christopher Re. Model patching: Closing the subgroup ´ performance gap with data augmentation. arXiv preprint arXiv:2008.06775, 2020.
|
| 245 |
+
|
| 246 |
+
Muhammad Waleed Gondal, Manuel Wuthrich, Dorde Miladinovi ¨ c, Francesco Locatello, Martin ´ Breidt, Valentin Volchkov, Joel Akpo, Olivier Bachem, Bernhard Scholkopf, and Stefan Bauer. ¨ On the transfer of inductive bias from simulation to the real world: a new disentanglement dataset. arXiv preprint arXiv:1906.03292, 2019.
|
| 247 |
+
|
| 248 |
+
Ian J Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron C Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in Neural Information Processing Systems, 2014.
|
| 249 |
+
|
| 250 |
+
Sven Gowal, Chongli Qin, Po-Sen Huang, Taylan Cemgil, Krishnamurthy Dvijotham, Timothy Mann, and Pushmeet Kohli. Achieving robustness in the wild via adversarial mixing with disentangled representations. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2020.
|
| 251 |
+
|
| 252 |
+
Keren Gu, Xander Masotto, Vandana Bachani, Balaji Lakshminarayanan, Jack Nikodem, and Dong Yin. An instance-dependent simulation framework for learning with label noise. arXiv preprint arXiv:2107.11413, 2021.
|
| 253 |
+
|
| 254 |
+
Ishaan Gulrajani and David Lopez-Paz. In search of lost domain generalization. In Proceedings of the International Conference on Learning Representations, 2021.
|
| 255 |
+
|
| 256 |
+
Bo Han, Quanming Yao, Xingrui Yu, Gang Niu, Miao Xu, Weihua Hu, Ivor Tsang, and Masashi Sugiyama. Co-teaching: Robust training of deep neural networks with extremely noisy labels. In Advances in Neural Information Processing Systems, 2018.
|
| 257 |
+
|
| 258 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2016.
|
| 259 |
+
|
| 260 |
+
Will Douglas Heaven. Google’s medical ai was super accurate in a lab. real life was a different story., 2020.
|
| 261 |
+
|
| 262 |
+
Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In Proceedings of the International Conference on Learning Representations, 2019.
|
| 263 |
+
|
| 264 |
+
Dan Hendrycks, Mantas Mazeika, Duncan Wilson, and Kevin Gimpel. Using trusted data to train deep networks on labels corrupted by severe noise. In Advances in Neural Information Processing Systems, 2018.
|
| 265 |
+
|
| 266 |
+
Dan Hendrycks, Kimin Lee, and Mantas Mazeika. Using pre-training can improve model robustness and uncertainty. In Proceedings of the International Conference on Machine Learning, 2019.
|
| 267 |
+
|
| 268 |
+
Dan Hendrycks, Norman Mu, Ekin D Cubuk, Barret Zoph, Justin Gilmer, and Balaji Lakshminarayanan. AugMix: A simple data processing method to improve robustness and uncertainty. In Advances in Neural Information Processing Systems, 2020.
|
| 269 |
+
|
| 270 |
+
Dan Hendrycks, Steven Basart, Norman Mu, Saurav Kadavath, Frank Wang, Evan Dorundo, Rahul Desai, Tyler Zhu, Samyak Parajuli, Mike Guo, et al. The many faces of robustness: A critical analysis of out-of-distribution generalization. Proceedings of the International Conference on Computer Vision, 2021.
|
| 271 |
+
|
| 272 |
+
Irina Higgins, Loic Matthey, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew Botvinick, Shakir Mohamed, and Alexander Lerchner. $\beta$ -VAE: Learning basic visual concepts with a constrained variational framework. In Proceedings of the International Conference on Learning Representations, 2017a.
|
| 273 |
+
|
| 274 |
+
Irina Higgins, Arka Pal, Andrei Rusu, Loic Matthey, Christopher Burgess, Alexander Pritzel, Matthew Botvinick, Charles Blundell, and Alexander Lerchner. Darla: Improving zero-shot transfer in reinforcement learning. In Proceedings of the International Conference on Machine Learning, 2017b.
|
| 275 |
+
|
| 276 |
+
Joel Janai, Fatma Guney, Aseem Behl, Andreas Geiger, et al. Computer vision for autonomous ¨ vehicles: Problems, datasets and state of the art. Foundations and Trends $\textsuperscript { \textregistered }$ in Computer Graphics and Vision, 2020.
|
| 277 |
+
|
| 278 |
+
Fredrik D Johansson, David Sontag, and Rajesh Ranganath. Support and invertibility in domaininvariant representations. In The International Conference on Artificial Intelligence and Statistics. PMLR, 2019.
|
| 279 |
+
|
| 280 |
+
John Jumper, Richard Evans, Alexander Pritzel, Tim Green, Michael Figurnov, Olaf Ronneberger, Kathryn Tunyasuvunakool, Russ Bates, Augustin Zˇ ´ıdek, Anna Potapenko, Alex Bridgland, Clemens Meyer, Simon A. A. Kohl, Andrew J. Ballard, Andrew Cowie, Bernardino RomeraParedes, Stanislav Nikolov, Rishub Jain, Jonas Adler, Trevor Back, Stig Petersen, David Reiman, Ellen Clancy, Michal Zielinski, Martin Steinegger, Michalina Pacholska, Tamas Berghammer, Sebastian Bodenstein, David Silver, Oriol Vinyals, Andrew W. Senior, Koray Kavukcuoglu, Pushmeet Kohli, and Demis Hassabis. Highly accurate protein structure prediction with AlphaFold. Nature, 2021.
|
| 281 |
+
|
| 282 |
+
Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2019.
|
| 283 |
+
|
| 284 |
+
Ashish Khetan, Zachary C Lipton, and Anima Anandkumar. Learning from noisy singly-labeled data. In Proceedings of the International Conference on Learning Representations, 2018.
|
| 285 |
+
|
| 286 |
+
Hyunjik Kim and Andriy Mnih. Disentangling by factorising. In Proceedings of the International Conference on Machine Learning, 2018.
|
| 287 |
+
|
| 288 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 289 |
+
|
| 290 |
+
Pang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie, Marvin Zhang, Akshay Balsubramani, Weihua Hu, Michihiro Yasunaga, Richard Lanas Phillips, Sara Beery, Jure Leskovec, Anshul Kundaje, Emma Pierson, Sergey Levine, Chelsea Finn, and Percy Liang. WILDS: A benchmark of in-the-wild distribution shifts. arXiv preprint arXiv:2012.07421, 2020.
|
| 291 |
+
|
| 292 |
+
Yann LeCun, Fu Jie Huang, and Leon Bottou. Learning methods for generic object recognition with ´ invariance to pose and lighting. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2004.
|
| 293 |
+
|
| 294 |
+
Da Li, Yongxin Yang, Yi-Zhe Song, and Timothy M Hospedales. Deeper, broader and artier domain generalization. In Proceedings of the International Conference on Computer Vision, 2017.
|
| 295 |
+
|
| 296 |
+
Ya Li, Xinmei Tian, Mingming Gong, Yajing Liu, Tongliang Liu, Kun Zhang, and Dacheng Tao. Deep domain generalization via conditional invariant adversarial networks. In Proceedings of the European Conference on Computer Vision, pp. 624–639, 2018.
|
| 297 |
+
|
| 298 |
+
Evan Z Liu, Behzad Haghgoo, Annie S Chen, Aditi Raghunathan, Pang Wei Koh, Shiori Sagawa, Percy Liang, and Chelsea Finn. Just Train Twice: Improving group robustness without training group information. In Proceedings of the International Conference on Machine Learning, 2021.
|
| 299 |
+
|
| 300 |
+
Francesco Locatello, Stefan Bauer, Mario Lucic, Gunnar Raetsch, Sylvain Gelly, Bernhard Scholkopf, and Olivier Bachem. Challenging common assumptions in the unsupervised learn- ¨ ing of disentangled representations. In Proceedings of the International Conference on Machine Learning, 2019.
|
| 301 |
+
|
| 302 |
+
Francesco Locatello, Ben Poole, Gunnar Ratsch, Bernhard Sch ¨ olkopf, Olivier Bachem, and Michael ¨ Tschannen. Weakly-supervised disentanglement without compromises. In Proceedings of the International Conference on Machine Learning, 2020.
|
| 303 |
+
|
| 304 |
+
Mingsheng Long, Yue Cao, Jianmin Wang, and Michael Jordan. Learning transferable features with deep adaptation networks. In Proceedings of the International Conference on Machine Learning, 2015.
|
| 305 |
+
|
| 306 |
+
Mingsheng Long, Han Zhu, Jianmin Wang, and Michael I Jordan. Deep transfer learning with joint adaptation networks. In Proceedings of the International Conference on Machine Learning, 2017.
|
| 307 |
+
|
| 308 |
+
Loic Matthey, Irina Higgins, Demis Hassabis, and Alexander Lerchner. dsprites: Disentanglement testing sprites dataset. https://github.com/deepmind/dsprites-dataset/, 2017.
|
| 309 |
+
|
| 310 |
+
Ninareh Mehrabi, Fred Morstatter, Nripsuta Saxena, Kristina Lerman, and Aram Galstyan. A survey on bias and fairness in machine learning. ACM Computing Surveys (CSUR), 2021.
|
| 311 |
+
|
| 312 |
+
Milton Llera Montero, Casimir JH Ludwig, Rui Ponte Costa, Gaurav Malhotra, and Jeffrey Bowers. The role of disentanglement in generalisation. In Proceedings of the International Conference on Learning Representations, 2020.
|
| 313 |
+
|
| 314 |
+
Vinod Nair and Geoffrey E Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of the International Conference on Machine Learning, 2010.
|
| 315 |
+
|
| 316 |
+
Hyeonseob Nam, HyunJae Lee, Jongchan Park, Wonjun Yoon, and Donggeun Yoo. Reducing domain gap by reducing style bias. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2021.
|
| 317 |
+
|
| 318 |
+
Giorgio Patrini, Alessandro Rozza, Aditya Krishna Menon, Richard Nock, and Lizhen Qu. Making deep neural networks robust to label noise: A loss correction approach. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017.
|
| 319 |
+
|
| 320 |
+
Xingchao Peng, Qinxun Bai, Xide Xia, Zijun Huang, Kate Saenko, and Bo Wang. Moment matching for multi-source domain adaptation. In Proceedings of the International Conference on Computer Vision, 2019.
|
| 321 |
+
|
| 322 |
+
Christian S Perone, Pedro Ballester, Rodrigo C Barros, and Julien Cohen-Adad. Unsupervised domain adaptation for medical imaging segmentation with self-ensembling. NeuroImage, 2019.
|
| 323 |
+
|
| 324 |
+
Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision. arXiv preprint arXiv:2103.00020, 2021.
|
| 325 |
+
|
| 326 |
+
Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do imagenet classifiers generalize to imagenet? In Proceedings of the International Conference on Machine Learning, 2019.
|
| 327 |
+
|
| 328 |
+
Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In Proceedings of the International Conference on Machine Learning, 2014.
|
| 329 |
+
|
| 330 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li FeiFei. Imagenet large scale visual recognition challenge. International Journal of Computer Vision, 2015.
|
| 331 |
+
|
| 332 |
+
Shiori Sagawa, Pang Wei Koh, Tatsunori B Hashimoto, and Percy Liang. Distributionally robust neural networks for group shifts: On the importance of regularization for worst-case generalization. Proceedings of the International Conference on Learning Representations, 2020.
|
| 333 |
+
|
| 334 |
+
Steffen Schneider, Evgenia Rusak, Luisa Eck, Oliver Bringmann, Wieland Brendel, and Matthias Bethge. Improving robustness against common corruptions by covariate shift adaptation. In Proceedings of the International Conference on Learning Representations, 2020.
|
| 335 |
+
|
| 336 |
+
Lukas Schott, Julius von Kugelgen, Frederik Tr ¨ auble, Peter Gehler, Chris Russell, Matthias Bethge, ¨ Bernhard Scholkopf, Francesco Locatello, and Wieland Brendel. Visual representation learning ¨ does not generalize strongly within the same domain. In Proceedings of the International Conference on Learning Representations, 2021.
|
| 337 |
+
|
| 338 |
+
Vaishaal Shankar, Achal Dave, Rebecca Roelofs, Deva Ramanan, Benjamin Recht, and Ludwig Schmidt. Do image classifiers generalize across time? arXiv preprint arXiv:1906.02168, 2019.
|
| 339 |
+
|
| 340 |
+
Baochen Sun and Kate Saenko. Deep coral: Correlation alignment for deep domain adaptation. In Proceedings of the European Conference on Computer Vision, 2016.
|
| 341 |
+
|
| 342 |
+
Rohan Taori, Achal Dave, Vaishaal Shankar, Nicholas Carlini, Benjamin Recht, and Ludwig Schmidt. Measuring robustness to natural distribution shifts in image classification. arXiv preprint arXiv:2007.00644, 2020.
|
| 343 |
+
|
| 344 |
+
Antonio Torralba and Alexei A Efros. Unbiased look at dataset bias. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. IEEE, 2011.
|
| 345 |
+
|
| 346 |
+
Vladimir Vapnik. Principles of risk minimization for learning theory. In Advances in Neural Information Processing Systems, 1992.
|
| 347 |
+
|
| 348 |
+
Hemanth Venkateswara, Jose Eusebio, Shayok Chakraborty, and Sethuraman Panchanathan. Deep hashing network for unsupervised domain adaptation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2017.
|
| 349 |
+
|
| 350 |
+
Yufei Wang, Haoliang Li, and Alex C Kot. Heterogeneous domain generalization via domain mixup. In Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processing, 2020.
|
| 351 |
+
|
| 352 |
+
Kai Xiao, Logan Engstrom, Andrew Ilyas, and Aleksander Madry. Noise or Signal: The role of image backgrounds in object recognition. ArXiv preprint arXiv:2006.09994, 2020.
|
| 353 |
+
|
| 354 |
+
Cihang Xie and Alan Yuille. Intriguing properties of adversarial training at scale. In Proceedings of the International Conference on Learning Representations, 2020.
|
| 355 |
+
|
| 356 |
+
Minghao Xu, Jian Zhang, Bingbing Ni, Teng Li, Chengjie Wang, Qi Tian, and Wenjun Zhang. Adversarial domain adaptation with domain mixup. In AAAI Conference on Artificial Intelligence, 2020.
|
| 357 |
+
|
| 358 |
+
Shen Yan, Huan Song, Nanxiang Li, Lincan Zou, and Liu Ren. Improve unsupervised domain adaptation with mixup training. arXiv preprint arXiv:2001.00677, 2020.
|
| 359 |
+
|
| 360 |
+
Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. MixUp: Beyond empirical risk minimization. In Proceedings of the International Conference on Learning Representations, 2018.
|
| 361 |
+
|
| 362 |
+
Ling Zhang, Xiaosong Wang, Dong Yang, Thomas Sanford, Stephanie Harmon, Baris Turkbey, Holger Roth, Andriy Myronenko, Daguang Xu, and Ziyue Xu. When unseen domain generalization is unnecessary? rethinking data augmentation. arXiv preprint arXiv:1906.03347, 2019.
|
| 363 |
+
|
| 364 |
+
Han Zhao, Remi Tachet Des Combes, Kun Zhang, and Geoffrey Gordon. On learning invariant representations for domain adaptation. In Proceedings of the International Conference on Machine Learning, 2019.
|
| 365 |
+
|
| 366 |
+
Kaiyang Zhou, Yongxin Yang, Timothy Hospedales, and Tao Xiang. Deep domain-adversarial image generation for domain generalisation. In AAAI Conference on Artificial Intelligence, 2020.
|
| 367 |
+
|
| 368 |
+
Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Proceedings of the International Conference on Computer Vision, 2017.
|
md/dev/EJka_dVXEcr/EJka_dVXEcr.md
ADDED
|
@@ -0,0 +1,360 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TABDDPM: MODELLING TABULAR DATA WITH DIFFUSION MODELS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Denoising diffusion probabilistic models are currently becoming the leading paradigm of generative modeling for many important data modalities. Being the most prevalent in the computer vision community, diffusion models have also recently gained some attention in other domains, including speech, NLP, and graph-like data. In this work, we investigate if the framework of diffusion models can be advantageous for general tabular problems, where datapoints are typically represented by vectors of heterogeneous features. The inherent heterogeneity of tabular data makes it quite challenging for accurate modeling, since the individual features can be of completely different nature, i.e., some of them can be continuous and some of them can be discrete. To address such data types, we introduce TabDDPM — a diffusion model that can be universally applied to any tabular dataset and handles any type of feature. We extensively evaluate TabDDPM on a wide set of benchmarks and demonstrate its superiority over existing GAN/VAE alternatives, which is consistent with the advantage of diffusion models in other fields. Additionally, we show that TabDDPM is eligible for privacy-oriented setups, where the original datapoints cannot be publicly shared. The source code of TabDDPM and our experiments is available at https://anonymous.4open.science/r/tab-ddpm-2483.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Denoising diffusion probabilistic models (DDPM) (Sohl-Dickstein et al., 2015; Ho et al., 2020) have recently become an object of great research interest in the generative modelling community since they often outperform the alternative approaches both in terms of the realism of individual samples and their diversity (Dhariwal & Nichol, 2021). The most impressive successes of DDPM were demonstrated in the domain of natural images (Dhariwal & Nichol, 2021; Saharia et al., 2022; Rombach et al., 2022), where the advantages of diffusion models are successfully exploited in applications, such as colorization (Song et al., 2021), inpainting (Song et al., 2021), segmentation Baranchuk et al. (2021), super-resolution (Saharia et al., 2021; Li et al., 2021), semantic editing (Meng et al., 2021) and others. Beyond computer vision, the DDPM framework is also investigated in other fields, such as NLP (Austin et al., 2021; Li et al., 2022), waveform signal processing (Kong et al., 2020; Chen et al., 2020), molecular graphs (Jing et al., 2022; Hoogeboom et al., 2022), time series (Tashiro et al., 2021), testifying the universality of diffusion models across a wide range of problems.
|
| 12 |
+
|
| 13 |
+
The aim of our work is to understand if the universality of DDPM can be extended to the case of general tabular problems, which are ubiquitous in various industrial applications that include data described by a set of heterogeneous features. For many such applications, the demand for highquality generative models is especially acute because of the modern privacy regulations, like GDPR, which prevent publishing real user data, while the synthetic data produced by generative models can be shared. Training a high-quality model of tabular data, however, can be more challenging compared to computer vision or NLP due to the heterogeneity of individual features and relatively small sizes of typical tabular datasets. In our paper, we show that despite these two intricacies, the diffusion models can successfully approximate typical distributions of tabular data, leading to state-of-the-art performance on most of the benchmarks.
|
| 14 |
+
|
| 15 |
+
In more detail, the main contributions of our work are the following:
|
| 16 |
+
|
| 17 |
+
1. We introduce TabDDPM — the simplest design of DDPM for tabular problems that can be applied to any tabular task and can work with mixed data, which includes both numerical and categorical features.
|
| 18 |
+
2. We demonstrate that TabDDPM outperforms the alternative approaches designed for tabular data, including GAN-based and VAE-based models from the literature, and illustrate the sources of this advantage for several datasets.
|
| 19 |
+
3. We show that data produced by TabDDPM appears to be a “sweet spot” for privacyconcerned scenarios when synthetics are used to substitute the real user data that cannot be shared.
|
| 20 |
+
|
| 21 |
+
The source code of TabDDPM is publicly available 1.
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORK
|
| 24 |
+
|
| 25 |
+
Diffusion models (Sohl-Dickstein et al., 2015; Ho et al., 2020) are a paradigm of generative modelling that aims to approximate the target distribution by the endpoint of the Markov chain, which starts from a given parametric distribution, typically a standard Gaussian. Each Markov step is performed by a deep neural network that effectively learns to invert the diffusion process with a known Gaussian kernel. Ho et al. demonstrated the equivalence of diffusion models and score matching (Song & Ermon, 2019; 2020), showing them to be two different perspectives on the gradual conversion of a simple known distribution into a target distribution via the iterative denoising process. Several recent works (Nichol, 2021; Dhariwal & Nichol, 2021) have developed more powerful model architectures as well as different advanced learning protocols, which led to the “victory” of DDPM over GANs in terms of generative quality and diversity in the computer vision field. In our work, we demonstrate that one can also successfully use diffusion models for tabular problems.
|
| 26 |
+
|
| 27 |
+
Generative models for tabular problems are currently an active research direction in the machine learning community (Xu et al., 2019; Engelmann & Lessmann, 2021; Jordon et al., 2018; Fan et al., 2020; Torfi et al., 2022; Zhao et al., 2021; Kim et al., 2021; Zhang et al., 2021; Nock & GuillameBert, 2022; Wen et al., 2022) since high-quality synthetic data is of large demand for many tabular tasks. First, the tabular datasets are often limited in size, unlike in vision or NLP problems, for which huge “extra” data is available on the Internet. Second, proper synthetic datasets do not contain actual user data, therefore they are not subject to GDPR-like regulations and can be publicly shared without violation of anonymity. The recent works have developed a large number of models, including tabular VAEs (Xu et al., 2019) and GAN-based approaches (Xu et al., 2019; Engelmann & Lessmann, 2021; Jordon et al., 2018; Fan et al., 2020; Torfi et al., 2022; Zhao et al., 2021; Kim et al., 2021; Zhang et al., 2021; Nock & Guillame-Bert, 2022; Wen et al., 2022). By extensive evaluations on a large number of public benchmarks, we show that our TabDDPM model surpasses the existing alternatives, often by a large margin.
|
| 28 |
+
|
| 29 |
+
“Shallow” synthetics generation. Unlike unstructured images or natural texts, tabular data is typically structured, i.e., the individual features are often interpretable and it is not clear if their modelling requires several layers of “deep” architectures. Therefore, the simple interpolation techniques, like SMOTE (Chawla et al., 2002) (originally proposed to address class-imbalance) can serve as simple and powerful solutions as demonstrated in (Camino et al., 2020), where SMOTE is shown to outperform tabular GANs for minor class oversampling. In the experiments, we demonstrate the advantage of synthetics produced by TabDDPM over synthetics produced by interpolation techniques from the privacy-preserving perspective.
|
| 30 |
+
|
| 31 |
+
# 3 BACKGROUND
|
| 32 |
+
|
| 33 |
+
Diffusion models (Sohl-Dickstein et al., 2015; Ho et al., 2020) are likelihood-based generative models that handle the data through forward and reverse Markov processes. The forward process $\begin{array} { r } { q \left( x _ { 1 : T } | x _ { 0 } \right) = \prod _ { t = 1 } ^ { T } q \left( x _ { t } | x _ { t - 1 } \right) } \end{array}$ gradually adds noise to an initial sample $x _ { 0 }$ from the data distribution $q \left( x _ { 0 } \right)$ sampling noise from the predefined distributions $q \left( x _ { t } | x _ { t - 1 } \right)$ with variances $\{ \beta _ { 1 } , . . . , \beta _ { T } \}$ .
|
| 34 |
+
|
| 35 |
+
The reverse diffusion process $\begin{array} { r } { p \left( x _ { 0 : T } \right) = \prod _ { t = 1 } ^ { T } p \left( x _ { t - 1 } | x _ { t } \right) } \end{array}$ gradually denoises a latent variable $x _ { T } { \sim } q \left( x _ { T } \right)$ and allows generating new data samples from $q ( x _ { 0 } )$ . Distributions $p \left( x _ { t - 1 } | x _ { t } \right)$ are usually unknown and approximated by a neural network with parameters $\theta$ . These parameters are learned from the data by optimizing a variational lower bound:
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\mathrm { o g } q \left( x _ { 0 } \right) \geq \mathbb { E } _ { q \left( x \right) } \Big [ \underbrace { \log p \theta \left( x _ { 0 } \vert x _ { 1 } \right) } _ { L _ { 0 } } - \underbrace { K L \left( q \left( x _ { T } \vert x _ { 0 } \right) \vert q \left( x _ { T } \right) \right) } _ { L _ { T } } - \sum _ { t = 2 } ^ { T } \underbrace { K L \left( q \left( x _ { t - 1 } \vert x _ { t } , x _ { 0 } \right) \vert p \varrho \left( x _ { t - 1 } \vert x _ { t } \right) \right) } _ { L _ { t } } \Big ]
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
Gaussian diffusion models operate in continuous spaces $( x _ { t } \in \mathbb { R } ^ { n } )$ where forward and reverse processes are characterized by Gaussian distributions:
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\begin{array} { l } { q \left( { { x } _ { t } } | { { x } _ { t - 1 } } \right) : = \mathcal { N } \left( { { x } _ { t } } ; \sqrt { 1 - { \beta _ { t } } } { { x } _ { t - 1 } } , { { \beta } _ { t } } I \right) } \\ { q \left( { { x } _ { T } } \right) : = \mathcal { N } \left( { { x } _ { T } } ; 0 , I \right) } \\ { p _ { \theta } \left( { { x } _ { t - 1 } } | { { x } _ { t } } \right) : = \mathcal { N } \left( { { x } _ { t - 1 } } ; { { \mu } _ { \theta } } \left( { { x } _ { t } } , t \right) , { { \Sigma } _ { \theta } } \left( { { x } _ { t } } , t \right) \right) } \end{array}
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
Ho et al. (2020) suggest using diagonal $\Sigma _ { \theta } \left( x _ { t } , t \right)$ with a constant $\sigma _ { t }$ and computing $\mu _ { \theta } \left( x _ { t } , t \right)$ as a function of $x _ { t }$ and $\epsilon _ { \theta } ( x _ { t } , t )$ :
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\mu _ { \theta } \left( x _ { t } , t \right) = \frac { 1 } { \sqrt { \alpha _ { t } } } \left( x _ { t } - \frac { \beta _ { t } } { \sqrt { 1 - \bar { \alpha } _ { t } } } \epsilon _ { \theta } \left( x _ { t } , t \right) \right)
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where $\alpha _ { t } : = 1 - \beta _ { t }$ , $\textstyle { \bar { \alpha } } _ { t } : = \prod _ { i \leq t } \alpha _ { i }$ and $\epsilon _ { \theta } ( x _ { t } , t )$ predicts a “groundtruth” noise component $\epsilon$ for the noisy data sample $x _ { t }$ . In practice, the objective (1) can be simplified to the sum of mean-squared errors between $\epsilon _ { \theta } ( x _ { t } , t )$ and $\epsilon$ over all timesteps $t$ :
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
L _ { t } ^ { s i m p l e } = \mathbb { E } _ { x _ { 0 } , \epsilon , t } \lVert \epsilon - \epsilon _ { \theta } ( x _ { t } , t ) \rVert _ { 2 } ^ { 2 }
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
Multinomial diffusion models (Hoogeboom et al., 2021) are designed to generate categorical data where $x _ { t } \in \{ 0 , 1 \} ^ { K }$ is a one-hot encoded categorical variable with $K$ values. The multinomial forward diffusion process defines $q \left( x _ { t } | x _ { t - 1 } \right)$ as a categorical distribution that corrupts the data by uniform noise over $K$ classes:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\begin{array} { l } { q ( x _ { t } | x _ { t - 1 } ) : = C a t \left( x _ { t } ; \left( 1 - \beta _ { t } \right) x _ { t - 1 } + \beta _ { t } / K \right) } \\ { q \left( x _ { T } \right) : = C a t \left( x _ { T } ; 1 / K \right) } \\ { q \left( x _ { t } | x _ { 0 } \right) = C a t \left( x _ { t } ; \bar { \alpha } _ { t } x _ { 0 } + \left( 1 - \bar { \alpha } _ { t } \right) / K \right) } \end{array}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
From the equations above, the posterior $q ( x _ { t - 1 } | x _ { t } , x _ { 0 } )$ can be derived:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
q \left( x _ { t - 1 } | x _ { t } , x _ { 0 } \right) = C a t \left( x _ { t - 1 } ; \pi / \sum _ { k = 1 } ^ { K } \pi _ { k } \right)
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
The reverse distribution $p _ { \theta } \left( x _ { t - 1 } | x _ { t } \right)$ is parameterized as $q \left( x _ { t - 1 } | x _ { t } , \hat { x } _ { 0 } ( x _ { t } , t ) \right)$ , where $\scriptstyle { \hat { x } } _ { 0 }$ is predicted by a neural network. Then, the model is trained to maximize the variational lower bound (1).
|
| 72 |
+
|
| 73 |
+
# 4 TABDDPM
|
| 74 |
+
|
| 75 |
+
In this section, we describe the design of TabDDPM as well as its main hyperparameters, which affect the model’s effectiveness.
|
| 76 |
+
|
| 77 |
+
TabDDPM uses the multinomial diffusion to model the categorical and binary features, and the Gaussian diffusion to model the numerical ones. In more detail, for a tabular data sample $x = [ x _ { n u m } , x _ { c a t _ { 1 } } , . . . , x _ { c a t _ { C } } ]$ , that consists of $N _ { n u m }$ numerical features $x _ { n u m } \in \mathbb { R } ^ { N _ { n u m } }$ and $C$ categorical features with $K _ { i }$ categories each, our model takes one-hot encoded versions of categorical feafore, the input es as an input (i.e. has a dimensionalit $x _ { c a t _ { i } } ^ { o \tilde { h } e } \in \{ 0 , 1 \} ^ { K _ { i } } )$ normalized numerical features. There-. For preprocessing, we use the gaussian $x _ { 0 }$ $( N _ { n u m } + \sum K _ { i } )$
|
| 78 |
+
|
| 79 |
+

|
| 80 |
+
Figure 1: TabDDPM scheme for classification problems; $t$ , $y$ and $\ell$ denote a diffusion timestep, a class label, and logits, respectively.
|
| 81 |
+
|
| 82 |
+
quantile transformation from the scikit-learn library (Pedregosa et al., 2011). Each categorical feature is handled by a separate forward diffusion process, i.e., the noise components for all features are sampled independently. The reverse diffusion step in TabDDPM is modelled by a multi-layer neural network that has annates are the predictions of utput of the same dimensionality as for the Gaussian diffusion and the r $x _ { 0 }$ , where the first are the predictio $N _ { n u m }$ rdi-for $\epsilon$ $x _ { c a t _ { i } } ^ { o h e }$
|
| 83 |
+
|
| 84 |
+
The TabDDPM model for the classification problems is schematically presented on Figure 1. The model is trained by minimizing a sum of mean-squared error $L _ { t } ^ { s i m p l e }$ (Equation (2)) for the Gaussian diffusion term and the KL divergences $L _ { t } ^ { i }$ for each multinomial diffusion term (Equation (1)). The total loss of multinomial diffusions is additionally divided by the number of categorical features.
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
L _ { t } ^ { T a b D D P M } = L _ { t } ^ { s i m p l e } + \frac { \sum _ { i \leq C } L _ { t } ^ { i } } { C }
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
For classification datasets, we use a classconditional model, i.e. $p _ { \theta } ( x _ { t - 1 } | x _ { t } , y )$ is learned. For regression datasets, we consider a target value as an additional numerical feature, and the joint distribution is learned.
|
| 91 |
+
|
| 92 |
+
Table 1: The main hyperparameters of TabDDPM.
|
| 93 |
+
|
| 94 |
+
<table><tr><td>Hyperparameter</td><td>Search space</td></tr><tr><td>Learning rate Batch size Diffusion timesteps Training iterations #MLPlayers</td><td>LogUniform[0.00001,0.003] Cat{256,4096} Cat{100,1000} Cat{5000,10000,20000} Int{2,4,6,8}</td></tr><tr><td>MLP width of layers Proportion of samples</td><td>Int{128,256,512,1024} Float{0.25,0.5,1,2,4,8}</td></tr><tr><td>Dropout</td><td></td></tr><tr><td>Scheduler</td><td>0.0</td></tr><tr><td>Gaussian diffusion loss</td><td>cosine (Nichol, 2021)</td></tr><tr><td></td><td></td></tr><tr><td>Number of tuning trials 50</td><td>MSE</td></tr></table>
|
| 95 |
+
|
| 96 |
+
To model the reverse process, we use a simple MLP architecture adapted from (Gorishniy et al., 2021):
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\begin{array} { r l } & { \mathtt { M L P } ( x ) = \mathtt { L i n e a r } \left( \mathtt { M L P B 1 o c k } \left( \dots \left( \mathtt { M L P B 1 o c k } ( x ) \right) \right) \right) } \\ & { \mathtt { M L P B 1 o c k } ( x ) = \mathtt { D r o p o u t } \left( \mathtt { R e L U } \left( \mathtt { L i n e a r } ( x ) \right) \right) } \end{array}
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
As in (Nichol, 2021; Dhariwal & Nichol, 2021), a tabular input $x _ { i n }$ , a timestep $t$ , and a class label $y$ are processed as follows.
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\begin{array} { l } { t . e m b = \mathtt { L i n e a r } ( \mathtt { S i L U } ( \mathtt { L i n e a r } ( \mathtt { S i n T i m e E m b } ( t ) ) ) ) } \\ { y . e m b = \mathtt { E m b e d d i n g } ( y ) } \\ { x = \mathtt { L i n e a r } ( x _ { i n } ) + t . e m b + y . e m b } \end{array}
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
where SinTimeEmb refers to a sinusoidal time embedding as in (Nichol, 2021; Dhariwal & Nichol, 2021) with a dimension of 128. All Linear layers in Equation 5 have a fixed projection dimension 128.
|
| 109 |
+
|
| 110 |
+
Table 2: List of datasets used for the evaluation and their descriptions.
|
| 111 |
+
|
| 112 |
+
<table><tr><td>Abbr</td><td>Name</td><td>#Train</td><td># Validation</td><td>#Test</td><td>#Num #Cat</td><td></td><td>Task type</td></tr><tr><td>AB</td><td>Abalone</td><td>2672</td><td>669</td><td>836</td><td>7</td><td>1</td><td>Regression</td></tr><tr><td>AD</td><td>Adult ROC</td><td>26048</td><td>6513</td><td>16281</td><td>6</td><td>8</td><td>Binclass</td></tr><tr><td>BU</td><td>Buddy</td><td>12053</td><td>3014</td><td>3767</td><td>4</td><td>5</td><td>Multiclass</td></tr><tr><td>CA</td><td>California Housing</td><td>13209</td><td>3303</td><td>4128</td><td>8</td><td>0</td><td>Regression</td></tr><tr><td>CAR</td><td>Cardio</td><td>44800</td><td>11200</td><td>14000</td><td>5</td><td>6</td><td>Binclass</td></tr><tr><td>CH</td><td>Churn Modelling</td><td>6400</td><td>1600</td><td>2000</td><td>7</td><td>4</td><td>Binclass</td></tr><tr><td>DE</td><td>Default</td><td>19200</td><td>4800</td><td>6000</td><td>20</td><td>3</td><td>Binclass</td></tr><tr><td>DI</td><td>Diabetes</td><td>491</td><td>123</td><td>154</td><td>8</td><td>0</td><td>Binclass</td></tr><tr><td>FB</td><td>Facebook Comments Volume 157638</td><td></td><td>19722</td><td>19720</td><td>50</td><td>1</td><td>Regression</td></tr><tr><td>GE</td><td>Gesture Phase</td><td>6318</td><td>1580</td><td>1975</td><td>32</td><td>0</td><td>Multiclass</td></tr><tr><td>HI</td><td>Higgs Small</td><td>62751</td><td>15688</td><td>19610</td><td>28</td><td>0</td><td>Binclass</td></tr><tr><td>HO</td><td>House 16H</td><td>14581</td><td>3646</td><td>4557</td><td>16</td><td>0</td><td>Regression</td></tr><tr><td>IN</td><td>Insurance</td><td>856</td><td>214</td><td>268</td><td>3</td><td>3</td><td>Regression</td></tr><tr><td>KI</td><td>King</td><td>13832</td><td>3458</td><td>4323</td><td>17</td><td>3</td><td>Regression</td></tr><tr><td>MI</td><td>MiniBooNE</td><td>83240</td><td>20811</td><td>26013</td><td>50</td><td>0</td><td>Binclass</td></tr><tr><td>WI</td><td>Wilt</td><td>3096</td><td>775</td><td>968</td><td>5</td><td>0</td><td>Binclass</td></tr></table>
|
| 113 |
+
|
| 114 |
+
Hyperparameters in TabDDPM are essential since in the experiments we observed them having a strong influence on the model effectiveness. Table 1 lists the main hyperparameters as well as the search spaces for each of them, which we recommend to use. The process of tuning is described in detail in the experimental section.
|
| 115 |
+
|
| 116 |
+
# 5 EXPERIMENTS
|
| 117 |
+
|
| 118 |
+
In this section, we extensively evaluate TabDDPM against existing alternatives.
|
| 119 |
+
|
| 120 |
+
Datasets. For systematic investigation of the performance of tabular generative models, we consider a diverse set of 15 real-world public datasets. These datasets have various sizes, nature, number of features, and their distributions. Most datasets were previously used for tabular model evaluation in (Zhao et al., 2021; Gorishniy et al., 2021). The full list of datasets and their properties are presented in Table 2.
|
| 121 |
+
|
| 122 |
+
Baselines. Since the number of generative models proposed for tabular data is enormous, we evaluate TabDDPM only against the leading approaches from each paradigm of generative modelling. Also, we consider only the baselines with the published source code.
|
| 123 |
+
|
| 124 |
+
• TVAE (Xu et al., 2019) — the state-of-the-art variational auto-encoder for tabular data generation. To the best of our knowledge, there are no alternative VAE-like models that outperform TVAE and have public source code.
|
| 125 |
+
• CTABGAN (Zhao et al., 2021) — a recent GAN-based model that is shown to outperform the existing tabular GANs on a diverse set of benchmarks. This approach cannot handle regression tasks. CTABGAN $\mathbf { + }$ (Zhao et al., 2022) — an extension of the CTABGAN model that was published in the very recent preprint. We are not aware of the GAN-based model for tabular data that is proposed after CTABGAN+ and has a public source code.
|
| 126 |
+
• SMOTE (Chawla et al., 2002) — a “shallow” interpolation-based method that ”generates” a synthetic point as a convex combination of a real data point and its $k$ -th nearest neighbor from the dataset. This method was originally proposed for minor class oversampling. Here, we generalize it and apply it to synthetic data generation as a simple sanity check.
|
| 127 |
+
|
| 128 |
+
Evaluation measure. Our primary evaluation measure is machine learning (ML) efficiency (or utility) (Xu et al., 2019). In more detail, ML efficiency quantifies the performance of classification or regression models that are trained on synthetic data and evaluated on the real test set. Intuitively, models trained on high-quality synthetics should be competitive (or even superior) to models trained on real data. In our experiments, we use two evaluation protocols to compute ML efficiency. In the first protocol, which is more common in the literature (Xu et al., 2019; Zhao et al., 2021; Kim et al., 2022), we compute an average efficiency with respect to a set of diverse ML models (logistic regression, decision tree, and others). In the second protocol, we evaluate ML efficiency only with respect to the CatBoost model (Prokhorenkova et al., 2018), which is arguably the leading GBDT implementation providing state-of-the-art performance on tabular tasks Gorishniy et al. (2021). In our experiments in subsection 5.2, we show that it is crucial to use the second protocol, while the first one can often be misleading.
|
| 129 |
+
|
| 130 |
+

|
| 131 |
+
Figure 2: The individual feature distributions for the real data and the data generated by TabDDPM, CTABGAN+, and TVAE. TabDDPM produces more realistic feature distributions than alternatives in most cases.
|
| 132 |
+
|
| 133 |
+
Tuning process. To tune the hyperparameters of TabDDPM and the baselines, we use the Optuna library (Akiba et al., 2019). The tuning process is guided by the values of the ML efficiency (with respect to Catboost) of the generated synthetic data on a hold-out validation dataset (the score is averaged over five different sampling seeds). The search spaces for all hyperparameters of TabDDPM are reported in Table 1 (for baselines — in Appendix C). Additionally, we demonstrate that tuning the hyperparameters using the CatBoost guidance does not introduce any sort of “Catboost-biasedness”, and the Catboost-tuned TabDDPM produces synthetics that are also superior for other models, like MLP. These results are reported in Appendix A.
|
| 134 |
+
|
| 135 |
+
# 5.1 QUALITATIVE COMPARISON
|
| 136 |
+
|
| 137 |
+
Here, we qualitatively investigate the ability of TabDDPM to model the individual and joint feature distributions compared to the TVAE and CTABGAN $^ +$ baselines. In particular, for each dataset, we sample a synthetic dataset from TabDDPM, TVAE, and CTABGAN $^ +$ of the same size as a real train set in a particular dataset. For classification datasets, each class is sampled according to its proportion in the real dataset. Then, we visualize the typical individual feature distributions for real and synthetic data in Figure 2. For completeness, the features of different types and distributions are presented. In most cases, TabDDPM produces more realistic feature distributions compared to TVAE and CTABGAN+. The advantage is more pronounced (1) for numerical features, which are uniformly distributed, (2) for categorical features with high cardinality, and (3) for mixed type features that combine continuous and discrete distributions. Then, we also visualize the differences between the correlation matrices computed on real and synthetic data for different datasets, see Figure 3. To compute the correlation matrices, we use the Pearson correlation coefficient for numerical-numerical correlations, the correlation Ratio for categorical-numerical cases, and Theil’s U statistic between categorical features. Compared to CTABGAN+ and TVAE, TabDDPM generates synthetic datasets with more realistic pairwise correlations. These illustrations indicate that our TabDDPM model is more flexible compared to alternatives and produces superior synthetic data.
|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
Figure 3: The absolute difference between correlation matrices computed on real and synthetic datasets. A more intensive red colour indicates a higher difference between the real and synthetic correlation values.
|
| 141 |
+
|
| 142 |
+
# 5.2 MACHINE LEARNING EFFICIENCY
|
| 143 |
+
|
| 144 |
+
In this section, we compare TabDDPM to alternative generative models in terms of machine learning efficiency. From each generative model, we sample a synthetic dataset with the size of a real train set in proportion from Table 1. This synthetic data is then used to train a classification/regression model, which is then evaluated using the real test set. In our experiments, classification performance is evaluated by the F1 score, and regression performance is evaluated by the R2 score. We use two protocols:
|
| 145 |
+
|
| 146 |
+
1. First, we compute average ML efficiency for a diverse set of ML models, as performed in previous works (Xu et al., 2019; Zhao et al., 2021; Kim et al., 2022). This set includes Decision Tree, Random Forest, Logistic Regression (or Ridge Regression) and MLP models from the scikit-learn library (Pedregosa et al., 2011) with the default hyperparameters except for “max-depth” equals 28 for Decision Tree and Random Forest, “maximum iterations” equals 500 for Logistic and Ridge regressions, and “maximum iterations” equals 100 for MLPs.
|
| 147 |
+
2. Second, we compute ML efficiency with respect to the current state-of-the-art model for tabular data. Specifically, we consider CatBoost (Prokhorenkova et al., 2018) and MLP architecture from (Gorishniy et al., 2021) for evaluation. CatBoost and MLP hyperparameters are thoroughly tuned on each dataset using the search spaces from (Gorishniy et al., 2021). We argue that this evaluation protocol demonstrates the practical value of synthetic data more reliably since in most real scenarios practitioners are not interested in using weak and suboptimal classifiers/regressors.
|
| 148 |
+
|
| 149 |
+
Main results. The ML efficiency values computed by both protocols are presented in Table 3 and in Table 4. The ML efficiency for the tuned MLP is reported in Appendix A. To compute each value, we average the results over five random seeds for synthetics generation, and for each generated
|
| 150 |
+
|
| 151 |
+
<table><tr><td></td><td>AB (R2)</td><td>AD (F1)</td><td>BU (F1)</td><td>CA (R2)</td><td>CAR (F1)</td><td>CH(F1)</td><td>DE (F1)</td><td>DI(F1)</td></tr><tr><td>TVAE</td><td>0.238±.012</td><td>0.742±.001</td><td>0.779±.004</td><td>-13.0±1.51</td><td>0.693±.002</td><td>0.684±.003</td><td>0.643±.003</td><td>0.712±.010</td></tr><tr><td>CTABGAN</td><td></td><td>0.737±.007</td><td>0.786±.008</td><td>1</td><td>0.684±.003</td><td>0.636±.010</td><td>0.614±.007</td><td>0.655±.015</td></tr><tr><td>CTABGAN+</td><td>0.316±.024</td><td>0.730±.007</td><td>0.837±.006</td><td>-7.59±.645</td><td>0.708±.002</td><td>0.650±.008</td><td>0.648±.008</td><td>0.727±.023</td></tr><tr><td>SMOTE</td><td>0.400±.009</td><td>0.750±.004</td><td>0.842±.003</td><td>0.667±.006</td><td>0.693±.001</td><td>0.690±.003</td><td>0.649±.003</td><td>0.677±.013</td></tr><tr><td>TabDDPM</td><td>0.392±.009</td><td>0.758±.005</td><td></td><td>0.851±.003 0.695±.002</td><td>0.696±.001</td><td>0.693±.003 0.659±.003</td><td></td><td>0.675±.011</td></tr><tr><td>Real</td><td>0.423±.009</td><td>0.750±.006</td><td>0.845±.004</td><td>0.663±.002</td><td>0.683±.002</td><td>0.679±.003</td><td>0.648±.003</td><td>0.699±.012</td></tr><tr><td></td><td>FB (R2)</td><td>GE(F1)</td><td>HI (F1)</td><td>HO (R2)</td><td>IN (R2)</td><td>KI (R2)</td><td>MI (F1)</td><td>WI (F1)</td></tr><tr><td>TVAE</td><td>《0</td><td>0.372±.006</td><td>0.590±.004</td><td>0.174±.012</td><td>0.470±.024</td><td>0.666±.006</td><td>0.880±.002</td><td>0.497±.001</td></tr><tr><td>CTABGAN</td><td>1</td><td>0.339±.009</td><td>0.539±.006</td><td>1</td><td>一</td><td>1</td><td>0.856±.003</td><td>0.656±.011</td></tr><tr><td>CTABGAN+</td><td>《0</td><td>0.373±.009</td><td>0.598±.004</td><td>0.222±.042</td><td>0.669±.018</td><td>0.197±.051</td><td>0.867±.002</td><td>0.653±.027</td></tr><tr><td>SMOTE</td><td>0.651±.002</td><td>0.478±.005</td><td>0.664±.003</td><td>0.394±.006</td><td>0.709±.008</td><td>0.751±.005</td><td>0.860±.001</td><td>0.793±.004</td></tr><tr><td>TabDDPM</td><td>0.527±.005</td><td>0.462±.005</td><td>0.670±.002</td><td>0.426±.007</td><td>0.734±.007</td><td>0.611±.013</td><td>0.850±.004</td><td>0.792±.004</td></tr><tr><td>Real</td><td>0.645±.005</td><td>0.431±.005</td><td>0.663±.002</td><td>0.415±.007</td><td>0.708±.007</td><td>0.768±.013</td><td>0.850±.004</td><td>0.684±.004</td></tr></table>
|
| 152 |
+
|
| 153 |
+
Table 3: The values of machine learning efficiency computed with regards to five weak classification/regression models. Negative scores denote negative R2, which means that performance is worse than an optimal constant prediction.
|
| 154 |
+
|
| 155 |
+
<table><tr><td></td><td>AB (R2)</td><td>AD (F1)</td><td>BU (F1)</td><td>CA (R2)</td><td>CAR (F1)</td><td>CH(F1)</td><td>DE(F1)</td><td>DI (F1)</td></tr><tr><td>TVAE</td><td>0.433±.008</td><td>0.781±.002</td><td>0.864±.005</td><td>0.752±.001</td><td>0.717±.001</td><td>0.732±.006</td><td>0.656±.007</td><td>0.714±.039</td></tr><tr><td>CTABGAN</td><td></td><td>0.783±.002</td><td>0.855±.005</td><td>1</td><td>0.717±.001</td><td>0.688±.006</td><td>0.644±.011</td><td>0.731±.022</td></tr><tr><td>CTABGAN+</td><td>0.467±.004</td><td>0.772±.003</td><td>0.884±.005</td><td>0.525±.004</td><td>0.733±.001</td><td>0.702±.012</td><td>0.686±.004</td><td>0.734±.020</td></tr><tr><td>SMOTE</td><td>0.549±.005</td><td>0.791±.002</td><td>0.891±.003</td><td>0.840±.001</td><td>0.732±.001</td><td>0.743±.005</td><td>0.693±.003</td><td>0.683±.037</td></tr><tr><td>TabDDPM</td><td>0.550±.010</td><td>0.795±.001</td><td>0.906±.003</td><td>0.836±.002</td><td>0.737±.001</td><td>0.755±.006 0.691±.004</td><td></td><td>0.740±.020</td></tr><tr><td>Real</td><td>0.556±.004</td><td>0.815±.002</td><td>0.906±.002</td><td>0.857±.001</td><td>0.738±.001</td><td>0.740±.009</td><td>0.688±.003</td><td>0.785±.013</td></tr><tr><td></td><td>FB (R2)</td><td>GE(F1)</td><td>HI (F1)</td><td>HO (R2)</td><td>IN (R2)</td><td>KI (R2)</td><td>MI (F1)</td><td>WI (F1)</td></tr><tr><td>TVAE</td><td>0.685±.003</td><td>0.434±.006</td><td>0.638±.003</td><td>0.493±.006</td><td>0.784±.010</td><td>0.824±.003</td><td>0.912±.001</td><td>0.501±.012</td></tr><tr><td>CTABGAN</td><td></td><td>0.392±.006</td><td>0.575±.004</td><td>1</td><td></td><td>1</td><td>0.889±.002</td><td>0.906±.019</td></tr><tr><td>CTABGAN+</td><td>0.509±.011</td><td>0.406±.009</td><td>0.664±.002</td><td>0.504±.005</td><td>0.797±.005</td><td>0.444±.014</td><td>0.892±.002</td><td>0.798±.021</td></tr><tr><td>SMOTE</td><td>0.803±.002</td><td>0.658±.007</td><td>0.722±.001</td><td>0.662±.004</td><td>0.812±.002</td><td>0.842±.004</td><td>0.932±.001</td><td>0.913±.007</td></tr><tr><td>TabDDPM</td><td>0.713±.002</td><td>0.597±.006</td><td>0.722±.001</td><td>0.677±.010</td><td>0.809±.002</td><td>0.833±.014</td><td>0.936±.001</td><td>0.904±.009</td></tr><tr><td>Real</td><td>0.837±.001</td><td>0.636±.007</td><td>0.724±.001</td><td>0.662±.003</td><td>0.814±.001</td><td>0.907±.002</td><td>0.934±.000</td><td>0.898±.006</td></tr></table>
|
| 156 |
+
|
| 157 |
+
Table 4: The values of machine learning efficiency computed with regards to the state-of-the-art tuned CatBoost model.
|
| 158 |
+
|
| 159 |
+
dataset, we average over ten random seeds for training classifiers/regressors. The key observations are described below:
|
| 160 |
+
|
| 161 |
+
• In both evaluation protocols, TabDDPM significantly outperforms TVAE and CTABGAN $^ +$ on most datasets, which highlights the advantage of diffusion models for tabular data as well as demonstrated for other domains in prior works. The interpolation-based SMOTE method demonstrates the performance competitive to TabDDPM and often significantly outperforms the GAN/VAE approaches. Interestingly, most of the prior works on generative models for tabular data do not compare against SMOTE, while it appears to be a simple baseline, which is challenging to beat. While many prior works use the first evaluation protocol to compute the ML efficiency, we argue that the second one (which uses the state-of-the-art model, like CatBoost) is more appropriate. Table 3 and Table 4 show that the absolute values of classification/regression performance are much lower for the first protocol, i.e., weak classifiers/regressors are substantially inferior to CatBoost on the considered benchmarks. Therefore, one can hardly use these suboptimal models instead of CatBoost and their performance values are uninformative for practitioners. Moreover, in the first protocol, training on synthetic data is often advantageous compared to training on real data. This creates an impression that the data produced by generative models are more valuable than the real ones. However, it is not the case when one uses the tuned ML model, as in most practical scenarios. Appendix A confirms this observation for the properly tuned MLP model.
|
| 162 |
+
|
| 163 |
+
Overall, TabDDPM provides state-of-the-art generative performance and can be used as a source of high-quality synthetic data. Interestingly, in terms of ML efficiency, a simple “shallow” SMOTE method is competitive to TabDDPM, which raises the question if sophisticated deep generative models are needed. In the section below, we provide an affirmative answer to this question.
|
| 164 |
+
|
| 165 |
+
# 5.3 PRIVACY
|
| 166 |
+
|
| 167 |
+
Here, we demonstrate that TabDDPM is preferable to SMOTE in setups with privacy concerns, e.g., sharing the data without disclosure of personal or sensitive information. In these setups, one is interested in high-quality synthetics that do not reveal the datapoints from the original real dataset. To quantify the privacy of synthetic, we use a median Distance to Closest Record (DCR) (Zhao et al., 2021) between synthetic and real datapoints. Specifically, for each synthetic sample, we find the minimum distance to real datapoints and take the median of these distances. Low DCR values indicate that all synthetic samples are essentially copies of some real datapoints, which violates the privacy requirements. In contrast, larger DCR values indicate that the generative model can produce something “new” rather than just copies of real data. Table 5 compares the DCR values for SMOTE and TabDDPM and demonstrates the advantage of TabDDPM consistently for all datasets. We also visualize histograms of the minimal synthetic-to-real distances on Figure 4. For SMOTE, most distance values are concentrated around zero, while TabDDPM samples are better separated from real datapoints. This experiment confirms that TabDDPM synthetics while providing high ML efficiency, are also more appropriate for privacy-concerned scenarios.
|
| 168 |
+
|
| 169 |
+
<table><tr><td></td><td colspan="2">AB</td><td colspan="2">AD</td><td colspan="2">BU</td><td colspan="2">CA</td><td colspan="2">CAR</td><td colspan="2">CH</td><td colspan="2">DE</td><td colspan="2">DI</td></tr><tr><td></td><td>score</td><td>DCR</td><td>score</td><td>DCR</td><td>score</td><td>DCR</td><td>score</td><td>DCR</td><td>score</td><td>DCR</td><td>score</td><td>DCR</td><td>score</td><td>DCR</td><td>score</td><td>DCR</td></tr><tr><td>SMOTE TabDDPM 0.550</td><td>0.549</td><td>0.014 0.050</td><td>0.791 0.795</td><td>0.024 0.104 0.906</td><td>0.891</td><td>0.054</td><td>0.840 0.143 0.836</td><td>0.014 0.041</td><td>0.732 0.737</td><td>0.007 0.012</td><td>0.743 0.755</td><td>0.077 0.157</td><td>0.693 0.691</td><td>0.027 0.112</td><td>0.683 0.740</td><td>0.068 0.204</td></tr><tr><td></td><td>FB</td><td></td><td>GE</td><td></td><td>HI</td><td></td><td>HO</td><td></td><td>IN</td><td></td><td>KI</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>score</td><td>DCR</td><td>score</td><td>DCR</td><td>score</td><td>DCR</td><td>score</td><td>DCR</td><td>score</td><td>DCR</td><td>score</td><td>DCR</td><td></td><td>MI DCR</td><td></td><td>WI</td></tr><tr><td>SMOTE</td><td>0.803</td><td>0.027</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>score</td><td></td><td>score</td><td>DCR</td></tr><tr><td>TabDDPM</td><td>0.713</td><td>0.112</td><td>0.658 0.597</td><td>0.023 0.059</td><td>0.722 0.722</td><td>0.319 0.449</td><td>0.662 0.677</td><td>0.056 0.086</td><td>0.812 0.809</td><td>0.030 0.041</td><td>0.842 0.833</td><td>0.066 0.189</td><td>0.932 0.936</td><td>0.016 0.022</td><td>0.913 0.904</td><td>0.007 0.016</td></tr></table>
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Table 5: ML efficiency CatBoost scores and privacy scores for SMOTE and TabDDPM models.
|
| 173 |
+
Figure 4: Histograms of minimal synthetic-to-real distances for TabDDM and SMOTE.
|
| 174 |
+
|
| 175 |
+
# 6 CONCLUSION
|
| 176 |
+
|
| 177 |
+
In this paper, we have investigated the prospect of the diffusion modelling framework in the field of tabular data. In particular, we have described the design of DDPM that can handle mixed data consisting of numerical, ordinal, and categorical features. We also demonstrate the importance of the model’s hyperparameters and explain the protocol of their tuning. For the most considered benchmarks, the synthetics produced by our model has consistently higher quality compared to ones produced by the GAN/VAE-based rivals and interpolation techniques, especially for the setups, where the privacy of the data must be ensured.
|
| 178 |
+
|
| 179 |
+
# REFERENCES
|
| 180 |
+
|
| 181 |
+
Takuya Akiba, Shotaro Sano, Toshihiko Yanase, Takeru Ohta, and Masanori Koyama. Optuna: A next-generation hyperparameter optimization framework. In Proceedings of the 25th ACM SIGKDD international conference on knowledge discovery & data mining, pp. 2623–2631, 2019.
|
| 182 |
+
|
| 183 |
+
Jacob Austin, Daniel D Johnson, Jonathan Ho, Daniel Tarlow, and Rianne van den Berg. Structured denoising diffusion models in discrete state-spaces. Advances in Neural Information Processing Systems, 34:17981–17993, 2021.
|
| 184 |
+
|
| 185 |
+
P. Baldi, P. Sadowski, and D. Whiteson. Searching for exotic particles in high-energy physics with deep learning. Nature Communications, 5, 2014.
|
| 186 |
+
|
| 187 |
+
Dmitry Baranchuk, Ivan Rubachev, Andrey Voynov, Valentin Khrulkov, and Artem Babenko. Labelefficient semantic segmentation with diffusion models. arXiv preprint arXiv:2112.03126, 2021.
|
| 188 |
+
|
| 189 |
+
Ramiro D Camino, Christian A Hammerschmidt, et al. Oversampling tabular data with deep generative models: Is it worth the effort? 2020.
|
| 190 |
+
|
| 191 |
+
Nitesh V Chawla, Kevin W Bowyer, Lawrence O Hall, and W Philip Kegelmeyer. Smote: synthetic minority over-sampling technique. Journal of artificial intelligence research, 16:321–357, 2002.
|
| 192 |
+
|
| 193 |
+
Nanxin Chen, Yu Zhang, Heiga Zen, Ron J Weiss, Mohammad Norouzi, and William Chan. Wavegrad: Estimating gradients for waveform generation. arXiv preprint arXiv:2009.00713, 2020.
|
| 194 |
+
|
| 195 |
+
Prafulla Dhariwal and Alex Nichol. Diffusion models beat gans on image synthesis. 2021.
|
| 196 |
+
|
| 197 |
+
Justin Engelmann and Stefan Lessmann. Conditional wasserstein gan-based oversampling of tabular data for imbalanced learning. Expert Systems with Applications, 174:114582, 2021.
|
| 198 |
+
|
| 199 |
+
Ju Fan, Tongyu Liu, Guoliang Li, Junyou Chen, Yuwei Shen, and Xiaoyong Du. Relational data synthesis using generative adversarial networks: A design space exploration. arXiv preprint arXiv:2008.12763, 2020.
|
| 200 |
+
|
| 201 |
+
Yury Gorishniy, Ivan Rubachev, Valentin Khrulkov, and Artem Babenko. Revisiting deep learning models for tabular data. Advances in Neural Information Processing Systems, 34:18932–18943, 2021.
|
| 202 |
+
|
| 203 |
+
Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. 2020.
|
| 204 |
+
|
| 205 |
+
Emiel Hoogeboom, Didrik Nielsen, Priyank Jaini, Patrick Forre, and Max Welling. Argmax flows ´ and multinomial diffusion: Learning categorical distributions. Advances in Neural Information Processing Systems, 34:12454–12465, 2021.
|
| 206 |
+
|
| 207 |
+
Emiel Hoogeboom, Victor Garcia Satorras, Clement Vignac, and Max Welling. Equivariant diffusion for molecule generation in 3d. In International Conference on Machine Learning, pp. 8867–8887. PMLR, 2022.
|
| 208 |
+
|
| 209 |
+
Bowen Jing, Gabriele Corso, Jeffrey Chang, Regina Barzilay, and Tommi Jaakkola. Torsional diffusion for molecular conformer generation. arXiv preprint arXiv:2206.01729, 2022.
|
| 210 |
+
|
| 211 |
+
James Jordon, Jinsung Yoon, and Mihaela Van Der Schaar. Pate-gan: Generating synthetic data with differential privacy guarantees. In International conference on learning representations, 2018.
|
| 212 |
+
|
| 213 |
+
R. Kelley Pace and Ronald Barry. Sparse spatial autoregressions. Statistics & Probability Letters, 33(3):291–297, 1997.
|
| 214 |
+
|
| 215 |
+
Jayoung Kim, Jinsung Jeon, Jaehoon Lee, Jihyeon Hyeong, and Noseong Park. Oct-gan: Neural ode-based conditional tabular gans. In Proceedings of the Web Conference 2021, pp. 1506–1515, 2021.
|
| 216 |
+
|
| 217 |
+
Jayoung Kim, Chaejeong Lee, Yehjin Shin, Sewon Park, Minjung Kim, Noseong Park, and Jihoon Cho. Sos: Score-based oversampling for tabular data. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, pp. 762–772, 2022.
|
| 218 |
+
|
| 219 |
+
Ron Kohavi. Scaling up the accuracy of naive-bayes classifiers: a decision-tree hybrid. In KDD, 1996.
|
| 220 |
+
|
| 221 |
+
Zhifeng Kong, Wei Ping, Jiaji Huang, Kexin Zhao, and Bryan Catanzaro. Diffwave: A versatile diffusion model for audio synthesis. arXiv preprint arXiv:2009.09761, 2020.
|
| 222 |
+
|
| 223 |
+
Haoying Li, Yifan Yang, Meng Chang, Huajun Feng, Zhihai Xu, Qi Li, and Yueting Chen. Srdiff: Single image super-resolution with diffusion probabilistic models. 2021.
|
| 224 |
+
|
| 225 |
+
Xiang Lisa Li, John Thickstun, Ishaan Gulrajani, Percy Liang, and Tatsunori B Hashimoto. Diffusion-lm improves controllable text generation. arXiv preprint arXiv:2205.14217, 2022.
|
| 226 |
+
|
| 227 |
+
Renata C. B. Madeo, Clodoaldo Ap. M. Lima, and Sarajane Marques Peres. Gesture unit segmentation using support vector machines: segmenting gestures from rest positions. In Proceedings of the 28th Annual ACM Symposium on Applied Computing, SAC, 2013.
|
| 228 |
+
|
| 229 |
+
Chenlin Meng, Yang Song, Jiaming Song, Jiajun Wu, Jun-Yan Zhu, and Stefano Ermon. Sdedit: Image synthesis and editing with stochastic differential equations. 2021.
|
| 230 |
+
|
| 231 |
+
Muhammad Ferjad Naeem, Seong Joon Oh, Youngjung Uh, Yunjey Choi, and Jaejun Yoo. Reliable fidelity and diversity metrics for generative models. In International Conference on Machine Learning, pp. 7176–7185. PMLR, 2020.
|
| 232 |
+
|
| 233 |
+
Prafulla Nichol, Alex & Dhariwal. Improved denoising diffusion probabilistic models. ICML, 2021.
|
| 234 |
+
|
| 235 |
+
Richard Nock and Mathieu Guillame-Bert. Generative trees: Adversarial and copycat. ICML, 2022.
|
| 236 |
+
|
| 237 |
+
F. Pedregosa, G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, J. Vanderplas, A. Passos, D. Cournapeau, M. Brucher, M. Perrot, and E. Duchesnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12:2825–2830, 2011.
|
| 238 |
+
|
| 239 |
+
Liudmila Prokhorenkova, Gleb Gusev, Aleksandr Vorobev, Anna Veronika Dorogush, and Andrey Gulin. Catboost: unbiased boosting with categorical features. Advances in neural information processing systems, 31, 2018.
|
| 240 |
+
|
| 241 |
+
Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Bjorn Ommer. High- ¨ resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10684–10695, 2022.
|
| 242 |
+
|
| 243 |
+
Chitwan Saharia, Jonathan Ho, William Chan, Tim Salimans, David J Fleet, and Mohammad Norouzi. Image super-resolution via iterative refinement. 2021.
|
| 244 |
+
|
| 245 |
+
Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily Denton, Seyed Kamyar Seyed Ghasemipour, Burcu Karagol Ayan, S Sara Mahdavi, Rapha Gontijo Lopes, et al. Photorealistic text-to-image diffusion models with deep language understanding. arXiv preprint arXiv:2205.11487, 2022.
|
| 246 |
+
|
| 247 |
+
Kamaljot Singh, Ranjeet Kaur Sandhu, and Dinesh Kumar. Comment volume prediction using neural networks and decision trees. In IEEE UKSim-AMSS 17th International Conference on Computer Modelling and Simulation, UKSim, 2015.
|
| 248 |
+
|
| 249 |
+
Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In ICML, 2015.
|
| 250 |
+
|
| 251 |
+
Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. In NeurIPS, 2019.
|
| 252 |
+
|
| 253 |
+
Yang Song and Stefano Ermon. Improved techniques for training score-based generative models. NeurIPS, 2020.
|
| 254 |
+
|
| 255 |
+
Yang Song, Jascha Sohl-Dickstein, Diederik P Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. 2021.
|
| 256 |
+
|
| 257 |
+
Yusuke Tashiro, Jiaming Song, Yang Song, and Stefano Ermon. Csdi: Conditional score-based diffusion models for probabilistic time series imputation. Advances in Neural Information Processing Systems, 34:24804–24816, 2021.
|
| 258 |
+
|
| 259 |
+
Amirsina Torfi, Edward A Fox, and Chandan K Reddy. Differentially private synthetic medical data generation using convolutional gans. Information Sciences, 586:485–500, 2022.
|
| 260 |
+
|
| 261 |
+
Joaquin Vanschoren, Jan N. van Rijn, Bernd Bischl, and Lu´ıs Torgo. Openml: networked science in machine learning. arXiv, 1407.7722v1, 2014.
|
| 262 |
+
|
| 263 |
+
Bingyang Wen, Yupeng Cao, Fan Yang, Koduvayur Subbalakshmi, and Rajarathnam Chandramouli. Causal-tgan: Modeling tabular data using causally-aware gan. In ICLR Workshop on Deep Generative Models for Highly Structured Data, 2022.
|
| 264 |
+
|
| 265 |
+
Lei Xu, Maria Skoularidou, Alfredo Cuesta-Infante, and Kalyan Veeramachaneni. Modeling tabular data using conditional gan. Advances in Neural Information Processing Systems, 32, 2019.
|
| 266 |
+
|
| 267 |
+
Yishuo Zhang, Nayyar A Zaidi, Jiahui Zhou, and Gang Li. Ganblr: a tabular data generation model. In 2021 IEEE International Conference on Data Mining (ICDM), pp. 181–190. IEEE, 2021.
|
| 268 |
+
|
| 269 |
+
Zilong Zhao, Aditya Kunar, Robert Birke, and Lydia Y Chen. Ctab-gan: Effective table data synthesizing. In Asian Conference on Machine Learning, pp. 97–112. PMLR, 2021.
|
| 270 |
+
|
| 271 |
+
Zilong Zhao, Aditya Kunar, Robert Birke, and Lydia Y Chen. Ctab-gan+: Enhancing tabular data synthesis. arXiv preprint arXiv:2204.00401, 2022.
|
| 272 |
+
|
| 273 |
+
# APPENDIX
|
| 274 |
+
|
| 275 |
+
# A MLP EVALUATION AND TUNING
|
| 276 |
+
|
| 277 |
+
Here, we show that tuning the hyperparameters using the CatBoost guidance results in the TabDDPM models that produce synthetics that is also optimal for other classifiers/regressors. The results for a subset of datasets are presented on Table 6. The methods denoted with ”-CB” and ”-MLP” denote the CatBoost guidance and different types of evaluation (CatBoost and MLP, respectively). The ”-MLP-tune” suffix stands for the MLP guidance tuning and MLP evaluation.
|
| 278 |
+
|
| 279 |
+
Table 6: ML utility score with MLP evaluation and MLP tuning compared with CatBoost evaluation and CatBoost tuning.
|
| 280 |
+
|
| 281 |
+
<table><tr><td></td><td>AB (R2)</td><td>AD(F1)</td><td>BU (F1)</td><td>CA (R2)</td><td>CAR (F1)</td><td>CH(F1)</td><td>DE (F1)</td><td>DI(F1)</td></tr><tr><td>TabDDPM-CB</td><td></td><td>0.550±.010 0.795±.001</td><td>0.906±.003</td><td>0.836±.002 0.737±.001</td><td></td><td>0.755±.006</td><td>0.691±.004 0.740±.020</td><td></td></tr><tr><td>Real-CB</td><td></td><td>0.556±.004 0.815±.002</td><td>0.906±.002</td><td>0.857±.001</td><td>0.738±.001</td><td>0.740±.009</td><td>0.688±.003 0.785±.013</td><td></td></tr><tr><td>TabDDPM-MLP</td><td></td><td>0.569±.010 0.794±.002 0.903±.003</td><td></td><td>:0.809±.003 0.737±.001</td><td></td><td>0.750±.005</td><td></td><td>0.679±.008 0.754±.020</td></tr><tr><td>Real-MLP</td><td></td><td></td><td></td><td>0.581±.005 0.795±.001 0.905±.003 0.808±.002 0.739±.001 0.741±.006 0.688±.004 0.754±.017</td><td></td><td></td><td></td><td></td></tr><tr><td>TabDDPM-MLP-tune 0.559±.009 0.792±.0020.901±.0030.803±.004 0.737±.0010.749±.0060.674±.0130.741±.018</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td></td><td>FB (R2)</td><td>GE (F1)</td><td>HI(F1)</td><td>HO (R2)</td><td>IN (R2)</td><td>KI (R2)</td><td>MI(F1)</td><td>WI (F1)</td></tr><tr><td>TabDDPM-CB</td><td>0.713±.002</td><td>0.597±.006</td><td>0.722±.001</td><td>0.677±.010 0.809±.002</td><td></td><td>0.833±.014</td><td>0.936±.001</td><td>0.904±.009</td></tr><tr><td>Real-CB</td><td></td><td></td><td>0.837±.001 0.636±.007 0.724±.001</td><td>0.662±.003 0.814±.001 0.907±.002</td><td></td><td></td><td>20.934±.000 0.898±.006</td><td></td></tr><tr><td>TabDDPM-MLP</td><td></td><td></td><td></td><td>0.595±.006 0.717±.002 0.643±.010 0.794±.008 0.804±.015 0.938±.001 0.921±.006</td><td></td><td></td><td></td><td></td></tr><tr><td>Real-MLP</td><td></td><td></td><td>0.607±.007 0.717±.002</td><td>0.614±.006 0.800±.003</td><td></td><td>0.882±.004</td><td>0.936±.001</td><td>0.905±.006</td></tr><tr><td>TabDDPM-MLP-tune</td><td>1</td><td>1</td><td>1</td><td>0.626±.009 0.800±.0040.799±.018</td><td></td><td></td><td>1</td><td>0.914±.006</td></tr></table>
|
| 282 |
+
|
| 283 |
+
# B ADDITIONAL RESULTS
|
| 284 |
+
|
| 285 |
+
Here, we provide results for CTGAN Xu et al. (2019) model (Table 7). We also follow Zhao et al. (2021) and provide an additional quantitative comparison that shows how well individual feature distributions are modelled (Table 8, Table 9, Table 10). Finally, we include density and coverage metrics from Naeem et al. (2020) that are improved alternatives of precision and recall, respectively (Table 11, Table 12).
|
| 286 |
+
|
| 287 |
+
Table 7: ML utility score with CatBoost evaluation.
|
| 288 |
+
|
| 289 |
+
<table><tr><td></td><td>AB (R2)</td><td>AD (F1)</td><td>BU (F1)</td><td>CA (R2)</td><td>CAR (F1)</td><td>CH(F1)</td><td>DE (F1)</td><td>DI (F1)</td></tr><tr><td>CTGAN</td><td>0.420±.004</td><td>0.789±.001</td><td>0.867±.003</td><td>0.686±.003</td><td>0.730±.001</td><td>0.723±.006</td><td>0.699±.002</td><td>0.459±.096</td></tr><tr><td>TVAE</td><td>0.433±.008</td><td>0.781±.002</td><td>0.864±.005</td><td>0.752±.001</td><td>0.717±.001</td><td>0.732±.006</td><td>0.656±.007</td><td>0.714±.039</td></tr><tr><td>CTABGAN</td><td></td><td>0.783±.002</td><td>0.855±.005</td><td></td><td>0.717±.001</td><td>0.688±.006</td><td>0.644±.011</td><td>0.731±.022</td></tr><tr><td>CTABGAN+</td><td>0.467±.004</td><td>0.772±.003</td><td>0.884±.005</td><td>0.525±.004</td><td>0.733±.001</td><td>0.702±.012</td><td>0.686±.004</td><td>0.734±.020</td></tr><tr><td>SMOTE</td><td>0.549±.005</td><td>0.791±.002</td><td>0.891±.003</td><td>0.840±.001</td><td>0.732±.001</td><td>0.743±.005</td><td>0.693±.003</td><td>0.683±.037</td></tr><tr><td>TabDDPM</td><td>0.550±.010</td><td>0.795±.001</td><td>0.906±.003</td><td>0.836±.002</td><td>0.737±.001</td><td>0.755±.006</td><td>0.691±.004</td><td>0.740±.020</td></tr><tr><td>Real</td><td>0.556±.004</td><td>0.815±.002</td><td>0.906±.002</td><td>0.857±.001</td><td>0.738±.001</td><td>0.740±.009</td><td>0.688±.003</td><td>0.785±.013</td></tr><tr><td></td><td>FB (R2)</td><td>GE (F1)</td><td>HI (F1)</td><td>HO (R2)</td><td>IN (R2)</td><td>KI (R2)</td><td>MI (F1)</td><td>WI (F1)</td></tr><tr><td>CTGAN</td><td>0.443±.005</td><td>0.333±.013</td><td>0.575±.006</td><td>0.433±.005</td><td>0.745±.009</td><td>0.772±.005</td><td>0.783±.005</td><td>0.749±.015</td></tr><tr><td>TVAE</td><td>0.685±.003</td><td>0.434±.006</td><td>0.638±.003</td><td>0.493±.006</td><td>0.784±.010</td><td>0.824±.003</td><td>0.912±.001</td><td>0.501±.012</td></tr><tr><td>CTABGAN</td><td></td><td>0.392±.006</td><td>0.575±.004</td><td></td><td></td><td></td><td>0.889±.002</td><td>0.906±.019</td></tr><tr><td>CTABGAN+</td><td>0.509±.011</td><td>0.406±.009</td><td>0.664±.002</td><td>0.504±.005</td><td>0.797±.005</td><td>0.444±.014</td><td>0.892±.002</td><td>0.798±.021</td></tr><tr><td>SMOTE</td><td>0.803±.002</td><td>0.658±.007</td><td>0.722±.001</td><td>0.662±.004</td><td>0.812±.002</td><td>0.842±.004</td><td>0.932±.001</td><td>0.913±.007</td></tr><tr><td>TabDDPM</td><td>0.713±.002</td><td>0.597±.006</td><td>0.722±.001</td><td>0.677±.010</td><td>0.809±.002</td><td>0.833±.014</td><td>0.936±.001</td><td>0.904±.009</td></tr><tr><td>Real</td><td>0.837±.001</td><td>0.636±.007</td><td>0.724±.001</td><td>0.662±.003</td><td>0.814±.001</td><td>0.907±.002</td><td>0.934±.000</td><td>0.898±.006</td></tr></table>
|
| 290 |
+
|
| 291 |
+
Table 8: Wasserstein distance between numerical features.
|
| 292 |
+
|
| 293 |
+
<table><tr><td></td><td>AB</td><td>AD</td><td>BU</td><td>CA</td><td>CA</td><td>CH</td><td>DE</td><td>DI</td></tr><tr><td>CTGAN</td><td>0.008</td><td>0.010</td><td>0.015</td><td>0.004</td><td>0.004</td><td>0.009</td><td>0.004</td><td>0.085</td></tr><tr><td>TVAE</td><td>0.020</td><td>0.016</td><td>0.039</td><td>0.007</td><td>0.027</td><td>0.049</td><td>0.009</td><td>0.044</td></tr><tr><td>CTABGAN+</td><td>0.008</td><td>0.011</td><td>0.016</td><td>0.019</td><td>0.003</td><td>0.046</td><td>0.022</td><td>0.016</td></tr><tr><td>SMOTE</td><td>0.002</td><td>0.003</td><td>0.005</td><td>0.002</td><td>0.001</td><td>0.006</td><td>0.002</td><td>0.020</td></tr><tr><td>TabDDPM</td><td>0.005</td><td>0.002</td><td>0.003</td><td>0.002</td><td>0.000</td><td>0.005</td><td>0.012</td><td>0.008</td></tr><tr><td></td><td>FB</td><td>GE</td><td>HI</td><td>HO</td><td>IN</td><td>KI</td><td>MI</td><td>WI</td></tr><tr><td>CTGAN</td><td>0.004</td><td>0.010</td><td>0.003</td><td>0.005</td><td>0.021</td><td>0.022</td><td>0.004</td><td>0.013</td></tr><tr><td>TVAE</td><td>0.008</td><td>0.009</td><td>0.076</td><td>0.007</td><td>0.025</td><td>0.012</td><td>0.004</td><td>0.016</td></tr><tr><td>CTABGAN+</td><td>0.078</td><td>0.007</td><td>0.052</td><td>0.008</td><td>0.025</td><td>0.021</td><td>0.006</td><td>0.006</td></tr><tr><td>SMOTE</td><td>0.000</td><td>0.004</td><td>0.009</td><td>0.005</td><td>0.011</td><td>0.004</td><td>0.000</td><td>0.002</td></tr><tr><td>TabDDPM</td><td>0.089</td><td>0.011</td><td>0.003</td><td>0.004</td><td>0.006</td><td>0.014</td><td>0.001</td><td>0.002</td></tr></table>
|
| 294 |
+
|
| 295 |
+
Table 9: Jensen-Shannon divergence between categorical features.
|
| 296 |
+
|
| 297 |
+
<table><tr><td></td><td>AB</td><td>AD</td><td>BU</td><td>CA</td><td>CA</td><td>CH</td><td>DE</td><td>DI</td></tr><tr><td>CTGAN</td><td>0.276</td><td>0.085</td><td>0.168</td><td>nan</td><td>0.076</td><td>0.039</td><td>0.120</td><td>0.298</td></tr><tr><td>TVAE</td><td>0.027</td><td>0.095</td><td>0.072</td><td>nan</td><td>0.181</td><td>0.019</td><td>0.157</td><td>0.052</td></tr><tr><td>CTABGAN+</td><td>0.035</td><td>0.052</td><td>0.037</td><td>nan</td><td>0.009</td><td>0.018</td><td>0.030</td><td>0.017</td></tr><tr><td>SMOTE</td><td>0.005</td><td>0.074</td><td>0.072</td><td>nan</td><td>0.069</td><td>0.030</td><td>0.058</td><td>0.004</td></tr><tr><td>TabDDPM</td><td>0.007</td><td>0.019</td><td>0.026</td><td>nan</td><td>0.011</td><td>0.017</td><td>0.009</td><td>0.006</td></tr><tr><td></td><td>FB</td><td>GE</td><td>HI</td><td>HO</td><td>IN</td><td>KI</td><td>MI</td><td>WI</td></tr><tr><td>CTGAN</td><td>0.017</td><td>0.240</td><td>0.091</td><td>nan</td><td>0.071</td><td>0.296</td><td>0.140</td><td>0.532</td></tr><tr><td>TVAE</td><td>0.246</td><td>0.113</td><td>0.040</td><td>nan</td><td>0.033</td><td>0.098</td><td>0.066</td><td>0.149</td></tr><tr><td>CTABGAN+</td><td>0.051</td><td>0.094</td><td>0.009</td><td>nan</td><td>0.023</td><td>0.044</td><td>0.075</td><td>0.017</td></tr><tr><td>SMOTE</td><td>0.027</td><td>0.000</td><td>0.000</td><td>nan</td><td>0.013</td><td>0.102</td><td>0.000</td><td>0.000</td></tr><tr><td>TabDDPM</td><td>0.046</td><td>0.001</td><td>0.001</td><td>nan</td><td>0.008</td><td>0.060</td><td>0.000</td><td>0.002</td></tr></table>
|
| 298 |
+
|
| 299 |
+
Table 10: L2 distance between correlation matrices.
|
| 300 |
+
|
| 301 |
+
<table><tr><td></td><td>AB</td><td>AD</td><td>BU</td><td>CA</td><td>CA</td><td>CH</td><td>DE</td><td>DI</td></tr><tr><td>CTGAN</td><td>0.471</td><td>0.390</td><td>0.492</td><td>0.606</td><td>0.712</td><td>0.239</td><td>1.355</td><td>1.735</td></tr><tr><td>TVAE</td><td>0.517</td><td>0.636</td><td>0.569</td><td>0.753</td><td>2.437</td><td>0.564</td><td>1.965</td><td>0.736</td></tr><tr><td>CTABGAN+</td><td>0.283</td><td>0.576</td><td>0.164</td><td>0.749</td><td>0.738</td><td>0.727</td><td>1.496</td><td>0.435</td></tr><tr><td>SMOTE</td><td>0.185</td><td>0.482</td><td>0.245</td><td>0.127</td><td>0.599</td><td>0.147</td><td>0.642</td><td>0.838</td></tr><tr><td>TabDDPM</td><td>0.333</td><td>0.133</td><td>0.068</td><td>0.090</td><td>0.202</td><td>0.161</td><td>0.934</td><td>0.186</td></tr><tr><td></td><td>FB</td><td>GE</td><td>HI</td><td>HO</td><td>IN</td><td>KI</td><td>MI</td><td>WI</td></tr><tr><td>CTGAN</td><td>5.651</td><td>5.301</td><td>1.413</td><td>0.742</td><td>0.196</td><td>1.530</td><td>43.815</td><td>0.538</td></tr><tr><td>TVAE</td><td>5.960</td><td>2.996</td><td>2.759</td><td>0.902</td><td>0.224</td><td>1.004</td><td>44.692</td><td>0.550</td></tr><tr><td>CTABGAN+</td><td>6.782</td><td>1.977</td><td>1.241</td><td>0.978</td><td>0.207</td><td>3.898</td><td>31.704</td><td>0.319</td></tr><tr><td>SMOTE</td><td>1.596</td><td>0.560</td><td>0.354</td><td>0.452</td><td>0.301</td><td>0.569</td><td>0.258</td><td>0.059</td></tr><tr><td>TabDDPM</td><td>16.120</td><td>1.192</td><td>0.233</td><td>0.336</td><td>0.077</td><td>3.623</td><td>9.185</td><td>0.375</td></tr></table>
|
| 302 |
+
|
| 303 |
+
Table 11: Density of synthetic data.
|
| 304 |
+
|
| 305 |
+
<table><tr><td></td><td>AB</td><td>AD</td><td>BU</td><td>CA</td><td>CA</td><td>CH</td><td>DE</td><td>DI</td></tr><tr><td>CTGAN</td><td>0.224</td><td>0.708</td><td>0.780</td><td>0.586</td><td>0.938</td><td>0.865</td><td>0.698</td><td>0.238</td></tr><tr><td>TVAE</td><td>0.347</td><td>1.126</td><td>1.032</td><td>0.746</td><td>0.845</td><td>1.043</td><td>0.808</td><td>1.565</td></tr><tr><td>CTABGAN+</td><td>0.380</td><td>0.867</td><td>0.998</td><td>0.569</td><td>0.957</td><td>0.974</td><td>0.730</td><td>0.974</td></tr><tr><td>SMOTE</td><td>1.389</td><td>1.415</td><td>1.226</td><td>1.329</td><td>1.200</td><td>1.238</td><td>1.282</td><td>1.413</td></tr><tr><td>TabDDPM</td><td>0.904</td><td>1.008</td><td>1.116</td><td>1.027</td><td>1.011</td><td>1.148</td><td>0.810</td><td>0.831</td></tr><tr><td></td><td>FB</td><td>GE</td><td>HI</td><td>HO</td><td>IN</td><td>KI</td><td>MI</td><td>WI</td></tr><tr><td>CTGAN</td><td>0.147</td><td>0.035</td><td>0.702</td><td>0.467</td><td>0.927</td><td>0.719</td><td>0.361</td><td>0.763</td></tr><tr><td>TVAE</td><td>0.005</td><td>0.248</td><td>0.960</td><td>0.604</td><td>1.072</td><td>0.868</td><td>0.747</td><td>0.919</td></tr><tr><td>CTABGAN+</td><td>0.187</td><td>0.448</td><td>0.730</td><td>0.565</td><td>1.052</td><td>0.186</td><td>0.110</td><td>0.831</td></tr><tr><td>SMOTE</td><td>0.926</td><td>1.531</td><td>1.682</td><td>1.595</td><td>1.213</td><td>1.335</td><td>1.308</td><td>1.251</td></tr><tr><td>TabDDPM</td><td>0.633</td><td>1.460</td><td>1.152</td><td>1.195</td><td>1.150</td><td>0.884</td><td>0.972</td><td>1.009</td></tr></table>
|
| 306 |
+
|
| 307 |
+
Table 12: Coverage of synthetic data.
|
| 308 |
+
|
| 309 |
+
<table><tr><td></td><td>AB</td><td>AD</td><td>BU</td><td>CA</td><td>CA</td><td>CH</td><td>DE</td><td>DI</td></tr><tr><td>CTGAN</td><td>0.654</td><td>0.948</td><td>0.966</td><td>0.759</td><td>0.920</td><td>1.000</td><td>0.777</td><td>0.572</td></tr><tr><td>TVAE</td><td>0.769</td><td>0.886</td><td>0.585</td><td>0.922</td><td>0.208</td><td>0.991</td><td>0.672</td><td>0.978</td></tr><tr><td>CTABGAN+</td><td>0.960</td><td>0.951</td><td>0.999</td><td>0.459</td><td>0.960</td><td>0.830</td><td>0.841</td><td>1.000</td></tr><tr><td>SMOTE</td><td>1.000</td><td>0.970</td><td>0.968</td><td>1.000</td><td>0.866</td><td>1.000</td><td>0.962</td><td>0.841</td></tr><tr><td>TabDDPM</td><td>1.000</td><td>0.994</td><td>1.000</td><td>0.998</td><td>0.978</td><td>1.000</td><td>0.967</td><td>0.955</td></tr><tr><td></td><td>FB</td><td>GE</td><td>HI</td><td>HO</td><td>IN</td><td>KI</td><td>MI</td><td>WI</td></tr><tr><td>CTGAN</td><td>0.238</td><td>0.029</td><td>0.871</td><td>0.839</td><td>0.986</td><td>0.739</td><td>0.576</td><td>0.986</td></tr><tr><td>TVAE</td><td>0.014</td><td>0.669</td><td>0.255</td><td>0.875</td><td>0.987</td><td>0.874</td><td>0.823</td><td>0.867</td></tr><tr><td>CTABGAN+</td><td>0.222</td><td>0.640</td><td>0.557</td><td>0.952</td><td>1.000</td><td>0.479</td><td>0.241</td><td>0.994</td></tr><tr><td>SMOTE</td><td>0.928</td><td>1.000</td><td>0.999</td><td>1.000</td><td>0.995</td><td>0.945</td><td>0.991</td><td>1.000</td></tr><tr><td>TabDDPM</td><td>0.782</td><td>0.997</td><td>0.980</td><td>1.000</td><td>1.000</td><td>0.969</td><td>0.956</td><td>1.000</td></tr></table>
|
| 310 |
+
|
| 311 |
+
C HYPERPARAMETERS SEARCH SPACES
|
| 312 |
+
|
| 313 |
+
<table><tr><td>Parameter Max depth</td><td>Distribution</td></tr><tr><td>Learning rate Bagging temperature L2 leaf reg</td><td>UniformInt[3,10] LogUniform[1e-5,1] Uniform[0,1] LogUniform[1,10]</td></tr><tr><td>Leaf estimation iterations Number of tuning trials</td><td>UniformInt[1,10] 100</td></tr></table>
|
| 314 |
+
|
| 315 |
+
Table 13: CatBoost hyperparameters space from Gorishniy et al. (2021)
|
| 316 |
+
|
| 317 |
+
<table><tr><td>Parameter</td><td>Distribution</td></tr><tr><td>#Layers</td><td>UniformInt[1,8]</td></tr><tr><td>Layer size</td><td>Int{64,128,256,512,1024}</td></tr><tr><td>Dropout</td><td>{0,Uniform[0,0.5]}</td></tr><tr><td>Learning rate</td><td>LogUniform[le-5,1e-2]</td></tr><tr><td>Weight decay</td><td>{0,LogUniform[le-6,1e-3]}</td></tr><tr><td>Number of tuning trials 100</td><td></td></tr></table>
|
| 318 |
+
|
| 319 |
+
Table 14: MLP hyperparameters space from Gorishniy et al. (2021)
|
| 320 |
+
Table 15: SMOTE hyperparameters search space. $\lambda _ { \mathit { r a n g e } }$ denotes the range of interpolation coefficient to sample from
|
| 321 |
+
|
| 322 |
+
<table><tr><td>Parameter</td><td>Distribution</td></tr><tr><td>k_neighbours</td><td>Int[5,20]</td></tr><tr><td>Xrange</td><td>Float[0,1]</td></tr><tr><td>Proportion of samples</td><td>Float{0.25,0.5,1,2,4,8}</td></tr><tr><td colspan="2">Number of tuning trials 50</td></tr></table>
|
| 323 |
+
|
| 324 |
+
Table 16: CTABGAN and CTABGAN $^ +$ hyperparameters search space. See an official implementation2
|
| 325 |
+
|
| 326 |
+
<table><tr><td>Parameter</td><td>Distribution</td></tr><tr><td># claassif.layers Classif. layer size</td><td>UniformInt[1,4] Int{64,128,256}</td></tr><tr><td>Training iterations Batch Size</td><td>Cat{1000,5000,10000}</td></tr><tr><td>random_dim</td><td>Int{512,1024,2048} Int{16,32,64,128}</td></tr><tr><td>num_channels</td><td>Int{16,32,64}</td></tr><tr><td>Proportion of samples</td><td>Float{0.25,0.5,1,2,4,8}</td></tr><tr><td>Number of tuning trials 35</td><td></td></tr></table>
|
| 327 |
+
|
| 328 |
+
Table 17: TVAE hyperparameters search space. See an official implementation3
|
| 329 |
+
|
| 330 |
+
<table><tr><td>Parameter</td><td>Distribution</td></tr><tr><td># claassif.layers</td><td>UniformInt[1, 6]</td></tr><tr><td>Classif. layer size</td><td>Int{64,128,256,512}</td></tr><tr><td>Training iterations</td><td>Cat{5000,20000,30000}</td></tr><tr><td>Batch Size</td><td>Cat{456,4096}</td></tr><tr><td>embedding_dim</td><td>Int{16,32,64,128,256,512,1024}</td></tr><tr><td>loss factor</td><td>LogUniform[0.01,10]</td></tr><tr><td>Proportion of samples</td><td>Float{0.25,0.5,1,2,4,8}</td></tr><tr><td colspan="2">Number of tuning trials 50</td></tr></table>
|
| 331 |
+
|
| 332 |
+
# D DATASETS
|
| 333 |
+
|
| 334 |
+
We used the following datasets:
|
| 335 |
+
|
| 336 |
+
• Abalone (OpenML)
|
| 337 |
+
• Adult (income estimation, Kohavi (1996))
|
| 338 |
+
• Buddy (Kaggle)
|
| 339 |
+
• California Housing (real estate data, Kelley Pace & Barry (1997))
|
| 340 |
+
• Cardiovascular Disease dataset (Kaggle)
|
| 341 |
+
• Churn Modeling (Kaggle)
|
| 342 |
+
• Diabetes (OpenML)
|
| 343 |
+
• Facebook Comments (Singh et al. (2015))
|
| 344 |
+
• Gesture Phase Prediction (Madeo et al. (2013))
|
| 345 |
+
• Higgs (simulated physical particles, Baldi et al. (2014); we use the version with 98K samples available at the OpenML repository Vanschoren et al. (2014))
|
| 346 |
+
• House 16H (OpenML)
|
| 347 |
+
• Insurance (Kaggle)
|
| 348 |
+
• King (Kaggle)
|
| 349 |
+
• MiniBooNE (OpenML)
|
| 350 |
+
• Wilt (OpenML)
|
| 351 |
+
|
| 352 |
+
# E ENVIRONMENT AND RUNTIME
|
| 353 |
+
|
| 354 |
+
Experiments were conducted under Ubuntu 20.04 on a machine equipped with GeForce RTX 2080 Ti GPU and Intel(R) Core(TM) i7-7800X CPU $\textcircled { a } \ 3 . 5 0 \mathrm { G H z }$ . We used Pytorch 10.1, CUDA 11.3, scikit-learn 1.1.2 and imbalanced-learn 0.9.1 (for SMOTE).
|
| 355 |
+
|
| 356 |
+
As for runtime of the proposed method, it depends on the dataset and hyperparameters. We provide 3 examples below. All three examples use $T = 1 0 0 0$ and batch siz ${ \mathrm { ~ \ ' ~ } } = { \mathrm { ~ 4 0 9 6 } }$ . Note that hyperparameters tuning contains 50 runs and takes usually 8-10 hours.
|
| 357 |
+
|
| 358 |
+
Table 18: Training and sampling time for TabDDPM.
|
| 359 |
+
|
| 360 |
+
<table><tr><td>Dataset</td><td>linput_dim</td><td>model_layers</td><td>train_steps n_to_sample|train_time sample_time</td><td></td><td></td><td></td></tr><tr><td>CH</td><td>16</td><td>[256,1024,1024, 1024,1024,512]</td><td>30k</td><td>26k</td><td>670s</td><td>6s</td></tr><tr><td>HI</td><td>28</td><td>[512,1024,1024,1024,1024,512]</td><td>30k</td><td>502k</td><td>502s</td><td>430s</td></tr><tr><td>FB</td><td>146</td><td>[512,1024]</td><td>30k</td><td>1264k</td><td>783s</td><td>470s</td></tr></table>
|
md/dev/EdIGMCHk4l/EdIGMCHk4l.md
ADDED
|
@@ -0,0 +1,333 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RRHF: Rank Responses to Align Language Models with Human Feedback
|
| 2 |
+
|
| 3 |
+
Hongyi $\mathbf { Y u a n } ^ { 1 2 \dagger * }$ Zheng Yuan1∗Chuanqi Tan1 Wei Wang1 Songfang Huang1 Fei Huang1
|
| 4 |
+
|
| 5 |
+
1Alibaba DAMO Academy 2Tsinghua University {yuanzheng.yuanzhen,chuanqi.tcq}@alibaba-inc.com yuanhy20@mails.tsinghua.edu.cn
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Reinforcement Learning from Human Feedback (RLHF) facilitates the alignment of large language models with human preferences, significantly enhancing the quality of interactions between humans and models. InstructGPT implements RLHF through several stages, including Supervised Fine-Tuning (SFT), reward model training, and Proximal Policy Optimization (PPO). However, PPO is sensitive to hyperparameters and requires multiple models in its standard implementation, making it hard to train and scale up to larger parameter counts. In contrast, we propose a novel learning paradigm called RRHF, which scores sampled responses from different sources via a logarithm of conditional probabilities and learns to align these probabilities with human preferences through ranking loss. RRHF can leverage sampled responses from various sources including the model responses from itself, other large language model responses, and human expert responses to learn to rank them. RRHF only needs 1 to 2 models during tuning and can efficiently align language models with human preferences robustly without complex hyperparameter tuning. Additionally, RRHF can be considered an extension of SFT and reward model training while being simpler than PPO in terms of coding, model counts, and hyperparameters. We evaluate RRHF on the Helpful and Harmless dataset, demonstrating comparable alignment performance with PPO by reward model score and human labeling. Extensive experiments show that the performance of RRHF is highly related to sampling quality which suggests RRHF is a best-of- $\boldsymbol { n }$ learner. Codes are released at https://github.com/GanjinZero/RRHF.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Large language models like ChatGPT2 and GPT-4 [21] are extremely powerful in understanding human queries and providing helpful and friendly responses. Employing Reinforcement Learning from Human Feedback (RLHF) [8, 42, 29] enables alignment of language model outputs with human preferences. As implemented in Ouyang et al. [22], the paradigm of RLHF contains three main steps, Supervised Fine-Tuning (SFT), reward model training, and Proximal Policy Optimization (PPO). Initially, they apply supervised fine-tuning (SFT) on the initial models to learn to follow human instructions. Subsequently, a reward model is learned from the ranking of human preferences. Finally, scores generated by the reward model are used to apply gradient policy in PPO to align human preferences. PPO [28] is a strong reinforcement learning (RL) algorithm and is the key step used in RLHF [22] to align human preferences. This PPO training step is powerful but complex. It requires tuning a large number of hyperparameters for conservative parameter updating, reward design, advantage estimation, etc. Besides, fine-tuning language models with PPO needs to store a policy model, a value model (or a value head), a reward model, and a reference model at the same time which is memory-unfriendly and needs sophisticated architecture of the training platform when scaling up to larger models.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Workflow of RRHF compared with PPO.
|
| 17 |
+
|
| 18 |
+
To alleviate the complex hyperparameter tuning and sophisticated training resource requirements of PPO, we propose a novel training paradigm RRHF (Rank Responses to align Human Feedback) that aligns model probabilities of multiple responses with human preferences by ranking loss, which can retain the performance of PPO and is much simpler. Ranking loss on responses probabilities [19, 41] has been used in a similar scenario, abstractive summarization, to improve conditional generation quality. Before training, RRHF first samples responses from various sources, responses can be sourced from a wide range of origins including model-generated responses such as those from the model itself, ChatGPT, GPT-4, as well as pre-existing human-authored high or low-quality responses. RRHF then leverages responses from various sources for training, scoring responses based on the log probability provided by the training language model. The scores are then matched orders with those from the human preference reward model or human preference labels by ranking loss. We choose to use ranking instead of the absolute value of the reward model for optimization. PPO uses estimated advantages to provide optimization signals. The advantage function is to estimate whether the state-action pair is better or worse compared to the baseline and the baseline is estimated by the value model. Consequently, advantage function estimation requires auxiliary models for training and inference during the whole training procedure [42, 22]. In RRHF, you can estimate the response qualities by logarithm probabilities and compare multiple responses corresponding to know which responses are better or worse without estimating the baseline by an additional value model. Compared to PPO, RRHF also does not need the reference model to calculate the KL divergence. the model itself used for generating samples in PPO is constantly changing while RRHF only uses the model itself for sampling before training. Thus the KL term degenerates for RRHF. The workflow for RRHF and PPO is depicted in Figure 1. PPO utilizes 4 models during training, whereas RRHF requires only 1 or 2 models.
|
| 19 |
+
|
| 20 |
+
Our experiments are conducted on Anthropic’s Helpful and Harmless dataset [3], demonstrating that RRHF’s performance is on par with PPO in terms of generating helpful and harmless responses by automatic evaluation and human labeling. We do extensive experiments on how sampled responses used in training affect the performances of RRHF. The performances of RRHF are positively correlated to the qualities of sampled responses. We find that the rewards of the trained models are close to the max rewards of the sampled responses which suggests that RRHF’s objective is to learn from best-of- $^ n$ sampling. Moreover, to simulate the real scenario of training a ChatGPT-like model. We use RRHF to learn from Alpaca prompts [31] and responses from ChatGPT, InstructGPT, LLaMA [32], and Alpaca to develop a new language model aligned to human preferences called Wombat. The evaluation of Wombat shows that RRHF can outperform SFT under similar training resources.
|
| 21 |
+
|
| 22 |
+
Contributions are summarized as follows:
|
| 23 |
+
|
| 24 |
+
• We propose a new learning paradigm named RRHF for large language models that can leverage various responses to align with human preferences. The trained model can be viewed as a language model for generation and a reward model for scoring.
|
| 25 |
+
|
| 26 |
+
• This paradigm is an extension of SFT training and is similar to training a reward model. • This paradigm is much simpler than PPO in terms of coding difficulty, numbers of models used in training, and hyper-parameter counts and obtains comparable performances on Anthropic’s Helpful and Harmless dataset.
|
| 27 |
+
|
| 28 |
+
# 2 Related Works
|
| 29 |
+
|
| 30 |
+
Recently, scaling up pre-trained language models by the number of parameters, training data [15], and computational budges [12] can equip large language models with strong abilities in various language tasks [5, 24, 7, 16, 21, 39]. However, pre-trained language models are not directly aligned with human preferences which may generate unsafe, toxicity, sexual, biased, or criminal responses. Language models first conduct supervised fine-tuning to imitate how to align with human instructions [35, 31]. After that, reinforcement learning techniques have been explored to align language models with human preferences [2, 4, 29, 14, 36, 22, 25]. The most successful way is applying a reinforcement learning from human feedback (RLHF) framework [42, 29, 22] via training a reward model on human feedback and using PPO [28] to obtain the policy model for language generation. In our practices, the PPO training paradigm is complex in coding and hyperparameter tuning while it needs four models that are hard for training. This motivates us to explore simpler and more straightforward methods to align language models with human preferences. Nakano et al. [20], Askell et al. [1], Cobbe et al. [9] explore best-of- $\mathbf { \nabla } \cdot n$ sampling to improve large language model generation by selecting the best response based on the human preference rewards among $n$ sampled responses. Best-of- $\boldsymbol { n }$ sampling is easy to achieve for aligning with human preferences while costing much more time when inference. Inspired by these two lines of work, RRHF is targeted to learn the best response and comparisons based on the human preference rewards among $n$ sampled responses to achieve alignment during optimization instead of inference. RRHF absorbs the advantages of PPO and best-of- $\boldsymbol { n }$ sampling while being simpler in coding, model count, and hyperparameter tuning than PPO and does not need to sample $n$ times during inference. The most similar work [10] is contemporary to us which applies SFT on the samples with the best reward. Compared to Dong et al. [10], we show that ranking loss is necessary and research the relation between sampling quality and model performance. There are also other ways to apply alignment which are focused on generating better-aligned datasets for SFT including hindsight-modified prompts [40, 18] and principle-driven self-alignment [30].
|
| 31 |
+
|
| 32 |
+
# 3 Approach
|
| 33 |
+
|
| 34 |
+
We mainly follow the notations in Ziegler et al. [42]. Denote the query data distribution as $x \sim D$ For the response $y$ reply to query $x$ , a reward function $R ( x , y )$ scores $y$ based on human preferences which can be a human or a neural network. Our target is to learn an auto-regressive language model $\pi$ (initialized from the model $\rho$ ) which generates responses with large rewards.
|
| 35 |
+
|
| 36 |
+
# 3.1 RRHF
|
| 37 |
+
|
| 38 |
+
During training, we have $k$ different responses $y _ { i }$ of $x$ sampled by policy $\rho _ { i } , 1 \le i \le k$ . Sampling with policy $\rho _ { i }$ is not restricted here which can be the initial model $\rho$ , the learned model $\pi$ , other LLMs like ChatGPT or GPT-4, or a response provided by human experts. The sampling policy $\rho _ { i }$ can also vary across the training time. Our sampling method can leverage any existing good or bad responses to help the model align with humans, while PPO can only learn from samples from its learned model $\pi$ .
|
| 39 |
+
|
| 40 |
+
The reward function gives scores for each $y _ { i }$ with $R ( x , y _ { i } ) = r _ { i }$ . To align with scores $\{ r _ { i } \} _ { k }$ , we use our model $\pi$ to give scores $p _ { i }$ for each $y _ { i }$ by:
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
p _ { i } = \frac { \sum _ { t } \log P _ { \pi } ( y _ { i , t } | \boldsymbol { x } , y _ { i , < t } ) } { \| y _ { i } \| } ,
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
where $p _ { i }$ is conditional log probability (length-normalized) of $y _ { i }$ under model $\pi$ . Our idea is simple, let the model $\pi$ give larger probabilities for better responses and give smaller probabilities for worse responses. Inspired by Liu et al. [19], we optimize this object by ranking loss:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
L _ { r a n k } = \sum _ { r _ { i } < r _ { j } } \operatorname* { m a x } ( 0 , p _ { i } - p _ { j } )
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
We do not have margins in the ranking loss as Liu et al. [19]. They add margin terms $\lambda _ { i j } = ( j - i ) \lambda$ to encourage the model to have higher $p _ { i }$ estimation with a higher ranking. We disable it since we find good empirical results without margin terms and it is time-consuming to tune $\lambda$ .
|
| 53 |
+
|
| 54 |
+
We also add a cross-entropy loss similar to SFT (supervised fine-tuning). We require the model to learn the response with the highest reward $r _ { i }$ .
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\begin{array} { c } { i ^ { \prime } = \arg \operatorname* { m a x } _ { i } r _ { i } } \\ { L _ { f t } = - \displaystyle \sum _ { t } \log P _ { \pi } ( y _ { i ^ { \prime } , t } | x , y _ { i ^ { \prime } , < t } ) } \end{array}
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
The total loss is defined as the unweighted sum of two losses:
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
L = L _ { r a n k } + L _ { f t }
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
We have tried using larger weights (10,100) on $L _ { r a n k }$ suggested by Liu et al. [19] which shows worse performances in our preliminary experiments.
|
| 67 |
+
|
| 68 |
+
The Python training code of RRHF only adds 30 lines to SFT training code 3 which is much simpler than PPO implementation 4.
|
| 69 |
+
|
| 70 |
+
# 3.2 Relation with Previous Paradigm RLHF
|
| 71 |
+
|
| 72 |
+
InstructGPT [22] aligns human preferences in three steps: SFT, training a reward model, and PPO.
|
| 73 |
+
We find our proposed RRHF has similar procedures to the above-mentioned three steps.
|
| 74 |
+
|
| 75 |
+
Relation with SFT Supervised fine-tuning (behavioral cloning) can be viewed as a degenerated version of our training process with $k = 1$ and $\rho _ { 1 }$ being fixed which is provided by human labelers.
|
| 76 |
+
|
| 77 |
+
Relation with Reward Model Our model can be used as a reward model. We use length-normalized log probability to score responses, while other reward models use [CLS] or [EOS] for scoring. If $R ( x , y )$ is labeled by human labelers, we are exactly training a reward model from human preferences.
|
| 78 |
+
|
| 79 |
+
Relation with PPO The task objective of PPO [28] is defined by a reward function $R ( x , y )$ , and it is to maximize the expected reward $\mathbf { E } _ { x \sim \mathcal { D } , y \sim \pi ( \cdot | x ) } \left[ R ( x , y ) \right]$ . Although $R ( x , y )$ should be defined by human assessments, $R ( x , y )$ is modeled with a learned reward model on human-evaluated data in experiments. To constrain the language policy $\pi _ { \boldsymbol { \theta } } ( \cdot | \boldsymbol { x } )$ from moving too far from the initialization $\rho ( \cdot | x )$ , the final reward design becomes: $\begin{array} { r } { \tilde { R } ( x ; y ) = R ( x ; y ) - \beta \log \left( \frac { \pi ( y | x ) } { \rho ( y | x ) } \right) } \end{array}$ , where $\beta$ controls the level of penalty and is set to a fixed value [22] or dynamically adjusted [42].
|
| 80 |
+
|
| 81 |
+
PPO leverages $\pi$ for sampling, while RRHF can use any applicable $\rho _ { i }$ . PPO is sampling during training, while RRHF is sampling before training to get rid of the KL divergence term. PPO uses the absolute reward value $R ( x , y )$ for optimization, while we only consider the comparisons of $R ( x , y )$ between different responses which are easier to learn. PPO requires one more value model to compare with the baseline, while RRHF makes comparisons among sampled responses to avoid the value model.
|
| 82 |
+
|
| 83 |
+
# 4 Experiments
|
| 84 |
+
|
| 85 |
+
# 4.1 Settings
|
| 86 |
+
|
| 87 |
+
Dataset We use Anthropic’s Helpful and Harmless (HH) dataset as our experiment dataset $[ 3 ] ^ { 5 }$ They provide a chosen response and a rejected response for each query based on human preferences (i.e. helpful and harmless). We use the proxy reward model Dahoas/gptj-rm-static6 trained on the same dataset. By using the proxy reward model, we can compare RRHF and PPO fairly.
|
| 88 |
+
|
| 89 |
+
Models We experiment mainly based on LLaMA [32] and Alpaca [31] with 7B parameter size. Ouyang et al. [22] and Ramamurthy et al. [25] use supervised fine-tuned models as the initial models when applying PPO, so we also have fine-tuned Alpaca-7B on our used dataset7 with chosen responses (i.e. human-preferred responses) following trlX[34] and name it as Alpaca-sft.
|
| 90 |
+
|
| 91 |
+
Sampling Policy during Training Our model’s ability is highly related to sampling qualities during training. We examine different sampling policies and list them in Figure 2 and Table 1. We term the initial language model policy as $\rho$ , the online language model policy as $\pi$ , and the language model policy after each 3-epoch training iteration as $\rho ^ { * }$ . For each query, we collect 4 roll-out samples using two variants of beam search. For vanilla beam searching, we use a beam size of 4 and set the maximum output token length to 128. Since the roll-out sample diversity of vanilla beam search is low, we also experiment with (1) diverse beam search [33], where we use a beam size of 4 and set the diverse beam group to 4, the diversity penalty to 1.0, and the sampling temperature to 0.8, and (2) top-p sampling (nucleus sampling) [13], where we use a beam size of 4, top-p of 1.0, and the sampling temperature to 0.8 which is a consistent setting with the top- $\mathbf { \nabla } \cdot \mathbf { p }$ sampling used in our PPO baselines. We sample training data before the training process except for OP- $\mathbf { \nabla } _ { \mathbf { k } }$ (online sampling). Sampling using vanilla beam search/diverse beam search/top-p sampling costs 4-6 hours on 8 80GB Nvidia A100 GPUs.
|
| 92 |
+
|
| 93 |
+
Table 1: Sampling policy used in our experiments. OP- $\mathbf { \nabla } \cdot \mathbf { k }$ uses $\pi$ for sampling (i.e. online sampling), we update $\pi$ every k optimization steps. IP-n (Iterate update) uses updated policy $\rho ^ { * }$ after training by IP-(n-1) and starts a new iteration. The dataset contains a good response and a bad response for each query which are used as $\rho _ { 5 }$ and $\rho _ { 6 }$ , which are termed $\mathbf { P }$ (Provided responses in datasets).
|
| 94 |
+
|
| 95 |
+
<table><tr><td>Setting</td><td>p1~p4</td><td>p5,p6</td></tr><tr><td>BP SP</td><td>Beam search by p</td><td>Provided responses</td></tr><tr><td>DP</td><td>top-p Sampling by p</td><td>Provided responses</td></tr><tr><td>OP-k</td><td>Diverse beam search by p</td><td>Provided responses</td></tr><tr><td></td><td>Online diverse beam by πt</td><td>Provided responses</td></tr><tr><td>IP-n D</td><td>Iterate diverse beam by p*</td><td>Provided responses</td></tr><tr><td></td><td>Diverse beam search by p</td><td>0</td></tr><tr><td>P</td><td>①</td><td>Provided responses</td></tr></table>
|
| 96 |
+
|
| 97 |
+

|
| 98 |
+
Figure 2: The workflow of sampling policy used in our experiments. IP-1 is equivalent to DP.
|
| 99 |
+
|
| 100 |
+
Fine-tuning Hyper-parameters We fine-tune RRHF with 3 epochs without early stopping. We first warm up the learning rate to 2e-5 and decay to 0 linearly. For each GPU we have at most 1 query at once, and we apply gradient accumulation at 8 steps leading to a query batch size of 64. The query and responses are truncated to 192 tokens. Since sampling and training processes are separated (except online sampling), our training only needs to load one model. We use 8 80GB Nvidia A100 GPUs for fine-tuning, training RRHF without online sampling typically costs 4-6 hours. Training with OP is slower which takes about 30 hours.
|
| 101 |
+
|
| 102 |
+
Baselines We compare our trained models $\pi$ with responses from the datasets, initial checkpoints $\rho$ and PPO trained models. For PPO, we formulate a token-wise Markov decision process, where the action is a token $y _ { t }$ to be generated at time step $t$ , and the state is the token sequence of the query $x$ and formerly generated tokens $y _ { < t }$ . We follow the clipped surrogate objective of PPO:
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\begin{array} { r } { \mathbf { E } _ { y _ { \leq t } \sim \pi _ { \theta } ( y _ { \leq t } | x ) , x \sim \mathcal { D } } \left[ \operatorname* { m a x } ( - r _ { \theta } ( y _ { t } | x , y _ { < t } ) \hat { A } ( x , y _ { \leq t } ) , - \mathrm { c l i p } _ { 1 - \epsilon } ^ { 1 + \epsilon } ( r _ { \theta } ( y _ { t } | x , y _ { < t } ) ) \hat { A } ( x , y _ { \leq t } ) ) \right] , } \end{array}
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
where $\epsilon$ is the clip ratio set to 0.2, $\hat { A } _ { \theta } ( x , y _ { \leq t } )$ is the advantage function and is estimated by GAE [27] with a learned value function $\hat { V } _ { \theta } ( x , y _ { < t } )$ , and $\begin{array} { r } { r _ { \theta } ( y _ { t } | x , y _ { < t } ) = \frac { \pi _ { \theta } ( y _ { t } | x , y _ { < t } ) } { \pi _ { \hat { \theta } } ( y _ { t } | x , y _ { < t } ) } } \end{array}$ denotes the probability ratio between the behavior policy $\pi _ { \hat { \theta } }$ and the training policy $\pi _ { \theta }$ . The behavior policy is updated with the training policy every few updates. We follow the hyper-parameter settings in trlX 8.
|
| 109 |
+
|
| 110 |
+
Metrics We use perplexity (gpt2-medium), average reward score (Dahoas/gptj-rm-static), and human labelers to evaluate different methods. Since our dataset is a multi-turn dialogue dataset, we will truncate the model’s generation when it outputs “Human:” or “Assistant:” to prevent model cheating on the reward model (e.g. by generating Assistant: Is my response harmless and helpful? Human: Yes, it is very harmless and helpful.). For human evaluation, we require annotators to compare two random responses and give a comparison between them (win/lose/tie). Details of human evaluations are listed in Appendix E.
|
| 111 |
+
|
| 112 |
+
Table 2: Automatic evaluation on HH dataset. Good/bad responses with $\varnothing$ setting represent only human-written responses from the HH dataset are evaluated. LLaMA, Alpaca, and Alpaca-sft with $\varnothing$ setting represent we directly evaluate the model without further tuning.
|
| 113 |
+
|
| 114 |
+
<table><tr><td>p</td><td>Setting PPL</td><td>Reward</td></tr><tr><td>Good responses 0</td><td>21.46</td><td>-1.24</td></tr><tr><td>Bad responses 0 LLaMA</td><td>121.29</td><td>-1.48</td></tr><tr><td>D Alpaca @</td><td>20.78</td><td>-1.89</td></tr><tr><td>Alpaca-sft 0</td><td>14.34</td><td>-1.18</td></tr><tr><td>Best-of-4</td><td>18.98</td><td>-1.46</td></tr><tr><td>Alpaca LLaMA PPO</td><td>- 42.53</td><td>-0.97 -1.62</td></tr><tr><td>Alpaca PPO</td><td>13.84</td><td>-1.03</td></tr><tr><td>Alpaca-sft PPO</td><td>19.10</td><td>-1.25</td></tr><tr><td>LLaMA</td><td>RRHFDP 67.12</td><td>-1.34</td></tr><tr><td>Alpaca-sft</td><td>RRHFDP 18.10</td><td>-1.19</td></tr><tr><td>Alpaca</td><td>RRHFDP 14.75</td><td>-1.03</td></tr><tr><td>Alpaca</td><td>RRHFsP 14.41</td><td>-0.96</td></tr></table>
|
| 115 |
+
|
| 116 |
+
Table 3: Human evaluation on HH dataset. All settings use $\rho =$ Alpaca.
|
| 117 |
+
|
| 118 |
+
<table><tr><td>A</td><td>B</td><td>win</td><td>tie</td><td>lose</td></tr><tr><td>RRHFDP</td><td>Good responses</td><td>59</td><td>30</td><td>11</td></tr><tr><td>RRHFDP</td><td>PPO</td><td>27</td><td>48</td><td>25</td></tr><tr><td>RRHFDP</td><td>RRHFIP-2</td><td>0</td><td>90</td><td>10</td></tr></table>
|
| 119 |
+
|
| 120 |
+
# 4.2 Main Results
|
| 121 |
+
|
| 122 |
+
Auto Evaluation We list automatic metrics in Table 2. We show results from baselines and RRHF with diverse beam search sampling (DP) and top-p sampling (SP). Our proposed Alpaca-RRHFDP obtains the average reward score of -1.03 (averaged out of 3 runs, -1.01, -1.02, and -1.05) and Alpaca-RRHFSP achieves the highest average reward score of -0.96. This proves that RRHF has the ability to optimize against the given reward model. RRHF performs better than PPO and vanilla language models in terms of average reward scores consistently. Alpaca-trained models outperform human-preferred responses collected from the datasets in terms of reward scores. We find perplexity does not change too much for Alpaca and influences LLaMA a lot. The reason can be LLaMA is not instruction-tuned.
|
| 123 |
+
|
| 124 |
+
Human Evaluation Human preferences can be different from the proxy reward model. Therefore, we perform human evaluations on sampled responses and list cases in Table 4 to compare different settings. Results in Table 3 demonstrate that ${ \mathrm { R R H F } } _ { \mathrm { D P } }$ outperforms responses from the dataset and PPO-trained models. From case studies, we can observe the model trained by RRHF has more details. We also have checked the performances between ${ \mathrm { R R H F } } _ { \mathrm { D P } }$ and $\mathrm { R R H F _ { I P - 2 } }$ , where $\mathrm { R R H F _ { I P - 2 } }$ is trained with sampling by ${ \mathrm { R R H F } } _ { \mathrm { D P } }$ . We find iterate training the model can further boost the performance. From the case study, we find $\mathrm { R R H F _ { I P - 2 } }$ understands human instruction better.
|
| 125 |
+
|
| 126 |
+
Accuracy as a Reward Model Since our trained model can also be viewed as a reward model to score responses by $p _ { i }$ . We test our model on the dataset used for training Dahoas/gptj-rm-static. The accuracy is computed by counting the percentage of the reward scores of good responses that are higher than the reward scores of bad responses using $p _ { i }$ (except Dahoas/gptj-rm-static) and list in Table 5.
|
| 127 |
+
|
| 128 |
+
Table 4: Responses generated by the different settings of models.
|
| 129 |
+
|
| 130 |
+
<table><tr><td>Human: How can I make my clothes whiter? Assistant: You can use vinegar to bleach the clothes. Human: Vinegar can bleach clothes ? Assistant:Yes. Human: Iwas thinking about using Clorox as well. Assistant: (RRHFpp) You can use Clorox, too.It's a brand of bleach. You can also use baking soda,</td></tr><tr><td>which is a mild detergent. Assistant: (Response from the dataset) Clorox is more toxic and harmful than vinegar. Human:How do you adjust the lens on a binocular? Assistant: (RRHFDp) You can adjust the lens on a binocular by turning the focus knob on the right eyepiece. This wil allow you to focus on objects at different distances. You can also adjust the lens to get the best viewing experience. Assistant: (PPO) You adjust the lens on a binocular by turning a ring around the center of the binocular. This adjusts the focus of the binocular and allows you to see objects at different distances</td></tr><tr><td>clearly. Human:Which stock should Iinvest all of my money into? Assistant: Interesting question!What kind of returns do you want? Human:Iwant better returns than the S&P 500. Assistant: (RRHFDp) Okay,let's look at some options.The S&P 5OO is a broad-market index that</td></tr><tr><td>tracks the stock prices of 5Oo large companies in the United States. It has a historical average annual return of around 10%. Assistant: (RRHFIpP-2) Okay, well there are a few factors to consider when investing.You should look at the risk of losing money, the expected return,and the amount of money you have to invest.</td></tr></table>
|
| 131 |
+
|
| 132 |
+
Dahoas/gptj-rm-static achieves $6 8 . 4 9 \%$ on the test set. The accuracy of LLaMA, Alpaca, and Alpaca-PPO is worse than random guessing. Our model Alpaca- ${ \bf R R H F _ { D P } }$ trained by Dahoas/gptj-rm-static can achieve $6 1 . 7 5 \%$ accuracy which is much better than vanilla language models and PPO-trained models. As our model learns from the proxy reward model rather than the training dataset of the reward dataset, it becomes difficult to surpass
|
| 133 |
+
|
| 134 |
+
Table 5: Reward model accuracy evaluation.
|
| 135 |
+
|
| 136 |
+
<table><tr><td>RewardModel</td><td>Accuracy</td></tr><tr><td>Dahoas/gptj-rm-static LLaMA</td><td>68.49% 45.09%</td></tr><tr><td>Alpaca</td><td>45.13%</td></tr><tr><td>Alpaca-PPO</td><td>46.03%</td></tr><tr><td>Alpaca-RRHFDP</td><td>61.75%</td></tr></table>
|
| 137 |
+
|
| 138 |
+
Dahoas/gptj-rm-static in terms of performance on the test set. Nonetheless, it demonstrates potential in adapting to the proxy reward model and could have a significant impact on real human preference labels.
|
| 139 |
+
|
| 140 |
+
Loss Curve We show our loss and metric curves in Figure 3. This is the setting of using Alpaca as the initial model $\rho$ and the sample policy is DP. We find losses and average reward scores are negatively correlated where one can track the loss curve to estimate the reward scores. We find the losses converge at the third epoch (i.e. 2400-3600 training steps) and the average reward scores reach the maximum at the third epoch. Our proposed RRHF converges well under the same hyper-parameter setting as SFT.
|
| 141 |
+
|
| 142 |
+
# 4.3 Ablation Study
|
| 143 |
+
|
| 144 |
+
Initial Checkpoints LLaMA performs worst among the three initial checkpoints with different settings in Table 6. This is not due to the potential of LLaMA being worse than Alpaca. By using only the response data from the datasets (sampling policy P) for training, LLaMA, Alpaca, and Alpaca-sft obtain the same average reward scores of -1.31 which show that these three models have the same ability under the same sampled training data. LLaMA is not instruction-tuned and responses sampled by LLaMA (reward -1.89) are much worse than two other models (reward -1.18 and reward -1.46). The sampling quality of LLaMA makes it perform the worst. Another phenomenon we find is
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 3: The loss and metric curves of training RRHF. The model uses DP as the sampling policy.
|
| 148 |
+
|
| 149 |
+
Table 6: Ablation study on HH dataset with different initial checkpoints and sampling policy. We also list the average, max, and standard error of the reward scores for training samples generated by different sampling policies. We do not truncate responses from the training set, while we truncate responses to the first turn for the testing set when calculating reward scores.
|
| 150 |
+
|
| 151 |
+
<table><tr><td>p</td><td>Setting</td><td>PPL</td><td>Reward</td><td>Mean</td><td>Std.</td><td>Max</td></tr><tr><td>LLaMA</td><td>DP</td><td>67.12</td><td>-1.34</td><td>-2.18</td><td>0.97</td><td>-1.27</td></tr><tr><td>Alpaca</td><td>DP</td><td>14.75</td><td>-1.02</td><td>-1.30</td><td>0.66</td><td>-0.95</td></tr><tr><td>Alpaca-sft</td><td>DP</td><td>18.10</td><td>-1.19</td><td>-1.49</td><td>0.79</td><td>-1.11</td></tr><tr><td>LLaMA</td><td>BP</td><td>17.03</td><td>-1.27</td><td>-2.26</td><td>0.96</td><td>-1.26</td></tr><tr><td>Alpaca</td><td>BP</td><td>14.37</td><td>-1.03</td><td>-1.31</td><td>0.67</td><td>-1.00</td></tr><tr><td>Alpaca-sft</td><td>BP</td><td>17.63</td><td>-1.14</td><td>-1.50</td><td>0.77</td><td>-1.15</td></tr><tr><td>LLaMA</td><td>P</td><td>18.49</td><td>-1.31</td><td>-1.50</td><td>0.79</td><td>-1.28</td></tr><tr><td>Alpaca</td><td>P</td><td>18.88</td><td>-1.31</td><td>-1.50</td><td>0.79</td><td>-1.28</td></tr><tr><td>Alpaca-sft</td><td>P</td><td>18.92</td><td>-1.31</td><td>-1.50</td><td>0.79</td><td>-1.28</td></tr><tr><td>Alpaca</td><td>D</td><td>13.66</td><td>-1.08</td><td>-1.21</td><td>0.65</td><td>-1.02</td></tr><tr><td>Alpaca</td><td>IP-1</td><td>14.75</td><td>-1.02</td><td>-1.30</td><td>0.66</td><td>-0.95</td></tr><tr><td>Alpaca</td><td>IP-2</td><td>14.31</td><td>-0.96</td><td>-1.13</td><td>0.57</td><td>-0.77</td></tr><tr><td>Alpaca</td><td>IP-3</td><td>14.51</td><td>-0.94</td><td>-1.05</td><td>0.56</td><td>-0.65</td></tr><tr><td>Alpaca</td><td>OP-32</td><td>63.78</td><td>0.34</td><td></td><td></td><td></td></tr><tr><td>Alpaca</td><td>OP-32+KL</td><td>19.76</td><td>-0.86</td><td>- 1</td><td>- =</td><td>- =</td></tr></table>
|
| 152 |
+
|
| 153 |
+
Alpaca-sft performs worse than Alpaca, and this is also observed by Ramamurthy et al. [25] that SFT warmup may not improve the performance.
|
| 154 |
+
|
| 155 |
+
Sampling Policy As stated previously, sampling policy deeply influences the performance of our training schema. We list results with different sampling policies in Table 6. Using diverse beam sampling performs best for Alpaca among all non-online sampling methods, while for another two models using beam sampling is good. We also try to only use two responses provided by datasets, three models obtain very near performances with reward -1.31 which shows sampling quality determines RRHF performances. Using beam or diverse beam sampling with responses from datasets enhances performances significantly compared to only using responses from datasets. We test on Alpaca by only using samples generated by the model itself, it also improves reward to -1.08. For the iterate update sampling policy, we find the reward scores can be improved by iteration.
|
| 156 |
+
|
| 157 |
+
Ranking Loss To check whether the ranking loss is necessary, we conduct an ablation study by removing $L _ { r a n k }$ , and the results are shown in Table 7. Without ranking loss, models cannot learn from how one response is better than another and obtain a worse average reward score.
|
| 158 |
+
|
| 159 |
+
# 5 Analysis and Discussion
|
| 160 |
+
|
| 161 |
+
RRHF with Online Sampling We mainly experiment with sampling using the initial model $\rho$ . Using the training model $\pi$ for sampling further needs a reward model for online scoring. We experiment with online sampling like PPO and we update the sampling policy every 32 optimization steps. We show results in Table 6. In this setting, the average reward improves to 0.34 quickly while PPL gets worse to 63.78. We manually check the results from OP-32, and it produces very friendly but meaningless responses like That sounds great! I appreciate your help. Thanks for your help! You’re welcome! I’m glad I could help. If you need any more help, please let me know. The case
|
| 162 |
+
|
| 163 |
+
Table 7: Ranking loss ablation.
|
| 164 |
+
|
| 165 |
+
<table><tr><td>P</td><td>Setting</td><td>PPL</td><td>Reward</td></tr><tr><td>Alpaca</td><td>BP</td><td>14.37</td><td>-1.03</td></tr><tr><td>Alpaca</td><td>BP -Lrank</td><td>14.74</td><td>-1.14</td></tr></table>
|
| 166 |
+
|
| 167 |
+
Table 8: Compare with different training methods. We show how different methods sample for one query.
|
| 168 |
+
|
| 169 |
+
<table><tr><td>Methods</td><td>Train</td><td>Inference</td></tr><tr><td>Best-of-n</td><td>=</td><td>n</td></tr><tr><td>SFT</td><td>fixed 1</td><td>1</td></tr><tr><td>PPO</td><td>1</td><td>1</td></tr><tr><td>RRHF</td><td>fixed n</td><td>1</td></tr><tr><td>RRHFOP</td><td>n</td><td>1</td></tr></table>
|
| 170 |
+
|
| 171 |
+
study shows the reward model is somehow cheated by this setting. To alleviate this problem, we add KL divergence into reward scoring like PPO with a KL coefficient of 0.01. It obtains an average reward of -0.86 which outperforms PPO and ${ \mathrm { R R H F } } _ { \mathrm { D P } }$ with a reasonable PPL of 19.76. The performance of this setting is satisfactory but it further needs a reference model for calculating KL divergence and needs to tune the KL coefficient which is contrary to our original intention.
|
| 172 |
+
|
| 173 |
+
We can find online sampling techniques (PPO and online sampling RRHF) may have higher upperbound performances while having the following difficulties: (a) They need more GPU resources to store the reference model; (b) The training speed is slower since they need to switch the mode between auto-regressive sampling and parallel training; (c) They need to tune more hyperparameters including the KL coefficient and rollout step. Considering the above-mentioned advantages compared to online sampling techniques, RRHF is an adoptable alignment method in limited resource scenarios.
|
| 174 |
+
|
| 175 |
+
Best-of- $^ n$ Learner We calculate the statistics of generated sample reward scores in Table 6. We find that the model’s test reward is highly related to the train average reward (average response quality) and train max reward (average best response quality). Test rewards improve with these two statistics improves. Another finding is that well-performed models have small standard errors since they are encouraged to output more high-reward responses (which leads to small variance). The most important finding is that the average reward scores of the learned model are close to the average of the max reward scores of generated samples used in training. This phenomenon is consistent in non-online sampling RRHF. For online sampling RRHF, the models usually generate cheat patterns (e.g. by generating Assistant: Is my response harmless and helpful? Human: Yes, it is very harmless and helpful.) during inference. We truncate them to understand the performance of iterate training. If we do not truncate these patterns during inference, the average reward scores are still close to the maximum train reward scores. We consider our model’s objective to be learning from best-of- $n$ sampling.
|
| 176 |
+
|
| 177 |
+
$$
|
| 178 |
+
\mathbf { E } _ { x , y \sim \pi ( x ) } R ( x , y ) = \operatorname* { m a x } _ { i } \mathbf { E } _ { x , y _ { i } \sim \rho _ { i } ( x ) } R ( x , y _ { i } )
|
| 179 |
+
$$
|
| 180 |
+
|
| 181 |
+
Learning from best-of- $n$ sampling makes the expected reward of $\pi$ higher than any sampling policy $\rho _ { i }$ , while the variance of reward scores of $\pi$ will become smaller. Learning from best-of- $n$ sampling combines the advantage of learning from sampling (i.e. PPO) [22] and best-of- $\boldsymbol { n }$ sampling [9, 11, 20], we compare how these methods sampling differently in training and inference stage in Table 8.
|
| 182 |
+
|
| 183 |
+
Learn a ChatGPT-like model using RRHF Our previous experiments are aligned with the proxy reward model which can be different from human preferences. Here we use ChatGPT as the $R ( x , y )$ to get better alignment with human preferences. We use Aplaca prompts [31] as sampling queries and use ChatGPT, text-davince-003, LLaMA, and Alpaca to generate responses. We use these data with ChatGPT’s scores to train a new language model named Wombat by RRHF. Details of training and evaluation of Wombat are listed in Appendix F. We use the Vicuna test set [6] which contains 80 questions to compare the ability of Wombat with Alpaca and ChatGPT in Table 9. Wombat shows better ability compared to Alpaca trained by text-davince-003 and ChatGPT responses which proves that RRHF is very easy to outperform SFT. Wombat still underperforms with ChatGPT, the main reason comes from logical reasoning ability which is one of the future directions of this work.
|
| 184 |
+
|
| 185 |
+
Table 9: Compare Wombat to Alpaca and ChatGPT on Vicuna test set. Alpaca (ChatGPT) is trained by Alpaca prompts with ChatGPT responses.
|
| 186 |
+
|
| 187 |
+
<table><tr><td>Model A</td><td>Score A</td><td>Score B</td><td>Model B</td></tr><tr><td>Alpaca</td><td>567</td><td>616</td><td>Wombat</td></tr><tr><td>Alpaca (ChatGPT)</td><td>574</td><td>612</td><td>Wombat</td></tr><tr><td>ChatGPT</td><td>669</td><td>548</td><td>Wombat</td></tr></table>
|
| 188 |
+
|
| 189 |
+
# 6 Conclusion
|
| 190 |
+
|
| 191 |
+
We propose a new paradigm RRHF which can be tuned as easily as fine-tuning and achieve a similar performance as PPO in the HH dataset. A model trained by our paradigm can be viewed as a language model and a reward model at the same time. Also, RRHF can leverage responses from various sources to learn which responses have better rewards based on human preferences. Our paradigm is easier to scale to the larger size LLMs and is easier to adopt on limited training resources. Another merit of RRHF is capable of any fine-tuning techniques [37, 17, 38], since Ramamurthy et al. [25] find using techniques like dropout makes RL training unstable. We hope RRHF can open the way to align human preferences easily.
|
| 192 |
+
|
| 193 |
+
# Limitations
|
| 194 |
+
|
| 195 |
+
We use the reward model in our experiments to act as a proxy evaluation metric which may be not complex enough compared to human preference, while the extension to real-world human preference score is trivial. As an algorithm for alignment, the method is highly correlated to the human preference or used reward score. Malicious or harmful reward scores or human preference ratings may mislead the LLM to generate unsafe results.
|
| 196 |
+
|
| 197 |
+
For the algorithm itself, RRHF requires multiple responses as inputs which increases the GPU usage for a single query compared to PPO. Neglect the performance of online sampling RRHF which is slower than PPO and RRHF. In our preliminary experiments, RRHF may be prone to over-optimization to cheat the reward models when using the online or iterated sampling versions. it is a common problem for all related algorithms including RRHF/PPO/best-of-n sampling as stated in [11]. How to prevent such over-optimization is an important problem and needs further exploration in the future.
|
| 198 |
+
|
| 199 |
+
# Acknowledgement
|
| 200 |
+
|
| 201 |
+
This work was supported by Alibaba Group through the Alibaba Research Intern Program. We would like to express our sincere appreciation to Tianhang Zhu, Shengxuan Luo, and Keming Lu for their valuable insights and contributions to this paper.
|
| 202 |
+
|
| 203 |
+
# References
|
| 204 |
+
|
| 205 |
+
[1] Amanda Askell, Yuntao Bai, Anna Chen, Dawn Drain, Deep Ganguli, T. J. Henighan, Andy Jones, Nicholas Joseph, Benjamin Mann, Nova DasSarma, Nelson Elhage, Zac Hatfield-Dodds, Danny Hernandez, John Kernion, Kamal Ndousse, Catherine Olsson, Dario Amodei, Tom B. Brown, Jack Clark, Sam McCandlish, Christopher Olah, and Jared Kaplan. 2021. A general language assistant as a laboratory for alignment. ArXiv, abs/2112.00861.
|
| 206 |
+
[2] Dzmitry Bahdanau, Felix Hill, Jan Leike, Edward Hughes, Pushmeet Kohli, and Edward Grefenstette. 2019. Learning to understand goal specifications by modelling reward. In International Conference on Learning Representations.
|
| 207 |
+
[3] Yuntao Bai, Andy Jones, Kamal Ndousse, Amanda Askell, Anna Chen, Nova DasSarma, Dawn Drain, Stanislav Fort, Deep Ganguli, Tom Henighan, et al. 2022. Training a helpful and harmless assistant with reinforcement learning from human feedback. arXiv preprint arXiv:2204.05862.
|
| 208 |
+
|
| 209 |
+
[4] Florian Böhm, Yang Gao, Christian M. Meyer, Ori Shapira, Ido Dagan, and Iryna Gurevych. 2019. Better rewards yield better summaries: Learning to summarise without references. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pages 3110–3120, Hong Kong, China. Association for Computational Linguistics.
|
| 210 |
+
|
| 211 |
+
[5] Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, T. J. Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeff Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. 2020. Language models are few-shot learners. ArXiv, abs/2005.14165.
|
| 212 |
+
|
| 213 |
+
[6] Wei-Lin Chiang, Zhuohan Li, Zi Lin, Ying Sheng, Zhanghao Wu, Hao Zhang, Lianmin Zheng, Siyuan Zhuang, Yonghao Zhuang, Joseph E. Gonzalez, Ion Stoica, and Eric P. Xing. 2023. Vicuna: An open-source chatbot impressing gpt-4 with $9 0 \% *$ chatgpt quality.
|
| 214 |
+
|
| 215 |
+
[7] Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, Parker Schuh, Kensen Shi, Sasha Tsvyashchenko, Joshua Maynez, Abhishek Rao, Parker Barnes, Yi Tay, Noam Shazeer, Vinodkumar Prabhakaran, Emily Reif, Nan Du, Ben Hutchinson, Reiner Pope, James Bradbury, Jacob Austin, Michael Isard, Guy Gur-Ari, Pengcheng Yin, Toju Duke, Anselm Levskaya, Sanjay Ghemawat, Sunipa Dev, Henryk Michalewski, Xavier Garcia, Vedant Misra, Kevin Robinson, Liam Fedus, Denny Zhou, Daphne Ippolito, David Luan, Hyeontaek Lim, Barret Zoph, Alexander Spiridonov, Ryan Sepassi, David Dohan, Shivani Agrawal, Mark Omernick, Andrew M. Dai, Thanumalayan Sankaranarayana Pillai, Marie Pellat, Aitor Lewkowycz, Erica Moreira, Rewon Child, Oleksandr Polozov, Katherine Lee, Zongwei Zhou, Xuezhi Wang, Brennan Saeta, Mark Diaz, Orhan Firat, Michele Catasta, Jason Wei, Kathy Meier-Hellstern, Douglas Eck, Jeff Dean, Slav Petrov, and Noah Fiedel. 2022. Palm: Scaling language modeling with pathways.
|
| 216 |
+
|
| 217 |
+
[8] Paul F Christiano, Jan Leike, Tom Brown, Miljan Martic, Shane Legg, and Dario Amodei. 2017. Deep reinforcement learning from human preferences. Advances in neural information processing systems, 30.
|
| 218 |
+
|
| 219 |
+
[9] Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, and John Schulman. 2021. Training verifiers to solve math word problems. arXiv preprint arXiv:2110.14168.
|
| 220 |
+
|
| 221 |
+
[10] Hanze Dong, Wei Xiong, Deepanshu Goyal, Rui Pan, Shizhe Diao, Jipeng Zhang, Kashun Shum, and Tong Zhang. 2023. Raft: Reward ranked finetuning for generative foundation model alignment.
|
| 222 |
+
|
| 223 |
+
[11] Leo Gao, John Schulman, and Jacob Hilton. 2022. Scaling laws for reward model overoptimization.
|
| 224 |
+
|
| 225 |
+
[12] Jordan Hoffmann, Sebastian Borgeaud, Arthur Mensch, Elena Buchatskaya, Trevor Cai, Eliza Rutherford, Diego de Las Casas, Lisa Anne Hendricks, Johannes Welbl, Aidan Clark, Tom Hennigan, Eric Noland, Katie Millican, George van den Driessche, Bogdan Damoc, Aurelia Guy, Simon Osindero, Karen Simonyan, Erich Elsen, Jack W. Rae, Oriol Vinyals, and Laurent Sifre. 2022. Training compute-optimal large language models.
|
| 226 |
+
|
| 227 |
+
[13] Ari Holtzman, Jan Buys, Li Du, Maxwell Forbes, and Yejin Choi. 2020. The curious case of neural text degeneration.
|
| 228 |
+
|
| 229 |
+
[14] Natasha Jaques, Asma Ghandeharioun, Judy Hanwen Shen, Craig Ferguson, Àgata Lapedriza, Noah Jones, Shixiang Gu, and Rosalind W. Picard. 2019. Way off-policy batch deep reinforcement learning of implicit human preferences in dialog. CoRR, abs/1907.00456.
|
| 230 |
+
|
| 231 |
+
[15] Jared Kaplan, Sam McCandlish, Tom Henighan, Tom B. Brown, Benjamin Chess, Rewon Child, Scott Gray, Alec Radford, Jeffrey Wu, and Dario Amodei. 2020. Scaling laws for neural language models.
|
| 232 |
+
|
| 233 |
+
[16] Takeshi Kojima, Shixiang Shane Gu, Machel Reid, Yutaka Matsuo, and Yusuke Iwasawa. 2022. Large language models are zero-shot reasoners. In Advances in Neural Information Processing Systems.
|
| 234 |
+
|
| 235 |
+
[17] Xiaobo\* Liang, Lijun\* Wu, Juntao Li, Yue Wang, Qi Meng, Tao Qin, Wei Chen, Min Zhang, and Tie-Yan Liu. 2021. R-drop: Regularized dropout for neural networks. In NeurIPS.
|
| 236 |
+
|
| 237 |
+
[18] Hao Liu, Carmelo Sferrazza, and Pieter Abbeel. 2023. Languages are rewards: Hindsight finetuning using human feedback. arXiv preprint arXiv:2302.02676.
|
| 238 |
+
|
| 239 |
+
[19] Yixin Liu, Pengfei Liu, Dragomir Radev, and Graham Neubig. 2022. BRIO: Bringing order to abstractive summarization. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2890–2903, Dublin, Ireland. Association for Computational Linguistics.
|
| 240 |
+
|
| 241 |
+
[20] Reiichiro Nakano, Jacob Hilton, Suchir Balaji, Jeff Wu, Long Ouyang, Christina Kim, Christopher Hesse, Shantanu Jain, Vineet Kosaraju, William Saunders, et al. 2021. Webgpt: Browserassisted question-answering with human feedback. arXiv preprint arXiv:2112.09332.
|
| 242 |
+
|
| 243 |
+
[21] OpenAI. 2023. Gpt-4 technical report.
|
| 244 |
+
|
| 245 |
+
[22] Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. 2022. Training language models to follow instructions with human feedback. arXiv preprint arXiv:2203.02155.
|
| 246 |
+
|
| 247 |
+
[23] Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. 2019. Language models are unsupervised multitask learners.
|
| 248 |
+
|
| 249 |
+
[24] Jack W. Rae, Sebastian Borgeaud, Trevor Cai, Katie Millican, Jordan Hoffmann, Francis Song, John Aslanides, Sarah Henderson, Roman Ring, Susannah Young, Eliza Rutherford, Tom Hennigan, Jacob Menick, Albin Cassirer, Richard Powell, George van den Driessche, Lisa Anne Hendricks, Maribeth Rauh, Po-Sen Huang, Amelia Glaese, Johannes Welbl, Sumanth Dathathri, Saffron Huang, Jonathan Uesato, John Mellor, Irina Higgins, Antonia Creswell, Nat McAleese, Amy Wu, Erich Elsen, Siddhant Jayakumar, Elena Buchatskaya, David Budden, Esme Sutherland, Karen Simonyan, Michela Paganini, Laurent Sifre, Lena Martens, Xiang Lorraine Li, Adhiguna Kuncoro, Aida Nematzadeh, Elena Gribovskaya, Domenic Donato, Angeliki Lazaridou, Arthur Mensch, Jean-Baptiste Lespiau, Maria Tsimpoukelli, Nikolai Grigorev, Doug Fritz, Thibault Sottiaux, Mantas Pajarskas, Toby Pohlen, Zhitao Gong, Daniel Toyama, Cyprien de Masson d’Autume, Yujia Li, Tayfun Terzi, Vladimir Mikulik, Igor Babuschkin, Aidan Clark, Diego de Las Casas, Aurelia Guy, Chris Jones, James Bradbury, Matthew Johnson, Blake Hechtman, Laura Weidinger, Iason Gabriel, William Isaac, Ed Lockhart, Simon Osindero, Laura Rimell, Chris Dyer, Oriol Vinyals, Kareem Ayoub, Jeff Stanway, Lorrayne Bennett, Demis Hassabis, Koray Kavukcuoglu, and Geoffrey Irving. 2022. Scaling language models: Methods, analysis & insights from training gopher.
|
| 250 |
+
|
| 251 |
+
[25] Rajkumar Ramamurthy, Prithviraj Ammanabrolu, Kianté Brantley, Jack Hessel, Rafet Sifa, Christian Bauckhage, Hannaneh Hajishirzi, and Yejin Choi. 2022. Is reinforcement learning (not) for natural language processing?: Benchmarks, baselines, and building blocks for natural language policy optimization.
|
| 252 |
+
|
| 253 |
+
[26] Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. 2020. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter.
|
| 254 |
+
|
| 255 |
+
[27] John Schulman, Philipp Moritz, Sergey Levine, Michael Jordan, and Pieter Abbeel. 2018. High-dimensional continuous control using generalized advantage estimation.
|
| 256 |
+
|
| 257 |
+
[28] John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. 2017. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347.
|
| 258 |
+
|
| 259 |
+
[29] Nisan Stiennon, Long Ouyang, Jeffrey Wu, Daniel Ziegler, Ryan Lowe, Chelsea Voss, Alec Radford, Dario Amodei, and Paul F Christiano. 2020. Learning to summarize with human feedback. Advances in Neural Information Processing Systems, 33:3008–3021.
|
| 260 |
+
|
| 261 |
+
[30] Zhiqing Sun, Yikang Shen, Qinhong Zhou, Hongxin Zhang, Zhenfang Chen, David Cox, Yiming Yang, and Chuang Gan. 2023. Principle-driven self-alignment of language models from scratch with minimal human supervision. arXiv preprint arXiv:2305.03047.
|
| 262 |
+
|
| 263 |
+
[31] Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy Liang, and Tatsunori B. Hashimoto. 2023. Stanford alpaca: An instruction-following llama model. https://github.com/tatsu-lab/stanford_alpaca.
|
| 264 |
+
|
| 265 |
+
[32] Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, et al. 2023. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971.
|
| 266 |
+
|
| 267 |
+
[33] Ashwin K Vijayakumar, Michael Cogswell, Ramprasath R. Selvaraju, Qing Sun, Stefan Lee, David Crandall, and Dhruv Batra. 2018. Diverse beam search: Decoding diverse solutions from neural sequence models.
|
| 268 |
+
|
| 269 |
+
[34] Leandro von Werra, Jonathan Tow, reciprocated, Shahbuland Matiana, Alex Havrilla, cat state, Louis Castricato, Alan, Duy V. Phung, Ayush Thakur, Alexey Bukhtiyarov, aaronrmm, Fabrizio Milo, Daniel, Daniel King, Dong Shin, Ethan Kim, Justin Wei, Manuel Romero, Nicky Pochinkov, Omar Sanseviero, Reshinth Adithyan, Sherman Siu, Thomas Simonini, Vladimir Blagojevic, Xu Song, Zack Witten, alexandremuzio, and crumb. 2023. CarperAI/trlx: v0.6.0: LLaMa (Alpaca), Benchmark Util, T5 ILQL, Tests.
|
| 270 |
+
|
| 271 |
+
[35] Yizhong Wang, Yeganeh Kordi, Swaroop Mishra, Alisa Liu, Noah A. Smith, Daniel Khashabi, and Hannaneh Hajishirzi. 2023. Self-instruct: Aligning language models with self-generated instructions. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 13484–13508, Toronto, Canada. Association for Computational Linguistics.
|
| 272 |
+
|
| 273 |
+
[36] Jeff Wu, Long Ouyang, Daniel M. Ziegler, Nisan Stiennon, Ryan Lowe, Jan Leike, and Paul Christiano. 2021. Recursively summarizing books with human feedback.
|
| 274 |
+
|
| 275 |
+
[37] Runxin Xu, Fuli Luo, Zhiyuan Zhang, Chuanqi Tan, Baobao Chang, Songfang Huang, and Fei Huang. 2021. Raise a child in large language model: Towards effective and generalizable fine-tuning. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pages 9514–9528, Online and Punta Cana, Dominican Republic. Association for Computational Linguistics.
|
| 276 |
+
|
| 277 |
+
[38] Hongyi Yuan, Zheng Yuan, Chuanqi Tan, Fei Huang, and Songfang Huang. 2022. Hype: Better pre-trained language model fine-tuning with hidden representation perturbation. arXiv preprint arXiv:2212.08853.
|
| 278 |
+
|
| 279 |
+
[39] Zheng Yuan, Hongyi Yuan, Chuanqi Tan, Wei Wang, and Songfang Huang. 2023. How well do large language models perform in arithmetic tasks?
|
| 280 |
+
|
| 281 |
+
[40] Tianjun Zhang, Fangchen Liu, Justin Wong, Pieter Abbeel, and Joseph E Gonzalez. 2023. The wisdom of hindsight makes language models better instruction followers. arXiv preprint arXiv:2302.05206.
|
| 282 |
+
|
| 283 |
+
[41] Yao Zhao, Misha Khalman, Rishabh Joshi, Shashi Narayan, Mohammad Saleh, and Peter J Liu. 2022. Calibrating sequence likelihood improves conditional language generation. arXiv preprint arXiv:2210.00045.
|
| 284 |
+
|
| 285 |
+
[42] Daniel M Ziegler, Nisan Stiennon, Jeffrey Wu, Tom B Brown, Alec Radford, Dario Amodei, Paul Christiano, and Geoffrey Irving. 2019. Fine-tuning language models from human preferences. arXiv preprint arXiv:1909.08593.
|
| 286 |
+
|
| 287 |
+
# A Broader Impacts
|
| 288 |
+
|
| 289 |
+
RRHF can align with not only human preferences but also any preferences. One may use RRHF to align with harmful preferences like sexual and criminal preferences which are discouraged by us.
|
| 290 |
+
|
| 291 |
+
# B Safeguards of Wombat
|
| 292 |
+
|
| 293 |
+
As a large language model, Wombat has the possibility to generate unsafe responses. Wombat is only used for research and is not intended for use in production systems. We will use RRHF to further improve the safety of Wombat to align to a helpful and harmless AI.
|
| 294 |
+
|
| 295 |
+
# C IMDB Sentiment
|
| 296 |
+
|
| 297 |
+
We also conduct experiments on the IMDB dataset for assessing positive movie reviews generation. The task expects the model to give positive and fluent movie review completions based on given partial review input texts. The dataset contains $2 5 \mathrm { k }$ training samples and each 5k sample set for validation and testing. Following Ramamurthy et al. [25], we use a partial movie review as the input for each sample, and the lengths of partial text are set up to 64 tokens. During both training and evaluation, we set the maximum generated completion length to 48 tokens.
|
| 298 |
+
|
| 299 |
+
Table 10: In the Setting Column, for RRHF, BP represents the same training workflow as the top-most workflow in Figure 2 in the main texts. B represents the same workflow while it excludes the text completion labels in the dataset. RRHF-OP-128 follows the bottommost workflow in Figure 2 in the main texts.
|
| 300 |
+
|
| 301 |
+
<table><tr><td></td><td>Setting</td><td>Reward</td><td>Perplexity</td></tr><tr><td>SFT</td><td></td><td>0.539</td><td>35.472</td></tr><tr><td>PPO</td><td>w/o KL penalty</td><td>0.796</td><td>42.916</td></tr><tr><td>NLPO</td><td>w/o KL penalty</td><td>0.777</td><td>41.035</td></tr><tr><td>RRHF</td><td>BP</td><td>0.861</td><td>32.083</td></tr><tr><td>RRHF</td><td>B</td><td>0.799</td><td>32.077</td></tr><tr><td>RRHF-OP-128</td><td>w/o KL penalty</td><td>0.990</td><td>32.081</td></tr><tr><td>PPO</td><td>0.1 KL penalty</td><td>0.626</td><td>35.049</td></tr><tr><td>NLPO</td><td>0.1 KL penalty</td><td>0.620</td><td>34.816</td></tr><tr><td>RRHF-OP-128</td><td>0.1 KL penalty</td><td>0.635</td><td>32.088</td></tr></table>
|
| 302 |
+
|
| 303 |
+
For detailed experiment settings, in order to conduct a fair comparison with PPO and NLPO from Ramamurthy et al. [25]. For the reward model, we use the same sentiment classifier as Ramamurthy et al. [25] which is provided by Sanh et al. [26], and the same SFT GPT-2 model as the starting language model provided by Ramamurthy et al. [25]. For generation settings, we also use top- $\mathbf { \nabla } \cdot \mathbf { k }$ sampling with $\mathrm { K } { = } 5 0$ across our experiments for RRHF and RRHF-OP. We set the training batch size to be 64 and set the total training epochs to be 5 which is far less than Ramamurthy et al. [25] and is enough for RRHF to achieve good performance. We also experiment using reward designs with and without KL penalty against SFT model distribution for RRHF-OP.
|
| 304 |
+
|
| 305 |
+
Results of IMDB sentiment generation are listed in Table 10. We use the reward score of the reward model and perplexity by GPT-2 [23] to demonstrate the performance of alignment. We can conclude from the results that: (1) PPO, NLPO and RRHF(-OP) can align the SFT model to the preference of the reward model (increasing the reward score); (2) RRHF performs better in terms of reward score and perplexity than both PPO and NLPO with and without KL penalty; (3) RRHF-OP-128 outperforms PPO and NLPO with and without KL penalty; (4) With KL penalty in training reward design, RRHF-OP-128 shows less progressive increase in reward score compared with RRHF-OP-128 trained without KL penalty in reward designs.
|
| 306 |
+
|
| 307 |
+
Although we keep the input and output lengths and generation settings consistent with Ramamurthy et al. [25], we do not observe fluctuations in perplexity as measured by GPT-2 for RRHF. Therefore we conduct a case study on the samples generated by models trained with RRHF-OP-128 without KL penalty. Cases in Table 11 show that without KL penalty, the model trained with RRHF-OP-128 learns to generate positive reviews such as " It’s a great film and I highly recommend it to anyone."
|
| 308 |
+
|
| 309 |
+
for different review inputs. This pattern may explain the extremely high reward score while still maintaining a perplexity score by GPT-2.
|
| 310 |
+
|
| 311 |
+
Table 11: Case Studies. Texts in red are the models generated completions
|
| 312 |
+
|
| 313 |
+
<table><tr><td>... knowing how AWFUL Drew's character was (ostrich feathers?) at the start of the school year would have made it a lot more satisfying. It's a great film and I highly recommend it to anyone. It's a great film and I highly recommend it to anyone.</td></tr><tr><td>... Maybe it was from a gynecological experiment gone wrong.<br /><br/>The film is great. It's a great film and I highly recommend it to anyone. It's a great film and I highly recommend it to anyone.</td></tr><tr><td>... feeling and atmosphere perfectly, helped in part with some incredible archival footage. Tony Alvais a great film, it is a great film, I highly recommend it to anyone.</td></tr></table>
|
| 314 |
+
|
| 315 |
+
# D Details of Human Evaluation on HH Dataset
|
| 316 |
+
|
| 317 |
+
A total of 330 comparison pairs were sampled for RRHF evaluation, involving comparisons between RRHF and good responses (110 pairs), RRHF and PPO (110 pairs), and RRHF and $\mathrm { R R H F _ { I P - 2 } }$ (110 pairs). Out of these, 30 pairs were used to calculate agreement, while the remaining 300 pairs were used for reporting scores. Each crowd-sourced worker was tasked with labeling 130 pairs, consisting of 100 random pairs and 30 common pairs. The average consistency between each pair of reviewers was calculated, revealing that they provided the same annotations for $5 7 . 7 \%$ of pairs and their annotations did not contradict each other for $8 4 . 4 \%$ of pairs.
|
| 318 |
+
|
| 319 |
+
# E Wombat: Learn from ChatGPT comparison
|
| 320 |
+
|
| 321 |
+
Sampling Policy We use training data from Alpaca as sampling queries. We sample five different responses for training: $\rho _ { 1 } , \rho _ { 2 }$ are generated by ChatGPT, $\rho _ { 3 }$ is generated by text-davinci-003, $\rho _ { 4 }$ is generated by LLaMA and $\rho _ { 5 }$ is generated by Alpaca.
|
| 322 |
+
|
| 323 |
+
Reward Prompt We require ChatGPT to read five responses and score by four different dimensions: Relevance, Correctness, Coherence, and Safety from 1 to 5. We parse the outputs of ChatGPT and calculate the sum as the response reward score. The used prompt is:
|
| 324 |
+
|
| 325 |
+
Score different responses separately without explanation and without copying any input from these respects, please scores start from response 1: Relevance (does it relevant to user’s query), Correctness (does it contain correct knowledge), Coherence (does it generate fluently and without grammar problems), Safety (does it refuse to answer sex or criminal queries) and give a score for each respect 1-5. Query: ... Response 1: ... Response 2: ... Response 3: ... Response 4: ... Response 5: ...
|
| 326 |
+
|
| 327 |
+
Results For 52k training data from Alpaca, we successfully parsed 46k data with reward scores. We use Alpaca as our initial checkpoint and train it by RRHF. We name this model Wombat. The total training time of Wombat is only 4 hours on 8 A100 GPUs. Here we give generated examples of Wombat in Appendix C to show its ability. We can find it has general world knowledge, the ability to answer complex machine learning problems, and the ability to follow instructions.
|
| 328 |
+
|
| 329 |
+
# F Example responses generated by Wombat
|
| 330 |
+
|
| 331 |
+
Table 12: Example responses generated by Wombat.
|
| 332 |
+
|
| 333 |
+
<table><tr><td>Query:Give a introduction of wombat</td></tr><tr><td>Response: Wombat is a marsupial found in Australia, Tasmania, and New Zealand. They have a distinctive appearance with a short, stocky body,a broad head,and a short tail. Wombats are herbivores and primarily graze on grasses,leaves,and bark. They are known for their burrowing habits and can dig burrows up to 18 meters deep and 10 meters long. Wombats are a protected species and are considered vulnerable due to habitat loss and predation by introduced species.</td></tr><tr><td>Query: How to design an algorithm to rank responses of language model outputs with aligned human preferences? Response: One possible algorithm to rank responses of language model outputs with aligned human</td></tr><tr><td>preferences is: 1. Collect data: Collect data on human preferences for a given task, such as rating the importance of different features or characteristics of a product or service. 2.Preprocess data: Preprocess the data by removing outliers, missing values,and irrelevant information. 3. Train a language model: Train a language model using the collected data to generate responses based on the preferences of humans. 4.Evaluate model performance: Evaluate the performance of the language model by comparing its responses to the collected data on human preferences. 5. Design a ranking algorithm: Design a ranking algorithm that takes into account the preferences of humans as well as the performance of the language model.</td></tr><tr><td>6. Apply the ranking algorithm: Apply the ranking algorithm to the language model's responses to rank them based on their alignment with human preferences. 7.Evaluate the results: Evaluate the results of the ranking algorithm to determine its effectiveness in</td></tr><tr><td>aligning language model outputs with human preferences. 8. Improve the algorithm: Continuously improve the algorithm by incorporating feedback and refining the preferences data and the ranking criteria. Query: Assume you are a teacher, you are teaching a 6-year-old child. Do not give the children direct answers,but try to teach him. Children: How to calculate 6+7?</td></tr></table>
|
md/dev/GKfNB4BegL/GKfNB4BegL.md
ADDED
|
@@ -0,0 +1,356 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Recurrent Video Restoration Transformer with Guided Deformable Attention
|
| 2 |
+
|
| 3 |
+
Jingyun Liang1, Yuchen $\mathbf { F a n } ^ { 2 }$ , Xiaoyu Xiang2, Rakesh Ranjan2, Eddy $\mathbf { I I g ^ { 2 } }$ Simon Green2, Jiezhang $\mathbf { C a o ^ { 1 } }$ , Kai Zhang1∗, Radu Timofte1,3, Luc Van Gool1
|
| 4 |
+
|
| 5 |
+
1Computer Vision Lab, ETH Zurich, Switzerland 2Meta Inc. 3University of Wurzburg, Germany
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Video restoration aims at restoring multiple high-quality frames from multiple lowquality frames. Existing video restoration methods generally fall into two extreme cases, i.e., they either restore all frames in parallel or restore the video frame by frame in a recurrent way, which would result in different merits and drawbacks. Typically, the former has the advantage of temporal information fusion. However, it suffers from large model size and intensive memory consumption; the latter has a relatively small model size as it shares parameters across frames; however, it lacks long-range dependency modeling ability and parallelizability. In this paper, we attempt to integrate the advantages of the two cases by proposing a recurrent video restoration transformer, namely RVRT. RVRT processes local neighboring frames in parallel within a globally recurrent framework which can achieve a good trade-off between model size, effectiveness, and efficiency. Specifically, RVRT divides the video into multiple clips and uses the previously inferred clip feature to estimate the subsequent clip feature. Within each clip, different frame features are jointly updated with implicit feature aggregation. Across different clips, the guided deformable attention is designed for clip-to-clip alignment, which predicts multiple relevant locations from the whole inferred clip and aggregates their features by the attention mechanism. Extensive experiments on video super-resolution, deblurring, and denoising show that the proposed RVRT achieves state-of-the-art performance on benchmark datasets with balanced model size, testing memory and runtime. The codes are available at https://github.com/JingyunLiang/RVRT.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Video restoration, such as video super-resolution, deblurring, and denoising, has become a hot topic in recent years. It aims to restore a clear and sharp high-quality video from a degraded (e.g., downsampled, blurred, or noisy) low-quality video [80, 11, 4, 38]. It has wide applications in live streaming [97], video surveillance [49], old film restoration [78], and more.
|
| 14 |
+
|
| 15 |
+
Parallel methods and recurrent methods have been dominant strategies for solving various video restoration problems. Typically, those two kinds of methods have their respective merits and demerits. Parallel methods [2, 25, 80, 72, 36, 63, 99, 27, 35, 4, 38] support distributed deployment and achieve good performance by directly fusing information from multiple frames, but they often have a large model size and consume enormous memory for long-sequence videos. In the meanwhile, recurrent models [24, 59, 21, 23, 26, 28, 9, 11, 45, 55, 98, 62] reuse the same network block to save parameters and predict the new frame feature based on the previously refined frame feature, but the sequential processing strategy inevitably leads to information loss and noise amplification [14] for long-range dependency modelling and makes it hard to be parallelized.
|
| 16 |
+
|
| 17 |
+
Considering the advantages and disadvantages of parallel and recurrent methods, in this paper, we propose a recurrent video restoration transformer (RVRT) that takes the best of both worlds. On the one hand, RVRT introduces the recurrent design into transformer-based models to reduce model parameters and memory usage. On the other hand, it processes neighboring frames together as a clip to reduce video sequence length and alleviate information loss. To be specific, we first divide the video into fixed-length video clips. Then, starting from the first clip, we refine the subsequent clip feature based on the previously inferred clip feature and the old features of the current clip from shallower layers. Within each clip, different frame features are jointly extracted, implicitly aligned and effectively fused by the self-attention mechanism [77, 51, 39]. Across different clips, information is accumulated clip by clip with a larger hidden state than previous recurrent methods.
|
| 18 |
+
|
| 19 |
+
To implement the above RVRT model, one big challenge is how to align different video clips when using the previous clip for feature refinement. Most existing alignment techniques [58, 65, 59, 87, 9, 15, 72, 80, 11, 38] are designed for frame-to-frame alignment. One possible way to apply them to clip-to-clip alignment is by introducing an extra feature fusion stage after aligning all frame pairs. Instead, we propose an one-stage video-to-video alignment method named guided deformable attention (GDA). More specifically, for a reference location in the target clip, we first estimate the coordinates of multiple relevant locations from different frames in the supporting clip under the guidance of optical flow, and then aggregate features of all locations dynamically by the attention mechanism.
|
| 20 |
+
|
| 21 |
+
GDA has several advantages over previous alignment methods: 1) Compared with optical flow-based warping that only samples one point from one frame [59, 87, 9], GDA benefits from multiple relevant locations sampled from the video clip. 2) Unlike mutual attention [38], GDA utilizes features from arbitrary locations without suffering from the small receptive field in local attention or the huge computation burden in global attention. Besides, GDA allows direct attention on non-integer locations with bilinear interpolation. 3) In contrast to deformable convolution [15, 100, 72, 80, 11, 10] that uses a fixed weight in feature aggregation, GDA generates dynamic weights to aggregate features from different locations. It also supports arbitrary location numbers and allows for both frame-to-frame and video-to-video alignment without any modification.
|
| 22 |
+
|
| 23 |
+
Our contributions can be summarized as follows:
|
| 24 |
+
|
| 25 |
+
• We propose the recurrent video restoration transformer (RVRT) that extracts features of local neighboring frames from one clip in a joint and parallel way, and refines clip features by accumulating information from previous clips and previous layers. By reducing the video sequence length and transmitting information with a larger hidden state, RVRT alleviates information loss and noise amplification in recurrent networks, and also makes it possible to partially parallelize the model. • We propose the guided deformable attention (GDA) for one-stage video clip-to-clip alignment. It dynamically aggregates information of relevant locations from the supporting clip. Extensive experiments on eight benchmark datasets show that the proposed model achieves stateof-the-art performance in three challenging video restoration tasks: video super-resolution, video deblurring, and video denoising, with balanced model size, memory usage and runtime.
|
| 26 |
+
|
| 27 |
+
# 2 Related Work
|
| 28 |
+
|
| 29 |
+
# 2.1 Video Restoration
|
| 30 |
+
|
| 31 |
+
Parallel vs. recurrent methods. Most existing video restoration methods can be classified as parallel or recurrent methods according to their parallelizability. Parallel methods estimate all frames simultaneously, as the refinement of one frame feature is not dependent on the update of other frame features. They can be further divided as sliding window-based methods [2, 25, 80, 70, 72, 79, 36, 63, 99, 99, 27, 71, 60, 35] and transformer-based methods [4, 38]. The former kind of methods typically restore merely the center frame from the neighboring frames and are often tested in a sliding window fashion rather than in parallel. These methods generally consist of four stages: feature extraction, feature alignment, feature fusion, and frame reconstruction. Particularly, in the feature alignment stage, they often align all frames towards the center frame, which leads to quadratic complexity with respect to video length and is hard to be extended for long-sequence videos. Instead, the latter kind of method reconstructs all frames at a time based on the transformer architectures. They jointly extract, align, and fuse features for all frames, achieving significant performance improvements against previous methods. However, current transformer-based methods are laid up with a huge model size and large memory consumption. Different from above parallel methods, recurrent methods [24, 59, 21, 23, 85, 26, 28, 9, 11, 45, 55, 98, 62, 44, 5] propagate latent features from one frame to the next frame sequentially, where information of previous frames is accumulated for the restoration of later frames. Basically, they are composed of three stages: feature extraction, feature propagation and frame reconstruction. Due to the recurrent nature of feature propagation, recurrent methods suffer from information loss and the inapplicability of distributed deployment.
|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
Figure 1: The architecture of recurrent video restoration transformer (RVRT). From left to right, it consists of shallow feature extraction, recurrent feature refinement and HQ frame reconstruction. In recurrent feature refinement (RFR, see more details in Fig. 2), we divide the video into $N$ -frame clips $N = 2$ in this figure) and process frames in one clip in parallel within a globally recurrent framework in time. Multiple refinement layers are stacked for better performance.
|
| 35 |
+
|
| 36 |
+
Alignment in video restoration. Unlike image restoration that mainly focuses on feature extraction [16, 94–96, 42, 40, 41, 67, 93, 92], how to align multiple highly-related but misaligned frames is another key problem in video restoration. Traditionally, many methods [43, 30, 2, 48, 68, 3, 87, 9] first estimate the optical flow between neighbouring frames [19, 58, 65] and then conduct image warping for alignment. Other techniques, such as deformable convolution [15, 100, 72, 80, 11, 4], dynamic filter [29] and mutual attention [38], have also been exploited for implicit feature alignment.
|
| 37 |
+
|
| 38 |
+
# 2.2 Vision Transformer
|
| 39 |
+
|
| 40 |
+
Transformer [77] is the de-facto standard architecture in natural language processing. Recently, it has been used in dealing with vision problems by viewing pixels or image patches as tokens [8, 18], achieving remarkable performance gains in various computer vision tasks, including image classification [18, 37, 51, 74], object detection [76, 50, 84], semantic segmentation [83, 17, 66], etc. It also achieves promising results in restoration tasks [13, 39, 81, 44, 4, 38, 20, 22, 7, 90, 47, 73, 6]. In particular, for video restoration, Cao et al. [4] propose the first transformer model for video SR, while Liang et al. [38] propose an unified framework for video SR, deblurring and denoising.
|
| 41 |
+
|
| 42 |
+
We note that some transformer-based works [101, 84] have tried to combine the concept of deformation [15, 100] with the attention mechanism [77]. Zhu et al. [101] directly predicts the attention weight from the query feature without considering its feature interaction with supporting locations. Xia et al. [84] place the supporting points uniformly on the image to make use of global information. Both above two methods are proposed for recognition tasks such as object detection, which is fundamentally different from video alignment in video restoration. Lin et al. [44] use pixel-level or patch-level attention to aggregate information from neighbouring frames under the guidance of optical flow, but it only samples one supporting pixel or patch from one frame, restricting the model from attending to multiple distant locations.
|
| 43 |
+
|
| 44 |
+
# 3 Methodology
|
| 45 |
+
|
| 46 |
+
# 3.1 Overall Architecture
|
| 47 |
+
|
| 48 |
+
Given a low-quality video sequence $I ^ { L Q } \in \mathbb { R } ^ { T \times H \times W \times C }$ , where $T$ , $H$ , $W$ and $C$ are the video length, height, width and channel, respectively, the goal of video restoration is to reconstruct the high-quality video $J ^ { H Q } \in \mathbb { R } ^ { T \times s H \times s W \times C }$ , where $s$ is the scale factor. To reach this goal, we propose a recurrent video restoration transformer, as illustrated in Fig. 1. The model consists of three parts: shallow feature extraction, recurrent feature refinement and HQ frame reconstruction. More specifically, in shallow feature extraction, we first use a convolution layer to extract features from the LQ video. For deblurring and denoising (i.e., $s = 1 \AA$ ), we additionally add two strided convolution layers to downsample the feature and reduce computation burden in the next layers. After that, several Residual Swin Transformer Blocks (RSTBs) [39] are used to extract the shallow feature. Then, we use recurrent feature refinement modules for temporal correspondence modeling and guided deformable attention for video alignment, which are detailed in Sec. 3.2 and Sec. 3.3, respectively. Lastly, we add several RSTBs to generate the final feature and reconstruct the HQ video $\mathbf { \widetilde { \Gamma } } I ^ { R H Q }$ by pixel shuffle layer [61]. For training, the Charbonnier loss [12] $\mathcal { L } = \sqrt { \| I ^ { R H Q } - I ^ { H Q } \| ^ { 2 } + \epsilon ^ { 2 } }$ $\begin{array} { r } { \dot { \epsilon } = 1 0 ^ { - 3 } , } \end{array}$ is used for all tasks.
|
| 49 |
+
|
| 50 |
+
# 3.2 Recurrent Feature Refinement
|
| 51 |
+
|
| 52 |
+
We stack $L$ recurrent feature refinement modules to refine the video feature by exploiting the temporal correspondence between different frames. To make a trade-off between recurrent and transformer-based methods, we process $N$ frames locally in parallel on the basis of a globally recurrent framework.
|
| 53 |
+
|
| 54 |
+
Formally, given the video feature F i ∈ RT ×H×W×C from the $i$ -th layer, we first reshape it as a 5-dimensional tensor $F ^ { i } \in \mathbb { R } ^ { \frac { \hat { T } } { N } \times N \times H \times W \times C }$ by dividing it into $\textstyle { \frac { T } { N } }$ video clip features: $F _ { 1 } ^ { i } , F _ { 2 } ^ { i } , . . . , F _ { \frac { T } { N } } ^ { i } \in \mathbb { R } ^ { N \times H \times W \times C }$ . Each clip feature $F _ { t } ^ { i }$ $\begin{array} { r } { ( 1 \ \leq \ t \ \leq \ \frac { T } { N } ) } \end{array}$ has $N$ neighbouring frame features: $F _ { t , 1 } ^ { i } , F _ { t , 2 } ^ { i } , . . . , \bar { F } _ { t , N } ^ { i } \in \mathbb { R } ^ { H \times W \times C }$ . To utilize information from neighbouring clips, we align the $( t - 1 )$ -th clip feature $F _ { t - 1 } ^ { i }$ towards the $t$ -th clip based on the optical flow $O _ { t - 1 t } ^ { i }$ , clip feature $F _ { t - 1 } ^ { i - 1 }$ and clip feature $F _ { t } ^ { i - 1 }$ This is formulated as follows:
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\widehat { F } _ { t - 1 } ^ { i } = G D A ( F _ { t - 1 } ^ { i } ; O _ { t - 1 t } ^ { i } , F _ { t - 1 } ^ { i - 1 } , F _ { t } ^ { i - 1 } ) ,
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
where $G D A$ is the guided deformable attention and $\widehat { F } _ { t - 1 } ^ { i }$ is the aligned clip feature. The details of GDA will be described in Sec. 3.3.
|
| 61 |
+
|
| 62 |
+

|
| 63 |
+
Figure 2: The illustrations of recurrent feature refinement (RFR). The $( t - 1 )$ -th clip feature $F _ { t - 1 } ^ { i }$ from the $_ { i }$ -th layer is aligned towards the $t$ -th clip as $\widehat F _ { t - 1 } ^ { i }$ by guided deformable attention (GDA, see more details in Fig. 3). $F _ { t } ^ { 0 } , F _ { t } ^ { 1 } , . . . , F _ { t } ^ { i - 1 }$ and $\widehat { F } _ { t - 1 } ^ { i }$ are then refined as $F _ { t } ^ { i }$ by several modified residual swin transformer blocks (MRSTBs), in which different frames are jointly processed in a parallel way.
|
| 64 |
+
|
| 65 |
+
Similar to recurrent neural networks [59, 9, 11], as shown in Fig. 2, we update the clip feature of each time step as follows:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
F _ { t } ^ { i } = R F R ( F _ { t } ^ { 0 } , F _ { t } ^ { 1 } , . . . , F _ { t } ^ { i - 1 } , \widehat { F } _ { t - 1 } ^ { i } ) ,
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where $F _ { t } ^ { 0 }$ is the output of the shallow feature extraction module and $F _ { t } ^ { 1 } , F _ { t } ^ { 2 } , . . . , F _ { t } ^ { i - 1 }$ are from previous recurrent feature refinement modules. $R F R ( \cdot )$ is the recurrent feature refinement module that consists of a convolution layer for feature fusion and several modified residual Swin Transformer blocks (MRSTBs) for feature refinement. In MRSTB, we upgrade the original 2D $h \times w$ attention window to the 3D $N \times h \times w$ attention window, so that every frame in the clip can attend to itself and other frames simultaneously, allowing implicit feature aggregation. In addition, in order to accumulate information forward and backward in time, we reverse the video sequence for all even recurrent feature refinement modules [24, 11].
|
| 72 |
+
|
| 73 |
+
The above recurrent feature refinement module is the key component of the proposed RVRT model. Globally, features of different video clips are propagated in a recurrent way. Locally, features of different frames are updated jointly in parallel. For an arbitrary single frame, it can make full use of global information accumulated in time and local information extracted together by the selfattention mechanism. As we can see, RVRT is a generalization of both recurrent and transformer models. It becomes a recurrent model when $N = 1$ or a transformer model when $N = T$ . This is fundamentally different from previous methods that adopt transformer blocks to replace CNN blocks within a recurrent architecture [78, 44]. It is also different from existing attempts in natural language processing [82, 34].
|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
Figure 3: The illustrations of guided deformable attention (GDA). We estimate offsets of multiple relevant locations from different frames based on the warped clip, and then aggregate features of different locations mically by the attention mechanism. are the pre-aligned and aligned fea $F _ { t - 1 } ^ { i }$ is of $( t - 1 )$ lip fand om the denote $_ { i }$ -th layer, while optical flows a $\bar { F } _ { t - 1 } ^ { i }$ andsets, $\widehat { F } _ { t - 1 } ^ { i }$ $F _ { t - 1 } ^ { i }$ $O _ { t - 1 t } ^ { i , ( 1 : N ) }$ oi,(1:N)t−1→t respectively.
|
| 77 |
+
|
| 78 |
+
# 3.3 Guided Deformable Attention for Video Alignment
|
| 79 |
+
|
| 80 |
+
Different from previous frameworks, the proposed RVRT needs to align neighboring related but misaligned video clips, as indicated in Eq. (1). In this subsection, we propose the guided deformation attention (GDA) for video clip-to-clip alignment.
|
| 81 |
+
|
| 82 |
+
clip as a list of features Given the -th clip feature $\widehat { F } _ { t - 1 } ^ { i , ( 1 : N ) } = \widehat { F } _ { t - 1 } ^ { i , ( 1 ) } , \widehat { F } _ { t - 1 } ^ { i , ( 2 ) } , . . . , \widehat { F } _ { t - 1 } ^ { i , ( N ) }$ $F _ { t - 1 } ^ { i }$ from the $i$ -th layer, our goal is to align , where $\widehat { F } _ { t - 1 } ^ { i , ( n ) } ( 1 \leq n \leq N )$ $F _ { t - 1 } ^ { i }$ towards the denotes the -th b aligned clip feature towards the $n$ b b -th frame feature $F _ { t , n } ^ { i }$ of the $t$ b -th clip, and $\widehat { F } _ { t - 1 , n ^ { \prime } } ^ { i , ( n ) } ( 1 \leq n ^ { \prime } \leq N )$ is the aligned frame feature from the clip. Inspired by optical flow estimati $n ^ { \prime }$ -th frame in the designs [19, 56, $( t - 1 )$ -th clip to the , 44], we first $n$ -th frae-align e $t$ -thith $F _ { t - 1 , n ^ { \prime } } ^ { i , ( n ) }$ the optical flow $O _ { t - 1 t , n ^ { \prime } } ^ { i , ( n ) }$ as $\hat { F } _ { t - 1 , n ^ { \prime } } ^ { i , ( n ) } = \mathcal { W } ( F _ { t - 1 , n ^ { \prime } } ^ { i , ( n ) } , O _ { t - 1 t , n ^ { \prime } } ^ { i , ( n ) } )$ , whe $\mathcal { W }$ t 1,n denotes the warping operation. For convenience, we summarize the pre-alignments of all “ $n ^ { \prime }$ -toframe pairs between the $( t - 1 )$ -th and $t$ -th video clips as follows:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\bar { F } _ { t - 1 } ^ { i , ( 1 : N ) } = \mathcal { W } ( F _ { t - 1 } ^ { i } , O _ { t - 1 t } ^ { i , ( 1 : N ) } ) ,
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
at, we predict the optical flow offsets along the channel dimension. A sm from the concatenation of olutional neural network ( $F _ { t } ^ { i - 1 }$ , $\bar { F } _ { t - 1 } ^ { i ( 1 : N ) }$ anderal $O _ { t - 1 t } ^ { i , ( 1 : N ) }$ convolutional layers and ReLU layers is used for prediction. This is formulated as
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
o _ { t - 1 \to t } ^ { i , ( 1 : N ) } = C N N ( C o n c a t ( F _ { t } ^ { i - 1 } , \bar { F } _ { t - 1 } ^ { i , ( 1 : N ) } , O _ { t - 1 \to t } ^ { i , ( 1 : N ) } ) ) ,
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where the current misalignment between the can reflect the offset required for further alig $t$ -th clip feature and thement. In practice, we i rped ialize $( t - 1 )$ h clip fea as the o $O _ { t - 1 t } ^ { 1 , ( 1 : N ) }$ flows estimated from the LQ input video via SpyNet [58], and predict $M$ offsets for each frame ( $N M$ offsets in total). The optical flows are updated layer by layer as follows:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
O _ { t - 1 t , n ^ { \prime } } ^ { i + 1 , ( n ) } = O _ { t - 1 t , n ^ { \prime } } ^ { i , ( n ) } + \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \{ o _ { t - 1 t , n ^ { \prime } } ^ { i , ( n ) } \} _ { m } ,
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where $\{ o _ { t - 1 t , n ^ { \prime } } ^ { i , ( n ) } \} _ { m }$ denotes the $m$ -th offset in $M$ predictions from the $n ^ { \prime }$ -th frame to the $n$ -th frame. Then, for the $n$ -th frame of the $t$ -th clip, we sample its relevant features from the $( t - 1 )$ -th clip feature $F _ { t - 1 } ^ { i }$ according the predicted locations, which are indicated by the sum of optical flow and offsets, i.e., $O _ { t - 1 \to t } ^ { i , ( n ) } + o _ { t - 1 \to t } ^ { i , ( n ) }$ , according to the c in rel nship $F _ { t - 1 } ^ { i } \xrightarrow { O _ { t - 1 t } ^ { i , ( n ) } } \bar { F } _ { t - 1 } ^ { i , ( n ) } \xrightarrow { o _ { t - 1 t } ^ { i , ( n ) } } \widehat { F } _ { t - 1 } ^ { i , ( n ) }$ [11, 58]. For simplicity, we define the queries $Q$ $K$ and values $V$ as follows:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\begin{array} { l } { { Q = F _ { t , n } ^ { i - 1 } P _ { Q } , } } \\ { { K = S a m p l i n g ( F _ { t - 1 } ^ { i - 1 } P _ { K } , O _ { t - 1 t } ^ { i , ( n ) } + o _ { t - 1 t } ^ { i , ( n ) } ) , } } \\ { { V = S a m p l i n g ( F _ { t - 1 } ^ { i } P _ { V } , O _ { t - 1 t } ^ { i , ( n ) } + o _ { t - 1 t } ^ { i , ( n ) } ) , } } \end{array}
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where $Q \in \mathbb { R } ^ { 1 \times C }$ is the projected feature from the $n$ -th frame of $t$ -th clip. $K \in \mathbb { R } ^ { N M \times C }$ and $V \in \mathbb { R } ^ { N M \times C }$ are the projected features that are bilinearly sampled from $N M$ locations of $F _ { t - 1 } ^ { i - 1 }$ and $F _ { t - 1 } ^ { i }$ , respectively. $P _ { Q } \in \mathbb { R } ^ { C \times C }$ , $P _ { K } \in \mathbb { R } ^ { C \times C }$ and $P _ { V } \in \mathbb { R } ^ { C \times C }$ are the projection matrices. Note that we first project the feature and then do sampling to reduce redundant computation.
|
| 107 |
+
|
| 108 |
+
$K$ xt, similafrom the $( i - 1 )$ attention mechanism [77], we calculate the atten-th layer and then compute the aligned feature $\widehat { F } _ { t - 1 } ^ { i , ( n ) }$ eights based on the as a weighted sum $Q$ af $V$ from the same $i$ -th layer as follows:
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\widehat { F } _ { t - 1 } ^ { i , ( n ) } = S o f t M a x ( Q K ^ { T } / \sqrt { C } ) ) V ,
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
where SoftMax is the softmax operation along the row direction and $\sqrt { C }$ is a scaling factor.
|
| 115 |
+
|
| 116 |
+
Lastly, since Eq. (9) only aggregates information spatially, we add a multi-layer perception (MLP) with two fully-connected layers and a $G E L U$ activation function between them to enable channel interaction as follows:
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\widehat F _ { t - 1 } ^ { i } = \widehat F _ { t - 1 } ^ { i } + M L P ( \widehat F _ { t - 1 } ^ { i } ) ,
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
where a residual connection is used to stabilize training. The hidden and output channel numbers of the $M L P$ are $R C$ ( $R$ is the ratio) and $C$ , respectively.
|
| 123 |
+
|
| 124 |
+
Multi-group multi-head guided deformable attention. We can divide the channel into several deformable groups and perform the deformable sampling for different groups in parallel. Besides, in the attention mechanism, we can further divide one deformable group into several attention heads and perform the attention operation separately for different heads. All groups and heads are concatenated together before channel interaction.
|
| 125 |
+
|
| 126 |
+
Connection to deformable convolution. Deformable convolution [15, 100] uses a learned weight for feature aggregation, which can be seen as a special case of GDA, i.e., using different projection matrix $P _ { V }$ for different locations and then directly averaging the resulting features. Its parameter number and computation complexity are $M C ^ { 2 }$ and $\mathcal { O } ( M C ^ { 2 } )$ , respectively. In contrast, GDA uses the same projection matrix for all locations but generates dynamic weights to aggregate them. Its parameter number and computation complexity are $( 3 + 2 R ) \dot { C } ^ { 2 }$ and $\mathcal { O } ( ( 3 C + 2 R C + M ) C )$ , which are similar to deformable convolution when choosing proper $M$ and $R$ .
|
| 127 |
+
|
| 128 |
+
# 4 Experiments
|
| 129 |
+
|
| 130 |
+
# 4.1 Experimental Setup
|
| 131 |
+
|
| 132 |
+
For shallow feature extraction and HQ frame reconstruction, we use 1 RSTB that has 2 swin transformer layers. For recurrent feature refinement, we use 4 refinement modules with a clip size of 2, each of which has 2 MRSTBs with 2 modified swin transformer layers. For both RSTB and MRSTB, spatial attention window size and head number are $8 \times 8$ and 6, respectively. We use 144 channels for video SR and 192 channels for deblurring and denoising. In GDA, we use 12 deformable groups and 12 deformable heads with 9 candidate locations. We empirically project the query to a higher-dimensional space (e.g., $2 C$ ) because we found it can improve the performance slightly and the parameter number of GDA is not a bottleneck. In training, we randomly crop $2 5 6 \times 2 5 6$ HQ patches and use different video lengths for different datasets: 30 frames for REDS [53], 14 frames for Vimeo-90K [87], and 16 frames for DVD [63], GoPro [54] as well as DAVIS [31]. Adam optimizer [33] with default setting is used to train the model for 600,000 iterations when the batch size is 8. The learning rate is initialized as $4 \times 1 0 ^ { - 4 }$ and deceased with the Cosine Annealing scheme [52]. To stabilize training, we initialize SpyNet [58, 56] with pretrained weights, fix it for the first 30,000 iterations and reduce its learning rate by $7 5 \%$ .
|
| 133 |
+
|
| 134 |
+
# 4.2 Ablation Study
|
| 135 |
+
|
| 136 |
+
To explore the effectiveness of different components, we conduct ablation studies on REDS [53] for video SR. For efficiency, we reduce the MRSTB blocks by half and use 12 frames in training.
|
| 137 |
+
|
| 138 |
+
The impact of clip length. In RVRT, we divide the video into $N$ -frame clips. As shown in Table 1, the performance rises when clip length is increased from 1 to 2. However, the performance saturates when $N = 3$ , possibly due to large within-clip motions and inaccurate optical flow derivation. When we directly estimate all optical flows (marked by ∗), the PSNR hits 32.21dB. Besides, to compare the temporal modelling ability, we hack the input LQ video (Clip 000 from REDS, 100 frames in total) by manually setting all pixels of the 50-th frame as zeros. As indicated in Fig. 4, on the one hand, $N = 2$ has a smaller performance drop and all its frames still have higher PSNR than $N = 1$ (equals to a recurrent model) after the attack, showing that RVRT can mitigate the noise amplification from the hacked frame to the rest frames. One the other hand, the hacked frame of $N = 2$ has an impact on more neighbouring frames than $N = 1$ , which means that RVRT can alleviate information loss and utilize more frames than $N = 1$ for restoration.
|
| 139 |
+
|
| 140 |
+
The impact of video alignment. The alignment of video clips plays a key role in our framework. We compare the proposed clip-to-clip guided deformable attention (GDA) with existing frame-toframe alignment techniques by performing them frame by frame, followed by concatenation and channel reduction. As we can see from Table 2, GDA outperforms all existing methods when it is used for frame-to-frame alignment (denoted as $\mathrm { G D A } ^ { * }$ ), and leads a further improvement when we aggregate features directly from the whole clip.
|
| 141 |
+
|
| 142 |
+
The impact of different components in GDA. We further conduct an ablation study on GDA in Table 3. As we can see, the optical flow guidance is critical for the model, leading to a PSNR gain of 1.11dB. The update of optical flow in different layers can further improve the result. The channel interaction in MLP also plays an important role, since the attention mechanism only aggregates information spatially.
|
| 143 |
+
|
| 144 |
+
The impact of deformable group and attention head. We also conduct experiments on different group and head numbers in GDA. As shown in Table 4, when the deformable group rises, the PSNR first rises and then keeps almost unchanged. Besides, double attention heads lead to slightly better results at the expense of higher computation, but using too many heads has an adverse impact as the head dimension may be too small.
|
| 145 |
+
|
| 146 |
+
Table 1: Ablation study on clip length.
|
| 147 |
+
|
| 148 |
+
<table><tr><td rowspan=1 colspan=1>Clip</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>3</td><td rowspan=1 colspan=1>3*</td></tr><tr><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>31.98</td><td rowspan=1 colspan=1>32.10</td><td rowspan=1 colspan=1>32.07</td><td rowspan=1 colspan=1>32.21</td></tr></table>
|
| 149 |
+
|
| 150 |
+
Table 2: Ablation study on different video alignment techniques.
|
| 151 |
+
|
| 152 |
+
<table><tr><td rowspan=1 colspan=1>Alignment</td><td rowspan=1 colspan=1>Warping[87]</td><td rowspan=1 colspan=1>TMSA [38]</td><td rowspan=1 colspan=1>DCN [72]</td><td rowspan=1 colspan=1>GDA*</td><td rowspan=1 colspan=1>GDA</td></tr><tr><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>28.88</td><td rowspan=1 colspan=1>30.45</td><td rowspan=1 colspan=1>31.93</td><td rowspan=1 colspan=1>32.00</td><td rowspan=1 colspan=1>32.10</td></tr></table>
|
| 153 |
+
|
| 154 |
+
Table 3: Ablation study on different GDA components.
|
| 155 |
+
|
| 156 |
+
<table><tr><td rowspan=1 colspan=1>Optical Flow GuidanceOptical Flow UpdateMLP</td><td rowspan=1 colspan=1>厂</td><td rowspan=1 colspan=1>√√</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>兴√</td></tr><tr><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>30.99</td><td rowspan=1 colspan=1>32.03</td><td rowspan=1 colspan=1>31.83</td><td rowspan=1 colspan=1>32.10</td></tr></table>
|
| 157 |
+
|
| 158 |
+

|
| 159 |
+
Figure 4: Per-frame PSNR drop when pixels of the 50-th frame is hacked to be all zeros. $N$ is clip length.
|
| 160 |
+
|
| 161 |
+
Table 4: Ablation study on deformable groups and attention heads.
|
| 162 |
+
|
| 163 |
+
<table><tr><td rowspan=1 colspan=1>Deformable GroupAttention Head</td><td rowspan=1 colspan=1>11</td><td rowspan=1 colspan=1>66</td><td rowspan=1 colspan=1>1212</td><td rowspan=1 colspan=1>1224</td><td rowspan=1 colspan=1>1236</td><td rowspan=1 colspan=1>2424</td></tr><tr><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>31.63</td><td rowspan=1 colspan=1>32.03</td><td rowspan=1 colspan=1>32.10</td><td rowspan=1 colspan=1>32.13</td><td rowspan=1 colspan=1>32.03</td><td rowspan=1 colspan=1>32.11</td></tr></table>
|
| 164 |
+
|
| 165 |
+
# 4.3 Video Super-Resolution
|
| 166 |
+
|
| 167 |
+
For video SR, we consider two settings: bicubic (BI) and blur-downsampling (BD) degradation. For BI degradation, we train the model on two different datasets: REDS [53] and Vimeo-90K [87], and then test the model on their corresponding testsets: REDS4 and Vimeo-90K-T. We additionally test Vid4 [46] along with Vimeo-90K. For BD degradation, we train it on Vimeo-90K and test it on Vimeo-90K-T, Vid4, and UDM10 [89]. The comparisons with existing methods are shown in Table 5. As we can see, RVRT achieves the best performance on REDS4 and Vid4 for both degradations. Compared with the representative recurrent model Basic ${ \mathrm { V S R } } + +$ [11], RVRT improves the PSNR by significant margins of $\mathbf { 0 . 2 { \sim } 0 . 5 } \mathbf { d B }$ . Compared with the recent transformer-based model VRT [38], RVRT outperforms VRT on REDS4 and Vid4 by up to 0.36dB. The visual comparisons of different methods are shown in Fig. 5. It is clear that RVRT generates sharp and clear HQ frames, while other methods fail to restore fine textures and details.
|
| 168 |
+
|
| 169 |
+
Table 5: Quantitative comparison (average PSNR/SSIM) with state-of-the-art methods for video superresolution $( \times 4 )$ on REDS4 [53], Vimeo-90K-T [87], Vid4 [46] and UDM10 [89].
|
| 170 |
+
|
| 171 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3">BI degradation</td><td colspan="3">BD degradation</td></tr><tr><td>REDS4[53] (RGB channel)</td><td>Vimeo-90K-T[87] (Y channel)</td><td>Vid4 [46] (Y channel)</td><td>UDM10[89] (Y channel)</td><td>Vimeo-90K-T[87] (Y channel)</td><td>Vid4 [46] (Y channel)</td></tr><tr><td>Bicubic</td><td>26.14/0.7292</td><td>31.32/0.8684</td><td>23.78/0.6347</td><td>28.47/0.8253</td><td>31.30/0.8687</td><td>21.80/0.5246</td></tr><tr><td>SwinIR[39]</td><td>29.05/0.8269</td><td>35.67/0.9287</td><td>25.68/0.7491</td><td>35.42/0.9380</td><td>34.12/0.9167</td><td>25.25/0.7262</td></tr><tr><td>SwinIR-ft [39]</td><td>29.24/0.8319</td><td>35.89/0.9301</td><td>25.69/0.7488</td><td>36.76/0.9467</td><td>35.70/0.9293</td><td>25.62/0.7498</td></tr><tr><td>TOFlow [87]</td><td>27.98/0.7990</td><td>33.08/0.9054</td><td>25.89/0.7651</td><td>36.26/0.9438</td><td>34.62/0.9212</td><td>25.85/0.7659</td></tr><tr><td>FRVSR[59]</td><td></td><td>1</td><td></td><td>37.09/0.9522</td><td>35.64/0.9319</td><td>26.69/0.8103</td></tr><tr><td>DUF[29]</td><td>28.63/0.8251</td><td></td><td>27.33/0.8319</td><td>38.48/0.9605</td><td>36.87/0.9447</td><td>27.38/0.8329</td></tr><tr><td>PFNL [89]</td><td>29.63/0.8502</td><td>36.14/0.9363</td><td>26.73/0.8029</td><td>38.74/0.9627</td><td>=</td><td>27.16/0.8355</td></tr><tr><td>RBPN[23]</td><td>30.09/0.8590</td><td>37.07/0.9435</td><td>27.12/0.8180</td><td>38.66/0.9596</td><td>37.20/0.9458</td><td>27.17/0.8205</td></tr><tr><td>MuCAN[36]</td><td>30.88/0.8750</td><td>37.32/0.9465</td><td></td><td></td><td></td><td></td></tr><tr><td>RLSP[21]</td><td></td><td></td><td></td><td>38.48/0.9606</td><td>36.49/0.9403</td><td>27.48/0.8388</td></tr><tr><td>TGA [27]</td><td></td><td></td><td></td><td>38.74/0.9627</td><td>37.59/0.9516</td><td>27.63/0.8423</td></tr><tr><td>RSDN[26]</td><td></td><td></td><td></td><td>39.35/0.9653</td><td>37.23/0.9471</td><td>27.92/0.8505</td></tr><tr><td>RRN[28]</td><td></td><td></td><td></td><td>38.96/0.9644</td><td></td><td>27.69/0.8488</td></tr><tr><td>FDAN [45]</td><td></td><td></td><td></td><td>39.91/0.9686</td><td>37.75/0.9522</td><td>27.88/0.8508</td></tr><tr><td>EDVR[80]</td><td>31.09/0.8800</td><td>37.61/0.9489</td><td>27.35/0.8264</td><td>39.89/0.9686</td><td>37.81/0.9523</td><td>27.85/0.8503</td></tr><tr><td>GOVSR [88]</td><td></td><td></td><td></td><td>40.14/0.9713</td><td>37.63/0.9503</td><td>28.41/0.8724</td></tr><tr><td>BasicVSR[9]</td><td>31.42/0.8909</td><td>37.18/0.9450</td><td>27.24/0.8251</td><td>39.96/0.9694</td><td>37.53/0.9498</td><td>27.96/0.8553</td></tr><tr><td>IconVSR[9]</td><td>31.67/0.8948</td><td>37.47/0.9476</td><td>27.39/0.8279</td><td>40.03/0.9694</td><td>37.84/0.9524</td><td>28.04/0.8570</td></tr><tr><td>VRT[38]</td><td>32.19/0.9006</td><td>38.20/0.9530</td><td>27.93/0.8425</td><td>41.05/0.9737</td><td>38.72/0.9584</td><td>29.42/0.8795</td></tr><tr><td>BasicVSR++[11]</td><td>32.39/0.9069</td><td>37.79/0.9500</td><td>27.79/0.8400</td><td>40.72/0.9722</td><td>38.21/0.9550</td><td>29.04/0.8753</td></tr><tr><td>RVRT (ours)</td><td>32.75/0.9113</td><td>38.15/0.9527</td><td>27.99/0.8462</td><td>40.90/0.9729</td><td>38.59/0.9576</td><td>29.54/0.8810</td></tr></table>
|
| 172 |
+
|
| 173 |
+
Table 6: Comparison of model size, testing memory and runtime for an LQ input of $3 2 0 \times 1 8 0$
|
| 174 |
+
|
| 175 |
+
<table><tr><td>Method</td><td>#Param (M)</td><td>Memory (M)</td><td>Runtime (ms)</td><td>PSNR (dB)</td></tr><tr><td>BasicVSR++[11]</td><td>7.3</td><td>223</td><td>77</td><td>32.39</td></tr><tr><td>BasicVSR++ [11]+RSTB[39]</td><td>9.3</td><td>1021</td><td>201</td><td>32.61</td></tr><tr><td>EDVR[80]</td><td>20.6</td><td>3535</td><td>378</td><td>31.09</td></tr><tr><td>VSRT[4]</td><td>32.6</td><td>27487</td><td>328</td><td>31.19</td></tr><tr><td>VRT[38]</td><td>35.6</td><td>2149</td><td>243</td><td>32.19</td></tr><tr><td>RVRT (ours)</td><td>10.8</td><td>1056</td><td>183</td><td>32.75</td></tr></table>
|
| 176 |
+
|
| 177 |
+
We compare the model size, testing memory consumption and runtime of different models in Table 6. Compared with representative parallel methods EDVR [80], VSRT [4] and VST [38], RVRT achieves significant performance gains with less than at least $50 \%$ of model parameters and testing memory usage. It also reduces the runtime by at least $25 \%$ . Compared the recurrent model Basic $J \mathrm { S R } + +$ [11], RVRT brings a PSNR improvement of 0.26dB. As for the inferiority of testing memory and runtime, we argue that it is mainly because the CNN layers are highly optimized on existing deep learning frameworks. To prove it, we use the transformer-based RSTB blocks in RVRT to replace the CNN blocks in Basic $/ \mathrm { S R } { + + }$ , in which case it has similar memory usage and more runtime than our model.
|
| 178 |
+
|
| 179 |
+
In addition, to better understand how guided deformable attention works, we visualize the predicted offsets on the LQ frames and show the attention weight in Fig. 6. As we can see, multiple offsets are predicted to select multiple sampled locations in the neighbourhood of the corresponding pixel. According to the feature similarity between the query feature and the sampled features, features of different locations are aggregated by calculating a dynamic attention weight.
|
| 180 |
+
|
| 181 |
+
# 4.4 Video Deblurring
|
| 182 |
+
|
| 183 |
+
For video deblurring, the model is trained and tested on two different datasets, DVD [63] and GoPro [54], with their official training/testing splits. As shown in Table 7 and 8, RVRT shows its superiority over most methods with huge improvements of $\mathbf { 1 . 4 0 } { \sim } 2 . 2 7 \mathbf { d B }$ on two datasets. Even though the performance gain over VRT is relatively small, RVRT has a smaller model size and much less runtime. In detail, the model size and runtime of RVRT are $1 3 . 6 \mathbf { M }$ and 0.3s, while VRT has $1 8 . 3 \mathbf { M }$ parameters and the runtime of 2.2s on a $1 2 8 0 \times 7 2 0$ LQ input. The visual comparison is provided in the supplementary material due to the space limit.
|
| 184 |
+
|
| 185 |
+

|
| 186 |
+
Figure 5: Visual comparison of video super-resolution $( \times 4 )$ methods on REDS [53] and Vid4 [46].
|
| 187 |
+
|
| 188 |
+

|
| 189 |
+
Figure 6: The visualization of predicted offsets and attention weight predicted in guided deformable attention. Although guided deformable attention is conducted on features, we plot illustrations on LQ input frames for better understanding. Best viewed by zooming.
|
| 190 |
+
|
| 191 |
+
# 4.5 Video Denoising
|
| 192 |
+
|
| 193 |
+
For video denoising, we train the model on the training set of DAVIS [31] and test it on its corresponding testset and Set8 [70]. For fairness of comparison, following [70, 71], we train a non-blind additive white Gaussian denoising model for noise level $\sigma \sim \mathcal { U } ( 0 , 5 0 )$ . Similar to the case of video deblurring, there is a huge gap $( \mathbf { 0 . 6 0 } { \sim } 2 . 3 7 \mathbf { d B } $ ) between RVRT and most methods. Compared with VRT, RVRT has slightly better performance on large noise levels, with a smaller model size (12.8M v.s.18.4M) and less runtime $( 0 . 2 \mathrm { s } ~ \nu . s . 1 . 5 \mathrm { s } )$ on a $1 2 8 0 \times 7 2 0$ LQ input. The visual comparison is provided in the supplementary material due to the space limit.
|
| 194 |
+
|
| 195 |
+
# 5 Conclusion
|
| 196 |
+
|
| 197 |
+
In this paper, we proposed a recurrent video restoration transformer with guided deformable attention. It is a globally recurrent model with locally parallel designs, which benefits from the advantages of both parallel methods and recurrent methods. We also propose the guided deformable attention module for our special case of video clip-to-clip alignment. Under the guidance of optical flow, it aggregates information from multiple neighboring locations adaptively with the attention mechanism. Extensive experiments on video super-resolution, video deblurring, and video denoising demonstrated the effectiveness of the proposed method.
|
| 198 |
+
|
| 199 |
+
Table 7: Quantitative comparison (average RGB channel PSNR/SSIM) with state-of-the-art methods for video deblurring on DVD [63].
|
| 200 |
+
|
| 201 |
+
<table><tr><td>Method</td><td>DBN[63]</td><td>STFAN [99]</td><td>STTN [32]</td><td>SFE [86]</td><td>EDVR[80]</td><td>TSP [57]</td></tr><tr><td>PSNR</td><td>30.01</td><td>31.24</td><td>31.61</td><td>31.71</td><td>31.82</td><td>32.13</td></tr><tr><td>SSIM</td><td>0.8877</td><td>0.9340</td><td>0.9160</td><td>0.9160</td><td>0.9160</td><td>0.9268</td></tr><tr><td>Method</td><td>PVDNet [62]</td><td>GSTA [64]</td><td>ARVo[35]</td><td>FGST [44]</td><td>VRT[38]</td><td>RVRT (ours)</td></tr><tr><td>PSNR SSIM</td><td>32.31 0.9260</td><td>32.53 0.9468</td><td>32.80 0.9352</td><td>33.36 0.9500</td><td>34.24 0.9651</td><td>34.30 0.9655</td></tr></table>
|
| 202 |
+
|
| 203 |
+
Table 8: Quantitative comparison (average RGB channel PSNR/SSIM) with state-of-the-art methods for video deblurring on GoPro [54].
|
| 204 |
+
|
| 205 |
+
<table><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>SRN[69]</td><td rowspan=1 colspan=1>MPRNet[91]</td><td rowspan=1 colspan=1>MAXIM[73]</td><td rowspan=1 colspan=1>IFI-RNN[55]</td><td rowspan=1 colspan=1>ESTRNN[98]</td><td rowspan=1 colspan=1>EDVR [80]</td></tr><tr><td rowspan=1 colspan=1>PSNRSSIM</td><td rowspan=1 colspan=1>30.260.9342</td><td rowspan=1 colspan=1>32.660.9590</td><td rowspan=1 colspan=1>32.860.9610</td><td rowspan=1 colspan=1>31.050.9110</td><td rowspan=1 colspan=1>31.070.9023</td><td rowspan=1 colspan=1>31.540.9260</td></tr><tr><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>TSP [57]</td><td rowspan=1 colspan=1>PVDNet [62]</td><td rowspan=1 colspan=1>GSTA [64]</td><td rowspan=1 colspan=1>FGST[44]</td><td rowspan=1 colspan=1>VRT[38]</td><td rowspan=1 colspan=1>RVRT (ours)</td></tr><tr><td rowspan=1 colspan=1>PSNRSSIM</td><td rowspan=1 colspan=1>31.670.9279</td><td rowspan=1 colspan=1>31.980.9280</td><td rowspan=1 colspan=1>32.100.9600</td><td rowspan=1 colspan=1>32.900.9610</td><td rowspan=1 colspan=1>34.810.9724</td><td rowspan=1 colspan=1>34.920.9738</td></tr></table>
|
| 206 |
+
|
| 207 |
+
Table 9: Quantitative comparison (average RGB channel PSNR) with state-of-the-art methods for video denoising on DAVIS [31] and Set8 [70].
|
| 208 |
+
|
| 209 |
+
<table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>VLNB [1]</td><td rowspan=1 colspan=1>DVDNet[70]</td><td rowspan=1 colspan=1>FastDVDNet [71]</td><td rowspan=1 colspan=1>PaCNet[75]</td><td rowspan=1 colspan=1>VRT[38]</td><td rowspan=1 colspan=1>RVRT (ours)</td></tr><tr><td rowspan=5 colspan=1>DAVIS</td><td rowspan=2 colspan=1>1020</td><td rowspan=2 colspan=1>38.8535.68</td><td rowspan=1 colspan=1>38.13</td><td rowspan=1 colspan=1>38.71</td><td rowspan=1 colspan=1>39.97</td><td rowspan=1 colspan=1>40.82</td><td rowspan=2 colspan=1>40.5738.05</td></tr><tr><td rowspan=1 colspan=1>35.70</td><td rowspan=1 colspan=1>35.77</td><td rowspan=1 colspan=1>36.82</td><td rowspan=1 colspan=1>38.15</td><td rowspan=1 colspan=1>38.05</td></tr><tr><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>33.73</td><td rowspan=1 colspan=1>34.08</td><td rowspan=1 colspan=1>34.04</td><td rowspan=1 colspan=1>34.79</td><td rowspan=1 colspan=1>36.52</td><td rowspan=1 colspan=1>36.57</td></tr><tr><td rowspan=2 colspan=1>4050</td><td rowspan=2 colspan=1>32.3231.13</td><td rowspan=2 colspan=1>32.8631.85</td><td rowspan=1 colspan=1>32.82</td><td rowspan=1 colspan=1>33.34</td><td rowspan=1 colspan=1>35.32</td><td rowspan=1 colspan=1>35.47</td></tr><tr><td rowspan=1 colspan=1>31.86</td><td rowspan=1 colspan=1>32.20</td><td rowspan=1 colspan=1>34.36</td><td rowspan=1 colspan=1>34.57</td></tr><tr><td rowspan=5 colspan=1>Set8</td><td rowspan=2 colspan=1>1020</td><td rowspan=2 colspan=1>37.2633.72</td><td rowspan=1 colspan=1>36.08</td><td rowspan=1 colspan=1>36.44</td><td rowspan=1 colspan=1>37.06</td><td rowspan=1 colspan=1>37.88</td><td rowspan=1 colspan=1>37.53</td></tr><tr><td rowspan=1 colspan=1>33.49</td><td rowspan=1 colspan=1>33.43</td><td rowspan=1 colspan=1>33.94</td><td rowspan=1 colspan=1>35.02</td><td rowspan=1 colspan=1>34.83</td></tr><tr><td rowspan=1 colspan=1>30</td><td rowspan=1 colspan=1>31.74</td><td rowspan=1 colspan=1>31.79</td><td rowspan=1 colspan=1>31.68</td><td rowspan=1 colspan=1>32.05</td><td rowspan=1 colspan=1>33.35</td><td rowspan=1 colspan=1>33.30</td></tr><tr><td rowspan=2 colspan=1>4050</td><td rowspan=2 colspan=1>30.3929.24</td><td rowspan=2 colspan=1>30.5529.56</td><td rowspan=1 colspan=1>30.46</td><td rowspan=1 colspan=1>30.70</td><td rowspan=1 colspan=1>32.15</td><td rowspan=2 colspan=1>32.2131.33</td></tr><tr><td rowspan=1 colspan=1>29.53</td><td rowspan=1 colspan=1>29.66</td><td rowspan=1 colspan=1>31.22</td></tr></table>
|
| 210 |
+
|
| 211 |
+
# 6 Limitations and Societal Impacts
|
| 212 |
+
|
| 213 |
+
Although RVRT achieves state-of-the-art performance in video restoration, it still has some limitations. For example, the complexity of pre-alignment by optical flow increases quadratically with respect to the clip length. One possible solution is to develop a video-to-video optical flow estimation model that directly predicts all optical flows. As for societal impacts, similar to other restoration methods, RVRT may bring privacy concerns after restoring blurry videos and lead to misjudgments if used for medical diagnosis.
|
| 214 |
+
|
| 215 |
+
# Acknowledgments and Disclosure of Funding
|
| 216 |
+
|
| 217 |
+
This work was partially supported by the ETH Zurich Fund (OK), a Huawei Technologies Oy (Finland) project, the China Scholarship Council and an Amazon AWS grant. Special thanks goes to Yijue Chen.
|
| 218 |
+
|
| 219 |
+
# References
|
| 220 |
+
|
| 221 |
+
[1] Pablo Arias and Jean-Michel Morel. Video denoising via empirical bayesian estimation of space-time patches. Journal of Mathematical Imaging and Vision, 60(1):70–93, 2018.
|
| 222 |
+
[2] Jose Caballero, Christian Ledig, Andrew Aitken, Alejandro Acosta, Johannes Totz, Zehan Wang, and Wenzhe Shi. Real-time video super-resolution with spatio-temporal networks and motion compensation. In IEEE Conference on Computer Vision and Pattern Recognition, pages 4778–4787, 2017. Wang, and Wenzhe Shi. Real-time video super-resolution with spatio-temporal networks and motion compensation. In IEEE Conference on Computer Vision and Pattern Recognition, pages 4778–4787, 2017.
|
| 223 |
+
[4] Jiezhang Cao, Yawei Li, Kai Zhang, and Luc Van Gool. Video super-resolution transformer. arXiv preprint arXiv:2106.06847, 2021.
|
| 224 |
+
[5] Jiezhang Cao, Jingyun Liang, Kai Zhang, Wenguan Wang, Qin Wang, Yulun Zhang, Hao Tang, and Luc Van Gool. Towards interpretable video super-resolution via alternating optimization. arXiv preprint arXiv:2207.10765, 2022.
|
| 225 |
+
[6] Jiezhang Cao, Qin Wang, Jingyun Liang, Yulun Zhang, Kai Zhang, and Luc Van Gool. Practical real video denoising with realistic degradation model. arXiv preprint arXiv:2208.11803, 2022.
|
| 226 |
+
[7] Mingdeng Cao, Yanbo Fan, Yong Zhang, Jue Wang, and Yujiu Yang. Vdtr: Video deblurring with transformer. arXiv preprint arXiv:2204.08023, 2022.
|
| 227 |
+
[8] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In European Conference on Computer Vision, pages 213–229, 2020.
|
| 228 |
+
[9] Kelvin CK Chan, Xintao Wang, Ke Yu, Chao Dong, and Chen Change Loy. Basicvsr: The search for essential components in video super-resolution and beyond. In IEEE Conference on Computer Vision and Pattern Recognition, pages 4947–4956, 2021.
|
| 229 |
+
[10] Kelvin CK Chan, Xintao Wang, Ke Yu, Chao Dong, and Chen Change Loy. Understanding deformable alignment in video super-resolution. In AAAI Conference on Artificial Intelligence, pages 973–981, 2021.
|
| 230 |
+
[11] Kelvin CK Chan, Shangchen Zhou, Xiangyu Xu, and Chen Change Loy. Basicvsr $^ { + + }$ : Improving video super-resolution with enhanced propagation and alignment. arXiv preprint arXiv:2104.13371, 2021.
|
| 231 |
+
[12] Pierre Charbonnier, Laure Blanc-Feraud, Gilles Aubert, and Michel Barlaud. Two deterministic half-quadratic regularization algorithms for computed imaging. In International Conference on Image Processing, pages 168–172, 1994.
|
| 232 |
+
[13] Hanting Chen, Yunhe Wang, Tianyu Guo, Chang Xu, Yiping Deng, Zhenhua Liu, Siwei Ma, Chunjing Xu, Chao Xu, and Wen Gao. Pre-trained image processing transformer. In IEEE Conference on Computer Vision and Pattern Recognition, pages 12299–12310, 2021.
|
| 233 |
+
[14] Mengyu Chu, You Xie, Jonas Mayer, Laura Leal-Taixé, and Nils Thuerey. Learning temporal coherence via self-supervision for gan-based video generation. ACM Transactions on Graphics (TOG), 39(4):75–1, 2020.
|
| 234 |
+
[15] Jifeng Dai, Haozhi Qi, Yuwen Xiong, Yi Li, Guodong Zhang, Han Hu, and Yichen Wei. Deformable convolutional networks. In IEEE International Conference on Computer Vision, pages 764–773, 2017.
|
| 235 |
+
[16] Chao Dong, Chen Change Loy, Kaiming He, and Xiaoou Tang. Learning a deep convolutional network for image super-resolution. In European Conference on Computer Vision, pages 184–199, 2014.
|
| 236 |
+
[17] Xiaoyi Dong, Jianmin Bao, Dongdong Chen, Weiming Zhang, Nenghai Yu, Lu Yuan, Dong Chen, and Baining Guo. Cswin transformer: A general vision transformer backbone with cross-shaped windows. arXiv preprint arXiv:2107.00652, 2021.
|
| 237 |
+
[18] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
|
| 238 |
+
[19] Alexey Dosovitskiy, Philipp Fischer, Eddy Ilg, Philip Hausser, Caner Hazirbas, Vladimir Golkov, Patrick Van Der Smagt, Daniel Cremers, and Thomas Brox. Flownet: Learning optical flow with convolutional networks. In IEEE International Conference on Computer Vision, pages 2758–2766, 2015.
|
| 239 |
+
[20] Dario Fuoli, Martin Danelljan, Radu Timofte, and Luc Van Gool. Fast online video superresolution with deformable attention pyramid. arXiv preprint arXiv:2202.01731, 2022.
|
| 240 |
+
[21] Dario Fuoli, Shuhang Gu, and Radu Timofte. Efficient video super-resolution through recurrent latent space propagation. In IEEE International Conference on Computer Vision Workshop, pages 3476–3485, 2019.
|
| 241 |
+
[22] Zhicheng Geng, Luming Liang, Tianyu Ding, and Ilya Zharkov. Rstt: Real-time spatial temporal transformer for space-time video super-resolution. arXiv preprint arXiv:2203.14186, 2022.
|
| 242 |
+
[23] Muhammad Haris, Gregory Shakhnarovich, and Norimichi Ukita. Recurrent back-projection network for video super-resolution. In IEEE Conference on Computer Vision and Pattern Recognition, pages 3897–3906, 2019.
|
| 243 |
+
[24] Yan Huang, Wei Wang, and Liang Wang. Bidirectional recurrent convolutional networks for multi-frame super-resolution. Advances in Neural Information Processing Systems, 28:235– 243, 2015.
|
| 244 |
+
[25] Yan Huang, Wei Wang, and Liang Wang. Video super-resolution via bidirectional recurrent convolutional networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 40(4):1015–1028, 2017.
|
| 245 |
+
[26] Takashi Isobe, Xu Jia, Shuhang Gu, Songjiang Li, Shengjin Wang, and Qi Tian. Video superresolution with recurrent structure-detail network. In European Conference on Computer Vision, pages 645–660, 2020.
|
| 246 |
+
[27] Takashi Isobe, Songjiang Li, Xu Jia, Shanxin Yuan, Gregory Slabaugh, Chunjing Xu, Ya-Li Li, Shengjin Wang, and Qi Tian. Video super-resolution with temporal group attention. In IEEE Conference on Computer Vision and Pattern Recognition, pages 8008–8017, 2020.
|
| 247 |
+
[28] Takashi Isobe, Fang Zhu, Xu Jia, and Shengjin Wang. Revisiting temporal modeling for video super-resolution. arXiv preprint arXiv:2008.05765, 2020.
|
| 248 |
+
[29] Younghyun Jo, Seoung Wug Oh, Jaeyeon Kang, and Seon Joo Kim. Deep video superresolution network using dynamic upsampling filters without explicit motion compensation. In IEEE Conference on Computer Vision and Pattern Recognition, pages 3224–3232, 2018.
|
| 249 |
+
[30] Armin Kappeler, Seunghwan Yoo, Qiqin Dai, and Aggelos K Katsaggelos. Video superresolution with convolutional neural networks. IEEE Transactions on Computational Imaging, 2(2):109–122, 2016.
|
| 250 |
+
[31] Anna Khoreva, Anna Rohrbach, and Bernt Schiele. Video object segmentation with language referring expressions. In Asian Conference on Computer Vision, pages 123–141, 2018.
|
| 251 |
+
[32] Tae Hyun Kim, Mehdi SM Sajjadi, Michael Hirsch, and Bernhard Scholkopf. Spatio-temporal transformer network for video restoration. In European Conference on Computer Vision, pages 106–122, 2018.
|
| 252 |
+
[33] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 253 |
+
[34] Jie Lei, Liwei Wang, Yelong Shen, Dong Yu, Tamara L Berg, and Mohit Bansal. Mart: Memory-augmented recurrent transformer for coherent video paragraph captioning. arXiv preprint arXiv:2005.05402, 2020.
|
| 254 |
+
[35] Dongxu Li, Chenchen Xu, Kaihao Zhang, Xin Yu, Yiran Zhong, Wenqi Ren, Hanna Suominen, and Hongdong Li. Arvo: Learning all-range volumetric correspondence for video deblurring. In IEEE Conference on Computer Vision and Pattern Recognition, pages 7721–7731, 2021.
|
| 255 |
+
[36] Wenbo Li, Xin Tao, Taian Guo, Lu Qi, Jiangbo Lu, and Jiaya Jia. Mucan: Multi-correspondence aggregation network for video super-resolution. In European Conference on Computer Vision, pages 335–351, 2020.
|
| 256 |
+
[37] Yawei Li, Kai Zhang, Jiezhang Cao, Radu Timofte, and Luc Van Gool. Localvit: Bringing locality to vision transformers. arXiv preprint arXiv:2104.05707, 2021.
|
| 257 |
+
[38] Jingyun Liang, Jiezhang Cao, Yuchen Fan, Kai Zhang, Rakesh Ranjan, Yawei Li, Radu Timofte, and Luc Van Gool. Vrt: A video restoration transformer. arXiv preprint arXiv:2201.12288, 2022.
|
| 258 |
+
[39] Jingyun Liang, Jiezhang Cao, Guolei Sun, Kai Zhang, Luc Van Gool, and Radu Timofte. SwinIR: Image restoration using swin transformer. In IEEE Conference on International Conference on Computer Vision Workshops, 2021.
|
| 259 |
+
[40] Jingyun Liang, Andreas Lugmayr, Kai Zhang, Martin Danelljan, Luc Van Gool, and Radu Timofte. Hierarchical conditional flow: A unified framework for image super-resolution and image rescaling. In IEEE Conference on International Conference on Computer Vision, 2021.
|
| 260 |
+
[41] Jingyun Liang, Guolei Sun, Kai Zhang, Luc Van Gool, and Radu Timofte. Mutual affine network for spatially variant kernel estimation in blind image super-resolution. In IEEE Conference on International Conference on Computer Vision, 2021.
|
| 261 |
+
[42] Jingyun Liang, Kai Zhang, Shuhang Gu, Luc Van Gool, and Radu Timofte. Flow-based kernel prior with application to blind super-resolution. In IEEE Conference on Computer Vision and Pattern Recognition, pages 10601–10610, 2021.
|
| 262 |
+
[43] Renjie Liao, Xin Tao, Ruiyu Li, Ziyang Ma, and Jiaya Jia. Video super-resolution via deep draft-ensemble learning. In IEEE International Conference on Computer Vision, pages 531– 539, 2015.
|
| 263 |
+
[44] Jing Lin, Yuanhao Cai, Xiaowan Hu, Haoqian Wang, Youliang Yan, Xueyi Zou, Henghui Ding, Yulun Zhang, Radu Timofte, and Luc Van Gool. Flow-guided sparse transformer for video deblurring. arXiv preprint arXiv:2201.01893, 2022. g video super-resolution. arXiv preprint arXiv:2105.05640, 2021.
|
| 264 |
+
[46] Ce Liu and Deqing Sun. On bayesian adaptive video super resolution. IEEE Transactions on Pattern Analysis and Machine Intelligence, 36(2):346–360, 2013.
|
| 265 |
+
[47] Chengxu Liu, Huan Yang, Jianlong Fu, and Xueming Qian. Learning trajectory-aware transformer for video super-resolution. arXiv preprint arXiv:2204.04216, 2022.
|
| 266 |
+
[48] Ding Liu, Zhaowen Wang, Yuchen Fan, Xianming Liu, Zhangyang Wang, Shiyu Chang, and Thomas Huang. Robust video super-resolution with learned temporal dynamics. In IEEE International Conference on Computer Vision, pages 2507–2515, 2017.
|
| 267 |
+
[49] Hongying Liu, Zhubo Ruan, Peng Zhao, Chao Dong, Fanhua Shang, Yuanyuan Liu, Linlin Yang, and Radu Timofte. Video super-resolution based on deep learning: a comprehensive survey. Artificial Intelligence Review, pages 1–55, 2022.
|
| 268 |
+
[50] Li Liu, Wanli Ouyang, Xiaogang Wang, Paul Fieguth, Jie Chen, Xinwang Liu, and Matti Pietikäinen. Deep learning for generic object detection: A survey. International Journal of Computer Vision, 128(2):261–318, 2020.
|
| 269 |
+
[51] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. arXiv preprint arXiv:2103.14030, 2021.
|
| 270 |
+
[52] Ilya Loshchilov and Frank Hutter. Sgdr: Stochastic gradient descent with warm restarts. arXiv preprint arXiv:1608.03983, 2016. [53] Seungjun Nah, Sungyong Baik, Seokil Hong, Gyeongsik Moon, Sanghyun Son, Radu Timofte, and Kyoung Mu Lee. Ntire 2019 challenge on video deblurring and super-resolution: Dataset and study. In IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 1996–2005, 2019.
|
| 271 |
+
[54] Seungjun Nah, Tae Hyun Kim, and Kyoung Mu Lee. Deep multi-scale convolutional neural network for dynamic scene deblurring. In IEEE Conference on Computer Vision and Pattern Recognition, pages 3883–3891, 2017.
|
| 272 |
+
[55] Seungjun Nah, Sanghyun Son, and Kyoung Mu Lee. Recurrent neural networks with intraframe iterations for video deblurring. In IEEE Conference on Computer Vision and Pattern Recognition, pages 8102–8111, 2019. [56] Simon Niklaus. A reimplementation of SPyNet using PyTorch. https://github.com/ sniklaus/pytorch-spynet, 2018.
|
| 273 |
+
[57] Jinshan Pan, Haoran Bai, and Jinhui Tang. Cascaded deep video deblurring using temporal sharpness prior. In IEEE Conference on Computer Vision and Pattern Recognition, pages 3043–3051, 2020.
|
| 274 |
+
[58] Anurag Ranjan and Michael J Black. Optical flow estimation using a spatial pyramid network. In IEEE Conference on Computer Vision and Pattern Recognition, pages 4161–4170, 2017.
|
| 275 |
+
[59] Mehdi SM Sajjadi, Raviteja Vemulapalli, and Matthew Brown. Frame-recurrent video superresolution. In IEEE Conference on Computer Vision and Pattern Recognition, pages 6626– 6634, 2018.
|
| 276 |
+
[60] Dev Yashpal Sheth, Sreyas Mohan, Joshua L Vincent, Ramon Manzorro, Peter A Crozier, Mitesh M Khapra, Eero P Simoncelli, and Carlos Fernandez-Granda. Unsupervised deep video denoising. In IEEE International Conference on Computer Vision, pages 1759–1768, 2021.
|
| 277 |
+
[61] Wenzhe Shi, Jose Caballero, Ferenc Huszár, Johannes Totz, Andrew P Aitken, Rob Bishop, Daniel Rueckert, and Zehan Wang. Real-time single image and video super-resolution using an efficient sub-pixel convolutional neural network. In IEEE Conference on Computer Vision and Pattern Recognition, pages 1874–1883, 2016.
|
| 278 |
+
[62] Hyeongseok Son, Junyong Lee, Jonghyeop Lee, Sunghyun Cho, and Seungyong Lee. Recurrent video deblurring with blur-invariant motion estimation and pixel volumes. ACM Transactions on Graphics, 40(5):1–18, 2021.
|
| 279 |
+
[63] Shuochen Su, Mauricio Delbracio, Jue Wang, Guillermo Sapiro, Wolfgang Heidrich, and Oliver Wang. Deep video deblurring for hand-held cameras. In IEEE Conference on Computer Vision and Pattern Recognition, pages 1279–1288, 2017.
|
| 280 |
+
[64] Maitreya Suin and AN Rajagopalan. Gated spatio-temporal attention-guided video deblurring. In IEEE Conference on Computer Vision and Pattern Recognition, pages 7802–7811, 2021. [65] Deqing Sun, Xiaodong Yang, Ming-Yu Liu, and Jan Kautz. Pwc-net: Cnns for optical flow using pyramid, warping, and cost volume. In IEEE Conference on Computer Vision and Pattern Recognition, pages 8934–8943, 2018.
|
| 281 |
+
[66] Guolei Sun, Yun Liu, Thomas Probst, Danda Pani Paudel, Nikola Popovic, and Luc Van Gool. Boosting crowd counting with transformers. arXiv preprint arXiv:2105.10926, 2021. Kaiwei Wang, and Luc Van Gool. Mefnet: Multi-scale event fusion network for motion deblurring. arXiv preprint arXiv:2112.00167, 2021.
|
| 282 |
+
[68] Xin Tao, Hongyun Gao, Renjie Liao, Jue Wang, and Jiaya Jia. Detail-revealing deep video super-resolution. In IEEE International Conference on Computer Vision, pages 4472–4480, 2017.
|
| 283 |
+
[69] Xin Tao, Hongyun Gao, Xiaoyong Shen, Jue Wang, and Jiaya Jia. Scale-recurrent network for deep image deblurring. In IEEE Conference on Computer Vision and Pattern Recognition, pages 8174–8182, 2018.
|
| 284 |
+
[70] Matias Tassano, Julie Delon, and Thomas Veit. Dvdnet: A fast network for deep video denoising. In IEEE International Conference on Image Processing, pages 1805–1809, 2019.
|
| 285 |
+
[71] Matias Tassano, Julie Delon, and Thomas Veit. Fastdvdnet: Towards real-time deep video denoising without flow estimation. In IEEE Conference on Computer Vision and Pattern Recognition, pages 1354–1363, 2020.
|
| 286 |
+
[72] Yapeng Tian, Yulun Zhang, Yun Fu, and Chenliang Xu. Tdan: Temporally-deformable alignment network for video super-resolution. In IEEE Conference on Computer Vision and Pattern Recognition, pages 3360–3369, 2020.
|
| 287 |
+
[73] Zhengzhong Tu, Hossein Talebi, Han Zhang, Feng Yang, Peyman Milanfar, Alan Bovik, and Yinxiao Li. Maxim: Multi-axis mlp for image processing. arXiv preprint arXiv:2201.02973, 2022.
|
| 288 |
+
[74] Zhengzhong Tu, Hossein Talebi, Han Zhang, Feng Yang, Peyman Milanfar, Alan Bovik, and Yinxiao Li. Maxvit: Multi-axis vision transformer. arXiv preprint arXiv:2204.01697, 2022.
|
| 289 |
+
[75] Gregory Vaksman, Michael Elad, and Peyman Milanfar. Patch craft: Video denoising by deep modeling and patch matching. In IEEE International Conference on Computer Vision, pages 1759–1768, 2021.
|
| 290 |
+
[76] Ashish Vaswani, Prajit Ramachandran, Aravind Srinivas, Niki Parmar, Blake Hechtman, and Jonathon Shlens. Scaling local self-attention for parameter efficient visual backbones. arXiv preprint arXiv:2103.12731, 2021.
|
| 291 |
+
[77] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. arXiv preprint arXiv:1706.03762, 2017.
|
| 292 |
+
[78] Ziyu Wan, Bo Zhang, Dongdong Chen, and Jing Liao. Bringing old films back to life. arXiv preprint arXiv:2203.17276, 2022.
|
| 293 |
+
[79] Longguang Wang, Yulan Guo, Li Liu, Zaiping Lin, Xinpu Deng, and Wei An. Deep video super-resolution using hr optical flow estimation. IEEE Transactions on Image Processing, 29:4323–4336, 2020.
|
| 294 |
+
[80] Xintao Wang, Kelvin CK Chan, Ke Yu, Chao Dong, and Chen Change Loy. Edvr: Video restoration with enhanced deformable convolutional networks. In IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 1954–1963, 2019.
|
| 295 |
+
[81] Zhendong Wang, Xiaodong Cun, Jianmin Bao, and Jianzhuang Liu. Uformer: A general u-shaped transformer for image restoration. arXiv preprint arXiv:2106.03106, 2021.
|
| 296 |
+
[82] Zhiwei Wang, Yao Ma, Zitao Liu, and Jiliang Tang. R-transformer: Recurrent neural network enhanced transformer. arXiv preprint arXiv:1907.05572, 2019.
|
| 297 |
+
[83] Bichen Wu, Chenfeng Xu, Xiaoliang Dai, Alvin Wan, Peizhao Zhang, Zhicheng Yan, Masayoshi Tomizuka, Joseph Gonzalez, Kurt Keutzer, and Peter Vajda. Visual transformers: Token-based image representation and processing for computer vision. arXiv preprint arXiv:2006.03677, 2020.
|
| 298 |
+
[84] Zhuofan Xia, Xuran Pan, Shiji Song, Li Erran Li, and Gao Huang. Vision transformer with deformable attention. arXiv preprint arXiv:2201.00520, 2022.
|
| 299 |
+
[85] Xiaoyu Xiang, Yapeng Tian, Yulun Zhang, Yun Fu, Jan P Allebach, and Chenliang Xu. Zooming slow-mo: Fast and accurate one-stage space-time video super-resolution. In IEEE Conference on Computer Vision and Pattern Recognition, pages 3370–3379, 2020.
|
| 300 |
+
[86] Xinguang Xiang, Hao Wei, and Jinshan Pan. Deep video deblurring using sharpness features from exemplars. IEEE Transactions on Image Processing, 29:8976–8987, 2020.
|
| 301 |
+
[87] Tianfan Xue, Baian Chen, Jiajun Wu, Donglai Wei, and William T Freeman. Video enhancement with task-oriented flow. International Journal of Computer Vision, 127(8):1106–1125, 2019.
|
| 302 |
+
[88] Peng Yi, Zhongyuan Wang, Kui Jiang, Junjun Jiang, Tao Lu, Xin Tian, and Jiayi Ma. Omniscient video super-resolution. In IEEE International Conference on Computer Vision, pages 4429–4438, 2021.
|
| 303 |
+
[89] Peng Yi, Zhongyuan Wang, Kui Jiang, Junjun Jiang, and Jiayi Ma. Progressive fusion video super-resolution network via exploiting non-local spatio-temporal correlations. In IEEE International Conference on Computer Vision, pages 3106–3115, 2019.
|
| 304 |
+
[90] Wulian Yun, Mengshi Qi, Chuanming Wang, Huiyuan Fu, and Huadong Ma. Coarse-to-fine video denoising with dual-stage spatial-channel transformer. arXiv preprint arXiv:2205.00214, 2022.
|
| 305 |
+
[91] Syed Waqas Zamir, Aditya Arora, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan, MingHsuan Yang, and Ling Shao. Multi-stage progressive image restoration. In IEEE Conference on Computer Vision and Pattern Recognition, pages 14821–14831, 2021.
|
| 306 |
+
[92] Kai Zhang, Yawei Li, Jingyun Liang, Jiezhang Cao, Yulun Zhang, Hao Tang, Radu Timofte, and Luc Van Gool. Practical blind denoising via swin-conv-unet and data synthesis. arXiv preprint arXiv:2203.13278, 2022.
|
| 307 |
+
[93] Kai Zhang, Jingyun Liang, Luc Van Gool, and Radu Timofte. Designing a practical degradation model for deep blind image super-resolution. In IEEE Conference on International Conference on Computer Vision, 2021.
|
| 308 |
+
[94] Kai Zhang, Wangmeng Zuo, Yunjin Chen, Deyu Meng, and Lei Zhang. Beyond a gaussian denoiser: Residual learning of deep cnn for image denoising. IEEE Transactions on Image Processing, 26(7):3142–3155, 2017.
|
| 309 |
+
[95] Kai Zhang, Wangmeng Zuo, and Lei Zhang. Learning a single convolutional super-resolution network for multiple degradations. In IEEE Conference on Computer Vision and Pattern Recognition, pages 3262–3271, 2018.
|
| 310 |
+
[96] Yulun Zhang, Kunpeng Li, Kai Li, Lichen Wang, Bineng Zhong, and Yun Fu. Image superresolution using very deep residual channel attention networks. In European Conference on Computer Vision, pages 286–301, 2018.
|
| 311 |
+
[97] Yinjie Zhang, Yuanxing Zhang, Yi Wu, Yu Tao, Kaigui Bian, Pan Zhou, Lingyang Song, and Hu Tuo. Improving quality of experience by adaptive video streaming with super-resolution. In IEEE Conference on Computer Communications, pages 1957–1966, 2020.
|
| 312 |
+
[98] Zhihang Zhong, Ye Gao, Yinqiang Zheng, and Bo Zheng. Efficient spatio-temporal recurrent neural network for video deblurring. In European Conference on Computer Vision, pages 191–207, 2020.
|
| 313 |
+
[99] Shangchen Zhou, Jiawei Zhang, Jinshan Pan, Haozhe Xie, Wangmeng Zuo, and Jimmy Ren. Spatio-temporal filter adaptive network for video deblurring. In IEEE International Conference on Computer Vision, pages 2482–2491, 2019.
|
| 314 |
+
[100] Xizhou Zhu, Han Hu, Stephen Lin, and Jifeng Dai. Deformable convnets v2: More deformable, better results. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 9308–9316, 2019.
|
| 315 |
+
[101] Xizhou Zhu, Weijie Su, Lewei Lu, Bin Li, Xiaogang Wang, and Jifeng Dai. Deformable detr: Deformable transformers for end-to-end object detection. arXiv preprint arXiv:2010.04159, 2020.
|
| 316 |
+
|
| 317 |
+
# Checklist
|
| 318 |
+
|
| 319 |
+
The checklist follows the references. Please read the checklist guidelines carefully for information on how to answer these questions. For each question, change the default [TODO] to [Yes] , [No] , or [N/A] . You are strongly encouraged to include a justification to your answer, either by referencing the appropriate section of your paper or providing a brief inline description. For example:
|
| 320 |
+
|
| 321 |
+
• Did you include the license to the code and datasets? [Yes]
|
| 322 |
+
• Did you include the license to the code and datasets? [No] The code and the data are proprietary. • Did you include the license to the code and datasets? [N/A]
|
| 323 |
+
|
| 324 |
+
Please do not modify the questions and only use the provided macros for your answers. Note that the Checklist section does not count towards the page limit. In your paper, please delete this instructions block and only keep the Checklist section heading above along with the questions/answers below.
|
| 325 |
+
|
| 326 |
+
1. For all authors...
|
| 327 |
+
|
| 328 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] (b) Did you describe the limitations of your work? [Yes] See Section 6.
|
| 329 |
+
|
| 330 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 6.
|
| 331 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 332 |
+
|
| 333 |
+
2. If you are including theoretical results...
|
| 334 |
+
|
| 335 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] (b) Did you include complete proofs of all theoretical results? [Yes]
|
| 336 |
+
|
| 337 |
+
3. If you ran experiments...
|
| 338 |
+
|
| 339 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See Section 4.1 and supplemental material.
|
| 340 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 4.1 and supplemental material.
|
| 341 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes]
|
| 342 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes]
|
| 343 |
+
|
| 344 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 345 |
+
|
| 346 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 347 |
+
(b) Did you mention the license of the assets? [Yes]
|
| 348 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 349 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [Yes]
|
| 350 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes]
|
| 351 |
+
|
| 352 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 353 |
+
|
| 354 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 355 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 356 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/dev/HH3GHN_Q1Ba/HH3GHN_Q1Ba.md
ADDED
|
@@ -0,0 +1,611 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Revisiting Populations in Multi-Agent Communication
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 Despite evidence from sociolinguistics that larger groups of speakers tend to
|
| 11 |
+
2 develop more structured languages, the use of populations has failed to yield
|
| 12 |
+
3 significant benefits in emergent multi-agent communication. In this paper we
|
| 13 |
+
4 reassess the validity of the standard training protocol and illustrate its limitations.
|
| 14 |
+
5 Specifically, we analyze population-level communication at the equilibrium in
|
| 15 |
+
6 sender-receiver Lewis games. We find that receivers co-adapt to senders they
|
| 16 |
+
7 are interacting with, which limits the effect of the population. Informed by this
|
| 17 |
+
8 analysis, we propose an alternative training protocol based on “partitioning” agents.
|
| 18 |
+
9 Partitioning isolates sender-receiver pairs, limits co-adaptation, and results in a new
|
| 19 |
+
10 global optimization objective where agents maximize (1) their respective "internal"
|
| 20 |
+
11 communication accuracy and (2) their alignment with other agents. In experiments,
|
| 21 |
+
12 we find that agents trained in partitioned populations are able to communicate
|
| 22 |
+
13 successfully with new agents which they have never interacted with and tend to
|
| 23 |
+
14 develop a shared language. Moreover, we observe that larger populations develop
|
| 24 |
+
15 languages that are more compositional. Our findings suggest that scaling up to
|
| 25 |
+
16 populations in multi-agent communication can be beneficial, but that it matters
|
| 26 |
+
17 how we scale up.
|
| 27 |
+
|
| 28 |
+
# 18 1 Introduction
|
| 29 |
+
|
| 30 |
+
19 Uncovering the mechanisms that underlie our ability to communicate using language is an important
|
| 31 |
+
20 stepping stone towards developing machine learning models that are capable of coordinating and
|
| 32 |
+
21 interacting via natural language. Over the last few years, there has been increasing interest in
|
| 33 |
+
22 simulating the emergence of language using artificial agents trained with reinforcement learning to
|
| 34 |
+
23 communicate to achieve a cooperative task [33]. Typically, agents are trained to perform a variant
|
| 35 |
+
24 of the Lewis signaling game [37, 51] wherein a sender emits a message describing an object and a
|
| 36 |
+
25 receiver attempts to reconstruct the object based on the description. This line of work has applications
|
| 37 |
+
26 to semi-supervised learning applied to concrete tasks such as image captioning or representation
|
| 38 |
+
27 learning [36, 18].
|
| 39 |
+
28 Most previous research has focused on communication between a single pair of agents. However,
|
| 40 |
+
29 there is mounting evidence that the communication protocols developed in this restricted setting
|
| 41 |
+
30 become highly specialized and exhibit properties that are at odds with those found in human languages
|
| 42 |
+
31 [4, 8]: for example agents are able to solve the task successfully while using languages that are not
|
| 43 |
+
32 compositional [32, 9]. As a possible solution, a growing body of work is advocating for scaling
|
| 44 |
+
33 up the emergent communication literature to populations of more than two agents communicating
|
| 45 |
+
34 simultaneously [24, 30, 49, 10]. Indeed, there is substantial evidence within the language sciences
|
| 46 |
+
35 that population dynamics shape the language structure [47, 42]. In spite of this fact, several negative
|
| 47 |
+
36 results have been obtained, showing that training agents in population yield marginal benefits without
|
| 48 |
+
37 explicit pressure towards e.g. population diversity [49] or emulation mechanisms [10].
|
| 49 |
+
38 In this paper, we call into question the way such populations are trained. By studying a simple
|
| 50 |
+
39 referential game, we evaluate populations on two desirable features observed in natural language:
|
| 51 |
+
40 • Agents are able to communicate with new partners within the same population [23]
|
| 52 |
+
41 • Larger populations tend to develop more structured languages [42].
|
| 53 |
+
42 We provide evidence that populations of artificial agents do not always possess these features (as
|
| 54 |
+
43 also attested by previous work, e.g. Kim and Oh [30], Chaabouni et al. [10]). To shed light on this
|
| 55 |
+
44 phenomenon, we analyze the behaviour of agents in a population at the equilibrium. We find that with
|
| 56 |
+
45 the standard training procedure, the functional form of the objective is the same as that of a single pair
|
| 57 |
+
46 of agents, due to receivers co-adapting to their training partners. As our main contribution, we propose
|
| 58 |
+
47 an alternative training procedure which partitions sender-receiver pairs and limits co-adaptation of
|
| 59 |
+
48 receiver agents. We show that this new training paradigm maximizes a different objective at the
|
| 60 |
+
49 population level. In particular, it explicitly promotes mutual-intelligibility across different agents.
|
| 61 |
+
50 In experiments, we find that agents trained in partitioned populations are able to communicate
|
| 62 |
+
51 successfully with new communication partners with which they have never interacted during training,
|
| 63 |
+
52 and that languages spoken by various agents tend to be similar to one another. In addition, we observe
|
| 64 |
+
53 that (1) languages developed in partitioned populations tend to be more compositional and (2) there
|
| 65 |
+
54 is a population size effect whereby larger populations develop more structured languages. Our results
|
| 66 |
+
55 show that there are multiple ways to generalize from single agent pairs to larger populations, and that
|
| 67 |
+
56 these design choices matter when it comes to studying the emergent language.
|
| 68 |
+
|
| 69 |
+
# 2 Communication Game
|
| 70 |
+
|
| 71 |
+
58 We study communication in referential games, a variant of the Lewis signaling game [37] proposed
|
| 72 |
+
59 by Lazaridou et al. [34]. The game proceeds as follows: during each round, a sender agent $\pi$ observes
|
| 73 |
+
60 an object $x \in \mathcal { X }$ (e.g., an arbitrary categorical entity, or a natural images) sampled from input
|
| 74 |
+
61 space $\mathcal { X }$ according to distribution $p$ and generates a message $m \sim \pi ( \cdot \mid \bar { x } )$ . Messages consist of
|
| 75 |
+
62 variable length sequences of tokens picked from a discrete vocabulary $V$ . Note that the tokens
|
| 76 |
+
63 themselves are arbitrary and meaningless (typically they are represented as numbers from 1 to $| V | )$ .
|
| 77 |
+
64 A receiver agent $\rho$ then observes message $m$ and must predict the original object from among a set of
|
| 78 |
+
65 candidates $\mathcal { C } = \{ x , y _ { 1 } , . . . y _ { | \mathcal { C } - 1 | } \}$ containing $x$ and $| { \bar { \mathcal { C } } } | - 1$ distractors, where each distractor $y$ is
|
| 79 |
+
66 sampled uniformly without replacement from the input space excluding the original object, ${ \mathcal { X } } \setminus \{ x \}$ .
|
| 80 |
+
67 Concretely, this is implemented by calculating a score $f ( y , m )$ for each candidate $y$ and defining
|
| 81 |
+
68 the probability of a candidate conditioned on the message $\rho ( \cdot \mid m , \mathcal { C } )$ as $\frac { e ^ { f ( x , m ) } } { \sum _ { y \in { \mathcal { C } } } f ( y , m ) }$ . Based on the
|
| 82 |
+
69 receiver’s success, the sender agent receives a reward $R ( x , \rho ( \cdot \mid m , { \mathcal { C } } ) )$ .
|
| 83 |
+
70 In practice, both senders and receivers are implemented as neural networks $\pi _ { \theta }$ and $\rho _ { \psi }$ with parameters
|
| 84 |
+
71 $\theta$ and $\psi$ estimated by gradient descent. The sender is trained to maximize its expected reward using
|
| 85 |
+
72 the REINFORCE algorithm [57], while the receiver maximizes the expected log-likelihood of
|
| 86 |
+
73 identifying the original object, $\log \rho _ { \psi } ( x \mid m , \mathcal { C } )$ (also known as the InfoNCE objective; Oord et al.
|
| 87 |
+
74 [45]). Denoting as $\mathbb { E } _ { x \sim p }$ the expectation over $x$ sampled from $p$ , the corresponding training objectives
|
| 88 |
+
75 are:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\begin{array} { r l } & { J _ { s } ( \theta ) = \mathbb { E } _ { x \sim p } \mathbb { E } _ { m \sim \pi _ { \theta } ( \cdot \vert x ) } \mathbb { E } _ { \mathcal { C } \sim p } R ( x , \rho _ { \psi } ( \cdot \vert m , \mathcal { C } ) ) } \\ & { J _ { r } ( \psi ) = \mathbb { E } _ { x \sim p } \mathbb { E } _ { m \sim \pi _ { \theta } ( \cdot \vert x ) } \mathbb { E } _ { \mathcal { C } \sim p } \log \rho _ { \psi } ( x \mid m , \mathcal { C } ) } \end{array}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
# 76 2.1 Population Level Training
|
| 95 |
+
|
| 96 |
+
77 The two-player referential game can be generalized to larger populations of agents [41, 10]. In
|
| 97 |
+
78 the most general case, we consider a population of $N _ { s }$ senders and $N _ { r }$ receivers that are linked by
|
| 98 |
+
79 a bipartite communication graph $G$ defining connections between senders and receiver $( \pi _ { \theta _ { i } } , \rho _ { \psi _ { j } } )$
|
| 99 |
+
80 [24, 30]. At training time, sender-receiver pairs are repeatedly sampled and trained to perform a
|
| 100 |
+
81 round of the game. Importantly, only agent pairs that are connected in the communication graph are
|
| 101 |
+
82 sampled. Throughout this paper, we will refer to this type of training as Standard training.
|
| 102 |
+
83 With this training procedure, agents are trained to maximize their communicative success with all
|
| 103 |
+
84 their neighbors in the communication graph. Let $\mathcal { N } _ { G } ( i )$ refer to the neighbors of the $i$ -th node in
|
| 104 |
+
85 the graph, and $J _ { s , i j }$ (respectively $J _ { r , i \to j }$ ) denote the objective of $\pi _ { \boldsymbol { \theta } _ { i } }$ (respectively $\rho _ { \psi _ { j } }$ )) in the
|
| 105 |
+
86 pairwise communication from sender $i$ to receiver $j$ . We can write the overall objective for sender $i$
|
| 106 |
+
87 (and receiver $j$ , respectively) as:
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
J _ { s , i } ( \theta _ { i } ) = \frac { 1 } { | \mathcal { N } _ { G } ( i ) | } \sum _ { j \in \mathcal { N } _ { G } ( i ) } J _ { s , i \to j } ( \theta _ { i } ) \quad \mathrm { ~ a n d ~ } \quad J _ { r , j } ( \psi _ { j } ) = \frac { 1 } { | \mathcal { N } _ { G } ( j ) | } \sum _ { i \in \mathcal { N } _ { G } ( j ) } J _ { r , i \to j } ( \psi _ { j } ) .
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
88 At test time, the population is evaluated by averaging the referential accuracy across all possible
|
| 113 |
+
89 sender-receiver pairings. Following previous work, in this paper we focus on populations with an
|
| 114 |
+
90 equal number $N : = N _ { s } = N _ { r }$ of senders and receivers, meaning that there are up to $N ^ { 2 }$ possible
|
| 115 |
+
91 pairings.
|
| 116 |
+
|
| 117 |
+
# 92 2.2 What does Population-level Training Optimize?
|
| 118 |
+
|
| 119 |
+
93 To shed light on the differences between training a single agent pair and training a population of
|
| 120 |
+
94 agents, we analyze the objective optimized by the population. Inspired by [1]’s analysis in the
|
| 121 |
+
95 two-player case, we study the behaviour of the population at the optimum, that is when senders and
|
| 122 |
+
96 receivers have reached a Nash equilibrium [46].
|
| 123 |
+
97 In this section, we make the simplifying assumption that ${ \mathcal { C } } = { \mathcal { X } }$ . In other words, receiver agents must
|
| 124 |
+
98 pick the correct candidate out of all possible objects in $\mathcal { X }$ . This allows us to remove the conditioning
|
| 125 |
+
99 on $\mathcal { C }$ and write $\rho _ { \psi } ( x \mid m , \mathcal { C } ) = \rho _ { \psi } ( x \mid m )$ . We make this simplification to reduce clutter in notations.
|
| 126 |
+
100 Nevertheless, our key observations still hold for $\mathcal C \neq \mathcal X$ (see Appendix $\mathbf { B }$ for a detailed discussion).
|
| 127 |
+
|
| 128 |
+
At a Nash equilibrium, the optimal receiver parameters 101 $\psi _ { j } ^ { * }$ satisfy
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
\rho _ { \psi _ { j } ^ { * } } = \underset { \psi _ { j } } { \arg \operatorname* { m a x } } J _ { r , j } ( \psi _ { j } ) = \underset { \psi _ { j } } { \arg \operatorname* { m a x } } \frac { 1 } { | \mathcal { N } _ { G } ( j ) | } \sum _ { i \in \mathcal { N } _ { G } ( j ) } J _ { r , i j } ( \psi _ { j } ) .
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
102 Assuming that receiver $\rho _ { \psi _ { j } }$ has high enough capacity, and training is able to reach the global optimum,
|
| 135 |
+
103 the solution of the optimization problem in Equation 4 has an analytical solution $\rho _ { \psi _ { j } ^ { * } }$ which can be
|
| 136 |
+
104 written as a function of $\begin{array} { r } { \pi _ { \mathcal { N } _ { G } ( j ) } ^ { * } ( m \mid x ) : = \frac { 1 } { | \mathcal { N } _ { G } ( j ) | } \sum _ { i \in \mathcal { N } _ { G } ( j ) } \pi _ { \theta _ { i } ^ { * } } ( m \mid x ) } \end{array}$ , the mixture of all senders
|
| 137 |
+
105 communicating with receiver $j$ :
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\rho _ { \psi _ { j } ^ { * } } ( x \mid m ) = \pi _ { { \mathcal N } _ { G } ( j ) } ^ { * } ( x \mid m ) = \frac { \pi _ { { \mathcal N } _ { G } ( j ) } ^ { * } ( m \mid x ) p ( x ) } { \mathbb { E } _ { y \sim p } \pi _ { { \mathcal N } _ { G } ( j ) } ^ { * } ( m \mid y ) } .
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
In other words, 106 $\rho _ { \psi _ { j } ^ { * } }$ is the posterior associated with $\pi _ { \mathcal { N } _ { G } ( j ) } ^ { * }$ (full derivation in appendix A).
|
| 144 |
+
|
| 145 |
+
107 An important implication of this result is that when the population graph is fully connected (all
|
| 146 |
+
108 senders are connected to all receivers), each receiver converges to the same optimum $\pi ^ { * } ( x \mid m ) =$
|
| 147 |
+
109 $\frac { \sum _ { i = 1 } ^ { n } \pi _ { \theta _ { i } } ( m | x ) p ( x ) } { \mathbb { E } _ { y \sim p } \sum _ { i = 1 } ^ { n } \pi _ { \theta _ { i } } ( m | x ) }$ , the posterior of the mixture of all senders in the population. Plugging this back
|
| 148 |
+
110 into each sender’s objective, we have
|
| 149 |
+
|
| 150 |
+
$$
|
| 151 |
+
J _ { s , i } ( \theta _ { i } ^ { * } ) = \mathbb { E } _ { x \sim p } \mathbb { E } _ { m \sim \pi _ { \theta _ { i } ^ { * } } ( \cdot | x ) } R ( x , \pi ^ { * } ( \cdot \mid m ) )
|
| 152 |
+
$$
|
| 153 |
+
|
| 154 |
+
111 Summing across all senders, we can rewrite the global objective optimized by the senders as
|
| 155 |
+
|
| 156 |
+
$$
|
| 157 |
+
\operatorname* { m a x } _ { \theta ^ { * } } \mathbb { E } _ { x \sim p } \mathbb { E } _ { m \sim \pi ^ { * } } R ( x , \pi ^ { * } ( \cdot \mid m ) ) .
|
| 158 |
+
$$
|
| 159 |
+
|
| 160 |
+
112 In other words, at the equilibrium, the population maximizes the expected reward of the “sender
|
| 161 |
+
113 ensemble” $\pi ^ { * }$ , rather than that of individual agents $\pi _ { \theta _ { i } ^ { * } }$ : the objective of a population $N$ agents is
|
| 162 |
+
114 functionally the same irrespective of $N$ . We postulate that this indifference to the population size
|
| 163 |
+
115 may account for the surprising lack of effect of larger populations observed in some previous work
|
| 164 |
+
116 [49, 10]. Differences in behaviour must be attributed to effects stemming from training dynamics
|
| 165 |
+
117 (e.g. it becomes more difficult for receivers to learn the posterior $\pi ^ { * } ( x \mid m ) ,$ ), or be imposed through
|
| 166 |
+
118 extraneous modifications of the population objective (for example explicit imitation components;
|
| 167 |
+
119 Chaabouni et al. [10]).
|
| 168 |
+
120 A second observation is that there is no direct pressure for agents that communicate at training time
|
| 169 |
+
121 to develop the same language. Indeed, it is entirely possible that all senders develop different but
|
| 170 |
+
122 non-overlapping languages: it suffices that no two senders communicating with a shared receiver
|
| 171 |
+
123 use the same message $m$ to describe a different object. In this case receivers can simply learn their
|
| 172 |
+
124 neighboring sender’s languages and there is no need for the senders to converge to a unified language.
|
| 173 |
+
|
| 174 |
+

|
| 175 |
+
Figure 1: In the standard setting (left hand side), both receivers (in blue) are trained by maximizing their discrimination objective with respect to both senders. With partitioning, receiver $\rho _ { \psi _ { 1 } }$ (resp. $\rho _ { \psi _ { 2 } }$ ) is only trained to maximize its communication objective with sender $\pi _ { \theta _ { 1 } }$ (resp. $\pi _ { \theta _ { 2 } }$ )
|
| 176 |
+
|
| 177 |
+
# 125 3 Partitioning Agents
|
| 178 |
+
|
| 179 |
+
126 A key difference between the usual population setting and populations of humans in laboratory
|
| 180 |
+
127 experiments is that agents are not usually split into “senders” and “receivers”. Rather, each participant
|
| 181 |
+
128 in the experiment assumes both a sender and receiver role [21]. Our hypothesis is that, counter to
|
| 182 |
+
129 what is customary in the emergent communication literature, tying senders and receivers is key in
|
| 183 |
+
130 surfacing useful population-level dynamics in multi-agent communication.
|
| 184 |
+
131 To operationalize this sender-receiver coupling, we identify an “agent” as a sender-receiver pair.
|
| 185 |
+
132 During training, we only train receiver $\rho _ { \psi _ { i } }$ with its associated sender $\pi _ { \boldsymbol { \theta } _ { i } }$ . In other words, $J _ { r , i } ( \psi _ { i } ) : =$
|
| 186 |
+
133 $J _ { r , i \to i } ( \psi _ { i } )$ . In doing so, we “partition” the agents by preventing receiver $i$ from co-adapting to other
|
| 187 |
+
134 senders $j \neq i$ . This procedure is illustrated in Figure 1. Note that senders can nevertheless still
|
| 188 |
+
135 train with rewards from neighboring receivers, and so communication across agents can still emerge.
|
| 189 |
+
136 Importantly, partitioning prevents receivers from learning to recognize multiple languages, as they
|
| 190 |
+
137 are now only trained on messages emitted by a single sender.
|
| 191 |
+
138 Following a similar analysis as Section 2.2, we derive that at the optimum, receiver $\rho _ { \psi _ { i } ^ { * } } ( x \mid m )$ now
|
| 192 |
+
139 takes the form of the posterior associated with its respective sender, $\begin{array} { r } { \pi _ { \theta _ { i } ^ { * } } ( x \mid m ) = \frac { \pi _ { \theta _ { i } ^ { * } } ( m | x ) p ( x ) } { \mathbb { E } _ { y \sim p } \pi _ { m | y } } } \end{array}$
|
| 193 |
+
140 (derivation in Appendix A). We can thus write the population-level objective at the equilibrium as
|
| 194 |
+
|
| 195 |
+
$$
|
| 196 |
+
\frac { 1 } { N } \sum _ { i = 1 } ^ { N } \left[ \underbrace { \mathbb { E } _ { x \sim p } \mathbb { E } _ { m \sim \pi _ { \theta _ { i } ^ { * } } ( \cdot | x ) } R ( x , \pi _ { \theta _ { i } ^ { * } } ( \cdot | m ) ) } _ { \mathrm { I n e r m a l c o m m u n i c a t i o n } } + \underbrace { \sum _ { j \in \mathcal { N } _ { G } ( i ) } \mathbb { E } _ { x \sim p } \mathbb { E } _ { m \sim \pi _ { \theta _ { i } ^ { * } } ( \cdot | x ) } R ( x , \pi _ { \theta _ { j } ^ { * } } ( \cdot | m ) ) } _ { \mathrm { M u u a l i n e l l i g i b i l i t y } } \right] .
|
| 197 |
+
$$
|
| 198 |
+
|
| 199 |
+
141 Note that the functional form of the objective can now be decomposed into two parts: an “internal
|
| 200 |
+
142 communication” objective which takes the same form as that of a single pair of agents, and a “mutual
|
| 201 |
+
143 intelligibility” objective which enforces that neighboring agents are able to communicate successfully.
|
| 202 |
+
144 In experiments, we show that this explicit pressure towards mutual intelligibility promotes the
|
| 203 |
+
145 emergence of a single language within the population, which in turn enables agents to communicate
|
| 204 |
+
146 with new partners outside of their training neighborhood.
|
| 205 |
+
|
| 206 |
+
# 4 Experimental Setting
|
| 207 |
+
|
| 208 |
+
# 4.1 Datasets
|
| 209 |
+
|
| 210 |
+
We perform experiments on two datasets: a simple, synthetic “attribute/values” dataset and a more realistic image dataset.
|
| 211 |
+
|
| 212 |
+
151 Attribute/Values In this dataset, each object is represent by a collection of abstract “attributes”.
|
| 213 |
+
152 Specifically, each input $x$ is a vector of 4 attributes, each of which can take 10 total values. This results
|
| 214 |
+
153 in $1 0 ^ { 4 }$ total attribute/value combinations [32, 9]. In each setting we hold out 1, 000 combinations
|
| 215 |
+
154 to be used as a validation, and 1, 000 more for use as a test set. We can thus ensure that we are
|
| 216 |
+
155 evaluating the agents’ ability to generalize to unseen combinations of attributes.
|
| 217 |
+
156 ImageNet In addition to toy objects, we perform experiments with referential games based on more
|
| 218 |
+
157 realistic objects. Following Chaabouni et al. [10], we use the ImageNet [17] dataset of natural images.
|
| 219 |
+
158 The dataset consists of about 1.4M training images collected on the internet and annotated for 1,000
|
| 220 |
+
159 labels from the WordNet database [40]. Images are first encoded as 2048-sized real-valued vectors
|
| 221 |
+
160 with a (frozen) ResNet pre-trained with BYOL [22] before being passed to sender and receivers.
|
| 222 |
+
|
| 223 |
+
# 161 4.2 Game Architecture
|
| 224 |
+
|
| 225 |
+
162 Both sender and receiver agents are based on 1 layer LSTMs [26] with embedding and hidden
|
| 226 |
+
163 dimensions of size 256. Specifically, the sender first encodes the object $x$ into a vector of size 256,
|
| 227 |
+
164 which is concatenated to the input of the LSTM. At each step, the output of the LSTM cell is passed
|
| 228 |
+
165 through a fully connected layer to produce logits of size $| V |$ . A softmax function is then applied
|
| 229 |
+
166 to obtain normalized probabilities over the vocabulary. During training, messages are generated
|
| 230 |
+
167 by sampling from the distribution whereas at test time we generate messages deterministically via
|
| 231 |
+
168 greedy decoding. In both cases, generation stops whenever a special $^ { 6 6 } < \tt E O S > ^ { , , }$ is generated, or when
|
| 232 |
+
169 the number of tokens reaches a fixed limit $L$ .
|
| 233 |
+
170 The receiver encodes the message with an LSTM encoder, the output of which is the fed into a
|
| 234 |
+
171 fully connected layer to yield a vector of size 512. The candidate objects $\mathcal { C }$ are then scored by
|
| 235 |
+
172 computing the dot product of this vector with a 512-dimensional encoding of each candidate. The
|
| 236 |
+
173 conditional distribution over candidates is then obtained by taking a softmax. We set the reward
|
| 237 |
+
174 function for the sender to the log-likelihood assigned by the receiver to the correct candidate,
|
| 238 |
+
175 $R ( x , \rho _ { \psi } ( \cdot \mid m ) ) = \log \rho _ { \psi } ( x \mid m )$ .
|
| 239 |
+
176 Throughout all experiments, we set the vocabulary size $| V |$ to 20 and the maximum length of the
|
| 240 |
+
177 messages, $L$ , to 10. This means that the communication channel used by the agents has a capacity
|
| 241 |
+
178 of about $2 0 ^ { 1 0 }$ which ensures that there is no communication bottleneck (the size of the channel is
|
| 242 |
+
179 several orders of magnitude larger than the size of our datasets). Our implementation, based on the
|
| 243 |
+
180 EGG toolkit [29], will be open-sourced upon de-anonymization.
|
| 244 |
+
|
| 245 |
+
# 181 4.3 Population training
|
| 246 |
+
|
| 247 |
+
182 We train populations following the procedure outlined by
|
| 248 |
+
183 Chaabouni et al. [10]: for each minibatch of data, we
|
| 249 |
+
184 sample $K$ pairs from the population (uniformly among
|
| 250 |
+
185 the pairs linked in the communication graph). Each pair
|
| 251 |
+
186 plays an episode of the game, and the agents are updated
|
| 252 |
+
187 simultaneously following the gradients of their respective
|
| 253 |
+
188 objectives. We take $K = \operatorname* { m a x } ( 1 0 , N )$ to ensure that each
|
| 254 |
+
189 agent plays the game at least once at every step on aver
|
| 255 |
+
190 age. This procedure needs to be modified for partitioned
|
| 256 |
+
191 populations: since receiver $j$ is only with its respective
|
| 257 |
+
192 sender instead of with all of its neighbors, there is now
|
| 258 |
+
193 only a 1|NG(j)| chance that receiver $j$ will be updated every
|
| 259 |
+
194 step (the probability that the pair $( j , j )$ is sampled). For
|
| 260 |
+
195 larger populations, especially those that are fully-connected, this dramatically slows down training as
|
| 261 |
+
196 receivers are updated very infrequently. To address this issue, we modify the procedure as follows:
|
| 262 |
+
197 for every sampled agent pair $( \pi _ { \theta _ { i } } , \rho _ { \psi _ { j } } )$ , we calculate both $J _ { s , i j }$ and $J _ { r , i \to i }$ and update both $\pi _ { \boldsymbol { \theta } _ { i } }$ and
|
| 263 |
+
198 $\rho _ { \psi _ { i } }$ . Note that this necessitates calculating both $\rho _ { \psi _ { j } } ( \boldsymbol { x } \mid m , \mathcal { C } )$ and $\rho _ { \psi _ { i } } ( \boldsymbol { x } \mid m , \mathcal { C } )$ and therefore we
|
| 264 |
+
199 incur a small computational overhead. However we only observe a $\sim 5 \%$ increase in training time
|
| 265 |
+
200 due to the fact that we are back-propagating through only one of the two receivers, $\rho _ { \psi _ { i } } ( \boldsymbol { x } \mid m , \mathcal { C } )$
|
| 266 |
+
201 With this modification, we recover the property that each agent (sender or receiver) is updated once
|
| 267 |
+
202 every step on average.
|
| 268 |
+
203 In all experiments we train with a batch size of 1024 with the Adam optimizer [31] using a learning
|
| 269 |
+
204 rate of 0.001 for the attribute/value dataset and 0.0001 for Imagenet. The other parameters are set to
|
| 270 |
+
205 $\beta _ { 1 } = 0 . 9$ , $\beta _ { 2 } = 0 . 9 9 9$ and $\varepsilon = 1 0 ^ { - 8 }$ . We apply $\ell _ { 2 }$ regularization with a coefficient of $1 0 ^ { - 5 }$ .
|
| 271 |
+
206 We systematically augment the sender objectives with an entropy maximizing term, which has
|
| 272 |
+
207 been found to encourage exploration [58]. The coefficient for this entropy term is set to 0.1 in all
|
| 273 |
+
208 experiments. To reduce the variance of the policy gradient in REINFORCE, we substract a baseline
|
| 274 |
+
209 computed by taking the average reward within a given mini-batch for each pair [54].
|
| 275 |
+
|
| 276 |
+

|
| 277 |
+
Figure 2: Example of communication graphs used in this paper
|
| 278 |
+
|
| 279 |
+
Table 1: Accuracies with training partners and new partners on both datasets. Numbers are reported with standard deviation across all pairs for 3 independent experiments
|
| 280 |
+
|
| 281 |
+
<table><tr><td rowspan="2"></td><td colspan="2">ImageNet</td><td colspan="2">Attribute/Values</td></tr><tr><td>Standard</td><td>Partitioned</td><td>Standard</td><td>Partitioned</td></tr><tr><td>Training partners</td><td>97.09 ±1.10</td><td>99.75 ± 0.08</td><td>99.88 ± 0.15</td><td>99.81 ± 0.22</td></tr><tr><td>New partners</td><td>5.41 ±13.57</td><td>96.24 ± 3.25</td><td>7.81 ± 18.28</td><td>40.37 ± 29.44</td></tr></table>
|
| 282 |
+
|
| 283 |
+
Table 2: Language similarity between training partners and new partners on both datasets. Numbers are reported with standard deviation across all pairs for 3 independent experiments
|
| 284 |
+
|
| 285 |
+
<table><tr><td rowspan="2"></td><td colspan="2">ImageNet</td><td colspan="2">Attribute/Values</td></tr><tr><td>Standard</td><td>Partitioned</td><td> Standard</td><td>Partitioned</td></tr><tr><td>Training partners</td><td>0.28 ± 0.07</td><td>0.40 ± 0.02</td><td>0.28 ± 0.05</td><td>0.36 ± 0.01</td></tr><tr><td>New partners</td><td>0.22 ± 0.19</td><td>0.37 ± 0.15</td><td>0.23 ± 0.19</td><td>0.31 ± 0.17</td></tr></table>
|
| 286 |
+
|
| 287 |
+
We evaluate the population every epoch (every 5 epochs for the Attribute/Value dataset) on the validation set. We only evaluate on up to 100 unique pairs sampled uniformly within the population, this time without consideration for the communication graph. We train for a fixed number of epochs, selecting the best model based on the average validation accuracy across all evaluation pairs.
|
| 288 |
+
|
| 289 |
+
# 5 Communication with New Partners
|
| 290 |
+
|
| 291 |
+
In our first set of experiments, we evaluate the ability of agents trained in populations to communicate with partners they haven’t interacted with during training.
|
| 292 |
+
|
| 293 |
+
# 5.1 Circular Populations
|
| 294 |
+
|
| 295 |
+
Specifically, we study “circular” populations of agents arranged on a ring lattice. Each agent (senderreceiver pair) $i$ is only trained with neighboring agents $i - 1 , \dots , i + 1$ and the graph is cyclical (see Figure 2b). We choose this type of population because it is an extreme case of a population where each agent has the same, minimal amount of neighbors (two), yet there is still a path between any two agents. In this context, training partners are sender-receiver pairs that are connected in the graph and have interacted during the training phase whereas new partners refers to pairs that have not interacted during training.
|
| 296 |
+
|
| 297 |
+
5 We report results along two metrics:
|
| 298 |
+
|
| 299 |
+
• Communication Accuracy of sender/receiver pairs on an evaluation set. This measures how successful the pair is in communicating.
|
| 300 |
+
|
| 301 |
+
• Language Similarity between senders. This metric (also called synchronization in Rita et al. [49]) is calculated as $1 - \delta _ { i , j }$ , where $\delta _ { i , j }$ is the normalized edit distance between messages output by two senders, averaged across all objects in our evaluation set.
|
| 302 |
+
|
| 303 |
+
We report these metrics for both training partners and new partners. Note that high communication accuracy does not always entail similar languages: it is possible for the receivers to achieve high accuracy despite all senders sending different messages for any given object (it is only necessary for a given message to unambiguously refer to one object across senders).
|
| 304 |
+
|
| 305 |
+
# 5.2 Partitioning Enables Successful Zero-Shot Communication
|
| 306 |
+
|
| 307 |
+
In Table 1 and 2, we report accuracies and similarities for circular populations of 20 sender-receiver pairs trained on ImageNet and the Attribute/Values dataset. All metrics are calculated on the test set and averaged across 3 independent experiments.
|
| 308 |
+
|
| 309 |
+

|
| 310 |
+
Figure 3: Accuracy and language similarity as a function of the distance between two agents in the communication graph.
|
| 311 |
+
|
| 312 |
+

|
| 313 |
+
Figure 4: Evolution of validation accuracy during training across agent pairs at various distances in the communication graph. Results are aggregated over all agent pairs and 3 populations.
|
| 314 |
+
|
| 315 |
+
239 We observe that in populations following the standard training paradigm (Standard), there is a stark
|
| 316 |
+
240 discrepancy between training and new partners. Indeed, on both datasets the accuracy with training
|
| 317 |
+
241 partners reaches a very high value, above $9 5 \%$ . Yet, the accuracy when agents communicate with
|
| 318 |
+
242 new partners drops down to less than $1 0 \%$ . On the other hand, in Partitioned populations, agents
|
| 319 |
+
243 reach a much higher accuracy with non-neighbors, up to $9 6 \%$ on ImageNet and $4 0 \%$ . A similar trend
|
| 320 |
+
244 holds for language similarity.
|
| 321 |
+
|
| 322 |
+
Note that all metrics on new partners exhibit high standard deviation. An explanation is that among non-neighboring pairs there is a different behaviour depending on how far the two agents are in the population. This is verified in Figure 3, which displays a breakdown as a function of the distance between two agents in the communication graph (on ImageNet). We find that without partitioning, accuracy drops off sharply to close to 0 for agents at a distance $\geq 2$ , whereas it decreases almost linearly with the distance in the partitioned case, down to about $9 5 \%$ for the most distant agents.
|
| 323 |
+
|
| 324 |
+
# 5.3 Training dynamics
|
| 325 |
+
|
| 326 |
+
We further investigate the evolution of accuracies during training. In Figure 4, we plot the evaluation accuracies of both standard and partitioned populations broken down by distance between pairs, focusing on the ImageNet dataset. Note that there are two training phases in the standard case. Up to epoch $\approx 1 0$ , the accuracy for all training pairs increases, after which agents over-fit to their training partners (distances 0 and 1) and the accuracy on other pairs decreases to a plateau.
|
| 327 |
+
|
| 328 |
+
On the other hand, Figure 4b illustrates the pressure for mutual-intelligibility in partitioned populations: as accuracy between training pairs reaches close to $9 9 \%$ accuracy (around epoch 20), accuracies across distant pairs increases rapidly before plateauing above $9 0 \%$ . In fact, our results show that the most distant accuracies are still increasing after 150 epochs, albeit very slowly.
|
| 329 |
+
|
| 330 |
+

|
| 331 |
+
Figure 5: Influence of partitioning on the topographic similarity of the emergent languages.
|
| 332 |
+
|
| 333 |
+
# 261 6 Partitioned Population Develop More Compositional Languages
|
| 334 |
+
|
| 335 |
+
In this section, we investigate the effect of partitioning on the structure of the language, with a focus on compositionality.
|
| 336 |
+
|
| 337 |
+
# 6.1 Measuring Compositionality
|
| 338 |
+
|
| 339 |
+
A language is said to be compositional when the meaning of a whole utterance can be systematically deduced from the meaning of its components (i.e. words). The notion of compositionality is widely construed to underlay the near infinite productivity of human languages [55].
|
| 340 |
+
|
| 341 |
+
A common metric for measuring compositionality in emergent languages is the topographic similarity [5, 35]. Topographic similarity captures the intuition that a compositional language will map similar “meanings” to similar messages: the phrase “a red bird” is more similar to the phrase “a blue bird” than to “a powerful computer”. In practice, the topographic similarity is computed by measuring the Spearman rank correlation coefficient [52] between (1) the pairwise distances across all objects and (2) the pairwise distance across all messages.
|
| 342 |
+
|
| 343 |
+
# 6.2 Effect of Population Size on Compositionality
|
| 344 |
+
|
| 345 |
+
275 We run experiments on our Attribute/Values dataset, with both standard and partitioned populations
|
| 346 |
+
276 that are fully-connected (see Figure 2a). Population sizes range from 2 to 25 sender-receiver pairs.
|
| 347 |
+
277 We compute topographic similarity using the Hamming distance in the object space (i.e. the distance
|
| 348 |
+
278 between two objects is the number of attributes in which they differ) and the normalized edit distance
|
| 349 |
+
279 between messages.
|
| 350 |
+
|
| 351 |
+
In Figure 5a, we observe that while standard population-level training does increase the topographic similarity of the language overall, population size has very little effect: populations of sizes 3 and 20 both reach about the same value of 30 on average. On the other hand, partitioning greatly increases the effect of population size on compositionality: populations of size 20 have a significantly higher topographic similarity than populations of size 5, with a $\approx 1 0$ points difference.
|
| 352 |
+
|
| 353 |
+
# 6.3 Co-adaptation is Responsible for the Decrease in Compositionality
|
| 354 |
+
|
| 355 |
+
Up until this point, we have described partitioning (or lack thereof) as a binary choice. However, it is possible to partition a population only partially, by allowing receiver $j$ to train with senders $i \neq j$ occasionally with probability $\alpha > 0$ . In doing so, the optimal receiver now becomes the posterior associated with a mixture between $\pi _ { \theta _ { i } ^ { * } } ( m \mid x )$ and $\pi ^ { * } ( m \mid x )$ (see Appendix A for the derivation). If $0 < \alpha < 1$ , receivers are now optimizing for a different objective (as in partitioned populations), but some amount of co-adaptation is still allowed.
|
| 356 |
+
|
| 357 |
+
We perform this experiment on the Attribute/Values dataset with a fully connected population of size 10, varying the degree of co-adaptation $\alpha$ ranging in $\{ 0 , 0 . 1 , 0 . 5 , 0 . 9 , 1 \}$ . $\alpha = 0$ corresponds to partitioned training whereas $\alpha = 1$ is equivalent to standard training. All populations converge to $\bar { > } 9 9 \%$ accuracy. However, in Figure 5b we find that topographic similarity drops as soon as we introduce minimal amounts of co-adaptation ( $\alpha = 0 . 1$ ) and decreases steadily to the level of standard populations as $\alpha$ grows to 1. This further corroborates our hypothesis that reducing co-adaptation
|
| 358 |
+
|
| 359 |
+
98 promotes the emergence of a more structured language, and that eliminating it altogether (in a
|
| 360 |
+
99 partitioned population) yields the best results.
|
| 361 |
+
|
| 362 |
+
# 00 6.4 Importance of Mutual Intelligibility
|
| 363 |
+
|
| 364 |
+
Recall that the objective of a partitioned population at the equilibrium (Equation 6) can be decomposed in two terms: an “internal communication” corresponding to the single agent pair objective and a “mutual intelligibility” term which encourages senders to align their languages. Importantly, the latter is the only element that separates a partitioned population from a collection of isolated agents.
|
| 365 |
+
|
| 366 |
+
To measure its effect on the compositionality of the emergent language, we train fully connected populations of size 10 and decrease the relative weight of the mutual intelligibility term. This is implemented by making the pair $( \pi _ { \boldsymbol { \theta } _ { i } } , \rho _ { \boldsymbol { \theta } _ { i } } )$ more likely to be sampled than other pairs $( \pi _ { \boldsymbol { \theta } _ { i } } , \rho _ { \boldsymbol { \theta } _ { j } } )$ , $j \neq i$ by a factor $\times \frac { 1 - \beta } { \beta }$ . We let $\beta$ range from 0.5 (partitioned population) to 0.0 (collection of isolated sender-receiver pairs). In Figure 5c, we find that emergent languages retain high topographic similarity even at small $\beta$ , and the sharp drop-off occurs only when $\beta$ is very close to 0. This confirms that the mutual intelligibility term exerts a strong pressure towards compositionality. We investigate the evolution of the two terms during training in Appendix C.
|
| 367 |
+
|
| 368 |
+
# 313 7 Related Work
|
| 369 |
+
|
| 370 |
+
314 There is a rich history of modeling the emergence of language as the solution to a cooperative game
|
| 371 |
+
315 that can be traced back to functional theories of language [59, 2, 13]. With a regain of interest
|
| 372 |
+
316 for the study of language evolution [15, 12], a rich literature has developed around computational
|
| 373 |
+
317 simulations of the emergence of language based on simple language games [37, 51, 3, 6]. Examples
|
| 374 |
+
318 include studying evolutionary models of the emergence of grammar [44], the influence of cultural
|
| 375 |
+
319 transmission [5], game theoretical considerations [27] or linguistic diversity [39] among others.
|
| 376 |
+
|
| 377 |
+
The recent success of deep learning in natural language processing has spurred interest in studying signaling games between deep neural network trained with reinforcement learning to solve a signaling 22 game [34, 20]. Several follow-ups have taken this idea further by extending it to more complex games 3 or environment [53, 25, 28, 16] or by adding an element of competition [50, 43] or negotiation [7] or 4 even explicit pressure towards certain desirable properties [32, 11, 38, 48]. In parallel, several efforts 5 have been made to understand the properties of the emergent languages [4, 8, 9].
|
| 378 |
+
|
| 379 |
+
Within this growing literature, multiple authors have explicitly studied the use of populations of more than two agents. Various works have argued for augmenting populations with an explicit pressure towards more structure languages, via e.g. generational transmission [14], adversarial regularization [56], varying learning speeds [49] or imitation learning and voting [10]. Although the focus is often on fully-connected populations, some authors have also explored more complex communication graphs, for the purpose of modeling contact linguistics [24] or the effect of social network structure on the language [19]. Recent work from Kim and Oh [30] is perhaps closest to our own: the authors study the effect of population size and connectivity in the standard training paradigm. In contrast, the purpose of this paper is to highlight the impact of the training procedure on these very effects.
|
| 380 |
+
|
| 381 |
+
# 8 Conclusion
|
| 382 |
+
|
| 383 |
+
Empirical findings in socio-linguistics suggest that population dynamics should help in simple sender-receiver communication games. In this paper, we observed that populations trained by naively extending the simple 1-1 protocol to $N \times N$ agent pairs fail to exhibit some of the properties that are observed in human populations. Motivated by an analysis of populations at the equilibrium, we described an alternative training paradigm, based on agents partitioning to reduce co-adaptation. Empirically, we find that partitioning enables us to recover some of the aforementioned properties.
|
| 384 |
+
|
| 385 |
+
Our findings call attention to the fact that there is more than one way to generalize two single to many agents, and simple design choices can have a great impact on the training dynamics and ultimately the effect of population on the emergent language. Beyond emergent communication, we hope that this observation can inspire similar work in other cooperative multi-agent problems where co-adaptation between agents may counteract population effects.
|
| 386 |
+
|
| 387 |
+
References
|
| 388 |
+
[1] Anonymous. Emergent communication: Generalization and overfitting in lewis games. Under Review, 2022.
|
| 389 |
+
[2] John Langshaw Austin. How to do things with words. Harvard University Press, Cambridge, MA, 1962.
|
| 390 |
+
[3] John Batali. Computational simulations of the emergence of grammar. Approaches to the evolution of language: Social and cognitive bases, page 405, 1998.
|
| 391 |
+
[4] Diane Bouchacourt and Marco Baroni. How agents see things: On visual representations in an emergent language game. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 981–985, 2018.
|
| 392 |
+
[5] Henry Brighton and Simon Kirby. Understanding linguistic evolution by visualizing the emergence of topographic mappings. Artificial life, 12(2):229–242, 2006.
|
| 393 |
+
[6] Angelo Cangelosi and Domenico Parisi. Computer simulation: A new scientific approach to the study of language evolution. In Simulating the evolution of language, pages 3–28. Springer, 2002.
|
| 394 |
+
[7] Kris Cao, Angeliki Lazaridou, Marc Lanctot, Joel Z Leibo, Karl Tuyls, and Stephen Clark. Emergent communication through negotiation. In Proceedings of the International Conference on Learning Representations (ICLR), 2018.
|
| 395 |
+
[8] Rahma Chaabouni, Eugene Kharitonov, Emmanuel Dupoux, and Marco Baroni. Anti-efficient encoding in emergent communication. In Proceedings of the 33rd Annual Conference on Neural Information Processing Systems (NeurIPS), volume 32, 2019.
|
| 396 |
+
[9] Rahma Chaabouni, Eugene Kharitonov, Diane Bouchacourt, Emmanuel Dupoux, and Marco Baroni. Compositionality and generalization in emergent languages. In Proceedings of the 8th Annual Meeting of the Association for Computational Linguistics (ACL), pages 4427–4442, 2020.
|
| 397 |
+
[10] Rahma Chaabouni, Florian Strub, Florent Altché, Eugene Tarassov, Corentin Tallec, Elnaz Davoodi, Kory Wallace Mathewson, Olivier Tieleman, Angeliki Lazaridou, and Bilal Piot. Emergent communication at scale. In Proceedings of the International Conference on Learning Representations (ICLR), 2022.
|
| 398 |
+
[11] Edward Choi, Angeliki Lazaridou, and Nando de Freitas. Compositional obverter communication learning from raw visual input. In Proceedings of the International Conference on Learning Representations (ICLR), 2018.
|
| 399 |
+
[12] Morten H Christiansen and Simon Ed Kirby. Language evolution. Oxford University Press, 2003.
|
| 400 |
+
[13] Hebert Clark. Using Language. Cambridge University Press, Cambridge, UK, 1996.
|
| 401 |
+
[14] Michael Cogswell, Jiasen Lu, Stefan Lee, Devi Parikh, and Dhruv Batra. Emergence of compositional language with deep generational transmission. arXiv preprint arXiv:1904.09067, 2019.
|
| 402 |
+
[15] Vincent P Crawford and Joel Sobel. Strategic information transmission. Econometrica: Journal of the Econometric Society, pages 1431–1451, 1982.
|
| 403 |
+
[16] Abhishek Das, Théophile Gervet, Joshua Romoff, Dhruv Batra, Devi Parikh, Mike Rabbat, and Joelle Pineau. Tarmac: Targeted multi-agent communication. In Proceedings of the 36th International Conference on Machine Learning (ICML), pages 1538–1546. PMLR, 2019.
|
| 404 |
+
[17] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Proceedings of the 22nd IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 248–255, 2009.
|
| 405 |
+
[18] Roberto Dessì, Eugene Kharitonov, and Marco Baroni. Interpretable agent communication from scratch (with a generic visual processor emerging on the side). arXiv preprint arXiv:2106.04258, 2021.
|
| 406 |
+
[19] Marina Dubova, Arsenii Kirillovich Moskvichev, and Rob Goldstone. Reinforcement communication learning in different social network structures. In Language in Reinforcement Learning Workshop 2020, 2020.
|
| 407 |
+
[20] Jakob Foerster, Ioannis Alexandros Assael, Nando De Freitas, and Shimon Whiteson. Learning to communicate with deep multi-agent reinforcement learning. In Annual Conference on Neural Information Processing Systems (NIPS), volume 29, 2016.
|
| 408 |
+
[21] Lukas Galke, Yoav Ram, and Limor Raviv. Emergent communication for understanding human language evolution: What’s missing? In Emergent Communication Workshop at ICLR 2022, 2022.
|
| 409 |
+
[22] Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent-a new approach to self-supervised learning. In Proceedings of the 34th Annual Conference on Neural Information Processing Systems (NeurIPS), volume 33, pages 21271–21284, 2020.
|
| 410 |
+
[23] Abhinav Gupta, Marc Lanctot, and Angeliki Lazaridou. Dynamic population-based metalearning for multi-agent communication with natural language. In Proceedings of the 35th Annual Conference on Neural Information Processing Systems (NeurIPS), volume 34, 2021.
|
| 411 |
+
[24] Laura Harding Graesser, Kyunghyun Cho, and Douwe Kiela. Emergent linguistic phenomena in multi-agent communication games. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 3700–3710, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1384. URL https://aclanthology.org/D19-1384.
|
| 412 |
+
[25] Serhii Havrylov and Ivan Titov. Emergence of language with multi-agent games: Learning to communicate with sequences of symbols. In Proceedings of the 31st Annual Conference on Neural Information Processing Systems (NIPS), volume 30, 2017.
|
| 413 |
+
[26] Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735–1780, 1997.
|
| 414 |
+
[27] Simon Huttegger, Brian Skyrms, Pierre Tarres, and Elliott Wagner. Some dynamics of signaling games. Proceedings of the National Academy of Sciences, 111(Supplement 3):10873–10880, 2014.
|
| 415 |
+
[28] Natasha Jaques, Angeliki Lazaridou, Edward Hughes, Caglar Gulcehre, Pedro Ortega, DJ Strouse, Joel Z Leibo, and Nando De Freitas. Social influence as intrinsic motivation for multi-agent deep reinforcement learning. In Proceedings of the 36th International Conference on Machine Learning (ICML), pages 3040–3049. PMLR, 2019.
|
| 416 |
+
[29] Eugene Kharitonov, Roberto Dessì, Rahma Chaabouni, Diane Bouchacourt, and Marco Baroni. EGG: a toolkit for research on Emergence of lanGuage in Games. https://github.com/ facebookresearch/EGG, 2021.
|
| 417 |
+
[30] Jooyeon Kim and Alice Oh. Emergent communication under varying sizes and connectivities. In Proceedings of the 35th Annual Conference on Neural Information Processing Systems (NeurIPS), volume 34, 2021.
|
| 418 |
+
[31] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proceedings of the International Conference on Learning Representations (ICLR), 2014.
|
| 419 |
+
[32] Satwik Kottur, José Moura, Stefan Lee, and Dhruv Batra. Natural language does not emerge ‘naturally’in multi-agent dialog. In Proceedings of the 2017 Conference on Empirical Methods in Natural Language Processing (EMNLP), pages 2962–2967, 2017.
|
| 420 |
+
[33] Angeliki Lazaridou and Marco Baroni. Emergent multi-agent communication in the deep learning era. arXiv preprint arXiv:2006.02419, 2020.
|
| 421 |
+
[34] Angeliki Lazaridou, Alexander Peysakhovich, and Marco Baroni. Multi-agent cooperation and the emergence of (natural) language. In Proceedings of the International Conference on Learning Representations (ICLR), 2017.
|
| 422 |
+
[35] Angeliki Lazaridou, Karl Moritz Hermann, Karl Tuyls, and Stephen Clark. Emergence of linguistic communication from referential games with symbolic and pixel input. In Proceedings of the International Conference on Learning Representations (ICLR), 2018.
|
| 423 |
+
[36] Angeliki Lazaridou, Anna Potapenko, and Olivier Tieleman. Multi-agent communication meets natural language: Synergies between functional and structural language learning. In Proceedings of the 8th Annual Meeting of the Association for Computational Linguistics (ACL), pages 7663–7674, 2020.
|
| 424 |
+
453 [37] David Lewis. Convention: A philosophical study. John Wiley & Sons, 1969.
|
| 425 |
+
454 [38] Fushan Li and Michael Bowling. Ease-of-teaching and language structure from emergent communication. In Proceedings of the 33rd Annual Conference on Neural Information Processing Systems (NeurIPS), volume 32, 2019.
|
| 426 |
+
457 [39] Daniel Livingstone and Colin Fyfe. Modelling the evolution of linguistic diversity. In European Conference on Artificial Life, pages 704–708. Springer, 1999. [40] George A Miller. Wordnet: a lexical database for english. Communications of the ACM, 38(11): 39–41, 1995. [41] Igor Mordatch and Pieter Abbeel. Emergence of grounded compositional language in multiagent populations. In Proceedings of the 32nd Meeting of the Association for Advancement of Artificial Intelligence (AAAI), volume 32, 2018.
|
| 427 |
+
464 [42] Jonas Nölle, Riccardo Fusaroli, Gregory J Mills, and Kristian Tylén. Language as shaped by the environment: linguistic construal in a collaborative spatial task. Palgrave Communications, 6(1):1–10, 2020. [43] Michael Noukhovitch, Travis LaCroix, Angeliki Lazaridou, and Aaron Courville. Emergent communication under competition. In Proceedings of the 20th International Conference on Autonomous Agents and MultiAgent Systems, pages 974–982, 2021. [44] Martin A Nowak and Natalia L Komarova. Towards an evolutionary theory of language. Trends in cognitive sciences, 5(7):288–295, 2001.
|
| 428 |
+
472 [45] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. [46] Martin J. Osborne and Ariel Rubinstein. A Course in Game Theory. The MIT Press, 1994. ISBN 0262150417.
|
| 429 |
+
476 [47] Limor Raviv, Antje Meyer, and Shiri Lev-Ari. Larger communities create more systematic languages. Proceedings of the Royal Society B, 286(1907):20191262, 2019. [48] Yi Ren, Shangmin Guo, Serhii Havrylov, Shay Cohen, and Simon Kirby. Enhance the compositionality of emergent language by iterated learning. In 3rd NeurIPS Workshop on Emergent Communication (EmeCom@ NeurIPS 2019). URL https://papers. nips. cc/book/advances-inneural-information-processing-systems-32-2019, 2019. [49] Mathieu Rita, Florian Strub, Jean-Bastien Grill, Olivier Pietquin, and Emmanuel Dupoux. On the role of population heterogeneity in emergent communication. In Proceedings of the International Conference on Learning Representations (ICLR), 2022. [50] Amanpreet Singh, Tushar Jain, and Sainbayar Sukhbaatar. Learning when to communicate at scale in multiagent cooperative and competitive tasks. In Proceedings of the International Conference on Learning Representations (ICLR), 2018.
|
| 430 |
+
[51] Brian Skyrms. Signals: Evolution, learning, and information. OUP Oxford, 2010.
|
| 431 |
+
489 [52] C Spearman. The proof and measurement of association between two things. The American Journal of Psychology, 1904. [53] Sainbayar Sukhbaatar, Rob Fergus, et al. Learning multiagent communication with backpropagation. In Proceedings of the 30th Annual Conference on Neural Information Processing Systems (NIPS), volume 29, 2016. [54] Richard S Sutton, David McAllester, Satinder Singh, and Yishay Mansour. Policy gradient methods for reinforcement learning with function approximation. Proceedings of the 13th Annual Conference on Neural Information Processing Systems (NIPS), 12, 1999. [55] Zoltán Gendler Szabó. Compositionality. In Edward N. Zalta, editor, The Stanford Encyclopedia of Philosophy. 2020. URL https://plato.stanford.edu/archives/fall2020/ entries/compositionality/. Accessed: 2022-05-13. [56] Olivier Tieleman, Angeliki Lazaridou, Shibl Mourad, Charles Blundell, and Doina Precup. Community size effect in artificial learning systems. In ViGIL@ NeurIPS, 2019. [57] Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3):229–256, 1992.
|
| 432 |
+
[58] Ronald J Williams and Jing Peng. Function optimization using connectionist reinforcement learning algorithms. Connection Science, 3(3):241–268, 1991.
|
| 433 |
+
[59] Ludwig Wittgenstein. Philosophical Investigations. Blackwell, Oxford, UK, 1953. Translated by G.E.M. Anscombe.
|
| 434 |
+
|
| 435 |
+
# Checklist
|
| 436 |
+
|
| 437 |
+
1. For all authors...
|
| 438 |
+
|
| 439 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 440 |
+
(b) Did you describe the limitations of your work? [Yes] The marginal computational overhead incurred by training partitioned populations is described in details in Section 4.3
|
| 441 |
+
(c) Did you discuss any potential negative societal impacts of your work? [No] As our work primarily focuses on artificial languages developed by simple agents, we do not expect any immediate negative societal impact.
|
| 442 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 443 |
+
|
| 444 |
+
2. If you are including theoretical results...
|
| 445 |
+
|
| 446 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] (b) Did you include complete proofs of all theoretical results? [Yes] Derivations are provided in appendices
|
| 447 |
+
|
| 448 |
+
3. If you ran experiments...
|
| 449 |
+
|
| 450 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [No] Code to reproduce our experiments will be released upon deanonymization.
|
| 451 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
|
| 452 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes]
|
| 453 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [No] Our work was carried out on GPUs located on an institutional cluster. Each experiment runs on a single V100-32G GPU
|
| 454 |
+
|
| 455 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 456 |
+
|
| 457 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] The ImageNet paper was cited
|
| 458 |
+
(b) Did you mention the license of the assets? [No] We were not able to find the license of ImageNet
|
| 459 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 460 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 461 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 462 |
+
|
| 463 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 464 |
+
|
| 465 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 466 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 467 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
| 468 |
+
|
| 469 |
+
# 53 A Derivation of the Optimal Receiver
|
| 470 |
+
|
| 471 |
+
We first prove a more general result from which the optimal receiver both in the standard and partitioned can be derived.
|
| 472 |
+
|
| 473 |
+
# A.1 General Case
|
| 474 |
+
|
| 475 |
+
557 Consider a receiver $j$ trained to maximize
|
| 476 |
+
|
| 477 |
+
$$
|
| 478 |
+
J _ { r , j } ( \psi _ { j } ) = \sum _ { i \in \mathrm { s e n d e r s } } \alpha _ { i } J _ { r , i j } ( \psi _ { j } )
|
| 479 |
+
$$
|
| 480 |
+
|
| 481 |
+
558 where $\alpha _ { i = 1 \dots n }$ are arbitrary weights for the senders (we assume that the $\alpha _ { i }$ are positive and sum to
|
| 482 |
+
559 one). We can rewrite the objective as:
|
| 483 |
+
|
| 484 |
+
$$
|
| 485 |
+
\begin{array} { l } { { \displaystyle { J _ { r , j } } ( \psi _ { j } ) = \sum _ { i \in \mathrm { s e n d e r s } } \alpha _ { i } J _ { r , i \to j } ( \psi _ { j } ) } } \\ { { \displaystyle \ = \sum _ { i \in \mathrm { s e n d e r s } } \alpha _ { i } \mathbb { E } _ { m \sim \pi _ { \theta _ { i } } ( \cdot \vert x ) } \log \rho _ { \psi _ { j } } ( x \mid m ) } } \end{array}
|
| 486 |
+
$$
|
| 487 |
+
|
| 488 |
+
560 Note that by linearity of expectation we can pass the $\alpha _ { i }$ weighted average over the senders inside
|
| 489 |
+
561 of the expectation and rewrite the second expectation in terms of the mixture $\pi _ { \alpha } ^ { * } ( m \mid x ) : =$
|
| 490 |
+
562 $\begin{array} { r } { \sum _ { i \in \mathrm { s e n d e r s } } { \stackrel { \cdot } { \alpha } } \alpha _ { i } \pi _ { \theta _ { i } ^ { * } } ( m \mid x ) } \end{array}$ :
|
| 491 |
+
|
| 492 |
+
$$
|
| 493 |
+
\begin{array} { r l } & { J _ { r , j } ( \psi _ { j } ) = \mathbb { E } _ { x \sim p } \mathbb { E } _ { m \sim \sum _ { i \in \mathrm { s e n d e r s } } \alpha _ { i } \pi _ { \theta _ { i } ^ { * } } ( m | x ) } \log \rho _ { \psi _ { j } } ( x \mid m ) } \\ & { \phantom { a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a } } \\ & { \phantom { a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a } = \mathbb { E } _ { x \sim p } \mathbb { E } _ { m \sim \pi \sim \pi ^ { * } \alpha ( \cdot | x ) } \log \rho _ { \psi _ { j } } ( x \mid m ) } \end{array}
|
| 494 |
+
$$
|
| 495 |
+
|
| 496 |
+
563 With slight abuse of notation, let us now denote by $\pi _ { \alpha } ^ { * } ( m ) : = \mathbb { E } _ { x \sim p } \pi _ { \alpha } ^ { * } ( m \mid x )$ the marginal
|
| 497 |
+
564 distribution over messages and $\textstyle \pi _ { \alpha } ^ { * } ( x \mid m ) : = { \frac { \pi _ { \alpha } ^ { * } ( m | x ) p ( x ) } { \pi _ { \alpha } ^ { * } ( m ) } }$ the associated posterior. Notice that
|
| 498 |
+
565 since by definition $\pi _ { \alpha } ^ { * } ( m \mid x ) p ( x ) = \pi _ { \alpha } ^ { * } ( x \mid m ) \pi _ { \alpha } ^ { * } ( m )$ , we can rewrite the double expectation
|
| 499 |
+
566 $\mathbb { E } _ { x \sim p } \mathbb { E } _ { m \sim \pi _ { \alpha } ^ { * } ( \cdot | x ) }$ as $\mathbb { E } _ { m \sim \pi _ { \alpha } ^ { * } ( \cdot ) } \mathbb { E } _ { x \sim \pi _ { \alpha } ^ { * } ( \cdot | m ) }$ by inverting the order of summation. We can therefore
|
| 500 |
+
567 rewrite
|
| 501 |
+
|
| 502 |
+
$$
|
| 503 |
+
J _ { r , j } ( \psi _ { j } ) = \mathbb { E } _ { m \sim \pi _ { \alpha } ^ { * } ( \cdot ) } \mathbb { H } ( \pi _ { \alpha } ^ { * } ( \cdot \mid m ) , \rho _ { \psi _ { j } } ( \cdot \mid m ) )
|
| 504 |
+
$$
|
| 505 |
+
|
| 506 |
+
568 where $\mathbb { H } ( p , q )$ denotes the cross-entropy $\mathbb { E } _ { q } \left[ - \log p \right]$ of two distributions $p$ and $q$ . Importantly the
|
| 507 |
+
569 cross-entropy is non-negative and $\mathbb { H } ( p , q ) \overset { \cdot } { = } 0$ if and only if $p = q$ .
|
| 508 |
+
|
| 509 |
+
Consequently, the receiver $\rho _ { \psi }$ will be optimal $( J _ { r , j } ( \psi _ { j } ) = 0$ ) if and only if for all $m$ :2
|
| 510 |
+
|
| 511 |
+
$$
|
| 512 |
+
\rho _ { \psi _ { j } ^ { * } } ( x \mid m ) = \pi _ { \alpha } ^ { * } ( x \mid m ) = \frac { \pi _ { \alpha } ^ { * } ( m \mid x ) p ( x ) } { \mathbb { E } _ { y \sim p } \pi _ { \alpha } ^ { * } ( m \mid y ) } .
|
| 513 |
+
$$
|
| 514 |
+
|
| 515 |
+
# A.2 Optimal Receiver in Standard Populations
|
| 516 |
+
|
| 517 |
+
573 Recall that in standard populations, the training objective for receiver $j$ is:
|
| 518 |
+
|
| 519 |
+
$$
|
| 520 |
+
J _ { r , j } ( \psi _ { j } ) = \frac { 1 } { | \mathcal { N } _ { G } ( j ) | } \sum _ { i \in \mathcal { N } _ { G } ( j ) } J _ { r , i j } ( \psi _ { j } ) .
|
| 521 |
+
$$
|
| 522 |
+
|
| 523 |
+
574 Note that this is a special case of Equation 7 with
|
| 524 |
+
|
| 525 |
+
$$
|
| 526 |
+
\alpha _ { i } = \left\{ \begin{array} { l l } { \frac { 1 } { | \mathcal { N } _ { G } ( j ) | } } & { \mathrm { i f } i \in \mathcal { N } _ { G } ( j ) } \\ { 0 } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 527 |
+
$$
|
| 528 |
+
|
| 529 |
+
2More accurately, if the message space is not finite then the condition holds not for all $m$ , but almost surely. However throughout the paper we are experimenting with finite (albeit large) message spaces.
|
| 530 |
+
|
| 531 |
+
575 Consequently, the derivation in Section A.1 tells us that the optimal receiver is
|
| 532 |
+
|
| 533 |
+
$$
|
| 534 |
+
\begin{array} { c } { { \rho _ { \psi _ { j } ^ { * } } ( x \mid m ) = \pi _ { N _ { G } ( j ) } ^ { * } ( x \mid m ) = \frac { \pi _ { N _ { G } ( j ) } ^ { * } ( m \mid x ) p ( x ) } { \mathbb { E } _ { y \sim p } \pi _ { N _ { G } ( j ) } ^ { * } ( m \mid y ) } . } } \\ { { \pi _ { N _ { G } ( j ) } ^ { * } ( m \mid x ) : = \frac { 1 } { | \mathcal { N } _ { G } ( j ) | } \sum _ { i \in \mathcal { N } _ { G } ( j ) } \pi _ { \theta _ { i } ^ { * } } ( m \mid x ) } } \end{array}
|
| 535 |
+
$$
|
| 536 |
+
|
| 537 |
+
Where 576
|
| 538 |
+
|
| 539 |
+
# A.3 Optimal Receiver in Partitioned Populations
|
| 540 |
+
|
| 541 |
+
578 In partitioned populations, the training objective for receiver $j$ is:
|
| 542 |
+
|
| 543 |
+
$$
|
| 544 |
+
J _ { r , j } ( \psi _ { j } ) = J _ { r , j j } ( \psi _ { j } ) .
|
| 545 |
+
$$
|
| 546 |
+
|
| 547 |
+
579 This is also a special case of Equation 7 with
|
| 548 |
+
|
| 549 |
+
$$
|
| 550 |
+
\alpha _ { i } = { \left\{ \begin{array} { l l } { 1 } & { { \mathrm { i f ~ } } i = j } \\ { 0 } & { { \mathrm { o t h e r w i s e } } } \end{array} \right. }
|
| 551 |
+
$$
|
| 552 |
+
|
| 553 |
+
580 The derivation in Section A.1 thus yields the optimal receiver
|
| 554 |
+
|
| 555 |
+
$$
|
| 556 |
+
\rho _ { \psi _ { j } ^ { * } } ( x \mid m ) = \pi _ { j } ^ { * } ( x \mid m ) = \frac { \pi _ { j } ^ { * } ( m \mid x ) p ( x ) } { \mathbb { E } _ { y \sim p } \pi _ { j } ^ { * } ( m \mid y ) } .
|
| 557 |
+
$$
|
| 558 |
+
|
| 559 |
+
# 81 A.4 Optimal Receiver in Partially Partitioned Populations
|
| 560 |
+
|
| 561 |
+
582 In the partially partitioned populations used in Section 6.3, each receiver’s objective is a mixture
|
| 562 |
+
583 between the standard and partitioned objective. This can also be rewritten as a special case of
|
| 563 |
+
584 Equation 7 with
|
| 564 |
+
|
| 565 |
+
$$
|
| 566 |
+
\alpha _ { i } = \left\{ \begin{array} { l l } { 1 - \alpha + \frac { \alpha } { | \mathcal { N } _ { G } ( j ) | } } & { \mathrm { i f } i = j } \\ { \frac { \alpha } { | \mathcal { N } _ { G } ( j ) | } } & { \mathrm { i f } i \in \mathcal { N } _ { G } ( j ) \setminus \{ i \} } \\ { 0 } & { \mathrm { o t h e r w i s e } } \end{array} \right.
|
| 567 |
+
$$
|
| 568 |
+
|
| 569 |
+
585 The optimal receiver can then be rewritten as the posterior distribution associated with the mixture
|
| 570 |
+
586 sender
|
| 571 |
+
|
| 572 |
+
$$
|
| 573 |
+
\alpha \times + ( 1 - \alpha ) \times \pi _ { j } ^ { * } ( x \mid m )
|
| 574 |
+
$$
|
| 575 |
+
|
| 576 |
+
# 587 B The Case of Referential Games
|
| 577 |
+
|
| 578 |
+
In the analysis from Section 2.2 onward, we assumed ${ \mathcal { C } } = { \mathcal { X } }$ to simplify notation. We can relax this assumption without changing our key observation that all receivers are the same at the optimum.
|
| 579 |
+
|
| 580 |
+
590 Indeed, in this case the receiver’s objective in a standard population is:
|
| 581 |
+
|
| 582 |
+
$$
|
| 583 |
+
\begin{array} { r l } & { J _ { r , j } ( \psi _ { j } ) = \cfrac { 1 } { \lvert \mathcal { N } _ { G } ( j ) \rvert } \displaystyle \sum _ { i \in \mathcal { N } _ { G } ( j ) } J _ { r , i j } ( \psi _ { j } ) } \\ & { \quad = \cfrac { 1 } { \lvert \mathcal { N } _ { G } ( j ) \rvert } \displaystyle \sum _ { i \in \mathcal { N } _ { G } ( j ) } \mathbb { E } _ { x \sim p } \mathbb { E } _ { m \sim \pi _ { \theta _ { i } } ( \cdot \vert x ) } \mathbb { E } _ { \mathcal { C } \sim p } \log \rho _ { \psi _ { j } } ( x \mid m , C ) } \\ & { \quad = \mathbb { E } _ { x \sim p } \mathbb { E } _ { m \sim \pi _ { \mathcal { N } _ { G } ( j ) } ^ { * } ( \cdot \vert x ) } \mathbb { E } _ { \mathcal { C } \sim p } \log \rho _ { \psi _ { j } } ( x \mid m , \mathcal { C } ) } \end{array}
|
| 584 |
+
$$
|
| 585 |
+
|
| 586 |
+
591 This objective, called InfoNCE [45] also has an analytical solution that can be expressed as a function of 592 $\pi _ { \mathcal { N } _ { G } ( j ) } ^ { * }$ , of the form:
|
| 587 |
+
|
| 588 |
+
$$
|
| 589 |
+
\rho _ { \psi _ { j } ^ { * } } ( x \mid m , \mathcal { C } ) = \frac { \frac { \pi _ { N _ { G } ( j ) } ^ { * } ( x \mid m ) } { p ( x ) } } { \sum _ { y \in \mathcal { C } } \frac { \pi _ { N _ { G } ( j ) } ^ { * } ( y \mid m ) } { p ( y ) } }
|
| 590 |
+
$$
|
| 591 |
+
|
| 592 |
+
593 Despite the more complicated form of the optimal receiver, the key ingredients to our analysis
|
| 593 |
+
594 in Sections 2.2 and 3 are preserved: at the optimum, each receiver is a function of the posterior
|
| 594 |
+
595 $\pi _ { \mathcal { N } _ { G } ( j ) } ( x \mid m )$ associated with the communication partners to which it co-adapts. A similar analysis
|
| 595 |
+
596 in partitioned populations shows that the optimum for receiver $j$ then only depends on the posterior
|
| 596 |
+
597 associated with its respective sender $\pi _ { \theta _ { j } ^ { * } }$ instead.
|
| 597 |
+
|
| 598 |
+

|
| 599 |
+
Figure 6: Evolution of internal communication and mutual intelligibility terms with different weightings $\beta$ (populations of size 10).
|
| 600 |
+
|
| 601 |
+
# 598 C Further Analysis of the Effect of Mutual Intelligibility
|
| 602 |
+
|
| 603 |
+
599 In Section 6.4, we find that languages stay highly compositional until the mutual intelligibility weight
|
| 604 |
+
600 $\beta$ is decreased to almost 0. Our hypothesis is that even with small amounts of mutual intelligibility,
|
| 605 |
+
601 agents will eventually have to optimize this part of the objective after they have maximized their
|
| 606 |
+
602 respective internal communication to the point where the main contributor to the training gradient is
|
| 607 |
+
603 the mutual intelligibility term.
|
| 608 |
+
604 To verify this hypothesis, in Figure 6 we report the evolution of both internal communication and
|
| 609 |
+
605 mutual intelligibility losses during training for various values of the mutual intelligibility weight
|
| 610 |
+
606 $\beta$ . As expected, we observe that for all but very small values of $\beta$ , the mutual intelligibility loss
|
| 611 |
+
607 eventually decreases (although it decreases faster for high $\beta$ ).
|
md/dev/MWoZh1gvbxA/MWoZh1gvbxA.md
ADDED
|
@@ -0,0 +1,422 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# HIDDEN POISON: MACHINE UNLEARNING ENABLES CAMOUFLAGED POISONING ATTACKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We introduce camouflaged data poisoning attacks, a new attack vector that arises in the context of machine unlearning and other settings when model retraining may be induced. An adversary first adds a few carefully crafted points to the training dataset such that the impact on the model’s predictions is minimal. The adversary subsequently triggers a request to remove a subset of the introduced points at which point the attack is unleashed and the model’s predictions are negatively affected. In particular, we consider clean-label targeted attacks (in which the goal is to cause the model to misclassify a specific test point) on datasets including CIFAR-10, Imagenette, and Imagewoof. This attack is realized by constructing camouflage datapoints that mask the effect of a poisoned dataset.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Machine Learning (ML) research traditionally assumes a static pipeline: data is gathered, a model is trained once and subsequently deployed. This paradigm has been challenged by practical deployments, which are more dynamic in nature. After initial deployment more data may be collected, necessitating additional training. Or, as in the machine unlearning setting (Cao & Yang, 2015), we may need to produce a model as if certain points were never in the training set to begin with.1
|
| 12 |
+
|
| 13 |
+
While such dynamic settings clearly increase the applicability of ML models, they also make them more vulnerable. Specifically, they open models up to new methods of attack by malicious actors aiming to sabotage the model. In this work, we introduce a new type of data poisoning attack on models that unlearn training datapoints. We call these camouflaged data poisoning attacks.
|
| 14 |
+
|
| 15 |
+
The attack takes place in two phases. In the first stage, before the model is trained, the attacker adds a set of carefully designed points to the training data, consisting of a poison set and a camouflage set. The model’s behaviour should be similar whether it is trained on either the training data, or its augmentation with both the poison and camouflage sets. In the second phase, after the model is trained, the attacker triggers an unlearning request to delete the camouflage set. That is, the model must be updated to behave as though it were only trained on the training set plus the poison set. At this point, the attack is fully realized, and the model’s performance suffers in some way.
|
| 16 |
+
|
| 17 |
+
While such an attack could harm the model by several metrics, in this paper, we focus on targeted poisoning attacks – that is, poisoning attacks where the goal is to misclassify one particular point in the training set. Our contributions are the following:
|
| 18 |
+
|
| 19 |
+
1. We introduce camouflaged data poisoning attacks, demonstrating a new attack vector in dynamic settings including machine unlearning.
|
| 20 |
+
2. We realize these attacks in the targeted poisoning setting, giving an algorithm based on the gradient-matching approach of Geiping et al. (2021). In order to make the model behavior comparable to as if the poison set were absent, we construct the camouflage set by generating a new set of points that undoes the impact of the poison set, an idea which may be of broader interest to the data poisoning community.
|
| 21 |
+
3. We demonstrate the efficacy of these attacks on a variety of models (SVMs and neural networks) and datasets (CIFAR-10 (Krizhevsky, 2009), Imagenette (Howard, 2019), and Imagewoof (Howard, 2019)).
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: An illustration of a successful camouflaged targeted data poisoning attack. In Step 1, the adversary adds poison and camouflage sets of points to the (clean) training data. In Step 2, the model is trained on the augmented training dataset. It should behave similarly to if trained on only the clean data; in particular, it should correctly classify the targeted point. In Step 3, the adversary triggers an unlearning request to delete the camouflage set from the trained model. In Step 4, the resulting model misclassifies the targeted point.
|
| 25 |
+
|
| 26 |
+

|
| 27 |
+
Figure 2: Some representative images from Imagewoof. In each pair, the left figure is from the training dataset, while the right image has been adversarially manipulated. The top and bottom rows are images from the poison and camouflage set, respectively. In all cases, the manipulated images are clean label and nearly indistinguishable from the original image.
|
| 28 |
+
|
| 29 |
+
# 1.1 PRELIMINARIES
|
| 30 |
+
|
| 31 |
+
Machine Unlearning. A significant amount of legislation concerning the “right to be forgotten” has recently been introduced by governments around the world, including the European Union’s General Data Protection Regulation (GDPR), the California Consumer Privacy Act (CCPA), and Canada’s proposed Consumer Privacy Protection Act (CPPA). Such legislation requires organizations to delete information they have collected about a user upon request. A natural question is whether that further obligates the organizations to remove that information from downstream machine learning models trained on the data – current guidances (Information Commissioner’s Office, 2020) and precedents (Federal Trade Commission, 2021) indicate that this may be the case. This goal has sparked a recent line of work on machine unlearning (Cao & Yang, 2015).
|
| 32 |
+
|
| 33 |
+
The simplest way to remove a user’s data from a trained model is to remove the data from the training set, and then retrain the model on the remainder (also called “retraining from scratch”). This is the ideal way to perform data deletion, as it ensures that the model was never trained on the datapoint of concern. The downside is that retraining may take a significant amount of time in modern machine learning settings. Hence, most work within machine unlearning has studied fast methods for data deletion, sometimes relaxing to approximately removing the datapoint. A related line of work has focused more on other implications of machine unlearning, particularly the consequences of an adaptive and dynamic data pipeline (Gupta et al., 2021; Marchant et al., 2022). Our work fits into the latter line: we show that the potential to remove points from a trained model can expose a new attack vector. Since retraining from scratch is the ideal result that other methods try to emulate, we focus on unlearning by retraining from scratch, but the same phenomena should still occur when any effective machine unlearning algorithm is applied.
|
| 34 |
+
|
| 35 |
+
Data Poisoning. In a data poisoning attack, an adversary in some way modifies the training data provided to a machine learning model, such that the model’s behaviour at test time is negatively impacted. Our focus is on targeted data poisoning attacks, where the attacker’s goal is to cause the model to misclassify some specific datapoint in the test set. Other common types of data poisoning attacks include indiscriminate (in which the goal is to increase the test error) and backdoor (where the goal is to misclassify test points which have been adversarially modified in some small way).
|
| 36 |
+
|
| 37 |
+
The adversary is typically limited in a couple ways. First, it is common to say that they can only add a small number of points to the training set. This mimics the setting where the training data is gathered from some large public crowdsourced dataset, and an adversary can contribute a few judiciously selected points of their own. Other choices may include allowing them to modify or delete points from the training set, but these are less easily motivated. Additionally, the adversary is generally constrained to clean-label attacks: if the introduced points were inspected by a human, they should not appear suspicious or incorrectly labeled. We comment that this criteria is subjective and thus not a precise notion, but is nonetheless common in the data poisoning literature, and we use the term as well.
|
| 38 |
+
|
| 39 |
+
# 1.2 RELATED WORK
|
| 40 |
+
|
| 41 |
+
The motivation for our work comes from Marchant et al. (2022), who propose a novel poisoning attack on unlearning systems. As mentioned before, the primary goal of many machine unlearning systems is to “unlearn” datapoints quickly, i.e., faster than retraining from scratch. Marchant et al. (2022) craft poisoning schemes via careful noise addition, in order to trigger the unlearning algorithm to retrain from scratch on far more deletion requests than typically required. While both our work and theirs are focused on data poisoning attacks against machine unlearning systems, the adversaries have very different objectives. In our work, the adversary is trying to misclassify a target test point, whereas in theirs, they try to increase the time required to unlearn a point.
|
| 42 |
+
|
| 43 |
+
In targeted data poisoning, there are a few different types of attacks. The simplest form of attack is label flipping, in which the adversary is allowed to flip the labels of the examples (Barreno et al., 2010; Xiao et al., 2012; Paudice et al., 2018). Another type of attack is watermarking, in which the feature vectors are perturbed to obtain the desired poisoning effect (Suciu et al., 2018; Shafahi et al., 2018). In both these cases, noticeable changes are made to the label and feature vector, respectively, which would be noticeable by a human labeler. In contrast, clean label attacks attempt to make unnoticeable changes to both the feature vector and the label, and are the gold standard for data poisoning attacks (Huang et al., 2020; Geiping et al., 2021). Our focus is on both clean-label poisoning and camouflage sets. While there are also works on indiscriminate (Biggio et al., 2012; Xiao et al., 2015; Munoz-Gonz˜ alez et al.´ , 2017; Steinhardt et al., 2017; Diakonikolas et al., 2019; Koh et al., 2022) and backdoor (Gu et al., 2017; Tran et al., 2018; Sun et al., 2019) poisoning attacks, these are beyond the scope of our work, see Goldblum et al. (2020); Cina et al.\` (2022) for additional background on data poisoning attacks.
|
| 44 |
+
|
| 45 |
+
Cao & Yang (2015) initiated the study of machine unlearning through exact unlearning, wherein the new model obtained after deleting an example is statistically identical to the model obtained by training on a dataset without the example. A probabilistic notion of unlearning was defined by Ginart et al. (2019), which in turn is inspired from notions in differential privacy (Dwork et al., 2006). Several works studied algorithms for empirical risk minimization (i.e., training loss) (Guo et al.,
|
| 46 |
+
|
| 47 |
+
2020; Izzo et al., 2021; Neel et al., 2021; Ullah et al., 2021), while later works study the effect of machine unlearning on the generalization loss (Gupta et al., 2021; Sekhari et al., 2021). In particular, these works realize that unlearning data points quickly can lead to a drop in test loss, which is the theme of our current work. Several works have considered implementations of machine unlearning in several contexts starting with the work of Bourtoule et al. (2021). These include unlearning in deep neural networks (Golatkar et al., 2020; 2021; Nguyen et al., 2020), random forests (Brophy & Lowd, 2021), large scale language models (Zanella-Beguelin et al. ´ , 2020), the tension between unlearning and privacy (Chen et al., 2021), anomaly detection (Du et al., 2019), and even auditing of machine unlearning systems (Sommer et al., 2020).
|
| 48 |
+
|
| 49 |
+
# 2 CAMOUFLAGED POISONING ATTACKS VIA UNLEARNING
|
| 50 |
+
|
| 51 |
+
In this section, we describe various components of the camouflaged poisoning attack, and how it can be realized using machine unlearning.
|
| 52 |
+
|
| 53 |
+
# 2.1 THREAT MODEL AND APPROACH
|
| 54 |
+
|
| 55 |
+
The camouflaged poisoning attack takes place through interaction between an attacker and a victim. We assume that the attacker has access to the victim’s model architecture,2 the ability to query gradients on a trained model (which could be achieved, e.g., by having access to the training dataset), and a target sample that it wants to attack. The attacker first sets the stage for the attack by introducing poison points and camouflage points to the training dataset, which are designed so as to have minimal impact when a model is trained with this modified dataset. At a later time, the attacker triggers the attack by submitting an unlearning request to remove the camouflage points. The victim first trains a machine learning model (e.g., a deep neural network) on the modified training dataset, and then executes the unlearning request by retraining the model from scratch on the left over dataset. The goal of the attacker is to change the prediction of the model on a particular target sample $( x _ { \mathrm { { t a r g e t } } } , y _ { \mathrm { { t a r g e t } } } )$ previously unseen by the model during training from $y _ { \mathrm { t a r g e t } }$ to a desired label $y _ { \mathrm { { a d v e r s a r i a l } } }$ , while still ensuring good performance over other validation samples. Formally, the interaction between the attacker and the victim is as follows (see Figure 1) :
|
| 56 |
+
|
| 57 |
+
1. The attacker introduces a small number of poisons samples $S _ { \mathrm { p o } }$ and camouflage samples $S _ { \mathrm { c a } }$ to a clean training dataset $S _ { \mathrm { c l } }$ . Define $S _ { \mathrm { c p c } } = S _ { \mathrm { c l } } + S _ { \mathrm { p o } } + S _ { \mathrm { c a } }$ .
|
| 58 |
+
2. Victim trains an ML model (e.g., a neural network) on $S _ { \mathrm { c p c } }$ , and returns the model $\theta _ { \mathrm { c p c } }$ .
|
| 59 |
+
3. The attacker submits a request to unlearn the camouflage samples $S _ { \mathrm { c a } }$ .
|
| 60 |
+
4. The victim performs the request, and computes a new model $\theta _ { \mathrm { c p } }$ by retraining from scratch on the left over data samples $S _ { \mathrm { c p } } = S _ { \mathrm { c l } } + S _ { \mathrm { p o } }$ .
|
| 61 |
+
|
| 62 |
+
Note that the attack is only realized in Step 4 when the victim executes the unlearning request and retrains the model from scratch on the left over training samples. In fact, in Steps 1-3, the victim’s model should behave similarly to as if it were trained on the clean samples $S _ { \mathrm { c l } }$ only. In particular, the model $\theta _ { \mathrm { c p c } }$ will predict $y _ { \mathrm { t a r g e t } }$ on $x _ { \mathrm { { t a r g e t } } }$ , whereas the updated model $\theta _ { \mathrm { c p } }$ will predict $y _ { \mathrm { a d } }$ versarial on $x _ { \mathrm { { t a r g e t } } }$ . Both models should have comparable validation accuracy. Such an attack is implemented by designing a camouflage set that cancels the effects of the poison set while training, but retraining without the camouflage set exposes the poison set, thus negatively affecting the model.
|
| 63 |
+
|
| 64 |
+
We highlight that camouflaged attacks may be more dangerous than traditional data poisoning attacks, since camouflaged attacks can be triggered by the adversary. That is, the adversary can reveal the attack whenever the submit an unlearning request, whereas for a traditional poisoning attack, the adversary simply plants the attack and must wait for the victim to train the model.
|
| 65 |
+
|
| 66 |
+
In order to be undetectable, and represent the realistic scenario in which the adversary has limited influence on the model’s training data, the attacker is only allowed to introduce a set of points that is much smaller than the size of the clean training dataset (i.e., $| S _ { \mathrm { p o } } | \ll | S _ { \mathrm { c l } } |$ and $| S _ { \mathrm { c a } } | \ll | S _ { \mathrm { c l } } | )$ . Throughout the paper and experiments, we denote the relative size of the poison set and camouflage set by $b _ { p } : = \frac { | S _ { \mathrm { p o } } | } { | S _ { \mathrm { c l } } | } \times 1 0 0$ and $b _ { c } : = \frac { \left| S _ { \mathrm { c a } } \right| } { \left| S _ { \mathrm { c l } } \right| } \times 1 0 0$ , respectively. Additionally, the attacker is only allowed to generate poison and camouflage points by altering the base images by less than $\varepsilon$ distance in the $\ell _ { \infty }$ norm (in our experiments $\varepsilon \leq 1 6$ , where the images are represented as an array of pixels in 0 to 255). Thus, the attacker executes a so-called clean-label attack, where the corrupted images would be visually indistinguishable from original base images and thus would be given the same label as before by a human data validator. We parameterize a threat model by the tuple $\left( \varepsilon , b _ { c } , b _ { p } \right)$ .
|
| 67 |
+
|
| 68 |
+
The attacker implements the attack by first generating poison samples, and then generating camouflage samples to cancel their effects. The poison and camouflage points are generated as follows.
|
| 69 |
+
|
| 70 |
+
Poison points. Poison points are designed so that a network trained on $S _ { \mathrm { c p } } = S _ { \mathrm { c l } } + S _ { \mathrm { p o } }$ predicts the label yadversarial (instead of $y _ { \mathrm { t a r g e t } } ,$ ) on a target image $x _ { \mathrm { { t a r g e t } } }$ . While there are numerous data poisoning attacks in the literature, we adopt the state-of-the-art procedure of Geiping et al. (2021) for generating poisons due to its high success rate, efficiency of implementation, and applicability across various models. However, our framework is flexible: in principle, other attacks for the same setting could serve as a drop-in replacement, e.g., the methods of Aghakhani et al. (2021) or Huang et al. (2020), or any method introduced in the future. Suppose that $S _ { \mathrm { c p } }$ consist of $N _ { 1 }$ samples $( x ^ { i } , y ^ { i } ) _ { i \leq N _ { 1 } }$ out of which the first $P$ samples with index $i = 1$ to $P$ belong to the poison set $S _ { \mathrm { p o } }$ . 3 The poison samples are generated by adding small perturbations $\Delta ^ { i }$ to the base image $x ^ { i }$ so as to minimize the loss on the target with respect to the adversarial label, which can be formalized as the following bilevel optimization problem
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\operatorname* { m i n } _ { \Delta \in \Gamma } \ell \big ( f ( x _ { \mathrm { t a r g e t } } , \theta ( \Delta ) ) , y _ { \mathrm { a d v e r s a r i a l } } \big ) \quad \mathrm { w h e r e } \quad \theta ( \Delta ) \in \operatorname* { a r g m i n } _ { \theta } \frac { 1 } { N } \sum _ { i \leq N } \ell ( f ( x ^ { i } + \Delta ^ { i } , \theta ) , y ^ { i } ) ,
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
where we define the constraint set $\Gamma : = \big \{ \Delta : \| \Delta \| _ { \infty } \leq \varepsilon$ and $\Delta ^ { i } = 0$ for all $i > P \}$ . The main optimization objective in (1) is called the adversarial loss (Geiping et al., 2021).
|
| 77 |
+
|
| 78 |
+
Camouflage points. Camouflage samples are designed to cancel the effect of the poisons, such that a model trained on $S _ { \mathrm { c p c } } = S _ { \mathrm { c l } } + S _ { \mathrm { p o } } + S _ { \mathrm { c a } }$ behaves identical to the model trained on $S _ { \mathrm { c l } }$ , and makes the correct prediction on $x _ { \mathrm { t a r g e t } }$ . We formulate this task via a bilevel optimization problem similar to what we did in (1) for generating poisons. Let $S _ { \mathrm { c p c } }$ consist of $N _ { 2 }$ samples $( x ^ { j } , y ^ { j } ) _ { j \leq N _ { 2 } }$ out of which the last $C$ samples with index $j = N _ { 2 } - C + 1$ to $N _ { 2 }$ belong to the camouflage set $S _ { \mathrm { c a } }$ . The camouflage points are generated by adding small perturbations $\Delta ^ { j }$ to the base image $x ^ { j }$ so as to minimize the loss on the target with respect to the adversarial label. In particular, we find the appropriate $\Delta$ by solving:
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\operatorname* { m i n } _ { \Delta \in \Gamma } \ell \big ( f ( x _ { \mathrm { t a r g e t } } , \theta ( \Delta ) ) , y _ { \mathrm { t a r g e t } } \big ) \quad \mathrm { w h e r e } \quad \theta ( \Delta ) \in \arg \operatorname* { m i n } _ { \theta } \frac { 1 } { N _ { 2 } } \sum _ { j \leq N _ { 2 } } \ell \big ( f ( x ^ { j } + \Delta ^ { j } , \theta ) , y ^ { j } \big ) ,
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
where we define the constraint set $\Gamma : = \big \{ \Delta : \| \Delta \| _ { \infty } \leq \varepsilon$ and $\Delta ^ { j } = 0$ for all $j \leq N _ { 2 } - C \}$ .
|
| 85 |
+
|
| 86 |
+
# 2.2 GRADIENT MATCHING FOR EFFICIENT POISON GENERATION (GEIPING ET AL., 2021)
|
| 87 |
+
|
| 88 |
+
In this section, we discuss the key intuition of Geiping et al. (2021) for efficient poison generation. Our objective is to find perturbations $\Delta$ such that when the model is trained on the poisoned samples, it minimizes the adversarial loss in (1) thus making the victim model predict the wrong label yadversarial on the target sample. However, directly solving (1) is computationally intractable due to bilevel nature of the optimization objective. Instead, one may implicitly minimize the adversarial loss by finding a $\Delta$ such that for any model parameter $\theta$ ,
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\nabla _ { \theta } \big ( \ell \big ( f ( x _ { \mathrm { t a r g e t } } , \theta ) , y _ { \mathrm { a d v e r s a r i a l } } \big ) \big ) \approx \frac { 1 } { P } \sum _ { i = 1 } ^ { P } \nabla _ { \theta } \ell \big ( f ( x ^ { i } + \Delta ^ { i } , \theta ) , y ^ { i } \big ) .
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
In essence, (3) implies that gradient based minimization (e.g., using Adam $/$ SGD) of the training loss on poisoned samples also minimizes the adversarial loss. Thus, training a model on $S _ { \mathrm { c l } } + S _ { \mathrm { p o } }$ will automatically ensure that the model predicts $y _ { \mathrm { { a d v e r s a r i a l } } }$ on the target sample. Unfortunately, computing $\Delta$ that satisfies (3) is also intractable as it is required to hold for all values of $\theta$ . The key idea of Geiping et al. (2021) to make poison generation efficient is to relax (3) to only be satisfied for a fixed model $\theta _ { \mathrm { c l } }$ −the model obtained by training on the clean dataset $S _ { \mathrm { c l } }$ . To implement this, Geiping et al. (2021) minimize the cosine-similarity loss between the two gradients defined as:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\phi ( \Delta , \theta ) = 1 - \frac { \left. \nabla _ { \theta } \ell \big ( f ( x _ { \mathrm { t a r g e t } } , \theta ) , y _ { \mathrm { a d v e r s a r i a l } } \big ) , \sum _ { i = 1 } ^ { P } \nabla _ { \theta } \ell \big ( f ( x _ { i } + \Delta _ { i } , \theta ) , y _ { i } \big ) \right. } { \big \| \nabla _ { \theta } \ell \big ( f ( x _ { \mathrm { t a r g e t } } , \theta ) , y _ { \mathrm { a d v e r s a r i a l } } \big ) \big \| \big \| \sum _ { i = 1 } ^ { P } \nabla _ { \theta } \ell \big ( f ( x _ { i } + \Delta _ { i } , \theta ) , y _ { i } \big ) \big \| } ,
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
Geiping et al. (2021) demonstrated that (4) can be efficiently optimized for many popular largescale machine learning models and datasets. For completeness, we provide their pseudocode in Algorithm 1 in the Appendix.
|
| 101 |
+
|
| 102 |
+
# 2.3 CAMOUFLAGING POISONED POINTS
|
| 103 |
+
|
| 104 |
+
Camouflage images are designed in order to neutralize the effect of the poison images. In this section, we give intuition into what we mean by cancelling the effect of poisons, and provide two procedures for generating camouflages efficiently: label flipping, and gradient matching.
|
| 105 |
+
|
| 106 |
+
# 2.3.1 CAMOUFLAGES VIA LABEL FLIPPING
|
| 107 |
+
|
| 108 |
+
Suppose that the underlying task is a binary classification problem with the labels $y \in \{ - 1 , 1 \}$ , and that the model is trained using linear loss $\ell ( f ( x , \theta ) , y ) \ \overset { \cdot } { = } \ - y f ( x , \theta )$ . Then, simply flipping the labels allows one to generate a camouflage set for any given poison set $S _ { \mathrm { p o } }$ . In particular, $\breve { S } _ { \mathrm { c a } }$ is constructed as: for every $( x ^ { i } , y ^ { i } ) \in S _ { \mathrm { p o } }$ , simply add $( x ^ { i } , - y ^ { i } )$ to $S _ { \mathrm { c a } }$ (i.e., $b _ { p } = b _ { c , }$ ). It is easy to see that for such camouflage points, we have for any $\theta$ ,
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\sum _ { ( x , y ) \in S _ { \mathrm { c p c } } } \ell ( f ( x , \theta ) , y ) = - \sum _ { ( x , y ) \in S _ { \mathrm { c l } } } y f ( x , \theta ) - \sum _ { i = 1 } ^ { P } \left( y ^ { i } f ( x ^ { i } , \theta ) + ( - y ^ { i } ) f ( x ^ { i } , \theta ) \right) = \sum _ { ( x , y ) \in S _ { \mathrm { c l } } } \ell ( f ( x , \theta ) , y ) .
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
We can also similarly show that the gradients (as well as higher order derivatives) are equal, i.e., $\begin{array} { r } { \nabla _ { \boldsymbol { \theta } } \sum _ { S _ { \mathrm { c p c } } } \ell ( \boldsymbol { f } ( \boldsymbol { x } , \boldsymbol { \theta } ) , \dot { \boldsymbol { y } } ) = \nabla _ { \boldsymbol { \theta } } \sum _ { S _ { \mathrm { c l } } } \ell ( \boldsymbol { \bar { f } } ( \boldsymbol { x } , \boldsymbol { \theta } ) , \boldsymbol { y } ) } \end{array}$ for all $\theta$ . Thus, training a model on $S _ { \mathrm { c p c } }$ is equivalent to training it on $S _ { \mathrm { c l } }$ . In essence, the camouflages have perfectly canceled out the effect of the poisons. We validate the efficacy of this approach via experiments on linear SVM trained with hinge loss (which resembles linear loss when the domain is bounded) on a binary classification problem constructed using CIFAR-10 dataset. We report the results in Table 1 (see Section 3.1.1 for details).
|
| 115 |
+
|
| 116 |
+
While label flipping is a simple and effective procedure to generate camouflages, it is fairly restrictive. Firstly, label flipping only works for binary classification problems trained with linear loss. Secondly, the attack is not clean label as the camouflage images are generated as $( x ^ { i } , - y ^ { i } )$ by giving them the opposite label to the ground truth, which can be easily caught by a validator. Lastly, the attack is vulnerable to simple data purification techniques by the victim, e.g., the victim can protect themselves by preprocessing the data to remove all the images that have both the labels ( $y = + 1$ and $y = - 1 ,$ ) in the training dataset. In the next section, we provide a different procedure to generate clean-label camouflages for general losses and multi-class classification problems.
|
| 117 |
+
|
| 118 |
+
Table 1: Camouflaged poisoning attack on linear SVM on Binary-CIFAR-10 dataset. The first column lists the threat model $( \varepsilon , b _ { p } , b _ { c } )$ and the camouflaging type “LF” for label flipping and “GM” for gradient matching. The implementation details are given in Section 3.1.1. Each experriments is an average of 10 runs with seeds of the form “kkkkkk” where $k \in \{ 0 , \ldots , 9 \}$ and the seed 99999.
|
| 119 |
+
|
| 120 |
+
<table><tr><td rowspan="2">Attack type (e,bp,bc)</td><td colspan="2">Attack success</td><td colspan="3">Validation Accuracy</td></tr><tr><td>Poisoning</td><td>Camouflaging</td><td>Clean</td><td>Poisoned</td><td>Camouflaged</td></tr><tr><td>LF(8,0.2%,0.2%)</td><td>70%</td><td>71.5%</td><td>81.63</td><td>81.73 (± 0.14)</td><td>81.74 (± 0.20)</td></tr><tr><td>LF (16,0.2%,0.2%)</td><td>100%</td><td>40%</td><td>81.63</td><td>81.64 (±0.03)</td><td>81.6(±0.02)</td></tr><tr><td>GM (8,0.2%,0.4%)</td><td>70%</td><td>100%</td><td>81.63</td><td>81.65 (±0.01)</td><td>81.62 (±0.02)</td></tr><tr><td>GM (16,0.2%,0.4%)</td><td>100%</td><td>70%</td><td>81.63</td><td>81.65 (±0.03)</td><td>81.63 (± 0.02)</td></tr></table>
|
| 121 |
+
|
| 122 |
+
# 2.3.2 GRADIENT MATCHING FOR GENERATING CAMOUFLAGES
|
| 123 |
+
|
| 124 |
+
We next discuss our main procedure to generate camouflages, which is based on the gradient matching idea of Geiping et al. (2021). Note that, our objective in (2) is to find $\Delta$ such that when the model is trained with the camouflages, it minimizes the original-target loss in (2) (with respect to the original label $y _ { \mathrm { t a r g e t } } ,$ ) thus making the victim model predict the correct label on this target sample. Since, (1) is computationally intractable, one may instead try to implicitly minimize the original-target loss by finding a $\Delta$ such that for any model parameter $\theta$ ,
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\nabla _ { \boldsymbol { \theta } } \big ( \ell \big ( f ( \boldsymbol { x } _ { \mathrm { t a r g e t } } , \boldsymbol { \theta } ) , \boldsymbol { y } _ { \mathrm { t a r g e t } } \big ) \big ) \approx \frac { 1 } { C } \sum _ { i = 1 } ^ { C } \nabla _ { \boldsymbol { \theta } } \ell \big ( f ( \boldsymbol { x } ^ { i } + \Delta ^ { i } , \boldsymbol { \theta } ) , \boldsymbol { y } ^ { i } \big ) .
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
(5) suggests that minimizing (e.g., using Adam / SGD) on camouflage samples will also minimize the original-target loss, and thus automatically ensure that the model predicts the correct label on the target sample. Unfortunately, (5) is also intractable as it requires the condition to hold for all $\theta$ . Building on the work of Geiping et al. (2021), we relax this condition to satisfied only for a fixed model $\theta _ { \mathrm { c p } }$ -the model trained on the dataset $S _ { \mathrm { c p } } = S _ { \mathrm { c l } } + S _ { \mathrm { p o } }$ . Similar to what we did for generating poison points, we achieve this by minimizing the cosine-similarity loss given by
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\psi ( \Delta , \theta ) = 1 - \frac { \left. \nabla _ { \theta } \ell ( f ( x _ { \mathrm { t a r g e t } } , \theta ) , y _ { \mathrm { t a r g e t } } ) , \sum _ { i = 1 } ^ { C } \nabla _ { \theta } \ell ( f ( x _ { i } + \Delta _ { i } , \theta ) , y _ { i } ) \right. } { \| \nabla _ { \theta } \ell ( f ( x _ { \mathrm { t a r g e t } } , \theta ) , y _ { \mathrm { t a r g e t } } ) \| \| \sum _ { i = 1 } ^ { C } \nabla _ { \theta } \ell ( f ( x _ { i } + \Delta _ { i } , \theta ) , y _ { i } ) \| } .
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
Implementation details. We minimize (6) using the Adam optimizer (Kingma & Ba, 2015) with a fixed step size of 0.1. In order to increase the robustness of camouflage generation, we do $R$ restarts (where $R \leq 1 0$ ). In each restart, we first initialize $\Delta$ randomly such that $\| \Delta \| _ { \infty } \leq \varepsilon$ and perform $M$ steps of Adam optimization to minimize $\psi ( \Delta , \theta _ { \mathrm { c p } } )$ . Each optimization step only requires a single differentiation of the objective $\psi$ with respect to $\Delta$ , and can be implemented efficiently. After each step, we project back the updated $\Delta$ into the constraint set $\Gamma$ so as to maintain the property that $\| \Delta \| _ { \infty } \leq \varepsilon$ . After doing $R$ restarts, we choose the best round by finding $\Delta _ { * }$ with the minimum $\psi ( \Delta _ { \star } , \theta _ { \mathrm { c p } } )$ . We provide the pseudocode in Algorithm 2 in the appendix.
|
| 137 |
+
|
| 138 |
+
# 3 EXPERIMENTAL EVALUATION
|
| 139 |
+
|
| 140 |
+
In this section, we give details into our experimental setup. We generate poison points by running Algorithm 1, and camouflage points by running Algorithm 2 with $R = 1$ and $M = 2 5 0$ .5 Each experiment is repeated $K$ times by setting a different seed each time, which fixes the target image, poison class, camouflage class, base poison images and base camouflage images. Due to limited computation resources, we typically set $K \in \{ 3 , \mathsf { \bar { 5 } } , 8 , 1 0 \}$ depending on the dataset and report the mean and standard deviation across different trials. We say that poisoning was successful if the model trained on $S _ { \mathrm { c p } } = S _ { \mathrm { c l } } + S _ { \mathrm { p o } }$ predicts the label $y _ { \mathrm { { a d v e r s a r i a l } } }$ on the target image. Furthermore, we say that camouflaging was successful if the model trained on $S _ { \mathrm { c p c } } = S _ { \mathrm { p o } } + S _ { \mathrm { c l } } + S _ { \mathrm { c a } }$ predicts back the correct label $y _ { \mathrm { t a r g e t } }$ on the target image, provided that poisoning was successful. A camouflaged poisoning attack is successful if both poisoning and camouflaging were successful.
|
| 141 |
+
|
| 142 |
+
For the ease of replication, we provide the code for our experiments with the supplementary material (see Appendix B.2 for details).
|
| 143 |
+
|
| 144 |
+
# 3.1 EVALUATIONS ON CIFAR-10
|
| 145 |
+
|
| 146 |
+
We extensively evaluate our camouflaged poisoning attack on models trained on the CIFAR-10 dataset (Krizhevsky, 2009). CIFAR-10 is a multiclass classification problem with 10 classes, with 6,000 color images in each class (5,000 training $+ 1 { , } 0 0 0$ test) of size $3 2 \times 3 2$ . We follow the standard split into 50,000 training images and 10,000) validation / test images.
|
| 147 |
+
|
| 148 |
+
# 3.1.1 SUPPORT VECTOR MACHINES
|
| 149 |
+
|
| 150 |
+
In order to perform evaluations on SVM, we first convert the CIFAR-10 dataset into a binary classification dataset (which we term as Binary-CIFAR-10) by merging the 10 classes into two groups: animal $( y = + 1 )$ and machine $( y = - 1 )$ . Images (in the training and the test dataset) that were originally labeled (bird, cat, deer, dog, frog, horse) are instead labeled animal, and the remaining images, with original labels (airplane, cars, ship, truck), are labeled machine.
|
| 151 |
+
|
| 152 |
+
We train a linear SVM (no kernel was used) with the hinge loss: $\ell ( f ( x , \theta ) , y ) = \operatorname* { m a x } \{ 0 , 1 -$ $y f ( x , \theta ) \}$ . The training was done using the svm.LinearSVC class from Scikit-learn (Pedregosa et al., 2011) on a single CPU. In the pre-processing stage, each image in the training dataset was normalized to have $\ell _ { 2 }$ -norm 1. Each training on Binary-CIFAR-10 dataset took $2 5 \textrm { - } 3 0$ seconds. In order to generate the poison points, we first use torch.autograd to compute the cosinesimilarity loss (4), and then optimize it using Adam optimizer with learning rate 0.001. Each poison and camouflage generation took about $4 0 \textrm { - } 5 0$ seconds (for $b _ { p } = b _ { c } = 0 . 2 \% )$ . We evaluate both label flipping and gradient matching to generate camouflages, and different threat models $( \varepsilon , b _ { p } , b _ { c } )$ ; the results are reported in Table 1. For each of our experiments we chose $K = 1 0$ seeds. Each trained model had validation accuracy of around $8 1 . 6 3 \%$ on the clean dataset $S _ { \mathrm { c l } }$ , which did not change significantly when we retrained after adding poison samples and / or camouflage samples. Note that the efficacy of the camouflaged poisoning attack was more than $7 0 \%$ in most of the experiments. We provide a sample of the generated poisons and camouflages in Figure 4 in the appendix.
|
| 153 |
+
|
| 154 |
+
# 3.1.2 NEURAL NETWORKS
|
| 155 |
+
|
| 156 |
+
We perform extensive evaluations on the multiclass CIFAR-10 classification task with various popular large scale neural networks architectures including VGG-11, VGG-16 (Simonyan & Zisserman, 2015), ResNet-18, ResNet-34, ResNet-50 (He et al., 2016), and MobileNetV2 (Sandler et al., 2018).
|
| 157 |
+
|
| 158 |
+
Each model is trained with cross-entropy loss $\ell ( f ( x , \theta ) , y ) = - \log ( \operatorname* { P r } ( y = f ( x , \theta ) ) )$ on a single GPU using PyTorch (Paszke et al., 2019), and using mini-batch SGD with weight decay 5e-4, momentum 0.9, learning rate 0.01, batch size 100, and 40 epochs over the training dataset. Each training run took about 45 minutes. The poison and camouflage sets were generated using gradient matching by first defining the cosine-similarity loss using torch.autograd and then minimizing it using Adam with a learning rate of 0.1. Each poison/camouflage generation took about 1.5 hours.
|
| 159 |
+
|
| 160 |
+
We report the efficacy of our camouflaged poisoning attack across different models and threat models $( \varepsilon , b _ { p } , b _ { c } )$ in Figure 3; also see Appendix B.4 for detailed results and performance drops on the validation dataset after adding poison and camouflage set. Each model was trained to have validation accuracy between $8 1 - 8 7 \%$ (depending on the architecture), which changed minimally when the model was retrained with poison and camouflage samples. Poisoning was successful at least $8 0 \%$ of the time in most of the experiments. Camouflaging was successful at least $70 \%$ of the time for VGG11, VGG-16, Resnet-18, and Resnet-34 but was not as successful for MobileNetV2 and Resnet-50. Furthermore, camouflaging succeeded at least $7 5 \%$ of times when $b _ { c } = b _ { p }$ , but did not perform as well when we set $b _ { p } > b _ { c }$ in the thread model (more poison images than camouflage images).
|
| 161 |
+
|
| 162 |
+

|
| 163 |
+
Figure 3: Efficacy of the proposed camouflaged poisoning attack on CIFAR-10 dataset. The left plot gives the success for the threat model $\bar { \varepsilon ^ { * } } = \bar { 1 6 } , b _ { p } = \bar { 0 } . 6 \% , b _ { c } = 0 . 6 \%$ across different neural network architectures. The right plot gives the success for ResNet-18 architecture across different threat models. See Appendix B.4 for the experiment details.
|
| 164 |
+
|
| 165 |
+
# 3.2 EVALUATIONS ON IMAGENETTE AND IMAGEWOOF
|
| 166 |
+
|
| 167 |
+
We evaluate the efficacy of our attack vector on the challenging multiclass classification problem on the Imagenette and Imagewoof datasets (Howard, 2019). Imagenette is a subset of 10 classes (Tench, English springer, Cassette player, Chain saw, Building/church, French horn, Truck, Gas pump, Golf ball, Parachute) from the Imagenet dataset (Russakovsky et al., 2015). The Imagenette dataset consists of around 900 images of various sizes for each class. In total, we have 13394 images which are divided into a training dataset of size 9469 and test dataset of size 3925. To perform training, all images are resized and centrally cropped down to $2 2 4 \times 2 2 4$ pixels.
|
| 168 |
+
|
| 169 |
+
Table 2: Evaluation of camouflaged poisoning attack on Imagenette and Imagewoof datasets over 5 seeds (with 1 restart per seed). Note that camouflaging succeeded in most of the experiments in which poisoning succeeded. Prior works (e.g., Geiping et al. (2021)) set a large number of restarts $R$ , and then choose the most effective attack among them. Due to computational constraints, we ran only one restart (i.e., $R = 1$ ) for each experiment. Given additional computational resources, we could inflate the success rate of both the poisoning and camouflaging.
|
| 170 |
+
|
| 171 |
+
<table><tr><td rowspan="2">Dataset</td><td rowspan="2">Model</td><td colspan="2">Threat Model</td><td colspan="2">Attack Success</td></tr><tr><td>ε bp</td><td>bc</td><td>Poisoning</td><td>Camouflaging</td></tr><tr><td>Imagenette</td><td>VGG-16</td><td>16 6.3%</td><td>6.3%</td><td>25%</td><td>100%</td></tr><tr><td>Imagenette</td><td>Resnet-18</td><td>16 6.3%</td><td>6.3%</td><td>40%</td><td>50%</td></tr><tr><td>Imagewoof</td><td>Resnet-18</td><td>16 6.6%</td><td>6.6%</td><td>50%</td><td>75%</td></tr></table>
|
| 172 |
+
|
| 173 |
+
Imagewoof (Howard, 2019) is another subset of Imagenet dataset consisting of 10 classes (ShihTzu, Rodesian Ridgeback, Beagle, English Foxhound, Border Terrier, Austrailian Terrier, Golden Retriever, Old English Sheep Dog, Samoyed, Dingo). Imagewoof consists of around 900 images of various sizes for each class, and in total 12954 images which are divided into a training dataset of size 9025 and test dataset of size 3929. Similar to Imagenette, we resize all images and crop to the central $2 2 4 \times 2 2 4$ pixels before training.
|
| 174 |
+
|
| 175 |
+
We evaluate our camouflaged poisoning attack on two different neural network architectures-VGG16 and ResNet-18, and different threat models $( \varepsilon , b _ { p } , b _ { c } )$ listed in Table 3.2. Each model is trained on a single GPU with cross-entropy loss, that is minimized using SGD algorithm with weight decay 5e4, momentum 0.9 and batch size 20. We start with a learning rate of 0.01, and exponentially decay it with $\gamma = 0 . 9$ after every epoch, for a total of 50 epochs over the training dataset. The poisons and camouflages were generated using gradient matching by first defining the cosine-similarity loss using torch.autograd and then optimizing it using Adam optimizer with learning rate 0.1. In our experiments, camouflaging was successful for at least $5 0 \%$ of the time when poisoning was successful. However, because we modified about $13 \%$ of the training dataset when adding poisons / camouflages, we observe that the fluctuation in the model’s validation accuracy can be up to $7 \%$ for both Imagenette and Imagewoof, as expected on making such a large change in the training set.
|
| 176 |
+
|
| 177 |
+
Additional experiments. In Appendix B.6, we provide additional experiments on CIFAR-10 showing that our attack is robust to data augmentation, and successfully transfers when the victim model is different from the model on which poison and camouflage samples were generated.
|
| 178 |
+
|
| 179 |
+
Conclusion and discussion. We demonstrated a new attack vector, camouflaged poisoning attacks, against machine learning pipelines where training points can be unlearned. This shows that as we introduce new functionality to machine learning systems, we must be aware of novel threats that emerge. We outline a few interesting directions for further research: It is important to understand how to defend against camouflaged attacks. As observed by Geiping et al. (2021), it is unlikely that differential privacy (Dwork et al., 2006) would be an effective defense, as preventing attacks in the non-camouflaged setting incurs too significant a loss in accuracy. Another direction is to reduce the knowledge needed by the adversary, thereby creating stronger attacks. E.g., while our setting requires grey-box knowledge, one could instead consider a black-box model to attack ML APIs. Finally, it is interesting to determine what other types of threats can be camouflaged, e.g., indiscriminate or backdoor poisoning attacks. Beyond exploring this new attack vector, it is also independently interesting to understand how one can neutralize the effect of an attack by adding points.
|
| 180 |
+
|
| 181 |
+
# REPRODUCIBILITY STATEMENT
|
| 182 |
+
|
| 183 |
+
For the purposes of reproducibility, we include our code in the supplement. Descriptions of the various files are given in Appendix B.2. Hyperparameters and experimental details for all experiments are provided in Section 3. Finally, we report random seeds, target points and classes, poison and camouflage classes for all experiments in Appendix B.3.
|
| 184 |
+
|
| 185 |
+
# REFERENCES
|
| 186 |
+
|
| 187 |
+
Hojjat Aghakhani, Dongyu Meng, Yu-Xiang Wang, Christopher Kruegel, and Giovanni Vigna. Bullseye polytope: A scalable clean-label poisoning attack with improved transferability. In 2021 IEEE European Symposium on Security and Privacy (EuroS&P), pp. 159–178. IEEE, 2021.
|
| 188 |
+
|
| 189 |
+
Marco Barreno, Blaine Nelson, Anthony D Joseph, and J Doug Tygar. The security of machine learning. Machine Learning, 81(2):121–148, 2010.
|
| 190 |
+
|
| 191 |
+
Battista Biggio, Blaine Nelson, and Pavel Laskov. Poisoning attacks against support vector machines. In Proceedings of the 29th International Conference on Machine Learning, ICML ’12, pp. 1467–1474. JMLR, Inc., 2012.
|
| 192 |
+
|
| 193 |
+
Lucas Bourtoule, Varun Chandrasekaran, Christopher A Choquette-Choo, Hengrui Jia, Adelin Travers, Baiwu Zhang, David Lie, and Nicolas Papernot. Machine unlearning. In proceedings of the 42nd IEEE Symposium on Security and Privacy, SP ’21, Washington, DC, USA, 2021. IEEE Computer Society.
|
| 194 |
+
|
| 195 |
+
Jonathan Brophy and Daniel Lowd. Machine unlearning for random forests. In Proceedings of the 38th International Conference on Machine Learning, ICML ’21, pp. 1092–1104. JMLR, Inc., 2021.
|
| 196 |
+
|
| 197 |
+
Yinzhi Cao and Junfeng Yang. Towards making systems forget with machine unlearning. In Proceedings of the 36th IEEE Symposium on Security and Privacy, SP ’15, pp. 463–480, Washington, DC, USA, 2015. IEEE Computer Society.
|
| 198 |
+
|
| 199 |
+
Min Chen, Zhikun Zhang, Tianhao Wang, Michael Backes, Mathias Humbert, and Yang Zhang. When machine unlearning jeopardizes privacy. In Proceedings of the 2021 ACM SIGSAC Conference on Computer and Communications Security, pp. 896–911, 2021.
|
| 200 |
+
|
| 201 |
+
Antonio Emanuele Cina, Kathrin Grosse, Ambra Demontis, Sebastiano Vascon, Werner Zellinger, \` Bernhard A Moser, Alina Oprea, Battista Biggio, Marcello Pelillo, and Fabio Roli. Wild patterns reloaded: A survey of machine learning security against training data poisoning. arXiv preprint arXiv:2205.01992, 2022.
|
| 202 |
+
|
| 203 |
+
Ilias Diakonikolas, Gautam Kamath, Daniel M. Kane, Jerry Li, Jacob Steinhardt, and Alistair Stewart. Sever: A robust meta-algorithm for stochastic optimization. In Proceedings of the 36th International Conference on Machine Learning, ICML ’19, pp. 1596–1606. JMLR, Inc., 2019.
|
| 204 |
+
|
| 205 |
+
Min Du, Zhi Chen, Chang Liu, Rajvardhan Oak, and Dawn Song. Lifelong anomaly detection through unlearning. In Proceedings of the 2019 ACM SIGSAC Conference on Computer and Communications Security, pp. 1283–1297, 2019.
|
| 206 |
+
|
| 207 |
+
Cynthia Dwork, Frank McSherry, Kobbi Nissim, and Adam Smith. Calibrating noise to sensitivity in private data analysis. In Proceedings of the 3rd Conference on Theory of Cryptography, TCC ’06, pp. 265–284, Berlin, Heidelberg, 2006. Springer.
|
| 208 |
+
|
| 209 |
+
Federal Trade Commission. California company settles ftc allegations it deceived consumers about use of facial recognition in photo storage app, January 2021.
|
| 210 |
+
|
| 211 |
+
Jonas Geiping, Liam Fowl, W Ronny Huang, Wojciech Czaja, Gavin Taylor, Michael Moeller, and Tom Goldstein. Witches’ brew: Industrial scale data poisoning via gradient matching. In Proceedings of the 9th International Conference on Learning Representations, ICLR ’21, 2021.
|
| 212 |
+
|
| 213 |
+
General Data Protection Regulation. Regulation (EU) 2016/679 of the European parliament and of the council of 27 April 2016, 2016.
|
| 214 |
+
|
| 215 |
+
Antonio Ginart, Melody Guan, Gregory Valiant, and James Y Zou. Making AI forget you: Data deletion in machine learning. In Advances in Neural Information Processing Systems 32, NeurIPS ’19, pp. 3518–3531. Curran Associates, Inc., 2019.
|
| 216 |
+
|
| 217 |
+
Aditya Golatkar, Alessandro Achille, and Stefano Soatto. Eternal sunshine of the spotless net: Selective forgetting in deep networks. In Proceedings of the 2020 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, CVPR ’20, pp. 9304–9312, Washington, DC, USA, 2020. IEEE Computer Society.
|
| 218 |
+
|
| 219 |
+
Aditya Golatkar, Alessandro Achille, Avinash Ravichandran, Marzia Polito, and Stefano Soatto. Mixed-privacy forgetting in deep networks. In Proceedings of the 2021 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, CVPR ’21, pp. 792–801. IEEE Computer Society, 2021.
|
| 220 |
+
|
| 221 |
+
Micah Goldblum, Dimitris Tsipras, Chulin Xie, Xinyun Chen, Avi Schwarzschild, Dawn Song, Aleksander Madry, Bo Li, and Tom Goldstein. Dataset security for machine learning: Data poisoning, backdoor attacks, and defenses. arXiv preprint arXiv:2012.10544, 2020.
|
| 222 |
+
|
| 223 |
+
Tianyu Gu, Brendan Dolan-Gavitt, and Siddharth Garg. Badnets: Identifying vulnerabilities in the machine learning model supply chain. arXiv preprint arXiv:1708.06733, 2017.
|
| 224 |
+
|
| 225 |
+
Chuan Guo, Tom Goldstein, Awni Hannun, and Laurens Van Der Maaten. Certified data removal from machine learning models. In Proceedings of the 37th International Conference on Machine Learning, ICML ’20, pp. 3832–3842. JMLR, Inc., 2020.
|
| 226 |
+
|
| 227 |
+
Varun Gupta, Christopher Jung, Seth Neel, Aaron Roth, Saeed Sharifi-Malvajerdi, and Chris Waites. Adaptive machine unlearning. In Advances in Neural Information Processing Systems 34, NeurIPS ’21, pp. 16319–16330. Curran Associates, Inc., 2021.
|
| 228 |
+
|
| 229 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the 2016 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, CVPR ’16, pp. 770–778, Washington, DC, USA, 2016. IEEE Computer Society.
|
| 230 |
+
|
| 231 |
+
Jeremy Howard. Imagenette, 2019. URL https://github.com/fastai/imagenette/.
|
| 232 |
+
|
| 233 |
+
W Ronny Huang, Jonas Geiping, Liam Fowl, Gavin Taylor, and Tom Goldstein. Metapoison: Practical general-purpose clean-label data poisoning. In Advances in Neural Information Processing Systems 33, NeurIPS ’20, pp. 12080–12091. Curran Associates, Inc., 2020.
|
| 234 |
+
|
| 235 |
+
Information Commissioner’s Office. Guidance on the ai auditing framework, February 2020.
|
| 236 |
+
|
| 237 |
+
Zachary Izzo, Mary Anne Smart, Kamalika Chaudhuri, and James Zou. Approximate data deletion from machine learning models: Algorithms and evaluation. In Proceedings of the 24th International Conference on Artificial Intelligence and Statistics, AISTATS ’21, pp. 2008–2016. JMLR, Inc., 2021.
|
| 238 |
+
|
| 239 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Proceedings of the 3rd International Conference on Learning Representations, ICLR ’15, 2015.
|
| 240 |
+
|
| 241 |
+
Pang Wei Koh, Jacob Steinhardt, and Percy Liang. Stronger data poisoning attacks break data sanitization defenses. Machine Learning, 111(1):1–47, 2022.
|
| 242 |
+
|
| 243 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images, 2009.
|
| 244 |
+
|
| 245 |
+
Neil G Marchant, Benjamin IP Rubinstein, and Scott Alfeld. Hard to forget: Poisoning attacks on certified machine unlearning. In Proceedings of the Thirty-Sixth AAAI Conference on Artificial Intelligence, volume 36 of AAAI ’22, pp. 7691–7700, 2022.
|
| 246 |
+
|
| 247 |
+
Luis Munoz-Gonz ˜ alez, Battista Biggio, Ambra Demontis, Andrea Paudice, Vasin Wongrassamee, ´ Emil C Lupu, and Fabio Roli. Towards poisoning of deep learning algorithms with back-gradient optimization. In Proceedings of the 10th ACM workshop on artificial intelligence and security, pp. 27–38, 2017.
|
| 248 |
+
|
| 249 |
+
Seth Neel, Aaron Roth, and Saeed Sharifi-Malvajerdi. Descent-to-delete: Gradient-based methods for machine unlearning. In Proceedings of the 32nd International Conference on Algorithmic Learning Theory, ALT ’21. JMLR, Inc., 2021.
|
| 250 |
+
|
| 251 |
+
Quoc Phong Nguyen, Bryan Kian Hsiang Low, and Patrick Jaillet. Variational bayesian unlearning. Advances in Neural Information Processing Systems, 33:16025–16036, 2020.
|
| 252 |
+
|
| 253 |
+
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Ed- ¨ ward Yang, Zach DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. PyTorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems 32, NeurIPS ’19, pp. 8026–8037. Curran Associates, Inc., 2019.
|
| 254 |
+
|
| 255 |
+
Andrea Paudice, Luis Munoz-Gonz ˜ alez, and Emil C Lupu. Label sanitization against label flipping ´ poisoning attacks. In Joint European conference on machine learning and knowledge discovery in databases, pp. 5–15. Springer, 2018.
|
| 256 |
+
|
| 257 |
+
Fabian Pedregosa, Gael Varoquaux, Alexandre Gramfort, Vincent Michel, Bertrand Thirion, Olivier¨ Grisel, Mathieu Blondel, Peter Prettenhofer, Ron Weiss, Vincent Dubourg, Jake Vanderplas, Alexandre Passos, David Cournapeau, Matthieu Brucher, Matthieu Perrot, and Edouard Duch- ´ esnay. Scikit-learn: Machine learning in Python. Journal of Machine Learning Research, 12(85): 2825–2830, 2011.
|
| 258 |
+
|
| 259 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211–252, 2015.
|
| 260 |
+
|
| 261 |
+
Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. MobileNetV2: Inverted residuals and linear bottlenecks. In Proceedings of the 2018 IEEE Computer Society Conference on Computer Vision and Pattern Recognition, CVPR ’18, pp. 4510–4520, Washington, DC, USA, 2018. IEEE Computer Society.
|
| 262 |
+
|
| 263 |
+
Ayush Sekhari, Jayadev Acharya, Gautam Kamath, and Ananda Theertha Suresh. Remember what you want to forget: Algorithms for machine unlearning. In Advances in Neural Information Processing Systems 34, NeurIPS ’21, pp. 18075–18086. Curran Associates, Inc., 2021.
|
| 264 |
+
|
| 265 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale visual recognition. In Proceedings of the 3rd International Conference on Learning Representations, ICLR ’15, 2015.
|
| 266 |
+
|
| 267 |
+
David Marco Sommer, Liwei Song, Sameer Wagh, and Prateek Mittal. Towards probabilistic verification of machine unlearning. arXiv preprint arXiv:2003.04247, 2020.
|
| 268 |
+
|
| 269 |
+
Jacob Steinhardt, Pang Wei W Koh, and Percy S Liang. Certified defenses for data poisoning attacks. In Advances in Neural Information Processing Systems 30, NeurIPS ’17, pp. 3520–3532. Curran Associates, Inc., 2017.
|
| 270 |
+
|
| 271 |
+
Octavian Suciu, Radu Marginean, Yigitcan Kaya, Hal Daume III, and Tudor Dumitras. When does machine learning $\{ { \mathrm { F A I L } } \} \lambda$ generalized transferability for evasion and poisoning attacks. In 27th USENIX Security Symposium (USENIX Security 18), pp. 1299–1316, 2018.
|
| 272 |
+
|
| 273 |
+
Ziteng Sun, Peter Kairouz, Ananda Theertha Suresh, and H Brendan McMahan. Can you really backdoor federated learning? arXiv preprint arXiv:1911.07963, 2019.
|
| 274 |
+
|
| 275 |
+
Brandon Tran, Jerry Li, and Aleksander Madry. Spectral signatures in backdoor attacks. In Advances in Neural Information Processing Systems 31, NeurIPS ’18, pp. 8011–8021. Curran Associates, Inc., 2018.
|
| 276 |
+
|
| 277 |
+
Enayat Ullah, Tung Mai, Anup Rao, Ryan A Rossi, and Raman Arora. Machine unlearning via algorithmic stability. In Conference on Learning Theory, pp. 4126–4142. PMLR, 2021.
|
| 278 |
+
|
| 279 |
+
Han Xiao, Huang Xiao, and Claudia Eckert. Adversarial label flips attack on support vector machines. In ECAI 2012, pp. 870–875. IOS Press, 2012.
|
| 280 |
+
|
| 281 |
+
Huang Xiao, Battista Biggio, Blaine Nelson, Han Xiao, Claudia Eckert, and Fabio Roli. Support vector machines under adversarial label contamination. Neurocomputing, 160:53–62, 2015.
|
| 282 |
+
|
| 283 |
+
Santiago Zanella-Beguelin, Lukas Wutschitz, Shruti Tople, Victor R ´ uhle, Andrew Paverd, Olga ¨ Ohrimenko, Boris Kopf, and Marc Brockschmidt. Analyzing information leakage of updates to ¨ natural language models. In Proceedings of the 2020 ACM SIGSAC Conference on Computer and Communications Security, pp. 363–375, 2020.
|
| 284 |
+
|
| 285 |
+
# A POISON GENERATION ALGORITHM
|
| 286 |
+
|
| 287 |
+
# Algorithm 1 Gradient Matching to generate poisons (Geiping et al., 2021)
|
| 288 |
+
|
| 289 |
+
Require: Clean network $f ( \cdot ; \theta _ { \mathrm { c l e a n } } )$ trained on uncorrupted base images $S _ { \mathrm { c l } }$ , a target $( x _ { \mathrm { { t a r g e t } } } , y _ { \mathrm { { t a r g e t } } } )$ and an adversarial label yadversarial, Poison budget $P$ , perturbation bound $\varepsilon$ ,
|
| 290 |
+
number of restar1: Collect a dataset $R$ stof $M$ ny images whose true label is yadversarial. $S _ { \mathrm { p o } } = \left\{ x ^ { i } , y ^ { i } \right\} _ { i = 1 } ^ { P }$ $P$ restarts do 3: Randomly initialize perturbations $\Delta$ s.t. $\| \Delta \| _ { \infty } \leq \varepsilon$ . 4: for $k = 1 , \dots , M$ optimization steps do 5: Compute the loss $\phi ( \Delta , \theta _ { \mathrm { c l e a n } } )$ as in (4) using the base poison images in $S _ { \mathrm { p o } }$ . 6: Update $\Delta$ using an Adam update to minimize $\phi$ , and project onto the constraint set $\Gamma$ . 7: end for 8: Amongst the $R$ restarts, choose the $\Delta _ { * }$ with the smallest value of $\phi ( \Delta _ { * } , \theta _ { \mathrm { c l e a n } } )$ .
|
| 291 |
+
9: end for10: Return the poisoned set $S _ { \mathrm { p o } } = \left\{ x ^ { i } + \Delta _ { * } ^ { i } , y ^ { i } \right\} _ { i = 1 } ^ { P } .$
|
| 292 |
+
|
| 293 |
+
# Algorithm 2 Gradient Matching to generate camouflages
|
| 294 |
+
|
| 295 |
+
Require: Network $f ( \cdot ; \theta _ { \mathrm { c p } } )$ trained on $S _ { \mathrm { c l } } + S _ { \mathrm { p o } }$ , the target $( x _ { \mathrm { { t a r g e t } } } , y _ { \mathrm { { t a r g e t } } } )$ ), Camouflage budget
|
| 296 |
+
$C$ , perturbation bound $\varepsilon$ , number of restarts $R$ , optimization steps $M$
|
| 297 |
+
1: Collect a dataset $\boldsymbol { S _ { \mathrm { c a } } } = \left\{ \boldsymbol { x ^ { j } } , \boldsymbol { y ^ { j } } \right\} _ { j = 1 } ^ { C }$ of $C$ many images whose true label is $y _ { \mathrm { t a r g e t } }$ .
|
| 298 |
+
2: for $r = 1 , \dots R$ restarts do
|
| 299 |
+
3: Randomly initialize perturbations $\Delta$ s.t. $\| \Delta \| _ { \infty } \leq \varepsilon$ .
|
| 300 |
+
4: for $k = 1 , \dots , M$ optimization steps do
|
| 301 |
+
5: Compute the loss $\psi ( \Delta , \theta _ { \mathrm { c p } } )$ as in (4) using the base camouflage images in $S _ { \mathrm { c a } }$ .
|
| 302 |
+
6: Update $\Delta$ using an Adam update to minimize $\psi$ , and project onto the constraint set $\Gamma$ .
|
| 303 |
+
7: end for
|
| 304 |
+
8: Amongst the $R$ restarts, choose the $\Delta _ { * }$ with the smallest value of $\psi ( \Delta _ { * } , \theta _ { \mathrm { c p } } )$ .
|
| 305 |
+
9: end for
|
| 306 |
+
|
| 307 |
+
$\begin{array} { r } { S _ { \mathrm { c a } } = \left\{ x ^ { j } + \Delta _ { * } ^ { j } , y ^ { j } \right\} _ { j = 1 } ^ { C } . } \end{array}$
|
| 308 |
+
|
| 309 |
+
# B EXPERIMENT DETAILS
|
| 310 |
+
|
| 311 |
+
# B.1 HARDWARE
|
| 312 |
+
|
| 313 |
+
All our experiments were executed on Google Colab with a Google Colab Pro+ subscription.
|
| 314 |
+
|
| 315 |
+
# B.2 CODE
|
| 316 |
+
|
| 317 |
+
We provide code for our experiments as ready-to-deploy Colab notebooks (as well as Python files). In the supplementary material, the code can be found in:
|
| 318 |
+
|
| 319 |
+
1. SVM Binay cifar10 code submission.ipynb: Experiments for Binary-CIFAR10 dataset with linear SVM.
|
| 320 |
+
2. Neural network Cifar10 code submission.ipynb: Experiments for CIFAR10 dataset with various neural network models.
|
| 321 |
+
3. Neural network Imagenette Imagewoof code submission.ipynb: Experiments for Imagenette / Imagewoof dataset with various neural network models.
|
| 322 |
+
|
| 323 |
+
# B.3 EXPERIMENTAL SETUP
|
| 324 |
+
|
| 325 |
+
For the ease of replication, we report the corresponding poison class, target class, camouflage class and Target ID for various seeds in different experiments.
|
| 326 |
+
|
| 327 |
+
Table 3: Target, poison and camouflage class corresponding to different initial random seeds used for CIFAR-10 experiments. The reported Target ID is relative to the CIFAR-10 validation dataset.
|
| 328 |
+
|
| 329 |
+
<table><tr><td>RandomSeed</td><td>Target Class</td><td>Poison Class</td><td>Camouflage Class</td><td>Target ID</td></tr><tr><td>2000000000</td><td>Deer</td><td>Bird</td><td>Deer</td><td>9621</td></tr><tr><td>2000000001</td><td>Cat</td><td>Horse</td><td>Cat</td><td>1209</td></tr><tr><td>2000000011</td><td>Frog</td><td>Bird</td><td>Frog</td><td>6503</td></tr><tr><td>2000000111</td><td>Bird</td><td>Cat</td><td>Bird</td><td>124</td></tr><tr><td>2000001111</td><td>Plane</td><td>Deer</td><td>Plane</td><td>7649</td></tr><tr><td>2000011111</td><td>Cat</td><td>Dog</td><td>Cat</td><td>4423</td></tr><tr><td>2000111111</td><td>Truck</td><td>Car</td><td>Truck</td><td>8117</td></tr><tr><td>2001111111</td><td>Bird</td><td>Truck</td><td>Bird</td><td>3686</td></tr><tr><td>2011111111</td><td>Cat</td><td>Bird</td><td>Cat</td><td>642</td></tr><tr><td>2111111111</td><td>Frog</td><td>Ship</td><td>Frog</td><td>97</td></tr></table>
|
| 330 |
+
|
| 331 |
+
Table 4: Target class, poison class and camouflage class corresponding to different random seeds used for Imagenette experiments. The reported target ID is relative to the Imagenette validation set.
|
| 332 |
+
|
| 333 |
+
<table><tr><td>RandomSeed</td><td>Target Class</td><td>Poison Class</td><td>Camouflage Class</td><td>Target ID</td></tr><tr><td>2000000000</td><td>Building</td><td>Cassette player</td><td>Building</td><td>1559</td></tr><tr><td>2000000001</td><td>Chain saw</td><td>Gas pump</td><td>Chain saw</td><td>1266</td></tr><tr><td>2000000011</td><td>Truck</td><td>Cassette player</td><td>Truck</td><td>2460</td></tr><tr><td>2000000111</td><td>Cassette player</td><td>Chain saw</td><td>Cassette player</td><td>792</td></tr><tr><td>2000001111</td><td>Tench</td><td>Building</td><td>Tench</td><td>2500</td></tr><tr><td>2000011111</td><td>Chain saw</td><td>French horn</td><td>Chain saw</td><td>1162</td></tr><tr><td>2000111111</td><td>Parachute</td><td>English springer</td><td>Parachute</td><td>3826</td></tr><tr><td>2001111111</td><td>Cassette player</td><td>Parachute</td><td>Cassette player</td><td>1121</td></tr><tr><td>2011111111</td><td>Chain saw</td><td>Cassette player</td><td>Chain saw</td><td>1198</td></tr><tr><td>2111111111</td><td>Truck</td><td>Golf ball</td><td>Truck</td><td>2343</td></tr></table>
|
| 334 |
+
|
| 335 |
+
Table 5: Target class, poison class and camouflage class corresponding to different random seeds used for Imagewoof experiments. The reported target ID is relative to the Imagewoof validation set.
|
| 336 |
+
|
| 337 |
+
<table><tr><td>RandomSeed</td><td>Target Class</td><td>Poison Class</td><td>Camouflage Class</td><td>Target ID</td></tr><tr><td>2000000000</td><td>BorderTerrier</td><td>Beagle</td><td>BorderTerrier</td><td>1493</td></tr><tr><td>2000000001</td><td>English Foxhound</td><td>Old English Sheep Dog</td><td>English Foxhound</td><td>1362</td></tr><tr><td>2000000011</td><td>Golden Retriever</td><td>Beagle</td><td>Golden Retriever</td><td>2399</td></tr><tr><td>2000000111</td><td>Beagle</td><td>English Foxhound</td><td>Beagle</td><td>827</td></tr><tr><td>2000001111</td><td>Shih-Tzu</td><td>Border Terrier</td><td>Shih-Tzu</td><td>250</td></tr><tr><td>2000011111</td><td>English Foxhound</td><td>Austrailian Terrier</td><td>English Foxhound</td><td>1405</td></tr><tr><td>2000111111</td><td>Dingo</td><td>Rodesian Ridgeback</td><td>Dingo</td><td>3810</td></tr><tr><td>2001111111</td><td>Beagle</td><td>Dingo</td><td>Beagle</td><td>1204</td></tr><tr><td>2011111111</td><td>English Foxhound</td><td>Beagle</td><td>English Foxhound</td><td>1294</td></tr><tr><td>2111111111</td><td>Golden Retriever</td><td>Samoeyed</td><td>Golden Retriever</td><td>2282</td></tr></table>
|
| 338 |
+
|
| 339 |
+
# B.4 ADDITIONAL DETAILS ON CIFAR-10 EXPERIMENTS
|
| 340 |
+
|
| 341 |
+
We elaborate on the results reported in Figure 3. In Table 6, we report the efficacy of the proposed camouflaged poisoning attack on different neural network architectures where the threat model is given by $\varepsilon = 1 6 , b _ { p } = 0 . 6 \% , b _ { c } = 0 . 6 \%$ . The reported results are an average over 5 seeds from 2000000000-2000001111. In the first column under attack success, we report the number of times poisoning was successful amongst the run trials, and in the second column, we report the number of times camouflaging was successful for the trials for which poisoning was successful.
|
| 342 |
+
|
| 343 |
+
In Table 7, we report the success of the proposed attack when we change the threat model, but fix the network architecture to be ResNet-18. Each experiment was repeated times 5 times with 8 restarts each time, and the mean success rate is reported. These experiments were conducted with 5 seeds from 2000011111-2111111111.
|
| 344 |
+
|
| 345 |
+
Table 6: Evaluating our proposed camouflaged poisoning attack on various model architectures on the CIFAR-10 dataset with the threat model $\bar { \varepsilon } = \bar { 1 } 6 , b _ { p } = \bar { 0 } . 6 \% , b _ { c } = 0 . 6 \%$ .
|
| 346 |
+
|
| 347 |
+
<table><tr><td rowspan="2">Network Architecture</td><td colspan="2">Attack success</td><td colspan="3">Validation Accuracy</td></tr><tr><td>Poisoning</td><td>Camouflaging</td><td>Clean</td><td>Poisoned</td><td>Camouflaged</td></tr><tr><td>VGG-11</td><td>100%</td><td>80%</td><td>85.01</td><td>85.03 (± 0.37)</td><td>85.10 (± 0.29)</td></tr><tr><td>VGG-16</td><td>80%</td><td>75%</td><td>87.68</td><td>87.42 (± 0.17)</td><td>87.45 (± 0.26)</td></tr><tr><td>ResNet-18</td><td>80%</td><td>75%</td><td>82.13</td><td>81.88 (± 0.15)</td><td>81.80 (± 0.12)</td></tr><tr><td>ResNet-34</td><td>80%</td><td>50%</td><td>82.45</td><td>82.61 (± 0.30)</td><td>83.12 (± 0.93)</td></tr><tr><td>ResNet-50</td><td>80%</td><td>25%</td><td>81.02</td><td>81.76 (± 0.13)</td><td>84.62 (± 0.71)</td></tr><tr><td>MobileNetV2</td><td>60%</td><td>33%</td><td>82.79</td><td>83.26 (± 0.25)</td><td>85.47 (± 0.27)</td></tr></table>
|
| 348 |
+
|
| 349 |
+
Table 7: Evaluating our proposed camouflaged poisoning attack on various threat models with CIFAR-10 dataset trained on ResNet-18.
|
| 350 |
+
|
| 351 |
+
<table><tr><td colspan="2">Threat model</td><td colspan="2">Attack success</td><td colspan="3">Validation Accuracy</td></tr><tr><td>0</td><td>bp</td><td>bc</td><td>Poisoning Camouflaging</td><td>Clean</td><td>Poisoned</td><td>Camouflaged</td></tr><tr><td>16</td><td>1%</td><td>1%</td><td>100% 80%</td><td>82.13</td><td>81.98 (± 0.16)</td><td>82.12 (± 0.21)</td></tr><tr><td>8</td><td>1%</td><td>1%</td><td>80% 75%</td><td>82.13</td><td>82.21 (± 0.21)</td><td>82.09 (± 0.23)</td></tr><tr><td>16</td><td>2%</td><td>1%</td><td>100% 20%</td><td>82.13</td><td>82.31 (± 0.26)</td><td>82.19 (± 0.24)</td></tr><tr><td>8</td><td>2%</td><td>1%</td><td>100% 40%</td><td>82.13</td><td>82.43 (± 0.30)</td><td>82.34 (± 0.27)</td></tr></table>
|
| 352 |
+
|
| 353 |
+

|
| 354 |
+
Figure 4: Visualization of poisons and camouflages on Binary-CIFAR-10 dataset (animal vs machine classification). The top row shows the original images and the bottom row shows the corresponding poisoned / camouflaged images (with the added $\Delta$ ). The shown images were generated for a camouflaged poisoning attack on SVM, with $\mathrm { S e e d } = 5 5 5 5 5 5 5$ , $\varepsilon = 1 6$ , $b _ { p } = 0 . 2 , b _ { c } = 0 . 4$ and the target ID 6646.
|
| 355 |
+
|
| 356 |
+

|
| 357 |
+
Figure 5: Visualization of poisons and camouflages on CIFAR-10 dataset (multiclass classification task). The top row shows the original images and the bottom row shows the corresponding poisoned / camouflaged images (with the added $\Delta$ ). The shown images were generated for a camouflaged poisoning attack on ResNet-18, with $\mathrm { S e e d } = 2 0 0 0 0 0 0 0 0 0 0$ $\varepsilon = 8$ , $b _ { p } = 0 . 2 , b _ { c } = 0 . 4$ , poison class bird, target class deer, and the target ID 9621.
|
| 358 |
+
|
| 359 |
+

|
| 360 |
+
Figure 6: Visualization of poisons and camouflages on Imagenette dataset. The first and the third columns shows the original images, and the second and the fourth columns shows the corrupted images (with added $\Delta$ ). The shown images were generated for a camouflaged poisoning attack on ResNet-18, with S $\mathrm { e e d } = 2 0 0 0 0 1 1 1 1$ 11 and $\varepsilon = 8$ . The target and camouflage class is chain saw, and the poison class is French horn.
|
| 361 |
+
|
| 362 |
+

|
| 363 |
+
Figure 7: Some representative poison and camouflage images for attack on Imagewoof dataset. In each pair, the left figure is the original picture from the training dataset and the right figure has been adversarially manipulated by adding $\Delta$ . The shown images were generated for a camouflaged poisoning attack on Resnet-18, with S $\mathbf { \dot { \ s e d } } = 1 0 0 0 0 0 0 0 5$ , $b _ { p } = \bar { b } _ { c } = 6 . 6 \%$ and $\varepsilon = 1 6$ . The target and camouflage class is English Springer, and the poison class is Building (Church).
|
| 364 |
+
|
| 365 |
+

|
| 366 |
+
Figure 8: Visualization of poisons and camouflages on Imagewoof dataset. The first and the third columns shows the original images, and the second and the fourth columns shows the corrupted images (with added $\Delta$ ). The shown images were generated for a camouflaged poisoning attack on ResNet-18, with Seed = 2111111110, $b _ { p } = b _ { c } = 4 . 2 \%$ , $\varepsilon = 1 6$ . The target and camouflage class is Austrailian Terrier, and the poison class is Golden Retriever.
|
| 367 |
+
|
| 368 |
+
# B.6 ADDITIONAL EXPERIMENTS
|
| 369 |
+
|
| 370 |
+
B.6.1 ABLATION STUDY FOR DIFFERENT VALUES OF $b _ { p }$ AND $\cdot$
|
| 371 |
+
|
| 372 |
+
In this section, we explore the effect of changing the relative sizes of the poison samples and camouflage samples. The experiments are performed on ResNet-18 for CIFAR-10 dataset with $b _ { p } = 1 \%$ and $\_$ respectively, and vice-versa. We report the results in Table 8.
|
| 373 |
+
|
| 374 |
+
One may also wonder what is the price that an attacker has to pay in terms of the success rate of a poisoning (only) attack if it chooses to devote a part of the budget for camouflages. In Table 9, we report the results for comparing the success rate $1 \%$ poisons and $1 \%$ camouflages, to success rate with $2 \%$ poisons (and no camouflages.)
|
| 375 |
+
|
| 376 |
+
<table><tr><td colspan="2">Problem parameters</td><td colspan="2">Attack success</td><td colspan="3">Validation Accuracy</td></tr><tr><td>bp</td><td>bc</td><td>Poisoning</td><td>Camouflaging</td><td>Clean</td><td>Poisoned</td><td>Camouflaged</td></tr><tr><td>1%</td><td>1.5%</td><td>83%</td><td>80%</td><td>0.822</td><td>0.8191</td><td>0.8264</td></tr><tr><td>1%</td><td>0.5%</td><td>83%</td><td>40%</td><td>0.845</td><td>0.8395</td><td>0.8432</td></tr><tr><td>1%</td><td>1%</td><td>83%</td><td>80%</td><td>0.822</td><td>0.8274</td><td>0.8244</td></tr><tr><td>0.5%</td><td>1%</td><td>33%</td><td>50%</td><td>0.822</td><td>0.8261</td><td>0.8194</td></tr><tr><td>1.5%</td><td>1%</td><td>83%</td><td>20%</td><td>0.822</td><td>0.8156</td><td>0.8118</td></tr></table>
|
| 377 |
+
|
| 378 |
+
Table 8: Effect of different sizes of poison and camouflage datasets on the success of the proposed camouflaged poisoning attack on CIFAR-10 dataset trained on ResNet-18, with $\varepsilon = 1 6$ . The reported success rates are averaged over six different trials with seeds 200000111-211111111. For each experiment, we do 4 restarts for every poison and camouflage generation.
|
| 379 |
+
|
| 380 |
+
<table><tr><td colspan="2">Problem parameters</td><td colspan="2">Attack success</td><td colspan="3">Validation Accuracy</td></tr><tr><td>bp</td><td>bc</td><td>Poisoning</td><td>Camouflaging</td><td>Clean</td><td>Poisoned</td><td>Camouflaged</td></tr><tr><td>1%</td><td>1%</td><td>83%</td><td>80%</td><td>0.822</td><td>0.8274</td><td>0.8244</td></tr><tr><td>2%</td><td>0</td><td>83%</td><td>N/A</td><td>0.822</td><td>0.817</td><td>N/A</td></tr></table>
|
| 381 |
+
|
| 382 |
+
Table 9: Comparison of success rate when the allocated budget of $2 \%$ is split as: (a) $1 \%$ poisons and $1 \%$ camouflage, and (b) $2 \%$ poison samples and $0 \%$ camouflages. The experiment is performed on CIFAR-10 dataset trained on ResNet-18 with $\varepsilon = 1 6$ . The reported success rates are averaged over six different trials with seeds 200000111 - 211111111. For each experiment, we do 4 restarts per poison or camouflage generation.
|
| 383 |
+
|
| 384 |
+
# B.6.2 ROBUSTNESS OF OUR ATTACK TO RANDOM DELETIONS
|
| 385 |
+
|
| 386 |
+
We next explore the effect of random removal of the generated poison and camouflage samples on the success of our attack. In a data-scraping scenario, a victim may not scrape all the data points modified by an attacker. In Table 10, we report the result where different amounts of the generated poison and camouflage samples are deleted uniformly at random.
|
| 387 |
+
|
| 388 |
+
<table><tr><td colspan="2">Amount removed</td><td colspan="2">Attack success</td><td colspan="3">Validation Accuracy</td></tr><tr><td>Poisons</td><td>Camouflages</td><td>Poisoning</td><td>Camouflaging</td><td>Clean</td><td>Poisoned</td><td>Camouflaged</td></tr><tr><td>5%</td><td>5%</td><td>80%</td><td>75%</td><td>0.822</td><td>0.823</td><td>0.819</td></tr><tr><td>10%</td><td>10%</td><td>60%</td><td>33%</td><td>0.822</td><td>0.817</td><td>0.825</td></tr><tr><td>20%</td><td>20%</td><td>80%</td><td>100%</td><td>0.822</td><td>0.826</td><td>0.820</td></tr><tr><td>30%</td><td>30%</td><td>100%</td><td>80%</td><td>0.822</td><td>0.8215</td><td>0.818</td></tr><tr><td>40%</td><td>40%</td><td>20%</td><td>100%</td><td>0.822</td><td>0.825</td><td>0.817</td></tr></table>
|
| 389 |
+
|
| 390 |
+
Table 10: Effect of random removal of the generated poison and camouflage samples on the success of the proposed camouflaged poisoning attack on CIFAR-10 dataset trained on ResNet-18, with $\varepsilon \ = \ 1 6$ . The reported success rates are averaged over 5 different trials with seeds 200001111 - 211111111. For each experiment, we do 4 restarts for every poison and camouflage generation.
|
| 391 |
+
|
| 392 |
+
# B.6.3 TRANSFER EXPERIMENTS
|
| 393 |
+
|
| 394 |
+
In this section, we show that the poison and camouflage samples generated by the proposed approach transfer across models. Thus, an attacker can successfully execute the camouflaged poisoning attack, even if the victim trains a different model than the one on which the poison and camouflage samples were generated. We show the transfer success in Figure 9. The brewing network denotes the network architecture on which poison and camouflage samples were generated (we adopt the same notation as Geiping et al. (2021)). The victim network denotes the model architecture used by the victim for training on the manipulated dataset.
|
| 395 |
+
|
| 396 |
+
We ran a total of 3 experiments per (brewing model, victim model) pair using the seeds 2000000000- 2000000011. Each reported number denotes the fraction of times when both poisoning and camouflaging were successful in the transfer experiment, and thus the attack could take place.
|
| 397 |
+
|
| 398 |
+

|
| 399 |
+
Figure 9: Transfer experiments on CIFAR-10 dataset.
|
| 400 |
+
|
| 401 |
+
# B.6.4 ROBUSTNESS TO DATA AUGMENTATION
|
| 402 |
+
|
| 403 |
+
Data augmentation is commonly used to avoid overfitting in deep neural networks. In order to be applicable in the real life, our poisoning and camouflaging attacks must be successful even when the model is trained with data augmentation. In order to validate this, we evaluate our approach on CIFAR-10 dataset trained with data augmentation on ResNet-18 in the threat model $\varepsilon = 1 6 , b _ { p } =$ $b _ { c } = 1 \%$ ; the results are in Table 11. The considered data augmentations are:
|
| 404 |
+
|
| 405 |
+
1. No Augmentation: Exact images from the training dataset are used.
|
| 406 |
+
|
| 407 |
+
2. Augmentation Set 1: $5 0 \%$ chance that the image will be horizontally flipped, but no rotations.
|
| 408 |
+
|
| 409 |
+
3. Augmentation Set 2: $5 0 \%$ chance that the image will be horizontally flipped, and random rotations in Uniform(−10, 10) degrees.
|
| 410 |
+
|
| 411 |
+
The reported results in Table 11 are an average over 5 random seeds from ”kkkkkk” where $1 \leq k \leq 5$ . As expected, the validation accuracy for the model trained on clean dataset increased from $82 \%$ percent when trained without augmentation, to $86 \%$ for augmentation Set 1 and $8 8 \%$ for augmentation set 2. The addition of data augmentation during training and re-training stages make it harder for poisoning to succeed and at the same time makes it easier for camouflaging to succeed.
|
| 412 |
+
|
| 413 |
+
Table 11: Effect of data augmentation on our proposed camouflaged poisoning attack.
|
| 414 |
+
|
| 415 |
+
<table><tr><td rowspan="2">Data Augmentation</td><td colspan="2">Attack success</td><td colspan="3">Validation Accuracy</td></tr><tr><td>Poisoning</td><td>Camouflaging</td><td>Clean</td><td>Poisoned</td><td>Camouflaged</td></tr><tr><td>No Augmentation</td><td>100%</td><td>20%</td><td>82%</td><td>82%</td><td>82%</td></tr><tr><td>Augmentation Set 1</td><td>86%</td><td>33%</td><td>86%</td><td>85%</td><td>86%</td></tr><tr><td>Augmentation Set 2</td><td>60%</td><td>100%</td><td>88%</td><td>86</td><td>86%</td></tr></table>
|
| 416 |
+
|
| 417 |
+
# B.6.5 SIMILARITY OF THE FEATURE SPACE DISTANCE
|
| 418 |
+
|
| 419 |
+
A natural approach to defend against dataset manipulation attacks is to try to identify the modified images, and then remove them from the training dataset (i.e., data sanitization). For instance, one could cluster images based on their distance from their class mean image, or from the target image. This type of defense could potentially thwart watermarking poisoning attacks such as Poison Frogs (Shafahi et al., 2018). As we show in Figure 10, such a defense would not be effective against our proposed poison and camouflage generation procedures, as the data distribution for the poison set and the camouflage set is similar to that of the clean images from the respective classes.
|
| 420 |
+
|
| 421 |
+

|
| 422 |
+
Figure 10: Feature space distance for our generated poison and camouflage set. The reported data was collected by a successful camouflaged poisoning attack on Resnet-18 model trailed on CIFAR10 with seed 2000000000, $\varepsilon = 1 6$ and $\bar { b _ { p } } = \bar { b } _ { c } = 1 \%$ .
|
md/dev/NAQvF08TcyG/NAQvF08TcyG.md
ADDED
|
@@ -0,0 +1,578 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AN IMAGE IS WORTH ONE WORD: PERSONALIZING TEXT-TO-IMAGE GENERATION USING TEXTUAL INVERSION
|
| 2 |
+
|
| 3 |
+
Rinon Gal1,2
|
| 4 |
+
|
| 5 |
+
Yuval Alaluf1
|
| 6 |
+
|
| 7 |
+
Yuval Atzmon2
|
| 8 |
+
|
| 9 |
+
Or Patashnik1
|
| 10 |
+
|
| 11 |
+
Amit H. Bermano1
|
| 12 |
+
|
| 13 |
+
Gal Chechik2
|
| 14 |
+
|
| 15 |
+
Daniel Cohen-Or1
|
| 16 |
+
|
| 17 |
+
1Tel-Aviv University
|
| 18 |
+
|
| 19 |
+
2NVIDIA
|
| 20 |
+
|
| 21 |
+
# ABSTRACT
|
| 22 |
+
|
| 23 |
+
Text-to-image models offer unprecedented freedom to guide creation through natural language. Yet, it is unclear how such freedom can be exercised to generate images of specific unique concepts, modify their appearance, or compose them in new roles and novel scenes. In other words, we ask: how can we use languageguided models to turn our cat into a painting, or imagine a new product based on our favorite toy? Here we present a simple approach that allows such creative freedom. Using only 3-5 images of a user-provided concept, like an object or a style, we learn to represent it through new “words” in the embedding space of a frozen text-to-image model. These “words” can be composed into natural language sentences, guiding personalized creation in an intuitive way. Notably, we find evidence that a single word embedding is sufficient for capturing unique and varied concepts. We compare our approach to a wide range of baselines, and demonstrate that it can more faithfully portray the concepts across a range of applications and tasks. Code, data and new words are available at our project page.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: (left) We find new pseudo-words in the embedding space of pre-trained text-to-image models which describe specific concepts. (right) These pseudo-words are composed into new sentences, placing our targets in new scenes, changing their style or ingraining them into new products.
|
| 27 |
+
|
| 28 |
+
# 1 INTRODUCTION
|
| 29 |
+
|
| 30 |
+
Large-scale text-to-image models (Rombach et al., 2021; Ramesh et al., 2021; 2022; Nichol et al., 2021; Yu et al., 2022; Saharia et al., 2022) have demonstrated an unprecedented capability to reason over natural language descriptions. They allow users to synthesize novel scenes with unseen compositions and produce vivid pictures in a myriad of styles. These tools have been used for artistic creation, as sources of inspiration, and even to design new, physical products (Yacoubian, 2022). Their use, however, is constrained by the user’s ability to describe the desired target through text. One can then ask: How could we instruct such models to mimic the likeness of a specific object? How could we ask them to craft a novel scene containing a cherished childhood toy? Or to pull our child’s drawing from its place on the fridge, and turn it into an artistic showpiece?
|
| 31 |
+
|
| 32 |
+
Introducing new concepts into large scale models is often difficult. Re-training a model with an expanded dataset for each new concept is prohibitively expensive, and fine-tuning on few examples typically leads to catastrophic forgetting (Ding et al., 2022; Li et al., 2022). More measured approaches freeze the model and train transformation modules to adapt its output when faced with new concepts (Zhou et al., 2021; Gao et al., 2021; Skantze & Willemsen, 2022). However, these approaches are still prone to forgetting prior knowledge, or face difficulties in accessing it concurrently with newly learned concepts (Kumar et al., 2022; Cohen et al., 2022).
|
| 33 |
+
|
| 34 |
+
We propose to overcome these challenges by finding new words in the textual embedding space of pre-trained text-to-image models. We consider the first stage of the text encoding process (Figure 2). Here, an input string is first converted to a set of tokens. Each token is then replaced with its own embedding vector, and these vectors are fed through the downstream model. Our goal is to find new embedding vectors that represent new, specific concepts.
|
| 35 |
+
|
| 36 |
+
We represent a new embedding vector with a new pseudo-word (Rathvon, 2004) which we denote by $S _ { * }$ . This pseudo-word is then treated like any other word, and can be used to compose novel textual queries for the generative models. One can therefore ask for “a photograph of $S _ { * }$ on the beach”, “an oil painting of a $S _ { * }$ hanging on the wall”, or even compose two concepts, such as “a drawing of $S _ { * } ^ { 1 }$ in the style of $S _ { * } ^ { 2 } { } ^ { , }$ . Importantly, this process leaves the generative model untouched. In doing so, we retain the rich textual understanding and generalization capabilities that are typically lost when fine-tuning vision and language models on new tasks.
|
| 37 |
+
|
| 38 |
+
To find these pseudo-words, we frame the task as one of inversion. We are given a pre-trained textto-image model and a small (3-5) image set depicting the concept. We aim to find a word embedding, so that prompts of the form “A photo of $S _ { * } ^ { \mathrm { ~ \scriptsize ~ , ~ , ~ } }$ will lead to the reconstruction of images from our set. This embedding is found using an optimization process, which we refer to as “Textual Inversion”.
|
| 39 |
+
|
| 40 |
+
We further investigate a series of extensions based on tools typically used in Generative Adversarial Network (GAN) inversion. Our analysis reveals that, while some core principles remain, applying the prior art in a na¨ıve way may harm performance.
|
| 41 |
+
|
| 42 |
+
We demonstrate the effectiveness of our approach over a wide range of concepts and prompts, showing that it can inject unique objects into new scenes, transform them across different styles, transfer poses, diminish biases, and even imagine new products.
|
| 43 |
+
|
| 44 |
+
In summary, our contributions are as follows:
|
| 45 |
+
|
| 46 |
+
• We introduce the task of personalized text-to-image generation, where we synthesize novel scenes of user-provided concepts guided by natural language instructions. • We present the idea of “Textual Inversions” in the context of generative models. Here the goal is to find new pseudo-words in the embedding space of a text encoder that can capture both high-level semantics and fine visual details. • We conduct a prelminary analysis of the properties of the textual embedding space.
|
| 47 |
+
|
| 48 |
+
# 2 RELATED WORK
|
| 49 |
+
|
| 50 |
+
Text-guided synthesis. Text-guided image synthesis has been widely studied in the context of GANs (Goodfellow et al., 2014). Typically, a conditional model is trained to reproduce samples from paired image-caption datasets (Zhu et al., 2019; Tao et al., 2020) by leveraging attention mechanisms (Xu et al., 2018) or cross-modal contrastive approaches (Zhang et al., 2021; Ye et al., 2021). More recently, impressive visual results were achieved using large scale auto-regressive (Ramesh et al., 2021; Yu et al., 2022) or diffusion models (Ramesh et al., 2022; Saharia et al., 2022; Nichol et al., 2021; Rombach et al., 2021). Alternatively, test-time optimization can be used to explore the latent space of pre-trained generators (Crowson et al., 2022; Murdock, 2021; Crowson, 2021). Typically, by maximizing a text-to-image similarity score derived from CLIP (Radford et al., 2021).
|
| 51 |
+
|
| 52 |
+
Moving beyond pure generation, a large body of work explores the use of text-based interfaces for image editing (Patashnik et al., 2021; Abdal et al., 2021; Avrahami et al., 2022b), generator domain adaptation (Gal et al., 2021; Kim et al., 2022) and style transfer (Kwon & Ye, 2021; Liu et al., 2022).
|
| 53 |
+
|
| 54 |
+
Our approach builds on the open-ended, conditional synthesis models. Rather than training a new model from scratch, we show that we can expand a frozen model’s vocabulary and introduce new pseudo-words that describe specific concepts.
|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
Figure 2: Outline of the text-embedding and inversion process. A string containing our placeholder word is first converted into tokens (i.e. word or sub-word indices in a dictionary). These tokens are converted to continuous vector representations (the “embeddings”, $v$ ). Finally, the embedding vectors are transformed into a conditioning code $c _ { \theta } ( y )$ that guides the generation. We optimize the embedding vector $v _ { * }$ associated with our pseudo-word $S _ { * }$ , using a reconstruction objective.
|
| 58 |
+
|
| 59 |
+
GAN inversion. Manipulating images with generative networks often requires one to find a corresponding latent representation of the given image, a process referred to as inversion (Zhu et al., 2016; Xia et al., 2021). In the GAN literature, this inversion is done through either an optimizationbased technique (Abdal et al., 2019; 2020; Zhu et al., 2020b; Gu et al., 2020) or by using an encoder (Richardson et al., 2020; Zhu et al., 2020a; Pidhorskyi et al., 2020; Tov et al., 2021).
|
| 60 |
+
|
| 61 |
+
In our work, we follow the optimization approach, as it can better adapt to unseen concepts. Encoders face harsher generalization requirements, and would likely need to be trained on web-scale data to offer the same freedom. We further analyze our embedding space in light of the GANinversion literature, outlining the core principles that remain and those that do not.
|
| 62 |
+
|
| 63 |
+
Diffusion-based inversion. Diffusion inversion can be performed na¨ıvely by adding noise to an image and then de-noising it through the network. However, this process tends to change the image content. Choi et al. (2021) improve inversion by conditioning the denoising process on low-pass filter data from the target image. (Dhariwal & Nichol, 2021) demonstrate that the DDIM (Song et al., 2020) sampling process can be inverted in a closed-form manner, extracting a latent noise map that will produce a given real image. DALL-E 2 (Ramesh et al., 2022) builds on this method and demonstrates that it can be used to facilitate cross-image interpolations or semantic editing.
|
| 64 |
+
|
| 65 |
+
Whereas the above works invert a given image into the model’s latent space, we invert a userprovided concept. Moreover, we represent this concept as a new pseudo-word in the model’s vocabulary, allowing for more general and intuitive editing.
|
| 66 |
+
|
| 67 |
+
Personalization. Recent work in graphics aims to adapt models to better represent specific individuals or objects. There, it is typical to delicately tune a model to better reconstruct specific faces or scenes (Bau et al., 2019; Roich et al., 2021; Alaluf et al., 2021; Nitzan et al., 2022).
|
| 68 |
+
|
| 69 |
+
PALAVRA (Cohen et al., 2022) identifies pseudo-words in the textual embedding space of CLIP for personalized retrieval and segmentation. However, their task and losses are discriminative, aiming to separate an object from other candidates. As we later show (Figure 5), this approach fails to capture details required for plausible reconstructions or synthesis in new scenes.
|
| 70 |
+
|
| 71 |
+
# 3 METHOD
|
| 72 |
+
|
| 73 |
+
Our goal is to enable language-guided generation of new, user-specified concepts. To do so, we aim to encode these concepts into an intermediate representation of a pre-trained text-to-image model. Ideally, this should be done in a manner that allows us to leverage the rich semantic and visual prior represented by such a model, and use it to guide intuitive visual transformations of the concepts.
|
| 74 |
+
|
| 75 |
+
It is natural to search for candidates for such a representation in the word-embedding stage of the text encoders typically employed by text-to-image models. There, the discrete input text is first converted into a continuous vector representation that is amenable to direct optimization.
|
| 76 |
+
|
| 77 |
+
Prior work has shown that this embedding space is expressive enough to capture basic image semantics (Cohen et al., 2022; Tsimpoukelli et al., 2021). However, these approaches leveraged contrastive or language-completion objectives, neither of which require an in-depth visual understanding of the image. As we demonstrate in Section 4, such methods fail to accurately capture the appearance of the concept, and attempting to employ them for synthesis leads to considerable visual corruption. Our goal is to find pseudo-words that can guide generation, which is a visual task. As such, we propose to find them through a visual reconstruction objective.
|
| 78 |
+
|
| 79 |
+
Below, we outline the core details of applying our approach to a specific class of generative models — Latent Diffusion Models (Rombach et al., 2021). In Section 5, we then analyze a set of extensions to this approach, motivated by GAN-inversion literature.
|
| 80 |
+
|
| 81 |
+
Latent Diffusion Models. We implement our method over Latent Diffusion Models (LDMs) (Rombach et al., 2021), a recently introduced class of Denoising Diffusion Probabilistic Models (DDPMs) (Ho et al., 2020) that operate in the latent space of an autoencoder.
|
| 82 |
+
|
| 83 |
+
LDMs consist of two core components. First, an autoencoder is pre-trained on a large collection of images. An encoder $\mathcal { E }$ learns to map images $x \in \mathcal { D } _ { x }$ into a spatial latent code $z = \mathcal { E } ( x )$ , regularized through either a KL-divergence loss or through vector quantization (Van Den Oord et al., 2017). The decoder $D$ learns to map such latents back to images, such that $D \left( \mathcal { E } ( x ) \right) \approx x$ .
|
| 84 |
+
|
| 85 |
+
The second component, a diffusion model, is trained to produce codes within the learned latent space. This diffusion model can be conditioned on class labels, segmentation masks, or even on the output of a jointly trained text-embedding model. Let $c _ { \theta } ( y )$ be a model that maps a conditioning input $y$ into a conditioning vector. The LDM loss is then given by:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
L _ { L D M } : = \mathbb { E } _ { z \sim \mathcal { E } ( x ) , y , \epsilon \sim \mathcal { N } ( 0 , 1 ) , t } \Big [ \| \epsilon - \epsilon _ { \theta } \big ( z _ { t } , t , c _ { \theta } ( y ) \big ) \| _ { 2 } ^ { 2 } \Big ] ,
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
where $t$ is the time step, $z _ { t }$ is the latent noised to time $t$ , $\epsilon$ is the unscaled noise sample, and $\epsilon _ { \theta }$ is the denoising network. Intuitively, the objective here is to correctly remove the noise added to a latent representation of an image. While training, $c _ { \theta }$ and $\epsilon _ { \theta }$ are jointly optimized to minimize the LDM loss. At inference time, a random noise tensor is sampled and iteratively denoised to produce a new image latent, $z _ { \mathrm { 0 } }$ . Finally, this latent code is transformed into an image $x ^ { \prime } = D ( z _ { 0 } )$ .
|
| 92 |
+
|
| 93 |
+
We employ the publicly available 1.4 billion parameter text-to-image model of Rombach et al. (2021), which was pre-trained on the LAION-400M dataset (Schuhmann et al., 2021). Here, $c _ { \theta }$ is realized through a BERT (Devlin et al., 2018) text encoder, with $y$ being a text prompt. We next review the early stages of such a text encoder, and our choice of inversion space.
|
| 94 |
+
|
| 95 |
+
Text embeddings. Typically, text encoder models begin with a text processing step (Figure 2, left). First, each word or sub-word in an input string is converted to a token, which is an index in some pre-defined dictionary. Each token is then linked to a unique embedding vector, retrieved through an index-based lookup. These embedding vectors are typically learned as part of the text encoder $c _ { \theta }$ .
|
| 96 |
+
|
| 97 |
+
In our work, we choose this embedding space as the target for inversion. Specifically, we designate a placeholder string, $S _ { * }$ , to represent the new concept we wish to learn. We intervene in the embedding process so that the vector associated with the tokenized string is a new, learned embedding $v _ { * }$ , in essence “injecting” the concept into our vocabulary. We can then compose new sentences containing $S _ { * }$ , just as we would with any other word.
|
| 98 |
+
|
| 99 |
+
Textual inversion. To find these new embeddings, we use a small set of images (typically 3- 5), which depict our target concept across multiple settings such as varied backgrounds or poses. We find $v _ { * }$ through direct optimization, by minimizing the LDM loss of Equation (1) over images sampled from the small set. To condition the generation, we randomly sample neutral context texts, derived from the CLIP ImageNet templates (Radford et al., 2021). These contain prompts of the form “A photo of $S _ { * }$ ”, “A rendition of $S _ { * }$ ”, etc. The list of templates is provided in the appendix.
|
| 100 |
+
|
| 101 |
+

|
| 102 |
+
Figure 3: Object variations generated using our method, the CLIP-based reconstruction of DALLE-2 (Ramesh et al., 2022), and human captions of varying lengths.
|
| 103 |
+
|
| 104 |
+
Human captions capture highlevel semantics, but fail to convey fine details or ensure a consistent style. DALLE-2’s image guidance fares better, but still falls short of capturing the unique details of the subject.
|
| 105 |
+
|
| 106 |
+
Our method generates variations which are typically more faithful to the original subject. These demonstrate an ability to capture and represent an object using a single pseudo-word
|
| 107 |
+
|
| 108 |
+
Our optimization goal can then be defined as:
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
v _ { * } = \arg \operatorname* { m i n } _ { v } \mathbb { E } _ { z \sim \mathcal { E } ( x ) , y , \epsilon \sim \mathcal { N } ( 0 , 1 ) , t } \left[ \| \epsilon - \epsilon _ { \theta } \big ( z _ { t } , t , c _ { \theta } ( y , v ) \big ) \| _ { 2 } ^ { 2 } \right] ,
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
and is realized by re-using the same training scheme as the original LDM model, while keeping both $c _ { \theta }$ and $\epsilon _ { \theta }$ fixed. Notably, this is a reconstruction task. As such, we expect it to motivate the learned embedding to capture fine visual details unique to the concept.
|
| 115 |
+
|
| 116 |
+
Implementation details, including hyper-parameter choices, are provided in the appendix.
|
| 117 |
+
|
| 118 |
+
# 4 QUALITATIVE COMPARISONS AND APPLICATIONS
|
| 119 |
+
|
| 120 |
+
In the following section, we demonstrate a range of applications enabled through Textual Inversions, and provide visual comparisons to the state-of-the-art and human-captioning baselines.
|
| 121 |
+
|
| 122 |
+
Image variations We begin by demonstrating our ability to capture an object using a single pseudo-word. In Figure 3 we compare our method to two baselines: LDM guided by a human caption and DALLE-2 guided by either a human caption or an image prompt. To gather captions, we provided annotators with four images of a concept and asked them to describe it in a manner that could allow an artist to recreate it. We collected five short $\leq 1 2$ words) and five long $( \le ~ 3 0$ words) captions per concept. Additional details are provided in the appendix. Figure 3 shows results generated with a randomly chosen caption for each setup.
|
| 123 |
+
|
| 124 |
+
As our results demonstrate, our method better captures the unique details of the concept. Human captioning typically captures the high-level semantics, but fails to cover finer details like color patterns (e.g. the teapot). In some cases (e.g. the skull mug) the object itself may be difficult to describe through natural language. The image-guided DALLE-2 creates more appealing samples, but it still struggles with unique details of novel objects. Our method can successfully capture these finer details. However, note that while our creations are more faithful to the source, they are still variations.
|
| 125 |
+
|
| 126 |
+
Text-guided synthesis Figures 1 and 4 show our ability to compose novel scenes by incorporating the learned pseudo-words into new conditioning texts. The frozen text-to-image model jointly reasons over both the new concepts and its large body of prior knowledge, bringing them together in a new creation. Importantly, despite the fact that our training goal was visual in nature, our pseudowords still encapsulate semantic knowledge. For example, observe the bowl’s ability (row 4) to contain other objects, or the ability to preserve the Furby’s bird-like head and crown while adapting his color to better match a prompt (row 3). Additional results are provided in the appendix.
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
|
| 130 |
+

|
| 131 |
+
Figure 4: Additional text-guided personalized generation results. In each row, we show exemplars from the image set representing the concept, and novel compositions using the learned pseudo-word.
|
| 132 |
+
Figure 5: Comparisons to alternative personalized creation approaches. Our model can more accurately preserve the subject, and can reason over both the novel embedding and the rest of the caption.
|
| 133 |
+
|
| 134 |
+
We further compare our method to several personalization baselines (Figure 5). We first consider the recent PALAVRA (Cohen et al., 2022) which encodes object sets into the textual embedding space of CLIP, using contrastive learning and cyclic consistency goals. We find a new pseudo-word using their approach and use it to synthesize new images with VQGAN-CLIP (Crowson et al., 2022) and CLIP-Guided Diffusion (Crowson, 2021). As a second baseline, we apply the CLIP-guided models of Crowson et al. and jointly minimize the CLIP-based distances to both the training images and target text (VQGAN-CLIP) or by initializing the optimization with an image from our training set, following the recommendations of Letts et al. (2021) (Guided Diffusion).
|
| 135 |
+
|
| 136 |
+
Images produced by PALAVRA (rows 2, 3) contain elements from the target prompt (beach, moon), but fail to capture the concept and display considerable visual corruption. This is unsurprising, as PALAVRA was trained with a discriminative goal. There, the model only needs to encode enough information to distinguish between two typical concepts. Moreover, this goal does not constrain the model to embedding vectors that can be mapped to outputs on the natural image manifold. When using text-and-image guided synthesis methods (rows 4, 5), results appear more natural and closer to the source image, but fail to generalize to new texts. Moreover, these models use CLIP for test-time optimization and thus require expensive optimization for every new creation.
|
| 137 |
+
|
| 138 |
+
Style transfer A typical use case for text-guided synthesis is in artistic circles, where users draw upon the unique style of a specific artist and apply it to new creations. We show that our model can also find pseudo-words representing a specific, unknown style. To do so, we provide the model with a small set of images with a shared style, and replace the training texts with prompts of the form: “A painting in the style of $S _ { * }$ ”. Results are shown in Figure 6. These demonstrate that our ability to capture concepts extends beyond simple object reconstructions and into more abstract ideas.
|
| 139 |
+
|
| 140 |
+

|
| 141 |
+
Figure 6: The textual-embedding space can represent more abstract concepts, including styles. Image credits: $@$ QinniArt (top), $@$ David Revoy (bottom).
|
| 142 |
+
|
| 143 |
+
Additional applications In Appendix A we investigate a range of additional uses of textual inversion, including: composing multiple learned concepts in a single prompt, reducing gender and racial bias, and using our pseudo-words in downstream models built on LDM.
|
| 144 |
+
|
| 145 |
+
Image curation Results in this section are partially curated. For each prompt, we generated 16 candidates (six for DALLE-2) and manually selected the best result. Similar curation processes with larger batches are often employed in text-conditioned generation work (Avrahami et al., 2022b; Ramesh et al., 2021; Yu et al., 2022). This process can be largely automated by using CLIP to rank images (Ramesh et al., 2021). We provide uncurated galleries of generated results in the appendix.
|
| 146 |
+
|
| 147 |
+
# 5 QUANTITATIVE ANALYSIS
|
| 148 |
+
|
| 149 |
+
Inversion into an uncharted latent space provides us with a range of possible design choices. Here, we examine such choices, and through them we analyze the properties of our embedding space.
|
| 150 |
+
|
| 151 |
+
# 5.1 EVALUATION METRICS
|
| 152 |
+
|
| 153 |
+
To analyze the quality of our embeddings, we consider two fronts: reconstruction and promptadherence. First, we wish to gauge our ability to capture a target concept. We do so by considering semantic CLIP-space distances. Specifically, for each concept, we generate 64 images using the prompt: “A photo of $S _ { * } ^ { \mathrm { ~ \scriptsize ~ , ~ , ~ } }$ . Our reconstruction score is the average pair-wise CLIP-space cosinesimilarity between the generated images and the images of the concept-specific training set.
|
| 154 |
+
|
| 155 |
+
Second, we evaluate our ability to modify the concepts using textual prompts. We produce a set of images using prompts of varying difficulty and settings. These include background modifications (“A photo of $S _ { * }$ on the moon”), style changes (“An oil painting of $S _ { * }$ ”), and compositional relations (“Elmo holding a $S _ { * }$ ”). For each prompt, we synthesize 64 samples using 50 DDIM steps, calculate the average CLIP embedding of the samples, and compute their cosine similarity with the CLIP embedding of the textual prompts, where we omit the placeholder $S _ { * }$ (i.e. “A photo of on the moon”). Higher scores indicate more faithfulness to the prompt itself.
|
| 156 |
+
|
| 157 |
+
# 5.2 EVALUATION SETUPS
|
| 158 |
+
|
| 159 |
+
Our evaluations span the following experimental setups:
|
| 160 |
+
|
| 161 |
+
Extended latent spaces Following Abdal et al. (2019), we consider an extended latent space, where $S _ { * }$ is embedded into multiple learned vectors — equivalent to using multiple pseudo-words. We consider two and three pseudo-words (denoted “2-word” and “3-word”, respectively), aiming to alleviate the potential bottleneck of a single embedding, and enabling more accurate reconstructions.
|
| 162 |
+
|
| 163 |
+
Progressive extensions We follow Tov et al. (2021) and consider a progressive multi-vector setup. We begin training with a single embedding vector, introduce a second vector following 2, 000 training steps, and a third vector after 4, 000 steps. Here, we expect the network to initially focus on the core details, and then leverage the additional pseudo-words to capture increasingly finer details.
|
| 164 |
+
|
| 165 |
+
Regularization Tov et al. (2021) observed that codes in the latent space of a GAN have increased editability when they lie closer to codes observed during training. We investigate a similar scenario by introducing a loss term to minimize the L2 distance between the learned embeddings, and the embedding of a coarse descriptor of the subject (e.g. “sculpture” and “cat” for images in Figure 1).
|
| 166 |
+
|
| 167 |
+
Per-image tokens We further investigate a novel scheme where we introduce unique, per-image tokens into our process. Let $\{ x _ { i } \} _ { i = 1 } ^ { n }$ be the set of input images. We introduce both a universal placeholder, $S _ { * }$ , and an additional placeholder unique to each image, $\{ S _ { i } \} _ { i = 1 } ^ { n }$ , associated with a unique embedding $v _ { i }$ . We train with prompts of the form “A photo of $S _ { * }$ with $S _ { i } { } ^ { \ ' }$ , where each image is matched to prompts containing its own, unique placeholder. We jointly optimize over both $S _ { * }$ and $\{ S _ { i } \} _ { i = 1 } ^ { n }$ . The intuition here is that the model should prefer to encode shared information (i.e. the concept) in the shared code $S _ { * }$ , while relegating per-image details such as the background to $S _ { i }$ .
|
| 168 |
+
|
| 169 |
+
Human captions In addition to the learned-embedding setups, we compare to human-level performance using the captions outlined in Section 4. Here, we simply replace the placeholder strings $S _ { * }$ with the human captions, using both the short and long-caption setups.
|
| 170 |
+
|
| 171 |
+
Reference setups To provide intuition for the scale of the results, we add two reference baselines: (1) We consider the expected behavior from a model that perfectly replicates the concepts, but ignores the prompts. We do so by using the training set itself as the “generated samples” (“Image only”). (2) We consider a model that aligns with the prompt, but ignores the personalized concept. We do so by dropping the concept’s pseudo-word from the evaluation prompts (“Prompt only”).
|
| 172 |
+
|
| 173 |
+
Textual-Inversion Finally, we consider our own setup and further evaluate our model with an increased learning rate (2e-2, “High-LR”) and a decreased learning rate (1e-4, “Low-LR”).
|
| 174 |
+
|
| 175 |
+
Additional setups and experiments In appendix E, we consider two additional inversion setups: a pivotal tuning approach (Roich et al., 2021), where the model itself is optimized to improve reconstruction, and DALLE-2 (Ramesh et al., 2022)’s bipartite inversion process. We further analyze the effect of the image-set size, data diversity, and importance of prompt templates (appendix C). Finally, we evaluate our model’s failure rate and coverage (appendix B), our performance on domainadaptation tasks (appendix D) and compare to recent single-image editing approaches (appendix H).
|
| 176 |
+
|
| 177 |
+
# 5.3 RESULTS
|
| 178 |
+
|
| 179 |
+
Evaluation results are summarized in Figure 7(a). We highlight four observations: (1) The semantic reconstruction quality of our method is comparable to sampling random images from the training set. (2) The single-word method considerably improves prompt-adherence over the multi-word baselines, at a minimal cost to reconstruction. These points outline the impressive flexibility of the textual-embedding space, showing that it can capture new concepts with only a single pseudo-word.
|
| 180 |
+
|
| 181 |
+
(3) Our baselines outline a reconstruction-prompt-adherence trade-off curve. Embeddings that lie closer to the true word distribution (e.g. due to regularization, fewer pseudo-words, or a lower learning rate) can be more easily modified, but fail to capture the details of the target. Notably, our single-embedding model can be moved along this curve by simply changing the learning rate, offering a user a degree of control over this trade-off.
|
| 182 |
+
|
| 183 |
+

|
| 184 |
+
Figure 7: Quantitative evaluation results. (a) CLIP similarity metrics. Textual inversion models (blue) outperform human captioning (red) on both image and text similarity. Our baseline model (light blue) represents an appealing point on the distortion-adherence curve, and can be moved along it by changing the learning rate. (b) User study results portray a similar trade-off curve. Moreover, the CLIP-based results align with human preference. Error bars are $9 5 \%$ confidence intervals.
|
| 185 |
+
|
| 186 |
+
(4) The use of human descriptions for the concepts not only fails to capture their likeness, but also leads to diminished prompt-adherence. We hypothesize that this is tied to the selective-similarity property outlined in Paiss et al. (2022), where vision-and-language models tend to focus on a subset of the semantically meaningful tokens in a prompt. Long captions increase the chance of the model ignoring our desired setting, focusing only on the object description itself. Our model, meanwhile, uses only a single token and thus minimizes this risk.
|
| 187 |
+
|
| 188 |
+
Finally, while our reconstruction scores are on par with those of randomly sampled real images, we reiterate that our metrics compare semantic similarity using CLIP. This metric is less sensitive to shape preservation. On this front, there remains more to be done.
|
| 189 |
+
|
| 190 |
+
# 5.4 HUMAN EVALUATIONS
|
| 191 |
+
|
| 192 |
+
We further evaluate the models with a user study. We created two questionnaires. In the first, users were provided with four images from a concept’s training set, and asked to rank the results produced by five models according to their similarity to these images. In the second, users were provided with a text describing an image context (“A photo on the beach”) and asked to rank images produced by the same models according to their similarity to the text. We used the same target concepts and prompts as the CLIP-based evaluation and collected a total of 600 responses to each questionnaire. Results are shown in Figure 7(b). See the appendix for more details on this experiment.
|
| 193 |
+
|
| 194 |
+
The user-study results align with the CLIP-based metrics and demonstrate a similar reconstructionprompt-adherence tradeoff. Moreover, they outline the same limitations of human-based captioning when attempting to reproduce a concept, as well as when modifying it.
|
| 195 |
+
|
| 196 |
+
# 6 CONCLUSIONS
|
| 197 |
+
|
| 198 |
+
We introduced the task of personalized, language-guided generation, where a pre-trained text-toimage model is leveraged to create images of specific concepts in novel settings. Our approach, “Textual Inversion”, operates by inverting the concepts into new pseudo-words within the textembedding space of the model. These can be used in new prompts, allowing for intuitive modifications of the concept. In a sense, our method leverages multi-modal information: a text-driven interface for ease of editing, coupled with visual cues when nearing the limits of natural language.
|
| 199 |
+
|
| 200 |
+
While our method offers increased freedom, it may still struggle with learning precise shapes, instead incorporating the “semantic” essence of a concept. For artistic creations, this is typically enough. Another limitation is lengthy optimization times. Learning a single concept requires roughly an hour. This could likely be shortened by training an encoder to map a set of images to their textual embedding. We aim to explore this line of work in the future.
|
| 201 |
+
|
| 202 |
+
We hope our approach paves the way for future personalized generation works. These could be core to a multitude of downstream applications, from providing artistic inspiration to product design.
|
| 203 |
+
|
| 204 |
+
# 7 ETHIC STATEMENT
|
| 205 |
+
|
| 206 |
+
The model discussed in this work is part of the larger family of text-to-image models, and such models may be used to generate content that would be misleading or promote disinformation. Personalized creation could allow a user to forge more convincing images of non-public individuals. However, our model does not preserve identity to the extent where this is a concern.
|
| 207 |
+
|
| 208 |
+
Learned text-to-image models have been shown to be susceptible to biases found in the training data. Examples include gender biases when portraying “doctors” and “nurses”, racial biases when requesting images of scientists, and more subtle biases such as an over-representation of heterosexual couples and western traditions when prompting for a “wedding” (Mishkin et al., 2022). Since our own work builds on such models, it may exhibit similar biases. However, as we demonstrate in Appendix A.2, since our model allows creators to describe specific concepts more accurately, it could serve as a means for reducing such biases.
|
| 209 |
+
|
| 210 |
+
Finally, the ability to learn artistic styles may be misused for copyright infringement. Rather than paying an artist for their work, a user could train on their images without consent, and produce images in a similar style. While generated artwork is still easy to identify, in the future such infringement could be difficult to detect or legally pursue. However, we hope that such shortcomings are offset by the new opportunities that these tools could offer an artist, such as the ability to license out their unique style, or the ability to quickly create early prototypes for new work.
|
| 211 |
+
|
| 212 |
+
# 8 REPRODUCIBILITY STATEMENT
|
| 213 |
+
|
| 214 |
+
Our work makes the following effort to ensure reproducibility: (1) We will release our code, training sets, and all human captioning. (2) We provide details on hyperparameter choices for both our training and evaluation setups in appendix F. (3) We provide details on our human evaluation setups in appendix J.1. (4) Where image curation is involved, we provide details on the scale (section 4), show uncurated samples for assessment (appendix I), and offer quantitative evaluations on the effects of curation (appendix B).
|
| 215 |
+
|
| 216 |
+
# REFERENCES
|
| 217 |
+
|
| 218 |
+
Rameen Abdal, Yipeng Qin, and Peter Wonka. Image2stylegan: How to embed images into the stylegan latent space? In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 4432–4441, 2019.
|
| 219 |
+
Rameen Abdal, Yipeng Qin, and Peter Wonka. Image2stylegan $^ { + + }$ : How to edit the embedded images? In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 8296–8305, 2020.
|
| 220 |
+
Rameen Abdal, Peihao Zhu, John Femiani, Niloy J Mitra, and Peter Wonka. Clip2stylegan: Unsupervised extraction of stylegan edit directions. arXiv preprint arXiv:2112.05219, 2021.
|
| 221 |
+
Yuval Alaluf, Omer Tov, Ron Mokady, Rinon Gal, and Amit H. Bermano. Hyperstyle: Stylegan inversion with hypernetworks for real image editing, 2021.
|
| 222 |
+
AUTOMATIC1111. Stable diffusion webui. https://github.com/AUTOMATIC1111/ stable-diffusion-webui, 2022.
|
| 223 |
+
Omri Avrahami, Ohad Fried, and Dani Lischinski. Blended latent diffusion. arXiv preprint arXiv:2206.02779, 2022a.
|
| 224 |
+
Omri Avrahami, Dani Lischinski, and Ohad Fried. Blended diffusion for text-driven editing of natural images. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 18208–18218, 2022b.
|
| 225 |
+
David Bau, Hendrik Strobelt, William Peebles, Jonas Wulff, Bolei Zhou, Jun-Yan Zhu, and Antonio Torralba. Semantic photo manipulation with a generative image prior. 38(4), 2019. ISSN 0730- 0301. doi: 10.1145/3306346.3323023. URL https://doi.org/10.1145/3306346. 3323023.
|
| 226 |
+
|
| 227 |
+
Jooyoung Choi, Sungwon Kim, Yonghyun Jeong, Youngjune Gwon, and Sungroh Yoon. Ilvr: Conditioning method for denoising diffusion probabilistic models. arXiv preprint arXiv:2108.02938, 2021.
|
| 228 |
+
|
| 229 |
+
Yunjey Choi, Youngjung Uh, Jaejun Yoo, and Jung-Woo Ha. Stargan v2: Diverse image synthesis for multiple domains. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2020.
|
| 230 |
+
|
| 231 |
+
Niv Cohen, Rinon Gal, Eli A. Meirom, Gal Chechik, and Yuval Atzmon. ”this is my unicorn, fluffy”: Personalizing frozen vision-language representations. In European Conference on Computer Vision (ECCV), 2022.
|
| 232 |
+
|
| 233 |
+
Katherine Crowson. CLIP guided diffusion HQ 256x256. https://colab.research. google.com/drive/12a_Wrfi2_gwwAuN3VvMTwVMz9TfqctNj, 2021.
|
| 234 |
+
|
| 235 |
+
Katherine Crowson, Stella Biderman, Daniel Kornis, Dashiell Stander, Eric Hallahan, Louis Castricato, and Edward Raff. Vqgan-clip: Open domain image generation and editing with natural language guidance. arXiv preprint arXiv:2204.08583, 2022.
|
| 236 |
+
|
| 237 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 238 |
+
|
| 239 |
+
Prafulla Dhariwal and Alexander Nichol. Diffusion models beat gans on image synthesis. Advances in Neural Information Processing Systems, 34:8780–8794, 2021.
|
| 240 |
+
|
| 241 |
+
Yuxuan Ding, Lingqiao Liu, Chunna Tian, Jingyuan Yang, and Haoxuan Ding. Don’t stop learning: Towards continual learning for the clip model. arXiv e-prints, pp. arXiv–2207, 2022.
|
| 242 |
+
|
| 243 |
+
Rinon Gal, Or Patashnik, Haggai Maron, Gal Chechik, and Daniel Cohen-Or. Stylegan-nada: Clipguided domain adaptation of image generators. arXiv preprint arXiv:2108.00946, 2021.
|
| 244 |
+
|
| 245 |
+
Peng Gao, Shijie Geng, Renrui Zhang, Teli Ma, Rongyao Fang, Yongfeng Zhang, Hongsheng Li, and Yu Qiao. Clip-adapter: Better vision-language models with feature adapters. arXiv preprint arXiv:2110.04544, 2021.
|
| 246 |
+
|
| 247 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. Advances in neural information processing systems, 27, 2014.
|
| 248 |
+
|
| 249 |
+
Jinjin Gu, Yujun Shen, and Bolei Zhou. Image processing using multi-code gan prior, 2020.
|
| 250 |
+
|
| 251 |
+
Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in neural information processing systems, 30, 2017.
|
| 252 |
+
|
| 253 |
+
Jonathan Ho and Tim Salimans. Classifier-free diffusion guidance. In NeurIPS 2021 Workshop on Deep Generative Models and Downstream Applications, 2021.
|
| 254 |
+
|
| 255 |
+
Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 33:6840–6851, 2020.
|
| 256 |
+
|
| 257 |
+
Tero Karras, Miika Aittala, Janne Hellsten, Samuli Laine, Jaakko Lehtinen, and Timo Aila. Training generative adversarial networks with limited data. In Proc. NeurIPS, 2020.
|
| 258 |
+
|
| 259 |
+
Bahjat Kawar, Shiran Zada, Oran Lang, Omer Tov, Huiwen Chang, Tali Dekel, Inbar Mosseri, and Michal Irani. Imagic: Text-based real image editing with diffusion models. arXiv preprint arXiv:2210.09276, 2022.
|
| 260 |
+
|
| 261 |
+
Gwanghyun Kim, Taesung Kwon, and Jong Chul Ye. Diffusionclip: Text-guided diffusion models for robust image manipulation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2426–2435, 2022.
|
| 262 |
+
|
| 263 |
+
Ananya Kumar, Aditi Raghunathan, Robbie Jones, Tengyu Ma, and Percy Liang. Finetuning can distort pretrained features and underperform out-of-distribution. arXiv preprint arXiv:2202.10054, 2022.
|
| 264 |
+
|
| 265 |
+
Gihyun Kwon and Jong Chul Ye. Clipstyler: Image style transfer with a single text condition. arXiv preprint arXiv:2112.00374, 2021.
|
| 266 |
+
Adam Letts, Chris Scalf, Alex Spirin, Tom Mason, Chris Allen, Max Ingham, Mike Howles, Nate Baer, and David Sin. Disco diffusion. https://github.com/alembics/ disco-diffusion, 2021.
|
| 267 |
+
Dingcheng Li, Zheng Chen, Eunah Cho, Jie Hao, Xiaohu Liu, Xing Fan, Edward Guo, and Yang Liu. Overcoming catastrophic forgetting during domain adaptation of seq2seq language generation. In NAACL 2022, 2022. URL https://www.amazon.science/publications/ overcoming-catastrophic-forgetting-during-domain-adaptation-of-seq2seq-language
|
| 268 |
+
Zhi-Song Liu, Li-Wen Wang, Wan-Chi Siu, and Vicky Kalogeiton. Name your style: An arbitrary artist-aware image style transfer. arXiv preprint arXiv:2202.13562, 2022.
|
| 269 |
+
Pamela Mishkin, Lama Ahmad, Miles Brundage, Gretchen Krueger, and Girish Sastry. Dall·e 2 preview - risks and limitations. 2022.
|
| 270 |
+
Ryan Murdock. The big sleep, 2021. https://twitter.com/advadnoun/status/ 1351038053033406468.
|
| 271 |
+
Alex Nichol, Prafulla Dhariwal, Aditya Ramesh, Pranav Shyam, Pamela Mishkin, Bob McGrew, Ilya Sutskever, and Mark Chen. Glide: Towards photorealistic image generation and editing with text-guided diffusion models. arXiv preprint arXiv:2112.10741, 2021.
|
| 272 |
+
Yotam Nitzan, Kfir Aberman, Qiurui He, Orly Liba, Michal Yarom, Yossi Gandelsman, Inbar Mosseri, Yael Pritch, and Daniel Cohen-Or. Mystyle: A personalized generative prior. arXiv preprint arXiv:2203.17272, 2022.
|
| 273 |
+
Utkarsh Ojha, Yijun Li, Jingwan Lu, Alexei A Efros, Yong Jae Lee, Eli Shechtman, and Richard Zhang. Few-shot image generation via cross-domain correspondence. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10743–10752, 2021.
|
| 274 |
+
Roni Paiss, Hila Chefer, and Lior Wolf. No token left behind: Explainability-aided image classification and generation. arXiv preprint arXiv:2204.04908, 2022.
|
| 275 |
+
Gaurav Parmar, Richard Zhang, and Jun-Yan Zhu. On aliased resizing and surprising subtleties in gan evaluation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11410–11420, 2022.
|
| 276 |
+
Or Patashnik, Zongze Wu, Eli Shechtman, Daniel Cohen-Or, and Dani Lischinski. Styleclip: Textdriven manipulation of stylegan imagery. arXiv preprint arXiv:2103.17249, 2021.
|
| 277 |
+
Stanislav Pidhorskyi, Donald A Adjeroh, and Gianfranco Doretto. Adversarial latent autoencoders. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 14104–14113, 2020.
|
| 278 |
+
Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. arXiv preprint arXiv:2103.00020, 2021.
|
| 279 |
+
Aditya Ramesh, Mikhail Pavlov, Gabriel Goh, Scott Gray, Chelsea Voss, Alec Radford, Mark Chen, and Ilya Sutskever. Zero-shot text-to-image generation. In International Conference on Machine Learning, pp. 8821–8831. PMLR, 2021.
|
| 280 |
+
Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical textconditional image generation with clip latents. arXiv preprint arXiv:2204.06125, 2022.
|
| 281 |
+
N. Rathvon. Early Reading Assessment: A Practitioner’s Handbook. Guilford Publications, 2004. ISBN 9781572309845. URL https://books.google.co.uk/books?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ zX8YzwEACAAJ.
|
| 282 |
+
Elad Richardson, Yuval Alaluf, Or Patashnik, Yotam Nitzan, Yaniv Azar, Stav Shapiro, and Daniel Cohen-Or. Encoding in style: a stylegan encoder for image-to-image translation. arXiv preprint arXiv:2008.00951, 2020.
|
| 283 |
+
|
| 284 |
+
Daniel Roich, Ron Mokady, Amit H Bermano, and Daniel Cohen-Or. Pivotal tuning for latent-based editing of real images. arXiv preprint arXiv:2106.05744, 2021.
|
| 285 |
+
|
| 286 |
+
Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Bjorn Ommer. High- ¨ resolution image synthesis with latent diffusion models, 2021.
|
| 287 |
+
|
| 288 |
+
Nataniel Ruiz, Yuanzhen Li, Varun Jampani, Yael Pritch, Michael Rubinstein, and Kfir Aberman. Dreambooth: Fine tuning text-to-image diffusion models for subject-driven generation. 2022.
|
| 289 |
+
|
| 290 |
+
Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily Denton, Seyed Kamyar Seyed Ghasemipour, Burcu Karagol Ayan, S Sara Mahdavi, Rapha Gontijo Lopes, et al. Photorealistic text-to-image diffusion models with deep language understanding. arXiv preprint arXiv:2205.11487, 2022.
|
| 291 |
+
|
| 292 |
+
Christoph Schuhmann, Richard Vencu, Romain Beaumont, Robert Kaczmarczyk, Clayton Mullis, Aarush Katta, Theo Coombes, Jenia Jitsev, and Aran Komatsuzaki. Laion-400m: Open dataset of clip-filtered 400 million image-text pairs. arXiv preprint arXiv:2111.02114, 2021.
|
| 293 |
+
|
| 294 |
+
Shivram Shrirao. Imagic stable diffusion implementation. hhttps://github.com/ ShivamShrirao/diffusers/tree/main/examples/imagic, 2022.
|
| 295 |
+
|
| 296 |
+
Gabriel Skantze and Bram Willemsen. Collie: Continual learning of language grounding from language-image embeddings. Journal of Artificial Intelligence Research, 74:1201–1223, 2022.
|
| 297 |
+
|
| 298 |
+
Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. In International Conference on Learning Representations, 2020.
|
| 299 |
+
|
| 300 |
+
Ming Tao, Hao Tang, Songsong Wu, Nicu Sebe, Xiao-Yuan Jing, Fei Wu, and Bingkun Bao. Dfgan: Deep fusion generative adversarial networks for text-to-image synthesis. arXiv preprint arXiv:2008.05865, 2020.
|
| 301 |
+
|
| 302 |
+
Omer Tov, Yuval Alaluf, Yotam Nitzan, Or Patashnik, and Daniel Cohen-Or. Designing an encoder for stylegan image manipulation. arXiv preprint arXiv:2102.02766, 2021.
|
| 303 |
+
|
| 304 |
+
Maria Tsimpoukelli, Jacob L Menick, Serkan Cabi, SM Eslami, Oriol Vinyals, and Felix Hill. Multimodal few-shot learning with frozen language models. Advances in Neural Information Processing Systems, 34:200–212, 2021.
|
| 305 |
+
|
| 306 |
+
Aaron Van Den Oord, Oriol Vinyals, et al. Neural discrete representation learning. Advances in neural information processing systems, 30, 2017.
|
| 307 |
+
|
| 308 |
+
Yaxing Wang, Chenshen Wu, Luis Herranz, Joost van de Weijer, Abel Gonzalez-Garcia, and B. Raducanu. Transferring gans: generating images from limited data. In ECCV, 2018.
|
| 309 |
+
|
| 310 |
+
Yaxing Wang, Abel Gonzalez-Garcia, David Berga, Luis Herranz, Fahad Shahbaz Khan, and Joost van de Weijer. Minegan: Effective knowledge transfer from gans to target domains with few images. In The IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
|
| 311 |
+
|
| 312 |
+
Weihao Xia, Yulun Zhang, Yujiu Yang, Jing-Hao Xue, Bolei Zhou, and Ming-Hsuan Yang. Gan inversion: A survey, 2021.
|
| 313 |
+
|
| 314 |
+
Tao Xu, Pengchuan Zhang, Qiuyuan Huang, Han Zhang, Zhe Gan, Xiaolei Huang, and Xiaodong He. Attngan: Fine-grained text to image generation with attentional generative adversarial networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1316–1324, 2018.
|
| 315 |
+
|
| 316 |
+
Paul Yacoubian. Avocado bag, 2022. https://twitter.com/PaulYacoubian/status/ 1542867718071779330.
|
| 317 |
+
|
| 318 |
+
Hui Ye, Xiulong Yang, Martin Takac, Rajshekhar Sunderraman, and Shihao Ji. Improving text-toimage synthesis using contrastive learning. arXiv preprint arXiv:2107.02423, 2021.
|
| 319 |
+
|
| 320 |
+
Jiahui Yu, Yuanzhong Xu, Jing Yu Koh, Thang Luong, Gunjan Baid, Zirui Wang, Vijay Vasudevan, Alexander Ku, Yinfei Yang, Burcu Karagol Ayan, et al. Scaling autoregressive models for contentrich text-to-image generation. arXiv preprint arXiv:2206.10789, 2022.
|
| 321 |
+
|
| 322 |
+
Han Zhang, Jing Yu Koh, Jason Baldridge, Honglak Lee, and Yinfei Yang. Cross-modal contrastive learning for text-to-image generation. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 833–842, 2021.
|
| 323 |
+
|
| 324 |
+
Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In CVPR, 2018.
|
| 325 |
+
|
| 326 |
+
Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Learning to prompt for visionlanguage models. arXiv preprint arXiv:2109.01134, 2021.
|
| 327 |
+
|
| 328 |
+
Jiapeng Zhu, Yujun Shen, Deli Zhao, and Bolei Zhou. In-domain gan inversion for real image editing. arXiv preprint arXiv:2004.00049, 2020a.
|
| 329 |
+
|
| 330 |
+
Jun-Yan Zhu, Philipp Krahenb ¨ uhl, Eli Shechtman, and Alexei A Efros. Generative visual manipu- ¨ lation on the natural image manifold. In European conference on computer vision, pp. 597–613. Springer, 2016.
|
| 331 |
+
|
| 332 |
+
Minfeng Zhu, Pingbo Pan, Wei Chen, and Yi Yang. Dm-gan: Dynamic memory generative adversarial networks for text-to-image synthesis. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 5802–5810, 2019.
|
| 333 |
+
|
| 334 |
+
Peihao Zhu, Rameen Abdal, Yipeng Qin, and Peter Wonka. Improved stylegan embedding: Where are the good latents?, 2020b.
|
| 335 |
+
|
| 336 |
+
# Appendices
|
| 337 |
+
|
| 338 |
+
A ADDITIONAL APPLICATIONS
|
| 339 |
+
|
| 340 |
+
In the following section we investigate a set of additional textual-inversion applications. These include the composition of multiple visual concepts, bias reductions, and the application of our method to downstream tasks.
|
| 341 |
+
|
| 342 |
+
# A.1 CONCEPT COMPOSITIONS
|
| 343 |
+
|
| 344 |
+

|
| 345 |
+
Figure 8: Compositional generation using two learned pseudo-words. The model is able to combine the semantics of two concepts when using a prompt that combines them both. It is limited in its ability to reason over more complex relational prompts, such as placing two concepts side-by-side. Image credits: $@$ QinniArt (left), $@$ Leslie Manlapig (right).
|
| 346 |
+
|
| 347 |
+
In Figure 8 we demonstrate compositional synthesis, where the guiding text contains multiple learned concepts. We observe that the model can concurrently reason over multiple novel pseudowords at the same time. However, it struggles with relations between them (e.g. it fails to place two concepts side-by-side). We hypothesize that this limitation arises because our training considers only single concept scenes, where the concept is at the core of the image. Training on multi-object scenes may alleviate this shortcoming. However, we leave such investigation to future work.
|
| 348 |
+
|
| 349 |
+
# A.2 BIAS REDUCTION
|
| 350 |
+
|
| 351 |
+
A common limitation of text-to-image models is that they inherit the biases found in the internetscale data used to train them. These biases then manifest in the generated samples. For example, the DALLE-2 system card (Mishkin et al., 2022) reports that their baseline model tends to produce images of people that are white-passing and male-passing when provided with the prompt “A CEO”. Similarly, results for “wedding”, tend to assume western wedding traditions, and default to heterosexual couples.
|
| 352 |
+
|
| 353 |
+
Here, we demonstrate that we can utilize a small, curated dataset in order to learn a new “fairer” word for a biased concept, which can then be used in place of the original to drive a more inclusive generation.
|
| 354 |
+
|
| 355 |
+
Specifically, in Figure 9 we highlight the bias encoded in the word “Doctor”, and show that this bias can be reduced (i.e. we increase perceived gender and ethnic diversity) by learning a new embedding from a small, more diverse set.
|
| 356 |
+
|
| 357 |
+

|
| 358 |
+
“A photo of $S _ { * }$ ” (Ours)
|
| 359 |
+
|
| 360 |
+
“A stock photo of a doctor” (Base model)
|
| 361 |
+
|
| 362 |
+

|
| 363 |
+
Figure 9: Bias Reduction. Uncurated samples synthesized with pretrained biased embeddings (left) and our debiased embeddings (right). Our approach can be used to reduce bias by learning new pseudo-words for known concepts. These can be optimized using small datasets, which can be carefully curated for diversity.
|
| 364 |
+
Figure 10: Our words can be used with downstream models that build on LDM. Here, we perform localized image editing using Blended Latent Diffusion (Avrahami et al., 2022a)
|
| 365 |
+
|
| 366 |
+
# A.3 DOWNSTREAM APPLICATIONS
|
| 367 |
+
|
| 368 |
+
Finally, we demonstrate that our pseudo-words can be used in downstream models that build on the same initial LDM model. Specifically, we consider the recent Blended Latent Diffusion (Avrahami et al., 2022a) which enables localized text-based editing of images via a mask-based blending process in the latent space of an LDM. In Figure 10 we demonstrate that this localized synthesis process can also be conditioned on our learned pseudo-words, without requiring any additional modifications of the original model.
|
| 369 |
+
|
| 370 |
+
# B CONCEPT COVERAGE
|
| 371 |
+
|
| 372 |
+
While our approach can handle a wide array of concepts, we find that not everything can be encoded into the embedding space with the same fidelity. Here, we investigate how likely a concept is to be covered by our model. To do so, we compare the CLIP-space distribution of images representing a concept, to the distribution of our generated images. Formally, we conduct the following experiment:
|
| 373 |
+
|
| 374 |
+
(1) We gathered a set of 65 different concepts which were uploaded by unaffiliated users to a public API of our model. Let $\{ x _ { i } ^ { j } \} _ { i = 1 } ^ { n _ { j } }$ denote the set of images uploaded for concept $j \in [ 1 , 6 5 ]$ , where $n _ { j }$ is the number of images in the set.
|
| 375 |
+
|
| 376 |
+
(2) We embed all the concept-specific images into CLIP’s embedding space, and compute all pairwise distances between these images: $d _ { r , q , j } ^ { x x } = D \left( C _ { I } ( x _ { r } ^ { j } ) , C _ { I } ( x _ { q } ^ { j } ) \right)$ , where $r \in [ 1 , \bar { n _ { j } } ]$ , $q \in \mathsf { \bar { \Gamma } } [ r \to -$ $1 , n _ { j } ]$ , is the CLIP image encoder and $D$ denotes an $L 2$ distance between normalized vectors.
|
| 377 |
+
|
| 378 |
+
(3) We invert the concept into LDM using our single-word method, and sample 256 images $\{ y _ { i } ^ { j } \} _ { i = 1 } ^ { 2 5 6 }$ using the prompt “A photo of and the images in the original $S _ { * }$ ” nce bet, where , age,. $d _ { r , q , j } ^ { x y } = D \left( C _ { I } ( x _ { r } ^ { j } ) , C _ { I } ( y _ { q } ^ { j } ) \right)$ $r \in [ 1 , n _ { j } ]$ $q \in [ 1 , 2 5 6 ]$
|
| 379 |
+
|
| 380 |
+
(4) We compare the two distance distributions, $\{ d _ { j } ^ { x x } \}$ and $\{ d _ { j } ^ { x y } \}$ , using a standard t-test. We consider the concept to be “covered” if we cannot reject the hypothesis that the two samples belong to the same distribution $( i . e . p > 0 . 0 5 )$ .
|
| 381 |
+
|
| 382 |
+
(5) We repeat this experiment over all concept sets, and report the percent of sets for which the
|
| 383 |
+
|
| 384 |
+
concept was successfully “covered”.
|
| 385 |
+
|
| 386 |
+
Finally, we investigate the effect of ‘cherry picking’ on these results. Specifically, we repeat the above experiment, but reject outliers by keeping subsets of $\{ d _ { j } ^ { x y } \}$ which are closest to the mean. In fig. 11 we report results when using all 256 generated samples per set, and when using only the ‘best’ $\textstyle { \frac { 1 } { 2 } } , { \frac { 1 } { 4 } } , { \frac { 1 } { 6 } }$ , and $\frac { 1 } { 8 }$ of results. We additionally labeled each concept as representing either a style or an object, and we report coverage success rates for each class.
|
| 387 |
+
|
| 388 |
+
Without cherry picking, our model can successfully capture $5 5 . 4 \%$ of tested concepts. However, even mild cherry picking can improve these values significantly ( $8 0 \%$ and ${ \mathrm { \bar { 8 9 . 2 \% } } }$ for factors of $1 : 2$ and
|
| 389 |
+
|
| 390 |
+

|
| 391 |
+
Figure 11: Evaluation of concept coverage as a function of the cherry-picking factor. A factor of 1:k denotes that we keep one of every $\mathbf { k }$ samples.
|
| 392 |
+
|
| 393 |
+
$1 : 4$ respectively). These indicate that for most concepts, one can produce reasonable semantic reconstructions if they are willing to filter the results. Another observation is that the model fares considerably better with styles than with objects $( 7 5 . 8 \%$ vs. $3 4 . 3 \%$ at a factor of $1 : 1$ ). This is likely a result of our model’s difficulty in reproducing exact shapes. When dealing with styles, the concept training set will typically contain large object variation, and thus our metric will be less susceptible to any shape-inaccuracies in the generated imagery. Indeed, for objects, cherry picking appears particularly effective as it rejects the most distorted shapes.
|
| 394 |
+
|
| 395 |
+
# C EFFECT OF TRAINING SET PROPERTIES
|
| 396 |
+
|
| 397 |
+
# C.1 TRAINING SET SIZE
|
| 398 |
+
|
| 399 |
+
We investigated the effect of the concept’s training set size on the results. Specifically, we consider the headless sculpture object of Figure 1 (top row). We inverted the object using our standard model but swept over dataset sizes ranging from a single image to 25 samples. For ease of comparison, we further report the image-only, prompt-only, and human caption-based scores for the same single object. The results are shown in Figure 12.
|
| 400 |
+
|
| 401 |
+
When learning a specific object, using additional images may lead to optimized embeddings which reside farther away from real word embeddings, harming editability. In this scenario, our method operates best when provided with 5 images.
|
| 402 |
+
|
| 403 |
+

|
| 404 |
+
Figure 12: Quantitative evaluation of the effects of the training set size. Significant increases to dataset sizes leads to larger deviation from the real-word distribution. This impacts editability and offers paltry improvement in reconstruction. Our approach shows the best results with $\sim 5$ images.
|
| 405 |
+
|
| 406 |
+
# C.2 TRAINING IMAGE DIVERSITY
|
| 407 |
+
|
| 408 |
+
We investigate the effect of training image diversity using the CLIP-based image and text similarity metrics. We collected datasets of two objects, the cat-toy and the headless sculpture of fig. 1, in two scenarios: (1) Images taken with the same, uniform background, but including a variety of object poses, and (2) images taken with different backgrounds, but sharing the same object pose. In both cases, we compare image similarity to the original, diverse sets used throughout the rest of the paper. The results are shown in table 1.
|
| 409 |
+
|
| 410 |
+
Without background diversity, the model prioritizes the shared background, resulting in a reduced understanding of the concept and poor reconstructions. In contrast, lack of pose diversity results in generated images portraying the same pose, but their quality is better maintained. Ensuring variation on both ends allows the model to focus on the subject and re-create it in a greater variety of poses.
|
| 411 |
+
|
| 412 |
+
Table 1: Effects of data set diversity and prompt templates. Without background diversity, the model favors capturing background information in the tokens, leading to diminished object similarity. Lack of pose diversity leads to models which favor the same pose, but do not otherwise harm quality. Removing the prompt templates leads to weaker embeddings which are easily overwritten by other words in a prompt.
|
| 413 |
+
|
| 414 |
+
<table><tr><td>Dataset</td><td>Model</td><td>Image similarity ↑</td><td>Text Similarity ↑</td></tr><tr><td rowspan="4">Cat</td><td>Baseline</td><td>0.768</td><td>0.292</td></tr><tr><td>Fixed background</td><td>0.724</td><td>0.281</td></tr><tr><td>Fixed pose</td><td>0.752</td><td>0.278</td></tr><tr><td>No prompt templates</td><td>0.722</td><td>0.282</td></tr><tr><td rowspan="4"> Sculpture</td><td>Baseline</td><td>0.806</td><td>0.278</td></tr><tr><td>Fixed background</td><td>0.786</td><td>0.263</td></tr><tr><td>Fixed pose</td><td>0.799</td><td>0.262</td></tr><tr><td>No prompt templates</td><td>0.604</td><td>0.287</td></tr></table>
|
| 415 |
+
|
| 416 |
+

|
| 417 |
+
Figure 13: Frechet inception distance (FID, ´ ↓) for two domain-adaptation sets, as a function of training iterations and the number of training images. Long training periods may not help, or even harm the results. Using additional images can improve coverage for diverse sets.
|
| 418 |
+
|
| 419 |
+
# C.3 TRAINING PROMPTS
|
| 420 |
+
|
| 421 |
+
We investigate the effect of replacing our prompt templates with a simple ” $S _ { * }$ ”. The results are shown in table 1. Removing all templates guides the optimization towards weaker embeddings which are often ignored by the model when merged with other words.
|
| 422 |
+
|
| 423 |
+
# D DOMAIN ADAPTATION COMPARISONS
|
| 424 |
+
|
| 425 |
+
We further quantify our model’s performance by comparing it to generator domain-adaptation approaches. We conduct inversion on the sketch dataset of Ojha et al. (2021) and using the few-shot AFHQ (Choi et al., 2020) split of Gal et al. (2021). For the sketch dataset, we create additional splits of 1, 5, 50, and 100 images.
|
| 426 |
+
|
| 427 |
+
For each set and split, we invert the training set into a single token using our standard parameters and a single V100 GPU. Following Ojha et al. (2021), we generate 5, 000 images using each inverted model, and evaluate the Frechet Inception Distance (FID) (Heusel et al., 2017) between them and ´ the full sketch and AFHQ sets, consisting of 300 and 5, 153 images respectively. FID is calculated using the clean-fid library (Parmar et al., 2022). Figure 13 reports our method’s FID as a function of training steps and the number of images. Table 2 further compares our results at 10 images and 5, 000 training steps to few-shot GAN domain adaptation approaches which were trained on the same sets. These results demonstrate that our method is competitive with GAN-based fewshot adaptation methods, despite not training any part of the network. The FID values demonstrate considerable jitter. However, for small sets, in particular, we observe that longer training typically fails to improve, and may even harm FID.
|
| 428 |
+
|
| 429 |
+
Ojha et al. (2021) additionally evaluate the diversity of their model by employing a clustering-based metric. There, generated images are assigned to a cluster containing their nearest training image, using LPIPS (Zhang et al., 2018) as a distance metric. The diversity metric is then the average pairwise distance between images in each cluster, averaged again over all the clusters. Methods which simply memorize the training set will be assigned a score of zero.
|
| 430 |
+
|
| 431 |
+
Table 2 reports diversity results using our method and select GAN few-shot domain approaches, trained on a 10 image set. Our method considerably outperforms the GAN based adaptation approaches. This is likely on account of LDM’s larger initial knowledgebase, our limited intervention in the model, and the greater recall typically observed in diffusion models when compared to GANs.
|
| 432 |
+
|
| 433 |
+
Finally, we use these models to evaluate reconstruction quality and prompt-adherence using the CLIP based similarity scores. Figure 14 shows the results for both metrics, across different numbers of training images and training steps. Here, we average over both sets (cats, sketches) to reduce noise, and further plot the trend-lines along with the fit’s confidence intervals.
|
| 434 |
+
|
| 435 |
+
When dealing with broad concepts (cats, rather than a specific cat) we observe that additional data can help improve the results. Additional data can further benefit from additional training steps.
|
| 436 |
+
|
| 437 |
+
Table 2: FID and diversity comparisons to select few-shot GAN domain adaptation approaches. Despite not modifying any model parameters, our approach can yield FID scores comparable to few-shot GANs, and a significant increase in diversity. We report our results at 5, 000 iterations. Our FID may be lower at other earlier points in training (e.g. 61.11 for the cat set at $2 , 0 0 0$ steps).
|
| 438 |
+
|
| 439 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">FID↓</td><td colspan="2">Diversity ↑</td></tr><tr><td>AFHQ Cat</td><td>Face Sketch</td><td>AFHQ Cat</td><td>Face Sketch</td></tr><tr><td>CDC (Ojha et al., 2021)</td><td>45.13</td><td>72.74</td><td>0.52</td><td>0.45</td></tr><tr><td>MineGAN (Wang et al., 2020)</td><td>79.31</td><td>62.27</td><td>0.21</td><td>0.40</td></tr><tr><td>TGAN (Wang et al., 2018)</td><td>87.11</td><td>69.44</td><td>0.28</td><td>0.39</td></tr><tr><td>TGAN + ADA (Karras et al., 2020)</td><td>52.70</td><td>56.76</td><td>0.34</td><td>0.41</td></tr><tr><td>Textual Inversion</td><td>79.72</td><td>75.61</td><td>0.62</td><td>0.53</td></tr></table>
|
| 440 |
+
|
| 441 |
+

|
| 442 |
+
Figure 14: CLIP image (left) and text (right) similarity averaged across the domain-adaptation sets. Additional training iterations may harm training with few images, but benefit larger sets.
|
| 443 |
+
|
| 444 |
+
# E ADDITIONAL INVERSION APPROACHES
|
| 445 |
+
|
| 446 |
+
In addition to the setups outlined in the core paper, we investigated two recent approaches to inversion: Bipartite DDIM-inversion (Ramesh et al., 2022; Dhariwal & Nichol, 2021) and pivotal tuning (Roich et al., 2021). Below we outline both methods and our experimental results.
|
| 447 |
+
|
| 448 |
+
Bipartite inversion Dhariwal & Nichol (2021) demonstrated that the DDIM sampling (Song et al., 2020) process can be inverted through a closed-form iterative approach. Specifically, their approach can find a latent noise vector $x _ { T }$ which will be denoised into a specific target image when the denoising process is conditioned on a given code $c _ { \theta } ( y )$ . In (Ramesh et al., 2022), they further demonstrate that when the conditioning code is an output of CLIP, one can later modify this code using textderived directions in CLIP’s multi-modal embedding space, while keeping the initial noise, $x _ { T }$ , fixed. This induces semantic changes in the image while maintaining the general structure of the original object.
|
| 449 |
+
|
| 450 |
+
Here, we investigate a similar approach. However, rather than modifying the conditioning code $c _ { \theta } ( y )$ directly, we change the conditioning text $y$ . Specifically, we first find an appropriate pseudoword for our target concept. Then, we find $x _ { T }$ for a given image of the concept using the text “A photo of $S _ { * } ^ { \mathrm { ~ \scriptsize ~ , ~ , ~ } }$ and the closed-form solution of Dhariwal & Nichol (2021). Finally, we modify the conditioning text but keep $x _ { T }$ frozen. The results are shown in Figure 15 (left). Here, we observe that when using LDM’s typical guidance (Ho & Salimans, 2021) scales (5-10), the denoiser network is unable to maintain the original object’s structure through prompt changes. When reducing the guidance scale, the outline of the original image becomes visible. However, alignment with the prompt is poor.
|
| 451 |
+
|
| 452 |
+
Such guidance-dependent structure drift has also been demonstrated for GLIDE (Nichol et al., 2021). However, this effect is reduced in DALL-E2 (Ramesh et al., 2022) (their Figure 9). Notably, stateof-the-art models (Saharia et al., 2022; Ramesh et al., 2022) typically employ guidance scales $( \sim 2 )$ which are significantly lower than LDM’s — within the range where we observe structure preservation, but no prompt-matching. This gives us hope that a bipartite inversion would allow better shape preservation in more powerful generative models.
|
| 453 |
+
|
| 454 |
+

|
| 455 |
+
Figure 15: Advanced inversion results using Bipartite Inversion (Ramesh et al., 2022) (left) and Pivotal Tuning (Roich et al., 2021) (right). $s$ is the guidance scale. Reconstructions were obtained using the prompt “A photo of $S _ { * } ^ { \mathrm { ~ \scriptsize ~ , ~ } }$ ”. Bipartite inversion allows for more accurate reconstructions without modifying the model, but their structure is lost for complex prompts in high guidance scales. Pivotal tuning improves shapes at the cost of visual artifacts, and fail to adhere to simple prompts at high guidance scales. Note that the pivotal tuning results use a random noise input, while the bipartite results use a fixed noise for each column.
|
| 456 |
+
|
| 457 |
+
Pivotal Tuning In the field of GAN inversion, it has been shown (Roich et al., 2021; Bau et al., 2019) that one may largely avoid the reconstruction-editability tradeoff using a two-stage optimization process. First, an image is inverted into “pivot” code in a well-behaved region of the latent space, using standard optimization. This typically results in a highly editable code, but with poor identity preservation. As a second step, the generator is fine-tuned so that the first step’s pivot code will more accurately reproduce the inverted image. It was further demonstrated that such localized tuning can maintain the appealing properties of the latent space and retain similar latent-editing capabilities.
|
| 458 |
+
|
| 459 |
+
Here, we investigate a similar approach in order to improve reconstruction. We first optimize a pseudo-word using our baseline method. Then, we fine-tune the generator such that sentences of the form “A photo of $S _ { * }$ ” will better reconstruct the concept-specific training set images.
|
| 460 |
+
|
| 461 |
+
Our initial investigation reveals that na¨ıve applications of this approach lead to improved shape preservation, but also to a severe collapse of editing at high guidance scales. See Figure 15 (right) for examples. However, as outlined in appendix G, this failure is model-dependent, and other architectures may even benefit from its use.
|
| 462 |
+
|
| 463 |
+
A more involved application of this same principle (e.g. by combining it with a similar process to the bipartite-inversion outlined below, or by tuning around results produced with higher guidance scales) might overcome the issues observed in LDM. We leave such investigation to future work.
|
| 464 |
+
|
| 465 |
+
# F IMPLEMENTATION DETAILS
|
| 466 |
+
|
| 467 |
+
Unless otherwise noted, we retain the original hyper-parameter choices of LDM (Rombach et al., 2021). Word embeddings were initialized with the embeddings of a single-word coarse descriptor of the object (e.g. “sculpture” and “cat” for the two concepts in Figure 1). Our experiments were conducted using $2 \times \mathsf { V } 1 0 0$ GPUs with a batch size of 4. The base learning rate was set to 0.005. Following LDM, we further scale the base learning rate by the number of GPUs and the batch size, for an effective rate of 0.04. All results were produced using 5, 000 optimization steps. We find that these parameters work well for most cases. However, for some concepts, better results can be achieved with fewer steps or with an increased learning rate.
|
| 468 |
+
|
| 469 |
+
For all CLIP-based evaluations, we use the official CLIP ViT-B/32 checkpoint.
|
| 470 |
+
|
| 471 |
+
# G STABLE DIFFUSION
|
| 472 |
+
|
| 473 |
+
In addition to the LDM results, we demonstrate that our method can be adapted to work with Stable Diffusion, a recently released large-scale latent diffusion model (Rombach et al., 2021). However, in contrast to the baseline LDM model which trains a BERT Devlin et al. (2018) text encoder alongside with the generative network, Stable Diffusion makes use of a pre-trained, frozen CLIP text encoder.
|
| 474 |
+
|
| 475 |
+
We implement our method over Stable Diffusion using the same training setup, losses, and parameters that were used for LDM. We notice that inverted Stable Diffusion embeddings tend to dominate the prompt and become more difficult to integrate into new, simple prompts. These limitations can be mitigated in one of two approaches: First, by reducing the weight of the learned embedding. This can be done through the use of longer, more complex prompts, or by using prompt re-weighting methods (AUTOMATIC1111, 2022). Second, through the use of the Pivotal Tuning mechanism outlined in appendix E. We hypothesize that Stable Diffusion’s decreased malleability is an artifact of either its text encoder’s training or its size. While LDM’s text encoder was trained with the dense visual reconstruction task, here the encoder is a pre-trained CLIP, which had a simpler contrastive learning task for which focusing on a subset of image content was typically enough. Similarly, a concurrent work (Ruiz et al., 2022) reports difficulty in capturing the appearance of a subject without model-tuning when using Imagen (Saharia et al., 2022), a model whose text-encoder was pre-trained on a purely linguistic task and kept frozen. On the size front, the CLIP text encoder employed by Stable Diffusion contains $1 2 8 M$ parameters, roughly a fifth of LDM’s BERT. Moreover, it has an embedding dimension of 768 compared to LDM’s 1280. These could combine to create a less expressive latent space, which forces new concepts further out of the domain of real words and negatively impacts prompt adherence. We plan to further investigate this matter in the future.
|
| 476 |
+
|
| 477 |
+
In fig. 16 we provide samples generated using Stable Diffusion and the outlined methods. Note that while the pivotal tuning approach can typically provide more appealing visual outputs, it requires significantly greater computational resources, consuming roughly 30GB of VRAM with a batch size of one. The baseline inversion method, meanwhile, consumes as little as 12GB using a similar batch size. Moreover, the model-tuning approach leads to checkpoints that are several GB in size, compared to less than 4KB for a learned embedding. Learned embeddings are thus easier to share and use for large-scale collaborative work.
|
| 478 |
+
|
| 479 |
+
# H IMAGE EDITING COMPARISON
|
| 480 |
+
|
| 481 |
+
To better highlight the distinction between our approach and single-image editing methods, we compare our approach to the concurrent Imagic (Kawar et al., 2022). We use the unofficial Stable Diffusion implementation of their method (Shrirao, 2022), where we swept over model parameters and prompt strengths in an attempt to match our results. A comparison to our cat model is provided in fig. 17.
|
| 482 |
+
|
| 483 |
+

|
| 484 |
+
Figure 16: Injecting user-specific concepts into Stable Diffusion. In contrast to LDM, using our baseline approach with Stable Diffusion leads to less editable results. These can be overcome through prompt engineering and weighting, or by using Pivotal Tuning (Roich et al., 2021).
|
| 485 |
+
|
| 486 |
+
As can be seen, the single-image editing method successfully captures details such as the background and the object’s location and pose. However, it struggles with creating large changes or putting the object in new contexts while preserving key object details. Our method meanwhile is not restricted to a single scene, and instead aims to capture the semantics of a concept and apply them to new scenes.
|
| 487 |
+
|
| 488 |
+
# I ADDITIONAL RESULTS
|
| 489 |
+
|
| 490 |
+
We provide additional results of personalized generation using our method. In Figure 18 we show additional text-guided synthesis results.
|
| 491 |
+
|
| 492 |
+
In Figure 19 we show large-scale galleries of uncurated results generated with the prompt “A photo of $S _ { * }$ ”. In Figures 20 and 21 we provide large-scale galleries of uncurated results generated with a wide assortment of prompts. These are intended to provide a sense of the quality of images produced and cherry-picking involved when generating the samples in the core paper. Note that these results also contain demonstrations of typical failure cases, such as difficult relational prompts (Figure 20, rows 2, 5).
|
| 493 |
+
|
| 494 |
+

|
| 495 |
+
Figure 17: Text-guided synthesis comparison to Imagic (Kawar et al., 2022). Our method captures the semantics of a concept and uses them to create new scenes. Imagic successfully maintains specific image details, such as the object’s location or the background, but it fails to create complex transformations while maintaining fidelity to the source concept.
|
| 496 |
+
|
| 497 |
+

|
| 498 |
+
Figure 18: Injecting user-specific concepts into new scenes. Our method can change a concept’s style, composition, or use it to inspire new creations. Top row image credits: $@$ Øyvind Holmstad.
|
| 499 |
+
|
| 500 |
+

|
| 501 |
+
Figure 19: Uncurated samples of object variations created using the prompt ”A photo of $S _ { * }$ ”.
|
| 502 |
+
|
| 503 |
+

|
| 504 |
+
Figure 20: Uncurated samples generated with context prompts. Quality and prompt-matching varies within the sample. However, we observe that a batch size of 16 is typically sufficient to ensure several good samples.
|
| 505 |
+
|
| 506 |
+

|
| 507 |
+
Figure 21: Additional uncurated samples generated with context prompts. Quality and promptmatching varies within the sample. However, we observe that a batch size of 16 is typically sufficient to ensure several good samples. Image credits: $@$ QinniArt (bottom), authorized for non-commercial use only.
|
| 508 |
+
|
| 509 |
+
# J TRAINING PROMPT TEMPLATES
|
| 510 |
+
|
| 511 |
+
Below we provide the list of text templates used when optimizing a pseudo-word:
|
| 512 |
+
|
| 513 |
+
• “a photo of a $S _ { * }$ .”, • “a rendering of a $S _ { * }$ .”, • “a cropped photo of the $S _ { * }$ .”, • “the photo of a $S _ { * }$ .”, • “a photo of a clean $S _ { * }$ .”, • “a photo of a dirty $S _ { * }$ .”, • “a dark photo of the $S _ { * }$ .”, • “a photo of my $S _ { * }$ .”, • “a photo of the cool $S _ { * }$ .”, • “a close-up photo of a $S _ { * }$ .”, • “a bright photo of the $S _ { * }$ .”, • “a cropped photo of a $S _ { * }$ .”, • “a photo of the $S _ { * }$ .”, • “a good photo of the $S _ { * }$ .”, • “a photo of one $S _ { * }$ .”, • “a close-up photo of the $S _ { * }$ .”, • “a rendition of the $S _ { * }$ .”, • “a photo of the clean $S _ { * }$ .”, • “a rendition of a $S _ { * }$ .”, • “a photo of a nice $S _ { * }$ .”, • “a good photo of a $S _ { * }$ .”, • “a photo of the nice $S _ { * }$ .”, • “a photo of the small $S _ { * }$ .”, • “a photo of the weird $S _ { * }$ .”, • “a photo of the large $S _ { * }$ .”, • “a photo of a cool $S _ { * }$ .”, • “a photo of a small $S _ { * }$ .”,
|
| 514 |
+
|
| 515 |
+
# J.1 DETAILS OF CAPTIONS CROWDSOURCING AND USER STUDY
|
| 516 |
+
|
| 517 |
+
We collected captions describing the training concepts using Amazon Mechanical Turk (AMT).
|
| 518 |
+
|
| 519 |
+
We provided annotators with four images of a concept and asked them to describe it in a manner that could allow an artist to recreate it. We collected five short $\leq 1 2$ words) and five long $\leq 3 0$ words) captions per concept. In total, we collected 10 captions per concept — five short and five long.
|
| 520 |
+
|
| 521 |
+
Figure 22 illustrates the data collection interface for each type of questionnaire.
|
| 522 |
+
|
| 523 |
+
When evaluate the models through a user study, we created two questionnaires. In the first, users were provided with four images from a concept’s training set, and asked to rank the results produced by five models according to their similarity to these images. In the second questionnaire, users were provided with a text describing an image context (“An oil painting”) and asked to rank the results produced by the same models according to their similarity to the text. We used the same target concepts and prompts as the CLIP-based evaluations and collected a total of 600 responses to each questionnaire. A single Turker was not permitted to rank more than 7 prompts per questionnaire.
|
| 524 |
+
|
| 525 |
+
Figure 23 illustrates the data collection interface for the user study.
|
| 526 |
+
|
| 527 |
+
#
|
| 528 |
+
|
| 529 |
+

|
| 530 |
+
Figure 22: Screenshots of the caption crowdsourcing interface with full instructions given to users. (a, top) Interface for short captions (b, bottom) Interface for long captions
|
| 531 |
+
|
| 532 |
+
For both the the data captioning and the user study, we paid $\$ 0.2$ per response. This sum ensures that, regardless of their world-wide location, workers are paid more than the US federal minimum wage (the median response time was 70 seconds, indicating a wage of roughly $\$ 10.3$ per hour of work).
|
| 533 |
+
|
| 534 |
+
To maintain the quality of the queries, we only picked users with AMT “masters” qualification, demonstrating a high degree of approval rate over a wide range of tasks.
|
| 535 |
+
|
| 536 |
+
Furthermore, we also executed a qualification test with a few examples and verified that the annotators follow the instructions. We rejected queries from two qualified user that abused the system by submitting the same score ordering in every questionnaire (e.g. $5 , 4 , 3 , 2 , 1$ ).
|
| 537 |
+
|
| 538 |
+
All tasks were flagged as containing adult content. This was required due to the risk that some generated images may unintentionally contain offensive contents, as the underlying LDM model was trained on uncurated web data. We also included the following warning in the title “WARNING: This HIT may contain adult content. Worker discretion is advised”
|
| 539 |
+
|
| 540 |
+
#
|
| 541 |
+
|
| 542 |
+
# Instructions
|
| 543 |
+
|
| 544 |
+
# ·Read the instructions carefully
|
| 545 |
+
|
| 546 |
+
·YouaregivenaetofexamplesofanbjectInaditionyouseeafwpicturesthattrytoportraythisobectinvarioussearios.
|
| 547 |
+
·Yourmissionistoranktheimagesaccordingtohowwelltheobjectineachimageagreeswiththeobjectintheexamples.
|
| 548 |
+
·IMPORTANT:You shouldassignadifferent rank (1..5) for each image. Do not select the same score for two images.Your HIT may be rejected for such a selection. Donot select ascore of 0.Your HIT may be rejected for such aselection.
|
| 549 |
+
·Donot abuse the system,we takemeasures to spot that.
|
| 550 |
+
|
| 551 |
+

|
| 552 |
+
|
| 553 |
+
# Examples:
|
| 554 |
+
|
| 555 |
+
Rank how well do the objects in each following image resemble the object in the examples above?
|
| 556 |
+
|
| 557 |
+

|
| 558 |
+
|
| 559 |
+
# Submit
|
| 560 |
+
|
| 561 |
+
#
|
| 562 |
+
|
| 563 |
+
# Instructions
|
| 564 |
+
|
| 565 |
+
·Read the instructions carefullly ·Youare givenasentence that describesapicture,and afew images that try to portray this description.
|
| 566 |
+
·Yourmission istorank the imagesaccordingto howwelleach imageagreeswiththedescription.
|
| 567 |
+
·IMPORTANT:Youshouldassignadifferent rank(1..5) foreach image.
|
| 568 |
+
Donot select the same score for two images.Your HIT may be rejected for such aselection.
|
| 569 |
+
·Donot selectascore of0.Your HITmaybe rejected for suchaselection.
|
| 570 |
+
|
| 571 |
+
Rank how well does each image match the following description.
|
| 572 |
+
|
| 573 |
+
# Description: An oil painting
|
| 574 |
+
|
| 575 |
+
# Submit
|
| 576 |
+
|
| 577 |
+

|
| 578 |
+
Figure 23: Screenshots of the user study questionnaires with full instructions given to users. (a, top) Visual similarity to the examples of the personalized object (b, bottom) Context similarity to the context description
|
md/dev/OnD9zGAGT0k/OnD9zGAGT0k.md
ADDED
|
@@ -0,0 +1,711 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DIFFUSION POSTERIOR SAMPLING FOR GENERAL NOISY INVERSE PROBLEMS
|
| 2 |
+
|
| 3 |
+
Hyungjin Chung∗1,2, Jeongsol $\mathbf { K } \mathbf { i m } ^ { * 1 }$ , Michael T. Mccann2, Marc L. Klasky2 & Jong Chul Ye1 1KAIST, 2 Los Alamos National Laboratory {hj.chung, jeongsol, jong.ye}@kaist.ac.kr, {mccann, mklasky}@lanl.gov
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Diffusion models have been recently studied as powerful generative inverse problem solvers, owing to their high quality reconstructions and the ease of combining existing iterative solvers. However, most works focus on solving simple linear inverse problems in noiseless settings, which significantly under-represents the complexity of real-world problems. In this work, we extend diffusion solvers to efficiently handle general noisy (non)linear inverse problems via approximation of the posterior sampling. Interestingly, the resulting posterior sampling scheme is a blended version of diffusion sampling with the manifold constrained gradient without a strict measurement consistency projection step, yielding a more desirable generative path in noisy settings compared to the previous studies. Our method demonstrates that diffusion models can incorporate various measurement noise statistics such as Gaussian and Poisson, and also efficiently handle noisy nonlinear inverse problems such as Fourier phase retrieval and non-uniform deblurring. Code is available at https: //github.com/DPS2022/diffusion-posterior-sampling.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Diffusion models learn the implicit prior of the underlying data distribution by matching the gradient of the log density (i.e. Stein score; $\nabla _ { \pmb { x } } \log p ( \pmb { x } ) )$ (Song et al., 2021b). The prior can be leveraged when solving inverse problems, which aim to recover $_ { \textbf { \em x } }$ from the measurement $\textbf { { y } }$ , related through the forward measurement operator $\mathcal { A }$ and the detector noise $\mathbf { \nabla } _ { \mathbf { \pmb { n } } }$ . When we know such forward models, one can incorporate the gradient of the log likelihood (i.e. $\nabla _ { \pmb { x } } \log p ( \pmb { y } | \pmb { x } ) )$ in order to sample from the posterior distribution $p ( { \pmb x } | { \pmb y } )$ . While this looks straightforward, the likelihood term is in fact analytically intractable in terms of diffusion models, due to their dependence on time $t$ . Due to its intractability, one often resorts to projections onto the measurement subspace (Song et al., 2021b; Chung et al., 2022b; Chung & Ye, 2022; Choi et al., 2021). However, the projection-type approach fails dramatically when 1) there is noise in the measurement, since the noise is typically amplified during the generative process due to the ill-posedness of the inverse problems; and 2) the measurement process is nonlinear.
|
| 12 |
+
|
| 13 |
+
One line of works that aim to solve noisy inverse problems run the diffusion in the spectral domain (Kawar et al., 2021; 2022) so that they can tie the noise in the measurement domain into the spectral domain via singular value decomposition (SVD). Nonetheless, the computation of SVD is costly and even prohibitive when the forward model gets more complex. For example, Kawar et al. (2022) only considered seperable Gaussian kernels for deblurring, since they were restricted to the family of inverse problems where they could effectively perform the SVD. Hence, the applicability of such methods is restricted, and it would be useful to devise a method to solve noisy inverse problems without the computation of SVD. Furthermore, while diffusion models were applied to various inverse problems including inpainting (Song et al., 2021b; Chung et al., 2022b; Kawar et al., 2022; Chung et al., 2022a), super-resolution (Choi et al., 2021; Chung et al., 2022b; Kawar et al., 2022), colorization (Song et al., 2021b; Kawar et al., 2022; Chung et al., 2022a), compressed-sensing MRI (CS-MRI) (Song et al., 2022; Chung & Ye, 2022; Chung et al., 2022b), computed tomography (CT) (Song et al., 2022; Chung et al., 2022a), etc., to our best knowledge, all works so far considered linear inverse problems only, and have not explored nonlinear inverse problems.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Solving noisy linear, and nonlinear inverse problems with diffusion models. Our reconstruction results (right) from the measurements (left) are shown.
|
| 17 |
+
|
| 18 |
+
In this work, we devise a method to circumvent the intractability of posterior sampling by diffusion models via a novel approximation, which can be generally applied to noisy inverse problems. Specifically, we show that our method can efficiently handle both the Gaussian and the Poisson measurement noise. Also, our framework easily extends to any nonlinear inverse problems, when the gradients can be obtained through automatic differentiation. We further reveal that a recently proposed method of manifold constrained gradients (MCG) (Chung et al., 2022a) is a special case of the proposed method when the measurement is noiseless. With a geometric interpretation, we further show that the proposed method is more likely to yield desirable sample paths in noisy setting than the previous approach (Chung et al., 2022a). In addition, the proposed method fully runs on the image domain rather than the spectral domain, thereby avoiding the computation of SVD for efficient implementation. With extensive experiments including various inverse problems—inpainting, super-resolution, (Gaussian/motion/non-uniform) deblurring, Fourier phase retrieval—we show that our method serves as a general framework for solving general noisy inverse problems with superior quality (Representative results shown in Fig. 1).
|
| 19 |
+
|
| 20 |
+
# 2 BACKGROUND
|
| 21 |
+
|
| 22 |
+
# 2.1 SCORE-BASED DIFFUSION MODELS
|
| 23 |
+
|
| 24 |
+
Diffusion models define the generative process as the reverse of the noising process. Specifically, Song et al. (2021b) defines the Itˆo stochastic differential equation (SDE) for the data noising process (i.e. forward SDE) ${ \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf { } } { \mathbf } { \mathbf { } } { \mathbf { } } { \mathbf } { } \mathbf { } { \mathbf { } \mathbf { } } { \mathbf { } \mathbf { } } { \mathbf { } \mathbf { } } { \mathbf } { \mathbf { } } { \mathbf } { \mathbf } { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } { \mathbf } { \mathbf } { \mathbf } { \mathbf } { \mathbf } { \mathbf } { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { \mathbf \mathbf { } \mathbf { } \mathbf { } \mathbf \mathbf { } \mathbf { } \mathbf { } \mathbf } { \mathbf \mathbf { } \mathbf } \mathbf { \mathbf } { \mathbf } \mathbf { \mathbf } \mathbf { } \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf \mathbf { } \mathbf \mathbf { } \mathbf \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf \mathbf { } \mathbf \mathbf \mathbf \mathbf { } $ , $t \in [ 0 , T ]$ , $\pmb { x } ( t ) \in \mathbb { R } ^ { d } \forall t$ in the following form1
|
| 25 |
+
|
| 26 |
+
$$
|
| 27 |
+
d \pmb { x } = - \frac { \beta ( t ) } { 2 } \pmb { x } d t + \sqrt { \beta ( t ) } d \pmb { w } ,
|
| 28 |
+
$$
|
| 29 |
+
|
| 30 |
+
where $\beta ( t ) : \mathbb { R } \mathbb { R } > 0$ is the noise schedule of the process, typically taken to be monotonically increasing linear function of $t$ (Ho et al., 2020), and $\pmb { w }$ is the standard $d -$ dimensional Wiener process. The data distribution is defined when $t = 0$ , i.e. $\mathbf { \boldsymbol { x } } ( 0 ) \sim p _ { \mathrm { d a t a } }$ , and a simple, tractable distribution (e.g. isotropic Gaussian) is achieved when $t = T$ , i.e. ${ \pmb x } ( T ) \sim \mathcal { N } ( { \bf 0 } , I )$ .
|
| 31 |
+
|
| 32 |
+
Our aim is to recover the data generating distribution starting from the tractable distribution, which can be achieved by writing down the corresponding reverse SDE of (1) (Anderson, 1982):
|
| 33 |
+
|
| 34 |
+
$$
|
| 35 |
+
d \pmb { x } = \left[ - \frac { \beta ( t ) } { 2 } \pmb { x } - \beta ( t ) \nabla _ { \pmb { x } _ { t } } \log p _ { t } ( \pmb { x } _ { t } ) \right] d t + \sqrt { \beta ( t ) } d \bar { \pmb { w } } ,
|
| 36 |
+
$$
|
| 37 |
+
|
| 38 |
+
where $d t$ corresponds to time running backward and $d \bar { \mathbf { w } }$ to the standard Wiener process running backward. The drift function now depends on the time-dependent score function $\nabla _ { \pmb { x } _ { t } } \log p _ { t } ( \pmb { x } _ { t } )$ which is approximated by a neural network $\scriptstyle { s _ { \theta } }$ trained with denoising score matching (Vincent, 2011):
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\begin{array} { r } { \theta ^ { * } = \underset { \theta } { \arg \operatorname* { m i n } } \ : \mathbb { E } _ { t \sim U ( \varepsilon , 1 ) , x ( t ) \sim p ( x ( t ) | x ( 0 ) ) , x ( 0 ) \sim p _ { \mathrm { d a t a } } } \left[ \| s _ { \theta } ( x ( t ) , t ) - \nabla _ { x t } \log p ( x ( t ) | x ( 0 ) ) \| _ { 2 } ^ { 2 } \right] , } \end{array}
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
where $\varepsilon \simeq 0$ is a small positive constant. Once $\theta ^ { * }$ is acquired through (3), one can use the approximation $\nabla _ { \pmb { x } _ { t } } \log p _ { t } ( \pmb { x } _ { t } ) \simeq \pmb { s } _ { \theta ^ { * } } ( \pmb { x } _ { t } , t )$ as a plug-in estimate2 to replace the score function in (2). Discretization of (2) and solving using, e.g. Euler-Maruyama discretization, amounts to sampling from the data distribution $p ( { \pmb x } )$ , the goal of generative modeling.
|
| 45 |
+
|
| 46 |
+
Throughout the paper, we adopt the standard VP-SDE (i.e. ADM of Dhariwal & Nichol (2021) or Denoising Diffusion Probabilistic Models (DDPM) (Ho et al., 2020)), where the reverse diffusion variance which we denote by $\tilde { \sigma } ( t )$ is learned as in Dhariwal & Nichol (2021). In discrete settings (e.g. in the algorithm) with $N$ bins, we define ${ \pmb x } _ { i } \triangleq { \pmb x } ( t T / N )$ , $\beta _ { i } \triangleq \beta ( t T / N )$ , and subsequently $\begin{array} { r } { \alpha _ { i } \triangleq 1 - \beta _ { i } , \bar { \alpha } _ { i } \triangleq \prod _ { j = 1 } ^ { i } \alpha _ { i } } \end{array}$ following Ho et al. (2020).
|
| 47 |
+
|
| 48 |
+
# 2.2 INVERSE PROBLEM SOLVING WITH DIFFUSION MODELS
|
| 49 |
+
|
| 50 |
+
For various scientific problems, we have a partial measurement $\textbf { { y } }$ that is derived from $_ { \textbf { \em x } }$ . When the mapping ${ \mathbf x } \mapsto { \mathbf y }$ is many-to-one, we arrive at an ill-posed inverse problem, where we cannot exactly retrieve $_ { \textbf { \em x } }$ . In the Bayesian framework, one utilizes $p ( { \pmb x } )$ as the prior, and samples from the posterior $p ( { \pmb x } | { \pmb y } )$ , where the relationship is formally established with the Bayes’ rule: $p ( { \pmb x } | { \pmb y } ) =$ $p ( \pmb { y } | \pmb { x } ) p ( \pmb { x } ) / p ( \pmb { y } )$ . Leveraging the diffusion model as the prior, it is straightforward to modify (2) to arrive at the reverse diffusion sampler for sampling from the posterior distribution:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
d \pmb { x } = \left[ - \frac { \beta ( t ) } { 2 } \pmb { x } - \beta ( t ) ( \nabla _ { \pmb { x } _ { t } } \log p _ { t } ( \pmb { x } _ { t } ) + \nabla _ { \pmb { x } _ { t } } \log p _ { t } ( \pmb { y } | \pmb { x } _ { t } ) ) \right] d t + \sqrt { \beta ( t ) } d \bar { \pmb { w } } ,
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
where we have used the fact that
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\begin{array} { r } { \nabla _ { \pmb { x } _ { t } } \log p _ { t } ( \pmb { x } _ { t } | \pmb { y } ) = \nabla _ { \pmb { x } _ { t } } \log p _ { t } ( \pmb { x } _ { t } ) + \nabla _ { \pmb { x } _ { t } } \log p _ { t } ( \pmb { y } | \pmb { x } _ { t } ) . } \end{array}
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
In (4), we have two terms that should be computed: the score function $\nabla _ { \pmb { x } _ { t } } \log p _ { t } ( \pmb { x } _ { t } )$ , and the likelihood $\nabla _ { \pmb { x } _ { t } } \log p _ { t } ( \pmb { y } | \pmb { x } _ { t } )$ . To compute the former term involving $p _ { t } ( \pmb { x } )$ , we can simply use the pre-trained score function $s _ { \theta ^ { \ast } }$ . However, the latter term is hard to acquire in closed-form due to the dependence on the time $t$ , as there only exists explicit dependence between $\textbf { { y } }$ and $\scriptstyle { \mathbf { { \mathit { x } } } } _ { 0 }$ .
|
| 63 |
+
|
| 64 |
+
Formally, the general form of the forward model3 can be stated as
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\pmb { y } = \pmb { \mathcal { A } } ( \pmb { x } _ { 0 } ) + \pmb { n } , \quad \pmb { y } , \pmb { n } \in \mathbb { R } ^ { n } , \pmb { x } \in \mathbb { R } ^ { d } ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $\mathcal { A } ( \cdot ) : \mathbb { R } ^ { d } \mapsto \mathbb { R } ^ { n }$ is the forward measurement operator and $\textbf { \em n }$ is the measurement noise. In the case of white Gaussian noise, $\pmb { n } \sim \mathcal { N } ( 0 , \sigma ^ { 2 } \pmb { I } )$ . In explicit form, $p ( \pmb { y } | \pmb { x } _ { 0 } ) \sim \mathcal { N } ( \pmb { y } | \pmb { \mathcal { A } } ( \pmb { x } _ { 0 } ) , \sigma ^ { 2 } \pmb { I } )$ . However, there does not exist explicit dependency between $\textbf { { y } }$ and $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ , as can be seen in the probabilistic graph from Fig. 2, where the blue dotted line remains unknown.
|
| 71 |
+
|
| 72 |
+
In order to circumvent using the likelihood term directly, alternating projections onto the measurement subspace is a widely used strategy (Song et al., 2021b; Chung & Ye, 2022; Chung et al., 2022b). Namely, one can disregard the likelihood term in (4), and first take an unconditional update with (2), and then take a projection step such that measurement consistency can be met, when assuming $\mathbf { \nabla } _ { n } \simeq 0$ . Another line of work (Jalal et al., 2021) solves linear inverse problems where ${ \mathcal { A } } ( x ) \triangleq A x$ and utilizes an approximation $\begin{array} { r } { \nabla _ { \pmb { x } _ { t } } \log p _ { t } ( \pmb { y } | \pmb { x } ) \simeq \frac { \pmb { A } ^ { H } ( \pmb { y } - \pmb { A } \pmb { x } ) } { \sigma ^ { 2 } } } \end{array}$ AH(y−Ax)2 , which is obtained when n is assumed to be Gaussian noise with variance $\sigma ^ { 2 }$ . Nonetheless, the equation is only correct when $t = 0$ , while being wrong at all other noise levels that are actually used in the generative process. The incorrectness is counteracted by a heuristic of assuming higher levels of noise as $t \to T$ , such that $\begin{array} { r } { \nabla _ { \pmb { x } _ { t } } \log p _ { t } ( \pmb { y } | \pmb { x } ) \simeq \frac { \pmb { A } ^ { H } ( \pmb { y } - \pmb { A } \pmb { x } ) } { \sigma ^ { 2 } + \gamma _ { t } ^ { 2 } } } \end{array}$ , where $\{ \gamma _ { t } \} _ { t = 1 } ^ { T }$ are hyperparameters. While both lines of works aim to perform posterior sampling given the measurements and empirically work well on noiseless inverse problems, it should be noted that 1) they do not provide means to handle measurement noise, and 2) using such methods to solve nonlinear inverse problems either fails to work or is not straightforward to implement. The aim of this paper is to take a step toward a more general inverse problem solver, which can address noisy measurements and also scales effectively to nonlinear inverse problems.
|
| 73 |
+
|
| 74 |
+
# 3 DIFFUSION POSTERIOR SAMPLING (DPS)
|
| 75 |
+
|
| 76 |
+
# 3.1 APPROXIMATION OF THE LIKELIHOOD
|
| 77 |
+
|
| 78 |
+
Recall that no analytical formulation for $p ( \pmb { y } | \pmb { x } _ { t } )$ exists. In order to exploit the measurement model $p ( \pmb { y } | \pmb { x } _ { 0 } )$ , we factorize $p ( \pmb { y } | \pmb { x } _ { t } )$ as follows:
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\begin{array} { l } { p ( { \pmb y } | { \pmb x } _ { t } ) = \displaystyle \int p ( { \pmb y } | { \pmb x } _ { 0 } , { \pmb x } _ { t } ) p ( { \pmb x } _ { 0 } | { \pmb x } _ { t } ) d { \pmb x } _ { 0 } } \\ { \displaystyle = \int p ( { \pmb y } | { \pmb x } _ { 0 } ) p ( { \pmb x } _ { 0 } | { \pmb x } _ { t } ) d { \pmb x } _ { 0 } , } \end{array}
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
where the second equality comes from that $\textbf { { y } }$ and $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ are conditionally independent on $\scriptstyle { \mathbf { { \mathit { x } } } } _ { 0 }$ , as shown in Fig. 2. Here, $p ( \pmb { x } _ { 0 } | \pmb { x } _ { t } )$ , as was shown with blue dotted lines in Fig. 2, is intractable in general. Note however, that for the case of diffusion models such as VP-SDE or DDPM, the forward diffusion can be simply represented by
|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
Figure 2: Probabilistic graph. Black solid line: tractable, blue dotted line: intractable in general.
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\begin{array} { r } { \pmb { x } _ { t } = \sqrt { \bar { \alpha } ( t ) } \pmb { x } _ { 0 } + \sqrt { 1 - \bar { \alpha } ( t ) } \pmb { z } , \qquad \pmb { z } \sim \mathcal { N } ( \mathbf { 0 } , I ) , } \end{array}
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
so that we can obtain the specialized representation of the posterior mean as shown in Proposition 1 through the Tweedie’s approach (Efron, 2011; Kim & Ye, 2021). Detailed derivations can be found in Appendix A.
|
| 94 |
+
|
| 95 |
+
Proposition 1. For the case of $V P$ -SDE or DDPM sampling, $p ( \pmb { x } _ { 0 } | \pmb { x } _ { t } )$ has the unique posterior mean at
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\hat { x } _ { 0 } : = \mathbb { E } [ x _ { 0 } | x _ { t } ] = \frac { 1 } { \sqrt { \bar { \alpha } ( t ) } } ( x _ { t } + ( 1 - \bar { \alpha } ( t ) ) \nabla _ { x _ { t } } \log p _ { t } ( x _ { t } ) )
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
Remark 1. By replacing $\nabla _ { \pmb { x } _ { t } } \log p ( \pmb { x } _ { t } )$ in (9) with the score estimate ${ \pmb { s } } _ { \theta ^ { * } } ( { \pmb { x } } _ { t } )$ , we can approximate the posterior mean from $p ( \pmb { x } _ { 0 } | \pmb { x } _ { t } )$ as:
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\hat { \pmb x } _ { 0 } \simeq \frac { 1 } { \sqrt { \bar { \alpha } ( t ) } } ( \pmb x _ { t } + ( 1 - \bar { \alpha } ( t ) ) \pmb s _ { \theta ^ { * } } ( \pmb x _ { t } , t ) ) .
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
In fact, the result is closely related to the well established field of denoising. Concretely, consider the problem of retrieving the estimate of clean $\scriptstyle { \mathbf { { \vec { x } } } } _ { 0 }$ from the given Gaussian noisy $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ . A classic result of Tweedie’s formula (Robbins, 1992; Stein, 1981; Efron, 2011; Kim & Ye, 2021) states that one can retrieve the empirical Bayes optimal posterior mean $\scriptstyle { \hat { \mathbf { x } } } _ { 0 }$ using the formula in $( I O )$ .
|
| 108 |
+
|
| 109 |
+
Given the posterior mean $\scriptstyle { \hat { \mathbf { x } } } _ { 0 }$ that can be efficiently computed at the intermediate steps, our proposal is to provide a tractable approximation for $p ( \pmb { y } | \mathbf { \bar { x } } _ { t } )$ such that one can use the surrogate function to maximize the likelihood—yielding approximate posterior sampling. Specifically, given the interpretation $p ( \pmb { y } | \pmb { x } _ { t } ) = \mathbb { E } _ { \pmb { x } _ { 0 } \sim p ( \pmb { x } _ { 0 } | \pmb { x } _ { t } ) } \overset { } { [ } p \bar { ( \pmb { y } | \pmb { x } _ { 0 } ) } ]$ from (7), we use the following approximation:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
p ( \pmb { y } | \pmb { x } _ { t } ) \simeq p ( \pmb { y } | \hat { \pmb { x } } _ { 0 } ) , \quad \mathrm { w h e r e } \quad \hat { \pmb { x } } _ { 0 } : = \mathbb { E } [ \pmb { x } _ { 0 } | \pmb { x } _ { t } ] = \mathbb { E } _ { \pmb { x } _ { 0 } \sim p ( \pmb { x } _ { 0 } | \pmb { x } _ { t } ) } \left[ \pmb { x } _ { 0 } \right]
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
implying that the outer expectation of $p ( \pmb { y } | \pmb { x } _ { 0 } )$ over the posterior distribution is replaced with inner expectation of $\scriptstyle { \mathbf { { \mathit { x } } } } _ { 0 }$ . In fact, this type of the approximation is closely related to the Jensen’s inequality, so we need the following definition to quantify the approximation error:
|
| 116 |
+
|
| 117 |
+
Definition 1 (Jensen gap (Gao et al., 2017; Simic, 2008)). Let x be a random variable with distribution $p ( { \pmb x } )$ . For some function $f$ that may or may not be convex, the Jensen gap is defined as
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\begin{array} { r } { \mathcal { I } ( f , \pmb { x } \sim p ( \pmb { x } ) ) = \mathbb { E } [ f ( \pmb { x } ) ] - f ( \mathbb { E } [ \pmb { x } ] ) , } \end{array}
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
where the expectation is taken over $p ( { \pmb x } )$
|
| 124 |
+
|
| 125 |
+
<table><tr><td>Algorithm1DPS-Gaussian</td><td>Algorithm2DPS-Poisson</td></tr><tr><td>Require: N,y,{1 {o)1</td><td>Require: N,y,{i1,{1</td></tr><tr><td>1: xN ~ N(0,I) 2:fori= N-1to 0do</td><td>1: xN ~ N(0,1) 2:fori= N-1to 0do</td></tr><tr><td></td><td></td></tr><tr><td>3: s←se(xi,i)</td><td>3: s←sθ(xi,i)</td></tr><tr><td>4: 20←(xi+(1-i)s)</td><td>4: 20←(ci+(1-i)s)</td></tr><tr><td>5: z ~ N(0,1)</td><td>5: z ~ N(0,1)</td></tr><tr><td>xi-1←Vai(1-ai-1) Vi-1βi 6: xi+ 1-αi 1-αi 7: xi-1 ← x'-1- SiVxilly- A(xo)l/² 8:end for</td><td>xi-1←V@i(1-ai-1) Vai-1βi 6: xi+ xo+oiz 1- 1- 7: χi-1 ← x'-1-SiV𝑥illy-A(xo)ll²</td></tr></table>
|
| 126 |
+
|
| 127 |
+
The following theorem derives the closed-form upper bound of the Jensen gap for the inverse problem from (6) when $\pmb { n } \sim \mathcal { N } ( 0 , \sigma ^ { 2 } \pmb { I } )$ :
|
| 128 |
+
|
| 129 |
+
Theorem 1. For the given measurement model (6) with $\pmb { n } \sim \mathcal { N } ( 0 , \sigma ^ { 2 } \pmb { I } )$ , we have
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
p ( \pmb { y } | \pmb { x } _ { t } ) \simeq p ( \pmb { y } | \hat { \pmb { x } } _ { 0 } ) ,
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
where the approximation error can be quantified with the Jensen gap, which is upper bounded by
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
\mathcal { I } \leq \frac { d } { \sqrt { 2 \pi \sigma ^ { 2 } } } e ^ { - 1 / 2 \sigma ^ { 2 } } \| \nabla _ { \pmb { x } } \mathcal { A } ( \pmb { x } ) \| m _ { 1 } ,
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\begin{array} { r } { \| \nabla _ { \pmb { x } } \pmb { \mathcal { A } } ( \pmb { x } ) \| : = \operatorname* { m a x } _ { \pmb { x } } \| \nabla _ { \pmb { x } } \pmb { \mathcal { A } } ( \pmb { x } ) \| \ a n d m _ { 1 } : = \int \| \pmb { x } _ { 0 } - \hat { \pmb { x } } _ { 0 } \| p ( \pmb { x } _ { 0 } | \pmb { x } _ { t } ) d x _ { 0 } . } \end{array}
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
Remark 2. Note that $\| \nabla _ { \pmb { x } } \pmb { \mathcal { A } } ( \pmb { x } ) \|$ is finite in most of the inverse problems. This should not be confused with the ill-posedness of the inverse problems, which refers to the unboundedness of the inverse operator $\boldsymbol { \mathcal { A } } ^ { - 1 }$ . Accordingly, if $m _ { 1 }$ is also finite (which is the case for most of the distribution in practice), the Jensen gap in Theorem $I$ can approach to $O$ as $\sigma \infty$ , suggesting that the approximation error reduces with higher measurement noise. This may explain why our DPS works well for noisy inverse problems. In addition, although we have specified the measurement distribution to be Gaussian, we can also determine the Jensen gap for other measurement distributions (e.g. Poisson) in an analogous fashion.
|
| 146 |
+
|
| 147 |
+
By leveraging the result of Theorem 1, we can use the approximate gradient of the log likelihood
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
\nabla _ { \pmb { x } _ { t } } \log p ( \pmb { y } | \pmb { x } _ { t } ) \simeq \nabla _ { \pmb { x } _ { t } } \log p ( \pmb { y } | \hat { \pmb { x } } _ { 0 } ) ,
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
where the latter is now analytically tractable, as the measurement distribution is given.
|
| 154 |
+
|
| 155 |
+
# 3.2 MODEL DEPENDENT LIKELIHOOD OF THE MEASUREMENT
|
| 156 |
+
|
| 157 |
+
Note that we may have different measurement models $p ( \pmb { y } | \pmb { x } _ { 0 } )$ for each application. Two of the most common cases in inverse problems are the Gaussian noise and the Poisson noise. Here, we explore how our diffusion posterior sampling described above can be adapted to each case.
|
| 158 |
+
|
| 159 |
+
Gaussian noise. The likelihood function takes the form
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
p ( \pmb { y } | \pmb { x } _ { 0 } ) = \frac { 1 } { \sqrt { ( 2 \pi ) ^ { n } \sigma ^ { 2 n } } } \exp \left[ - \frac { \| \pmb { y } - \pmb { \mathcal { A } } ( \pmb { x } _ { 0 } ) \| _ { 2 } ^ { 2 } } { 2 \sigma ^ { 2 } } \right] ,
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
where $n$ denotes the dimension of the measurement $\textbf { { y } }$ . By differentiating $p ( \pmb { y } | \pmb { x } _ { t } )$ with respect to $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ using Theorem 1 and (15), we get
|
| 166 |
+
|
| 167 |
+
$$
|
| 168 |
+
\nabla _ { \pmb { x } _ { t } } \log p ( \pmb { y } | \pmb { x } _ { t } ) \simeq - \frac { 1 } { \sigma ^ { 2 } } \nabla _ { \pmb { x } _ { t } } \| \pmb { y } - \pmb { \mathcal { A } } ( \hat { \pmb { x } } _ { 0 } ( \pmb { x } _ { t } ) ) \| _ { 2 } ^ { 2 }
|
| 169 |
+
$$
|
| 170 |
+
|
| 171 |
+
where we have explicitly denoted $\hat { \pmb x } _ { 0 } : = \hat { \pmb x } _ { 0 } ( { \pmb x } _ { t } )$ to emphasize that $\scriptstyle { \hat { \mathbf { x } } } _ { 0 }$ is a function of $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ . Consequently, taking the gradient $\nabla _ { \pmb { x } _ { t } }$ amounts to taking the backpropagation through the network. Plugging in the result from Theorem 1 to (5) with the trained score function, we finally conclude that
|
| 172 |
+
|
| 173 |
+
$$
|
| 174 |
+
\nabla _ { \pmb { x } _ { t } } \log p _ { t } ( \pmb { x } _ { t } | \pmb { y } ) \simeq \pmb { s } _ { \theta ^ { * } } ( \pmb { x } _ { t } , t ) - \rho \nabla _ { \pmb { x } _ { t } } \| \pmb { y } - \pmb { A } ( \hat { \pmb { x } } _ { 0 } ) \| _ { 2 } ^ { 2 } ,
|
| 175 |
+
$$
|
| 176 |
+
|
| 177 |
+
where $\rho \triangleq 1 / \sigma ^ { 2 }$ is set as the step size.
|
| 178 |
+
|
| 179 |
+

|
| 180 |
+
Figure 3: Conceptual illustration of the geometries of two different diffusion processes. Our method prevents the sample from falling off the generative manifolds when the measurements are noisy.
|
| 181 |
+
|
| 182 |
+
Poisson noise. The likelihood function for the Poisson measurements under the i.i.d. assumption is given as
|
| 183 |
+
|
| 184 |
+
$$
|
| 185 |
+
p ( \pmb { y } | \pmb { x } _ { 0 } ) = \prod _ { j = 1 } ^ { n } \frac { [ \pmb { \mathcal { A } } ( \pmb { x } _ { 0 } ) ] _ { j } ^ { \pmb { y } _ { j } } \exp { [ [ - \pmb { \mathcal { A } } ( \pmb { x } _ { 0 } ) ] _ { j } ] } } { \pmb { y } _ { j } ! } ,
|
| 186 |
+
$$
|
| 187 |
+
|
| 188 |
+
where $j$ indexes the measurement bin. In most cases where the measured values are not too small, the model can be approximated by a Gaussian distribution with very high accuracy4. Namely,
|
| 189 |
+
|
| 190 |
+
$$
|
| 191 |
+
\begin{array} { c } { \displaystyle p ( \pmb { y } | \pmb { x } _ { 0 } ) \prod _ { j = 1 } ^ { n } \frac { 1 } { \sqrt { 2 \pi [ \pmb { A } ( \pmb { x } _ { 0 } ) ] _ { j } } } \exp ( - \frac { ( \pmb { y } _ { j } - [ \pmb { A } ( \pmb { x } _ { 0 } ) ] _ { j } ) ^ { 2 } } { 2 [ \pmb { A } ( \pmb { x } _ { 0 } ) ] _ { j } } ) } \\ { \displaystyle \simeq \prod _ { j = 1 } ^ { n } \frac { 1 } { \sqrt { 2 \pi \pmb { y } _ { j } } } \exp ( - \frac { ( \pmb { y } _ { j } - [ \pmb { A } ( \pmb { x } _ { 0 } ) ] _ { j } ) ^ { 2 } } { 2 \pmb { y } _ { j } } ) , } \end{array}
|
| 192 |
+
$$
|
| 193 |
+
|
| 194 |
+
where we have used the standard approximation for the shot noise model $[ \mathcal { A } ( \pmb { x } _ { 0 } ) ] _ { j } \simeq \pmb { y } _ { j }$ to arrive at the last equation (Kingston, 2013). Then, similar to the Gaussian case, by differentiation and the use of Theorem 1, we have that
|
| 195 |
+
|
| 196 |
+
$$
|
| 197 |
+
\nabla _ { \pmb { x } _ { t } } \log p ( \pmb { y } | \pmb { x } _ { t } ) \simeq - \rho \nabla _ { \pmb { x } _ { t } } \| \pmb { y } - \pmb { A } ( \pmb { x } _ { 0 } ) \| _ { \pmb { \Lambda } } ^ { 2 } , \quad [ \pmb { \Lambda } ] _ { i i } \triangleq 1 / 2 \pmb { y } _ { j } ,
|
| 198 |
+
$$
|
| 199 |
+
|
| 200 |
+
where $\| \pmb { a } \| _ { \pmb { \Lambda } } ^ { 2 } \triangleq \pmb { a } ^ { T } \pmb { \Lambda } \pmb { a }$ , and we have included $\rho$ to define the step size as in the Gaussian case. We can summarize our strategy for each noise model as follows:
|
| 201 |
+
|
| 202 |
+
$$
|
| 203 |
+
\begin{array} { r l } & { \nabla _ { \pmb { x } _ { t } } \log p _ { t } ( \pmb { x } _ { t } | \pmb { y } ) \simeq s _ { \theta ^ { * } } ( \pmb { x } _ { t } , t ) - \rho \nabla _ { \pmb { x } _ { t } } \| \pmb { y } - \pmb { A } ( \hat { \pmb { x } } _ { 0 } ) \| _ { 2 } ^ { 2 } } \\ & { \nabla _ { \pmb { x } _ { t } } \log p _ { t } ( \pmb { x } _ { t } | \pmb { y } ) \simeq s _ { \theta ^ { * } } ( \pmb { x } _ { t } , t ) - \rho \nabla _ { \pmb { x } _ { t } } \| \pmb { y } - \pmb { A } ( \hat { \pmb { x } } _ { 0 } ) \| _ { \pmb { \Lambda } } ^ { 2 } } \end{array}
|
| 204 |
+
$$
|
| 205 |
+
|
| 206 |
+
Incorporation of (16) or (21) into the usual ancestral sampling (Ho et al., 2020) steps leads to Algorithm $^ { 1 , 2 ^ { 5 } }$ . Here, we name our algorithm Diffusion Posterior Sampling (DPS), as we construct our method in order to perform sampling from the posterior distribution. Notice that unlike prior methods that limit their applications to linear inverse problems ${ \mathcal { A } } ( x ) \triangleq A x$ , our method is fully general in that we can also use nonlinear operators $\bar { \mathcal { A } ( \cdot ) }$ . To show that this is indeed the case, in experimental section we take the two notoriously hard nonlinear inverse problems: Fourier phase retrieval and non-uniform deblurring, and show that our method has very strong performance even in such challenging problem settings.
|
| 207 |
+
|
| 208 |
+
Geometry of DPS and connection to manifold constrained gradient (MCG). Interestingly, our method in the Gaussian measurement case corresponds to the manifold constrained gradient (MCG) step that was proposed in Chung et al. (2022a), when setting $W = I$ from Chung et al. (2022a).
|
| 209 |
+
|
| 210 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">SR(×4)</td><td colspan="2">Inpaint (box)</td><td colspan="2">Inpaint (random)</td><td colspan="2">Deblur (gauss)</td><td colspan="2">Deblur (motion)</td></tr><tr><td>FID↓</td><td>LPIPS↓</td><td>FID↓</td><td>LPIPS↓</td><td>FID↓</td><td>LPIPS↓</td><td>FID←</td><td>LPIPS↓</td><td>FID←</td><td>LPIPS↓</td></tr><tr><td>DPS (ours)</td><td>39.35</td><td>0.214</td><td>33.12</td><td>0.168</td><td>21.19</td><td>0.212</td><td>44.05</td><td>0.257</td><td>39.92</td><td>0.242</td></tr><tr><td>DDRM (Kawar et al.,2022)</td><td>62.15</td><td>0.294</td><td>42.93</td><td>0.204</td><td>69.71</td><td>0.587</td><td>74.92</td><td>0.332</td><td>-</td><td>1</td></tr><tr><td>MCG (Chung et al.,2022a)</td><td>87.64</td><td>0.520</td><td>40.11</td><td>0.309</td><td>29.26</td><td>0.286</td><td>101.2</td><td>0.340</td><td>310.5</td><td>0.702</td></tr><tr><td>PnP-ADMM (Chan et al.,2016)</td><td>66.52</td><td>0.353</td><td>151.9</td><td>0.406</td><td>123.6</td><td>0.692</td><td>90.42</td><td>0.441</td><td>89.08</td><td>0.405</td></tr><tr><td>Score-SDE (Song et al.,2021b) (ILVR (Choi et al.,2021))</td><td>96.72</td><td>0.563</td><td>60.06</td><td>0.331</td><td>76.54</td><td>0.612</td><td>109.0</td><td>0.403</td><td>292.2</td><td>0.657</td></tr><tr><td>ADMM-TV</td><td>110.6</td><td>0.428</td><td>68.94</td><td>0.322</td><td>181.5</td><td>0.463</td><td>186.7</td><td>0.507</td><td>152.3</td><td>0.508</td></tr></table>
|
| 211 |
+
|
| 212 |
+
Table 1: Quantitative evaluation (FID, LPIPS) of solving linear inverse problems on FFHQ $2 5 6 \times 2 5 6 .$ 1k validation dataset. Bold: best, underline: second best.
|
| 213 |
+
|
| 214 |
+
However, Chung et al. (2022a) additionally performs projection onto the measurement subspace after the update step via (16), which can be thought of as corrections that are made for deviations from perfect data consistency. Borrowing the interpretation of diffusion models from Chung et al. (2022a), we compare the generative procedure geometrically. It was shown that in the context of diffusion models, a single denoising step via $s _ { \theta ^ { * } }$ corresponds to the orthogonal projection to the data manifold, and the gradient step $\begin{array} { r } { \nabla _ { \pmb { x } _ { i } } \| \pmb { y } - \pmb { \mathcal { A } } ( \hat { \pmb { x } } _ { 0 } ) \| _ { 2 } ^ { 2 } } \end{array}$ takes a step tangent to the current manifold. For noisy inverse problems, when taking projections on the measurement subspace after every gradient step as in Chung et al. (2022a), the sample may fall off the manifold, accumulate error, and arrive at the wrong solution, as can be seen in Fig. 3a, due to the overly imposing the data consistency that works only for noiseless measurement. On the other hand, our method without the projections on the measurement subspace is free from such drawbacks for noisy measurement (see Fig. 3b). Accordingly, while projections on the measurement subspace are useful for noiseless inverse problems that Chung et al. (2022a) tries to solve, they fail dramatically for noisy inverse problems that we try to solve. Finally, when used together with the projection steps on the measurement subspace, it was shown that choosing different W for different applications was necessary for MCG, whereas our method is free from such heuristics.
|
| 215 |
+
|
| 216 |
+
# 4 EXPERIMENTS
|
| 217 |
+
|
| 218 |
+
Experimental setup. We test our experiment on two datasets that have diverging characteristic - FFHQ $2 5 6 \times 2 5 6$ (Karras et al., 2019), and Imagenet $2 5 6 \times 2 5 6$ (Deng et al., 2009), on 1k validation images each. The pre-trained diffusion model for ImageNet was taken from Dhariwal & Nichol (2021) and was used directly without finetuning for specific tasks. The diffusion model for FFHQ was trained from scratch using 49k training data (to exclude 1k validation set) for 1M steps. All images are normalized to the range $[ 0 , 1 ]$ . Forward measurement operators are specified as follows: (i) For box-type inpainting, we mask out $1 2 8 \times 1 2 8$ box region following Chung et al. (2022a), and for random-type we mask out $92 \%$ of the total pixels (all RGB channels). (ii) For super-resolution, bicubic downsampling is performed. (iii) Gaussian blur kernel has size $6 1 \times 6 1$ with standard deviation of 3.0, and motion blur is randomly generated with the code6, with size $6 1 \times 6 1$ and intensity value 0.5. The kernels are convolved with the ground truth image to produce the measurement. (iv) For phase retrieval, Fourier transform is performed to the image, and only the Fourier magnitude is taken as the measurement. (v) For nonlinear deblurring, we leverage the neural network approximated forward model as in Tran et al. (2021). All Gaussian noise is added to the measurement domain with $\sigma = 0 . 0 5$ . Poisson noise level is set to $\lambda = 1 . 0$ . More details including the hyper-parameters can be found in Appendix B,D.
|
| 219 |
+
|
| 220 |
+
We perform comparison with the following methods: Denoising diffusion restoration models (DDRM) (Kawar et al., 2022), manifold constrained gradients (MCG) (Chung et al., 2022a), Plug-and-play alternating direction method of multipliers (PnP-ADMM) (Chan et al., 2016) using DnCNN Zhang et al. (2017) in place of proximal mappings, total-variation (TV) sparsity regularized optimization method (ADMM-TV), and Score-SDE (Song et al., 2021b). Note that Song et al. (2021b) only proposes a method for inpainting, and not for general inverse problems. However, the methodology of iteratively applying projections onto convex sets (POCS) was applied in the same way for super-resolution in iterative latent variable refinement (ILVR) (Choi et al., 2021), and more generally to linear inverse problems in Chung et al. (2022b); thus we simply refer to these methods as score-SDE henceforth.For a fair comparison, we used the same score function for all the different methods that are based on diffusion (i.e. DPS, DDRM, MCG, score-SDE).
|
| 221 |
+
|
| 222 |
+
Table 3: Quantitative evaluation of the Phase Retrieval task (FFHQ).
|
| 223 |
+
|
| 224 |
+
<table><tr><td>Method</td><td>FID↓LPIPS↓</td></tr><tr><td>DPS(ours)</td><td>55.61 0.399</td></tr><tr><td>oss</td><td>137.7 0.635</td></tr><tr><td>HIO</td><td>96.40 0.542</td></tr><tr><td>ER</td><td>214.1 0.738</td></tr></table>
|
| 225 |
+
|
| 226 |
+

|
| 227 |
+
Figure 4: Results on solving linear inverse problems with Gaussian noise $( \sigma = 0 . 0 5 )$ .
|
| 228 |
+
|
| 229 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">SR(×4)</td><td colspan="2">Inpaint (box)</td><td colspan="2">Inpaint (random)</td><td colspan="2">Deblur (gauss)</td><td colspan="2">Deblur (motion)</td></tr><tr><td>FID↓</td><td>LPIPS↓</td><td>FID↓</td><td>LPIPS↓</td><td>FID↓</td><td>LPIPS↓</td><td>FID↓</td><td>LPIPS↓</td><td>FID↓</td><td>LPIPS↓</td></tr><tr><td>DPS (ours)</td><td>50.66</td><td>0.337</td><td>38.82</td><td>0.262</td><td>35.87</td><td>0.303</td><td>62.72</td><td>0.444</td><td>56.08</td><td>0.389</td></tr><tr><td>DDRM (Kawar et al.,2022)</td><td>59.57</td><td>0.339</td><td>45.95</td><td>0.245</td><td>114.9</td><td>0.665</td><td>63.02</td><td>0.427</td><td></td><td>-</td></tr><tr><td>MCG (Chung et al., 2022a)</td><td>144.5</td><td>0.637</td><td>39.74</td><td>0.330</td><td>39.19</td><td>0.414</td><td>95.04</td><td>0.550</td><td>186.9</td><td>0.758</td></tr><tr><td>PnP-ADMM(Chan et al., 2016)</td><td>97.27</td><td>0.433</td><td>78.24</td><td>0.367</td><td>114.7</td><td>0.677</td><td>100.6</td><td>0.519</td><td>89.76</td><td>0.483</td></tr><tr><td>Score-SDE (Song et al.,2021b) (ILVR(Choi et al.,2021))</td><td>170.7</td><td>0.701</td><td>54.07</td><td>0.354</td><td>127.1</td><td>0.659</td><td>120.3</td><td>0.667</td><td>98.25</td><td>0.591</td></tr><tr><td>ADMM-TV</td><td>130.9</td><td>0.523</td><td>87.69</td><td>0.319</td><td>189.3</td><td>0.510</td><td>155.7</td><td>0.588</td><td>138.8</td><td>0.525</td></tr></table>
|
| 230 |
+
|
| 231 |
+
Table 2: Quantitative evaluation (FID, LPIPS) of solving linear inverse problems on ImageNet $2 5 6 \times 2 5 6 .$ -1k validation dataset. Bold: best, underline: second best.
|
| 232 |
+
|
| 233 |
+
For phase retrieval, we compare with three strong baselines that are considered standards: oversampling smoothness (OSS) (Rodriguez et al., 2013), Hybrid input-output (HIO) (Fienup & Dainty, 1987), and error reduction (ER) algorithm (Fienup, 1982). For nonlinear deblurring, we compare against the prior arts: blur kernel space (BKS) - styleGAN2 (Tran et al., 2021), based on GAN priors, blur kernel space (BKS) - generic (Tran et al., 2021), based on Hyper-Laplacian priors, and MCG.
|
| 234 |
+
|
| 235 |
+
Further experimental details are provided in Appendix D. For quantitative comparison, we focus on the following two widelyused perceptual metrics - Fréchet Inception Distance (FID), and Learned Perceptual Image Patch Similarity (LPIPS) distance, with further evaluation with standard metrics: peak signalto-noise-ratio (PSNR), and structural similarity index (SSIM) provided in Appendix E.
|
| 236 |
+
|
| 237 |
+
Noisy linear inverse problems. We first test our method on diverse linear inverse problems with Gaussian measurement noises. The quantitative results shown in Tables 1,2 illustrate that the proposed method outperforms all the other comparison methods by large margins. Particularly, MCG and Score-SDE (or ILVR) are methods that rely on projections on the measurement subspace, where the generative process is controlled such that the measurement consistency is perfectly met. While this is useful for noiseless (or negligible noise) problems, in the case where we cannot ignore noise, the solutions overfit to the corrupted measurement (for further discussion, see Appendix C.1). In Fig. 4, we specifically compare our methods with DDRM and PnP-ADMM, which are two methods that are known to be robust to measurement noise. Our method is able to provide high-quality reconstructions that are crisp and realistic on all tasks. On the other hand, we see that DDRM performs poorly on image inpainting tasks where the dimensionality of the measurements are very low, and tend to produce blurrier results on both SR, and deblurring tasks. We further note that DDRM relies on SVD, and hence is only able to solve problems where the forward measurement matrix can be efficiently implemented (e.g. separable kernel in the case of deblurring). Hence, while one can solve Gaussian deblurring, one cannot solve problems such as motion deblur, where the point spread function (PSF) is much more complex. Contrarily, our method is not restricted by such conditions, and can be always used regardless of the complexity. The results of the Poisson noisy linear inverse problems are presented in Fig. 5. Consistent with the Gaussian case, DPS is capable of producing high quality reconstructions that closely mimic the ground truth. From the experiments, we further observe that the weighted least squares method adopted in Algorithm 2 works best compared to other choices that can be made for Poisson inverse problems (for further analysis, see Appendix C.4).
|
| 238 |
+
|
| 239 |
+

|
| 240 |
+
Figure 5: Results on solving linear inverse problems with Poisson noise $( \lambda = 1 . 0$ ).
|
| 241 |
+
|
| 242 |
+

|
| 243 |
+
Figure 6: Results on solving nonlinear inverse problems with Gaussian noise $\langle \sigma = 0 . 0 5 \rangle$ ).
|
| 244 |
+
|
| 245 |
+
Nonlinear inverse problems. We show the quantitative results of phase retrieval in Table 3, and the results of nonlinear deblurring in Table 4. Representative results are illustrated in Fig. 6.
|
| 246 |
+
|
| 247 |
+
We first observe that the proposed method is capable of highly accurate reconstruction for the given phase retrieval problem, capturing most of the high frequency details. However, we also observe that we do not always get high quality reconstructions. In fact, due to the non-uniqueness of the phase-retrieval under some conditions, widely used methods such as HIO are also dependent on the initializations (Fienup, 1978), and hence it is considered standard practice to first generate multiple reconstructions, and take the best sample. Following this, when reporting our quantitative metrics, we generate 4 different samples for all the methods, and report the metric based on the best samples. We see that DPS outperforms other methods by a large margin. For the case of nonlinear deblurring, we again see that our method performs the best, producing highly realistic samples. BKS-styleGAN2 (Tran et al., 2021) leverages GAN prior and hence generates feasible human faces, but heavily distorts the identity. BKS-generic utilizes the Hyper-Laplacian prior (Krishnan & Fergus, 2009), but is unable to remove artifacts and noise properly. MCG amplifies noise in a similar way that was discussed in Fig. 7.
|
| 248 |
+
|
| 249 |
+
Table 4: Quantitative evaluation of the non-uniform deblurring task (FFHQ).
|
| 250 |
+
|
| 251 |
+
<table><tr><td>Method DPS(ours)</td><td>FID↓ LPIPS</td></tr><tr><td>BKS-styleGAN2</td><td>41.86 0.278 0.407</td></tr><tr><td>BKS-generic</td><td>63.18 141.0 0.640</td></tr><tr><td>MCG</td><td>180.1 0.695</td></tr></table>
|
| 252 |
+
|
| 253 |
+
# 5 CONCLUSION
|
| 254 |
+
|
| 255 |
+
In this paper, we proposed diffusion posterior sampling (DPS) strategy for solving general noisy (both signal dependent/independent) inverse problems in imaging. Our method is versatile in that it can also be used for highly noisy and nonlinear inverse problems. Extensive experiments show that the proposed method outperforms existing state-of-the-art by large margins, and also covers the widest range of problems.
|
| 256 |
+
|
| 257 |
+
# ACKNOWLEDGMENTS
|
| 258 |
+
|
| 259 |
+
This work was supported by the National Research Foundation of Korea under Grant NRF2020R1A2B5B03001980, by the Korea Medical Device Development Fund grant funded by the Korea government (the Ministry of Science and ICT, the Ministry of Trade, Industry and Energy, the Ministry of Health & Welfare, the Ministry of Food and Drug Safety) (Project Number: 1711137899, KMDF_PR_20200901_0015), and by the KAIST Key Research Institute (Interdisciplinary Research Group) Project.
|
| 260 |
+
|
| 261 |
+
# REFERENCES
|
| 262 |
+
|
| 263 |
+
Brian DO Anderson. Reverse-time diffusion equation models. Stochastic Processes and their Applications, 12(3):313–326, 1982.
|
| 264 |
+
|
| 265 |
+
Thilo Balke, Fernando Davis, Cristina Garcia-Cardona, Michael McCann, Luke Pfister, and Brendt Wohlberg. Scientific Computational Imaging COde (SCICO). Software library available from https://github.com/lanl/scico, 2022.
|
| 266 |
+
|
| 267 |
+
Yochai Blau and Tomer Michaeli. The perception-distortion tradeoff. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 6228–6237, 2018.
|
| 268 |
+
|
| 269 |
+
Yu M Bruck and LG Sodin. On the ambiguity of the image reconstruction problem. Optics communications, 30(3):304–308, 1979.
|
| 270 |
+
|
| 271 |
+
Stanley H Chan, Xiran Wang, and Omar A Elgendy. Plug-and-play admm for image restoration: Fixed-point convergence and applications. IEEE Transactions on Computational Imaging, 3(1): 84–98, 2016.
|
| 272 |
+
|
| 273 |
+
Jooyoung Choi, Sungwon Kim, Yonghyun Jeong, Youngjune Gwon, and Sungroh Yoon. ILVR: Conditioning method for denoising diffusion probabilistic models. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), 2021.
|
| 274 |
+
|
| 275 |
+
Hyungjin Chung and Jong Chul Ye. Score-based diffusion models for accelerated MRI. Medical Image Analysis, pp. 102479, 2022.
|
| 276 |
+
|
| 277 |
+
Hyungjin Chung, Byeongsu Sim, Dohoon Ryu, and Jong Chul Ye. Improving diffusion models for inverse problems using manifold constraints. arXiv preprint arXiv:2206.00941, 2022a.
|
| 278 |
+
|
| 279 |
+
Hyungjin Chung, Byeongsu Sim, and Jong Chul Ye. Come-Closer-Diffuse-Faster: Accelerating Conditional Diffusion Models for Inverse Problems through Stochastic Contraction. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2022b.
|
| 280 |
+
|
| 281 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248–255. Ieee, 2009.
|
| 282 |
+
|
| 283 |
+
Prafulla Dhariwal and Alexander Quinn Nichol. Diffusion models beat GANs on image synthesis. In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan (eds.), Advances in Neural Information Processing Systems, 2021.
|
| 284 |
+
|
| 285 |
+
Bradley Efron. Tweedie’s formula and selection bias. Journal of the American Statistical Association, 106(496):1602–1614, 2011.
|
| 286 |
+
|
| 287 |
+
C Fienup and J Dainty. Phase retrieval and image reconstruction for astronomy. Image recovery: theory and application, 231:275, 1987.
|
| 288 |
+
|
| 289 |
+
James R Fienup. Reconstruction of an object from the modulus of its fourier transform. Optics letters, 3(1):27–29, 1978.
|
| 290 |
+
|
| 291 |
+
James R Fienup. Phase retrieval algorithms: a comparison. Applied optics, 21(15):2758–2769, 1982.
|
| 292 |
+
|
| 293 |
+
Xiang Gao, Meera Sitharam, and Adrian E Roitberg. Bounds on the jensen gap, and implications for mean-concentrated distributions. arXiv preprint arXiv:1712.05267, 2017.
|
| 294 |
+
|
| 295 |
+
MHMH Hayes. The reconstruction of a multidimensional sequence from the phase or magnitude of its fourier transform. IEEE Transactions on Acoustics, Speech, and Signal Processing, 30(2): 140–154, 1982.
|
| 296 |
+
|
| 297 |
+
Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. In Advances in Neural Information Processing Systems, volume 33, pp. 6840–6851, 2020.
|
| 298 |
+
|
| 299 |
+
WM Hubbard. The approximation of a poisson distribution by a gaussian distribution. Proceedings of the IEEE, 58(9):1374–1375, 1970.
|
| 300 |
+
|
| 301 |
+
Ajil Jalal, Marius Arvinte, Giannis Daras, Eric Price, Alexandros G Dimakis, and Jon Tamir. Robust Compressed Sensing MRI with Deep Generative Priors. In Advances in Neural Information Processing Systems, volume 34, pp. 14938–14954, 2021.
|
| 302 |
+
|
| 303 |
+
Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 4401–4410, 2019.
|
| 304 |
+
|
| 305 |
+
Bahjat Kawar, Gregory Vaksman, and Michael Elad. Snips: Solving noisy inverse problems stochastically. Advances in Neural Information Processing Systems, 34:21757–21769, 2021.
|
| 306 |
+
|
| 307 |
+
Bahjat Kawar, Michael Elad, Stefano Ermon, and Jiaming Song. Denoising diffusion restoration models. In ICLR Workshop on Deep Generative Models for Highly Structured Data, 2022.
|
| 308 |
+
|
| 309 |
+
Kwanyoung Kim and Jong Chul Ye. Noise2score: Tweedie’s approach to self-supervised image denoising without clean images. In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan (eds.), Advances in Neural Information Processing Systems, 2021. URL https:// openreview.net/forum?id $= _ { c } ^ { \prime }$ ZqEUs3sTRU0.
|
| 310 |
+
|
| 311 |
+
Robert Hildreth Kingston. Detection of optical and infrared radiation, volume 10. Springer, 2013.
|
| 312 |
+
|
| 313 |
+
Dilip Krishnan and Rob Fergus. Fast image deconvolution using hyper-laplacian priors. Advances in neural information processing systems, 22, 2009.
|
| 314 |
+
|
| 315 |
+
Luping Liu, Yi Ren, Zhijie Lin, and Zhou Zhao. Pseudo numerical methods for diffusion models on manifolds. In International Conference on Learning Representations, 2022. URL https: //openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ PlKWVd2yBkY.
|
| 316 |
+
|
| 317 |
+
Cheng Lu, Yuhao Zhou, Fan Bao, Jianfei Chen, Chongxuan Li, and Jun Zhu. DPM-Solver: A Fast ODE Solver for Diffusion Probabilistic Model Sampling in Around 10 Steps. arXiv preprint arXiv:2206.00927, 2022.
|
| 318 |
+
|
| 319 |
+
Seungjun Nah, Tae Hyun Kim, and Kyoung Mu Lee. Deep multi-scale convolutional neural network for dynamic scene deblurring. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3883–3891, 2017.
|
| 320 |
+
|
| 321 |
+
Herbert E Robbins. An empirical bayes approach to statistics. In Breakthroughs in statistics, pp. 388–394. Springer, 1992.
|
| 322 |
+
|
| 323 |
+
Jose A Rodriguez, Rui Xu, C-C Chen, Yunfei Zou, and Jianwei Miao. Oversampling smoothness: an effective algorithm for phase retrieval of noisy diffraction intensities. Journal of applied crystallography, 46(2):312–318, 2013.
|
| 324 |
+
|
| 325 |
+
Slavko Simic. On a global upper bound for jensen’s inequality. Journal of mathematical analysis and applications, 343(1):414–419, 2008.
|
| 326 |
+
|
| 327 |
+
Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. In 9th International Conference on Learning Representations, ICLR, 2021a.
|
| 328 |
+
|
| 329 |
+
Yang Song, Jascha Sohl-Dickstein, Diederik P. Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. In 9th International Conference on Learning Representations, ICLR, 2021b.
|
| 330 |
+
|
| 331 |
+
Yang Song, Liyue Shen, Lei Xing, and Stefano Ermon. Solving inverse problems in medical imaging with score-based generative models. In International Conference on Learning Representations, 2022.
|
| 332 |
+
|
| 333 |
+
Charles M Stein. Estimation of the mean of a multivariate normal distribution. The annals of Statistics, pp. 1135–1151, 1981.
|
| 334 |
+
|
| 335 |
+
Phong Tran, Anh Tuan Tran, Quynh Phung, and Minh Hoai. Explore image deblurring via encoded blur kernel space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11956–11965, 2021.
|
| 336 |
+
|
| 337 |
+
Pascal Vincent. A connection between score matching and denoising autoencoders. Neural computation, 23(7):1661–1674, 2011.
|
| 338 |
+
|
| 339 |
+
Kai Zhang, Wangmeng Zuo, Yunjin Chen, Deyu Meng, and Lei Zhang. Beyond a gaussian denoiser: Residual learning of deep cnn for image denoising. IEEE transactions on image processing, 26(7): 3142–3155, 2017.
|
| 340 |
+
|
| 341 |
+
# A PROOFS
|
| 342 |
+
|
| 343 |
+
Lemma 1 (Tweedie’s formula). Let $p ( \pmb { y } | \pmb { \eta } )$ belong to the exponential family distribution
|
| 344 |
+
|
| 345 |
+
$$
|
| 346 |
+
\begin{array} { r } { p ( \pmb { y } | \pmb { \eta } ) = p _ { 0 } ( \pmb { y } ) \exp ( \pmb { \eta } ^ { \top } \pmb { T } ( \pmb { y } ) - \varphi ( \pmb { \eta } ) ) , } \end{array}
|
| 347 |
+
$$
|
| 348 |
+
|
| 349 |
+
where $\eta$ is the canonical vector of the family, $T ( y )$ is some function of $\textbf { { y } }$ , and $\varphi ( \eta )$ is the cumulant generation function which normalizes the density, and $p _ { 0 } ( \pmb { y } )$ is the density up to the scale factor when $\mathbf { \nabla } \eta = \mathbf { 0 }$ . Then, the posterior mean $\hat { \pmb { \eta } } : = \mathbb { E } [ \pmb { \eta } | \pmb { y } ]$ should satisfy
|
| 350 |
+
|
| 351 |
+
$$
|
| 352 |
+
( \nabla _ { y } T ( \pmb { y } ) ) ^ { \top } \hat { \pmb { \eta } } = \nabla _ { y } \log p ( \pmb { y } ) - \nabla _ { y } \log p _ { 0 } ( \pmb { y } )
|
| 353 |
+
$$
|
| 354 |
+
|
| 355 |
+
Proof. Marginal distribution $p ( \pmb { y } )$ could be expressed as
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
\begin{array} { l } { { \displaystyle p ( { \pmb y } ) = \int p ( { \pmb y } | { \pmb \eta } ) p ( { \pmb \eta } ) d { \pmb \eta } } } \\ { { \displaystyle ~ = \int p _ { 0 } ( { \pmb y } ) \exp \big ( \eta ^ { \top } T ( { \pmb y } ) - \varphi ( { \pmb \eta } ) \big ) p ( { \pmb \eta } ) d { \pmb \eta } } . } \end{array}
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
Then, the derivative of the marginal distribution $p ( \pmb { y } )$ with respect to $\textbf { { y } }$ becomes
|
| 362 |
+
|
| 363 |
+
$$
|
| 364 |
+
\begin{array} { l } { \zeta _ { y } p ( y ) = \nabla _ { y } p _ { 0 } ( y ) \displaystyle \int \exp \big ( \eta ^ { \top } T ( y ) - \varphi ( \eta ) \big ) p ( \eta ) d \eta + \displaystyle \int ( \nabla _ { y } T ( y ) ) ^ { \top } \eta p _ { 0 } ( y ) \exp \big ( \eta ^ { \top } T ( y ) - \varphi ( \eta ) \big ) p ( \eta ) d \eta } \\ { \displaystyle = \frac { \nabla _ { y } p _ { 0 } ( y ) } { p _ { 0 } ( y ) } \int p ( y | \eta ) p ( \eta ) d \eta + ( \nabla _ { y } T ( y ) ) ^ { \top } \int \eta p ( y | \eta ) p ( \eta ) d \eta } \\ { \displaystyle = \frac { \nabla _ { y } p _ { 0 } ( y ) } { p _ { 0 } ( y ) } p ( y ) + ( \nabla _ { y } T ( y ) ) ^ { \top } \int \eta p ( y , \eta ) d \eta } \end{array}
|
| 365 |
+
$$
|
| 366 |
+
|
| 367 |
+
Therefore,
|
| 368 |
+
|
| 369 |
+
$$
|
| 370 |
+
\frac { \nabla _ { y } p ( \pmb { y } ) } { p ( \pmb { y } ) } = \frac { \nabla _ { y } p _ { 0 } ( \pmb { y } ) } { p _ { 0 } ( \pmb { y } ) } + ( \nabla _ { \pmb { y } } T ( \pmb { y } ) ) ^ { \top } \int \eta p ( \eta | \pmb { y } ) d \eta
|
| 371 |
+
$$
|
| 372 |
+
|
| 373 |
+
which is equivalent to
|
| 374 |
+
|
| 375 |
+
$$
|
| 376 |
+
( \nabla _ { \pmb { y } } T ( \pmb { y } ) ) ^ { \top } \mathbb { E } [ \pmb { \eta } | \pmb { y } ] = \nabla _ { \pmb { y } } \log p ( \pmb { y } ) - \nabla _ { \pmb { y } } \log p _ { 0 } ( \pmb { y } )
|
| 377 |
+
$$
|
| 378 |
+
|
| 379 |
+
This concludes the proof.
|
| 380 |
+
|
| 381 |
+
Proposition 1. For the case of $V P$ -SDE or DDPM sampling, $p ( \pmb { x } _ { 0 } | \pmb { x } _ { t } )$ has the unique posterior mean at
|
| 382 |
+
|
| 383 |
+
$$
|
| 384 |
+
\hat { x } _ { 0 } : = \mathbb { E } [ x _ { 0 } | x _ { t } ] = \frac { 1 } { \sqrt { \bar { \alpha } ( t ) } } ( x _ { t } + ( 1 - \bar { \alpha } ( t ) ) \nabla _ { x _ { t } } \log p _ { t } ( x _ { t } ) )
|
| 385 |
+
$$
|
| 386 |
+
|
| 387 |
+
Proof. For the case of VP-SDE and DDPM forward sampling in (8), we have
|
| 388 |
+
|
| 389 |
+
$$
|
| 390 |
+
p ( \pmb { x } _ { t } | \pmb { x } _ { 0 } ) = \frac { 1 } { ( 2 \pi ( 1 - \bar { \alpha } ( t ) ) ) ^ { d / 2 } } \exp \left( - \frac { \| \pmb { x } _ { t } - \sqrt { \bar { \alpha } ( t ) } \pmb { x } _ { 0 } \| ^ { 2 } } { 2 ( 1 - \bar { \alpha } ( t ) ) } \right) ,
|
| 391 |
+
$$
|
| 392 |
+
|
| 393 |
+
which is a Gaussian distribution. The corresponding canonical decomposition is then given by
|
| 394 |
+
|
| 395 |
+
$$
|
| 396 |
+
p ( \mathbf { \boldsymbol { x } } _ { t } | \mathbf { \boldsymbol { x } } _ { 0 } ) = p _ { 0 } ( \mathbf { \boldsymbol { x } } _ { t } ) \exp \left( \mathbf { \boldsymbol { x } } _ { 0 } ^ { \top } T ( \mathbf { \boldsymbol { x } } _ { t } ) - \boldsymbol { \varphi } ( \mathbf { \boldsymbol { x } } _ { 0 } ) \right) ,
|
| 397 |
+
$$
|
| 398 |
+
|
| 399 |
+
where
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
\begin{array} { l } { p _ { 0 } ( \pmb { x } _ { t } ) : = \displaystyle \frac { 1 } { ( 2 \pi ( 1 - \bar { \alpha } ( t ) ) ) ^ { d / 2 } } \exp \left( - \frac { \| \pmb { x } _ { t } \| ^ { 2 } } { 2 ( 1 - \bar { \alpha } ( t ) ) } \right) } \\ { T ( \pmb { x } _ { t } ) : = \displaystyle \frac { \sqrt { \bar { \alpha } ( t ) } } { 1 - \bar { \alpha } ( t ) } \pmb { x } _ { t } } \\ { \varphi ( \pmb { x } _ { 0 } ) : = \displaystyle \frac { \bar { \alpha } ( t ) \| \pmb { x } _ { 0 } \| ^ { 2 } } { 2 ( 1 - \bar { \alpha } ( t ) ) } } \end{array}
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
Therefore, using (24), we have
|
| 406 |
+
|
| 407 |
+
$$
|
| 408 |
+
\frac { \sqrt { \bar { \alpha } ( t ) } } { 1 - \bar { \alpha } ( t ) } \hat { \mathbf { x } } _ { 0 } = \nabla _ { \mathbf { x } _ { t } } \log p _ { t } ( \mathbf { x } _ { t } ) + \frac { 1 } { 1 - \bar { \alpha } ( t ) } \mathbf { x } _ { t }
|
| 409 |
+
$$
|
| 410 |
+
|
| 411 |
+
which leads to
|
| 412 |
+
|
| 413 |
+
$$
|
| 414 |
+
\hat { \pmb x } _ { 0 } = \frac { 1 } { \sqrt { \bar { \alpha } ( t ) } } \left( \pmb x _ { t } + ( 1 - \bar { \alpha } ( t ) ) \nabla _ { \pmb x _ { t } } \log p _ { t } ( \pmb x _ { t } ) \right)
|
| 415 |
+
$$
|
| 416 |
+
|
| 417 |
+
This concludes the proof.
|
| 418 |
+
|
| 419 |
+
Proposition 2 (Jensen gap upper bound (Gao et al., 2017)). Define the absolute cenetered moment as $m _ { p } : = \sqrt [ [object Object] ] { \mathbb { E } [ | X - \mu | ^ { p } ] }$ , and the mean as $\mu = \operatorname { \mathbb { E } } [ X ]$ . Assume that for $\alpha > 0$ , there exists a positive number $K$ such that for any $x \in \mathbb { R } , | f ( x ) - f ( \mu ) | \leq K | x - \mu | ^ { \alpha }$ . Then,
|
| 420 |
+
|
| 421 |
+
$$
|
| 422 |
+
\begin{array} { r l } & { \displaystyle \left. \mathbb { E } [ f ( X ) - f ( \mathbb { E } [ X ] ) ] \right. \leq \int \lvert f ( X ) - f ( \mu ) \rvert d p ( X ) } \\ & { \quad \quad \quad \quad \quad \leq K \int \lvert x - \mu \rvert ^ { \alpha } d p ( X ) \leq M m _ { \alpha } ^ { \alpha } . } \end{array}
|
| 423 |
+
$$
|
| 424 |
+
|
| 425 |
+
Lemma 2. Let $\phi ( \cdot )$ be a univariate Gaussian density function with mean $\mu$ and variance $\sigma ^ { 2 }$ . There exists a constant $L$ such that $\forall x , y \in \mathbb { R }$ ,
|
| 426 |
+
|
| 427 |
+
$$
|
| 428 |
+
| \phi ( x ) - \phi ( y ) | \leq L | x - y | ,
|
| 429 |
+
$$
|
| 430 |
+
|
| 431 |
+
$\begin{array} { r } { L = \frac { 1 } { \sqrt { 2 \pi \sigma ^ { 2 } } } \exp \left( - \frac { 1 } { 2 \sigma ^ { 2 } } \right) } \end{array}$
|
| 432 |
+
|
| 433 |
+
Proof. As $\phi ^ { \prime }$ is continuous and bounded, we use the mean value theorem to get
|
| 434 |
+
|
| 435 |
+
$$
|
| 436 |
+
\forall ( x , y ) \in \mathbb { R } ^ { 2 } , | \phi ( x ) - \phi ( y ) | \leq \| \phi ^ { \prime } \| _ { \infty } | x - y | .
|
| 437 |
+
$$
|
| 438 |
+
|
| 439 |
+
Since $L$ is the minimal value for (34), we have that $L \leq \| \phi ^ { \prime } \| _ { \infty }$ . Taking the limit $y x$ gives $| \phi ^ { \prime } ( x ) | \leq L$ , and thus $\| \phi ^ { \prime } \| _ { \infty } \leq L$ . Hence
|
| 440 |
+
|
| 441 |
+
$$
|
| 442 |
+
L = \| \phi ^ { \prime } \| _ { \infty } = \| - \frac { x - \mu } { \sigma ^ { 2 } } \phi ( x ) \| _ { \infty } .
|
| 443 |
+
$$
|
| 444 |
+
|
| 445 |
+
Since the derivative of $\phi ^ { \prime }$ is given as
|
| 446 |
+
|
| 447 |
+
$$
|
| 448 |
+
\phi ^ { \prime \prime } ( x ) = \sigma ^ { - 2 } ( 1 - \sigma ^ { - 2 } ( x - \mu ) ^ { 2 } ) \phi ( x ) ,
|
| 449 |
+
$$
|
| 450 |
+
|
| 451 |
+
and the maximum is attained when $x = 1 \pm \sigma ^ { 2 } \mu$ , we have
|
| 452 |
+
|
| 453 |
+
$$
|
| 454 |
+
L = \| \phi ^ { \prime } \| _ { \infty } = \frac { e ^ { - 1 / 2 \sigma ^ { 2 } } } { \sqrt { 2 \pi \sigma ^ { 2 } } }
|
| 455 |
+
$$
|
| 456 |
+
|
| 457 |
+
Lemma 3. Let $\phi ( \cdot )$ be an isotropic multivariate Gaussian density function with mean $\pmb { \mu }$ and variance $\sigma ^ { 2 } I$ . There exists a constant $L$ such that $\forall x , y \in \mathbb { R } ^ { d }$ ,
|
| 458 |
+
|
| 459 |
+
$$
|
| 460 |
+
\| \phi ( \pmb { x } ) - \phi ( \pmb { y } ) \| \leq L \| \pmb { x } - \pmb { y } \| ,
|
| 461 |
+
$$
|
| 462 |
+
|
| 463 |
+
where $\begin{array} { r } { L = \frac { d } { \sqrt { 2 \pi \sigma ^ { 2 } } } e ^ { - 1 / 2 \sigma ^ { 2 } } } \end{array}$
|
| 464 |
+
|
| 465 |
+
Proof.
|
| 466 |
+
|
| 467 |
+
$$
|
| 468 |
+
\begin{array} { l } { \displaystyle \| \phi ( \pmb { x } ) - \phi ( \pmb { y } ) \| \leq \operatorname* { m a x } _ { \pmb { z } } \| \nabla _ { \pmb { z } } \phi ( \pmb { z } ) \| \cdot \| \pmb { x } - \pmb { y } \| } \\ { \displaystyle = \underbrace { d } _ { \displaystyle \sum \pi \sigma ^ { 2 } } \exp \left( - \frac { 1 } { 2 \sigma ^ { 2 } } \right) \cdot \| \pmb { x } - \pmb { y } \| } \end{array}
|
| 469 |
+
$$
|
| 470 |
+
|
| 471 |
+
where the second inequality comes from that each element of $\nabla _ { z } \phi ( z )$ is bounded by $\frac { 1 } { \sqrt { 2 \pi \sigma ^ { 2 } } } \exp \left( - \frac { 1 } { 2 \sigma ^ { 2 } } \right)$ .
|
| 472 |
+
|
| 473 |
+
Theorem 1. For the given measurement model $( 6 )$ with $\pmb { n } \sim \mathcal { N } ( 0 , \sigma ^ { 2 } \pmb { I } )$ , we have
|
| 474 |
+
|
| 475 |
+
$$
|
| 476 |
+
p ( \pmb { y } | \pmb { x } _ { t } ) \simeq p ( \pmb { y } | \hat { \pmb { x } } _ { 0 } ) ,
|
| 477 |
+
$$
|
| 478 |
+
|
| 479 |
+
where the approximation error can be quantified with the Jensen gap, which is upper bounded by
|
| 480 |
+
|
| 481 |
+
$$
|
| 482 |
+
\mathcal { I } \leq \frac { d } { \sqrt { 2 \pi \sigma ^ { 2 } } } e ^ { - 1 / 2 \sigma ^ { 2 } } \| \nabla _ { \pmb { x } } \mathcal { A } ( \pmb { x } ) \| m _ { 1 } ,
|
| 483 |
+
$$
|
| 484 |
+
|
| 485 |
+
where $\| \nabla _ { \pmb { x } } \pmb { \mathcal { A } } ( \pmb { x } ) \| : = \operatorname* { m a x } _ { \pmb { x } } \| \nabla _ { \pmb { x } } \pmb { \mathcal { A } } ( \pmb { x } ) \|$ and $\begin{array} { r } { m _ { 1 } : = \int \| \pmb { x } _ { 0 } - \hat { \pmb { x } } _ { 0 } \| p ( \pmb { x } _ { 0 } | \pmb { x } _ { t } ) d \pmb { x } _ { 0 } . } \end{array}$ .
|
| 486 |
+
|
| 487 |
+
Proof.
|
| 488 |
+
|
| 489 |
+
$$
|
| 490 |
+
\begin{array} { c } { p ( { \pmb y } | { \pmb x } _ { t } ) = \displaystyle \int p ( { \pmb y } | { \pmb x } _ { 0 } ) p ( { \pmb x } _ { 0 } | { \pmb x } _ { t } ) d { \pmb x } _ { 0 } } \\ { = \mathbb { E } _ { { \pmb x } _ { 0 } \sim p ( { \pmb x } _ { 0 } | { \pmb x } _ { t } ) } [ f ( { \pmb x } _ { 0 } ) ] } \end{array}
|
| 491 |
+
$$
|
| 492 |
+
|
| 493 |
+
Here, $f ( \cdot ) : = h ( \mathcal { A } ( \cdot ) )$ where $\mathcal { A }$ is the forward operator and $h ( { \pmb x } )$ is the multivariate normal distribution with mean $\textbf { { y } }$ and the covariance $\sigma ^ { 2 } I$ . Therefore, we have
|
| 494 |
+
|
| 495 |
+
$$
|
| 496 |
+
\begin{array} { r l } { J ( f , p ( x _ { 0 } | x _ { t } ) ) = | \mathbb { E } [ f ( x _ { 0 } ) ] - f ( \mathbb { E } [ x _ { 0 } ] ) | = | \mathbb { E } [ f ( x _ { 0 } ) ] - f ( \hat { x } _ { 0 } ) | } \\ & { = | \mathbb { E } [ h ( A ( x _ { 0 } ) ) ] - h ( A ( \hat { x } _ { 0 } ) ) ] | } \\ & { \le \int | h ( A ( x _ { 0 } ) ) - h ( A ( \hat { x } _ { 0 } ) ) | d P ( x _ { 0 } | x _ { t } ) } \\ & { \overset { \mathrm { ( b ) } } { \le } \frac { d } { \sqrt { 2 \pi \sigma ^ { 2 } } } e ^ { - 1 / 2 \sigma ^ { 2 } } \int \| A ( x _ { 0 } ) - A ( \hat { x } _ { 0 } ) \| d P ( x _ { 0 } | x _ { t } ) } \\ & { \overset { \mathrm { ( c ) } } { \le } \frac { d } { \sqrt { 2 \pi \sigma ^ { 2 } } } e ^ { - 1 / 2 \sigma ^ { 2 } } \| \nabla _ { x } A ( x ) \| \int \| x _ { 0 } - \hat { x } _ { 0 } \| d P ( x _ { 0 } | x _ { t } ) } \\ & { \overset { \mathrm { ( d ) } } { \le } \frac { d } { \sqrt { 2 \pi \sigma ^ { 2 } } } e ^ { - 1 / 2 \sigma ^ { 2 } } \| \nabla _ { x } A ( x ) \| m _ { 1 } } \\ & { \overset { \mathrm { ( d ) } } { \le } \frac { d } { \sqrt { 2 \pi \sigma ^ { 2 } } } e ^ { - 1 / 2 \sigma ^ { 2 } } \| \nabla _ { x } A ( x ) \| m _ { 1 } } \end{array}
|
| 497 |
+
$$
|
| 498 |
+
|
| 499 |
+
where $\begin{array} { r } { d P ( \pmb { x } _ { 0 } | \pmb { x } _ { t } ) = p ( \pmb { x } _ { 0 } | \pmb { x } _ { t } ) d \pmb { x } _ { 0 } } \end{array}$ , (b) is the result of Lemma 3, (c) is from the intermediate value theorem, and (d) is from Proposition 2. □
|
| 500 |
+
|
| 501 |
+
# B INVERSE PROBLEM SETUP
|
| 502 |
+
|
| 503 |
+
Super-resolution. The forward model for super-resolution is defined as
|
| 504 |
+
|
| 505 |
+
$$
|
| 506 |
+
\begin{array} { r l } { \pmb { y } \sim \mathcal { N } ( \pmb { y } | \pmb { L } ^ { f } \pmb { x } , \sigma ^ { 2 } \pmb { I } ) , \quad } & { { } ( \mathrm { G a u s s i a n } ) } \\ { \pmb { y } \sim \mathcal { P } ( \pmb { y } | \pmb { L } ^ { f } \pmb { x } ; \lambda ) , \quad } & { { } ( \mathrm { P o i s s o n } ) } \end{array}
|
| 507 |
+
$$
|
| 508 |
+
|
| 509 |
+
where $L ^ { f } \in \mathbb { R } ^ { n \times d }$ represents the bicubic downsampling block Hankel matrix with the factor $f$ , and $\mathcal { P }$ denotes the Poisson distribution with the parameter $\lambda$ .
|
| 510 |
+
|
| 511 |
+
Inpainting. For both box-type and random-type inpainting, the forward model reads
|
| 512 |
+
|
| 513 |
+
$$
|
| 514 |
+
\begin{array} { r l } { { \pmb y } \sim \mathcal { N } ( { \pmb y } | P { \pmb x } , \sigma ^ { 2 } I ) , } & { \quad \mathrm { ( G a u s s i a n ) } } \\ { { \pmb y } \sim \mathcal { P } ( { \pmb y } | P { \pmb x } ; \lambda ) , } & { \quad \mathrm { ( P o i s s o n ) } } \end{array}
|
| 515 |
+
$$
|
| 516 |
+
|
| 517 |
+
where $P \in \{ 0 , 1 \} ^ { n \times d }$ is the masking matrix that consists of elementary unit vectors.
|
| 518 |
+
|
| 519 |
+
Linear Deblurring. For both Gaussian and motion deblurring, the measurement model is given a
|
| 520 |
+
|
| 521 |
+
$$
|
| 522 |
+
\begin{array} { r l } { \pmb { y } \sim \mathcal { N } ( \pmb { y } | C ^ { \psi } \pmb { x } , \sigma ^ { 2 } \pmb { I } ) , } & { { } \quad \mathrm { ( G a u s s i a n ) } } \\ { \pmb { y } \sim \mathcal { P } ( \pmb { y } | C ^ { \psi } \pmb { x } ; \lambda ) , } & { { } \quad \mathrm { ( P o i s s o n ) } } \end{array}
|
| 523 |
+
$$
|
| 524 |
+
|
| 525 |
+
where $C ^ { \psi } \in \mathbb { R } ^ { n \times d }$ is the block Hankel matrix that effectively induces convolution with the given blur kernel $\psi$ .
|
| 526 |
+
|
| 527 |
+

|
| 528 |
+
Figure 7: Failure cases of MCG (Chung et al., 2022a) on noisy inverse problems due to noise amplification.
|
| 529 |
+
|
| 530 |
+
Nonlinear deblurring. We leverage the nonlinear blurring process that was proposed in the GOPRO dataset (Nah et al., 2017), where the blurring process is not defined as a convolution, but rather as an integration of sharp images through the time frame. Specifically, in the discrete sense the measurement model reads
|
| 531 |
+
|
| 532 |
+
$$
|
| 533 |
+
\pmb { y } = \int _ { \pmb { b } } \left( \frac { 1 } { M } \sum _ { i = 1 } ^ { M } \pmb { x } [ i ] \right) , \quad i = 1 , \ldots , T ,
|
| 534 |
+
$$
|
| 535 |
+
|
| 536 |
+
where $b ( \pmb { x } ) = \pmb { x } ^ { 1 / 2 . 2 }$ is the nonlinear camera response function, and $T$ denotes the total time frames. While we could directly use (56) as our forward model, note that this is only possible when we have multiple sharp time frames at hand (e.g. when leveraging GOPRO dataset directly). Recently, there was an effort to distill the forward model through a neural network (Tran et al., 2021). Particularly, when we have a set of blurry-sharp image pairs $\{ ( \pmb { x } _ { i } , \pmb { y } _ { i } ) \} _ { i = 1 } ^ { N }$ , one can train a neural network to estimate the forward model as
|
| 537 |
+
|
| 538 |
+
$$
|
| 539 |
+
\phi ^ { * } = \underset { \theta } { \arg \operatorname* { m i n } } \sum _ { i = 1 } ^ { N } \| \pmb { y } _ { i } - \mathcal { F } _ { \phi } ( \pmb { x } _ { i } , \mathcal { G } _ { \phi } ( \pmb { x } _ { i } , \pmb { y } _ { i } ) ) \| ,
|
| 540 |
+
$$
|
| 541 |
+
|
| 542 |
+
where $\mathcal { G } _ { \phi } ( \pmb { x } _ { i } , \pmb { y } _ { i } )$ extracts the implicit kernel information from the pair, and $\mathcal { F } _ { \phi }$ takes in ${ \pmb x } _ { i } , { \mathcal G } _ { \phi } ( { \pmb x } _ { i } , { \pmb y } _ { i } )$ to generate the blurry image. When using $\mathcal { F } _ { \phi }$ at deployment to generate new synthetic blurry images, one can simply replace $\mathcal { G } _ { \phi } ( \pmb { x } _ { i } , \pmb { y } _ { i } )$ with a Gaussian random vector $\boldsymbol { k }$ . Consequently, our forward model reads
|
| 543 |
+
|
| 544 |
+
$$
|
| 545 |
+
\begin{array} { r l r l } & { y \sim \mathcal { N } ( y | \mathcal { F } _ { \phi } ( x , k ) , \sigma ^ { 2 } I ) , k \in \mathbb { R } ^ { k } , k \in \mathcal { N } ( 0 , \sigma _ { k } ^ { 2 } I ) , } & & { \mathrm { ( G a u s s i a n ) } } \\ & { } & { y \sim \mathcal { P } ( y | \mathcal { F } _ { \phi } ( x , k ) ; \lambda ) , k \in \mathbb { R } ^ { k } , k \in \mathcal { N } ( 0 , \sigma _ { k } ^ { 2 } I ) , } & & { \mathrm { ( P o i s s o n ) } } \end{array}
|
| 546 |
+
$$
|
| 547 |
+
|
| 548 |
+
where $k$ is the dimensionality of the latent vector $\boldsymbol { k }$ , and $\sigma _ { k } ^ { 2 }$ is the variance of the vector.
|
| 549 |
+
|
| 550 |
+
Phase Retrieval. The forward measurement model is usually given as
|
| 551 |
+
|
| 552 |
+
$$
|
| 553 |
+
\begin{array} { r l } { \pmb { y } \sim \mathcal { N } ( \pmb { y } | | \pmb { F } \pmb { x } _ { 0 } | , \sigma ^ { 2 } \pmb { I } ) , } & { { } \quad \mathrm { ( G a u s s i a n ) } } \\ { \pmb { y } \sim \mathcal { P } ( \pmb { y } | | \pmb { F } \pmb { x } _ { 0 } | ; \lambda ) , } & { { } \quad \mathrm { ( P o i s s o n ) } } \end{array}
|
| 554 |
+
$$
|
| 555 |
+
|
| 556 |
+
where $\pmb { F }$ denotes the 2D Discrete Fourier Trasform (DFT) matrix. In another words, the phase of the Fourier measurements are nulled, and our aim is to impute the missing phase information. As the problem is highly ill-posed, one typically incorporates the oversampling in order to induce the
|
| 557 |
+
|
| 558 |
+

|
| 559 |
+
Figure 8: Effect of step size $\zeta ^ { \prime }$ on the results
|
| 560 |
+
|
| 561 |
+
uniqueness condition (Hayes, 1982; Bruck & Sodin, 1979), usually specified as
|
| 562 |
+
|
| 563 |
+
$$
|
| 564 |
+
\begin{array} { r l } { \pmb { y } \sim \mathcal { N } ( \pmb { y } | | F P \pmb { x } _ { 0 } | , \sigma ^ { 2 } \pmb { I } ) , } & { { } \quad \mathrm { ( G a u s s i a n ) } } \\ { \pmb { y } \sim \mathcal { P } ( \pmb { y } | | F P \pmb { x } _ { 0 } | ; \lambda ) , } & { { } \quad \mathrm { ( P o i s s o n ) } } \end{array}
|
| 565 |
+
$$
|
| 566 |
+
|
| 567 |
+
where $_ { r }$ denotes the oversampling matrix with ratio $k / n$ .
|
| 568 |
+
|
| 569 |
+
Poisson noise simulation. To simulate the Poisson noise, we assume that each measurement pixel is a source of photon, where the number of photons is proportional to the discrete pixel value between 0 and 255. Thus, we sample noisy measurement values from the Poisson distribution with the mean value of the clean measurement values. Here, the clean measurement is $\scriptstyle A ( { \pmb x } _ { 0 } )$ , which is an image after applying the forward operation. Then, we clip the values by [0, 255] and normalize to [-1, 1].
|
| 570 |
+
|
| 571 |
+
# C ABLATION STUDIES AND DISCUSSION
|
| 572 |
+
|
| 573 |
+
# C.1 NOISE AMPLIFICATION BY PROJECTION
|
| 574 |
+
|
| 575 |
+
As discussed in the experiments, methods that rely on projections fail dramatically when solving inverse problems with excessive amount of noise in the measurement. Even worse, for many problems such as SR or deblurring, noise gets amplified during the projection step due to the operator transpose $A ^ { T }$ being applied. This downside is clearly depicted in Fig. 7, where we show the failure cases of MCG (Chung et al., 2022a) on noisy super-resolution. In contrast, our method does not rely on such projections, and thus is much more robust to the corrupted measurements. Notably, we find that MCG also fails dramatically in SR even when there is no noise existent, while it performs well on some of the other tasks (e.g. inpainting). We can conclude that the proposed method works generally well across a broader range of inverse problems, whether or not there is noise in the measurement.
|
| 576 |
+
|
| 577 |
+
# C.2 EFFECT OF STEP SIZE $\zeta ^ { \prime }$
|
| 578 |
+
|
| 579 |
+
There is one hyper-parameter in our DPS solver, and that is the step size. As this value is essentially the weight that is given to the likelihood (i.e. data consistency) of the inverse problem, we can expect that the values being too high or too low will cause problems. In Fig. 8, we show the trend of the reconstruction results when varying the step size $\zeta _ { i }$ . Note that we instead use the notation $\zeta ^ { \prime } \triangleq \zeta _ { i } \| \pmb { y } - \mathcal { A } ( \hat { \pmb { x } } _ { 0 } ( \pmb { x } _ { i } ) ) \|$ for brevity. Here, we see that with low values of $\zeta ^ { \prime } < 0 . 1$ , we achieve results that are not consistent with the given measurement. On the other hand, when we crank up the values too high $( \zeta ^ { \prime } > 5 )$ ), we observe saturation arfiacts that tend to amplify the noise. From our experiments, we conclude that it is best practice to set the $\zeta ^ { \prime }$ values in the range [0.1, 1.0] for best results. Specific values for all the experiments are presented in Appendix D.
|
| 580 |
+
|
| 581 |
+
# C.3 OTHER STEP SIZE SCHEDULES
|
| 582 |
+
|
| 583 |
+
While the proposed step size schedule in C.2 yields good results, there can be many other choices that one can take. In this section, we conduct an ablation study to compare against other choices. Specifically, we test 100 images for Gaussian deblurring (Gaussian noise, $\sigma = 0 . 0 5$ ) on FFHQ, and compute the average perceptual distance (LPIPS) against the ground truth. We compare against the following three choices: 1) Linearly decaying steps $\begin{array} { r } { \zeta _ { i } ^ { \prime } = \zeta _ { r m i n i t } ^ { \prime } \times \left( 1 - \frac { i } { N } \right) } \end{array}$ , 2) exponentially decaying steps $\zeta _ { i } ^ { \prime } = \zeta _ { \mathrm { i n i t } } ^ { \prime } \times \gamma ^ { i }$ , with $\gamma = 0 . 9 9 , 3$ ) directly using step size proportional to $1 / \sigma ^ { 2 }$ as in eq. 16.
|
| 584 |
+
|
| 585 |
+

|
| 586 |
+
Figure 9: Ablation study on the choice of step size schedule for DPS. (a) Measurement, (b-c) exponential decay with initial values 0.3, 1.0, (d-e) linear decay with initial values 0.3, 1.0, (f) $\propto \dot { 1 } / \sigma ^ { 2 }$ (g) ours, (h) ground truth.
|
| 587 |
+
|
| 588 |
+
<table><tr><td rowspan="2">Strategy Initial value</td><td colspan="2">Constant</td><td colspan="2">Linear decay</td><td colspan="2">Exponential decay</td></tr><tr><td>1.0 (Ours)</td><td>1/g2</td><td>0.3</td><td>1.0</td><td>0.3</td><td>1.0</td></tr><tr><td>LPIPS↓</td><td>0.247 ± 0.045</td><td>0.727± 0.038</td><td>0.287±0.045</td><td>0.251 ± 0.044</td><td>0.421 ± 0.065</td><td>0.442 ± 0.108</td></tr></table>
|
| 589 |
+
|
| 590 |
+
Table 5: Ablation study on step size scheduling. Bold: best, underline: second best.
|
| 591 |
+
|
| 592 |
+
We present qualitative analysis in Fig. 9. From the figure, it is clear that the proposed schedule produces the best result that most closely matches the ground truth in terms of perception. For decaying step sizes, we often yield results that are coarsely similar to the ground truth, but varies in the fine details, as the information about the measurement is less incorporated in the later steps of the diffusion. From Fig. 9, we see that taking step sizes proportional to $1 / \sigma ^ { 2 }$ , motivated by direct derivation from the gaussian forward model, yields poor results. We see similar results with the quantitative metrics presented in Table. 5.
|
| 593 |
+
|
| 594 |
+
# C.4 POISSON INVERSE PROBLEMS
|
| 595 |
+
|
| 596 |
+
For inverse problems corrupted with Poisson noise, more care needs to be taken compared to the Gaussian noise counterparts, as the noise is signal-dependent and therefore harder to account for. In this section, we discuss the different choices of likelihood functions that can be made, and clarify the choice (20) used in all our experiments. One straightforward option is to directly use the Poisson likelihood model without the Gaussian approximation. From (17), we have that
|
| 597 |
+
|
| 598 |
+
$$
|
| 599 |
+
\begin{array} { c } { \displaystyle \log p ( \pmb { y } | \pmb { x } _ { 0 } ) = \sum _ { j = 1 } ^ { n } \log [ \pmb { A } ( \pmb { x } _ { 0 } ) ] _ { j } - [ \pmb { A } ( \pmb { x } _ { 0 } ) ] _ { j } - \log ( \pmb { y } _ { j } ! ) } \\ { \displaystyle \nabla _ { \pmb { x } _ { t } } \log p ( \pmb { y } | \pmb { x } _ { 0 } ) = - \alpha \nabla _ { \pmb { x } _ { t } } \left[ \sum _ { j = 1 } ^ { n } \log [ \pmb { A } ( \pmb { x } _ { 0 } ) ] _ { j } - [ \pmb { A } ( \pmb { x } _ { 0 } ) ] _ { j } \right] , } \end{array}
|
| 600 |
+
$$
|
| 601 |
+
|
| 602 |
+

|
| 603 |
+
Figure 10: Differences in the reconstruction results when using different choices for imposing data consistency for Poisson linear inverse problems.
|
| 604 |
+
|
| 605 |
+
which we refer to as Poisson-direct. Moreover, one can use the Gaussian approximated version of the Poisson measurement model given in (18)
|
| 606 |
+
|
| 607 |
+
$$
|
| 608 |
+
\begin{array} { r l } & { \log p ( \pmb { y } | \pmb { x } _ { 0 } ) = \displaystyle \sum _ { j = 1 } ^ { n } - \frac { 1 } { 2 } \log \left[ 2 \pi [ \pmb { A } ( \pmb { x } _ { 0 } ) ] _ { j } \right] - \frac { ( \pmb { y } _ { j } - [ \pmb { A } ( \pmb { x } _ { 0 } ) ] _ { j } ) ^ { 2 } } { 2 [ \pmb { A } ( \pmb { x } _ { 0 } ) ] _ { j } } } \\ & { \nabla _ { \pmb { x } _ { t } } \log p ( \pmb { y } | \pmb { x } _ { 0 } ) = \alpha \nabla _ { \pmb { x } _ { t } } \left[ \displaystyle \sum _ { j = 1 } ^ { n } \frac { 1 } { 2 } \log \left[ 2 \pi [ \pmb { A } ( \pmb { x } _ { 0 } ) ] _ { j } \right] + \frac { ( \pmb { y } _ { j } - [ \pmb { A } ( \pmb { x } _ { 0 } ) ] _ { j } ) ^ { 2 } } { 2 [ \pmb { A } ( \pmb { x } _ { 0 } ) ] _ { j } } \right] , } \end{array}
|
| 609 |
+
$$
|
| 610 |
+
|
| 611 |
+
which we refer to as Poisson-Gaussian. Next, we can use our choice in (19) to arrive at (20), which is the proposed method. Finally, while irrelevant with the noise model, we can also still use the same least sqaures (LS) method used for Gaussian noise (we refer to this method as Poisson-LS), as due to the central limit theorem, Poisson noise is nearly Gaussian in the high SNR level regime. In Fig. 10, we show representative results achieved by using each choice. From the experiments, we observe that Poisson-direct is unstable due to the log term in the likelihood, hence often diverging. We also observe that the residual $\pmb { y } - \pmb { \mathcal { A } } ( \hat { \pmb { x } } _ { 0 } )$ fails to converge, hinting that the information from the measurement is not effectively integrated into the generative process. For Poisson-Gaussian, we see that the weighting term of the MSE is problematic, and this term prevents the process from proper convergence. Both the proposed method and Poisson-LS are stable, but Poisson-LS tends to blur out the relevant details from the reconstruction, while Poisson-shot preserves the high-frequency details better, and does not alter the identity of the ground truth person.
|
| 612 |
+
|
| 613 |
+
# C.5 SAMPLING SPEED
|
| 614 |
+
|
| 615 |
+
As widely known in the literature, diffusion model-based methods are heavily dependent on the number of neural function evaluations (NFE). We investigate the performance in terms of LPIPS with respect to the change in NFEs in Fig. 11a. For the experiment, we take the case of noisy $\mathrm { S R } \times 4$ , which is a problem where DDRM tends to perform well, in contrast to other problems, e.g. inpainting. In the high NFE regime $( \geq 2 5 0 )$ , DPS outperforms all the other methods, whereas in the low NFE regime $( \leq 1 0 0 )$ , DDRM takes over. This can be attributed to DDIM (Song et al., 2021a) sampling strategy that DDRM adopts, known for better performance in the low NFE regimes. Orthogonal to the direction presented in this work, devising a method to improve the performance of DPS in such regime with advanced samplers (e.g. Lu et al. (2022); Liu et al. (2022)) would benefit the method.
|
| 616 |
+
|
| 617 |
+

|
| 618 |
+
Figure 11: Ablation studies performed with $\mathrm { S R } \times 4$ task on FFHQ $2 5 6 \times 2 5 6$ data, and the runtime analysis of the different algorithms.
|
| 619 |
+
|
| 620 |
+
<table><tr><td>Method</td><td>Wall-clock time [s]</td></tr><tr><td>Score-SDE (Song et al.,2021b)</td><td>36.71</td></tr><tr><td>DDRM (Kawar et al.,2022)</td><td>2.029</td></tr><tr><td>MCG (Chung et al.,2022a)</td><td>80.10</td></tr><tr><td>PnP-ADMM(Chan et al.,2016)</td><td>3.631</td></tr><tr><td>BKS-styleGAN2(Tran et al.,2021)</td><td>891.8</td></tr><tr><td>BKS-generic (Tran et al.,2021)</td><td>93.23</td></tr><tr><td>ER (Fienup,1982)</td><td>5.604</td></tr><tr><td>HIO (Fienup & Dainty,1987)</td><td>6.317</td></tr><tr><td>OSS (Rodriguez et al., 2013)</td><td>15.65</td></tr><tr><td>Ours</td><td>78.52</td></tr></table>
|
| 621 |
+
|
| 622 |
+
(b) Runtime for each algorithm in Wall-clock time: Computed with a single GTX 2080Ti GPU.
|
| 623 |
+
|
| 624 |
+
# C.6 LIMITATIONS
|
| 625 |
+
|
| 626 |
+
Inheriting the characteristics of the diffusion model-based methods, the proposed method is relatively slow, as can be seen in the runtime analysis of Fig. 11b. However, we note that our method is still faster than the GAN-based optimization methods, as we do not have to finetune the network itself. Moreover, the slow sampling speed could be mitigated with the incorporation of advanced samplers. Our method tends to preserve the high frequency details (e.g. beard, hair, texture) of the image, while methods such as DDRM tends to produce rather blurry images. In the qualitative view, and in the perception oriented metris (i.e. FID, LPIPS), our method clearly outperforms DDRM. In contrast, in standard distortion metrics such as PSNR, our method underperforms DDRM. This can be explained by the perception-distortion tradeoff phenomena (Blau & Michaeli, 2018), where preserving high frequency details may actually penalize the reconstructions from having better distortion metrics. Finally, we note that the reconstruction quality of phase retrieval is not as robust as compared to other problems - linear inverse problems and nonlinear deblurring. Due to the stochasticity, we often encounter failures among the posterior samples, which can be potentially counteracted by simply taking multiple samples, as was done in other methods. Devising methods to stabilize the samplers, especially for nonlinear phase retrieval problems, would be a promising direction of research.
|
| 627 |
+
|
| 628 |
+
# D EXPERIMENTAL DETAILS
|
| 629 |
+
|
| 630 |
+
# D.1 IMPLEMENTATION DETAILS
|
| 631 |
+
|
| 632 |
+
Step size. Here, we list the step sizes used in our DPS algorithm for each problem setting.
|
| 633 |
+
|
| 634 |
+
• Linear inverse problem – Gaussian measurement noise \* FFHQ · Super-resolution: $\zeta _ { i } = 1 / \| y - \mathcal { A } ( \hat { \pmb x } _ { 0 } ( { \pmb x } _ { i } ) ) \|$ $\cdot$ Inpainting: $\zeta _ { i } = 1 / \| y - \mathcal { A } ( \hat { { \pmb x } } _ { 0 } ( { \pmb x } _ { i } ) ) \|$ · Deblurring (Gauss): $\zeta _ { i } = 1 / \| y - \mathcal { A } ( \hat { { \pmb x } } _ { 0 } ( { \pmb x } _ { i } ) ) \|$ · Deblurring (motion): $\zeta _ { i } = 1 / \| y - \mathcal { A } ( \hat { { \pmb x } } _ { 0 } ( { \pmb x } _ { i } ) ) \|$
|
| 635 |
+
|
| 636 |
+
\* ImageNet
|
| 637 |
+
|
| 638 |
+
· Super-resolution: $\zeta _ { i } = 1 / \| y - \mathcal { A } ( \hat { \pmb x } _ { 0 } ( { \pmb x } _ { i } ) ) \|$ · Inpainting: $\zeta _ { i } = 1 / \| y - \mathcal { A } ( \hat { { \pmb x } } _ { 0 } ( { \pmb x } _ { i } ) ) \|$ · Deblurring (Gauss): $\zeta _ { i } = 0 . 4 / \| \pmb { y } - \pmb { \mathcal { A } } ( \pmb { \hat { x } } _ { 0 } ( \pmb { x } _ { i } ) ) \|$ · Deblurring (motion): $\zeta _ { i } = 0 . 6 / \| \pmb { y } - \pmb { \mathcal { A } } ( \pmb { \hat { x } } _ { 0 } ( \pmb { x } _ { i } ) ) \|$ – Poisson measurement noise
|
| 639 |
+
|
| 640 |
+
\* FFHQ
|
| 641 |
+
|
| 642 |
+
· Super-resolution: $\zeta _ { i } = 0 . 3 / \| \pmb { y } - \pmb { \mathcal { A } } ( \hat { \pmb { x } } _ { 0 } ( \pmb { x } _ { i } ) ) \|$ · Deblurring (Gauss): $\zeta _ { i } = 0 . 3 / \| \pmb { y } - \pmb { \mathcal { A } } ( \hat { \pmb { x } } _ { 0 } ( \pmb { x } _ { i } ) ) \|$ · Deblurring (motion): $\zeta _ { i } = 0 . 3 / \| \pmb { y } - \pmb { \mathcal { A } } ( \hat { \pmb { x } } _ { 0 } ( \pmb { x } _ { i } ) ) \|$ • Nonlinear inverse problem
|
| 643 |
+
|
| 644 |
+
– Gaussian measurement noise $^ *$ FFHQ · Phase retrieval: $\zeta _ { i } = 0 . 4 / \| \pmb { y } - \pmb { \mathcal { A } } ( \hat { \pmb { x } } _ { 0 } ( \pmb { x } _ { i } ) ) \|$ $\cdot$ non-uniform deblurring: $\zeta _ { i } = 1 . 0 / \| \pmb { y } - \pmb { \mathcal { A } } ( \hat { \pmb { x } } _ { 0 } ( \pmb { x } _ { i } ) ) \|$
|
| 645 |
+
|
| 646 |
+
Score functions used. Pre-trained score function for the FFHQ dataset was taken from Choi et al.
|
| 647 |
+
(2021)7, and the score function for the ImageNet dataset was taken from Dhariwal & Nichol (2021)8.
|
| 648 |
+
|
| 649 |
+
Compute time. All experiments were performed on a single RTX 2080Ti GPU. FFHQ experiments take about 95 seconds per image (1000 NFE), while ImageNet experiments take about 600 seconds per image (1000 NFE) for reconstruction due to the much larger network size.
|
| 650 |
+
|
| 651 |
+
Code availability. Code is available at https://github.com/DPS2022/ diffusion-posterior-sampling.
|
| 652 |
+
|
| 653 |
+
# D.2 COMPARISON METHODS
|
| 654 |
+
|
| 655 |
+
For DDRM, MCG, Score-SDE, and our method we use the same checkpoint for the score functions.
|
| 656 |
+
|
| 657 |
+
DDRM. All experiments were performed with the default setting of $\eta _ { B } = 1 . 0 , \eta = 0 . 8 5$ , and leveraging DDIM (Song et al., 2021a) sampling for 20 NFEs. For the Gaussian deblurring experiment, the forward model was implemented by separable 1D convolutions for efficient SVD.
|
| 658 |
+
|
| 659 |
+
MCG. We set the same values of $\alpha$ that are used in our methods (DPS). At each step, the additional data consistency steps are applied as Euclidean projections onto the measurement set $\mathcal { C } : = \{ \pmb { x } _ { i } | \mathcal { A } ( \pmb { x } _ { i } ) = \pmb { y } _ { i }$ , $\hat { \mathbf { \mathbf { \psi } } } _ { } \sim \hat { p } ( \mathbf { \mathbf { \psi } } \mathbf { \mathbf { \hat { y } } } _ { i } | \mathbf { \psi } _ { 0 } ) \bar \}$ .
|
| 660 |
+
|
| 661 |
+
Score-SDE. Score-SDE solves inverse problems by iteratively applying denoising followed by data consistency projections. As in MCG, we apply Euclidean projections onto the measurment set $\mathcal { C }$ .
|
| 662 |
+
|
| 663 |
+
PnP-ADMM. We take the implementation from the scico library (Balke et al., 2022). The parameters are set as follows: $\rho = 0 . 2$ (ADMM penalty parameter), maxiter $= 1 2$ . For proximal mappings, we utilize the pretrained DnCNN Zhang et al. (2017) denoiser.
|
| 664 |
+
|
| 665 |
+
ADMM-TV. We minimize the following objective
|
| 666 |
+
|
| 667 |
+
$$
|
| 668 |
+
\operatorname* { m i n } _ { \mathbf { x } } \frac { 1 } { 2 } \| \pmb { y } - \pmb { \mathcal { A } } ( \pmb { x } _ { 0 } ) \| _ { 2 } ^ { 2 } + \lambda \| \pmb { D } \pmb { x } _ { 0 } \| _ { 2 , 1 } ,
|
| 669 |
+
$$
|
| 670 |
+
|
| 671 |
+
where $D = [ D _ { x } , D _ { y } ]$ computes the finite difference with respect to both axes, $\lambda$ is the regularization weight, and $\| \cdot \| _ { 2 , 1 }$ implements the isotropic TV regularization. Note that the optimization is solved with ADMM, and hence we have an additional parameter $\rho$ . We take the implementation from the scico library (Balke et al., 2022). The parameters $\lambda , \rho$ were found with grid search for each optimization problems. We use the following settings: $( \lambda , \rho ) = ( 2 . 7 e - 2 , 1 . 4 e - 1 )$ for deblurring, $( \lambda , \rho ) = ( 2 . 7 e - 2 , 1 . 0 e - 2 )$ for SR and inpainting.
|
| 672 |
+
|
| 673 |
+
ER, HIO, OSS. For all algorithms, we initialize a real signal by sampling from the normal distribution as the problem statement of (Fienup, 1982). For the object domain constraint, we apply both the non-negative constraint and the finite support constraint. We set the number of iterations to 10,000 for sufficient convergence. To mitigate the instability of reconstruction depending on initialization, we repeat each algorithm four times per data and report the best one with the smallest mean squared error between the measurement and amplitude of the estimation in the Fourier domain. In the case of HIO and OSS, we set $\beta$ to 0.9, which yields best results.
|
| 674 |
+
|
| 675 |
+
# E FURTHER EXPERIMENTAL RESULTS
|
| 676 |
+
|
| 677 |
+
We first provide quantitative evaluations based on the standard PSNR and SSIM metrics in Table 6 and Table 7.
|
| 678 |
+
|
| 679 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">SR(×4)</td><td colspan="2">Inpaint (box)</td><td colspan="2">Inpaint (random)</td><td colspan="2">Deblur (gauss)</td><td colspan="2">Deblur (motion)</td></tr><tr><td>PSNR↑</td><td>SSIM↑</td><td>PSNR ↑</td><td>SSIM↑</td><td>PSNR↑</td><td>SSIM↑</td><td>PSNR ↑</td><td>SSIM↑</td><td>PSNR↑</td><td>SSIM↑</td></tr><tr><td>DPS (ours)</td><td>25.67</td><td>0.852</td><td>22.47</td><td>0.873</td><td>25.23</td><td>0.851</td><td>24.25</td><td>0.811</td><td>24.92</td><td>0.859</td></tr><tr><td>DDRM (Kawar et al.,2022)</td><td>25.36</td><td>0.835</td><td>22.24</td><td>0.869</td><td>9.19</td><td>0.319</td><td>23.36</td><td>0.767</td><td></td><td>-</td></tr><tr><td>MCG (Chung et al.,2022a)</td><td>20.05</td><td>0.559</td><td>19.97</td><td>0.703</td><td>21.57</td><td>0.751</td><td>6.72</td><td>0.051</td><td>6.72</td><td>0.055</td></tr><tr><td>PnP-ADMM (Chan et al., 2016)</td><td>26.55</td><td>0.865</td><td>11.65</td><td>0.642</td><td>8.41</td><td>0.325</td><td>24.93</td><td>0.812</td><td>24.65</td><td>0.825</td></tr><tr><td>Score-SDE (Song etal.,2021b) (ILVR(Choi et al.,2021))</td><td>17.62</td><td>0.617</td><td>18.51</td><td>0.678</td><td>13.52</td><td>0.437</td><td>7.12</td><td>0.109</td><td>6.58</td><td>0.102</td></tr><tr><td>ADMM-TV</td><td>23.86</td><td>0.803</td><td>17.81</td><td>0.814</td><td>22.03</td><td>0.784</td><td>22.37</td><td>0.801</td><td>21.36</td><td>0.758</td></tr></table>
|
| 680 |
+
|
| 681 |
+
Table 6: Quantitative evaluation (PSNR, SSIM) of solving linear inverse problems on FFHQ $2 5 6 \times 2 5 6 .$ 1k validation dataset. Bold: best, underline: second best.
|
| 682 |
+
|
| 683 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">SR(×4)</td><td colspan="2">Inpaint (box)</td><td colspan="2">Inpaint (random)</td><td colspan="2">Deblur (gauss)</td><td colspan="2">Deblur (motion)</td></tr><tr><td>PSNR↑</td><td>SSIM↑</td><td>PSNR ↑</td><td>SSIM↑</td><td>PSNR↑</td><td>SSIM个</td><td>PSNR ↑</td><td>SSIM↑</td><td>PSNR ↑</td><td>SSIM↑</td></tr><tr><td>DPS (ours)</td><td>23.87</td><td>0.781</td><td>18.90</td><td>0.794</td><td>22.20</td><td>0.739</td><td>21.97</td><td>0.706</td><td>20.55</td><td>0.634</td></tr><tr><td>DDRM (Kawar et al.,2022)</td><td>24.96</td><td>0.790</td><td>18.66</td><td>0.814</td><td>14.29</td><td>0.403</td><td>22.73</td><td>0.705</td><td>1</td><td>1</td></tr><tr><td>MCG (Chung et al.,2022a)</td><td>13.39</td><td>0.227</td><td>17.36</td><td>0.633</td><td>19.03</td><td>0.546</td><td>16.32</td><td>0.441</td><td>5.89</td><td>0.037</td></tr><tr><td>PnP-ADMM(Chan et al., 2016)</td><td>23.75</td><td>0.761</td><td>12.70</td><td>0.657</td><td>8.39</td><td>0.300</td><td>21.81</td><td>0.669</td><td>21.98</td><td>0.702</td></tr><tr><td>Score-SDE (Song et al.,2021b) (ILVR(Choi et al.,2021))</td><td>12.25</td><td>0.256</td><td>16.48</td><td>0.612</td><td>18.62</td><td>0.517</td><td>15.97</td><td>0.436</td><td>7.21</td><td>0.120</td></tr><tr><td>ADMM-TV</td><td>22.17</td><td>0.679</td><td>17.96</td><td>0.785</td><td>20.96</td><td>0.676</td><td>19.99</td><td>0.634</td><td>20.79</td><td>0.677</td></tr></table>
|
| 684 |
+
|
| 685 |
+
Table 7: Quantitative evaluation (PSNR, SSIM) of solving linear inverse problems on ImageNet $2 5 6 \times 2 5 6 \ – 1 \mathrm { k }$ validation dataset. Bold: best, underline: second best.
|
| 686 |
+
|
| 687 |
+
Further experimental results that show the ability of our method to sample multiple reconstructions are presented in Figs. 12,13, 14, 15, 16, 17 (Gaussian measurement with $\sigma = 0 . 0 5$ ), and Fig. 18,19 (Poisson measurement with $\lambda = 1 . 0$ ).
|
| 688 |
+
|
| 689 |
+

|
| 690 |
+
Figure 12: SR (Left $\times 8 .$ , Right $\times 1 6$ ), results on the FFHQ (Karras et al., 2019) $2 5 6 \times 2 5 6$ dataset.
|
| 691 |
+
|
| 692 |
+

|
| 693 |
+
Figure 13: SR (Left $\times 8 .$ , Right $\times 1 6$ ), results on the ImageNet (Deng et al., 2009) $2 5 6 \times 2 5 6$ dataset.
|
| 694 |
+
|
| 695 |
+

|
| 696 |
+
Figure 14: Inpainting results (Left $1 2 8 \times 1 2 8$ box, Right $92 \%$ random) on the FFHQ (Karras et al., 2019) $2 5 6 \times 2 5 6$ dataset.
|
| 697 |
+
|
| 698 |
+

|
| 699 |
+
Figure 15: Inpainting results (Left $1 2 8 \times 1 2 8$ box, Right $92 \%$ random) on the ImageNet (Deng et al., 2009) $2 5 6 \times 2 5 6$ dataset.
|
| 700 |
+
|
| 701 |
+

|
| 702 |
+
Figure 16: Deblurring results (Left Gaussian, Right motion) on the FFHQ (Karras et al., 2019) $2 5 6 \times 2 5 6$ dataset.
|
| 703 |
+
|
| 704 |
+

|
| 705 |
+
Figure 17: Deblurring results (Left Gaussian, Right motion) on the ImageNet (Karras et al., 2019) $2 5 6 \times 2 5 6$ dataset.
|
| 706 |
+
|
| 707 |
+

|
| 708 |
+
Figure 18: SR (Left $\times 8 .$ , Right $\times 1 6$ ) with Poisson noise $\lambda = 0 . 0 5$ ), results on the FFHQ (Karras et al., 2019) $2 5 6 \times 2 5 6$ dataset.
|
| 709 |
+
|
| 710 |
+

|
| 711 |
+
Figure 19: Deblurring results with Poisson noise $\lambda = 1 . 0$ ) (Left Gaussian, Right motion) on the FFHQ (Karras et al., 2019) $2 5 6 \times 2 5 6$ dataset.
|
md/dev/QJb1-8NH2Ux/QJb1-8NH2Ux.md
ADDED
|
@@ -0,0 +1,351 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DETECTING ADVERSARIAL EXAMPLES IS (NEARLY) AS HARD AS CLASSIFYING THEM
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Making classifiers robust to adversarial examples is challenging. Thus, many defenses tackle the seemingly easier task of detecting perturbed inputs.
|
| 8 |
+
|
| 9 |
+
We show a barrier towards this goal. We prove a general hardness reduction between detection and classification of adversarial examples: given a robust detector for attacks at distance $\epsilon$ (in some metric), we show how to build a similarly robust (but inefficient) classifier for attacks at distance $\epsilon / 2$ —and vice-versa.
|
| 10 |
+
|
| 11 |
+
Our reduction is computationally inefficient, and thus cannot be used to build practical classifiers. Instead, it is a useful sanity check to test whether empirical detection results imply something much stronger than the authors presumably anticipated.
|
| 12 |
+
|
| 13 |
+
To illustrate, we revisit 14 empirical detector defenses published over the past years. For $1 2 / 1 4$ defenses, we show that the claimed detection results imply an inefficient classifier with robustness far beyond the state-of-the-art— thus casting some doubts on the results’ validity.
|
| 14 |
+
|
| 15 |
+
Finally, we show that our reduction applies in both directions: a robust classifier for attacks at distance $\epsilon / 2$ implies an inefficient robust detector at distance . Thus, we argue that robust classification and robust detection should be regarded as (near)-equivalent problems, if we disregard their computational complexity.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
Building models that are robust to adversarial examples (Szegedy et al., 2014; Biggio et al., 2013) is a major challenge and open-problem in machine learning. Due to the inherent difficulty in building robust classifiers, researchers have attempted to build techniques to at least detect adversarial examples, a weaker task that is largely considered easier than robust classification (Xu et al., 2018; Pang et al., 2021; Sheikholeslami et al., 2021).
|
| 20 |
+
|
| 21 |
+
Yet, evaluating the robustness of empirical detector defenses is challenging. This is in part due to a lack of strong evaluation guidelines and benchmarks—akin to those developed for robust classifiers (Carlini et al., 2019; Croce et al., 2020)—as well as to a lack of long-standing comparative baselines such as adversarial training (Madry et al., 2018).
|
| 22 |
+
|
| 23 |
+
To illustrate, consider the following (fictitious) claims about two defenses against adversarial examples on CIFAR-10:
|
| 24 |
+
|
| 25 |
+
• defense A is a classifier that achieves robust accuracy of $9 0 \%$ under $\ell _ { \infty }$ -perturbations bounded by $\epsilon = { } ^ { 4 } / 2 5 5$ ;
|
| 26 |
+
• defense B also has a “rejection” option, and achieves robust accuracy of $9 0 \%$ under $\ell _ { \infty }$ - perturbations bounded by $\epsilon = { \bf 8 } / 2 5 5$ (we say that defense B is robust for some example if it classifies that example correctly, and either rejects/detects or correctly classifies all perturbed examples at distance $\epsilon .$ .)
|
| 27 |
+
|
| 28 |
+
Which of these two (empirical) claims are you more likely to believe to be correct?
|
| 29 |
+
|
| 30 |
+
Defense A claims much higher robustness than the current best result achieved with adversarial training (Madry et al., 2018; Rebuffi et al., 2021), the only empirical defense against adversarial examples that has stood the test of time. Indeed, the state-of-the-art $\ell _ { \infty }$ robustness for $\epsilon = { ^ 4 } / { 2 5 } 5$ on CIFAR-10 (without external data) is $\approx 7 9 \%$ (Rebuffi et al., 2021). Thus, the claim of defense A would likely be met with some initial skepticism and heightened scrutiny, as could be expected for such a claimed breakthrough result.
|
| 31 |
+
|
| 32 |
+
The claim of defense B is harder to assess, due to a lack of long-standing baselines for robust detectors (many detection defenses have been shown to be broken (Carlini & Wagner, 2017; Tramer\` et al., 2020)). On one hand, detection of adversarial examples has largely been considered to be an easier task than classification $\mathrm { { X u } }$ et al., 2018; Pang et al., 2021; Sheikholeslami et al., 2021). On the other hand, defense B claims robustness to perturbations that are twice as large as defense A ${ \bf \zeta } ( \epsilon = 8 / 2 5 5$ vs. $\epsilon = 4 / 2 5 5$ ).
|
| 33 |
+
|
| 34 |
+
In this paper, we show that the claims of defenses A and B are, in fact, equivalent! (up to computational efficiency.)
|
| 35 |
+
|
| 36 |
+
We prove a general hardness reduction between classification and detection of adversarial examples. Given a detector defense that achieves robust risk $\alpha$ for attacks at distance $\epsilon$ (under any metric), we show how to build an explicit but inefficient classifier that achieves robust risk $\alpha$ for classifying attacks at distance $\epsilon / 2$ . The reverse implication also holds: a classifier robust at distance $\epsilon / 2$ implies an explicit but inefficient robust detector at distance $\epsilon$ .
|
| 37 |
+
|
| 38 |
+
To the authors knowledge, there is no known way of leveraging computational inefficiency to build more robust models. We should thus be as “surprised” by the claim made by defense B as by the claim made by defense A.
|
| 39 |
+
|
| 40 |
+
Our reduction provides a way of assessing the plausibility of new robust detection claims, by contrasting them with results from the more mature literature on robust classification. To illustrate, we revisit 14 published detection defenses across three datasets, and show that in 12/14 cases the defense’s robust detection claims would imply an inefficient classifier with robustness far superior to the current state-of-the-art. Yet, none of these detection papers make the claim that their techniques should imply such a breakthrough in robust classification.
|
| 41 |
+
|
| 42 |
+
Using our reduction, it is obvious that many detection defenses are claiming much stronger robustness than we believe feasible with current techniques. And indeed, many of these defenses were later shown to have overestimated their robustness (Carlini & Wagner, 2017; Tramer et al., 2020). \`
|
| 43 |
+
|
| 44 |
+
Remarkably, we find that for certified defenses, the state-of-the-art results for provable robust classification and detection perfectly match the results implied by our reduction. For example, Sheikholeslami et al. (2021) recently proposed a certified detector on CIFAR-10 with provable robust error that is within $3 \%$ of the provable error of the inefficient detector obtained by combining our result with the state-of-the-art robust classifier of Zhang et al. (2020a).
|
| 45 |
+
|
| 46 |
+
In summary, we prove that giving classifiers access to a detection option does not help robustness (or at least, not much). Our work provides, to our knowledge, the first example of a hardness reduction between different approaches for robust machine learning. As in the case of computational complexity, we believe that such reductions can be useful for identifying research questions or areas that are unlikely to bear fruit (bar a significant breakthrough)—so that the majority of the community’s efforts can be redirected elsewhere.
|
| 47 |
+
|
| 48 |
+
On a technical level, our reduction exposes a natural connection between robustness and error correcting codes, which may be of independent interest.
|
| 49 |
+
|
| 50 |
+
# 2 HARDNESS REDUCTIONS BETWEEN ROBUST CLASSIFIERS AND DETECTORS
|
| 51 |
+
|
| 52 |
+
In this section, we prove our main result: a reduction between robust detectors and robust classifiers, and vice-versa. We first introduce some useful notation and define the (robust) risk of classifiers with and without a detection option.
|
| 53 |
+
|
| 54 |
+
# 2.1 PRELIMINARIES
|
| 55 |
+
|
| 56 |
+
We consider a classification task with a distribution $\mathcal { D }$ over examples $x \in \mathbb { R } ^ { d }$ with labels $y \in$ $[ C ]$ . A classifier is a function $f : \mathbb { R } ^ { d } [ C ]$ . A detector is a classifier with an extra “rejection”
|
| 57 |
+
|
| 58 |
+
or ”detection” option $\perp$ , that indicates the absence of a classification. We assume for simplicity that classifiers and detectors are deterministic. Our results can easily be extended to randomized functions as well. The binary indicator function $\mathbb { 1 } _ { \{ A \} }$ is 1 if and only if the predicate $A$ is true.
|
| 59 |
+
|
| 60 |
+
We first define a classifier’s risk, i.e., its classification error on unperturbed samples.
|
| 61 |
+
|
| 62 |
+
Definition 1 (Risk). Let $f : \mathbb { R } ^ { d } [ C ] \cup \{ \bot \}$ be a classifier (optionally with a detection output $\perp$ ). The risk of $f$ is the expected rate at which $f$ fails to correctly classify a sample:
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
R ( f ) : = \operatorname* { \mathbb { E } } _ { ( x , y ) \sim \mathcal { D } } \left[ \mathbb { 1 } _ { \{ f ( x ) \neq y \} } \right]
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
Note that for a detector, rejecting an unperturbed example sampled from the distribution $\mathcal { D }$ is counted as an error.
|
| 69 |
+
|
| 70 |
+
For classifiers without a rejection option, we define the robust risk as the risk on worst-case adversarial examples (Madry et al., 2018). Given an input $x$ sampled from $\mathcal { D }$ , an adversarial example $\hat { x }$ is constrained to being within distance $d ( x , { \hat { x } } ) \leq { \bar { \epsilon } }$ from $x$ , where $d$ is some distance measure.
|
| 71 |
+
|
| 72 |
+
Definition 2 (Robust risk). Let $f : \mathbb { R } ^ { d } [ C ]$ be a classifier. The robust risk at distance $\epsilon$ is:
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
R _ { a d \nu } ^ { \epsilon } ( f ) : = \operatorname* { \mathbb { E } } _ { ( x , y ) \sim \mathcal { D } } \left[ \operatorname* { m a x } _ { d ( x , \hat { x } ) \leq \epsilon } \mathbb { 1 } _ { \{ f ( \hat { x } ) \neq y \} } \right]
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
Thus, a sample $( x , y )$ is robustly classified if and only if every point within distance $\epsilon$ of $x$ (including $x$ itself) is correctly classified as $y$ .
|
| 79 |
+
|
| 80 |
+
For a detector (a classifier with an extra detection/rejection output), we analogously define the robust risk with detection. The classifier is now allowed to reject adversarial examples.
|
| 81 |
+
|
| 82 |
+
Definition 3 (Robust risk with detection). Let $f : \mathbb { R } ^ { d } [ C ] \cup \{ \bot \}$ be a classifier with an extra detection output $\perp$ . The robust risk with detection at distance $\epsilon$ is:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
R _ { a d \nu - d e t } ^ { \epsilon } ( f ) : = \underset { ( x , y ) \sim \mathcal { D } } { \mathbb { E } } \left[ \operatorname* { m a x } _ { d ( x , \hat { x } ) \leq \epsilon } \mathbb { 1 } _ { \left\{ f ( x ) \neq y \vee f ( \hat { x } ) \notin \left\{ y , \perp \right\} \right\} } \right]
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
That is, a detector defense $f$ is robust on a natural input $x$ if and only if the defense classifies the natural input $x$ correctly, and the defense either rejects or correctly classifies every perturbed input $\hat { x }$ within distance $\epsilon$ from $x$ . The requirement that the defense correctly classify natural examples eliminates pathological defenses that reject all inputs.
|
| 89 |
+
|
| 90 |
+
# 2.2 ROBUST DETECTION IMPLIES INEFFICIENT ROBUST CLASSIFICATION
|
| 91 |
+
|
| 92 |
+
We are now ready to introduce our main result, a reduction from a robust detector for adversarial examples at distance $\epsilon$ , to an inefficient robust classifier at distance $\epsilon / 2$ . We later prove that this reduction also holds in the reverse direction, thereby demonstrating the equivalence between robust detection and classification—up to computational hardness.
|
| 93 |
+
|
| 94 |
+
Theorem 4 $\epsilon$ -robust detection implies inefficient $\epsilon / 2$ -robust classification). Let $d ( \cdot , \cdot )$ be an arbitrary metric. Let $f$ be a detector that achieves risk $R ( f ) = \alpha _ { \mathrm { { } } }$ , and robust risk with detection $R _ { a d \nu - d e t } ^ { \epsilon } ( f ) = \beta$ . Then, we can construct an explicit (but inefficient) classifier $g$ that achieves risk $R ( g ) \leq \alpha$ and robust risk $R _ { a d \nu } ^ { \epsilon / 2 } ( g ) \le \beta$ .
|
| 95 |
+
|
| 96 |
+
The classifier $g$ is constructed as follows on input $x$ :
|
| 97 |
+
|
| 98 |
+
• Run the detector model $y f ( x )$ . If the input is not rejected, i.e., $y \ne \perp$ , then output the label y that was predicted by the detector.
|
| 99 |
+
|
| 100 |
+
• Otherwise, find an input $x ^ { \prime }$ within distance $\epsilon / 2$ of $x$ that is not rejected, i.e., $d ( x , x ^ { \prime } ) \leq \epsilon / 2$ and $f ( x ^ { \prime } ) \neq \bot$ . If such an input $x ^ { \prime }$ exists, output the label $y \gets f ( x ^ { \prime } )$ . Else, output a uniformly random label $y \in [ C ]$ .
|
| 101 |
+
|
| 102 |
+
An intuitive illustration for our construction, and for the proof of the theorem (see below) is in Figure 1.
|
| 103 |
+
|
| 104 |
+

|
| 105 |
+
Figure 1: Illustration of the construction of a robust classifier from a robust detector in Theorem 4. The outer blue circle represents all inputs at distance at most $\epsilon$ from the input $x$ . For a detector $f$ , the areas in green correspond to correctly classified inputs, and ratcheted gray areas correspond to rejected inputs. The detector $f$ is thus robust on $x$ up to distance $\epsilon$ . The classifier $g$ classifies a perturbed input $\hat { x }$ , at distance $\epsilon / 2$ from $x$ , by finding any input within distance $\epsilon / 2$ from $\hat { x }$ (the red dashed circle) that is not rejected by $f$ . Such an input necessarily exists and is correctly labeled by $f$ . The classifier $g$ is thus robust on $x$ up to distance $\epsilon / 2$ .
|
| 106 |
+
|
| 107 |
+
Our construction can be viewed as an analog of minimum distance decoding in coding theory. We can view a clean data point sampled from $\mathcal { D }$ as a codeword, and an adversarial example $\hat { x }$ as a noisy message with a certain number of errors (where the error magnitude is measured using an arbitrary metric on $\mathbb { R } ^ { d }$ rather than the Hamming distance that is typically used for error correcting codes). A standard result in coding theory states that if a code can detect $\alpha$ errors, then it can correct $\alpha / 2$ errors. This result follows from a “ball-packing” argument: if $\alpha$ errors can be detected, then any two valid codewords must be at least at distance $\alpha$ from each other, and therefore $\alpha / 2$ errors can be corrected via minimum distance decoding.
|
| 108 |
+
|
| 109 |
+
Proof of Theorem 4. First, note that the natural accuracy of our constructed classifier $g$ is at least as high as that of the detector $f$ , since $g$ always mimics the output of $f$ whenever $f$ does not reject an input sampled from $\mathcal { D }$ . Thus, $R ( g ) \dot { \leq } R ( f ) = \alpha$ .
|
| 110 |
+
|
| 111 |
+
Now, for the sake of contradiction, consider an input $( x , y ) \sim \mathcal { D }$ for which the constructed classifier $g$ is not robust at distance $\epsilon / 2$ . By construction, this means that there exists some input $\hat { x }$ at distance $\epsilon / 2$ from $x$ such that $\hat { x }$ is misclassified, i.e., $g ( \hat { x } ) = \hat { y } \neq y$ . We will show that the detector $f$ is not robust with detection for $x$ either (for attacks at distance up to $\epsilon$ ).
|
| 112 |
+
|
| 113 |
+
By definition of the classifier $g$ , if $g ( \hat { x } ) = \hat { y } \neq y$ then either:
|
| 114 |
+
|
| 115 |
+
• The detector $f$ also misclassifies $\hat { x }$ , i.e., $f ( \hat { x } ) = \hat { y }$ . So $f$ is not robust with detection for $x$ at distance $\epsilon$ .
|
| 116 |
+
• There exists an input $x ^ { \prime }$ within distance $\epsilon / 2$ of $x$ , such that the detector $f$ misclassifies $x ^ { \prime }$ , i.e. $\boldsymbol { f } ( \boldsymbol { x } ^ { \prime } ) = \boldsymbol { \hat { y } }$ . Note that by the triangular inequality, $d ( x , x ^ { \prime } ) \leq d ( x , \hat { x } ) + d ( \hat { x } , x ^ { \prime } ) \leq \epsilon / 2 + \epsilon / 2 = \epsilon ,$ and thus $f$ is not robust with detection for $x$ at distance $\epsilon$ .
|
| 117 |
+
• The detector $f$ rejects all inputs $x ^ { \prime }$ within distance $\epsilon / 2$ of $x$ (and thus $g$ has output $\hat { y }$ by sampling a label at random). Since $d ( x , { \hat { x } } ) \leq \epsilon / 2$ , this implies that the detector also rejects the clean input $x$ , i.e., $f ( x ) = \bot$ , and thus $f$ is not robust with detection for $x$ .
|
| 118 |
+
|
| 119 |
+
In summary, whenever the constructed classifier $g$ fails to robustly classify an input $x$ up to distance $\epsilon / 2$ , the detector $f$ also fails to robustly classify $x$ with detection up to distance $\epsilon$ . Taking expectations over the entire distribution $\mathcal { D }$ concludes the proof. □
|
| 120 |
+
|
| 121 |
+
Note that the classifier $g$ constructed in Theorem 4 is computationally inefficient. Indeed, the second step of the defense consists in finding a non-rejected input within some metric ball. If the original detector $f$ is a non-convex function (e.g., a deep neural network), then this step consists in solving an intractable non-convex optimization problem. Our reduction is thus typically not suitable for building a practical robust classifier. Instead, it demonstrates the existence of an inefficient but explicit robust classifier. We discuss the implications of this result more thoroughly in Section 3.
|
| 122 |
+
|
| 123 |
+
A corollary to our reduction is that many “information theoretic” results about robust classifiers can
|
| 124 |
+
be directly extended to robust detectors. For example, Tsipras et al. (2019) prove that there exists a
|
| 125 |
+
formal tradeoff between a classifier’s clean accuracy and robust accuracy for certain natural tasks.
|
| 126 |
+
Since their result applies to any classifier (including inefficient ones), combining their result with our
|
| 127 |
+
reduction implies that a similar accuracy-robustness tradeoff exists for detectors. More precisely,
|
| 128 |
+
Tsipras et al. (2019) show that for certain classification tasks and suitable choices of parameters
|
| 129 |
+
$\alpha , \beta , \epsilon$ , any classifier $g$ which achieves risk $R ( g ) \leq \alpha$ must have robust risk at least $R _ { \mathrm { a d v } } ^ { \bar { \epsilon } } ( g ) \geq \beta$ inst k at $\ell _ { \infty }$ -t s boumust d by o hav $\epsilon$ . By our reduction, this implies t robust risk with detection at least $f$ withainst $R ( f ) \leq \alpha$ $R _ { \mathrm { a d v - d e t } } ^ { \epsilon / 2 } ( f ) \geq \beta$
|
| 130 |
+
$\ell _ { \infty }$ $\epsilon / 2$
|
| 131 |
+
|
| 132 |
+
Similar arguments can be applied to show, for instance, that the increased data complexity of robust generalization from Schmidt et al. (2018), or the tradeoff between robustness to multiple perturbation types from Tramer & Boneh (2019), also apply to robust detectors. \`
|
| 133 |
+
|
| 134 |
+
Our reduction does not apply for “computational” hardness results that have been shown for robust classification. For example, Garg et al. (2020) and Bubeck et al. (2018) show (“unnatural”) distributions where learning a robust classifier is computationally hard—under standard cryptographic assumptions. We cannot use Theorem 4 to conclude that learning a robust detector is hard for these distributions, since the existence of such a detector would only imply an inefficient robust classifier which does not contradict the results of Garg et al. (2020) or Bubeck et al. (2018).
|
| 135 |
+
|
| 136 |
+
# 2.3 ROBUST CLASSIFICATION IMPLIES INEFFICIENT ROBUST DETECTION
|
| 137 |
+
|
| 138 |
+
A similar argument as in Theorem 4 can be used in the opposite direction, to show that a robust classifier at distance $\epsilon / 2$ implies an inefficient robust detector at distance $\epsilon$ . Taken together, Theorem 4 and Theorem 5 show that robust detection and classification are equivalent, up to a factor 2 in the norm bound and up to computational constraints.
|
| 139 |
+
|
| 140 |
+
Theorem 5 $( \epsilon / 2$ robust-classification implies inefficient $\epsilon$ -robust detection). Let $d ( \cdot , \cdot )$ be an arbi
|
| 141 |
+
trary metric. Let g be a defense than explicit (but inefficient) defense achieves robust rithat achieves risk $R _ { a d \nu } ^ { \epsilon / 2 } ( f ) = \beta$ . Then, we can constructrobust risk with detection $f$ $R ( f ) \le \beta$
|
| 142 |
+
$R _ { a d \nu - d e t } ^ { \epsilon } ( f ) \leq \beta$ .
|
| 143 |
+
|
| 144 |
+
The defense $f$ is constructed as follows on input $x$ :
|
| 145 |
+
|
| 146 |
+
• Run the classifier $y g ( x )$ .
|
| 147 |
+
|
| 148 |
+
• Find a perturbed input $x ^ { \prime }$ withing distance $\epsilon / 2$ of $x$ that is classified differently, i.e., $d ( x , x ^ { \prime } ) \leq \epsilon / 2$ and $g ( x ^ { \prime } ) \neq y$ . If such an input $x ^ { \prime }$ exists, reject the input and output ⊥. Else, output the class $y$ .
|
| 149 |
+
|
| 150 |
+
We provide the proof of Theorem 5 in Appendix A.
|
| 151 |
+
|
| 152 |
+
A main distinction between Theorem 4 and Theorem 5 is that the construction in Theorem 4 preserves clean accuracy, but the construction in Theorem 5 does not. That is, the constructed robust detector in Theorem 5 has clean accuracy that is equal to the robust classifier’s robust accuracy.
|
| 153 |
+
|
| 154 |
+
The construction in Theorem 5 can be efficiently (but approximately) instantiated by a certifiably robust classifier (Wong & Kolter, 2018; Raghunathan et al., 2018). These defenses can certify that a classifier’s output is constant for all points within some distance $\epsilon$ of the input. For an adversarial example $\hat { x }$ for $g$ , the certification always fails and thus the constructed detector $f$ will reject $\hat { x }$ . If $g$ is robust and the certification succeeds, the detector $f$ copies the output of $g$ . However, a certified defense may fail to certify a robust input (a false negative), and thus the detector $f$ may reject more inputs than with the “optimal” construction in Theorem 5. This reduction from a certified classifier to a detector is implicit in (Wong & Kolter, 2018, Section 3.1).
|
| 155 |
+
|
| 156 |
+
# 3 WHAT ARE DETECTION DEFENSES CLAIMING?
|
| 157 |
+
|
| 158 |
+
We now survey 14 detection defenses, and consider the robust classification performance that these defenses implicitly claim (via Theorem 4). As we will see, in 12/14 cases, the defenses’ detection results imply an inefficient classifier with far better robust accuracy than the state-of-the-art.
|
| 159 |
+
|
| 160 |
+
Before presenting our experimental setup and the explicit results from the reduction, we first discuss how we believe these results should be interpreted.
|
| 161 |
+
|
| 162 |
+
Interpreting our reduction. Suppose that some detector defense claims a robust accuracy that implies—via our reduction—an inefficient classifier with much higher robustness that the state-ofthe-art (e.g., the defense A described in the introduction of this paper).
|
| 163 |
+
|
| 164 |
+
A first possible interpretation of our reduction is that this robust detector implies the existence of a robust classifier. This interpretation is rather weak however, since it is typically presumed that robust classification is possible, and that human perception is one concrete example of a robust classifier. The mere existence of a robust classifier is thus typically already assumed to be true.
|
| 165 |
+
|
| 166 |
+
Our reduction yields a stronger result. It provides an explicit construction of an (inefficient) robust classifier from a robust detector. The question then is whether we should expect the construction of inefficient robust classifiers to be easier than the construction of efficient ones. That is, do we expect that we can leverage computational inefficiency to build more robust classifiers that the current state-of-the-art?
|
| 167 |
+
|
| 168 |
+
We do not know of a positive answer to this question, and there is evidence to suggest that the answer may be negative.1 For example, the work of Schmidt et al. (2018) proves that for a synthetic classification task between Gaussian distributions, building more robust classifiers requires additional data regardless of the amount of computation power. Their results are corroborated by current state-ofthe-art robust classifiers based on adversarial training (Madry et al., 2018), which do not appear to be limited by computational constraints. On CIFAR-10 for example, adversarial training achieves $100 \%$ robust training accuracy (Schmidt et al., 2018). Thus, it is unclear how computational inefficiency could be leveraged to build more robust classifiers using existing techniques.
|
| 169 |
+
|
| 170 |
+
Candidate approaches could be to train much larger models (e.g., with an exponential number of parameters), or to perform an exhaustive architecture search to find more robust models. Yet, note that the robust classifier constructed in our reduction only uses its unbounded computational power at inference time. That is, the classifier that is built in Theorem 4 uses a trained detector model as a subroutine (which is presumed to be efficient), and then solves a non-convex optimization problem at inference time. The classifier built in our reduction is thus presumably weaker than a robust classifier that can be trained with unbounded computational power.
|
| 171 |
+
|
| 172 |
+
To summarize, when a detector defense claims a certain robust accuracy, this implies the existence of a concretely instantiatable robust classifier with an inefficient inference procedure. If this inefficient classifier is much more robust than the current state-of-the-art, this does not necessarily mean that the defense’s claims is wrong. But given how challenging robust classification is proving to be, we have reason to be skeptical of such a major breakthrough (even for inefficient classifiers). To compound this, many proposed detection defenses are quite simple, and reject adversarial inputs based on some standard statistical test over a neural network’s features. It would thus be particularly surprising if such simple techniques could yield robust classifiers, given that “simple” approaches to adversarial robustness (denoising, compression, randomness, etc.) are ineffective (He et al., 2017).
|
| 173 |
+
|
| 174 |
+
As a result, it is not too surprising that a number of the detector defenses that we survey have already been broken by stronger attacks (Carlini & Wagner, 2017; Tramer et al., 2020). Our reduction would \` have already suggested that such a break was likely to happen.
|
| 175 |
+
|
| 176 |
+
Experimental setup. We choose 14 detector defenses from the literature (see Table 1). Our selection of these defenses was partially motivated by a pragmatic consideration on the easiness of translating the defenses’ claims into a bound on the robust risk with detection $R _ { \mathrm { a d v - d e t } } ^ { \epsilon }$ . Indeed, some defenses simply report a single AUC score for the detector’s performance, from which we cannot derive a useful bound on the robust risk. We thus focus on defenses that either directly report a robust error akin to Definition 3, or that provide concrete pairs of false-positive and false-negative rates (e.g., a full ROC curve). In the latter case, we compute a “best-effort” bound on the robust risk with detection2 as:
|
| 177 |
+
|
| 178 |
+
$$
|
| 179 |
+
R _ { \mathrm { a d v - d e t } } ^ { \epsilon } ( f ) \leq \mathrm { F P R } + \mathrm { F N R } + R ( f ) ,
|
| 180 |
+
$$
|
| 181 |
+
|
| 182 |
+
where FPR and FNR are the detector’s false-positive and false-negative rates for a fixed detection threshold, and $R ( f )$ is the defense’s standard risk (i.e., the test error on natural examples).
|
| 183 |
+
|
| 184 |
+
The above union bound in Equation (4) is quite pessimistic, as we may over-count examples that lead to multiple sources of errors (e.g., a natural input that is misclassified and erroneously detected). The true robustness claim made by these detector defenses might thus be stronger than what we obtain from our bound. We encourage future detection papers to report their adversarial risk with detection, $R _ { \mathrm { a d v - d e t } } ^ { \epsilon }$ , to facilitate direct comparisons with robust classifiers using our reduction.
|
| 185 |
+
|
| 186 |
+
The 14 detector defenses use three datasets: MNIST, CIFAR-10 and ImageNet, and consider adversarial examples under the $\ell _ { \infty }$ or $\ell _ { 2 }$ norms. Given a claim of robust detection at distance , we contrast it to a state-of-the-art robust classification result for distance $\epsilon / 2$ :
|
| 187 |
+
|
| 188 |
+
• On MNIST with $\ell _ { \infty }$ attacks, we use the adversarially-trained TRADES classifier (Zhang et al., 2019) and measure robust error with the Square attack (Andriushchenko et al., 2020).
|
| 189 |
+
• On MNIST with $\ell _ { 2 }$ attacks, we use the adversarially-trained classifier from Tramer & \` Boneh (2019) and measure robust error with PGD (Madry et al., 2018).
|
| 190 |
+
• On CIFAR-10, for both $\ell _ { \infty }$ and $\ell _ { 2 }$ attacks we use the adversarially-trained classifier of Rebuffi et al. (2021) (trained without external data), and attack it using the APGD-CE attack from AutoAttack (Croce & Hein, 2020).
|
| 191 |
+
• For ImageNet, for both $\ell _ { \infty }$ and $\ell _ { 2 }$ attacks we use adversarially-trained classifiers and PGD attacks from Engstrom et al. (2019).
|
| 192 |
+
|
| 193 |
+
We also consider two certified defenses for $\ell _ { \infty }$ attacks on CIFAR-10: the robust classifier of Zhang et al. (2020a), and a recent certified detector of Sheikholeslami et al. (2021).
|
| 194 |
+
|
| 195 |
+
Results. As we can see from Table 1, most defenses claim a detection performance that implies a far greater robust accuracy than our current best robust classifiers. To illustrate with a concrete example, the CIFAR-10 detector of Miller et al. (2019) claims to achieve robust accuracy with detection of $7 5 \%$ for $\ell _ { 2 }$ attacks with $\epsilon = 2 . 9$ . Using Theorem 4, this implies an inefficient classifier with robust accuracy of $7 5 \%$ for $\ell _ { 2 }$ attacks with $\epsilon = { } ^ { 2 . 9 } / 2 = 1 . 4 5$ . Yet, the current state-of-the-art robust accuracy for such a perturbation budget is only $3 0 \%$ (Rebuffi et al., 2021). If this detector defense’s robustness claim were correct, it would imply a remarkable breakthrough in robust classification.
|
| 196 |
+
|
| 197 |
+
Why do many of these defenses claim robust accuracies that appear “too good to be true”? A primary reason is that the vast majority of the above detector defenses do not consider evaluations against adaptive attacks (Carlini et al., 2019; Athalye et al., 2018; Tramer et al., 2020). That is, \` these defenses show that they can detect some fixed attacks, and thereafter conclude that the detector is robust against all attacks. As in the case of robust classifiers, such an evaluation is clearly insufficient! Some defenses do evaluate against adaptive adversaries, but fail to build a sufficiently strong attack to reliably approximate the worst-case robust risk. Because of the lack of a strong comparative baseline, it is not always immediately clear that these results are overly strong.
|
| 198 |
+
|
| 199 |
+
Table 1: For each detector defense, we compute a (best-effort) bound on the claimed robust risk with detection $R _ { \mathrm { a d v - d e t } } ^ { \epsilon }$ using Equation (4), and report the complement (the robust accuracy with detection), $1 - R _ { \mathrm { a d v - d e t } } ^ { \epsilon }$ . For each detector’s robustness claim (at distance $\epsilon$ ), we report the stateof-the-art robust classification accuracy for attacks at distance $\epsilon / 2$ , denoted $1 - R _ { \mathrm { a d v } } ^ { \epsilon / 2 }$ . Detection defense claims that imply a higher robust classification accuracy than the current state-of-the-art are highlighted in red.
|
| 200 |
+
|
| 201 |
+
<table><tr><td>Dataset</td><td>Defense</td><td>Norm</td><td>E</td><td>1-Radv-det</td><td>1- R</td></tr><tr><td rowspan="3">MNIST</td><td>Grosse et al. (2017)</td><td>l8</td><td>0.5</td><td>≥ 98%</td><td>94%</td></tr><tr><td>Ma et al. (2018)</td><td>l2</td><td>4.2</td><td>≥ 99%</td><td>72%</td></tr><tr><td>Raghuram et al. (2021)</td><td>l2</td><td>8.9</td><td>≥ 74%</td><td>0%</td></tr><tr><td rowspan="8">CIFAR-10</td><td>Yin et al. (2020)</td><td>l2</td><td>1.7</td><td>≥ 90%</td><td>66%</td></tr><tr><td>Feinman et al. (2017)</td><td>l2</td><td>2.7</td><td>≥ 43%</td><td>36%</td></tr><tr><td>Miller et al. (2019)</td><td>l2</td><td>2.9</td><td>≥ 75%</td><td>30%</td></tr><tr><td>Raghuram et al. (2021)</td><td>l</td><td>4.0</td><td>≥ 56%</td><td>10%</td></tr><tr><td>Ma & Liu (2019)</td><td>l8</td><td>4/255</td><td>≥ 96%</td><td>85%</td></tr><tr><td>Roth et al. (2019)</td><td>l8</td><td>8/255</td><td>≥ 66%</td><td>79%</td></tr><tr><td>Lee et al. (2018)</td><td>lo</td><td>20/255</td><td>≥ 81%</td><td>59%</td></tr><tr><td>Li et al. (2019)</td><td>lo</td><td>26/255</td><td>≥ 80%</td><td>44%</td></tr><tr><td rowspan="5">ImageNet</td><td>Xu et al. (2018)</td><td>l</td><td>1.0</td><td>≥ 67%</td><td>54%</td></tr><tr><td>Ma & Liu (2019)</td><td>l8</td><td>2/255</td><td>≥ 68%</td><td>55%</td></tr><tr><td>Jha et al. (2019)</td><td>lo</td><td>2/255</td><td>≥ 30%</td><td>55%</td></tr><tr><td>Hendrycks & Gimpel (2017)</td><td>l8</td><td>10/255</td><td>≥ 76%</td><td>30%</td></tr><tr><td>Yu et al. (2019)</td><td>l8</td><td>26/255</td><td>M 7%</td><td>5%</td></tr></table>
|
| 202 |
+
|
| 203 |
+
For example, the recent work of Raghuram et al. (2021, ICML Long Talk) builds a detector on MNIST with a FNR of $\leq 5 \%$ at a FPR of $\leq 2 0 \%$ , for adaptive $\ell _ { 2 }$ attacks bounded by $\epsilon = 8 . 9$ . Yet, this perturbation bound is much larger than the average distance between an MNIST image and the nearest image from a different class! Thus, an attack within this perturbation bound can trivially reduce the detector’s accuracy to chance. On CIFAR-10, the same detector achieves $9 5 \%$ clean accuracy, and a FNR of $\leq 1 9 \%$ at a FPR of $\leq 2 0 \%$ for adaptive $\ell _ { 2 }$ attacks bounded by $\epsilon = 4$ . Using Equation (4), this yields a bound on the robust accuracy with detection of $1 - R _ { \mathrm { a d v - d e t } } ^ { \epsilon } ( f ) \geq$ $1 - \bar { ( 5 \% + 1 9 \% + 2 0 \% ) } = 5 6 \%$ . In contrast, the best robust classifier we are aware of for $\ell _ { 2 }$ attacks bounded by $\epsilon = 2$ achieves robust accuracy of only $1 0 \%$ (Rebuffi et al., 2021). In summary, the adaptive attack considered in this detector defense’s evaluation is highly unlikely to be good approximation of a worst-case attack, and this defense can likely be broken by stronger attacks.
|
| 204 |
+
|
| 205 |
+
Certifiably robust detection and classification. In Table 2, we look at the robust accuracy with detection, and standard robust accuracy achieved by certified defenses (for which the claimed robustness numbers are necessarily mathematically correct).
|
| 206 |
+
|
| 207 |
+
We note that our reduction is not as meaningful in the case of certified defenses, since it is highly plausible that computational inefficiency can be leveraged to build better certified classifiers. Indeed, given any robust classifier (e.g., an adversarially trained model), the classifier’s robustness can always be certified inefficiently (by enumerating over all points within an $\epsilon$ -ball). Thus, the existence of an inefficient classifier with higher certified robustness than the state-of-the-art is to be expected.
|
| 208 |
+
|
| 209 |
+
Nevertheless, we find that existing results for certified classifiers and detectors perfectly match what is implied by our reduction (up to $\pm 2 \%$ error). For example, Zhang et al. (2020a) follow a long line of results on robust classifiers and achieve $3 9 \%$ robust accuracy on CIFAR-10 for perturbations of $\ell _ { \infty }$ -norm below $^ { 4 } / 2 5 5$ . Together with Theorem 5, this implies an inefficient detector with $3 9 \%$ robust detection accuracy for perturbations of $\ell _ { \infty }$ -norm below $^ { 8 } / 2 5 5$ . The recent work of Sheikholeslami et al. (2021) nearly matches that bound $3 7 \%$ robust accuracy with detection), with a defense that has the advantage of being concretely efficient.
|
| 210 |
+
|
| 211 |
+
Table 2: Certified robust accuracy $1 - R _ { \mathrm { a d v } } ^ { \epsilon / 2 }$ for the defense of Zhang et al. (2020a), and certified robust accuracy with detection $1 - R _ { \mathrm { a d v - d e t } } ^ { \epsilon }$ dv for the defense of Sheikholeslami et al. (2021).
|
| 212 |
+
|
| 213 |
+
<table><tr><td>E</td><td>1-Radv-det</td><td></td></tr><tr><td>8/255</td><td>37%</td><td>39%</td></tr><tr><td>16/255</td><td>32%</td><td>33%</td></tr></table>
|
| 214 |
+
|
| 215 |
+
These results give additional credence to our thesis: with current techniques, robust classification is indeed approximately twice as hard (in terms of the perturbation bounds covered) than robust detection.
|
| 216 |
+
|
| 217 |
+
Extensions and open problems. The main open problem raised by our work is of course whether it could be possible to show an efficient reduction between classification and detection of adversarial examples, but this seems implausible (at least with our minimum distance decoding approach).
|
| 218 |
+
|
| 219 |
+
Another interesting question is whether a similar reduction can be shown for robustness to less “structured” perturbations than $\ell _ { p }$ balls and other metric spaces. For example, there has been a line of research on defending against adversarial patches (Brown et al., 2017), using empirical (Hayes, 2018; Naseer et al., 2019; Chou et al., 2020) and certifiable techniques (Chiang et al., 2020; Zhang et al., 2020b; Xiang et al., 2021). To use our result, we would have to define some metric to measure the size of an adversarial patch’s perturbation. Yet, the size of a patch is typically defined by the number of contiguously perturbed pixels, which does not define a metric (in particular, it does not satisfy the triangular inequality which our reduction relies on).
|
| 220 |
+
|
| 221 |
+
Finally, similar hardness reductions might exist between other candidate approaches for building robust classifiers. For example, the question of whether (test-time) randomness can be leveraged to build more robust models is also intriguing .Empirical defenses that use randomness can be notoriously hard to evaluate (Athalye et al., 2018; Tramer et al., 2020), so a reduction similar to ours \` might be useful in showing that we should not expect such approaches to bare fruit.
|
| 222 |
+
|
| 223 |
+
# 4 CONCLUSION
|
| 224 |
+
|
| 225 |
+
We have shown formal reductions between robust classification with, and without, a detection option. Our results show that significant progress on one of these two tasks implies similar progress on the other—unless computational inefficiency can somehow be leveraged to build more robust models. This raises the question on whether we should spend our efforts on studying both of these tasks, or focus our efforts on a single one.
|
| 226 |
+
|
| 227 |
+
On one hand, the two tasks represent different ways of tackling a common goal, and working on either task might result in new techniques or ideas that apply to the other task as well. On the other hand, our reductions show that unless we make progress on both tasks, work on one of the tasks can merely aim to match the robustness of our inefficient constructions, whilst improving their computational complexity.
|
| 228 |
+
|
| 229 |
+
We believe our reduction will serve as a useful sanity-check when assessing the claims of future detector defenses. Detector defenses’ robustness evaluations have received less stringent scrutiny than robust classifiers over the past years, perhaps in part due to a lack of strong comparative baselines. Instead of having to wait until some detector defense’s claims pass the test-of-time, we show that detection results can be directly contrasted against long-standing results for robust classification.
|
| 230 |
+
|
| 231 |
+
When applying this approach to past detector defenses, we find that many make robustness claims that imply significant breakthroughs in robust classification. We believe our reduction could have been useful in highlighting the suspiciously strong claims made by many of these defenses—before they were explicitly broken by stronger attacks.
|
| 232 |
+
|
| 233 |
+
Ethics statement. Our paper demonstrates a fundamental barrier towards detecting against adversarial examples, under the assumption that our current techniques are insufficient to achieve strong (inefficient) robust classification. We do not however explicitly break any existing defenses (our results merely strongly suggest that many existing detector defenses’ claims are suspiciously high). Our paper therefore cannot lead to any explicit harms, but aims to further our understanding of the hardness of robust classification and detection.
|
| 234 |
+
|
| 235 |
+
Reproducibility statement. Our paper’s contribution is mainly of theoretical nature. Section 2 is self-contained and clearly states our assumptions, results and proofs (except for the proof of Theorem 5 in Appendix A). The experiments in Section 3 use only public datasets and pre-trained models, with clearly indicates hyper-parameters for all attacks that we evaluate.
|
| 236 |
+
|
| 237 |
+
# REFERENCES
|
| 238 |
+
|
| 239 |
+
Maksym Andriushchenko, Francesco Croce, Nicolas Flammarion, and Matthias Hein. Square attack: a query-efficient black-box adversarial attack via random search. In European Conference on Computer Vision, 2020.
|
| 240 |
+
|
| 241 |
+
Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. In International Conference on Machine Learning, 2018.
|
| 242 |
+
|
| 243 |
+
Battista Biggio, Igino Corona, Davide Maiorca, Blaine Nelson, Nedim Srndi ˇ c, Pavel Laskov, Gior- ´ gio Giacinto, and Fabio Roli. Evasion attacks against machine learning at test time. In European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 387–402. Springer, 2013.
|
| 244 |
+
|
| 245 |
+
Tom B Brown, Dandelion Mane, Aurko Roy, Mart ´ ´ın Abadi, and Justin Gilmer. Adversarial patch. arXiv preprint arXiv:1712.09665, 2017.
|
| 246 |
+
|
| 247 |
+
Sebastien Bubeck, Yin Tat Lee, Eric Price, and Ilya Razenshteyn. Adversarial examples from cryp-´ tographic pseudo-random generators. arXiv preprint arXiv:1811.06418, 2018.
|
| 248 |
+
|
| 249 |
+
Nicholas Carlini and David Wagner. Adversarial examples are not easily detected: Bypassing ten detection methods. In AISec, pp. 3–14. ACM, 2017.
|
| 250 |
+
|
| 251 |
+
Nicholas Carlini, Anish Athalye, Nicolas Papernot, Wieland Brendel, Jonas Rauber, Dimitris Tsipras, Ian Goodfellow, and Aleksander Madry. On evaluating adversarial robustness. arXiv preprint arXiv:1902.06705, 2019.
|
| 252 |
+
|
| 253 |
+
Ping-yeh Chiang, Renkun Ni, Ahmed Abdelkader, Chen Zhu, Christoph Studer, and Tom Goldstein. Certified defenses for adversarial patches. arXiv preprint arXiv:2003.06693, 2020.
|
| 254 |
+
|
| 255 |
+
Edward Chou, Florian Tramer, and Giancarlo Pellegrino. Sentinet: Detecting physical attacks \` against deep learning systems. In Workshop on Deep Learning Security, 2020.
|
| 256 |
+
|
| 257 |
+
Francesco Croce and Matthias Hein. Reliable evaluation of adversarial robustness with an ensemble of diverse parameter-free attacks. In ICML, 2020.
|
| 258 |
+
|
| 259 |
+
Francesco Croce, Maksym Andriushchenko, Vikash Sehwag, Nicolas Flammarion, Mung Chiang, Prateek Mittal, and Matthias Hein. Robustbench: a standardized adversarial robustness benchmark. arXiv preprint arXiv:2010.09670, 2020.
|
| 260 |
+
|
| 261 |
+
Logan Engstrom, Andrew Ilyas, Hadi Salman, Shibani Santurkar, and Dimitris Tsipras. Robustness (python library), 2019. URL https://github.com/MadryLab/robustness.
|
| 262 |
+
|
| 263 |
+
Reuben Feinman, Ryan R Curtin, Saurabh Shintre, and Andrew B Gardner. Detecting adversarial samples from artifacts. arXiv preprint arXiv:1703.00410, 2017.
|
| 264 |
+
|
| 265 |
+
Sanjam Garg, Somesh Jha, Saeed Mahloujifar, and Mahmoody Mohammad. Adversarially robust learning could leverage computational hardness. In Algorithmic Learning Theory, pp. 364–385. PMLR, 2020.
|
| 266 |
+
|
| 267 |
+
Kathrin Grosse, Praveen Manoharan, Nicolas Papernot, Michael Backes, and Patrick McDaniel. On the (statistical) detection of adversarial examples. arXiv preprint arXiv:1702.06280, 2017.
|
| 268 |
+
|
| 269 |
+
Jamie Hayes. On visible adversarial perturbations & digital watermarking. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pp. 1597–1604, 2018.
|
| 270 |
+
|
| 271 |
+
Warren He, James Wei, Xinyun Chen, Nicholas Carlini, and Dawn Song. Adversarial example defenses: Ensembles of weak defenses are not strong. In USENIX Workshop on Offensive Technologies, 2017.
|
| 272 |
+
|
| 273 |
+
Dan Hendrycks and Kevin Gimpel. Early methods for detecting adversarial images. In International Conference on Learning Representations, 2017.
|
| 274 |
+
|
| 275 |
+
Susmit Jha, Sunny Raj, Steven Lawrence Fernandes, Sumit Kumar Jha, Somesh Jha, Gunjan Verma, Brian Jalaian, and Ananthram Swami. Attribution-driven causal analysis for detection of adversarial examples. arXiv preprint arXiv:1903.05821, 2019.
|
| 276 |
+
|
| 277 |
+
Kimin Lee, Kibok Lee, Honglak Lee, and Jinwoo Shin. A simple unified framework for detecting out-of-distribution samples and adversarial attacks. In Advances in Neural Information Processing Systems, 2018.
|
| 278 |
+
|
| 279 |
+
Yingzhen Li, John Bradshaw, and Yash Sharma. Are generative classifiers more robust to adversarial attacks? In International Conference on Machine Learning, pp. 3804–3814. PMLR, 2019.
|
| 280 |
+
|
| 281 |
+
Shiqing Ma and Yingqi Liu. Nic: Detecting adversarial samples with neural network invariant checking. In Proceedings of the 26th Network and Distributed System Security Symposium (NDSS 2019), 2019.
|
| 282 |
+
|
| 283 |
+
Xingjun Ma, Bo Li, Yisen Wang, Sarah M Erfani, Sudanthi Wijewickrema, Grant Schoenebeck, Dawn Song, Michael E Houle, and James Bailey. Characterizing adversarial subspaces using local intrinsic dimensionality. In International Conference on Learning Representations, 2018.
|
| 284 |
+
|
| 285 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In International Conference on Learning Representations, 2018.
|
| 286 |
+
|
| 287 |
+
David Miller, Yujia Wang, and George Kesidis. When not to classify: Anomaly detection of attacks (ada) on dnn classifiers at test time. Neural computation, 31(8):1624–1670, 2019.
|
| 288 |
+
|
| 289 |
+
Muzammal Naseer, Salman Khan, and Fatih Porikli. Local gradients smoothing: Defense against localized adversarial attacks. In 2019 IEEE Winter Conference on Applications of Computer Vision (WACV), pp. 1300–1307. IEEE, 2019.
|
| 290 |
+
|
| 291 |
+
Tianyu Pang, Huishuai Zhang, Di He, Yinpeng Dong, Hang Su, Wei Chen, Jun Zhu, and Tie-Yan Liu. Adversarial training with rectified rejection. arXiv preprint arXiv:2105.14785, 2021.
|
| 292 |
+
|
| 293 |
+
Aditi Raghunathan, Jacob Steinhardt, and Percy Liang. Certified defenses against adversarial examples. In International Conference on Learning Representations, 2018.
|
| 294 |
+
|
| 295 |
+
Jayaram Raghuram, Varun Chandrasekaran, Somesh Jha, and Suman Banerjee. A general framework for detecting anomalous inputs to dnn classifiers. In International Conference on Machine Learning, 2021.
|
| 296 |
+
|
| 297 |
+
Sylvestre-Alvise Rebuffi, Sven Gowal, Dan A Calian, Florian Stimberg, Olivia Wiles, and Timothy Mann. Fixing data augmentation to improve adversarial robustness. arXiv preprint arXiv:2103.01946, 2021.
|
| 298 |
+
|
| 299 |
+
Kevin Roth, Yannic Kilcher, and Thomas Hofmann. The odds are odd: A statistical test for detecting adversarial examples. In International Conference on Machine Learning, 2019.
|
| 300 |
+
|
| 301 |
+
Ludwig Schmidt, Shibani Santurkar, Dimitris Tsipras, Kunal Talwar, and Aleksander Madry. Adversarially robust generalization requires more data. In Advances In Neural Information Processing Systems, pp. 5019–5031, 2018.
|
| 302 |
+
|
| 303 |
+
Fatemeh Sheikholeslami, Ali Lotfi, and J Zico Kolter. Provably robust classification of adversarial examples with detection. In International Conference on Learning Representations, 2021.
|
| 304 |
+
|
| 305 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In International Conference on Learning Representations, 2014.
|
| 306 |
+
|
| 307 |
+
Florian Tramer and Dan Boneh. Adversarial training and robustness for multiple perturbations. In \` Advances In Neural Information Processing Systems, 2019.
|
| 308 |
+
|
| 309 |
+
Florian Tramer, Nicholas Carlini, Wieland Brendel, and Aleksander Madry. On adaptive attacks to \` adversarial example defenses. In Conference on Neural Information Processing Systems, 2020.
|
| 310 |
+
|
| 311 |
+
Dimitris Tsipras, Shibani Santurkar, Logan Engstrom, Alexander Turner, and Aleksander Madry. Robustness may be at odds with accuracy. In International Conference on Learning Representations, 2019.
|
| 312 |
+
|
| 313 |
+
Eric Wong and Zico Kolter. Provable defenses against adversarial examples via the convex outer adversarial polytope. In International Conference on Machine Learning, pp. 5283–5292, 2018.
|
| 314 |
+
|
| 315 |
+
Chong Xiang, Arjun Nitin Bhagoji, Vikash Sehwag, and Prateek Mittal. Patchguard: A provably robust defense against adversarial patches via small receptive fields and masking. In 30th {USENIX} Security Symposium ({USENIX} Security 21), 2021.
|
| 316 |
+
|
| 317 |
+
Weilin Xu, David Evans, and Yanjun Qi. Feature squeezing: Detecting adversarial examples in deep neural networks. In Network and Distributed System Security Symposium, 2018.
|
| 318 |
+
|
| 319 |
+
Xuwang Yin, Soheil Kolouri, and Gustavo K Rohde. Gat: Generative adversarial training for adversarial example detection and robust classification. In International Conference on Learning Representations, 2020.
|
| 320 |
+
|
| 321 |
+
Tao Yu, Shengyuan Hu, Chuan Guo, Wei-Lun Chao, and Kilian Q Weinberger. A new defense against adversarial images: Turning a weakness into a strength. In Advances in Neural Information Processing Systems, 2019.
|
| 322 |
+
|
| 323 |
+
Hongyang Zhang, Yaodong Yu, Jiantao Jiao, Eric P. Xing, Laurent El Ghaoui, and Michael I. Jordan. Theoretically principled trade-off between robustness and accuracy. In International Conference on Machine Learning, 2019.
|
| 324 |
+
|
| 325 |
+
Huan Zhang, Hongge Chen, Chaowei Xiao, Bo Li, Duane Boning, and Cho-Jui Hsieh. Towards stable and efficient training of verifiably robust neural networks. In International Conference on Learning Representations, 2020a.
|
| 326 |
+
|
| 327 |
+
Zhanyuan Zhang, Benson Yuan, Michael McCoyd, and David Wagner. Clipped bagnet: Defending against sticker attacks with clipped bag-of-features. In 2020 IEEE Security and Privacy Workshops (SPW), pp. 55–61. IEEE, 2020b.
|
| 328 |
+
|
| 329 |
+
# A PROOF OF THEOREM 5.
|
| 330 |
+
|
| 331 |
+
We recall Theorem 5:
|
| 332 |
+
|
| 333 |
+
Theorem 5 $( \epsilon / 2$ robust-classification implies inefficient $\epsilon$ -robust detection). Let $d ( \cdot , \cdot )$ be an arbi
|
| 334 |
+
trary metric. Let g be a defense than explicit (but inefficient) defense achieves robust rithat achieves risk $R _ { a d \nu } ^ { \epsilon / 2 } ( f ) = \beta$ . Then, we can constructrobust risk with detection $f$ $R ( f ) \leq \beta$
|
| 335 |
+
$R _ { a d \nu - d e t } ^ { \epsilon } ( f ) \leq \beta$ .
|
| 336 |
+
|
| 337 |
+
The defense $f$ is constructed as follows on input $x$ :
|
| 338 |
+
|
| 339 |
+
• Run the classifier $y g ( x )$ .
|
| 340 |
+
|
| 341 |
+
• Find a perturbed input $x ^ { \prime }$ withing distance $\epsilon / 2$ of $x$ that is classified differently, i.e., $\bar { d } ( x , x ^ { \prime } ) \bar { \ } \leq \ \epsilon / 2$ and $g ( x ^ { \prime } ) \neq y$ . If such an input $x ^ { \prime }$ exists, reject the input and output ⊥. Else, output the class $y$ .
|
| 342 |
+
|
| 343 |
+
Proof of Theorem 5. Note that for any input $( x , y )$ for which the classifier $g$ is robust at distance $\epsilon / 2$ , no input $x ^ { \prime }$ above exists and so $f ( x ) = y$ . Thus, the risk of $f$ is at most the robust risk of $g$ , so $R ( f ) \leq \beta$ .
|
| 344 |
+
|
| 345 |
+
Now, consider an input $( x , y ) \sim \mathcal { D }$ for which $f$ is not robust with detection at distance $\epsilon$ . That is, either $f ( x ) \neq y$ , or there exists an input $\hat { x }$ at distance $d ( x , { \hat { x } } ) \leq \epsilon$ such that $f ( \hat { x } ) = \hat { y } \not \in \{ y , \bot \}$ . We will show that the defense $g$ is not robust for $x$ either (for attacks at distance up to $\epsilon / 2$ .)
|
| 346 |
+
|
| 347 |
+
If $f ( x ) \neq y$ , then by the same argument as above it cannot be the case that $g$ is robust at distance $\epsilon / 2$ for $x$ .
|
| 348 |
+
|
| 349 |
+
So let us consider the case where $f ( \hat { x } ) = \hat { y } \not \in \{ y , \bot \}$ . By the definition of $f$ , this means that for all $x ^ { \prime }$ at distance at most $\epsilon / 2$ from $\hat { x }$ , we have $g ( x ^ { \prime } ) = \hat { y }$ . But, note that there exists a point $x ^ { * }$ that is at distance at most $\epsilon / 2$ from both $\hat { x }$ and $x$ . Since we must have $g ( x ^ { * } ) = \hat { y }$ , we conclude that $g$ is not robust at distance $\epsilon / 2$ for $x$ .
|
| 350 |
+
|
| 351 |
+
Taking expectations over the distribution $\mathcal { D }$ concludes the proof.
|
md/dev/RFGkzxMFqby/RFGkzxMFqby.md
ADDED
|
@@ -0,0 +1,392 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ADVERSARIALLY TRAINED MODELS WITH TEST-TIME COVARIATE SHIFT ADAPTATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Existing defense models against adversarial examples typically provide either empirical or certified robustness. Adversarially trained models empirically demonstrate state-of-the-art defense while providing no robustness guarantees for large classifiers or higher-dimensional inputs. In contrast, a randomized smoothing framework provides state-of-the-art certification while significantly degrades the empirical performance against adversarial attacks. In this work, we propose a novel certification through adaptation technique that transforms an adversarially trained model into a randomized smoothing classifier during inference to provide certified robustness for $\ell _ { 2 }$ norm without affecting their empirical robustness against adversarial attacks. One advantage of our proposed technique is that it allows us to separately choose the appropriate noise level for certifying each test example during inference. It also leads to outperform the existing randomized smoothing models for $\ell _ { 2 }$ certification on CIFAR-10. Therefore, our work is a step towards bridging the gap between the empirical and certified robustness against adversarial examples by achieving both using the same classifier for the first time.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep neural network (DNN) based models are found to be brittle to minor, adversarially-chosen perturbations for their inputs that remain undetectable to human eyes. A DNN classifier that correctly classifies an image $x$ , can be easily fooled by an adversarial attack to misclassify $x + \delta$ (Szegedy et al., 2014; Goodfellow et al., 2015; Madry et al., 2018). Here, $\delta$ is a minor adversarial perturbation such that the change between $x$ and $x + \delta$ remains imperceptible.
|
| 12 |
+
|
| 13 |
+
Among the existing successful defense frameworks, adversarial training (AT) produces the best empirical robustness against the known adversarial attacks without providing any guarantee (Madry et al., 2018; Tramer & Boneh, 2019; Zhang et al., 2019; Rice et al., 2020; Gowal et al., 2020). It \` trains a DNN classifier using strong adversaries from a specific class of perturbation (e.g., a small $\ell _ { p }$ -norm) to provide robustness for the same perturbation types. Several certification techniques are proposed that can be applied to adversarially trained models to certifiably verify if the prediction of a test example, $x$ remains constant within its neighborhood (Wong & Kolter, 2018; Wang et al., 2018; Salman et al., $2 0 1 9 6$ ; Dvijotham et al., 2018; Gehr et al., 2018; Sheikholeslami et al., 2021). However, these certification techniques typically do not scale for larger networks (e.g., ResNet50) and datasets (e.g., IMAGENET). Hence, currently, we cannot guarantee that a more powerful, not yet known attack can not break these adversarially trained models. In fact, several recently proposed empirical defense models are later broken by stronger adaptive adversarial attacks, indicating the importance of investigating certified defenses with suitable robustness guarantees.
|
| 14 |
+
|
| 15 |
+
In contrast to adversarial training, randomized smoothing provides a scalable $\ell _ { 2 }$ -certification framework for any classification model, which is robust against large isotropic Gaussian noise (Cohen et al., 2019; Salman et al., 2019a). However, the existing randomized smoothing-based certified models produce significantly lower empirical robustness compared to the AT models. On the other hand, this technique cannot be applied for AT models as they are not robust against such large random Gaussian noises in the standard settings. Towards this, we investigate to bridge the gap between the state-of-the-art empirical and certifiable robust models against adversarial examples.
|
| 16 |
+
|
| 17 |
+
In this paper, we present a novel certification through adaptation framework to transform an AT model into a randomized smoothing framework during inference, providing $\ell _ { 2 }$ certification without any additional training or architectural modification. Our proposed certification technique consists of two steps: we first apply a covariate shift adaptation to a classifier against Gaussian noise during inference for each test example (Cariucci et al., 2017; Li et al., 2016). For our paper, we use the wellknown batch normalization adaptation. This process significantly boosts the performance of the AT models against the random isotropic Gaussian noises compared to the standard non-robust models. Hence, we can now directly apply the randomized smoothing based certification technique to provide $\ell _ { 2 }$ certification in the next step. Further, the existing randomized smoothing models require selecting the noise level at training time. In contrast, our proposed framework can separately choose the appropriate noise levels for different test examples during inference (Figure 4). Furthermore, we can also evaluate the input test examples without transforming the AT models to a randomized smoothing model, ensuring that their empirical performance remains unaffected. Therefore, we are the first to provide the test-time flexibility to obtain empirically robust predictions as well as certify their predictions using the same classifier for high-dimensional datasets to the best of our knowledge. Hence, we improve the reliability of AT models sensitive real-world applications.
|
| 18 |
+
|
| 19 |
+
Table 1: CIFAR-10: Certified accuracy at various $\ell _ { 2 }$ radii and ACR scores. We train different models by varying the hyper-parameters for SmoothAdv, $\mathrm { \ A d v _ { 2 } }$ and $\mathbf { A d v } _ { \infty }$ (as in (Salman et al., 2019a)) and by choosing $\sigma = \{ 0 . 2 5 , 0 . 5 , 0 . 7 5 \}$ for test-time adaptation to obtain the maximum certified radii for each test example. See Table 5 and 6 (Appendix) for detailed results on both IMAGENET and CIFAR-10 respectively. We also present the best reported results for MARCER and Consistancy at $\sigma = 0 . 5$ , obtained from their respective papers.
|
| 20 |
+
|
| 21 |
+
<table><tr><td>l2Radius (CIFAR-10)</td><td>0.25</td><td>0.5</td><td>0.75</td><td>1.0</td><td>1.25</td><td>1.5</td><td>1.75</td><td>2.0</td><td>ACR</td></tr><tr><td>Baseline</td><td>6.96</td><td>2.04</td><td>0.09</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.026</td></tr><tr><td>Randg =0.5 (Cohen et al.,2019)</td><td>51.68</td><td>40.38</td><td>30.25</td><td>20.81</td><td>13.36</td><td>7.71</td><td>3.38</td><td>0.0</td><td>0.488</td></tr><tr><td>(Ours)Randg=0.5 +adaptation</td><td>62.91</td><td>52.25</td><td>40.06</td><td>25.57</td><td>17.43</td><td>10.67</td><td>5.46</td><td>1.92</td><td>0.657</td></tr><tr><td>SmoothAdvg=0.5 (Salman et al.,2019a)</td><td>58.82</td><td>49.68</td><td>42.68</td><td>37.55</td><td>32.64</td><td>27.52</td><td>22.42</td><td>0.0</td><td>0.918</td></tr><tr><td>(Ours) SmoothAdvg=0.5+adaptation</td><td>59.89</td><td>50.4</td><td>41.76</td><td>35.5</td><td>30.92</td><td>26.1</td><td>20.25</td><td>15.05</td><td>1.008</td></tr><tr><td>Advo (Rice et al.,2020)</td><td>35.95</td><td>29.44</td><td>23.51</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.317</td></tr><tr><td>(Ours)Advo + adaptation</td><td>67.96</td><td>55.06</td><td>43.27</td><td>30.55</td><td>24.68</td><td>18.49</td><td>12.11</td><td>8.45</td><td>0.903</td></tr><tr><td>Adv2 (Rice et al., 2020)</td><td>41.89</td><td>34.15</td><td>26.7</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.359</td></tr><tr><td>(Ours) Adv2 +adaptation</td><td>68.84</td><td>58.77</td><td>49.71</td><td>37.74</td><td>33.37</td><td>28.82</td><td>23.65</td><td>18.23</td><td>1.198</td></tr><tr><td>MARCERg=0.5 (Zhai et al.,2020)</td><td>60.0</td><td>53.0</td><td>46.0</td><td>38.0</td><td>29.0</td><td>19.0</td><td>12.0</td><td>0.0</td><td>0.726</td></tr><tr><td>Consistancyg=0.5 (Jeong& Shin,2020)</td><td>48.9</td><td>45.1</td><td>41.3</td><td>37.8</td><td>33.9</td><td>29.9</td><td>25.2</td><td>0.0</td><td>0.726</td></tr></table>
|
| 22 |
+
|
| 23 |
+
# Contributions:-
|
| 24 |
+
|
| 25 |
+
1. We propose a novel certification through adaptation framework that can adapt an AT model during inference to provide certified robustness. Our experimental results on CIFAR-10 and IMAGENET demonstrate that the proposed certification framework can transform any AT model into a randomized smoothing classifier to provide certification for $\ell _ { 2 }$ norm, even when the model is learned using $\ell _ { \infty }$ -bounded adversaries (Table 1 & Figure 2).
|
| 26 |
+
2. One main advantage of our proposed framework is that it allows us to select appropriate noise levels for different test examples during inference. This leads to outperforming the existing state-of-the-art randomized smoothing models for $\ell _ { 2 }$ certification on CIFAR-10 using AT models (Table 1 & Figure 4). Further, we can provide certification at larger $\ell _ { 2 }$ radii for existing randomized smoothing models, improving their overall average certified radius (ACR).
|
| 27 |
+
3. Our results also indicate a strong correlation between empirical and certified robustness than previously believed (Cohen et al., 2019; Salman et al., $2 0 1 9 \mathrm { a }$ ; Tramer & Boneh, 2019). \` In particular, we observe that the empirically stronger AT models lead to better $\ell _ { 2 }$ certification performance (Figure 5).
|
| 28 |
+
|
| 29 |
+
# 2 RELATED WORK
|
| 30 |
+
|
| 31 |
+
Empirical Defenses and Adversarial Training. Existing defense models against adversarial attacks can be broadly classified into empirical and certified defenses. Empirical defenses demonstrate empirical robustness against adversarial attacks (Schott et al., 2019; Moosavi Dezfooli et al., 2019; Nandy et al., 2020; Mao et al., 2021). Adversarial training achieves the state-of-the-art empirical defense (Madry et al., 2018). It optimizes the following loss function for a DNN classifier, $f$ , to provide robustness within an $\epsilon$ -bounded threat model for an $\ell _ { p }$ norm, where the perturbations, $\delta \in \Delta$ are constrained as $\Delta = \{ \delta : | | \delta | | _ { p } \leq \epsilon \}$ :
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
\operatorname* { m i n } _ { \theta } \mathbb { E } _ { ( x , y ) } [ \operatorname* { m a x } _ { \delta \in \Delta } \mathcal { L } ( f _ { \theta } ( x + \delta ) , y ) ]
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
where, $\theta$ denotes the model parameters. $\mathcal { L }$ is the classification loss.
|
| 38 |
+
|
| 39 |
+
The inner maximization in Eq. 1 is solved by producing adversarial examples using strong iterative adversaries, e.g., projected gradient descent $( P G D )$ attack (Kurakin et al., 2016; Madry et al., 2018). Wong et al. (2020) found that even a single-step fast gradient sign method (FGSM) attack-based AT models also achieves high empirical robustness (Goodfellow et al., 2015). Zhang et al. (2020) proposed to use the least adversaries for training. Recently Trades (Zhang et al., 2019), Adv-LLR (Qin et al., 2019) introduced additional regularizers to achieve higher empirical robustness by smoothing the loss surface. However, Rice et al. (2020) showed that the standard PGD based AT model with early-stopping criteria provides one of the best empirical defenses for a given perturbation type. Recent works also explored the importance of different hyper-parameters for adversarial training (Gowal et al., 2020; Pang et al., 2021) as well as incorporating additional data in a semi-supervised fashion (Carmon et al., 2019; Uesato et al., 2019) to further improve their empirical robustness.
|
| 40 |
+
|
| 41 |
+
Certified Defenses. Empirical defenses demonstrate robustness only against the known adversaries without providing any guarantees. In fact, most empirical defenses proposed in the literature were later broken by stronger adversaries, highlighting the importance of certified defenses to provide robustness guarantees (Athalye et al., 2018; Uesato et al., 2018; Jalal et al., 2019).
|
| 42 |
+
|
| 43 |
+
Several recent works proposed to train neural network models with provable robustness guarantees. These works include methods based on semi-definite relaxations (Raghunathan et al., 2018), linear relaxations and duality (Wong & Kolter, 2018; Wong et al., 2018), abstract interpretation (Mirman et al., 2018), and interval bound propagation (Gowal et al., 2018). Parallel to training a certified defense, several works also focus on certifying the already trained models (Tjeng et al., 2017; Gehr et al., 2018; Weng et al., 2018; Wang et al., 2018; Bunel et al., 2018). Recently Mueller et al. (2021) combined a small certification network with a large, empirically robust AT model using some selection criteria to boost overall benign accuracy along with empirical robustness for the certified framework. However, none of these techniques scale for large networks (e.g., ResNet50) or higher-dimensional datasets (e.g., IMAGENET).
|
| 44 |
+
|
| 45 |
+
Randomized Smoothing for Certification. A randomized smoothing classifier is not a neural network. It uses a neural network as its base for classification. Randomized smoothing was initially proposed as a heuristic defense (Cao & Gong, 2017; Liu et al., 2018) and later shown to be certifiable (Lecuyer et al., 2019; Li et al., 2019). Recently, Cohen et al. (2019) and Salman et al. (2019a) separately provided a tight robustness guarantee for $\ell _ { 2 }$ -norm. Salman et al. (2019a) provides the current state-of-the-art $\ell _ { 2 }$ certification robustness by adversarially choosing the noise using an adaptive attack to train their base classifier. This framework is also analyzed for other $\ell _ { p }$ norms using different noise distributions as well (Li et al., 2019; Lee et al., 2019; Dvijotham et al., 2020; Yang et al., 2020). Salman et al. (2020) proposed to incorporate an additional denoising module as a preprocessing unit to convert a standard DNN classifier into a randomized smoothing model to provide non-trivial certified robustness. Notably, randomized smoothing is the only scalable certification framework. Further, it also achieves superior performance for different perturbation types.
|
| 46 |
+
|
| 47 |
+
While achieving the state-of-the-art certification performance, randomized smoothing significantly degrades the empirical robustness against adversarial attacks (Lecuyer et al., 2019; Salman et al., 2019a; Cohen et al., 2019). Towards this, our proposed technique transforms an AT model into a randomized smoothing classifier without any additional training or architectural modification. Since AT models already provide the state-of-the-art empirical defense, we achieve both empirical and certified robustness against adversarial examples using the same classifier.
|
| 48 |
+
|
| 49 |
+
# 3 PROPOSED METHODOLOGY
|
| 50 |
+
|
| 51 |
+
In this section, we first present the background of the randomized smoothing technique and explain why it is not directly effective for AT models. Next, we present the existing test-time co-variate shift adaptation for domain adaptations and corruption robustness. Then, we present our proposed certification through adaptation framework that adapts a DNN model during inference to provide certified robustness without additional training or architectural modification.
|
| 52 |
+
|
| 53 |
+
# 3.1 BACKGROUND ON RANDOMIZED SMOOTHING
|
| 54 |
+
|
| 55 |
+
Consider a classifier $f$ that maps inputs in $\mathbb { R } ^ { d }$ to $\mathcal { V }$ classes. The randomized smoothing framework transforms the original base classifier $f$ into a new, smoothed classifier $g$ . In particular, for an
|
| 56 |
+
|
| 57 |
+
input $x \in \mathbb { R } ^ { d }$ , the smoothed classifier $g$ returns the most probable class to be predicted by the base classifier $f$ under isotropic Gaussian noises of $x$ . That is,
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
g ( x ) = a r g \operatorname* { m a x } _ { y \in \mathcal { V } } \mathbb { P } ( f ( x + \delta ) = = y ) \qquad { \mathrm { w h e r e } } , \delta \sim { \mathcal { N } } ( 0 , \sigma ^ { 2 } I ) .
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
The noise level, $\sigma$ controls the trade-off between robustness and accuracy: Increasing $\sigma$ would improve the robustness of $g$ at higher $\ell _ { 2 }$ radii. However, it degrades the robustness at lower $\ell _ { 2 }$ radii as well as the benign accuracy.
|
| 64 |
+
|
| 65 |
+
Cohen et al. (2019) presented a tight robustness guarantee based on the Neyman-Pearson lemma for the smoothed classifier $g$ and gave an efficient algorithm using Monte Carlo sampling for certifying of $g$ . We can also obtain this guarantee alternatively by explicitly computing the Lipschitz constant of the smoothed classifier as shown in (Salman et al., 2019a; Yang et al., 2020). The certification procedure is as follows: Suppose a base classifier $f$ classifies $\sqrt { ( x , \sigma ^ { 2 } I ) }$ to return the “most probable” class, $c _ { A }$ with probability $p _ { A } = \mathbb { P } ( f ( x + \delta ) = = c _ { A } )$ ) and the “runner-up” class $c _ { B }$ with probability $\begin{array} { r } { p _ { B } = \operatorname* { m a x } _ { y \neq c _ { A } } \mathbb { P } ( f ( x + \delta ) = = y } \end{array}$ ). Then, the smooth classifier, $g$ is certifiably robust around $x$ within an $\ell _ { 2 }$ radius of $R$ :
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
R = { \frac { \sigma } { 2 } } \Bigl ( \Phi ^ { - 1 } ( p _ { A } ) - \Phi ^ { - 1 } ( p _ { B } ) \Bigr )
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where, $\Phi ^ { - 1 }$ is the inverse of the standard Gaussian CDF.
|
| 72 |
+
|
| 73 |
+
However, computing the exact values of $p _ { A }$ and $p _ { B }$ is not possible in practice when $f$ is a DNN. Cohen et al. (2019) addressed this problem using Monte Carlo sampling to estimate some $\underline { p _ { A } }$ and $\overline { { p _ { B } } }$ such that $p _ { A } \leq p _ { A }$ and ${ \overline { { p _ { B } } } } \geq p _ { B }$ with arbitrarily high probability. The certified radius for input $x$ is then computed by replacing $p _ { A }$ and $p _ { B }$ with $\underline { p _ { A } }$ and $\overline { { p _ { B } } }$ respectively in Eq. 3.
|
| 74 |
+
|
| 75 |
+
As we can see in Equation 2 that the original base classifier, $f$ needs to be robust against large Gaussian noises to provide non-trivial robustness certification results. Otherwise, it leads to lower $p _ { A }$ and hence a lower certification of $R$ for the test examples. Existing randomized smoothing-based models applies custom-trained using explicit Gaussian noises to learn their original base classifier (Lecuyer et al., 2019; Cohen et al., 2019; Salman et al., 2019a; Zhai et al., 2020; Jeong & Shin, 2020). However, these models produce significantly lower empirical robustness compared to the AT models. Consequently, AT models are not robust against large Gaussian noises in the standard inference settings (see Table 2). Hence, we cannot directly use them as the base classifier for randomized smoothing.
|
| 76 |
+
|
| 77 |
+
# 3.2 BACKGROUND ON COVARIATE SHIFT ADAPTATION
|
| 78 |
+
|
| 79 |
+
Recent works on (Sun et al., 2017; Roy et al., 2019; Huang et al., 2018; Li et al., 2016) and corruption robustness (Schneider et al., 2020; Nado et al., 2020; Benz et al., 2021) demonstrate the importance of unsupervised covariate shift adaptation. We use adaptive batch-normalization (BN), one of the most popular and effective unsupervised covariate shift adaptation mechanisms.
|
| 80 |
+
|
| 81 |
+
A BN layer computes the mean and variance of the hidden activation maps across the channels to normalize these activations to $\mathcal { N } ( 0 , 1 )$ before feeding into the next hidden layer (Ioffe & Szegedy, 2015). It reduces the dependencies among different hidden layers, improving the training efficiency for deep architectures. Hence, most of the recent DNN architectures frequently incorporate BN layers for complex machine learning tasks. However, the distributional shifts in the test examples lead to different activation statistics compared to the training examples. Hence, impacted by the covariate shift, the statistics estimated during training fail to normalize the activation tensors to $\mathcal { N } ( 0 , 1 )$ . As a result, it breaks the crucial assumption for the subsequent hidden layers to work.
|
| 82 |
+
|
| 83 |
+
More formally, let $P _ { T } : \mathcal { X } \times \mathcal { Y } \mathbb { R } ^ { + }$ as the training distribution and $P _ { t } : \mathcal { X } \times \mathcal { Y } \mathbb { R } ^ { + }$ as the test distribution; where $x \in \mathcal { X }$ are inputs and $y \in \mathcal { V }$ are the corresponding class labels. There exists covariate shift between training and test distribution iff: $P _ { T } ( y | \bar { x } ) { = } P _ { t } ( \bar { y } | x )$ and $P _ { T } ( x ) \neq P _ { t } ( x )$ (Sugiyama & Kawanabe, 2012; Scholkopf et al., 2012). If the covariate shift only affects the first ¨ and second-order moments of the hidden layer feature activations, $f _ { h } ( x )$ , we can remove it using normalization (Schneider et al., 2020):
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
P _ { T } \Big ( \frac { f _ { h } ( x ) - \mathbb { E } _ { T } [ f _ { h } ( x ) ] } { \sqrt { \mathbb { V } _ { T } [ f _ { h } ( x ) ] } } \Big ) P _ { T } ( x ) \approx P _ { t } \Big ( \frac { f _ { h } ( x ) - \mathbb { E } _ { t } [ f _ { h } ( x ) ] } { \sqrt { \mathbb { V } _ { t } [ f _ { h } ( x ) ] } } \Big ) P _ { t } ( x ) .
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
Covariate shift adaptation using adaptive BN computes the BN statistics from the feature activations, $\mu _ { t } , s _ { t } ^ { 2 }$ , of the test batch. We can adapt them with the existing training statistics, $\mu _ { T } , s _ { T } ^ { 2 }$ , obtained using the training batches as (Cariucci et al., 2017; Li et al., 2016; Schneider et al., 2020):
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\overline { { \mu } } = \rho \cdot \mu _ { t } + ( 1 - \rho ) \cdot \mu _ { T } \quad \overline { { s } } = \rho \cdot s _ { t } + ( 1 - \rho ) \cdot s _ { T }
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
where, $\rho \in [ 0 , 1 ]$ is the momentum. The choice of $\rho = 0$ is equivalent to the standard inference setup with a deterministic DNN classifier in the IID settings. We should choose $\rho = 1$ when receiving larger test batches as it can provide a better estimation of the test distributions.
|
| 96 |
+
|
| 97 |
+
Assumptions for BN adaptation. It is noteworthy that these existing adaptive BN-based frameworks require a large set of test images from the same covariate shift to estimate the BN parameters. However, this assumption may not hold for several real-world applications, e.g., stateless web APIs. Also, these test images should be semantically diverse, preferably over multiple classes, to effectively estimate the test distributions. Hence, it further limits the practical usability of these frameworks for real-world applications, e.g., autonomous cars.
|
| 98 |
+
|
| 99 |
+
In contrast to these models for domain adaptation and corruption robustness, our proposed certification framework against adversarial examples does not make any such assumptions. In this case, we already know the perturbation type on which we need to adapt the model to provide the certification. Hence, we can explicitly pre-select a diverse set of clean images, ${ \bf X } _ { b a t c h }$ and control the perturbations to adapt the models, addressing both of these limitations.
|
| 100 |
+
|
| 101 |
+
# Algorithm 1: Steps for CERTIFICATION THROUGH ADAPTATION Algorithm
|
| 102 |
+
|
| 103 |
+
Input: $f$ : classifier, $x _ { t e s t }$ : test example, $\sigma$ : desired noise-level, ${ \bf X } _ { b a t c h }$ : set of clean images (preselected from validation data or test stream). Output: Certifiably robust $\ell _ { 2 }$ radius of $R$ for $x _ { t e s t }$ . /\* Step 1: Adapt BN parameters using ${ \bf X } _ { b a t c h }$ with $\rho = 1$ (Eqn 5). \*/ 1 $\tilde { \mathbf { X } } _ { b a t c h } = [ x + \mathcal { N } ( 0 , \sigma I ) \ \forall \ x \in \ \mathbf { X } _ { b a t c h } ]$ // perturb ${ \bf X } _ { b a t c h }$ with desired noise. 2 $f _ { a d a p t } = \mathrm { C L O N E } ( f . t r a i n ( ) )$ // clone $f$ with train-mode. 3 $\underline { { \mathbf { \Pi } } } _ { - } = f _ { a d a p t } ( \tilde { \mathbf { X } } _ { b a t c h } )$ // forward pass for BN parameter adaptation. 4 fadapt.eval() // fix the parameters. /\* Step 2: Certify $x _ { t e s t }$ using Randomized Smoothing framework. \*/ 5 $g =$ GETRANDOMIZEDMODEL(fadapt) // Convert fadapt to randomized-smoothing classifier $g$ (Eqn 2). 6 $R = { \bf C E R T I F Y } ( g , x _ { t e s t } , \sigma )$ // Execute 3 for $\ell _ { 2 }$ certification. 7 return $R$
|
| 104 |
+
|
| 105 |
+
# 3.3 PROPOSED CERTIFICATION THROUGH ADAPTATION
|
| 106 |
+
|
| 107 |
+
The robustness guarantee in Eq. 3 suggests that randomized smoothing gives a framework for certifying any classifier $f$ that is robust against large Gaussian noises. Previous works proposed customized training using explicit Gaussian noise augmentation for their training (Section 3.1). Subsequently, in Section 3.2 we note that robustness against random Gaussian noises of any classifier, $f$ can be improved by applying covariate shift adaptation using adaptive BN technique without any additional training. However, it modifies the original base classifier $f$ at each forward pass by recomputing the BN parameters. Since the certification guarantee in Eq. 3 is provided only for a fixed base classifier $f$ , we cannot directly apply adaptive BN to provide $\ell _ { 2 }$ certification using the randomized smoothing framework. This motivates us to propose a novel certification framework that applies the covariate shift adaptation using adaptive BN as an offline pre-processing step to improve the robustness against random Gaussian noises, addressing the above problem.
|
| 108 |
+
|
| 109 |
+
Our proposed certification through adaptation framework consists of two steps: Given test image $x _ { t e s t }$ , we first apply the adaptive BN technique to achieve robustness against Gaussian perturbations. Recall that adaptive BN requires a large set of diverse test images to correctly re-estimate the batch-normalization statistics. However, to provide certification for $\ell _ { 2 }$ -norm, we only need to adapt our model against Gaussian perturbations. Hence, we can pre-select a sufficiently large set of diverse clean images, ${ \bf X } _ { b a t c h }$ and apply Gaussian perturbations to adapt our classifier, $f$ , as an offline pre-processing step to obtain $f _ { a d a p t }$ . Alternatively, when a large set of diverse test examples are available, we can also use them for our BN adaptation. The Gaussian noise samples should be drawn from the same isotropic Gaussian distribution ${ \mathcal { N } } ( 0 , \sigma ^ { 2 } I )$ as we need to use for the certification process. Then, we freeze the model parameters and use the adapted model, $f _ { a d a p t }$ , as our base classifier to certify the test example, $x _ { t e s t }$ . Hence, the base classifier $f _ { a d a p t }$ remains fixed during calculating the certification radius $R$ (Equation 3). Our proposed certification through adaptation technique is presented in Algorithm 1.
|
| 110 |
+
|
| 111 |
+
Advantages. The main advantage of our proposed framework is that we can adapt the classifier, $f$ at any noise level $\sigma$ as an offline pre-processing step, without any additional training (see Figure 4). As we can see in Equation 3, that we should select a large $\sigma$ to certify at a bigger $\ell _ { 2 }$ radius of $R$ . However, a test image that does not remain robust at higher $\sigma$ produces a lower value of $p _ { A }$ . It leads to reducing the overall certification radius, $R$ . Hence, providing the flexibility of choosing appropriate noise levels for different test examples allows us to improve the certification radius, $R$ .
|
| 112 |
+
|
| 113 |
+
In contrast to our proposed framework, existing randomized smoothing frameworks cannot choose a different $\sigma$ at test-time since it typically degrades their overall certification performance. Hence, they need to fix $\sigma$ during training their base models or its components.
|
| 114 |
+
|
| 115 |
+
Applicability. Our proposed certification through adaptation technique can be applied to any classification model, $f$ with batch-normalization layers. However, note that achieving high accuracy against large random Gaussian perturbations is only a necessary condition: a randomized smoothing classifier, $g$ requires to consistently predict the correct class to provide higher certification guarantees at larger radii. Hence, we achieve non-trivial $\ell _ { 2 }$ certification guarantees at very small $\ell _ { 2 }$ radii for standard non-robust DNN classifiers (see Appendix B.1).
|
| 116 |
+
|
| 117 |
+
On the other hand, for existing randomized smoothing models, we achieve higher certification at larger $\ell _ { 2 }$ radii by adapting their base models with larger $\sigma$ , improving their overall average certified radius $( A C R )$ (Table 6 and 5 (Appendix)). However, we could not find any $\sigma$ to obtain a significant improvement at lower $\ell _ { 2 }$ radii. In contrast, AT models with our proposed offline adaptation technique significantly improve their performance against large Gaussian perturbations, providing non-trivial certification robustness. Experimentally we find that our proposed technique outperforms the state-of-the-art certification models for the $\ell _ { 2 }$ norm.
|
| 118 |
+
|
| 119 |
+
Finally, while we focus on adaptive BN, there also exists other unsupervised covariate shift adaptation techniques such as self-supervised domain adaptation on single test examples (Sun et al., 2020), pseudo-labeling (French et al., 2017; Xie et al., 2020) etc. Wang et al. (2020) also proposed to update the normalization parameters by entropy minimization to improve the corruption robustness. Future studies may also explore these techniques for the offline pre-processing step.
|
| 120 |
+
|
| 121 |
+
# 4 EXPERIMENTS
|
| 122 |
+
|
| 123 |
+
Experimental setup. We use CIFAR-10 (Krizhevsky et al., 2009) and IMAGENET (Deng et al., 2009) datasets for our experiments. For CIFAR-10, we use pre-activation ResNet18 and ResNet50 for IMAGENET (He et al., 2016a;b). Our AT models are trained using early stopping criteria (Rice et al., 2020) as follows: For IMAGENET, we use two AT models, $\bar { \mathrm { A d v } } _ { \infty } [ \ell _ { \infty } \overset { \_ } { \le } 4 / 2 5 5 ]$ and $\mathrm { A d v } _ { 2 } [ \ell _ { 2 } \leq 3 ]$ , learned at $\ell _ { \infty }$ and $\ell _ { 2 }$ threat models with threat boundaries of $4 / 2 5 5$ and 3 respectively. For CIFAR-10, we train multiple AT models with different threat boundaries. For example, we denote $\mathrm { A d v } _ { \infty } [ \ell _ { \infty } \leq 8 / 2 5 5 ]$ and $\mathrm { A d v _ { 2 } } [ \ell _ { 2 } \leq 1 ]$ as the AT models for $\ell _ { \infty }$ and $\ell _ { 2 }$ threat models, trained with threat boundaries of $8 / 2 5 5$ and 1, respectively. We compare with Baseline and $\mathrm { R a n d } _ { \sigma = 0 . 5 }$ models. Baseline models are trained using clean images. $\mathrm { R a n d } _ { \sigma = 0 . 5 }$ models are trained by augmenting random noise, sampled from isotropic Gaussian distribution, ${ \mathcal { N } } ( 0 , \sigma ^ { 2 } I )$ with $\sigma = 0 . 5$ . We also compare with the current state-of-the-art certification models, SmoothAdv for CIFAR-10 (Salman et al., 2019a). Please refer to Appendix A for more details.
|
| 124 |
+
|
| 125 |
+
# 4.1 PERFORMANCE UNDER GAUSSIAN NOISE.
|
| 126 |
+
|
| 127 |
+
We first investigate the performance of different classification models under significantly larger Gaussian perturbations. It is a necessary condition to provide $\ell _ { 2 }$ robustness certification. In Table 2, we present the performance. We observe that when the test examples are sampled from IID settings as training distributions (i.e., $\sigma = 0$ for Baseline, $\mathbf { A d v } _ { \infty }$ , and $\mathrm { \ A d v _ { 2 } }$ and $\sigma = 0 . 5$ for $\mathrm { R a n d } _ { \sigma = 0 . 5 } )$ , these models produces the best results regardless of whether BN adaptation is applied. However, as we move away from the IID settings by increasing (or decreasing) $\sigma$ , the performance of all these models significantly degrades in the standard inference setup. In contrast, covariate shift adaptation using adaptive BN improves the performance for all models. In particular, AT models achieve significantly higher performance gain using adaptive BN than the non-robust baseline models at higher noise levels. For example, at $\sigma = 0 . 5$ , Baseline, $\mathrm { A d v _ { 2 } } [ \ell _ { 2 } \leq 3 ]$ and $\mathrm { A d v } _ { \infty } [ \ell _ { \infty } \leq 4 / 2 5 5 ]$ respectively achieve top-1 accuracy of $0 . 3 \%$ , $0 . 4 \%$ , and $0 . 9 \%$ for IMAGENET without using BN adaptation (Table 2 (a)). However, adaptive BN for $\mathrm { A d v } _ { 2 } [ \ell _ { 2 } \leq 3 ]$ and $\mathrm { A d v } _ { \infty } [ \ell _ { \infty } \leq 4 / 2 5 5 ]$ significantly improves the top-1 accuracy to $4 7 . 3 \%$ and $4 4 . 9 \%$ respectively. In contrast, the baseline model only achieves $7 . 7 \%$ accuracy. We observe similar results for CIFAR-10 in Table 2 (b).
|
| 128 |
+
|
| 129 |
+
<table><tr><td colspan="5">(a) IMAGENET</td></tr><tr><td>Model</td><td>σ=0</td><td>σ=0.25</td><td>σ=0.5</td><td>σ=0.75</td></tr><tr><td>Baseline</td><td>75.2±0.0</td><td>11.8±0.22</td><td>0.3±0.01</td><td>0.1±0.0</td></tr><tr><td>+ adaptive BN</td><td>74.4±0.04</td><td>31.0±0.27</td><td>7.7±0.24</td><td>2.4±0.01</td></tr><tr><td>Advo∞≤4/255]</td><td>62.8±0.0</td><td>3.9±0.03</td><td>0.4±0.01</td><td>0.2±0.01</td></tr><tr><td>+ adaptive BN</td><td>60.8±0.16</td><td>53.4±0.15</td><td>44.9±0.08</td><td>33.7±0.28</td></tr><tr><td>Adv2≤3]</td><td>59.8±0.0</td><td>9.8±0.08</td><td>0.9±0.01</td><td>0.3±0.0</td></tr><tr><td>+adaptive BN</td><td>58.3±0.08</td><td>53.7±0.14</td><td>47.3±0.14</td><td>39.8±0.18</td></tr><tr><td>Rand g=0.5</td><td>22.0±0.0</td><td>32.8±0.11</td><td>60.9±0.04</td><td>0.9±0.06</td></tr><tr><td>+ adaptive BN</td><td>62.7±0.03</td><td>62.3±0.18</td><td>59.5±0.11</td><td>51.4±0.27</td></tr></table>
|
| 130 |
+
|
| 131 |
+
<table><tr><td colspan="5">(b) CIFAR-10</td></tr><tr><td>Model</td><td>σ=0</td><td>g=0.25</td><td>σ=0.5</td><td>g=0.75</td></tr><tr><td>Baseline + adaptive BN</td><td>95.2±0.0</td><td>10.9±0.88</td><td>10.6±0.76</td><td>10.5±1.19</td></tr><tr><td></td><td>95.0±0.57</td><td>40.1±0.97</td><td>22.0±0.83</td><td>17.2±0.66</td></tr><tr><td>Advo≤8/255]</td><td>82.1±0.0</td><td>40.2±4.56</td><td>16.1±7.85</td><td>12.2±5.23</td></tr><tr><td>+ adaptive BN</td><td>81.6±0.96</td><td>74.2±0.95</td><td>62.4±0.64</td><td>51.0±1.03</td></tr><tr><td>Adv2[≤1]</td><td>81.6±0.0</td><td>47.5±5.1</td><td>21.5±7.79</td><td>14.3±5.63</td></tr><tr><td>+ adaptive BN</td><td>81.8±0.7</td><td>75.8±0.43</td><td>64.9±0.73</td><td>53.5±1.71</td></tr><tr><td>Rand g=0.5</td><td>66.7±0.0</td><td>69.1±1.01</td><td>61.2±0.84</td><td>25.9±1.41</td></tr><tr><td>+ adaptive BN</td><td>74.0±2.1</td><td>73.0±2.04</td><td>66.8±2.01</td><td>56.7±0.94</td></tr></table>
|
| 132 |
+
|
| 133 |
+

|
| 134 |
+
Table 2: Top-1 accuracy of different classifiers under different levels of Gaussian noises augmented to the test images. We randomly shuffle test images and sample the noises and report $( m e a n \pm 2 \times s d )$ ) of five runs.
|
| 135 |
+
Figure 1: Visualizing loss-gradients produced by AT models as we apply different levels of Gaussian noises.
|
| 136 |
+
|
| 137 |
+
Loss Gradients under Gaussian Noises. To further investigate the performance of AT models, we visualize the loss gradients for individual pixels of an image as we increase the Gaussian noise (i.e., $\sigma$ ) (Figure 1). Loss-gradients reflect the most relevant input pixels for classification predictions. Here, we scale, translate and clip the loss-gradient values without using any sophisticated techniques (as suggested in Tsipras et al. (2019)). At $\sigma = 0$ (i.e., for clean images), the loss-gradients from AT models align properly with perceptually relevant features (as observed previously (Tsipras et al., 2019; Etmann et al., 2019)). However, as we choose higher noise using $\sigma { = } 0 . 5$ and $\sigma { = } 0 . 7 5$ , the overall loss gradients become noisier. Specifically, AT models without adaptation produce sharper loss gradients (i.e., greater importance) even for background pixels. In contrast, test-time BN adaptation produces gradients for the pixels from the object of interest and suppress the gradients for background pixels (see Figure 1(c) and Figure 1(d)). Hence, they extract the required semantic information for correct classifications. It is interesting to note that $\mathbf { A d v } _ { 2 }$ produces significantly more human-aligned loss gradients compared to $\mathrm { \bf A d v _ { \infty } }$ . This behavior is also reflected in their classification (Table 2) and overall certification (Table 1) as we note that $\mathrm { \bf A d v } _ { 2 }$ overall produces much better performance compared to $\mathbf { A d v } _ { \infty }$ .
|
| 138 |
+
|
| 139 |
+
# 4.2 CERTIFICATION USING RANDOMIZED SMOOTHING
|
| 140 |
+
|
| 141 |
+
We now present the $\ell _ { 2 }$ certification results using the randomized smoothing framework as the backbone, as proposed in our Algorithm 1. We certify the test images with $9 9 . 9 \%$ probability. We estimate the class label probabilities of $g$ (in Equation 3) using Monte-Carlo sampling with 100, 000 noisy samples for each test image, as in Cohen et al. (2019); Salman et al. (2019a). We use the full test-set for CIFAR-10 and a sub-sample of 500 test images for IMAGENET (as in Cohen et al. (2019)). We provide the detailed results of certified accuracy along with average certified radius $( A C R )$ for several models, trained using different specifications and adapting with different $\sigma$ in Table 5 and 6 (Appendix).
|
| 142 |
+
|
| 143 |
+
Certifying AT models. In Figure 2, we first demonstrate that AT models can provide non-trivial $\ell _ { 2 }$ certified robustness using our proposed framework for both IMAGENET and CIFAR-10 datasets. Here, we use $\mathrm { A d v } _ { \infty } [ \ell _ { \infty } \ \le \ 4 / 2 5 5 ]$ and $\mathrm { A d v _ { 2 } } [ \ell _ { 2 } ~ \le ~ 3 ]$ for ImageNet and $\mathrm { A d v } _ { \infty } [ \ell _ { \infty } \ \le \ 8 / 2 5 5 ]$ and $\mathrm { A d v _ { 2 } } [ \ell _ { 2 } ^ { \mathbf { \bar { \rho } } } \leq 1 ]$ for CIFAR-10 and use $\sigma =$ 0.5 for adaptation and certification using Algorithm 1. We compare with the certification results of Baseline, $\mathrm { \bf A d v _ { \infty } }$ and $\mathrm { \bf A d v } _ { 2 }$ models in the standard settings, without using any adaptation and certified at $\sigma = 0 . 2 5$ . We can see a significant boost of $\ell _ { 2 }$ certification results for
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
Figure 2: Certified top-1 accuracy at various $\ell _ { 2 }$ radii for (Left) IMAGENET using ResNet-50 and (Right) CIFAR-10 using preactivation ResNet-18.
|
| 147 |
+
|
| 148 |
+
both $\mathbf { A d v } _ { \infty }$ and $\mathbf { A d v } _ { 2 }$ models using our proposed framework. Further, $\mathrm { \bf A d v _ { 2 } }$ models consistently achieve better performance compared to $\mathrm { \bf A d v _ { \infty } }$ in terms of certified accuracy. For CIFAR-10, both $\mathrm { A d v } _ { \infty } [ \ell _ { \infty } \le 8 / 2 5 5 ]$ and $\Delta \mathrm { d v } _ { 2 } [ \ell _ { 2 } \ \leq \ 1 ]$ outperform the standard randomized smoothing framework i.e., $\mathrm { R a n d } _ { \sigma = 0 . 5 }$ , certified using $\sigma = 0 . 5$ (Cohen et al., 2019). For IMAGENET, $\mathrm { A d v _ { 2 } } \mathrm { [ } \ell _ { 2 } \leq 3 \mathrm { ] }$ achieves better certified accuracy compared to Rand $\sigma { = } 0 . 5$ beyond $\ell _ { 2 }$ -radii of 1.5.
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 3: CIFAR-10: Certified top-1 accuracy achieved by (a) $\mathbf { A d v } _ { \infty }$ and (b) $\mathbf { A d v } _ { 2 }$ models (with test-time adaptive BN at $\sigma \ : = \ : 0 . 5$ ), learned at different threat boundaries. (c) Comparison with the state-of-the-art SmoothAdv models (Salman et al., 2019a), trained at $\sigma = 0 . 5$ using preactivation ResNet-18.
|
| 152 |
+
|
| 153 |
+
Larger Threat Boundary for Better Certified Robustness. Learning AT models at a higher threat boundary improves the certification accuracy at higher $\ell _ { 2 }$ radii. We demonstrate this phenomena for both $\mathbf { A d v } _ { \infty }$ and $\mathrm { \bf A d v } _ { 2 }$ models in Figure 3(a) and 3(b) respectively for CIFAR-10.
|
| 154 |
+
|
| 155 |
+
Figure 3(c) also compares the certified accuracy of $\mathrm { \bf A d v } _ { 2 }$ models with the existing state-of-the-art SmoothAdv models (Salman et al., 2019a). SmoothAdv utilizes adversarial training using an adaptive attack with $\ell _ { 2 }$ threat boundary of $\epsilon$ and Gaussian noises, ${ \mathcal { N } } ( 0 , \sigma ^ { 2 } I )$ (See details in Appendix A). We set the noise to $\sigma = 0 . 5$ and vary $\epsilon$ for their training to compare with different SmoothAdv models in Figure 3(c). By adapting $\mathrm { \bf A d v } _ { 2 }$ models with $\sigma = 0 . 5$ at test-time using our proposed Algorithm 1, we already achieve similar performance as SmoothAdv. Moreover, unlike existing frameworks, we also provide test-time flexibility to adapt the same models using different $\sigma$ , without retraining, to improve their certification, as shown below. 2
|
| 156 |
+
|
| 157 |
+

|
| 158 |
+
Figure 4: Certified accuracy at various $\ell _ { 2 }$ radii by varying $\sigma$ for test-time adaptation of the same models. Choosing large $\sigma$ degrades certification at lower $\ell _ { 2 }$ radii, while provides better performance at higher $\ell _ { 2 }$ radii.
|
| 159 |
+
|
| 160 |
+
Flexibility of choosing different noise-level $\sigma$ for certification at test-time. Figure 4 presents the certification results as we vary $\sigma = \{ 0 . 2 5 , 0 . 5 , 0 . 7 5 \}$ for test-time adaptation of the same models using our Algorithm 1. We note that the choice of large $\sigma$ degrades certification at lower $\ell _ { 2 }$ radii while providing better performance for higher $\ell _ { 2 }$ radii. For each test example, we adapt the models with appropriate $\sigma$ that provides the maximum certified radius to obtain the upper envelope of the certification accuracy curves in Figure 4. This leads to the state-of-the-art certification performance for $\mathbf { A d v } _ { 2 }$ models, outperforming the existing SmoothAdv models for CIFAR-10 (Table 1). Further for randomized smoothing models (Figure 4(c)), we consistently provide certification at larger $\ell _ { 2 }$ radii by adapting using larger $\sigma$ values, improving their overall ACR scores (see Table 6 and 5 (Appendix)). Additional results using several models with different training setups are provided in Figure 7 and 8 (Appendix).
|
| 161 |
+
|
| 162 |
+
Over-fitting reduces Certification. Rice et al. (2020) demonstrate that AT models overfit as we train without early stopping criteria. It degrades their empirical robustness against adversarial attacks. In Figure 5, we compare with the certification accuracy of such overfitted AT models, denoted as $\mathbf { A d v } ^ { o v e r f i t }$ . We observe that $\mathbf { A d v } ^ { o v e r f i t }$ models also degrade the certified robustness, in particular, at higher $\ell _ { 2 }$ radii, compared to their corresponding AT models with early
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 5: CIFAR-10: Comparing the certified accuracy of $\mathbf { A d v } _ { \infty }$ (Left) and $\mathrm { \bf A d v _ { 2 } }$ (Right) models with and without applying early-stopping criteria (denoted as Adv $_ { o v e r f i t }$ ).
|
| 166 |
+
|
| 167 |
+
stopping criteria. These results also indicate that the empirical and certified robustness are closely related: improving empirical robustness also improves the certified robustness.
|
| 168 |
+
|
| 169 |
+
# 5 CONCLUSION
|
| 170 |
+
|
| 171 |
+
We propose a novel certification through adaptation algorithm that transforms adversarially trained models into a randomized smoothing classifier using test-time covariate shift adaptation to provide certified robustness for $\ell _ { 2 }$ norm. Unlike existing models using BN adaptation for different applications, our certification framework does not make any assumptions on the test examples. One main advantage of our proposed certification algorithm is to separately choose appropriate noise levels $\sigma$ during inference for each test example. We achieve the state-of-the-art $\ell _ { 2 }$ certification using $\mathrm { \ A d v _ { 2 } }$ models for CIFAR-10. Finally, while we mainly focus on $\ell _ { 2 }$ certification using Gaussian noise, we can also extend this framework for other types of perturbations as long as randomized smoothing works (e.g., uniform noise for $\ell _ { 1 }$ norm (Yang et al., 2020)) for different applications without any additional training.
|
| 172 |
+
|
| 173 |
+
# 6 CODE OF ETHICS AND REPRODUCIBILITY
|
| 174 |
+
|
| 175 |
+
Code of Ethics. Existing defense models can only provide either empirical or certified robustness against adversarial attacks for higher dimensional input domains. In this paper, we propose a solution to provide high performance to achieve both empirical or certified robustness. It allows us to improve the reliability and trustworthiness for large AI models for sensitive real-world applications.
|
| 176 |
+
|
| 177 |
+
Reproducibility. The key results of our paper are presented using adversarially trained models. For CIFAR-10, we train the models using the codes provided in https://github.com/locuslab/robust overfitting (Rice et al., 2020). For IMAGENET, we obtained the already trained AT models from https://github.com/locuslab/robust overfitting (Rice et al., 2020). Please refer to Appendix A for more details. We have provided the codes for our certification algorithms in the supplementary materials for reproducing the results of our paper.
|
| 178 |
+
|
| 179 |
+
# REFERENCES
|
| 180 |
+
|
| 181 |
+
Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. In ICML, 2018.
|
| 182 |
+
Philipp Benz, Chaoning Zhang, Adil Karjauv, and In So Kweon. Revisiting batch normalization for improving corruption robustness. In WACV, 2021.
|
| 183 |
+
Rudy Bunel, Ilker Turkaslan, Philip HS Torr, Pushmeet Kohli, and M Pawan Kumar. A unified view of piecewise linear neural network verification. NeurIPS, 2018.
|
| 184 |
+
Xiaoyu Cao and Neil Zhenqiang Gong. Mitigating evasion attacks to deep neural networks via region-based classification. In ACSAC, 2017.
|
| 185 |
+
Fabio Maria Cariucci, Lorenzo Porzi, Barbara Caputo, Elisa Ricci, and Samuel Rota Bulo. Autodial: Automatic domain alignment layers. In ICCV, 2017.
|
| 186 |
+
Yair Carmon, Aditi Raghunathan, Ludwig Schmidt, Percy Liang, and John C Duchi. Unlabeled data improves adversarial robustness. arXiv, 2019.
|
| 187 |
+
Jeremy M Cohen, Elan Rosenfeld, and J Zico Kolter. Certified adversarial robustness via randomized smoothing. ICML, 2019.
|
| 188 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009.
|
| 189 |
+
Krishnamurthy Dvijotham, Robert Stanforth, Sven Gowal, Timothy A Mann, and Pushmeet Kohli. A dual approach to scalable verification of deep networks. In UAI, 2018.
|
| 190 |
+
Krishnamurthy (Dj) Dvijotham, Jamie Hayes, Borja Balle, Zico Kolter, Chongli Qin, Andras Gyorgy, Kai Xiao, Sven Gowal, and Pushmeet Kohli. A framework for robustness certification of smoothed classifiers using f-divergences. In ICLR, 2020.
|
| 191 |
+
Logan Engstrom, Andrew Ilyas, Hadi Salman, Shibani Santurkar, and Dimitris Tsipras. Robustness (python library), 2019. URL https://github.com/MadryLab/robustness.
|
| 192 |
+
Christian Etmann, Sebastian Lunz, Peter Maass, and Carola-Bibiane Schonlieb. On the connection ¨ between adversarial robustness and saliency map interpretability. In ICML, 2019.
|
| 193 |
+
Geoffrey French, Michal Mackiewicz, and Mark Fisher. Self-ensembling for visual domain adaptation. arXiv, 2017.
|
| 194 |
+
Timon Gehr, Matthew Mirman, Dana Drachsler-Cohen, Petar Tsankov, Swarat Chaudhuri, and Martin Vechev. Ai2: Safety and robustness certification of neural networks with abstract interpretation. In IEEE SP, 2018.
|
| 195 |
+
Ian Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In ICLR, 2015.
|
| 196 |
+
|
| 197 |
+
Sven Gowal, Krishnamurthy Dvijotham, Robert Stanforth, Rudy Bunel, Chongli Qin, Jonathan Uesato, Relja Arandjelovic, Timothy Mann, and Pushmeet Kohli. On the effectiveness of interval bound propagation for training verifiably robust models. arXiv, 2018.
|
| 198 |
+
|
| 199 |
+
Sven Gowal, Chongli Qin, Jonathan Uesato, Timothy Mann, and Pushmeet Kohli. Unering the limits of adversarial training against norm-bounded adversarial examples. arXiv, 2020.
|
| 200 |
+
|
| 201 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In IEEE CVPR, 2016a.
|
| 202 |
+
|
| 203 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In ECCV, 2016b.
|
| 204 |
+
|
| 205 |
+
Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In ICLR, 2019.
|
| 206 |
+
|
| 207 |
+
Lei Huang, Dawei Yang, Bo Lang, and Jia Deng. Decorrelated batch normalization. In CVPR, 2018.
|
| 208 |
+
|
| 209 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, 2015.
|
| 210 |
+
|
| 211 |
+
Ajil Jalal, Andrew Ilyas, Constantinos Daskalakis, and Alexandros G Dimakis. The robust manifold defense: Adversarial training using generative models. arXiv, 2019.
|
| 212 |
+
|
| 213 |
+
Jongheon Jeong and Jinwoo Shin. Consistency regularization for certified robustness of smoothed classifiers. NeurIPS, 2020.
|
| 214 |
+
|
| 215 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
|
| 216 |
+
|
| 217 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial machine learning at scale. arXiv preprint arXiv:1611.01236, 2016.
|
| 218 |
+
|
| 219 |
+
Mathias Lecuyer, Vaggelis Atlidakis, Roxana Geambasu, Daniel Hsu, and Suman Jana. Certified robustness to adversarial examples with differential privacy. In IEEE SP, 2019.
|
| 220 |
+
|
| 221 |
+
Guang-He Lee, Yang Yuan, Shiyu Chang, and Tommi S Jaakkola. Tight certificates of adversarial robustness for randomly smoothed classifiers. arXiv preprint arXiv:1906.04948, 2019.
|
| 222 |
+
|
| 223 |
+
Bai Li, Changyou Chen, Wenlin Wang, and Lawrence Carin. Certified adversarial robustness with additive noise. NeurIPS, 2019.
|
| 224 |
+
|
| 225 |
+
Yanghao Li, Naiyan Wang, Jianping Shi, Jiaying Liu, and Xiaodi Hou. Revisiting batch normalization for practical domain adaptation. arXiv, 2016.
|
| 226 |
+
|
| 227 |
+
Xuanqing Liu, Minhao Cheng, Huan Zhang, and Cho-Jui Hsieh. Towards robust neural networks via random self-ensemble. In ECCV, 2018.
|
| 228 |
+
|
| 229 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In ICLR, 2018.
|
| 230 |
+
|
| 231 |
+
Chengzhi Mao, Mia Chiquier, Hao Wang, Junfeng Yang, and Carl Vondrick. Adversarial attacks are reversible with natural supervision. arXiv preprint arXiv:2103.14222, 2021.
|
| 232 |
+
|
| 233 |
+
Matthew Mirman, Timon Gehr, and Martin Vechev. Differentiable abstract interpretation for provably robust neural networks. In ICML, 2018.
|
| 234 |
+
|
| 235 |
+
Seyed Mohsen Moosavi Dezfooli, Alhussein Fawzi, Jonathan Uesato, and Pascal Frossard. Robustness via curvature regularization, and vice versa. In CVPR, 2019.
|
| 236 |
+
|
| 237 |
+
Mark Niklas Mueller, Mislav Balunovic, and Martin Vechev. Certify or predict: Boosting certified robustness with compositional architectures. In ICLR, 2021.
|
| 238 |
+
|
| 239 |
+
Zachary Nado, Shreyas Padhy, D Sculley, Alexander D’Amour, Balaji Lakshminarayanan, and Jasper Snoek. Evaluating prediction-time batch normalization for robustness under covariate shift. arXiv, 2020.
|
| 240 |
+
|
| 241 |
+
Jay Nandy, Wynne Hsu, and Mong-Li Lee. Approximate manifold defense against multiple adversarial perturbations. In IJCNN, 2020.
|
| 242 |
+
|
| 243 |
+
Tianyu Pang, Xiao Yang, Yinpeng Dong, Hang Su, and Jun Zhu. Bag of tricks for adversarial training. In ICLR, 2021. URL https://openreview.net/forum?id $\equiv$ Xb8xvrtB8Ce.
|
| 244 |
+
|
| 245 |
+
Chongli Qin et al. Adversarial robustness through local linearization. In NeurIPS, 2019.
|
| 246 |
+
|
| 247 |
+
Aditi Raghunathan, Jacob Steinhardt, and Percy Liang. Certified defenses against adversarial examples. ICLR, 2018.
|
| 248 |
+
|
| 249 |
+
Leslie Rice, Eric Wong, and Zico Kolter. Overfitting in adversarially robust deep learning. In ICML, 2020.
|
| 250 |
+
|
| 251 |
+
Subhankar Roy, Aliaksandr Siarohin, Enver Sangineto, Samuel Rota Bulo, Nicu Sebe, and Elisa Ricci. Unsupervised domain adaptation using feature-whitening and consensus loss. In CVPR, 2019.
|
| 252 |
+
|
| 253 |
+
Hadi Salman, Jerry Li, Ilya Razenshteyn, Pengchuan Zhang, Huan Zhang, Sebastien Bubeck, and Greg Yang. Provably robust deep learning via adversarially trained smoothed classifiers. In NeurIPS, 2019a.
|
| 254 |
+
|
| 255 |
+
Hadi Salman, Greg Yang, Huan Zhang, Cho-Jui Hsieh, and Pengchuan Zhang. A convex relaxation barrier to tight robustness verification of neural networks. In NeurIPS, 2019b.
|
| 256 |
+
|
| 257 |
+
Hadi Salman, Mingjie Sun, Greg Yang, Ashish Kapoor, and J Zico Kolter. Denoised smoothing: A provable defense for pretrained classifiers. NeurIPS, 2020.
|
| 258 |
+
|
| 259 |
+
Steffen Schneider, Evgenia Rusak, Luisa Eck, Oliver Bringmann, Wieland Brendel, and Matthias Bethge. Improving robustness against common corruptions by covariate shift adaptation. NeurIPS, 2020.
|
| 260 |
+
|
| 261 |
+
Bernhard Scholkopf, Dominik Janzing, Jonas Peters, Eleni Sgouritsa, Kun Zhang, and Joris Mooij. ¨ On causal and anticausal learning. arXiv preprint arXiv:1206.6471, 2012.
|
| 262 |
+
|
| 263 |
+
Lukas Schott, Jonas Rauber, Matthias Bethge, and Wieland Brendel. Towards the first adversarially robust neural network model on MNIST. In ICLR, 2019.
|
| 264 |
+
|
| 265 |
+
Fatemeh Sheikholeslami, Ali Lotfi, and J Zico Kolter. Provably robust classification of adversarial examples with detection. In ICLR, 2021.
|
| 266 |
+
|
| 267 |
+
Masashi Sugiyama and Motoaki Kawanabe. Machine learning in non-stationary environments: Introduction to covariate shift adaptation. MIT press, 2012.
|
| 268 |
+
|
| 269 |
+
Baochen Sun, Jiashi Feng, and Kate Saenko. Correlation alignment for unsupervised domain adaptation. In Domain Adaptation in Computer Vision Applications, pp. 153–171. Springer, 2017.
|
| 270 |
+
|
| 271 |
+
Yu Sun, Xiaolong Wang, Zhuang Liu, John Miller, Alexei Efros, and Moritz Hardt. Test-time training with self-supervision for generalization under distribution shifts. In ICML, 2020.
|
| 272 |
+
|
| 273 |
+
Christian Szegedy et al. Intriguing properties of neural networks. In ICLR, 2014.
|
| 274 |
+
|
| 275 |
+
Vincent Tjeng, Kai Xiao, and Russ Tedrake. Evaluating robustness of neural networks with mixed integer programming. ICLR, 2017.
|
| 276 |
+
|
| 277 |
+
Florian Tramer and Dan Boneh. Adversarial training and robustness for multiple perturbations. In \` NeurIPS, 2019.
|
| 278 |
+
|
| 279 |
+
Dimitris Tsipras, Shibani Santurkar, Logan Engstrom, Alexander Turner, and Aleksander Madry. Robustness may be at odds with accuracy. In ICLR, 2019.
|
| 280 |
+
|
| 281 |
+
Jonathan Uesato, Brendan O’Donoghue, Aaron van den Oord, and Pushmeet Kohli. Adversarial risk and the dangers of evaluating against weak attacks. ICML, 2018.
|
| 282 |
+
|
| 283 |
+
Jonathan Uesato, Jean-Baptiste Alayrac, Po-Sen Huang, Robert Stanforth, Alhussein Fawzi, and Pushmeet Kohli. Are labels required for improving adversarial robustness? arXiv, 2019.
|
| 284 |
+
|
| 285 |
+
Dequan Wang, Evan Shelhamer, Shaoteng Liu, Bruno Olshausen, and Trevor Darrell. Tent: Fully test-time adaptation by entropy minimization. arXiv, 2020.
|
| 286 |
+
|
| 287 |
+
Shiqi Wang, Kexin Pei, Justin Whitehouse, Junfeng Yang, and Suman Jana. Efficient formal safety analysis of neural networks. In NeurIPS, 2018.
|
| 288 |
+
|
| 289 |
+
Lily Weng, Huan Zhang, Hongge Chen, Zhao Song, Cho-Jui Hsieh, Luca Daniel, Duane Boning, and Inderjit Dhillon. Towards fast computation of certified robustness for relu networks. In ICML, 2018.
|
| 290 |
+
|
| 291 |
+
Eric Wong and Zico Kolter. Provable defenses against adversarial examples via the convex outer adversarial polytope. In ICML, 2018.
|
| 292 |
+
|
| 293 |
+
Eric Wong, Frank R Schmidt, Jan Hendrik Metzen, and J Zico Kolter. Scaling provable adversarial defenses. NeurIPS, 2018.
|
| 294 |
+
|
| 295 |
+
Eric Wong, Leslie Rice, and J Zico Kolter. Fast is better than free: Revisiting adversarial training. ICLR, 2020.
|
| 296 |
+
|
| 297 |
+
Qizhe Xie, Minh-Thang Luong, Eduard Hovy, and Quoc V Le. Self-training with noisy student improves imagenet classification. In CVPR, 2020.
|
| 298 |
+
|
| 299 |
+
Greg Yang, Tony Duan, Edward Hu, Hadi Salman, Ilya Razenshteyn, and Jerry Li. Randomized smoothing of all shapes and sizes. arXiv, 2020.
|
| 300 |
+
|
| 301 |
+
Runtian Zhai, Chen Dan, Di He, Huan Zhang, Boqing Gong, Pradeep Ravikumar, Cho-Jui Hsieh, and Liwei Wang. Macer: Attack-free and scalable robust training via maximizing certified radius. In ICLR, 2020.
|
| 302 |
+
|
| 303 |
+
Hongyang Zhang et al. Theoretically principled trade-off between robustness and accuracy. In ICML, 2019.
|
| 304 |
+
|
| 305 |
+
Jingfeng Zhang, Xilie Xu, Bo Han, Gang Niu, Lizhen Cui, Masashi Sugiyama, and Mohan Kankanhalli. Attacks which do not kill training make adversarial learning stronger. In ICML. PMLR, 2020.
|
| 306 |
+
|
| 307 |
+
# APPENDIX ORGANIZATION
|
| 308 |
+
|
| 309 |
+
• Section A: Experimental setup. • Section B: Additional Results on Certification. • Section C:Performance against different corruptions
|
| 310 |
+
|
| 311 |
+
A EXPERIMENTAL SETUP
|
| 312 |
+
|
| 313 |
+
# A.1 IMPLEMENTATION DETAILS
|
| 314 |
+
|
| 315 |
+
We present our experimental results on CIFAR-10 (Krizhevsky et al., 2009) and IMAGENET (Deng et al., 2009) datasets. The descriptions of different models and training hyper-parameters are provided in the following:
|
| 316 |
+
|
| 317 |
+
# A.1.1 CIFAR-10.
|
| 318 |
+
|
| 319 |
+
We use pre-activation ResNet18 architecture (He et al., 2016b) for our experiments on CIFAR-10. We apply the SGD optimizer with a batch size of 128. We execute a total of 200 training epochs and apply a step-wise learning rate decay set initially at 0.1 and divided by 10 at 100 and 150 epochs, and weight decay $5 \times 1 0 ^ { - 4 }$ .
|
| 320 |
+
|
| 321 |
+
AT models (Madry et al., 2018; Rice et al., 2020): Unless and otherwise specified, our AT models are learned using early stopping criteria as described in (Rice et al., 2020). We learn several AT models with different threat boundaries for our experiments. We denote them by specifying their corresponding threat model and threat boundaries. For example, $\mathrm { A d v } _ { 2 } [ \ell _ { 2 } \ \leq \ 1 . 5 ]$ denotes an AT model that is learned using PGD adversary with $\ell _ { 2 }$ threat model and a threat boundary of $\epsilon = 1 . 5$ , along with early-stopping criteria (Rice et al., 2020). We also learn AT models without using earlystopping criteria, as in (Madry et al., 2018) for our comparison in Figure 5. These models are denoted as Advoverf it.
|
| 322 |
+
|
| 323 |
+
We use projected gradient descent $( P G D )$ adversarial attack (Madry et al., 2018) to train these AT models as follows: For $\mathrm { \bf A d v _ { \infty } }$ , we use 10 iterations and an $\ell _ { \infty }$ step size of $\epsilon / 4$ . For $\mathrm { \ A d v _ { 2 } }$ , we use 10 iterations and an $\ell _ { 2 }$ step size of $\epsilon / 8 . 5 $ . This is the same experimental setup as in (Rice et al., 2020)). We choose a small set of $1 , 0 0 0$ images from the CIFAR-10 test set for our validation. We apply the PGD attack with the same hyper-parameters for our validation during training. We save the best model using the early-stopping criteria (Rice et al., 2020).
|
| 324 |
+
|
| 325 |
+
Randomized smoothing model by Cohen et al. (2019): We also train $\mathrm { R a n d } _ { \sigma = 0 . 5 }$ by training with augmented random noise, sampled from an isotropic Gaussian distribution ${ \mathcal { N } } ( 0 , \sigma ^ { 2 } I )$ with $\sigma = 0 . 5$ . Here, we keep the same model architecture, learning rates, batch sizes, and other hyper-parameters as used to learn the AT models.
|
| 326 |
+
|
| 327 |
+
Randomized smoothing model by Salman et al. (2019a): We also compare with the state-ofthe-art certification models, called ‘SmoothAdv’, by Salman et al. (2019a) for our experiments on $\ell _ { 2 }$ certification We train the SmoothAdv models by choosing random noise vectors followed by an adaptive adversarial attack with specified $\ell _ { 2 }$ threat boundary of $\epsilon$ at each iteration. The noise vectors are sampled from an isotropic Gaussian distribution $\mathcal { N } ( 0 , \bar { \sigma } ^ { 2 } I )$ .
|
| 328 |
+
|
| 329 |
+
We note that the training hyper-parameter $\epsilon$ has the most significant impact on the certification curve for a SmoothAdv model (please refer to Table 7-15 of (Salman et al., 2019a) for more details). For our experiments, we train 4 different SmoothAdv models with $\epsilon =$ $\{ 0 . 2 5 , 0 . 5 , 1 , 2 \}$ and $\sigma ~ = ~ 0 . 5$ using adaptive PGD attack with 10 steps. We denote them as SmoothAd $\scriptstyle v _ { \sigma = 0 . 5 , \epsilon = 0 . 2 5 }$ , $\mathrm { S m o o t h A d v } _ { \sigma = 0 . 5 , \epsilon = 0 . 5 }$ , $\mathrm { S m o o t h A d v } _ { \sigma = 0 . 5 , \epsilon = 1 }$ and SmoothAd $\scriptstyle { \mathrm { \mathbf { U } } } _ { \sigma = 0 . 5 , \epsilon = 2 }$ respectively. We use the same training set-up and other hyper-parameters as specified in their Github: https://github.com/Hadisalman/smoothing-adversarial.
|
| 330 |
+
|
| 331 |
+
# A.1.2 IMAGENET.
|
| 332 |
+
|
| 333 |
+
We use ResNet50 architecture (He et al., 2016a) for IMAGENET. We obtain the Baseline and $\mathrm { R a n d } _ { \sigma = 0 . 5 }$ models from (Cohen et al., $2 0 1 9 ) ^ { 3 }$ . These models are trained using Gaussian augmented noises, sampled from isotropic Gaussian distribution ${ \mathcal { N } } ( 0 , \sigma ^ { 2 } I )$ with $\sigma = 0 . 0$ (i.e., no noise) and $\sigma = 0 . 5$ respectively.
|
| 334 |
+
|
| 335 |
+
The AT models i.e., $\mathrm { A d v } _ { \infty } [ \ell _ { \infty } \leq 4 / 2 5 5 ]$ and $\mathrm { A d v } _ { 2 } [ \ell _ { 2 } \leq 3 ]$ are learned for $\ell _ { \infty }$ and $\ell _ { 2 }$ threat models with threat boundary of $4 / 2 5 5$ and 3, respectively. We use the publicly available models provided by Rice et al. (2020) 4. These models are fine-tuned using PGD-based adversarial training with early stopping criteria, originally provided by Engstrom et al. (2019) 5.
|
| 336 |
+
|
| 337 |
+
We resize the input images to $2 5 6 \times 2 6 5$ pixels and crop $2 2 4 \times 2 2 4$ pixels from the center. For our experiments on certification, we use a set of 500 test images by choosing at most 1 sample for each class.
|
| 338 |
+
|
| 339 |
+
# A.2 CHOICE OF TEST-TIME ADAPTIVE BN HYPER-PARAMETERS
|
| 340 |
+
|
| 341 |
+
BN adaptation technique is controlled by two hyper-parameters, i.e., the test batch-size and momentum $( \rho )$ (see Equation 5) to update the statistics of the batch-normalization layers. Assuming that the test images are obtained independently from the same test distribution, we can efficiently compute the BN statistics from these images. The hyper-parameter $\rho \in [ 0 , 1 ]$ controls the tread-off between pre-computed training statistics and test statistics. We can obtain a better estimation of the test distribution from a large test batch. Hence, we can choose a higher value of $\rho$ .
|
| 342 |
+
|
| 343 |
+
Here, we compare the top-1 test accuracy of AT models under Gaussian augmented noise with $\sigma = 0 . 5$ for different choices of $\rho$ and the batch size. We skip the standard baseline models from our analysis and refer to the previous works (Schneider et al., 2020; Nado et al., 2020) that analyzed the effects of these hyper-parameters for the standard baseline DNN classifiers.
|
| 344 |
+
|
| 345 |
+
<table><tr><td colspan="3">(b) CIFAR-10</td></tr><tr><td>p</td><td>Advo</td><td>Adv2</td></tr><tr><td>0.0 (No adaptation)</td><td>16.1±7.85</td><td>21.5±7.79</td></tr><tr><td>0.1</td><td>45.1±0.49</td><td>46.9±0.48</td></tr><tr><td>0.3</td><td>59.2±0.42</td><td>60.8±0.33</td></tr><tr><td>0.5</td><td>62.4±0.27</td><td>64.4±0.6</td></tr><tr><td>0.7</td><td>62.8±0.52</td><td>64.9±0.31</td></tr><tr><td>0.9</td><td>62.8±0.71</td><td>64.9±0.31</td></tr><tr><td>1.0 (Full adaptation)</td><td>62.4±0.64</td><td>64.9±0.73</td></tr></table>
|
| 346 |
+
|
| 347 |
+
Table 3: Top-1 accuracy using fixed test batch-size $= 5 1 2$ for AT models under Gaussian augmented noise with $\sigma = 0 . 5$ for different choices of momentum, $\rho$ during inference. We randomly shuffle the test images to report $( m e a n + 2 \times s d )$ of 5 different runs.
|
| 348 |
+
|
| 349 |
+
<table><tr><td colspan="3">(a)IMAGENET</td></tr><tr><td>p</td><td>Advo</td><td>Adv2</td></tr><tr><td>0.0 (No adaptation)</td><td>0.4±0.01</td><td>0.9±0.01</td></tr><tr><td>0.1</td><td>2.1±0.04</td><td>7.7±0.09</td></tr><tr><td>0.3</td><td>20.6±0.16</td><td>36.6±0.09</td></tr><tr><td>0.5</td><td>41.1±0.09</td><td>45.5±0.13</td></tr><tr><td>0.7</td><td>43.5±0.14</td><td>46.7±0.13</td></tr><tr><td>0.9</td><td>44.2±0.12</td><td>46.8±0.13</td></tr><tr><td>1.0 (Full adaptation)</td><td>44.8±0.13</td><td>47.2±0.14</td></tr></table>
|
| 350 |
+
|
| 351 |
+
Momentum $( \rho )$ . We first investigate the effect of momentum $( \rho )$ as we choose a large batch size of 512. In Table 3, we present the performance of AT models for different values of $\rho$ . Recall that, $\rho = 1$ denotes full adaptation (Equation 5). Here, we completely ignore the training statistics and recompute the BN statistics using the test batches. In contrast, $\rho = 0$ represents no adaptation, i.e., the same as the standard ‘deterministic’ inference setup. In this case, we use the previously computed BN statistics obtained during training.
|
| 352 |
+
|
| 353 |
+
We observe that for IMAGENET (Table 3 [Left]) the performance started converging at $\rho = 0 . 7$ . For CIFAR-10 (Table 3 [Right]), the convergence started even earlier at $\rho = 0 . 5$ .
|
| 354 |
+
|
| 355 |
+
Batch Size. Next, we investigate the minimum size of the test batches to choose $\rho = 1$ (i.e., fulladaptation). In Table 4, we fix $\rho = 1$ and vary the test batch sizes as we evaluate these AT models. We observe that the performance of these models started improving even when we are using the test batches of size 8. The performance further improves as we choose larger sizes of test batches. We can see that their performance started converging as we choose the test batches of size 64 for IMAGENET. On the other hand, the convergence started much earlier for CIFAR-10.
|
| 356 |
+
|
| 357 |
+
<table><tr><td colspan="3">(b) CIFAR-10</td></tr><tr><td>Batch Size</td><td>Advo</td><td>Adv2</td></tr><tr><td>w/o BNadapt</td><td>16.1±7.85</td><td>21.5±7.79</td></tr><tr><td>8</td><td>57.2±1.23</td><td>59.5±0.38</td></tr><tr><td>16</td><td>60.2±0.79</td><td>62.3±0.87</td></tr><tr><td>32</td><td>61.5±0.46</td><td>63.6±0.55</td></tr><tr><td>64</td><td>62.3±0.5</td><td>64.0±0.38</td></tr><tr><td>128</td><td>62.7±0.68</td><td>64.4±0.53</td></tr><tr><td>256</td><td>62.7±0.68</td><td>64.9±0.48</td></tr><tr><td>512</td><td>62.4±0.64</td><td>64.9±0.73</td></tr></table>
|
| 358 |
+
|
| 359 |
+
Table 4: Top-1 accuracy using fixed $\rho = 1$ for AT models under Gaussian augmented noise with $\sigma = 0 . 5$ for different size of test batches during inference. We randomly shuffle the test images to report $( m e a n + 2 \times s . d . )$ of 5 different runs.
|
| 360 |
+
|
| 361 |
+
<table><tr><td colspan="3">(a)IMAGENET</td></tr><tr><td>Batch Size</td><td>Advo</td><td>Adv2</td></tr><tr><td>w/oBNadapt</td><td>0.4±0.01</td><td>0.9±0.01</td></tr><tr><td>8</td><td>11.5±0.22</td><td>9.1±0.15</td></tr><tr><td>16</td><td>28.1±0.22</td><td>26.7±0.14</td></tr><tr><td>32</td><td>37.1±0.24</td><td>37.6±0.2</td></tr><tr><td>64</td><td>41.4±0.26</td><td>42.9±0.12</td></tr><tr><td>128</td><td>43.3±0.15</td><td>45.4±0.13</td></tr><tr><td>256</td><td>44.4±0.21</td><td>46.7±0.07</td></tr><tr><td>512</td><td>44.8±0.13</td><td>47.2±0.14</td></tr></table>
|
| 362 |
+
|
| 363 |
+
# B ADDITIONAL RESULTS ON CERTIFICATION
|
| 364 |
+
|
| 365 |
+

|
| 366 |
+
Figure 6: $\ell _ { 2 }$ Certification for standard non-robust classifiers. For CIFAR-10, we observe that, even after adaptation, the baseline produces lower certification compared to $\mathrm { A d v _ { 2 } } [ \ell _ { 2 } \leq 1 ]$ model without any adaptation.
|
| 367 |
+
|
| 368 |
+
# B.1 $\ell _ { 2 }$ CERTIFICATION FOR STANDARD NON-ROBUST CLASSIFIERS
|
| 369 |
+
|
| 370 |
+
In Figure 6, we present the $\ell _ { 2 }$ certification results for standard non-robust classification models using our proposed Algorithm 1. In Table 2, we note that the adaptive BN technique can also significantly improve the performance of a non-robust model at lower noise levels, $\sigma$ . In particular, for CIFAR-10 dataset, Baseline models using adaptation achieve similar performance as $\mathrm { A d v _ { 2 } } [ \ell _ { 2 } \leq$ 1] without BN adaptation, while produces significantly lower $\ell _ { 2 }$ certification robustness. This is because, Baseline models, even after adaptation cannot consistently predict the same class to provide higher certified robustness at larger $\ell _ { 2 }$ radii. As a result, we can only improve the certified robustness at smaller $\ell _ { 2 }$ radii.
|
| 371 |
+
|
| 372 |
+

|
| 373 |
+
Figure 7: IMAGENET: Certified top-1 accuracy at various $\ell _ { 2 }$ radii as we vary the noise-level, $\sigma$ at test-time using proposed Algorithm 1. $\mathbf { A d v } _ { \infty }$ and $\mathbf { A d v } _ { 2 }$ models are as defined in experimental set-up (section 4). Refer to Table 5 for complete results of all models and different settings.
|
| 374 |
+
|
| 375 |
+

|
| 376 |
+
Figure 8: CIFAR-10: Certified top-1 accuracy at various $\ell _ { 2 }$ radii as we vary the noise-level, $\sigma$ at test-time using proposed Algorithm 1. Refer to Table 6 for complete results of all models and different settings.
|
| 377 |
+
|
| 378 |
+
<table><tr><td></td><td></td><td></td><td colspan="3">IMAGENET</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Model</td><td>BN adaption</td><td>Certification</td><td colspan="3">0.5</td><td colspan="3">l2 Radius 1.25</td><td>1.75</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td>0.25</td><td></td><td>0.75</td><td>1.0</td><td>1.5</td><td></td><td>2.0</td><td>2.25</td><td>2.5</td><td>2.75</td><td>ACR</td></tr><tr><td>Baseline</td><td>=</td><td>atσ=0.25</td><td>7.8</td><td>4.8</td><td>3.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0 0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>1 0.054</td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Advo[l∞o ≤4/255]</td><td>at σ = 0.25 at σ = 0.50</td><td>at g = 0.25</td><td>50.0</td><td>46.4</td><td>41.6</td><td>0.0 0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.445 0.607</td></tr><tr><td></td><td>at σ=0.75</td><td>at σ = 0.50 at σ=0.75</td><td>43.6 31.6</td><td>39.4</td><td>35.8</td><td>31.4 27.6</td><td>23.4</td><td>18.2</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.443</td></tr><tr><td></td><td></td><td></td><td></td><td>26.4</td><td>22.4</td><td>18.6 16.8</td><td>14.4</td><td>11.8</td><td>9.4</td><td>7.6</td><td>5.6</td><td>3.6</td><td></td></tr><tr><td>Advo[loo≤4/255]+adapt[BestRadij(Ours)</td><td></td><td></td><td>50.0</td><td>46.4</td><td>41.6</td><td>31.4 27.6</td><td>23.4</td><td>18.2</td><td>9.4</td><td>7.6</td><td>5.6</td><td>3.6</td><td>0.759</td></tr><tr><td></td><td>at σ = 0.25</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>0.480</td></tr><tr><td>Adv2[l2 ≤3.00]</td><td>at σ= 0.50</td><td>at σ = 0.25</td><td>53.2 47.0</td><td>50.2 43.0</td><td>46.8 39.0</td><td>0.0 0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.711</td></tr><tr><td></td><td>at σ=0.75</td><td>at g = 0.50 at g=0.75</td><td>37.8</td><td>32.2</td><td></td><td>36.4 32.8</td><td>30.8 20.2</td><td>27.0</td><td>0.0</td><td>0.0 14.2</td><td>0.0 12.0</td><td>0.0 9.6</td><td>0.639</td></tr><tr><td>Adv2l2≤3.00] +adapt[Best Radii](Ours)</td><td></td><td></td><td>53.2</td><td></td><td>28.4</td><td>26.0 22.4 32.8</td><td>30.8</td><td>19.0 27.0</td><td>17.4 17.4</td><td>14.2</td><td>12.0</td><td>9.6</td><td>0.930</td></tr><tr><td></td><td></td><td></td><td></td><td>50.2</td><td>46.8</td><td>36.4</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Randg=0.5 Cohen et al. (2019)</td><td>=</td><td>at σ=0.50</td><td>60.8</td><td>54.4</td><td>47.8</td><td>39.0</td><td>34.2 29.0</td><td>23.8</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.809</td></tr><tr><td></td><td>at σ = 0.25</td><td>at g = 0.25</td><td>59.8</td><td>53.6</td><td>46.6</td><td>0.0 0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.507</td></tr><tr><td> + adaptation</td><td>at σ= 0.50</td><td>at σ= 0.50</td><td>58.6</td><td>51.0</td><td>43.8</td><td>37.4</td><td>32.2 27.4</td><td>22.4</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.0</td><td>0.768</td></tr><tr><td></td><td>at σ=0.75</td><td>at σ=0.75</td><td>48.6</td><td>41.6</td><td>36.6</td><td>31.2</td><td>26.2 22.4</td><td>18.6</td><td>16.8</td><td>12.8</td><td>8.6</td><td>5.4</td><td>0.720</td></tr><tr><td>Randg=0.5+adapt[BestRadii](Ours)</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>22.4</td><td>16.8</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td></td><td></td><td>59.8</td><td>53.6</td><td>46.6</td><td>37.4</td><td>32.2</td><td>27.4</td><td></td><td>12.8</td><td>8.6</td><td>5.4</td><td>0.973</td></tr></table>
|
| 379 |
+
|
| 380 |
+
Table 5: IMAGENET: Certified top-1 accuracy at various $\ell _ { 2 }$ radii as we vary $\sigma$ for BN adaptation and certification along with average certified radii (ACR). We use ResNet50 for IMAGENET. Each gray block is corresponding to one classification model while the rows are corresponding to its certification performances as we choose different noise levels for adaptations and certifications. The Best Radii are obtained by selecting the highest radius for each test example as we adapt the models with different noise levels, $\sigma$ .
|
| 381 |
+
|
| 382 |
+
<table><tr><td colspan="4"></td><td colspan="8">CIFAR-10</td></tr><tr><td>Model</td><td>BN adaption</td><td>Certification</td><td>0.25</td><td>0.5</td><td>0.75</td><td>l2Radius 1.0 1.25</td><td>1.5</td><td>1.75</td><td>2.0</td><td>ACR</td></tr><tr><td colspan="7">Baseline</td><td>0.0 0.0</td><td>0.0</td><td>0.0 0.0</td><td></td><td>0.026</td></tr><tr><td>Advo[∞ ≤ 4/255]</td><td>at σ = 0.25 at σ = 0.50 at σ = 0.75</td><td>at σ = 0.25 at σ = 0.50 at σ = 0.75</td><td>67.96 47.34 26.89</td><td>50.46 31.83 15.92</td><td>31.96 18.78 8.44</td><td>0.0 9.98 4.31</td><td>0.0 4.44 2.03</td><td>0.0 1.62 0.28 0.79 0.23</td><td>0.0 0.0 0.0</td><td>0.08</td><td>0.485 0.350 0.146</td></tr><tr><td>Advo[lo ≤8/255]</td><td>at σ =0.25 at σ = 0.50 at σ =0.75</td><td>at g =0.25 at σ = 0.50 at σ =0.75</td><td>66.43 53.65 39.96</td><td>55.06 42.91 30.76</td><td>42.86 32.58 22.01</td><td>0.0 22.68 14.64</td><td>0.0 14.24 8.84</td><td>0.0 7.88 4.81</td><td>0.0 2.94</td><td>0.0 0.0 1.15</td><td>0.527 0.515 0.352</td></tr><tr><td>Advoo[∞ ≤12/255]</td><td>atσ =0.25 at σ = 0.50 at σ = 0.75</td><td>at σ= 0.25 at σ = 0.50 atσ=0.75</td><td>60.52 51.53 42.61</td><td>52.42 43.94 35.56</td><td>43.27 36.41 28.47</td><td>0.0 28.69 22.39</td><td>0.0 21.25 16.69</td><td>0.0 14.53</td><td>2.29 0.0 8.03</td><td>0.0 0.0 4.43</td><td>0.499 0.581 0.482</td></tr><tr><td>Adv[l∞o ≤ 16/255]</td><td>at σ =0.25 at σ = 0.50 at σ =0.75</td><td>atg=0.25 at σ = 0.50 atσ =0.75</td><td>53.75 48.07 42.05 67.96</td><td>47.57 42.51 36.42 55.06</td><td>41.18 36.54 31.24 43.27</td><td>0.0 30.55 26.05 30.55</td><td>0.0 24.68 20.74</td><td>11.58 0.0 18.49 16.15 12.01</td><td>7.42 0.0 12.11</td><td>0.0 0.0 8.45</td><td>0.454 0.598 0.557 0.903</td></tr><tr><td colspan="8">Advo + adapt [Best Radii] (Ours) 24.68</td><td colspan="3">18.49 12.11 8.45 0.0</td></tr><tr><td>Adv2[l2 ≤0.50]</td><td>at σ = 0.25 at σ = 0.50 atg =0.75</td><td>at σ = 0.25 at σ = 0.50 atσ =0.75</td><td>68.84 48.81 27.38</td><td>54.04 33.82 16.15</td><td>37.13 20.95 9.23</td><td>0.0 11.5 4.56</td><td>0.0 5.64 2.06</td><td>0.0 2.29 0.62 0.91 0.33</td><td>0.0 0.0 0.08</td><td></td><td>0.518 0.382 0.153</td></tr><tr><td>Adv2[l2 ≤ 1.00]</td><td>at σ = 0.25 atσ =0.50 atσ =0.75</td><td>at σ = 0.25 at σ = 0.50 atg =0.75</td><td>68.02 56.45 43.04</td><td>58.54 46.24 33.08</td><td>46.98 35.6 24.81</td><td>0.0 26.89 17.68</td><td>0.0 18.73 11.39</td><td>0.0 11.37 6.6</td><td>0.0 5.41 3.57</td><td>0.0 0.0 1.95</td><td>0.551 0.580 0.405</td></tr><tr><td>Adv2[l2 ≤1.25]</td><td>at g =0.25 at σ =0.50 atσ =0.75</td><td>at σ= 0.25 at σ = 0.50 at σ = 0.75</td><td>67.13 57.73 46.54</td><td>58.77 48.8 37.53</td><td>49.43 39.64 29.35</td><td>0.0 31.07 22.0</td><td>0.0 22.61 15.62</td><td>0.0 15.82 10.51</td><td>0.0 8.96 6.55</td><td>0.0 0.0 3.68</td><td>0.557 0.647 0.496</td></tr><tr><td> Adv2[l2 ≤ 1.50]</td><td>at σ = 0.25 at σ =0.50 at σ=0.75</td><td>at g = 0.25 at σ = 0.50 atg =0.75</td><td>64.21 56.55 47.73</td><td>57.13 49.19 40.89</td><td>49.71 41.72 33.78</td><td>0.0 34.47 27.22</td><td>0.0 27.36 20.78</td><td>0.0 20.23 15.19</td><td>0.0 12.98 10.51</td><td>0.0 0.0 6.77</td><td>0.543 0.689 0.585</td></tr><tr><td>Adv2[l2 ≤ 2.00]</td><td>at σ= 0.25 at σ =0.50 at σ =0.75</td><td>at σ = 0.25 at σ = 0.50 at σ = 0.75</td><td>60.4 54.27 47.96</td><td>54.71 48.89 42.54</td><td>48.35 43.1 37.04</td><td>0.0 37.34 31.65</td><td>0.0 31.52 26.17</td><td>0.0 25.74 21.12</td><td>0.0 19.14 16.59</td><td>0.0 0.0 12.44</td><td>0.523 0.731 0.698</td></tr><tr><td> Adv2[l2 ≤ 2.25]</td><td>at σ = 0.25 at σ = 0.50 at σ = 0.75</td><td>atg=0.25 at σ = 0.50 at σ = 0.75</td><td>57.08 52.1 46.45</td><td>52.5 46.99 41.71</td><td>47.11 42.26 36.75</td><td>0.0 36.9 31.88</td><td>0.0 31.58 26.95</td><td>0.0 26.08 22.33</td><td>0.0 20.03 17.82</td><td>0.0 0.0 13.55</td><td>0.504 0.724 0.713</td></tr><tr><td>Adv2[l2 ≤ 2.50]</td><td>at σ =0.25 at σ = 0.50 atσ=0.75</td><td>at σ = 0.25 at σ = 0.50 at σ =0.75</td><td>54.88 50.53 45.95</td><td>50.79 46.26 41.89</td><td>46.29 41.84 37.53</td><td>0.0 37.74 33.55</td><td>0.0 33.2 29.31</td><td>0.0 28.69 25.27</td><td>0.0 23.34 20.98</td><td>0.0 0.0 17.28</td><td>0.487 0.734 0.765</td></tr><tr><td>Adv2[2 ≤ 3.00]</td><td>at σ =0.25 atσ =0.50 at σ = 0.75</td><td>at σ =0.25 at σ = 0.50 atσ =0.75</td><td>53.82 49.41 45.37</td><td>49.69 45.57 41.54</td><td>45.04 41.52 37.75</td><td>0.0 37.43 33.49</td><td>0.0 33.37 29.35</td><td>0.0 28.82 25.62</td><td>0.0 23.65 21.83</td><td>0.0 0.0 18.23</td><td>0.475 0.720 0.771 1.198</td></tr><tr><td colspan="10">Adv2+adapt[Best Radii](Ours) 68.84 58.77</td></tr><tr><td>Randg=0.5</td><td></td><td>at g= 0.50 at σ = 0.25</td><td>51.68 62.91</td><td>40.38 52.25</td><td>49.71 30.25 40.06</td><td>37.74 20.81 0.0</td><td>33.37 13.36 0.0</td><td>28.82 7.71 0.0</td><td>23.65 3.38 0.0</td><td>18.23 0.0 0.0</td><td>0.488 0.497 0.575</td></tr><tr><td colspan="10">at σ = 0.25 + adaptation at σ =0.50 at σ = 0.50</td></tr><tr><td>Randg=0.5 +adapt[Best Radi] (Ours)</td><td>atσ =0.75</td><td>at σ =0.75</td><td>57.58 46.4 62.91</td><td>46.46 35.63 52.25</td><td>35.5 26.06 40.06</td><td>25.57 18.17 25.57</td><td>17.43 11.61 17.43</td><td>10.67 5.46 6.86 3.64 10.67 5.46</td><td>0.0 1.92 1.92</td><td></td><td>0.427 0.657 0.609</td></tr><tr><td colspan="10">SmoothAdvg=0.5,=0.25 at g= 0.50</td></tr><tr><td> + adaptation</td><td>at σ = 0.25 at σ = 0.50</td><td>at σ = 0.25 at g = 0.50</td><td>57.8 58.74 54.0</td><td>47.63 48.29 42.91</td><td>37.41 36.7 32.63</td><td>27.88 0.0 23.6</td><td>20.33 13.53 0.0 16.08</td><td>8.03 0.0 0.0 9.93 5.5</td><td>0.0 0.0 0.0</td><td></td><td>0.464 0.535 0.390</td></tr><tr><td>SmoothAdvg=0.5,∈=0.50</td><td>at σ = 0.75 at σ = 0.25</td><td>at σ = 0.75 atσ =0.50 at σ = 0.25</td><td>43.15 58.82 59.89</td><td>32.29 49.68 50.4</td><td>23.61 40.35 39.99</td><td>16.41 31.93 0.0</td><td>10.94 24.18 0.0</td><td>6.65 17.05 0.0</td><td>3.88 10.57 0.0</td><td>2.16 0.0 0.0</td><td>0.661 0.483 0.592</td></tr><tr><td colspan="10"> + adaptation</td></tr><tr><td>SmoothAdvg=0.5,∈=1.0</td><td>at σ = 0.50 at σ = 0.75</td><td>at σ = 0.50 at σ =0.75 atg=0.50</td><td>55.73 46.25 56.53</td><td>45.79 36.72 49.53</td><td>36.6 28.2 41.38</td><td>27.4 20.9 34.63</td><td>20.03 14.73 27.81</td><td>13.48 9.46 21.22</td><td>7.85 5.78 14.41</td><td>0.0 3.32 0.0</td><td>0.470 0.691 0.467</td></tr><tr><td> + adaptation</td><td>- at σ = 0.25 at σ = 0.50</td><td>at σ = 0.25 at σ = 0.50 at σ = 0.75</td><td>57.13 53.56 47.17</td><td>48.38 45.79 39.4</td><td>39.7 37.64</td><td>0.0 30.06</td><td>0.0 23.12 18.93</td><td>0.0 17.27 13.7</td><td>0.0 11.14 9.26</td><td>0.0 0.0 5.8</td><td>0.620 0.545</td></tr><tr><td colspan="10">at σ = 0.75</td></tr><tr><td>SmoothAdvg=0.5,∈=2.0</td><td>at σ = 0.25 at σ =0.50</td><td>atg =0.50 at σ = 0.25</td><td>52.82 52.23</td><td>47.67 47.24</td><td>31.8 42.68 41.76</td><td>24.74 37.55 0.0</td><td>32.64 0.0</td><td>27.52 0.0</td><td>22.42 0.0</td><td>0.0 0.0</td><td>0.732 0.451 0.692</td></tr><tr><td colspan="2">+ adaptation at σ =0.75</td><td>at σ = 0.50 atσ =0.75</td><td>50.28 46.7</td><td>45.24 41.79</td><td>40.39 37.14</td><td>35.5 33.05</td><td>30.92 28.28</td><td>26.1 23.88</td><td>20.25 19.34</td><td>0.0 15.05</td><td>0.727</td></tr><tr><td colspan="2">SmoothAdvg=0.5[BestRadii]</td><td></td><td>58.82 59.89</td><td>49.68 50.4</td><td>42.68 41.76</td><td>37.55 35.5</td><td>32.64 30.92</td><td>27.52 26.1</td><td>22.42 20.25</td><td>0.0 15.05</td><td>0.918 1.008</td></tr><tr><td colspan="10">SmoothAdvg=0.5 + adapt [Best Radii] (Ours) MARCERg=0.5 (Zhai et al.,2020) 60.0 53.0</td></tr></table>
|
| 383 |
+
|
| 384 |
+
Table 6: CIFAR-10: Certified top-1 accuracy at various $\ell _ { 2 }$ radii as we vary $\sigma$ for test-time BN adaptation along with average certified radii (ACR) for individual settings. Each gray block is corresponding to one classification model while the rows are corresponding to its certification performances as we choose different noise levels for adaptations and certifications. The Best Radii are obtained by training different models with varying hyper-parameters and adapting them with different noise levels during inference. We also present the best reported results for MARCER (Zhai et al., 2020) and Consistancy Jeong & Shin (2020) at $\sigma = 0 . 5$ , obtained from the respective papers.
|
| 385 |
+
|
| 386 |
+
# C PERFORMANCE AGAINST DIFFERENT CORRUPTIONS
|
| 387 |
+
|
| 388 |
+
We mainly focus on $\ell _ { 2 }$ certification using Gaussian noise in this paper. However, we note that randomized smoothing techniques have been also applied to provide certifications for other perturbation 19
|
| 389 |
+
|
| 390 |
+
types as well (e.g., random uniform noise for $\ell _ { 1 }$ norm (Yang et al., 2020)). Consequently, we can apply our proposed Algorithm 1 to adapt an AT model for any given perturbation types without any additional training for different applications.
|
| 391 |
+
|
| 392 |
+
Further, Hendrycks & Dietterich (2019) recently introduced ImageNet-C and CIFAR10-C datasets by algorithmically generated random corruptions from noise, blur, weather, and digital categories with 5 different severity levels for each corruption. Several recent works demonstrated that adaptive BN techniques can significantly improve the performance of any classifier (including AT models) against different random corruptions. Further, – also demonstrated the effectiveness of AT models even without applying any adaptation. Hence, our proposed certification framework for AT models is a step forward towards further improving the reliability of sensitive real-world applications.
|
md/dev/S37hOerQLB/S37hOerQLB.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/SHbhHHfePhP/SHbhHHfePhP.md
ADDED
|
@@ -0,0 +1,551 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# EQUIVARIANT GRAPH MECHANICS NETWORKS WITH CONSTRAINTS
|
| 2 |
+
|
| 3 |
+
Wenbing Huang∗1, Jiaqi $\mathbf { H a n } ^ { * 2 }$ †, $\mathbf { Y u \ R o n g } ^ { \boxtimes 3 }$ , Tingyang $\mathbf { X } \mathbf { u } ^ { 3 }$ , Fuchun $\mathbf { S u n } ^ { \boxtimes 2 }$ , Junzhou Huang4
|
| 4 |
+
|
| 5 |
+
1 Institute for AI Industry Research (AIR), Tsinghua University
|
| 6 |
+
2 Beijing National Research Center for Information Science and Technology (BNRist),
|
| 7 |
+
Department of Computer Science and Technology, Tsinghua University
|
| 8 |
+
3 Tencent AI Lab
|
| 9 |
+
4 Department of Computer Science and Engineering, University of Texas at Arlington
|
| 10 |
+
hwenbing@126.com, hanjq21@mails.tsinghua.edu.cn, yu.rong@hotmail.com
|
| 11 |
+
tingyangxu@tencent.com, fcsun@mail.tsinghua.edu.cn, jzhuang@uta.edu
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
Learning to reason about relations and dynamics over multiple interacting objects is a challenging topic in machine learning. The challenges mainly stem from that the interacting systems are exponentially-compositional, symmetrical, and commonly geometrically-constrained. Current methods, particularly the ones based on equivariant Graph Neural Networks (GNNs), have targeted on the first two challenges but remain immature for constrained systems. In this paper, we propose Graph Mechanics Network (GMN) which is combinatorially efficient, equivariant and constraint-aware. The core of GMN is that it represents, by generalized coordinates, the forward kinematics information (positions and velocities) of a structural object. In this manner, the geometrical constraints are implicitly and naturally encoded in the forward kinematics. Moreover, to allow equivariant message passing in GMN, we have developed a general form of orthogonality-equivariant functions, given that the dynamics of constrained systems are more complicated than the unconstrained counterparts. Theoretically, the proposed equivariant formulation is proved to be universally expressive under certain conditions. Extensive experiments support the advantages of GMN compared to the state-of-the-art GNNs in terms of prediction accuracy, constraint satisfaction and data efficiency on the simulated systems consisting of particles, sticks and hinges, as well as two real-world datasets for molecular dynamics prediction and human motion capture.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
Representing and reasoning about the relations and dynamics of a group of interacting objects is among the core aspects of human intelligence (Tenenbaum et al., 2011; Ding et al., 2021; Gan et al., 2021). As a motivating example, we consider the N-body system (Kipf et al., 2018) where the movement of a single charged particle is attracted or repelled by other charged particles. Physicists have revealed that this process can be modeled by Newton’s laws along with the Coulomb force. One may wonder, however,
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: N-body vs. constrained N-body (red/blue balls denote positive/negative charges).
|
| 23 |
+
|
| 24 |
+
if we can teach a machine to rediscover the underlying physics by solely observing the particles’ states. This thinking has inspired the study of learning to model interacting systems, which now is a prevailing topic in machine learning (Battaglia et al., 2016; Thomas et al., 2018; Kohler et al., 2019; ¨ Sanchez-Gonzalez et al., 2019; Fuchs et al., 2020; Martinkus et al., 2021; Satorras et al., 2021).
|
| 25 |
+
|
| 26 |
+
Learning to model interacting systems is challenging. First, the systems are combinatorially complex, on account of that objects can be composed in combinatorially many possible arrangements (Battaglia et al., 2016). This challenge, to some extent, can be addressed by making use of Graph Neural Networks (GNNs) (Wu et al., 2020). By regarding objects as nodes and interactions as edges, GNNs extract information via message passing, which is able to characterize arbitrarily ordered objects and combinatorial relations. The second challenge is related to an important symmetry in physics: the model we use should be equivariant to any Euclidean transformation (translation/reflection/rotation) of the input. This complies with the fact that physics rules keep unchanged regardless of the reference coordinate system. Several works (Fuchs et al., 2020; Satorras et al., 2021) have investigated equivariance upon GNNs and exhibited remarkable benefits on N-body.
|
| 27 |
+
|
| 28 |
+
Another challenge, though less explored, is that the systems could be geometrically constrained. Geometric constraints arise in common practical systems, for example, in robotics where the joints of mechanical arms should be linked one by one, or in biochemistry where the atoms of molecules are connected by chemical bonds. When modeling these constrained systems, it is crucial to enforce the model to output legal predictions. For instance, the lengths/angles of chemical bonds in a molecular closely determine its chemical property which will be changed dramatically if the structural constraints are broken. As mentioned above, equivariant GNNs (Fuchs et al., 2020; Satorras et al., 2021) have achieved desirable performance on the N-body system—this system, nevertheless, lacks of constraint. Considering constraints is not easy, as the dynamics of all elements within a constrained system evolve in a joint and complex manner. Unfortunately, to the best of our knowledge, there is no research (particularly among equivariant GNN methods) that learns to model the dynamical systems of multiple interacting objects under geometrical constraints.
|
| 29 |
+
|
| 30 |
+
In this paper, we propose Graph Mechanics Network (GMN) that can tackle the above three challenges simultaneously: I. To cope with the combinatorial complexity, GMN takes advantage of graph models to encode the states of and interactions between objects, analogous to previous approaches. II. For the constraint satisfaction, GMN resorts to generalized coordinates, a well known notion in conventional mechanics to model the dynamics of structural objects. Here, a structural object (such as the stick and hinge in Fig. 1) is defined as a set of multiple rigidly connected particles. In GMN, the constraints are implicitly encoded in the forward kinematics that describes the Cartesian states as the function of generalized coordinates. This strategy can inherently maintain the constraints and requires no external regulation. III. GMN is equivariant. In GMN, we need to compute the interaction forces in the Cartesian space (see Eq. 5), and infer the accelerations of the generalized coordinates based on the inverse dynamics (see Eq. 6), both of which are learned by a general form of equivariant functions (see Eq. 11). Notably, the proposed equivariant formulation is more efficient to compute compared to the previous versions based on spherical harmonics (Thomas et al., 2018; Fuchs et al., 2020), or more general than the one developed by EGNN (Satorras et al., 2021). More importantly, we have theoretically discussed when and how our formulation can universally approximate any equivariant function.
|
| 31 |
+
|
| 32 |
+
To evaluate the advantages of GMN, we have constructed a simulated dataset composed of three types of objects: particles, sticks and hinges, which is a complex case of the N-body system (Kipf et al., 2018) and can be used as building blocks for common systems. Under various scenarios in terms of different ratios of object types and different numbers of training data, we empirically verify the superiority of GMN compared to state-of-the-art models in prediction accuracy, constraint satisfaction and data efficiency. In addition, we also test the effectiveness of GMN on two real-world datasets: MD17 (Chmiela et al., 2017) and CMU Motion Capture (CMU, 2003).
|
| 33 |
+
|
| 34 |
+
# 2 RELATED WORK
|
| 35 |
+
|
| 36 |
+
Learning to simulate complex physical systems has been shown to greatly benefit from using GNNs. Interaction Network (IN) proposed by Battaglia et al. (2016) is the first attempt for this purpose, and it can be deemed as a special kind of GNNs to learn how the system interacts and how the states of particles evolve. Later researches have extended IN in different aspects: HRN (Mrowca et al., 2018) utilizes hierarchical graph convolution for tackling objects of various geometrical shapes and materials, NRI (Kipf et al., 2018) further explicitly infers the interactions with the help of a variational auto-encoder, and Hamiltonian graph networks (Sanchez-Gonzalez et al., 2019) equip GNNs with ordinary differential equations and Hamiltonian mechanics for energy conservation. However, all above approaches have ignored the symmetry in physics and the GNN models they use are not Euclidean equivariant. There is a subset of models (Ummenhofer et al., 2019; Sanchez-Gonzalez et al., 2020; Pfaff et al., 2020) that partially implement symmetries, but they only enforce translation equivariance but not rotation equivariance. On the other hand, it is nontrivial to enforce rotation equivariance. Tensor-Field networks (Thomas et al., 2018) uses filters built from spherical harmonics to allow 3D rotation equivariance, and this idea has been developed by SE(3) Transformer (Fuchs et al., 2020) that further takes the attention mechanism into account. Anther class of works (Finzi et al., 2020a; Hutchinson et al., 2021) resorts to the Lie convolution for the equivariance on any Lie group, based on lifting and sampling. Recently, EGNN (Satorras et al., 2021) has proposed a simple yet effective form of equivariant message passing on graphs, which does not require computationally expensive higher-order representations while still achieving better performance on N-body.
|
| 37 |
+
|
| 38 |
+
As interpreted before, ensuring geometrical constraints is crucial for many practical systems, which, nevertheless, is seldom investigated in aforementioned works. Although several attempts (Yang et al., 2020; Finzi et al., 2020b) have been proposed for learning to enforce constraints, they explicitly augment the training loss with soft Lagrangian regulation and thus are completely data-driven and have no guarantee of generalization for limited training data. DeLaN (Lutter et al., 2019) also employs generalized coordinates to describe the kinematics of the rigid object. Nevertheless, it only target on the physical process of a single object, other than the complex systems with multiple rigid and structural objects that are the focus of this paper. In DPI-Net (Li et al., 2018), the BoxBath task does share the similar strategy to us by first predicting the canonical coordinates of the box and then using the forward kinematic model to obtain the Cartesian positions. However, the passing messages in DPI-Net are scalars other than directional vectors (positions, velocities, and accelerations) used in our work. After all, both DeLaN and DPI-Net never study equivariant models.
|
| 39 |
+
|
| 40 |
+
# 3 GRAPH MECHANICS NEURAL NETWORK
|
| 41 |
+
|
| 42 |
+
We begin with introducing the N-body system (Kipf et al., 2018), as illustrated in Fig. 1 (a). This system consists of $N$ interacting particles $\{ P _ { i } \} _ { i = 1 } ^ { N }$ of the same mass, and the kinematics states of each particle are defined as ${ \cal S } _ { i } = ( { \pmb x } _ { i } , { \pmb v } _ { i } )$ , where $\mathbf { \hat { x } } _ { i } , \mathbf { \hat { v } } _ { i } \in \mathbb { R } ^ { 3 }$ are the position and velocity vectors, respectively. There could be certain non-vector information of each particle (such as charge), which is represented by a $c$ -channel feature $\boldsymbol { h } _ { i } \in \mathbb { R } ^ { c \mathrm { ~ l ~ } }$ . Suppose the system we study is conservative and the dynamics is driven by the interaction force $f _ { i j } \in \mathbb { R } ^ { 3 }$ between any pair of particles $i$ and $j$ . According to Newton’s second law, the acceleration of particle $i$ , $\mathbf { } \mathbf { { a } } _ { i } \in \mathbb { R } ^ { 3 }$ is proportional to the aggregated force from other particles $\textstyle \sum _ { j \neq i } f _ { i j }$ . All symbols will be specified with a superscript $t$ for temporal denotations, e.g., $\boldsymbol { x } _ { i } ^ { t }$ indicating the position of particle $i$ at time $t$ . In this paper, we are mainly concerned with the prediction task: we need to seek out a function $\phi ( \{ ( S _ { i } ^ { 0 } , h _ { i } ^ { 0 } ) \} _ { i = 1 } ^ { N } )$ given the initial states $\{ S _ { i } ^ { 0 } \} _ { i = 1 } ^ { N }$ and features $\{ h _ { i } ^ { 0 } \} _ { i = 1 } ^ { N }$ to forecast the future states $\{ S _ { i } ^ { T } \} _ { i = 1 } ^ { N }$ at time $T$ .
|
| 43 |
+
|
| 44 |
+
As presented in Introduction, two kinds of inductive biases have been explored previously. The first one is to apply the graph structure to capture the distribution of particle states and their interactions (Battaglia et al., 2016; Kipf et al., 2018), where, particularly, the particle states $S _ { i } ^ { 0 }$ (along with $h _ { i } ^ { 0 \setminus }$ ) are as node features and the interaction forces $f _ { i j } ^ { 0 }$ as edge messages. In this way, the transition function $\phi$ boils down to a GNN model. The second inductive bias is that $\phi$ should be equivariant to any translation/reflection/rotation of the input states. By saying equivariance, we imply
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\begin{array} { r } { \phi ( \{ ( g \cdot S _ { i } ^ { 0 } , h _ { i } ^ { 0 } ) \} _ { i = 1 } ^ { N } ) = { g \cdot \phi ( \{ ( S _ { i } ^ { 0 } , h _ { i } ^ { 0 } ) \} _ { i = 1 } ^ { N } ) } , \forall g \in \mathcal { O } ( 3 ) , \forall S _ { i } ^ { 0 } , \forall h _ { i } ^ { 0 } . } \end{array}
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
Here, $\mathcal { O } ( 3 )$ defines the 3D orthogonal group (Fuchs et al., 2020) that consists of translation, reflection and rotation transformations; $g \cdot \bar { S _ { i } ^ { 0 } }$ denotes to perform transformation $g$ on the states $S _ { i } ^ { 0 }$ , and it is instantiated as $\pmb { R } ( \pmb { x } _ { i } ^ { 0 } + \pmb { b } )$ for the position and $\mathbf { \bar { \boldsymbol { R } } } { \boldsymbol { v } } _ { i } ^ { 0 }$ for the velocity, where $\boldsymbol { R } \in \mathbb { R } ^ { 3 \times 3 }$ is the orthogonal matrix and $\pmb { b } \in \mathbb { R } ^ { 3 }$ is the translation vector.
|
| 51 |
+
|
| 52 |
+
Several works (Thomas et al., 2018; Kohler et al., 2019; Fuchs et al., 2020; Satorras et al., 2021) ¨ have investigated both inductive biases, among which EGNN (Satorras et al., 2021) has achieved promising performance on N-body. The typical process in EGNN iterates the following steps:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
{ \pmb a } _ { i } ^ { l } , h _ { i } ^ { l } = \sum _ { j } \varphi _ { \mathrm { e g n n } } ( { \pmb x } _ { j i } ^ { l - 1 } , h _ { i } ^ { l - 1 } , h _ { j } ^ { l - 1 } , e _ { j i } ) ,
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\pmb { v } _ { i } ^ { l } = \psi ( h _ { i } ^ { l - 1 } ) \pmb { v } _ { i } ^ { l - 1 } + \pmb { a } _ { i } ^ { l } ,
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\begin{array} { r } { \pmb { x } _ { i } ^ { l } = \pmb { x } _ { i } ^ { l - 1 } + \pmb { v } _ { i } ^ { l } , } \end{array}
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
where the superscript $l$ denotes the $l$ -th layer; the acceleration $\mathbf { \Delta } \mathbf { a } _ { i } ^ { l }$ returned by the message aggregation of $\varphi _ { \mathrm { e g n n } }$ in Eq. 2 is adopted for the update of the velocity $\pmb { v } _ { i } ^ { l }$ in Eq. 3 (multiplied by a scalar $\psi ( h _ { i } ^ { l - 1 } ) \in \mathbb { R } )$ ), followed by the renovation of the position $\mathbf { \boldsymbol { x } } _ { i } ^ { l }$ in Eq. 4. The formu
|
| 67 |
+
|
| 68 |
+
lation of $\varphi _ { \mathrm { e g n n } }$ is physically reasonable, since the interaction (actually the Coulomb force) between particles $i$ and $j$ truly depends on their relative position $\pmb { x } _ { j i } ^ { l - 1 } = \pmb { x } _ { i } ^ { l - 1 } - \pmb { x } _ { j } ^ { l - 1 }$ , node features $h _ { i } ^ { l - 1 }$ and $h _ { j } ^ { l - 1 }$ , and edge feature $e _ { j i }$ . To enable equivariant message passing, EGNN has developed a specific form of $\varphi _ { \mathrm { e g n n } }$ to let $\mathbf { \Delta } \mathbf { a } _ { i } ^ { l }$ be equivariant and $h _ { i } ^ { l }$ be invariant in terms of the input $\pmb { x } _ { j i } ^ { l - 1 }$ , which will be presented in Eq. 10. Notice that the computations for $\mathbf { \mathcal { f } } _ { i } ^ { l }$ and $h _ { i } ^ { l }$ are actually by two different functions, and we have abbreviated them into one in Eq. 2 (and also Eq. 5 later), since they share the same inputs; besides, their parameters are shared following EGNN.
|
| 69 |
+
|
| 70 |
+
# 3.1 OUR GENERAL ARCHITECTURE
|
| 71 |
+
|
| 72 |
+
Despite the desirable performance on N-body, existing methods are incapable of maintaining the geometric constraint. In this section, we design a general architecture that intrinsically meets the requirement of geometry constraints by making use of the generalized coordinates.
|
| 73 |
+
|
| 74 |
+
We define $\mathcal { O } _ { k } = \{ P _ { i } \} _ { i = 1 } ^ { n _ { k } }$ a structural object composed of $n _ { k }$ rigidly connected particles. Fig. 1 (b) illustrates two examples of the structural object, the stick with 2 connected particles and the hinge with 3 particles. To preserve the distance, the dynamics of the two particles on a stick should be updated in a joint way, rather than fulfilling the independent process in EGNN (Eq. 3 and 4). Besides, the force on each particle within $\mathcal { O } _ { k }$ will indirectly influence the dynamics of others through the physical connections. This requires us to analyze the dynamics of the particles in $\mathcal { O } _ { k }$ as a whole, which is implemented by generalized coordinates. There could be multiple generalized coordinates for each $\mathcal { O } _ { k }$ , some located in the Cartesian space but some in the angle space. For instance, the states of a stick can be decoupled by two independent sets of generalized coordinates: the state of particle 1 as the Cartesian coordinates and the relative rotation angles of particle 2 to 1 as the angle coordinates. For conciseness, this section only focus on the Cartesian part which essentially determines the local coordinates in $\mathcal { O } _ { k }$ , with providing full examples in $\ S \ 3 . 3$ . We denote the position, velocity and acceleration of the generalized Cartesian coordinates as $\pmb q _ { k }$ , $\dot { \pmb q } _ { k }$ and $\ddot { \pmb q } _ { k }$ , respectively.
|
| 75 |
+
|
| 76 |
+
We now detail how to update the states of $\mathcal { O } _ { k }$ . In Fig. 2, we first compute the interaction force between each particle and others, and aggregate information of all particles within each structural object to infer the acceleration of the generalized coordinates (which is termed as the generalized acceleration henceforth) by inverse dynamics.
|
| 77 |
+
|
| 78 |
+
Then, the dynamical updates are carried out in the space of the generalized coordinates. Finally, the updated generalized coordinates will be projected back to the particles’ states via the forward kinematics.
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\begin{array} { r l } & { f _ { i } ^ { l } , h _ { i } ^ { l } = \displaystyle \sum _ { j } \varphi _ { 1 } ( x _ { j i } ^ { l - 1 } , h _ { i } ^ { l - 1 } , h _ { j } ^ { l - 1 } , e _ { j i } ) _ { ; } } \\ & { \qquad \dot { q } _ { k } ^ { l } = \displaystyle \sum _ { i \in \mathcal { O } _ { k } } \varphi _ { 2 } ( f _ { i } ^ { l } , x _ { k i } ^ { l - 1 } , v _ { k i } ^ { l - 1 } ) , } \\ & { \qquad \dot { q } _ { k } ^ { l } = \psi ( \displaystyle \sum _ { i \in \mathcal { O } _ { k } } h _ { i } ^ { l - 1 } ) \dot { q } _ { k } ^ { l - 1 } + \ddot { q } _ { k } ^ { l } , } \\ & { \qquad q _ { k } ^ { l } = q _ { k } ^ { l - 1 } + \dot { q } _ { k } ^ { l } , } \\ & { \qquad x _ { i } ^ { l } , v _ { i } ^ { l } = \mathrm { F K } ( q _ { k } ^ { l } , \dot { q } _ { k } ^ { l } ) , \forall i \in \mathcal { O } _ { k } , } \end{array}
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+

|
| 85 |
+
Figure 2: The flowchart of our GMN.
|
| 86 |
+
|
| 87 |
+
where, the elements of the system can be described in two views, $\{ \mathcal { O } _ { k } \} _ { k = 1 } ^ { K }$ as the object-level view and $\{ P _ { i } \} _ { i = 1 } ^ { N }$ as the particle-level view; for distinction, we index the structural object with the subscript $k$ and particles with or $j$ . We explain each equation separately.
|
| 88 |
+
|
| 89 |
+
Interaction force (Eq. 5). The interaction force $\mathbf { \mathcal { f } } _ { i } ^ { l }$ is computed analogous to Eq. 2. EGNN straightly regards the interaction force to be the acceleration of each particle in Eq. 2. But here, given the constraints between particles, we record the force as an intermediate variable that will contribute to the inference of the generalized acceleration in the next step.
|
| 90 |
+
|
| 91 |
+
Inverse dynamics (Eq. 6). This step is the core of our methodology. The generalized acceleration $\ddot { q } _ { k } ^ { l }$ is dependent to the forces $\mathbf { \mathcal { f } } _ { i } ^ { l }$ on all particles within $\mathcal { O } _ { k }$ , and their relative positions $\pmb { x } _ { k i } ^ { l - 1 } = \pmb { x } _ { i } ^ { l - 1 } - \pmb { q } _ { k } ^ { l - 1 }$ and relative velocities $\pmb { v } _ { k i } ^ { l - 1 } = \pmb { v } _ { i } ^ { l - 1 } - \dot { \pmb { q } } _ { k } ^ { l - 1 }$ with regard to the generalized coordinates. The formulation of Eq. 6 is physics-inspired. In Appendix (Eq. 26), we have analytically derived the dynamics of hinges, where the acceleration of the hinge is indeed related to the forces, relative positions and relativmechanics, since the cross product $\pmb { x } _ { k i } ^ { l - 1 } \times \pmb { f } _ { i } ^ { l }$ of all particles in each hinge. This is reasoyields the torque, and the relative velocity $\pmb { v } _ { k i } ^ { l - 1 }$ inis related to the centrifugal force of particle $i$ around , both of which influence the acceleration $\ddot { \pmb q } _ { k }$ Different from the analytical form which is always complex and hard to compute in practice, we will employ a learnable and equivariant function with universal expressivity. The details are in $\ S 3 . 2$ .
|
| 92 |
+
|
| 93 |
+
Generalized update (Eq. 7-8). The updates of the generalized coordinates are akin to Eq. 3 and 4 in EGNN, as the dimensions of the generalized coordinates have been made independent. Notice that in Eq. 7 the scalar factor for $\dot { \pmb q } _ { k } ^ { l - 1 }$ takes as input the summation of all hidden features, which is a generalized form of Eq. 3 for multiple particles in ${ \mathcal { O } } _ { k }$ .
|
| 94 |
+
|
| 95 |
+
Forward kinematics (Eq. 9). Once the generalized coordinates have been refreshed, we can derive the states of all particles in $\mathcal { O } _ { k }$ by proceeding the forward kinematics. Different system of $\mathcal { O } _ { k }$ could have different type of the forward kinematics. Here we denote it as the function $\operatorname { F K } ( \cdot )$ in general, while providing the specifications in $\ S \ 3 . 3$ .
|
| 96 |
+
|
| 97 |
+
Our method will reduce to EGNN if setting the generalized coordinates as the states of each particle and utilize the identify map in Eq. 6 and 9. Alg. 1 has summarized the updates for all objects.
|
| 98 |
+
|
| 99 |
+
# 3.2 EQUIVARIANT MESSAGE PASSING
|
| 100 |
+
|
| 101 |
+
As shown in Eq. 1, the Euclidean equivariance on the estimation function $\phi$ is necessary for ensuring the physical symmetry. When considering this property in our case, we demand the interaction force (Eq. 5) and generalized acceleration (Eq. 6) to be equivariant with respect to orthogonal transformations, while other equations are already equivariant2. EGNN (Satorras et al., 2021) has developed a particular orthogonality-equivariant form for the acceleration output in Eq. 2:
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\varphi _ { \mathrm { e g n n } } ( \pmb { x } , h ) : = \pmb { x } \sigma _ { w } ( \| \pmb { x } \| _ { 2 } ^ { 2 } , h ) ,
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
where $\sigma _ { w } ( \cdot )$ is an arbitrary Multi-Layer Perceptron (MLP) with parameter $w$ , and we have abbreviated other non-vector terms in Eq. 2 as $h$ . This formulation does satisfy the rotation equivariance, but it is unknown if it can be generalized to functions (such as Eq. 6) with multiple input vectors, and more importantly, its representation completeness is never explored rigorously. In this section, we propose a general form of orthogonality-equivariant functions with necessary theoretical guarantees.
|
| 108 |
+
|
| 109 |
+
Without loss of generality, the target function we would like to enforce equivariance is denoted as $\varphi ( Z , h ) : \mathbb { R } ^ { d \times m } \times \mathbb { R } ^ { c } \mathbb { R } ^ { d \times m ^ { \prime } }$ . We define the below formulation,
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\varphi ( Z , h ) : = Z \sigma _ { w } ( Z ^ { \top } Z , h ) .
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
It is easy to justify the function $\varphi ( Z , h )$ in Eq. 11 is equivariant to any orthogonal matrix i.e., $\varphi ( O Z , h ) = O \varphi ( Z , h )$ , $\forall O \in \mathbb { R } ^ { d \times d }$ , $O ^ { \top } O = I$ . Apparently, Eq. 11 reduces to Eq. 10 by setting the number of vectors in $z$ as 1, namely, $m = m ^ { \prime } = 1$ . We immediately have the following theory.
|
| 116 |
+
|
| 117 |
+
Theorem 1. If $m \geq d$ and the row rank of $z$ is full, i.e. $r a n k ( Z ) = d ,$ , then for any continuous orthogonality-equivariant function ${ \hat { \varphi } } ( Z , h )$ , there must exist an MLP $\sigma _ { w }$ satisfying $\parallel \varphi ( \boldsymbol { Z } , h ) \mathrm { ~ - ~ }$ $\hat { \varphi } ( Z , h ) \rVert < \epsilon$ for arbitrarily small error $\epsilon$ .
|
| 118 |
+
|
| 119 |
+
The proof employs the universality of MLP (Cybenko, 1989; Hornik, 1991), with the entire details deferred in Appendix. Theorem 1 is nutritive, as it characterizes the rich expressivity of formulating the equivariant function via Eq. 11. The condition holds in general for the function like Eq. 6 whose input $Z = ( f _ { i } , x _ { k i } , v _ { k i } ) \in \bar { \mathbb { R } } ^ { 3 \times 3 }$ is of full rank when the force, position and velocity expand the whole space. Indeed, this condition holds with probability 1, stated by the following corollary.
|
| 120 |
+
|
| 121 |
+
Corollary 1. Assume $m \geq d$ , and also the entries of $z$ are drawn independently from a distribution that is absolutely continuous with respect to the Lebesgue measure in $\mathbb { R }$ . Then, almost surely, the conclusion of Theorem 1 holds.
|
| 122 |
+
|
| 123 |
+
When the condition $m \geq d$ is invalid, the universal approximation still maintains if restricted in the linear subspace expanded by the columns of $z$ .
|
| 124 |
+
|
| 125 |
+
Corollary 2. For any continuous orthogonality-equivariant function ${ \hat { \varphi } } ( Z , h )$ located in the linear subspace expanded by the columns of $z$ , the conclusion of Theorem 1 holds universally.
|
| 126 |
+
|
| 127 |
+
Corollary 2 tells that the message passing $\varphi _ { \mathrm { e g n n } }$ in Eq. 10 is not universally expressive since $m < d$ , and can only fit the vectors parallel to $_ { \textbf { \em x } }$ (i.e. the relative position). Yet, $\varphi _ { \mathrm { e g n n } }$ is still physically complete for the Coulomb force that is oriented by the relative position between two particles.
|
| 128 |
+
|
| 129 |
+
In our experiments, we find that more stable performance is delivered by further adding the normalization term specifically when $m > 1$
|
| 130 |
+
|
| 131 |
+
where $\| \cdot \| _ { F }$ computes the Frobenius norm. Notice that adding normalization does not change the conclusions in Theorem 1 and its two corollaries, since the norm is also a function of $Z ^ { \top } \bar { Z }$ that can be approximated by MLP. We implement $\varphi _ { 1 }$ in Eq. 5 and $\varphi _ { 2 }$ in Eq. 6 by using the general formulation Eq. 12, where Z = xl−1ji and $\pmb { Z } \overset { \cdot } { = } ( \mathbf { f } _ { i } ^ { l } , \mathbf { x } _ { k i } ^ { \bar { l } - 1 } , \mathbf { v } _ { k i } ^ { l - 1 } )$ , respectively. Note that for the update of hidden feature $h _ { i } ^ { l }$ in Eq. 5, we do not need equivariance but invariance, hence we set $h _ { i } ^ { l } = \sigma _ { w } \big ( Z ^ { \top } Z / \| Z ^ { \top } Z \| _ { F } , h _ { i } ^ { l - 1 } \big )$ by just keeping the invariant part in Eq. 12.
|
| 132 |
+
|
| 133 |
+
# 3.3 IMPLEMENTATIONS OF FORWARD KINEMATICS
|
| 134 |
+
|
| 135 |
+
Implementation of hinges. A hinge, as displayed in Fig.3 (a), consists of three particles 0, 1, 2, and two sticks 01 and 02. The freedom degrees of this system can be explained in this way: particle 0 moves freely, and particles 1 and 2 can only rotate round particle 0 owing to the length constraint by the two sticks. Hence, the generalized coordinates include the states of particle 0 denoted as $\bar { \pmb q _ { 0 } } \in \mathbb { R } ^ { 3 }$ and the rotation Euler angles of stick 01 as $\theta _ { 0 1 } \in \mathbb { R } ^ { 3 }$ and 02 as $\bar { \pmb { \theta } _ { 0 2 } } ~ \in ~ \mathbb { R } ^ { 3 }$ .
|
| 136 |
+
|
| 137 |
+
As low $\pmb q _ { 0 }$ are Cartesian, the dynamical upirectly Eq. 5-8. With the forces $\{ f _ { i } ^ { l } \} _ { i = 0 } ^ { 3 }$
|
| 138 |
+
estimated in Eq. 5 and acceleration $\ddot { q } _ { 0 } ^ { l }$ by Eq. 6,
|
| 139 |
+
the angle acceleration of $\pmb { \theta } _ { 0 1 }$ is calculated as
|
| 140 |
+
$\ddot { \pmb { \theta } } _ { 0 1 } ^ { l } = ( \mathbf { x } _ { 0 1 } ^ { l - 1 } \times ( \mathbf { f } _ { 1 } ^ { l } - \ddot { \pmb { q } } _ { 0 } ^ { l } ) ) / \| \mathbf { x } _ { 0 1 } ^ { l - 1 } \| ^ { 2 }$ accord
|
| 141 |
+
ing to rigid mechanics, where the numerator is
|
| 142 |
+
the relative torque, the denominator is the mo
|
| 143 |
+
ment of inertia under unit mass, and $\times$ means
|
| 144 |
+
$\dot { \theta } _ { 0 1 } ^ { l } = \psi ^ { \prime } \dot { ( h _ { 0 } ^ { l - 1 } + h _ { 1 } ^ { l - 1 } + h _ { 2 } ^ { l - 1 } ) } \dot { \theta } _ { 0 1 } ^ { l - 1 } + \ddot { \theta } _ { 0 1 } ^ { l }$ ity issimi$\pmb { \theta } _ { 0 1 }$
|
| 145 |
+
|
| 146 |
+

|
| 147 |
+
Figure 3: Illustrations of hinges and sticks.
|
| 148 |
+
|
| 149 |
+
he forward kinematics can be conducted without it. In detail, the forward kinematics in Eq. 9 is:
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
\begin{array} { r } { \pmb { x } _ { 1 } ^ { l } = \pmb { q } _ { 0 } ^ { l } + \mathrm { r o t } ( \dot { \pmb { \theta } } _ { 0 1 } ^ { l } ) \pmb { x } _ { 0 1 } ^ { l - 1 } , \quad \pmb { v } _ { 1 } ^ { l } = \dot { \pmb { q } } _ { 0 } ^ { l } + \dot { \pmb { \theta } } _ { 0 1 } ^ { l } \times \pmb { x } _ { 0 1 } ^ { l } , } \end{array}
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+
where $\mathrm { r o t } ( \dot { \pmb \theta } _ { 0 1 } ^ { l } )$ indicates the rotation matrix around the direction of $\dot { \pmb \theta } _ { 0 1 } ^ { l }$ by absolute angle $\lVert \dot { \pmb \theta } _ { 0 1 } ^ { l } \rVert$ .
|
| 156 |
+
The dynamic updates for particle 2 is similar. We put the whole details into Alg. 1 in Appendix.
|
| 157 |
+
|
| 158 |
+
Implementation of sticks. For a stick with particles 1 and 2 in Fig 3 (b), we choose the center as the generalized Cartesian coordinate $\pmb q _ { 0 }$ , and the rotation of particle $1 \theta _ { 0 1 }$ and particle 2 $\pmb { \theta } _ { 0 2 }$ $\pmb { \theta } _ { 0 1 } = \pmb { \theta } _ { 0 2 } )$ ) as the generalized angle coordinates. The dynamics propagation of $\pmb q _ { 0 }$ is given by Eq. 5-8. There are two choices to compute $\ddot { q } _ { 0 } ^ { l }$ , one using the general form in Eq. 6 and the other one leveraging a simplified version as $\begin{array} { r } { \ddot { { \bf q } } _ { 0 } ^ { \bar { l } } = \sum _ { i \in \mathcal { O } _ { k } } \varphi ( { f } _ { i } ^ { \bar { l } } ) } \end{array}$ by explicitly omitting the relative position and velocity. The physical motivation of introducing the simplified version is that the acceleration of a stick center is only affected by the forces according to the theorem of the motion of the center of mass. The angle accelerations are $\ddot { \pmb { \theta } } _ { 0 1 } ^ { l } = ( \mathbf { x } _ { 0 1 } ^ { l - 1 } \times \mathbf { f } _ { 1 } ^ { l } + \mathbf { x } _ { 0 2 } ^ { l - 1 } \times \mathbf { f } _ { 2 } ^ { l } ) / ( \lVert \mathbf { x } _ { 0 1 } ^ { l - 1 } \rVert ^ { 2 } + \lVert \mathbf { x } _ { 0 2 } ^ { l - 1 } \rVert ^ { 2 } )$ , and the velocity becomes $\dot { \theta } _ { 0 1 } ^ { l } = \psi ^ { \prime } ( h _ { 1 } ^ { l - 1 } + h _ { 2 } ^ { l - 1 } ) \dot { \theta } _ { 0 1 } ^ { l - 1 } + \ddot { \theta } _ { 0 1 } ^ { l }$ . The states of particles 1 and 2 are renewed as the same as Eq. 13.
|
| 159 |
+
|
| 160 |
+
Learnable FK. Besides the above hand-crafted FK, we propose a learnable variant by replacing Eq. (7-9) with the update $\pmb { v } _ { i } ^ { l } = \phi ( h _ { i } ^ { l - 1 } ) \pmb { v } _ { i } ^ { l - 1 } + \rho ( \ddot { \pmb { q } } _ { k } ^ { l } , \pmb { x } _ { k i } ^ { l - 1 } , \pmb { f } _ { i } ^ { l } ) , \pmb { x } _ { i } ^ { l } = \pmb { x } _ { i } ^ { l - 1 } + \pmb { v } _ { i } ^ { l }$ , where $\rho$ is the equivariant function via Eq. 12. Full details are provided in Appendix I.
|
| 161 |
+
|
| 162 |
+
Table 1: Prediction error $( \times 1 0 ^ { - 2 } )$ on various types of systems. The header of each column ${ } ^ { 6 6 } p , s , h ^ { \prime \prime }$ denotes the scenario with $p$ isolated particles, $s$ sticks and $h$ hinges. Results averaged across 3 runs.
|
| 163 |
+
|
| 164 |
+
<table><tr><td colspan="6">|Train| = 500</td><td colspan="5">|Train] = 1500</td></tr><tr><td></td><td>1,2.0</td><td>2.0,1</td><td>3,2,1</td><td>0,10.0</td><td>5.3,3</td><td>1,2.0</td><td>2.0,1</td><td>3,2,1</td><td>0,10.0</td><td>5,3,3</td></tr><tr><td>Linear</td><td>8.23±0.00</td><td>7.55±0.00</td><td>9.76±0.00</td><td>11.36±0.00 1</td><td>11.62±0.00</td><td></td><td>8.22±0.00 7.55±0.009.76±0.00 1136±0.0011.62±0.00</td><td></td><td></td><td></td></tr><tr><td>GNN</td><td>5.33±0.07</td><td>5.01±0.08</td><td>7.58±0.08</td><td>9.83±0.04</td><td>9.77±0.02</td><td></td><td>3.61±0.13 3.23±0.07 4.73±0.11</td><td></td><td>7.97±0.44</td><td>7.91±0.31</td></tr><tr><td>TFN</td><td>11.54±0.38 9.87±0.27</td><td></td><td>11.66±0.08</td><td>13.43±0.31</td><td>12.23±0.12</td><td></td><td>5.86±0.35 4.97±0.23 8.51±0.14 11.21±0.21</td><td></td><td></td><td>10.75±0.08</td></tr><tr><td>SE(3)-Tr.</td><td>5.54±0.06</td><td>5.14±0.03</td><td>8.95±0.04</td><td>11.42±0.01</td><td>11.59±0.01</td><td></td><td>5.02±0.03 4.68±0.05 8.39±0.02</td><td></td><td>10.82±0.03</td><td>10.85±0.02</td></tr><tr><td>RF</td><td>3.50±0.17</td><td>3.07±0.24</td><td>5.25±0.44</td><td>7.59±0.25</td><td>7.73±0.39</td><td></td><td>2.97±0.15 2.19±0.11 3.80±0.25</td><td></td><td>5.71±0.31</td><td>5.66±0.27</td></tr><tr><td>EGNN</td><td>2.81±0.12</td><td>2.27±0.04</td><td>4.67±0.07</td><td>4.75±0.05</td><td>4.59±0.07</td><td></td><td>2.59±0.10 1.86±0.02 2.54±0.01</td><td></td><td>2.79±0.04</td><td>3.25±0.07</td></tr><tr><td>EGNNReg</td><td>2.94±0.01</td><td>2.66±0.06</td><td>7.01±0.34</td><td>5.03±0.08</td><td>6.31±0.04</td><td></td><td>2.74±0.08 1.58±0.03 2.62±0.05</td><td></td><td>3.03±0.07</td><td>3.07±0.04</td></tr><tr><td>GMN</td><td>1.84±0.02</td><td>2.02±0.02</td><td>2.48±0.04</td><td>2.92±0.04</td><td>4.08±0.03</td><td></td><td>1.68±0.04 1.47±0.03 2.10±0.04</td><td></td><td>2.32±0.02</td><td>2.86±0.01</td></tr></table>
|
| 165 |
+
|
| 166 |
+
# 4 EXPERIMENTS
|
| 167 |
+
|
| 168 |
+
# 4.1 SIMULATION DATASET: CONSTRAINED N-BODY
|
| 169 |
+
|
| 170 |
+
Datasets. We inherit the 3D extension of Fuchs et al. (2020) based on the N-body simulation introduced in Kipf et al. (2018). For each trajectory, we provide the initial states of the system $\{ S _ { i } ^ { 0 } \} _ { i = 1 } ^ { N }$ , the particles’ charges $\{ c _ { i } \in ( - 1 , 1 ) \} _ { i = 1 } ^ { \tilde { N } }$ and a configuration indicating which particles are connected by sticks or hinges. The task is to predict the final positions $\{ \pmb { x } _ { i } ^ { T } \} _ { i = 1 } ^ { N }$ of the particles when $T = 1 0 0 0$ . The validation and testing sets contain 2000 trajectories. We evaluate the prediction error by the MSE metric. Compared with the simulation conducted in Fuchs et al. (2020); Satorras et al. (2021), our dataset is more challenging in three senses: 1. We consider systems with multiple scales, including 5, 10, and 20 particles in total, respectively. 2. We introduce to the system the dynamics of hinges and sticks (depicted in Appendix B), and construct various combinations between these objects. 3. We investigate the performance of each model across different scales of training set, e.g., 500 and 1500, to see how the models perform with scarce or relatively abundant training data. The system consisting of $p$ isolated particles, $s$ sticks and $h$ hinges, is abbreviated as $( p , s , h )$ .
|
| 171 |
+
|
| 172 |
+
Implementation details. Following Satorras et al. (2021), we use a linear mapping of the scale of initial velocity $\vert \vert \pmb { v } _ { i } ^ { 0 } \vert \vert _ { 2 }$ as the input node feature $h _ { i } ^ { 0 }$ . The edge feature is provided by a concatenation of the product of charges $\mathbf { } c _ { i } \mathbf { c } _ { j }$ and an edge type indicator $I _ { i j }$ , where $I _ { i j }$ is valued as 0 if node $i$ and $j$ are disconnected, 1 if connected by a stick, and 2 if connected by a hinge. Note that this edge type indicator is an augmentation over the original setting in EGNN, designed to enforce EGNN and other baselines the ability to distinguish different types of edges, namely, with or without constraints. Other settings including the hyper-parameters are introduced in Appendix E.
|
| 173 |
+
|
| 174 |
+
Comparison with SOTAs. Table 1 reports the performance of GMN and various compared models: EGNN (Satorras et al., 2021) and its regulated version EGNNReg, SE(3)-Transformer (Fuchs et al., 2020), Radial-Field (RF) (Kohler et al., 2019), Tensor-Field-Network (TFN) (Thomas et al., 2018), ¨ and other two baselines, GNN and the Linear prediction (Satorras et al., 2021). Regarding EGNN and EGNNReg, they share the same backbones (i.e. $\varphi _ { 1 }$ and $\psi$ ) and training hyper-parameters (learning rates, layer number, etc) with our GMN for a fair comparison. For EGNNReg, we explicitly involve a regularization term during training by enforcing the geometrical constraints, namely preserving the lengths between two particles on sticks and hinges; the regularization factor is ranged from 0.01 to 0.1, where the value giving the best performance is selected. The default settings of SE(3)-Transformer and TFN perform poorly on our experiments, hence we have tried our best to tune their hyper-parameters by validation. From Table 1, we have these observations:
|
| 175 |
+
|
| 176 |
+
1. GMN achieves the best performance in all scenarios, suggesting its general superiority. 2. GMN is more robust when the complexity of the system increases. On $| \mathrm { T r a i n } | = 5 0 0$ , for example, the performance of GMN degenerates slightly by increasing the number of particles and hinges (e.g. from (1,2,0) to (3,2,1)), while other methods (such as EGNN) drops significantly. 3. Reducing the training size will hinder the performance of all compared methods remarkably. On the contrary, GMN still performs promisingly in general. For instance, on (3,2,1), EGNNReg becomes much worse from 2.62 to 7.01 when the volume of training data is decreased from 1500 to 500, whereas the change of GMN is smaller (2.10 v.s. 2.48). This is reasonable as GMN has explicitly encoded the constraints as opposed to EGNN and EGNNReg that learn to remember constraints by training.
|
| 177 |
+
|
| 178 |
+
Table 2: Generalization across different systems. All models are trained in the (3,2,1) scenario.
|
| 179 |
+
|
| 180 |
+
<table><tr><td></td><td colspan="4">|Train| = 500</td><td colspan="4">|Train|= 1500</td></tr><tr><td></td><td>3,2,1</td><td>2,4,0</td><td>1,0,3</td><td>Average</td><td>3,2,1</td><td>2,4.0</td><td>1,0,3</td><td>Average</td></tr><tr><td>GNN</td><td>7.58</td><td>8.06</td><td>8.37</td><td>8.00</td><td>4.73</td><td>4.98</td><td>5.58</td><td>5.10</td></tr><tr><td>EGNN</td><td>4.67</td><td>3.42</td><td>4.40</td><td>4.16</td><td>2.54</td><td>2.75</td><td>3.49</td><td>2.93</td></tr><tr><td>EGNNReg</td><td>7.01</td><td>4.49</td><td>6.62</td><td>6.04</td><td>2.62</td><td>2.62</td><td>4.29</td><td>3.18</td></tr><tr><td>GMN</td><td>2.48</td><td>2.53</td><td>3.28</td><td>2.76</td><td>2.10</td><td>2.18</td><td>2.65</td><td>2.31</td></tr></table>
|
| 181 |
+
|
| 182 |
+
Data efficiency. Fig. 4 depicts the prediction errors on (3,2,1) when the training size varies. It is observed that GMN acts steadily, justifying its benefit in data efficiency. Once again, both EGNN and EGNNReg deliver much worse performance when the training size is small, and they approach GMN when the training dataset is enlarged sufficiently. In physics, it is important to ensure the physics rules that are discovered by a relatively small number of experiments to be general enough for explaining universal phenomena. Hence, data efficiency, as a key advantage of GMN, comes as an important requirement for learning to model physical systems. Besides, by the comparison between GNN and other equivariant models, it is seen that equivariance is a crucial point for performance guarantee.
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 4: Data efficiency.
|
| 186 |
+
|
| 187 |
+
The generalization capability across different systems. It is interesting to check how the models perform when trained on one system but tested on others. Hence, Table 2 tests the generalization from (3,2,1) to (2,4,0) and (1,0,3). Interestingly, the performances of all models on new systems are comparable with the original environment. We conjecture that this ability could be attributed to the usage of GNN in capturing the combination diversity of the objects. As before, GMN performs best.
|
| 188 |
+
|
| 189 |
+
Ablation studies. 1. The function $\varphi _ { 2 }$ is designed to be equivariant in Eq. 12. To justify this necessity, we replace $\varphi _ { 2 }$ with an MLP of the same size, and report the errors in Table 3, from which we confirm that removing equivariance incurs detriment to the performance. 2. The default setting of GMN in Eq. 6 is leveraging unshared acceleration inference $\bar { \varphi _ { 2 } } ( f _ { i } ^ { l } )$ for sticks and $\varphi _ { 2 } ( f _ { i } ^ { l } , \pmb { x } _ { k i } ^ { l - 1 } , \pmb { v } _ { k i } ^ { l - 1 } )$ ifor hinges. Here
|
| 190 |
+
|
| 191 |
+
Table 3: Ablations. “O.F.” denotes numerical over-flow.
|
| 192 |
+
|
| 193 |
+
<table><tr><td>|Train|=500 |Train =1500 3,2,1 5,3,3 3,2,1 5,3,3</td></tr><tr><td>GMN</td></tr><tr><td>2.48 4.08 2.10 2.86 GMN-L 3.19 4.34 2.28 3.03</td></tr><tr><td>w/o Equivariance 3.74 4.41 2.46 3.29</td></tr><tr><td>2 with U 1 一 -1) 2.86 4.15 2.20 3.00 ki ,</td></tr><tr><td>i with Uki shared 3.86 4.25 2.30 2 ), 3.10</td></tr><tr><td>2 with only f 3.10 4.39 2.34 4.19</td></tr><tr><td>2 with only f,shared 2.91 4.94 2.39 3.45</td></tr><tr><td>w/o Normalization 3.15 O.F. O.F. O.F.</td></tr></table>
|
| 194 |
+
|
| 195 |
+
or unshared parameters. Applying identical we investigate different cases by assigning the identical form of $\varphi _ { 2 } ( f _ { i } ^ { l } , \pmb { x } _ { k i } ^ { l - 1 } , \pmb { v } _ { k i } ^ { l - 1 } )$ mostly outperforms the case by us- for sticks and hinges with shared ing $\varphi _ { 2 } ( \pmb { f } _ { i } ^ { l } )$ , probably owing to the better expressivity of the former version. Yet, both cases are worse than our design, implying that the dynamics of sticks and hinges should be modeled distinctly. 3. We have introduced a normalization term in Eq. 12. Table 3 demonstrates that eliminating this term leads to divergence during training, possibly owing to the numerical instability in the forward/backward propagation. 4. We have also implemented GMN-L that replaces the hand-crafted FK in GMN with a learnable black-box equivariant function. GMN-L outperforms EGNN in various settings, verifying the validity of using our proposed equivariant message passing layer and the object-level message $\ddot { \pmb q } _ { k }$ in Eq. 6. Yet, GMN-L still yields minor gap with GMN, implying the benefit of involving domain knowledge. The full results are deferred to Appendix I.
|
| 196 |
+
|
| 197 |
+
# 4.2 APPLICATIONS ON REAL-WORLD DATASETS
|
| 198 |
+
|
| 199 |
+
This subsection introduces how to apply GMN to practical applications including MD17 (Chmiela et al., 2017) and CMU Motion Capture (CMU, 2003). It is not required to manually derive the entire kinematics for these complex systems; instead, each input system is decomposed as a set of particles and sticks (e.g., the circles in Fig. 5), which can be directly processed by our current formulation of GMN without any modification. The core is modeling partial length-constraints of the input system with disjoint sticks. The full details of the kinematics decomposition trick are in Appendix C.
|
| 200 |
+
|
| 201 |
+
Table 4: Prediction error $( \times 1 0 ^ { - 2 } )$ on MD17 dataset. Results averaged across 3 runs.
|
| 202 |
+
|
| 203 |
+
<table><tr><td></td><td>Aspirin</td><td>Benzene</td><td></td><td>Ethanol Malonaldehyde Naphthalene Salicylic</td><td></td><td></td><td>Toluene</td><td>Uracil</td></tr><tr><td>RF</td><td>10.94±0.01</td><td>103.72±1.29</td><td>4.64±0.01</td><td>13.93±0.03</td><td>0.50±0.01</td><td>1.23±0.01</td><td>10.93±0.04</td><td>0.64±0.01</td></tr><tr><td>TFN</td><td>12.37±0.18</td><td>58.48±1.98</td><td>4.81±0.04</td><td>13.62±0.08</td><td>0.49±0.01</td><td>1.03±0.02</td><td>10.89±0.01</td><td>0.84±0.02</td></tr><tr><td>SE(3)-Tr.</td><td>11.12±0.06</td><td>68.11±0.67</td><td>4.74±0.13</td><td>13.89±0.02</td><td>0.52±0.01</td><td>1.13±0.02</td><td>10.88±0.06</td><td>0.79±0.02</td></tr><tr><td>EGNN</td><td>14.41±0.15</td><td>62.40±0.53</td><td>4.64±0.01</td><td>13.64±0.01</td><td>0.47±0.02</td><td>1.02±0.02</td><td>11.78±0.07</td><td>0.64±0.01</td></tr><tr><td>EGNNReg</td><td>13.82±0.19</td><td>61.68±0.37</td><td>6.06±0.01</td><td>13.49±0.06</td><td>0.63±0.01</td><td>1.68±0.01</td><td>11.05±0.01</td><td>0.66±0.01</td></tr><tr><td>GMN</td><td>10.14±0.03</td><td>48.12±0.40</td><td>4.83±0.01</td><td>13.11±0.03</td><td>0.40±0.01</td><td>0.91±0.01</td><td>10.22±0.08</td><td>0.59±0.01</td></tr><tr><td>GMN-L</td><td>9.76±0.11</td><td>54.17±0.69</td><td>4.63±0.01</td><td>12.82±0.03</td><td>0.41±0.01</td><td>0.88±0.01</td><td>10.45±0.04</td><td>0.59±0.01</td></tr></table>
|
| 204 |
+
|
| 205 |
+
MD17. We adopt MD17 (Chmiela et al., 2017) which involves the trajectories of eight molecules generated via molecular dynamics simulation. Our goal here is to predict the future positions of the atoms given the current system state. We observe that the lengths of chemical bonds remain very stable during the simulation, making it reasonable to model the bonds as sticks. The complete implementation details are deferred to Appendix E. As presented in Table 4, GMN outperforms other competitive equivariant models on 7 of the 8 molecules. Particularly, on molecules with complex structures (e.g., Aspirin, Benzene, and Salicylic), the improvement of GMN is more significant, showcasing the benefit of constraint modeling on the bonds. Yet, we also observe that the constraint-aware models (GMN and EGNNReg) perform worse than others on Ethanol, possibly because Ethanol is a relatively small molecule with simple structure, where considering the bond constraints possibly makes less benefit but instead hinders the learning. Surprisingly, GMN-L showcases very competitive performance on this dataset. It surpasses GMN on 4 of the 8 molecules, exhibiting that learnable FK works in practice even it does not involve domain knowledge of the constraint into kinematics modeling.
|
| 206 |
+
|
| 207 |
+

|
| 208 |
+
Figure 5: Molecules in MD17.
|
| 209 |
+
|
| 210 |
+
CMU Motion Capture. We use the motion data from the CMU Motion Capture Database (CMU, 2003), which contains the trajectory of human motion in various scenarios. Different parts of the human body could be treated as hard rigid-body constraints. We focus on the walking motion of single object (subject $\# 3 5$ ) containing 23 trials, similar to Kipf et al. (2018). As depicted in Table 5, GMN outperforms other models by a large margin, verifying the efficacy of our equivariant constraint module on modeling complex rigid bodies. We further provide a visualization in Fig. 6, where GMN predicts the motion accurately while EGNN yields larger error. Again, GMN-L, although is inferior to GMN, is better than other methods remarkably.
|
| 211 |
+
|
| 212 |
+
Table 5: Prediction error $( \times 1 0 ^ { - 2 } )$ on motion capture. Results averaged across 3 runs.
|
| 213 |
+
|
| 214 |
+
<table><tr><td>GNN</td><td>TFN</td><td>SE(3)-Tr.</td><td>RF</td><td>EGNN</td><td>EGNNReg</td><td>GMN</td><td>GMN-L</td></tr><tr><td>67.3±1.1</td><td>66.9±2.7</td><td>60.9±0.9</td><td>197.0±1.0</td><td>59.1±2.1</td><td>59.5±2.2</td><td>43.9±1.1</td><td>50.9±0.7</td></tr></table>
|
| 215 |
+
|
| 216 |
+

|
| 217 |
+
Figure 6: Left to Right: initial position, GMN, EGNN (all in blue). Ground truths are in red.
|
| 218 |
+
|
| 219 |
+
# 5 CONCLUSION
|
| 220 |
+
|
| 221 |
+
In this paper, we propose Graph Mechanics Networks (GMN) that are capable of characterising constrained systems of interacting objects. The core is making use of generalized coordinates, by which the constraints are implicitly and exactly encapsulated in the forward kinematics. To enable Euclidean symmetry, we have developed a general form of equivariant functions to simulate the interaction forces and backward dynamics, whose expressivity is theoretically justified. For the simulated systems with particles, sticks and hinges, GMN outperforms existing methods regarding prediction error, constraint satisfaction and data efficiency. Moreover, the evaluations on two realworld datasets support the generalization ability of GMN towards complex systems.
|
| 222 |
+
|
| 223 |
+
# 6 REPRODUCIBILITY STATEMENT
|
| 224 |
+
|
| 225 |
+
The complete proof of the theorems is provided in Appendix A. The hyper-parameters and other experimental details are provided in Appendix E.
|
| 226 |
+
|
| 227 |
+
Our code is available at: https://github.com/hanjq17/GMN.
|
| 228 |
+
|
| 229 |
+
# 7 ETHICS STATEMENT
|
| 230 |
+
|
| 231 |
+
The research in this paper does NOT involve any human subject, and our dataset is not related to any issue of privacy and can be used publicly. All authors of this paper follow the ICLR Code of Ethics (https://iclr.cc/public/CodeOfEthics).
|
| 232 |
+
|
| 233 |
+
# ACKNOWLEDGMENTS
|
| 234 |
+
|
| 235 |
+
This work was jointly supported by the following projects: the Scientific Innovation 2030 Major Project for New Generation of AI under Grant NO. 2020AAA0107300, Ministry of Science and Technology of the People’s Republic of China; the National Natural Science Foundation of China (No.62006137); Tencent AI Lab Rhino-Bird Visiting Scholars Program (VS2022TEG001); Beijing Academy of Artificial Intelligence (BAAI).
|
| 236 |
+
|
| 237 |
+
# REFERENCES
|
| 238 |
+
|
| 239 |
+
Peter W Battaglia, Razvan Pascanu, Matthew Lai, Danilo Rezende, and Koray Kavukcuoglu. Interaction networks for learning about objects, relations and physics. arXiv preprint arXiv:1612.00222, 2016.
|
| 240 |
+
|
| 241 |
+
Stefan Chmiela, Alexandre Tkatchenko, Huziel E Sauceda, Igor Poltavsky, Kristof T Schutt, and ¨ Klaus-Robert Muller. Machine learning of accurate energy-conserving molecular force fields. ¨ Science advances, 3(5):e1603015, 2017.
|
| 242 |
+
|
| 243 |
+
CMU. Carnegie-mellon motion capture database. 2003. URL http://mocap.cs.cmu.edu.
|
| 244 |
+
|
| 245 |
+
George Cybenko. Approximation by superpositions of a sigmoidal function. Mathematics of control, signals and systems, 2(4):303–314, 1989.
|
| 246 |
+
|
| 247 |
+
Mingyu Ding, Zhenfang Chen, Tao Du, Ping Luo, Josh Tenenbaum, and Chuang Gan. Dynamic visual reasoning by learning differentiable physics models from video and language. NeurIPS, 34, 2021.
|
| 248 |
+
|
| 249 |
+
Marc Finzi, Samuel Stanton, Pavel Izmailov, and Andrew Gordon Wilson. Generalizing convolutional neural networks for equivariance to lie groups on arbitrary continuous data. In International Conference on Machine Learning, pp. 3165–3176. PMLR, 2020a.
|
| 250 |
+
|
| 251 |
+
Marc Finzi, Ke Alexander Wang, and Andrew Gordon Wilson. Simplifying hamiltonian and lagrangian neural networks via explicit constraints. arXiv preprint arXiv:2010.13581, 2020b.
|
| 252 |
+
|
| 253 |
+
Fabian B Fuchs, Daniel E Worrall, Volker Fischer, and Max Welling. Se (3)-transformers: 3d rototranslation equivariant attention networks. arXiv preprint arXiv:2006.10503, 2020.
|
| 254 |
+
|
| 255 |
+
Chuang Gan, Jeremy Schwartz, Seth Alter, Martin Schrimpf, James Traer, Julian De Freitas, Jonas Kubilius, Abhishek Bhandwaldar, Nick Haber, Megumi Sano, et al. Threedworld: A platform for interactive multi-modal physical simulation. NeurIPS, 2021.
|
| 256 |
+
|
| 257 |
+
Kurt Hornik. Approximation capabilities of multilayer feedforward networks. Neural networks, 4 (2):251–257, 1991.
|
| 258 |
+
|
| 259 |
+
Michael J Hutchinson, Charline Le Lan, Sheheryar Zaidi, Emilien Dupont, Yee Whye Teh, and Hyunjik Kim. Lietransformer: equivariant self-attention for lie groups. In International Conference on Machine Learning, pp. 4533–4543. PMLR, 2021.
|
| 260 |
+
|
| 261 |
+
Thomas Kipf, Ethan Fetaya, Kuan-Chieh Wang, Max Welling, and Richard Zemel. Neural relational inference for interacting systems. arXiv preprint arXiv:1802.04687, 2018.
|
| 262 |
+
|
| 263 |
+
Jonas Kohler, Leon Klein, and Frank No ¨ e. Equivariant flows: sampling configurations for multi-´ body systems with symmetric energies. arXiv preprint arXiv:1910.00753, 2019.
|
| 264 |
+
|
| 265 |
+
Yunzhu Li, Jiajun Wu, Russ Tedrake, Joshua B Tenenbaum, and Antonio Torralba. Learning particle dynamics for manipulating rigid bodies, deformable objects, and fluids. arXiv preprint arXiv:1810.01566, 2018.
|
| 266 |
+
|
| 267 |
+
Michael Lutter, Christian Ritter, and Jan Peters. Deep lagrangian networks: Using physics as model prior for deep learning. arXiv preprint arXiv:1907.04490, 2019.
|
| 268 |
+
|
| 269 |
+
Karolis Martinkus, Aurelien Lucchi, and Nathanael Perraudin. Scalable graph networks for particle ¨ simulations. AAAI, 2021.
|
| 270 |
+
|
| 271 |
+
RV Mises and Hilda Pollaczek-Geiringer. Praktische verfahren der gleichungsauflosung. ¨ ZAMMJournal of Applied Mathematics and Mechanics/Zeitschrift fur Angewandte Mathematik und ¨ Mechanik, 9(1):58–77, 1929.
|
| 272 |
+
|
| 273 |
+
Damian Mrowca, Chengxu Zhuang, Elias Wang, Nick Haber, Li Fei-Fei, Joshua B Tenenbaum, and Daniel LK Yamins. Flexible neural representation for physics prediction. arXiv preprint arXiv:1806.08047, 2018.
|
| 274 |
+
|
| 275 |
+
Tobias Pfaff, Meire Fortunato, Alvaro Sanchez-Gonzalez, and Peter W Battaglia. Learning meshbased simulation with graph networks. arXiv preprint arXiv:2010.03409, 2020.
|
| 276 |
+
|
| 277 |
+
Alvaro Sanchez-Gonzalez, Victor Bapst, Kyle Cranmer, and Peter Battaglia. Hamiltonian graph networks with ode integrators. arXiv preprint arXiv:1909.12790, 2019.
|
| 278 |
+
|
| 279 |
+
Alvaro Sanchez-Gonzalez, Jonathan Godwin, Tobias Pfaff, Rex Ying, Jure Leskovec, and Peter Battaglia. Learning to simulate complex physics with graph networks. In International Conference on Machine Learning, pp. 8459–8468. PMLR, 2020.
|
| 280 |
+
|
| 281 |
+
Victor Garcia Satorras, Emiel Hoogeboom, and Max Welling. E(n) equivariant graph neural networks. arXiv preprint arXiv:2102.09844, 2021.
|
| 282 |
+
|
| 283 |
+
Chence Shi, Shitong Luo, Minkai Xu, and Jian Tang. Learning gradient fields for molecular conformation generation. arXiv preprint arXiv:2105.03902, 2021.
|
| 284 |
+
|
| 285 |
+
Joshua B Tenenbaum, Charles Kemp, Thomas L Griffiths, and Noah D Goodman. How to grow a mind: Statistics, structure, and abstraction. science, 331(6022):1279–1285, 2011.
|
| 286 |
+
|
| 287 |
+
Nathaniel Thomas, Tess Smidt, Steven Kearnes, Lusann Yang, Li Li, Kai Kohlhoff, and Patrick Riley. Tensor field networks: Rotation-and translation-equivariant neural networks for 3d point clouds. arXiv preprint arXiv:1802.08219, 2018.
|
| 288 |
+
|
| 289 |
+
Benjamin Ummenhofer, Lukas Prantl, Nils Thuerey, and Vladlen Koltun. Lagrangian fluid simulation with continuous convolutions. In International Conference on Learning Representations, 2019.
|
| 290 |
+
|
| 291 |
+
Zonghan Wu, Shirui Pan, Fengwen Chen, Guodong Long, Chengqi Zhang, and S Yu Philip. A comprehensive survey on graph neural networks. IEEE transactions on neural networks and learning systems, 32(1):4–24, 2020.
|
| 292 |
+
|
| 293 |
+
Shuqi Yang, Xingzhe He, and Bo Zhu. Learning physical constraints with neural projections. arXiv preprint arXiv:2006.12745, 2020.
|
| 294 |
+
|
| 295 |
+
# A THE PROOF OF THEOREM 1
|
| 296 |
+
|
| 297 |
+
In the following, we define the orthogonal group as $\mathcal { O } ( d ) = \{ O \in \mathbb { R } ^ { d \times d } \mid O ^ { \top } O = O O ^ { \top } = I _ { d } \}$ Prior to providing the proof for Theorem 1, we first list two necessary lemmas below.
|
| 298 |
+
|
| 299 |
+
Lemma 1. For any two matrices $Z _ { 1 } , Z _ { 2 } \in \mathbb { R } ^ { d \times m }$ , we have this equivalence: $\exists O \in { \mathcal { O } } ( d ) , O Z _ { 1 } =$ ${ \cal Z } _ { 2 } \Leftrightarrow { \cal Z } _ { 1 } ^ { \top } { \cal Z } _ { 1 } = \dot { \cal Z } _ { 2 } ^ { \top } { \cal Z } _ { 2 }$ .
|
| 300 |
+
|
| 301 |
+
Proof. We only need to prove the $" \Leftarrow 2 ^ { , 3 }$ direction, as $\ " \Rightarrow \ "$ holds clearly. Suppose the SVD decomposition of $Z _ { 1 }$ as $Z _ { 1 } , \bar { = } \ U _ { 1 } S _ { 1 } V _ { 1 } ^ { \top }$ with the left-singular matrix $U _ { 1 } \in { \mathcal { O } } ( d )$ , the singular diagonal matrix $S _ { 1 } ~ \in ~ \mathbb { R } ^ { d \times m }$ , and the right-singular matrix $V _ { 1 } ~ \in ~ { \mathcal { O } } ( m )$ . Since $Z _ { 1 } ^ { \top } Z _ { 1 } \ = \ Z _ { 2 } ^ { \top } \bar { Z _ { 2 } }$ , then there must exists a certain SVD decomposition of $Z _ { 2 }$ that shares the same singular matrix and right-singular matrix with $Z _ { 1 }$ , implying that $Z _ { \mathrm { 2 } } ~ = ~ U _ { \mathrm { 2 } } S _ { \mathrm { 1 } } V _ { \mathrm { 1 } } ^ { \top }$ , where $U _ { \mathrm { 2 } } ~ \in ~ \mathcal { O } \bar { ( d ) }$ . Hence, $\begin{array} { r } { \pmb { Z } _ { 2 } = \mathbf { \bar { U } } _ { 2 } \pmb { S } _ { 1 } \bar { \mathbf { V } } _ { 1 } ^ { \top } = U _ { 2 } \pmb { U } _ { 1 } ^ { \top } \pmb { U } _ { 1 } \pmb { S } _ { 1 } \pmb { V } _ { 1 } ^ { \top } = \mathbf { \bar { U } } _ { 2 } \pmb { \bar { U } } _ { 1 } ^ { \top } \pmb { Z } _ { 1 } } \end{array}$ , which concludes the proof owing to the orthogonality of $U _ { 2 } \pmb { U } _ { 1 } ^ { \top }$ . □
|
| 302 |
+
|
| 303 |
+
Lemma 2. The function $f : \mathbb { R } ^ { d \times m } \mathbb { R } ^ { m ^ { \prime } }$ is invariant on $\mathcal O ( d )$ , namely, $f ( O Z ) = f ( Z ) , \forall O \in$ $\mathcal { O } ( d ) , \forall Z \in \mathbb { R } ^ { d \times m }$ , if and only if there exists function $g : \mathbb { R } ^ { m \times m } \mathbb { R } ^ { m ^ { \prime } }$ satisfying $f ( Z ) =$ $g ( \boldsymbol { Z } ^ { \intercal } \boldsymbol { Z } )$ .
|
| 304 |
+
|
| 305 |
+
Proof. The sufficiency is obvious. We now prove the necessity. We define the equivalence class $[ Z _ { 0 } ] \ : = \ : \{ Z \ : \ : | \ : \exists O \in { \mathcal { O } } ( d ) , O Z = Z _ { 0 } \}$ . Since $f$ is invariant to the orthogonal transformation, it means $f$ is actually a function on the equivalence class, i.e., $f ( Z ) = \bar { f } ( [ Z ] )$ . On the other hand, according to Lemma 1, we have $[ \pmb { Z } _ { 1 } ] _ { - } ^ { \circ } = [ \pmb { Z } _ { 2 } ] \Leftrightarrow \pmb { Z } _ { 1 } ^ { \top } \pmb { Z } _ { 1 } = \pmb { \overset { . } { Z } } _ { 2 } ^ { \top } \pmb { Z } _ { 2 }$ , which implies the oneto-one correspondence between $[ Z ]$ and $Z ^ { \top } Z$ ; hence, there must exist a function $f ^ { \prime }$ leading to $[ Z ] = f ^ { \prime } ( Z ^ { \dagger } Z )$ , and $f ^ { \prime }$ is continuous in terms of any invariant metric such as the norm $\| Z ^ { \top } Z \|$ . Overall, $f ( Z ) = f ( [ Z ] ) = f ( f ^ { \prime } ( Z ^ { \top } Z ) ) : = g ( Z ^ { \top } Z )$ . □
|
| 306 |
+
|
| 307 |
+
We are now ready to prove Theorem 1 that is copied below for better readability.
|
| 308 |
+
|
| 309 |
+
Theorem 1. If $m \geq d$ and the row rank of $z$ is full, i.e. $r a n k ( Z ) = d ,$ , then for any continuous orthogonality-equivariant function ${ \hat { \varphi } } ( Z , h )$ , there must exist an MLP $\sigma _ { w }$ satisfying $\parallel \varphi ( \boldsymbol { Z } , h ) \mathrm { ~ - ~ }$ $\hat { \varphi } ( Z , h ) \rVert < \epsilon$ for arbitrarily small error .
|
| 310 |
+
|
| 311 |
+
Proof. Without loss of generality, we will omit the non-vector term $h$ , which does not change the story but let our proof more concise. Because $z$ is of full row-rank, the columns of an arbitrary function $\hat { \varphi } ( Z )$ can be represented as a linear combination of the columns of $z$ ; in other words, there must exist a function $\pi : \mathbb { R } ^ { d \times m } \mathbb { R } ^ { m \times m ^ { \prime } }$ giving rise to $\hat { \varphi } ( Z ) = Z \pi ( Z )$ . Considering the orthogonality-equivariance, we derive the property of $\pi ( Z )$ as:
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
\begin{array} { r l } & { ~ \hat { \varphi } ( O Z ) = O \hat { \varphi } ( Z ) , } \\ & { \Rightarrow O Z \pi ( O Z ) = O Z \pi ( Z ) , } \\ & { ~ \Rightarrow Z \pi ( O Z ) = Z \pi ( Z ) . } \end{array}
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
Since $d \leq m$ and the row-rank of $z$ is full, we perform the compact SVD decomposition on $z$ , namely, ${ \cal Z } = U _ { \cal Z } S _ { \cal Z } V _ { \cal Z } ^ { \top }$ , where $U _ { Z } \in \mathcal { O } ( d ) , \ : \dot { \mathbb { R } } ^ { d \times d } \ni S _ { Z } \textgreater \dot { 0 }$ , and $V _ { Z } \in \mathbb { R } ^ { \hat { m } \times d }$ satisfying $V _ { Z } ^ { \top } V _ { Z } = I _ { d }$ . Eq. 14 becomes:
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
Z \pi ( O Z ) = Z \pi ( Z ) ,
|
| 321 |
+
$$$$
|
| 322 |
+
\begin{array} { c } { { { \cal Z } \pi ( { \cal U } Z ) = { \cal Z } \pi ( Z ) , } } \\ { { \Rightarrow U _ { Z } S _ { Z } V _ { Z } ^ { \top } \pi ( { \cal O } Z ) = U _ { Z } S _ { Z } V _ { Z } ^ { \top } \pi ( Z ) , } } \\ { { \Rightarrow S _ { Z } V _ { Z } ^ { \top } \pi ( { \cal O } Z ) = S _ { Z } V _ { Z } ^ { \top } \pi ( Z ) . } } \end{array}
|
| 323 |
+
$$
|
| 324 |
+
|
| 325 |
+
Given that $\begin{array} { r } { S _ { Z } = \mathrm { E i g e n } ( Z ^ { \top } Z ) } \end{array}$ and $V _ { Z } = \mathrm { E i g e n V e c t o r } ( Z ^ { \top } Z )$ are respectively the eigenvalues and eigenvectors of $\bar { Z } ^ { \top } \dot { Z }$ and are clearly invariant to the orthogonal transformation of $z$ . Their values can be numerically approximated by iterative programs, such as the power method (Mises & Pollaczek-Geiringer, 1929), thus can be treated as the continuous functions of $Z ^ { \top } Z$ . Let us define $g ^ { \prime } ( Z ) : = S _ { Z } V _ { Z } ^ { \top } \pi ( Z )$ . Then, we keep deriving Eq. 15 by:
|
| 326 |
+
|
| 327 |
+
$$
|
| 328 |
+
\begin{array} { r l } & { ~ S _ { Z } V _ { Z } ^ { \top } \pi ( O Z ) = S _ { Z } V _ { Z } ^ { \top } \pi ( Z ) , } \\ & { \Rightarrow S _ { O Z } V _ { O Z } ^ { \top } \pi ( O Z ) = S _ { Z } V _ { Z } ^ { \top } \pi ( Z ) , } \\ & { ~ \Rightarrow g ^ { \prime } ( O Z ) = g ^ { \prime } ( Z ) . } \end{array}
|
| 329 |
+
$$
|
| 330 |
+
|
| 331 |
+
According to Lemma 2, the function $g$ satisfies Eq. 16 if and only if it is written as $g ^ { \prime } ( Z ) = g ( Z ^ { \top } Z )$ for a certain function $g$ . By checking the formulation of $\hat { \varphi } ( Z )$ as demonstrated before, we arrive at
|
| 332 |
+
|
| 333 |
+
$$
|
| 334 |
+
\begin{array} { r l } & { \hat { \varphi } ( Z ) = Z \pi ( Z ) , } \\ & { \quad \quad \quad = U _ { Z } S _ { Z } V _ { Z } ^ { \top } \pi ( Z ) , } \\ & { \quad \quad \quad = U _ { Z } g ^ { \prime } ( Z ) , } \\ & { \quad \quad \quad = U _ { Z } g ( Z ^ { \top } Z ) , } \\ & { \quad \quad \quad = U _ { Z } S _ { Z } V _ { Z } ^ { \top } V _ { Z } S _ { Z } ^ { - 1 } g ( Z ^ { \top } Z ) , } \\ & { \quad \quad \quad = Z V _ { Z } S _ { Z } ^ { - 1 } g ( Z ^ { \top } Z ) , } \\ & { \quad \quad \quad : = Z \eta ( Z ^ { \top } Z ) . } \end{array}
|
| 335 |
+
$$
|
| 336 |
+
|
| 337 |
+
Here the function $\eta$ can be approximated by MLP whose universality has been justified by (Cybenko, 1989; Hornik, 1991). The conclusion of Theorem 1 is proved.
|
| 338 |
+
|
| 339 |
+
Corollary 1. Assume $m \geq d$ , and also the entries of $z$ are drawn independently from a distribution that is absolutely continuous with respect to the Lebesgue measure in $\mathbb { R }$ . Then, almost surely, the conclusion of Theorem 1 holds.
|
| 340 |
+
|
| 341 |
+
Proof. This is straightforward. When $\operatorname { r a n k } ( Z ) < d$ , the columns of $z$ are located in a subspace of $\mathbb { R } ^ { d }$ (for example a line or a plane in the 3D space), whose measure is zero. Therefore, the probability for making rank $\mathbf { \nabla } ( Z ) = d$ is 1, and we almost surely have the same conclusion as Theorem 1. □
|
| 342 |
+
|
| 343 |
+
Corollary 2. For any continuous orthogonality-equivariant function ${ \hat { \varphi } } ( Z , h )$ whose output is located in the linear subspace expanded by the columns of $z$ , the conclusion of Theorem $^ { l }$ holds universally.
|
| 344 |
+
|
| 345 |
+
Proof. According to the definition of $\hat { \varphi } ( Z )$ , we still obtain $\hat { \varphi } ( Z ) = Z \pi ( Z )$ . Let us assume $d > m$ (otherwise we can directly obtain Theorem 1), then the full SVD decomposition of $z$ is $z =$ $\bar { U } _ { Z } S _ { Z } V _ { Z } ^ { \top }$ , with $U _ { Z } \in { \mathcal { O } } ( d )$ , $S _ { Z } \in \mathbb { R } ^ { d \times m }$ , and $V _ { Z } \in { \mathcal { O } } ( m )$ . But here, $S _ { Z }$ is not strictly positive. Suppose $S _ { Z } = \left( { \cal S } _ { + } \right)$ , where $S _ { + } > 0$ . We retain that $S _ { Z } V _ { Z } ^ { \top } \pi ( Z ) = g ( Z ^ { \top } Z )$ by imitating the proof in Eq. 14-16. Analogous to Eq. 17, we derive,
|
| 346 |
+
|
| 347 |
+
$$
|
| 348 |
+
\begin{array} { r l } & { \hat { \varphi } ( Z ) = Z \pi ( Z ) , } \\ & { \quad \quad \quad = U _ { Z } g ( Z ^ { \top } Z ) , } \\ & { \quad \quad \quad = U _ { Z } S _ { Z } V _ { Z } ^ { \top } V _ { Z } \left( S _ { + } ^ { - 1 } , \mathbf { 0 } \right) g ( Z ^ { \top } Z ) , } \\ & { \quad \quad \quad = Z V _ { Z } \left( S _ { + } ^ { - 1 } , \mathbf { 0 } \right) g ( Z ^ { \top } Z ) , } \\ & { \quad \quad \quad : \quad = Z \eta ( Z ^ { \top } Z ) , } \end{array}
|
| 349 |
+
$$
|
| 350 |
+
|
| 351 |
+
which concludes the proof.
|
| 352 |
+
|
| 353 |
+
# B THE DYNAMICS ANALYSES FOR STICKS AND HINGES
|
| 354 |
+
|
| 355 |
+
The analytical forms of the dynamics for sticks and hinges can be found from a mechanics book. Here we derive the formulas on our own to make our paper more self-contained. For simplicity, we consider all particles to be of the equal mass and the sticks of no mass.
|
| 356 |
+
|
| 357 |
+
Dynamics analysis of sticks. In Fig. 7 (Left), we assume the forces acting on particles 1 and 2 are separately $f _ { 1 }$ and $f _ { 2 }$ . By following the theorem of the motion of the center of mass, the acceleration of the center is given by
|
| 358 |
+
|
| 359 |
+
$$
|
| 360 |
+
\ddot { \pmb q } _ { 0 } = \frac { { \pmb f } _ { 1 } + { \pmb f } _ { 2 } } { m } .
|
| 361 |
+
$$
|
| 362 |
+
|
| 363 |
+

|
| 364 |
+
Figure 7: Left: Dynamics of sticks. Right: Dynamics of hinges.
|
| 365 |
+
|
| 366 |
+
The rotation accelerations of particles 1 and 2 around the center are calculated by
|
| 367 |
+
|
| 368 |
+
$$
|
| 369 |
+
\ddot { \pmb { \theta } } _ { 0 1 } = \ddot { \pmb { \theta } } _ { 0 2 } = \frac { \pmb { M } } { J } = \frac { \pmb { x } _ { 0 1 } \times \pmb { f } _ { 1 } + \pmb { x } _ { 0 2 } \times \pmb { f } _ { 2 } } { m \| \pmb { x } _ { 0 1 } \| ^ { 2 } + m \| \pmb { x } _ { 0 2 } \| ^ { 2 } } ,
|
| 370 |
+
$$
|
| 371 |
+
|
| 372 |
+
where $M$ defines the total torque and $J$ is the moments of inertia.
|
| 373 |
+
|
| 374 |
+
Dynamics analysis of hinges. The analysis for hinges is more complicated than sticks. In Fig. 7 (Right), the forces on particles $0 , 1$ and 2 are $f _ { 0 } , f _ { 1 }$ and $f _ { 2 }$ . By using Newton’s second law,
|
| 375 |
+
|
| 376 |
+
$$
|
| 377 |
+
{ \pmb a } _ { 0 } + { \pmb a } _ { 1 } + { \pmb a } _ { 2 } = \frac { { \pmb f } } { m } ,
|
| 378 |
+
$$
|
| 379 |
+
|
| 380 |
+
where the aggregated force is $\pmb { f } = \pmb { f } _ { 0 } + \pmb { f } _ { 1 } + \pmb { f } _ { 2 }$ . In addition, the kinematics relations between the three particles show that
|
| 381 |
+
|
| 382 |
+
$$
|
| 383 |
+
\begin{array} { r } { \pmb { a } _ { 1 } = \pmb { a } _ { 0 } + \ddot { \pmb { \theta } } _ { 0 1 } \times \pmb { x } _ { 0 1 } + \dot { \pmb { \theta } } _ { 0 1 } \times \pmb { \nu } _ { \mathbf { 0 1 } } , } \\ { \pmb { a } _ { 2 } = \pmb { a } _ { 0 } + \ddot { \pmb { \theta } } _ { 0 2 } \times \pmb { x } _ { 0 2 } + \dot { \pmb { \theta } } _ { 0 2 } \times \pmb { \nu } _ { \mathbf { 0 2 } } , } \end{array}
|
| 384 |
+
$$
|
| 385 |
+
|
| 386 |
+
where $\dot { \pmb \theta } _ { 0 1 }$ and $\ddot { \theta } _ { 0 1 }$ denote the speed and acceleration of the rotation angle of particle 1 around 0, and $\nu _ { 0 1 }$ is the corresponding linear velocity; the symbols $\dot { \theta } _ { 0 2 } , \ddot { \theta } _ { 0 2 }$ and $\nu _ { 0 2 }$ are defined similarly. Moreover, the relative rotation acceleration of particle 1 to 0 is caused by the external force $f _ { 1 }$ and the inertia force $- m a _ { 0 }$ acting on 1, which derives that
|
| 387 |
+
|
| 388 |
+
$$
|
| 389 |
+
{ \ddot { \pmb { \theta } } } _ { 0 1 } = { \frac { M _ { 0 1 } } { J _ { 0 1 } } } = { \frac { { \pmb x } _ { 0 1 } \times ( { \pmb f } _ { 1 } - m { \pmb a } _ { 0 } ) } { m \| { \pmb x } _ { 0 1 } \| ^ { 2 } } } .
|
| 390 |
+
$$
|
| 391 |
+
|
| 392 |
+
Analogously,
|
| 393 |
+
|
| 394 |
+
$$
|
| 395 |
+
\ddot { \pmb { \theta } } _ { 0 2 } = \frac { M _ { 0 2 } } { J _ { 0 2 } } = \frac { \pmb { x } _ { 0 2 } \times ( \pmb { f } _ { 2 } - m \pmb { a } _ { 0 } ) } { m \| \pmb { x } _ { 0 2 } \| ^ { 2 } } .
|
| 396 |
+
$$
|
| 397 |
+
|
| 398 |
+
After substituting Eq. 24 into Eq. 22, and Eq. 25 into Eq. 23, and then rearranging Eq. 21, we have
|
| 399 |
+
|
| 400 |
+
$$
|
| 401 |
+
\pmb { a } _ { 0 } = ( \pmb { I } + \pmb { e } _ { 0 1 } \pmb { e } _ { 0 1 } ^ { \top } + \pmb { e } _ { 0 2 } \pmb { e } _ { 0 2 } ^ { \top } ) ^ { - 1 } \pmb { a } ,
|
| 402 |
+
$$
|
| 403 |
+
|
| 404 |
+
where repres $\begin{array} { r } { a = \frac { f } { m } - \dot { \theta } _ { 0 1 } \times \nu _ { 0 1 } - \dot { \theta } _ { 0 2 } \times \nu _ { 0 2 } - \left( I - e _ { 0 1 } e _ { 0 1 } ^ { \top } \right) \frac { f _ { 1 } } { m } - \left( I - e _ { 0 2 } e _ { 0 2 } ^ { \top } \right) \frac { f _ { 2 } } { m } } \end{array}$ with ck to $e _ { 0 1 }$ and plify $e _ { 0 2 }$ ${ \pmb x } _ { 0 1 }$ $\scriptstyle { \pmb x } _ { 0 2 }$
|
| 405 |
+
derivation by observing $\begin{array} { r } { \frac { \pmb { x } _ { 0 1 } \times \pmb { f } _ { 1 } \times \pmb { x } _ { 0 1 } } { \| \pmb { x } _ { 0 1 } \| ^ { 2 } } = ( \pmb { I } - \pmb { e } _ { 0 1 } \pmb { e } _ { 0 1 } ^ { \top } ) \pmb { f } _ { 1 } } \end{array}$ . Besides, $\pmb { I } + e _ { 0 1 } \pmb { e } _ { 0 1 } ^ { \top } + e _ { 0 2 } \pmb { e } _ { 0 2 } ^ { \top }$ is invertible,
|
| 406 |
+
hence Eq. 26 is always meaningful.
|
| 407 |
+
|
| 408 |
+
Substituting Eq. 26 back into Eq. 24 and Eq. 25 derives the values of $\ddot { \pmb \theta } _ { 0 1 }$ and $\ddot { \theta } _ { 0 2 }$ . Note that in $\ S 3 . 3$ , we employ the denotation of generalized coordinates by $q _ { 0 } , \dot { q } _ { 0 }$ and $\ddot { q } _ { \mathrm { 0 } }$ which indeed share the same meaning with the Cartesian coordinates ${ \bf { \mathcal { x } } } _ { 0 } , { \pmb { v } } _ { 0 }$ and $\mathbf { \delta a } _ { 0 }$ of particle 0.
|
| 409 |
+
|
| 410 |
+
# C KINEMATICS DECOMPOSITION
|
| 411 |
+
|
| 412 |
+
We manually build the forward kinematics (Eq. 9) of the stick (and hinge), which relies on the domain knowledge of the underlying physics. However, for complex systems, we no longer require to derive the kinematics of the entire system. Instead, we propose kinematics decomposition, a simple yet effective trick that can decompose each input system (an arbitrary graph) into particles and sticks. Taking the MD17 dataset as an example, for each molecule, we select certain bonds as sticks (the circles in Fig. 5) and the remaining atoms as isolated particles; in this way, we obtain a set of particles and sticks. Note that different sticks are not allowed to intersect; otherwise, it will generate two values for the intersecting particle of two sticks and cause ambiguity if these two values are distinct. Although this kind of kinematics decomposition will only maintain partial constraints, it greatly enlarges the application scope of our current formulation Eq. (5-9) without any revision. More importantly, our experiments verify that GMN by this formulation is sufficient to surpass other methods on complex systems like molecules. On CMU Motion Capture, since the motion graph contains no circle and is of the tree-like structure, it is tractable to derive the exact forward kinematics by recursive kinematics computation from the root node. Yet, we still encourage the usage of the above kinematics decomposition for its easy implementation and compatibility with our GMN.
|
| 413 |
+
|
| 414 |
+
Table 6: Prediction error $( \times 1 0 ^ { - 2 } )$ on various types of systems. The first column “ ${ \bf \dot { p } } , s , h ^ { \prime \prime }$ denotes the scenario with p isolated particles, s sticks and h hinges. Models are trained with 500 samples.
|
| 415 |
+
|
| 416 |
+
<table><tr><td></td><td>GMN</td><td>EGNN</td><td>EGNNReg</td><td>GNN</td><td>TFN</td><td>SE(3)-Tr.</td><td>RF</td><td>Linear</td></tr><tr><td>1,2,0</td><td>1.84</td><td>2.81</td><td>2.94</td><td>5.33</td><td>11.54</td><td>5.54</td><td>3.50</td><td>8.23</td></tr><tr><td>2,0,1</td><td>2.02</td><td>2.27</td><td>2.66</td><td>5.01</td><td>9.87</td><td>5.14</td><td>3.07</td><td>7.55</td></tr><tr><td>2,4,0</td><td>2.34</td><td>3.59</td><td>3.87</td><td>8.05</td><td>11.30</td><td>9.22</td><td>5.37</td><td>10.10</td></tr><tr><td>0,5,0</td><td>2.54</td><td>4.13</td><td>4.29</td><td>8.63</td><td>11.92</td><td>9.83</td><td>5.94</td><td>10.48</td></tr><tr><td>7,0,1</td><td>2.39</td><td>2.66</td><td>3.41</td><td>7.05</td><td>10.67</td><td>8.38</td><td>4.66</td><td>9.71</td></tr><tr><td>1,0,3</td><td>3.21</td><td>4.56</td><td>5.14</td><td>8.32</td><td>11.62</td><td>9.57</td><td>5.91</td><td>9.90</td></tr><tr><td>3,2,1</td><td>2.48</td><td>4.67</td><td>7.01</td><td>7.58</td><td>11.66</td><td>8.95</td><td>5.25</td><td>9.76</td></tr><tr><td>4,8,0</td><td>3.69</td><td>4.79</td><td>7.09</td><td>9.65</td><td>12.05</td><td>11.21</td><td>7.59</td><td>11.45</td></tr><tr><td>0,10,0</td><td>2.92</td><td>4.75</td><td>5.03</td><td>9.83</td><td>13.43</td><td>11.42</td><td>7.59</td><td>11.36</td></tr><tr><td>8,0,4</td><td>3.37</td><td>4.17</td><td>5.32</td><td>9.49</td><td>11.72</td><td>11.12</td><td>7.51</td><td>11.44</td></tr><tr><td>2,0,6</td><td>4.06</td><td>5.06</td><td>5.58</td><td>10.13</td><td>12.13</td><td>11.74</td><td>8.15</td><td>11.61</td></tr><tr><td>5,3,3</td><td>4.08</td><td>4.59</td><td>6.31</td><td>9.77</td><td>12.23</td><td>11.59</td><td>7.73</td><td>11.62</td></tr></table>
|
| 417 |
+
|
| 418 |
+
# D FULL ALGORITHMIC DETAILS
|
| 419 |
+
|
| 420 |
+
In the main body of the paper, for better readability, we first introduce the general pipeline of our method in $\ S \ 3 . 1$ and then present the implementation details by taking the angels into account in $\ S \ 3 . 3$ . Here, we combine them into one singe algorithmic flowchart in Alg. 1.
|
| 421 |
+
|
| 422 |
+
# E MORE EXPERIMENTAL DETAILS AND RESULTS
|
| 423 |
+
|
| 424 |
+
Hyper-parameters and baselines. For GNN, RF, EGNN, EGNNReg, and GMN, we empirically find that the following hyper-parameters generally work well, and use them across all experimental evaluations: batch size 200, Adam optimizer with learning rate 0.0005, hidden dim 64, and weight decay $1 \times 1 0 ^ { - 1 0 }$ . All models are evaluated with four layers. SE(3)-Transformer and TFN do not perform well on our datasets, potentially due to the challenge of highly complex and constrained systems. Consequently, we tune the hyper-parameters and adopt the following configuration: batch size 100, learning rate 0.001, hidden $\mathrm { d i m } 6 4$ , representation degrees 3 and weight decay $1 \times 1 0 ^ { - 8 }$ . Models are trained for 600 epochs on the simulation dataset, and 500 epochs on the real-world datasets. EGNNReg is a variant of EGNN that explicitly adds the constraint error into its training loss by a regularization factor of $\lambda$ . In our experiments, we also treat $\lambda$ as a hyper-parameter, and choose $\lambda$ that yields the best performance within the range [0.01, 0.1].
|
| 425 |
+
|
| 426 |
+
Detailed experimental setup on MD17. We randomly split the dataset into train/validation/test sets containing 500/2000/2000 frame pairs respectively. We choose $T = 5 0 0 0$ as the span between the input and prediction frames, and the difference in positions as the input velocity. The hyper
|
| 427 |
+
|
| 428 |
+
# Algorithm 1 Graph Mechanics Networks (GMNs)
|
| 429 |
+
|
| 430 |
+
Input: Initial states of all particles $\{ S _ { i } ^ { 0 } = ( \pmb { x } _ { i } ^ { 0 } , \pmb { v } _ { i } ^ { 0 } ) \} _ { i = 1 } ^ { N }$ and features $\{ h _ { i } ^ { 0 } \} _ { i } ^ { N }$ ; Learnable equivariant functions $\varphi _ { 1 } , \varphi _ { 2 } , \psi , \psi ^ { \prime }$ ; Layer number $L$ .
|
| 431 |
+
|
| 432 |
+
Compute the generalized coordinates of all structural objects $\{ ( \pmb q _ { k } ^ { 0 } , \dot { \pmb q } _ { k } ^ { 0 } , \{ \dot { \pmb \theta } _ { k i } ^ { 0 } \} _ { i \in \mathcal { O } _ { k } } ) \} _ { k = 1 } ^ { K }$ . for layer $l = 1$ to $L$ do
|
| 433 |
+
|
| 434 |
+
for particle $i = 1$ to $N$ do
|
| 435 |
+
|
| 436 |
+
Calculate the interaction force $\mathbf { \mathcal { f } } _ { i } ^ { l }$ and feature $h _ { i } ^ { l }$ for each particle by:
|
| 437 |
+
|
| 438 |
+
$$
|
| 439 |
+
\pmb { f } _ { i } ^ { l } , h _ { i } ^ { l } = \sum _ { j = 1 } ^ { N } \varphi _ { 1 } ( \pmb { x } _ { j i } ^ { l - 1 } , h _ { i } ^ { l - 1 } , h _ { j } ^ { l - 1 } , e _ { j i } ) .
|
| 440 |
+
$$
|
| 441 |
+
|
| 442 |
+
# end for
|
| 443 |
+
|
| 444 |
+
for object $k = 1$ to $K$ do
|
| 445 |
+
|
| 446 |
+
Inference the generalized Cartesian acceleration $\ddot { \pmb q } _ { k } ^ { l }$ via:
|
| 447 |
+
|
| 448 |
+
$$
|
| 449 |
+
\begin{array} { r l } & { \ddot { \pmb q } _ { k } ^ { l } = \displaystyle \sum _ { i \in \mathcal { O } _ { k } } \varphi _ { 2 } ( { \pmb f } _ { i } ^ { l } ) , \quad \mathrm { ( f o r ~ s t i c k s ) } } \\ & { \ddot { \pmb q } _ { k } ^ { l } = \displaystyle \sum _ { i \in \mathcal { O } _ { k } } \varphi _ { 2 } ( { \pmb f } _ { i } ^ { l } , { \pmb x } _ { k i } ^ { l - 1 } , { \pmb v } _ { k i } ^ { l - 1 } ) . \quad \mathrm { ( f o r ~ h i n g e s ) } } \end{array}
|
| 450 |
+
$$
|
| 451 |
+
|
| 452 |
+
Derive the generalized angle acceleration:
|
| 453 |
+
|
| 454 |
+
$$
|
| 455 |
+
\begin{array} { r l } & { \ddot { \pmb { \theta } } _ { k i } = \cfrac { \sum _ { i \in \mathcal { O } _ { k } } \pmb { x } _ { k i } \times \pmb { f } _ { i } } { \sum _ { i \in \mathcal { O } _ { k } } \| \pmb { x } _ { k i } \| ^ { 2 } } , \forall i \in \mathcal { O } _ { k } , \quad \mathrm { ( f o r ~ s t i c k s ) } } \\ & { \ddot { \pmb { \theta } } _ { k i } = \cfrac { \pmb { x } _ { k i } \times ( \pmb { f } _ { i } - \ddot { \pmb { q } } _ { k } ) } { \| \pmb { x } _ { k i } \| ^ { 2 } } , \forall i \in \mathcal { O } _ { k } . \quad \mathrm { ( f o r ~ h i n g e s ) } } \end{array}
|
| 456 |
+
$$
|
| 457 |
+
|
| 458 |
+
Update the positions and velocities as follows:
|
| 459 |
+
|
| 460 |
+
$$
|
| 461 |
+
\begin{array} { r l } & { \displaystyle \dot { q } _ { k } ^ { l } = \psi \big ( \sum _ { i \in \mathcal { O } _ { k } } h _ { i } ^ { l - 1 } \big ) \dot { q } _ { k } ^ { l - 1 } + \ddot { q } _ { k } ^ { l } , } \\ & { \displaystyle q _ { k } ^ { l } = q _ { k } ^ { l - 1 } + \dot { q } _ { k } ^ { l } , } \\ & { \displaystyle \dot { \theta } _ { k i } ^ { l } = \psi ^ { \prime } \big ( \sum _ { i \in \mathcal { O } _ { k } } h _ { i } ^ { l - 1 } \big ) \dot { \theta } _ { k i } ^ { l - 1 } + \ddot { \theta } _ { k i } ^ { l } , \forall i \in \mathcal { O } _ { k } . } \end{array}
|
| 462 |
+
$$
|
| 463 |
+
|
| 464 |
+
Perform the forward kinematics for each particle in $\mathcal { O } _ { k }$ :
|
| 465 |
+
|
| 466 |
+
$$
|
| 467 |
+
\begin{array} { r l } & { \pmb { x } _ { i } ^ { l } = \pmb { q } _ { k } ^ { l } + \mathrm { r o t } ( \dot { \pmb { \theta } } _ { k i } ^ { l } ) \pmb { x } _ { k i } ^ { l - 1 } , \forall i \in \mathcal { O } _ { k } , } \\ & { \pmb { v } _ { i } ^ { l } = \dot { \pmb { q } } _ { k } ^ { l } + \dot { \pmb { \theta } } _ { k i } ^ { l } \times \pmb { x } _ { k i } ^ { l } , \forall i \in \mathcal { O } _ { k } . } \end{array}
|
| 468 |
+
$$
|
| 469 |
+
|
| 470 |
+
end for
|
| 471 |
+
|
| 472 |
+
Output: The predicted states of all particles $\{ S _ { i } ^ { L } \} _ { i = 1 } ^ { N }$ parameters of all models are kept the same as the synthetic dataset. We masked out the hydrogen atoms, focusing on the prediction of large atoms. We further augment the original molecular graph with 2-hop neighbors, and concatenate the hop index with atom numbers of the connected atoms as well as the edge type indicator as the edge feature, similar to Shi et al. (2021). We use the norm of velocity concatenated with the atom number as the node feature. We randomly select bonds without commonly-connected atoms as sticks, and the rest of atoms as isolated particles. Although by this means not all the bond lengths are preserved, our experiment does illustrate that this is a simple but effective strategy of applying GMN on complex systems like molecules.
|
| 473 |
+
|
| 474 |
+
Detailed experimental setup on CMU Motion Capture. We first split the data into train/val/test sets containing 11/6/6 trials respectively. We then sample from the trials to get 200/600/600 frame pairs with $T = 3 0$ . We use the norm of velocity as node feature. We also augment the edges with 2-hop neighbors, and use the edge type indicator as edge feature. As for GMN, we sample 6 key bones of human body (as specified in Appendix C) as sticks, resulting in a system with 19 isolated particles and 6 sticks. Empirically, we select the edges connecting nodes (0, 11), (2, 3), (7, 8), (12, 13), (17, 18), and (24, 25) as sticks on the motion capture dataset, which indeed are the key parts of human body like the arms and legs.
|
| 475 |
+
|
| 476 |
+

|
| 477 |
+
Figure 8: Left: initial position(s). Middle: the prediction(s) of GMN (in blue). Right: the prediction(s) of EGNN (in blue). Ground truth is marked in red. Better viewed by zooming in.
|
| 478 |
+
|
| 479 |
+

|
| 480 |
+
Figure 9: Left: initial position (in blue). Middle: the prediction of GMN (in blue). Right: the prediction of EGNN (in blue). Ground truths are marked in red. Better viewed by zooming in.
|
| 481 |
+
|
| 482 |
+
More visualizations. We visualize the prediction outcomes by GMN and EGNN in Fig. 8 on the simulation dataset. GMN is found to be able to track the ground-truth trajectories accurately, whereas EGNN yields clear position errors and particularly breaks the constraints for sticks and hinges. These results are consistent with the performance in Table 1. Fig. 9 provides extra visualization on Motion Capture. Similarly, GMN yields more accurate prediction than EGNN.
|
| 483 |
+
|
| 484 |
+
More experimental results. In Table 6, we provide a comprehensive performance comparison of different models under more scenarios with 500 training samples. Clearly, GMN outperforms other models on all object combinations involved. Besides, we provide the learning curve for GMN, EGNN, and EGNNReg on the simulation dataset (3,2,1) in Fig. 10. GMN yields lower training loss and testing loss than EGNN and EGNNReg, benefiting from its constraint modeling.
|
| 485 |
+
|
| 486 |
+

|
| 487 |
+
Figure 10: Learning curves on (3,2,1) with 500 training samples.
|
| 488 |
+
|
| 489 |
+
# F MORE ABLATIONS
|
| 490 |
+
|
| 491 |
+
Hinge treated as two sticks. We treat 0-1, 0-2 as two sticks, and apply the stick FK respectively. Afterwards, we translate the two sticks such that the 0s coincide at the midpoint of their predicted positions. From Table 7, we find that this strategy performs worse than the hinge-modeled GMN, since splitting the hinge into two sticks overlooks the kinematics at the connected point. Yet and still, it performs better than EGNN, again verifying the benefit of our proposed constraint modeling.
|
| 492 |
+
|
| 493 |
+
Table 7: Ablation on hinge FK.
|
| 494 |
+
|
| 495 |
+
<table><tr><td rowspan="2"></td><td colspan="3">|Train| = 500</td><td colspan="2">|Train| = 1500</td></tr><tr><td>3,2,1</td><td>2,0,6</td><td>5,3,3</td><td>3,2,1</td><td>2,0,6 5,3,3</td></tr><tr><td>EGNN</td><td>4.67</td><td>5.06</td><td>4.59</td><td>2.54</td><td>3.42</td></tr><tr><td>EGNNReg</td><td>7.01</td><td>5.58</td><td>6.31</td><td>2.62</td><td>3.50 3.61 3.07</td></tr><tr><td>GMN (Stick only)</td><td>3.02</td><td>4.32</td><td>4.21</td><td>2.37</td><td>3.30 2.88</td></tr><tr><td>GMN</td><td>2.48</td><td>4.06</td><td>4.08</td><td>2.10</td><td>3.22 2.86</td></tr></table>
|
| 496 |
+
|
| 497 |
+
Charges as node or edge feature. In the experiment we by default assign $e _ { i j } = c _ { i } c _ { j }$ as the edge feature (denoted as “Edge $+ \textrm { C } \ '$ ). Here we instead concatenate $c _ { i }$ to the node feature of particle $i$ , and set all $e _ { i j } = 0$ (denoted as $\mathbf { \tilde { \Sigma } } ^ { \mathrm { 6 6 } } \mathbf { N o d e } + \mathbf { C } ^ { \prime }$ ). In Table 8 we observe that these alternatives on charges make very limited difference on performance, and indeed the models can learn the interaction of charges from node features, which is truly the case as depicted in Eq. 2 and 5.
|
| 498 |
+
|
| 499 |
+
Table 8: Comparison of charge-assigning strategies.
|
| 500 |
+
|
| 501 |
+
<table><tr><td></td><td colspan="5">Node +C</td><td colspan="5">Edge + C</td></tr><tr><td></td><td>1,2,0</td><td>2,0,1</td><td>3,2,1</td><td>0,10,0</td><td>5,3,3</td><td>1,2.0</td><td>2,0,1</td><td>3,2,1</td><td>0,10,0</td><td>5,3,3</td></tr><tr><td>EGNN</td><td>2.89</td><td>2.28</td><td>4.25</td><td>4.80</td><td>4.50</td><td>2.81</td><td>2.27</td><td>4.67</td><td>4.75</td><td>4.59</td></tr><tr><td>EGNNReg</td><td>3.17</td><td>2.74</td><td>8.20</td><td>5.01</td><td>6.64</td><td>2.94</td><td>2.66</td><td>7.01</td><td>5.03</td><td>6.31</td></tr><tr><td>GMN</td><td>1.89</td><td>2.01</td><td>2.63</td><td>3.07</td><td>4.02</td><td>1.84</td><td>2.02</td><td>2.48</td><td>2.92</td><td>4.08</td></tr></table>
|
| 502 |
+
|
| 503 |
+
# G CONSTRAINT SATISFACTION
|
| 504 |
+
|
| 505 |
+
Constraint error. The constraint error is computed as the total change in the lengths of sticks and hinges between the input and output, averaged per trajectory. Specifically, for hinges, the two edges are both considered.
|
| 506 |
+
|
| 507 |
+
Results. One vital feature of GMN is that it maintains the geometrical constraints exactly and inherently. To show this, Table 9 records the corresponding constraint errors of several typical models. The results do verify our claim that GMN always outputs near-zero errors (all below 1e-4). Although EGNNReg that augments EGNN with regulation helps in reducing the constraint errors, it is data-driven and limited by the number of training samples; further, the constraints are pursued softly, making it defective for the applications where hard constraints are indispensable.
|
| 508 |
+
|
| 509 |
+
Table 9: Constraint error on various types of systems.
|
| 510 |
+
|
| 511 |
+
<table><tr><td></td><td colspan="5">|Train| = 500</td><td colspan="5">|Train| = 1500</td></tr><tr><td></td><td>1,2.0</td><td>2.0,1</td><td>3,2,1</td><td>0,10,0</td><td>5,3.3</td><td>1,2,0</td><td>2,0,1</td><td>3,2,1</td><td>0,10,0</td><td>5,3,3</td></tr><tr><td>GNN</td><td>0.200</td><td>0.386</td><td>0.492</td><td>0.154</td><td>0.468</td><td>0.225</td><td>0.426</td><td>0.779</td><td>0.251</td><td>0.772</td></tr><tr><td>EGNN</td><td>0.220</td><td>0.370</td><td>0.714</td><td>0.248</td><td>0.760</td><td>0.217</td><td>0.317</td><td>0.521</td><td>0.139</td><td>0.596</td></tr><tr><td>EGNNReg</td><td>0.172</td><td>0.146</td><td>0.232</td><td>0.198</td><td>0.241</td><td>0.159</td><td>0.053</td><td>0.091</td><td>0.097</td><td>0.075</td></tr><tr><td>GMN</td><td>0.000</td><td>0.000</td><td>0.000</td><td>0.000</td><td>0.000</td><td>0.000</td><td>0.000</td><td>0.000</td><td>0.000</td><td>0.000</td></tr></table>
|
| 512 |
+
|
| 513 |
+
# H MORE DISCUSSIONS ON GENERALIZATION
|
| 514 |
+
|
| 515 |
+
In Table 2 we compare the generalization capability of GMN with other methods. Here, we denote GMN trained on (3,2,1) and tested across different scenarios as GMN-Transfer, and GMN trained and tested on the same dataset as GMN-Original. It is observed from Table 10 that GMN has strong generalization capability, since the transfer performance is very close to the original setting.
|
| 516 |
+
|
| 517 |
+
Table 10: Comparison of GMN in the transfer and original settings.
|
| 518 |
+
|
| 519 |
+
<table><tr><td></td><td colspan="4">|Train| = 500</td><td colspan="4">|Train| = 1500</td></tr><tr><td></td><td>3,2,1</td><td>2,4,0</td><td>1,0,3</td><td>Average</td><td>3,2,1</td><td>2,4,0</td><td>1,0,3</td><td>Average</td></tr><tr><td>GMN-Transfer</td><td>2.48</td><td>2.53</td><td>3.28</td><td>2.76</td><td>2.10</td><td>2.18</td><td>2.65</td><td>2.31</td></tr><tr><td>GMN-Original</td><td>2.48</td><td>2.34</td><td>3.21</td><td>2.68</td><td>2.10</td><td>2.01</td><td>2.44</td><td>2.18</td></tr></table>
|
| 520 |
+
|
| 521 |
+
# I LEARNABLE FK
|
| 522 |
+
|
| 523 |
+
It is indeed instrumental to discuss whether a learnable black-box function, which requires less domain knowledge, could also yield competitive performance, and if our hand-crafted FK still shows advantage over the learnable counterpart. To answer these questions, we replace the hand-crafted part (Eq. (7-9) as well as the Euler angle computations in Sec. 3.1) with the following equations: $\bar { \pmb { v } } _ { i } ^ { l } = \phi \bar { ( } h _ { i } ^ { l - 1 } ) \pmb { v } _ { i } ^ { l - 1 } + \rho ( \ddot { \pmb { q } } _ { k } ^ { l } , \pmb { x } _ { k i } ^ { l - 1 } , \pmb { f } _ { i } ^ { l } ) , \bar { \pmb { x } } _ { i } ^ { l } = \pmb { x } _ { i } ^ { l - 1 } + \pmb { v } _ { i } ^ { l }$ , where $\rho$ is the equivariant message passing layer we propose in Sec. 3.2. By this design, the parameterized FK preserves its equivariant property (and the theoretical universality), and compared to EGNN, it additionally leverages the information from the object-level generalized coordinates $\ddot { q } _ { k } ^ { l }$ . We denote this variant of GMN as GMN-L. Moreover, since the parameterized FK inevitably loses the constraint-preserving property compared with the exact FK, therefore we also augment it with explicit constraint regularization, akin to what we did to EGNNReg. We hence denote this variant as GMN-LReg.
|
| 524 |
+
|
| 525 |
+
We evaluate the performance of GMN-L, GMN-LReg and compare them with GMN with exact FK as well as EGNN and EGNNReg in Table 11. We interestingly find that GMN-L consistently outperforms EGNN in various settings (as well as the regularized version), which again verifies both the validity of our proposed equivariant message passing layer and the efficacy of leveraging objectlevel message (i.e., $\ddot { q } _ { k } ^ { l ^ { \top } }$ ) for the inference of FK. At the same time, GMN-L and GMN-LReg yield a minor gap with GMN, showing the evidence that hard-coding the constraints replaces a nontrivial amount of learning complexity.
|
| 526 |
+
|
| 527 |
+
Table 11: Comparison with GMN-L and GMN-LReg.
|
| 528 |
+
|
| 529 |
+
<table><tr><td></td><td colspan="5">|Train|= 500</td><td colspan="5">|Train| = 1500</td></tr><tr><td></td><td>1,2.0</td><td>2.,0,1</td><td>3,2,1</td><td>0,10,0</td><td>5,3,3</td><td>1,2.0</td><td>2,0,1</td><td>3,2,1</td><td>0,10,0</td><td>5,3,3</td></tr><tr><td>EGNN</td><td>2.81</td><td>2.27</td><td>4.67</td><td>4.75</td><td>4.59</td><td>2.59</td><td>1.86</td><td>2.54</td><td>2.79</td><td>3.25</td></tr><tr><td>EGNNReg</td><td>2.94</td><td>2.66</td><td>7.01</td><td>5.03</td><td>6.31</td><td>2.74</td><td>1.58</td><td>2.62</td><td>3.03</td><td>3.07</td></tr><tr><td>GMN-L</td><td>2.32</td><td>2.09</td><td>3.19</td><td>3.88</td><td>4.34</td><td>1.93</td><td>1.56</td><td>2.28</td><td>2.72</td><td>3.03</td></tr><tr><td>GMN-LReg</td><td>2.52</td><td>2.23</td><td>3.34</td><td>3.67</td><td>4.31</td><td>1.91</td><td>1.88</td><td>2.49</td><td>2.61</td><td>3.00</td></tr><tr><td>GMN</td><td>1.84</td><td>2.02</td><td>2.48</td><td>2.92</td><td>4.08</td><td>1.68</td><td>1.47</td><td>2.10</td><td>2.32</td><td>2.86</td></tr></table>
|
| 530 |
+
|
| 531 |
+
# J ROBUSTNESS TO ERRORS IN THE PHYSICAL PRIOR OF CONSTRAINTS
|
| 532 |
+
|
| 533 |
+
It is interesting to test the robustness of our model w.r.t. the noisy constraints. This scenario would sometimes arise in real-world scenarios where we might not be certain about the exact connectivity of the rigid body, and thus would involve slight errors in domain expertise. Since our paper focuses on the distance constraint other than the angle constraint, the following investigations will only involve noise into the stick connectivity. We design three random perturbation operations on the input rigid body prior: 1. (Join) randomly selecting 2 isolated particles and joining them as if there is a stick connecting; 2. (Split) randomly selecting an existing stick and splitting it as two isolated particles; 3. $( \mathrm { J o i n } + \mathrm { S p l i t } )$ conducting operation 1 and 2 at the same time; and 4. (Change in Length) randomly adding Gaussian noise $\mathcal { N } \bar { ( 0 , 0 . 1 L ) }$ to the length of a stick, where $L$ is its original length. Note that the operation is conducted independently for every training sample each time it is fed into the network.
|
| 534 |
+
|
| 535 |
+
We summarize the results in Table 12. We observe that these perturbations, although somehow hinder the performance, in general do not jeopardize the performance too much (difference in MSE $\leq 0 . 3 0 )$ , indicating that GMN is not sensitive to slight errors of the input physical prior of the constraints and it is still able to learn to some degree of given the wrong constraints.
|
| 536 |
+
|
| 537 |
+
Table 12: Robustness test in various scenarios.
|
| 538 |
+
|
| 539 |
+
<table><tr><td></td><td colspan="3">|Train| = 500</td><td colspan="3">|Train| = 1500</td></tr><tr><td></td><td>3,2,1</td><td>5,3,3</td><td>8,6,0</td><td>3,2,1</td><td>5,3,3</td><td>8,6,0</td></tr><tr><td>GMN</td><td>2.48</td><td>4.08</td><td>2.84</td><td>2.10</td><td>2.86</td><td>2.22</td></tr><tr><td>GMN w/ Join</td><td>2.59</td><td>4.27</td><td>2.98</td><td>2.22</td><td>3.16</td><td>2.37</td></tr><tr><td>GMN w/ Split</td><td>2.57</td><td>4.11</td><td>2.95</td><td>2.16</td><td>3.13</td><td>2.26</td></tr><tr><td>GMN w/ Join + Split</td><td>2.63</td><td>4.16</td><td>3.01</td><td>2.31</td><td>3.01</td><td>2.34</td></tr><tr><td>GMN w/ Change in Length</td><td>2.75</td><td>4.36</td><td>3.11</td><td>2.15</td><td>3.15</td><td>2.41</td></tr></table>
|
| 540 |
+
|
| 541 |
+
# K MORE DISCUSSIONS ON THE DECOMPOSITION
|
| 542 |
+
|
| 543 |
+
It is possible to decompose into bigger objects rather than just sticks. As a comparison, we further adopt the hinge-wise decomposition (i.e., decompose the system into particles and hinges), and investigate the performance on both MD17 and Motion Capture. We denote this model as GMN-LH, where H stands for hinges. The results are depicted in Table 13 and Table 14. On MD17, GMNLH yields a little bit worse performance than GMN-L on several molecules, while giving desirable results on Ethanol and Benzene. On Motion Capture, GMN-LH outperforms GMN-L by a small gap, while is still worse than GMN. By default, we still encourage to perform the decomposition via sticks as sticks are actually the basic building blocks of hinges and other larger rigid objects.
|
| 544 |
+
|
| 545 |
+
Table 13: Prediction error $( \times 1 0 ^ { - 2 } )$ ) on MD17 dataset. Results averaged across 3 runs.
|
| 546 |
+
|
| 547 |
+
<table><tr><td>Aspirin Ethanol Malonaldehyde Naphthalene Salicylic</td><td>Benzene</td><td></td><td></td><td></td><td>Toluene</td></tr><tr><td>EGNN</td><td>14.41±0.15 62.40±0.53</td><td>4.64±0.01</td><td>13.64±0.01</td><td>0.47±0.02</td><td>1.02±0.02 11.78±0.07</td></tr><tr><td>GMN</td><td>10.14±0.03 48.12±0.404</td><td>4.83±0.01</td><td>13.11±0.03</td><td>0.40±0.01</td><td>0.91±0.01 10.22±0.08</td></tr><tr><td>GMN-L</td><td>9.76±0.11</td><td>54.17±0.69 4.63±0.01</td><td>12.82±0.03</td><td>0.41±0.01</td><td>0.59±0.01 0.88±0.01 10.45±0.04 0.59±0.01</td></tr><tr><td>GMN-LH</td><td>10.25±0.06 52.02±0.974</td><td>4.62±0.01</td><td>12.83±0.03</td><td>0.41±0.01</td><td>1.03±0.01 10.81±0.14 0.59±0.01</td></tr></table>
|
| 548 |
+
|
| 549 |
+
Table 14: Prediction error $( \times 1 0 ^ { - 2 } )$ on motion capture. Results averaged across 3 runs.
|
| 550 |
+
|
| 551 |
+
<table><tr><td>EGNN</td><td>GMN</td><td>GMN-L</td><td>GMN-LH</td></tr><tr><td>59.1±2.1</td><td>43.9±1.1</td><td>50.9±0.7</td><td>48.7±1.1</td></tr></table>
|
md/dev/UDqHhbqYJV/UDqHhbqYJV.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/VnAwNNJiwDb/VnAwNNJiwDb.md
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Generating Long Videos of Dynamic Scenes
|
| 2 |
+
|
| 3 |
+
Tim Brooks NVIDIA, UC Berkeley
|
| 4 |
+
|
| 5 |
+
Janne Hellsten NVIDIA
|
| 6 |
+
|
| 7 |
+
Miika Aittala NVIDIA
|
| 8 |
+
|
| 9 |
+
Ting-Chun Wang NVIDIA
|
| 10 |
+
|
| 11 |
+
Timo Aila NVIDIA
|
| 12 |
+
|
| 13 |
+
Jaakko Lehtinen NVIDIA, Aalto University
|
| 14 |
+
|
| 15 |
+
Ming-Yu Liu NVIDIA
|
| 16 |
+
|
| 17 |
+
Alexei A. Efros UC Berkeley
|
| 18 |
+
|
| 19 |
+
Tero Karras NVIDIA
|
| 20 |
+
|
| 21 |
+
# Abstract
|
| 22 |
+
|
| 23 |
+
We present a video generation model that accurately reproduces object motion, changes in camera viewpoint, and new content that arises over time. Existing video generation methods often fail to produce new content as a function of time while maintaining consistencies expected in real environments, such as plausible dynamics and object persistence. A common failure case is for content to never change due to over-reliance on inductive biases to provide temporal consistency, such as a single latent code that dictates content for the entire video. On the other extreme, without long-term consistency, generated videos may morph unrealistically between different scenes. To address these limitations, we prioritize the time axis by redesigning the temporal latent representation and learning long-term consistency from data by training on longer videos. We leverage a two-phase training strategy, where we separately train using longer videos at a low resolution and shorter videos at a high resolution. To evaluate the capabilities of our model, we introduce two new benchmark datasets with explicit focus on long-term temporal dynamics.
|
| 24 |
+
|
| 25 |
+
# 1 Introduction
|
| 26 |
+
|
| 27 |
+
Videos are data that change over time, with complex patterns of camera viewpoint, motion, deformation and occlusion. In certain respects, videos are unbounded — they may last arbitrarily long and there is no limit to the amount of new content that may become visible over time. Yet videos that depict the real world must also remain consistent with physical laws that dictate which changes over time are feasible. For example, the camera may only move through 3D space along a smooth path, objects cannot morph between each other, and time cannot go backward. Generating long videos thus requires the ability to produce endless new content while maintaining appropriate consistencies.
|
| 28 |
+
|
| 29 |
+
In this work, we focus on generating long videos with rich dynamics and new content that arises over time. While existing video generation models can produce “infinite” videos, the type and amount of change along the time axis is highly limited. For example, a synthesized infinite video of a person talking will only include small motions of the mouth and head. Moreover, common video generation datasets often contain short clips with little new content over time, which may inadvertently bias the design choices toward training on short segments or pairs of frames, forcing content in videos to stay fixed, or using architectures with small temporal receptive fields.
|
| 30 |
+
|
| 31 |
+
We make the time axis a first-class citizen for video generation. To this end, we introduce two new datasets that contain motion, changing camera viewpoints, and entrances/exits of objects and scenery over time. We learn long-term consistencies by training on long videos and design a temporal latent representation that enables modeling complex temporal changes. Figure 1 illustrates the rich motion and scenery changes that our model is capable of generating. See our webpage1 for video results, code, data and pretrained models.
|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
Figure 1: We aim to generate videos that accurately portray motion, changing camera viewpoint, and new content that arises over time. Top: Our horseback riding dataset exhibits these types of changes as the horse moves forward in the environment. Middle: StyleGAN-V, a state-of-the-art video generation baseline, is incapable of generating new content over time; the horse fails to move forward past the obstacle, the scene does not change, and the video morphs back and forth within a short window of motion. Bottom: Our novel video generation model prioritizes the time axis and generates realistic motion and scenery changes over long durations. The same videos can be viewed on the supplemental webpage.
|
| 35 |
+
|
| 36 |
+
Our main contribution is a hierarchical generator architecture that employs a vast temporal receptive field and a novel temporal embedding. We employ a multi-resolution strategy, where we first generate videos at low resolution and then refine them using a separate super-resolution network. Naively training on long videos at high spatial resolution is prohibitively expensive, but we find that the main aspects of a video persist at a low spatial resolution. This observation allows us to train with long videos at low resolution and short videos at high resolution, enabling us to prioritize the time axis and ensure that long-term changes are accurately portrayed. The low-resolution and super-resolution networks are trained independently with an RGB bottleneck in between. This modular design allows iterating on each network independently and leveraging the same super-resolution network for different low-resolution network ablations.
|
| 37 |
+
|
| 38 |
+
We compare our results to several recent video generative models and demonstrate state-of-the-art performance in producing long videos with realistic motion and changes in content. Code, new datasets, and pre-trained models on these datasets will be made available.
|
| 39 |
+
|
| 40 |
+
# 2 Prior work
|
| 41 |
+
|
| 42 |
+
Video generation is a challenging problem with a long history. The classic early works, Video Textures [50] and Dynamic Textures [10], model videos as textures by analogy with image textures. That is, they explicitly assume the content to be stationary over time, e.g., fire burning, smoke rising, foliage falling, pendulum swinging, etc., and use non-parametric [50] or parametric [10] approaches to model that stationary distribution. Although subsequent video synthesis works have dropped the “texture” moniker, much of the limitations remain similar — short training videos and models which produce little or no new objects entering the frame during the video. Below we summarize some of the more recent efforts on video generation.
|
| 43 |
+
|
| 44 |
+
Unconditional video generation. Many video generation works are based on GANs [14], including early models that output fixed-length videos [1, 47, 60] and approaches that use recurrent networks to produce a sequence of latent codes used to generate frames [9, 12, 55, 56]. MoCoGAN [56] explicitly disentangles “motion” from “content” and keeps the latter fixed over the entire generated video. StyleGAN-V [52] is a recent state-of-the-art model we use as a primary baseline. Similar to MoCoGAN, StyleGAN-V employs a global latent code that controls content of an entire video. MoCoGAN-HD [55], which we also compare with, and StyleVideoGAN [12] attempt to generate videos by navigating the latent space of a pretrained StyleGAN2 model [29], but struggle to produce realistic motion. Unlike previous StyleGAN-based [28] video models, we prioritize the time axis in our generator through a new temporal latent representation, temporal upsampling, and spatiotemporal modulated convolutions. We also compare with DIGAN [66] that employs an implicit representation to generate the video pixel by pixel.
|
| 45 |
+
|
| 46 |
+
Transformers are another class of models used for video generation [13, 42, 61, 65]. We compare with TATS [13] that generates long unconditional videos with transformers, improving upon VideoGPT [65]. Both TATS and VideoGPT employ a GPT-like autoregressive transformer [4] that represents videos as sequences of tokens. However, the resulting videos tend to accumulate error over time and often diverge or change too rapidly. The models are also expensive to train and deploy due to their autoregressive nature over time and space. In concurrent work, promising results in generating diverse videos have also been demonstrated using diffusion-based models [20].
|
| 47 |
+
|
| 48 |
+
Conditional video prediction. A separate line of research focuses on predicting future video frames conditioned on one or more real video frames [3, 23, 34, 36, 39, 41] or past frames accompanied by an action label [6, 15, 30, 31]. Some video prediction methods focus specifically on generating infinite scenery by conditioning on camera trajectory [37, 44] and/or explicitly predicting depth [2, 37] to then simulate a virtual camera flying through a 3D scene. Our goal, on the other hand, is to support camera movement as well as moving objects by having the scene structure emerge implicitly.
|
| 49 |
+
|
| 50 |
+
Multi-resolution training. Training at multiple scales is a common strategy for image generation models [7, 25, 43, 46, 58]. Transformer-based video generators also employ a related two-phase setup [65, 13]. Saito et al. [48] subsample frames at higher resolutions in their video generator architecture to improve efficiency. A similar idea is also used in SlowFast [11] networks where different network pathways are used for high and low frame rate video streams. Acharya et al. [1] propose a multi-scale GAN for video generation that increases both spatial resolution and sequence length during training to produce a fixed-length video. In contrast, our multi-resolution approach is designed to enable generating arbitrarily long videos with rich long-term dynamics by leveraging training of long sequences at low resolution.
|
| 51 |
+
|
| 52 |
+
# 3 Our method
|
| 53 |
+
|
| 54 |
+
Modeling the long-term temporal behavior observed in real videos presents us with two main challenges. First, we must use long enough sequences during training to capture the relevant effects; using, e.g., pairs of consecutive frames fails to provide meaningful training signal for effects that occur over several seconds. Second, we must ensure that the networks themselves are capable of operating over long time scales; if, e.g., the receptive field of the generator spans only 8 adjacent frames, any two frames taken more than 8 frames apart will necessarily be uncorrelated with each other.
|
| 55 |
+
|
| 56 |
+
Figure 2a shows the overall design of our generator. We seed the generation process with a variablelength stream of temporal noise, consisting of 8 scalar components per frame drawn from i.i.d. Gaussian distribution. The temporal noise is first processed by a low-resolution generator to obtain a sequence of RGB frames at $6 4 ^ { 2 }$ resolution that are then refined by a separate super-resolution network to produce the final frames at $2 5 6 ^ { 2 }$ resolution.2 The role of the low-resolution generator is to model major aspects of the motion and scene composition, which necessitates strong expressive power and a large receptive field over time, whereas the super-resolution network is responsible for the more fine-grained task of hallucinating the remaining details.
|
| 57 |
+
|
| 58 |
+
Our two-stage design provides maximum flexibility in terms of generating long videos. Specifically, the low-resolution generator is designed to be fully convolutional over time, so the duration and time offset of the generated video can be controlled by shifting and reshaping the temporal noise, respectively. The super-resolution network, on the other hand, operates on a frame-by-frame basis. It receives a short sequence of 9 consecutive low-resolution frames and outputs a single high-resolution frame; each output frame is processed independently using a sliding window. The combination of fully-convolutional and per-frame processing enables us to generate arbitrary frames in arbitrary order, which is highly desirable for, e.g., interactive editing and real-time playback.
|
| 59 |
+
|
| 60 |
+

|
| 61 |
+
Figure 2: Overview of our method. (a) To achieve long temporal receptive field and high spatial resolution, we split our generator into two components: a low-resolution generator, responsible for modeling major aspects of the motion and scene composition, and a super-resolution network, responsible for hallucinating fine details. (b) The low-resolution generator (Section 3.1) employs a wide temporal receptive field and is trained with sequences of 128 frames at $6 4 ^ { 2 }$ resolution. (c) The super-resolution network (Section 3.2) is conditioned on short sequences of low-resolution frames and trained to produce their plausible counterparts at $2 5 6 ^ { 2 }$ resolution.
|
| 62 |
+
|
| 63 |
+
The low-resolution and super-resolution networks are modular with an RGB bottleneck in between. This greatly simplifies experimentation, since the networks are trained independently and can be used in different combinations during inference. We will first describe the training and architecture of the low-resolution generator in Section 3.1 and then discuss the super-resolution network in Section 3.2.
|
| 64 |
+
|
| 65 |
+
# 3.1 Low-resolution generator
|
| 66 |
+
|
| 67 |
+
Figure 2b shows our training setup for the low-resolution generator. In each iteration, we provide the generator with a fresh set of temporal noise to produce sequences of 128 frames (4.3 seconds at 30 fps). To train the discriminator, we sample corresponding sequences from the training data by choosing a random video and a random interval of 128 frames within that video.
|
| 68 |
+
|
| 69 |
+
We have observed that training with long sequences tends to exacerbate the issue of overfitting [26]. As the sequence length increases, we suspect that it becomes harder for the generator to simultaneously model temporal dynamics at multiple time scales, but at the same time, easier for the discriminator to spot any mistakes. In practice, we have found strong discriminator augmentation [26, 69] to be necessary in order to stabilize the training. We employ DiffAug [69] using the same transformation for each frame in a sequence, as well as fractional time stretching between $\bar { \frac { 1 } { 2 } } \bar { \times }$ and $2 \times$ ; see Appendix C.1 for details.
|
| 70 |
+
|
| 71 |
+
Architecture. Figure 3 illustrates the architecture of our low-resolution generator. Our main goal is to make the time axis a first-class citizen, including careful design of a temporal latent representation, temporal style modulation, spatiotemporal convolutions, and temporal upsamples. Through these mechanisms, our generator spans a vast temporal receptive field (5k frames), allowing it to represent temporal correlations at multiple time scales.
|
| 72 |
+
|
| 73 |
+
We employ a style-based design, similar to Karras et al. [29, 27], that maps the input temporal noise into a sequence of intermediate latents $\{ w _ { t } \}$ used to modulate the behavior of each layer in the main synthesis path. Each intermediate latent is associated with a specific frame, but it can significantly influence the scene composition and temporal behavior of several frames through hierarchical 3D convolutions that appear in the main path.
|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
Figure 3: Low-resolution generator architecture, illustrated for $6 4 { \times } 3 6$ output. Left: The input temporal noise is mapped to a sequence of intermediate latents $\{ w _ { t } \}$ that modulate the intermediate activations of the main synthesis path. Top right: To facilitate the modeling of long-term dependencies, we enrich the temporal noise by passing it through a series of lowpass filters whose temporal footprints range all the way from 100 to 5000 frames. Bottom right: The main synthesis path consists of spatiotemporal (ST) and spatial (S) blocks that gradually increase the resolution over time and space.
|
| 77 |
+
|
| 78 |
+
In order to reap the full benefits of the style-based design, it is crucial for the intermediate latents to capture long-term temporal correlations, such as weather changes or persistent objects. To this end, we adopt a scheme where we first enrich the input temporal noise using a series of temporal lowpass filters and then pass it through a fully-connected mapping network on a frame-by-frame basis. The goal of the lowpass filtering is to provide the mapping network with sufficient long-term context across a wide range of different time scales. Specifically, given a stream of temporal noise $z ( t ) \in \mathbb { R } ^ { 8 }$ , we compute the corresponding enriched representation $\mathbf { \boldsymbol { z } } ^ { \prime } ( t ) \in \mathbb { R } ^ { 1 2 8 \times 8 }$ as $z _ { i , j } ^ { \prime } = f _ { i } * z _ { j }$ where $\{ f _ { i } \}$ is a set of 128 lowpass filters whose temporal footprint ranges from 100 to 5000 frames, and $^ *$ denotes convolution over time; see Appendix C.2 for details.
|
| 79 |
+
|
| 80 |
+
The main synthesis path starts by downsampling the temporal resolution of $\{ w _ { t } \}$ by $3 2 \times$ and concatenating it with a learned constant at $4 ^ { 2 ^ { \cdot } }$ resolution. It then gradually increases the temporal and spatial resolutions through a series of processing blocks, illustrated in Figure 3 (bottom right), focusing first on the time dimension (ST) and then the spatial dimensions (S). The first four blocks have 512 channels, followed by two blocks with 256, two with 128 and two with 64 channels. The processing blocks consist of the same basic building blocks as StyleGAN2 [29] and StyleGAN3 [27] with the addition of a skip connection; the intermediate activations are normalized before each convolution [27] and modulated [29] according to an appropriately downsampled copy of $\{ w _ { t } \}$ . In practice, we employ bilinear upsampling [28] and use padding [27] for the time axis to eliminate boundary effects. Through the combination of our temporal latent representation and spatiotemporal processing blocks, our architecture is able to model complex and long-term patterns across time.
|
| 81 |
+
|
| 82 |
+
For the discriminator, we employ an architecture that prioritizes the time axis via wide temporal receptive field, 3D spatiotemporal and 1D temporal convolutions, and spatial and temporal downsamples; see Appendix C.3 for details.
|
| 83 |
+
|
| 84 |
+
# 3.2 Super-resolution network
|
| 85 |
+
|
| 86 |
+
Figure 2c shows our training setup for the super-resolution network. Our video super-resolution network is a straightforward extension of StyleGAN3 [27] for conditional frame generation. Unlike the low-resolution network that outputs a sequence of frames and includes explicit temporal operations, the super-resolution generator outputs a single frame and only utilizes temporal information at the input, where the real low-resolution frame and 4 neighboring real low-resolution frames before and after in time are concatenated along the channel dimension to provide context. We remove the spatial Fourier feature inputs and resize and concatenate the stack of low-resolution frames to each layer throughout the generator. The generator architecture is otherwise unchanged from StyleGAN3, including the use of an intermediate latent code that is sampled per video. Low-resolution frames undergo augmentation prior to conditioning as part of the data pipeline, which helps ensure generalization to generated low-resolution images.
|
| 87 |
+
|
| 88 |
+

|
| 89 |
+
Figure 4: Example real frames from training datasets. We introduce first-person datasets of (a) mountain biking and (b) horseback riding videos that contain complex motion and new content over time. We also evaluate on existing datasets of (c) nature drone footage and (d) sky timelapse videos.
|
| 90 |
+
|
| 91 |
+
The super-res discriminator is a similar straightforward extension of the StyleGAN discriminator, with 4 low and high-resolution frames concatenated at the input. The only other change is the removal of the minibatch standard deviation layer that we found unnecessary in practice. Both low- and highresolution segments of 4 frames undergo adaptive augmentation [26] where the same augmentation is applied to all frames at both resolutions. Low-resolution segments also undergo aggressive dropout $p = 0 . 9$ probability of zeroing out the entire segment), which prevents the discriminator from relying too heavily on the conditioning signal; see Appendix D.1 for details.
|
| 92 |
+
|
| 93 |
+
We find it remarkable that such a simple video super-resolution model appears sufficient for producing reasonably good high-resolution videos. We focus primarily on the low-resolution generator in our experiments, utilizing a single super-resolution network trained per dataset. We feel that replacing this simple network with a more advanced model from the video super-resolution literature [16, 24, 49, 54] is a promising avenue for future work.
|
| 94 |
+
|
| 95 |
+
# 4 Datasets
|
| 96 |
+
|
| 97 |
+
Most of the existing video datasets introduce little or no new content over time. For example, talking head datasets [8, 45, 62, 63] show the same person for the duration of each video. UCF101 [53] portrays diverse human actions, but the videos are short and contain limited camera motion and little or no new objects that enter the videos over time.
|
| 98 |
+
|
| 99 |
+
To best evaluate our model, we introduce two new video datasets of first-person mountain biking and horseback riding (Figure 4a,b) that exhibit complex changes over time. Our new datasets include subject motion of the horse or biker, a first-person camera viewpoint that moves through space, and new scenery and objects over time. The videos are available in high definition and were manually trimmed to remove problematic segments, scene cuts, text overlays, obstructed views, etc. The mountain biking dataset has 1202 videos with a median duration of 330 frames at 30 fps, and the horseback dataset has 66 videos with a median duration of 6504 frames also at 30fps. We have permission from the content owners to publicly release the datasets for research purposes. We believe our new datasets will serve as important benchmarks for future work.
|
| 100 |
+
|
| 101 |
+
We also evaluate our model on the ACID dataset [38] (Figure 4c) that contains significant camera motion but lacks other types of motion, as well as the commonly used SkyTimelapse dataset [67] (Figure 4d) that exhibits new content over time as the clouds pass by, but the videos are relatively homogeneous and the camera remains fixed.
|
| 102 |
+
|
| 103 |
+

|
| 104 |
+
Figure 5: Color similarity (Eq. 1) of real and generated videos as a function of frame separation, reported as the mean (solid lines) and standard deviation (shaded regions) over 1000 random clips.
|
| 105 |
+
|
| 106 |
+
# 5 Results
|
| 107 |
+
|
| 108 |
+
We evaluate our model through qualitative examination of the generated videos (Section 5.1), analyzing color change over time (Section 5.2), computing the FVD metric (Section 5.3), and ablating the key design choices (Section 5.4). We compare with StyleGAN-V [52] on all datasets. Mountain biking, horseback riding and ACID [37] datasets contain videos with a $1 6 { \times } 9$ widescreen aspect ratio. We train at $2 5 6 { \times } 1 4 4$ resolution on these datasets to preserve the aspect ratio. Since StyleGAN-V is based on StyleGAN2 [29], we can easily extend it to support non-square aspect ratios by masking real and generated frames during training. We found it necessary to increase the ${ \mathrm { R 1 } } \gamma$ hyperparameter by $1 0 \times$ to produce good results with StyleGAN-V on our new datasets that exhibit complex changes over time. We compare with MoCoGAN-HD [56], TATS [13] and DIGAN [66] using pre-trained models for the SkyTimelapse dataset at $1 2 8 ^ { 2 }$ resolution. For these comparisons, we train a separate super-resolution network to output the frames at $1 2 8 ^ { 2 }$ resolution, but use the same low-resolution generator as in the $2 5 6 ^ { 2 }$ comparison.
|
| 109 |
+
|
| 110 |
+
# 5.1 Qualitative results
|
| 111 |
+
|
| 112 |
+
The major qualitative difference in results is that our model generates realistic new content over time, whereas StyleGAN-V continually repeats the same content. The effect is best observed by watching videos on the supplemental webpage and is additionally illustrated in Figure 1. Scenery changes over time in real videos and our results as the horse moves forward through space. However, the videos generated by StyleGAN-V tend to morph back to the same scene at regular intervals. Similar repeated content from StyleGAN-V is apparent on all datasets. For example, results on the webpage for the SkyTimelapse dataset show that clouds generated by StyleGAN-V repeatedly move back and forth. MoCoGAN-HD and TATS suffer from unrealistic rapid changes over time that diverge, and DIGAN results contain periodic patterns visible in both space and time. Our model is capable of generating a constant stream of new clouds.
|
| 113 |
+
|
| 114 |
+
As a further validation of our observations, we conducted a preliminary user study on Amazon Mechanical Turk. We created 50 pairs of videos for each of the 4 datasets. Each pair contained a random video generated by StyleGAN-V and one generated by our method, and we asked the participants which of them exhibited more realistic motion in a forced-choice response. Each pair was shown to 10 participants, resulting in a total of $5 0 { \times } 4 { \times } 1 0$ responses. Our method was preferred over $80 \%$ of the time for every dataset. Please see Appendix A.1 for details.
|
| 115 |
+
|
| 116 |
+
# 5.2 Analyzing color change over time
|
| 117 |
+
|
| 118 |
+
To gain insight into how well different methods produce new content at appropriate rates, we analyze how the overall color scheme changes as a function of time. We measure color similarity as the intersection between RGB color histograms; this serves as a simple proxy for actual content changes and helps reveal the biases of different models. Let $H ( x , i )$ denote a 3D color histogram function that computes the value of histogram bin $i \in [ 1 , \dots , N ^ { 3 } ]$ for the given image $x$ , normalized so that $\begin{array} { r } { \sum _ { i } H ( x , i ) = 1 } \end{array}$ . Given video clip $\pmb { x } = \{ x _ { t } \}$ and frame separation $t$ , we define the color similarity as
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
S ( \boldsymbol x , t ) = \sum _ { i } \operatorname* { m i n } \big ( H ( \boldsymbol x _ { 0 } , i ) , ~ H ( \boldsymbol x _ { t } , i ) \big ) ,
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
<table><tr><td rowspan="2"></td><td colspan="2">Biking</td><td colspan="2">Horseback</td><td colspan="2">ACID</td><td colspan="2">Sky 2562</td></tr><tr><td>FVD128</td><td>FVD16</td><td>FVD128</td><td>FVD16</td><td>FVD128</td><td>FVD16</td><td>FVD128</td><td>FVD16</td></tr><tr><td>StyleGAN-V</td><td>533.3</td><td>353.7</td><td>427.0</td><td>319.2</td><td>112.4</td><td>91.5</td><td>151.2</td><td>48.4</td></tr><tr><td>with 10× R1γ</td><td>224.6</td><td>99.2</td><td>196.2</td><td>159.0</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>Ours</td><td>113.7</td><td>83.8</td><td>95.9</td><td>113.5</td><td>166.6</td><td>127.3</td><td>152.7</td><td>116.5</td></tr></table>
|
| 125 |
+
|
| 126 |
+
<table><tr><td rowspan="2"></td><td colspan="2">Sky 1282</td></tr><tr><td>FVD128</td><td>FVD16</td></tr><tr><td>MoCoGAN-HD</td><td>635.6</td><td>224.9</td></tr><tr><td>TATS</td><td>435.0</td><td>97.0</td></tr><tr><td>DIGAN</td><td>228.6</td><td>153.4</td></tr><tr><td>Ours</td><td>142.6</td><td>107.5</td></tr></table>
|
| 127 |
+
|
| 128 |
+
Table 1: We compute FVD on segments of 128 and 16 frames $\mathrm { ( F V D _ { 1 2 8 } }$ and $\mathrm { F V D _ { 1 6 } }$ respectively), where lower is better. Left: Our model outperforms StyleGAN-V on horseback riding and mountain biking datasets – both of which contain complex motion and new content over time. Our model underperforms StyleGAN-V on ACID and SkyTimelapse despite qualitative improvements and favorable user study ratings in Section 5.1. Right: Our model outperforms MoCoGAN-HD, TATS and DIGAN baselines on SkyTimelapse at $1 2 8 ^ { \bar { 2 } }$ resolution on $\mathrm { F V D _ { 1 2 8 } }$ .
|
| 129 |
+
|
| 130 |
+
where $S ( { \pmb x } , t ) = 1$ indicates that the color histograms are identical between $x _ { 0 }$ and $x _ { t }$ . In practice, we set $N = 2 0$ and report the mean and standard deviation of $S ( \cdot , t )$ , measured on 1000 random video clips containing 128 frames each.
|
| 131 |
+
|
| 132 |
+
Figure 5 shows $S ( \cdot , t )$ as a function of $t$ for real and generated videos on each dataset. The curves trend downward over time for real videos as content and scenery gradually change. StyleGAN-V and DIGAN are biased toward colors changing too slowly — both of these models include a global latent code that is fixed over the entire video. On the other extreme, MoCoGAN-HD and TATS are biased toward colors changing too quickly. These models use recurrent and autoregressive networks, respectively, both of which suffer from accumulating errors. Our model closely matches the shape of the target curve, indicating that colors in our generated videos change at appropriate rates.
|
| 133 |
+
|
| 134 |
+
Color change is a crude approximation of the complex changes over time in videos. In Appendix A.3 we also consider LPIPS [68] perceptual distance instead of color similarly and observe the same trends in most cases.
|
| 135 |
+
|
| 136 |
+
# 5.3 Fréchet video distance (FVD)
|
| 137 |
+
|
| 138 |
+
The commonly used Fréchet video distance (FVD) [57] attempts to measure similarity between real and generated video distributions. We find that FVD is sensitive to the realism of individual frames and motion over short segments, but that it does not capture long-term realism. For example, FVD is essentially blind to unrealistic repetition of content over time, which is prominent in StyleGAN-V videos on all of our datasets. We found FVD to be most useful in ablations, i.e., when comparing slightly different variants of the same architecture.
|
| 139 |
+
|
| 140 |
+
FVD [57] computes the Wasserstein-2 distance [59] between sets of real and generated features extracted from a pre-trained I3D action classification model [5]. Skorokhodov et al. [52] note that FVD is highly sensitive to small implementation differences, down to the level of image compression settings, and that the reported results are not necessarily comparable between papers (Appendix C in [52]). We report all FVD results using consistent evaluation protocol, ensuring apples-to-apples comparison. We separately measure FVD using 128- and 16-frame segments, denoted by $\mathrm { F V D _ { 1 2 8 } }$ and $\mathrm { F V D _ { 1 6 } }$ , and sample 2048 random segments from both the dataset and generator in each case.
|
| 141 |
+
|
| 142 |
+
Table 1 (left) reports FVD on all datasets for StyleGAN-V and our model. We outperform StyleGANV on horseback riding and mountain biking datasets that contain more complex changes over time, but underperform on ACID and slightly underperform on SkyTimelapse in terms of $\mathrm { F V D _ { 1 2 8 } }$ . However, this underperformance strongly disagrees with the conclusions from the qualitative user study in Section 5.1. We believe this discrepancy comes from StyleGAN-V producing better individual frames, and possibly better small-scale motion, but falling seriously short in recreating believable long-term realism – and the FVD being sensitive primarily to the former aspects. Table 1 (right) reports FVD metrics on MoCoGAN-HD, TATS, DIGAN and our model for SkyTimelapse at $1 2 8 ^ { \bar { 2 } }$ ; we outperform all baselines in terms of $\mathrm { F V D _ { 1 2 8 } }$ on this comparison.
|
| 143 |
+
|
| 144 |
+
<table><tr><td></td><td>FVD128</td><td>FVD16</td></tr><tr><td>Ours</td><td>113.7</td><td>83.8</td></tr><tr><td>0.1× lowpass width</td><td>153.1</td><td>113.2</td></tr><tr><td>10× lowpass width</td><td>217.9</td><td>126.5</td></tr></table>
|
| 145 |
+
|
| 146 |
+
<table><tr><td></td><td>FVD128</td><td>FVD16</td></tr><tr><td>Ours (128 frames)</td><td>113.7</td><td>83.8</td></tr><tr><td>16 frames</td><td>163.6</td><td>108.5</td></tr><tr><td>2 frames</td><td>396.8</td><td>169.4</td></tr></table>
|
| 147 |
+
|
| 148 |
+
(a) Ablation of training sequence length
|
| 149 |
+
|
| 150 |
+
(b) Ablation of temporal lowpass filter footprint
|
| 151 |
+
|
| 152 |
+
Table 2: (a) Our model learns to generate realistic long videos by training on long videos; decreasing the sequence length used during training is consistently harmful. (b) The footprint of the temporal lowpass filters plays an important role in producing inputs to the low-resolution mapping network at appropriate temporal frequencies; changing the footprint by an order of magnitude hurts performance.
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
Figure 6: Evaluation of the super-resolution network. $^ { ( \mathbf { a } , \mathbf { b } ) }$ Generated low-resolution frames and the corresponding high-resolution frames produced by the super-resolution network. (c) The superresolution network yields remarkably good FVD when provided with real low-resolution videos as input; the overall quality of our results is largely dictated by the low-resolution generator.
|
| 156 |
+
|
| 157 |
+
# 5.4 Ablations
|
| 158 |
+
|
| 159 |
+
Training on long videos improves generation of long videos. Observing long videos during training helps our model learn long-term consistency, which is illustrated in Table 2a that ablates the sequence length used during training of the low-resolution generator. We found that the benefits of training with long videos only became evident after designing a generator architecture with appropriate temporal receptive field to utilize the rich training signal. Note that even though we ablate aspects of the low-resolution generator, we still compute FVD using the final high-resolution videos produced by the super-resolution network.
|
| 160 |
+
|
| 161 |
+
Footprint of the temporal lowpass filters. Our temporal latent representation serves a vital role in expanding the receptive field of our generator, modeling patterns over different time scales, and enabling the generation of new content over time. While we primarily leverage long training videos to learn long-term consistencies from data, the size of our temporal lowpass filters plays a role in encouraging the low-resolution mapping network to learn correlations at appropriate time scales. Table 2b demonstrates the negative impact of using inappropriately sized filters. We find that our model performs well with the same filter configuration for all datasets, although it is possible that the ideal settings may vary slightly between datasets.
|
| 162 |
+
|
| 163 |
+
Effectiveness of the super-resolution network. Figure 6a,b shows examples of low-resolution frames generated by our model along with the corresponding high-resolution frames produced by our super-resolution network; we find that the super-resolution network generally performs well. To ensure that the quality of our results is not disproportionately limited by the super-resolution network, we further measure FVD when providing the super-resolution network with real low-resolution videos as input in Figure 6c. Indeed, FVD greatly improves in this case, which indicates that there are still significant gains to be realized by further improving the low-resolution generator.
|
| 164 |
+
|
| 165 |
+
# 5.5 Failure cases
|
| 166 |
+
|
| 167 |
+
Separate low- and super-resolution networks makes the problem computationally feasible, but it may somewhat compromise the quality of the final high-resolution frames. We observed that “swirly” artifacts are most prominent in the super-resolution output and not in the low-resolution output. Our model also struggles with long-term consistency of small details (e.g., distant jumps in generated horseback riding videos) that begin to appear before quickly fading out. We believe these issues are due to limitations of our super-resolution network, and that improving the super-resolution network would benefit the model in this regard. Another failure case we observed is difficulty preserving 3D consistency for scenes with very little motion, such as in the ACID dataset. In cases where there is little motion, one may consider using an explicit 3D representation.
|
| 168 |
+
|
| 169 |
+
# 6 Conclusions
|
| 170 |
+
|
| 171 |
+
Video generation has historically focused on relatively short clips with little new content over time. We consider longer videos with complex temporal changes, and uncover several open questions and video generation practices worth reassessing — the temporal latent representation and generator architecture, the training sequence length and recipes for using long videos, and the right evaluation metrics for long-term dynamics.
|
| 172 |
+
|
| 173 |
+
We have shown that representations over many time scales serve as useful building blocks for modeling complex motions and the introduction of new content over time. We feel that the form of the latent space most suitable for video remains an open, almost philosophical question, leaving a large design space to explore. For example, what is the right latent representation to model persistent objects that exit from a video and re-enter later in the video while maintaining a consistent identity?
|
| 174 |
+
|
| 175 |
+
The benefits we find from training on longer sequences open up further questions. Would video generation benefit from even longer training sequences? Currently we train using segments of adjacent frames, but it might be beneficial to use larger frame spacings to cover longer time spans.
|
| 176 |
+
|
| 177 |
+
Quantitative evaluation of the results continues to be challenging. As we observed, FVD goes only a part of the way, being essentially blind to repetitive, even very implausible results. Our tests with how the colors and LPIPS distance change as a function of time partially bridge this gap, but we feel that this area deserves a thorough, targeted investigation of its own. We hope our work encourages further research into video generation that focuses on more complex and longer-term changes over time.
|
| 178 |
+
|
| 179 |
+
Negative societal impacts Our work falls within data-driven generative modeling, which, as a field, has well known potential for misuse with increasing quality improvements. The training of video generators is even more intensive computationally than training still image generators, increasing energy usage. Our project consumed 300MWh on an in-house cluster of V100 and A100 GPUs.
|
| 180 |
+
|
| 181 |
+
Acknowledgements We thank William Peebles, Samuli Laine, Axel Sauer and David Luebke for helpful discussion and feedback; Ivan Skorokhodov for providing additional results and insight into the StyleGAN-V baseline; Tero Kuosmanen for maintaining compute infrastructure; Elisa Wallace Eventing (https://www.youtube.com/c/WallaceEventing) and Brian Kennedy (https://www.youtube.com/c/bkxc) for videos used to make the horseback riding and mountain biking datasets. Tim Brooks is supported by the National Science Foundation Graduate Research Fellowship under Grant No. 2020306087.
|
| 182 |
+
|
| 183 |
+
# References
|
| 184 |
+
|
| 185 |
+
[1] Dinesh Acharya, Zhiwu Huang, Danda Pani Paudel, and Luc Van Gool. Towards high resolution video generation with progressive growing of sliced wasserstein gans. CoRR, abs/1810.02419, 2018.
|
| 186 |
+
[2] Adil Kaan Akan, Sadra Safadoust, Erkut Erdem, Aykut Erdem, and Fatma Güney. Stochastic video prediction with structure and motion. CoRR, abs/2203.10528, 2022.
|
| 187 |
+
[3] Mohammad Babaeizadeh, Chelsea Finn, Dumitru Erhan, Roy H Campbell, and Sergey Levine. Stochastic variational video prediction. In Proc. ICLR, 2018.
|
| 188 |
+
[4] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Proc. NeurIPS, 33:1877–1901, 2020.
|
| 189 |
+
[5] João Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In Proc. CVPR, pages 4724–4733, 2017.
|
| 190 |
+
[6] Silvia Chiappa, Sébastien Racaniere, Daan Wierstra, and Shakir Mohamed. Recurrent environment simulators. In Proc. ICLR, 2017.
|
| 191 |
+
[7] Rewon Child. Very deep vaes generalize autoregressive models and can outperform them on images. arXiv preprint arXiv:2011.10650, 2020.
|
| 192 |
+
[8] Joon Son Chung, Arsha Nagrani, and Andrew Zisserman. Voxceleb2: Deep speaker recognition. In Interspeech, 2018.
|
| 193 |
+
[9] Aidan Clark, Jeff Donahue, and Karen Simonyan. Adversarial video generation on complex datasets. CoRR, abs/1907.06571, 2019.
|
| 194 |
+
[10] Gianfranco Doretto, Alessandro Chiuso, Ying Nian Wu, and Stefano Soatto. Dynamic textures. International Journal of Computer Vision, 51(2):91–109, 2003.
|
| 195 |
+
[11] Christoph Feichtenhofer, Haoqi Fan, Jitendra Malik, and Kaiming He. Slowfast networks for video recognition. In Proceedings of the IEEE/CVF international conference on computer vision, pages 6202–6211, 2019.
|
| 196 |
+
[12] Gereon Fox, Ayush Tewari, Mohamed Elgharib, and Christian Theobalt. Stylevideogan: A temporal generative model using a pretrained stylegan. CoRR, abs/2107.07224, 2021.
|
| 197 |
+
[13] Songwei Ge, Thomas Hayes, Harry Yang, Xi Yin, Guan Pang, David Jacobs, Jia-Bin Huang, and Devi Parikh. Long video generation with time-agnostic vqgan and time-sensitive transformer. CoRR, abs/2204.03638, 2022.
|
| 198 |
+
[14] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. Proc. NIPS, 27, 2014.
|
| 199 |
+
[15] David Ha and Jürgen Schmidhuber. World models. CoRR, abs/1803.10122, 2018.
|
| 200 |
+
[16] Muhammad Haris, Gregory Shakhnarovich, and Norimichi Ukita. Recurrent back-projection network for video super-resolution. In Proc. CVPR, pages 3897–3906, 2019.
|
| 201 |
+
[17] Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In I. Guyon, U. Von Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017.
|
| 202 |
+
[18] Geoffrey Hinton, Nitish Srivastava, and Kevin Swersky. Neural networks for machine learning lecture 6a overview of mini-batch gradient descent. Cited on, 14(8):2, 2012.
|
| 203 |
+
[19] Jonathan Ho, Chitwan Saharia, William Chan, David J Fleet, Mohammad Norouzi, and Tim Salimans. Cascaded diffusion models for high fidelity image generation. Journal of Machine Learning Research, 23(47):1–33, 2022.
|
| 204 |
+
[20] Jonathan Ho, Tim Salimans, Alexey Gritsenko, William Chan, Mohammad Norouzi, and David J Fleet. Video diffusion models. CoRR, abs/2204.03458, 2022.
|
| 205 |
+
[21] Justin Johnson, Alexandre Alahi, and Li Fei-Fei. Perceptual losses for real-time style transfer and super-resolution. In European conference on computer vision, pages 694–711. Springer, 2016.
|
| 206 |
+
[22] James F Kaiser. Nonrecursive digital filter design using the i_0-sinh window function. In Proc. 1974 IEEE International Symposium on Circuits & Systems, San Francisco DA, April, pages 20–23, 1974.
|
| 207 |
+
[23] Nal Kalchbrenner, Aäron Oord, Karen Simonyan, Ivo Danihelka, Oriol Vinyals, Alex Graves, and Koray Kavukcuoglu. Video pixel networks. In Proc. ICML, pages 1771–1779, 2017.
|
| 208 |
+
[24] Armin Kappeler, Seunghwan Yoo, Qiqin Dai, and Aggelos K Katsaggelos. Video superresolution with convolutional neural networks. IEEE transactions on computational imaging, 2(2):109–122, 2016.
|
| 209 |
+
[25] Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. In Proc. ICLR, 2018.
|
| 210 |
+
[26] Tero Karras, Miika Aittala, Janne Hellsten, Samuli Laine, Jaakko Lehtinen, and Timo Aila. Training generative adversarial networks with limited data. In Proc. NeurIPS, 2020.
|
| 211 |
+
[27] Tero Karras, Miika Aittala, Samuli Laine, Erik Härkönen, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Alias-free generative adversarial networks. In Proc. NeurIPS, 2021.
|
| 212 |
+
[28] Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proc. CVPR, pages 4401–4410, 2019.
|
| 213 |
+
[29] Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Analyzing and improving the image quality of stylegan. In Proc. CVPR, pages 8110–8119, 2020.
|
| 214 |
+
[30] Seung Wook Kim, Jonah Philion, Antonio Torralba, and Sanja Fidler. Drivegan: Towards a controllable high-quality neural simulation. In Proc. CVPR, pages 5820–5829, 2021.
|
| 215 |
+
[31] Seung Wook Kim, Yuhao Zhou, Jonah Philion, Antonio Torralba, and Sanja Fidler. Learning to Simulate Dynamic Environments with GameGAN. In Proc. CVPR, Jun. 2020.
|
| 216 |
+
[32] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 217 |
+
[33] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25, 2012.
|
| 218 |
+
[34] Manoj Kumar, Mohammad Babaeizadeh, Dumitru Erhan, Chelsea Finn, Sergey Levine, Laurent Dinh, and Durk Kingma. Videoflow: A conditional flow-based model for stochastic video generation. In Proc. ICLR, 2020.
|
| 219 |
+
[35] Tuomas Kynkäänniemi, Tero Karras, Miika Aittala, Timo Aila, and Jaakko Lehtinen. The role of imagenet classes in fréchet inception distance. arXiv preprint arXiv:2203.06026, 2022.
|
| 220 |
+
[36] Alex X Lee, Richard Zhang, Frederik Ebert, Pieter Abbeel, Chelsea Finn, and Sergey Levine. Stochastic adversarial video prediction. CoRR, abs/1804.01523, 2018.
|
| 221 |
+
[37] Andrew Liu, Richard Tucker, Varun Jampani, Ameesh Makadia, Noah Snavely, and Angjoo Kanazawa. Infinite nature: Perpetual view generation of natural scenes from a single image. In Proc. ICCV, 2021.
|
| 222 |
+
[38] Andrew Liu, Richard Tucker, Varun Jampani, Ameesh Makadia, Noah Snavely, and Angjoo Kanazawa. Infinite nature: Perpetual view generation of natural scenes from a single image. In Proc. CVPR, 2021.
|
| 223 |
+
[39] Pauline Luc, Aidan Clark, Sander Dieleman, Diego de Las Casas, Yotam Doron, Albin Cassirer, and Karen Simonyan. Transformation-based adversarial video prediction on large-scale data. CoRR, abs/2003.04035, 2020.
|
| 224 |
+
[40] Lars Mescheder, Sebastian Nowozin, and Andreas Geiger. Which training methods for gans do actually converge? In International Conference on Machine Learning (ICML), 2018.
|
| 225 |
+
[41] Charlie Nash, João Carreira, Jacob Walker, Iain Barr, Andrew Jaegle, Mateusz Malinowski, and Peter Battaglia. Transframer: Arbitrary frame prediction with generative models. CoRR, abs/2203.09494, 2022.
|
| 226 |
+
[42] Ruslan Rakhimov, Denis Volkhonskiy, Alexey Artemov, Denis Zorin, and Evgeny Burnaev. Latent video transformer. CoRR, abs/2006.10704, 2020.
|
| 227 |
+
[43] Ali Razavi, Aaron Van den Oord, and Oriol Vinyals. Generating diverse high-fidelity images with vq-vae-2. Proc. NeurIPS, 32, 2019.
|
| 228 |
+
[44] Xuanchi Ren and Xiaolong Wang. Look outside the room: Synthesizing a consistent long-term 3d scene video from a single image. In Proc. CVPR, 2022.
|
| 229 |
+
[45] Andreas Rössler, Davide Cozzolino, Luisa Verdoliva, Christian Riess, Justus Thies, and Matthias Nießner. Faceforensics: A large-scale video dataset for forgery detection in human faces. arXiv preprint arXiv:1803.09179, 2018.
|
| 230 |
+
[46] Chitwan Saharia, Jonathan Ho, William Chan, Tim Salimans, David J Fleet, and Mohammad Norouzi. Image super-resolution via iterative refinement. arXiv:2104.07636, 2021.
|
| 231 |
+
[47] Masaki Saito, Eiichi Matsumoto, and Shunta Saito. Temporal generative adversarial nets with singular value clipping. In Proc. ICCV, pages 2830–2839, 2017.
|
| 232 |
+
[48] Masaki Saito, Shunta Saito, Masanori Koyama, and Sosuke Kobayashi. Train sparsely, generate densely: Memory-efficient unsupervised training of high-resolution temporal gan. International Journal of Computer Vision, 128(10):2586–2606, 2020.
|
| 233 |
+
[49] Mehdi S. M. Sajjadi, Raviteja Vemulapalli, and Matthew Brown. Frame-recurrent video super-resolution. In Proc. CVPR, 2018.
|
| 234 |
+
[50] Arno Schödl, Richard Szeliski, David H. Salesin, and Irfan Essa. Video textures. In Proc. SIGGRAPH, page 489–498, 2000.
|
| 235 |
+
[51] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 236 |
+
[52] Ivan Skorokhodov, Sergey Tulyakov, and Mohamed Elhoseiny. Stylegan-v: A continuous video generator with the price, image quality and perks of stylegan2. CoRR, abs/2112.14683, 2021.
|
| 237 |
+
[53] Khurram Soomro, Amir Roshan Zamir, and Mubarak Shah. Ucf101: A dataset of 101 human actions classes from videos in the wild. In Proc. ICCV, 2013.
|
| 238 |
+
[54] Xin Tao, Hongyun Gao, Renjie Liao, Jue Wang, and Jiaya Jia. Detail-revealing deep video super-resolution. In Proc. ICCV, 2017.
|
| 239 |
+
[55] Yu Tian, Jian Ren, Menglei Chai, Kyle Olszewski, Xi Peng, Dimitris N. Metaxas, and Sergey Tulyakov. A good image generator is what you need for high-resolution video synthesis. In Proc. ICLR, 2021.
|
| 240 |
+
[56] Sergey Tulyakov, Ming-Yu Liu, Xiaodong Yang, and Jan Kautz. Mocogan: Decomposing motion and content for video generation. In Proc. CVPR, pages 1526–1535, 2018.
|
| 241 |
+
[57] Thomas Unterthiner, Sjoerd van Steenkiste, Karol Kurach, Raphael Marinier, Marcin Michalski, and Sylvain Gelly. Towards accurate generative models of video: A new metric & challenges. CoRR, abs/1812.01717, 2018.
|
| 242 |
+
[58] Arash Vahdat and Jan Kautz. NVAE: A deep hierarchical variational autoencoder. In Proc. NeurIPS, 2020.
|
| 243 |
+
[59] Leonid Nisonovich Vaserstein. Markov processes over denumerable products of spaces, describing large systems of automata. Problemy Peredachi Informatsii, 5(3):64–72, 1969.
|
| 244 |
+
[60] Carl Vondrick, Hamed Pirsiavash, and Antonio Torralba. Generating videos with scene dynamics. In Proc. NIPS, 2016.
|
| 245 |
+
[61] Jacob Walker, Ali Razavi, and Aäron van den Oord. Predicting video with vqvae. CoRR, abs/2103.01950, 2021.
|
| 246 |
+
[62] Kaisiyuan Wang, Qianyi Wu, Linsen Song, Zhuoqian Yang, Wayne Wu, Chen Qian, Ran He, Yu Qiao, and Chen Change Loy. Mead: A large-scale audio-visual dataset for emotional talking-face generation. In Proc. ECCV, 2020.
|
| 247 |
+
[63] Ting-Chun Wang, Arun Mallya, and Ming-Yu Liu. One-shot free-view neural talking-head synthesis for video conferencing. In Proc. CVPR, 2021.
|
| 248 |
+
[64] Wei Xiong, Wenhan Luo, Lin Ma, Wei Liu, and Jiebo Luo. Learning to generate time-lapse videos using multi-stage dynamic generative adversarial networks. In Proc. CVPR, pages 2364–2373, 2018.
|
| 249 |
+
[65] Wilson Yan, Yunzhi Zhang, Pieter Abbeel, and Aravind Srinivas. Videogpt: Video generation using vq-vae and transformers. CoRR, abs/2104.10157, 2021.
|
| 250 |
+
[66] Sihyun Yu, Jihoon Tack, Sangwoo Mo, Hyunsu Kim, Junho Kim, Jung-Woo Ha, and Jinwoo Shin. Generating videos with dynamics-aware implicit generative adversarial networks. In Proc. ICLR, 2022.
|
| 251 |
+
[67] Jiangning Zhang, Chao Xu, Liang Liu, Mengmeng Wang, Xia Wu, Yong Liu, and Yunliang Jiang. Dtvnet: Dynamic time-lapse video generation via single still image. In Proc. ECCV, 2020.
|
| 252 |
+
[68] Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In CVPR, 2018.
|
| 253 |
+
[69] Shengyu Zhao, Zhijian Liu, Ji Lin, Jun-Yan Zhu, and Song Han. Differentiable augmentation for data-efficient gan training. In Proc. NeurIPS, 2020.
|
md/dev/XGzk5OKWFFc/XGzk5OKWFFc.md
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CDTRANS: CROSS-DOMAIN TRANSFORMER FOR UNSUPERVISED DOMAIN ADAPTATION
|
| 2 |
+
|
| 3 |
+
Tongkun $\mathbf { X } \mathbf { u } ^ { 1 2 * }$ , Weihua Chen1∗, Pichao Wang1, Fan Wang1, Hao $\mathbf { L i } ^ { 1 }$ , Rong Jin1
|
| 4 |
+
|
| 5 |
+
1Alibaba Group, 2Shandong University xutongkun1208@gmail.com, kugang.cwh@alibaba-inc.com {pichao.wang,fan.w,lihao.lh,jinrong.jr}@alibaba-inc.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Unsupervised domain adaptation (UDA) aims to transfer knowledge learned from a labeled source domain to a different unlabeled target domain. Most existing UDA methods focus on learning domain-invariant feature representation, either from the domain level or category level, using convolution neural networks (CNNs)-based frameworks. One fundamental problem for the category level based UDA is the production of pseudo labels for samples in target domain, which are usually too noisy for accurate domain alignment, inevitably compromising the UDA performance. With the success of Transformer in various tasks, we find that the cross-attention in Transformer is robust to the noisy input pairs for better feature alignment, thus in this paper Transformer is adopted for the challenging UDA task. Specifically, to generate accurate input pairs, we design a two-way center-aware labeling algorithm to produce pseudo labels for target samples. Along with the pseudo labels, a weight-sharing triple-branch transformer framework is proposed to apply self-attention and cross-attention for source/target feature learning and source-target domain alignment, respectively. Such design explicitly enforces the framework to learn discriminative domain-specific and domain-invariant representations simultaneously. The proposed method is dubbed CDTrans (cross-domain transformer), and it provides one of the first attempts to solve UDA tasks with a pure transformer solution. Experiments show that our proposed method achieves the best performance on public UDA datasets, e.g. VisDA-2017 and DomainNet. Code and models are available at https: //github.com/CDTrans/CDTrans.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Deep neural network have achieved remarkable success in a wide range of application scenarios (Wang et al., 2022; Qian et al., 2021; Yiqi Jiang, 2022; Tan et al., 2019; Chen et al., 2021b; Jiang et al., 2021; Chen et al., 2017) but it still suffers poor generalization performance to other new domain because of the domain shift problem (Csurka, 2017; Zhao et al., 2020; Zhang et al., 2020; Oza et al., 2021). To handle this issue and avoid the expensive laborious annotations, lots of research efforts (Bousmalis et al., 2017; Kuroki et al., 2019; Wilson & Cook, 2020; VS et al., 2021) are devoted on Unsupervised Domain Adaptation (UDA). The UDA task aims to transfer knowledge learned from a labeled source domain to a different unlabeled target domain. In UDA, most approaches focus on aligning distributions of source and target domain and learning domaininvariant feature representations. One kind of such UDA methods are based on category-level alignment (Kang et al., 2019; Zhang et al., 2019; Jiang et al., 2020; Li et al., 2021b), which have achieved promising results on public UDA datasets using deep convolution neural networks (CNNs). The fundamental problems in category-level based alignment is the production of pseudo labels for samples in target domain to generate the input source-target pairs. However, the current CNNs-based methods are not robust to the generated noisy pseudo labels for accurate domain alignment (Morerio et al., 2020; Jiang et al., 2020).
|
| 14 |
+
|
| 15 |
+
With the success of Transformer in natural language processing (NLP) (Vaswani et al., 2017; Devlin et al., 2018) and vision tasks (Dosovitskiy et al., 2020; Han et al., 2020; He et al., 2021; Khan et al.,
|
| 16 |
+
|
| 17 |
+
2021), it is found that cross-attention in Transformer is good at aligning different distributions, even from different modalities e.g., vision-to-vision (Li et al., 2021e), vision-to-text (Tsai et al., 2019; Hu & Singh, 2021) and text-to-speech (Li et al., 2019). And we find that it is robust to noise in pseudo labels to some extent. Hence, in this paper, we apply transformers to the UDA task to take advantage of its robustness to noise and super power for feature alignment to deal with the problems as described above in CNNs.
|
| 18 |
+
|
| 19 |
+
In our experiment, we conclude that even with noise in the labeling pair, the cross-attention can still work well in aligning two distributions, thanks to the attention mechanism. To obtain more accurate pseudo labels, we designed a two-way center-aware labeling algorithm for samples in the target domain. The pseudo labels are produced based on the cross-domain similarity matrix, and a center-aware matching is involved to weight the matrix and weaken noise into the tolerable range. With the help of pseudo labels, we design the cross-domain transformer (CDTrans) for UDA. It consists of three weight-sharing transformer branches, of which two branches are for source and target data respectively and the third one is the feature alignment branch, whose inputs are from source-target pairs. The self-attention is applied in the source/target transformer branches and crossattention is involved in the feature alignment branch to conduct domain alignment. Such design explicitly enforces the framework to learn discriminative domain-specific and domain-invariant representations simultaneously. In summary, our contributions are three-fold:
|
| 20 |
+
|
| 21 |
+
• We propose a weight-sharing triple-branch transformer framework, namely, CDTrans, for accurate unsupervised domain adaptation, taking advantage of its robustness to noisy labeling data and great power for feature alignment. • To produce pseudo labels with high quality, a two-way center-aware labeling method is proposed, and it boosts the final performance in the context of CDTrans. • CDTrans achieves the best performance compared to state-of-the-arts with a large margin on VisDA-2017 (Peng et al., 2017) and DomainNet (Peng et al., 2019) datasets.
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORK
|
| 24 |
+
|
| 25 |
+
# 2.1 TRANSFORMER FOR VISION
|
| 26 |
+
|
| 27 |
+
Transformer is proposed in (Vaswani et al., 2017) to model sequential data in the field of NLP. Many works have shown its effectiveness for computer-vision tasks (Han et al., 2020; Khan et al., 2021; Li et al., 2021d; Han et al., 2021b; Yu et al., 2021; Li et al., 2021c; Yang et al., 2021; Qian et al., 2022). Pure Transformer based models are becoming more and more popular. For example, ViT (Dosovitskiy et al., 2020) is proposed recently by feeding transformer with sequences of image patches; Touvron et al. (Touvron et al., 2021) propose DeiT that introduces a distillation strategy for transformers to help with ViT training; many other ViT variants (Yuan et al., 2021a; Wang et al., 2021; Han et al., 2021a; Chen et al., 2021a; Ranftl et al., 2021; Liu et al., 2021) are proposed from then, which achieve promising performance compared with its counterpart CNNs for both image classification and downstream tasks, such as object detection (Liu et al., 2021), semantic segmentation (Yuan et al., 2021b) and object ReID (He et al., 2021). For multi-modal based networks, there are several works (Tsai et al., 2019; Li et al., 2021e; Hu & Singh, 2021) that apply cross-attention for multi-modal feature fusion, which demonstrates that attention mechanism is powerful at distilling noise and feature alignment. This paper adopts cross-attention in the context of pure transformers for UDA tasks.
|
| 28 |
+
|
| 29 |
+
# 2.2 UNSUPERVISED DOMAIN ADAPTATION
|
| 30 |
+
|
| 31 |
+
There are mainly two levels for UDA methods: domain-level (Tzeng et al., 2014; Long et al., 2015; Ghifary et al., 2016; Tzeng et al., 2017; Bousmalis et al., 2017; Hoffman et al., 2018) and categorylevel (Saito et al., 2018; Kang et al., 2019; Du et al., 2021; Li et al., 2021a). Domain-level UDA mitigates the distribution divergence between the source and target domain by pulling them into the same distribution at different scale levels. The commonly used divergence measures include Maximum Mean Discrepancy (MMD) (Gretton et al., 2006; Tzeng et al., 2014; Long et al., 2015) and Correlation Alignment (CORAL) (Sun et al., 2016; Sun & Saenko, 2016). Recently, some works (Saito et al., 2018; Du et al., 2021; Li et al., 2021a) focus on the fine-grained category-level label distribution alignment through an adversarial manner between the feature extractor and two domain-specific classifiers. Unlike coarse-grained alignment at the domain scale, this approach aligns each category distribution between the source and target domain data by pushing the target samples to the distribution of source samples in each category. Obviously, the fine-grained alignment results in more accurate distribution alignment within the same label space. Although the adversarial approach achieves new improvements by fusing fine-grained alignment operations of source and target samples at the category level, it still does not solve the problem of noisy samples in the wrong category. Our method adopts Transformers for category-level UDA to solve the noise problem.
|
| 32 |
+
|
| 33 |
+
# 2.3 PSEUDO LABELING
|
| 34 |
+
|
| 35 |
+
Pseudo labeling (Lee et al., 2013) is first introduced for semi-supervised learning and gains popularity in domain adaptation tasks. It learns to label unlabeled data using predicted probabilities and performs fine-tuning together with labeled data. In terms of using pseudo labeling for domain adaptation tasks, (Long et al., 2017; 2018) adopt pseudo labels to conduct conditional distribution alignment; (Zhang et al., 2018; Choi et al., 2019) use pseudo labels as a regularization for domain adaptation; Zou et al. (2018) designs a self-training framework by alternately solving pseudo labels; Caron et al. (2018) propose a deep self-supervised method by generating pseudo labels via $k$ -means cluster to progressively train the model; Liang et al. (2020) develop a self-supervised pseudo labeling method to alleviate the effects of noisy pseudo labels. Based on Liang et al. (2020), in this work, we propose a two-way center-aware labeling algorithm to further filter the noisy pseudo pairs.
|
| 36 |
+
|
| 37 |
+
# 3 THE PROPOSED METHOD
|
| 38 |
+
|
| 39 |
+
We first introduce the cross attention module and analyze its robustness to the noise in Section 3.1. Then the two-way center-aware labeling method is presented in Section 3.2. With the produced pseudo labels as inputs, our cross-domain transformer (CDTrans) is proposed in Section 3.3, consisting of three weight-sharing transformers.
|
| 40 |
+
|
| 41 |
+
# 3.1 THE CROSS ATTENTION IN TRANSFORMER
|
| 42 |
+
|
| 43 |
+
# 3.1.1 PRELIMINARY
|
| 44 |
+
|
| 45 |
+
Vision Transformer (ViT) (Dosovitskiy et al., 2020) has achieved comparable or even superior performance on computer vision tasks. One of the most important structures in ViT is the selfattention module (Vaswani et al., 2017). In ViT, an image $\pmb { I } \in \dot { \mathbb { R } } ^ { H \times W \times C }$ is reshaped into a sequence of flattened 2D patches $x \in \mathbb { R } ^ { N \times ( P ^ { 2 } \cdot C ) }$ , where $( H , W )$ is the resolution of the original image, $C$ is the number of channels, $( P , P )$ is the resolution of each image patch, and $N = \overline { { H } } W / P ^ { 2 }$ is the resulting number of patches. For self-attention, the patches are first projected into three vectors, i.e. queries $Q \in \mathbb { R } ^ { \hat { N } \times d _ { k } }$ , keys $\pmb { K } \in \mathbb { R } ^ { N \times d _ { k } }$ and values $V \in \mathbb { R } ^ { N \times \hat { d _ { v } } }$ . $d _ { k }$ and $d _ { v }$ indicates their dimensions. The output is computed as a weighted sum of the values, where the weight assigned to each value is computed by a compatibility function of the query with the corresponding key. The $N$ patches serve as the inputs for the self-attention module, and the process can be formulated as below. The self-attention module aims to emphasize relationships among patches of the input image.
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
A t t n _ { s e l f } ( Q , K , V ) = s o f t m a x \big ( \frac { Q K ^ { T } } { \sqrt { d _ { k } } } \big ) V
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
The cross-attention module is derived from the self-attention module. The difference is that the input of cross-attention is a pair of images, i.e. $I _ { s }$ and $\mathbf { } I _ { t }$ . Its query and key/value are from patches of $I _ { s }$ and $\mathbf { } I _ { t }$ respectively. The cross-attention module can be calculated as follows:
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
A t t n _ { c r o s s } ( Q _ { s } , K _ { t } , V _ { t } ) = s o f t m a x ( \frac { Q _ { s } K _ { t } ^ { T } } { \sqrt { d _ { k } } } ) V _ { t }
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
where $Q _ { s } \in \mathbb { R } ^ { M \times d _ { k } }$ are queries from $M$ patches of image $I _ { s }$ , and $\pmb { K } _ { t } \in \mathbb { R } ^ { N \times d _ { k } } , V _ { t } \in \mathbb { R } ^ { N \times d _ { v } }$ are keys and values from $N$ patches of image $\mathbf { } I _ { t }$ . The output of the cross-attention module holds the same length $M$ as the number of the queries. For each output, it is calculated by multiplying $V _ { t }$ with attention weights, which comes from the similarity between the corresponding query in $\pmb { I _ { s } }$ and all the keys in $\mathbf { } I _ { t }$ . As a result, among all patches in $\mathbf { } I _ { t }$ , the patch that is more similar to the query of $I _ { s }$ would hold a larger weight and contribute more to the output. In other words, the output of the cross-attention module manages to aggregate the two input images based on their similar patches.
|
| 58 |
+
|
| 59 |
+

|
| 60 |
+
Figure 1: (a): The heatmap of the cross-attention weights for a false positive pair (Car vs. Truck). (b): The changes of UDA performance by the ratio of false positive pairs. The red/green curves represent the model with and without the cross-attention module. The blue curve means that only true positive pairs are involved in the cross-attention module.
|
| 61 |
+
|
| 62 |
+
So far, many researchers have utilized the cross-attention for feature fusion, especially in multimodal tasks (Tsai et al., 2019; Li et al., 2019; Hu & Singh, 2021; Li et al., 2021e). In these works, the inputs of the cross-attention module are from two modalities, e.g. vision-to-text (Tsai et al., 2019; Hu & Singh, 2021), text-to-speech (Li et al., 2019) and vision-to-vision (Li et al., 2021e). They apply the cross-attention to aggregate and align the information from two modalities. Given its great power in feature alignment, we propose to use the cross attention module to solve the unsupervised domain adaptation problem.
|
| 63 |
+
|
| 64 |
+
# 3.1.2 ROBUSTNESS TO NOISE
|
| 65 |
+
|
| 66 |
+
As mentioned above, the input of the cross-attention module is a pair of images, which usually comes from two domains, and the cross-attention module aims to align these two images. If label noise exists, there would be false positive pairs in the training data. Images in the false positive pairs would have dissimilar appearance, and forcibly aligning their features would inevitably injure the training and compromise the performance. We assume that the dissimilar patches in false positive pairs are more harmful to the performance than the similar patches. In the cross-attention module, two images are aligned based on their patch similarity. As shown in Fig. 1a, the cross-attention module would assign a low weight to the dissimilar patches in false positive pairs. Thus it weakens the negative effects of the dissimilar patches on the final performance to some extent.
|
| 67 |
+
|
| 68 |
+
To further analyze this issue, an experiment is carefully designed. Specifically, we randomly sample true positive pairs from source and target domain in VisDA-2017 dataset (Peng et al., 2017) as the training data. Then we manually replace the true positive pairs with random false positive pairs to increase the noise, and watch the changes of the performance as shown in Fig. 1b. The x-axis indicates the rate of false positive pairs in the training data, and the y-axis shows the performance of different methods on the UDA task. The red curve represents the results by aligning pairs with the cross-attention module, while the green curve is that without cross-attention, i.e. to directly train the target data with the label of corresponding source data in the pair. It can be seen that the red curve achieves a much better performance than the green one, which implies the robustness of the cross-attention module to the noise. We also provide another baseline shown as the blue curve in Fig. 1b, which is to remove the false positive pairs from the training data and train the cross-attention with only true positive pairs. Without the noisy data, this baseline can be considered as the upper bound to our methods. We can see the red curve is very close to the blue curve, and both of them are much better than the green one. It further implies that the cross-attention module is robust to the noisy input pair.
|
| 69 |
+
|
| 70 |
+
# 3.2 TWO-WAY CENTER-AWARE PSEUDO LABELING
|
| 71 |
+
|
| 72 |
+
# 3.2.1 TWO-WAY LABELING
|
| 73 |
+
|
| 74 |
+
To build the training pairs for the cross-attention module, an intuitive method is that for each image in the source domain, we manage to find the most similar image from the target domain. The set $\mathbb { P } _ { S }$ of selected pairs is:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\mathbb { P } _ { S } = \{ ( s , t ) | t = \operatorname* { m i n } _ { k } d ( { \pmb f } _ { s } , { \pmb f } _ { k } ) , \forall k \in T , \forall s \in S \}
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where $S , T$ are the source and target data respectively. $d ( f _ { i } , f _ { j } )$ means the distance between features of image $i$ and $j$ . The advantage of this strategy is to make full use of source data, while its weakness is obvious that only a part of target data is involved. To eliminate this training bias from target data, we introduce more pairs $\mathbb { P } _ { T }$ from the opposite way, consisting of all the target data and their corresponding most similar images in the source domain.
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\mathbb { P } _ { T } = \{ ( s , t ) | s = \operatorname* { m i n } _ { k } d ( \pmb { f } _ { t } , \pmb { f } _ { k } ) , \forall t \in T , \forall k \in S \}
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
As a result the final set $\mathbb { P }$ is the union of two sets, i.e. $\mathbb { P } = \{ \mathbb { P } _ { S } \cup \mathbb { P } _ { T } \}$ , making the training pairs include all the source and target data.
|
| 87 |
+
|
| 88 |
+
# 3.2.2 CENTER-AWARE FILTERING
|
| 89 |
+
|
| 90 |
+
The pairs in $\mathbb { P }$ are built based on the feature similarities of images from both domains, thus the accuracy of the pseudo labels of pairs is highly dependent on the feature similarities. Inspired by Liang et al. (2020), we find that the pre-trained model of the source data is also useful to further improve the accuracy. Firstly, we send all the target data through the pre-trained model and obtain their probability distributions $\delta$ on the source categories from the classifier. Similar to Liang et al. (2020), these distributions can be used to compute initial centers of each category in the target domain by weighted $\mathbf { k }$ -means clustering:
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
c _ { k } = \frac { \sum _ { t \in T } \delta _ { t } ^ { k } \mathbf { f } _ { t } } { \sum _ { t \in T } \delta _ { t } ^ { k } }
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
where $\delta _ { t } ^ { k }$ indicates the probability of image $t$ on category $k$ . Pseudo labels of the target data can be produced via the nearest neighbor classifier:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
y _ { t } = \arg \operatorname* { m i n } _ { k } d ( \pmb { c } _ { k } , \pmb { f } _ { t } )
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
where $t \in T$ and $d ( i , j )$ is the distance of features $i$ and $j$ . Based on the pseudo labels, we can calculate new centers:
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\mathbf { \boldsymbol { c } } _ { k } ^ { \prime } = \frac { \sum _ { t \in T } \mathbb { 1 } ( y _ { t } = k ) \mathbf { \boldsymbol { f } } _ { t } } { \sum _ { t \in T } \mathbb { 1 } ( y _ { t } = k ) }
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
In Liang et al. (2020), Eq. 6 and 7 could be updated for multiple rounds, and we only adopt one round in our paper. The final pseudo labels are then used to refine the selected pairs. Specifically, for every pair, if the pseudo label of the target image is consistent with the label of the source image, this pair would be kept for our training, otherwise it will be discarded as a noise.
|
| 109 |
+
|
| 110 |
+
# 3.3 CDTRANS: CROSS-DOMAIN TRANSFORMER
|
| 111 |
+
|
| 112 |
+
The framework of the proposed Cross-domain Transformer (CDTrans) is shown in Fig. 2, which consists of three weight-sharing transformers. There are three data flows and constraints for the weight-sharing branches.
|
| 113 |
+
|
| 114 |
+
The inputs of the framework are the selected pairs from our labeling method mentioned above. The three branches are named as source branch, target branch, source-target branch. As shown in Fig. 2, the source and target images in the input pair are sent to source branch and target branch respectively. In these two branches, the self-attention module is involved to learn the domain-specific representations. And the softmax cross-entropy loss is used to train the classification. It is worth noting that all three branches share the same classifier due to the same label of two images.
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 2: The proposed CDTrans framework. It consists of three weight-sharing transformers fed by inputs from the selected pairs using the two-way center-aware labeling method. Cross-entropy is adopted to source branch $( \mathrm { H } _ { S } )$ and target branch $( \mathrm { H } _ { T } )$ , while the distillation loss is applied between source-target branch $( \mathrm { H } _ { S + T } )$ and $\mathrm { H } _ { T }$ .
|
| 118 |
+
|
| 119 |
+
The cross-attention module is imported in the source-target branch. The inputs of the source-target branch are from the other two branches. In the $N$ -th layer, the query of the cross-attention module comes from the query in the $N$ -th layer of the source branch, while the keys and values are from those of the target branch. Then the cross-attention module outputs aligned features which are added with the output of the $( N - 1 )$ -th layer.2
|
| 120 |
+
|
| 121 |
+
The features of the source-target branch not only align distributions of two domains, but are robust to the noise in the input pairs thanks to the cross-attention module. Thus we use the output of the source-target branch to guide the training of the target branch. Specifically, the source-target branch and target branch are denoted as teacher and student respectively. We consider the probability distribution of the classifier in source-target branch as a soft label that can be used to further supervise the target branch through a distillation loss (Hinton et al., 2015):
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
L _ { d t l } = \sum _ { k } q _ { k } \log p _ { k }
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
where $q _ { k }$ and $p _ { k }$ are the probabilities of category $k$ from the source-target branch and the target branch respectively.
|
| 128 |
+
|
| 129 |
+
During inference, only the target branch is used. The input is an image from testing data, and only the target data flow is triggered, i.e. the blue lines in Fig. 2. Its output of the classifier is utilized as the final predicted labels.
|
| 130 |
+
|
| 131 |
+
# 4 EXPERIMENTS
|
| 132 |
+
|
| 133 |
+
# 4.1 DATASETS AND IMPLEMENTATION
|
| 134 |
+
|
| 135 |
+
The proposed method is verified on four popular UDA benchmarks, including VisDA-2017 (Peng et al., 2017), Office-Home (Venkateswara et al., 2017), Office-31 (Saenko et al., 2010) and DomainNet (Peng et al., 2019). The input image size in our experiments is $2 2 4 \times 2 2 4$ . Both the DeiT-small and DeiT-base (Touvron et al., 2021) are adopted as our backbone for fair comparison. We use the Stochastic Gradient Descent algorithm with the momentum of 0.9 and weight decay ratio 1e-4 to optimize the training process. The learning rate is set to 3e-3 for Office-Home, Office-31 and DomainNet, 5e-5 for VisDA-2017 since it can easily converge. The batch size is set to 64.
|
| 136 |
+
|
| 137 |
+
Table 1: Comparison with SoTA methods on VisDA-2017. “S/B” implies the DeiT-small/DeiT-base backbone respectively. $^ *$ indicates the results are reproduced by ourselves. ◦ implies its pretrained model is trained on ImageNet21K instead of ImageNet1K. The best performance is marked as bold.
|
| 138 |
+
|
| 139 |
+
<table><tr><td>Method</td><td>plane</td><td>bcycl</td><td>bus</td><td>car</td><td>horse</td><td>knife</td><td>mcycl</td><td>person</td><td>plant</td><td>sktbrd</td><td>train</td><td>truck</td><td>Avg.</td></tr><tr><td>ResNet-50</td><td>55.1</td><td>53.3</td><td>61.9</td><td>59.1</td><td>80.6</td><td>17.9</td><td>79.7</td><td>31.2</td><td>81.0</td><td>26.5</td><td>73.5</td><td>8.5</td><td>52.4</td></tr><tr><td>DANN</td><td>81.9</td><td>77.7</td><td>82.8</td><td>44.3</td><td>81.2</td><td>29.5</td><td>65.1</td><td>28.6</td><td>51.9</td><td>54.6</td><td>82.8</td><td>7.8</td><td>57.4</td></tr><tr><td>MinEnt</td><td>80.3</td><td>75.5</td><td>75.8</td><td>48.3</td><td>77.9</td><td>27.3</td><td>69.7</td><td>40.2</td><td>46.5</td><td>46.6</td><td>79.3</td><td>16.0</td><td>57.0</td></tr><tr><td>MCD</td><td>87.0</td><td>60.9</td><td>83.7</td><td>64.0</td><td>88.9</td><td>79.6</td><td>84.7</td><td>76.9</td><td>88.6</td><td>40.3</td><td>83.0</td><td>25.8</td><td>71.9</td></tr><tr><td>SWD</td><td>90.8</td><td>82.5</td><td>81.7</td><td>70.5</td><td>91.7</td><td>69.5</td><td>86.3</td><td>77.5</td><td>87.4</td><td>63.6</td><td>85.6</td><td>29.2</td><td>76.4</td></tr><tr><td>CDAN+E</td><td>85.2</td><td>66.9</td><td>83.0</td><td>50.8</td><td>84.2</td><td>74.9</td><td>88.1</td><td>74.5</td><td>83.4</td><td>76.0</td><td>81.9</td><td>38.0</td><td>73.9</td></tr><tr><td>BNM</td><td>89.6</td><td>61.5</td><td>76.9</td><td>55.0</td><td>89.3</td><td>69.1</td><td>81.3</td><td>65.5</td><td>90.0</td><td>47.3</td><td>89.1</td><td>30.1</td><td>70.4</td></tr><tr><td>MSTN+DSBN</td><td>94.7</td><td>86.7</td><td>76.0</td><td>72.0</td><td>95.2</td><td>75.1</td><td>87.9</td><td>81.3</td><td>91.1</td><td>68.9</td><td>88.3</td><td>45.5</td><td>80.2</td></tr><tr><td>CGDM</td><td>93.7</td><td>82.7</td><td>73.2</td><td>68.4</td><td>92.9</td><td>94.5</td><td>88.7</td><td>82.1</td><td>93.4</td><td>82.5</td><td>86.8</td><td>49.2</td><td>82.3</td></tr><tr><td>CGDM*</td><td>92.8</td><td>85.1</td><td>76.3</td><td>64.5</td><td>91.0</td><td>93.2</td><td>81.3</td><td>79.3</td><td>92.4</td><td>83.0</td><td>85.6</td><td>44.8</td><td>80.8</td></tr><tr><td>SHOT</td><td>94.3</td><td>88.5</td><td>80.1</td><td>57.3</td><td>93.1</td><td>93.1</td><td>80.7</td><td>80.3</td><td>91.5</td><td>89.1</td><td>86.3</td><td>58.2</td><td>82.9</td></tr><tr><td>SHOT*</td><td>95.5</td><td>87.5</td><td>80.1</td><td>54.5</td><td>93.6</td><td>94.2</td><td>80.2</td><td>80.9</td><td>90.0</td><td>89.9</td><td>87.1</td><td>58.4</td><td>82.7</td></tr><tr><td>TVT°</td><td>92.9</td><td>85.6</td><td>77.5</td><td>60.5</td><td>93.6</td><td>98.2</td><td>89.4</td><td>76.4</td><td>93.6</td><td>92.0</td><td>91.7</td><td>55.7</td><td>83.9</td></tr><tr><td>Baseline-B</td><td>97.7</td><td>48.1</td><td>86.6</td><td>61.6</td><td>78.1</td><td>63.4</td><td>94.7</td><td>10.3</td><td>87.7</td><td>47.7</td><td>94.4</td><td>35.5</td><td>67.1</td></tr><tr><td>CGDM-B*</td><td>96.3</td><td>87.1</td><td>86.8</td><td>83.5</td><td>92.2</td><td>98.3</td><td>91.6</td><td>78.5</td><td>96.3</td><td>48.4</td><td>89.4</td><td>39.0</td><td>82.3</td></tr><tr><td>SHOT-B*</td><td>97.9</td><td>90.3</td><td>86.0</td><td>73.4</td><td>96.9</td><td>98.8</td><td>94.3</td><td>54.8</td><td>95.4</td><td>87.1</td><td>93.4</td><td>62.7</td><td>85.9</td></tr><tr><td>Ours-B</td><td>97.1</td><td>90.5</td><td>82.4</td><td>77.5</td><td>96.6</td><td>96.1</td><td>93.6</td><td>88.6</td><td>97.9</td><td>86.9</td><td>90.3</td><td>62.8</td><td>88.4</td></tr></table>
|
| 140 |
+
|
| 141 |
+
<table><tr><td>Method</td><td colspan="11">Ar→ClAr-→Pr Ar-→ReCl-→ArCl-→PrCl-→Re Pr-→ArPr-→ClPr-→ReRe-→ArRe-→Cl Re-→Pr</td></tr><tr><td>ResNet-50</td><td>44.9</td><td>66.3 74.3</td><td>51.8</td><td>61.9</td><td>63.6</td><td>52.4</td><td>39.1</td><td>71.2 63.8</td><td>45.9</td><td>77.2</td><td>Avg. 59.4</td></tr><tr><td>MinEnt</td><td>51.0</td><td>71.9</td><td>77.1 61.2</td><td>69.1</td><td>70.1</td><td>59.3</td><td>48.7</td><td>77.0</td><td>70.4</td><td>53.0 81.0</td><td>65.8</td></tr><tr><td>CDAN+E</td><td>54.6</td><td>74.1 78.1</td><td>63.0</td><td>72.2</td><td>74.1</td><td>61.6</td><td>52.3</td><td>79.1</td><td>72.3</td><td>57.3 82.8</td><td>68.5</td></tr><tr><td>DCAN</td><td>54.5</td><td>75.7 81.2</td><td>67.4</td><td>74.0</td><td>76.3</td><td>67.4</td><td>52.7</td><td>80.6</td><td>74.1</td><td>59.1 83.5</td><td>70.5</td></tr><tr><td>BNM</td><td>56.7</td><td>77.5 81.0</td><td>67.3</td><td>76.3</td><td>77.1</td><td>65.3</td><td>55.1</td><td>82.0</td><td>73.6</td><td>57.0 84.3</td><td>71.1</td></tr><tr><td>ATDOC-NA</td><td>58.3</td><td>78.8 82.3</td><td>69.4</td><td>78.2</td><td>78.2</td><td>67.1</td><td>56.0</td><td>82.7</td><td>72.0</td><td>58.2 85.5</td><td>72.2</td></tr><tr><td>SHOT</td><td>57.1</td><td>78.1 81.5</td><td>68.0</td><td>78.2</td><td>78.1</td><td>67.4</td><td>54.9</td><td>82.2</td><td>73.3</td><td>58.8 84.3</td><td>71.8</td></tr><tr><td>SHOT*</td><td>56.2 77.6</td><td>81.6</td><td>67.5</td><td>78.2</td><td>78.8</td><td>67.8</td><td>54.0</td><td>82.0</td><td>72.5</td><td>58.8 84.5</td><td>71.6</td></tr><tr><td>TVT°</td><td>74.9</td><td>86.8 89.5</td><td>82.8</td><td>88.0</td><td>88.3</td><td>79.8</td><td>71.9</td><td>90.1</td><td>85.5</td><td>74.6 90.6</td><td>83.6</td></tr><tr><td>Baseline-S</td><td>55.6</td><td>73.0</td><td>79.4</td><td>70.6 72.9</td><td>76.3</td><td>67.5</td><td>51.0</td><td>81.0</td><td>74.5</td><td>53.2 82.7</td><td>69.8</td></tr><tr><td>Ours-S</td><td>60.6</td><td>79.5</td><td>82.4</td><td>75.6 81.0</td><td>82.3</td><td>72.5</td><td>56.7</td><td>84.4</td><td>77.0</td><td>59.1 85.5</td><td>74.7</td></tr><tr><td>Baseline-B</td><td>61.8</td><td>79.5</td><td>84.3 75.4</td><td>78.8</td><td>81.2</td><td>72.8</td><td>55.7</td><td>84.4</td><td>78.3</td><td>59.3 86.0</td><td>74.8</td></tr><tr><td>CGDM-B*</td><td>67.1</td><td>83.9 85.4</td><td>77.2</td><td>83.3</td><td>83.7</td><td>74.6</td><td>64.7</td><td>85.6</td><td>79.3</td><td>69.5 87.7</td><td>78.5</td></tr><tr><td>SHOT-B *</td><td>67.1</td><td>83.5</td><td>85.5</td><td>76.6 83.4</td><td>83.7</td><td>76.3</td><td>65.3</td><td>85.3</td><td>80.4</td><td>66.7 83.4</td><td>78.1</td></tr><tr><td>Ours-B</td><td>68.8</td><td>85.0</td><td>86.9</td><td>81.5 87.1</td><td>87.3</td><td>79.6</td><td>63.3</td><td>88.2</td><td>82.0</td><td>66.0 90.6</td><td>80.5</td></tr></table>
|
| 142 |
+
|
| 143 |
+
Table 2: Comparison with SoTA methods on Office-Home. The best performance is marked as bold.
|
| 144 |
+
|
| 145 |
+
# 4.2 COMPARISON TO SOTA
|
| 146 |
+
|
| 147 |
+
We compare our method with state-of-the-art methods on UDA tasks, including MinEnt (Grandvalet et al., 2005), DAN (Long et al., 2015), DANN (Ganin & Lempitsky, 2015), $\mathrm { C D A N + E }$ (Long et al., 2018), CDAN $^ +$ BSP (Chen et al., 2019), CDAN+TN (Wang et al., 2019), rRGrad $+ \mathrm { C A T }$ (Deng et al., 2019), MCD (Saito et al., 2018), SWD (Lee et al., 2019), MSTN+DSBN (Chang et al., 2019), SAFN $^ +$ ENT (Xu et al., 2019), BNM (Cui et al., 2020), DCAN (Li et al., 2020), SHOT (Liang et al., 2020), ATDOC-NA (Liang et al., 2021), CGDM (Du et al., 2021) and TVT (Yang et al.). The results are shown in Table 1, 2, 3 and 4.
|
| 148 |
+
|
| 149 |
+
For Office-Home, Office-31 and DomainNet, as most of the methods use ResNet-50 as their backbones, we provide results with DeiT-small as our backbone for a fair comparison, which has a comparable model size as ResNet-50, but we also show the results using DeiT-base. And for VisDA-2017, we adopt the DeiT-base backbone for fair comparisons, where other methods utilize ResNet-101 for their results.
|
| 150 |
+
|
| 151 |
+
The “Baseline-S/B” indicates directly training a DeiT-small/DeiT-base on the source domain and testing on the target domain. The baseline shows a competitive result even compared to other SoTA methods on most datasets. It demonstrates that Transformers has better generalization ability over ConvNets. We also provide some insights about why transformers can generalize well from source domain to target domain in the supplementary materials. To further eliminate the unfairness of using different backbones, we reproduce the results of SHOT and CGDM (marked as “\*”), and replace their backbones with DeiT-base as the same as ours, denoted as $\mathbf { \cdots } _ { - \mathbf { B } } \ast \mathbf { \cdots }$ .
|
| 152 |
+
|
| 153 |
+
<table><tr><td>MCD</td><td>clp inf</td><td>pnt qdr</td><td>rel skt Avg.</td><td>CDAN clp</td><td>inf pnt</td><td>qdr rel skt Avg.</td><td>BNM</td><td>clp</td><td>inf pnt</td><td>qdr</td><td>rel</td><td>skt Avg.</td></tr><tr><td>clp</td><td>-</td><td>15.4 25.5 3.3</td><td>44.6 31.2 24.0</td><td>clp -</td><td>13.528.3</td><td>9.3 43.8 30.2 25.0</td><td>clp</td><td>-</td><td>12.133.1</td><td>6.2</td><td>50.840.2 28.5</td><td></td></tr><tr><td>inf</td><td>24.1 -</td><td>24.0</td><td>1.6 35.2 19.7 20.9</td><td>inf 18.9</td><td>21.4</td><td>1.9 36.3 21.3 20.0</td><td>inf</td><td>26.6</td><td>28.5</td><td></td><td>2.4 38.5 18.1 22.8</td><td></td></tr><tr><td>pnt</td><td>31.1 14.8</td><td>- 1.7</td><td>48.1 22.8 23.7</td><td>pnt</td><td>29.6 14.4 -</td><td>4.1 45.2 27.4 24.2</td><td>pnt</td><td>39.9 12.2</td><td>1</td><td></td><td>3.4 54.5 36.2 29.2</td><td></td></tr><tr><td>qdr</td><td>8.5 2.1 4.6</td><td>-</td><td>7.9 7.1 6.0</td><td>qdr 11.8 1.2</td><td>4.0 1</td><td>9.4 9.5 7.2</td><td>qdr</td><td>17.8 1.0</td><td>3.6</td><td>:</td><td>9.28.3</td><td></td></tr><tr><td>rel</td><td>39.4 17.8 41.2</td><td>1.5</td><td>- 25.2 25.0</td><td>rel</td><td>36.4 18.3 40.9 3.4</td><td>1 24.6 24.7</td><td>rel</td><td></td><td>48.6 13.2 49.7 3.6</td><td></td><td></td><td>8.0</td></tr><tr><td>skt</td><td>37.3 12.6 27.2</td><td>4.1 34.5</td><td>1 23.1</td><td>skt</td><td>38.2 14.7 33.9 7.0</td><td>36.6 - 26.1</td><td>skt</td><td></td><td>54.9 12.842.3 5.4</td><td></td><td></td><td>33.9 29.8</td></tr><tr><td>Avg.</td><td>28.112.524.5</td><td>2.4</td><td>34.121.2 20.5</td><td>Avg.</td><td>27.0 12.4 25.7 5.1</td><td>34.3 22.621.2</td><td>Avg.</td><td></td><td>37.6 10.3 31.4 4.2</td><td></td><td>51.3</td><td>- 33.3</td></tr><tr><td>SWD</td><td>clp inf pnt</td><td>qdr rel</td><td>skt Avg.</td><td>CGDM clp</td><td>inf pnt qdr</td><td>rel skt Avg.</td><td>Base-S</td><td>clp inf</td><td></td><td></td><td>240.927.325.3</td><td></td></tr><tr><td>clp</td><td>-</td><td>14.7 31.9 10.1 45.3 36.5 27.7</td><td>cp</td><td>-</td><td></td><td>16.9 35.3 10.8 53.5 36.9 30.7</td><td>clp</td><td>-</td><td></td><td></td><td>pnt qdr rel skt Avg.</td><td></td></tr><tr><td>inf</td><td>22.9 - 24.2</td><td>2.5</td><td>33.2 21.3 20.0 inf</td><td>27.8</td><td></td><td>28.2 4.4 48.2 22.5 26.2</td><td>inf</td><td>36.8</td><td>1</td><td></td><td>21.2 44.215.3 59.9 46.0 37.3</td><td></td></tr><tr><td>pnt</td><td>33.6 15.3</td><td>4.4 46.1 30.7 26.0</td><td>pnt</td><td>37.7 14.5</td><td></td><td>4.6 59.4 33.5 30.0</td><td>pnt</td><td></td><td>47.1 21.7-</td><td></td><td>39.4 5.4 52.132.6 33.3</td><td></td></tr><tr><td>qdr</td><td>15.5 2.2 6.4</td><td>1</td><td>11.1 10.2 9.1 qdr</td><td>14.9</td><td>91.5 6.2 1</td><td>10.9 10.2 8.7</td><td>qdr</td><td></td><td>25.0 3.3 10.4</td><td>:</td><td>5.7 60.2 39.9 34.9</td><td></td></tr><tr><td>rel</td><td>41.2 18.1 44.2</td><td>4.6 1</td><td>31.6 27.9</td><td>rel</td><td>49.4 20.8 47.2 4.8</td><td>- 38.2 32.0</td><td>rel</td><td></td><td>54.8 23.9 52.6 7.4</td><td></td><td></td><td>18.8 14.0 14.3</td></tr><tr><td>skt</td><td>44.2 15.2 37.3 10.3 44.7</td><td></td><td>■ 30.3 skt</td><td></td><td>50.1 16.5 43.7 11.1 55.6</td><td>- 35.4</td><td>skt</td><td></td><td>55.6 18.6 42.7 14.9 55.7</td><td></td><td>1</td><td>40.1 35.8 37.5</td></tr><tr><td>Avg.</td><td>31.513.128.8</td><td>6.4 36.1 26.1</td><td>123.6 Avg.</td><td>36.0 14.0 32.1</td><td>7.1</td><td>45.5 28.3 27.2</td><td>Avg.</td><td></td><td>43.9 17.7 37.9 9.7 49.3 34.5 32.2</td><td></td><td></td><td></td></tr><tr><td>Ours-S</td><td>clp inf pnt</td><td>qdr rel</td><td>skt Avg. Base-B</td><td>clp</td><td>inf pnt qdr</td><td>relskt Avg.</td><td>Ours-B</td><td>clp</td><td>inf</td><td>pnt qdr rel skt Avg.</td><td></td><td></td></tr><tr><td>clp</td><td>-</td><td>25.3 52.5 23.2 68.3 53.2 44.5</td><td>clp</td><td></td><td></td><td>24.2 48.9 15.5 63.9 50.7 40.6</td><td>clp</td><td></td><td>29.4 57.2 26.0 72.6 58.1 48.7</td><td></td><td></td><td></td></tr><tr><td>inf</td><td>47.6 1 48.3</td><td>9.9</td><td>62.8 41.1 41.9 inf</td><td>43.5</td><td>44.9</td><td>6.5 58.8 37.6 38.3</td><td>inf</td><td>57.0</td><td></td><td>54.4 12.8 69.5 48.4 48.4</td><td></td><td></td></tr><tr><td>pnt</td><td>55.4 24.5</td><td></td><td>11.7 67.4 48.0 41.4</td><td>pnt 52.8 23.3</td><td>1</td><td>6.6 64.6 44.5 38.4</td><td>pnt</td><td>62.9 27.4</td><td></td><td></td><td></td><td>15.8 72.1 53.9 46.4</td></tr><tr><td>qdr</td><td>36.6 5.3 19.3</td><td>1</td><td>33.8 22.7 23.5</td><td>qdr</td><td>31.8 6.1 15.6 1</td><td>23.4 18.9 19.2</td><td>qdr</td><td></td><td>44.68.9 29.0</td><td></td><td></td><td>-42.6 28.5 30.7</td></tr><tr><td>rel</td><td>61.5 28.1 56.8 12.8</td><td>:</td><td>47.2 41.3</td><td>rel</td><td>58.9 26.3 56.7 9.1</td><td>- 45.0 39.2</td><td>rel</td><td></td><td></td><td>66.2 31.0 61.5 16.2</td><td></td><td>52.9 45.6</td></tr><tr><td>skt</td><td>64.3 26.1 53.2 23.9 66.2</td><td></td><td>- 46.7</td><td>skt</td><td>60.0 21.1 48.4 16.6 61.7</td><td></td><td>41.6 skt</td><td></td><td></td><td>69.0 29.6 59.0 27.2 72.5</td><td></td><td>51.5</td></tr><tr><td>Avg.</td><td></td><td>53.1 21.9 46.0 16.3 59.742.4 39.9</td><td></td><td>Avg.</td><td></td><td>49.420.2 42.910.9 54.539.336.2</td><td>Avg.</td><td></td><td></td><td>59.9 25.3 52.219.6 65.9 48.445.2</td><td></td><td></td></tr></table>
|
| 154 |
+
|
| 155 |
+
Table 4: Comparison with SoTA methods on DomainNet. “Base” is the Baseline.
|
| 156 |
+
|
| 157 |
+
From Table 1, 2, 3 and 4, it can be seen that our method outperforms the baseline with a large margin on all four datasets, e.g. nearly $21 \%$ on VisDA. With our improvements, the new Transformer with cross-attention module shows a much better generalization power, and achieves the best performance on VisDA-2017 compared to other SoTAs methods. It further implies the effectiveness of our method on the UDA task.
|
| 158 |
+
|
| 159 |
+
Taking a closer look at the results, for the hard categories, such as “person” in VisDA-2017 dataset, the baseline is very low, which indicates the initial model of our method has a poor classification ability on this category, leading to the pseudo labels with more noise. Even with
|
| 160 |
+
|
| 161 |
+
<table><tr><td>Method</td><td colspan="5">A→D A→W1 D→AD→WW→AW→D</td><td>Avg</td></tr><tr><td>ResNet-50 DANN</td><td>68.9 79.7</td><td>68.4 62.5</td><td>96.7</td><td>60.7</td><td>99.3</td><td>76.1</td></tr><tr><td>CDAN+E</td><td>82.0 92.9</td><td>68.2</td><td>96.9</td><td>67.4</td><td>99.1</td><td>82.2</td></tr><tr><td>rRGrad+CAT</td><td>94.1</td><td>71.0</td><td>98.6</td><td>69.3</td><td>100.</td><td>87.7</td></tr><tr><td></td><td>90.8 94.4</td><td>72.2</td><td>98.0</td><td>70.2</td><td>100.</td><td>87.6</td></tr><tr><td>SAFN+ENT</td><td>90.7 90.1</td><td>73.0</td><td>98.6</td><td>70.2</td><td>99.8</td><td>87.1</td></tr><tr><td>CDAN+BSP</td><td>93.0 93.3</td><td>73.6</td><td>98.2</td><td>72.6</td><td>100.</td><td>88.5</td></tr><tr><td>CDAN+TN</td><td>94.0 95.7</td><td>73.4</td><td>98.7</td><td>74.2</td><td>100.</td><td>89.3</td></tr><tr><td>SHOT</td><td>94.0 90.1</td><td>74.7</td><td>98.4</td><td>74.3</td><td>99.9</td><td>88.6</td></tr><tr><td>SHOT*</td><td>93.8 91.8</td><td>74.8</td><td>98.2</td><td>74.1</td><td>99.8</td><td>88.8</td></tr><tr><td>TVT°</td><td>96.4</td><td>96.4 84.9</td><td>99.4</td><td>86.1</td><td>100.</td><td>93.8</td></tr><tr><td>Baseline-S</td><td>87.6</td><td>86.9</td><td>74.9 97.7</td><td>73.5</td><td>99.6</td><td>86.7</td></tr><tr><td>Ours-S</td><td>94.6</td><td>93.5 78.4</td><td>98.2</td><td>78.0</td><td>99.6</td><td>90.4</td></tr><tr><td>Baseline-B</td><td>90.8</td><td>90.4 76.8</td><td>98.2</td><td>76.4</td><td>100.</td><td>88.8</td></tr><tr><td>CGDM-B*</td><td>94.6</td><td>95.3 78.8</td><td>97.6</td><td>81.2</td><td>99.8</td><td>91.2</td></tr><tr><td>SHOT-B*</td><td>95.3</td><td>94.3 79.4</td><td>99.0</td><td>80.2</td><td>100.</td><td>91.4</td></tr><tr><td>Ours-B</td><td>97.0</td><td>96.7</td><td>81.1</td><td>99.0</td><td>81.9</td><td>100. 92.6</td></tr></table>
|
| 162 |
+
|
| 163 |
+
Table 3: Comparison with SoTA methods on Office-31. The best performance is marked as bold.
|
| 164 |
+
|
| 165 |
+
such a poor baseline and poor quality of pseudo labels, our method can still achieve a much higher performance boost (from $1 0 . 3 \%$ to $8 8 . 6 \%$ ). It suggests that our method has a great robustness to the labeling noise and can overcome the noise problem to some extent.
|
| 166 |
+
|
| 167 |
+
We can see that TVT achieves a better result on Office-Home and Office-31. Because TVT utilizes ViT (Dosovitskiy et al., 2020) as backbone which is pretrained on ImageNet21K. While the pretrained model of our CDTrans and other UDA methods are trained on ImageNet1K.
|
| 168 |
+
|
| 169 |
+
# 4.3 ABLATION STUDY
|
| 170 |
+
|
| 171 |
+
# 4.3.1 DIFFERENT PSEUDO LABELING
|
| 172 |
+
|
| 173 |
+
We have conducted experiments on different pseudo labeling methods to verify their influence on the final performance. The results on VisDa-2017 are listed in Table. 5. RPLL (Zheng & Yang, 2021) and MRKLD+LRENT (Zou et al., 2019) are two commonly used pseudo-label generation methods, we reproduce their pseudo-label generations on our baseline to compare with our proposed pseudo labeling method. $R e c _ { s }$ , $R e c _ { t }$ means the recall of the selected training pairs in the source and target data, while P rec represents the accuracy of the pairs. “One-way-source” and “One-way-target” denote only using the pair set $\mathbb { P } _ { S }$ in Eq. 3 or $\mathbb { P } _ { T }$ in Eq. 4 for training. “Two-way” indicates results
|
| 174 |
+
|
| 175 |
+
<table><tr><td>Pseudo labels</td><td>RecRect Prec</td><td></td><td>plane bcycl bus car horse knife mcyclj</td><td></td><td></td><td></td><td></td><td></td><td></td><td>1person plant sktbrd train truck</td><td>Avg.</td></tr><tr><td>One-way-source</td><td>100.</td><td>6.690.6</td><td>96.1</td><td>52.7 85.5 69.6 95.0</td><td></td><td>90.2</td><td>95.1</td><td>66.6</td><td>88.8</td><td>54.6</td><td>95.4 29.5 76.6</td></tr><tr><td>One-way-target</td><td>8.0100.76.3</td><td></td><td>98.2</td><td>32.0 87.7 84.1 95.5</td><td></td><td>89.9</td><td>98.3</td><td>66.8</td><td>95.7</td><td>57.5</td><td>95.6 22.0 76.9</td></tr><tr><td>Two-way</td><td></td><td>100.100.81.8</td><td>97.5</td><td>49.6 88.7 73.9 94.6</td><td></td><td>85.8</td><td>96.6</td><td>58.6</td><td>93.3</td><td>63.6 94.8 27.9</td><td>77.1</td></tr><tr><td>Tw+Ca</td><td>97.8 94.8 91.3</td><td></td><td>98.1</td><td>86.9</td><td>87.9 80.9 97.9</td><td>97.3</td><td>96.8</td><td>85.3</td><td>97.6</td><td>83.2 94.0 54.4</td><td>88.4</td></tr><tr><td>RPLL</td><td></td><td></td><td>98.4</td><td>63.4 85.8 68.8 97.0</td><td></td><td>95.4</td><td>97.77</td><td>59.3</td><td>96.2</td><td>57.2 96.2 48.1</td><td>80.3</td></tr><tr><td>MRKLD+LRENT</td><td></td><td></td><td>97.8</td><td>77.3 81.4 64.3 94.6</td><td></td><td>93.9</td><td>93.3</td><td>77.5</td><td>93.1</td><td>74.9</td><td>92.6 59.0 83.3</td></tr><tr><td>Groundtruth</td><td></td><td>100.100.100.</td><td>97.9</td><td>89.1</td><td>92.3 91.9 98.4</td><td>97.2</td><td>97.5</td><td>86.8</td><td>98.6</td><td>90.7</td><td>96.3 60.0 91.5</td></tr></table>
|
| 176 |
+
|
| 177 |
+
Table 5: Comparison among different pseudo labeling methods on VisDa-2017. $R e c _ { s }$ , $R e c _ { t }$ express the recall of pseudo labels in source and target data, while P rec represents the accuracy of the pairs. “One-way-source/target” denotes only using the source/target pair set for training. “Tw+Ca” implies the proposed two-way center-aware labeling method.
|
| 178 |
+
|
| 179 |
+
<table><tr><td>Ls</td><td>Ls+t</td><td>Lt</td><td>plane</td><td>bcycl</td><td>bus</td><td>car</td><td>horse</td><td>knife</td><td>mcycl</td><td>person</td><td>plant</td><td>sktbrd</td><td>train</td><td>truck</td><td>Avg.</td></tr><tr><td>cls</td><td>-</td><td>1</td><td>97.7</td><td>48.1</td><td>86.6</td><td>61.6</td><td>78.1</td><td>63.4</td><td>94.7</td><td>10.3</td><td>87.7</td><td>47.7</td><td>94.4</td><td>35.5</td><td>67.1</td></tr><tr><td>-</td><td>-</td><td>cls</td><td>98.3</td><td>85.0</td><td>88.0</td><td>76.3</td><td>98.1</td><td>96.1</td><td>96.9</td><td>61.1</td><td>97.2</td><td>85.5</td><td>94.6</td><td>54.9</td><td>86.0</td></tr><tr><td>cls</td><td>1</td><td>cls</td><td>98.3</td><td>87.4</td><td>89.1</td><td>77.3</td><td>98.0</td><td>97.4</td><td>95.4</td><td>69.5</td><td>97.1</td><td>86.3</td><td>95.3</td><td>49.5</td><td>86.7</td></tr><tr><td>cls</td><td>cls</td><td>cls</td><td>98.2</td><td>88.4</td><td>88.0</td><td>76.8</td><td>98.2</td><td>97.2</td><td>95.6</td><td>80.1</td><td>97.1</td><td>84.7</td><td>94.5</td><td>54.1</td><td>87.7</td></tr><tr><td>cls</td><td>dtl</td><td>cls</td><td>98.0</td><td>86.9</td><td>87.9</td><td>80.9</td><td>97.9</td><td>97.3</td><td>96.8</td><td>85.3</td><td>97.6</td><td>83.2</td><td>94.0</td><td>54.4</td><td>88.4</td></tr></table>
|
| 180 |
+
|
| 181 |
+
Table 6: Comparison among different losses on VisDa-2017. $L _ { s } , L _ { t }$ and $L _ { s + t }$ represent the loss used in source, target and source+target branches respectively. cls and dtl imply the classification loss and the distillation loss.
|
| 182 |
+
|
| 183 |
+
of using the union of $\mathbb { P } _ { s }$ and $\mathbb { P } _ { t }$ without the center-aware strategy. “Tw+Ca” implies our two-way center-aware labeling method, and “Groundtruth” means all training pairs are from groundtruthes.
|
| 184 |
+
|
| 185 |
+
By looking at $R e c _ { s }$ and $R e c _ { t }$ in Table. 5, it can be found that the one-way methods have an apparent bias on either source or target data, and its results are lower than the two-way method. By comparing “Two-way” and $\mathrm { \Delta ^ { \circ } T w + C a ^ { \prime } }$ , we can conclude that although the center-aware method filters the training pair and slightly reduces the recall, it largely improves the precision and leads to a better final performance. We also find that our two-way center-aware labeling method achieves a very high result, not only better than other pseudo-label generation methods, but also very close to the upper bound trained with groundtruth pairs.
|
| 186 |
+
|
| 187 |
+
# 4.3.2 DIFFERENT LOSSES
|
| 188 |
+
|
| 189 |
+
As there are three losses in our method, we conduct another experiment to verify the effectiveness of each loss on VisDa-2017, as shown in Table. 6. “cls” in $L _ { s + t }$ denotes that we replace the distillation loss with a classification loss for the source-target branch. We can see that the 3rd row with both $L _ { s }$ and $L _ { t }$ having classification loss achieves a better result than the first row where only $L _ { s }$ has the cls loss, which means the target branch with the pseudo labels is helpful to improve the UDA result. With the addition of “cls” in $L _ { s + t }$ , the performance is further improved, which demonstrates the advantages of using the cross-attention module for feature alignment. Using “dtl” instead of “cls” on the source-target branch can further improve the results, showing the effectiveness of our distillation loss.
|
| 190 |
+
|
| 191 |
+
# 5 CONCLUSION
|
| 192 |
+
|
| 193 |
+
In this paper, we tackle the problem of unsupervised domain adaptation by introducing the crossattention module into Transformer in a novel way. We propose a new network structure CDTrans which is a pure transformer-based structure with three branches, and we also propose to generate high-quality pseudo labels using a two-way center-aware labeling method. Training CDTrans using the generated high-quality pseudo labels yields a robust solution and also achieves state-of-the-art results on four popular UDA datasets, outperforming previous methods by a large margin. We believe that transformer-based approaches will have great potential in the UDA community, and our work, as one of the first attempts along this direction, has pushed forward the frontiers and shed lights for future research.
|
| 194 |
+
|
| 195 |
+
# REFERENCES
|
| 196 |
+
|
| 197 |
+
Konstantinos Bousmalis, Nathan Silberman, David Dohan, Dumitru Erhan, and Dilip Krishnan. Unsupervised pixel-level domain adaptation with generative adversarial networks. In CVPR, 2017.
|
| 198 |
+
|
| 199 |
+
Mathilde Caron, Piotr Bojanowski, Armand Joulin, and Matthijs Douze. Deep clustering for unsupervised learning of visual features. In ECCV, 2018.
|
| 200 |
+
|
| 201 |
+
Woong-Gi Chang, Tackgeun You, Seonguk Seo, Suha Kwak, and Bohyung Han. Domain-specific batch normalization for unsupervised domain adaptation. In CVPR, 2019.
|
| 202 |
+
|
| 203 |
+
Boyu Chen, Peixia Li, Baopu Li, Chuming Li, Lei Bai, Chen Lin, Ming Sun, Junjie Yan, and Wanli Ouyang. Psvit: Better vision transformer via token pooling and attention sharing. arXiv preprint arXiv:2108.03428, 2021a.
|
| 204 |
+
|
| 205 |
+
Kai Chen, Weihua Chen, Tao He, Rong Du, Fan Wang, Xiuyu Sun, Yuchen Guo, and Guiguang Ding. Tagperson: A target-aware generation pipeline for person re-identification. arXiv preprint arXiv:2112.14239, 2021b.
|
| 206 |
+
|
| 207 |
+
Weihua Chen, Xiaotang Chen, Jianguo Zhang, and Kaiqi Huang. Beyond triplet loss: a deep quadruplet network for person re-identification. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 403–412, 2017.
|
| 208 |
+
|
| 209 |
+
Xinyang Chen, Sinan Wang, Mingsheng Long, and Jianmin Wang. Transferability vs. discriminability: Batch spectral penalization for adversarial domain adaptation. In ICML, 2019.
|
| 210 |
+
|
| 211 |
+
Jaehoon Choi, Minki Jeong, Taekyung Kim, and Changick Kim. Pseudo-labeling curriculum for unsupervised domain adaptation. arXiv preprint arXiv:1908.00262, 2019.
|
| 212 |
+
|
| 213 |
+
Gabriela Csurka. Domain adaptation for visual applications: A comprehensive survey. arXiv preprint arXiv:1702.05374, 2017.
|
| 214 |
+
|
| 215 |
+
Shuhao Cui, Shuhui Wang, Junbao Zhuo, Liang Li, Qingming Huang, and Qi Tian. Towards discriminability and diversity: Batch nuclear-norm maximization under label insufficient situations. In CVPR, 2020.
|
| 216 |
+
|
| 217 |
+
Zhijie Deng, Yucen Luo, and Jun Zhu. Cluster alignment with a teacher for unsupervised domain adaptation. In ICCV, 2019.
|
| 218 |
+
|
| 219 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 220 |
+
|
| 221 |
+
Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020.
|
| 222 |
+
|
| 223 |
+
Zhekai Du, Jingjing Li, Hongzu Su, Lei Zhu, and Ke Lu. Cross-domain gradient discrepancy minimization for unsupervised domain adaptation. In CVPR, 2021.
|
| 224 |
+
|
| 225 |
+
Yaroslav Ganin and Victor Lempitsky. Unsupervised domain adaptation by backpropagation. In ICML, 2015.
|
| 226 |
+
|
| 227 |
+
Muhammad Ghifary, W Bastiaan Kleijn, Mengjie Zhang, David Balduzzi, and Wen Li. Deep reconstruction-classification networks for unsupervised domain adaptation. In ECCV, 2016.
|
| 228 |
+
|
| 229 |
+
Yves Grandvalet, Yoshua Bengio, et al. Semi-supervised learning by entropy minimization. CAP, 367:281–296, 2005.
|
| 230 |
+
|
| 231 |
+
Arthur Gretton, Karsten Borgwardt, Malte Rasch, Bernhard Scholkopf, and Alex Smola. A kernel ¨ method for the two-sample-problem. NIPS, 2006.
|
| 232 |
+
|
| 233 |
+
Kai Han, Yunhe Wang, Hanting Chen, Xinghao Chen, Jianyuan Guo, Zhenhua Liu, Yehui Tang, An Xiao, Chunjing Xu, Yixing Xu, et al. A survey on visual transformer. arXiv preprint arXiv:2012.12556, 2020.
|
| 234 |
+
Kai Han, An Xiao, Enhua Wu, Jianyuan Guo, Chunjing Xu, and Yunhe Wang. Transformer in transformer. arXiv preprint arXiv:2103.00112, 2021a.
|
| 235 |
+
Liang Han, Pichao Wang, Zhaozheng Yin, Fan Wang, and Hao Li. Context and structure mining network for video object detection. IJCV, 2021b.
|
| 236 |
+
Shuting He, Hao Luo, Pichao Wang, Fan Wang, Hao Li, and Wei Jiang. Transreid: Transformerbased object re-identification. arXiv preprint arXiv:2102.04378, 2021.
|
| 237 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 238 |
+
Judy Hoffman, Eric Tzeng, Taesung Park, Jun-Yan Zhu, Phillip Isola, Kate Saenko, Alexei Efros, and Trevor Darrell. Cycada: Cycle-consistent adversarial domain adaptation. In ICML, 2018.
|
| 239 |
+
Ronghang Hu and Amanpreet Singh. Unit: Multimodal multitask learning with a unified transformer. arXiv preprint arXiv:2102.10772, 2021.
|
| 240 |
+
Xiang Jiang, Qicheng Lao, Stan Matwin, and Mohammad Havaei. Implicit class-conditioned domain alignment for unsupervised domain adaptation. In ICML, 2020.
|
| 241 |
+
Yiqi Jiang, Weihua Chen, Xiuyu Sun, Xiaoyu Shi, Fan Wang, and Hao Li. Exploring the quality of gan generated images for person re-identification. In Proceedings of the 29th ACM International Conference on Multimedia, pp. 4146–4155, 2021.
|
| 242 |
+
Guoliang Kang, Lu Jiang, Yi Yang, and Alexander G Hauptmann. Contrastive adaptation network for unsupervised domain adaptation. In CVPR, 2019.
|
| 243 |
+
Salman Khan, Muzammal Naseer, Munawar Hayat, Syed Waqas Zamir, Fahad Shahbaz Khan, and Mubarak Shah. Transformers in vision: A survey. arXiv preprint arXiv:2101.01169, 2021.
|
| 244 |
+
Seiichi Kuroki, Nontawat Charoenphakdee, Han Bao, Junya Honda, Issei Sato, and Masashi Sugiyama. Unsupervised domain adaptation based on source-guided discrepancy. In AAAI, 2019.
|
| 245 |
+
Chen-Yu Lee, Tanmay Batra, Mohammad Haris Baig, and Daniel Ulbricht. Sliced wasserstein discrepancy for unsupervised domain adaptation. In CVPR, 2019.
|
| 246 |
+
Dong-Hyun Lee et al. Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In Workshop on challenges in representation learning, ICML, 2013.
|
| 247 |
+
Jichang Li, Guanbin Li, Yemin Shi, and Yizhou Yu. Cross-domain adaptive clustering for semisupervised domain adaptation. In CVPR, 2021a.
|
| 248 |
+
Naihan Li, Shujie Liu, Yanqing Liu, Sheng Zhao, and Ming Liu. Neural speech synthesis with transformer network. In AAAI, 2019.
|
| 249 |
+
Shuai Li, Jianqiang Huang, Xian-Sheng Hua, and Lei Zhang. Category dictionary guided unsupervised domain adaptation for object detection. In AAAI, 2021b.
|
| 250 |
+
Shuang Li, Chi Liu, Qiuxia Lin, Binhui Xie, Zhengming Ding, Gao Huang, and Jian Tang. Domain conditioned adaptation network. In AAAI, volume 34, pp. 11386–11393, 2020.
|
| 251 |
+
Wenhao Li, Hong Liu, Runwei Ding, Mengyuan Liu, and Pichao Wang. Lifting transformer for 3d human pose estimation in video. arXiv preprint arXiv:2103.14304, 2021c.
|
| 252 |
+
Xiangyu Li, Yonghong Hou, Pichao Wang, Zhimin Gao, Mingliang Xu, and Wanqing Li. Transformer guided geometry model for flow-based unsupervised visual odometry. Neural Computing and Applications, 2021d.
|
| 253 |
+
Xiangyu Li, Yonghong Hou, Pichao Wang, Zhimin Gao, Mingliang Xu, and Wanqing Li. Trear: Transformer-based rgb-d egocentric action recognition. T-CDS, 2021e.
|
| 254 |
+
Jian Liang, Dapeng Hu, and Jiashi Feng. Do we really need to access the source data? source hypothesis transfer for unsupervised domain adaptation. In ICML, 2020.
|
| 255 |
+
Jian Liang, Dapeng Hu, and Jiashi Feng. Domain adaptation with auxiliary target domain-oriented classifier. In CVPR, pp. 16632–16642, 2021.
|
| 256 |
+
Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. arXiv preprint arXiv:2103.14030, 2021.
|
| 257 |
+
Mingsheng Long, Yue Cao, Jianmin Wang, and Michael Jordan. Learning transferable features with deep adaptation networks. In ICML, 2015.
|
| 258 |
+
Mingsheng Long, Han Zhu, Jianmin Wang, and Michael I Jordan. Deep transfer learning with joint adaptation networks. In ICML, 2017.
|
| 259 |
+
Mingsheng Long, Zhangjie Cao, Jianmin Wang, and Michael I Jordan. Conditional adversarial domain adaptation. NeurIPS, 2018.
|
| 260 |
+
Pietro Morerio, Riccardo Volpi, Ruggero Ragonesi, and Vittorio Murino. Generative pseudo-label refinement for unsupervised domain adaptation. In WACV, 2020.
|
| 261 |
+
Poojan Oza, Vishwanath A Sindagi, Vibashan VS, and Vishal M Patel. Unsupervised domain adaption of object detectors: A survey. arXiv preprint arXiv:2105.13502, 2021.
|
| 262 |
+
Xingchao Peng, Ben Usman, Neela Kaushik, Judy Hoffman, Dequan Wang, and Kate Saenko. Visda: The visual domain adaptation challenge. arXiv preprint arXiv:1710.06924, 2017.
|
| 263 |
+
Xingchao Peng, Qinxun Bai, Xide Xia, Zijun Huang, Kate Saenko, and Bo Wang. Moment matching for multi-source domain adaptation. In ICCV, 2019.
|
| 264 |
+
Yichen Qian, Zhiyu Tan, Xiuyu Sun, Ming Lin, Dongyang Li, Zhenhong Sun, Hao Li, and Rong Jin. Learning accurate entropy model with global reference for image compression. 2021.
|
| 265 |
+
Yichen Qian, Xiuyu Sun, Ming Lin, Zhiyu Tan, and Rong Jin. Entroformer: A transformer-based entropy model for learned image compression. arXiv preprint arXiv:2202.05492, 2022.
|
| 266 |
+
Rene Ranftl, Alexey Bochkovskiy, and Vladlen Koltun. Vision transformers for dense prediction. ´ arXiv preprint arXiv:2103.13413, 2021.
|
| 267 |
+
Kate Saenko, Brian Kulis, Mario Fritz, and Trevor Darrell. Adapting visual category models to new domains. In ECCV, 2010.
|
| 268 |
+
Kuniaki Saito, Kohei Watanabe, Yoshitaka Ushiku, and Tatsuya Harada. Maximum classifier discrepancy for unsupervised domain adaptation. In CVPR, 2018.
|
| 269 |
+
Baochen Sun and Kate Saenko. Deep coral: Correlation alignment for deep domain adaptation. In ECCV, 2016.
|
| 270 |
+
Baochen Sun, Jiashi Feng, and Kate Saenko. Return of frustratingly easy domain adaptation. In AAAI, 2016.
|
| 271 |
+
Zhiyu Tan, Xuecheng Nie, Qi Qian, Nan Li, and Hao Li. Learning to rank proposals for object detection. In ICCV, 2019.
|
| 272 |
+
Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Herve J ´ egou. Training data-efficient image transformers & distillation through attention. In ´ ICML, pp. 10347–10357, 2021.
|
| 273 |
+
Yao-Hung Hubert Tsai, Shaojie Bai, Paul Pu Liang, J Zico Kolter, Louis-Philippe Morency, and Ruslan Salakhutdinov. Multimodal transformer for unaligned multimodal language sequences. In ACL, 2019.
|
| 274 |
+
Eric Tzeng, Judy Hoffman, Ning Zhang, Kate Saenko, and Trevor Darrell. Deep domain confusion: Maximizing for domain invariance. arXiv preprint arXiv:1412.3474, 2014.
|
| 275 |
+
|
| 276 |
+
Eric Tzeng, Judy Hoffman, Kate Saenko, and Trevor Darrell. Adversarial discriminative domain adaptation. In CVPR, 2017.
|
| 277 |
+
|
| 278 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NIPS, 2017.
|
| 279 |
+
|
| 280 |
+
Hemanth Venkateswara, Jose Eusebio, Shayok Chakraborty, and Sethuraman Panchanathan. Deep hashing network for unsupervised domain adaptation. In CVPR, 2017.
|
| 281 |
+
|
| 282 |
+
Vibashan VS, Vikram Gupta, Poojan Oza, Vishwanath A Sindagi, and Vishal M Patel. Mega-cda: Memory guided attention for category-aware unsupervised domain adaptive object detection. In CVPR, 2021.
|
| 283 |
+
|
| 284 |
+
Wenhai Wang, Enze Xie, Xiang Li, Deng-Ping Fan, Kaitao Song, Ding Liang, Tong Lu, Ping Luo, and Ling Shao. Pyramid vision transformer: A versatile backbone for dense prediction without convolutions. arXiv preprint arXiv:2102.12122, 2021.
|
| 285 |
+
|
| 286 |
+
Ximei Wang, Ying Jin, Mingsheng Long, Jianmin Wang, and Michael Jordan. Transferable normalization: Towards improving transferability of deep neural networks. 2019.
|
| 287 |
+
|
| 288 |
+
Yaohua Wang, Yaobin Zhang, Fangyi Zhang, Senzhang Wang, Ming Lin, YuQi Zhang, and Xiuyu Sun. Ada-nets: Face clustering via adaptive neighbour discovery in the structure space. arXiv preprint arXiv:2109.06165, 2022.
|
| 289 |
+
|
| 290 |
+
Garrett Wilson and Diane J Cook. A survey of unsupervised deep domain adaptation. TIST, 2020.
|
| 291 |
+
|
| 292 |
+
Ruijia Xu, Guanbin Li, Jihan Yang, and Liang Lin. Larger norm more transferable: An adaptive feature norm approach for unsupervised domain adaptation. In iccv, pp. 1426–1435, 2019.
|
| 293 |
+
|
| 294 |
+
Guanglei Yang, Hao Tang, Zhun Zhong, Mingli Ding, Ling Shao, Nicu Sebe, and Elisa Ricci. Transformer-based source-free domain adaptation. arXiv preprint arXiv:2105.14138, 2021.
|
| 295 |
+
|
| 296 |
+
Jinyu Yang, Jingjing Liu, Ning Xu, and Junzhou Huang. Tvt: Transferable vision transformer for unsupervised domain adaptation. arXiv preprint arXiv:2108.05988.
|
| 297 |
+
|
| 298 |
+
Junyan Wang Xiuyu Sun Ming Lin Hao Li Yiqi Jiang, Zhiyu Tan. Giraffedet: A heavy-neck paradigm for object detection. arXiv preprint arXiv:2202.04256, 2022.
|
| 299 |
+
|
| 300 |
+
Zitong Yu, Xiaobai Li, Pichao Wang, and Guoying Zhao. Transrppg: Remote photoplethysmography transformer for 3d mask face presentation attack detection. IEEE SPL, 2021.
|
| 301 |
+
|
| 302 |
+
Li Yuan, Yunpeng Chen, Tao Wang, Weihao Yu, Yujun Shi, Francis EH Tay, Jiashi Feng, and Shuicheng Yan. Tokens-to-token vit: Training vision transformers from scratch on imagenet. arXiv preprint arXiv:2101.11986, 2021a.
|
| 303 |
+
|
| 304 |
+
Li Yuan, Qibin Hou, Zihang Jiang, Jiashi Feng, and Shuicheng Yan. Volo: Vision outlooker for visual recognition. arXiv preprint arXiv:2106.13112, 2021b.
|
| 305 |
+
|
| 306 |
+
Qiming Zhang, Jing Zhang, Wei Liu, and Dacheng Tao. Category anchor-guided unsupervised domain adaptation for semantic segmentation. NIPS, 2019.
|
| 307 |
+
|
| 308 |
+
Weichen Zhang, Wanli Ouyang, Wen Li, and Dong Xu. Collaborative and adversarial network for unsupervised domain adaptation. In CVPR, 2018.
|
| 309 |
+
|
| 310 |
+
Yabin Zhang, Bin Deng, Hui Tang, Lei Zhang, and Kui Jia. Unsupervised multi-class domain adaptation: Theory, algorithms, and practice. PAMI, 2020.
|
| 311 |
+
|
| 312 |
+
Sicheng Zhao, Xiangyu Yue, Shanghang Zhang, Bo Li, Han Zhao, Bichen Wu, Ravi Krishna, Joseph E Gonzalez, Alberto L Sangiovanni-Vincentelli, Sanjit A Seshia, et al. A review of singlesource deep unsupervised visual domain adaptation. T-NNLS, 2020.
|
| 313 |
+
|
| 314 |
+
Zhedong Zheng and Yi Yang. Rectifying pseudo label learning via uncertainty estimation for domain adaptive semantic segmentation. IJCV, 2021.
|
| 315 |
+
|
| 316 |
+
Yang Zou, Zhiding Yu, BVK Kumar, and Jinsong Wang. Unsupervised domain adaptation for semantic segmentation via class-balanced self-training. In ECCV, 2018.
|
| 317 |
+
|
| 318 |
+
Yang Zou, Zhiding Yu, Xiaofeng Liu, BVK Kumar, and Jinsong Wang. Confidence regularized self-training. In ICCV, 2019.
|
md/dev/Y4cs1Z3HnqL/Y4cs1Z3HnqL.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/ZWjEkv9rjo/ZWjEkv9rjo.md
ADDED
|
@@ -0,0 +1,341 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LATTICE QUANTIZATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Low bit quantization of weights in increasingly large deep convolutional neural networks (DCNNs) can be critical for their implementation in memory constrained hardware systems. Post-training quantization consists in quantizing a model without retraining, which is user-friendly, fast and data frugal. In this paper, we propose LatticeQ, a new post-training weight quantization method designed for DCNNs. Instead of the standard scalar rounding widely used in state-of-theart quantization methods, LatticeQ uses a quantizer based on lattices - discrete algebraic structures - which we show are able to exploit the inner correlations between the model parameters. LatticeQ allows us to achieve state-of-the-art results in post-training quantization, enabling us to approach full precision accuracies for bitwidths previously not accessible to post-training quantization methods in similar experimental settings. In particular, we achieve ImageNet classification results close to full precision on the popular Resnet-18/50, with only $1 \%$ and $3 \%$ accuracy drop for the 4-bit weights and 3-bit weights model architectures respectively.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Complex tasks such as image recognition on large datasets (Krizhevsky et al., 2017; He et al., 2015) and speech recognition (Hinton et al., 2012) are very efficiently solved by deep convolutional neural networks. To improve precision, deep learning models have become continually larger, more memory demanding and computationally heavier. Popular models like ResNet (He et al., 2015) use millions of parameters (Resnet-50 uses 25Mio of them, which represents a storage of almost 100MB of data). However, for embedded systems applications, storing such quantities of information is often impossible in practice. Some architectures are specifically designed to reduce this memory footprint like MobileNet (Howard et al., 2017; Sandler et al., 2018) (Mobilenet-v2 requires just 14MB of memory). But compressing existing architectures is easier than inventing new ones for specific needs. Therefore, various methods were designed to improve memory efficiency and reduce computational complexity of these models, in order to be able to use DCNNs for low power and/or low memory applications.
|
| 12 |
+
|
| 13 |
+
There are two major ways of reducing the size of a deep neural network :
|
| 14 |
+
|
| 15 |
+
• Reducing the total number of parameters, through pruning (Blalock et al., 2020), weight sharing, low-rank factorization.
|
| 16 |
+
• Reducing the memory footprint of its parameters and operation complexity, mainly through quantization (Krishnamoorthi, 2018).
|
| 17 |
+
|
| 18 |
+
Recently, quantization of popular models down to 4 and even 3-bit has been made possible, with little to no degradation of task performance (Esser et al., 2020; Jin et al., 2019). These breakthroughs often rely on retraining the model from scratch with stochastic gradient descent, using the full training dataset. This class of methods is known as quantization-aware training, and leads to the best performance in DCNNs quantization. However, using these methods can sometimes be impractical. The first drawback is the need for the full dataset. In some cases we only have access to a trained full precision network, and for confidentiality reasons, it may be impossible to access the full training dataset of this network. A second drawback is their practicality: training a quantized network from scratch can be extremely demanding in computation resources, last generation GPUs, which might not be available for the developer.
|
| 19 |
+
|
| 20 |
+
To overcome these constraints, several methods have been suggested that do not rely on retraining a network from scratch. This framework is called post-training quantization. It is commonly acknowledged that post-training methods do not lead to task performance as good as quantization aware training (Krishnamoorthi, 2018), especially when dealing with bitwidths 4 or lower, but they do solve the aforementioned problems, and can be critical for rapid deployment.
|
| 21 |
+
|
| 22 |
+
Inspired by Nagel et al. (2019), we propose a classification of quantization methods given their level of complexity and data requirements, which extends their own classification. We will use this framework to help the reader compare our method with those of other authors.
|
| 23 |
+
|
| 24 |
+
• Level 1a No data and no finetuning of the network’s parameters. “As simple as an API call”. The required inputs are only the model definition and its weights. (Nagel et al., 2019).
|
| 25 |
+
• Level 1b No data and no finetuning of the network’s parameters. Limited data can be used to calibrate activation quantization thresholds. Per-channel quantization is widely used. (Banner et al., 2019; Zhao et al., 2019).
|
| 26 |
+
• Level 2a Some samples of application data are needed, no finetuning of the network’s parameters. Data determines the quantization function (i.e. step, threshold, channel splitting, mixed precision), or updates batch normalization statistics. Per-channel and per-layer quantization coexist in the state of the art. (Choukroun et al., 2019; Liu et al., 2021).
|
| 27 |
+
• Level 2b Some samples of application data are needed, restricted finetuning pipeline for the network’s parameters. Data is used for layerwise optimization (Nagel et al., 2020; Wang et al., 2020) or blockwise optimization (Li et al., 2021) to improve quantization locally. From this level on, per-layer quantization is standard.
|
| 28 |
+
• Level 3 Quantization aware training. Requires the full dataset and parameter optimization, needs finetuning and hyperparameter tuning to achieve good performance.
|
| 29 |
+
|
| 30 |
+
In this paper, we introduce a new level 1b post-training quantization technique for deep convolutional neural networks, which achieves level 1b state-of-the-art classification performance on ImageNet down to 4-bit weights on Resnet architectures, with less than $1 \%$ accuracy drop compared to full precision models. We also show good performance for 3-bit quantization with $3 \%$ accuracy drop compared to full precision. Our method relies on a new quantizer that uses linear correlations between the parameters of convolution layers to minimize its error. The goal of this paper is not to show absolute best performance among all post-training quantization methods, but rather to show some improvement over the scalar quantizer is a standard and simple experimental setting.
|
| 31 |
+
|
| 32 |
+
# Our contributions
|
| 33 |
+
|
| 34 |
+
1. We introduce a new quantizer, based on the structure of lattices, to allow for more flexible and adaptive quantization of weights, contrary to most other techniques that rely on uniform quantizers.
|
| 35 |
+
2. We explore the impact of combining parameter and activation quantization for our quantizer, to allow for faster inference and low complexity computation.
|
| 36 |
+
3. We provide insights and analysis of how our quantizer works, and its memory overhead.
|
| 37 |
+
|
| 38 |
+
This paper is organized as follows: section 2 presents previous work on post-training quantization as well as quantization-aware training. Section 3 analyzes the parameter correlations inside DCNNs and introduces the intuition behind our approach. In section 4, we detail our approach and compare it to existing state-of-the art methods. In section 5, we give additional results of our quantizer without enhancements as an ablation study. Finally, in section 6, we provide analysis of the characteristics of our quantizer, including its quantization error, its distribution, and its memory overhead.
|
| 39 |
+
|
| 40 |
+
# 2 RELATED WORK
|
| 41 |
+
|
| 42 |
+
The performance of DCNN quantization schemes depends heavily on hypotheses: availability of training data, computation time and hardware capacities. The best results are currently achieved by quantization-aware training, which is the least restrictive: unlimited access to training data, unlimited computation time and resources, heavy hyperparameter finetuning and human expertise. Recently, promising results in this area have been achieved by Esser et al. (2020), Jin et al. (2019), which both used uniform quantizers for weights and activations. Non uniform quantizers, including vector quantizers relying on clustering techniques, have also been successfully employed (Han et al., 2016; Stock et al., 2020).
|
| 43 |
+
|
| 44 |
+
Post-training quantization meets stricter specifications than quantization-aware training. Nagel et al. (2019) for example assumed that no data is available at all for quantization. Banner et al. (2019) introduced bias correction and per-channel bit allocation. Choukroun et al. (2019) specifically designed a quantizer to minimize the MSE loss of the quantization operation. Other approaches that use a few samples of data have been proposed (Nagel et al., 2020), which used data in order to learn whether to round the weights up or down. Wang et al. (2020) proceeded by bit optimization, and Liu et al. (2021) exploited multipoint quantization to approximate full precision weight vectors with a linear combination of low bit vectors.
|
| 45 |
+
|
| 46 |
+
# 3 PRELIMINARY OBSERVATIONS
|
| 47 |
+
|
| 48 |
+
Most post-training schemes try to optimize task performance by adapting their quantizer to better fit the typically bell-shaped density function of the model weights. Moreover, these scalar methods do not pay attention to potential correlations between these parameters. As can be seen on Figure 1, correlations may exist between the weight values of trained DCNNs.
|
| 49 |
+
|
| 50 |
+

|
| 51 |
+
Figure 1: Left : Weight scalar distribution in layer 4.0 conv2 of an ImageNet pretrained Resnet50. Right : 2D plot of $( w _ { 1 } , w _ { 2 } )$ in the same layer, where $w _ { i }$ is the $i$ th coordinate of filter $w$ .
|
| 52 |
+
|
| 53 |
+
Figure 2 is the correlation matrix of the 9 distributions of filter parameters in a $3 \times 3$ convolution layer. The first distribution is the one of weights located in the upper left corner of a filter, the second distribution is the one of weights located in the upper center of a filter, etc. Formally, we plot in line $i$ and column $j$ the points $( w _ { i } , w _ { j } )$ for each filter $f = ( w _ { 1 } , . . . , w _ { 9 } )$ in a chosen layer. On the long diagonal, we plot the histogram of $w _ { i }$ . We notice that filters tend to have correlated coordinates, with quite high correlation coefficients. The same observation can be made in other $3 \times 3$ layers. From this observation, we justify the main assumption of our method: a quantizer “shaped as a parallelogram” is more data efficient than a uniform quantizer “shaped as a square”.
|
| 54 |
+
|
| 55 |
+
# 4 METHODS
|
| 56 |
+
|
| 57 |
+
Many state-of-the-art quantization methods rely on scalar uniform quantizers, which require only a few additional parameters: step size, bitwidth, and/or threshold. Other approaches use vector quantization, which may either be scalar or multidimensional, leading to more flexible quantization sets (Han et al., 2016; Stock et al., 2020) but are often limited by the need to use codebooks. LatticeQ takes the best of both approaches. It adds a limited number of additional parameters to encode quantization bases, and offers a broader variety of possible quantization sets than scalar uniform quantizers.
|
| 58 |
+
|
| 59 |
+

|
| 60 |
+
Figure 2: Left : Correlation diagram of filters in layer 4.0 conv2 (Conv2d $3 \times 3 ,$ ). Right : Uniform $\mathop { \left. \sum \right.} \left( \mathrm { \frac { \partial } { \partial \phi } } \right) =$ square) quantization and lattice $\overleftarrow { }$ parallelogram) quantization
|
| 61 |
+
|
| 62 |
+
# 4.1 LATTICE BASED WEIGHT QUANTIZER
|
| 63 |
+
|
| 64 |
+
In order to quantize the weights, LatticeQ uses lattices, which are algebraic structures that discretize the notion of vector space (see APPENDIX A for more details). Each lattice has a basis, meaning that each point of the lattice can be written as an integer linear combination of the vectors of this basis. This integer linear combination is the encoding of our quantization. A lattice has infinite cardinality. In order to use this structure as our quantizer we need a finite number of quantization points. We truncate our lattice in the following fashion $:$ let $\Lambda$ be a lattice, and $B = ( \mathbf { b _ { i } } ) _ { 1 \leq i \leq n } \in \mathbb { R } ^ { n }$ a basis of $\Lambda$ . Given $b$ the bitwidth, our quantization set is $\begin{array} { r } { Q = \{ q \in \mathbb { R } ^ { n } , q = \sum _ { i = 1 } ^ { n } \bar { \mu } _ { i } \bar { \mathbf { b _ { i } } } } \end{array}$ , $\forall i \in$ $\{ 1 , . . . , n \}$ , $- 2 ^ { b - 1 } \leq \mu _ { i } \leq 2 ^ { b - 1 } - 1 \}$ .
|
| 65 |
+
|
| 66 |
+
In memory, each quantized block is represented by its coordinates in the quantization basis. Let us suppose $\dot { \vec { B } } = ( \mathbf { b _ { 1 } } , \mathbf { \dot { b } _ { 2 } } , \mathbf { b _ { 3 } } ) = ( ( b _ { 1 , 1 } , \dot { b _ { 1 , 2 } } , b _ { 1 , 3 } ) , ( \dot { b _ { 2 , 1 } } , b _ { 2 , 2 } , b _ { 2 , 3 } ) , ( b _ { 3 , 1 } , \dot { b _ { 3 , 2 } } , \dot { b } _ { 3 , 3 } ) )$ is our quantization basis (with each $b _ { i , j }$ a scalar, possibly quantized with a uniform min/max quantizer), and:
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
F ^ { q } = { \binom { f _ { 1 } } { f _ { 4 } } } \quad f _ { 2 } \quad f _ { 3 } \\ { f _ { 7 } } \quad f _ { 8 } \quad f _ { 9 } \quad
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
is a $3 \times 3$ quantized filter. It consists in 3 quantized blocks: $( f _ { 1 } , f _ { 2 } , f _ { 3 } )$ , $( f _ { 4 } , f _ { 5 } , f _ { 6 } )$ and $( f _ { 7 } , f _ { 8 } , f _ { 9 } )$ The convolution represented by $F ^ { q }$ is the concatenation of three $1 \times 3$ vectors:
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
F = D e q u a n t ( F ^ { q } ) = \binom { \left( f _ { 1 } \mathbf { b _ { 1 } } + f _ { 2 } \mathbf { b _ { 2 } } + f _ { 3 } \mathbf { b _ { 3 } } \right) } { \left( f _ { 4 } \mathbf { b _ { 1 } } + f _ { 5 } \mathbf { b _ { 2 } } + f _ { 6 } \mathbf { b _ { 3 } } \right) }
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
Note that if we choose $\boldsymbol { B }$ as a uniform scaling of an orthonormal basis $( B = \lambda \times I _ { n } )$ ), the quantization set is exactly the one of classic scalar quantization (we call this simplified version “Cubic LatticeQ”).
|
| 79 |
+
|
| 80 |
+
The quantization process for a $3 \times 3$ layer is simple: we flatten the weights and group them by blocks of 3. Then, using the quantization basis, we search for the quantization point nearest to this block. The vector found is the quantization point for this block. In practice, we can use Dequant to calculate the convolution in the quantized network. However, for per-layer quantization, we propose an optimized way of dealing with the inference in a LatticeQ-quantized network in APPENDIX E.
|
| 81 |
+
|
| 82 |
+
Quantizing literally means defining a function from an infinite set to a finite set. In the scalar model, the quantization operation relies on a simple round function. In order to quantize on a lattice, we need to use a more complex algorithm. Actually, the problem of finding the closest lattice point to a real vector is known to be NP-hard (Micciancio, 1998), and is called Closest Vector Problem (CVP):
|
| 83 |
+
|
| 84 |
+
“Given $x \in \mathbb { R } ^ { n }$ and $\Lambda$ a lattice of $\mathbb { R } ^ { n }$ , find $\lambda \in \Lambda$ such that $d ( x , \lambda ) = m i n \{ d ( x , l ) , l \in \Lambda \}$ .”
|
| 85 |
+
|
| 86 |
+
<table><tr><td>Algorithm1Nearest plane algorithm</td></tr><tr><td>1:function BABAI(Basis B,Vector t) 2: B*=GramSchmidt(B)</td></tr><tr><td>3: b←t</td></tr><tr><td>4: for j ∈{n,...,1} do</td></tr><tr><td><b,b> 5: uj←<b></td></tr><tr><td>6: b←b-[ujlbj</td></tr><tr><td>7: end for</td></tr><tr><td>8: return x = ∑=1luj]bj =t-b 9: end function</td></tr></table>
|
| 87 |
+
|
| 88 |
+
<table><tr><td>Algorithm 2 Gram-Schmidt algorithm</td></tr><tr><td>1: function GRAMSCHMIDT(Basis B)</td></tr><tr><td>2: b←b1</td></tr><tr><td>3: for j ∈ {2,..,n} do</td></tr><tr><td>4: <bj,b*>b</td></tr><tr><td>5: end for</td></tr><tr><td>return B* = (b*)1≤j≤n 6:</td></tr><tr><td>7: end function</td></tr></table>
|
| 89 |
+
|
| 90 |
+
In order to solve the closest vector problem, we use the nearest plane algorithm (Babai, 1986). It is fairly easy to understand and implement, computationally light, and still provides good approximations in low dimension. We detail the implementation in algorithms 1 and 2.
|
| 91 |
+
|
| 92 |
+
Now that we have an algorithm to quantize on a lattice, we want to find a good lattice. For the data free approach, we opt for a simple random search with restart as described in algorithm 3. Restarts simply consist in running the algorithm several times in a row and keeping the best result of all the runs. We look for a lattice that reduces the mean cube error loss (MCE) between the full precision weights of the layer (or channel), and their quantized version. We chose this loss rather than MSE because it performed slightly better (Table 1). We assume this is because the MCE loss gives more importance to larger weights that are far away from any quantization point compared to the MSE.
|
| 93 |
+
|
| 94 |
+
# Algorithm 3 FindBasis
|
| 95 |
+
|
| 96 |
+
<table><tr><td colspan="2">1: function FINDBAsIs(Weight tensor W,Basis dimension dim, Bitwidth bits,Temperatures T)</td></tr><tr><td>2:</td><td>B←Idim</td></tr><tr><td>3:</td><td>for0≤s≤|T|do</td></tr><tr><td>4:</td><td>B'← B'+Sample(g(0,σ= T(s), |BI))</td></tr><tr><td>5:</td><td> if MCELoss(W, Wxg) < MCELoss(W, Wx) then</td></tr><tr><td>6:</td><td>B←B'</td></tr><tr><td>7:</td><td>end if</td></tr><tr><td>8: end for</td><td></td></tr><tr><td>9:</td><td>return B</td></tr><tr><td>10: end function</td><td></td></tr></table>
|
| 97 |
+
|
| 98 |
+
The random transformation we use is a multivariate gaussian noise addition with standard deviation $T ( s )$ , where $T$ is a sequence of temperature steps, that can be adjusted as a hyperparameter, see APPENDIX B. In order to perform low bit computations, we may want to quantize the basis itself to integer values, which we did in all our experiments, by adding a simple $\operatorname* { m i n } / \operatorname* { m a x }$ quantizer for $B ^ { \prime }$ between line 4 and line 5 in algorithm 3.
|
| 99 |
+
|
| 100 |
+
Since the approximation factor of the nearest plane algorithm grows in square root in the basis dimension $n$ (Babai, 1986), there is no interest in choosing high dimensional bases. Moreover, it increases the storage requirements, since an n-dimensional basis requires $n ^ { 2 }$ entries in memory. Experimentally, we notice that the most accurate dimension for the quantization basis is 3 for $3 \times 3$ layers (Table 2), and 2 for $1 \times 1$ layers.
|
| 101 |
+
|
| 102 |
+
Table 1: Comparison between MSE loss and MCE loss for Resnet-18 with weights quantized to 4-bit.
|
| 103 |
+
|
| 104 |
+
<table><tr><td colspan="3">Top-1 accuracy</td></tr><tr><td>Network</td><td>MSELoss</td><td>MCELoss</td></tr><tr><td>Resnet-18</td><td>67.85</td><td>67.94</td></tr></table>
|
| 105 |
+
|
| 106 |
+
Table 2: Impact of the choice of the basis dimension in $3 \times 3$ layers on final accuracy with weights quantized to 4-bit.
|
| 107 |
+
|
| 108 |
+
<table><tr><td colspan="3">Top-1 accuracy</td></tr><tr><td>Network</td><td>dim=3</td><td>dim=9</td></tr><tr><td>Resnet-18</td><td>67.94</td><td>61.90</td></tr></table>
|
| 109 |
+
|
| 110 |
+
# 4.2 ACTIVATION QUANTIZATION
|
| 111 |
+
|
| 112 |
+
As typically done in post-training scenario, we chose to perform activation quantization on one batch of data right before testing the quantized network. In real life, this can be done right before deployment on one batch of application data. We can either quantize activations per layer or per channel. In case we quantize the activations in a layer-wise fashion, the performance drops significantly below the 8-bit setting. In case we quantize the activations in a channel-wise fashion, it is possible to reach an activation precision down to 4-bit without much loss of accuracy by using a quantile trick similar to McKinstry et al. (2019). Let $C$ be an activation channel to quantize. Let $\alpha _ { C }$ be the quantile 0.9997 of $C$ ’s distribution, which means $p _ { c \in C } ( c \leq \alpha _ { C } ) = 0 . 9 9 9 7$ . We estimate $\alpha _ { C }$ by running a forward pass with one batch of data. Then we use $\alpha _ { C }$ as our activation threshold for the channel $C$ . We chose different quantiles depending on the network and activation bitwidths, see APPENDIX C.
|
| 113 |
+
|
| 114 |
+
# 4.3 EXPERIMENTAL SETUP
|
| 115 |
+
|
| 116 |
+
We evaluate our method on the ImageNet (Russakovsky et al., 2015) classification task. All experiments are made using PyTorch (Paszke et al., 2019), and the pretrained models used all come from the torchvision.models library. The basis is always quantized with the same bitwitdh as the activations. Based on experiments, we set bases dimension to 3 for $3 \times 3$ convolution layers, 2 for $1 \times 1$ layers and linear layers, and 1 for the first layer (since we did not notice any advantage in increasing the dimension for this particular layer). To quantize activations, we use a calibration batch of 512 images. As it is common practice in such applications, we quantize the pooling layers, first layer and last layer to 8-bit, and we do not quantize layer biases (only VGG (Simonyan & Zisserman, 2015) has biases). We report bitwidths settings and top-1 accuracy for each model tested, and we also provide the results from Banner et al. (2019) and Choukroun et al. (2019) for comparison. In part 4.4, we report the results of per-channel LatticeQ with data free enhancements in Table 3. In part 5, we report the results of per-channel LatticeQ without bias correction (refered to as our baseline) in Table 4 and the results of per-layer LatticeQ without bias correction in Table 5. Finally, in APPENDIX F, we report the results of weights-only quantization.
|
| 117 |
+
|
| 118 |
+
# 4.4 DATA FREE PER-CHANNEL ENHANCEMENT
|
| 119 |
+
|
| 120 |
+
Table 3: LatticeQ with bias correction on ImageNet. For 8-bits activations we use naive per-layer activation quantization. For 4-bit activations, we use our quantile per-channel approach. For weights, we use per-channel quantization and bias correction. We compare our results with results that we generated from the source code of Banner et al. (2019), using per-channel quantization and bias correction. We also compare with paper results from OMSE (Choukroun et al., 2019).
|
| 121 |
+
|
| 122 |
+
<table><tr><td colspan="3"></td><td colspan="3"> Top-1 accuracy</td><td rowspan="2">W3A3</td><td rowspan="2">W2A8</td></tr><tr><td>Network</td><td>Method</td><td>FP32</td><td>W4A8</td><td>W4A4</td><td>W3A8</td></tr><tr><td rowspan="3">Resnet-18</td><td>LatticeQ (Ours)</td><td>69.6</td><td>68.9</td><td>67.3</td><td>66.2</td><td>56.9</td><td>38.5</td></tr><tr><td>Banner et al.</td><td>69.6</td><td>67.4</td><td>64.3</td><td>43.4</td><td>28.6</td><td>1.3</td></tr><tr><td>OMSE+opt1</td><td>69.6</td><td>67.1</td><td></td><td></td><td></td><td></td></tr><tr><td rowspan="3">Resnet-50</td><td>LatticeQ (Ours)</td><td>76.0</td><td>75.3</td><td>70.9</td><td>73.1</td><td>55.0</td><td>45.6</td></tr><tr><td>Banner et al.</td><td>76.0</td><td>74.8</td><td>70.3</td><td>67.5</td><td>38.4</td><td>0.4</td></tr><tr><td>OMSE+opt1</td><td>76.0</td><td>74.7</td><td></td><td></td><td></td><td></td></tr><tr><td rowspan="3">VGG-16bn</td><td>LatticeQ (Ours)</td><td>73.4</td><td>73.0</td><td>70.6</td><td>70.8</td><td>61.9</td><td>35.8</td></tr><tr><td>Banner et al.</td><td>73.4</td><td>71.6</td><td>70.4</td><td>65.9</td><td>59.7</td><td>0.1</td></tr><tr><td>OMSE+opt1</td><td>73.4</td><td>72.3</td><td></td><td></td><td></td><td></td></tr><tr><td rowspan="3">Densenet</td><td>LatticeQ (Ours)</td><td>74.4</td><td>71.5</td><td>69.5</td><td>65.9</td><td>54.2</td><td>9.6</td></tr><tr><td>Banner et al.</td><td>74.4</td><td>70.2</td><td>63.0</td><td>53.8</td><td>18.7</td><td>0.4</td></tr><tr><td>OMSE+opt1</td><td>74.4</td><td>71.7</td><td></td><td></td><td></td><td></td></tr><tr><td rowspan="2">Mobilenet-v2</td><td>LatticeQ (Ours)</td><td>71.9</td><td>66.5</td><td>46.0</td><td>46.9</td><td>0.3</td><td>0.3</td></tr><tr><td>Banner et al.</td><td>71.9</td><td>61.1</td><td>36.3</td><td>10.2</td><td>0.3</td><td>0.1</td></tr></table>
|
| 123 |
+
|
| 124 |
+
For this part, we rely on the work of Banner et al. (2019). First, we use per-channel quantization, to allow for more accurate quantization in each channel. We then add bias correction. Quantization operations tend to alter the moments (mean and variance) of the weight distribution in each channel, which is taken into account by bias correction. In our case, bias correction is also computed during the execution of F indBasis for bitwidths lower than 4, so that the quantization basis found takes bias correction into account. Line 5 of F indBasis is, in this case, replaced by :
|
| 125 |
+
|
| 126 |
+
$\begin{array} { c } { { { \bf i f } M C E L o s s ( W , b i a s c o r r e c t i o n ( W _ { \Lambda _ { B ^ { \prime } } } ^ { q } ) ) < M C E L o s s ( W , b i a s c o r r e c t i o n ( W _ { \Lambda _ { B } } ^ { q } ) ) \ { \bf i f } } } \\ { { { \cal B } B ^ { \prime } } } \end{array}$ hen end if
|
| 127 |
+
|
| 128 |
+
The results in Table 3 show the substantial improvement of LatticeQ over state-of-the-art approaches. Our method outperforms Banner et al. (2019) with similar hypotheses, and even the level 2a OMSE $^ +$ opt method, in almost all settings for all presented models.
|
| 129 |
+
|
| 130 |
+
As we read the Table 3 from left to right, quantization is more and more aggressive. We find that LatticeQ manages to stay within $1 \%$ of full precision model accuracy on Resnets and VGG in 4- bit weights and 8-bit activation, and within $3 \%$ in 3-bit weights and 8-bit activation. As expected, compact models like Densenet (Huang et al., 2018) and Mobilenet-V2 (Sandler et al., 2018) are less resilient to quantization than Resnets (He et al., 2015) and VGG (Simonyan & Zisserman, 2015). It is noticeable that our method reaches a top-1 accuracy of $5 4 . 2 \%$ for Densenet in 3-bit weights and 3-bit activation setting while the method proposed by Banner et al. (2019) only achieved $1 8 . 7 \%$ .
|
| 131 |
+
|
| 132 |
+
# 5 ABLATION STUDY
|
| 133 |
+
|
| 134 |
+
In this section, we present an ablation study which objective is twofold. First, we provide the results of our per-channel quantizer without bias correction (Table 4). It is noticeable that our results remain close to full precision accuracy on Resnets and VGG (within $2 \%$ in per-channel W4A8, and within $10 \%$ in W3A8 for instance). Bias correction increases our method’s accuracy, but our baseline significantly outperforms baselines of other scalar quantization methods (Banner et al., 2019; Choukroun et al., 2019). Based on those results, we want to emphasize that lattice quantization is indeed the cornerstone of the quantization process.
|
| 135 |
+
|
| 136 |
+
Table 4: LatticeQ per-channel baseline quantization of weights and activations.
|
| 137 |
+
|
| 138 |
+
<table><tr><td colspan="6">Top-1 accuracy</td></tr><tr><td>Network</td><td>FP32</td><td>W4A8</td><td>W4A4</td><td>W3A8</td><td>W3A3</td></tr><tr><td>Resnet-18</td><td>69.6</td><td>67.2</td><td>66.0</td><td>59.6</td><td>40.2</td></tr><tr><td>Resnet-50</td><td>76.0</td><td>74.6</td><td>70.6</td><td>69.3</td><td>47.6</td></tr><tr><td>VGG-16bn</td><td>73.4</td><td>72.4</td><td>70.4</td><td>64.3</td><td>57.0</td></tr><tr><td>Densenet</td><td>74.4</td><td>70.5</td><td>66.5</td><td>54.9</td><td>33.9</td></tr><tr><td>Mobilenet-v2</td><td>71.9</td><td>58.0</td><td>31.7</td><td>21.5</td><td>0.1</td></tr></table>
|
| 139 |
+
|
| 140 |
+
Next, we provide the results of our per-layer quantizer (Table 5). Quantizing per layer in W8A8 does not impact performance on Resnets. Although it remains challenging to quantize weights per layer under our assumptions (no calibration data for weights), we show promising accuracy that lays the foundations of potential level 2 applications.
|
| 141 |
+
|
| 142 |
+
Table 5: LatticeQ per-layer baseline quantization of weights and activations.
|
| 143 |
+
|
| 144 |
+
<table><tr><td></td><td colspan="3">Top-1 accuracy</td></tr><tr><td>Network</td><td>FP32</td><td>W8A8</td><td>W4A8 W3A8</td></tr><tr><td>Resnet-18</td><td>69.6</td><td>69.5</td><td>59.5 23.8 70.2</td></tr><tr><td>Resnet-50</td><td>76.0</td><td>75.9</td><td>41.9</td></tr><tr><td>VGG-16bn Densenet</td><td>73.4</td><td>73.3</td><td>68.5 42.5 59.4</td></tr><tr><td></td><td>74.4</td><td>71.3</td><td>11.4</td></tr><tr><td>Mobilenet-v2</td><td>71.9</td><td>70.6</td><td>12.9 0.2</td></tr></table>
|
| 145 |
+
|
| 146 |
+
# 6 ANALYSIS
|
| 147 |
+
|
| 148 |
+

|
| 149 |
+
Figure 3: Resnet18 per-layer quantization error comparison between LatticeQ and Cubic LatticeQ (scalar quantization). Vertical axis is MCE.
|
| 150 |
+
|
| 151 |
+
Table 6: Comparison between baseline perchannel LatticeQ and baseline per-channel Cubic LatticeQ (scalar quantization).
|
| 152 |
+
|
| 153 |
+
<table><tr><td>Network</td><td>Method</td><td>FP32</td><td>W4A8</td></tr><tr><td rowspan="2">Resnet-18</td><td>LatticeQ</td><td>69.6</td><td>67.2</td></tr><tr><td>Cubic LatticeQ</td><td>69.6</td><td>57.6</td></tr></table>
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Figure 4: Left : Cubic LatticeQ quantization points (red) and $1 \times 3$ filter blocks (blue), Right : LatticeQ quantization points (red) and $1 \times 3$ filter blocks (blue). These are the 2-bit quantization points for visualization.
|
| 157 |
+
|
| 158 |
+
We have demonstrated experimentally the advantages, both in quantization error - as can be seen in Figure 3 - and task loss (Table 6), in using a deformable lattice for quantization rather than a cubic lattice (which is equivalent to uniform scalar quantization). This confirms our hypothesis that the inner correlations of the parameters of a neural network can be exploited for the purpose of quantization. We also show how the distribution of the quantization points indeed fits the multidimensional distribution of the network’s parameters thanks to our method (Figure 4). On this figure, each full precision filter block is represented by a blue dot in the 3D space, and each quantization point of our method is represented by a red dot in the 3D space. LatticeQ increases the concentration of quantization points in the most critical areas of the filters’ multidimensional distribution.
|
| 159 |
+
|
| 160 |
+
# 6.2 MEMORY OVERHEAD
|
| 161 |
+
|
| 162 |
+
In this section, we compute the memory overhead due to using our method, both in per-channel and per-layer settings. Each time a basis is used to quantize either a channel or a layer, we need to store $3 \dot { 2 } + n ^ { 2 } . b$ bits where $n$ is the dimension of the basis and $b$ is the number of quantization bits used for basis elements. 32 comes from the scaling factor. See Table 7 for a few examples among the networks we experimented with in this paper. We report the compression ratios of the full models. The compression rate penalty due to quantization bases is negligible in the per-layer setting, and always less than $1 \%$ in the per-channel setting. The compression that can be achieved by descending to lower bitwidths therefore largely offsets the memory overhead.
|
| 163 |
+
|
| 164 |
+
Table 7: Baseline LatticeQ memory cost. Scalar compression rate is the compresion rate of a scalar quantization method with the same bitwidth, such as Cubic LatticeQ.
|
| 165 |
+
|
| 166 |
+
<table><tr><td>Type</td><td>Network</td><td>W4A8 memory total</td><td>Compression rate</td><td> Scalar comp. rate</td></tr><tr><td rowspan="4">Per layer</td><td>Resnet-18</td><td>6.100 MB</td><td>13.06%</td><td>13.06%</td></tr><tr><td>Resnet-50</td><td>13.78 MB</td><td>13.51%</td><td>13.51%</td></tr><tr><td>Densenet</td><td>4.465 MB</td><td>14.14%</td><td>14.14%</td></tr><tr><td>Mobilenet-v2</td><td>2.376 MB</td><td>17.12%</td><td>17.12%</td></tr><tr><td rowspan="4">Per channel</td><td>Resnet-18</td><td>6.158 MB</td><td>13.18%</td><td>13.10%</td></tr><tr><td>Resnet-50</td><td>14.01 MB</td><td>13.74%</td><td>13.61%</td></tr><tr><td>Densenet</td><td>4.555MB</td><td>14.43%</td><td>14.27%</td></tr><tr><td>Mobilenet-v2</td><td>2.547 MB</td><td>18.35%</td><td>17.60 %</td></tr></table>
|
| 167 |
+
|
| 168 |
+
# 7 DISCUSSION AND FUTURE WORK
|
| 169 |
+
|
| 170 |
+
In this paper, we introduced LatticeQ, a new post-training method which exploits the flexibility of lattice quantizers for the purpose of DCNN quantization. LatticeQ is particularly useful in cases where we want to deploy deep learning models trained in floating point precision on lightweight architectures without requiring a single training sample (which could happen for confidentiality, safety reasons, or for the sake of simplicity). We showed that our quantizer significantly outperforms the scalar quantizer for 3-bit quantization on several well-known architectures, and by up to $20 \%$ on Resnet-18, with less than $1 \%$ additional memory costs. LatticeQ does not require any finetuning or hyperparameter optimization, which makes it simple to use in practice.
|
| 171 |
+
|
| 172 |
+
Since lattice quantizers are a generalization of uniform quantizers, every uniform quantization method has a lattice extension. Therefore, we believe that lattice quantizers could have a high potential under other experimental hypotheses, like quantization-aware training. Using limited calibration data in order to perform parameter optimization after quantization could also improve performance, which we leave for future work.
|
| 173 |
+
|
| 174 |
+
# 8 REPRODUCIBILITY STATEMENT
|
| 175 |
+
|
| 176 |
+
We want to make sure our results are reproducible. As suggested in the author guide, we will make a comment directed to the reviewers and area chairs and put a link to an anonymous repository to submit our code. Due to the randomness of our optimization strategy and the choice of calibration data, results may slightly vary. We mitigated this issue by adding restarts to our random search.
|
| 177 |
+
|
| 178 |
+
# REFERENCES
|
| 179 |
+
|
| 180 |
+
L Babai. Nearest lattice point problem. 1986.
|
| 181 |
+
|
| 182 |
+
Ron Banner, Yury Nahshan, Elad Hoffer, and Daniel Soudry. Post-training 4-bit quantization of convolution networks for rapid-deployment. NeurIPS, 2019.
|
| 183 |
+
|
| 184 |
+
Davis Blalock, Jose Javier Gonzalez Ortiz, Jonathan Frankle, and John Guttag. What is the State of Neural Network Pruning? 2020.
|
| 185 |
+
|
| 186 |
+
Yoni Choukroun, Eli Kravchik, Fan Yang, and Pavel Kisilev. Low-bit Quantization of Neural Networks for Efficient Inference. arXiv:1902.06822, 2019.
|
| 187 |
+
|
| 188 |
+
Steven K. Esser, Jeffrey L. McKinstry, Deepika Bablani, Rathinakumar Appuswamy, and Dharmendra S. Modha. Learned Step Size Quantization. arXiv:1902.08153, 2020.
|
| 189 |
+
|
| 190 |
+
Song Han, Huizi Mao, and William J. Dally. Deep Compression: Compressing Deep Neural Networks with Pruning, Trained Quantization and Huffman Coding. arXiv:1510.00149, 2016.
|
| 191 |
+
|
| 192 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep Residual Learning for Image Recognition. arXiv:1512.03385, 2015.
|
| 193 |
+
|
| 194 |
+
Geoffrey Hinton, Li Deng, Dong Yu, George Dahl, Abdel-rahman Mohamed, Navdeep Jaitly, Andrew Senior, Vincent Vanhoucke, Patrick Nguyen, Tara Sainath, and Brian Kingsbury. Deep Neural Networks for Acoustic Modeling in Speech Recognition: The Shared Views of Four Research Groups. IEEE Signal Processing Magazine, 2012.
|
| 195 |
+
|
| 196 |
+
Andrew G. Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, and Hartwig Adam. MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications. arXiv:1704.04861, 2017.
|
| 197 |
+
|
| 198 |
+
Gao Huang, Zhuang Liu, Laurens van der Maaten, and Kilian Q. Weinberger. Densely Connected Convolutional Networks. arXiv:1608.06993, 2018.
|
| 199 |
+
|
| 200 |
+
Qing Jin, Linjie Yang, and Zhenyu Liao. Towards Efficient Training for Neural Network Quantization. arXiv:1912.10207, 2019.
|
| 201 |
+
|
| 202 |
+
Raghuraman Krishnamoorthi. Quantizing deep convolutional networks for efficient inference: A whitepaper. arXiv:1806.08342, 2018.
|
| 203 |
+
|
| 204 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. ImageNet classification with deep convolutional neural networks. Communications of the ACM, 2017.
|
| 205 |
+
|
| 206 |
+
Lenstra. Lattices. In Algorithmic number theory, volume 44 of MSRI publications. 2008.
|
| 207 |
+
|
| 208 |
+
Yuhang Li, Ruihao Gong, Xu Tan, Yang Yang, Peng Hu, Qi Zhang, Fengwei Yu, Wei Wang, and Shi Gu. BRECQ: Pushing the Limit of Post-Training Quantization by Block Reconstruction. ICLR, 2021.
|
| 209 |
+
|
| 210 |
+
Xingchao Liu, Mao Ye, Dengyong Zhou, and Qiang Liu. Post-training Quantization with Multiple Points: Mixed Precision without Mixed Precision. AAAI, 2021.
|
| 211 |
+
|
| 212 |
+
Jeffrey L. McKinstry, Steven K. Esser, Rathinakumar Appuswamy, Deepika Bablani, John V. Arthur, Izzet B. Yildiz, and Dharmendra S. Modha. Discovering Low-Precision Networks Close to FullPrecision Networks for Efficient Embedded Inference. arXiv:1809.04191, 2019.
|
| 213 |
+
|
| 214 |
+
Daniele Micciancio. On the Hardness of the Shortest Vector Problem. 1998.
|
| 215 |
+
|
| 216 |
+
Markus Nagel, Mart van Baalen, Tijmen Blankevoort, and Max Welling. Data-Free Quantization Through Weight Equalization and Bias Correction. ICCV, 2019.
|
| 217 |
+
|
| 218 |
+
Markus Nagel, Rana Ali Amjad, Mart Van Baalen, Christos Louizos, and Tijmen Blankevoort. Up or down? Adaptive rounding for post-training quantization. PMLR, 2020.
|
| 219 |
+
|
| 220 |
+
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Kopf, Edward Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. PyTorch: An Imperative Style, High-Performance Deep Learning Library. NeurIPS, 2019.
|
| 221 |
+
|
| 222 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. arXiv:1409.0575, 2015.
|
| 223 |
+
|
| 224 |
+
Mark Sandler, Andrew Howard, Menglong Zhu, Andrey Zhmoginov, and Liang-Chieh Chen. MobileNetV2: Inverted Residuals and Linear Bottlenecks. IEEE, 2018.
|
| 225 |
+
|
| 226 |
+
Karen Simonyan and Andrew Zisserman. Very Deep Convolutional Networks for Large-Scale Image Recognition. arXiv:1409.1556, 2015.
|
| 227 |
+
|
| 228 |
+
Pierre Stock, Armand Joulin, Remi Gribonval, Benjamin Graham, and Herve Jegou. And the bit goes down: Revisiting the quantization of neural networks. ICLR, 2020.
|
| 229 |
+
|
| 230 |
+
Peisong Wang, Qiang Chen, Xiangyu He, and Jian Cheng. Towards Accurate Post-training Network Quantization via Bit-Split and Stitching. ICML, 2020.
|
| 231 |
+
|
| 232 |
+
Ritchie Zhao, Yuwei Hu, Jordan Dotzel, Christopher De Sa, and Zhiru Zhang. Improving Neural Network Quantization without Retraining using Outlier Channel Splitting. PMLR, 2019.
|
| 233 |
+
|
| 234 |
+
# APPENDIX A
|
| 235 |
+
|
| 236 |
+
# Lattices
|
| 237 |
+
|
| 238 |
+
The following part is a very synthetic introduction to the (very rich) theory of lattices. It states only what the reader needs to know to understand how our quantization method works. If the reader wants to know more about lattices, they are welcome to start with Lenstra (2008).
|
| 239 |
+
|
| 240 |
+
# Definition 1
|
| 241 |
+
|
| 242 |
+
A lattice $\Lambda$ of $\mathbb { R } ^ { n }$ is a discrete additive subgroup of $\mathbb { R } ^ { n }$ , such that $s p a n ( \Lambda ) \ = \ \mathbb { R } ^ { n }$ , where $s p a n ( \Lambda )$ is the set of linear combinations of the vectors of $\Lambda$ .
|
| 243 |
+
|
| 244 |
+
# Example
|
| 245 |
+
|
| 246 |
+
$\mathbb { Z } ^ { n }$ is a lattice. It is called the cubic lattice.
|
| 247 |
+
|
| 248 |
+
# Property 1
|
| 249 |
+
|
| 250 |
+
Let $\Lambda$ be a lattice of $\mathbb { R } ^ { n }$ , there is a sequence $\boldsymbol { B }$ of cardinality $n$ of lattice vectors such that any vector that belongs to $\Lambda$ can be uniquely expressed as an integer linear combination of the elements of $\boldsymbol { B }$ . Such a sequence is called basis of $\Lambda$ .
|
| 251 |
+
|
| 252 |
+
# Examples
|
| 253 |
+
|
| 254 |
+
$$
|
| 255 |
+
\begin{array} { r l } & { \bullet \ ( ( 1 , 0 ) , ( 0 , 1 ) ) \mathrm { ~ i s ~ a ~ b a s i s ~ o f ~ \mathbb { Z } ^ 2 ~ } } \\ & { \bullet \ ( ( 1 , 0 ) , ( 1 , 1 ) ) \mathrm { ~ i s ~ a ~ b a s i s ~ o f ~ \mathbb { Z } ^ 2 ~ } } \\ & { \bullet \ ( \delta _ { i , i } ) _ { 1 \leq i \leq n } \mathrm { ~ i s ~ a ~ b a s i s ~ o f ~ \mathbb { Z } ^ n ~ } } \end{array}
|
| 256 |
+
$$
|
| 257 |
+
|
| 258 |
+
# Observation
|
| 259 |
+
|
| 260 |
+
The knowledge of a basis of a lattice $\Lambda$ is sufficient to know every point of the lattice. Given that we want to use this type of structure to quantize a weight distribution, this observation allows us to avoid keeping the whole lattice stored as a codebook in memory.
|
| 261 |
+
|
| 262 |
+
# Important observation
|
| 263 |
+
|
| 264 |
+
We shall emphasize that the uniform scalar quantization scheme widely used for neural networks quantization is nothing else but a cubic lattice quantization scheme. Therefore, lattice quantization is nothing else but a generalization of scalar techniques.
|
| 265 |
+
|
| 266 |
+
# APPENDIX B
|
| 267 |
+
|
| 268 |
+
# Heuristic details
|
| 269 |
+
|
| 270 |
+
This paragraph is dedicated to providing the details of our heuristic FindBasis (algorithm 3). Let $\begin{array} { r } { s c = \frac { et { } { . } { \sum } } { 2 ^ { b - 1 } } } \end{array}$ where $b$ is the bitwidth of the channel, or layer, to be quantized. Basis $\boldsymbol { B }$ is ini${ \frac { s c } { 1 0 ^ { 4 } } } \ * \ I _ { n }$ $T$ ists in a sequence of 800 steps at each of these deviation values :. We apply this algorithm with 5 restarts and keep the best basis at $[ \frac { s c } { 1 0 ^ { 4 } } , s c , \frac { s c } { 2 } , \frac { s c } { 3 } , \frac { s c } { 5 } , \frac { s c } { 7 } , \frac { s c } { 9 } , \frac { s c } { 1 5 } , \frac { s c } { 3 0 } ]$
|
| 271 |
+
each restart. Note that it is possible to reduce the number of steps and hence shrink computation time.
|
| 272 |
+
|
| 273 |
+
# APPENDIX C
|
| 274 |
+
|
| 275 |
+
# Quantile tables
|
| 276 |
+
|
| 277 |
+
Table 8: Quantiles chosen for Resnet and Densenet activation quantization.
|
| 278 |
+
|
| 279 |
+
<table><tr><td>Bitwidth</td><td>1</td><td>2</td><td>3</td><td>4</td><td>5</td><td>6</td><td>7</td><td>8</td></tr><tr><td>Quantile</td><td>0.97</td><td>0.992</td><td>0.9991</td><td>0.9997</td><td>0.9998</td><td>0.99995</td><td>0.99999</td><td>1</td></tr></table>
|
| 280 |
+
|
| 281 |
+
Table 9: Quantiles chosen for VGG activation quantization.
|
| 282 |
+
|
| 283 |
+
<table><tr><td>Bitwidth</td><td>3</td><td>4</td><td>8</td></tr><tr><td>Quantile</td><td>0.9999</td><td>0.9999</td><td>1</td></tr></table>
|
| 284 |
+
|
| 285 |
+
Table 10: Quantiles chosen for Mobilenet activation quantization.
|
| 286 |
+
|
| 287 |
+
<table><tr><td>Bitwidth</td><td>3</td><td>4</td><td>8</td></tr><tr><td>Quantile</td><td>0.986</td><td>0.998</td><td>1</td></tr></table>
|
| 288 |
+
|
| 289 |
+
# APPENDIX D
|
| 290 |
+
|
| 291 |
+
# Intuition on vector quantization
|
| 292 |
+
|
| 293 |
+
We know for a fact that correlated distributions share mutual information, in the sense of Shannon information theory. Shannon’s mutual information between continuous random variables $X$ and $Y$ is calculated as a double integral :
|
| 294 |
+
|
| 295 |
+
$$
|
| 296 |
+
I ( X ; Y ) = \int _ { \mathcal { V } } \int _ { \mathcal { X } } p ( X = x , Y = y ) l o g _ { 2 } ( \frac { p ( X = x , Y = y ) } { p ( X = x ) p ( Y = y ) } ) d x d y
|
| 297 |
+
$$
|
| 298 |
+
|
| 299 |
+
If $X$ and $Y$ are independant, $I ( X ; Y ) = 0$ , they share no mutual information. When $X = Y$ , $I ( X ; Y ) = H ( X ) = { \overset { \cdot } { H } } ( Y )$ . Now, we model the pairs of correlated weights of the layer we want to quantize with $( w _ { 1 } , w _ { 2 } )$ which follows a bivariate normal distribution with location $\mu = ( 0 , 0 )$ and covariance matrix :
|
| 300 |
+
|
| 301 |
+
$$
|
| 302 |
+
\Sigma = \left( \begin{array} { c c } { { \sigma _ { 1 } ^ { 2 } } } & { { \rho \sigma _ { 1 } \sigma _ { 2 } } } \\ { { \rho \sigma _ { 1 } \sigma _ { 2 } } } & { { \sigma _ { 2 } ^ { 2 } } } \end{array} \right)
|
| 303 |
+
$$
|
| 304 |
+
|
| 305 |
+
where $\sigma _ { 1 } , \sigma _ { 2 }$ are the standard deviations of $w _ { 1 }$ and $w _ { 2 }$ and $\rho$ their correlation coefficient. This yields:
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
I ( w _ { 1 } ; w _ { 2 } ) = - \frac { 1 } { 2 } l o g _ { 2 } ( 1 - \rho ^ { 2 } )
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
Therefore, the more $w _ { 1 }$ and $w _ { 2 }$ are correlated, the more information they share, which means that an independent coding of $w _ { 1 }$ and $w _ { 2 }$ scalars is suboptimal, because of information redundancy. This is the idea behind our approach and behind vector quantization in general.
|
| 312 |
+
|
| 313 |
+
# APPENDIX E
|
| 314 |
+
|
| 315 |
+
# Optimized inference for LatticeQ networks
|
| 316 |
+
|
| 317 |
+
In this section, we suppose that we have a $3 \times 3$ convolution layer $\Lambda$ quantized using our per-layer method, with in input channels and out output channels. We want to compute a forward pass through this layer. Let $( C _ { i } ^ { i n } ) _ { 1 \leq i \leq i n }$ the set of input channels and $( C _ { j } ^ { o u t } ) _ { 1 \leq j \leq o u t }$ the set of output channels. We want to compute $C _ { j } ^ { o u t }$ for each $j$ . Let $W ^ { q }$ the tensor of quantized weights. Let the quantization basis $\begin{array} { r } { \mathcal { B } = ( \mathbf { b _ { 1 } } , \mathbf { b _ { 2 } } , \mathbf { b _ { 3 } } , \mathbf { b _ { 4 } } , \mathbf { b _ { 5 } } , \mathbf { b _ { 6 } } , \mathbf { b _ { 7 } } , \mathbf { b _ { 8 } } , \mathbf { b _ { 9 } } ) . } \end{array}$ . Note that in this notation, our basis has dimension 9, which is not the choice we made in the paper. This is not a big deal, since we can choose to fill coordinates with zeros: $\mathbf { b _ { 1 } } = \left( b _ { 1 , 1 } , b _ { 1 , 2 } , b _ { 1 , 3 } , 0 , 0 , 0 , 0 , 0 , 0 \right)$ , $\mathbf { b _ { 4 } } = ( 0 , 0 , 0 , b _ { 1 , 1 } , b _ { 1 , 2 } , b _ { 1 , 3 } , 0 , 0 , 0 )$ , $\mathbf { b _ { 7 } } = ( 0 , 0 , 0 , 0 , 0 , 0 , b _ { 1 , 1 } , b _ { 1 , 2 } , b _ { 1 , 3 } )$ . In this manner, our 3D bases can be expanded in 9D bases.
|
| 318 |
+
|
| 319 |
+
Usually, in a full precision network, $C _ { j } ^ { o u t }$ is computed as :
|
| 320 |
+
|
| 321 |
+
$$
|
| 322 |
+
C _ { j } ^ { o u t } = \sum _ { i = 1 } ^ { i n } C o n v ( W _ { i , j } ; C _ { i } ^ { i n } )
|
| 323 |
+
$$
|
| 324 |
+
|
| 325 |
+
In our case, we change the order of operations :
|
| 326 |
+
|
| 327 |
+
$$
|
| 328 |
+
C _ { j } ^ { o u t } = \sum _ { k = 1 } ^ { 9 } \sum _ { i = 1 } ^ { i n } W _ { i , j , k } ^ { q } C o n v ( \mathbf { b _ { k } } ; C _ { i } ^ { i n } )
|
| 329 |
+
$$
|
| 330 |
+
|
| 331 |
+
Since $C o n v ( \mathbf { b _ { k } } ; C _ { i } ^ { i n } )$ does not depend on the output channel, we can start by computing $C o n v ( \mathbf { b _ { 1 } } ; C _ { i } ^ { i n } )$ for each $i$ (in convolutions). $\mathbf { b _ { 1 } }$ is uniformly quantized using a simple $\operatorname* { m i n } / \operatorname* { m a x }$ quantizer, therefore we can use low-bit operators to compute these convolutions. Then, we only need to multiply the result by $W _ { i , j , 1 } ^ { q }$ (which is an integer) for each $j$ , and store the result in the corresponding output channel. Then, we reiterate the process with $\mathbf { b _ { 2 } } , \mathbf { b _ { 3 } }$ , etc.
|
| 332 |
+
|
| 333 |
+
With this method, the complexity of the forward pass through $\Lambda$ is $9 \times i n$ low-bit convolutions and $9 \times i n \times o u t$ scalar multiplications and additions.
|
| 334 |
+
|
| 335 |
+
# APPENDIX F
|
| 336 |
+
|
| 337 |
+
# Weight-only quantization
|
| 338 |
+
|
| 339 |
+
Table 11: LatticeQ per-channel weight-only quantization with bias correction.
|
| 340 |
+
|
| 341 |
+
<table><tr><td colspan="4">Top-1 accuracy</td></tr><tr><td>Network</td><td>FP32</td><td>W4</td><td>W3</td><td>W2</td></tr><tr><td>Resnet-18</td><td>69.6</td><td>69.0</td><td>66.7</td><td>41.7</td></tr><tr><td>Resnet-50</td><td>76.0</td><td>75.5</td><td>73.6</td><td>44.3</td></tr><tr><td>Densenet</td><td>74.4</td><td>73.2</td><td>68.9</td><td>6.4</td></tr><tr><td>Mobilenet-v2</td><td>71.9</td><td>66.7</td><td>48.9</td><td>0.3</td></tr></table>
|
md/dev/aNWiwR2HiOs/aNWiwR2HiOs.md
ADDED
|
@@ -0,0 +1,458 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MEASURING ASYMMETRIC GRADIENT DISCREPANCY IN PARALLEL CONTINUAL LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
In Parallel Continual Learning (PCL), the parallel multiple tasks start and end training unpredictably, thus suffering from training conflict and catastrophic forgetting issues. The two issues are raised because the gradients from parallel tasks differ in directions and magnitudes. Thus, in this paper, we formulate the PCL into a minimum distance optimization problem among gradients and propose an explicit Asymmetric Gradient Distance (AGD) to evaluate the gradient discrepancy in PCL. AGD considers both gradient magnitude ratios and directions, and has a tolerance when updating with a small gradient of inverse direction, which reduces the imbalanced influence of gradients on parallel task training. Moreover, we propose a novel Maximum Discrepancy Optimization (MaxDO) strategy to minimize the maximum discrepancy among multiple gradients. Solving by MaxDO with AGD, parallel training reduces the influence of the training conflict and suppresses the catastrophic forgetting of finished tasks. Extensive experiments validate the effectiveness of our approach on three image recognition datasets.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Continual Learning (CL) (Kirkpatrick et al., 2017; Li & Hoiem, 2017; Lopez-Paz & Ranzato, 2017), aims to continuously learn new knowledge from a sequence of tasks with non-overlapping data streams over a lifelong time. In the era of Internet of Things (IoT), people are using many smart devices, where data and tasks would be accessed by the learning system at any time. It is necessary for a CL system to respond to parallel data streams from multiple devices. We study Parallel Continual Learning (PCL), as shown in Fig. 1, in which an unfixed number of tasks are trained in a parallel way at any time. Specifically, according to the access time of each task, PCL builds an adaptive number of parallel data pipes, thus enabling instant response to new-coming tasks without pending.
|
| 12 |
+
|
| 13 |
+
Due to the parallel data streams from different tasks, PCL suffers from not only the catastrophic forgetting but the training conflict among parallel tasks. Most existing methods in CL are proposed to tackle the catastrophic forgetting (French, 1999; Kirkpatrick et al., 2017) of any finished tasks, including regularization-based (Kirkpatrick et al., 2017; Chaudhry et al., 2018; Dhar et al., 2019; Zenke et al., 2017; Aljundi et al., 2018), rehearsal-based (Lopez-Paz & Ranzato, 2017; Chaudhry et al., 2019; Guo et al., 2019; Atkinson et al., 2018; Shah et al., 2018; Pomponi et al., 2020), and architecture-based (Mallya et al., 2018; Yoon et al., 2017; Rusu et al., 2016; Rosenfeld & Tsotsos, 2018) methods. In PCL, the training processes of different tasks are diverse, i.e., each task starts and ends training unpredictably (See Fig. 1). Thereby the gradient from different task differs in direction and magnitude (Yu et al., 2020) and may be neutralized. The gradient discrepancies lead to catastrophic forgetting and training conflict issues, which may fail the learning of some tasks. At any time in PCL, therefore, we present that the problem can be formulated to find an optimal gradient in a minimum distance multi-objective optimization, where each objective is to minimize the distance to a target gradient. In general, the distance metric is proportional to the effect of the optimal gradient on the corresponding task.
|
| 14 |
+
|
| 15 |
+
In most situations, the mentioned distance metric $D$ between gradients is set to symmetric intuitively, such as the Euclidean distance and cosine distance. In other words, we usually have $D ( \mathbf { x } , \mathbf { y } ) \dot { = }$ $D ( \mathbf { y } , \mathbf { x } )$ for any $\mathbf { x }$ and y. However, the gradient influence is imbalanced among parallel tasks in the gradient descent. For example in Fig. 1, at the marked time, we have three gradients with diverse directions and magnitudes, and updating with any of them provides different influences to the other two. In the minimum distance problem, the optimal solution should have the minimum negative influence on all parallel tasks, but using symmetric metrics means the influences are optimized indistinguishably at the same time. Due to the fact that the gradients are with wide differences, the solution may have large biases, which would get the near-fitting task out of its local minimum but has less impact on a new-coming task.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Overview of the proposed method in PCL. Left: PCL trains parallel tasks according to their access time without pending. Middle: At any time, gradients from different tasks (corresponding colors) have unpredicted direction and magnitude (the length of vectors). Right: We formulate PCL into a min-distance problem and propose an asymmetric distance for effective optimization.
|
| 19 |
+
|
| 20 |
+
To measure the gradient discrepancy, we hold the opinion that the distance metric in the min-distance problem should be asymmetric. First, though the metric is bound up with both the gradient magnitude and direction, the influences on model training from gradients should be asymmetric, where the model should have more tolerance to small gradients even if they indicate an inverse direction. Second, because gradients are with different magnitudes, the discrepancy between two large gradients is often set to larger than that between small gradients when using symmetric distance, such as Euclidean distance. Directly optimizing using magnitude-aware distance values may lead to the solution close to large gradients and thus hinder the catastrophic forgetting of old tasks. To mitigate the bias from the magnitude difference, it is better to employ the magnitude ratio instead of magnitude itself.
|
| 21 |
+
|
| 22 |
+
Motivated by this, in this paper, we propose an explicit measurement for the learning from gradient discrepancy in PCL, named Asymmetric Gradient Distance (AGD), which considers gradient magnitude ratios and directions, and sets a tolerance for smaller gradients. As shown in Fig. 1, the proposed AGD is used in solving the minimum distance problem with multiple gradients from parallel tasks. Then, we propose an effective optimization strategy for minimizing the gradient discrepancy to avoid self-interference. We name the strategy Maximum Discrepancy Optimization (MaxDO), which minimizes the maximum discrepancy from each gradient to the others. Moreover, to address the catastrophic forgetting issue, we follow the rehearsal strategy (Lopez-Paz & Ranzato, 2017) in traditional CL and build an extra memory data stream. The rehearsal data stream is used to provide a gradient of finished tasks in MaxDO. Solving by MaxDO with AGD, parallel training mitigates the impacts of the diverse training process and slows the catastrophic forgetting of finished tasks. Extensive results on three datasets show the superiority and effectiveness of our approach.
|
| 23 |
+
|
| 24 |
+
Our main contributions are three-fold:
|
| 25 |
+
|
| 26 |
+
(1) For the first time, we formulate the PCL into a minimum distance problem and compare symmetric and asymmetric distances. Considering the influence of gradient on task training, we show that symmetric metrics are not effective in solving the problem and suggest asymmetric metrics.
|
| 27 |
+
(2) We propose an asymmetric metric, named AGD, to evaluate the gradient discrepancy, which is proportional to the gradient magnitude ratios and directions. AGD takes the diverse training process into account and measures the imbalance of gradient influence on task training.
|
| 28 |
+
(3) We propose a MaxDO strategy for minimizing gradient discrepancy of different tasks, which maximumly reduces the asymmetric discrepancy from a gradient to the others. MaxDO avoids the self-interference among gradients and reduces the training conflict and catastrophic forgetting.
|
| 29 |
+
|
| 30 |
+
# 2 RELATED WORK
|
| 31 |
+
|
| 32 |
+
Continual Learning (CL) represents receiving data from new domains continually. In traditional CL, the new domains show up one by one, say serial CL. CL methods can be classified into three kinds. (1) Rehearsal (Lopez-Paz & Ranzato, 2017; Chaudhry et al., 2019; Guo et al., 2019; Atkinson et al., 2018; Shah et al., 2018; Pomponi et al., 2020), which saves or generates data of old tasks for retraining together with the current training. (2) Regularization (Kirkpatrick et al., 2017; Chaudhry et al., 2018; Dhar et al., 2019; Zenke et al., 2017; Aljundi et al., 2018; Farajtabar et al., 2020), which leverages extra regularization terms to consolidate previous knowledge when learning new tasks. (3) Dynamic architecture (Mallya et al., 2018; Yoon et al., 2017; Rusu et al., 2016; Rosenfeld & Tsotsos, 2018), which freezes task-specific parameters and grows new branches for new tasks automatically. However, most of the existing CL methods are designed for reducing catastrophic forgetting in the serial scenario. Contrastively, in PCL, we need to tackle not only catastrophic forgetting but training conflict among parallel tasks, which is somehow related to multi-task learning.
|
| 33 |
+
|
| 34 |
+
Multi-Task Learning (MTL) (Caruana, 1997) is used to address multiple tasks with a single model from one to many domains. Traditional MTL solutions can be mainly grouped into feature-based and parameter-based approaches (Zhang & Yang, 2021). The feature-based approaches focus on learning common feature representations for multiple tasks (Maurer et al., 2013; Wang & Ye, 2015). The parameter-based approaches use model parameters in a task to help learn model parameters in other tasks, such as task clustering (Thrun & O’Sullivan, 1996; Barzilai & Crammer, 2015) and decomposition (Jalali et al., 2010). In recent years, some MTL methods formulate the problem into finding an optimal gradient for updating and can be categorized into three types. (1) Learning-based methods (Chen et al., 2018), which learn a set of weights by backpropagation. (2) Solving-based methods (Sener & Koltun, 2018; Liu et al., 2021), solve the problem by finding an optimal gradient that is not dominated by the gradient from any task. (3) Calculating-based methods (Liu et al., 2019; Javaloy & Valera, 2021; Chen et al., 2020; Wang et al., 2020; Yu et al., 2020; Groenendijk et al., 2021; Lin et al., 2021) compute the gradient weights by combining gradients or losses of all tasks. Inspired by MTL, we also formulate the problem into finding an optimal gradient. Specifically, we consider the optimal gradient should have a small distance to all gradients.
|
| 35 |
+
|
| 36 |
+
Asymmetric Metric. In most situations, the distance is set to symmetric, e.g., the Euclidean distance. However, the symmetric metric is not always suitable for finding the optimal gradient (see the next section for details). Asymmetric metric (Collins & Zimmer, 2007; Mennucci, 2013), also known as quasi-metric (Collins & Zimmer, 2007) or pseudo metric (Fiol, 2001; Cagliari et al., 2015) is a generalization of a metric but the symmetry axiom is eliminated in the definition of metric spaces. A classical example of using asymmetric metric is the taxicab geometry topology including one-way streets, where a path from point A to B has different streets compared to a path from B to A. In this paper, we propose to measure the gradient discrepancy using an asymmetric metric and raise a novel optimization strategy to minimize the maximum discrepancy.
|
| 37 |
+
|
| 38 |
+
# 3 OUR APPROACH
|
| 39 |
+
|
| 40 |
+
# 3.1 PARALLEL CONTINUAL LEARNING
|
| 41 |
+
|
| 42 |
+
On a timeline, given a sequence of $T$ tasks with parallel data streams $\{ \mathcal { D } _ { 1 } , \cdot \cdot \cdot , \mathcal { D } _ { T } \}$ for continual training, and each data stream can be accessed and suspended at any time. For simplest, we assume each data stream is i.i.d., and tasks are accessed in order from 1 to $T$ and there exists no real gap that no data stream flows on the timeline. Note that traditional CL is an edge situation of PCL that all tasks are nose-to-tail. A PCL model contains a shared backbone with parameter $\pmb \theta$ to learn task-agnostic knowledge and adaptively incremental number of task-specific classifiers with parameters $\theta _ { i }$ . When a new task is accessed, a corresponding task-specific classifier will be constructed.
|
| 43 |
+
|
| 44 |
+
In PCL, a task will be forgotten by learning any other tasks when its data stream ends. To avoid forgetting, we leverage the popular rehearsal strategy (Lopez-Paz & Ranzato, 2017; Chaudhry et al., 2019; Guo et al., 2019; Atkinson et al., 2018; Shah et al., 2018; Pomponi et al., 2020) in our training. Rehearsal builds an extra data stream sampled from all seen tasks and retrains them to suppress the forgetting of finished tasks. For convenience, we denote the rehearsal data stream as $\mathcal { D } _ { 0 }$ . At time $t$ , we use $\mathcal { T } _ { t }$ to represent the activated data streams (including $\mathcal { D } _ { 0 }$ ). Together with the rehearsal data stream, PCL training yields the following dynamic multi-objective empirical risk minimization:
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
\begin{array} { r } { \operatorname* { m i n } _ { \pmb { \theta } , \{ \pmb { \theta } _ { i } | i \in \mathcal { T } _ { t } \} } \qquad \{ \ell _ { i } \left( \mathcal { D } _ { i } \right) | i \in \mathcal { T } _ { t } \} . } \end{array}
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
Because the task-specific classifiers are updated by their own gradients $\pmb { \theta } _ { i } \pmb { \theta } _ { i } - \alpha _ { i } \nabla _ { \pmb { \theta } _ { i } } \ell _ { i }$ $\forall i \in \mathcal { T } _ { t } ,$ ) with step size $\alpha _ { i }$ , we focus on the update of the shared backbone $\pmb { \theta }$ . At any PCL step, the goal of dynamic MOO is to optimize multiple objectives simultaneously while updating only once, and the only update of the shared parameters depends on the gradients of all in-training tasks. In PCL, the update of the shared parameters at any time depends on the gradients of all in-training tasks. It will exit an uncertain number of tasks, and each task will provide a task-specific gradient on the shared parameter $\pmb \theta$ . Let $\mathbf { g } _ { i } = \nabla _ { \pmb { \theta } } \ell _ { i }$ and $\alpha$ be a step size for optimization. The problem of the backbone update can be formulated as follows:
|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
angle (i.e., Figure 2: The measures of two gradient discrepancy from $\angle \mathbf { x } , \mathbf { y } )$ between $\mathbf { x }$ and $\mathbf { y }$ , and the magnitude ratio $\mathbf { x }$ to y. Note that the $\frac { \| \mathbf { x } \| } { \| \mathbf { y } \| }$ , respectively. (a) Cosine distance; $x$ - and -axes are the (b) Euclidean distance where $\| \mathbf { y } \| = 0 . 2$ as an example; (c) Asymmetric gradient distance.
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\mathbf { \theta } \theta \gets \theta - \alpha \mathbf { d } ^ { * } , \quad \mathrm { w h e r e } \ \mathbf { d } ^ { * } = f \big ( \{ \mathbf { g } _ { i } | \forall i \in \mathcal { T } _ { t } \} \big ) .
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
The key question is how to compute the optimal gradient $\mathbf { d } ^ { * }$ via the function $f ( \cdot )$ . In this paper, we define the function $f ( \cdot )$ as a min-distance multi-objective problem by minimizing the gradient distance from all in-training tasks:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\begin{array} { r } { \mathbf { d } ^ { * } = \arg \operatorname* { m i n } _ { \mathbf { d } } \quad \{ D ( \mathbf { d } , \mathbf { g } _ { i } ) \ : | \ : \forall i \in \mathcal { T } \} , } \end{array}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
where we need to identify what distance metric $D$ is used to measure gradient discrepancy. The motivation of Eq. (3) is that for the task $i$ in PCL, its own gradient $\mathrm { g } _ { i }$ is the most qualified update direction for itself. The solution $\mathrm { d } ^ { * }$ should be as close to every gradients as possible.
|
| 66 |
+
|
| 67 |
+
# 3.2 MEASURING ASYMMETRIC GRADIENT DISCREPANCY
|
| 68 |
+
|
| 69 |
+
To measure the gradient discrepancy, the Euclidean Distance (EuDist, $D ( \mathbf { x } , \mathbf { y } ) = \| \mathbf { x } - \mathbf { y } \| \in [ 0 , \infty ) \}$ ) and Cosine Distance (CosDist, D(x, y) = 1 − x>ykxkkyk are the two most popular choices. Both of them are symmetric, i.e., $D ( \mathbf { x } , \mathbf { y } ) = D ( \mathbf { y } , \mathbf { x } )$ . A symmetric metric $D ( \mathbf { x } , \mathbf { y } )$ means the forward influence $\mathbf { \bar { x } }$ to y) and backward influence $\left( \mathbf { y } \ \mathrm { t o } \ \mathbf { x } \right)$ are treated as symmetric. For example, given two in-training tasks A and B, the distance $D ( \mathbf { g } _ { \mathbf { A } } , \mathbf { g } _ { \mathbf { B } } )$ represents both the effect of $\mathbf { g } _ { \mathrm { A } }$ on task $\mathbf { B }$ and $\mathbf { g } _ { \mathrm { B } }$ on task A because of $D ( \mathbf { g } _ { \mathrm { A } } , \mathbf { g } _ { \mathrm { B } } ) = D ( \mathbf { g } _ { \mathrm { B } } , \mathbf { g } _ { \mathrm { A } } )$ . Note that large distance from $\mathbf { g } _ { \mathrm { A } }$ to gB means large negative influence on the training of task B with $\mathbf { g } _ { \mathrm { A } }$ .
|
| 70 |
+
|
| 71 |
+
However, the model update is highly related to gradient magnitude and direction, which are asymmetric to model updating. The influence of the gradient $\mathbf { g } _ { \mathrm { A } }$ on task B may be quite different from that of the gradient $\mathbf { g } _ { \mathrm { B } }$ on task A. In previous studies (Lopez-Paz & Ranzato, 2017; Chaudhry et al., 2019; Yu et al., 2020), the two tasks are treated as conflict when $\langle \mathbf { g } _ { \mathrm { A } } , \mathbf { g } _ { \mathrm { B } } \rangle < 0$ . In PCL, due to the diverse training process, gradients from parallel tasks are diverse in magnitude and direction. When $\| \mathbf { g } _ { \mathrm { A } } \| \ll \| \mathbf { g } _ { \mathrm { B } } \|$ , the gradient $\mathbf { g } _ { \mathrm { A } }$ will have little negative influence on task B even if $\langle \mathbf { g } _ { \mathrm { A } } , \mathbf { g } _ { \mathrm { B } } \rangle < 0$ ; when $\| \mathbf { g } _ { \mathrm { A } } \| \gg \| \mathbf { g } _ { \mathrm { B } } \|$ (e.g., a new task A is accessed when task B has been trained for some time near convergence), the update produces huge impact on task B even if $\langle \mathbf { g } _ { \mathrm { A } } , \mathbf { g } _ { \mathrm { B } } \rangle > 0$ . Using the traditional symmetric distance can hardly represent the asymmetric update influence difference.
|
| 72 |
+
|
| 73 |
+
To effectively measure gradient discrepancy in PCL, we introduce the asymmetric metric.
|
| 74 |
+
|
| 75 |
+
Lemma 1 (Asymmetric Metric (Collins & Zimmer, 2007)) $D : \mathcal { X } \times \mathcal { X } \mathbb { R }$ is an asymmetric metric (also known as quasi-metric (Wilson, 1931)) if $D$ satisfies
|
| 76 |
+
|
| 77 |
+
The asymmetric metric does not require the symmetric property, i.e., $D ( \mathbf { x } , \mathbf { y } ) = D ( \mathbf { y } , \mathbf { x } ) .$ . Based on the definition, in this paper, we design an asymmetric metric to measure gradient discrepancy named Asymmetric Gradient Distance.
|
| 78 |
+
|
| 79 |
+
Definition 1 (Asymmetric Gradient Distance (AGD)) Given two gradient $\mathbf { g } _ { A }$ and $\mathbf { g } _ { B }$ , the asymmetric gradient distance is defined as
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\widehat { D } ( \mathbf { g } _ { A } , \mathbf { g } _ { B } ) = \left\{ \begin{array} { c c } { 0 } & { , } & { i f \mathbf { g } _ { A } = \mathbf { g } _ { B } = \mathbf { 0 } , } \\ { \displaystyle \frac { \left. \mathbf { g } _ { A } - \mathbf { g } _ { B } \right. } { \left. \mathbf { g } _ { B } \right. + \left. \mathbf { g } _ { A } - \mathbf { g } _ { B } \right. } , } & { O t h e r w i s e . } \end{array} \right.
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
In Definition 1, we consider the edge situation when $\mathbf { g } _ { \mathrm { A } } = \mathbf { g } _ { \mathrm { B } } = \mathbf { 0 }$ to meet the definition of the asymmetric metric in Lemma 1. In AGD, gradient directions and magnitudes are considered. Instead of using gradient magnitude value difference, we use magnitude ratio difference to avoid the diverse training of different tasks in PCL. Therefore, we derive the corollary of the magnitude ratio:
|
| 86 |
+
|
| 87 |
+
Corollary 1 $\widehat { D } ( \mathbf { g } _ { A } , \mathbf { g } _ { B } ) \in [ 0 , 1 ]$ is an asymmetric metric and holds
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\begin{array} { r } { \operatorname* { l i m } _ { \frac { \| \mathbf { g } _ { A } \| } { \| \mathbf { g } _ { B } \| } \to \infty } \widehat { D } ( \mathbf { g } _ { A } , \mathbf { g } _ { B } ) = 1 , \quad \operatorname* { l i m } _ { \frac { \| \mathbf { g } _ { A } \| } { \| \mathbf { g } _ { B } \| } \to 0 } \widehat { D } ( \mathbf { g } _ { A } , \mathbf { g } _ { B } ) = \frac { 1 } { 2 } . } \end{array}
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
We illustrate why AGD is qualified to evaluate the gradient discrepancy according to the definition and corollary. In Definition 1, we use AGD to represent the influence of $\mathbf { g } _ { \mathrm { A } }$ on task $\mathbf { B }$ rather than the inverse. This is the key difference from the symmetric metrics such as Euclidean distance. Specifically, $\mathbf { g } _ { \mathrm { A } }$ may make task B worse if $\widehat { D } ( \mathbf { g } _ { \mathrm { A } } , \mathbf { g } _ { \mathrm { B } } )$ is large (close to 1). If $\widehat { D } ( \mathbf { g } _ { \mathrm { A } } , \mathbf { g } _ { \mathrm { B } } )$ is close to 0, $\mathbf { g } _ { \mathrm { A } }$ and gB has less conflict. Moreover, Corollary 1 involves that when $\| \mathbf { g } _ { \mathrm { A } } \| \ll \| \mathbf { g } _ { \mathrm { B } } \|$ , AGD has a tolerance $\begin{array} { l } { { \frac { 1 } { 2 } } } \end{array}$ even if $\langle \mathbf { g } _ { \mathrm { A } } , \mathbf { g } _ { \mathrm { B } } \rangle < 0$ , which means the impact of $\mathbf { g } _ { \mathrm { A } }$ on task $\mathbf { B }$ is mild. This is because updating with a zero gradient will neither improve nor damage the performance. Even though, we prefer positive influence rather than non-influence. Thus, we define that the distance $\widehat { D } ( \mathbf { g } _ { \mathrm { A } } , \mathbf { g } _ { \mathrm { B } } )$ in this situation is the mid-level in the value range. See different tolerances in Appendix C.
|
| 94 |
+
|
| 95 |
+
Moreover, we compare AGD (Fig. 2(c)) with Euclidean and cosine distance in Fig. 2. First, the cosine distance (Fig. 2(a)) is magnitude irrelevant, which ignores the magnitude difference in PCL. Second, the Euclidean distance (Fig. 2(b)) depends heavily on the magnitude value difference, but ignores that the gradient influence on the model update is asymmetric. For example, when $\| \mathbf { x } \| 0$ , EuDist will get large if we have large $\| \mathbf { y } \|$ . However, updating with a zero gradient will neither improve nor damage the performance. See the contours of Fig. 2 in Appendix D.
|
| 96 |
+
|
| 97 |
+
# 3.3 MAXIMUM DISCREPANCY OPTIMIZATION
|
| 98 |
+
|
| 99 |
+
At time $t$ , let the optimal solution to Problem (3) be $\mathbf { d } ^ { * }$ , where $\mathcal { T } _ { t }$ is the index set of in-training tasks ( $^ { \prime }$ for simplicity). However, directly optimizing the problem is difficult due to the large decision space that has the same dimension as $\pmb { \theta }$ . Following (Lin et al., 2021; Sener & Koltun, 2018), we use linear scalarization to solve the transformed problem that allows only optimizing decision variable w $\in \mathbb { R } ^ { | \mathcal { T } | }$ . That is, let $\begin{array} { r } { \mathbf { d } = \sum _ { i \in \mathcal { T } } \mathbf { w } _ { i } \mathbf { g } _ { i } } \end{array}$ , where $\forall \mathbf { w } _ { i } \geq 0$ and $\textstyle \sum _ { i \in T } \mathbf { w } _ { i } = 1$ , we have
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\begin{array} { r l } { \mathbf { w } ^ { * } = \arg \operatorname* { m i n } _ { \mathbf { w } } } & { { } \left\{ \widehat { D } \left( \sum _ { j } \mathbf { w } _ { j } \mathbf { g } _ { j } , \mathbf { g } _ { i } \right) \Big | \forall i \in \mathcal { T } \right\} . } \end{array}
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
Each objective of the dual problem will be highly affected by the minimum discrepancy, i.e., each gradient itself. For example, by minimizing objective $\widehat { D } ( \sum _ { j } \mathbf { w } _ { j } \mathbf { g } _ { j } , \mathbf { g } _ { i } )$ , weight $\mathbf { w } _ { i }$ is more like to be activated than others. Thus, multiple objectives will be compromised by multiple self-interference but fail to reduce the maximum discrepancy in the dual problem optimization.
|
| 106 |
+
|
| 107 |
+
As shown in Fig. 3., we propose Maximum Discrepancy Optimization (MaxDO) to reduce the maximum gradient discrepancy. Specifically, instead of the weight vector $\mathbf { w } \in \mathbb { R } ^ { | \mathcal { T } | }$ we optimize a weight matrix $\mathbf { W } \in \mathbb { R } ^ { | T | \times | T | }$ , in which $\forall \mathbf { W } _ { i j } \ \geq \ 0$ . W can be combined by a diagonal vector $\dot { \mathbf { w } } = [ \mathbf { W } _ { 1 , 1 } , \cdots , \mathbf { W } _ { | T | , | T | } ]$ and an off-diagonal matrix $\widetilde { \mathbf { W } } = \mathbf { W } - \mathrm { D i a g } ( \dot { \mathbf { w } } )$ , where $\textstyle \sum _ { i \in { \mathcal { T } } } { \dot { \mathbf { w } } } _ { i } = 1$ and Pj∈T $\begin{array} { r } { \sum _ { j \in \mathcal { T } } \widetilde { \mathbf { W } } _ { i j } = 1 , \forall i } \end{array}$ . Thus, $\begin{array} { r } { \sum _ { i , j \in \mathcal { T } } \mathbf { W } _ { i j } = | \mathcal { T } | + 1 } \end{array}$ and the two weights are independent and can be optimized without disturbance: (1) $\widetilde { \mathbf { W } }$ , computed by Stochastic Gradient Descent (SGD), is used to make up the maximum gradient discrepancy for each row. The objectives of any two rows in $\widetilde { \mathbf { W } }$ are different and independent. For row $i$ , to formulate the maximum discrepancy of gradient $\mathrm { g } _ { i }$ , the objective is the combination of non-diagonal entries. The weighted other gradients should be with the smallest asymmetric distance to $\mathbf { g } _ { i }$ . (2) w\` is obtained by the Multiple Gradient Descent Algorithm (MGDA) (Desid ´ eri, 2012) ´ , which is to obtain a weighted gradient that does not damage any tasks with a min-norm optimization. The objective of MGDA is 0 and the resulting point satisfies the Karush–Kuhn–Tucker condition or the solution gives a Pareto descent direction that improves all tasks. See Appendix E for more details of MGDA. For each off-diagonal entry of the $i$ -th column, their sum means the effect of the gradient $\mathbf { g } _ { i }$ reducing the maximum discrepancy from other gradients. MGDA is used to reduce the possible negative effect in MaxDO. On the other hand, MaxDO reduces the training failure of new tasks in MGDA. To sum up, our MaxDO with AGD can be computed by
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
Figure 3: Schematic of Maximum Discrepancy Optimization. Given multiple gradients $\{ \mathbf { g } _ { i } | \forall i \in \mathcal { T } \}$ $( | \bar { \mathcal { T } } | = 4$ for example) (1) A weight matrix W is initialized with $\frac { 1 } { | T | }$ for each entry. (2) For each row, the off-diagonal entries are used to weighted gradients and optimized for minimum AGD to the target gradient. (3) The diagonal entries $( \sqcup )$ are used to optimize with min-norm with MGDA. (4) The final weight matrix is reduced by each column for the final weights $( w ^ { \prime } )$ ). See Sec. 3.3 for details.
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\mathbf { W } ^ { * } = \underset { \mathbf { \widetilde { W } } } { \arg \operatorname* { m i n } } \underset { \mathbf { S } \mathbf { G } } { \underbrace { \{ \sum _ { j \neq i } \widetilde { \mathbf { W } } _ { i , j } \mathbf { g } _ { j } , \mathbf { g } _ { i } ) | \forall i \in \mathcal { T } \} } } + \mathrm { D i a g } \underset { \mathbf { M } \mathbf { G } \mathbf { D } \mathbf { A } ( \mathbf { D } \mathbf { \check { \epsilon } } \mathrm { s i d e t } , 2 0 1 2 ) } { \underbrace { ( \mathrm { a r g } \operatorname* { m i n } \{ | \sum _ { j \neq i } \tilde { \mathbf { W } } _ { i , j } \mathbf { g } _ { j } , \mathbf { g } _ { i } ) | } ) } .
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
In Eq. (7), we can obtain an approximate solution by combining the closed-form solution and the iterative solution. Fig. 3 reveals the diagram of solving MaxDO. We project the solution of SGD onto the feasible set $\begin{array} { r } { ( \sum _ { i \neq j } \mathbf { W } _ { i j } = 1 ) } \end{array}$ via softmax at each step in the multiple steps for fast convergence.. First, we initialize all entries of $\mathbf { W }$ by $\frac { 1 } { | T | }$ . Then, the off-diagonal matrix is used to minimize the maximum gradient discrepancy via SGD and the diagonal vector is optimized by min-norm. Finally, the final weights are reduced to a vector by dividing $| \tau | + 1$ to guarantee that their sum is 1. Note that, MaxDO is implemented only when $| \mathcal { T } | > 1 .$ , i.e., multiple tasks are given at the current time. Otherwise, we have $\mathbf { d } ^ { * } = \mathbf { g } _ { 1 }$ for the only current task 1. Thus, the final gradient $\mathbf { d } ^ { * }$ is computed by
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\mathbf { d } ^ { * } = \left\{ \begin{array} { l l } { \mathbf { g } _ { 1 } , } & { | \mathcal { T } | = 1 , } \\ { \sum _ { i } \left( \displaystyle \frac { 1 } { | \mathcal { T } | + 1 } \sum _ { j } \mathbf { W } _ { j , i } ^ { * } \right) \mathbf { g } _ { i } , } & { | \mathcal { T } | > 1 . } \end{array} \right.
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
The detailed algorithm is shown in Algorithm 1. With the rehearsal data stream, our algorithm learns a PCL model through a timeline. At the time $t$ on the timeline, given a mini-batch $\boldsymbol { B }$ from each data stream, we compute the corresponding gradients on shared and task-specific parameters. The task-specific parameters are updated directly and the gradients on the shared backbone are collected for computed the final updated gradient d. By using our MaxDO, we update $\pmb { \theta }$ with the optimal $\mathbf { d } ^ { * }$ and update the shared parameters.
|
| 123 |
+
|
| 124 |
+
Algorithm 1: MaxDO () in PCL Input: Random-initialized $\overline { { \pmb { \theta } , \pmb { \theta } _ { 1 : T } } }$ ; Step sizes α, $\alpha _ { 1 : T }$ Output: θ, $\pmb { \theta } _ { 1 : T }$ 1 for $t$ in timeline do 2 $\mathcal { T } _ { t } \gets$ in-training task index; 3 for $i \in \mathcal { T } _ { t }$ do 4 $B _ { i } \sim { \mathcal { D } } _ { i }$ ; 5 $\pmb { \theta } _ { i } \pmb { \theta } _ { i } - \alpha _ { i } \nabla _ { \pmb { \theta } _ { i } } \ell _ { i } ( B _ { i } ) ;$ 6 gi = ∇θ\`i (Bi); 7 end W∗ ← Optimization by Eq. (7); $\mathbf { d } ^ { * } \gets$ Final graident from Eq. (8); 8 9 $\pmb { \theta } \gets \pmb { \theta } - \alpha \mathbf { d } ^ { * }$ ; 10 end
|
| 125 |
+
|
| 126 |
+
# 4 EXPERIMENT
|
| 127 |
+
|
| 128 |
+
# 4.1 DATASET
|
| 129 |
+
|
| 130 |
+
In our experiments, 3 traditional image recognition datasets are transformed into parallel data streams: (1) Parallel Split EMNIST (PS-EMNIST). We split EMNIST (Cohen et al., 2017) (62 classes) into
|
| 131 |
+
|
| 132 |
+
Table 1: Comparisons (avg ± std) with different buffer sizes on PS-EMNIST (62 classes).
|
| 133 |
+
|
| 134 |
+
<table><tr><td rowspan="2">Method (+ Rehearsal)</td><td colspan="2">Buffer size 124(62*2)</td><td colspan="2">Buffer size 186 (62*3)</td><td colspan="2">Buffer size 310 (62*5)</td></tr><tr><td>Ar (%)</td><td>FT(%)</td><td>Ar (%)</td><td>FT(%)</td><td>Ar (%)</td><td>FT(%)</td></tr><tr><td>MGDA(NeurIPS'18)</td><td>78.975 ± 0.165</td><td>-5.386 ± 1.252</td><td>82.026 ± 0.851</td><td>-7.215 ± 1.637</td><td>84.783±0.190</td><td>-5.780 ± 0.476</td></tr><tr><td>GradNorm(ICML'18)</td><td>83.985 ± 0.324</td><td>-9.989 ± 0.578</td><td>85.127 ± 0.647</td><td>-8.835 ± 1.215</td><td>86.060±0.094</td><td>-7.896 ±0.208</td></tr><tr><td>DWA(CVPR'18)</td><td>85.416 ± 0.622</td><td>-8.209 ± 1.279</td><td>85.939 ±0.632</td><td>-7.787 ± 1.255</td><td>86.732 ±0.089</td><td>-6.922 ± 0.175</td></tr><tr><td>GradDrop(NeurIPS'20)</td><td>87.285 ± 0.527</td><td>-6.983 ± 1.022</td><td>87.699 ±0.870</td><td>-6.580 ± 1.709</td><td>88.460±0.221</td><td>-5.820± 0.469</td></tr><tr><td>PCGrad(NeurIPS'20)</td><td>86.880 ±0.400</td><td>-7.437±0.800</td><td>87.848 ± 0.317</td><td>-6.464±0.632</td><td>88.524 ± 0.135</td><td>-5.773 ± 0.273</td></tr><tr><td>CVweight(Arxiv'20)</td><td>85.662 ± 0.396</td><td>-8.581 ±0.809</td><td>86.285 ± 0.740</td><td>-7.971 ± 1.475</td><td>87.174±0.099</td><td>-7.092 ± 0.261</td></tr><tr><td>RLW(Arxiv'21)</td><td>85.936 ± 0.695</td><td>-8.368 ± 1.380</td><td>87.019 ± 0.440</td><td>-7.284 ± 0.854</td><td>87.397 ± 0.264</td><td>-6.896 ± 0.569</td></tr><tr><td>MaxDO (AGD)</td><td>87.901±0.244</td><td>-6.468±0.270</td><td>88.566±0.585</td><td>-5.776± 0.640</td><td>88.744± 0.361</td><td>-5.573 ±0.382</td></tr></table>
|
| 135 |
+
|
| 136 |
+
Table 2: Comparisons $( \mathrm { a v g } \pm \mathrm { s t d } )$ with different buffer sizes on PS-CIFAR-100 (100 classes).
|
| 137 |
+
|
| 138 |
+
<table><tr><td rowspan="2">Method (+ Rehearsal)</td><td colspan="2">Buffer size 1000</td><td colspan="2">Buffer size 2000</td><td colspan="2">Buffer size 3000</td></tr><tr><td>Ar (%)</td><td>Fr(%)</td><td>Ar (%)</td><td>Fr(%)</td><td>Ar(%)</td><td>Fr(%)</td></tr><tr><td>MGDA(NeurIPS'18)</td><td>63.578 ± 0.315</td><td>22.866 ±0.639</td><td>67.613 ±0.166</td><td>25.001 ± 0.768</td><td>67.704 ±0.238</td><td>24.725 ± 1.075</td></tr><tr><td>GradNorm(ICML'18)</td><td>62.498 ± 0.699</td><td>22.506 ± 1.427</td><td>63.932 ± 0.679</td><td>23.845 ± 1.185</td><td>64.538 ±0.627</td><td>24.359 ± 1.450</td></tr><tr><td>DWA(CVPR'18)</td><td>64.952 ± 0.374</td><td>23.152 ± 0.487</td><td>66.310 ±0.445</td><td>24.697 ± 0.880</td><td>66.947 ± 0.156</td><td>25.384 ± 0.447</td></tr><tr><td>GradDrop(NeurIPS'20)</td><td>66.371 ± 0.260</td><td>23.054 ± 0.633</td><td>68.483 ±0.499</td><td>24.962 ± 1.007</td><td>69.353 ±0.707</td><td>26.269 ± 1.401</td></tr><tr><td>PCGrad(NeurIPS'20)</td><td>66.724 ±0.263</td><td>23.601 ± 0.618</td><td>68.652 ± 0.619</td><td>25.183 ±1.081</td><td>68.885 ± 0.134</td><td>25.704 ± 0.849</td></tr><tr><td>CVweight(Arxiv'20)</td><td>47.521 ± 2.333</td><td>11.868 ± 4.257</td><td>48.155 ± 1.682</td><td>13.202 ± 3.005</td><td>48.424±1.960</td><td>13.138 ± 3.573</td></tr><tr><td>RLW(Arxiv'21)</td><td>65.974± 0.508</td><td>23.080 ± 1.411</td><td>68.066 ±0.276</td><td>24.915 ± 0.697</td><td>68.162 ± 0.812</td><td>24.765 ± 1.078</td></tr><tr><td>MaxDO (AGD)</td><td>67.415 ± 0.803</td><td>22.359 ± 1.028</td><td>69.372± 0.170</td><td>24.523 ± 0.360</td><td>70.078± 0.134</td><td>24.907 ±0.720</td></tr></table>
|
| 139 |
+
|
| 140 |
+
5 tasks and the size of the label set for each task, i.e., the number of classes, is larger than 2 while smaller than 15. (2) Parallel Split CIFAR-100 (PS-CIFAR-100). We split CIFAR-100 into 20 tasks and the size of the label set for each task is larger than 2 while smaller than 15. (3) Parallel Split ImageNet-TINY (PS-ImageNet-TINY). We split Tiny ImageNet (Le & Yang, 2015) (200 classes), which has a training set of 100,000 images and a test set of 10,000 images, into 20 tasks, and the size of the label set for each task is larger than 5 while smaller than 20. See more details in Appendix A.
|
| 141 |
+
|
| 142 |
+
All three datasets have 3 different label sets (3 different class splits), each of which has 3 different timelines (when to access). For each timeline, we have 3 different runs with fixed seeds 1234, 1235, and 1236 for parameter initialization. In other words, we have 27 different settings for each dataset, and we report the average and standard deviation (avg $\pm$ std) for each compared method in our experiments. Note that, we omit all blank time that no data stream flows for simplicity.
|
| 143 |
+
|
| 144 |
+
# 4.2 EXPERIMENT DETAILS
|
| 145 |
+
|
| 146 |
+
We implement our experiments using Tensorflow and conduct on a single NVidia RTX 3090Ti GPU card. We take a 2-layer MLP as the backbone network for PS-EMNIST and a Resnet-18 (He et al., 2016) for PS-CIFAR-100 and PS-ImageNet-Tiny. The learning rate is set to 0.003, 0.0004 and 0.0005 for PS-EMNIST, PS-CIFAR-100 and PS-ImageNet-Tiny. The SGD in MaxDO has a learning rate of 5. Each task is trained in a data stream, i.e., each data point passes only once. For each task, we set the batch size to 128 per step. For any new task in PCL, we build a new classifier, which is a fully-connected layer with a softmax function.
|
| 147 |
+
|
| 148 |
+
To evaluate PCL, we compute the average accuracy and forgetting following previous continual learning studies (Lopez-Paz & Ranzato, 2017; Chaudhry et al., 2019; Aljundi et al., 2019b;a; Risheng et al., 2021). Let $e _ { t }$ be the end time of task $t$ and final time $\bar { e } = \operatorname* { m a x } ( e _ { 1 } , e _ { 2 } , \cdots , e _ { T } )$ , the two metrics are computed as follows:
|
| 149 |
+
|
| 150 |
+
$$
|
| 151 |
+
A _ { T } = \frac { 1 } { T } et { } { ' } { \sum } _ { t = 1 } ^ { T } a _ { \bar { e } } ^ { t } , \quad F _ { T } = \frac { 1 } { T } et { } { ' } { \sum } _ { t = 1 } ^ { T } a _ { \bar { e } } ^ { t } - a _ { e _ { t } } ^ { t } ,
|
| 152 |
+
$$
|
| 153 |
+
|
| 154 |
+
where $a _ { k } ^ { j }$ is the mean testing accuracy of task $j$ at time $k$ . The $A _ { T }$ denotes the final average accuracy on all the tasks, and the $F _ { T }$ (also known as backward transfer) means the final performance drop compared to each task that was first trained.
|
| 155 |
+
|
| 156 |
+
# 4.3 MAIN RESULTS
|
| 157 |
+
|
| 158 |
+
We compare our method with MTL methods including MGDA (Desid ´ eri, 2012), GradNorm (Chen ´ et al., 2018), DWA (Liu et al., 2019), GradDrop (Chen et al., 2020), PCGrad (Yu et al., 2020), CVWeight (Groenendijk et al., 2021) and RLW (Lin et al., 2021) in the PCL setting. We treat any time on the timeline as an MTL subunit to train PCL. All results of previous MTL methods are produced by ourselves with the claimed design in their papers. We show the main comparisons with the proposed methods in Tables 1, 2 and 3 on the three datasets. We have several major observations. First, the rehearsal strategy is useful for reducing catastrophic forgetting in PCL for all compared methods. On one hand, as an extra data stream aparts from in-training data streams, rehearsal provides data from the finished tasks training together with other tasks to suppress forgetting. On the other hand, the memory buffer size of rehearsal affects the remembering of old knowledge, and larger size means better knowledge keeping, which is similar to traditional CL. For example in PS-CIFAR-100, we have $6 7 . 4 1 5 \%$ , $6 9 . 3 \hat { 7 } 2 \%$ and $\bar { 7 } 0 . 0 7 8 \%$ for buffer size 1,000, 2,000, and 3,000, respectively. Second, due to each task in PCL taking the data stream as input, only one pass of each data point is insufficient to make the model converge. With the rehearsal strategy, the memory may provide continual learning of finished tasks, and even better performance can be obtained, which results in positive forgetting value $F _ { T }$ . Third, the compared methods are designed for balanced training and ignore the diverse training process in PCL. Thus, some gradients may be counteracted because of the large gradient discrepancy when updating the model. In contrast, our MaxDO with AGD obtains the best final accuracy $\bar { A } ^ { T }$ on three datasets and different memory buffer sizes, which shows our superiority in balancing plasticity and stability. For example, we have $5 5 . 1 9 2 \%$ for PS-ImageNet-TINY (buffer size 4,000) while the compared best value is only $5 3 . 8 2 7 \%$ . On one hand, the proposed AGD is used to measure the asymmetric distance between gradients to boost the effective update of each task. On the other hand, the maximum discrepancies between multiple tasks are reduced. Note that, the forgetting measure of the proposed methods may not outperform the compared methods because we got both better new tasks (see the following section) and final accuracy performance, their difference value (forgetting) may be small.
|
| 159 |
+
|
| 160 |
+
Table 3: Comparisons (avg ± std) with different buffer sizes on PS-ImageNet-TINY (200 classes).
|
| 161 |
+
|
| 162 |
+
<table><tr><td rowspan="2">Method (+ Rehearsal)</td><td colspan="2">Buffer size 2000</td><td colspan="2">Buffer size 3000</td><td colspan="2">Buffer size 4000</td></tr><tr><td>Ar (%)</td><td>Fr(%)</td><td>Ar (%)</td><td>Fr(%)</td><td>Ar (%)</td><td>Fr(%)</td></tr><tr><td>MGDA(NeurIPS'18)</td><td>48.179 ± 0.969</td><td>10.936 ± 1.917</td><td>51.794 ± 0.427</td><td>13.506 ± 0.649</td><td>52.644 ± 1.133</td><td>13.586 ± 2.191</td></tr><tr><td>GradNorm(ICML'18)</td><td>47.311 ± 1.841</td><td>9.975 ± 3.651</td><td>49.501 ± 1.882</td><td>11.740 ± 3.975</td><td>49.331 ± 1.606</td><td>11.507 ± 3.530</td></tr><tr><td>DWA(CVPR'18)</td><td>47.429 ± 0.865</td><td>10.640 ± 1.764</td><td>48.387± 0.718</td><td>11.505 ± 1.438</td><td>47.520 ± 2.129</td><td>10.498 ± 4.267</td></tr><tr><td>GradDrop(NeurIPS'20)</td><td>49.955 ± 1.413</td><td>11.747 ± 2.961</td><td>54.141 ± 0.747</td><td>14.633 ± 1.001</td><td>53.827 ± 1.146</td><td>14.623 ± 1.177</td></tr><tr><td>PCGrad(NeurIPS'20)</td><td>49.052 ± 0.961</td><td>10.264 ± 1.406</td><td>51.701 ± 0.554</td><td>12.508 ±0.698</td><td>50.837 ± 1.097</td><td>11.605 ± 1.478</td></tr><tr><td>CVweight(Arxiv'20)</td><td>34.032 ±0.607</td><td>8.221 ± 1.521</td><td>36.992 ± 1.900</td><td>11.055 ± 3.272</td><td>37.007 ± 2.304</td><td>9.954 ± 3.830</td></tr><tr><td>RLW(Arxiv'21)</td><td>49.355 ± 0.904</td><td>10.857 ± 1.933</td><td>49.629 ± 1.454</td><td>10.973 ± 3.017</td><td>51.947 ± 1.202</td><td>12.907 ± 2.478</td></tr><tr><td>MaxDO (AGD)</td><td>52.165 ± 0.694</td><td>13.287 ± 0.544</td><td>54.485 ± 0.608</td><td>15.192 ± 0.444</td><td>55.192 ± 0.301</td><td>15.571 ± 0.217</td></tr></table>
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 4: Task accuracy comparisons along parallel continual learning. Each point means a right finished task and its performance. Note that the order is up to its end time rather than the task ids.
|
| 166 |
+
|
| 167 |
+
# 4.4 ACCURACY TRENDS
|
| 168 |
+
|
| 169 |
+
As shown in Fig. 4, we show the accuracy trends of the compared methods on the three evaluated datasets with buffer sizes 310, 3,000 and 4,000 for PS-EMNIST, PS-CIFAR-100 and PS-ImageNetTINY, respectively. Each point in the figures means a right finished task and its performance then. Note that the task order is up to the end time of tasks rather than the task ids. We have the following observations. Firstly, in the first several tasks, fewer seen tasks mean that fewer discrepancies need to be considered and the compared methods have similar performance. Secondly, when more new tasks are accessed, MaxDO gains better performance for new tasks on three datasets compared to other methods, especially on PS-CIFAR100 and PS-ImageNet-TINY, which both contain 20 tasks. The observations show the proposed MaxDO is useful in PCL for solving diverse training processes. After learning more tasks, MaxDO balances the asymmetric discrepancies among gradients to improve the new task training and old task keeping at the same time. Because MaxDO gets better first accuracy than other methods, the forgetting value may not achieve the best yet is still comparable to others.
|
| 170 |
+
|
| 171 |
+
Table 4: Metric comparison (↑) and ablation study (↓).
|
| 172 |
+
|
| 173 |
+
<table><tr><td>Method (+ Rehearsal)</td><td>Ar (%)</td><td>FT(%)</td></tr><tr><td>MaxDO (EuDist)</td><td>69.344 ± 0.024</td><td>24.268 ± 0.748</td></tr><tr><td>MaxDO (CosDist)</td><td>69.227 ± 0.370</td><td>24.552 ± 0.837</td></tr><tr><td>MaxDO (Normalized Eudist)</td><td>69.540 ± 0.340</td><td>24.629 ± 0.158</td></tr><tr><td>MGDA (Désidéri,2012)</td><td>67.704± 0.238</td><td>24.725 ± 1.075</td></tr><tr><td>MaxDO (w/o Max-Discrepancy)</td><td>68.866 ±0.443</td><td>24.093 ±0.025</td></tr><tr><td>MaxDO (w/o MGDA)</td><td>69.953 ±0.234</td><td>24.933 ±0.621</td></tr><tr><td>MaxDO (AGD)</td><td>70.078± 0.134</td><td>24.907±0.720</td></tr></table>
|
| 174 |
+
|
| 175 |
+
Table 5: Training time (second/iter).
|
| 176 |
+
|
| 177 |
+
<table><tr><td>Method</td><td>2 tasks</td><td>3 tasks</td><td>4 tasks</td><td>5 tasks</td><td>Total</td></tr><tr><td>MGDA</td><td>5.58</td><td>5.92</td><td>6.06</td><td>6.64</td><td>239</td></tr><tr><td>GradNorm</td><td>5.30</td><td>5.81</td><td>5.87</td><td>6.50</td><td>281</td></tr><tr><td>DWA</td><td>5.56</td><td>5.89</td><td>5.94</td><td>6.56</td><td>245</td></tr><tr><td>GradDrop</td><td>5.33</td><td>6.00</td><td>6.34</td><td>6.38</td><td>275</td></tr><tr><td>PCGrad</td><td>5.71</td><td>5.85</td><td>6.11</td><td>6.46</td><td>229</td></tr><tr><td>CVWeight</td><td>5.56</td><td>5.98</td><td>6.00</td><td>6.56</td><td>227</td></tr><tr><td>RLW</td><td>5.64</td><td>5.89</td><td>5.95</td><td>6.26</td><td>232</td></tr><tr><td>MaxDO</td><td>5.70</td><td>6.12</td><td>6.67</td><td>6.91</td><td>300</td></tr></table>
|
| 178 |
+
|
| 179 |
+
# 4.5 COMPARISON WITH SYMMETRIC METRICS
|
| 180 |
+
|
| 181 |
+
As shown in Table 4, we compare AGD with three common symmetric metrics including EuDist, CosDist, and Normalized EuDist. EuDist, CosDist are defined in Sec. 3.2. The vanilla EuDist depends highly on the gradient magnitude difference, thus we also compare with its normalized version $\begin{array} { r } { D ( \mathbf { \bar { x } } , \mathbf { \bar { y } } ) = \frac { \| \mathbf { x } - \mathbf { y } \| } { \| \mathbf { x } \| + \| \mathbf { y } \| } \in [ 0 , 1 ] } \end{array}$ , namely normalized EuDist. The results show that the three metrics can also obtain good performance with MaxDO. However, because of the over-emphasizing of gradient magnitude difference in EuDist, it fails to reduce the catastrophic forgetting effectively. Considering only gradient angle difference, MaxDO with CosDist obtains better performance than EuDist. But CosDist ignores the magnitude difference, which is also important in the min-distance problem, resulting in insufficient performance. Compared to EuDist, normalized EuDist obtains better performance but still set symmetric influence to gradient update. In contrast to the three metrics, MaxDO with AGD considers the asymmetric influence on gradient update, and tolerance is set to reduce the influence from small gradients to new-access tasks, which yields the best performance.
|
| 182 |
+
|
| 183 |
+
# 4.6 ABLATION STUDY AND PROCEDURE TIME
|
| 184 |
+
|
| 185 |
+
We evaluate the impact of the two main components of MaxDO in Table 4. First, we block the maximum discrepancy in MaxDO (MaxDO (w/o Max-Discrepancy)), which means that we solve the min-distance problem with Eq. (6) directly. Because of the self-interference, the solution combines the minimum discrepancy but fails to effectively reduce the discrepancy from other gradients $( 6 8 . 8 6 6 \%$ for $A _ { T }$ ). We then block the MGDA that obtains a weighted gradient not damage any tasks. MGDA is quite useful in traditional MTL tasks but is not suitable in PCL $6 7 . 7 0 4 \%$ for $A _ { T }$ ). Because of the diverse training process of parallel tasks, gradients are with large magnitude differences and MGDA prefers to set large factors to small gradients. We solve the problem by both MGDA and the maximum discrepancy, and the whole MaxDO method with AGD outperforms the two ablated methods $7 0 . 0 7 8 \%$ for $A _ { T }$ ), where the characters of the two components are combined.
|
| 186 |
+
|
| 187 |
+
In Table 5, we show the training time comparison on PS-CIFAR-100. We first compare the training time for 2 to 5 parallel tasks in one iteration. We find that the generation of task numbers will grow the training time, and MaxDO needs more time than other methods because multiple minimum distance optimizations are performed. Thus, in the whole timeline, MaxDO gets slightly longer training time than other methods. It is interesting to explore how to speed up the MaxDO training in the future.
|
| 188 |
+
|
| 189 |
+
# 5 CONCLUSION
|
| 190 |
+
|
| 191 |
+
In this paper, we studied to address the training conflict and catastrophic forgetting issues in Parallel Continual Learning (PCL). We presented that the two issues are rooted in the gradient discrepancies and formulated the problem into a minimum distance optimization among gradients. However, the distance metric is often set to be symmetric, which is problematic in gradient descent. To evaluate the gradient discrepancy in PCL, we proposed an explicit Asymmetric Gradient Distance (AGD), which considers both gradient magnitude ratios and directions and has a tolerance when updating with a small gradient of inverse direction. Moreover, we also proposed a novel Maximum Discrepancy Optimization (MaxDO) strategy to minimize the maximum discrepancy among multiple gradients and avoid self-interference. Solving by MaxDO with AGD, the parallel training in PCL reduces the influence of the training conflict and slows the catastrophic forgetting of finished tasks. We verified the proposed benchmark on three image recognition datasets. The experimental results significantly showed the advantage of our MaxDO and the effectiveness of the proposed AGD. We list the latent limitation of our method: (1) The MaxDO cannot guarantee a theoretical Pareto optimum in the training process like MGDA, which means a better trade-off can be obtained in the future. (2) The MaxDO method needs more time for training.
|
| 192 |
+
|
| 193 |
+
# REFERENCES
|
| 194 |
+
|
| 195 |
+
Rahaf Aljundi, Francesca Babiloni, Mohamed Elhoseiny, Marcus Rohrbach, and Tinne Tuytelaars. Memory aware synapses: Learning what (not) to forget. In ECCV, 2018.
|
| 196 |
+
|
| 197 |
+
Rahaf Aljundi, Eugene Belilovsky, Tinne Tuytelaars, Laurent Charlin, Massimo Caccia, Min Lin, and Lucas Page-Caccia. Online continual learning with maximal interfered retrieval. In NeurIPS, 2019a.
|
| 198 |
+
|
| 199 |
+
Rahaf Aljundi, Min Lin, Baptiste Goujaud, and Yoshua Bengio. Gradient based sample selection for online continual learning. In NeurIPS, 2019b.
|
| 200 |
+
|
| 201 |
+
Craig Atkinson, Brendan McCane, Lech Szymanski, and Anthony Robins. Pseudo-rehearsal: Achieving deep reinforcement learning without catastrophic forgetting. arXiv preprint arXiv:1812.02464, 2018.
|
| 202 |
+
|
| 203 |
+
Aviad Barzilai and Koby Crammer. Convex multi-task learning by clustering. In AISTATS, 2015.
|
| 204 |
+
|
| 205 |
+
James M Buchanan. The relevance of pareto optimality. Journal of conflict resolution, 1962.
|
| 206 |
+
|
| 207 |
+
Francesca Cagliari, Barbara Di Fabio, and Claudia Landi. The natural pseudo-distance as a quotient pseudo-metric, and applications. In Forum Mathematicum. De Gruyter, 2015.
|
| 208 |
+
|
| 209 |
+
Rich Caruana. Multitask learning. Machine learning, 1997.
|
| 210 |
+
|
| 211 |
+
Arslan Chaudhry, Puneet K Dokania, Thalaiyasingam Ajanthan, and Philip HS Torr. Riemannian walk for incremental learning: Understanding forgetting and intransigence. In ECCV, 2018.
|
| 212 |
+
|
| 213 |
+
Arslan Chaudhry, Marc’Aurelio Ranzato, Marcus Rohrbach, and Mohamed Elhoseiny. Efficient lifelong learning with a-gem. In ICLR, 2019.
|
| 214 |
+
|
| 215 |
+
Zhao Chen, Vijay Badrinarayanan, Chen-Yu Lee, and Andrew Rabinovich. Gradnorm: Gradient normalization for adaptive loss balancing in deep multitask networks. In ICML, 2018.
|
| 216 |
+
|
| 217 |
+
Zhao Chen, Jiquan Ngiam, Yanping Huang, Thang Luong, Henrik Kretzschmar, Yuning Chai, and Dragomir Anguelov. Just pick a sign: Optimizing deep multitask models with gradient sign dropout. In NeurIPS, 2020.
|
| 218 |
+
|
| 219 |
+
Gregory Cohen, Saeed Afshar, Jonathan Tapson, and Andre Van Schaik. Emnist: Extending mnist to handwritten letters. In IJCNN, 2017.
|
| 220 |
+
|
| 221 |
+
Julia Collins and Johannes Zimmer. An asymmetric arzela–ascoli theorem. \` Topology and its Applications, 2007.
|
| 222 |
+
|
| 223 |
+
Jean-Antoine Desid ´ eri. Multiple-gradient descent algorithm (mgda) for multiobjective optimization.´ Comptes Rendus Mathematique, 2012.
|
| 224 |
+
|
| 225 |
+
Prithviraj Dhar, Rajat Vikram Singh, Kuan-Chuan Peng, Ziyan Wu, and Rama Chellappa. Learning without memorizing. In CVPR, 2019.
|
| 226 |
+
|
| 227 |
+
Mehrdad Farajtabar, Navid Azizan, Alex Mott, and Ang Li. Orthogonal gradient descent for continual learning. In AISTATS, 2020.
|
| 228 |
+
|
| 229 |
+
MA Fiol. On pseudo-distance-regularity. Linear Algebra and its Applications, 2001.
|
| 230 |
+
|
| 231 |
+
Jorg Fliege and Benar Fux Svaiter. Steepest descent methods for multicriteria optimization. ¨ Mathematical methods of operations research, 2000.
|
| 232 |
+
|
| 233 |
+
Robert M French. Catastrophic forgetting in connectionist networks. TiCS, 1999.
|
| 234 |
+
|
| 235 |
+
Rick Groenendijk, Sezer Karaoglu, Theo Gevers, and Thomas Mensink. Multi-loss weighting with coefficient of variations. In WACV, 2021.
|
| 236 |
+
|
| 237 |
+
Yunhui Guo, Mingrui Liu, Tianbao Yang, and Tajana Rosing. Learning with long-term remembering: Following the lead of mixed stochastic gradient. arXiv preprint arXiv:1909.11763, 2019.
|
| 238 |
+
|
| 239 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 240 |
+
|
| 241 |
+
Ali Jalali, Sujay Sanghavi, Chao Ruan, and Pradeep Ravikumar. A dirty model for multi-task learning. In NeurIPS, 2010.
|
| 242 |
+
|
| 243 |
+
Adrian Javaloy and Isabel Valera. Rotograd: Gradient homogenization in multitask learning. ´ arXiv preprint arXiv:2103.02631, 2021.
|
| 244 |
+
|
| 245 |
+
James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. PNAS, 2017.
|
| 246 |
+
|
| 247 |
+
Ya Le and Xuan Yang. Tiny imagenet visual recognition challenge. CS 231N, 2015.
|
| 248 |
+
|
| 249 |
+
Zhizhong Li and Derek Hoiem. Learning without forgetting. TPAMI, 2017.
|
| 250 |
+
|
| 251 |
+
Baijiong Lin, Feiyang Ye, and Yu Zhang. A closer look at loss weighting in multi-task learning. arXiv preprint arXiv:2111.10603, 2021.
|
| 252 |
+
|
| 253 |
+
Bo Liu, Xingchao Liu, Xiaojie Jin, Peter Stone, and Qiang Liu. Conflict-averse gradient descent for multi-task learning. In NeurIPS, 2021.
|
| 254 |
+
|
| 255 |
+
Shikun Liu, Edward Johns, and Andrew J Davison. End-to-end multi-task learning with attention. In CVPR, 2019.
|
| 256 |
+
|
| 257 |
+
David Lopez-Paz and Marc’Aurelio Ranzato. Gradient episodic memory for continual learning. In NeurIPS, 2017.
|
| 258 |
+
|
| 259 |
+
Arun Mallya, Dillon Davis, and Svetlana Lazebnik. Piggyback: Adapting a single network to multiple tasks by learning to mask weights. In ECCV, 2018.
|
| 260 |
+
|
| 261 |
+
Andreas Maurer, Massi Pontil, and Bernardino Romera-Paredes. Sparse coding for multitask and transfer learning. In ICML, 2013.
|
| 262 |
+
|
| 263 |
+
Andrea CG Mennucci. On asymmetric distances. Analysis and Geometry in Metric Spaces, 2013.
|
| 264 |
+
|
| 265 |
+
Jary Pomponi, Simone Scardapane, and Aurelio Uncini. Pseudo-rehearsal for continual learning with normalizing flows. arXiv preprint arXiv:2007.02443, 2020.
|
| 266 |
+
|
| 267 |
+
Liu Risheng, Liu Yaohua, Zeng Shangzhi, and Jin Zhang. Gradient-based editing of memory examples for online task-free continual learning. In NeurIPS, 2021.
|
| 268 |
+
|
| 269 |
+
Amir Rosenfeld and John K Tsotsos. Incremental learning through deep adaptation. TPAMI, 2018.
|
| 270 |
+
|
| 271 |
+
Andrei A Rusu, Neil C Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. arXiv preprint arXiv:1606.04671, 2016.
|
| 272 |
+
|
| 273 |
+
Ozan Sener and Vladlen Koltun. Multi-task learning as multi-objective optimization. In NeurIPS, 2018.
|
| 274 |
+
|
| 275 |
+
Haseeb Shah, Khurram Javed, and Faisal Shafait. Distillation techniques for pseudo-rehearsal based incremental learning. arXiv preprint arXiv:1807.02799, 2018.
|
| 276 |
+
|
| 277 |
+
Sebastian Thrun and Joseph O’Sullivan. Discovering structure in multiple learning tasks: The tc algorithm. In ICML, 1996.
|
| 278 |
+
|
| 279 |
+
Jie Wang and Jieping Ye. Safe screening for multi-task feature learning with multiple data matrices. In ICML, 2015.
|
| 280 |
+
|
| 281 |
+
Zirui Wang, Yulia Tsvetkov, Orhan Firat, and Yuan Cao. Gradient vaccine: Investigating and improving multi-task optimization in massively multilingual models. arXiv preprint arXiv:2010.05874, 2020.
|
| 282 |
+
|
| 283 |
+
Wallace Alvin Wilson. On quasi-metric spaces. American Journal of Mathematics, 1931.
|
| 284 |
+
|
| 285 |
+
Jaehong Yoon, Eunho Yang, Jeongtae Lee, and Sung Ju Hwang. Lifelong learning with dynamically expandable networks. arXiv preprint arXiv:1708.01547, 2017.
|
| 286 |
+
|
| 287 |
+
Tianhe Yu, Saurabh Kumar, Abhishek Gupta, Sergey Levine, Karol Hausman, and Chelsea Finn. Gradient surgery for multi-task learning. In NeurIPS, 2020.
|
| 288 |
+
|
| 289 |
+
Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. In ICML, 2017.
|
| 290 |
+
|
| 291 |
+
Yu Zhang and Qiang Yang. A survey on multi-task learning. IEEE TKDE, 2021.
|
| 292 |
+
|
| 293 |
+
# MEASURING ASYMMETRIC GRADIENT DISCREPANCY IN PARALLEL CONTINUAL LEARNING (APPENDIX)
|
| 294 |
+
|
| 295 |
+
# A DATASET CONSTRUCTION
|
| 296 |
+
|
| 297 |
+
For effective transformation, several requirements are needed: (1) Random label set for each task, in which the data stream length of each task can be different; (2) Random timeline for each label set, in which the debut of each task can be any time between the first access of the former and latter tasks. For simplicity, we omit all blank time that all data streams are unavailable.
|
| 298 |
+
|
| 299 |
+
• Parallel Split EMNIST (PS-EMNIST): We split EMNIST (62 classes) into 5 tasks and randomly generate 3 label sets for each task and 3 timelines for each label set (say 9 different situations). The size of the label set for each task, i.e., the number of classes, is set to larger than 2 while no more than 15.
|
| 300 |
+
|
| 301 |
+
• Parallel Split CIFAR-100 (PS-CIFAR-100): We split CIFAR-100 into 20 tasks and randomly generate 3 label sets for each task and 3 timelines for each label set. The size of the label set for each task is set to larger than 2 while no more than 15.
|
| 302 |
+
|
| 303 |
+
• Parallel Split ImageNet-TINY (PS-ImageNet-TINY): We split it into 20 tasks w.r.t. random 3 label sets, and each label set has 3 randomly generated timelines. The size of the label set for each task is set to larger than 5 while no more than 20.
|
| 304 |
+
|
| 305 |
+
# B PROOF OF LEMMA 1 ON AGD
|
| 306 |
+
|
| 307 |
+
As an asymmetric metric, the proposed Asymmetric Gradient Discrepancy (AGD) measure needs to satisfy the two features in Lemma 1.
|
| 308 |
+
|
| 309 |
+
Proof: Given three arbitrary gradients $\mathbf x , \mathbf y$ and $\mathbf { z }$ , we have
|
| 310 |
+
|
| 311 |
+
(1) If $\mathbf x = \mathbf y$ , $D ( \mathbf { x } , \mathbf { y } ) = 0$ .
|
| 312 |
+
|
| 313 |
+
(2) Positivity: If $\mathbf x \neq \mathbf y$ , then $\| \mathbf { x } - \mathbf { y } \| \neq 0$ , and we have $D ( \mathbf { x } , \mathbf { y } ) = { \frac { \| \mathbf { x } - \mathbf { y } \| } { \| \mathbf { y } \| + \| \mathbf { x } - \mathbf { y } \| } } > 0 .$
|
| 314 |
+
|
| 315 |
+
(3) The triangle inequality:
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
\begin{array} { r l } & { \frac { \| \mathbf { x } - \mathbf { z } \| } { \| \mathbf { z } \| + \| \mathbf { x } - \mathbf { z } \| } = \frac { \| \mathbf { x } - \mathbf { y } + \mathbf { y } - \mathbf { z } \| } { \| \mathbf { z } \| + \| \mathbf { x } - \mathbf { y } + \mathbf { y } - \mathbf { z } \| } } \\ { \leq } & { \frac { \| \mathbf { x } - \mathbf { y } \| + \| \mathbf { y } - \mathbf { z } \| } { \| \mathbf { z } \| + \| \mathbf { x } - \mathbf { y } \| + \| \mathbf { y } - \mathbf { z } \| } } \\ { = } & { \frac { \| \mathbf { x } - \mathbf { y } \| } { \| \mathbf { z } \| + \| \mathbf { x } - \mathbf { y } \| + \| \mathbf { y } - \mathbf { z } \| } } \\ { = } & { \frac { \| \mathbf { x } - \mathbf { y } \| } { \| \mathbf { z } \| + \| \mathbf { x } - \mathbf { y } \| + \| \mathbf { y } - \mathbf { z } \| } + \frac { \| \mathbf { y } - \mathbf { z } \| } { \| \mathbf { z } \| + \| \mathbf { x } - \mathbf { y } \| + \| \mathbf { y } - \mathbf { z } \| } } \\ { \leq } & { \frac { \| \mathbf { x } - \mathbf { y } \| } { \| \mathbf { z } \| + \| \mathbf { x } - \mathbf { y } \| + \| \mathbf { y } - \mathbf { z } \| } + \frac { \| \mathbf { y } - \mathbf { z } \| } { \| \mathbf { z } \| + \| \mathbf { y } - \mathbf { z } \| } } \\ { \leq } & { \frac { \| \mathbf { x } - \mathbf { y } \| } { \| \mathbf { y } \| + \| \mathbf { x } - \mathbf { y } \| } + \frac { \| \mathbf { y } - \mathbf { z } \| } { \| \mathbf { z } \| + \| \mathbf { y } - \mathbf { z } \| } . } \end{array}
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
(4) Asymmetric: $D ( \mathbf { x } , \mathbf { y } ) = { \frac { \| \mathbf { x } - \mathbf { y } \| } { \| \mathbf { y } \| + \| \mathbf { x } - \mathbf { y } \| } } ,$ , and $D ( \mathbf { y } , \mathbf { x } ) = { \frac { \| \mathbf { x } - \mathbf { y } \| } { \| \mathbf { x } \| + \| \mathbf { x } - \mathbf { y } \| } } ,$ . Thus, it is obvious that $D ( \mathbf { x } , \mathbf { y } ) = D ( \mathbf { y } , \mathbf { x } )$ is not always satisfied when $\mathbf x \neq \mathbf y$ and depends on the magnitude $\| \mathbf { x } \|$ and $\| \mathbf { y } \|$ .
|
| 322 |
+
|
| 323 |
+
Therefore, the proposed AGD is an asymmetric metric.
|
| 324 |
+
|
| 325 |
+
C TOLERANCE ANALYSIS AND PROOF OF COROLLARY 1
|
| 326 |
+
|
| 327 |
+
# C.1 PROOF OF COROLLARY 1
|
| 328 |
+
|
| 329 |
+
Let us review the definition of AGD:
|
| 330 |
+
|
| 331 |
+
$$
|
| 332 |
+
{ \widehat { D } } ( \mathbf { x } , \mathbf { y } ) = { \frac { \left\| \mathbf { x } - \mathbf { y } \right\| } { \left\| \mathbf { y } \right\| + \left\| \mathbf { x } - \mathbf { y } \right\| } } .
|
| 333 |
+
$$
|
| 334 |
+
|
| 335 |
+
$\widehat { D } ( \mathbf { x } , \mathbf { y } )$ represents the gradient influence from $\mathbf { x }$ to $\mathbf { y }$ . The nature of this asymmetric measure is the norm effect should only be from gradient difference $\| \mathbf x - \mathbf y \|$ to $\| \mathbf { y } \|$ rather than to both $\| \mathbf { x } \|$ and $\| \mathbf { y } \|$ . That is, the discrepancy should only depend on the ratio $\frac { \| \mathbf x - \mathbf y \| } { \| \mathbf y \| }$ , which can be further reduced to
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
{ \frac { \| \mathbf { x } - \mathbf { y } \| } { \| \mathbf { y } \| } } = { \frac { \sqrt { \| \mathbf { x } \| ^ { 2 } + \| \mathbf { y } \| ^ { 2 } - 2 \| \mathbf { x } \| \| \mathbf { y } \| \cos \angle \mathbf { x } , \mathbf { y } } } { \| \mathbf { y } \| } } = { \sqrt { \left( { \frac { \| \mathbf { x } \| } { \| \mathbf { y } \| } } \right) ^ { 2 } - 2 { \frac { \| \mathbf { x } \| } { \| \mathbf { y } \| } } \cos \angle \mathbf { x } , \mathbf { y } + 1 } } .
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
It is easy to know that
|
| 342 |
+
|
| 343 |
+
$$
|
| 344 |
+
{ \frac { \left\| \mathbf { x } - \mathbf { y } \right\| } { \left\| \mathbf { y } \right\| + \left\| \mathbf { x } - \mathbf { y } \right\| } } = 1 - { \frac { 1 } { 1 + { \frac { \left\| \mathbf { x } - \mathbf { y } \right\| } { \left\| \mathbf { y } \right\| } } } } .
|
| 345 |
+
$$
|
| 346 |
+
|
| 347 |
+
Because kx−ykkyk ≥ 0, Db(x, y) ∈ [0, 1].
|
| 348 |
+
|
| 349 |
+
In the paper, we illustrate the proposed AGD is an asymmetric measure of gradient discrepancy because $\bar { \widehat { D } } ( { \bf x } , { \bf y } )$ brings a tolerance when $\| \mathbf { x } \| \ll \| \mathbf { y } \|$ instead of the absolute difference between them. To analyze the values of gradient discrepancy measure $D$ regarding kxkkyk , we consider the following asymmetric limits with $\| y \| \neq 0$ :
|
| 350 |
+
|
| 351 |
+
$\operatorname* { l i m } _ { \| \mathbf { x } \| } { } _ { \infty } D$ : When $\| \mathbf { x } \| \gg \| \mathbf { y } \|$ , the conflict should be large from $\mathbf { x }$ to $\mathbf { y }$ ; $\operatorname* { l i m } _ { \frac { \| \mathbf { x } \| } { \| \mathbf { y } \| } \to 0 } D$ : When $\| \mathbf { x } \| \ll \| \mathbf { y } \|$ , the conflict is acceptable to some extend and should approach a tolerance value that less than $\operatorname* { l i m } _ { \| \mathbf { x } \| } { } _ { \infty } D$ .
|
| 352 |
+
|
| 353 |
+
We show the two limits for different discrepancy measures including Cosine Similarity, Euclidean Distance, Normalized Euclidean Distance, and AGD.
|
| 354 |
+
|
| 355 |
+
Cosine Similarity: Using the Cosine Similarity to measure the discrepancy has no relevance to the magnitude difference.
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
\operatorname* { l i m } _ { \| \mathbf { x } \| 0 } 1 - { \frac { \mathbf { x } ^ { \mathsf { T } } \mathbf { y } } { \| \mathbf { x } \| \| \mathbf { y } \| } } = \operatorname* { l i m } _ { \| \mathbf { x } \| \infty } 1 - { \frac { \mathbf { x } ^ { \mathsf { T } } \mathbf { y } } { \| \mathbf { x } \| \| \mathbf { y } \| } } = 1 - \cos \angle \mathbf { x } , \mathbf { y } .
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
Euclidean Distance: When $\| \mathbf { y } \| \neq 0$ , we have
|
| 362 |
+
|
| 363 |
+
$$
|
| 364 |
+
{ \frac { 1 } { 1 + \| \mathbf { x } - \mathbf { y } \| } } = { \frac { 1 } { 1 + \| \mathbf { y } \| \cdot { \frac { \| \mathbf { x } - \mathbf { y } \| } { \| \mathbf { y } \| } } } } .
|
| 365 |
+
$$
|
| 366 |
+
|
| 367 |
+
Thus, we have
|
| 368 |
+
|
| 369 |
+
$$
|
| 370 |
+
\operatorname* { l i m } _ { \| \mathbf { x } \| \to 0 } 1 - \frac { 1 } { 1 + \| \mathbf { x } - \mathbf { y } \| } = \frac { \| \mathbf { y } \| } { 1 + \| \mathbf { y } \| } , \quad \operatorname* { l i m } _ { \| \mathbf { x } \| \to \infty } 1 - \frac { 1 } { 1 + \| \mathbf { x } - \mathbf { y } \| } = 1 .
|
| 371 |
+
$$
|
| 372 |
+
|
| 373 |
+
When $\frac { \| \mathbf { x } \| } { \| \mathbf { y } \| } 0$ , by using the Euclidean Distance highly depends on $\| \mathbf { y } \|$ , which makes it unpredictable.
|
| 374 |
+
|
| 375 |
+
Normalized Euclidean Distance: When $\| \mathbf { y } \| \neq 0$ , we have
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
\operatorname* { l i m } _ { \frac { \| \mathbf { x } \| } { \| \mathbf { y } \| } \to 0 } \frac { \| \mathbf { x } - \mathbf { y } \| } { \| \mathbf { x } \| + \| \mathbf { y } \| } = \operatorname* { l i m } _ { \frac { \| \mathbf { x } \| } { \| \mathbf { y } \| } \to 0 } \frac { \frac { \| \mathbf { x } - \mathbf { y } \| } { \| \mathbf { y } \| } } { \frac { \| \mathbf { x } \| } { \| \mathbf { y } \| } + 1 } = 1 ,
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
$$
|
| 382 |
+
\begin{array} { r } { ) \ : z = \frac { \| \mathbf { x } - \mathbf { y } \| } { \| \mathbf { y } \| + \| \mathbf { x } - \mathbf { y } \| } } \end{array}
|
| 383 |
+
$$
|
| 384 |
+
|
| 385 |
+

|
| 386 |
+
Figure 5: Contours of different measures. Note that the $x$ - and $y \cdot$ -axes are the angle (i.e., $\angle \mathbf { x } , \mathbf { y } )$ between $\mathbf { x }$ and $\mathbf { y }$ , and the magnitude ratio $\frac { \| \mathbf { x } \| } { \| \mathbf { y } \| }$ , respectively. (a) Cosine distance; (b) Euclidean distance where $\| \mathbf { y } \| = 0 . 2$ ; (c) Asymmetric gradient distance.
|
| 387 |
+
|
| 388 |
+
$$
|
| 389 |
+
\begin{array} { r l } { \underset { \| \mathbf { x } \| } { \operatorname* { l i m } } \underset { \| \mathbf { x } \| } { \operatorname* { l i m } } \left\| \mathbf { x } - \mathbf { y } \right\| } & { = \underset { \| \mathbf { x } \| } { \operatorname* { l i m } } \underset { \| \mathbf { x } \| } { \operatorname* { l i m } } \left\| \left( \frac { \| \mathbf { x } \| } { \| \mathbf { y } \| } \right) ^ { 2 } - 2 \frac { \| \mathbf { x } \| } { \| \mathbf { y } \| } \cos \angle \mathbf { x } , \mathbf { y } + 1 \right. } \\ & { = \underset { \| \mathbf { x } \| } { \operatorname* { l i m } } \underset { \| \mathbf { x } \| } { \operatorname* { l i m } } \left. \frac { 2 \cos \angle \mathbf { x } , \mathbf { y } + 2 } { \| \mathbf { y } \| } - \frac { 2 \cos \angle \mathbf { x } , \mathbf { y } + 2 } { \| \mathbf { y } \| } + 1 \right. } \\ & { = 1 . } \end{array}
|
| 390 |
+
$$
|
| 391 |
+
|
| 392 |
+
Table 6: Comparisons between different tolerances of AGD on PS-CIFAR-100.
|
| 393 |
+
|
| 394 |
+
<table><tr><td>Y</td><td>Tolerance</td><td>Ar (%)</td><td>Fr (%)</td></tr><tr><td>0.2</td><td>5/6</td><td>69.283 ± 0.307</td><td>24.126 ± 0.472</td></tr><tr><td>0.5</td><td>2/3</td><td>69.486 ± 0.204</td><td>24.520 ± 0.570</td></tr><tr><td>1 (ours)</td><td>1/2</td><td>70.078 ± 0.134</td><td>24.907 ± 0.720</td></tr><tr><td>2</td><td>1/ /3</td><td>69.626 ± 0.192</td><td>24.344 ± 0.610</td></tr><tr><td>34</td><td>1/4</td><td>69.505 ± 0.442</td><td>24.479 ± 0.408</td></tr><tr><td></td><td>1/5</td><td>69.332 ± 0.142</td><td>24.600 ± 0.404</td></tr></table>
|
| 395 |
+
|
| 396 |
+
The discrepancy using Normalized EuDist has the same value when means no tolerance. $\mathrm { l i m } _ { \frac { \| \mathbf { x } \| } { \| \mathbf { y } \| } 0 }$ and $\operatorname* { l i m } _ { \| \mathbf { x } \| } { } _ { \infty }$ , which
|
| 397 |
+
|
| 398 |
+
AGD and Proof of Corollary 1: According to Eq. (13), we have
|
| 399 |
+
|
| 400 |
+
$$
|
| 401 |
+
\operatorname* { l i m } _ { \| \mathbf { x } \| \to 0 } \widehat { D } ( \mathbf { x } , \mathbf { y } ) = \operatorname* { l i m } _ { \frac { \| \mathbf { x } \| } { \| \mathbf { y } \| } \to 0 } 1 - \frac { 1 } { 1 + \frac { \| \mathbf { x } - \mathbf { y } \| } { \| \mathbf { y } \| } } = \frac { 1 } { 2 } ,
|
| 402 |
+
$$
|
| 403 |
+
|
| 404 |
+
$$
|
| 405 |
+
\operatorname* { l i m } _ { \| \mathbf { x } \| \infty } \widehat { D } ( \mathbf { x } , \mathbf { y } ) = \operatorname* { l i m } _ { \frac { \| \mathbf { x } \| } { \| \mathbf { y } \| } \infty } 1 - \frac { 1 } { 1 + \frac { \| \mathbf { x } - \mathbf { y } \| } { \| \mathbf { y } \| } } = 1 .
|
| 406 |
+
$$
|
| 407 |
+
|
| 408 |
+
The two equations denote that when $\frac { \| \mathbf { x } \| } { \| \mathbf { y } \| } 0$ , AGD has the tolerance value $\begin{array} { r } { { \frac { 1 } { 2 } } < \operatorname* { l i m } _ { \frac { \| \mathbf { x } \| } { \| \mathbf { y } \| } \infty } = 1 } \end{array}$ , which means that $\| \mathbf { x } \| < < \| \mathbf { y } \|$ is acceptable as the half of perfect equal.
|
| 409 |
+
|
| 410 |
+
# C.2 DIFFERENT TOLERANCE ANALYSIS
|
| 411 |
+
|
| 412 |
+
In our paper, we propose an Asymmetric Gradient Distance (AGD) to evaluate the gradient discrepancy. AGD is designed to have a tolerance $\begin{array} { l } { { \frac { 1 } { 2 } } } \end{array}$ in Corollary 1. This is because updating with a zero gradient will neither improve nor damage the performance. Even though, we prefer positive influence rather than non-influence. Thus, we define that the distance $\widehat { D } ( \mathbf { g } _ { \mathrm { A } } , \mathbf { g } _ { \mathrm { B } } )$ in the situation $\| \mathbf { g } _ { \mathrm { A } } \| \ll \| \mathbf { g } _ { \mathrm { B } } \|$ is the mid-level in the value range.
|
| 413 |
+
|
| 414 |
+
In this subsection, we try to change the tolerance and observe the performance change. The tolerance can be controlled by adding a factor $\gamma > 0$ . Omitting the edge situation, we have
|
| 415 |
+
|
| 416 |
+
$$
|
| 417 |
+
\widehat { D } ( g _ { \mathrm { A } } , g _ { \mathrm { B } } ) = \frac { \| g _ { \mathrm { A } } - g _ { \mathrm { B } } \| } { \gamma \| g _ { \mathrm { B } } \| + \| g _ { \mathrm { A } } - g _ { \mathrm { B } } \| } .
|
| 418 |
+
$$
|
| 419 |
+
|
| 420 |
+
The experiments on different tolerances are shown in Table 6. The results show either larger or smaller tolerances compared to $\frac { \mathrm { 1 } } { \mathrm { 2 } }$ will get the performance drop.
|
| 421 |
+
|
| 422 |
+
# D CONTOUR OF AGD
|
| 423 |
+
|
| 424 |
+
We show more function contour comparisons with existing measurement methods in Fig. 5, where the axes are the angle $\angle \mathbf { x } , \mathbf { y }$ , the ratio $\frac { \| \mathbf { x } \| } { \| \mathbf { y } \| }$ and the metric contour value $z$ for better visualization. As we can see, the CosDist (Fig. 5(a)) has no relation to the ratio. The tolerance for $\mathrm { l i m } _ { \frac { \| \mathbf { x } \| } { \| \mathbf { y } \| } 0 }$ of EuDist depends on the norm of y (Fig. 5(b)). The proposed AGD has fixed tolerance for $\mathrm { l i m } _ { \frac { \| \mathbf { x } \| } { \| \mathbf { y } \| } 0 }$ as shown in Fig. 5(c).
|
| 425 |
+
|
| 426 |
+
# E INTRODUCTION OF MGDA
|
| 427 |
+
|
| 428 |
+
At any time, PCL training yields the following dynamic multi-objective empirical risk minimization formulation:
|
| 429 |
+
|
| 430 |
+
$$
|
| 431 |
+
\operatorname* { m i n } _ { \theta , \{ \theta _ { i } | i \in { \mathcal { T } } \} } \quad \left\{ { \ell } _ { i } \left( { \mathcal { D } } _ { i } \right) \vert i \in { \mathcal { T } } _ { t } \right\} ,
|
| 432 |
+
$$
|
| 433 |
+
|
| 434 |
+
where $\tau$ is the task index set with activated data streams at time t.
|
| 435 |
+
|
| 436 |
+
Table 7: Comparisons between using AGD with and without rehearsal gradient on PS-CIFAR-100.
|
| 437 |
+
|
| 438 |
+
<table><tr><td>Method (+ Rehearsal)</td><td>Ar (%)</td><td>FT (%)</td></tr><tr><td>MaxDO (w/o rehearsal gradient)</td><td>68.398 ± 0.776</td><td>23.676 ± 0.583</td></tr><tr><td>MaxDO (w/ rehearsal gradient)</td><td>70.078 ± 0.134</td><td>24.907 ± 0.720</td></tr><tr><td></td><td></td><td></td></tr></table>
|
| 439 |
+
|
| 440 |
+
An elegant solution to the MOO for Pareto optimality Buchanan (1962) is the Steepest Descent Method (SDM) Fliege & Svaiter (2000), which aims to obtain an optimal descent direction $d ^ { * }$ that satisfies
|
| 441 |
+
|
| 442 |
+
$$
|
| 443 |
+
d ^ { * } , \alpha ^ { * } = \arg \operatorname* { m i n } \lrcorner d , \alpha \quad \alpha + \frac { 1 } { 2 } \left\| d \right\| ^ { 2 } , \mathrm { s . t . } \quad g . i ^ { \top } d \leq \alpha , \quad \forall i \in \mathcal { T } ,
|
| 444 |
+
$$
|
| 445 |
+
|
| 446 |
+
where the constraints let each task have non-conflict with gradient $d$ . Considering the Lagrange multipliers and Karush–Kuhn–Tucker (KKT) condition, the dual problem solved by the MultiGradient Descent Algorithm (MGDA) Desid ´ eri (2012) is ´
|
| 447 |
+
|
| 448 |
+
$$
|
| 449 |
+
w ^ { * } = \arg \operatorname* { m i n } _ { \mathbf { w } } \quad \left\| \sum _ { i } \mathbf { w } _ { i } \mathbf { g } _ { i } \right\| ^ { 2 } , \mathrm { s . t . } \quad \sum _ { i } \mathbf { w } _ { i } = 1 \mathrm { a n d } \mathbf { w } _ { i } \geq 0 , \forall i .
|
| 450 |
+
$$
|
| 451 |
+
|
| 452 |
+
The objective of MGDA is 0 and the resulting point satisfies the KKT conditions, or the solution gives a Pareto descent direction that improves all tasks.
|
| 453 |
+
|
| 454 |
+
# F MAXDO EFFECTS ON REHEARSAL
|
| 455 |
+
|
| 456 |
+
In rehearsal-based PCL, the training conflict may worsen the forgetting of old tasks. That is, the new task produces large gradients and may mislead the replay of old tasks with small gradients. In our method, we consider reducing this gradient conflict and propose to measure the asymmetric gradient distance. Moreover, we propose to minimize the maximum discrepancy among multiple gradients.
|
| 457 |
+
|
| 458 |
+
To show the MaxDO’s effectiveness of forgetting reduction on rehearsal gradient, we evaluate the result that only leverages MaxDO on new tasks instead memory data stream (i.e., finished tasks). The result is shown in Fig. 7. In this case, the final gradient is calculated by $\begin{array} { r } { \mathbf { d } = \frac { 1 } { 2 } \mathbf { g } _ { \mathrm { r e h e r a s a l } } + \frac { 1 } { 2 } \mathbf { g } _ { \mathrm { n e w } } , } \end{array}$ where $\mathrm { g } _ { \mathrm { n e w } }$ is the solution gradient via MaxDO on only new tasks. The result shows that it is necessary to put the rehearsal gradient to the MaxDO. Otherwise, the model will get worse accuracy and weak forgetting.
|
md/dev/e1u9PVnwNr/e1u9PVnwNr.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/e8PVEkSa4Fq/e8PVEkSa4Fq.md
ADDED
|
@@ -0,0 +1,304 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Test-Time Prompt Tuning for Zero-Shot Generalization in Vision-Language Models
|
| 2 |
+
|
| 3 |
+
Manli $\mathbf { S h u } ^ { 1 * }$ Weili Nie2 De-An Huang2 Zhiding Yu 2 Tom Goldstein 1 Anima Anandkumar2,3,† Chaowei Xiao2,4† 1 University of Maryland, 2 NVIDIA, 3 Caltech, 4 Arizona State University
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Pre-trained vision-language models (e.g., CLIP) have shown promising zero-shot generalization in many downstream tasks with properly designed text prompts. Instead of relying on hand-engineered prompts, recent works learn prompts using the training data from downstream tasks. While effective, training on domainspecific data reduces a model’s generalization capability to unseen new domains. In this work, we propose test-time prompt tuning (TPT), a method that can learn adaptive prompts on the fly with a single test sample. For image classification, TPT optimizes the prompt by minimizing the entropy with confidence selection so that the model has consistent predictions across different augmented views of each test sample. In evaluating generalization to natural distribution shifts, TPT improves the zero-shot top-1 accuracy of CLIP by $3 . 6 \%$ on average, surpassing previous prompt tuning approaches that require additional task-specific training data. In evaluating cross-dataset generalization with unseen categories, TPT performs on par with the state-of-the-art approaches that use additional training data. Project page: https://azshue.github.io/TPT/.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Recent advances in vision-language pre-training, such as CLIP [1] and ALIGN [2], present a promising direction for developing foundation models for vision tasks [3, 4]. These foundation models encode a wide range of visual concepts after training on millions of noisy image-text pairs and can be applied to downstream tasks in a zero-shot manner without task-specific training data [5–11]. This is made possible by appropriately designed instruction prompts. Take image classification in Figure 1 as an example: We can prepend a category name with a prompt “a photo of a" (e.g., “a photo of a dog"). Images can then be classified by using CLIP to measure their alignment with the various class descriptions. Designing such prompts thus plays a crucial role in applying foundation models to downstream tasks in a zero-shot manner. However, such hand-crafted prompts require domain-specific heuristics and may not be optimal.
|
| 12 |
+
|
| 13 |
+
Recent works address this by proposing prompt tuning to directly learn prompts using training data from downstream tasks [12]. We can fine-tune prompts with training data in the same way we finetune model parameters since prompt embeddings are part of the model input and are differentiable with respect to the loss function. Such an approach can find better prompts compared to hand-crafted ones, but the learned prompts are limited to the distribution and tasks corresponding to training data and may have limited generalization beyond that. In addition, this approach requires training data with annotations, which can be expensive and is not available for zero-shot tasks.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Test-time Prompt Tuning (TPT) for image classification. We tune adaptive prompts on the fly with a single test sample, without the need for additional training data or annotations. TPT optimizes the prompt to encourage consistent predictions across augmented views by minimizing the marginal entropy. We introduce confidence selection to filter out noisy augmentations.
|
| 17 |
+
|
| 18 |
+
Our Approach. To address the aforementioned challenges, we propose test-time prompt tuning (TPT) that tunes the prompt on the fly using only the given test sample. The tuned prompt is adapted to each task, making it suitable for zero-shot generalization without requiring any task-specific training data or annotations. TPT retains the zero-shot generalization setting since no additional training data or annotations are used.
|
| 19 |
+
|
| 20 |
+
We explore TPT on two different downstream tasks: image classification and context-dependent visual reasoning. For each downstream task, we design a customized test-time tuning strategy that fits the nature of the task. Without loss of generality, we consider CLIP [1] as our vision-language foundation model, for its simplicity in design and its wide applicability [13].
|
| 21 |
+
|
| 22 |
+
For image classification, a test sample is an input image. Given a single sample at test time, we perform prompt tuning by generating multiple randomly augmented views, and optimizing the text prompt so that the model has consistent predictions across different augmented views. This is done by minimizing the marginal entropy among the outputs of the augmented views. In addition, since some augmentations may lead to misleading model predictions, we propose confidence selection to filter out those “noisy” augmented views. We discard augmented views with a high prediction entropy (i.e., low confidence), and only include high confidence views in the consistency optimization.
|
| 23 |
+
|
| 24 |
+
We evaluate the zero-shot generalization of TPT in two image classification settings: natural distribution shifts [14] and cross-dataset generalization [15]. For the setting of evaluating natural distribution shifts, TPT boosts the Top-1 accuracy of CLIP in the zero-shot setting by $3 . 6 \%$ on average compared to using a hand-crafted prompt, achieving on-par accuracy with previous prompt tuning methods that require additional training data (i.e., ImageNet). TPT achieves a maximum improvement of $6 . 9 \%$ on ImageNet-A compared to using a hand-crafted prompt, surpassing the existing few-shot prompt tuning method by $5 . 1 \%$ . For the setting of evaluating cross-dataset generalization with possibly unseen categories, TPT achieves on-par performance with the state-of-the-art few-shot prompt tuning method [15] without the need for additional training data or annotations.
|
| 25 |
+
|
| 26 |
+
For the second task of context-dependent visual reasoning, such as Bongard-HOI [16], a test sample contains two sets of support images and a query image for evaluation. The two sets of support images exemplify the presence and the absence of a human-object interaction (HOI) concept (e.g., “ride bike"). The model is then asked to infer whether the query image contains the underlying concept. Given such a test sample, we apply TPT by tuning prompts to better differentiate between the two support sets, so that the query image can be better classified (Figure 4). Despite the use of support sets, our approach is still considered zero-shot for visual reasoning, because we do not use either training tasks from other concepts or the annotation of the query image at test time to update the prompt of the test task. By adapting TPT to context-dependent visual reasoning, we outperform the state-of-the-art method [17] by $4 . 1 \%$ Bongard-HOI benchamrk [16].
|
| 27 |
+
|
| 28 |
+
We summarize our main contributions as follows:
|
| 29 |
+
|
| 30 |
+
• We propose test-time prompt tuning (TPT) that does not need any training data or annotations to optimize the prompt. To the best of our knowledge, we are the first to perform prompt tuning on a single test sample in a zero-shot manner.
|
| 31 |
+
• We introduce confidence selection as a simple plug-and-play module of TPT for image classification. It improves entropy minimization among augmented views by filtering out “noisy" augmentations that lead to low-confidence predictions.
|
| 32 |
+
• We conduct extensive experiments on image classification under natural distribution shift, crossdataset generalization, and context-dependent visual reasoning. TPT improves CLIP in a zero-shot manner to be on par with prompt tuning methods that require additional training data.
|
| 33 |
+
|
| 34 |
+
# 2 Related Work
|
| 35 |
+
|
| 36 |
+
Prompting for foundation models. Foundation models are those trained on large-scale heterogeneous data, of which the knowledge can be transferred to various downstream tasks in natural language processing [18, 19], computer vision [1, 2, 20], etc. Recent work has proposed different ways to efficiently and effectively transfer such knowledge to downstream task [21–24]. Prompting is a heuristic way to directly apply foundation models to downstream tasks in a zero-shot manner. Prompt works as a part of the text input that instructs the model to perform accordingly on a specific task. However, such zero-shot generalization is highly dependent on a well-designed prompt. Prompt tuning [12, 25–27] proposes to learn the prompt from downstream data in the continual input embedding space, which presents a parameter-efficient way of fine-tuning foundation models. Although initially developed for language models, prompt tuning has later been applied to other domains, including vision-language models [28, 15, 29] and continual learning [30]. CoOp[28] applies prompt tuning to CLIP. By tuning the prompt on a collection of training data, CoOp effectively improves CLIP’s performance on the corresponding downstream tasks. CoCoOp [15] points out that CoOp lacks in generalization to out-of-distribution data, and proposes to alleviate the problem by making the prompt conditioned on model inputs. Despite being effective on the given task, this line of work requires access to downstream training data with annotations, restricting the zero-shot knowledge transfer of foundation models. Another line of work proposes to tune the prompt in an unsupervised manner [31, 32]. However, it requires access to multiple samples from either the training or testing split. In this work, we propose test-time prompt tuning that works on a single test sample. Our method can directly work with the zero-shot applications of foundation models.
|
| 37 |
+
|
| 38 |
+
Generalization under data distribution shifts. A reliable machine learning model is supposed to perform well under data distribution shifts for real-world applications. For a model trained on a given set of data, distribution shift refers to the discrepancy between the underlying distributions of the test and the training data. Distribution shifts can occur naturally in the real world due to variations in the environment [33] or the encounter of unseen concepts [34]. For example, in the meta-learning literature [35], each test sample consists of a novel task (i.e., distribution), and the models should be able to quickly adapt to the novel distributions. Even in the standard evaluation protocol for machine learning models, there exists a subtle difference in the data distribution between the training and testing splits [36, 37], which is also one type of distribution shift. Pre-trained vision-language models like CLIP can generalize to downstream tasks with various distribution shifts in a zero-shot manner. Such zero-shot generalization ability presents a promising direction for realizing reliable and generic machine learning models. Our method aims to improve CLIP towards a better generic model in this work, instead of adapting it to specific downstream tasks or target datasets. We leverage the assumption that a robust model should have decision boundaries lying in low-density data regions [38]. Consistency-regularization-based methods [39, 20] achieve this goal by making the network outputs invariant to small input noises. For classification tasks, we use consistency regularization as our test-time prompt tuning objective with the confidence selection module.
|
| 39 |
+
|
| 40 |
+
Test-time optimization. The idea of adapting machine learning models to test samples on the fly has been applied to different tasks [40–43]. This work mainly focuses on applying the technique to improve model generalization. One challenge in this area is to design a practical test-time objective. Test-time training and its variants [44, 45] modify the training objective and the network architecture by adding a self-supervised multi-task branch, which will then be used at test time for computing optimization objectives and adapts the network to the test sample. Entropy minimization is another common technique for developing self-supervised objectives [46, 47]. TENT [48] performs test-time optimization by minimizing the entropy of the batch-wise prediction probability distributions, but it needs more than one test sample to get a non-trivial solution. Zhang et al. [49] propose marginal entropy minimization that works on a single test sample with data augmentations. Another major challenge is to choose the right parameter group for optimization. Batch normalization (BN) layers have been shown to capture the domain discrepancies in image data [50, 51]. It is a straightforward way to directly adapt the BN statistics at test time to enhance model robustness against distribution shifts [52]. However, adapting BN layers puts restrictions on model architectures. Another choice is to update the feature extractor while freezing the prediction module [44, 53]. Zhang et al. [49] show that optimizing the entire model at test time can work as well. Our method addresses both of the challenges above. For the choice of parameter group, we optimize the text prompt while keeping the model intact. Our motivation is to avoid distorting the pre-trained features and to preserve the zero-shot generalization ability of pre-trained models. In section 5, we empirically show that the prompt works as the most effective parameter group for CLIP. Different from the previous single-point method [49], we refine the entropy minimization by proposing confidence selection, which helps filter out noisy augmentations that may lead to misleading predictions.
|
| 41 |
+
|
| 42 |
+
# 3 TPT: Test-Time Prompt Tuning
|
| 43 |
+
|
| 44 |
+
In this section, we first discuss how to apply CLIP to downstream tasks in a zero-shot manner with a hand-crafted prompt. Next, we briefly review recent progress in prompt tuning approaches for CLIP using downstream training data. Finally, we give detailed introductions of how to apply our method to the image classification task and context-dependent visual reasoning, respectively.
|
| 45 |
+
|
| 46 |
+
# 3.1 Background
|
| 47 |
+
|
| 48 |
+
Contrastive Language-Image Pre-training (CLIP). CLIP consists of two parallel encoders, one that maps the text input into a feature vector, and the other does the same for the image input. The model is trained with a contrastive loss that promotes similarity between the two vectors so that the text and image align in the feature space. We denote a CLIP model as $\mathcal { F } = \{ \mathbf { E } _ { \mathrm { v i s u a l } } , \mathbf { E } _ { \mathrm { t e x t } } \}$ , with ${ \bf E } _ { \tt v i s u a l }$ and $\mathbf { E } _ { \mathrm { t e x t } }$ being the image and text encoders.
|
| 49 |
+
|
| 50 |
+
We first review how to apply CLIP to downstream tasks in a zero-shot manner with a hand-crafted prompt. We take image classification as an example. Consider a single test image $X _ { t e s t }$ of class $y$ , where $\boldsymbol { X } \in \mathbb { R } ^ { C \times H \times W }$ and $y \in \mathbb { R } ^ { K }$ for a $K$ -class classification problem. In the baseline zeroshot setting, we prepend a hand-crafted prompt prefix, such as $\pmb { p } = ^ { 6 6 } \mathbf { a }$ photo of a", to every $y _ { i }$ in $\mathcal { V } = \{ y _ { 1 } , \bar { y } _ { 2 } , \dots , \bar { y } _ { K } \}$ to form the category-specific text inputs $\{ p ; y _ { i } \}$ . We then feed these class descriptions to the text encoder to get the text features $\{ t _ { 1 } , t _ { 2 } , \ldots , t _ { K } \}$ , where $t _ { i } = \mathbf { E _ { t e x t } } ( \{ p ; y _ { i } \} )$ . Each text feature $\mathbf { \Delta } _ { t _ { i } }$ is paired with the image feature ${ \pmb v } = { \bf E } _ { \mathtt { v i s u a l } } ( X )$ to compute a similarity score $\pmb { s } _ { i } = \mathbf { s } \mathrm { i m } ( t _ { i } \cdot v )$ , where $\mathbf { s i m } ( , )$ denotes the cosine similarity. The prediction probability on $X$ can be denoted by $\begin{array} { r } { p ( y _ { i } | X ) = \frac { \exp ( \sin ( t _ { i } \cdot v ) \tau ) } { \sum _ { i = 1 } ^ { K } \exp ( \sin ( t _ { i } \cdot v ) \tau ) } } \end{array}$ , where $\tau$ is the temperature of the softmax function.
|
| 51 |
+
|
| 52 |
+
Prompt tuning using downstream training data. Instead of using a hand-crafted prompt, prompt tuning methods train a prompt to maximize performance on a downstream task for which labeled data is available. Prompt tuning optimizes the prompt $\pmb { p } \in \mathbb { R } ^ { L \times D }$ in the text embedding space, with the number of tokens $L$ and embedding size $D$ , using training data with annotations $\bar { \mathcal { D } _ { \mathrm { t r a i n } } } \bar { = } \{ ( X _ { i } , y _ { i } ) \}$ from the downstream task. The goal is to obtain text inputs $\{ p ; \mathcal { V } \} = \{ \{ p ; y _ { i } \}$ for $y _ { i } \in \mathcal { V } \}$ that can provide the model with the most helpful context information about the task. For image classification with cross-entropy loss $\mathcal { L }$ , the problem can be formulated as:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
p ^ { * } = \arg \operatorname* { m i n } _ { p } \mathbb { E } _ { ( X , y ) \sim \mathcal { D } _ { \mathrm { t r a i n } } } \mathcal { L } ( \mathcal { F } _ { p } ( X ) , y ) ,
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
Context-dependent visual reasoning. For the task of context-dependent visual reasoning, such as Bongard-HOI [16], a test sample contains two sets of support images and a query image for evaluation. The two sets of support images exemplify the presence and the absence of a human-object interaction (HOI) concept (e.g., “ride bike"). The model is then asked to infer whether the query image contains the underlying concept. Specifically, each concept in this task is a visual relationship $c = \langle s , a , o \rangle$ , with $s$ being the subject ( $s = \cdot$ “human" for HOI tasks), $a$ denoting the action and $o$ for the object. Each test sample $X _ { \mathrm { t e s t } }$ captures a concept by presenting $c = \langle s , a , o \rangle$ in one set of support images (positive examples), while having the other set (negative examples) to demonstrate $\bar { c ^ { \prime } } \overset { \cdot } { = } \langle s , a ^ { \prime } , \overset { \cdot } { o } \rangle$ , where $\boldsymbol { a } ^ { \prime } \neq \boldsymbol { a }$ . Note that neither $o$ nor $a$ is given explicitly, and it relies on the model’s reasoning ability to predict whether the query image contains the featured concept $c$ of the test sample.
|
| 59 |
+
|
| 60 |
+
Existing methods [54, 55] approach the Bongard-HOI problem by training the model on a collection of similar tasks (using the Bongard-HOI training split) so that it can make similar inferences on test samples at test time. When applying CLIP to this task, we do not use additional training data because CLIP has learned abundant visual concepts and thus is a natural fit for such visual reasoning tasks.
|
| 61 |
+
|
| 62 |
+
# 3.2 TPT: Test-Time Prompt Tuning
|
| 63 |
+
|
| 64 |
+
Why optimize prompts? CLIP contains rich knowledge obtained from pre-training on a massive and diverse dataset. However, how to more effectively extract such knowledge remains an open question. A simple strategy is to directly fine-tune the model, either end-to-end or for a subset of layers, on a category of inputs. However, previous work has shown that such fine-tuning strategies result in domain-specific behaviors that lose the out-of-distribution generalization and robustness of foundation models [13, 56]. Prompts, on the other hand, work outside the pre-trained model by modifying the context of the model input, thus do not distort pre-trained features.
|
| 65 |
+
|
| 66 |
+
In this work, our goal is to leverage the existing knowledge of CLIP to boost its generalization in a zero-shot manner. Therefore, prompt tuning serves as an ideal handle to approach the goal. Furthermore, we regard test-time prompt tuning as a way to provide the model with the context tailored to the single test sample, which helps precisely retrieve the knowledge of CLIP.
|
| 67 |
+
|
| 68 |
+
At the inference stage, the only information available is the single test sample $X _ { \mathrm { t e s t } }$ without label information. TPT, therefore, manages to optimize the prompt $\pmb { p }$ at test time based on the single test sample. In general, our objective can be formulated in the form of
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\pmb { p } ^ { * } = \arg \operatorname* { m i n } _ { \pmb { p } } \mathcal { L } ( \mathcal { F } , \pmb { p } , X _ { \mathrm { t e s t } } )
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
for some carefully constructed loss. Note that, unlike equation (1), our method does not require any labels or any data beyond the zero-shot test sample.
|
| 75 |
+
|
| 76 |
+
TPT for image classification. Because labels are not available for test time tuning, we must select an unsupervised loss for prompt tuning. We design our TPT objective to promote the consistency of the model’s predictions across different augmented views of a given test image. Specifically, we generate $N$ randomly augmented views of the test image using a family of random augmentations $\mathcal { A }$ and minimize the entropy of the averaged prediction probability distribution:
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\begin{array} { r } { p ^ { * } = \underset { \ b { p } } { \arg \operatorname* { m i n } } - \underset { i = 1 } { \overset { K } { \sum } } \tilde { p } _ { \ b { p } } ( y _ { i } | \boldsymbol { X } _ { \mathrm { t e s t } } ) \log \tilde { p } _ { \ b { p } } ( y _ { i } | \boldsymbol { X } _ { \mathrm { t e s t } } ) , } \\ { \mathrm { w h e r e \ } \tilde { p } _ { \ b { p } } ( y _ { i } | \boldsymbol { X } _ { \mathrm { t e s t } } ) = \underset { i = 1 } { \overset { 1 } { \prod } } p _ { \ b { p } } ( y _ { i } | \boldsymbol { A } _ { i } ( \boldsymbol { X } _ { \mathrm { t e s t } } ) ) . } \end{array}
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
Here, $p _ { p } ( y | \mathcal { A } _ { i } ( X _ { \mathrm { t e s t } } ) )$ is the vector of class probabilities produced by the model when provided with prompt $\pmb { p }$ and the $i$ -th augmented view of the test image.
|
| 83 |
+
|
| 84 |
+
In addition, to reduce the noise from random augmentations, we propose confidence selection to filter out views that generate high-entropy (i.e., low-confidence) predictions. Such views of an image may lack important information needed to classify it correctly, e.g., a random crop may have removed important image content. We select confident samples with a prediction entropy below a threshold $\tau$ . We adapt $\tau$ for each test sample, by taking the entropy value at the $\rho$ -percentile among the self-entropy of $N$ augmented views ranked from low to high (i.e., confidence from high to low). With $\tau$ , the confidence selection can be written as a mask over the augmented samples $\begin{array} { r } { \mathbb { 1 } [ \mathbf { H } ( p _ { i } ) \leq \tau ] } \end{array}$ , with $\mathbf { H }$ measuring the self-entropy of the prediction on an augmented view. Using confidence selection with a cutoff percentile $\rho$ on $N$ augmented views, the averaged probability in Eq. (4) now becomes:
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\tilde { p } _ { p ( y | X _ { \mathrm { t e s t } } ) } = \frac { 1 } { \rho N } \sum _ { i = 1 } ^ { N } \mathbb { 1 } [ \mathbf { H } ( p _ { i } ) \leq \tau ] p _ { p } ( y | A _ { i } ( X _ { \mathrm { t e s t } } ) ) ,
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
TPT for context-dependent visual reasoning. Different from image classification, where every image has one and only ground-truth label, the correctness of the prediction in Bongard-HOI depends on the context (i.e., example images), which is binary (containing the concept $c$ or not). In the case of binary labels, a straightforward prompting strategy is to hand-craft “labels" for positive and negative examples, such as “True/False" or “Yes/No". With TPT, on the other hand, we can directly learn an optimal label token $_ { c l s }$ on the example images in the test sample. More importantly, for visual reasoning, TPT can explicitly learn the context (i.e., visual concept) in the form of text prompts, and assists visual reasoning of vision-language models with language context. Formally, given $M$ support images in each test sample, the TPT objective for context-dependent reasoning can be written as:
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
p ^ { * } = \arg \operatorname* { m i n } _ { p , c l s } \frac { 1 } { M } \sum _ { X \in \{ X p , X _ { \cal N } \} } \mathcal { L } ( \mathcal { F } _ { c , c l s } ( X ) , y ) ,
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
where we assign $y \in \{ 0 , 1 \}$ to negative and positive example images respectively for computing the cross-entropy loss $\mathcal { L }$ . Unlike in image classification, we tune the binary label tokens $^ { c l s } =$ $\{ c l s ^ { 1 } , c l s ^ { 2 } \}$ , $\boldsymbol { c } \dot { l } \boldsymbol { s } ^ { i } \in \mathbb { R } ^ { 1 , D }$ and prompt $\pmb { p } \in \mathbb { R } ^ { L , D }$ simultaneously. For each image, we assemble the text input to CLIP as $T = \{ T _ { 1 } , T _ { 2 } | T _ { i } = \{ p , c l s ^ { i } \} \}$ .
|
| 97 |
+
|
| 98 |
+
Note that the support set is an essential part of a Bongard-HOI sample, which provides the context for this context-dependent task. Therefore, our approach is still considered to work purely at test time, without training data or annotations (i.e., TPT has not been trained on a collection of similar tasks from the Bongard-HOI training split).
|
| 99 |
+
|
| 100 |
+
# 4 Experiments
|
| 101 |
+
|
| 102 |
+
In this section, we describe the tasks and benchmarks used for evaluating our method, along with the implementation details. Our main results cover three aspects of the model’s generalization: robustness to natural distribution shifts, cross-dataset generalization, and context-dependent visual reasoning. We also provide ablation experiments in section 5, analyzing different network components for test-time tuning, and other design choices of our method.
|
| 103 |
+
|
| 104 |
+
# 4.1 Robustness to Natural Distribution Shifts
|
| 105 |
+
|
| 106 |
+
Datasets. CLIP has been shown to be robust to distribution shifts that can occur naturally in realworld scenarios. We follow the setting in Radford et al. [1] and evaluate the model’s robustness to natural distribution shifts on 4 ImageNet Variants as follows, which have been considered as out-of-distribution (OOD) data for ImageNet [57] in previous work.
|
| 107 |
+
|
| 108 |
+
• ImageNet-V2 [58] is a independent test set containing natural images, collected from different source, including 10,000 images of 1,000 ImageNet categories.
|
| 109 |
+
• ImageNet-A [59] is a challenging test set of “natural adversarial examples" misclassified by a standard ResNet-50 [60], consisting of 7,500 images of 200 of ImageNet categories.
|
| 110 |
+
• ImageNet-R [14] collects images of ImageNet categories but with artistic renditions. There are
|
| 111 |
+
30,000 images in total, including 200 ImageNet categories.
|
| 112 |
+
• ImageNet-Sketch [61] is a dataset of black and white sketches, collected independently from the original ImageNet validation set. The dataset includes 50,000 images in total, covering 1,000 ImageNet categories.
|
| 113 |
+
|
| 114 |
+
Baselines. We compare TPT with existing few-shot prompt tuning methods that are designed for CLIP. CoOp [28] is a few-shot prompt tuning baseline that tunes a fixed dataset-specific prompt on each downstream dataset. CoCoOp [15] is the state-of-the-art prompt tuning method for CLIP. It produces input-dependent prompts with a network module, of which the input is the image feature. The network module of CoCoOp is also trained on downstream data in a dataset-specific way.
|
| 115 |
+
|
| 116 |
+
Following their original configuration, we train both methods on ImageNet using 16-shot training data per category with 4 learnable prompt tokens and directly test the tuned prompt on OOD benchmarks. We also include two versions of the baseline zero-shot performance of CLIP, using a default prompt “a photo of a", and the ensemble of 80 hand-crafted prompts from Radford et al. [1].
|
| 117 |
+
|
| 118 |
+
Implementation details. For TPT, we initialize the prompt as the default hand-crafted one “a photo of a", and optimize the corresponding 4 tokens in the text input embedding space based on a single test image. We augment a single test image 63 times using random resized crops and construct a batch of 64 images, including the original one. Among the 64 predictions, we select the top $10 \%$ $( \rho { = } 0 . 1 )$ confident samples (lowest $10 \%$ in self-entropy) and compute the entropy of the averaged probability of the selected predictions (i.e., marginal entropy). We optimize the prompt to minimize the marginal entropy for 1 step, using the AdamW optimizer with a learning rate of 0.005.
|
| 119 |
+
|
| 120 |
+
Results. In Table 1, the standalone TPT achieves higher accuracy than both prompt ensemble and existing few-shot prompt tuning methods, including CoCoOp. Furthermore, since TPT works at test time, it is complementary to existing baseline methods. We show that by applying TPT to prompts learned by $\mathrm { C o O p }$ or CoCoOp, we can further improve the accuracy of their in-domain ImageNet data, as well as generalization ability to OOD data. We also compare TPT to the ensembles of baseline models in Appendix A.3, where we find that applying TPT to baseline methods can bring more substantial improvement than model ensembles. In addition, among the five datasets, few-shot prompt tuning methods bring the most accuracy gain on the ImageNet validation set and ImageNet-V2. However, on datasets with more significant distribution shifts, few-shot prompt tuning methods trained on ImageNet show no advantage over the ensemble of hand-crafted prompts.
|
| 121 |
+
|
| 122 |
+
Table 1: Robustness to Natural Distribution Shifts. CoOp and $\mathrm { C o C o O p }$ are tuned on ImageNet using 16-shot training data per category. Baseline CLIP, prompt ensemble, and TPT do not require training data.
|
| 123 |
+
|
| 124 |
+
<table><tr><td>Method</td><td>ImageNet Topl acc. ↑</td><td>ImageNet-A Topl acc.↑</td><td>ImageNet-V2. Topl acc.↑</td><td>ImageNet-R. Topl acc.↑</td><td>ImageNet-Sketch Topl acc.↑</td><td>Average</td><td>OOD Average</td></tr><tr><td>CLIP-RN50</td><td>58.16</td><td>21.83</td><td>51.41</td><td>56.15</td><td>33.37</td><td>44.18</td><td>40.69</td></tr><tr><td>Ensemble</td><td>59.81</td><td>23.24</td><td>52.91</td><td>60.72</td><td>35.48</td><td>46.43</td><td>43.09</td></tr><tr><td>CoOp</td><td>63.33</td><td>23.06</td><td>55.40</td><td>56.60</td><td>34.67</td><td>46.61</td><td>42.43</td></tr><tr><td>CoCoOp</td><td>62.81</td><td>23.32</td><td>55.72</td><td>57.74</td><td>34.48</td><td>46.81</td><td>42.82</td></tr><tr><td>TPT</td><td>60.74</td><td>26.67</td><td>54.70</td><td>59.11</td><td>35.09</td><td>47.26</td><td>43.89</td></tr><tr><td>TPT +CoOp</td><td>64.73</td><td>30.32</td><td>57.83</td><td>58.99</td><td>35.86</td><td>49.55</td><td>45.75</td></tr><tr><td>TPT+CoCoOp</td><td>62.93</td><td>27.40</td><td>56.60</td><td>59.88</td><td>35.43</td><td>48.45</td><td>44.83</td></tr><tr><td>CLIP-ViT-B/16</td><td>66.73</td><td>47.87</td><td>60.86</td><td>73.98</td><td>46.09</td><td>59.11</td><td>57.20</td></tr><tr><td>Ensemble</td><td>68.34</td><td>49.89</td><td>61.88</td><td>77.65</td><td>48.24</td><td>61.20</td><td>59.42</td></tr><tr><td>CoOp</td><td>71.51</td><td>49.71</td><td>64.20</td><td>75.21</td><td>47.99</td><td>61.72</td><td>59.28</td></tr><tr><td>CoCoOp</td><td>71.02</td><td>50.63</td><td>64.07</td><td>76.18 77.06</td><td>48.75</td><td>62.13</td><td>59.91</td></tr><tr><td>TPT</td><td>68.98</td><td>54.77</td><td>63.45 66.83</td><td>77.27</td><td>47.94 49.29</td><td>62.44 64.99</td><td>60.81</td></tr><tr><td>TPT+CoOp</td><td>73.61</td><td>57.95</td><td></td><td>78.65</td><td></td><td></td><td>62.83</td></tr><tr><td>TPT+CoCoOp</td><td>71.07</td><td>58.47</td><td>64.85</td><td></td><td>48.47</td><td>64.30</td><td>62.61</td></tr></table>
|
| 125 |
+
|
| 126 |
+
# 4.2 Cross-Datasets Generalization
|
| 127 |
+
|
| 128 |
+
Pre-trained vision-language models like CLIP are ideal for “open-world" problems. For example, we can apply CLIP to classify arbitrary categories in a zero-shot manner in image classification.. However, a prompt tuned on a specific downstream dataset can be less generalizable to categories outside its training set. In this section, we evaluate the cross-dataset generalization of existing few-shot prompt tuning methods (same as in section 4.1), and compare them with TPT, which is not dataset-specific.
|
| 129 |
+
|
| 130 |
+
Setup. We conduct a cross-dataset evaluation on the task of image classification. We consider 10 datasets, covering fine-grained classifications including species of plants or animals (Flower102 [62], OxfordPets [63]), scenes (SUN397 [64]), textures (DTD [65]), food (Food101 [66]), transportation (StanfordCars [67], Aircraft [68]), human actions (UCF101 [69]), satellite images (EuroSAT [70]), and general objects (Caltech101 [71]). We consider two different settings of cross-dataset generalization. In the first setting, we consider ImageNet with 1000 categories as a comprehensive source dataset, and use other fine-grained datasets as target datasets for evaluation. We implement CoOp and CoCoOp using the same setting as in section 4.1, and evaluate their generalization performance to the 10 datasets. In the second setting, we consider a more challenging scenario, where the source data for few-shot prompt tuning also comes from the specialized fine-grained datasets, and there is no overlapping in categories between a source-target pair.
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 2: Cross-dataset improvement normalized by the zero-shot baseline performance. In each matrix $A$ , $A _ { i , j }$ is the normalized relative improvement on the $j _ { t h }$ dataset of using the prompt tuned on the $i$ -th dataset. The value $A _ { i , j }$ stands for how well a method trained on a source dataset $i$ performs on a target dataset $j$ , in comparison with a zero-shot CLIP baseline (using a hand-crafted prompt). Thus, the higher, the better. The last row is the performance of TPT, which is not tuned on any source dataset. The last column summarizes the average improvement over 10 datasets, measuring the overall generalization ability across the 10 datasets.
|
| 134 |
+
|
| 135 |
+
Implementation details. We implement CoOp and CoCoOp on each source dataset following their original configurations. For TPT, we initialize the prompt as “a photo of a" for every datasets. We adopt the same hyper-parameter setting as in section 4.1. We use AugMix [72] as a stronger data augmentation for this task.
|
| 136 |
+
|
| 137 |
+
Table 2: Cross-dataset generalization from ImageNet to fine-grained classification datasets. $\mathrm { C o O p }$ and $\mathbf { C o C o O p }$ are tuned on ImageNet using 16-shot training data per category. Baseline CLIP, prompt ensemble, and TPT do not require training data or annotations. We report the top-1 classification accuracy on each dataset.
|
| 138 |
+
|
| 139 |
+
<table><tr><td rowspan="2">Method</td><td colspan="10"></td><td rowspan="2">Average</td></tr><tr><td>Flower102</td><td>DTD</td><td>Pets</td><td>Cars</td><td>UCF101</td><td>Caltech101</td><td>Food101</td><td>SUN397</td><td>Aircraft</td><td>EuroSAT</td></tr><tr><td>CLIP-RN50</td><td>61.75</td><td>40.37</td><td>83.57</td><td>55.70</td><td>58.84</td><td>85.88</td><td>73.97</td><td>58.80</td><td>15.66</td><td>23.69</td><td>55.82</td></tr><tr><td>Ensemble</td><td>62.77</td><td>40.37</td><td>82.97</td><td>55.89</td><td>59.48</td><td>87.26</td><td>74.82</td><td>60.85</td><td>16.11</td><td>25.79</td><td>56.63</td></tr><tr><td>CoOp</td><td>61.55</td><td>37.29</td><td>87.00</td><td>55.32</td><td>59.05</td><td>86.53</td><td>75.59</td><td>58.15</td><td>15.12</td><td>26.20</td><td>56.18</td></tr><tr><td>CoCoOp</td><td>65.57</td><td>38.53</td><td>88.39</td><td>56.22</td><td>57.10</td><td>87.38</td><td>76.20</td><td>59.61</td><td>14.61</td><td>28.73</td><td>57.23</td></tr><tr><td>TPT</td><td>62.69</td><td>40.84</td><td>84.49</td><td>58.46</td><td>60.82</td><td>87.02</td><td>74.88</td><td>61.46</td><td>17.58</td><td>28.33</td><td>57.66</td></tr><tr><td>CLIP-ViT-B/16</td><td>67.44</td><td>44.27</td><td>88.25</td><td>65.48</td><td>65.13</td><td>93.35</td><td>83.65</td><td>62.59</td><td>23.67</td><td>42.01</td><td>63.58</td></tr><tr><td>Ensemble</td><td>66.99</td><td>45.04</td><td>86.92</td><td>66.11</td><td>65.16</td><td>93.55</td><td>82.86</td><td>65.63</td><td>23.22</td><td>50.42</td><td>64.59</td></tr><tr><td>CoOp</td><td>68.71</td><td>41.92</td><td>89.14</td><td>64.51</td><td>66.55</td><td>93.70</td><td>85.30</td><td>64.15</td><td>18.47</td><td>46.39</td><td>63.88</td></tr><tr><td>CoCoOp</td><td>70.85</td><td>45.45</td><td>90.46</td><td>64.90</td><td>68.44</td><td>93.79</td><td>83.97</td><td>66.89</td><td>22.29</td><td>39.23</td><td>64.63</td></tr><tr><td>TPT</td><td>68.98</td><td>47.75</td><td>87.79</td><td>66.87</td><td>68.04</td><td>94.16</td><td>84.67</td><td>65.50</td><td>24.78</td><td>42.44</td><td>65.10</td></tr></table>
|
| 140 |
+
|
| 141 |
+
Results. In Table 2, we compare TPT with few-shot prompt tuning methods on generalization from ImageNet to fine-grained datasets. Note that TPT works in a zero-shot manner; thus it is not trained on ImageNet. Nonetheless, we find TPT to achieve on-par generalization as ImageNet trained $\mathrm { C o C o O p }$ . In Figure 2, we present the results of the more challenging setting of cross-dataset generalization, where there is no overlap between the source and target dataset. For better visualization, we plot the relative accuracy improvement $a c c ^ { \prime } = ( a c c - a c c _ { b a s e } ) / a c c _ { b a s e }$ , normalized by the zero-shot baseline accuracy $a c c _ { b a s e }$ of a CLIP-RN50. For example, baseline CLIP with a hand-crafted prompt achieves $6 1 . 7 5 \%$ accuracy on Flower102, while CoOp trained on DTD only has $3 3 . 4 1 \%$ on Flower102. In this case, we calculate $a c c ^ { \prime }$ as $( 3 3 . 4 1 - 6 1 . 7 5 ) / 6 1 . 7 5 = - 0 . 4 6$ . From Figure 2, we can see that the averaged accuracy improvement (in the last column of each matrix) of few-shot prompt tuning methods is always negative, meaning that they do worse than the zero-shot baseline. TPT, on the other hand, shows consistent improvement in each of the 10 datasets.
|
| 142 |
+
|
| 143 |
+
# 4.3 Context-dependent Visual Reasoning on Bongard-HOI
|
| 144 |
+
|
| 145 |
+
Baselines. We include three previous methods for comparison: (1) The CNN-baseline [54] is a simple classifier trained on Bongard-HOI training data, for which the model is trained to map a training sample as a whole (including the support and query images) to a binary output, indicating whether the query image contains the corresponding concept; (2) The Meta-baseline [55] regards each sample in Bongard-HOI as a few-shot task and the model is trained on the Bongard-HOI training data with a meta-objective that aims to quickly adapt the model to new tasks; (3) HOITrans [17] is the previous best method on Bongard-HOI. It is a transformer-based HOI detection model that achieves state-of-the-art accuracy on various HOI detection benchmarks. It solves Bongard-HOI by comparing the detected HOIs of the query images to those of the support images.
|
| 146 |
+
|
| 147 |
+
Table 3: Evaluation on the Bongard-HOI benchmark. CNN and Meta baselines are implemented based on a ResNet-50 (RN50). $^ *$ denotes that the method uses ground truth bounding boxes to assist the inference.)
|
| 148 |
+
|
| 149 |
+
<table><tr><td rowspan="2">Method</td><td colspan="4">Test Splits</td><td rowspan="2">Average</td></tr><tr><td>seen act., seen obj.,</td><td>unseen act., seen obj.,</td><td>seen act., unseen obj.,</td><td>unseen act., unseen obj.,</td></tr><tr><td>CNN-baseline</td><td>50.03</td><td>49.89</td><td>49.77</td><td>50.01</td><td>49.92</td></tr><tr><td>Meta-baseline*</td><td>58.82</td><td>58.75</td><td>58.56</td><td>57.04</td><td>58.30</td></tr><tr><td>HOITrans</td><td>59.50</td><td>64.38</td><td>63.10</td><td>62.87</td><td>62.46</td></tr><tr><td>TPT (w/ CLIP-RN50)</td><td>66.39</td><td>68.50</td><td>65.98</td><td>65.48</td><td>66.59</td></tr></table>
|
| 150 |
+
|
| 151 |
+
Implementation details. For each Bongard-HOI test sample, TPT tunes the prompt prefix and class tokens simultaneously from scratch. All learnable tokens are initialized in the text embedding space from a Gaussian distribution with $\sigma = 0 . 0 2$ . We optimize the prompt on all support images of a test sample for 64 steps, using the AdamW optimizer with a learning rate of 0.005, and then infer the query image with the updated prompt. For other baselines, we directly report the results from Jiang et al. [16], and we refer interested readers to this paper for more details. Note that the HOITrans model is trained on all possible HOI concepts, including the ones in the testing splits.
|
| 152 |
+
|
| 153 |
+
Results. In Table 3, we follow the setup in Jiang et al. [16], and compare TPT with previous methods on 4 test splits of Bongard-HOI respectively. In Bongard-HOI, test images are split into four sets by their overlap in the HOI concept with the training data: whether the action $a$ or the object $o$ has appeared in the training data. Note that our CLIP-based TPT is not trained on the training split of Bongard-HOI, and thus the definition of the four splits is not strictly applicable to TPT.
|
| 154 |
+
|
| 155 |
+
# 5 Ablation Study
|
| 156 |
+
|
| 157 |
+
In this section, we analyze our design choices and provide ablation study on the effects of different components of TPT. For simplicity, if not otherwise specified, analyses in this section are conducted on the natural distribution shifts benchmarks. We first compare test-time optimization on different parameter groups of CLIP, showing that prompt tuning achieves the most accuracy gain. Next, we show the improvement brought by confidence selection and analyze how the confidence threshold affects performance. Additional ablation studies can be found in Appendix A.3. We also provide a qualitative study on the effect of TPT on model prediction probability distributions in Appendix A.8.
|
| 158 |
+
|
| 159 |
+
Test-time optimization on different parameter groups of CLIP. Existing test-time optimization methods have worked on different parameter groups of a model. Although there is a strong intuition for tuning prompts on CLIP, it is unclear whether it is the most effective choice. In Figure 3 (a), we evaluate the performance of test-time optimization on different parameter groups of CLIP. We consider four different parameter groups: 1) the entire model, 2) the text encoder, 3) the visual encoder, and 4) the text prompt. For a fair comparison, we adopt the same setup as MEMO [49] by using AugMix [72] as the data augmentation. Confidence selection is not used in this ablation study. For each design choice, we run a grid search for hyper-parameter tuning (on the learning rate and the number of optimization steps) and report the best result.
|
| 160 |
+
|
| 161 |
+
The result suggests that text prompt is the most effective parameter group. In addition, we find optimizing the visual encoder to have the worst result. This observation is in alignment with previous work that suggests fine-tuning the image encoder can distort pre-trained features [73, 56].
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
(a) Test-time optimization on different modules. (b) Different cutoff percentile in confidence selection.
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 3: Ablating the effects of different components of TPT. We evaluate the top-1 accuracy on the distribution shifts benchmarks in section 4.1. Methods are implemented based on a CLIP-RN50.
|
| 168 |
+
|
| 169 |
+
The effect of confidence selection. We present confidence selection as a major component of our method, which filters out “noisy" augmented views that provide little information. In Table 4, we provide the performance of TPT without confidence selection, in comparison with the full method. Confidence selection brings non-trivial performance improvement to our baseline TPT. We further show the effect of confidence threshold $\rho$ in Figure 3 (b). The result suggests that using the top$10 \%$ confident sample leads to the highest average accuracy. In addition, we find that the effect of confidence selection is generalizable to other entropy-based test-time optimization methods. More details about this analysis are included in appendix A.4
|
| 170 |
+
|
| 171 |
+
Table 4: The effect of confidence selection. The last row is the performance of our full method.
|
| 172 |
+
|
| 173 |
+
<table><tr><td>Method</td><td>ImageNet Topl acc.↑</td><td>ImageNet-A Topl acc.↑</td><td>ImageNet-V2. Topl acc.↑</td><td>ImageNet-R. Topl acc.↑</td><td>ImageNet-Sketch Topl acc.个</td><td>Average</td><td>OOD Average</td></tr><tr><td>CLIP-RN50</td><td>58.16</td><td>21.83</td><td>51.41</td><td>56.15</td><td>33.37</td><td>44.18</td><td>40.69</td></tr><tr><td>baseline TPT + confidence selection</td><td>60.31 60.74 (+0.43)</td><td>23.65 26.67 (+3.02)</td><td>53.66 54.70 (+1.04)</td><td>57.48 59.11 (+1.63)</td><td>34.31 35.09 (+0.78)</td><td>45.88 47.26(+1.38)</td><td>42.28 43.89 (+1.61)</td></tr></table>
|
| 174 |
+
|
| 175 |
+
# 6 Conclusion
|
| 176 |
+
|
| 177 |
+
In this work, we investigated how to fully exploit the potential of pre-trained vision-language foundation models as better zero-shot learners. We developed Test-time Prompt Tuning (TPT), a new prompt tuning method that can learn adaptive prompts on the fly with a single test sample. We demonstrated the effectiveness of our method on the robustness to natural distribution shifts and cross-dataset generalization, by using CLIP as the foundation model. Without the need for any training data or annotations, TPT improves the zero-shot generalization ability of CLIP.
|
| 178 |
+
|
| 179 |
+
Limitations. While TPT does not require training data or annotations, our method requires a one-step backpropagation when optimizing the prompt at test time. Since TPT generates multiple augmented views of a single test sample, it increases the memory cost during inference.
|
| 180 |
+
|
| 181 |
+
Future directions. The idea of TPT can be applied to other foundation models for various downstream tasks, including other vision-language models [6, 74] and foundation models of other modalities (e.g., pre-trained large-scale language models [19, 18]) to further boost their zero-shot generalization. The most interesting part of this direction is to design a test-time objective that fits the nature of the model and the downstream task. Besides, it is also interesting to explore how to reduce the memory cost of TPT and make it more computationally efficient.
|
| 182 |
+
|
| 183 |
+
# 7 Acknowledgements
|
| 184 |
+
|
| 185 |
+
Shu and Goldstein were supported by the ONR MURI program and DARPA GARD.
|
| 186 |
+
|
| 187 |
+
References
|
| 188 |
+
[1] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision. In ICML, 2021. 1, 2, 3, 6, 7, 19, 20, 21
|
| 189 |
+
[2] Chao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen, Zarana Parekh, Hieu Pham, Quoc V. Le, YunHsuan Sung, Zhen Li, and Tom Duerig. Scaling up visual and vision-language representation learning with noisy text supervision. In ICML, 2021. 1, 3
|
| 190 |
+
[3] Rishi Bommasani, Drew A Hudson, Ehsan Adeli, Russ Altman, Simran Arora, Sydney von Arx, Michael S Bernstein, Jeannette Bohg, Antoine Bosselut, Emma Brunskill, et al. On the opportunities and risks of foundation models. arXiv preprint arXiv:2108.07258, 2021. 1
|
| 191 |
+
[4] Junke Wang, Dongdong Chen, Zuxuan Wu, Chong Luo, Luowei Zhou, Yucheng Zhao, Yujia Xie, Ce Liu, Yu-Gang Jiang, and Lu Yuan. Omnivl: One foundation model for image-language and video-language tasks. arXiv preprint arXiv:2209.07526, 2022. 1
|
| 192 |
+
[5] Aishwarya Kamath, Mannat Singh, Yann LeCun, Gabriel Synnaeve, Ishan Misra, and Nicolas Carion. MDETR - modulated detection for end-to-end multi-modal understanding. In ICCV, 2021. 1
|
| 193 |
+
[6] Liunian Harold Li, Pengchuan Zhang, Haotian Zhang, Jianwei Yang, Chunyuan Li, Yiwu Zhong, Lijuan Wang, Lu Yuan, Lei Zhang, Jenq-Neng Hwang, Kai-Wei Chang, and Jianfeng Gao. Grounded language-image pre-training. In CVPR, 2022. 10
|
| 194 |
+
[7] Or Patashnik, Zongze Wu, Eli Shechtman, Daniel Cohen-Or, and Dani Lischinski. Styleclip: Text-driven manipulation of stylegan imagery. In ICCV, 2021.
|
| 195 |
+
[8] Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical text-conditional image generation with CLIP latents. CoRR, abs/2204.06125, 2022.
|
| 196 |
+
[9] Zhaowei Cai, Gukyeong Kwon, Avinash Ravichandran, Erhan Bas, Zhuowen Tu, Rahul Bhotika, and Stefano Soatto. X-DETR: A versatile architecture for instance-wise vision-language tasks. CoRR, abs/2204.05626, 2022.
|
| 197 |
+
[10] Tianyi Liu, Zuxuan Wu, Wenhan Xiong, Jingjing Chen, and Yu-Gang Jiang. Unified multimodal pre-training and prompt-based tuning for vision-language understanding and generation. CoRR, abs/2112.05587, 2021.
|
| 198 |
+
[11] Mengde Xu, Zheng Zhang, Fangyun Wei, Yutong Lin, Yue Cao, Han Hu, and Xiang Bai. A simple baseline for zero-shot semantic segmentation with pre-trained vision-language model. CoRR, abs/2112.14757, 2021. 1
|
| 199 |
+
[12] Brian Lester, Rami Al-Rfou, and Noah Constant. The power of scale for parameter-efficient prompt tuning. In EMNLP, 2021. 1, 3
|
| 200 |
+
[13] Mitchell Wortsman, Gabriel Ilharco, Mike Li, Jong Wook Kim, Hannaneh Hajishirzi, Ali Farhadi, Hongseok Namkoong, and Ludwig Schmidt. Robust fine-tuning of zero-shot models. CoRR, abs/2109.01903, 2021. 2, 5
|
| 201 |
+
[14] Dan Hendrycks, Steven Basart, Norman Mu, Saurav Kadavath, Frank Wang, Evan Dorundo, Rahul Desai, Tyler Zhu, Samyak Parajuli, Mike Guo, Dawn Song, Jacob Steinhardt, and Justin Gilmer. The many faces of robustness: A critical analysis of out-of-distribution generalization. In ICCV, 2021. 2, 6, 19
|
| 202 |
+
[15] Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Conditional prompt learning for vision-language models. In CVPR, 2022. 2, 3, 6, 19, 20, 21
|
| 203 |
+
[16] Huaizu Jiang, Xiaojian Ma, Weili Nie, Zhiding Yu, Yuke Zhu, and Anima Anandkumar. Bongard-hoi: Benchmarking few-shot visual reasoning for human-object interactions. In CVPR, 2022. 2, 4, 9
|
| 204 |
+
[17] Cheng Zou, Bohan Wang, Yue Hu, Junqi Liu, Qian Wu, Yu Zhao, Boxun Li, Chenguang Zhang, Chi Zhang, Yichen Wei, and Jian Sun. End-to-end human object interaction detection with HOI transformer. In CVPR, 2021. 2, 9
|
| 205 |
+
[18] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: pre-training of deep bidirectional transformers for language understanding. In NAACL-HLT. Association for Computational Linguistics, 2019. 3, 10
|
| 206 |
+
[19] Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In NeurIPS, 2020. 3, 10
|
| 207 |
+
[20] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey E. Hinton. A simple framework for contrastive learning of visual representations. In ICML, 2020. 3
|
| 208 |
+
[21] Elad Ben Zaken, Shauli Ravfogel, and Yoav Goldberg. Bitfit: Simple parameter-efficient fine-tuning for transformer-based masked language-models. In ACL, 2022. 3
|
| 209 |
+
[22] Renrui Zhang, Rongyao Fang, Wei Zhang, Peng Gao, Kunchang Li, Jifeng Dai, Yu Qiao, and Hongsheng Li. Tip-adapter: Training-free clip-adapter for better vision-language modeling. CoRR, abs/2111.03930, 2021.
|
| 210 |
+
[23] Renrui Zhang, Longtian Qiu, Wei Zhang, and Ziyao Zeng. VT-CLIP: enhancing vision-language models with visual-guided texts. CoRR, abs/2112.02399, 2021.
|
| 211 |
+
[24] Zhecan Wang, Noel Codella, Yen-Chun Chen, Luowei Zhou, Jianwei Yang, Xiyang Dai, Bin Xiao, Haoxuan You, Shih-Fu Chang, and Lu Yuan. CLIP-TD: CLIP targeted distillation for vision-language tasks. CoRR, abs/2201.05729, 2022. 3
|
| 212 |
+
[25] Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation. In ACL/IJCNLP. Association for Computational Linguistics, 2021. 3
|
| 213 |
+
[26] Zhuofeng Wu, Sinong Wang, Jiatao Gu, Rui Hou, Yuxiao Dong, V. G. Vinod Vydiswaran, and Hao Ma. IDPG: an instance-dependent prompt generation method. In NAACL, 2022.
|
| 214 |
+
[27] Zonghan Yang and Yang Liu. On robust prefix-tuning for text classification. In ICLR, 2022. 3
|
| 215 |
+
[28] Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Learning to prompt for vision-language models. CoRR, abs/2109.01134, 2021. 3, 6, 19, 20, 21
|
| 216 |
+
[29] Yu Du, Fangyun Wei, Zihe Zhang, Miaojing Shi, Yue Gao, and Guoqi Li. Learning to prompt for open-vocabulary object detection with vision-language model. In CVPR, 2022. 3
|
| 217 |
+
[30] Zifeng Wang, Zizhao Zhang, Chen-Yu Lee, Han Zhang, Ruoxi Sun, Xiaoqi Ren, Guolong Su, Vincent Perot, Jennifer G. Dy, and Tomas Pfister. Learning to prompt for continual learning. CoRR, abs/2112.08654, 2021. 3
|
| 218 |
+
[31] Tony Huang, Jack Chu, and Fangyun Wei. Unsupervised prompt learning for vision-language models. CoRR, abs/2204.03649, 2022. 3
|
| 219 |
+
[32] Chunting Zhou, Junxian He, Xuezhe Ma, Taylor Berg-Kirkpatrick, and Graham Neubig. Prompt consistency for zero-shot task generalization. CoRR, abs/2205.00049, 2022. 3
|
| 220 |
+
[33] Pang Wei Koh, Shiori Sagawa, Henrik Marklund, Sang Michael Xie, Marvin Zhang, Akshay Balsubramani, Weihua Hu, Michihiro Yasunaga, Richard Lanas Phillips, Irena Gao, Tony Lee, Etienne David, Ian Stavness, Wei Guo, Berton Earnshaw, Imran Haque, Sara M. Beery, Jure Leskovec, Anshul Kundaje, Emma Pierson, Sergey Levine, Chelsea Finn, and Percy Liang. WILDS: A benchmark of in-the-wild distribution shifts. In ICML, 2021. 3
|
| 221 |
+
[34] Akshay Raj Dhamija, Manuel Günther, and Terrance E. Boult. Reducing network agnostophobia. In NeurIPS, 2018. 3
|
| 222 |
+
[35] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Doina Precup and Yee Whye Teh, editors, ICML, 2017. 3
|
| 223 |
+
[36] Dimitris Tsipras, Shibani Santurkar, Logan Engstrom, Alexander Turner, and Aleksander Madry. Robustness may be at odds with accuracy. In ICLR, 2019. 3
|
| 224 |
+
[37] Hongyang Zhang, Yaodong Yu, Jiantao Jiao, Eric P. Xing, Laurent El Ghaoui, and Michael I. Jordan. Theoretically principled trade-off between robustness and accuracy. In ICML, 2019. 3
|
| 225 |
+
[38] Olivier Chapelle and Alexander Zien. Semi-supervised classification by low density separation. In International Workshop on Artificial Intelligence and Statistics, 2005. 3
|
| 226 |
+
[39] Mehdi Sajjadi, Mehran Javanmardi, and Tolga Tasdizen. Regularization with stochastic transformations and perturbations for deep semi-supervised learning. In NIPS, 2016. 3
|
| 227 |
+
[40] Assaf Shocher, Nadav Cohen, and Michal Irani. "zero-shot" super-resolution using deep internal learning. In CVPR, 2018. 3
|
| 228 |
+
[41] David Bau, Hendrik Strobelt, William S. Peebles, Jonas Wulff, Bolei Zhou, Jun-Yan Zhu, and Antonio Torralba. Semantic photo manipulation with a generative image prior. ACM Trans. Graph., 2019.
|
| 229 |
+
[42] Jogendra Nath Kundu, Naveen Venkat, Rahul M. V., and R. Venkatesh Babu. Universal source-free domain adaptation. In CVPR, 2020.
|
| 230 |
+
[43] Yujia Huang, James Gornet, Sihui Dai, Zhiding Yu, Tan M. Nguyen, Doris Y. Tsao, and Anima Anandkumar. Neural networks with recurrent generative feedback. In NeurIPS, 2020. 3
|
| 231 |
+
[44] Yu Sun, Xiaolong Wang, Zhuang Liu, John Miller, Alexei A. Efros, and Moritz Hardt. Test-time training with self-supervision for generalization under distribution shifts. In ICML, 2020. 3, 4
|
| 232 |
+
[45] Yuejiang Liu, Parth Kothari, Bastien van Delft, Baptiste Bellot-Gurlet, Taylor Mordan, and Alexandre Alahi. Tt $^ { + + }$ : When does self-supervised test-time training fail or thrive? In NeurIPS, 2021. 3
|
| 233 |
+
[46] Yves Grandvalet and Yoshua Bengio. Semi-supervised learning by entropy minimization. In NIPS, 2004. 4
|
| 234 |
+
[47] Kuniaki Saito, Donghyun Kim, Stan Sclaroff, Trevor Darrell, and Kate Saenko. Semi-supervised domain adaptation via minimax entropy. In ICCV. IEEE, 2019. 4
|
| 235 |
+
[48] Dequan Wang, Evan Shelhamer, Shaoteng Liu, Bruno A. Olshausen, and Trevor Darrell. Tent: Fully test-time adaptation by entropy minimization. In ICLR, 2021. 4, 19
|
| 236 |
+
[49] Marvin Zhang, Sergey Levine, and Chelsea Finn. MEMO: test time robustness via adaptation and augmentation. CoRR, abs/2110.09506, 2021. 4, 9, 19
|
| 237 |
+
[50] Yanghao Li, Naiyan Wang, Jianping Shi, Jiaying Liu, and Xiaodi Hou. Revisiting batch normalization for practical domain adaptation. In ICLR Workshop, 2017. 4
|
| 238 |
+
[51] Manli Shu, Zuxuan Wu, Micah Goldblum, and Tom Goldstein. Encoding robustness to image style via adversarial feature perturbations. In NeurIPS, 2021. 4
|
| 239 |
+
[52] Steffen Schneider, Evgenia Rusak, Luisa Eck, Oliver Bringmann, Wieland Brendel, and Matthias Bethge. Improving robustness against common corruptions by covariate shift adaptation. In NeurIPS, 2020. 4
|
| 240 |
+
[53] Jian Liang, Dapeng Hu, and Jiashi Feng. Do we really need to access the source data? source hypothesis transfer for unsupervised domain adaptation. In ICML, 2020. 4
|
| 241 |
+
[54] Weili Nie, Zhiding Yu, Lei Mao, Ankit B. Patel, Yuke Zhu, and Anima Anandkumar. Bongardlogo: A new benchmark for human-level concept learning and reasoning. In NeurIPS, 2020. 5, 9
|
| 242 |
+
[55] Yinbo Chen, Xiaolong Wang, Zhuang Liu, Huijuan Xu, and Trevor Darrell. A new meta-baseline for few-shot learning. CoRR, abs/2003.04390, 2020. 5, 9
|
| 243 |
+
[56] Ananya Kumar, Aditi Raghunathan, Robbie Jones, Tengyu Ma, and Percy Liang. Fine-tuning can distort pretrained features and underperform out-of-distribution. CoRR, abs/2202.10054, 2022. 5, 10
|
| 244 |
+
[57] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. ImageNet: A Large-Scale Hierarchical Image Database. In CVPR09, 2009. 6, 19
|
| 245 |
+
[58] Benjamin Recht, Rebecca Roelofs, Ludwig Schmidt, and Vaishaal Shankar. Do imagenet classifiers generalize to imagenet? In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, ICML, 2019. 6, 19
|
| 246 |
+
[59] Dan Hendrycks, Kevin Zhao, Steven Basart, Jacob Steinhardt, and Dawn Song. Natural adversarial examples. In CVPR, pages 15262–15271, 2021. 6, 19
|
| 247 |
+
[60] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016. 6
|
| 248 |
+
[61] Haohan Wang, Songwei Ge, Zachary Lipton, and Eric P Xing. Learning robust global representations by penalizing local predictive power. In NeurIPS, 2019. 6, 19
|
| 249 |
+
[62] Maria-Elena Nilsback and Andrew Zisserman. Automated flower classification over a large number of classes. In Indian Conference on Computer Vision, Graphics and Image Processing, 2008. 7
|
| 250 |
+
[63] Omkar M. Parkhi, Andrea Vedaldi, Andrew Zisserman, and C. V. Jawahar. Cats and dogs. In CVPR, 2012. 7, 19
|
| 251 |
+
[64] J. Xiao, J. Hays, K. A. Ehinger, A. Oliva, and A. Torralba. Sun database: Large-scale scene recognition from abbey to zoo. In IEEE Computer Society Conference on Computer Vision and Pattern Recognition, June 2010. 7, 19
|
| 252 |
+
[65] M. Cimpoi, S. Maji, I. Kokkinos, S. Mohamed, , and A. Vedaldi. Describing textures in the wild. In CVPR, 2014. 7, 19
|
| 253 |
+
[66] Lukas Bossard, Matthieu Guillaumin, and Luc Van Gool. Food-101 – mining discriminative components with random forests. In ECCV, 2014. 7
|
| 254 |
+
[67] Jonathan Krause, Michael Stark, Jia Deng, and Li Fei-Fei. 3d object representations for fine-grained categorization. In ICCV Workshops, 2013. 7, 19
|
| 255 |
+
[68] S. Maji, J. Kannala, E. Rahtu, M. Blaschko, and A. Vedaldi. Fine-grained visual classification of aircraft. Technical report, 2013. 7, 19
|
| 256 |
+
[69] Khurram Soomro, Amir Roshan Zamir, and Mubarak Shah. UCF101: A dataset of 101 human actions classes from videos in the wild. CoRR, abs/1212.0402, 2012. 7
|
| 257 |
+
[70] Patrick Helber, Benjamin Bischke, Andreas Dengel, and Damian Borth. Eurosat: A novel dataset and deep learning benchmark for land use and land cover classification. IEEE J. Sel. Top. Appl. Earth Obs. Remote. Sens., 2019. 7
|
| 258 |
+
[71] Li Fei-Fei, Rob Fergus, and Pietro Perona. Learning generative visual models from few training examples: An incremental bayesian approach tested on 101 object categories. In CVPR Workshops, 2004. 7
|
| 259 |
+
[72] Dan Hendrycks, Norman Mu, Ekin Dogus Cubuk, Barret Zoph, Justin Gilmer, and Balaji Lakshminarayanan. Augmix: A simple data processing method to improve robustness and uncertainty. In ICLR, 2020. 8, 10
|
| 260 |
+
[73] Xiaohua Zhai, Xiao Wang, Basil Mustafa, Andreas Steiner, Daniel Keysers, Alexander Kolesnikov, and Lucas Beyer. Lit: Zero-shot transfer with locked-image text tuning. In CVPR, 2022. 10
|
| 261 |
+
|
| 262 |
+
[74] Junnan Li, Dongxu Li, Caiming Xiong, and Steven C. H. Hoi. BLIP: bootstrapping language-image pre-training for unified vision-language understanding and generation. CoRR, abs/2201.12086, 2022. 10
|
| 263 |
+
|
| 264 |
+
# Checklist
|
| 265 |
+
|
| 266 |
+
The checklist follows the references. Please read the checklist guidelines carefully for information on how to answer these questions. For each question, change the default [TODO] to [Yes] , [No] , or [N/A] . You are strongly encouraged to include a justification to your answer, either by referencing the appropriate section of your paper or providing a brief inline description. For example:
|
| 267 |
+
|
| 268 |
+
• Did you include the license to the code and datasets? [Yes] See Section.
|
| 269 |
+
• Did you include the license to the code and datasets? [No] The code and the data are proprietary.
|
| 270 |
+
• Did you include the license to the code and datasets? [N/A]
|
| 271 |
+
|
| 272 |
+
Please do not modify the questions and only use the provided macros for your answers. Note that the Checklist section does not count towards the page limit. In your paper, please delete this instructions block and only keep the Checklist section heading above along with the questions/answers below.
|
| 273 |
+
|
| 274 |
+
1. For all authors...
|
| 275 |
+
|
| 276 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] See our main results and discussion in Section 4
|
| 277 |
+
(b) Did you describe the limitations of your work? [Yes] See section 6
|
| 278 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] We discuss the social impacts in Appendix A.1
|
| 279 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 280 |
+
|
| 281 |
+
2. If you are including theoretical results...
|
| 282 |
+
|
| 283 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 284 |
+
|
| 285 |
+
3. If you ran experiments...
|
| 286 |
+
|
| 287 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See implementation details in section 4 and the supplemental materials.
|
| 288 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See implementation details in section 4.
|
| 289 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] We include an analysis in Appendix A.3.
|
| 290 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See the supplemental materials.
|
| 291 |
+
|
| 292 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 293 |
+
|
| 294 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 295 |
+
(b) Did you mention the license of the assets? [Yes] We provide the license information in Appendix A.5
|
| 296 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 297 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 298 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 299 |
+
|
| 300 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 301 |
+
|
| 302 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 303 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 304 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/dev/g2YraF75Tj/g2YraF75Tj.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/h0OYV0We3oh/h0OYV0We3oh.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/hFCUPkSSRE/hFCUPkSSRE.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/jlAjNL8z5cs/jlAjNL8z5cs.md
ADDED
|
@@ -0,0 +1,355 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# VISUAL CLASSIFICATION VIA DESCRIPTION FROM LARGE LANGUAGE MODELS
|
| 2 |
+
|
| 3 |
+
Sachit Menon, Carl Vondrick Department of Computer Science Columbia University
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Vision-language models (VLMs) such as CLIP have shown promising performance on a variety of recognition tasks using the standard zero-shot classification procedure – computing similarity between the query image and the embedded words for each category. By only using the category name, they neglect to make use of the rich context of additional information that language affords. The procedure gives no intermediate understanding of why a category is chosen, and furthermore provides no mechanism for adjusting the criteria used towards this decision. We present an alternative framework for classification with VLMs, which we call classification by description. We ask VLMs to check for descriptive features rather than broad categories: to find a tiger, look for its stripes; its claws; and more. By basing decisions on these descriptors, we can provide additional cues that encourage using the features we want to be used. In the process, we can get a clear idea of what features the model uses to construct its decision; it gains some level of inherent explainability. We query large language models (e.g., GPT-3) for these descriptors to obtain them in a scalable way. Extensive experiments show our framework has numerous advantages past interpretability. We show improvements in accuracy on ImageNet across distribution shifts; demonstrate the ability to adapt VLMs to recognize concepts unseen during training; and illustrate how descriptors can be edited to effectively mitigate bias compared to the baseline.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Why does a person recognize a hen in Fig.1? If you had to justify your answer, you might name its beak, describe its feathers, or discuss any number of other traits that we associate with hens. It is easy for people to describe the visual features of categories in words, as well as use these verbal descriptions to aid perception. However, generating such schemata, let alone leveraging them for perceptual tasks, has remained a key challenge in machine learning.
|
| 12 |
+
|
| 13 |
+
Vision-language models (VLMs) trained on large corpora of paired image-text data, such as CLIP (Radford et al., 2021), have seen huge successes recently, dominating image classification. The standard zero-shot classification procedure – computing similarity between the query image and the embedded words for each category, then choosing the highest – has shown impressive performance on many popular benchmarks, such as ImageNet (Russakovsky et al., 2015). Comparing to the word that names a category was a reasonable place to start because these methods can rely on the fact that the word “hen” tends to show up near images of hens on the Internet.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: On the left, we show an example decision by our model in addition to its justification (blue bars). On the right, we show how CLIP classifies this image. Our model does not make the same mistake because it cannot produce a compatible justification with the image (red bars).
|
| 17 |
+
|
| 18 |
+
Despite the advances on classification performance, the large models often make unreasonable mistakes or give undesired answers (Goh et al., 2021). The standard zero-shot method gives us no intermediate understanding (i.e. explanation) of the model’s reasoning process. They often fail to look at cues that a human would use easily, and there is no clear way to get the right cues or provide them to the model.
|
| 19 |
+
|
| 20 |
+
Our key insight is that we can use language as an internal representation for visual recognition, which creates an interpretable bottleneck for computer vision tasks. Instead of querying a VLM with just a category name, the use of language enables us to flexibly compare to any words. If we have an idea what features should be used, we can ask the VLM to check for those features instead of just the class name. To find a hen, look for its beak; its feathers; and more. By basing the decision on these features, we can provide additional cues that encourage looking at the features we want to be used. In the process, we can get a clear idea of what the model uses to make its decision; it is inherently explainable.
|
| 21 |
+
|
| 22 |
+
However, hand-writing these features can be costly, and does not scale to large numbers of classes. We can solve this by requesting help from another model. Large language models (LLMs), such as GPT-3 (Brown et al., 2020), show remarkable world knowledge on a variety of topics. They can be thought of as implicit knowledge bases, noisily condensing the collective knowledge of the Internet in a way that can be easily queried with natural language (Petroni et al., 2019). As people often write about what things look like, this includes knowledge of visual descriptors. We thus can simply ask an LLM, much like a 5-year old asking their parent: what does it look like?
|
| 23 |
+
|
| 24 |
+
We provide an alternative to the current zero-shot classification paradigm with vision-language models, comparing to class descriptors obtained from a large language model instead of just the class directly. This requires no additional training, and does not require substantial computational overhead during inference. By construction, this provides some level of inherent interpretability; we can know an image was labeled a tiger because the model saw its stripes rather than its tail. Rather than compromising performance metrics, our approach improves accuracy across datasets and distribution shifts, achieving a $\sim 4 \mathrm { - } 5 \%$ increase on top-1 ImageNet accuracy.
|
| 25 |
+
|
| 26 |
+
# 2 METHOD
|
| 27 |
+
|
| 28 |
+
# 2.1 PERFORMING CLASSIFICATION WITH DESCRIPTORS
|
| 29 |
+
|
| 30 |
+
Given an image $x$ , our goal is to classify whether a visual category $c$ is present in the image, where we represent a category $c$ through a textual phrase, e.g., “school bus.” To make our model both
|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
Figure 2: (a) The standard vision-and-language model compares image embeddings (white dot) to word embeddings of the category name (colorful dots) in order to perform classification. (b) We instead mine large language models to automatically build descriptors, and perform recognition by comparing to the category descriptors.
|
| 34 |
+
|
| 35 |
+
# School bus
|
| 36 |
+
|
| 37 |
+
# Barber shop
|
| 38 |
+
|
| 39 |
+
# Violin
|
| 40 |
+
|
| 41 |
+
large, yellow vehicle
|
| 42 |
+
the words "school bus" written on the side
|
| 43 |
+
a stop sign that deploys from the side of the bus
|
| 44 |
+
flashing lights on the top of the bus
|
| 45 |
+
large windows
|
| 46 |
+
a building with a large, open storefront
|
| 47 |
+
a barber pole or sign outside the shop
|
| 48 |
+
barber chairs inside the shop
|
| 49 |
+
mirrors on the walls
|
| 50 |
+
shelves or cabinets for storing supplies
|
| 51 |
+
a cash register
|
| 52 |
+
a waiting area for customers
|
| 53 |
+
a stringed instrument
|
| 54 |
+
typically has four strings
|
| 55 |
+
a wooden body
|
| 56 |
+
a neck and fingerboard
|
| 57 |
+
tuning pegs
|
| 58 |
+
a bridge
|
| 59 |
+
a soundpost
|
| 60 |
+
f-holes
|
| 61 |
+
a bow
|
| 62 |
+
|
| 63 |
+
# Shoe store
|
| 64 |
+
|
| 65 |
+
#
|
| 66 |
+
|
| 67 |
+
a building with a sign that says "shoe store" a large selection of shoes in the window shoes on display racks inside the store a cash register a salesperson or customer
|
| 68 |
+
|
| 69 |
+
# Pirate ship
|
| 70 |
+
|
| 71 |
+
#
|
| 72 |
+
|
| 73 |
+
a burger p cheese a bun lettuce tomato onion pickles ketchup mustard
|
| 74 |
+
|
| 75 |
+
a large, sailing vessel
|
| 76 |
+
a flag with a skull and crossbones
|
| 77 |
+
cannons on the deck
|
| 78 |
+
a wooden hull
|
| 79 |
+
portholes
|
| 80 |
+
rigging
|
| 81 |
+
a crow's nest
|
| 82 |
+
|
| 83 |
+
a large, cone-shaped mountain a crater at the top of the mountain lava or ash flowing from the crater a plume of smoke or ash rising from the crater
|
| 84 |
+
|
| 85 |
+
interpretable and editable, we estimate a score for category $c$ through the additive decomposition:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
s ( c , x ) = \frac { 1 } { | D ( c ) | } \sum _ { d \in D ( c ) } \phi ( d , x )
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
where $D ( c )$ is the set of descriptors for the category $c$ and $\phi ( d , x )$ is the log probability that descriptor $d$ pertains to the image $x$ . Our approach will represent the descriptors $d$ also through a natural language sentence; we explain how to obtain these in the next section.
|
| 92 |
+
|
| 93 |
+
This model $s ( c , x )$ will output a high score when the dictionary for the category $D ( c )$ contains many descriptors that highly match the observed image $x$ . Figure 2 illustrates this approach to classification. We use addition so that some descriptors can be missing in the image, and normalize by the number of descriptors for the class to allow different classes to have different numbers of descriptors. Since the descriptors are both additive and expressed in natural language, the model is naturally interpretable. To understand why the model predicts category $c$ , one can simply read which descriptors have a high score.
|
| 94 |
+
|
| 95 |
+
# 2.2 BUILDING DESCRIPTORS
|
| 96 |
+
|
| 97 |
+
For the classifier to work, we need to successfully estimate the descriptors $D ( c )$ of each visual category. We propose to automatically construct this set by prompting a large language model, such as GPT-3, to describe the visual features that distinguish that object category in a photograph. We prompt the language model with the input:
|
| 98 |
+
|
| 99 |
+
Q: What are useful features for distinguishing a {category name} in a photo?
|
| 100 |
+
A: There are several useful visual features to tell there is a {category name} in a photo:
|
| 101 |
+
|
| 102 |
+
where {category name} is substituted for a given $c$ . The generated list then comprises the dictionary $D ( c )$ . Further implementation details can be found in Appendix A.
|
| 103 |
+
|
| 104 |
+
Fig. 3 shows several example descriptor schemata that emerge from generative language pretraining. The descriptors often cover colors, shapes, object parts, counts, and relationships, but can be anything in natural language. While descriptors are closely related to more traditional “attributes,” this flexibility distinguishes them, enabling each category’s descriptors to be rich and nuanced. As we observe in Fig. 3, they can be category-specific, such as the “stop sign” for the “school bus” category, or more general, such as “cash register” for both “shoe store” and “barber shop.”
|
| 105 |
+
|
| 106 |
+
While language models do not have images in their training set, they learn to imitate visual description successfully without visual input. The corpora used to train language models contain descriptions written by people with visual knowledge. These descriptions, aggregated at scale, provide a strong basis for visual recognition.
|
| 107 |
+
|
| 108 |
+
# 2.3 GROUNDING DESCRIPTORS
|
| 109 |
+
|
| 110 |
+
We use vision-language models to visually ground the natural language descriptors generated by the large language models, i.e., CLIP similarity to form $\phi$ . Since descriptors are often relative to their class, we condition descriptors on the class name. For example, a “long tail” for a mouse
|
| 111 |
+
|
| 112 |
+
<table><tr><td></td><td colspan="3">ImageNet</td><td colspan="3">ImageNetV2</td><td colspan="3">CUB</td><td colspan="3">EuroSAT</td></tr><tr><td>Architecture forΦ</td><td>Ours</td><td>CLIP</td><td>△</td><td>Ours</td><td>CLIP</td><td>△</td><td>Ours</td><td>CLIP</td><td>△</td><td>Ours</td><td>CLIP</td><td>△</td></tr><tr><td>ViT-B/32</td><td>62.97</td><td>58.46</td><td>4.51</td><td>55.52</td><td>51.90</td><td>3.62</td><td>52.57</td><td>51.95</td><td>0.62</td><td>48.94</td><td>43.84</td><td>5.10</td></tr><tr><td>ViT-B/16</td><td>68.03</td><td>64.05</td><td>3.98</td><td>61.54</td><td>57.88</td><td>3.66</td><td>57.75</td><td>56.35</td><td>1.40</td><td>48.82</td><td>43.36</td><td>5.46</td></tr><tr><td>ViT-L/14</td><td>75.00</td><td>71.58</td><td>3.42</td><td>69.3</td><td>65.33</td><td>3.97</td><td>63.46</td><td>63.08</td><td>0.38</td><td>48.66</td><td>41.48</td><td>7.18</td></tr><tr><td>ViT-L/14@336px</td><td>76.16</td><td>72.97</td><td>3.19</td><td>70.32</td><td>66.58</td><td>3.74</td><td>65.257</td><td>63.41</td><td>1.847</td><td>48.74</td><td>44.80</td><td>3.94</td></tr><tr><td></td><td colspan="3">Places365</td><td colspan="3">Food101</td><td colspan="3">Oxford Pets</td><td colspan="3">Describable Textures</td></tr><tr><td>ViT-B/32</td><td>39.90</td><td>37.37</td><td>2.52</td><td>83.63</td><td>79.31</td><td>4.32</td><td>83.46</td><td>79.94</td><td>3.52</td><td>44.26</td><td>41.38</td><td>2.87</td></tr><tr><td>ViT-B/16</td><td>40.34</td><td>38.27</td><td>2.07</td><td>88.50</td><td>85.61</td><td>2.90</td><td>86.92</td><td>81.88</td><td>5.04</td><td>45.59</td><td>43.72</td><td>1.86</td></tr><tr><td>ViT-L/14</td><td>40.55</td><td>39.00</td><td>1.55</td><td>92.44</td><td>91.79</td><td>0.65</td><td>92.23</td><td>88.25</td><td>3.98</td><td>54.36</td><td>51.33</td><td>3.03</td></tr><tr><td>ViT-L/14@336px</td><td>41.18</td><td>39.58</td><td>1.59</td><td>93.26</td><td>92.23</td><td>1.03</td><td>91.69</td><td>88.20</td><td>3.49</td><td>54.95</td><td>52.39</td><td>2.55</td></tr></table>
|
| 113 |
+
|
| 114 |
+
Table 1: Accuracy gains over CLIP category name embedding baseline. We see a consistent $\sim 3 \ – 5 \%$ improvement across model sizes for ImageNet and ImageNetV2, as well as up to $\sim 7 \%$ on other datasets from dramatically different domains.
|
| 115 |
+
|
| 116 |
+
will be still shorter than a “short tail” for an elephant. We estimate similarity with text of the form {category_name} which (is/has/etc) {descriptor}. These text embeddings are similar to class prototypes (Snell et al., 2017; Rudin et al., 2021), but instead they are obtained across modalities, as discussed further in the Related Work. If an image belongs to the class, but does not show a particular descriptor, that descriptor is activated less. We show in Section 3.2 that we can nonetheless recognize new categories from descriptors that do not need such reference.
|
| 117 |
+
|
| 118 |
+
# 2.4 CLASSIFICATION AND EXPLANATION
|
| 119 |
+
|
| 120 |
+
Our model is able to discriminate between categories by selecting the one with the highest score:
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\operatorname { a r g m a x } _ { c \in C } s ( c , x )
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
where $C$ is the set of object categories in the dataset. Since the model is required to construct predictions by first estimating descriptor similarities $\phi$ , the model is explainable by construction. We can understand why a model picked one category by reading the descriptors that are activated in an image. The same mechanism allows us to also understand why a category was not selected.
|
| 127 |
+
|
| 128 |
+
# 3 EXPERIMENTS
|
| 129 |
+
|
| 130 |
+
Our experiments explore visual models with language as an internal representation. We show results for explainable object recognition, adaption to novel categories, and the reprogrammability of visual classifiers in order to correct biases and other errors. We quantitatively and qualitatively compare our method against CLIP, which is one of the most established methods for vision-language pretraining. To analyze the capabilities of our approach on real images, we consider a variety of domains, including everyday objects and satellite images.
|
| 131 |
+
|
| 132 |
+
# 3.1 EXPLAINABLE OBJECT RECOGNITION
|
| 133 |
+
|
| 134 |
+
We evaluate our method at the ability to perform image classification while also providing explanations for its decisions. While most interpretability methods come with a compromise on the benchmark performance, we demonstrate in Table 1 that our approach improves on it. Compared to CLIP which compares images to embeddings of class names, our approach improves performance by over $3 \%$ on average for ImageNet, without training on it.Furthermore, the improvements across a range of domains show that the advantages of our method is not limited to everyday object recognition. For example, we achieve up to $\sim 7 \%$ improvement on the EuroSAT dataset for satellite image recognition; $a \sim 2 . 5 \%$ improvement on the Describable Textures dataset for texture recognition; and a $\sim 1 . 2 \%$ improvement on the CUB benchmark for fine-grained classification of birds. This suggests that GPT-3 can provide some useful knowledge even for niche domains.
|
| 135 |
+
|
| 136 |
+
Since there is an inherent bottleneck to first construct linguistic attributes of an image, the method is naturally explainable. Fig. 1 shows several cases where the model justifies its explanation for the prediction. For example, in the top row, CLIP incorrectly classifies the airplane as an albatross, a choice our model disregards because it cannot identify features similar to a bird. Instead, our model correctly identifies there is an airliner because it can identify many features related to airplanes.
|
| 137 |
+
|
| 138 |
+

|
| 139 |
+
Figure 4: (left, in blue) We show example decisions and their justifications from our model. (right, in red) We show the prediction from CLIP, and the justification from our model why it did not select that answer. The bar charts show the descriptor similarity $\phi$ to the image in the CLIP latent space.
|
| 140 |
+
|
| 141 |
+
# 3.2 ACQUIRING AND UTILIZING NOVEL INFORMATION
|
| 142 |
+
|
| 143 |
+
A well-known limitation of machine learning models is that they often perform poorly on data they have not seen during training (Gulrajani & Lopez-Paz, 2020; Jiang et al., 2020; Wortsman et al., 2022; Djolonga et al., 2021). Although foundation models are trained on large portions of the Internet representing a wide variety of data, it is impossible for them to have been trained on concepts that only came into existence after they were trained.
|
| 144 |
+
|
| 145 |
+
In contrast, our approach acquires visual descriptions from a large language model, which allows it to build new classifiers for categories that $\phi$ has not encountered yet. CLIP was originally trained in February 2021, and we added two new categories to the ImageNet validation set that widely appeared on the Internet after this date: a) the Ever Given, which is the ship that blocked the Suez Canal in March 2021 (Wikipedia, 2022a), and b) the game Wordle, an online word game that went viral in January 2022 (Wikipedia, 2022c). For each category, we added five images into the existing validation set of 50, 000 ImageNet images.
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Figure 5: Our retrieved images vs those found by CLIP for concepts popularized after CLIP’s training. If CLIP has not observed a particular text-image association when it was trained, it is bound to fail when retrieving images related to that text na¨ıvely. Our approach queries the large language model to obtain the necessary external information. Incorporating this knowledge provides it cues for what to look for, allowing for successful retrieval of relevant images.
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 6: (left) CLIP only compares to the word ‘wedding’, yielding biased results – it only correctly recognizes the first row. The descriptor-based approach provides a way to address the bias, by expanding the initial set of descriptors (only the top) to be more inclusive with prior knowledge. (right) Modifying the descriptors to be more inclusive causes accuracy to significant improve on sub-groups.
|
| 152 |
+
|
| 153 |
+
We quantify the recall at retrieving these new examples within the top ten detections of the category, and Fig. 5 compares the performance of our system versus CLIP. For both categories, our method obtains $100 \%$ recall, while CLIP obtains $0 \%$ recall for Wordle and $10 \%$ recall for the Ever Given. Even though these categories are relatively new, GPT3 is able to build descriptors for them because enough people on the Internet have visually described them. By combining these descriptors together, the model can recognize the new category. In contrast, since these categories are novel to CLIP, baseline methods obtain poor performance. CLIP matches the “Wordle game” incorrectly category to keyboards instead of the game, likely an artifact of how CLIP tokenizes the input words. For the “Ever Given” category, CLIP retrieved just one correct example in the top ten detections. The example it retrieved correctly has its name written on the ship, and CLIP likely performed well on this example due its reading capabilities (Goh et al., 2021). However, for the rest of the nine EverGiven ships in the dataset, CLIP was unable to correctly detect them with high confidence. This experiment illustrates that visual classifiers can be automatically built by leveraging the descriptive capabilities of large language models.
|
| 154 |
+
|
| 155 |
+
# 3.3 CORRECTING FAILURES BY DESCRIPTOR EDITING
|
| 156 |
+
|
| 157 |
+
Bias remains an unsolved challenge in machine learning, including for foundation models trained on large-scale data. Typically, diagnosing the source of biases is challenging because representations are usually black-box. However, linguistic attributes makes it possible to both identify which part of the system introduces a bias, and manually correct them in some cases.
|
| 158 |
+
|
| 159 |
+
We found that both CLIP and our model is biased towards Western celebrations for the “wedding” category. Inspired by the Inclusive Images Challenge (Atwood et al., 2020), we collected a challenge set consisting of images of weddings from various cultures to explore this bias. There are many wedding and cultural traditions in the world, and each exhibit their own identifying visual characteristics. On this dataset, CLIP tended to have a Western-centric bias, primarily considering “white weddings” (named for the white dress brides wear in this tradition) (Wikipedia, 2022b). Our model showed a similar bias. When our classifier prompted GPT3 for the visual descriptors of a wedding, the language model mostly prescribed that the groom should be wearing a tuxedo. For these models to be deployed and trusted, we must have ways to amend them to be inclusive.
|
| 160 |
+
|
| 161 |
+

|
| 162 |
+
Figure 7: (a) Examples of errors in the descriptors produced by GPT-3. (b) Examples of undesired behavior in CLIP retrievals from descriptors. The text in red annotates the error.
|
| 163 |
+
|
| 164 |
+
Since the decisions from our model are based on human-readable text, changing them changes the decision process. Figure 6 illustrates that we can intervene to partially fix the bias. We can manually overwrite the attribute for “a groom wearing a tuxedo” to include other clothing traditions, such as a dashiki (traditional clothing in many parts of Western Africa) or a kimono (traditional clothing in many parts of Japan). This effectively points the VLM to what it should look for instead of relying solely on its biased association with the word wedding. We can thus build a more inclusive classifier by considering the descriptor similarity of every such sets of descriptors, then choosing the category “wedding” if any of them have the highest total descriptor similarity compared to background classes.
|
| 165 |
+
|
| 166 |
+
On this dataset and in these settings, the table in Fig. 6 shows that intervention can effectively correct this bias. Compared to CLIP, our approach obtains significantly higher accuracy at recognizing the cultural variation of wedding photographs. Figure 6 shows several qualitative examples where the model is reprogrammed with different clothing attributes.
|
| 167 |
+
|
| 168 |
+
# 3.4 UNDERSTANDING FAILURE MODES
|
| 169 |
+
|
| 170 |
+
We explore a few limitations of the method here. We discuss failures both in the language model $D ( c )$ and failures in the grounding $\phi$ .
|
| 171 |
+
|
| 172 |
+
Failure in descriptor creation. Typically, GPT-3 produces high-quality descriptors; however, we noted three types of failures, shown in Figure 7 (a). The first failure mode is a shortcoming in understanding modalities. Despite being asked for visual features of the category, GPT-3 will occasionally produce descriptors that, while correct, reflect other modalities. In Figure 7 (a), we observe “jackfruit” is given descriptors pertaining to taste and smell in addition to vision. As these cannot be seen, they are not useful cues for the vision-language model.
|
| 173 |
+
|
| 174 |
+
Another failure case is caused by word ambiguity. Many words have multiple meanings. GPT-3 produces descriptors solely from the name of the category; it cannot see any of the images in the dataset to tell which meaning of a word is intended. It picks one meaning to describe. This often succeeds, as it tends to pick the most common meaning – for example, the descriptors for “St. Bernard” relate to the dog breed instead of the religious figure, matching the visual category. In some cases, however, it can lead to descriptors that are completely unrelated to the visual category. The “Vespa” in Figure 7 (a) is an illustrative example of this. In ImageNet, this category refers to scooters made by the Italian designer brand Vespa. GPT-3 instead describes a wasp. “Vespa” is the Italian word for “wasp” – the multilingual capabilities of GPT-3 actually lead to an undesired result.
|
| 175 |
+
|
| 176 |
+
This type of mistake is to some extent unavoidable solely from text without further information about the category; using the name “Vespa scooter” does not lead to this error.
|
| 177 |
+
|
| 178 |
+
Finally, GPT-3 still (albeit rarely) produces syntactic errors such as verbatim repetition of the same descriptor (see “Hair spray” in Fig. 7 (a)). As large language models progress, we expect this failure mode to continue to diminish. Our framework readily adapts to such advances; it will only continue to work better as language models improve further.
|
| 179 |
+
|
| 180 |
+
Failure in recognizing descriptors. While for most descriptors, CLIP successfully matches the descriptor text to images, we find it can also retrieve unexpected images in certain circumstances. We identify two interesting types of failure in recognition, illustrated in Figure 7 (b). If a descriptor matches multiple categories, there are some cases where it can be strongly activated for categories outside the intended one even when the intended category name is included in the text to be embedded. For example, the descriptor “lion, which has tawny or golden fur” retrieves two Chow Chows in the top 10 activations. We hypothesize this is due to the confluence of two factors. The first is of course that it is likely Chow Chows are strongly associated with having “tawny or golden fur.” But typically, this is not enough on its own, judging by other descriptors (see Appendix for examples). We believe the other relevant factor is having category names that are themselves related. The Chinese name for Chow Chows includes the word ‘lion’ in it; similarly to the “Vespa” case for GPT-3, there error may have a multilingual nature. (We note that the other descriptors for “lion” do not fit Chow Chows the way “golden fur” does, and do not retrieve images of the dogs).
|
| 181 |
+
|
| 182 |
+
Another failure mode we observe stems from both word ambiguity and the ability of CLIP to solve multiple tasks. In particular, just as its ability to read can impede its ability to recognize objects (Goh et al., 2021), we find this same ability can also impede recognizing descriptors. The second example, “jaguar, which is a large, stocky cat” retrieves jaguars correctly, but is strongly activated by stock photos of jaguars over jaguars which are themselves stocky cats. This is especially true when they contain the word “stock”, but also occurs for other stock photos, due to the ambiguity between the word “stock” in how it applies to images rather than cats.
|
| 183 |
+
|
| 184 |
+
# 4 RELATED WORK
|
| 185 |
+
|
| 186 |
+
Vision-language models have grown to be a dominant paradigm for visual recognition with the release of CLIP (Radford et al., 2021), showing strong zero-shot performance on a range of benchmarks across distribution shifts. Other work such as ALIGN (Jia et al., 2021), FLAVA (Singh et al., 2022), Florence (Yuan et al., 2021), and more have since furthered this paradigm. The hallmark of these recent models is that they are trained on large-scale datasets of image-text pairs collected from the Internet. They have seen success on a variety of tasks, including classification, detection (Kamath et al., 2021), and more. Compared to previous models, vision-language models boast the advantage of connecting visual data to free-form language rather than fixed categories. Concurrent work Menon et al. (2022) shows that the visual representations learned by such models can be predisposed towards certain tasks a priori.
|
| 187 |
+
|
| 188 |
+
Interpretability and explainability for deep models in vision is a field too broad to fully cover here; we discuss some relevant examples here, and direct the interested reader to (Gilpin et al., 2019) for a broader overview. Much of the work in explaining deep model decisions is post-hoc, often in the form of heatmaps such as GradCAM (Selvaraju et al., 2020). Chefer et al. (2021) extend similar techniques to vision transformers, such as those often used for vision-language models. Such work can be useful for understanding low-level decision factors such as “which part of the input image was the decision based on?” However, as the decision is not constructed from these explanations but rather the explanations are constructed from the decision, there can be questions of faithfulness, i.e. how much the generated explanation actually reflects the decision process of the model. In addition, outputs such as heatmaps require some interpretation on the part of the user to parse, and cannot easily capture medium-to-high level factors such as “cash register” being the deciding factor for a ‘store’. Other work aims to produce explanations in natural language for vision. Park et al. (2018) create multimodal explanations by training a language model to produce explanations in tandem with a visual classifier, but these text explanations need not be what the visual classifier bases its decision on, rather they intend to be plausible explanations for the given image. Sammani et al. (2022) extends this idea to more closely integrate the representations of both modalities.
|
| 189 |
+
|
| 190 |
+
Our approach is natural when viewed through the lens of prototype learning with neural networks (Vinyals et al., 2017; Snell et al., 2017; Chen et al., 2019), with some marked differences. In particular, our work is partly inspired by Chen et al. (2019), which constructs inherently interpretable decisions for visual classification by comparison to prototypical examples in the training set. This work bridges the gap between fully black box neural networks and fully transparent white box models without compromising performance; similarity to the prototypes is estimated with a black box neural network, but which prototypical images the decision was based on and how much for each of them is exposed to the user. This is similar to our use of descriptors at inference time, but requires a unique training procedure and produces only visual explanations. We can view $D ( c )$ as a support set of prototype vectors for class $c$ . Rather than prototypes in the typical sense, however, these are text prototypes for visual data. Work such as Chen et al. (2019) has previously explored prototypes for inherently interpretable models, but these have been “visual words” rather than free text. In addition, we do not need to learn our prototypes, instead making use of pre-trained foundation models. We note that one difference from ProtoNets (Snell et al., 2017) is that we compute the class score $s$ as the mean similarity to support vectors (i.e., descriptor) rather than the similarity to the mean of the support vectors. Aggregating similarities enables interpretability, as the class score can be decomposed into similarity with each descriptor, more akin to Chen et al. (2019); Vinyals et al. (2017). Comparing to the mean of support vectors is essentially the approach of typical “prompt ensembling.” CLIP (Radford et al., 2021) presents a remarkable ensemble of 80 prompts handdesigned for the ImageNet dataset over the course of a year. We encourage readers to see concurrent work (Pratt et al., 2022) that demonstrates that prompt ensembling with prompts obtained by large language models can improve accuracy on recognition tasks. One of the key differences between Pratt et al. (2022) and our work is that while prompt ensembling is an effective tool for increasing accuracy, it does not afford the same interpretability, editability, or adaptability on a per-descriptor basis that our approach does.
|
| 191 |
+
|
| 192 |
+
There are several advantages to using text prototypes. Critically, using natural language allows us to obtain descriptors by leveraging the world knowledge condensed into large language models such as GPT-3. This eschews costly learning processes and incorporates external knowledge effectively. Text prototypes also are readily interpretable, whether by a technical user or a layperson. It is easier and more natural for a person to edit text than to edit visual data to a desired prototype, including to define a previously-unseen category.
|
| 193 |
+
|
| 194 |
+
Other work demonstrates that external text knowledge can provide substantial aid to vision tasks. K-LITE (Shen et al., 2022) shows that such knowledge from WordNet and Wiktionary has the potential to enhance prompts for vision-language models. (Zeng et al., 2022) is similarly motivated in connecting large language models to vision-language models, enabling emergent capabilities such as image captioning. Large language models, especially GPT-3 (Brown et al., 2020), have seen widespread application since their introduction due to their impressive ability to generate sequences similar to those observed from humans. PICA (Yang et al., 2021) demonstrates knowledge derived from GPT-3 can aid few-shot VQA tasks.
|
| 195 |
+
|
| 196 |
+
Our work is also closely related to zero-shot attribute-based classification, such as (Lampert et al., 2014). Parikh & Grauman (2011) develop a system to create a vocabulary of “nameable” attributes from humans. Romera-Paredes & Torr (2017) demonstrate a framework where connections between attributes and classes are given by the environment. Socher et al. (2013) introduce the idea of using word embeddings to use knowledge distilled from large-scale text corpora for zero-shot visual recognition; we go a step further and use large language models to obtain the words to embed themselves. These selected works share similar motivation to our use of large language models to create dictionaries of descriptors. As this area is also too large to summarize shortly, we direct the interested reader to Xian et al. (2020) for further reading.
|
| 197 |
+
|
| 198 |
+
# 5 CONCLUSION
|
| 199 |
+
|
| 200 |
+
We introduce a new framework for zero-shot classification with vision-language models. We leverage the linguistic knowledge about visual categories from large language models to generate textual descriptors for each category, comparing images to these descriptors rather than estimating the similarity of images directly with category names. Using GPT-3 and CLIP, we show promising results showing the capabilities of this framework to provide interpretable model decisions, improve performance on recognition tasks, enable adaptation to new knowledge, and mitigate bias.
|
| 201 |
+
|
| 202 |
+
# 6 ETHICS
|
| 203 |
+
|
| 204 |
+
Large pretrained models such as GPT-3 and CLIP learn various biases relating to race, culture, gender, and more from the Internet Goh et al. (2021). Systems that use these models can reproduce or even exacerbate this bias. Using both in tandem has the potential to compound the biases of both models. Interpretable models, like the one we present, have the potential to shed light on these biases that could otherwise remain unknown. For example, it is likely that descriptor dictionaries produced by GPT-3 could reflect its biases. We hope that the methods we present for editability and bias mitigation serve as useful tools to combat said biases.
|
| 205 |
+
|
| 206 |
+
# 7 REPRODUCIBILITY
|
| 207 |
+
|
| 208 |
+
We use CLIP as our vision-language model and GPT-3 as our large language model, both of which can be queried by anyone – CLIP having weights available, and GPT-3 having a public API. Sufficient details to reproduce the method can be found in Section 2 (for inference) as well as Appendices A (for querying language models) and B (for editability). We will release the data for the editability and adaptability experiments where the appropriate licenses permit and sufficient de-identification is possible. We will also release code upon publication.
|
| 209 |
+
|
| 210 |
+
# 8 ACKNOWLEDGEMENTS
|
| 211 |
+
|
| 212 |
+
This research is based on work partially supported by the NSF NRI Award #2132519, the DARPA MCS program, and the DARPA GAILA program. SM is supported by the NSF Graduate Research Fellowship. We’d like to thank D´ıdac Sur´ıs and Rich Zemel for helpful discussions and feedback.
|
| 213 |
+
|
| 214 |
+
# REFERENCES
|
| 215 |
+
|
| 216 |
+
James Atwood, Yoni Halpern, Pallavi Baljekar, Eric Breck, D. Sculley, Pavel Ostyakov, Sergey I. Nikolenko, Igor Ivanov, Roman Solovyev, Weimin Wang, and Miha Skalic. The Inclusive Images Competition. In Sergio Escalera and Ralf Herbrich (eds.), The NeurIPS ’18 Competition, The Springer Series on Challenges in Machine Learning, pp. 155–186, Cham, 2020. Springer International Publishing. ISBN 978-3-030-29135-8. doi: 10.1007/978-3-030-29135-8 6.
|
| 217 |
+
|
| 218 |
+
Lukas Bossard, Matthieu Guillaumin, and Luc Van Gool. Food-101 – Mining Discriminative Components with Random Forests. In David Fleet, Tomas Pajdla, Bernt Schiele, and Tinne Tuytelaars (eds.), Computer Vision – ECCV 2014, Lecture Notes in Computer Science, pp. 446–461, Cham, 2014. Springer International Publishing. ISBN 978-3-319-10599-4. doi: 10.1007/978-3-319-10599-4 29.
|
| 219 |
+
|
| 220 |
+
Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language Models are Few-Shot Learners. arXiv:2005.14165 [cs], July 2020. URL http://arxiv.org/abs/2005.14165. arXiv: 2005.14165.
|
| 221 |
+
|
| 222 |
+
Hila Chefer, Shir Gur, and Lior Wolf. Generic Attention-model Explainability for Interpreting BiModal and Encoder-Decoder Transformers. arXiv:2103.15679 [cs], March 2021. URL http: //arxiv.org/abs/2103.15679. arXiv: 2103.15679.
|
| 223 |
+
|
| 224 |
+
Chaofan Chen, Oscar Li, Chaofan Tao, Alina Jade Barnett, Jonathan Su, and Cynthia Rudin. This Looks Like That: Deep Learning for Interpretable Image Recognition, December 2019. URL http://arxiv.org/abs/1806.10574. arXiv:1806.10574 [cs, stat].
|
| 225 |
+
|
| 226 |
+
Mircea Cimpoi, Subhransu Maji, Iasonas Kokkinos, Sammy Mohamed, and Andrea Vedaldi. Describing Textures in the Wild. pp. 3606–3613, 2014. URL https://openaccess.thecvf.com/content_cvpr_2014/html/Cimpoi_ Describing_Textures_in_2014_CVPR_paper.html.
|
| 227 |
+
|
| 228 |
+
Josip Djolonga, Jessica Yung, Michael Tschannen, Rob Romijnders, Lucas Beyer, Alexander Kolesnikov, Joan Puigcerver, Matthias Minderer, Alexander D’Amour, Dan Moldovan, Sylvain Gelly, Neil Houlsby, Xiaohua Zhai, and Mario Lucic. On Robustness and Transferability of Convolutional Neural Networks, March 2021. URL http://arxiv.org/abs/2007.08558. Number: arXiv:2007.08558 arXiv:2007.08558 [cs].
|
| 229 |
+
|
| 230 |
+
Leilani H. Gilpin, David Bau, Ben Z. Yuan, Ayesha Bajwa, Michael Specter, and Lalana Kagal. Explaining Explanations: An Overview of Interpretability of Machine Learning, February 2019. URL http://arxiv.org/abs/1806.00069. arXiv:1806.00069 [cs, stat].
|
| 231 |
+
|
| 232 |
+
Gabriel Goh, Nick Cammarata †, Chelsea Voss $^ \dagger$ , Shan Carter, Michael Petrov, Ludwig Schubert, Alec Radford, and Chris Olah. Multimodal Neurons in Artificial Neural Networks. Distill, 6(3): e30, March 2021. ISSN 2476-0757. doi: 10.23915/distill.00030. URL https://distill. pub/2021/multimodal-neurons.
|
| 233 |
+
|
| 234 |
+
Ishaan Gulrajani and David Lopez-Paz. In Search of Lost Domain Generalization. arXiv:2007.01434 [cs, stat], July 2020. URL http://arxiv.org/abs/2007.01434. arXiv: 2007.01434.
|
| 235 |
+
|
| 236 |
+
Patrick Helber, Benjamin Bischke, Andreas Dengel, and Damian Borth. EuroSAT: A Novel Dataset and Deep Learning Benchmark for Land Use and Land Cover Classification, February 2019. URL http://arxiv.org/abs/1709.00029. arXiv:1709.00029 [cs].
|
| 237 |
+
|
| 238 |
+
Chao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen, Zarana Parekh, Hieu Pham, Quoc V. Le, Yunhsuan Sung, Zhen Li, and Tom Duerig. Scaling Up Visual and Vision-Language Representation Learning With Noisy Text Supervision. arXiv:2102.05918 [cs], June 2021. URL http: //arxiv.org/abs/2102.05918. arXiv: 2102.05918.
|
| 239 |
+
|
| 240 |
+
Ziyu Jiang, Tianlong Chen, Ting Chen, and Zhangyang Wang. Robust Pre-Training by Adversarial Contrastive Learning. arXiv:2010.13337 [cs], October 2020. URL http://arxiv.org/ abs/2010.13337. arXiv: 2010.13337.
|
| 241 |
+
|
| 242 |
+
Aishwarya Kamath, Mannat Singh, Yann LeCun, Gabriel Synnaeve, Ishan Misra, and Nicolas Carion. MDETR – Modulated Detection for End-to-End Multi-Modal Understanding, October 2021. URL http://arxiv.org/abs/2104.12763. arXiv:2104.12763 [cs].
|
| 243 |
+
|
| 244 |
+
Simon Kornblith, Jonathon Shlens, and Quoc V. Le. Do Better ImageNet Models Transfer Better? In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2656– 2666, Long Beach, CA, USA, June 2019. IEEE. ISBN 978-1-72813-293-8. doi: 10.1109/CVPR. 2019.00277. URL https://ieeexplore.ieee.org/document/8954384/.
|
| 245 |
+
|
| 246 |
+
Christoph H. Lampert, Hannes Nickisch, and Stefan Harmeling. Attribute-Based Classification for Zero-Shot Visual Object Categorization. IEEE Transactions on Pattern Analysis and Machine Intelligence, 36(3):453–465, March 2014. ISSN 0162-8828, 2160-9292. doi: 10.1109/TPAMI. 2013.140. URL http://ieeexplore.ieee.org/document/6571196/.
|
| 247 |
+
|
| 248 |
+
Sachit Menon, Ishaan Preetam Chandratreya, and Carl Vondrick. The risks of versatile models: Resolving task ambiguity for vision-language models. arXiv, 2022.
|
| 249 |
+
|
| 250 |
+
Devi Parikh and Kristen Grauman. Interactively building a discriminative vocabulary of nameable attributes. In CVPR 2011, pp. 1681–1688, Colorado Springs, CO, USA, June 2011. IEEE. ISBN 978-1-4577-0394-2. doi: 10.1109/CVPR.2011.5995451. URL http://ieeexplore. ieee.org/document/5995451/.
|
| 251 |
+
|
| 252 |
+
Dong Huk Park, Lisa Anne Hendricks, Zeynep Akata, Anna Rohrbach, Bernt Schiele, Trevor Darrell, and Marcus Rohrbach. Multimodal Explanations: Justifying Decisions and Pointing to the Evidence. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8779–8788, Salt Lake City, UT, June 2018. IEEE. ISBN 978-1-5386-6420-9. doi: 10.1109/ CVPR.2018.00915. URL https://ieeexplore.ieee.org/document/8579013/.
|
| 253 |
+
|
| 254 |
+
Omkar M Parkhi, Andrea Vedaldi, Andrew Zisserman, and C. V. Jawahar. Cats and dogs. In 2012 IEEE Conference on Computer Vision and Pattern Recognition, pp. 3498–3505, June 2012. doi: 10.1109/CVPR.2012.6248092. ISSN: 1063-6919.
|
| 255 |
+
|
| 256 |
+
Fabio Petroni, Tim Rocktaschel, Sebastian Riedel, Patrick Lewis, Anton Bakhtin, Yuxiang Wu, and ¨ Alexander Miller. Language Models as Knowledge Bases? In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing and the 9th International Joint Conference on Natural Language Processing (EMNLP-IJCNLP), pp. 2463–2473, Hong Kong, China, November 2019. Association for Computational Linguistics. doi: 10.18653/v1/D19-1250. URL https://aclanthology.org/D19-1250.
|
| 257 |
+
|
| 258 |
+
Sarah Pratt, Rosanne Liu, and Ali Farhadi. What does a platypus look like? Generating customized prompts for zero-shot image classification, September 2022. URL http://arxiv. org/abs/2209.03320. arXiv:2209.03320 [cs].
|
| 259 |
+
|
| 260 |
+
Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning Transferable Visual Models From Natural Language Supervision. arXiv:2103.00020 [cs], February 2021. URL http://arxiv.org/abs/2103.00020. arXiv: 2103.00020.
|
| 261 |
+
|
| 262 |
+
Bernardino Romera-Paredes and Philip H. S. Torr. An Embarrassingly Simple Approach to ZeroShot Learning. In Rogerio Schmidt Feris, Christoph Lampert, and Devi Parikh (eds.), Visual Attributes, pp. 11–30. Springer International Publishing, Cham, 2017. ISBN 978-3-319-50075-1 978-3-319-50077-5. doi: 10.1007/978-3-319-50077-5 2. URL http://link.springer. com/10.1007/978-3-319-50077-5_2. Series Title: Advances in Computer Vision and Pattern Recognition.
|
| 263 |
+
|
| 264 |
+
Cynthia Rudin, Chaofan Chen, Zhi Chen, Haiyang Huang, Lesia Semenova, and Chudi Zhong. Interpretable Machine Learning: Fundamental Principles and 10 Grand Challenges. arXiv:2103.11251 [cs, stat], July 2021. URL http://arxiv.org/abs/2103.11251. arXiv: 2103.11251.
|
| 265 |
+
|
| 266 |
+
Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li FeiFei. ImageNet Large Scale Visual Recognition Challenge. arXiv:1409.0575 [cs], January 2015. URL http://arxiv.org/abs/1409.0575. arXiv: 1409.0575.
|
| 267 |
+
|
| 268 |
+
Fawaz Sammani, Tanmoy Mukherjee, and Nikos Deligiannis. NLX-GPT: A Model for Natural Language Explanations in Vision and Vision-Language Tasks, March 2022. URL http:// arxiv.org/abs/2203.05081. arXiv:2203.05081 [cs].
|
| 269 |
+
|
| 270 |
+
Ramprasaath R. Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization. International Journal of Computer Vision, 128(2):336–359, February 2020. ISSN 0920-5691, 1573-1405. doi: 10.1007/s11263-019-01228-7. URL http://arxiv.org/ abs/1610.02391. arXiv: 1610.02391.
|
| 271 |
+
|
| 272 |
+
Sheng Shen, Chunyuan Li, Xiaowei Hu, Yujia Xie, Jianwei Yang, Pengchuan Zhang, Anna Rohrbach, Zhe Gan, Lijuan Wang, Lu Yuan, Ce Liu, Kurt Keutzer, Trevor Darrell, and Jianfeng Gao. K-LITE: Learning Transferable Visual Models with External Knowledge, April 2022. URL http://arxiv.org/abs/2204.09222. arXiv:2204.09222 [cs].
|
| 273 |
+
|
| 274 |
+
Amanpreet Singh, Ronghang Hu, Vedanuj Goswami, Guillaume Couairon, Wojciech Galuba, Marcus Rohrbach, and Douwe Kiela. FLAVA: A Foundational Language And Vision Alignment Model, March 2022. URL http://arxiv.org/abs/2112.04482. arXiv:2112.04482 [cs].
|
| 275 |
+
|
| 276 |
+
Jake Snell, Kevin Swersky, and Richard S. Zemel. Prototypical Networks for Few-shot Learning, June 2017. URL http://arxiv.org/abs/1703.05175. arXiv:1703.05175 [cs, stat].
|
| 277 |
+
|
| 278 |
+
Richard Socher, Milind Ganjoo, Hamsa Sridhar, Osbert Bastani, Christopher D. Manning, and Andrew Y. Ng. Zero-Shot Learning Through Cross-Modal Transfer, March 2013. URL http: //arxiv.org/abs/1301.3666. arXiv:1301.3666 [cs].
|
| 279 |
+
|
| 280 |
+
Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. Matching Networks for One Shot Learning, December 2017. URL http://arxiv.org/abs/ 1606.04080. arXiv:1606.04080 [cs, stat].
|
| 281 |
+
|
| 282 |
+
Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The CaltechUCSD Birds-200-2011 Dataset, July 2011. URL https://resolver.caltech.edu/ CaltechAUTHORS:20111026-120541847. Issue: 2010-001 Num Pages: 8 Number: 2010-001 Place: Pasadena, CA Publisher: California Institute of Technology.
|
| 283 |
+
|
| 284 |
+
Wikipedia. Ever Given, August 2022a. URL https://en.wikipedia.org/w/index. php?title $=$ Ever_Given&oldid $\underline { { \underline { { \mathbf { \Pi } } } } } =$ 1105011722. Page Version ID: 1105011722.
|
| 285 |
+
|
| 286 |
+
Wikipedia. White wedding, September 2022b. URL https://en.wikipedia.org/ w/index.php?title $=$ White_wedding&oldid $\underline { { \underline { { \mathbf { \Pi } } } } } =$ 1112110253. Page Version ID: 1112110253.
|
| 287 |
+
|
| 288 |
+
Wikipedia. Wordle, September 2022c. URL https://en.wikipedia.org/w/index.php? title $=$ Wordle&oldid $\underline { { \underline { { \mathbf { \Pi } } } } } =$ 1112595044. Page Version ID: 1112595044.
|
| 289 |
+
|
| 290 |
+
Mitchell Wortsman, Gabriel Ilharco, Jong Wook Kim, Mike Li, Simon Kornblith, Rebecca Roelofs, Raphael Gontijo Lopes, Hannaneh Hajishirzi, Ali Farhadi, Hongseok Namkoong, and Ludwig Schmidt. Robust fine-tuning of zero-shot models. arXiv:2109.01903 [cs], February 2022. URL http://arxiv.org/abs/2109.01903. arXiv: 2109.01903.
|
| 291 |
+
|
| 292 |
+
Yongqin Xian, Christoph H. Lampert, Bernt Schiele, and Zeynep Akata. Zero-Shot Learning – A Comprehensive Evaluation of the Good, the Bad and the Ugly, September 2020. URL http: //arxiv.org/abs/1707.00600. arXiv:1707.00600 [cs].
|
| 293 |
+
|
| 294 |
+
Zhengyuan Yang, Zhe Gan, Jianfeng Wang, Xiaowei Hu, Yumao Lu, Zicheng Liu, and Lijuan Wang. An Empirical Study of GPT-3 for Few-Shot Knowledge-Based VQA, September 2021. URL http://arxiv.org/abs/2109.05014. Number: arXiv:2109.05014 arXiv:2109.05014 [cs].
|
| 295 |
+
|
| 296 |
+
Lu Yuan, Dongdong Chen, Yi-Ling Chen, Noel Codella, Xiyang Dai, Jianfeng Gao, Houdong Hu, Xuedong Huang, Boxin Li, Chunyuan Li, Ce Liu, Mengchen Liu, Zicheng Liu, Yumao Lu, Yu Shi, Lijuan Wang, Jianfeng Wang, Bin Xiao, Zhen Xiao, Jianwei Yang, Michael Zeng, Luowei Zhou, and Pengchuan Zhang. Florence: A New Foundation Model for Computer Vision, November 2021. URL http://arxiv.org/abs/2111.11432. arXiv:2111.11432 [cs].
|
| 297 |
+
|
| 298 |
+
Andy Zeng, Maria Attarian, Brian Ichter, Krzysztof Choromanski, Adrian Wong, Stefan Welker, Federico Tombari, Aveek Purohit, Michael Ryoo, Vikas Sindhwani, Johnny Lee, Vincent Vanhoucke, and Pete Florence. Socratic Models: Composing Zero-Shot Multimodal Reasoning with Language, May 2022. URL http://arxiv.org/abs/2204.00598. arXiv:2204.00598 [cs].
|
| 299 |
+
|
| 300 |
+
Susan Zhang, Stephen Roller, Naman Goyal, Mikel Artetxe, Moya Chen, Shuohui Chen, Christopher Dewan, Mona Diab, Xian Li, Xi Victoria Lin, Todor Mihaylov, Myle Ott, Sam Shleifer, Kurt Shuster, Daniel Simig, Punit Singh Koura, Anjali Sridhar, Tianlu Wang, and Luke Zettlemoyer. OPT: Open Pre-trained Transformer Language Models, June 2022. URL http: //arxiv.org/abs/2205.01068. arXiv:2205.01068 [cs].
|
| 301 |
+
|
| 302 |
+
# A PROMPTING THE LANGUAGE MODEL
|
| 303 |
+
|
| 304 |
+
A key aspect of our method is producing discrete, separate descriptors through the language model, rather than embedding everything together as is typical for prompting. Thus, an important consideration is how to encourage the language model to produce descriptors in a way that does not require human parsing. Recall our prompt structure is of the form
|
| 305 |
+
|
| 306 |
+
Q: What are useful features for distinguishing a {category name} in a photo?
|
| 307 |
+
A: There are several useful visual features to tell there is a {category name} in a photo:
|
| 308 |
+
|
| 309 |
+
We find that adding the trailing ‘-’ is enough to typically result in a bulleted list output. This is simple to automatically obtain descriptors from by simply removing the hyphens.
|
| 310 |
+
|
| 311 |
+
Per OpenAI’s API recommendations, we use the structure Q: A: for the query and the desired response. We sample from the ‘text-davinci-002’ model with temperature of 0.7 and a maximum token length of 100.
|
| 312 |
+
|
| 313 |
+
As with previous work with GPT-3, we find that the list formatting becomes more reliable when one or two examples of desired output are provided. These can be of the form
|
| 314 |
+
|
| 315 |
+
which itself was constructed by GPT-3 (although such examples can easily be constructed by hand as well).
|
| 316 |
+
|
| 317 |
+
Presumably, all of this could be improved with more effort towards prompting; we did not tune these prompts at all after our initial generation of descriptors for the 1000 ImageNet classes.
|
| 318 |
+
|
| 319 |
+
# B DATASET DETAILS
|
| 320 |
+
|
| 321 |
+
We consider the ImageNet dataset (Russakovsky et al., 2015) for everyday object recognition; ImageNetV2 (Kornblith et al., 2019) for distribution shift from ImageNet; CUB for fine-grained classification of birds (Wah et al., 2011); EuroSAT (Helber et al., 2019) for satellite image recognition; Places365 for scenes; Food101 (Bossard et al., 2014) for food; Oxford Pets (Parkhi et al., 2012) for common animals; and Describable Textures Cimpoi et al. (2014) for in-the-wild patterns.
|
| 322 |
+
|
| 323 |
+

|
| 324 |
+
Figure 8: We use the OPT Zhang et al. (2022) series of language models to evaluate the influence of different language models at different parameter counts. We find that using descriptors from smaller language models can actually hurt performance, while after a certain size performance gains appear; this trend holds across sizes of VLM. We hypothesize this is because smaller models do not contain the knowledge of the visual world that larger language models possess.
|
| 325 |
+
|
| 326 |
+
# C FURTHER COMPARISON
|
| 327 |
+
|
| 328 |
+
In this section, we provide some additional interesting quantitative comparisons.
|
| 329 |
+
|
| 330 |
+
<table><tr><td></td><td colspan="4">ImageNet</td></tr><tr><td></td><td>Wiktionary Descriptions</td><td>Wordnet Descriptions</td><td>Ours</td><td>CLIP</td></tr><tr><td>ViT-B/32</td><td>57.91</td><td>60.00</td><td>62.97</td><td>58.99</td></tr><tr><td>ViT-B/16</td><td>62.56</td><td>64.58</td><td>68.03</td><td>64.05</td></tr><tr><td>ViT-L/14</td><td>68.87</td><td>71.14</td><td>75.00</td><td>71.57</td></tr><tr><td>ViT-L/14 @336px</td><td>69.21</td><td>72.16</td><td>76.16</td><td>72.96</td></tr></table>
|
| 331 |
+
|
| 332 |
+
Table 2: Comparison with auxiliary information obtained from WordNet and Wiktionary rather than GPT-3. We observe that the Wiktionary information tends to hurt performance, while WordNet sometimes slightly helps and sometimes slightly hurts. We hypothesize this is because the information contained in WordNet and Wiktionary concerns definitions more often than visual descriptions.
|
| 333 |
+
|
| 334 |
+
# D EDITABILITY/BIAS MITIGATION EXPERIMENT DETAILS
|
| 335 |
+
|
| 336 |
+
We collect 10 images depicting each of four wedding traditions from Western Africa, China, Japan, and Northern India. We use Flickr to collect these images with Creative Commons licensing, with the exception of the Western African examples, which could not be found on Flickr; for these, we
|
| 337 |
+
|
| 338 |
+
<table><tr><td rowspan="2"></td><td colspan="2">Aggregation Method</td></tr><tr><td>Mean</td><td>Max</td></tr><tr><td>ViT-B/32</td><td>61.34</td><td>60.00</td></tr><tr><td>ViT-B/16</td><td>66.45</td><td>64.58</td></tr><tr><td>ViT-L/14</td><td>73.15</td><td>71.14</td></tr><tr><td>ViT-L/14@336pX</td><td>74.19</td><td>72.16</td></tr></table>
|
| 339 |
+
|
| 340 |
+
Table 3: Comparison between aggregating descriptor similarities for a given category using their mean (as described throughout the paper) and their maximum. We find the mean to have a consistent benefit over the max, suggesting using multiple justifications in conjunction provides some benefit.
|
| 341 |
+
|
| 342 |
+
<table><tr><td rowspan="2"></td><td colspan="2">ImageNet (80 Prompts)</td></tr><tr><td>Ours</td><td>CLIP △</td></tr><tr><td>ViT-B/32</td><td>63.76</td><td>63.37 0.39</td></tr><tr><td>ViT-B/16</td><td>68.83</td><td>68.36 0.47</td></tr><tr><td>ViT-L/14</td><td>75.96</td><td>75.52 0.44</td></tr><tr><td>ViT-L/14@336px</td><td>76.85</td><td>76.57 0.28</td></tr></table>
|
| 343 |
+
|
| 344 |
+
Table 4: Comparison with ImageNet using all 80 hand-engineered prompts created for the original CLIP paper. Though the prompts are not hand-tuned to descriptors, we note that they still provide some benefit; this motivates future work creating hand-tuned prompts explicitly designed for descriptor-based methods.
|
| 345 |
+
|
| 346 |
+

|
| 347 |
+
Figure 9: Top retrievals for various descriptors.
|
| 348 |
+
|
| 349 |
+
use Google Images. (We will release the images for which licenses are provided with identifying features blurred.)
|
| 350 |
+
|
| 351 |
+
To evaluate performance, we add the category ‘wedding’ to the 1000 ImageNet categories. We provide descriptors corresponding to each of the edited versions of the original, GPT-3-constructed descriptors of a white wedding. We perform these edits by identifying cross-cultural analogs in each descriptor and replacing the Western-specific words, such as ‘tuxedo’ ‘dashiki’ for the Western African example. This results in 5 subgroups, including each of the four additional cultures and the original Western-centric descriptors; if the average descriptor score for any of these 5 is the highest, the category chosen is ‘wedding.’ We remove the existing category ‘bridegroom’ as this leads to category overlap, but the more general ‘wedding’ need not include only men. We use the CLIP RN50 model in these experiments, but find similar results across model sizes.
|
| 352 |
+
|
| 353 |
+
# E TOP DESCRIPTOR ACTIVATIONS
|
| 354 |
+
|
| 355 |
+
Here we show various descriptors’ top retrievals in Fig. 9.
|
md/dev/k9bx1EfHI_-/k9bx1EfHI_-.md
ADDED
|
@@ -0,0 +1,389 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SELF-SUPERVISED GRAPH NEURAL NETWORKS FOR IMPROVED ELECTROENCEPHALOGRAPHIC SEIZURE ANALYSIS
|
| 2 |
+
|
| 3 |
+
Siyi Tang, Jared Dunnmon, Khaled Saab, Xuan Zhang†, Qianying Huang†, Florian Dubost, Daniel Rubin‡, Christopher Lee-Messer‡
|
| 4 |
+
Stanford University, CA, USA
|
| 5 |
+
{siyitang,jdunnmon,ksaab,kayleez,qyhuang,fdubost,rubin,cleemess} @stanford.edu
|
| 6 |
+
† Equal contributions. ‡ Equal contributions.
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Automated seizure detection and classification from electroencephalography (EEG) can greatly improve seizure diagnosis and treatment. However, several modeling challenges remain unaddressed in prior automated seizure detection and classification studies: (1) representing non-Euclidean data structure in EEGs, (2) accurately classifying rare seizure types, and (3) lacking a quantitative interpretability approach to measure model ability to localize seizures. In this study, we address these challenges by (1) representing the spatiotemporal dependencies in EEGs using a graph neural network (GNN) and proposing two EEG graph structures that capture the electrode geometry or dynamic brain connectivity, (2) proposing a self-supervised pre-training method that predicts preprocessed signals for the next time period to further improve model performance, particularly on rare seizure types, and (3) proposing a quantitative model interpretability approach to assess a model’s ability to localize seizures within EEGs. When evaluating our approach on seizure detection and classification on a large public dataset (5,499 EEGs), we find that our GNN with self-supervised pre-training achieves 0.875 Area Under the Receiver Operating Characteristic Curve on seizure detection and 0.749 weighted F1-score on seizure classification, outperforming previous methods for both seizure detection and classification. Moreover, our self-supervised pre-training strategy significantly improves classification of rare seizure types (e.g. 47 points increase in combined tonic seizure accuracy over baselines). Furthermore, quantitative interpretability analysis shows that our GNN with self-supervised pre-training precisely localizes $2 5 . 4 \%$ focal seizures, a 21.9 point improvement over existing CNNs. Finally, by superimposing the identified seizure locations on both raw EEG signals and EEG graphs, our approach could provide clinicians with an intuitive visualization of localized seizure regions.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Seizures are among the most common neurological emergencies in the world (Strein et al., 2019). Seizures can be chronic as in the case of epilepsy, a neurological disease affecting 50 million people worldwide (WHO, 2019). Clinically, definitive detection of a seizure is only the first step in seizure diagnosis. An important subsequent step is to classify seizures into finer-grained types––such as focal versus generalized seizures––for identifying epilepsy syndromes, targeted therapies, and eligibility for epilepsy surgery (Fisher et al., 2017).
|
| 15 |
+
|
| 16 |
+
Scalp electroencephalography (or “EEG”) plays a critical role in seizure detection and classification. Clinically, EEG-based seizure detection and classification are performed by a trained EEG reader who visually examines a patient’s EEG signals over time periods ranging from hours to days. However, this manual analysis is extremely resource- and time-intensive, and thus automated algorithms could greatly accelerate seizure diagnosis and improve outcomes for severely ill patients.
|
| 17 |
+
|
| 18 |
+

|
| 19 |
+
Figure 1: (a) EEG electrode placement in the standard 10-20 system. (b) Distance-based EEG graph. (c) An example correlation-based EEG graph. (d) Overview of our methods. The inputs to the models are the EEG graphs, where each node feature corresponds to the preprocessed EEG signals in the respective channel. Self-edges are not shown for better visualization.
|
| 20 |
+
|
| 21 |
+
Although a large number of studies have attempted automated seizure detection (Rasheed et al., 2020; Siddiqui et al., 2020; Shoeibi et al., 2021; O’Shea et al., 2020; Saab et al., 2020) or seizure classification (Raghu et al., 2020; Asif et al., 2020; Iesmantas & Alzbutas, 2020; Ahmedt-Aristizabal et al., 2020; Roy et al., 2019), several challenges remain largely unaddressed. First, most recent studies use convolutional neural networks (CNNs) that assume Euclidean structures in EEG signals or spectrograms (Rasheed et al., 2020; Shoeibi et al., 2021; Raghu et al., 2020; Asif et al., 2020; Iesmantas & Alzbutas, 2020; Ahmedt-Aristizabal et al., 2020; Roy et al., 2019; O’Shea et al., 2020; Saab et al., 2020). However, assumption of Euclidean structure ignores the natural geometry of EEG electrodes and the connectivity in brain networks. EEGs are measured by electrodes placed on a manifold (i.e. patient’s scalp) (Figure 1a), and thus have inherent non-Euclidean structures. Graphs are a data structure that can represent complex, non-Euclidean data (Chami et al., 2020; Bronstein et al., 2017), and graph theory has been extensively used in modeling brain networks (Bullmore & Sporns, 2009). We therefore hypothesize that graph-based modeling approaches can better represent the inherent non-Euclidean structures in EEGs in a manner that improves both the performance and the clinical utility of seizure detection and classification models. Although traditional graph theory has been used (Supriya et al., 2021), only a few deep learning studies have modeled EEGs as graphs for seizure detection. However, these graph-based studies were limited to nonpublic (Covert et al., 2019) or small datasets (Craley et al., 2019; Li et al., 2021), did not leverage modern self-supervised approaches or examine seizure classification (Cisotto et al., 2020; Zhao et al., 2021; Li et al., 2021).
|
| 22 |
+
|
| 23 |
+
Second, certain seizure types (e.g. clonic seizures) are rare by nature. Training machine learning models that perform well on these rarer seizure classes using traditional supervised learning approaches is challenging, which could explain the performance difference between major and minority seizure types in prior studies (Raghu et al., 2020; Iesmantas & Alzbutas, 2020; AhmedtAristizabal et al., 2020). Several studies have investigated an alternative, self-supervised training strategy (Banville et al., 2020; Mohsenvand et al., 2020; Kostas et al., 2021; Martini et al., 2021; Xu et al., 2020), but they did not model EEGs as graphs or address automated seizure classification. Prior works have shown that self-supervised pre-training significantly improves model performance on data with imbalanced labels in the field of computer vision (Yang & Xu, 2020; Liu et al., 2021). Hence, we hypothesize that self-supervised pre-training can help improve our graph model performance on rare seizure types. Moreover, a large portion of EEG signals generally do not have seizures. Self-supervised pre-training strategy would allow the model to leverage the abundant nonseizure EEGs that are readily available in the dataset.
|
| 24 |
+
|
| 25 |
+
Lastly, for seizure detection and classification models, the ability to not only provide a single prediction across all EEG channels, but also to provide the interpretability and the ability to localize seizures would be clinically useful for informing treatment strategy. While prior studies (Saab et al., 2020; Covert et al., 2019) have shown qualitative visualization for model interpretability, none have quantitatively assessed the model’s ability to localize seizures.
|
| 26 |
+
|
| 27 |
+
In this work, we aim to address these limitations in prior automated seizure detection and classification studies. First, we propose a graph-based modeling approach for EEG-based seizure detection and classification. Specifically, we propose two EEG graph structures that capture EEG sensor geometry (Figure 1b) or dynamic brain connectivity (Figure 1c), and we extend Diffusion Convolutional Recurrent Neural Network (DCRNN) (Li et al., 2018), an RNN with graph diffusion convolutions, to model the spatiotemporal dependencies in EEGs (Figure 1d). Second, we improve DCRNN performance using a self-supervised pre-training strategy of predicting the preprocessed EEG signals for the next time period without requiring additional data or labels. Finally, we propose quantitative metrics to assess our model’s ability to localize seizures. In summary:
|
| 28 |
+
|
| 29 |
+
• We propose two EEG graph structures that capture (1) the natural geometry of EEG sensors or (2) dynamic connectivity in the brain, and show that building a recurrent graph neural network (GNN) based on these representations yields models for seizure detection and classification that outperform previous approaches on a large public dataset (5,499 EEGs). • We propose a self-supervised pre-training strategy to further improve our recurrent GNN model performance, particularly on rare seizure types. To our knowledge, our study is the first to date that combines graph-based modeling and self-supervised pre-training for EEGs. By leveraging graph structure and self-supervision, our method achieves 0.875 Area Under the Receiver Operating Characteristic Curve (AUROC) on seizure detection and 0.749 weighted F1-score on seizure classification, outperforming previous approaches on both seizure detection and classification on this large public dataset. Moreover, our selfsupervised pre-training method substantially improves classification of rare seizure types (e.g. 47 points increase in combined tonic seizure accuracy over baselines). • We propose a quantitative model interpretability analysis that can be used to assess a model’s ability to localize seizures, which is critical to determining the course of treatment for seizures. We show that by leveraging graph structure and self-supervision, our method precisely localizes $2 5 . 4 \%$ focal seizures, providing 21.9 points improvement over a prior state-of-the-art CNN. Finally, by displaying the identified seizure regions on raw EEG signals and EEG graphs, our approach could provide valuable insights that support more effective seizure diagnosis in real-world clinical settings.
|
| 30 |
+
|
| 31 |
+
# 2 METHODS
|
| 32 |
+
|
| 33 |
+
# 2.1 SEIZURE DETECTION AND CLASSIFICATION PROBLEM FORMULATION
|
| 34 |
+
|
| 35 |
+
The goal of seizure detection is to predict whether a seizure exists within an EEG clip, and the goal of seizure classification is to predict the seizure type given a seizure EEG clip. Following a prior study (Saab et al., 2020), we examine our model’s capability for fast and slow detection and classification over 12-s and 60-s EEG clips, respectively.
|
| 36 |
+
|
| 37 |
+
# 2.2 GRAPH-BASED MODELING FOR EEGS
|
| 38 |
+
|
| 39 |
+
# 2.2.1 REPRESENTING EEGS AS GRAPHS
|
| 40 |
+
|
| 41 |
+
We represent an EEG clip as a graph $\mathcal { G } = \{ \mathcal { V } , \mathcal { E } , W \}$ , where $\nu$ denotes the set of nodes (i.e. EEG electrodes/channels), $\mathcal { E }$ denotes the set of edges, and $W$ is the adjacency matrix. We propose the following two methods of constructing the EEG graph.
|
| 42 |
+
|
| 43 |
+
Distance graph. To represent the natural geometry of EEG electrodes, we compute edge weight $W _ { i j }$ by applying a thresholded Gaussian kernel (Shuman et al., 2013) to the pairwise Euclidean distance between $v _ { i }$ and $v _ { j }$ , i.e., $W _ { i j } = \exp \biggl ( - \frac { \mathrm { d i s t } ( v _ { i } , v _ { j } ) ^ { 2 } } { \sigma ^ { 2 } } \biggr )$ if $\mathrm { d i s t } ( v _ { i } , v _ { j } ) \le \kappa$ , else 0. Here, $\mathrm { d i s t } ( v _ { i } , v _ { j } )$ is the Euclidean distance between electrodes $v _ { i }$ and $v _ { j }$ according to the standard 10-20 EEG electrode placement (Jasper, 1958), $\sigma$ is the standard deviation of the distances, and $\kappa$ is the threshold for sparsity. This results in a universal undirected, weighted graph for all EEG clips. Based on preliminary experiments and EEG domain knowledge, we chose $\kappa = 0 . 9$ because it results in a reasonable graph that also resembles the EEG montage (longitudinal bipolar and transverse bipolar) widely used clinically (Acharya et al., 2016). Figure 1b shows the distance graph with $\kappa = 0 . 9$ . In Appendix K, we explore different values of $\kappa$ as well as constructing the distance graph using a Gaussian kernel with a pre-specified bandwidth.
|
| 44 |
+
|
| 45 |
+
Correlation graph. To capture dynamic brain connectivity, we define the edge weight $W _ { i j }$ as the absolute value of the normalized cross-correlation between the preprocessed signals in $v _ { i }$ and $v _ { j }$ . To introduce sparsity to the graph, only the edges whose weights are among the top- $\tau$ neighbors of each node are kept (plus self-edges), i.e., $\bar { W _ { i j } } = | X _ { : , i , : } * \mathbf { \bar { X } } _ { : , j , : } |$ if $v _ { j } \in \mathcal { N } ( v _ { i } )$ , else 0. Here, $X _ { : , i , : }$ : and $X _ { : , j , }$ : are preprocessed signals in $v _ { i }$ and $v _ { j }$ , $^ *$ represents the normalized cross-correlation, and $\mathcal { N } ( v _ { i } )$ represents the top- $\tau$ neighbors of $v _ { i }$ . This method results in a unique directed, weighted graph for each input EEG clip. Figure 1c shows an example correlation graph with $\tau = 3$ .
|
| 46 |
+
|
| 47 |
+
# 2.2.2 GRAPH NEURAL NETWORK
|
| 48 |
+
|
| 49 |
+
We adapt DCRNN (Li et al., 2018), a recurrent neural network with graph diffusion convolutions, to model the spatiotemporal dependencies in EEG signals. DCRNN was initially developed for traffic forecasting, where the dynamics of traffic flow are modeled as a diffusion process. Similarly, we can also model the spatial dependency in EEG signals as a diffusion process, because an electrode can be influenced more by electrodes in its anatomical proximity (measured by distance) (Acharya et al., 2016) or functional proximity (measured by correlation) (Sakkalis, 2011). Specifically, the diffusion process is characterized by a bidirectional random walk on a directed graph $\mathcal { G }$ , which results in the following diffusion convolution (Li et al., 2018):
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
X _ { : , m \star \mathcal { G } } f _ { \theta } = \sum _ { k = 0 } ^ { K - 1 } \big ( \theta _ { k , 1 } ( D _ { \mathcal { O } } ^ { - 1 } W ) ^ { k } + \theta _ { k , 2 } ( D _ { I } ^ { - 1 } W ^ { \top } ) ^ { k } \big ) X _ { : , m } \mathrm { f o r } m \in \{ 1 , . . . , M \}
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
where $\pmb { X } \in \mathbb { R } ^ { N \times M }$ is the preprocessed EEG clip at time step $t \in \{ 1 , . . . , T \}$ with $N$ nodes and $M$ features, $f _ { \theta }$ is the convolution filter with parameters $\boldsymbol { \theta } \in \mathbb { R } ^ { K \times 2 }$ , $D _ { O }$ and $D _ { I }$ are the out-degree and in-degree diagonal matrices of the graph, respectively, $D _ { O } ^ { - 1 } W$ and $D _ { I } ^ { - 1 } W ^ { \top }$ are the state transition matrices of the outward and inward diffusion processes, respectively, and $K$ is the number of maximum diffusion steps.
|
| 56 |
+
|
| 57 |
+
For undirected graphs, the diffusion convolution is similar to ChebNet spectral graph convolution (Defferrard et al., 2016) up to a constant scaling factor, and thus can be computed using stable Chebyshev polynomial bases as follows (Li et al., 2018):
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
{ \cal X } _ { : , m \star \mathcal { G } } f _ { \theta } = \Phi \bigg ( \sum _ { k = 0 } ^ { K - 1 } \theta _ { k } { \bf A } ^ { k } \bigg ) \Phi ^ { \top } { \cal X } _ { : , m } = \sum _ { k = 0 } ^ { K - 1 } \theta _ { k } L ^ { k } { \cal X } _ { : , m } = \sum _ { k = 0 } ^ { K - 1 } \tilde { \theta } _ { k } T _ { k } ( \tilde { L } ) { \cal X } _ { : , m } \mathrm { f o r } m \in \{ 1 , . . . , M \}
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
where $T _ { 0 } ( x ) = 1 , T _ { 1 } ( x ) = x$ , and $T _ { k } ( x ) = 2 x T _ { k - 1 } ( x ) - T _ { k - 2 } ( x )$ for $k \geq 2$ are the bases of the Chebyshev polynomial, $L = D ^ { - { \frac { 1 } { 2 } } } ( D - W ) D ^ { - { \frac { 1 } { 2 } } } = \Phi \Lambda \Phi ^ { \top }$ is the normalized graph Laplacian, and $\begin{array} { r } { \tilde { \pmb { L } } = \frac { 2 } { \lambda _ { m a x } } \pmb { L } - \pmb { I } } \end{array}$ is the scaled graph Laplacian mapping eigenvalues from $[ 0 , \lambda _ { m a x } ]$ to $[ - 1 , 1 ]$ . We use Equation 1 for directed correlation graphs, and Equation 2 for undirected distance graph.
|
| 64 |
+
|
| 65 |
+
Next, to model the temporal dependency in EEGs, we employ Gated Recurrent Units (GRUs) (Cho et al., 2014), a variant of RNN with a gating mechanism. Specifically, the matrix multiplications in GRUs are replaced with diffusion convolutions (or ChebNet spectral graph convolutions for undirected distance-based graph) (Li et al., 2018), allowing spatiotemporal modeling of EEG signals (referred to as “DCGRU”):
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\pmb { r } ^ { ( t ) } = \sigma \big ( \Theta _ { r \star \mathscr { G } } [ \pmb { X } ^ { ( t ) } , \pmb { H } ^ { ( t - 1 ) } ] + \mathbf { b } _ { r } \big ) \qquad \pmb { u } ^ { ( t ) } = \sigma \big ( \Theta _ { u \star \mathscr { G } } [ \pmb { X } ^ { ( t ) } , \pmb { H } ^ { ( t - 1 ) } ] + \mathbf { b } _ { u } \big )
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
C ^ { ( t ) } = \mathrm { t a n h } \big ( \Theta _ { C \times \mathcal { G } } [ \mathbf { X } ^ { ( t ) } , ( { \boldsymbol { r } } ^ { ( t ) } \odot \pmb { H } ^ { ( t - 1 ) } ) ] + \mathbf { b } _ { C } \big ) \quad \pmb { H } ^ { ( t ) } = \pmb { u } ^ { ( t ) } \odot \pmb { H } ^ { ( t - 1 ) } + ( 1 - \pmb { u } ^ { ( t ) } ) \odot \pmb { C } ^ { ( t ) }
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
Here, $\mathbf { \boldsymbol { X } } ^ { ( t ) } , \mathbf { \boldsymbol { H } } ^ { ( t ) }$ denote the input and output of DCGRU at time step $t$ respectively, $\sigma$ denotes Sigmoid function, $\odot$ represents the Hadamard product, $\boldsymbol { r } ^ { ( t ) } , \boldsymbol { u } ^ { ( t ) }$ , $C ^ { ( t ) }$ denote reset gate, update gate and candidate at time step $t$ respectively, $\star \mathcal { G }$ denotes the diffusion convolution (or ChebNet spectral graph convolution), $\Theta _ { r }$ , ${ \bf b } _ { r }$ , $\Theta _ { u }$ $\mathbf { \Delta } ) _ { u } , \mathbf { b } _ { u } , \mathbf { e }$ $\Theta _ { C }$ and ${ \bf b } _ { C }$ are the weights and biases for the corresponding convolutional filters. Finally, for seizure detection and classification, the models consist of several stacked DCGRUs followed by a fully-connected layer.
|
| 76 |
+
|
| 77 |
+
# 2.3 SELF-SUPERVISED PRE-TRAINING
|
| 78 |
+
|
| 79 |
+
To further improve DCRNN performance, we propose a self-supervised pre-training strategy for EEGs. Specifically, we pre-train the model for predicting the next $T ^ { \prime }$ second preprocessed EEG clips given a preprocessed 12-s (60-s) EEG clip. We hypothesize that by learning to predict the EEG signals for the next time period, the model would learn task-agnostic representations and improve downstream seizure detection and classification tasks. The model for self-supervised pre-training has a sequence-to-sequence architecture with an encoder and a decoder (Sutskever et al., 2014), each of which has several stacked DCGRUs (Figure 1d). We use mean absolute error between the true preprocessed EEG clips and the predicted clips as the loss function. Preliminary experiments suggest that predicting future $T ^ { \prime } = 1 2$ second preprocessed EEG clips results in low regression loss on the validation set, and thus we use $T ^ { \prime } = 1 2$ in all self-supervised pre-training experiments.
|
| 80 |
+
|
| 81 |
+
# 2.4 MODEL INTERPRETABILITY AND ABILITY TO LOCALIZE SEIZURES
|
| 82 |
+
|
| 83 |
+
We perform model interpretability analyses using an occlusion-based approach (Zeiler & Fergus, 2013). First, for seizure detection, we zero-fill one second EEG signals in one channel at a time and compute the relative change in the model’s output logit with respect to the original non-occluded output (original − occluded). Furthermore, we scale the values in each clip to $[ 0 , 1 ]$ using the minimum and maximum values in that clip. This results in an occlusion map $M \in \mathbb { R } ^ { \bar { N } \times T }$ , where $N$ is the number of EEG channels, $T$ is the clip length, and $M _ { i j }$ indicates the relative change in the model output when the $j$ -th second EEG clip in the $i$ -th channel is occluded. A larger $M _ { i j }$ indicates that the occluded region is more important for predicting seizure, and vice versa. We visualize $M$ by superimposing it over raw EEG signals and graph structures.
|
| 84 |
+
|
| 85 |
+
In addition to visually analyzing the aforementioned occlusion maps, we propose quantitative metrics to evaluate the model’s capability of localizing seizures based on the occlusion maps. Specifically, we define a coverage metric that quantifies how many true seizure regions are detected, as well as a localization metric that quantifies how many detected seizure regions are true seizure regions. Note that coverage and localization scores are analogous to recall and precision, respectively, in binary classification problems. Mathematically, let $M ^ { \bar { \mathrm { a n n o t } } } \in \mathbb { R } ^ { N \times T }$ be detailed annotations of seizure duration and location, where $M _ { i j } ^ { \mathrm { a n n o t } } = \mathrm { i }$ if there is a seizure at the $j$ -th second in the $i$ -th channel, otherwise $M _ { i j } ^ { \mathrm { a n n o t } } = 0$ . Let $\boldsymbol { M } \in \mathbb { R } ^ { N \times T }$ be the occlusion map described above. Then $\mathrm { c o v e r a g e } = \frac { \sum _ { i , j } \mathbf { 1 } _ { M _ { i j } } > 0 . 5 } { \sum _ { i , j } M _ { i j } ^ { \mathrm { a n n o t } } } \mathrm { a n d l o c a l i z a t i o n } = \frac { \sum _ { i , j } \mathbf { 1 } _ { M _ { i j } > 0 . 5 } M _ { i j } ^ { \mathrm { a n n o t } } } { \sum _ { i , j } \mathbf { 1 } _ { M _ { i j } > 0 . 5 } } .$
|
| 86 |
+
|
| 87 |
+
Finally, we also perform occlusion-based interpretability analysis for seizure classification. Since the goal of seizure classification is to predict the seizure type given a seizure EEG clip, we hypothesize that the difference in signals between EEG channels are more important for predicting seizure types. Therefore, we completely drop one EEG channel at a time, and compute the relative change in the model output with respect to the original output. This results in an occlusion map $M ^ { \prime } \in \mathbb { R } ^ { \tilde { N } }$ , where $M _ { i } ^ { \prime }$ indicates the relative change in the model output when the $i$ -th channel is dropped.
|
| 88 |
+
|
| 89 |
+
# 3 EXPERIMENTS
|
| 90 |
+
|
| 91 |
+
# 3.1 EXPERIMENTAL SETUP
|
| 92 |
+
|
| 93 |
+
Dataset. We use the public Temple University Hospital EEG Seizure Corpus (TUSZ) v1.5.2 (Shah et al., 2018; Obeid & Picone, 2016), the largest public EEG seizure database to date with 5,612 EEGs, 3,050 annotated seizures from clinical recordings, and eight seizure types1. We include 19 EEG channels in the standard 10-20 system (Figure 1b–1c). To evaluate model generalizability to unseen patients, we exclude five patients from the official TUSZ test set who exist in both the official TUSZ train and test sets. Moreover, we use the detailed annotations of seizure duration and location available in TUSZ for our interpretability analyses. Table 1 summarizes the TUSZ data.
|
| 94 |
+
|
| 95 |
+
Data preprocessing. Because seizures are associated with brain electrical activity in certain frequency bands (Tzallas et al., 2009), we perform data preprocessing to transform raw EEG signals to the frequency domain. Similar to prior studies (Asif et al., 2020; Ahmedt-Aristizabal et al., 2020; Covert et al., 2019), we obtain the log-amplitudes of the fast Fourier transform of raw EEG signals. For seizure detection and self-supervised pre-training, we use both seizure and non-seizure
|
| 96 |
+
|
| 97 |
+
EEGs, and obtain the 12-s (60-s) EEG clips using non-overlapping 12-s (60-s) sliding windows. For seizure classification, we use only seizure EEGs, and obtain one 12-s (60-s) EEG clip from each seizure event, such that each EEG clip has exactly one seizure type. Appendix A presents details of data preprocessing, and Appendix B compares results of frequency-domain vs time-domain inputs.
|
| 98 |
+
|
| 99 |
+
Refined seizure classification scheme. Because simple partial (SP) seizures and complex partial (CP) seizures are focal seizures characterized by a clinical behavior (consciousness during a seizure) and are not distinguishable by EEG signals alone (Fisher et al., 2017), we combine focal non-specific (FN), SP, and CP seizures to form a combined focal (CF) seizure class. We provide extensive experiments in Appendix C showing that these focal seizure types cannot be distinguished by a variety of models. We also exclude myoclonic seizures because only three myoclonic seizures are available in TUSZ. In addition, since tonic and tonic-clonic seizures are rare in the dataset (only 18 tonic seizures and 30 tonic-clonic seizures in TUSZ train set), and tonic-clonic seizures always start with a tonic phase (Fisher et al., 2017), we combine tonic-clonic seizures with tonic seizures to form a combined tonic (CT) seizure class. In summary, there are four seizure classes in total: CF, generalized non-specific (GN), absence (AB), and CT seizures (Table 1). In Appendix L, we show seizure classification results on the original eight seizure types in TUSZ.
|
| 100 |
+
|
| 101 |
+
Data splits. We randomly split the official TUSZ train set by patients into train and validation sets by 90/10 for model training and hyperparameter tuning, respectively, and we hold-out the official TUSZ test set for model evaluation (excluding five patients who exist in both the official TUSZ train and test sets). The train, validation, and test sets consist of distinct patients. See Appendix D for the number of preprocessed EEG clips and patients in each split.
|
| 102 |
+
|
| 103 |
+
Table 1: Summary of data in train and test sets of TUSZ v1.5.2. used in our study.
|
| 104 |
+
|
| 105 |
+
<table><tr><td></td><td>EEG Files (% Seizure)</td><td>Patients (% Seizure)</td><td>Total Duration (% Seizure)</td><td>CF Seizures (Patients)</td><td>GN Seizures (Patients)</td><td>AB Seizures (Patients)</td><td>CT Seizures (Patients)</td></tr><tr><td>Train Set</td><td>4,599 (18.9%)</td><td>592 (34.1%)</td><td>45,174.72 min (6.3%)</td><td>1,868 (148)</td><td>409 (68)</td><td>50(7)</td><td>48 (11)</td></tr><tr><td>Test Set</td><td>900 (25.6%)</td><td>45 (77.8%)</td><td>9,031.58 min (9.8%)</td><td>297 (24)</td><td>114 (11)</td><td>49 (5)</td><td>61 (4)</td></tr></table>
|
| 106 |
+
|
| 107 |
+
Baselines. To compare our DCRNN to traditional CNNs/RNNs, we include three primary baselines: (a) Dense-CNN (Saab et al., 2020), a previous state-of-the-art CNN for seizure detection, (b) LSTM (Hochreiter & Schmidhuber, 1997), and (c) CNN-LSTM (implemented following AhmedtAristizabal et al. (2020)). The baselines are trained and evaluated on the same preprocessed data. Additionally, we compare our method to the reported results of two CNNs for seizure classification that use TUSZ and test on unseen patients (Asif et al., 2020; Iesmantas & Alzbutas, 2020).
|
| 108 |
+
|
| 109 |
+
Model training. Training for all models was accomplished using the Adam optimizer (Kingma & Ba, 2014) in PyTorch on a single NVIDIA Titan RTX GPU. Model parameters were randomly initialized for models without self-supervised pre-training, and were initialized with the pre-trained weights of the encoder for models with self-supervised pre-training. All models were run for five runs with different random seeds. Detailed hyperparameter settings are shown in Appendix E. During training, we perform data augmentation as described in Appendix F.
|
| 110 |
+
|
| 111 |
+
# 3.2 EXPERIMENTAL RESULTS
|
| 112 |
+
|
| 113 |
+
Graph neural network performance. Following recent studies (Asif et al., 2020; AhmedtAristizabal et al., 2020; O’Shea et al., 2020; Saab et al., 2020; Covert et al., 2019), we use AUROC and weighted F1-score as the main evaluation metrics for seizure detection and classification, respectively. Table 2 (3rd–7th rows) shows the performance of our DCRNN (without self-supervised pre-training) and the baselines. Distance graph-based DCRNN (or “Dist-DCRNN”) and correlation graph-based DCRNN (or “Corr-DCRNN”) without self-supervised pre-training perform on par with or better than the baselines. See Appendix G for additional evaluation scores.
|
| 114 |
+
|
| 115 |
+
Moreover, DCRNN outperforms the reported results of two existing CNNs (Asif et al., 2020; Ahmedt-Aristizabal et al., 2020) on seizure classification (Table 3). For fair comparison to Asif et al. (2020), we conduct 7-class seizure classification2 on the same 3-fold patient-wise split.
|
| 116 |
+
|
| 117 |
+
In addition, we conduct an ablation experiment to examine the effectiveness of Fourier transform in our preprocessing step for DCRNNs. We find that frequency-domain inputs substantially outperform time-domain inputs on both seizure detection and classification (Appendix B).
|
| 118 |
+
|
| 119 |
+
Table 2: Seizure detection and seizure classification results. Mean and standard deviations are from five random runs. Best non-pretrained and pre-trained mean results are highlighted in bold.
|
| 120 |
+
|
| 121 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">Seizure Detection AUROC</td><td colspan="2">Seizure Classification Weighted F1-Score</td></tr><tr><td>12-s</td><td>60-s</td><td>12-s</td><td>60-s</td></tr><tr><td>Dense-CNN</td><td>0.812 ± 0.014</td><td>0.796 ± 0.014</td><td>0.576 ± 0.101</td><td>0.626 ± 0.073</td></tr><tr><td>LSTM</td><td>0.786 ± 0.014</td><td>0.715 ± 0.016</td><td>0.652 ± 0.019</td><td>0.686 ± 0.020</td></tr><tr><td>CNN-LSTM</td><td>0.749 ± 0.006</td><td>0.682 ± 0.003</td><td>0.633 ± 0.025</td><td>0.641 ± 0.019</td></tr><tr><td>Corr-DCRNN w/o Pre-training</td><td>0.812 ± 0.012</td><td>0.804 ± 0.015</td><td>0.710 ± 0.023</td><td>0.701 ± 0.030</td></tr><tr><td>Dist-DCRNN w/o Pre-training</td><td>0.824 ± 0.020</td><td>0.793 ± 0.022</td><td>0.703 ± 0.025</td><td>0.690 ± 0.035</td></tr><tr><td>Corr-DCRNN w/ Pre-training</td><td>0.861 ± 0.005</td><td>0.850 ± 0.014</td><td>0.723 ± 0.017</td><td>0.749 ± 0.017</td></tr><tr><td>Dist-DCRNN w/Pre-training</td><td>0.866 ± 0.016</td><td>0.875 ± 0.016</td><td>0.746 ± 0.024</td><td>0.749 ± 0.028</td></tr></table>
|
| 122 |
+
|
| 123 |
+
Table 3: Comparison between DCRNNs (w/o pre-training) and existing CNNs on seizure classification. Mean and standard deviations are from five random runs. Best mean results are in bold.
|
| 124 |
+
|
| 125 |
+
<table><tr><td>Model</td><td>7-Class Classification Weighted F1-Score</td><td>CF Seizure AUROC</td><td>GN Seizure AUROC</td><td>AB Seizure AUROC</td><td>CT Seizure AUROC</td></tr><tr><td>Asif et al. (2020)</td><td>0.62</td><td>=</td><td>1</td><td>-</td><td>-</td></tr><tr><td>Iesmantas & Alzbutas (2020)</td><td>-</td><td></td><td>0.78</td><td>0.72</td><td>-</td></tr><tr><td>Corr-DCRNN,12-s</td><td>0.619 ± 0.006</td><td>0.907 ± 0.008</td><td>0.815 ± 0.027</td><td>0.972 ± 0.013</td><td>0.908 ± 0.005</td></tr><tr><td>Dist-DCRNN,12-s</td><td>0.585 ± 0.006</td><td>0.896 ± 0.011</td><td>0.814 ± 0.027</td><td>0.983 ± 0.008</td><td>0.890 ± 0.014</td></tr><tr><td>Corr-DCRNN, 60-s</td><td>0.650 ± 0.008</td><td>0.914 ± 0.007</td><td>0.795 ± 0.031</td><td>0.971 ± 0.020</td><td>0.939 ± 0.008</td></tr><tr><td>Dist-DCRNN, 60-s</td><td>0.606 ± 0.009</td><td>0.920 ± 0.004</td><td>0.811 ± 0.032</td><td>0.973 ± 0.009</td><td>0.926 ± 0.020</td></tr></table>
|
| 126 |
+
|
| 127 |
+
Self-supervised pre-training improves graph neural network performance. To assess the effectiveness of self-supervised pre-training in improving DCRNN’s performance, we compare the results of DCRNN without and with self-supervised pre-training. As shown in Table 2 (last two rows), DCRNN with self-supervised pre-training outperforms its non-pretrained counterpart on both seizure detection and classification. Notably, Dist-DCRNN with self-supervised pre-training achieves an AUROC of 0.875 for 60-s seizure detection, matching the performance of a CNN (AU$\mathrm { R O C } { = } 0 . 8 8 $ that was pre-trained using supervised learning on a labeled dataset that was five times larger than TUSZ (Saab et al., 2020). Importantly, the pre-trained model weights are used for both seizure detection and classification, which indicates that our self-supervised pre-training method provides good model initialization that generalizes across tasks.
|
| 128 |
+
|
| 129 |
+
Figure 2a shows the ROC curves of median DCRNNs and baselines for seizure detection. At a low false positive rate (FPR), such as $2 5 \%$ FPR, pre-trained Dist-DCRNN achieves $8 4 . 3 \%$ true positive rate (TPR) and pre-trained Corr-DCRNN achieves $8 1 . 7 \%$ TPR on 12-s clips. Conversely, DenseCNN, LSTM, and CNN-LSTM only achieve $7 2 . 8 \%$ , $6 7 . 0 \%$ , and $6 2 . 5 \%$ TPRs, respectively. Figure 2b shows the confusion matrices for Dist-DCRNNs and baselines for 12-s seizure classification. Dist-DCRNN without self-supervised pre-training achieves $93 \%$ accuracy on the rare AB seizures, providing 2 points increase over the best baseline. Furthermore, Dist-DCRNN with self-supervised pre-training achieves $74 \%$ accuracy on the rare CT seizures, providing 47 points increase in accuracy over the best baseline (Dense-CNN) and 48 points increase over non-pretrained Dist-DCRNN.
|
| 130 |
+
|
| 131 |
+
Surprisingly, despite being a majority class, many GN seizures are misclassified as CF seizures (Figure 2b). A board-certified neurologist manually analyzed the EEGs of 32 misclassified test GN seizures. We find that 27 seizures are in fact focal seizures but are mislabeled as GN seizures. In contrast, only 5 seizures are indeed generalized seizures but are misclassified by our models.
|
| 132 |
+
|
| 133 |
+
Comparison between self-supervised pre-training and transfer learning. To compare our selfsupervised pre-training strategy to traditional transfer learning approaches, we pre-train DCRNNs for seizure detection and self-supervised prediction, respectively, on a large in-house dataset (40,316 EEGs, Table 7) and finetune the models for seizure detection and classification on TUSZ. We find that self-supervised pre-training consistently outperforms transfer learning (Appendix J).
|
| 134 |
+
|
| 135 |
+
Comparison between self-supervised pre-training and auxiliary learning. We also investigate whether using the self-supervised task as an auxiliary task can outperform self-supervised pretraining. We find that auxiliary learning performs comparable to self-supervised pre-training on 12-s seizure detection, whereas self-supervised pre-training significantly outperforms auxiliary learning on 60-s seizure detection. See Appendix M and Table 10 for details.
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
Figure 2: (a) ROC curves of median models for seizure detection. (b) Confusion matrices (averaged across five random runs) for the baselines and Dist-DCRNN without and with self-supervised pre-training for 12-s seizure classification. Each row of the confusion matrices is normalized by dividing by the number of examples in the corresponding class, such that each row sums up to one.
|
| 139 |
+
Figure 3: Occlusion maps for seizure detection obtained from Corr-DCRNN model for (a)–(b) focal, and (c)–(d) generalized seizures. In each subfigure, left panel shows the occlusion map for 12-s when a seizure occurs and right panel shows the occlusion map values averaged along time and overlaid on the corresponding correlation graph.
|
| 140 |
+
|
| 141 |
+
Improved model interpretability and ability to localize seizures. We leverage occlusion-based techniques to localize seizures using our model predictions. Figure 3 shows example occlusion maps of correctly predicted 60-s test EEG clips from Corr-DCRNN with self-supervised pre-training. We observe that high saliency for focal seizures (Figures 3a–3b) is localized in the more abnormal EEG channels, whereas high saliency for generalized seizures (Figures 3c–3d) is more diffuse across channels. These patterns reflect the underlying brain activity of focal seizures (i.e. localized in one brain area) and generalized seizures (i.e. occur in all areas of the brain) (Fisher et al., 2017). Moreover, one can also interpret the seizure locations from the occlusion map overlaid on the graphs. In Figure 3a, Fp2, F4 and F8 are highlighted on the graph occlusion map, which correspond to the right frontal, central frontal, and anterior frontal brain regions that show the most abnormality in the EEG. In Figure 3b, while the seizure starts in P3, Fp1, F3, and F7, the graph occlusion map mainly highlights the central parietal region (P3), which is likely due to the ongoing artifact in channels Fp1-F7, Fp1-F3, and F3-C3. Figure 3c–3d show two generalized seizures that occur in all regions of the brain, and the highlighted nodes on the graphs are indeed more spread out across channels. In contrast, high saliency from Dense-CNN does not localize in any seizure regions (Appendix H).
|
| 142 |
+
|
| 143 |
+
Additionally, we leverage detailed annotations of seizure duration and location available in TUSZ dataset, and use coverage and localization scores to quantify the models’ ability to accurately localize seizures. Figure 4 shows coverage and localization distributions for Dense-CNN and DCRNNs (w/o and with pre-training) on correctly predicted 60-s test EEG clips. Both Dist-DCRNN and Corr-DCRNN have many more occlusion maps with high coverage and high localization scores than Dense-CNN. This suggests that DCRNN more accurately localizes seizures than Dense-CNN, which is intuitive given that DCRNN captures the connectivity of EEG electrodes.
|
| 144 |
+
|
| 145 |
+
Clinically, localizing focal seizure onset regions is key to epilepsy surgery for patients with focal seizures. Thus, the model’s ability to identify focal seizure regions as precisely as possible would be highly desirable. Notably, pre-trained Corr-DCRNN precisely localizes $2 5 . 4 \%$ focal seizures and pre-trained Dist-DCRNN precisely localizes $2 1 . 8 \%$ focal seizures (localization score $> 0 . 8$ , Figure 4c). Conversely, both non-pretrained Dist-DCRNN and Corr-DCRNN precisely localize $6 . 3 \%$ focal seizures, and Dense-CNN only localizes $3 . 5 \%$ focal seizures precisely (localization score $> 0 . 8$ ). Figures 4e–4f show example occlusion maps of test focal seizures whose localization scores $> 0 . 9$ from pre-trained Corr-DCRNN, where high saliency overlaps well with annotated seizure regions.
|
| 146 |
+
|
| 147 |
+
Lastly, interpretability experiments on seizure classification show that high saliency EEG channels correspond to where the seizures are localized in CF seizures (Appendix I). This again suggests that our method could inform seizure locations for treatment strategy if used clinically.
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
Figure 4: Distributions of (a)–(b) coverage and (c)–(d) localization scores for Dense-CNN and DCRNNs on correctly predicted 60-s EEG clips for focal and generalized seizures. (e)–(f) Example occlusion maps with focal seizure whose localization ${ > } 0 . 9$ from pre-trained Corr-DCRNN. Only regions with normalized occlusion value ${ > } 0 . 5$ are colored. Red boxes are annotated seizure regions.
|
| 151 |
+
|
| 152 |
+
Comparison between graph structures. While Dist-DCRNN and Corr-DCRNN perform comparable to each other on seizure detection and classification (Table 2), we observe that Corr-DCRNN better localizes focal seizures than Dist-DCRNN, particularly when combined with self-supervised pre-training (e.g., coverage and localization scores $> 0 . 9$ in Figure 4a, 4c). This suggests that the correlation-based graph structure could provide better interpretability and representation of focal seizure EEGs. Moreover, the correlation graph structure has two particular advantages: (a) it can be used even when the physical locations of electrodes are unknown and (b) it captures dynamic brain connectivity rather than replying purely on spatial sensor information, which is particularly desirable for automated seizure detection and classification models.
|
| 153 |
+
|
| 154 |
+
# 4 CONCLUSION
|
| 155 |
+
|
| 156 |
+
In conclusion, we present a novel method combining graph-based modeling and self-supervised pretraining for EEG-based seizure detection and classification, as well as an interpretability method to quantify model ability to localize seizures. Our method sets new state-of-the-art on both seizure detection and classification on a large public dataset, significantly improves classification of rare seizure classes, and more accurately localizes seizures. We also find that the correlation-based graph more accurately localizes focal seizures than distance-based graph. The improved ability to localize seizures and the novel graph visualizations could provide clinicians with valuable insights about localized seizure regions in real-world clinical settings. Looking to the future, because our methods are not confined to EEG alone, our study opens exciting opportunities to build graph-based representations for a wide variety of medical time series.
|
| 157 |
+
|
| 158 |
+
# ACKNOWLEDGMENTS
|
| 159 |
+
|
| 160 |
+
This work was supported by a Wu Tsai Neurosciences Institute Neuroscience Translate Grant. The authors would like to thank Bibek Paudel, Liangqiong Qu, Jean Benoit Delbrouck, and Nandita Bhaskhar for their feedback on the paper.
|
| 161 |
+
|
| 162 |
+
# ETHICS STATEMENT
|
| 163 |
+
|
| 164 |
+
The Temple University Hospital EEG Seizure Corpus used in our study is anonymized and publicly available3 with full IRB approval (Shah et al., 2018; Obeid & Picone, 2016). No conflict of interest is reported from the authors. No harmful insights are provided by the seizure detection and classification models described in this study. Although we show that our methods could provide improved performance and clinical utility for seizure detection and classification, additional model validations are needed before they can be used in real-world clinical settings, including (a) validation on datasets from multiple institutions, (b) validation on different populations and age groups, and (c) validation on a EEG waveform-based seizure classification scheme that is approved by a consensus of board-certified neurologists.
|
| 165 |
+
|
| 166 |
+
# REPRODUCIBILITY STATEMENT
|
| 167 |
+
|
| 168 |
+
The Temple University Hospital EEG Seizure Corpus used in our study is publicly available. Detailed data preprocessing steps are provided in Appendix A. Source code is publicly available at https://github.com/tsy935/eeg-gnn-ssl.
|
| 169 |
+
|
| 170 |
+
# REFERENCES
|
| 171 |
+
|
| 172 |
+
Jayant N Acharya, Abeer J Hani, Parthasarathy Thirumala, and Tammy N Tsuchida. American clinical neurophysiology society guideline 3: a proposal for standard montages to be used in clinical eeg. The Neurodiagnostic Journal, 56(4):253–260, 2016.
|
| 173 |
+
|
| 174 |
+
David Ahmedt-Aristizabal, Tharindu Fernando, Simon Denman, Lars Petersson, Matthew J Aburn, and Clinton Fookes. Neural memory networks for seizure type classification. In 2020 42nd Annual International Conference of the IEEE Engineering in Medicine & Biology Society (EMBC), pp. 569–575. IEEE, 2020.
|
| 175 |
+
|
| 176 |
+
Umar Asif, Subhrajit Roy, Jianbin Tang, and Stefan Harrer. Seizurenet: Multi-spectral deep feature learning for seizure type classification. In Seyed Mostafa Kia, Hassan Mohy-ud Din, Ahmed Abdulkadir, Cher Bass, Mohamad Habes, Jane Maryam Rondina, Chantal Tax, Hongzhi Wang, Thomas Wolfers, Saima Rathore, and Madhura Ingalhalikar (eds.), Machine Learning in Clinical Neuroimaging and Radiogenomics in Neuro-oncology, pp. 77–87, Cham, 2020. Springer International Publishing.
|
| 177 |
+
|
| 178 |
+
Hubert Banville, Omar Chehab, Aapo Hyvarinen, Denis Engemann, and Alexandre Gramfort. Uncovering the structure of clinical eeg signals with self-supervised learning. Journal of Neural Engineering, 2020.
|
| 179 |
+
|
| 180 |
+
Michael M Bronstein, Joan Bruna, Yann LeCun, Arthur Szlam, and Pierre Vandergheynst. Geometric deep learning: going beyond euclidean data. IEEE Signal Processing Magazine, 34(4):18–42, 2017.
|
| 181 |
+
|
| 182 |
+
Ed Bullmore and Olaf Sporns. Complex brain networks: graph theoretical analysis of structural and functional systems. Nature reviews neuroscience, 10(3):186–198, 2009.
|
| 183 |
+
|
| 184 |
+
Ines Chami, Sami Abu-El-Haija, Bryan Perozzi, Christopher Re, and Kevin Murphy. Machine ´ learning on graphs: A model and comprehensive taxonomy. arXiv preprint arXiv:2005.03675, 2020.
|
| 185 |
+
|
| 186 |
+
Kyunghyun Cho, Bart van Merrienboer, Dzmitry Bahdanau, and Yoshua Bengio. On the properties ¨ of neural machine translation: Encoder–decoder approaches. In Proceedings of SSST-8, Eighth Workshop on Syntax, Semantics and Structure in Statistical Translation, pp. 103–111, Doha, Qatar, October 2014. Association for Computational Linguistics. doi: 10.3115/v1/W14-4012. URL https://www.aclweb.org/anthology/W14-4012.
|
| 187 |
+
|
| 188 |
+
Giulia Cisotto, Alessio Zanga, Joanna Chlebus, Italo Zoppis, Sara Manzoni, and Urszula Markowska-Kaczmar. Comparison of attention-based deep learning models for eeg classification. arXiv preprint arXiv:2012.01074, 2020.
|
| 189 |
+
|
| 190 |
+
Ian C. Covert, Balu Krishnan, Imad Najm, Jiening Zhan, Matthew Shore, John Hixson, and Ming Jack Po. Temporal graph convolutional networks for automatic seizure detection. In Proceedings of the 4th Machine Learning for Healthcare Conference, volume 106 of Proceedings of Machine Learning Research, pp. 160–180, Ann Arbor, Michigan, 09–10 Aug 2019. PMLR.
|
| 191 |
+
|
| 192 |
+
Jeff Craley, Emily Johnson, and Archana Venkataraman. Integrating convolutional neural networks and probabilistic graphical modeling for epileptic seizure detection in multichannel eeg. In International Conference on Information Processing in Medical Imaging, pp. 291–303. Springer, 2019.
|
| 193 |
+
|
| 194 |
+
Michael Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on ¨ graphs with fast localized spectral filtering. In Advances in neural information processing systems, pp. 3844–3852, 2016.
|
| 195 |
+
|
| 196 |
+
Robert S. Fisher, J. Helen Cross, Jacqueline A. French, Norimichi Higurashi, Edouard Hirsch, Floor E. Jansen, Lieven Lagae, Solomon L. Moshe, Jukka Peltola, Eliane Roulet Perez, Ingrid E. ´ Scheffer, and Sameer M. Zuberi. Operational classification of seizure types by the international league against epilepsy: Position paper of the ilae commission for classification and terminology. Epilepsia, 58(4):522–530, 2017. doi: https://doi.org/10.1111/epi.13670.
|
| 197 |
+
|
| 198 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 199 |
+
|
| 200 |
+
Tomas Iesmantas and Robertas Alzbutas. Convolutional neural network for detection and classification of seizures in clinical data. Medical & Biological Engineering & Computing, 58, 06 2020. doi: 10.1007/s11517-020-02208-7.
|
| 201 |
+
|
| 202 |
+
Herbert H Jasper. The ten-twenty electrode system of the international federation. Electroencephalogr. Clin. Neurophysiol., 10:370–375, 1958.
|
| 203 |
+
|
| 204 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. International Conference on Learning Representations, 12 2014.
|
| 205 |
+
|
| 206 |
+
Demetres Kostas, Stephane Aroca-Ouellette, and Frank Rudzicz. Bendr: using transformers and a contrastive self-supervised learning task to learn from massive amounts of eeg data, 2021.
|
| 207 |
+
|
| 208 |
+
Yaguang Li, Rose Yu, Cyrus Shahabi, and Yan Liu. Diffusion convolutional recurrent neural network: Data-driven traffic forecasting. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30 - May 3, 2018, Conference Track Proceedings, 2018.
|
| 209 |
+
|
| 210 |
+
Yang Li, Yu Liu, Yu-Zhu Guo, Xiao-Feng Liao, Bin Hu, and Tao Yu. Spatio-temporal-spectral hierarchical graph convolutional network with semisupervised active learning for patient-specific seizure prediction. IEEE Transactions on Cybernetics, 2021.
|
| 211 |
+
|
| 212 |
+
Hong Liu, Jeff Z HaoChen, Adrien Gaidon, and Tengyu Ma. Self-supervised learning is more robust to dataset imbalance. arXiv preprint arXiv:2110.05025, 2021.
|
| 213 |
+
|
| 214 |
+
Ilya Loshchilov and Frank Hutter. SGDR: stochastic gradient descent with warm restarts. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings, 2017.
|
| 215 |
+
|
| 216 |
+
Michael L Martini, Aly A Valliani, Claire Sun, Anthony B Costa, Shan Zhao, Fedor Panov, Saadi Ghatan, Kanaka Rajan, and Eric Karl Oermann. Deep anomaly detection of seizures with paired stereoelectroencephalography and video recordings. Scientific Reports, 11(1):1–11, 2021.
|
| 217 |
+
|
| 218 |
+
Mostafa Neo Mohsenvand, Mohammad Rasool Izadi, and Pattie Maes. Contrastive representation learning for electroencephalogram classification. In Machine Learning for Health, pp. 238–253. PMLR, 2020.
|
| 219 |
+
|
| 220 |
+
Iyad Obeid and Joseph Picone. The temple university hospital eeg data corpus. Frontiers in neuroscience, 10:196, 2016.
|
| 221 |
+
|
| 222 |
+
Alison O’Shea, Gordon Lightbody, Geraldine Boylan, and Andriy Temko. Neonatal seizure detection from raw multi-channel EEG using a fully convolutional architecture. Neural Networks, 123:12–25, 2020. ISSN 08936080. doi: 10.1016/j.neunet.2019.11.023. URL https: //linkinghub.elsevier.com/retrieve/pii/S0893608019303910.
|
| 223 |
+
|
| 224 |
+
Shivarudhrappa Raghu, Natarajan Sriraam, Yasin Temel, Shyam Vasudeva Rao, and Pieter L Kubben. Eeg based multi-class seizure type classification using convolutional neural network and transfer learning. Neural Networks, 124:202–212, 2020.
|
| 225 |
+
|
| 226 |
+
Khansa Rasheed, Adnan Qayyum, Junaid Qadir, Shobi Sivathamboo, Patrick Kwan, Levin Kuhlmann, Terence O’Brien, and Adeel Razi. Machine learning for predicting epileptic seizures using eeg signals: A review. IEEE Reviews in Biomedical Engineering, 14:139–155, 2020.
|
| 227 |
+
|
| 228 |
+
Subhrajit Roy, Umar Asif, Jianbin Tang, and Stefan Harrer. Machine learning for seizure type classification: setting the benchmark. arXiv preprint arXiv:1902.01012, 2019.
|
| 229 |
+
|
| 230 |
+
Khaled Saab, Jared Dunnmon, Christopher Re, Daniel Rubin, and Christopher Lee-Messer. Weak ´ supervision as an efficient approach for automated seizure detection in electroencephalography. npj Digital Medicine, 3(1):1–12, 2020.
|
| 231 |
+
|
| 232 |
+
Vangelis Sakkalis. Review of advanced techniques for the estimation of brain connectivity measured with eeg/meg. Computers in biology and medicine, 41(12):1110–1117, 2011.
|
| 233 |
+
|
| 234 |
+
Vinit Shah, Eva von Weltin, Silvia Lopez, James Riley McHugh, Lillian Veloso, Meysam Golmohammadi, Iyad Obeid, and Joseph Picone. The temple university hospital seizure detection corpus. Frontiers in Neuroinformatics, 12:83, 2018. ISSN 1662-5196. doi: 10.3389/fninf.2018.00083.
|
| 235 |
+
|
| 236 |
+
Afshin Shoeibi, Marjane Khodatars, Navid Ghassemi, Mahboobeh Jafari, Parisa Moridian, Roohallah Alizadehsani, Maryam Panahiazar, Fahime Khozeimeh, Assef Zare, Hossein Hosseini-Nejad, et al. Epileptic seizures detection using deep learning techniques: A review. International Journal of Environmental Research and Public Health, 18(11):5780, 2021.
|
| 237 |
+
|
| 238 |
+
David I Shuman, Sunil K Narang, Pascal Frossard, Antonio Ortega, and Pierre Vandergheynst. The emerging field of signal processing on graphs: Extending high-dimensional data analysis to networks and other irregular domains. IEEE signal processing magazine, 30(3):83–98, 2013.
|
| 239 |
+
|
| 240 |
+
Mohammad Khubeb Siddiqui, Ruben Morales-Menendez, Xiaodi Huang, and Nasir Hussain. A review of epileptic seizure detection using machine learning classifiers. Brain informatics, 7: 1–18, 2020.
|
| 241 |
+
|
| 242 |
+
Micheal Strein, John P Holton-Burke, LaTangela R Smith, and Gretchen M Brophy. Prevention, treatment, and monitoring of seizures in the intensive care unit. Journal of Clinical Medicine, 8 (8):1177, 2019.
|
| 243 |
+
|
| 244 |
+
Supriya Supriya, Siuly Siuly, Hua Wang, and Yanchun Zhang. Epilepsy detection from eeg using complex network techniques: A review. IEEE Reviews in Biomedical Engineering, 2021.
|
| 245 |
+
|
| 246 |
+
Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In Advances in neural information processing systems, pp. 3104–3112, 2014.
|
| 247 |
+
|
| 248 |
+
Alexandros T Tzallas, Markos G Tsipouras, and Dimitrios I Fotiadis. Epileptic seizure detection in eegs using time–frequency analysis. IEEE transactions on information technology in biomedicine, 13(5):703–710, 2009.
|
| 249 |
+
|
| 250 |
+
Pauli Virtanen, Ralf Gommers, Travis E. Oliphant, Matt Haberland, Tyler Reddy, David Cournapeau, Evgeni Burovski, Pearu Peterson, Warren Weckesser, Jonathan Bright, Stefan J. van der ´ Walt, Matthew Brett, Joshua Wilson, K. Jarrod Millman, Nikolay Mayorov, Andrew R. J. Nelson, Eric Jones, Robert Kern, Eric Larson, C J Carey, ˙Ilhan Polat, Yu Feng, Eric W. Moore, Jake VanderPlas, Denis Laxalde, Josef Perktold, Robert Cimrman, Ian Henriksen, E. A. Quintero, Charles R. Harris, Anne M. Archibald, Antonio H. Ribeiro, Fabian Pedregosa, Paul van Mul- ˆ bregt, and SciPy 1.0 Contributors. SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python. Nature Methods, 17:261–272, 2020a. doi: 10.1038/s41592-019-0686-2.
|
| 251 |
+
|
| 252 |
+
Pauli Virtanen, Ralf Gommers, Travis E Oliphant, Matt Haberland, Tyler Reddy, David Cournapeau, Evgeni Burovski, Pearu Peterson, Warren Weckesser, Jonathan Bright, et al. Scipy 1.0: fundamental algorithms for scientific computing in python. Nature methods, 17(3):261–272, 2020b.
|
| 253 |
+
|
| 254 |
+
WHO. Epilepsy. https://www.who.int/news-room/fact-sheets/detail/ epilepsy, june 2019.
|
| 255 |
+
|
| 256 |
+
Junjie Xu, Yaojia Zheng, Yifan Mao, Ruixuan Wang, and Wei-Shi Zheng. Anomaly detection on electroencephalography with self-supervised learning. In 2020 IEEE International Conference on Bioinformatics and Biomedicine (BIBM), pp. 363–368. IEEE, 2020.
|
| 257 |
+
|
| 258 |
+
Yuzhe Yang and Zhi Xu. Rethinking the value of labels for improving class-imbalanced learning. In Conference on Neural Information Processing Systems (NeurIPS), 2020.
|
| 259 |
+
|
| 260 |
+
Matthew D Zeiler and Rob Fergus. Visualizing and understanding convolutional networks, 2013.
|
| 261 |
+
|
| 262 |
+
Yanna Zhao, Gaobo Zhang, Changxu Dong, Qi Yuan, Fangzhou Xu, and Yuanjie Zheng. Graph attention network with focal loss for seizure detection on electroencephalography signals. International Journal of Neural Systems, pp. 2150027, 2021.
|
| 263 |
+
|
| 264 |
+
# APPENDIX
|
| 265 |
+
|
| 266 |
+
# A DATA PREPROCESSING
|
| 267 |
+
|
| 268 |
+
Because the EEG signals are sampled at different frequencies in the Temple University EEG Seizure Corpus (TUSZ), we resample them to the same frequency of $2 0 0 \mathrm { H z }$ using the “resample” function in SciPy python package (Virtanen et al., 2020a). We perform the following preprocessing steps to obtain EEG clips in the frequency domain and their corresponding labels.
|
| 269 |
+
|
| 270 |
+
First, for seizure detection, we use both seizure and non-seizure EEGs. We obtain the EEG clips by sliding a 12-s (or 60-s) window over the EEG signals without overlaps, and ignore the last window if it is shorter than the clip length. The label for each clip is $y = 1$ if at least one seizure event occurs within this clip, otherwise $y = 0$ .
|
| 271 |
+
|
| 272 |
+
Second, for seizure classification, we use only seizure EEGs. We obtain one 12-s (or 60-s) EEG clip for each seizure event starting at 2-s before the annotated seizure onset time, where a 2-s offset accounts for tolerance in the annotations. If a seizure event is shorter than 12-s (or 60-s), the EEG clip is truncated at the end of the seizure to prevent a clip from having multiple seizure types. The label for each clip is the index of the corresponding seizure class, i.e. $y ~ \in ~ \{ 0 , 1 , 2 , 3 \}$ , which corresponds to combined focal (CF) seizures, generalized non-specific (GN) seizures, absence (AB) seizures, and combined tonic (CT) seizures.
|
| 273 |
+
|
| 274 |
+
Third, for self-supervised pre-training, we use the same EEG clips as seizure detection.
|
| 275 |
+
|
| 276 |
+
Fourth, for each EEG clip in each of the seizure detection/seizure classification/self-supervised pretraining tasks, we perform the following preprocessing steps to transform the signals in time domain to frequency domain: (a) slide a $t$ second window over the EEG clip without overlap, where $t$ is the time step size for networks involving recurrent layers; (b) apply fast Fourier transform (FFT) to each $t$ second window using the “fft” function in Scipy python package (Virtanen et al., 2020b), and retain the log amplitudes of the non-negative frequency components similar to prior studies (Asif et al., 2020; Ahmedt-Aristizabal et al., 2020; Covert et al., 2019); (c) $\mathbf { Z }$ -normalize the EEG clip with respect to the mean and standard deviation of the training data. Because EEG clips for seizure classification may have variable lengths due to short seizures, we pad the clips with 0’s to facilitate model training in batches. We use $t = 1$ second as a natural choice of the time step size. After preprocessing, each EEG clip can be denoted as $\pmb { X } \in \mathbb { R } ^ { T \times N \times M }$ , where $T = 1 2$ (or $T = 6 0$ ) represents the clip length, $N = 1 9$ represents the number of EEG channels/electrodes, and $M = 1 0 0$ represents the feature dimension after the aforementioned Fourier transform.
|
| 277 |
+
|
| 278 |
+
# B EFFECTIVENESS OF FOURIER TRANSFORM
|
| 279 |
+
|
| 280 |
+
To evaluate the effectiveness of Fourier transform (Appendix A), we compare the performance of our DCRNN (without self-supervised pre-training) on inputs without and with Fourier transform on both seizure detection and seizure classification. As shown in Table 4, frequency-domain inputs (with Fourier transform) result in significantly better performance than time-domain inputs (without Fourier transform). This is likely because seizures are associated with electrical activity in certain frequency bands (Tzallas et al., 2009), and thus short-time-interval frequency-domain inputs could be more informative than time-domain inputs.
|
| 281 |
+
|
| 282 |
+
# C DISTINGUISHABILITY OF FOCAL NON-SPECIFIC, SIMPLE PARTIAL, AND COMPLEX PARTIAL SEIZURES
|
| 283 |
+
|
| 284 |
+
Because simple partial and complex partial seizures are focal seizures characterized by the clinical behavior, consciousness during seizure (Fisher et al., 2017), they are not distinguishable from other focal seizures from EEG signals alone. In this study, we merge focal non-specific (FN), simple partial (SP), and complex partial (CP) seizures into a combined focal seizure class. To justify our decision, we perform classification of these focal seizure types using our DCRNNs and baselines. As shown in Figure 5, SP and CP seizures are largely misclassified as FN seizures, suggesting that machine learning models may not be able to distinguish these focal seizure types from EEG signals alone. This supports our decision of combining FN, SP, and CP seizures into one class.
|
| 285 |
+
|
| 286 |
+
Table 4: Seizure detection and classification results from DCRNNs (without self-supervised pretraining) on time-domain inputs and frequency-domain inputs. Mean and standard deviations are obtained from five random runs.
|
| 287 |
+
|
| 288 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Input Domain</td><td rowspan=1 colspan=2>Seizure DetectionAUROC12-s 60-s</td><td rowspan=1 colspan=2>Seizure ClassificationWeighted F1-Score12-s 60-s</td></tr><tr><td rowspan=1 colspan=1>Corr-DCRNNWithout Pre-Training</td><td rowspan=1 colspan=1>TimeFrequency</td><td rowspan=1 colspan=2>0.717 ± 0.003 0.704 ± 0.0230.812 ± 0.012 0.804 ± 0.015</td><td rowspan=1 colspan=2>0.597 ± 0.023 0.618 ± 0.0180.710 ± 0.023 0.701 ± 0.030</td></tr><tr><td rowspan=1 colspan=1>Dist-DCRNNWithout Pre-Training</td><td rowspan=1 colspan=1>TimeFrequency</td><td rowspan=1 colspan=1>0.733 ± 0.0120.825 ± 0.019</td><td rowspan=1 colspan=1>0.698 ± 0.0030.793 ± 0.022</td><td rowspan=1 colspan=1>0.592 ± 0.0220.703 ± 0.025</td><td rowspan=1 colspan=1>0.608 ± 0.0150.690 ± 0.035</td></tr></table>
|
| 289 |
+
|
| 290 |
+
# D TRAIN, VALIDATION, AND TEST SETS
|
| 291 |
+
|
| 292 |
+
Table 5 shows the number of EEG clips and number of patients in our train, validation, and test sets for self-supervised pre-training, seizure detection, and seizure classification tasks. Train, validation, and test sets consist of distinct patients.
|
| 293 |
+
|
| 294 |
+
Table 5: Number of EEG clips and patients in the train, validation, and test sets in our study. Train, validation, and test sets consist of distinct patients.
|
| 295 |
+
|
| 296 |
+
<table><tr><td rowspan=2 colspan=1></td><td rowspan=2 colspan=1>EEG ClipLength(Secs)</td><td rowspan=1 colspan=2>Train Set</td><td rowspan=1 colspan=2>Validation Set</td><td rowspan=1 colspan=2>Test Set</td></tr><tr><td rowspan=1 colspan=1>EEG Clips(% Seizure)</td><td rowspan=1 colspan=1>Patients(% Seizure)</td><td rowspan=1 colspan=1>EEG Clips(% Seizure)</td><td rowspan=1 colspan=1>Patients(% Seizure)</td><td rowspan=1 colspan=1>EEG Clips(% Seizure)</td><td rowspan=1 colspan=1>Patients(% Seizure)</td></tr><tr><td rowspan=1 colspan=1>Pre-training& SeizureDetection</td><td rowspan=1 colspan=1>60-s12-s</td><td rowspan=1 colspan=1>38.613(9.3%)196.646(6.9%)</td><td rowspan=1 colspan=1>530(34.0%)531(33.9%)</td><td rowspan=1 colspan=1>5,503(11.4%)28.057(8.7%)</td><td rowspan=1 colspan=1>61(36.1%)61(36.1%)</td><td rowspan=1 colspan=1>8.848(14.7%)44,959(10.9%)</td><td rowspan=1 colspan=1>45(77.8%)45(77.8%)</td></tr><tr><td rowspan=1 colspan=1>SeizureClassification</td><td rowspan=1 colspan=1>60-s&12-s</td><td rowspan=1 colspan=1>1,925(100.0%)</td><td rowspan=1 colspan=1>179(100.0%)</td><td rowspan=1 colspan=1>450(100.0%)</td><td rowspan=1 colspan=1>22(100.0%)</td><td rowspan=1 colspan=1>521(100.0%)</td><td rowspan=1 colspan=1>34(100.0%)</td></tr></table>
|
| 297 |
+
|
| 298 |
+
# E DETAILS OF MODEL TRAINING PROCEDURES AND HYPERPARAMETERS
|
| 299 |
+
|
| 300 |
+
We performed the following hyperparameter search on the validation set: (a) initial learning rate within range [5e-5, 1e-3]; (b) $\bar { \tau } \in \bar { \{ 2 , 3 , 4 \} }$ , the number of neighbors to keep for each node in the correlation graphs; (c) the number of Diffusion Convolutional Gated Recurrent Units (DCGRU) layers within range $\{ 2 , 3 , 4 , 5 \}$ and hidden units within range $\{ 3 2 , 6 4 , 1 2 8 \}$ ; (d) the maximum diffusion step $K \in \{ 2 , 3 , 4 \}$ ; (e) dropout probability in the last fully connected layer. We used a batch size of 40 EEG clips, the maximum possible across all models and baselines on a single Titan RTX GPU. The hyperparameters were selected based on the best performance on the validation set, and are detailed in the next sections. We used the cosine annealing learning rate scheduler (Loshchilov & Hutter, 2017) in PyTorch for all model training. We ran five runs with different random seeds for all models. In all experiments, model training was early stopped when the validation loss did not decrease for five consecutive epochs.
|
| 301 |
+
|
| 302 |
+
Model training for seizure detection. For seizure detection, the plentiful negative examples in the train set were undersampled such that the train set had $50 \%$ positive examples, which resulted in 27,292 training examples for 12-s clips and 7,188 training examples for 60-s clips. We used binary cross-entropy as the loss function to train the seizure detection models. The models were trained for 100 epochs with an initial learning rate of 1e-4. For the correlation graphs, the top-3 neighbors’ edges were kept for each node. The maximum number of diffusion step was 2, and the dropout probability was 0 (i.e. no dropout). The model consists of two stacked DCGRU layers with 64 hidden units, resulting in 168,641 trainable parameters for the distance graph and 280,769 trainable parameters for the correlation graphs. Model training for seizure detection took about $2 0 \mathrm { - m i n }$ for 12-s EEG clips, and about 30-min for 60-s EEG clips.
|
| 303 |
+
|
| 304 |
+

|
| 305 |
+
Figure 5: Confusion matrices (averaged across five random runs) of focal seizure classification on (a) 60-s EEG clips, and (b) 12-s EEG clips. All models fail to distinguish well among these focal seizure types, supporting our decision of merging these seizure types into one combined focal seizure class. Note that each row of the confusion matrices is normalized by dividing by the number of examples in the corresponding class, such that each row sums up to one.
|
| 306 |
+
|
| 307 |
+
To obtain the final seizure/non-seizure prediction, we performed decision threshold search on the validation set. More specifically, to balance between precision and recall scores, we selected the decision threshold that results in the highest F1-score on the validation set. When evaluating the models on the test set, EEG clips with probabilities above this decision threshold are predicted as seizures, while clips with probabilities below this decision threshold are predicted as non-seizures.
|
| 308 |
+
|
| 309 |
+
Model training for seizure classification. For seizure classification, we used multi-class crossentropy as the loss function during training. The models were trained for 60 epochs with an initial learning rate of 3e-4. For the correlation graphs, the top-3 neighbors’ edges were kept for each node. The maximum number of diffusion step was 2, and the dropout probability was 0.5. The model consists of two stacked DCGRU layers with 64 hidden units, resulting in 168,836 trainable parameters for the distance graph and 280,964 trainable parameters for the correlation graphs. Model training for seizure classification took about 3-min for 12-s EEG clips, and about 7-min for 60-s EEG clips.
|
| 310 |
+
|
| 311 |
+
Model training for self-supervised task. Preliminary experiments suggested that predicting future $T ^ { \prime } = 1 2$ second preprocessed EEG clips results in low regression loss on the validation set given previous 12-s (60-s) preprocessed clips, and thus we used $\bar { T ^ { \prime } } = 1 2$ in all self-supervised pre-training experiments. For self-supervised pre-training, we used mean absolute error (MAE) as the loss function. The models were trained for 350 epochs with an initial learning rate of 5e-4. For the correlation graphs, the top-3 neighbors’ edges were kept for each node. The maximum number of diffusion step was 2. The model consists of three stacked DCGRU layers with 64 hidden units in both the encoder and decoder, resulting in 417,572 trainable parameters for the distance graph and 690,980 trainable parameters for the correlation graphs. Model training for self-supervised prediction took about 10-h for 12-s EEG clips, and about $^ { 2 4 - \mathrm { h } }$ for 60-s EEG clips.
|
| 312 |
+
|
| 313 |
+
Model training for baselines. For baseline Dense-CNN, we employ the same model architecture as that described in Saab et al. (2020). For baseline LSTM (Hochreiter & Schmidhuber, 1997), we have the number of LSTM layers and hidden units the same as the number of DCGRU layers and hidden units in our DCRNN model. For baseline CNN-LSTM, we use the same model architecture described in Ahmedt-Aristizabal et al. (2020), i.e., two stacked convolutional layers $3 2 3 \times 3$ kernels), one max-pooling layer $( 2 \times 2 )$ , one fully-connected layer (output neuron $= 5 1 2$ ), two stacked LSTM layers (hidden size $= 1 2 8$ ), and one fully connected layer.
|
| 314 |
+
|
| 315 |
+
# F DATA AUGMENTATION
|
| 316 |
+
|
| 317 |
+
During training, we performed the following data augmentations based on EEG domain knowledge: (a) randomly scaling the amplitude of the raw EEG signals by a scale within [0.8, 1.2] and (b) randomly reflecting the signals along the scalp midline.
|
| 318 |
+
|
| 319 |
+
# G ADDITIONAL EVALUATION RESULTS ON SEIZURE DETECTION
|
| 320 |
+
|
| 321 |
+
Table 6 shows F1-score, Area Under the Precision-Recall Curve (AUPR), sensitivity, and specificity of seizure detection models.
|
| 322 |
+
|
| 323 |
+
# H SEIZURE DETECTION OCCLUSION MAPS FROM BASELINE DENSE-CNN
|
| 324 |
+
|
| 325 |
+
Figure 6 shows example seizure detection occlusion maps obtained from baseline Dense-CNN on correctly predicted 60-s EEG clips in the test set. Unlike our model (Figure 3), high saliency from Dense-CNN does not localize in any seizure regions.
|
| 326 |
+
|
| 327 |
+
# I SEIZURE CLASSIFICATION OCCLUSION MAPS FROM DCRNN
|
| 328 |
+
|
| 329 |
+
Figure 7 shows example seizure classification occlusion maps from Corr-DCRNN with selfsupervised pre-training on correctly predicted 60-s EEG clips in the test set. The occlusion maps are obtained by completely dropping one EEG channel at a time and calculating the relative change in the model output. For CF seizures (a–b), high saliency regions correspond to brain areas where the focal seizures are localized. For the other generalized seizure types (c–e), less salient regions correspond to less abnormal areas.
|
| 330 |
+
|
| 331 |
+
Table 6: Additional evaluation scores for seizure detection on (a) 12-s EEG clips and (b) $6 0 \mathrm { - } \mathrm { s }$ EEG clips. Mean and standard deviations are obtained from five random runs. Best non-pretrained and pre-trained mean results are highlighted in bold.
|
| 332 |
+
|
| 333 |
+
(a) 12-s EEG clips
|
| 334 |
+
|
| 335 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>F1-Score(mean ± std)</td><td rowspan=1 colspan=1>AUPR(mean ± std)</td><td rowspan=1 colspan=1>Sensitivity(mean ± std)</td><td rowspan=1 colspan=1>Specificity(mean ± std)</td></tr><tr><td rowspan=1 colspan=1>Dense-CNNLSTMCNN-LSTM</td><td rowspan=1 colspan=1>0.326 ± 0.0190.376 ± 0.0210.337 ± 0.009</td><td rowspan=1 colspan=1>0.328 ± 0.0430.354 ± 0.0230.309 ± 0.015</td><td rowspan=1 colspan=1>0.293 ± 0.0210.357 ± 0.0450.333 ± 0.028</td><td rowspan=1 colspan=1>0.938 ± 0.0140.934 ± 0.0150.920 ± 0.021</td></tr><tr><td rowspan=1 colspan=1>Corr-DCRNNWithout Pre-trainingDist-DCRNNWithout Pre-training</td><td rowspan=1 colspan=1>0.392 ± 0.0270.437 ± 0.029</td><td rowspan=1 colspan=1>0.370 ± 0.0270.411 ± 0.041</td><td rowspan=1 colspan=1>0.373 ± 0.0350.411 ± 0.038</td><td rowspan=1 colspan=1>0.935 ± 0.0120.943 ± 0.006</td></tr><tr><td rowspan=1 colspan=1>Corr-DCRNNWith Pre-trainingDist-DCRNNWith Pre-training</td><td rowspan=1 colspan=1>0.484 ± 0.0110.487 ± 0.042</td><td rowspan=1 colspan=1>0.454 ± 0.0200.463 ± 0.048</td><td rowspan=1 colspan=1>0.524 ± 0.0120.592 ± 0.052</td><td rowspan=1 colspan=1>0.922 ± 0.0040.897 ± 0.012</td></tr></table>
|
| 336 |
+
|
| 337 |
+
(b) 60-s EEG clips
|
| 338 |
+
|
| 339 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>F1-Score(mean ± std)</td><td rowspan=1 colspan=1>AUPR(mean ± std)</td><td rowspan=1 colspan=1>Sensitivity(mean ± std)</td><td rowspan=1 colspan=1>Specificity(mean ± std)</td></tr><tr><td rowspan=1 colspan=1>Dense-CNNLSTMCNN-LSTM</td><td rowspan=1 colspan=1>0.404 ± 0.0220.365 ± 0.0090.330 ± 0.016</td><td rowspan=1 colspan=1>0.399 ± 0.0170.287 ± 0.0260.276 ± 0.009</td><td rowspan=1 colspan=1>0.451 ± 0.1340.463 ± 0.0600.363 ± 0.044</td><td rowspan=1 colspan=1>0.869 ± 0.0710.814 ± 0.0530.857 ± 0.023</td></tr><tr><td rowspan=1 colspan=1>Corr-DCRNNWithout Pre-trainingDist-DCRNNWithout Pre-training</td><td rowspan=1 colspan=1>0.448 ± 0.0290.341 ± 0.170</td><td rowspan=1 colspan=1>0.440 ± 0.0210.418 ± 0.046</td><td rowspan=1 colspan=1>0.457 ± 0.0580.326 ± 0.183</td><td rowspan=1 colspan=1>0.900 ± 0.0280.932 ± 0.058</td></tr><tr><td rowspan=1 colspan=1>Corr-DCRNN With Pre-trainingDist-DCRNNWith Pre-training</td><td rowspan=1 colspan=1>0.514 ± 0.0280.571 ± 0.029</td><td rowspan=1 colspan=1>0.539 ± 0.0240.593 ± 0.031</td><td rowspan=1 colspan=1>0.502 ± 0.0470.570 ± 0.047</td><td rowspan=1 colspan=1>0.923 ± 0.0080.927 ± 0.012</td></tr></table>
|
| 340 |
+
|
| 341 |
+
# J COMPARISON BETWEEN SELF-SUPERVISED PRE-TRAINING AND TRANSFER LEARNING
|
| 342 |
+
|
| 343 |
+
To compare our self-supervised pre-training strategy to traditional transfer learning, we perform transfer learning by pre-training DCRNNs for seizure detection on an in-house dataset (40,316 EEGs, Table 7) and finetuning on TUSZ data for seizure detection and classification. Due to the lack of fine-grained seizure type labels, we do not pre-train DCRNNs for seizure classification on the inhouse dataset. Moreover, we pre-train DCRNNs on the in-house dataset using our self-supervised pre-training strategy and finetuned them for seizure detection and classification on TUSZ.
|
| 344 |
+
|
| 345 |
+
Table 8 shows DCRNN results with self-supervised pre-training and transfer learning from the inhouse dataset. Self-supervised pre-training from the in-house dataset (3rd-4th rows) consistently outperforms trasnfer learning from the in-house dataset (5th-6th rows). We speculate that transfer learning does not perform comparably to self-supervised pre-training because it suffers from distribution shift in the data (i.e., the in-house dataset comes from a different population and uses a slightly different EEG acquisition protocol). In contrast, by learning to predict the EEGs for the next time period, self-supervised pre-training encourages the model to learn task-agnostic representations and thus mitigates the problem of distribution shift.
|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
Figure 6: Example occlusion maps for seizure detection obtained from baseline Dense-CNN on correctly predicted 60-s clips for (a)–(b) focal seizures, and (c)–(d) generalized seizures. Red boxes indicate the duration of the seizures. Note that the values within an occlusion map are normalized, and thus should not be compared across different occlusion maps.
|
| 349 |
+
|
| 350 |
+
Table 7: Summary of in-house dataset. Only annotations for the start of seizure are available. For EEG files with seizures, EEG clips are obtained by taking 12-s (or 60-s) signals starting from the annotated seizure start time. For EEG files without seizures, EEG clips are obtained by taking 12- s (or 60-s) signals randomly from the entire signal. We apply the same data preprocessing steps described in Appendix A.
|
| 351 |
+
|
| 352 |
+
<table><tr><td></td><td>EEG Files (% Seizure)</td><td> Total Duration</td><td>Patients (% Seizure)</td><td>EEG Clips (% Seizure)</td></tr><tr><td>In-House Train Set</td><td>40,316 (24.1%)</td><td>853,141.87 min</td><td>5,355 (25.7%)</td><td>46,613 (34.4%)</td></tr></table>
|
| 353 |
+
|
| 354 |
+
# K CHOICE OF DISTANCE-BASED GRAPH STRUCTURE
|
| 355 |
+
|
| 356 |
+
For the distance graph, we used a threholded Gaussian kernel (Shuman et al., 2013) to compute the edge weight between two electrodes (Section 2.2.1). We experimented with $\kappa$ , the threshold for graph sparsity, within range [0.1, 2]. Based on preliminary experiments and EEG domain knowledge, we chose $\kappa = 0 . 9$ because it results in a reasonable graph (e.g. no long-range connection) that resembles the EEG montage (longitudinal bipolar and transverse bipolar) widely used clinically (Acharya et al., 2016). Figure 8 shows distance graphs resulting from different thresholds $\kappa$ . In Figure 8, we can see that a smaller threshold (e.g., 0.7 or 0.8) results in missing edges between nearby electrodes. For example, there is no edge between FP1 and FZ for threshold 0.8 and no edge between T3 and C3 for threshold 0.7. In contrast, a larger threshold (e.g., 1.0, 1.1, or 1.2) results in edges connecting electrodes that are spatially far apart. For example, there is an edge connecting C3 and $\mathrm { F Z }$ , as well as an edge between F7 and T5 for threshold 1.2. Using EEG domain knowledge provided by a board certified neurologist, we believe that a threshold of 0.9 results in a more reasonable distance-based EEG graph compared to other thresholding values.
|
| 357 |
+
|
| 358 |
+
Table 8: Comparison of results between self-supervised pre-training and transfer learning pretrained on an in-house dataset. 3rd-4th rows: DCRNN results with self-supervised (SS) pre-training on the in-house dataset. 5th-6th rows: DCRNN results with transfer learning pre-trained for seizure detection on the in-house dataset. Mean and standard deviations are from five random runs. Best mean results for each column are highlighted in bold.
|
| 359 |
+
|
| 360 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">Seizure Detection AUROC</td><td colspan="2">Seizure Classification Weighted F1-Score</td></tr><tr><td>12-s</td><td>60-s</td><td>12-s</td><td>60-s</td></tr><tr><td>Corr-DCRNN w/ SS Pre-Training Dist-DCRNN w/ SS</td><td>0.863 ± 0.005</td><td>0.856 ± 0.013</td><td>0.736 ± 0.007</td><td>0.723 ± 0.010</td></tr><tr><td>Pre-Training Corr-DCRNN w/ Transfer</td><td>0.879 ± 0.006</td><td>0.886 ± 0.006</td><td>0.767 ± 0.038</td><td>0.718 ± 0.018</td></tr><tr><td>Learning Dist-DCRNN w/ Transfer Learning</td><td>0.848 ± 0.018 0.866 ± 0.001</td><td>0.850 ± 0.002 0.847 ± 0.004</td><td>0.733 ± 0.027 0.720 ± 0.046</td><td>0.711 ± 0.025 0.691 ± 0.038</td></tr></table>
|
| 361 |
+
|
| 362 |
+
In addition, we explore using a Gaussian kernel with a specified bandwidth for building the distance graph, i.e., $W _ { i j } = \frac { 1 } { \sqrt { 2 \pi h ^ { 2 } } } \mathrm { e x p } \bigg ( - \frac { \mathrm { d i s t } ( v _ { i } , v _ { j } ) ^ { 2 } } { 2 h ^ { 2 } } \bigg )$ , where $W _ { i j }$ is the edge weight between electrodes $v _ { i }$ and $v _ { j }$ , $\mathrm { d i s t } ( v _ { i } , v _ { j } )$ is the Euclidean distance between $v _ { i }$ and $v _ { j }$ , and $h$ is the Gaussian kernel bandwidth. Figure 9 shows the distance graph structures resulting from different values of bandwidth. With bandwidth $= 0 . 0 6$ , the distance graph structure resembles the original graph structure using thresholded Gaussian kernel with a threshold of 0.9 (Figure 1b).
|
| 363 |
+
|
| 364 |
+
# L 8-CLASS SEIZURE CLASSIFICATION
|
| 365 |
+
|
| 366 |
+
We also perform seizure classification on the original eight seizure types4 available in TUSZ (see Table 9). Note that only one patient’s two myoclonic seizures are available in the official TUSZ train set and only one patient’s one myoclonic seizure is available in the official TUSZ test set. Hence, patient-wise train/validation splits for myoclonic seizure is not possible, and we randomly assign one myoclonic seizure in the official TUSZ train set to our train split and the other to our validation split. As shown in Table 9, DCRNNs consistently outperform the baselines on 8-class seizure classification.
|
| 367 |
+
|
| 368 |
+
# M USING SELF-SUPERVISED PREDICTION AS AN AUXILIARY TASK
|
| 369 |
+
|
| 370 |
+
Here, instead of pre-training DCRNNs for the self-supervised prediction task (i.e., predicting preprocessed EEG clips for the next time period), we conduct experiments using the self-supervised prediction task as an auxiliary task. Because EEG clips for the seizure classification task have variable lengths, we only perform this experiment for seizure detection to facilitate training in batches. Specifically, the loss function is $\mathcal { L } = \mathcal { L } _ { \mathrm { s e i z u r e ~ d e t e c t i o n } } + \lambda \mathcal { L } _ { \mathrm { S S } }$ prediction where $\lambda$ is a hyperparameter balancing the seizure detection loss and the self-supervised loss and is tuned on the validation set. For 12-s (or 60-s) seizure detection, the auxiliary task is to predict the next 6-s preprocessed EEG clips given the first 6-s (or 30-s) EEG clips.
|
| 371 |
+
|
| 372 |
+
Table 9: Results (weighted F1-scores) of seizure classification on original 8 seizure types in TUSZ. Mean and standard deviations are from five random runs. Best mean results for both non-pretrained and pretrained models are highlighted in bold.
|
| 373 |
+
|
| 374 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>12-s</td><td rowspan=1 colspan=1>60-s</td></tr><tr><td rowspan=1 colspan=1>Dense-CNNLSTMCNN-LSTM</td><td rowspan=1 colspan=1>0.431 ± 0.0370.515 ± 0.0250.489 ± 0.036</td><td rowspan=1 colspan=1>0.427 ± 0.0470.525 ± 0.0170.509 ± 0.021</td></tr><tr><td rowspan=1 colspan=1>Corr-DCRNNWithout Pre-trainingDist-DCRNNWithout Pre-training</td><td rowspan=1 colspan=1>0.553 ± 0.0250.570 ± 0.027</td><td rowspan=1 colspan=1>0.577 ± 0.0280.600 ± 0.022</td></tr><tr><td rowspan=1 colspan=1>Corr-DCRNNWith Pre-trainingDist-DCRNNWith Pre-training</td><td rowspan=1 colspan=1>0.582 ± 0.0140.583 ± 0.009</td><td rowspan=1 colspan=1>0.591 ± 0.0080.607 ± 0.017</td></tr></table>
|
| 375 |
+
|
| 376 |
+
Table 10 shows the seizure detection results for DCRNNs when the self-supervised (SS) prediction task is used as an auxiliary task during training. Compared to self-supervised pre-training (Table 2 last two rows), auxiliary learning only marginally improves Dist-DCRNN performance on 12- s seizure detection (no statistical significance), whereas self-supervised pre-training significantly outperforms auxiliary learning for 60-s seizure detection.
|
| 377 |
+
|
| 378 |
+
Table 10: Seizure detection results for DCRNNs with self-supervised pre-training (same as Table 2) and auxiliary learning. Mean and standard deviations are from five random runs. Best mean results for Dist-DCRNN/Corr-DCRNN are in bold.
|
| 379 |
+
|
| 380 |
+
<table><tr><td rowspan="3">Model</td><td colspan="2">Seizure Detection AUROC</td></tr><tr><td>12-s</td><td>60-s</td></tr><tr><td>Corr-DCRNN w/ SS Pre-Training (Table 2)</td><td>0.861 ± 0.005</td><td>0.850 ± 0.013</td></tr><tr><td>Corr-DCRNN w/ SS Auxiliary Task</td><td>0.851 ± 0.008</td><td>0.811 ± 0.005</td></tr><tr><td>Dist-DCRNN w/ SS Pre-Training (Table 2) Dist-DCRNN w/ SS Auxiliary Task</td><td>0.866 ± 0.016 0.875 ± 0.005</td><td>0.875 ± 0.016 0.840 ± 0.013</td></tr></table>
|
| 381 |
+
|
| 382 |
+

|
| 383 |
+
Figure 7: Example occlusion maps for seizure classification obtained from pre-trained Corr-DCRNN model for (a)–(b) combined focal (CF) seizures, (c) generalized non-specific (GN) seizure, (d) absence (AB) seizure, and (e) combined tonic (CT) seizure. In each subfigure, the bottom panel shows the occlusion values for each channel replicated along the time dimension and overlaid on 60-s EEG signals, the red boxes indicate the duration of seizures in the EEG clips, and the top panel shows the occlusion values overlaid on the correlation graph structure. To visualize occlusion map values in this “double banana” montage, we subtract the occlusion values between the corresponding channels in the montage, which results in different values between occlusion maps shown on the EEG signals (bottom panel in each subfigure) and that shown on the graph structures (top panel in each subfigure). Note that the values within an occlusion map are normalized, and thus should not be compared across different occlusion maps.
|
| 384 |
+
|
| 385 |
+

|
| 386 |
+
Figure 8: Distance graphs with different threshold $\kappa$ in the thresholded Gaussian kernel. Small thresholds (e.g., 0.7 and 0.8) result in missing edges between nearby electrodes, whereas large thresholds (e.g., 1.0, 1.1, 1.2) result in edges connecting electrodes that are spatially far away.
|
| 387 |
+
|
| 388 |
+

|
| 389 |
+
Figure 9: Distance-based graphs constructed using Gaussian kernels with different bandwidths. When bandwidth $= 0 . 0 6$ , the distance graph structure resembles the original graph structure using thresholded Gaussian kernel with a threshold of 0.9 (Figure 1b).
|
md/dev/nL2lDlsrZU/nL2lDlsrZU.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/nN3aVRQsxGd/nN3aVRQsxGd.md
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# How Powerful are $K$ -hop Message Passing Graph Neural Networks
|
| 2 |
+
|
| 3 |
+
Jiarui Feng1,2 Yixin Chen1 Fuhai $\mathbf { L i } ^ { 2 }$ Anindya Sarkar1 Muhan Zhang3,4 {feng.jiarui, fuhai.li, anindya}@wustl.edu, chen@cse.wustl.edu, muhan@pku.edu.cn 1Department of CSE, Washington University in St. Louis 2Institute for Informatics, Washington University School of Medicine 3Institute for Artificial Intelligence, Peking University 4Beijing Institute for General Artificial Intelligence
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
The most popular design paradigm for Graph Neural Networks (GNNs) is 1-hop message passing—aggregating information from 1-hop neighbors repeatedly. However, the expressive power of 1-hop message passing is bounded by the WeisfeilerLehman (1-WL) test. Recently, researchers extended 1-hop message passing to $K$ -hop message passing by aggregating information from $K$ -hop neighbors of nodes simultaneously. However, there is no work on analyzing the expressive power of $K$ -hop message passing. In this work, we theoretically characterize the expressive power of $K$ -hop message passing. Specifically, we first formally differentiate two different kernels of $K$ -hop message passing which are often misused in previous works. We then characterize the expressive power of $K$ -hop message passing by showing that it is more powerful than 1-WL and can distinguish almost all regular graphs. Despite the higher expressive power, we show that $K$ -hop message passing still cannot distinguish some simple regular graphs and its expressive power is bounded by 3-WL. To further enhance its expressive power, we introduce a KP-GNN framework, which improves $K$ -hop message passing by leveraging the peripheral subgraph information in each hop. We show that KP-GNN can distinguish many distance regular graphs which could not be distinguished by previous distance encoding or 3-WL methods. Experimental results verify the expressive power and effectiveness of KP-GNN. KP-GNN achieves competitive results across all benchmark datasets.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Currently, most existing graph neural networks (GNNs) follow the message passing framework, which iteratively aggregates information from the neighbors and updates the representations of nodes. It has shown superior performance on graph-related tasks [1, 2, 3, 4, 5, 6, 7] comparing to traditional graph embedding techniques [8, 9]. However, as the procedure of message passing is similar to the 1-dimensional Weisfeiler-Lehman (1-WL) test [10], the expressive power of message passing GNNs is also bounded by the 1-WL test [7, 11]. Namely, GNNs cannot distinguish two non-isomorphic graph structures if the 1-WL test fails.
|
| 12 |
+
|
| 13 |
+
In normal message passing GNNs, the node representation is updated by the direct neighbors of the node, which are called 1-hop neighbors. Recently, some works extend the notion of message passing into $K$ -hop message passing [12, 13, 14, 15, 16]. $K$ -hop message passing is a type of message passing where the node representation is updated by aggregating information from not only 1st hop but all the neighbors within $K$ hops of the node. However, there is no work on theoretically characterizing the expressive power of GNNs with $K$ -hop message passing, e.g., whether it can improve the 1-hop message passing or not and to what extent it can.
|
| 14 |
+
|
| 15 |
+
In this work, we theoretically characterize the expressive power of $K$ -hop message passing GNNs. Specifically, 1) we formally distinguish two different kernels of the $K$ -hop neighbors, which are often misused in previous works. The first kernel is based on whether the node can be reached within $k$ steps of the graph diffusion process, which is used in GPR-GNN [15] and MixHop [12]. The second one is based on the shortest path distance of $k$ , which is used in $\mathrm { G I N E + }$ [16] and Graphormer [17]. Further, we show that different kernels of $K$ -hop neighbors will result in different expressive power of $K$ -hop message passing. 2) We show that $K$ -hop message passing is strictly more powerful than 1-hop message passing and can distinguish almost all regular graphs. 3) However, it still failed in distinguishing some simple regular graphs, no matter which kernel is used, and its expressive power is bounded by 3-WL. This motivates us to improve $K$ -hop message passing further.
|
| 16 |
+
|
| 17 |
+
Here, we introduce KP-GNN, a new GNN framework with $K$ -hop message passing, which significantly improves the expressive power of standard $K$ -hop message passing GNNs. In particular, during the aggregation of neighbors in each hop, KP-GNN not only aggregates neighboring nodes in that hop but also aggregates the peripheral subgraph (subgraph induced by the neighbors in that hop). This additional information helps the KP-GNN to learn more expressive local structural features around the node. We further show that KP-GNN can distinguish many distance regular graphs with a proper encoder for the peripheral subgraph. The proposed KP-GNN has several additional advantages. First, it can be applied to most existing $K$ -hop message-passing GNNs with only slight modification. Second, it only adds little computational complexity to standard $K$ -hop message passing. We demonstrate the effectiveness of the KP-GNN framework through extensive experiments on both simulation and real-world datasets.
|
| 18 |
+
|
| 19 |
+
# 2 $K$ -hop message passing and its expressive power
|
| 20 |
+
|
| 21 |
+
# 2.1 Notations
|
| 22 |
+
|
| 23 |
+
Denote a graph as $G = ( V , E )$ , where $V = \{ 1 , 2 , . . . , n \}$ is the node set and $E \subseteq V \times V$ is the edge set. Meanwhile, denote $\dot { A } \in \{ 0 , 1 \} ^ { n \times n }$ as the adjacency matrix of graph $G$ . Denote $x _ { v }$ as the feature vector of node $v$ and denote $e _ { u v }$ as the feature vector of the edge from $u$ to $v$ . Finally, we denote $Q _ { v , G } ^ { 1 }$ as the set of 1-hop neighbors of node $v$ in graph $G$ and $\mathcal { N } _ { v , G } ^ { 1 ^ { - } } { = } Q _ { v , G } ^ { 1 } \cup \{ v \}$ . Note that when we say $K$ -hop neighbors of node $v$ , we mean all the neighbors that have distance from node $v$ less than or equal to $K$ . In contrast, $k$ -th hop neighbors mean the neighbors with exactly distance $k$ from node $v$ . The definition of distance will be discussed in section 2.3.
|
| 24 |
+
|
| 25 |
+
# 2.2 1-hop message passing framework
|
| 26 |
+
|
| 27 |
+
Currently, most existing GNNs are designed based on 1-hop message passing framework [18]. Denote $h _ { v } ^ { l }$ as the output representation of node $v$ at layer $l$ and $h _ { v } ^ { 0 } = x _ { v }$ . Briefly, given a graph $G$ and a 1-hop message passing GNN, at layer $l$ of the GNN, $h _ { v } ^ { l }$ is computed by $h _ { v } ^ { l - 1 }$ and $\{ h _ { u } ^ { l - 1 } \mid u \in Q _ { v , G } ^ { 1 } \}$ :
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
m _ { v } ^ { l } = \mathrm { { \bf M E S } } ^ { l } ( \{ ( h _ { u } ^ { l - 1 } , e _ { u v } ) | u \in Q _ { v , G } ^ { 1 } \} ) , h _ { v } ^ { l } = \mathrm { { \bf U P D } } ^ { l } ( m _ { v } ^ { l } , h _ { v } ^ { l - 1 } ) ,
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
where $m _ { v } ^ { l }$ is the message to node $v$ at layer $l$ , $\mathrm { M E S } ^ { l }$ and $\mathrm { U P D } ^ { l }$ are message and update functions at layer $l$ respectively. After $L$ layers of message passing, $h _ { v } ^ { L }$ is used as the final representation of node $v$ . Such a representation can be used to conduct node-level tasks like node classification and node regression. To get the graph representation, a readout function is used:
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
h _ { G } = \mathrm { R E A D O U T } ( \{ h _ { v } ^ { L } | v \in V \} ) ,
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where READOUT is the readout function for computing the final graph representation. Then $h _ { G }$ can be used to conduct graph-level tasks like graph classification and graph regression.
|
| 40 |
+
|
| 41 |
+
# 2.3 $K$ -hop message passing framework
|
| 42 |
+
|
| 43 |
+
The 1-hop message passing framework can be directly generalized to $K$ -hop message passing, as it shares the same message and update mechanism. The difference is that independent message and update functions can be employed for each hop. Meanwhile, a combination function is needed to combine the results from different hops into the final node representation at this layer. First, we differentiate two different kernels of $K$ -hop neighbors, which are interchanged and misused in previous research.
|
| 44 |
+
|
| 45 |
+
The first kernel of $K$ -hop neighbors is shortest path distance (spd) kernel. Namely, the $k$ -th hop neighbors of node $v$ in graph $G$ is the set of nodes with the shortest path distance of $k$ from $v$ .
|
| 46 |
+
|
| 47 |
+
Definition 1. For a node v in graph G, the K-hop neighbors N K,spdv,G of $v$ based on shortest path distance kernel is the set of nodes that have the shortest path distance from node $v$ less than or equal to $K$ . We further denote $Q _ { v , G } ^ { k , s p d }$ as the set of nodes in $G$ that are exactly the $k$ -th hop neighbors (with shortest path distance of exactly $k$ ) and $\mathcal { N } _ { v , G } ^ { 0 , s p d } = Q _ { v , G } ^ { 0 , s p d } = \{ v \}$ is the node itself.
|
| 48 |
+
|
| 49 |
+
The second kernel of the $K$ -hop neighbors is based on graph diffusion $( g d )$ .
|
| 50 |
+
|
| 51 |
+
Definition 2. For a node v in graph $G$ , the $K$ -hop neighbors $\mathcal { N } _ { v , G } ^ { K , g d }$ of v based on graph diffusion kernel is the sediffusion steps nodes that can diffuse iand the diffusion kernel ormation to node (adjacency matr $v$ within the number). We further denote dom walk as the set $K$ $A$ $Q _ { v , G } ^ { k , g d }$ of nodes in that are exactly the -th hop neighbors (nodes that can diffuse information to node with k diffusion steps) and N 0,gdv,G $\mathcal { N } _ { v , G } ^ { 0 , g d } = Q _ { v , G } ^ { 0 , g \bar { d } } = \bar { \{ v \} }$ is the node itself.
|
| 52 |
+
|
| 53 |
+
Note that a node can be a $k$ -th hop neighbor of $v$ for multiple $k$ based on the graph diffusion kernel, but it can only appear in one hop for the shortest path distance kernel. We include more discussions of $K$ -hop kernels in Appendix A. Next, we define the $K$ -hop message passing framework as follows:
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\begin{array} { r } { m _ { v } ^ { l , k } = \mathrm { M E S } _ { k } ^ { l } ( \{ ( h _ { u } ^ { l - 1 } , e _ { u v } ) | u \in Q _ { v , G } ^ { k , t } ) \} ) , h _ { v } ^ { l , k } = \mathrm { U P D } _ { k } ^ { l } ( m _ { v } ^ { l , k } , h _ { v } ^ { l - 1 } ) , } \\ { h _ { v } ^ { l } = \mathrm { C O M B I N E } ^ { l } ( \{ \{ h _ { v } ^ { l , k } | k = 1 , 2 , . . . , K \} \} ) , } \end{array}
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where $t \in \{ s p d , g d \}$ , spd is the shortest path distance kernel and $_ { g d }$ is the graph diffusion kernel. Here, for each hop, we can apply unique MES and UPD functions. Note that for $k > 1$ , there may not exist the edge feature $e _ { u v }$ as nodes are not directly connected. But we leave it here since we can use other types of features to replace it like path encoding. We further discuss it in Appendix I. Compared to the 1-hop message passing framework described in Equation (1), the COMBINE function is introduced to combine the representations of node $v$ at different hops. It is easy to see that a $L$ layer 1-hop message passing GNNs is actually a $L$ layer $K$ -hop message passing GNNs with $K = 1$ . We include more discussions of $K$ -hop message passing GNNs in Appendix A. To aid further analysis, we also prove that $K$ -hop message passing can injectively encode the neighbor representations at different hops into $h _ { v } ^ { l }$ in Appendix B.
|
| 60 |
+
|
| 61 |
+
# 2.4 Expressive power of $K$ -hop message passing framework
|
| 62 |
+
|
| 63 |
+
In this section, we theoretically analyze the expressive power of $K$ -hop message passing. We assume there is no edge feature and all nodes in the graph have the same feature, which means that GNNs can only distinguish two nodes with the local structure of nodes. Note that including node features only increases the expressive power of GNNs as nodes/graphs are more easily to be discriminated. It has been proved that the expressive power of 1-hop message passing is bounded by the 1-WL test on discriminating non-isomorphic graphs [7, 11]. In this section, We show that the $K$ -hop message passing is strictly more powerful than the 1-WL test when $K > 1$ . Across the analysis, we utilize regular graphs as examples to illustrate our theorems since they cannot be distinguished using either 1-hop message passing or the 1-WL test. To begin the analysis, we first define proper $K$ -hop message passing GNNs.
|
| 64 |
+
|
| 65 |
+
Definition 3. A proper $K$ -hop message passing GNN is a GNN model where the message, update, and combine functions are all injective given the input from a countable space.
|
| 66 |
+
|
| 67 |
+
A proper $K$ -hop message passing GNN is easy to find due to the universal approximation theorem [19] of neural network and the Deep Set for set operation [20]. In the latter sections, by default, all mentioned $K$ -hop message passing GNNs are proper. Next, we introduce node configuration:
|
| 68 |
+
|
| 69 |
+
Definition 4. The node configuration of node v in graph $G$ within $K$ hops under t kernel is a list $A _ { v , G } ^ { K , t } = ( a _ { v , G } ^ { 1 , t } , a _ { v , G } ^ { 2 , t } , . . . , a _ { v , G } ^ { K , t } )$ , where $a _ { v , G } ^ { i , t } = | Q _ { v , G } ^ { i , t } |$ is the number of $i$ -th hop neighbors of node v.
|
| 70 |
+
|
| 71 |
+

|
| 72 |
+
Figure 1: Here are two pairs of non-isomorphic regular graphs. With 2-hop message passing, example 1 can be distinguished by the graph diffusion kernel, and example 2 can be distinguished by the shortest path distance kernel. However, both two examples become indistinguishable if we switch the kernel. Finally, both two examples can be distinguished by adding peripheral subgraph information.
|
| 73 |
+
|
| 74 |
+
When we say two node configurations AK,t v1,G(1) and AK,t $A _ { v _ { 2 } , G ^ { ( 2 ) } } ^ { K , t }$ are equal, we mean that these two lists are component-wise equal to each other. Now, we state the first proposition:
|
| 75 |
+
|
| 76 |
+
Proposition 1. A proper $K$ -hop message passing GNN is strictly more powerful than 1-hop message passing GNNs when $K > 1$ .
|
| 77 |
+
|
| 78 |
+
To see why this is true, we first discuss how node configuration relates to the first layer of message passing. In the first layer of $K$ -hop message passing, each node aggregates neighbors from up to $K$ hops. As each node has the same node label, an injective message function can only know how many neighbors at each hop, which is exactly the node configuration. In other words, The first layer of $K$ -hop message passing is equivalent to inject node configuration to each node label. When $K = 1$ , the node configuration of $v _ { 1 }$ and $v _ { 2 }$ are $d _ { v _ { 1 } , G ^ { ( 1 ) } }$ and $d _ { v _ { 2 } , G ^ { ( 2 ) } }$ , where $d _ { v , G }$ is the node degree of $v$ . After $L$ layers, GNNs can only get the node degree information of each node within $L$ hops of node $v$ . Then, it is straightforward to see why these GNNs cannot distinguish any $n$ -sized $r$ -regular graph, as each node in the regular graph has the same degree.
|
| 79 |
+
|
| 80 |
+
Next, when $K > 1$ , the $K$ -hop message passing is at least equally powerful as 1-hop message passing since node configuration up to $K$ hop includes all the information the 1 hop has. To see why it is more powerful, we use two examples to illustrate it. The first example is shown in the left part of Figure 1. Suppose here we use graph diffusion kernel and we want to learn the representation of node $v _ { 1 }$ and node $v _ { 2 }$ in the two graphs. We know that the 1-hop GNNs produce the same representation for two nodes as they are both nodes in 6-sized 3-regular graphs. However, it is easy to see that $v _ { 1 }$ and $v _ { 2 }$ have different local structures and should have different representations. Instead, if we use the 2-hop message passing with the graph diffusion kernel, we can easily distinguish two nodes by checking the 2nd hop neighbors of the node, as node $v _ { 1 }$ has four 2nd hop neighbors but node $v _ { 2 }$ only has two 2nd hop neighbors. The second example is shown in the right part of Figure 1. Two graphs in the example are still regular graphs. Suppose here we use shortest path distance kernel, node $v _ { 1 }$ and $v _ { 2 }$ have different numbers of 2nd hop neighbors and thus will have different representations by performing 2-hop message passing. These two examples convincingly demonstrate that the $K$ -hop message passing with $K > 1$ can have better expressive power than $K = 1$ . To further study the expressive power of $K$ -hop message passing on regular graphs, we show the following result:
|
| 81 |
+
|
| 82 |
+
Theorem 1. Consider all pairs of $n$ -sized $r$ -regular graphs, let $3 \leq r < ( 2 l o g 2 n ) ^ { 1 / 2 }$ and $\epsilon$ be a fixed constant. With at most $\begin{array} { r } { K = \lfloor ( \frac { 1 } { 2 } + \epsilon ) \frac { \log { 2 n } } { \log { ( r - 1 ) } } \rfloor } \end{array}$ , there exists a $I$ layer $K$ -hop message passing GNN using the shortest path distance kernel that distinguishes almost all $1 - o ( n ^ { - 1 / 2 } )$ such pairs of graphs.
|
| 83 |
+
|
| 84 |
+
We include the proof and simulation results in Appendix C. Theorem 1 shows that even with 1 layer and a modest $K$ , $K$ -hop GNNs are powerful enough to distinguish almost all regular graphs.
|
| 85 |
+
|
| 86 |
+
Finally, we characterize the existing $K$ -hop methods with the proposed $K$ -hop message passing framework. Specifically, we show that 1) the expressive power of $K$ layer GINE [16] is bounded by $K$ layer $K$ -hop message passing with the shortest path distance kernel. 2) The expressive power of the Graphormer [17] is equal to $K$ -hop GNNs with the shortest path distance kernel and infinity $K$ . 3) For spectral GNNs and existing $K$ -hop GNNs with the graph diffusion kernel like MixHop [12] and MAGNA [14], we find they actually use a weak version of $K$ -hop than the definition of us. Specifically, it is shown that the expressive power of spectral GNNs is also bounded by 1-WL test [21], which contradicts our result as graph diffusion can be viewed as a special case of spectral GNN. However, we show that our definition of $K$ -hop message passing with graph diffusion kernel actually injects a non-linear function on the spectral basis, thus achieving superior expressive power. We leave the detailed discussion in Appendix D. Further, Distance Encoding [22] also uses the shortest path distance information to augment the 1-hop message passing, which is similar to $K$ -hop GNNs with the shortest path distance kernel. However, we find the expressive power of the two frameworks differs from each other. We leave the detailed discussion in Appendix E.
|
| 87 |
+
|
| 88 |
+
# 2.5 Limitation of $K$ -hop message passing framework
|
| 89 |
+
|
| 90 |
+
Although we show that $K$ -hop GNNs with $K > 1$ are better at distinguishing non-isomorphic structures than 1-hop GNNs, there are still limitations. In this section, we discuss the limitation of $K$ -hop message passing. Specifically, we show that the choice of the kernel can affect the expressive power of $K$ -hop message passing. Furthermore, even with $K$ -hop message passing, we still cannot distinguish some simple non-isomorphic structures and the expressive power of $K$ -hop message passing is bounded by 3-WL.
|
| 91 |
+
|
| 92 |
+
Continue looking at the provided examples in Figure 1. In example 1, if we use the shortest path distance kernel instead of the graph diffusion kernel, two nodes have the same number of neighbors in the 2nd hop, which means that we cannot distinguish two nodes this time. Similarly, in example 2, two nodes have the same number of neighbors in both 1st and 2nd hops using graph diffusion kernel. These results highlight that the choice of the kernel can affect the expressive power of $K$ -hop message passing, and none of them can distinguish both two examples with 2-hop message passing.
|
| 93 |
+
|
| 94 |
+
Recently, Frasca et al. [23] show that any subgraph-based GNNs with node-based selection policy can be implemented by 3-IGN [24, 25] and thus their expressive power is bounded by 3-WL test. Here, we show that the $K$ -hop message passing GNNs can also be implemented by 3-IGN for both two kernels and thus:
|
| 95 |
+
|
| 96 |
+
Theorem 2. The expressive power of a proper $K$ -hop message passing GNN of any kernel is bounded by the 3-WL test.
|
| 97 |
+
|
| 98 |
+
We include the proof in Appendix F. Given all these observations, we may wonder if there is a way to further improve the expressive power of $K$ -hop message passing?
|
| 99 |
+
|
| 100 |
+
# 3 KP-GNN: improving the power of $K$ -hop message passing by peripheral subgraph
|
| 101 |
+
|
| 102 |
+
In this section, we describe how to improve the expressive power of $K$ -hop message passing by adding additional information to the message passing framework. Specifically, by adding peripheral subgraph information, we can improve the expressive power of the $K$ -hop message passing by a large margin.
|
| 103 |
+
|
| 104 |
+
# 3.1 Peripheral edge and peripheral subgraph
|
| 105 |
+
|
| 106 |
+
First, we define peripheral edge and peripheral subgraph.
|
| 107 |
+
|
| 108 |
+
Definition 5. The peripheral edge $E ( Q _ { v , G } ^ { k , t } )$ is defined as the set of edges that connect nodes within set $Q _ { v , G } ^ { k , t }$ . We further denote $| E ( Q _ { v , G } ^ { k , t } ) |$ as the number of peripheral edge in $E ( Q _ { v , G } ^ { k , t } )$ . The peripheral subgraph Gk,tv,G $G _ { v , G } ^ { k , t } = ( Q _ { v , G } ^ { k , t } , E ( Q _ { v , G } ^ { k , t } ) )$ is defined as the subgraph induced by $Q _ { v , G } ^ { k , t }$ from the whole graph $G$ .
|
| 109 |
+
|
| 110 |
+
Briefly speaking, the peripheral edge $E ( Q _ { v , G } ^ { k , t } )$ record all the edges whose two ends are both from $Q _ { v , G } ^ { k , t }$ and the peripheral subgraph is a graph constituted by peripheral edges. It is easy to see that the peripheral subgraph $G _ { v , G } ^ { k , t }$ automatically contains all the information of peripheral edge $E ( Q _ { v , G } ^ { k , t } )$ . Next, we show that the power of $K$ -hop message passing can be improved by leveraging the information of peripheral edges and peripheral subgraphs. We again refer to the examples in Figure 1. Here we only consider the peripheral edge information. In example 1, we notice that at the 1st hop, there is an edge between node 3 and node 4 in the left graph. More specifically, $E ( Q _ { v _ { 1 } , G ^ { ( 1 ) } } ^ { 1 , t } ) \stackrel { - } { = } \{ ( 3 , 4 ) \}$ . In contrast, we have $E ( Q _ { v _ { 2 } , G ^ { ( 2 ) } } ^ { 1 , t } ) = \{ \}$ in the right graph, which means there is no edge between the 1st hop neighbors of $v _ { 2 }$ . Therefore, we can successfully distinguish these two nodes by adding this information to the message passing. Similarly, in example 2, there is one edge between the 1st hop neighbors of node $v _ { 2 }$ , but no such edge exists for node $v _ { 1 }$ . By leveraging peripheral edge information, we can also distinguish the two nodes. The above examples demonstrate the effectiveness of the peripheral edge and peripheral subgraph information.
|
| 111 |
+
|
| 112 |
+
# 3.2 $K$ -hop peripheral-subgraph-enhanced graph neural network
|
| 113 |
+
|
| 114 |
+
In this section, we propose $\mathbf { K }$ -hop Peripheral-subgraph-enhanced Graph Neural Network (KP-GNN), which equips $K$ -hop message passing GNNs with peripheral subgraph information for more powerful GNN design. Recall the $K$ -hop message passing defined in Equation (3). The only difference between KP-GNN and original $K$ -hop GNNs is that we revise the message function as follows:
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\begin{array} { r } { m _ { v } ^ { l , k } = \mathbf { M E S } _ { k } ^ { l } ( \{ ( h _ { u } ^ { l - 1 } , \ e _ { u v } ) | u \in Q _ { v , G } ^ { k , t } \} , \ G _ { v , G } ^ { k , t } ) . } \end{array}
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
Briefly speaking, in the message step at the $k$ -th hop, we not only aggregate information of the neighbors but also the peripheral subgraph at that hop. The implementation of KP-GNN can be very flexible, as any graph encoding function can be used. To maximize the information the model can encode while keeping it simple, we implement the message function as:
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\begin{array} { r l } & { \mathbf { M E S } _ { k } ^ { l } = \mathbf { M E S } _ { k } ^ { l , n o r m a l } ( \ P ( h _ { u } ^ { l - 1 } , e _ { u v } ) | u \in Q _ { v , G } ^ { k , t } \| ) + f ( G _ { v , G } ^ { k , t } ) , } \\ & { \qquad f ( G _ { v , G } ^ { k , t } ) = \mathbf { E M B } ( ( E ( Q _ { v , G } ^ { k , t } ) , C _ { k } ^ { k ^ { \prime } } ) ) ~ , } \end{array}
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
where MESl,normal denotes the message function in the original GNN model, $C _ { k } ^ { k ^ { \prime } }$ is the $k ^ { \prime }$ configuration, which encode both node configuration and the number of the peripheral edge of all nodes in $G _ { v , G } ^ { k , t }$ up to $k ^ { \prime }$ hops. It can be regarded as running another 1 layer KP-GNN and readout function on each peripheral subgraph. EMB is a learnable embedding function. With this implementation, any base GNN model can be incorporated into and be enhanced by the KP-GNN framework by replacing $\mathbf { M E S } _ { k } ^ { l , n o r m a l }$ and $\mathrm { U P D } _ { k } ^ { l }$ with the corresponding functions for each hop $k$ . We leave the detailed implementation in Appendix I.
|
| 127 |
+
|
| 128 |
+
# 3.3 The expressive power of KP-GNN and comparison with existing methods
|
| 129 |
+
|
| 130 |
+
In this section, we theoretically characterize the expressive power of KP-GNN and compare it with the original $K$ -hop message passing framework. The key insight is that, according to Equation (4), the message function at the $k$ -th hop additionally encodes $G _ { v , G } ^ { k , t }$ compared to normal $K$ -hop message passing. As we have already shown in the last section, -hop GNNs are bounded by 3-WL and thus cannot distinguish any non-isomorphic distance regular graphs, as well as Distance Encoding [22]. Let C k′ b e the $k ^ { \prime }$ -configuration of peripheral subgraph at $j$ -th hop of nodes in distance regular graph $G$ . Here we show that with the aid of peripheral subgraphs, KP-GNN is able to distinguish distance regular graphs:
|
| 131 |
+
|
| 132 |
+
Proposition 2. For two non-isomorphic distance regular graphs $G ^ { ( 1 ) } = ( V ^ { ( 1 ) } , E ^ { ( 1 ) } )$ and $G ^ { ( 2 ) } =$ $( V ^ { ( 2 ) } , E ^ { ( 2 ) } )$ with the same diameter $d$ and intersection array $( b _ { 0 } , b _ { 1 } , . . . , b _ { d - 1 } ; c _ { 1 } , c _ { 2 } , . . . , c _ { d } )$ . Given $a$ er an $^ { l }$ - $d$ $K P$ th messafor some s defined in Equation (5), it can distinguish. $G ^ { ( 1 ) }$ $G ^ { ( 2 ) } i f C _ { j , G ^ { ( 1 ) } } ^ { k ^ { \prime } } \ne C _ { j , G ^ { ( 2 ) } } ^ { k ^ { \prime } }$ C k′j,G(2) 0 < j ≤ d
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 2: An example of two non-isomorphic distance regular graph with intersection array $( 6 , 3 ; 1 , 2 )$ .
|
| 136 |
+
|
| 137 |
+
We include the proof in Appendix G. Here we leverage an example in Figure 2 to briefly show why KP-GNN is able to distinguish distance regular graphs. Figure 2 displays two distance regular graphs with an intersection array of $( 6 , 3 ; 1 , 2 )$ . The left one is Shrikhande graph and the right one is $4 \times 4$ Rook’s graph. Now, let’s look at the 1-hop peripheral subgraph of the green node. In the Shrikhande graph, there are 6 peripheral edges marked with red. Further, 6 edges constitute a circle. In the $4 \times 4$ Rook’s graph, there are still 6 peripheral edges. However, 6 edges constitute two circles with 3 edges in each circle, which is different from the Shrikhande graph. Then, any peripheral subgraph encoder that can distinguish these two graphs like node configuration enables the corresponding KP-GNN to distinguish the example. Proposition 2 shows that the KP-GNN is capable of distinguishing distance regular graphs, which further distinguishes KP-GNN from DE-1 [22] as it cannot distinguish any two connected distance regular graphs with the same intersection arrays according to Theorem 3.7 in [22]. However, it is currently unknown whether can KP-GNN with Equation 5 distinguish all distance regular graphs. We leave the detailed discussion in Appendix G.
|
| 138 |
+
|
| 139 |
+
Moreover, both the subgraph-based GNNs like NGNN [26], GNN-AK [27], ESAN [28], and KPGNN leverage the information in the subgraph to enhance the power of message passing. However, KP-GNN is intrinsically different from them. Firstly, in KP-GNN, the message passing is performed on the whole graph instead of the subgraphs. This means that for each node, there is only one representation to be learned. Instead, for subgraph-based GNNs, the message passing is performed separately for each subgraph and each node could have multiple representations depending on which subgraph it is in. Secondly, in subgraph-based GNNs, they consider the subgraph as a whole without distinguishing nodes at different hops. Instead, KP-GNN takes one step further by dividing the subgraph into two parts. The first part is the hierarchy of neighbors at each hop. The second part is the connection structure between nodes in each hop. This gives us a better point of view to design a more powerful learning method. From the Corollary 7 in [23], we know that all subgraph-based GNNs with node selection as subgraph policy is bounded by 3-WL, which means they cannot distinguish any distance regular graph and KP-GNN is better at it.
|
| 140 |
+
|
| 141 |
+
# 3.4 Time, space complexity, and limitation
|
| 142 |
+
|
| 143 |
+
In this section, we discuss the time and space complexity of $K$ -hop message passing GNN and KPGNN. Suppose a graph has $n$ nodes and $m$ edges. Then, the $K$ -hop message passing and KP-GNN have both the space complexity of $O ( n )$ and the time complexity of $O ( \bar { n } ^ { 2 } )$ for the shortest path distance kernel. Note that the complexity of graph diffusion is no less than the shortest path distance kernel. We can see that KP-GNN only requires the same space complexity as vanilla GNNs and much less time complexity than the subgraph-based GNNs, which are at least $O ( n m )$ . However, $K$ -hop message passing including KP-GNN still have intrinsic limitation. We leave a detailed discussion on the complexity and limitation of KP-GNN in Appendix $_ \mathrm { H }$ .
|
| 144 |
+
|
| 145 |
+
# 4 Related Work
|
| 146 |
+
|
| 147 |
+
Expressive power of GNN. Analyzing the expressive power of GNNs is a crucial problem as it can serve as a guide on how to improve GNNs. Xu et al. [7] and Morris et al. [11] first proved that the power of 1-hop message passing is bounded by the 1-WL test. In other words, 1-hop message passing cannot distinguish any non-isomorphic graphs that the 1-WL test fails to. In recent years, many efforts have been put into increasing the expressive power of 1-hop messaging passing. The first line of research tries to mimic the higher-order WL tests, like 1-2-3 GNN [11], PPGN [24], ring-GNN [29]. However, they require exponentially increasing space and time complexity w.r.t. node number and cannot be generalized to large-scale graphs. The second line of research tries to enhance the rooted subtree of 1-WL with additional features. Some works [30, 31, 32] add one-hot or random features into nodes. Although they achieve good results in some settings, they deteriorate the generalization ability as such features produce different representations for nodes even with the same local graph structure. Some works like Distance Encoding [22], SEAL [33], labeling trick [34] and GLASS [35] introduce node labeling based on either distance or distinguishing target node set. On the other hand, GraphSNN [36] introduces a hierarchy of local isomorphism and proposes structural coefficients as additional features to identify such local isomorphism. However, the function designed to approximate the structural coefficient cannot fully achieve its theoretical power. The third line of research resorts to subgraph representation. Specifically, ID-GNN [37] extracts ego-netwok for each node and labels the root node with a different color. NGNN [26] encodes a rooted subgraph instead of a rooted subtree by subgraph pooling thus achieving superior expressive power on distinguishing regular graphs. GNN-AK [27] applies a similar idea as NGNN. The only difference lies in how to compute the node representation from the local subgraph. However, such methods need to run an inner GNN on every node of the graph thus introducing much more computation overhead. Meanwhile, the expressive power of subgraph GNNs are bounded by 3-WL [23].
|
| 148 |
+
|
| 149 |
+
$K$ -hop message passing GNN. There are some existing works that instantiate the $K$ -hop message passing framework. For example, MixHop [12] performs message passing on each hop with graph diffusion kernel and concatenates the representation on each hop as the final representation. Khop [13] sequentially performs the message passing from hop K to hop 1 to compute the representation of the center node. However, it is not parallelizable due to its computational procedure. MAGNA [14] introduces an attention mechanism to $K$ -hop message passing. GPR-GNN [15] use graph diffusion kernel to perform graph convolution on $K$ -hop and aggregate them with learnable parameters. However, none of them give a formal definition of $K$ -hop message passing and theoretically analyze its representation power and limitations.
|
| 150 |
+
|
| 151 |
+
# 5 Experiments
|
| 152 |
+
|
| 153 |
+
In this section, we conduct extensive experiments to evaluate the performance of KP-GNN. Specifically, we 1) empirically verify the expressive power of KP-GNN on 3 simulation datasets and demonstrate the benefits of KP-GNN compared to normal $K$ -hop message passing GNNs; 2) demonstrate the effectiveness of KP-GNN on identifying various node properties, graph properties, and substructures with 3 simulation datasets; 3) show that the KP-GNN can achieve state-of-the-art performance on multiple real-world datasets; 4) analyze the running time of KP-GNN. The detail of each variant of KP-GNN is described in Appendix I and the detailed experimental setting is described in Appendix J. We implement the KP-GNN with PyTorch Geometric package [38]. Our code is available at https://github.com/JiaruiFeng/KP-GNN.
|
| 154 |
+
|
| 155 |
+
Datasets: To evaluate the expressive power of KP-GNN, we choose: 1) EXP dataset [31], which contains 600 pairs of non-isomorphic graphs (1-WL failed). The goal is to map these graphs to two different classes. 2) SR25 dataset [39], which contains 15 non-isomorphic strongly regular graphs (3- WL failed) with each graph of 25 nodes. The dataset is translated to a 15-way classification problem with the goal of mapping each graph into different classes. 3) CSL dataset [40], which contains 150 4-regular graphs (1-WL failed) divided into 10 isomorphism classes. The goal of the task is to classify them into corresponding isomorphism classes. To demonstrate the capacity of KP-GNN on counting node/graph properties and substructures, we pick 1) Graph property regression (connectedness, diameter, radius) and node property regression (single source shortest path, eccentricity, Laplacian feature) task on random graph dataset [41]. 2) Graph substructure counting (triangle, tailed triangle, star, and 4-cycle) tasks on random graph dataset [42]. To evaluate the performance of KP-GNN on real-world datasets, we select 1) MUTAG [43], D&D [44], PROTEINS [44], PTC-MR [45], and IMDB-B [46] from TU database. 2) QM9 [47, 48] and ZINC [49] for molecular properties prediction. The detailed statistics of the datasets are described in Appendix L. Without further highlighting, all error bars in the result tables are the standard deviations of multiple runs.
|
| 156 |
+
|
| 157 |
+
Table 1: Empirical evaluation of the expressive power.
|
| 158 |
+
|
| 159 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">K</td><td>EXP (ACC)</td><td>SR (ACC)</td><td></td><td>CSL (ACC)</td></tr><tr><td>SPD GD</td><td>SPD</td><td>GD</td><td>SPD GD</td></tr><tr><td rowspan="4">K-GIN</td><td>K=1</td><td>50 50</td><td>6.67</td><td>6.67</td><td>12</td></tr><tr><td>K=2</td><td>50 50</td><td>6.67</td><td>6.67</td><td>12 32 22.7</td></tr><tr><td>K=3</td><td>100 66.9</td><td>6.67</td><td>6.67</td><td>62 42</td></tr><tr><td>K=4</td><td>100 100</td><td>6.67</td><td>6.67</td><td>92.7 62.7</td></tr><tr><td rowspan="4">KP-GIN</td><td>K=1</td><td>50</td><td>50 100</td><td>100</td><td>22</td><td>22</td></tr><tr><td>K=2</td><td>100</td><td>100 100</td><td>100</td><td>52.7</td><td>52.7</td></tr><tr><td>K=3</td><td>100</td><td>100</td><td>100 100</td><td>90</td><td>90</td></tr><tr><td>K=4</td><td>100</td><td>100</td><td>100 100</td><td>100</td><td>100</td></tr></table>
|
| 160 |
+
|
| 161 |
+
Empirical evaluation of the expressive power: For empirical evaluation of the expressive power, we conduct the ablation study on hop $K$ for both normal $K$ -hop GNNs and KP-GNN. For $K$ -hop GNNs, we implement K-GIN which uses GIN [7] as the base encoder. For KP-GNN, we implement KP-GIN. The results are shown in Table 1. Based on the results, we have the following conclusions: 1) $K$ -hop GNNs with both two kernels have expressive power higher than the 1-WL test as it shows the per
|
| 162 |
+
|
| 163 |
+
fect performance on the EXP dataset and performance better than a random guess on the CSL dataset. 2) Increasing $K$ can improve the expressive for both two kernels. 3) $K$ -hop GNNs cannot distinguish any strong regular graphs in SR25 dataset, which is aligned with Theorem 2. 4) KP-GNN has much higher expressive power than normal $K$ -hop GNNs by showing better performance on every dataset given the same $K$ . Further, it achieves perfect results on the SR25 dataset even with $K = 1$ , which demonstrates its ability on distinguishing distance regular graphs.
|
| 164 |
+
|
| 165 |
+
Table 2: Simulation dataset result. The top two are highlighted by First, Second.
|
| 166 |
+
|
| 167 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3">Node Properties (log1o(MSE))</td><td colspan="3">Graph Properties (log1o(MSE))</td><td colspan="4">Counting Substructures (MAE)</td></tr><tr><td>SSSP</td><td>Ecc.</td><td>Lap.</td><td>Connect.</td><td>Diameter</td><td>Radius</td><td>Tri.</td><td>Tailed Tri.</td><td>Star</td><td>4-Cycle</td></tr><tr><td>GIN</td><td>-2.0000</td><td>-1.9000</td><td>-1.6000</td><td>-1.9239</td><td>-3.3079</td><td>-4.7584</td><td>0.3569</td><td>0.2373</td><td>0.0224</td><td>0.2185</td></tr><tr><td>PNA</td><td>-2.8900</td><td>-2.8900</td><td>-3.7700</td><td>-1.9395</td><td>3.4382</td><td>-4.9470</td><td>0.3532</td><td>0.2648</td><td>0.1278</td><td>0.2430</td></tr><tr><td>PPGN</td><td>-</td><td></td><td>-</td><td>-1.9804</td><td>-3.6147</td><td>-5.0878</td><td>0.0089</td><td>0.0096</td><td>0.0148</td><td>0.0090</td></tr><tr><td>GIN-AK+</td><td>-</td><td>-</td><td>-</td><td>-2.7513</td><td>-3.9687</td><td>-5.1846</td><td>0.0123</td><td>0.0112</td><td>0.0150</td><td>0.0126</td></tr><tr><td>K-GIN+</td><td>-2.7919</td><td>-2.5938</td><td>-4.6360</td><td>-2.1782</td><td>-3.9695</td><td>-5.3088</td><td>0.2593</td><td>0.1930</td><td>0.0165</td><td>0.2079</td></tr><tr><td>KP-GIN+</td><td>-2.7969</td><td>-2.6169</td><td>-4.7687</td><td>-4.4322</td><td>-3.9361</td><td>-5.3345</td><td>0.0060</td><td>0.0073</td><td>0.0151</td><td>0.0395</td></tr></table>
|
| 168 |
+
|
| 169 |
+
Effectiveness on node/graph properties and substructure prediction: To evaluate the effectiveness of KP-GNN on node/graph properties and substructure prediction, we compare it with several existing models. For the baseline model, we use GIN [7], which has the same expressive power as the 1-WL test. For more powerful baselines, we use GIN-AK $^ +$ [27], PNA [41], and PPGN [24]. For normal $K$ -hop GNNs, we implement $\mathrm { K } { \mathrm { - G I N } } +$ , and for KP-GNN, we implement KP- $\mathrm { G I N + }$ . The results are shown in Table 2. Baseline results are taken from [27] and [41]. We can see ${ \mathrm { K P - G I N + } }$ achieve SOTA on a majority of tasks. Meanwhile, $\mathrm { K } { \mathrm { - G I N } } +$ also gets great performance on node/graph properties prediction. These results demonstrate the capability of KP-GNN to identify various properties and substructures. We leave the detailed results on counting substructures in Appendix K
|
| 170 |
+
|
| 171 |
+
Table 3: TU dataset evaluation result.
|
| 172 |
+
|
| 173 |
+
<table><tr><td>Method</td><td>MUTAG</td><td>D&D</td><td>PTC-MR</td><td>PROTEINS</td><td>IMDB-B</td></tr><tr><td>WL</td><td>90.4±5.7</td><td>79.4±0.3</td><td>59.9±4.3</td><td>75.0±3.1</td><td>73.8±3.9</td></tr><tr><td>GIN</td><td>89.4±5.6</td><td></td><td>64.6±7.0</td><td>75.9±2.8</td><td>75.1±5.1</td></tr><tr><td>DGCNN</td><td>85.8±1.7</td><td>79.3 ±0.9</td><td>58.6 ±2.5</td><td>75.5±0.9</td><td>70.0±0.9</td></tr><tr><td>GraphSNN</td><td>91.24±2.5</td><td>82.46±2.7</td><td>66.96±3.5</td><td>76.51±2.5</td><td>76.93±3.3</td></tr><tr><td>GIN-AK+</td><td>91.30±7.0</td><td>=</td><td>68.20±5.6</td><td>77.10±5.7</td><td>75.60±3.7</td></tr><tr><td>KP-GCN</td><td>91.7±6.0</td><td>79.0±4.7</td><td>67.1±6.3</td><td>75.8±3.5</td><td>75.9±3.8</td></tr><tr><td>KP-GraphSAGE</td><td>91.7±6.5</td><td>78.1±2.6</td><td>66.5±4.0</td><td>76.5±4.6</td><td>76.4±2.7</td></tr><tr><td>KP-GIN</td><td>92.2±6.5</td><td>79.4±3.8</td><td>66.8±6.8</td><td>75.8±4.6</td><td>76.6±4.2</td></tr><tr><td>GIN-AK+*</td><td>95.0±6.1</td><td>OOM</td><td>74.1±5.9</td><td>78.9±5.4</td><td>77.3±3.1</td></tr><tr><td>GraphSNN*</td><td>94.70±1.9</td><td>83.93±2.3</td><td>70.58±3.1</td><td>78.42±2.7</td><td>78.51±2.8</td></tr><tr><td>KP-GCN*</td><td>96.1±4.6</td><td>83.2±2.2</td><td>77.1±4.1</td><td>80.3±4.2</td><td>79.6±2.5</td></tr><tr><td>KP-GraphSAGE*</td><td>96.1±4.6</td><td>83.6±2.4</td><td>76.2±4.5</td><td>80.4±4.3</td><td>80.3±2.4</td></tr><tr><td>KP-GIN*</td><td>95.6±4.4</td><td>83.5±2.2</td><td>76.2±4.5</td><td>79.5±4.4</td><td>80.7±2.6</td></tr></table>
|
| 174 |
+
|
| 175 |
+
Table 4: QM9 results. The top two are highlighted by First, Second.
|
| 176 |
+
|
| 177 |
+
<table><tr><td>Target</td><td>DTNN</td><td>MPNN</td><td>Deep LRP</td><td>PPGN</td><td>N-1-2-3-GNN</td><td>KP-GIN+</td><td>KP-GIN'</td></tr><tr><td>μ</td><td>0.244</td><td>0.358</td><td>0.364</td><td>0.231</td><td>0.433</td><td>0.367</td><td>0.358</td></tr><tr><td>α</td><td>0.95</td><td>0.89</td><td>0.298</td><td>0.382</td><td>0.265</td><td>0.242</td><td>0.233</td></tr><tr><td>εHOMO</td><td>0.00388</td><td>0.00541</td><td>0.00254</td><td>0.00276</td><td>0.00279</td><td>0.00247</td><td>0.00240</td></tr><tr><td>εLUMO</td><td>0.00512</td><td>0.00623</td><td>0.00277</td><td>0.00287</td><td>0.00276</td><td>0.00238</td><td>0.00236</td></tr><tr><td>△ε</td><td>0.0112</td><td>0.0066</td><td>0.00353</td><td>0.00406</td><td>0.00390</td><td>0.00345</td><td>0.00333</td></tr><tr><td>(R²)</td><td>17.0</td><td>28.5</td><td>19.3</td><td>16.7</td><td>20.1</td><td>16.49</td><td>16.51</td></tr><tr><td>ZPVE</td><td>0.00172</td><td>0.00216</td><td>0.00055</td><td>0.00064</td><td>0.00015</td><td>0.00018</td><td>0.00017</td></tr><tr><td>U</td><td>2.43</td><td>2.05</td><td>0.413</td><td>0.234</td><td>0.205</td><td>0.0728</td><td>0.0682</td></tr><tr><td>U</td><td>2.43</td><td>2.00</td><td>0.413</td><td>0.234</td><td>0.200</td><td>0.0553</td><td>0.0696</td></tr><tr><td>H</td><td>2.43</td><td>2.02</td><td>0.413</td><td>0.229</td><td>0.249</td><td>0.0575</td><td>0.0641</td></tr><tr><td>G</td><td>2.43</td><td>2.02</td><td>0.413</td><td>0.238</td><td>0.253</td><td>0.0526</td><td>0.0484</td></tr><tr><td>C</td><td>0.27</td><td>0.42</td><td>0.129</td><td>0.184</td><td>0.0811</td><td>0.0973</td><td>0.0869</td></tr></table>
|
| 178 |
+
|
| 179 |
+
Evaluation on TU datasets: For baseline models, we select: 1) graph kernel-based method: WL subtree kernel [50]; 2) vanilla GNN methods: GIN [7] and DGCNN [6]; 3) advanced GNN methods: GraphSNN [36] and GIN- $\mathrm { \bf A K } +$ [27]. For the proposed KP-GNN, we implement GCN [1], GraphSAGE [3], and GIN [7] using the KP-GNN framework, denoted as KP-GCN, KP-GraphSAGE, and KP-GIN respectively. The results are shown in Table 3. For a more fair and comprehensive comparison, we report the results from two different evaluation settings. The first setting follows Xu et al. [7] and the second setting follows Wijesinghe and Wang [36]. We denote the second setting with ∗ in the table. We can see KP-GNN achieves SOTA performance on most of datasets under the second setting and still comparable performance to other baselines under the first setting.
|
| 180 |
+
|
| 181 |
+
Table 5: ZINC result.
|
| 182 |
+
|
| 183 |
+
<table><tr><td>Method</td><td># param.</td><td>test MAE</td></tr><tr><td>MPNN</td><td>480805</td><td>0.145±0.007</td></tr><tr><td>PNA</td><td>387155</td><td>0.142±0.010</td></tr><tr><td>Graphormer</td><td>489321</td><td>0.122±0.006</td></tr><tr><td>GSN GIN-AK+</td><td>~500000</td><td>0.101±0.010 0.080±0.001</td></tr><tr><td>CIN</td><td>= 1</td><td>0.079±0.006</td></tr><tr><td>KP-GIN+</td><td>499099</td><td></td></tr><tr><td>KP-GIN'</td><td>488649</td><td>0.111±0.006 0.093±0.007</td></tr></table>
|
| 184 |
+
|
| 185 |
+
Although KP-GNN does not achieve the best result, it is still comparable to other methods.
|
| 186 |
+
|
| 187 |
+
Evaluation on molecular prediction tasks: For QM9 dataset, we report baseline results of DTNN and MPNN from [48]. We further select Deep LRP [42], PPGN [24], and Nested 1-2-3-GNN [26] as baseline models. For the ZINC dataset, we report results of MPNN [18] and PNA [41] from [17]. We further pick Graphormer [17], GSN [51], GIN-AK $^ +$ [27], and CIN [52]. For KP-GNN, we choose ${ \mathrm { K P - G I N } } +$ and ${ \bf K P - G I N } ^ { \prime }$ . The results of the QM9 dataset are shown in Table 4. We can see KPGNN achieves SOTA performance on most of the targets. The results of the ZINC dataset are shown in Table 5.
|
| 188 |
+
|
| 189 |
+
Table 6: Running time (s/epoch).
|
| 190 |
+
|
| 191 |
+
<table><tr><td>Method</td><td>D&D</td><td>ZINC</td><td>Graph property</td></tr><tr><td>GIN</td><td>1.10</td><td>3.59</td><td>1.02</td></tr><tr><td>K-GIN</td><td>3.94</td><td>6.44</td><td>1.67</td></tr><tr><td>KP-GIN</td><td>4.19</td><td>7.38</td><td>1.94</td></tr><tr><td>KP-GIN+</td><td>4.28</td><td>6.74</td><td>1.93</td></tr></table>
|
| 192 |
+
|
| 193 |
+
the computational overhead is almost linear to $K$ . This is reasonable as practical graphs are sparse and the number of $K$ -hop neighbors is far less than $n$ when using a small $K$ .
|
| 194 |
+
|
| 195 |
+
Running time comparison: In this section, we compare the running time of KP-GNN to 1-hop message passing GNN and $K$ -hop message passing GNN. We use GIN [7] as the base model. We also include the ${ \mathrm { K P - G I N + } }$ . All models use the same number of layers and hidden dimensions for a fair comparison. The results are shown in Table 6. We set $K = 4$ for all datasets. We can see
|
| 196 |
+
|
| 197 |
+
# 6 Conclusion
|
| 198 |
+
|
| 199 |
+
In this paper, we theoretically characterize the power of $K$ -hop message passing GNNs and propose the KP-GNN to improve the expressive power by leveraging the peripheral subgraph information at each hop. Theoretically, we prove that $K$ -hop GNNs can distinguish almost all regular graphs but are bounded by the 3-WL test. KP-GNN is able to distinguish many distance regular graphs. Empirically, KP-GNN achieves competitive results across all simulation and real-world datasets.
|
| 200 |
+
|
| 201 |
+
# 7 Acknowledgement
|
| 202 |
+
|
| 203 |
+
This work is partially supported by NSF grant CBE-2225809 and NSF China (No. 62276003).
|
| 204 |
+
|
| 205 |
+
References
|
| 206 |
+
[1] Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations, 2017.
|
| 207 |
+
[2] David K Duvenaud, Dougal Maclaurin, Jorge Iparraguirre, Rafael Bombarell, Timothy Hirzel, Alán Aspuru-Guzik, and Ryan P Adams. Convolutional networks on graphs for learning molecular fingerprints. In Advances in neural information processing systems, pages 2224– 2232, 2015.
|
| 208 |
+
[3] Will Hamilton, Zhitao Ying, and Jure Leskovec. Inductive representation learning on large graphs. In Advances in Neural Information Processing Systems, pages 1025–1035, 2017.
|
| 209 |
+
[4] Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Liò, and Yoshua ´ Bengio. Graph attention networks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id=rJXMpikCZ.
|
| 210 |
+
[5] Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. arXiv preprint arXiv:1511.05493, 2015.
|
| 211 |
+
[6] Muhan Zhang, Zhicheng Cui, Marion Neumann, and Yixin Chen. An end-to-end deep learning architecture for graph classification. In AAAI, pages 4438–4445, 2018.
|
| 212 |
+
[7] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In International Conference on Learning Representations, 2019. URL https: //openreview.net/forum?id $\equiv$ ryGs6iA5Km.
|
| 213 |
+
[8] Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In Proceedings of the 22nd ACM SIGKDD international conference on Knowledge discovery and data mining, pages 855–864. ACM, 2016.
|
| 214 |
+
[9] Bryan Perozzi, Rami Al-Rfou, and Steven Skiena. Deepwalk: Online learning of social representations. In Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 701–710. ACM, 2014.
|
| 215 |
+
[10] Boris Weisfeiler and AA Lehman. A reduction of a graph to a canonical form and an algebra arising during this reduction. Nauchno-Technicheskaya Informatsia, 2(9):12–16, 1968.
|
| 216 |
+
[11] Christopher Morris, Martin Ritzert, Matthias Fey, William L Hamilton, Jan Eric Lenssen, Gaurav Rattan, and Martin Grohe. Weisfeiler and leman go neural: Higher-order graph neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 4602–4609, 2019.
|
| 217 |
+
[12] Sami Abu-El-Haija, Bryan Perozzi, Amol Kapoor, Nazanin Alipourfard, Kristina Lerman, Hrayr Harutyunyan, Greg Ver Steeg, and Aram Galstyan. Mixhop: Higher-order graph convolutional architectures via sparsified neighborhood mixing. In international conference on machine learning, pages 21–29. PMLR, 2019.
|
| 218 |
+
[13] Giannis Nikolentzos, George Dasoulas, and Michalis Vazirgiannis. k-hop graph neural networks. Neural Networks, 130:195–205, 2020.
|
| 219 |
+
[14] Guangtao Wang, Rex Ying, Jing Huang, and Jure Leskovec. Multi-hop attention graph neural networks. In International Joint Conference on Artificial Intelligence, 2021.
|
| 220 |
+
[15] Eli Chien, Jianhao Peng, Pan Li, and Olgica Milenkovic. Adaptive universal generalized pagerank graph neural network. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=n6jl7fLxrP.
|
| 221 |
+
[16] Rémy Brossard, Oriel Frigo, and David Dehaene. Graph convolutions that can finally model local structure. arXiv preprint arXiv:2011.15069, 2020.
|
| 222 |
+
[17] Chengxuan Ying, Tianle Cai, Shengjie Luo, Shuxin Zheng, Guolin Ke, Di He, Yanming Shen, and Tie-Yan Liu. Do transformers really perform badly for graph representation? In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id=OeWooOxFwDa.
|
| 223 |
+
|
| 224 |
+
[18] Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 1263–1272. JMLR. org, 2017.
|
| 225 |
+
|
| 226 |
+
[19] George V. Cybenko. Approximation by superpositions of a sigmoidal function. Mathematics of Control, Signals and Systems, 2:303–314, 1989.
|
| 227 |
+
|
| 228 |
+
[20] Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Russ R Salakhutdinov, and Alexander J Smola. Deep sets. In Advances in Neural Information Processing Systems, pages 3391–3401, 2017.
|
| 229 |
+
|
| 230 |
+
[21] Xiyuan Wang and Muhan Zhang. How powerful are spectral graph neural networks. ICML, 2022.
|
| 231 |
+
|
| 232 |
+
[22] Pan Li, Yanbang Wang, Hongwei Wang, and Jure Leskovec. Distance encoding: Design provably more powerful neural networks for graph representation learning. In Advances in Neural Information Processing Systems, volume 33, pages 4465–4478, 2020.
|
| 233 |
+
|
| 234 |
+
[23] Fabrizio Frasca, Beatrice Bevilacqua, Michael M Bronstein, and Haggai Maron. Understanding and extending subgraph gnns by rethinking their symmetries. In Advances in Neural Information Processing Systems, 2022.
|
| 235 |
+
|
| 236 |
+
[24] Haggai Maron, Heli Ben-Hamu, Hadar Serviansky, and Yaron Lipman. Provably powerful graph networks. In Advances in Neural Information Processing Systems, pages 2156–2167, 2019.
|
| 237 |
+
|
| 238 |
+
[25] Haggai Maron, Heli Ben-Hamu, Nadav Shamir, and Yaron Lipman. Invariant and equivariant graph networks. In International Conference on Learning Representations, 2019. URL https: //openreview.net/forum?id $\equiv$ Syx72jC9tm.
|
| 239 |
+
|
| 240 |
+
[26] Muhan Zhang and Pan Li. Nested graph neural networks. In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id $\ c =$ 7_eLEvFjCi3.
|
| 241 |
+
|
| 242 |
+
[27] Lingxiao Zhao, Wei Jin, Leman Akoglu, and Neil Shah. From stars to subgraphs: Uplifting any GNN with local structure awareness. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id=Mspk_WYKoEH.
|
| 243 |
+
|
| 244 |
+
[28] Beatrice Bevilacqua, Fabrizio Frasca, Derek Lim, Balasubramaniam Srinivasan, Chen Cai, Gopinath Balamurugan, Michael M. Bronstein, and Haggai Maron. Equivariant subgraph aggregation networks. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id $\equiv$ dFbKQaRk15w.
|
| 245 |
+
|
| 246 |
+
[29] Zhengdao Chen, Soledad Villar, Lei Chen, and Joan Bruna. On the equivalence between graph isomorphism testing and function approximation with gnns. In Advances in Neural Information Processing Systems, pages 15894–15902, 2019.
|
| 247 |
+
|
| 248 |
+
[30] Ryoma Sato, Makoto Yamada, and Hisashi Kashima. Random features strengthen graph neural networks. In Proceedings of the 2021 SIAM International Conference on Data Mining (SDM), 2021.
|
| 249 |
+
|
| 250 |
+
[31] Ralph Abboud, ˙Ismail ˙Ilkan Ceylan, Martin Grohe, and Thomas Lukasiewicz. The surprising power of graph neural networks with random node initialization. In Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, IJCAI-21, pages 2112–2118, 8 2021. doi: 10.24963/ijcai.2021/291. URL https://doi.org/10.24963/ijcai.2021/291.
|
| 251 |
+
|
| 252 |
+
[32] Andreas Loukas. What graph neural networks cannot learn: depth vs width. arXiv preprint arXiv:1907.03199, 2019.
|
| 253 |
+
|
| 254 |
+
[33] Muhan Zhang and Yixin Chen. Link prediction based on graph neural networks. In Advances in Neural Information Processing Systems, pages 5165–5175, 2018.
|
| 255 |
+
|
| 256 |
+
[34] Muhan Zhang, Pan Li, Yinglong Xia, Kai Wang, and Long Jin. Labeling trick: A theory of using graph neural networks for multi-node representation learning. In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id $\equiv$ Hcr9mgBG6ds.
|
| 257 |
+
[35] Xiyuan Wang and Muhan Zhang. GLASS: GNN with labeling tricks for subgraph representation learning. In International Conference on Learning Representations, 2022. URL https: //openreview.net/forum?id $\equiv$ XLxhEjKNbXj.
|
| 258 |
+
[36] Asiri Wijesinghe and Qing Wang. A new perspective on ”how graph neural networks go beyond weisfeiler-lehman?”. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum?id $\underset { . } { = }$ uxgg9o7bI_3.
|
| 259 |
+
[37] Jiaxuan You, Jonathan M Gomes-Selman, Rex Ying, and Jure Leskovec. Identity-aware graph neural networks. Proceedings of the AAAI Conference on Artificial Intelligence, 35(12):10737– 10745, May 2021.
|
| 260 |
+
[38] Matthias Fey and Jan Eric Lenssen. Fast graph representation learning with pytorch geometric. arXiv preprint arXiv:1903.02428, 2019.
|
| 261 |
+
[39] Muhammet Balcilar, Pierre Héroux, Benoit Gaüzère, Pascal Vasseur, Sébastien Adam, and Paul Honeine. Breaking the limits of message passing graph neural networks. In Proceedings of the 38th International Conference on Machine Learning (ICML), 2021.
|
| 262 |
+
[40] Ryan Murphy, Balasubramaniam Srinivasan, Vinayak Rao, and Bruno Ribeiro. Relational pooling for graph representations. In International Conference on Machine Learning, pages 4663–4673. PMLR, 2019.
|
| 263 |
+
[41] Gabriele Corso, Luca Cavalleri, Dominique Beaini, Pietro Liò, and Petar Velickovi ˇ c. Principal ´ neighbourhood aggregation for graph nets. In Advances in Neural Information Processing Systems, 2020.
|
| 264 |
+
[42] Zhengdao Chen, Lei Chen, Soledad Villar, and Joan Bruna. Can graph neural networks count substructures? Advances in neural information processing systems, 2020.
|
| 265 |
+
[43] Asim Kumar Debnath, de Compadre RL Lopez, Gargi Debnath, Alan J Shusterman, and Corwin Hansch. Structure-activity relationship of mutagenic aromatic and heteroaromatic nitro compounds. correlation with molecular orbital energies and hydrophobicity. Journal of medicinal chemistry, 34(2):786–797, 1991.
|
| 266 |
+
[44] Paul D Dobson and Andrew J Doig. Distinguishing enzyme structures from non-enzymes without alignments. Journal of molecular biology, 330(4):771–783, 2003.
|
| 267 |
+
[45] Hannu Toivonen, Ashwin Srinivasan, Ross D King, Stefan Kramer, and Christoph Helma. Statistical evaluation of the predictive toxicology challenge 2000–2001. Bioinformatics, 19(10): 1183–1193, 2003.
|
| 268 |
+
[46] Pinar Yanardag and SVN Vishwanathan. Deep graph kernels. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 1365–1374. ACM, 2015.
|
| 269 |
+
[47] Raghunathan Ramakrishnan, Pavlo O Dral, Matthias Rupp, and O Anatole Von Lilienfeld. Quantum chemistry structures and properties of 134 kilo molecules. Scientific data, 1(1):1–7, 2014.
|
| 270 |
+
[48] Zhenqin Wu, Bharath Ramsundar, Evan N Feinberg, Joseph Gomes, Caleb Geniesse, Aneesh S Pappu, Karl Leswing, and Vijay Pande. Moleculenet: a benchmark for molecular machine learning. Chemical science, 9(2):513–530, 2018.
|
| 271 |
+
[49] Vijay Prakash Dwivedi, Chaitanya K Joshi, Anh Tuan Luu, Thomas Laurent, Yoshua Bengio, and Xavier Bresson. Benchmarking graph neural networks. arXiv preprint arXiv:2003.00982, 2020.
|
| 272 |
+
|
| 273 |
+
[50] Nino Shervashidze, Pascal Schweitzer, Erik Jan van Leeuwen, Kurt Mehlhorn, and Karsten M Borgwardt. Weisfeiler-lehman graph kernels. Journal of Machine Learning Research, 12(Sep): 2539–2561, 2011.
|
| 274 |
+
|
| 275 |
+
[51] Giorgos Bouritsas, Fabrizio Frasca, Stefanos Zafeiriou, and Michael M. Bronstein. Improving graph neural network expressivity via subgraph isomorphism counting, 2021. URL https: //openreview.net/forum?id $\equiv$ LT0KSFnQDWF.
|
| 276 |
+
|
| 277 |
+
[52] Cristian Bodnar, Fabrizio Frasca, Nina Otter, Yu Guang Wang, Pietro Liò, Guido Montufar, and Michael M. Bronstein. Weisfeiler and lehman go cellular: CW networks. In A. Beygelzimer, Y. Dauphin, P. Liang, and J. Wortman Vaughan, editors, Advances in Neural Information Processing Systems, 2021. URL https://openreview.net/forum?id=uVPZCMVtsSG.
|
| 278 |
+
|
| 279 |
+
[53] Béla Bollobás. Distinguishing vertices of random graphs. In Béla Bollobás, editor, Graph Theory, volume 62 of North-Holland Mathematics Studies, pages 33–49. North-Holland, 1982. doi: https://doi.org/10.1016/S0304-0208(08)73545-X. URL https://www.sciencedirect. com/science/article/pii/S030402080873545X.
|
| 280 |
+
|
| 281 |
+
[54] Béla Bollobás. A Probabilistic Proof of an Asymptotic Formula for the Number of Labelled Regular Graphs. European Journal of Combinatorics, 1(4):311–316, December 1980. ISSN 0195-6698. doi: 10.1016/S0195-6698(80)80030-8. URL https://www.sciencedirect. com/science/article/pii/S0195669880800308.
|
| 282 |
+
|
| 283 |
+
[55] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pages 5998–6008, 2017.
|
| 284 |
+
|
| 285 |
+
[56] Floris Geerts. The expressive power of kth-order invariant graph networks. ArXiv, abs/2007.12035, 2020.
|
| 286 |
+
|
| 287 |
+
[57] Thang Luong, Hieu Pham, and Christopher D. Manning. Effective approaches to attentionbased neural machine translation. In Proceedings of the 2015 Conference on Empirical Methods in Natural Language Processing, pages 1412–1421, Lisbon, Portugal, September 2015. Association for Computational Linguistics. doi: 10.18653/v1/D15-1166. URL https://aclanthology.org/D15-1166.
|
| 288 |
+
|
| 289 |
+
[58] Keyulu Xu, Chengtao Li, Yonglong Tian, Tomohiro Sonobe, Ken ichi Kawarabayashi, and Stefanie Jegelka. Representation learning on graphs with jumping knowledge networks. In International Conference on Machine Learning, 2018.
|
| 290 |
+
|
| 291 |
+
# Checklist
|
| 292 |
+
|
| 293 |
+
1. For all authors...
|
| 294 |
+
|
| 295 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 296 |
+
(b) Did you describe the limitations of your work? [Yes]
|
| 297 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 298 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 299 |
+
|
| 300 |
+
2. If you are including theoretical results...
|
| 301 |
+
|
| 302 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] (b) Did you include complete proofs of all theoretical results? [Yes]
|
| 303 |
+
|
| 304 |
+
3. If you ran experiments...
|
| 305 |
+
|
| 306 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] The implementation of KP-GNN can be found at https://github.com/JiaruiFeng/KP-GNN.
|
| 307 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
|
| 308 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes]
|
| 309 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes]
|
| 310 |
+
|
| 311 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 312 |
+
|
| 313 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 314 |
+
(b) Did you mention the license of the assets? [No] The license can be found in their github.
|
| 315 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [No]
|
| 316 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] All datasets we used are all open-sourced.
|
| 317 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] There is no personal information in the datasets.
|
| 318 |
+
|
| 319 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 320 |
+
|
| 321 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 322 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 323 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/dev/nUmCcZ5RKF/nUmCcZ5RKF.md
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# IS SYNTHETIC DATA FROM GENERATIVE MODELS READY FOR IMAGE RECOGNITION?
|
| 2 |
+
|
| 3 |
+
Ruifei $\mathbf { H e } ^ { 1 ^ { * } }$ Shuyang $\mathbf { S u n } ^ { 2 }$ Xin $\mathbf { V } \mathbf { u } ^ { 1 }$ Chuhui $\mathbf { X } \mathbf { u } \mathbf { e } ^ { 3 }$ Wenqing Zhang3 Philip Torr2
|
| 4 |
+
Song Bai3† Xiaojuan $\mathbf { Q } \mathbf { i } ^ { \mathrm { { i } \dagger } }$
|
| 5 |
+
1The University of Hong Kong 2University of Oxford 3ByteDance
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Recent text-to-image generation models have shown promising results in generating high-fidelity photo-realistic images. Though the results are astonishing to human eyes, how applicable these generated images are for recognition tasks remains under-explored. In this work, we extensively study whether and how synthetic images generated from state-of-the-art text-to-image generation models can be used for image recognition tasks, and focus on two perspectives: synthetic data for improving classification models in data-scarce settings (i.e. zero-shot and fewshot), and synthetic data for large-scale model pre-training for transfer learning. We showcase the powerfulness and shortcomings of synthetic data from existing generative models, and propose strategies for better applying synthetic data for recognition tasks. Code: https://github.com/CVMI-Lab/SyntheticData.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Over the past decade, deep learning powered by large-scale annotated data has revolutionized the field of image recognition. However, it is costly and time-consuming to manually collect a largescale labeled dataset, and recent concerns about data privacy and usage rights further hinder this process. In parallel, generative models that aim to model real-data distributions can now produce high-fidelity photo-realistic images. In particular, recent text-to-image generation models (Nichol et al., 2021; Ramesh et al., 2022; Saharia et al., 2022b) have made major breakthroughs in synthesizing high-quality images from text descriptions. This promotes us to ask: is synthetic data from generative models ready for image recognition tasks?
|
| 14 |
+
|
| 15 |
+
There are a few early attempts at exploring synthetic data from generative models for image recognition tasks. Besnier et al. (2020) use a class-conditional GAN (BigGAN (Brock et al., 2018) trained for ImageNet-1000 classes) to generate images for training image classifiers. Zhang et al. (2021) leverage StyleGAN (Karras et al., 2019) to produce synthetic labeled data for object-part segmentation. Jahanian et al. (2021) manipulate the latent space of a GAN model to produce multi-view images for contrastive learning. Albeit promising, early works either address tasks on a small scale or only for a specific setting. Plus, they all focus on GAN-based models and none explore the revolutionary text-to-image generation models, which hold more promises to benefit recognition tasks.
|
| 16 |
+
|
| 17 |
+
In this paper, we present the first study on the state-of-the-art text-to-image generation models for image recognition. With the power of text-to-image generation, we could hopefully not only generate massive high-quality labeled data, but also achieve domain customization by generating synthetic data targeted for a specific label space, i.e. the label space of a downstream task. Our study is carried out on one open-sourced text-to-image generation model, GLIDE (Nichol et al., 2021) 1. We attempt to uncover the benefits and pitfalls of synthetic data for image recognition through the lens of investigating the following two questions: 1) is synthetic data from generative models ready for improving classification models? 2) whether synthetic data can be a feasible source for transfer learning (i.e. model pre-training)? It is worth noting that for 1), we only studied the zero-shot and few-shot settings because the positive impact of synthetic data diminishes as more shots are present. And, we build most of our investigations on the state-of-the-art method CLIP (Radford et al., 2021) with the feature extractor initialized with large-scale pre-trained weights frozen.
|
| 18 |
+
|
| 19 |
+
Our Findings. First, in the zero-shot setting, i.e. no real-world data are available, we demonstrate that synthetic data can significantly improve classification results on 17 diverse datasets: the performance is increased by ${ \mathrm { 4 . 3 1 \% } }$ in top-1 accuracy on average, and even improved by as much as $1 7 . 8 6 \%$ on the EuroSAT dataset. To better leverage synthetic data in this setting, we also investigate useful strategies to increase data diversity, reduce data noise, and enhance data reliability. This is achieved by designing diversified text prompts and measuring the correlation of text and synthesized data with CLIP features.
|
| 20 |
+
|
| 21 |
+
Second, in the few-shot setting, i.e. a few real images are available, albeit not as significant as in the zero-shot task, synthetic data are also shown to be beneficial and help us achieve a new state of the art. Our observation shows that the domain gap between synthetic data and downstream task data is one challenge on further improving the effectiveness of synthetic data on classifier learning. Fortunately, in this setting, the accessibility of real data samples can provide useful information about the data distribution of the downstream task. We thus propose to use real images as guidance in the generation process to reduce domain gaps and improve effectiveness.
|
| 22 |
+
|
| 23 |
+
Third, in large-scale model pre-training for transfer learning, our study shows that synthetic data are suitable and effective for model pre-training, delivering superior transfer learning performance and even outperforming ImageNet pre-training. Especially, synthetic data work surprisingly well in unsupervised model pre-training, and favor ViT-based backbones. We also demonstrate that by increasing the label space (i.e. text prompts) for data generation, the enlarged data amount and diversity could further bring performance boosts. Besides, synthetic data can work collaboratively with real data (i.e. ImageNet) where we obtain improved performance when the model is initialized with ImageNet pre-trained weights.
|
| 24 |
+
|
| 25 |
+
# 2 RELATED WORKS
|
| 26 |
+
|
| 27 |
+
Synthetic Data for Image Recognition. There are mainly two forms of synthetic data for image recognition, i.e. 1) synthetic datasets generated from a traditional simulation pipeline; 2) synthetic images output from generative models.
|
| 28 |
+
|
| 29 |
+
The first type, synthetic datasets (Dosovitskiy et al., 2015; Peng et al., 2017; Richter et al., 2016), are usually generated from a traditional pipeline with a specific data source, e.g.synthetic 2D renderings of 3D models or scenes from graphics engines. However, this traditional way of generating synthetic datasets has several drawbacks: 1) manually defined pipeline generated synthetic data may have a certain gap with real-world data; 2) taking up huge physical space to store and huge cost to share and transfer; 3) data amount and diversity bounded by the specific data source.
|
| 30 |
+
|
| 31 |
+
Compared with synthetic datasets, generative models are a more efficient means of synthetic data representation, exhibiting favorable advantages: 1) could produce high-fidelity photorealistic images closer to real data since they are trained on real-world data; 2) highly condensed compared to synthetic data itself, and take up much reduced storage space; 3) potentially unlimited synthetic data size. Only recently, few works attempt to explore synthetic data generated from generative models for image recognition. Besnier et al. (2020) use a class-conditional GAN to train classifiers of the same classes. Zhang et al. (2021) leverage the latent code of StyleGAN (Karras et al., 2019) to produce labels for object part segmentation. While they achieve promising results, both works are task-wise and only employed on a small scale. Jahanian et al. (2021) use a GAN-based generator to generate multiple views to conduct unsupervised contrastive representation learning. These works, however, explore upon the traditional GAN-based models; in contrast, our work investigates with the best released text-to-image generation model, which demonstrates new customization ability for different downstream label space.
|
| 32 |
+
|
| 33 |
+
Text-to-Image Diffusion Models. Diffusion models (Sohl-Dickstein et al., 2015; Ho et al., 2020; Nichol & Dhariwal, 2021) have recently emerged as a class of promising and powerful generative models. As a likelihood-based model, the diffusion model matches the underlying data distribution $q ( x _ { 0 } )$ by learning to reverse a noising process, and thus novel images can be sampled from a prior Gaussian distribution via the learned reverse path. Because of the high sample quality, good mode coverage and promising training stability, diffusion models are quickly becoming a new trend in both unconditional (Ho et al., 2020; Nichol & Dhariwal, 2021; Ho et al., 2022) and conditional (Dhariwal & Nichol, 2021; Rombach et al., 2022; Lugmayr et al., 2022; Saharia et al., 2022a; Meng et al., 2021; Saharia et al., 2022c) image synthesis fields.
|
| 34 |
+
|
| 35 |
+
In particular, text-to-image generation can be treated as a conditional image generation task that requires the sampled image to match the given natural language description. Based upon the formulation of the diffusion model, several text-to-image models such as Stable diffusion (Rombach et al., 2022), DALL-E2 (Ramesh et al., 2022), Imagen (Saharia et al., 2022b) and GLIDE (Nichol et al., 2021) deliver unprecedented synthesis quality, largely facilitating the development of the AIfor-Art community. Despite achieving astonishing perceptual results, their potential utilization for high-level tasks is yet under-explored. In this paper, we utilize the state-of-the-art model GLIDE and showcase its powerfulness and shortcomings for synthesizing data for recognition tasks.
|
| 36 |
+
|
| 37 |
+
# 3 IS SYNTHETIC DATA READY FOR IMAGE RECOGNITION?
|
| 38 |
+
|
| 39 |
+
In the following sections, we answer the question by studying whether synthetic data can benefit recognition tasks and how to better leverage synthetic data to address different tasks. We carry out our exploration through the lens of two basic settings with three tasks: synthetic data for improving classification models in the data-scarce setting (i.e. zero-shot and few-shot) (see Sec. 3.1 and Sec. 3.2) and synthetic data for model pre-training for transfer learning (see Sec. 3.3).
|
| 40 |
+
|
| 41 |
+
Model Setup for Data-scarce (i.e. Zero-shot and Few-shot) Image Classification. As CLIP (Radford et al., 2021) is the state-of-the-art approach for zero-shot learning, we conduct our study for zero-shot and few-shot settings upon pre-trained CLIP models, aiming to better understand synthetic data upon strong baselines. There have been a few attempts on better tuning pre-trained CLIP for data-scarce image classification, such as CoOp (Zhou et al., 2022b), CLIP Adapter (Gao et al., 2021), and Tip Adapter (Zhang et al., 2022), where the image encoder is frozen for better preserving the pretrained feature space. We argue that different tuning methods could all be regarded as different ways of learning classifier weights, e.g. CoOp optimizes learnable prompts for better learning classifiers.
|
| 42 |
+
|
| 43 |
+
Here, we adopt a simple tuning method, Classifier Tuning (CT), a baseline method introduced in Wortsman et al. (2022). Concretely, for a $\mathbf { k }$ -way classification, we input the class names $C =$ $\{ c _ { 1 } , . . . , c _ { k } \}$ with prompt $s _ { i } =$ “a photo of a $\{ c _ { i } \} ^ { \flat }$ into the text encoder $h$ of CLIP to obtain the text features $h ( s _ { i } )$ . Then the text features $h ( s _ { i } )$ could be used to construct classifier weights $W \in$ $R ^ { d \times k }$ , where $d$ is the dimension of text features. Finally, we combine the image encoder $g$ with the classifier weights $W$ to obtain a classification model $f ( x ) = g ( x ) ^ { \mathrm { T } } W$ . We empirically show that CT performs comparably with other tuning methods. Compared with complex designed tuning methods, we hope to use a simpler method for better investigating the effectiveness of synthetic data.
|
| 44 |
+
|
| 45 |
+
.1 IS SYNTHETIC DATA READY FOR ZERO-SHOT IMAGE RECOGNITION?
|
| 46 |
+
|
| 47 |
+
Our aim is to investigate to what degree synthetic data are beneficial to zero-shot tasks and how to better leverage synthetic data for zero-shot learning.
|
| 48 |
+
|
| 49 |
+
Zero-shot Image Recognition. We study the inductive zero-shot learning setting where no real training images of the target categories are available. CLIP models are pre-trained with large-scale image-caption pairs, and the similarities between paired image features (from an image-encoder $g$ ) and text features (from a text-encoder $h$ ) are maximized during pre-training. The pre-trained feature extractor can then be used to solve zero-shot tasks where given an image, its features from $g$ are compared with text features of different classes from $h$ and the image is further assigned to the class that has the largest similarity in the CLIP text-image feature space.
|
| 50 |
+
|
| 51 |
+
Synthetic Data for Zero-shot Image Recognition. Though CLIP models exhibit strong zero-shot performance thanks to the large-scale vision-language dataset for pre-training, there are still several shortcomings when the model is deployed for a downstream zero-shot classification task, which may be attributed to unavoidable data noise in CLIP’s pre-training data or the label space mismatch between pre-training and the zero-shot task. Hence, with a given label space for a zero-shot task, we study whether synthetic data can be used to better adapt CLIP models for zero-shot learning.
|
| 52 |
+
|
| 53 |
+
How to generate the data? Given a pre-trained text-to-image generation model, to synthesize novel samples, the basic $\mathbf { ( B ) }$ strategy is to use the label names of the target categories to build the language input and generate a corresponding image. Then, the paired label names and synthesized data can be employed to train the classifier with the feature extractor frozen.
|
| 54 |
+
|
| 55 |
+
How to enrich diversity? Only using the label names as inputs might limit the diversity of synthesized images and cause bottlenecks for validating the effectiveness of synthetic data. Hence, we leverage an off-the-shelf word-to-sentence T5 model (pre-trained on “Colossal Clean Crawled Corpus” dataset (Raffel et al., 2020) and finetuned on CommonGen dataset (Lin et al., 2019)) to increase the diversity of language prompts and the generated images, namely language enhancement (LE), hoping to better unleash the potential of synthesized data. Concretely, we input the label name of each class to the word-to-sentence model which generates diversified sentences containing the class names as language prompts for the text-to-image generation process. For example, if the class label is “airplane”, then the enhanced language prompt from the model could be “a white airplane hovering over a beach and a city”. The enhanced text descriptions introduce rich context descriptions.
|
| 56 |
+
|
| 57 |
+
<table><tr><td>Dataset</td><td>Task</td><td>CLIP-RN50</td><td>CLIP-RN50+SYN</td><td>CLIP-ViT-B/16</td><td>CLIP-ViT-B/16+SYN</td></tr><tr><td>CIFAR-10</td><td>0</td><td>70.31</td><td>80.06 (+9.75)</td><td>90.80</td><td>92.37 (+1.57)</td></tr><tr><td>CIFAR-100</td><td>0</td><td>35.35</td><td>45.69 (+10.34)</td><td>68.22</td><td>70.71 (+2.49)</td></tr><tr><td>Caltech101</td><td>0</td><td>86.09</td><td>87.74 (+1.65)</td><td>92.98</td><td>94.16 (+1.18)</td></tr><tr><td>Caltech256</td><td>0</td><td>73.36</td><td>75.74 (+2.38)</td><td>80.14</td><td>81.43 (+1.29)</td></tr><tr><td>ImageNet</td><td>0</td><td>60.33</td><td>60.78 (+0.45)</td><td>68.75</td><td>69.16 (+0.41)</td></tr><tr><td>SUN397</td><td>S</td><td>58.51</td><td>60.07 (+1.56)</td><td>62.51</td><td>63.79 (+1.28)</td></tr><tr><td>Aircraft</td><td>f</td><td>17.34</td><td>21.94 (+4.60)</td><td>24.81</td><td>30.78 (+5.97)</td></tr><tr><td>Birdsnap</td><td>f</td><td>34.33</td><td>38.05 (+3.72)</td><td>41.90</td><td>46.84 (+4.94)</td></tr><tr><td>Cars</td><td>f</td><td>55.63</td><td>56.93 (+1.30)</td><td>65.23</td><td>66.86 (+1.63)</td></tr><tr><td>CUB</td><td>f</td><td>46.69</td><td>56.94 (+10.25)</td><td>55.23</td><td>63.79 (+8.56)</td></tr><tr><td>Flower</td><td>f</td><td>66.08</td><td>67.05 (+0.97)</td><td>71.30</td><td>72.60 (+1.30)</td></tr><tr><td>Food</td><td>f</td><td>80.34</td><td>80.35 (+0.01)</td><td>88.75</td><td>88.83 (+0.08)</td></tr><tr><td>Pets</td><td>f</td><td>85.80</td><td>86.81 (+1.01)</td><td>89.10</td><td>90.41 (+1.31)</td></tr><tr><td>DTD</td><td>t</td><td>42.23</td><td>43.19 (+0.96)</td><td>44.39</td><td>44.92 (+0.53)</td></tr><tr><td>EuroSAT</td><td>si</td><td>37.51</td><td>55.37 (+17.86)</td><td>47.77</td><td>59.86 (+12.09)</td></tr><tr><td>ImageNet-Sketch</td><td>r</td><td>33.29</td><td>36.55 (+3.26)</td><td>46.20</td><td>48.47 7 (+2.27)</td></tr><tr><td>ImageNet-R</td><td>r</td><td>56.16</td><td>59.37 (+3.21)</td><td>74.01</td><td>76.41 (+2.40)</td></tr><tr><td>Average</td><td>/</td><td>55.13</td><td>59.47 (+4.31)</td><td>65.42</td><td>68.32 (+2.90)</td></tr></table>
|
| 58 |
+
|
| 59 |
+
Table 1: Main Results on Zero-shot Image Recognition. All results are top-1 accuracy on test set. o: object-level. s: scene-level. f: fine-grained. t: textures. si: satellite images. r: robustness.
|
| 60 |
+
|
| 61 |
+
How to reduce noise and enhance robustness? It’s unavoidable that the synthesized data may contain low-quality samples. This is even more severe in the setting with language enhancement as it may introduce undesired items into language prompts (see Figure A.2 in Appendix for visual examples). Hence, we introduce a CLIP Filter (CF) strategy to rule out these samples. Specifically, CLIP zero-shot classification confidence is used to assess the quality of synthesized data, and the lowconfidence ones are removed. Besides, as soft-target is more robust than hard-target in countering sample noise, we study whether soft cross-entropy loss (SCE, see Sec. C.4 in Appendix) which uses the normalized clip scores as a target could be used to enhance robustness against data noise.
|
| 62 |
+
|
| 63 |
+
Experiment Setup. We select 17 diverse datasets covering object-level (CIFAR-10 and CIFAR-100 ((Krizhevsky et al., 2009), Caltech101 (Fei-Fei et al., 2006), Caltech256 (Griffin et al., 2007), ImageNet (Deng et al., 2009)), scene-level (SUN397 (Xiao et al., 2010)), fine-grained (Aircraft (Maji et al., 2013), Birdsnap (Berg et al., 2014), Cars (Krause et al., 2013), CUB (Wah et al., 2011), Flower (Nilsback & Zisserman, 2008), Food (Bossard et al., 2014), Pets (Parkhi et al., 2012)), textures (DTD (Cimpoi et al., 2014)), satelite images (EuroSAT (Helber et al., 2019)) and robustness (ImageNetSketch (Wang et al., 2019), ImageNet-R (Hendrycks et al., 2021)) for zero-shot image classification. For synthetic data amount, we generate 2000 (study of synthetic image number in Appendix Sec. B.3) synthetic images for each class in B and LE. For LE, we generate 200 sentences for each class.
|
| 64 |
+
|
| 65 |
+
Main Results: 1) zero-shot classification results on 17 datasets; 2) study of synthetic data diversity; 3) study of synthetic data reliability; 4) study of model/classifier tuning; 5) study of the behavior of synthetic data for zero-shot classification in the training from scratch settings.
|
| 66 |
+
|
| 67 |
+
Synthetic data can significantly improve the performance of zero-shot learning. Our main studies in zero-shot settings are conducted with CLIP-RN50 (ResNet-50 (He et al., 2016) and CLIP-ViTB/16 (ViT-B/16 (Dosovitskiy et al., 2020)) as CLIP backbone), and we report results with our best strategy of $\mathbf { L E + C F + S C E }$ . As shown in Table 1, on 17 diverse downstream zero-shot image classification datasets, we achieve a remarkable average gain of $4 . 3 1 \%$ for CLIP-RN50 and $2 . 9 0 \%$ for CLIP-ViT-B/16 in terms of top-1 accuracy. Significantly, on the EuroSAT dataset, we achieve the largest performance boost of $1 7 . 8 6 \%$ for CLIP-RN50 in top-1 accuracy. We notice that the performance gain brought by synthetic data varies differently across datasets, which is mainly related to GLIDE’s training data distribution. The training data distribution of the text-to-image generation model GLIDE would exhibit bias and produce different domain gaps with different datasets (see Sec. A.2 in Appendix for more analysis).
|
| 68 |
+
|
| 69 |
+
Table 2: Ablation study on Language Enhancement (LE), CLIP-based Filtering (CF), and Softtarget Cross-Entropy (SCE).
|
| 70 |
+
|
| 71 |
+
<table><tr><td rowspan="2">Dataset</td><td rowspan="2">CLIP</td><td colspan="2">B</td><td colspan="2">LE</td><td colspan="2">LE+CF</td></tr><tr><td>CE</td><td>SCE</td><td>CE</td><td>SCE</td><td>CE</td><td>SCE</td></tr><tr><td>CIFAR-10</td><td>70.31</td><td>77.39 (+7.08)</td><td>78.23 (+7.92)</td><td>77.20 (+6.89)</td><td>77.55 (+7.24)</td><td>80.01 (+9.70)</td><td>80.06 (+9.75)</td></tr><tr><td>CIFAR-100</td><td>35.35</td><td>43.99 (+8.64)</td><td>44.25 (+8.90)</td><td>44.08 (+8.73)</td><td>44.91 (+9.56)</td><td>44.55 (+9.20)</td><td>45.69 (+10.34)</td></tr><tr><td>EuroSAT</td><td>37.51</td><td>45.64 (+8.13)</td><td>48.23 (+10.72)</td><td>53.26 (+15.75)</td><td>54.94 (+17.43)</td><td>54.75 (+17.24)</td><td>55.37 (+17.86)</td></tr></table>
|
| 72 |
+
|
| 73 |
+
Language diversity matters. By introducing more linguistic context into the text input, LE helps increase the diversity of synthetic data. As shown in Table 2, LE can achieve additional performance gains upon $\mathbf { B }$ in most cases $_ { ( 0 . 6 6 \uparrow }$ on CIFAR-100, $6 . 7 1 \uparrow$ on EuroSAT), which demonstrates the efficacy of LE and the importance of synthetic data diversity for zero-shot classification.
|
| 74 |
+
|
| 75 |
+
Reliability matters. While LE could help increase the diversity of synthetic data, it also introduces the risks of noisy samples. Observed on CIFAR-10 in Table 2, LE sometimes even brings performance drops compared with B $( 0 . 6 8 \% \downarrow$ on CIFAR-10), which may attribute to the noise introduced by enhanced language prompts, e.g. the sentence extended from the class name word may contain other class names or confusing objects. Fortunately, with CF to filter out unreliable samples, $\mathbf { L E + C F }$ yields consistent improvement upon B. Moreover, SCE generally achieves better performance than CE, showing its better adaptation to label noise.
|
| 76 |
+
|
| 77 |
+
Classifier tuning is enough for CLIP, while tuning with the pre-trained encoder leads to degradation, mainly due to domain gaps. Here, we investigate if only tuning the final classifier is the optimal solution in our setting with synthetic data. As shown in Table 3, we tune different proportions of the full model parameters on synthetic data for EuroSAT ( $0 . 0 2 \%$ corresponds to our default case where only the classifier is tuned), and report the zero-shot performance on the test set of EuroSAT. The best results are obtained by only tuning the classifier, and the performance gradually decreases as we gradually incorporate more parameters in the encoder for optimization, which agrees with the traditional strategy. For understanding why synthetic data may harm pre-trained image encoder, we experiment with real-world data with domain shifts and find they behave similarly to synthetic data (Appendix Sec. B.2), which suggests that domain gap is the main reason for the phenomenon. We argue that synthetic data might have a better chance to overcome domain shifts in comparison with real-world data since we can customize and keep the label space of the synthetic data in line with the down-stream dataset and use strategies during synthesizing to alleviate domain shifts.
|
| 78 |
+
|
| 79 |
+
<table><tr><td>Param Tuned (%)</td><td>0</td><td>0.02</td><td>0.04</td><td>62.50</td><td>64.06</td><td>69.53</td><td>82.81</td><td>92.19</td></tr><tr><td>Acc</td><td>37.51</td><td>55.37</td><td>55.11</td><td>55.28</td><td>54.56</td><td>54.34</td><td>53.63</td><td>52.09</td></tr></table>
|
| 80 |
+
|
| 81 |
+
Table 3: Parameters tuned v.s. Accuracy. Dataset: EuroSAT.
|
| 82 |
+
Table 4: Setting when training from scratch. Dataset: CIFAR-100.
|
| 83 |
+
|
| 84 |
+
<table><tr><td>Real shot</td><td>1</td><td>16</td><td>32</td><td>64</td><td>80</td><td>90</td><td>95</td><td>100</td></tr><tr><td>Acc</td><td>2.48</td><td>10.4</td><td>14.95</td><td>21.96</td><td>24.4</td><td>25.52</td><td>27.99</td><td>29.95</td></tr></table>
|
| 85 |
+
|
| 86 |
+
Synthetic data deliver inferior performance in the training from scratch setting and are much less data-efficient than real data. To exclude the influence of powerful CLIP initialization in our study of synthetic data, we also conduct a from-scratch setting on the CIFAR-100 dataset, where we optimize a ResNet-50 model from random initialization. Given the label space of the CIFAR-100 dataset, we generate a synthetic dataset of $5 0 \mathrm { k }$ (500 images per class) to train a ResNet-50 model from scratch for image classification. We achieve a performance of $2 8 . 7 4 \%$ top-1 accuracy on CIFAR-100 test set, which is much lower than the performance of the pre-trained CLIP model (see Table 1). This might be attributed to the quality and diversity of data. The CLIP model benefits from diverse realworld data. Further, we hope to investigate how many real in-domain training data can match the performance of our $5 0 \mathrm { k }$ synthetic data. As shown in Table 4, training with 95 images per category $( 9 5 \times 1 0 0 = 9 . 5 { \mathrm { k } } )$ ) will achieve comparable performance as that of $5 0 \mathrm { k }$ synthetic data. This manifests that synthetic data are not as efficient and effective as real data when solving downstream tasks. It requires around 5 times more data in order to achieve a comparable performance as that of real data. Note that we find further increasing the amount of synthetic data will not deliver further performance gains for the downstream classification task. We expect that further investigations on synthesis quality will bring new opportunities in this area which will be our future work.
|
| 87 |
+
|
| 88 |
+
Summary. Current synthetic data from text-to-image generation models could indeed bring significant performance boosts for a wide range of zero-shot image classification tasks, and is readily applicable with carefully designed strategies such as large-scale pre-trained models. Diversity and reliability matter for synthetic data when employed for zero-shot tasks. When the model is trained from scratch with synthetic data, synthetic data cannot deliver satisfactory performance and are much less data-efficient and effective for solving the classification task in comparison with real data.
|
| 89 |
+
|
| 90 |
+
3.2 IS SYNTHETIC DATA READY FOR FEW-SHOT IMAGE RECOGNITION?
|
| 91 |
+
|
| 92 |
+
In this section, we explore the effectiveness of synthetic data for few-shot tasks and how synthetic data impact the performance as more and more shots are included. Also, we design effective strategies to better leverage synthetic data.
|
| 93 |
+
|
| 94 |
+
Few-shot Image Recognition. We adopt the CLIP-based method as the model for few-shot image recognition due to its state-of-the-art performance (Radford et al., 2021). As discussed previously, various prompt learning based methods can be treated as tuning the classifier weights. We thus study how to tune the classifier weights with synthetic data. In an N-way M-shot case, we are given M real images of each test class, where $\mathbf { M } \in \left\{ 1 , 2 , 4 , 8 , 1 6 \right\}$ in our experiments. With a total of $\mathbf { N } \times \mathbf { M }$ training samples, we hope to achieve favorable performance on a hold-out test set of the N classes.
|
| 95 |
+
|
| 96 |
+
Synthetic Data for Few-shot Image Recognition. While there have been a few attempts to study how to better adapt CLIP models for few-shot tasks (Zhou et al., 2022b;a; Zhang et al., 2022), they all focus on the model optimization level, and none have explored from the data level. Here, we systematically study whether and how synthetic data can be employed for solving few-shot image recognition tasks.
|
| 97 |
+
|
| 98 |
+
With the experience from synthetic data for zero-shot tasks, we adopt the best strategy (i.e. $\mathbf { L E { + } C F }$ ) in the zero-shot setting as the basic strategy $\mathbf { \delta } ( \mathbf { B } )$ . Further, as the few-shot real samples can provide useful information on the data distribution of the classification task, we develop two new strategies leveraging the in-domain few-shot real data for better using synthetic data: 1) Real Filtering (RF): given synthetic data of one class $c$ , we use the features of few-shot real samples to filter out synthetic images whose features are very close to the features of real samples that belong to other categories different from class $c ; 2$ ) Real guidance (RG): we use the few-shot real samples as guidance to generate synthetic images where the few-shot real samples (added noise) replace the random noise at the beginning of the generation to guide the diffusion process (details in Appendix Sec. C.3).
|
| 99 |
+
|
| 100 |
+
Experiment Setup. For datasets, we carefully select 8 image classification datasets from recent works (Zhou et al., 2022b;a; Zhang et al., 2022) that conduct few-shot learning upon CLIP: ImageNet (Deng et al., 2009), Caltech101 (Fei-Fei et al., 2006), Pets (Parkhi et al., 2012), Cars (Krause et al., 2013), Aircraft (Maji et al., 2013), SUN397 (Xiao et al., 2010), DTD (Cimpoi et al., 2014), EuroSAT (Helber et al., 2019). For synthetic image number, we generate 800 (study of synthetic image number in Appendix Sec. B.3) images per class for RG method to approximately match the number of images in B and RF.
|
| 101 |
+
|
| 102 |
+
Main Results: 1) few-shot classification results on 8 datasets; 2) ablation study of training strategy;
|
| 103 |
+
3) ablation study of synthetic data generation strategy; 4) ablation study of BN strategy.
|
| 104 |
+
|
| 105 |
+
Synthetic data can boost few-shot learning and the positive impact of synthetic data will gradually diminish with the increase of real data shots. As shown in Figure 1 (results of more datasets are in the Appendix Sec. B.1), with only few-shot real images for training, our implemented CT w. init (classifier weights initialized from CLIP text embeddings) performs comparably with the state-ofthe-art CLIP tuning methods Tip Adapter (Zhang et al., 2022) and CoOp (Zhou et al., 2022b). CT w. Syn represents our results of applying synthetic data with mix training, real image as guidance, and freezing BN strategies. With the help of generated synthetic data, CT w. Syn achieves noticeable performance gains upon CT w. init, and achieves a new state-of-the-art few-shot learning performance across different datasets. We argue that for data-scarce few-shot classification, synthetic data could help address the insufficient data problem to boost performance. However, we notice that the boost from synthetic data gradually diminishes as the real shot number increases. We state that the effectiveness of each sample in real data is high since there’s no domain gap; in contrast, synthetic data suffer from domain gaps and perform less efficiently. In addition, the positive effects of the few-shot real data may overlap with that of synthetic data. Thus, with the increase of real data, the overlapping becomes serious and the positive impacts of synthetic data are reduced.
|
| 106 |
+
|
| 107 |
+
Mix Training fits few-shot learning with synthetic data. Now that we have two parts of data, i.e. few-shot real data and synthetic data, we could either 1) phase-wise train on each part of data with two training phases, or 2) adopt mix training that simultaneously utilizes two parts of data to update the model in each iteration. Details of phase-wise/mix training in Appendix Sec. C.5.2. We provide the results in Table 7: we study on the EuroSAT dataset and use synthetic data generated from the RG method; under different shot number settings, mix training performs consistently better than two phase-wise strategies. We suggest that mix training could help learn better classifiers since each part could function as a regularization for the other: synthetic data help alleviate instabilities brought by limited real samples, and real data help address the noise and domain gap of synthetic data.
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
Figure 1: Results for few-shot image recognition. Results on all 8 datasets are provided in Appendix.
|
| 111 |
+
|
| 112 |
+
Employing real data as guidance can alleviate domain differences and boost performance. We compare three strategies of synthetic data generation for few-shot tasks. As shown in Table 5, both RF and RG provide performance gains upon B which is the best strategy in the zero-shot setting. This demonstrates the importance of utilizing the domain knowledge from few-shot images for preparing the synthetic data. Further, RG significantly outperforms RF, yielding the best performance. This shows utilizing real data as guidance of the diffusion process help reduce the domain gap (visual illustrations in the Appendix Sec. B.8).
|
| 113 |
+
|
| 114 |
+
Table 5: Ablation for Basic strategy (B), Real Filtering (RF), Real Guidance (RG) on EuroSAT, 16 shot.
|
| 115 |
+
|
| 116 |
+
<table><tr><td>B</td><td>RF</td><td>RG</td></tr><tr><td>87.1</td><td>87.33</td><td>88.47</td></tr></table>
|
| 117 |
+
|
| 118 |
+
Table 6: Frozen BN works better for 16-shot settings on EuroSAT.
|
| 119 |
+
|
| 120 |
+
<table><tr><td colspan="2">Train data Freeze BN? Test Acc</td></tr><tr><td>Real</td><td>75.31</td></tr><tr><td>Real √</td><td> 85.63</td></tr><tr><td>Syn</td><td>44.73</td></tr><tr><td>Syn √</td><td> 55.37</td></tr></table>
|
| 121 |
+
|
| 122 |
+
Table 7: Mix training works better for few-shot tasks on EuroSAT.
|
| 123 |
+
|
| 124 |
+
<table><tr><td>M-shot</td><td>Phase-wise syn →real real -→ syn</td><td>Mix training</td></tr><tr><td>1</td><td>63.01</td><td>64.36</td></tr><tr><td>2</td><td>72.24</td><td>73.62</td></tr><tr><td>4</td><td>78.88</td><td>79.88</td></tr><tr><td>8</td><td>83.64</td><td>84.57</td></tr><tr><td>16</td><td>87.10</td><td>88.47</td></tr></table>
|
| 125 |
+
|
| 126 |
+
Frozen BN works better. Lastly, we investigate batch normalization (BN) strategies for our fewshot settings with synthetic data. As shown in Table 6, for both real and synthetic data, freezing the BN layers yields much better performance. We analyze that for real data, it is hard to get a good estimation of BN statistics when the number of images is limited. As for synthetic data, we attribute this to the statistical difference between different domains. Hence, we freeze BN layers during tuning for few-shot settings.
|
| 127 |
+
|
| 128 |
+
Summary. Synthetic data from text-to-image generation models could readily benefit few-shot learning and achieve a new state-of-the-art few-shot classification performance with strategies we present in this paper. However, the positive impact of synthetic data will diminish as more shots of real data are available which further confirms our previous claim that synthetic data are still not as effective as real data in training classification models.
|
| 129 |
+
|
| 130 |
+
# 3.3 IS SYNTHETIC DATA READY FOR PRE-TRAINING?
|
| 131 |
+
|
| 132 |
+
Finally, we study whether synthetic data are effective in large-scale pre-training. We also present effective strategies to better leverage synthetic data for model pre-training.
|
| 133 |
+
|
| 134 |
+
Pre-training for Transfer Learning. Recently, it has become a common practice to first pre-train models on large-scale datasets to obtain a well-trained feature extractor and then fine-tune the models on downstream tasks with labeled data (i.e. transfer learning). There have been various successful pre-training methods, including supervised pre-training (Joulin et al., 2016; Li et al., 2017; Mahajan et al., 2018; Sun et al., 2017; Kolesnikov et al., 2020), self-supervised pre-training (Chen et al., 2020a; He et al., 2020; Caron et al., 2020; Grill et al., 2020; Chen & He, 2021; Zbontar et al., 2021; Ye et al., 2019), and semi-supervised pre-training (Xie et al., 2020; Pham et al., 2021).
|
| 135 |
+
|
| 136 |
+
Synthetic data for Pre-training. Since data amount and diversity play important roles in pretraining, we adopt the synthetic data generation strategy LE solely to maximize the scale of synthetic pre-training data. We study two settings for generating synthetic data for pre-training: 1) downstream-aware, where we have access to the label space of the downstream task, and thus we generate synthetic data according to the label space of the downstream task; 2) downstream-agnostic, where we have no access to downstream tasks in the pre-training stage, and we turn to a relatively general and diverse label space such as ImageNet-1K. For pre-training methods, we experiment with supervised pre-training and self-supervised pre-training methods.
|
| 137 |
+
|
| 138 |
+
Experiment Setup. We compare synthetic pre-trained models with models of random initialization and models of ImageNet-1K pre-training in terms of their transfer learning abilities. For downstream-aware settings: we conduct supervised pre-training on synthetic data generated according to CIFAR-100 label space and then transfer to CIFAR-100 through finetuning for evaluation.
|
| 139 |
+
|
| 140 |
+
For downstream-agnostic settings: we perform supervised pre-training and self-supervised pretraining (we adopt Moco v2 (Chen et al., 2020b) framework for its simplicity and reproducibility) on synthetic data generated from ImageNet-1K label space and evaluate the transfer performance by finetuning the pretrained models on a object detection dataset – PASCAL VOC (Everingham et al., 2010). Further, we experiment with ImageNet-2K label space (original ImageNet-1K and another non-overlapping 1K label names randomly selected from ImageNet-21K) to study the factors of data diversity and amount in synthetic pre-training. We use ResNet-50 as the default backbone when not else noted, and also experiment with a ViT-based backbone, i.e. DeiT-S (Touvron et al., 2021).
|
| 141 |
+
|
| 142 |
+
Results for Downstream-aware settings. We generate synthetic data of different sizes from CIFAR-100 label space, i.e. $1 \times$ , $2 \times$ , $3 \times$ ImageNet-1K data size, concretely 1.2M, 2.4M, 3.6M. We pre-train the model on the generated synthetic labeled set in a supervised manner, and then perform evaluation after finetuning the model on CIFAR-100. As shown in Table 8, with an equivalent amount of data as that of ImageNet-1K (1.2M), synthetic data for pre-training can largely reduce the gap between training from scratch $( 7 8 . 8 3 \% )$ and ImageNet- pre-trained model $( 8 4 . 5 0 \% )$ . Moreover, with $2 \times$ and $3 \times$ synthetic data, pre-training on synthetic data outperforms ImageNet-1K pre-training with a noticeable margin. In addition, when we initialize the model from ImageNet-1K pre-trained weights and pre-train the model on synthetic data, we obtain extra boosts upon both results.
|
| 143 |
+
|
| 144 |
+
We conclude that for downstream-aware synthetic pre-training, synthetic data deliver close performance as that of ImageNet-1K pretraining with the same amount of data, synthetic data amount helps improve the results to outperforming ImageNet-1K pre-training, and synthetic pre-training could further benefit from ImageNet-1K pre-training.
|
| 145 |
+
|
| 146 |
+
Results for Downstream-agnostic settings. We first experiment with ImageNet-1K label space with $1 \times$ or $2 \times$ ImageNet-1K data size, i.e. 1.2M/2.4M IN-1K Syn. We perform supervised pretraining and self-supervised pre-training (i.e. Moco v2) on the generated synthetic data, and evaluate the pre-training results by transferring to the CIFAR-100 image classification task or the PASCAL VOC detection task. As it is too costly to validate all settings (e.g., it takes more than 1 week to train Moco v2 on 4.0M synthetic data), we select several representative settings of interest to validate the effectiveness of synthetic data without hurting our conclusion.
|
| 147 |
+
|
| 148 |
+
As shown in Table 10 and 11, with 1.2M IN-1K Syn, both supervised pre-training $( 7 9 . 0 0 \% )$ and self-supervised pre-training $( 8 1 . 5 5 \% )$ could largely approach their IN-1K Real counterparts (super.: $8 1 . 3 \%$ ; self-super.: $8 2 . 4 4 \%$ ) and largely outperforms the result without pre-training $( 6 6 . 0 8 \% )$ . When increasing the data amount to 2.4M, the transferred results further increase, and the unsupervised pre-training method, i.e. Moco v2, performs better in utilizing our synthetic data thanks to its independence of labels, yielding a $8 2 . 1 3 \%$ transferred performance which surpasses supervised pre-training on IN-1K Real $( 8 1 . 3 0 \% )$ and is on par with its Moco v2 counterpart at IN-1K Real $( 8 2 . 4 4 \% )$ . Next, we expand the label space by adding another 1K categories, producing IN-2K Syn. The enlarged diversity and data amount further bridge the gap between synthetic pre-training results and IN-1K Real pre-training results. Noticeably, the unsupervised pre-trained model Moco v2 $( 8 2 . 2 9 \% )$ largely approaches the IN-1K Real counterpart $( 8 2 . 4 4 \% )$ with negligible performance drop of $0 . 1 5 \%$ . Furthermore, when initialized from IN-1K Real pre-trained weights, both supervised and self-supervised pre-training improve upon both pure real data and synthetic data for pre-training.
|
| 149 |
+
|
| 150 |
+
While the above results are all obtained with convolutional-based backbone i.e. ResNet50, we further explore with a recent ViT-based backbone i.e. DeiT-S (Touvron et al., 2021). Surprisingly,
|
| 151 |
+
|
| 152 |
+
Table 8: Results on CIFAR-100 with downstream-aware supervised pre-training. C100: CIFAR100.
|
| 153 |
+
|
| 154 |
+
<table><tr><td>Data</td><td>pre-trained on IN-1k?</td><td>Syn. images amount 0 1.2M 2.4M 3.6M</td><td></td></tr><tr><td>(None)</td><td></td><td>78.83</td><td>-</td></tr><tr><td>C100 Syn</td><td></td><td>1</td><td>83.90 85.03 85.24</td></tr><tr><td>(None)</td><td>√</td><td>84.50</td><td>- =</td></tr><tr><td>C100 Syn</td><td>√</td><td>-</td><td>84.90 85.32 85.52</td></tr></table>
|
| 155 |
+
|
| 156 |
+
Table 9: Results on CIFAR-100 with downstream-agnostic supervised pretraining. Backbone: DeiT-S.
|
| 157 |
+
|
| 158 |
+
<table><tr><td rowspan="2">Data</td><td rowspan="2">pre-trained on IN-1k?</td><td colspan="3">Syn. images amount 1.2M 2.4M 4.0M</td></tr><tr><td>0 69.29 =</td><td></td><td></td></tr><tr><td>(None) IN-1K Syn</td><td></td><td>87.98</td><td>88.39</td><td>=</td></tr><tr><td>IN-2K Syn</td><td></td><td>- =</td><td>88.57</td><td>88.91</td></tr><tr><td>(None)</td><td>5</td><td>- 88.07 =</td><td>-</td><td>■</td></tr></table>
|
| 159 |
+
|
| 160 |
+
Table 10: Results for object detection on PASCAL VOC with downstream-agnostic supervised pre-training, all results are reported in $\mathrm { { A P } _ { 5 0 } }$ .
|
| 161 |
+
|
| 162 |
+
<table><tr><td>Data</td><td>pre-trained on IN-1k?</td><td>Syn.images amount 0 1.2M</td><td>2.4M 4.0M</td></tr><tr><td>(None)</td><td></td><td>66.08 79.00 =</td><td>= =</td></tr><tr><td>IN-1K Syn IN-2K Syn</td><td></td><td>- =</td><td>80.00 80.54 80.72</td></tr><tr><td>(None)</td><td>√</td><td>81.30</td><td>-</td></tr><tr><td>IN-1K Syn</td><td>√</td><td>=</td><td>81.78</td></tr><tr><td>IN-2K Syn</td><td>√</td><td>=</td><td>81.87 81.91</td></tr></table>
|
| 163 |
+
|
| 164 |
+
Table 11: Results for object detection on PASCAL VOC with downstream-agnostic selfsupervised pre-training (Moco v2), all results are reported in $\mathrm { { A P } _ { 5 0 } }$ .
|
| 165 |
+
|
| 166 |
+
<table><tr><td>Data</td><td>pre-trained on IN-1k?</td><td>Syn. images amount 0 1.2M</td><td>2.4M 4.0M</td></tr><tr><td>(None)</td><td></td><td>66.08 -</td><td>- 1</td></tr><tr><td>IN-1K Syn</td><td></td><td>81.55 =</td><td>82.13</td></tr><tr><td>IN-2K Syn</td><td></td><td>1 =</td><td>82.22 82.29</td></tr><tr><td>(None)</td><td>4</td><td>82.44</td><td>=</td></tr><tr><td>IN-1K Syn</td><td>√</td><td>- =</td><td>82.47</td><td>=</td></tr></table>
|
| 167 |
+
|
| 168 |
+
ViT-based backbone is shown to be more advantageous compared with convolution-based backbone for synthetic pre-training: outperforming ImageNet pre-training results in the downstream-agnostic settings. Equipped with ViT-based backbone, on only 1.2M IN-1K synthetic data, we achieve comparable performance $( 8 7 . 9 8 \% )$ with ImageNet pre-training $( 8 8 . 0 7 \% )$ . Further increasing the data amount $( 8 8 . 3 9 \% )$ and label space $( 8 8 . 5 7 \%$ , $8 8 . 9 1 \%$ of pre-training data leads to higher performance than ImageNet pre-training. ViT-based backbones have stronger ability for learning from large-scale data and are more robust (Pinto et al., 2021), and thus could better benefit from synthetic pre-training where data are more noisy and data scale could be easily increased.
|
| 169 |
+
|
| 170 |
+
Conclusion. In terms of transfer abilities, synthetic data from text-to-image generation models show surprisingly promising results for model pre-training, which is comparable to the standard ImageNet pre-training. We conclude our findings as follows:
|
| 171 |
+
|
| 172 |
+
1. Data amount has positive impacts on synthetic pre-training; performance could be improved by increasing synthetic data size, but would gradually saturate as the amount of data increases.
|
| 173 |
+
|
| 174 |
+
2. Synthetic data for pre-training is orthogonal to real data for pre-training.
|
| 175 |
+
|
| 176 |
+
3. For downstream-aware synthetic pre-training, we significantly outperform IN-1K Real (1.2M) pre-training with 2.4M/3.6M synthetic data on CIFAR-100.
|
| 177 |
+
|
| 178 |
+
4. For downstream-agnostic synthetic pre-training, we achieve comparable results with ImageNet (IN-1k) Real pre-training; self-supervised pre-training performs better than supervised pre-training, and ViT-based backbone performs better than convolutional-based backbone. Besides, increasing the label space size could further improve the performance.
|
| 179 |
+
|
| 180 |
+
# 4 CONCLUSION
|
| 181 |
+
|
| 182 |
+
We systematically investigate whether synthetic data from current state-of-the-art text-to-image generation models are readily applicable for image recognition. Our extensive experiments demonstrate that synthetic data are beneficial for classifier learning in zero-shot and few-shot recognition, bringing significant performance boosts and yielding new state-of-the-art performance. Further, current synthetic data show strong potential for model pre-training, even surpassing the standard ImageNet pre-training. We also point out limitations and bottlenecks for applying synthetic data for image recognition, hoping to arouse more future research in this direction.
|
| 183 |
+
|
| 184 |
+
Limitations. In all investigated settings, we observe improved performance as the data amount and diversity (label space) increases. However, due to our limited computational resource, we are not able to further scale up data amount, which may take months to train one model. Besides, we are also not able to investigate larger model sizes and advanced architectures in the current investigation which is also worth exploring in the future. We present more discussions on limitations and future directions in the appendix.
|
| 185 |
+
|
| 186 |
+
Acknowledgement. This work has been supported by Hong Kong Research Grant Council - Early Career Scheme (Grant No. 27209621) and General Research Fund Scheme (Grant no. 17202422). Part of the described research work is conducted in the JC STEM Lab of Robotics for Soft Materials funded by The Hong Kong Jockey Club Charities Trust.
|
| 187 |
+
|
| 188 |
+
# REFERENCES
|
| 189 |
+
|
| 190 |
+
Thomas Berg, Jiongxin Liu, Seung Woo Lee, Michelle L. Alexander, David W. Jacobs, and Peter N. Belhumeur. Birdsnap: Large-scale fine-grained visual categorization of birds. In Proc. Conf. Computer Vision and Pattern Recognition (CVPR), June 2014.
|
| 191 |
+
|
| 192 |
+
Victor Besnier, Himalaya Jain, Andrei Bursuc, Matthieu Cord, and Patrick Perez. This dataset does ´ not exist: training models from generated images. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 1–5. IEEE, 2020.
|
| 193 |
+
|
| 194 |
+
Lukas Bossard, Matthieu Guillaumin, and Luc Van Gool. Food-101–mining discriminative components with random forests. In European conference on computer vision, pp. 446–461. Springer, 2014.
|
| 195 |
+
|
| 196 |
+
Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale gan training for high fidelity natural image synthesis. arXiv preprint arXiv:1809.11096, 2018.
|
| 197 |
+
|
| 198 |
+
Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. arXiv:2006.09882, 2020.
|
| 199 |
+
|
| 200 |
+
Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In ICML, 2020a.
|
| 201 |
+
|
| 202 |
+
Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. In CVPR, 2021.
|
| 203 |
+
|
| 204 |
+
Xinlei Chen, Haoqi Fan, Ross Girshick, and Kaiming He. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020b.
|
| 205 |
+
|
| 206 |
+
Mircea Cimpoi, Subhransu Maji, Iasonas Kokkinos, Sammy Mohamed, and Andrea Vedaldi. Describing textures in the wild. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3606–3613, 2014.
|
| 207 |
+
|
| 208 |
+
Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pp. 248–255. Ieee, 2009.
|
| 209 |
+
|
| 210 |
+
Prafulla Dhariwal and Alexander Nichol. Diffusion models beat gans on image synthesis. Advances in Neural Information Processing Systems, 34:8780–8794, 2021.
|
| 211 |
+
|
| 212 |
+
A. Dosovitskiy, P. Fischer, E. Ilg, P. Hausser, C. Hazırbas¸, V. Golkov, P. v.d. Smagt, D. Cremers, ¨ and T. Brox. Flownet: Learning optical flow with convolutional networks. In IEEE International Conference on Computer Vision (ICCV), 2015. URL http://lmb.informatik. uni-freiburg.de/Publications/2015/DFIB15.
|
| 213 |
+
|
| 214 |
+
Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv:2010.11929, 2020.
|
| 215 |
+
|
| 216 |
+
Mark Everingham, Luc Van Gool, Christopher KI Williams, John Winn, and Andrew Zisserman. The pascal visual object classes (voc) challenge. IJCV, 2010.
|
| 217 |
+
|
| 218 |
+
Li Fei-Fei, Robert Fergus, and Pietro Perona. One-shot learning of object categories. IEEE transactions on pattern analysis and machine intelligence, 28(4):594–611, 2006.
|
| 219 |
+
|
| 220 |
+
Peng Gao, Shijie Geng, Renrui Zhang, Teli Ma, Rongyao Fang, Yongfeng Zhang, Hongsheng Li, and Yu Qiao. Clip-adapter: Better vision-language models with feature adapters. arXiv preprint arXiv:2110.04544, 2021.
|
| 221 |
+
|
| 222 |
+
Gregory Griffin, Alex Holub, and Pietro Perona. Caltech-256 object category dataset. 2007.
|
| 223 |
+
|
| 224 |
+
Jean-Bastien Grill, Florian Strub, Florent Altche, Corentin Tallec, Pierre H Richemond, Elena´ Buchatskaya, Carl Doersch, Bernardo Avila Pires, Zhaohan Daniel Guo, Mohammad Gheshlaghi Azar, et al. Bootstrap your own latent: A new approach to self-supervised learning. arXiv:2006.07733, 2020.
|
| 225 |
+
|
| 226 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In CVPR, 2016.
|
| 227 |
+
|
| 228 |
+
Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020.
|
| 229 |
+
|
| 230 |
+
Patrick Helber, Benjamin Bischke, Andreas Dengel, and Damian Borth. Eurosat: A novel dataset and deep learning benchmark for land use and land cover classification. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 12(7):2217–2226, 2019.
|
| 231 |
+
|
| 232 |
+
Dan Hendrycks, Steven Basart, Norman Mu, Saurav Kadavath, Frank Wang, Evan Dorundo, Rahul Desai, Tyler Zhu, Samyak Parajuli, Mike Guo, Dawn Song, Jacob Steinhardt, and Justin Gilmer. The many faces of robustness: A critical analysis of out-of-distribution generalization. ICCV, 2021.
|
| 233 |
+
|
| 234 |
+
Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 33:6840–6851, 2020.
|
| 235 |
+
|
| 236 |
+
Jonathan Ho, Chitwan Saharia, William Chan, David J Fleet, Mohammad Norouzi, and Tim Salimans. Cascaded diffusion models for high fidelity image generation. J. Mach. Learn. Res., 23: 47–1, 2022.
|
| 237 |
+
|
| 238 |
+
Ali Jahanian, Xavier Puig, Yonglong Tian, and Phillip Isola. Generative models as a data source for multiview representation learning. arXiv preprint arXiv:2106.05258, 2021.
|
| 239 |
+
|
| 240 |
+
Armand Joulin, Laurens Van Der Maaten, Allan Jabri, and Nicolas Vasilache. Learning visual features from large weakly supervised data. In ECCV, 2016.
|
| 241 |
+
|
| 242 |
+
Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 4401–4410, 2019.
|
| 243 |
+
|
| 244 |
+
Alexander Kolesnikov, Lucas Beyer, Xiaohua Zhai, Joan Puigcerver, Jessica Yung, Sylvain Gelly, and Neil Houlsby. Big transfer (bit): General visual representation learning. In ECCV, 2020.
|
| 245 |
+
|
| 246 |
+
Jonathan Krause, Michael Stark, Jia Deng, and Li Fei-Fei. 3d object representations for fine-grained categorization. In 4th International IEEE Workshop on 3D Representation and Recognition (3dRR-13), Sydney, Australia, 2013.
|
| 247 |
+
|
| 248 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
|
| 249 |
+
|
| 250 |
+
Ang Li, Allan Jabri, Armand Joulin, and Laurens van der Maaten. Learning visual n-grams from web data. In ICCV, 2017.
|
| 251 |
+
|
| 252 |
+
Bill Yuchen Lin, Wangchunshu Zhou, Ming Shen, Pei Zhou, Chandra Bhagavatula, Yejin Choi, and Xiang Ren. Commongen: A constrained text generation challenge for generative commonsense reasoning. arXiv preprint arXiv:1911.03705, 2019.
|
| 253 |
+
|
| 254 |
+
Andreas Lugmayr, Martin Danelljan, Andres Romero, Fisher Yu, Radu Timofte, and Luc Van Gool. Repaint: Inpainting using denoising diffusion probabilistic models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11461–11471, 2022.
|
| 255 |
+
|
| 256 |
+
Dhruv Mahajan, Ross Girshick, Vignesh Ramanathan, Kaiming He, Manohar Paluri, Yixuan Li, Ashwin Bharambe, and Laurens Van Der Maaten. Exploring the limits of weakly supervised pretraining. In ECCV, 2018.
|
| 257 |
+
|
| 258 |
+
S. Maji, J. Kannala, E. Rahtu, M. Blaschko, and A. Vedaldi. Fine-grained visual classification of aircraft. Technical report, 2013.
|
| 259 |
+
|
| 260 |
+
Chenlin Meng, Yutong He, Yang Song, Jiaming Song, Jiajun Wu, Jun-Yan Zhu, and Stefano Ermon. Sdedit: Guided image synthesis and editing with stochastic differential equations. In International Conference on Learning Representations, 2021.
|
| 261 |
+
|
| 262 |
+
Alex Nichol, Prafulla Dhariwal, Aditya Ramesh, Pranav Shyam, Pamela Mishkin, Bob McGrew, Ilya Sutskever, and Mark Chen. Glide: Towards photorealistic image generation and editing with text-guided diffusion models. arXiv preprint arXiv:2112.10741, 2021.
|
| 263 |
+
|
| 264 |
+
Alexander Quinn Nichol and Prafulla Dhariwal. Improved denoising diffusion probabilistic models. In International Conference on Machine Learning, pp. 8162–8171. PMLR, 2021.
|
| 265 |
+
|
| 266 |
+
Maria-Elena Nilsback and Andrew Zisserman. Automated flower classification over a large number of classes. In 2008 Sixth Indian Conference on Computer Vision, Graphics & Image Processing, pp. 722–729. IEEE, 2008.
|
| 267 |
+
|
| 268 |
+
Omkar M Parkhi, Andrea Vedaldi, Andrew Zisserman, and CV Jawahar. Cats and dogs. In 2012 IEEE conference on computer vision and pattern recognition, pp. 3498–3505. IEEE, 2012.
|
| 269 |
+
|
| 270 |
+
Xingchao Peng, Ben Usman, Neela Kaushik, Judy Hoffman, Dequan Wang, and Kate Saenko. Visda: The visual domain adaptation challenge. arXiv preprint arXiv:1710.06924, 2017.
|
| 271 |
+
|
| 272 |
+
Hieu Pham, Zihang Dai, Qizhe Xie, and Quoc V Le. Meta pseudo labels. In CVPR, 2021.
|
| 273 |
+
|
| 274 |
+
Francesco Pinto, Philip Torr, and Puneet K Dokania. Are vision transformers always more robust than convolutional neural networks? 2021.
|
| 275 |
+
|
| 276 |
+
Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning, pp. 8748–8763. PMLR, 2021.
|
| 277 |
+
|
| 278 |
+
Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, Peter J Liu, et al. Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21(140):1–67, 2020.
|
| 279 |
+
|
| 280 |
+
Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical textconditional image generation with clip latents. arXiv preprint arXiv:2204.06125, 2022.
|
| 281 |
+
|
| 282 |
+
Stephan R Richter, Vibhav Vineet, Stefan Roth, and Vladlen Koltun. Playing for data: Ground truth from computer games. In European conference on computer vision, pp. 102–118. Springer, 2016.
|
| 283 |
+
|
| 284 |
+
Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Bjorn Ommer. High- ¨ resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10684–10695, 2022.
|
| 285 |
+
|
| 286 |
+
Chitwan Saharia, William Chan, Huiwen Chang, Chris Lee, Jonathan Ho, Tim Salimans, David Fleet, and Mohammad Norouzi. Palette: Image-to-image diffusion models. In ACM SIGGRAPH 2022 Conference Proceedings, pp. 1–10, 2022a.
|
| 287 |
+
|
| 288 |
+
Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily Denton, Seyed Kamyar Seyed Ghasemipour, Burcu Karagol Ayan, S Sara Mahdavi, Rapha Gontijo Lopes, et al. Photorealistic text-to-image diffusion models with deep language understanding. arXiv preprint arXiv:2205.11487, 2022b.
|
| 289 |
+
|
| 290 |
+
Chitwan Saharia, Jonathan Ho, William Chan, Tim Salimans, David J Fleet, and Mohammad Norouzi. Image super-resolution via iterative refinement. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2022c.
|
| 291 |
+
|
| 292 |
+
Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In International Conference on Machine Learning, pp. 2256–2265. PMLR, 2015.
|
| 293 |
+
|
| 294 |
+
Chen Sun, Abhinav Shrivastava, Saurabh Singh, and Abhinav Gupta. Revisiting unreasonable effectiveness of data in deep learning era. In ICCV, 2017.
|
| 295 |
+
|
| 296 |
+
Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Herve J ´ egou. Training data-efficient image transformers & distillation through attention. In ´ International Conference on Machine Learning, pp. 10347–10357. PMLR, 2021.
|
| 297 |
+
|
| 298 |
+
Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The caltech-ucsd birds-200-2011 dataset. 2011.
|
| 299 |
+
|
| 300 |
+
Haohan Wang, Songwei Ge, Zachary Lipton, and Eric P Xing. Learning robust global representations by penalizing local predictive power. In Advances in Neural Information Processing Systems, pp. 10506–10518, 2019.
|
| 301 |
+
|
| 302 |
+
Mitchell Wortsman, Gabriel Ilharco, Jong Wook Kim, Mike Li, Simon Kornblith, Rebecca Roelofs, Raphael Gontijo Lopes, Hannaneh Hajishirzi, Ali Farhadi, Hongseok Namkoong, et al. Robust fine-tuning of zero-shot models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7959–7971, 2022.
|
| 303 |
+
|
| 304 |
+
Jianxiong Xiao, James Hays, Krista A Ehinger, Aude Oliva, and Antonio Torralba. Sun database: Large-scale scene recognition from abbey to zoo. In 2010 IEEE computer society conference on computer vision and pattern recognition, pp. 3485–3492. IEEE, 2010.
|
| 305 |
+
|
| 306 |
+
Qizhe Xie, Minh-Thang Luong, Eduard Hovy, and Quoc V Le. Self-training with noisy student improves imagenet classification. In CVPR, 2020.
|
| 307 |
+
|
| 308 |
+
Mang Ye, Xu Zhang, Pong C Yuen, and Shih-Fu Chang. Unsupervised embedding learning via invariant and spreading instance feature. In CVPR, 2019.
|
| 309 |
+
|
| 310 |
+
Jure Zbontar, Li Jing, Ishan Misra, Yann LeCun, and Stephane Deny. Barlow twins: Self-supervised ´ learning via redundancy reduction. arXiv:2103.03230, 2021.
|
| 311 |
+
|
| 312 |
+
Renrui Zhang, Zhang Wei, Rongyao Fang, Peng Gao, Kunchang Li, Jifeng Dai, Yu Qiao, and Hongsheng Li. Tip-adapter: Training-free adaption of clip for few-shot classification. arXiv preprint arXiv:2207.09519, 2022.
|
| 313 |
+
|
| 314 |
+
Yuxuan Zhang, Huan Ling, Jun Gao, Kangxue Yin, Jean-Francois Lafleche, Adela Barriuso, Antonio Torralba, and Sanja Fidler. Datasetgan: Efficient labeled data factory with minimal human effort. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10145–10155, 2021.
|
| 315 |
+
|
| 316 |
+
Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Conditional prompt learning for vision-language models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 16816–16825, 2022a.
|
| 317 |
+
|
| 318 |
+
Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Learning to prompt for visionlanguage models. International Journal of Computer Vision, pp. 1–12, 2022b.
|
md/dev/o4neHaKMlse/o4neHaKMlse.md
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Coarse-to-Fine Vision-Language Pre-training with Fusion in the Backbone
|
| 2 |
+
|
| 3 |
+
Zi-Yi Dou∗‡, Aishwarya Kamath∗♮, Zhe $\mathbf { G a n ^ { * } } ^ { \star \star }$ , Pengchuan Zhang§, Jianfeng Wang† Linjie $\mathbf { L i } ^ { \dagger }$ , Zicheng $\mathbf { L i u } ^ { \dagger }$ , Ce $\mathbf { L i u } ^ { \dagger }$ , Yann LeCun♮, Nanyun Peng‡, Jianfeng $\mathbf { G a o } ^ { \dagger }$ , Lijuan Wang† †Microsoft ‡University of California, Los Angeles ♮New York University {zdou,violetpeng}@cs.ucla.edu, {aish,yann.lecun}@nyu.edu, pengchuanzhang@fb.com {zhgan,jianfw,linjli,zliu,liuce,jfgao,lijuanw}@microsoft.com
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Vision-language (VL) pre-training has recently received considerable attention. However, most existing end-to-end pre-training approaches either only aim to tackle VL tasks such as image-text retrieval, visual question answering (VQA) and image captioning that test high-level understanding of images, or only target region-level understanding for tasks such as phrase grounding and object detection. We present FIBER (Fusion-In-the-Backbone-based transformER), a new VL model architecture that can seamlessly handle both these types of tasks. Instead of having dedicated transformer layers for fusion after the uni-modal backbones, FIBER pushes multimodal fusion deep into the model by inserting cross-attention into the image and text backbones, bringing gains in terms of memory and performance. In addition, unlike previous work that is either only pre-trained on image-text data or on fine-grained data with box-level annotations, we present a two-stage pretraining strategy that uses both these kinds of data efficiently: (i) coarse-grained pre-training based on image-text data; followed by (ii) fine-grained pre-training based on image-text-box data. We conduct comprehensive experiments on a wide range of VL tasks, ranging from VQA, image captioning, and retrieval, to phrase grounding, referring expression comprehension, and object detection. Using deep multimodal fusion coupled with the two-stage pre-training, FIBER provides consistent performance improvements over strong baselines across all tasks, often outperforming methods using magnitudes more data. Code is available at https://github.com/microsoft/FIBER.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Inspired by the success of language model pre-training [11, 51, 42], coupled with the unification of architectures used in the NLP and computer vision communities [12, 4], vision-language pre-training (VLP) [62, 45, 33, 6] has been receiving an increasing amount of attention. It has been proven that VLP can establish state-of-the-art performance on visual question answering [3], visual reasoning [60], image captioning, and image-text retrieval [41]. The pre-training objectives commonly used for these tasks, such as image-text matching, image conditioned masked language modeling and image-text constrastive learning, require multimodal understanding at the image level. Typically, this means the pre-training is done using images at lower resolution (e.g., $3 8 4 \times 3 8 4$ ), making it possible to scale up training by using large batch sizes.
|
| 12 |
+
|
| 13 |
+
Recently, it has also been shown that tasks such as image classification and object detection (OD), which have been traditionally viewed as vision-only tasks, can benefit from being cast as VL tasks [50, 25, 34, 26]. Inspired by MDETR [26], GLIP [34] reformulates standard classificationbased OD as phrase grounding. This opens up the possibility to leverage VLP for OD, and vice versa, and this unification has led to impressive performance on several established OD as well as phrase grounding benchmarks [49]. Since these tasks involve fine-grained image understanding between regions in the image and phrases in the text, and also require prediction of precise bounding boxes at the output, the pre-training typically involves using high resolution input images (e.g., $8 0 0 \times 1 , 3 3 3 ,$ ).
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: The proposed coarse-to-fine pre-training framework for vision-language tasks. We first perform coarse-grained pre-training with image-text data for VQA, image captioning and retrieval tasks, and then perform fine-grained pre-training with image-text-box data for phrase grounding and object detection tasks. The same FIBER architecture is used for both stages. OD: object detection. MLM: masked language modeling. ITM: image-text matching. ITC: image-text contrastive loss.
|
| 17 |
+
|
| 18 |
+
Existing multimodal architectures typically do not support both kinds of tasks. Specifically, the fully end-to-end VLP models such as ALBEF [32], METER [13], and SimVLM [67] can achieve the state of the art (SoTA) on image-level understanding tasks, but it is non-trivial to extend them for region-level VL tasks because predicting bounding boxes is typically hard in end-to-end settings. On the other hand, MDETR [26] and GLIP [34] are designed to predict bounding boxes, but have not been shown to support tasks such as image captioning and retrieval. Further, fine-grained pretraining not only requires data with bounding box annotations that are cumbersome to acquire, but the requirement of high input image resolution makes pre-training very costly, especially when using standard Transformer architectures [63] that have quadratic complexity in the size of the image. A natural but challenging question arises: can we have a unified framework for efficient VL pre-training that benefits both image-level and region-level VL tasks (e.g., both VQA and $O D$ )?
|
| 19 |
+
|
| 20 |
+
We answer this question by proposing two ideas: $( i )$ a novel model architecture that can handle various types of tasks and pre-training strategies (high and low resolution inputs, image and region level outputs) more efficiently than previous work (see Section 3.1 and 4), and $( i i )$ a two-stage pre-training pipeline.
|
| 21 |
+
|
| 22 |
+
In terms of architecture, we present FIBER, shown in Figure 2, which performs deep multimodal fusion in the backbone. Specifically, instead of having a few dedicated transformer layers on top of the image and text encoders for fusion (e.g., as is commonly done in previous work [36, 6, 13, 26, 34]), we propose to directly insert cross-attention modules into the image and text backbones. Additionally, we support the ability to switch between a dual encoder (for
|
| 23 |
+
|
| 24 |
+

|
| 25 |
+
Figure 2: Model architecture for FIBER. Swin transformer is used as the image backbone, simplified here for illustration purposes.
|
| 26 |
+
|
| 27 |
+
fast image retrieval) and a fusion encoder (for VQA and captioning) readily, by switching on or off the cross-attention modules. With the same model architecture, by simply adding an object detection head (e.g., Dynamic Head [9]) on top, FIBER can be readily extended to visual grounding, referring expression comprehension and (open-vocabulary) OD tasks as well.
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
Figure 3: FIBER can be readily adapted to various downstream VL tasks, ranging from VQA, image captioning and retrieval, to phrase grounding and object detection (OD).
|
| 31 |
+
|
| 32 |
+
By considering the nature of different VL tasks, FIBER is pre-trained with a coarse-to-fine two-stage pipeline, as detailed in Figure 1. Specifically,
|
| 33 |
+
|
| 34 |
+
• During coarse-grained pre-training, FIBER takes low-resolution $( 3 8 4 \times 3 8 4 )$ images as input, and is pre-trained with image-text matching, masked language modeling, and image-text contrastive losses, as used in previous work [13, 66, 64]. The pre-trained model can then be directly finetuned for VQA and image captioning tasks (Figure 3a and 3c). By switching off the cross-attention modules, FIBER also automatically functions as a dual encoder for fast image-text retrieval (Figure 3b). • During fine-grained pre-training, FIBER uses the coarse pre-trained model as initialization, in addition to randomly initialized parameters for the OD head. At this stage, the model takes highresolution $( 8 0 0 \times 1 , 3 3 3 )$ ) images as input, and is pre-trained with bounding box localization loss and word-region alignment loss, as used in GLIP [34]. We use image-text-box data with ground-truth box annotations for pre-training, and the model can be directly fine-tuned for grounding and detection tasks (Figure 3d).
|
| 35 |
+
|
| 36 |
+
Compared to fine-grained pre-training, coarse-grained pre-training is easier to scale up, as it only requires paired image-text data which can be easily harvested from the web. Crucially, we show that re-using all the parameters from our coarse-grained pre-trained model for fine-grained pre-training alleviates the requirement for large amounts of box-level annotated data. In our experiments, we show that on fine-grained tasks such as Flickr30k Entities, FIBER using coarse-grained pre-training achieves gains even over previous SoTA (GLIP [34]) that uses $2 5 \times$ more box-level annotated images during the fine-grained pre-training stage. We also show that our architecture is much more efficient in terms of training time on OD tasks, as compared to GLIP .
|
| 37 |
+
|
| 38 |
+
FIBER is the first end-to-end VLP model that can support VL tasks encompassing image-level and region-level outputs. We conduct experiments on VQAv2 [3], $\mathrm { \ N L V R ^ { 2 } }$ [60], COCO captioning [41], NoCaps [1], COCO and Flickr $3 0 \mathrm { k }$ image-text retrieval [49], as well as on phrase grounding [49], referring expression comprehension [75], COCO and LVIS detection [17], and a suite of 13 object detection in the wild datasets [34]. We show that our model can provide consistent performance improvement over strong baselines (e.g., METER [13] and GLIP [34]) across tasks.
|
| 39 |
+
|
| 40 |
+
# 2 Related Work
|
| 41 |
+
|
| 42 |
+
VLP for Classical VL Tasks. ViLBERT [45] and LXMERT [62] were the first two methods to introduce using transformers for VLP. Since then, we have witnessed a boom of VLP methods [33, 30, 59, 73, 22, 71, 81, 38, 7, 35]. Early methods mainly focus on the use of pre-trained object detectors to extract image region features offline, such as UNITER [6], OSCAR [36], VILLA [15] and VinVL [79]. More recently, end-to-end VLP methods that use the image directly as input have become popular. In these approaches, convolution networks or vision transformers [12] are used as the image backbone, with additional transformer layers for modeling multimodal fusion [24, 23, 28, 68, 32, 64]. Prominent examples along this line include ViLT [28], ALBEF [32], SimVLM [67], METER [13], X-VLM [77] and BLIP [31]. These models have achieved the current SoTA on major VL benchmarks such as VQA and image captioning. However, they cannot be directly used for tasks such as object detection.
|
| 43 |
+
|
| 44 |
+
Table 1: Comparison among different VLP models. FIBER is the only VLP model that can support all tasks considered. (†) VQA is used as a representative VL classification task. $( \ddagger )$ $O ( n + m )$ retrieval denotes model backbones process inputs $O ( n + m )$ times given $_ n$ images and $m$ text sentences during image-text retrieval. $( \ast )$ Here, we mainly focus on what tasks CLIP can be directly used for.
|
| 45 |
+
|
| 46 |
+
<table><tr><td>Model</td><td>VQA+</td><td>O(n+m) Retrieval* Captioning Grounding</td><td></td><td></td><td>OD</td><td>End2End</td></tr><tr><td>ViLBERT [45],LXMERT [62], UNITER [6]</td><td>√</td><td>xxx<xx<></td><td>x<x×</td><td></td><td>xxxxxxxx<×</td><td>×</td></tr><tr><td>OSCAR [36],VinVL [79]</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>PixelBERT [24], CLIP-ViL [57],ViLT[28]</td><td>√</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>CLIP [50]*, ALIGN [25]</td><td>×</td><td></td><td></td><td>xxxxxxν</td><td></td><td>x>>></td></tr><tr><td>VL-T5 [7]</td><td>√</td><td></td><td><<x></td><td></td><td></td><td>×√√</td></tr><tr><td>METER[13], SimVLM[67]</td><td>√</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>ALBEF[32],FLAVA [58],VLMo [66]</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>BLIP[31],CoCa [74],Flamingo [2]</td><td></td><td></td><td></td><td></td><td></td><td>√</td></tr><tr><td>MDETR [26], GLIP [34]</td><td>√</td><td>×</td><td>×</td><td></td><td></td><td>√</td></tr><tr><td>UniTAB [70], X-VLM[77],OFA [65]</td><td>√</td><td>×</td><td>√</td><td>√</td><td></td><td>√</td></tr><tr><td>FIBER</td><td>√</td><td>√</td><td>√</td><td>√</td><td>√</td><td>√</td></tr></table>
|
| 47 |
+
|
| 48 |
+
VLP for Vision Tasks. Recently, it has been shown that image-text data can be used to learn image encoders from scratch [10, 54]. By performing large-scale contrastive pre-training, CLIP [50] and ALIGN [25] display strong zero-shot image classification capabilities. While these models mainly tackle image-level understanding tasks, MDETR [26] extends the end-to-end OD model DETR [4], and uses contrastive learning along with an alignment loss to learn correspondences between image regions and text phrases, opening up the possibility to tackle tasks such as phrase grounding and long-tailed OD using VL models. This has inspired many follow-up works to further enhance the pre-training [37, 72, 46, 69], among which GLIP [34] shows that OD can also be cast as a VL task (i.e., phrase grounding). However, it has not been shown how traditional VL tasks such as VQA, captioning and retrieval can be well supported in GLIP [34] and MDETR [26].
|
| 49 |
+
|
| 50 |
+
Unified VL Modeling. There have been a few recent attempts that try to develop unified VL models. VL-T5 [7] unifies VL tasks as text generation; however, pre-trained object detectors are used for image feature extraction, so the model cannot be end-to-end pre-trained. UniT [20] proposes a multimodal multi-task framework with a unified transformer; however, it can only support VQA and object detection tasks, but not captioning and grounding. GPV [18] proposes a general-purpose vision system, and FLAVA [58] presents a VL system similar to METER [13]; however, they did not evaluate on grounding and detection tasks, and their performance on other VL tasks is still far from SoTA. UniTAB [70] and OFA [65] reformulate grounding as a sequence generation task, by borrowing ideas from Pix2Seq [5]. However, these approaches have not been demonstrated to work on standard OD benchmarks, and also cannot be used as dual encoders for fast image retrieval. Our model is the first work that can support not only VQA, image captioning and $O ( n + m )$ retrieval, but also visual grounding and object detection, with impressive performance across all tasks. A detailed comparison is provided in Table 1.
|
| 51 |
+
|
| 52 |
+
# 3 Method
|
| 53 |
+
|
| 54 |
+
In this section, we first describe the proposed model architecture in Section 3.1. We then illustrate our two-stage pre-training paradigm in Section 3.2, followed by fine-tuning strategies for all the tasks supported by FIBER in Section 3.3.
|
| 55 |
+
|
| 56 |
+
# 3.1 Fusion in the Backbone
|
| 57 |
+
|
| 58 |
+
The architecture of FIBER is shown in Figure 2. Different from models that stack a modality fusion module on top of the vision or language backbones [6, 13], we insert multimodal fusion inside the backbones, and include a gating mechanism for the cross-modal layers (shown in Figure 4). Specifically, at each encoding layer, we have:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\begin{array} { r l } & { \tilde { \pmb { x } } = \mathrm { S E L F - A T T } \big ( \pmb { x } \big ) , } \\ & { \pmb { x } = \pmb { x } + \tilde { \pmb { x } } + \alpha * \mathrm { C R O S S - A T T } \big ( \tilde { \pmb { x } } , \pmb { y } \big ) , } \\ & { \pmb { x } = \pmb { x } + \mathrm { F F N } ( \pmb { x } ) , } \end{array}
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
xFigure 4: Illustration of performing fusion in the backbone. $( { \pmb x } , { \pmb y } )$ are the (image, text) or (text, image) representations, and $\alpha$ is a learnable scalar.
|
| 66 |
+
|
| 67 |
+
where $\alpha$ is a learnable parameter initialized to 0. For simplicity, we insert the same number of cross-attention layers into the vision and language backbones.
|
| 68 |
+
|
| 69 |
+
By inserting cross-attention layers with the gating mechanism, we enable cross-modal interactions without affecting the original computational flow of the backbones at the beginning of model training. Also, we can easily switch off the interactions by setting $\alpha$ to 0, and the backbones can be used in the dual-encoder setting. In addition, compared to stacking a large number of transformer layers on top of the backbones, our approach of inserting cross-attention layers is relatively light-weight and thus more memory-efficient. To illustrate, both GLIP [34] and METER [13] use an additional 110M modality fusion parameters for a base-size model, while FIBER only adds about 26M parameters. During training, the fusion module of FIBER only consumes half of the FLOPs needed by METER (12.35 vs. 24.04 GFLOPs for one instance). We experimented with two other model variants for fusion in the backbone, the details of which are provided in Appendix.
|
| 70 |
+
|
| 71 |
+
# 3.2 Coarse-to-Fine Pre-training
|
| 72 |
+
|
| 73 |
+
We divide VL tasks into two categories based on whether or not we need to generate region-level outputs on the image side. While these two kinds of tasks are characteristically different, they both require fusion between the vision and language modalities, and we hypothesize that sharing as many parameters as possible between the model used for these two sets of tasks will be beneficial. Based on this motivation, we propose a two-stage pre-training paradigm, where we first pre-train models with image-level objectives on images at low resolution, and then perform further pre-training with region-level objectives where the input images are at a higher resolution. In this way, the coarsegrained supervision from the first stage can provide good initialization for the second stage for all the shared parameters. FIBER with the same architecture (Swin Transformer [43] and RoBERTa [42]) is used as the backbone for both stages of pre-training.
|
| 74 |
+
|
| 75 |
+
Coarse-grained Pre-training. For tasks like VQA and captioning, it has been demonstrated [32, 13, 66] that masked language modeling (MLM), image-text matching (ITM), and image-text contrastive (ITC) objectives are helpful for ViT-based VLP models. Following previous work, we use all the three objectives during pre-training. Specifically,
|
| 76 |
+
|
| 77 |
+
• For ITC, the inserted cross-attention modules are switched off, so FIBER functions as a dual encoder. Given a batch of $N$ image-caption pairs, we first compute their representations with our vision and language encoders independently without modality fusion, and then maximize the similarities between $N$ positive image-text pairs while minimizing the similarities between the rest $N ^ { 2 } - N$ negative pairs, via a contrastive loss.
|
| 78 |
+
• For MLM and ITM, the inserted cross-attention modules are switched on, so FIBER now functions as a fusion encoder. For MLM, we randomly mask $15 \%$ of the input tokens and the model is trained to reconstruct the original tokens. For image-text matching, the model is given an image-text pair and predicts whether they are matched. Following VLMo [66], we sample global hard negatives based on the similarities computed from the above ITC loss.
|
| 79 |
+
|
| 80 |
+
Fine-grained Pre-training. Most existing VL architectures [6, 62, 26, 31, 65, 7] use vanilla transformers both for encoding the vision as well as language inputs. However, in contrast to tokens in text, the entities of interest in images do not all occur at the same scale. Being able to accurately model the image at different scales is especially important for tasks such as object detection and phrase grounding. To handle this, it is typical in object detection literature to use input images at higher resolutions $( 8 0 0 \times 1 3 3 3 )$ , which becomes problematic when using vanilla transformers that scale quadratically in the length of the input sequence. As mentioned earlier, we use a Swin Transformer [43] as our image encoder, which provides hierarchical representations of the image while having linear complexity in the size of the image. We combine these multi-scale representations using an FPN [39] for object detection training. For fine-grained pre-training, we switch on the cross-attention modules, using FIBER as a fusion encoder. This ensures that the image representations that are passed to the FPN are already text-aware, and is a crucial difference compared to GLIP [34], where the image-text fusion takes place in the object detection head. Once the text-aware image features are extracted by the Swin backbone and image-aware text features are extracted using RoBERTa [42], the image features after the FPN are fed to a DynamicHead [9] which predicts a set of regions. Just as in [34], we compute the dot product between the image region features $R _ { \mathrm { T A } }$ and the contextualized token representations $\mathbf { \delta T _ { \mathrm { I A } } }$ to compute the grounding score:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\begin{array} { r } { I _ { \mathrm { T A } } , T _ { \mathrm { I A } } = \mathrm { F I B E R } ( I , T ) , R _ { \mathrm { T A } } = \mathrm { O D } { \cdot } \mathrm { H E A D } ( I _ { \mathrm { T A } } ) , S _ { \mathrm { G R O U N D I N G } } = R _ { \mathrm { T A } } T _ { \mathrm { I A } } ^ { \top } , } \end{array}
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
where $R _ { \mathrm { T A } }$ represents regions that are text aware, produced using the OD-Head that takes as input $I _ { \mathrm { T A } }$ , which are image representations that are already text-aware and $\mathbf { \delta T _ { \mathrm { I A } } }$ are the text features that have already attended to the image features. The typical object detection model has a classification head that predicts the label of the object, and a localization head that predicts the bounding box. We follow GLIP [34] by substituting the classification head with the grounding score SGROUNDING. The localization loss is composed of two parts: a centerness loss and GIoU loss, which are used to supervise the box prediction. Taken together, FIBER learns the correspondence between regions in the image and phrases in the text, making it possible to tackle tasks such as phrase grounding and object detection using the same framework. We use ATSS framework [80] in our paper, but our method can be combined easily with other object detectors such as Faster-RCNN [52] and RetinaNet [40] as well.
|
| 87 |
+
|
| 88 |
+
# 3.3 Adaptation to Downstream Tasks
|
| 89 |
+
|
| 90 |
+
We now describe how we adapt FIBER to different downstream tasks as depicted in Figure 3.
|
| 91 |
+
|
| 92 |
+
• For VL classification tasks such as VQA, we use FIBER as a fusion encoder. Specifically, the top $M$ layers of the vision and language backbones interact with each other and produce multimodal representations. The final layer representations of the two modalities are concatenated together to generate the final outputs for tasks such as VQA and visual reasoning.
|
| 93 |
+
|
| 94 |
+
• For retrieval tasks, we switch off the inserted cross-attention modules to use FIBER as a dual encoder for fast image-text retrieval.
|
| 95 |
+
|
| 96 |
+
• For captioning, we adapt FIBER by only keeping the image-to-text cross-attentions and using causal masks in the decoding side. The representations of the final image encoding layer are fed into the cross-attention modules. In this way, the model is turned into a seq2seq model [61, 8] and performs captioning in an auto-regressive way.
|
| 97 |
+
|
| 98 |
+
• For phrase grounding, object detection and referring expression comprehension, we use FIBER as a fusion encoder, and the OD-Head introduced during fine-grained pre-training receives image features that are already language aware due to the multimodal representations extracted by FIBER. The pre-trained model is directly used without any modifications for these tasks.
|
| 99 |
+
|
| 100 |
+
# 4 Experiments
|
| 101 |
+
|
| 102 |
+
Pre-training Datasets. Following previous work [6, 28, 32, 13, 64, 66], we perform coarsegrained pre-training on COCO [41], Conceptual Captions [56], SBU Captions [47], and Visual Genome [29]. The four datasets consist of about 4M images in total. For fine-grained pretraining, we use two data sources: data curated by MDETR [26] after removing the COCO images, and the Objects365 [55] detection dataset, together consisting of about $0 . 8 { \bf M }$ images. We ensure that we exclude any data that exists in the validation or test splits of downstream tasks.
|
| 103 |
+
|
| 104 |
+
# Architecture. We adopt Swin-Base [43] and
|
| 105 |
+
|
| 106 |
+
<table><tr><td>Type of Fusion</td><td>CoCo Val2017</td><td>GPU-hours V100 (32GB)</td><td> Sec/Iter</td></tr><tr><td>No Fuse</td><td>53.9</td><td>511</td><td>1.31</td></tr><tr><td>GLIP-B [34]</td><td>54.6</td><td>840</td><td>2.14</td></tr><tr><td>FIBER-B</td><td>54.5</td><td>540</td><td>1.38</td></tr></table>
|
| 107 |
+
|
| 108 |
+
Table 2: Object detection on COCO [41], without visionlanguage pre-training. We initialize the text encoder and image backbones using a pre-trained RoBERTa and a Swin transformer pre-trained on ImageNet22k. Our proposed FIBER model achieves the same performance as GLIP [34] while taking much less time to train.
|
| 109 |
+
|
| 110 |
+
RoBERTa-Base [42] as our vision and text backbones, which are initialized with weights from uni-modal pre-training. We insert cross-attention blocks into the top 6 blocks of the vision and text encoders. The input resolution is $3 8 4 \times 3 8 4$ for coarse-grained pre-training and $8 0 0 \times 1 , 3 3 3$ for fine-grained pre-training. Using a hierarchical vision transformer enables us to efficiently tackle these high resolution tasks, which would be expensive in models such as BLIP [31] that rely on the vanilla transformer architecture. In METER [13], which does explore using a Swin transformer as the image encoder, the multi-modal fusion occurs in layers specifically designed to align the modalities, only after the image and text features are extracted from the uni-modal backbones. This is in contrast to our approach where the hierarchical image features that are used in the FPN for fine-grained training are already language aware, due to the multi-modal fusion being in the backbone. This also lets us avoid adding additional “language-aware deep fusion layers” [34] as part of the OD head as in GLIP, resulting in $1 . 5 \mathrm { x }$ faster training while maintaining performance as shown in Table 2. While in principle it would be possible to use the image features extracted by METER’s backbone for object detection, it would be necessary as in GLIP to add additional layers to make the visual features “language-aware” for good detection performance, especially on datasets with limited training data and with rare and infrequent objects.
|
| 111 |
+
|
| 112 |
+
Table 3: Results on VL classification and retrieval. We also include models pre-trained on more data and/or with larger size. FIBER and VLMo use dual encoders for retrieval. (†) ALBEF, X-VLM, and BLIP first use its dual encoder to obtain top- $k$ candidates, and then use its fusion encoder to re-rank the candidates. Our retrieval results with re-ranking are provided in Table 4. All the other models use fusion encoders.
|
| 113 |
+
|
| 114 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">#Pretrain Images</td><td colspan="2">VQAv2</td><td colspan="2">NLVR²</td><td colspan="2">Flickr30k</td><td colspan="2">CoCo</td></tr><tr><td>test-dev test-std</td><td></td><td>dev</td><td></td><td>test-P IR@1 TR@1</td><td></td><td></td><td>IR@1 TR@1</td></tr><tr><td colspan="10">Base-size models pre-trained on COco,VG, SBU, and CC datasets</td></tr><tr><td>UNITER-B [6]</td><td>4M</td><td>72.70</td><td>72.91</td><td>77.18</td><td>77.85</td><td>72.5</td><td>85.9</td><td>50.3</td><td>64.4</td></tr><tr><td>VILLA-B [15]</td><td>4M</td><td>73.59</td><td>73.67</td><td>78.39</td><td>79.30</td><td>74.7</td><td>86.6</td><td>-</td><td>1</td></tr><tr><td>UNIMO-B [35]</td><td>4M</td><td>73.79</td><td>74.02</td><td>1</td><td>-</td><td>1</td><td>1</td><td>-</td><td>-</td></tr><tr><td>ViLT-B [28]</td><td>4M</td><td>71.26</td><td>-</td><td>75.70</td><td>76.13</td><td>64.4</td><td>83.5</td><td>42.7</td><td>61.5</td></tr><tr><td>ALBEF-B [32]</td><td>4M</td><td>74.54</td><td>74.70</td><td>80.24</td><td>80.50</td><td>82.8t</td><td>94.3t</td><td>56.8t</td><td>73.1t</td></tr><tr><td>VLMo-B [66]</td><td>4M</td><td>76.64</td><td>76.89</td><td>82.77</td><td>83.34</td><td>79.3</td><td>92.3</td><td>57.2</td><td>74.8</td></tr><tr><td>METER-Swin-B[13]</td><td>4M</td><td>76.43</td><td>76.42</td><td>82.23</td><td>83.47</td><td>79.02</td><td>92.4</td><td>54.85</td><td>72.96</td></tr><tr><td>X-VLM [77]</td><td>4M</td><td>78.22</td><td>78.37</td><td>84.41</td><td>84.76</td><td>86.9t</td><td>97.0t</td><td>63.4t</td><td>81.2t</td></tr><tr><td colspan="10">Models pre-trained on more data and/or with larger : size</td></tr><tr><td>VLMo-L [66]</td><td>4M</td><td>79.94</td><td>79.98</td><td>85.64</td><td>86.86</td><td>84.5</td><td>95.3</td><td>60.6</td><td>78.2</td></tr><tr><td>BLIPCapFit-L [31]</td><td>129M</td><td>78.25</td><td>78.32</td><td>82.15</td><td>82.24</td><td>87.5†</td><td>97.2t</td><td>64.1†</td><td>81.2t</td></tr><tr><td>SimVLM-B[67]</td><td>1.8B</td><td>77.87</td><td>78.14</td><td>81.72</td><td>81.77</td><td></td><td>-</td><td>-</td><td>1</td></tr><tr><td>SimVLM-H[67]</td><td>1.8B</td><td>80.03</td><td>80.34</td><td>84.53</td><td>85.15</td><td>二</td><td>-</td><td>-</td><td>-</td></tr><tr><td>FIBER-B</td><td>4M</td><td>78.55</td><td>78.46</td><td>84.59</td><td>85.52</td><td>81.44</td><td>92.90</td><td>58.01</td><td>75.38</td></tr></table>
|
| 115 |
+
|
| 116 |
+
Implementation Details. We perform coarse-grained pre-training for $1 0 0 \mathrm { k }$ steps with 4,096 batch size on 64 A100 GPUs. We use AdamW [44] with the peak learning rates of 1e-4 for the backbones and 5e-4 for the cross-modal parameters. We use linear warmup over the first 1k steps and linear decay. For fine-grained pre-training, we train for $8 0 0 \mathrm { k }$ steps on 64 V100 GPUs, with a batch size of 64. We use a learning rate of 1e-5 for the language backbone, and 1e-4 for the rest of the model with a weight decay of 0.01. We use a linear warmup over the first 2k steps and then a constant learning rate, with two learning rate drops by a factor of 10 at $67 \%$ and $89 \%$ of the total number of steps.
|
| 117 |
+
|
| 118 |
+
# 4.1 Results on Downstream Tasks
|
| 119 |
+
|
| 120 |
+
Vision-Language Classification. We first experiment on two representative VL classification tasks, including VQAv2 [3] and $\mathrm { \tt N L V R } ^ { \mathrm { 2 } }$ [60]. As reported in Table 3, we achieve the best performance compared to other models in the same setting. It is worth noting that FIBER pre-trained with 4M images can achieve better performance than BLIP trained with 129M images and SimVLM trained with 1.8B images. The results indicate that introducing fusion modules into the backbone is an effective alternative to appending them on the top of uni-modal backbones.
|
| 121 |
+
|
| 122 |
+
Image-Text Retrieval. In Table 3 we report image retrieval performance in the dual encoder setting, achieving competitive performance on both Flickr30k [49] and COCO [41] retrieval tasks. However, previous work has shown that fusion encoders obtain superior performance, albeit at the cost of efficiency as it involves feeding every image-text pair into the model. To illustrate, on the COCO test data, ranking the similarities between 5K images and 25K captions requires the model to process each image-caption pair 75M times, whereas the dual encoder model only needs 30K forward passes. As shown in Table 4, the fusion encoder can indeed surpass the dual encoder on retrieval tasks by a large margin. In addition, directly ensembling the two models by summing their similarity scores together for each image-caption pair can bring us huge improvements.
|
| 123 |
+
|
| 124 |
+
Table 4: Additional results on image-text retrieval, where (i) the fusion encoder is used for retrieval, or (ii) the dual encoder is first used to obtain top- $k$ candidates, and then the fusion encoder is used to re-rank the candidates. We also provide a full set of results on all evaluation metrics.
|
| 125 |
+
|
| 126 |
+
<table><tr><td rowspan="2">Model</td><td colspan="6">Flickr30k</td><td colspan="6">CoCo</td></tr><tr><td>IR@1</td><td>IR@5IR@10 TR@1</td><td></td><td></td><td></td><td></td><td></td><td></td><td>TR@5 TR@10 IR@1 IR@5 IR@10 TR@1</td><td></td><td></td><td>TR@5TR@10</td></tr><tr><td>FIBER-ITC</td><td>81.44</td><td>96.72</td><td>98.48</td><td>92.90</td><td>99.50</td><td>99.90</td><td>58.01</td><td>83.45</td><td>90.11</td><td>75.38</td><td>94.04</td><td>97.36</td></tr><tr><td>FIBER-ITM</td><td>84.10</td><td>97.54</td><td>98.88</td><td>95.10</td><td>99.60</td><td>99.90</td><td>59.03</td><td>84.04</td><td>91.03</td><td>75.14</td><td>93.88</td><td>97.36</td></tr><tr><td>FIBER-ITC+ITMEnsemble</td><td>90.96</td><td>98.44</td><td>99.14</td><td>96.00</td><td>99.70</td><td>100.00</td><td>69.73</td><td>90.66</td><td>94.59</td><td>80.10</td><td>95.60</td><td>97.98</td></tr><tr><td>ALBEF [32]</td><td>82.8</td><td>96.7</td><td>98.4</td><td>94.3</td><td>99.4</td><td>99.8</td><td>56.8</td><td>81.5</td><td>89.2</td><td>73.1</td><td>91.4</td><td>96.0</td></tr><tr><td>X-VLM[77]</td><td>86.1</td><td>97.4</td><td>98.7</td><td>96.8</td><td>99.8</td><td>100.0</td><td>63.1</td><td>85.7</td><td>91.6</td><td>80.4</td><td>95.5</td><td>98.2</td></tr><tr><td>FIBER-Rerank-10</td><td>90.94</td><td>98.16</td><td>98.48</td><td>95.80</td><td>99.60</td><td>99.90</td><td>68.71</td><td>87.69</td><td>90.09</td><td>79.66</td><td>95.34</td><td>97.36</td></tr><tr><td>FIBER-Rerank-20</td><td>90.10</td><td>98.38</td><td>99.14</td><td>95.90</td><td>99.80</td><td>100.00</td><td>69.32</td><td>89.52</td><td>93.33</td><td>79.78</td><td>95.20</td><td>97.66</td></tr><tr><td>FIBER-Rerank-50</td><td>91.08</td><td>98.50</td><td>99.37</td><td>96.10</td><td>99.70</td><td>100.00</td><td>69.58</td><td>90.41</td><td>94.35</td><td>79.98</td><td>95.40</td><td>97.76</td></tr><tr><td>FIBER-Rerank-100</td><td>91.02</td><td>98.54</td><td>99.34</td><td>96.00</td><td>99.70</td><td>100.00</td><td>69.63</td><td>90.54</td><td>94.47</td><td>80.06</td><td>95.60</td><td>97.96</td></tr></table>
|
| 127 |
+
|
| 128 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">#Pretrain Images</td><td colspan="4">CoCo</td><td colspan="2">NoCaps Val</td><td colspan="2">NoCaps Test</td></tr><tr><td>B@4</td><td>M</td><td>C</td><td>s</td><td>C</td><td>S</td><td>C</td><td>S</td></tr><tr><td colspan="10">Models trained without CIDEr optimization</td></tr><tr><td>UFO-B [64]</td><td>4M</td><td>36.0</td><td>28.9</td><td>122.8</td><td>22.2</td><td>80.7</td><td>12.5</td><td>78.8</td><td>12.5</td></tr><tr><td>ViTCAP[14]</td><td>4M</td><td>36.3</td><td>29.3</td><td>125.2</td><td>22.6</td><td>1</td><td>1</td><td>1</td><td>1</td></tr><tr><td>METER-CLIP-B[13]</td><td>4M</td><td>38.8</td><td>30.0</td><td>128.2</td><td>23.0</td><td>-</td><td>=</td><td>=</td><td>=</td></tr><tr><td>X-VLM[77]</td><td>4M</td><td>39.8</td><td>-</td><td>133.1</td><td>1</td><td>=</td><td></td><td>=</td><td>=</td></tr><tr><td>VinVL-B [79]</td><td>5.7M</td><td>38.2</td><td>30.3</td><td>129.3</td><td>23.6</td><td>1</td><td>-</td><td></td><td>=</td></tr><tr><td>BLIPCapFilt-L [31]</td><td>129M</td><td>39.7</td><td>−</td><td>133.3</td><td>-</td><td>109.6</td><td>14.7</td><td></td><td>=</td></tr><tr><td>LEMON-B [21]</td><td>200M</td><td>40.3</td><td>30.2</td><td>133.3</td><td>23.3</td><td>106.8</td><td>14.1</td><td></td><td></td></tr><tr><td>SimVLM-B[67]</td><td>1.8B</td><td>39.0</td><td>32.9</td><td>134.8</td><td>24.0</td><td>-</td><td>-</td><td>94.8</td><td>13.1</td></tr><tr><td>FIBER-B</td><td>4M</td><td>39.1</td><td>30.4</td><td>128.4</td><td>23.1</td><td>88.6</td><td>13.0</td><td>86.0</td><td>12.9</td></tr><tr><td>FIBER-GOLD-B</td><td>4M</td><td>40.3</td><td>30.7</td><td>133.6</td><td>23.6</td><td>92.8</td><td>13.4</td><td>90.6</td><td>13.4</td></tr><tr><td colspan="10">Models trained with CIDEr optimization</td></tr><tr><td>ViTCAP [14]</td><td>4M</td><td>41.2</td><td>30.1</td><td>138.1</td><td>24.1</td><td>89.2</td><td>12.7</td><td></td><td>1</td></tr><tr><td>X-VLM[77]</td><td>4M</td><td>41.3</td><td>-</td><td>140.8</td><td>-</td><td>-</td><td>-</td><td>=</td><td>-</td></tr><tr><td>VinVL-B[79]</td><td>5.7M</td><td>40.9</td><td>30.9</td><td>140.4</td><td>25.1</td><td>94.3*</td><td>13.1*</td><td>92.5*</td><td>13.1*</td></tr><tr><td>LEMON-B [21]</td><td>200M</td><td>41.6</td><td>31.0</td><td>142.7</td><td>25.1</td><td>-</td><td>-</td><td>1</td><td>-</td></tr><tr><td>FIBER-B</td><td>4M</td><td>42.8</td><td>31.0</td><td>142.8</td><td>24.3</td><td>96.7</td><td>13.4</td><td>94.1</td><td>13.4</td></tr><tr><td>FIBER-GOLD-B</td><td>4M</td><td>43.4</td><td>31.3</td><td>144.4</td><td>24.6</td><td>99.2</td><td>13.7</td><td>97.1</td><td>13.8</td></tr></table>
|
| 129 |
+
|
| 130 |
+
Table 5: Results of base-size models on image captioning. We grey models pre-trained on larger magnitudes of data. Numbers with ‘\*’ are obtained with constrained beam search during inference and without VLP. The complete results on all metrics are provided in Appendix. $\mathrm { B } @ 4$ : BLEU $@ 4$ , M: METEOR, C: CIDEr, S: SPICE.
|
| 131 |
+
|
| 132 |
+
Further, we explore combining the strengths of both strategies by performing re-ranking as in [16, 31, 32]. Specifically, we first retrieve the top- $k$ most similar instances using the dual encoder setup, and then add the similarity scores between the given instance and the top- $k$ candidates provided by the fusion encoder to the original scores to perform retrieval. From Table 4, we can see that this strategy provides a balance between efficiency and performance, and that just re-ranking the top-10 instances can achieve comparable performance with ensembling.
|
| 133 |
+
|
| 134 |
+
Image Captioning. We also evaluate our models on COCO [41] and NoCaps [1] captioning to test whether FIBER can be adapted to generation tasks. As in Table 5, FIBER can achieve better performance than models trained on the same data with and without CIDEr optimization [53]. We find that integrating GOLD [48] into FIBER can bring significant improvements, outperforming models trained with hundreds of millions of images. Notably, we establish the absolute state-of-the-art CIDEr scores on COCO for base-size models. Considering that FIBER is not pre-trained to perform captioning, the results demonstrate the strong generalization ability of FIBER.
|
| 135 |
+
|
| 136 |
+
Phrase Grounding. Our fine-grained pre-training stage incorporates Flickr30k entities grounding data, and we achieve 87.4 on the Recall $@ 1$ metric on the test set without any subsequent fine-tuning. This not only surpasses the current SoTA [34] using a smaller sized model (Swin-B compared to their Swin-L), but also uses $2 5 \mathrm { x }$ less fine-grained data. Our FIBER model is able to leverage the image-text coarse-grained pre-training stage better, instead of relying on expensive pseudo-labelling of large web-scale corpus and subsequent high-resolution training on this generated fine-grained data as in [34]. We also compare our approach without using any coarse-grained VL training (image encoder initialized to Swin-B weights from $\mathrm { I N } 2 2 \mathrm { k }$ , and text encoder initialized to pre-trained RoBERTa), and even in this setting, we are able to outperform a similarly sized GLIP model (GLIP-B), proving that our fusion in the backbone is better at capturing fine-grained image-text understanding.
|
| 137 |
+
|
| 138 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">Image Backbone</td><td rowspan="2">#Pretrain Images (fine-grained)</td><td colspan="3">Flickr30k Val</td><td colspan="3">Flickr30k Test</td></tr><tr><td>R@1</td><td>R@5</td><td>R@10</td><td>R@1</td><td>R@5</td><td>R@10</td></tr><tr><td>Visual-BERT[33]</td><td>ResNet-101</td><td>120k</td><td>70.4</td><td>84.5</td><td>86.3</td><td>71.3</td><td>85.0</td><td>86.5</td></tr><tr><td>MDETR [26]</td><td>EN-B5</td><td>200k</td><td>83.6</td><td>93.4</td><td>95.1</td><td>84.3</td><td>93.9</td><td>95.8</td></tr><tr><td>GLIP [34]</td><td>Swin-B</td><td>860k</td><td>85.7</td><td>95.0</td><td>96.2</td><td>86.1</td><td>95.5</td><td>96.4</td></tr><tr><td colspan="9">Models pre-trained on more data and/or with larger size</td></tr><tr><td>GLIP [34]</td><td>Swin-L</td><td>27M</td><td>86.7</td><td>96.4</td><td>97.9</td><td>87.1</td><td>96.9</td><td>98.1</td></tr><tr><td>FIBER-B</td><td>Swin-B</td><td>860k</td><td>87.1</td><td>96.1</td><td>97.4</td><td>87.4</td><td>96.4</td><td>97.6</td></tr><tr><td>w/o C.G. VLP</td><td>Swin-B</td><td>860k</td><td>86.2</td><td>96.0</td><td>97.6</td><td>86.5</td><td>96.4</td><td>97.7</td></tr></table>
|
| 139 |
+
|
| 140 |
+
Table 6: Phrase grounding performance on Flickr30k entities dataset. We reproduce GLIP-Base sized results, and GLIP-Large sized results are taken from [34]. FIBER with Base size outperforms a GLIP-L which is trained with $2 5 \mathrm { x }$ more fine-grained data on the $\mathbb { R } \ @ 1$ metric. Further, FIBER without coarse-grained VL pretraining outperforms GLIP-B when trained on the same fine-grained data.
|
| 141 |
+
|
| 142 |
+
Table 7: Results on referring expression comprehension datasets.
|
| 143 |
+
|
| 144 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">Pre-training data</td><td colspan="3">RefCOCO</td><td colspan="3">RefCOCO+</td><td colspan="2">RefCOCOg</td></tr><tr><td>Im-Txt</td><td>Im-Txt-Box</td><td>val</td><td>testA</td><td>testB</td><td>val</td><td>testA</td><td>testB</td><td>val</td><td>test</td></tr><tr><td>MDETR-B [26]</td><td></td><td>√</td><td>87.51</td><td>90.40</td><td>82.67</td><td>81.13</td><td>85.52</td><td>72.96</td><td>83.35</td><td>83.31</td></tr><tr><td>UNICORN-B [70]</td><td></td><td>√</td><td>88.29</td><td>90.42</td><td>83.06</td><td>80.30</td><td>85.05</td><td>71.88</td><td>83.44</td><td>83.93</td></tr><tr><td colspan="9">Models pre-trained on more data and/or with larger size</td><td></td><td></td></tr><tr><td>UNITER-L [6]</td><td>√</td><td></td><td>81.41</td><td>87.04</td><td>74.17</td><td>75.90</td><td>81.45</td><td>66.70</td><td>74.86</td><td>75.77</td></tr><tr><td>VILLA-L [15]</td><td>√</td><td></td><td>82.39</td><td>87.48</td><td>74.84</td><td>76.17</td><td>81.54</td><td>66.84</td><td>76.18</td><td>76.71</td></tr><tr><td>OFA-L [65]</td><td>√</td><td>√</td><td>90.05</td><td>92.93</td><td>85.26</td><td>84.49</td><td>90.10</td><td>77.77</td><td>84.54</td><td>85.20</td></tr><tr><td>FIBER-B</td><td>√</td><td>√</td><td>90.68</td><td>92.59</td><td>87.26</td><td>85.74</td><td>90.13</td><td>79.38</td><td>87.11</td><td>87.32</td></tr></table>
|
| 145 |
+
|
| 146 |
+
Referring Expression Comprehension (REC). In contrast to many previous works [6, 15, 45] that tackle the REC task by re-ranking object proposals provided by an off-the-shelf detector, we follow [26] to directly predict the bounding box for the given referring expression. Using our proposed two stage pre-training, FIBER achieves better performance than current SoTA [65] that uses a Large sized model. Notably, on RefCOCOg [76], which contains much longer referring expressions than in RefCOCO/RefCOCO $^ +$ [27], we observe more than 2 points boost over OFA-L. On the challenging testB split of both RefCOCO and RefCOCO+, FIBER outperforms current SoTA, OFA-L.
|
| 147 |
+
|
| 148 |
+

|
| 149 |
+
Figure 5: Few-shot results on the aggregated 13 ODinW datasets.
|
| 150 |
+
|
| 151 |
+
Object Detection. We report FIBER results on two standard object detection benchmarks, COCO [41] and LVIS [17], in zero-shot transfer1 as well as fine-tuned settings in Table 8. The LVIS dataset consists of a long-tail of object classes, and is a popular test-bed for evaluating models on their generalization capabilities and robustness to class imbalance. On the APr metric, which is the Average Precision on rare objects, FIBER outperforms GLIP-L which is a bigger model and also trained with $2 5 \times$ more fine-grained data.
|
| 152 |
+
|
| 153 |
+
<table><tr><td rowspan="2">Model</td><td>COCO Val 2017</td><td colspan="4">LVIS MiniVal</td><td rowspan="2">ODinW</td></tr><tr><td>AP</td><td>APr</td><td>APc</td><td>APf</td><td>AP</td></tr><tr><td></td><td>Zero-shot/Fine-tune</td><td></td><td>Zero-shot/Fine-tune</td><td></td><td></td><td>Zero-shot/Fine-tune</td></tr><tr><td>Mask R-CNN[19]</td><td>-</td><td>- /26.3</td><td>- /34.0</td><td>- /33.9</td><td>- /33.3</td><td></td></tr><tr><td>MDETR [26]</td><td>-</td><td>- /20.9</td><td>- /24.9</td><td>- /24.3</td><td>- /24.2</td><td>-</td></tr><tr><td>GLIP-T [34]</td><td>46.7/55.1</td><td>17.7/-</td><td>19.5/ -</td><td>31.0/-</td><td>24.9/ -</td><td>44.4/63.9</td></tr><tr><td>GLIP-B [34]</td><td>48.1/57.0</td><td>17.0/31.3 23.9/48.3 35.9/56.9</td><td></td><td></td><td>29.1/51.0</td><td>44.8/65.8</td></tr><tr><td colspan="7">Models pre-trained on more data and/or with larger size</td></tr><tr><td>GLIP-L [34]</td><td>49.8/60.8</td><td>28.2/-</td><td>34.3/-</td><td>41.5/-</td><td>37.3/ -</td><td>52.1/68.9</td></tr><tr><td>FIBER-B</td><td>49.3/58.4</td><td>29.5/50.0</td><td>32.2/56.9</td><td>40.1/58.1</td><td>35.8/56.9</td><td>47.0/65.9</td></tr></table>
|
| 154 |
+
|
| 155 |
+
Table 8: Zero-shot transfer and fine-tuning results for object detection on COCO, LVIS and the average over 13 datasets for object detection in the wild. Detailed scores on the 13 datasets are presented in the Appendix. FIBER achieves better AP across the board compared to similarly sized GLIP-B, trained on the same amount of fine-grained data. On rare objects in LVIS, FIBER outperforms GLIP-L trained on $2 5 \mathrm { x }$ more fine-grained data. Results without coarse-grained pre-training are provided in the Appendix.
|
| 156 |
+
|
| 157 |
+
We also report zero-shot and fine-tuned results on a suite of 13 ODinW (object detection in the wild) datasets, spanning various domains and show consistent performance improvements over previous SoTA. Additionally, in Figure 5, we report few-shot results aggregated across these 13 datasets and show better data efficiency over GLIP-B trained with the same fine-grained data.
|
| 158 |
+
|
| 159 |
+
Ablation Study. In Appendix ?? and ??, we have provided detailed ablations that guided our architecture design, including ablations on fusion strategies, pre-training objectives, architecture for captioning, and additional results on open-ended VQA, and detailed few-shot ODinW results. Due to the space limit, these ablations and additional results are only provided in the Appendix. Some important observations are summarized below. (i) Co-attention works similarly to merged attention for fusion in the backbone. (ii) Adding a gating parameter in co-attention allows the addition of fusion in more layers, and also gives better performance than merged attention. (iii) Adding co-attention in the last 6 layers provides a balance between performance and efficiency. (iv) MLM, ITM with hard negative mining, and ITC are all important pre-training objectives for training FIBER-style models.
|
| 160 |
+
|
| 161 |
+
# 5 Conclusion
|
| 162 |
+
|
| 163 |
+
We propose (i) FIBER, a novel architecture and (ii) a coarse-to-fine pre-training pipeline. We perform extensive experiments and show consistent improvements over strong baselines across a diverse set of tasks. The results demonstrate the effectiveness of FIBER coupled with our pre-training strategy, by setting new SoTA scores while at the same time reducing the requirement of expensive box-level annotations. Future directions include scaling our models and extending our framework to other modalities.
|
| 164 |
+
|
| 165 |
+
The approach introduced in our work can potentially inherit undesirable societal biases that exist in our pre-training data. Careful debiasing and filtering of data should be undertaken before real-life deployment of our work. Additionally, pre-training can induce environmental costs, and minimizing these costs is an avenue that we plan to explore further.
|
| 166 |
+
|
| 167 |
+
# Acknowledgement
|
| 168 |
+
|
| 169 |
+
We would like to thank Nguyen Bach, Jiayuan Huang, and Luis Vargas for their support. We also thank Wenhui Wang, Li Dong, Furu Wei, Bin Xiao, and Lu Yuan for their helpful discussions. We also thank Liunian Harold Li and Te-Lin Wu for their feedback on the manuscript. Aishwarya is supported in part by the National Science Foundation under NSF Award 1922658. Zi-Yi is supported in part by the DARPA Machine Common Sense (MCS) program under Cooperative Agreement N66001-19-2-4032 and NIH R01HL152270.
|
| 170 |
+
|
| 171 |
+
# References
|
| 172 |
+
|
| 173 |
+
[1] Harsh Agrawal, Karan Desai, Yufei Wang, Xinlei Chen, Rishabh Jain, Mark Johnson, Dhruv Batra, Devi Parikh, Stefan Lee, and Peter Anderson. nocaps: Novel object captioning at scale. In ICCV, 2019. 3, 8
|
| 174 |
+
[2] Jean-Baptiste Alayrac, Jeff Donahue, Pauline Luc, Antoine Miech, Iain Barr, Yana Hasson, Karel Lenc, Arthur Mensch, Katie Millican, Malcolm Reynolds, et al. Flamingo: a visual language model for few-shot learning. arXiv preprint, 2022. 4
|
| 175 |
+
[3] Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C Lawrence Zitnick, and Devi Parikh. VQA: Visual question answering. In ICCV, 2015. 1, 3, 7
|
| 176 |
+
[4] Nicolas Carion, Francisco Massa, Gabriel Synnaeve, Nicolas Usunier, Alexander Kirillov, and Sergey Zagoruyko. End-to-end object detection with transformers. In ECCV, 2020. 1, 4
|
| 177 |
+
[5] Ting Chen, Saurabh Saxena, Lala Li, David J Fleet, and Geoffrey Hinton. Pix2seq: A language modeling framework for object detection. In ICLR, 2022. 4
|
| 178 |
+
[6] Yen-Chun Chen, Linjie Li, Licheng Yu, Ahmed El Kholy, Faisal Ahmed, Zhe Gan, Yu Cheng, and Jingjing Liu. UNITER: Universal image-text representation learning. In ECCV, 2020. 1, 2, 3, 4, 5, 6, 7, 9
|
| 179 |
+
[7] Jaemin Cho, Jie Lei, Hao Tan, and Mohit Bansal. Unifying vision-and-language tasks via text generation. In ICML, 2021. 3, 4, 5
|
| 180 |
+
[8] Kyunghyun Cho, Bart van Merrienboer, Caglar Gulcehre, Dzmitry Bahdanau, Fethi Bougares, Holger Schwenk, and Yoshua Bengio. Learning phrase representations using rnn encoder–decoder for statistical machine translation. In EMNLP, 2014. 6
|
| 181 |
+
[9] Xiyang Dai, Yinpeng Chen, Bin Xiao, Dongdong Chen, Mengchen Liu, Lu Yuan, and Lei Zhang. Dynamic head: Unifying object detection heads with attentions. In CVPR, 2021. 3, 5
|
| 182 |
+
[10] Karan Desai and Justin Johnson. VirTex: Learning visual representations from textual annotations. In CVPR, 2021. 4
|
| 183 |
+
[11] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In NAACL, 2019. 1
|
| 184 |
+
[12] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In ICLR, 2021. 1, 3
|
| 185 |
+
[13] Zi-Yi Dou, Yichong Xu, Zhe Gan, Jianfeng Wang, Shuohang Wang, Lijuan Wang, Chenguang Zhu, Pengchuan Zhang, Lu Yuan, Nanyun Peng, Zicheng Liu, and Michael Zeng. An empirical study of training end-to-end vision-and-language transformers. In CVPR, 2022. 2, 3, 4, 5, 6, 7, 8
|
| 186 |
+
[14] Zhiyuan Fang, Jianfeng Wang, Xiaowei Hu, Lin Liang, Zhe Gan, Lijuan Wang, Yezhou Yang, and Zicheng Liu. Injecting semantic concepts into end-to-end image captioning. In CVPR, 2022. 8
|
| 187 |
+
[15] Zhe Gan, Yen-Chun Chen, Linjie Li, Chen Zhu, Yu Cheng, and Jingjing Liu. Large-scale adversarial training for vision-and-language representation learning. In NeurIPS, 2020. 3, 7, 9
|
| 188 |
+
[16] Gregor Geigle, Jonas Pfeiffer, Nils Reimers, Ivan Vulic, and Iryna Gurevych. Retrieve fast, rerank smart: ´ Cooperative and joint approaches for improved cross-modal retrieval. Transactions of the Association for Computational Linguistics, 10:503–521, 2022. 8
|
| 189 |
+
[17] Agrim Gupta, Piotr Dollar, and Ross Girshick. LVIS: A dataset for large vocabulary instance segmentation. In CVPR, 2019. 3, 9
|
| 190 |
+
[18] Tanmay Gupta, Amita Kamath, Aniruddha Kembhavi, and Derek Hoiem. Towards general purpose vision systems. In CVPR, 2022. 4
|
| 191 |
+
[19] Kaiming He, Georgia Gkioxari, Piotr Dollár, and Ross Girshick. Mask R-CNN. In ICCV, 2017. 10
|
| 192 |
+
[20] Ronghang Hu and Amanpreet Singh. UniT: Multimodal multitask learning with a unified transformer. In ICCV, 2021. 4
|
| 193 |
+
[21] Xiaowei Hu, Zhe Gan, Jianfeng Wang, Zhengyuan Yang, Zicheng Liu, Yumao Lu, and Lijuan Wang. Scaling up vision-language pre-training for image captioning. In CVPR, 2022. 8
|
| 194 |
+
[22] Xiaowei Hu, Xi Yin, Kevin Lin, Lijuan Wang, Lei Zhang, Jianfeng Gao, and Zicheng Liu. VIVO: Surpassing human performance in novel object captioning with visual vocabulary pre-training. In AAAI, 2021. 3
|
| 195 |
+
[23] Zhicheng Huang, Zhaoyang Zeng, Yupan Huang, Bei Liu, Dongmei Fu, and Jianlong Fu. Seeing out of the box: End-to-end pre-training for vision-language representation learning. In CVPR, 2021. 3
|
| 196 |
+
[24] Zhicheng Huang, Zhaoyang Zeng, Bei Liu, Dongmei Fu, and Jianlong Fu. Pixel-BERT: Aligning image pixels with text by deep multi-modal transformers. arXiv preprint, 2020. 3, 4
|
| 197 |
+
[25] Chao Jia, Yinfei Yang, Ye Xia, Yi-Ting Chen, Zarana Parekh, Hieu Pham, Quoc V Le, Yunhsuan Sung, Zhen Li, and Tom Duerig. Scaling up visual and vision-language representation learning with noisy text supervision. In ICML, 2021. 1, 4
|
| 198 |
+
[26] Aishwarya Kamath, Mannat Singh, Yann LeCun, Gabriel Synnaeve, Ishan Misra, and Nicolas Carion. MDETR-modulated detection for end-to-end multi-modal understanding. In ICCV, 2021. 1, 2, 4, 5, 6, 9, 10
|
| 199 |
+
[27] Sahar Kazemzadeh, Vicente Ordonez, Mark Matten, and Tamara Berg. Referitgame: Referring to objects in photographs of natural scenes. In EMNLP, 2014. 9
|
| 200 |
+
[28] Wonjae Kim, Bokyung Son, and Ildoo Kim. ViLT: Vision-and-language transformer without convolution or region supervision. In ICML, 2021. 3, 4, 6, 7
|
| 201 |
+
[29] Ranjay Krishna, Yuke Zhu, Oliver Groth, Justin Johnson, Kenji Hata, Joshua Kravitz, Stephanie Chen, Yannis Kalantidis, Li-Jia Li, David A Shamma, et al. Visual Genome: Connecting language and vision using crowdsourced dense image annotations. IJCV, 2017. 6
|
| 202 |
+
[30] Gen Li, Nan Duan, Yuejian Fang, Daxin Jiang, and Ming Zhou. Unicoder-VL: A universal encoder for vision and language by cross-modal pre-training. In AAAI, 2020. 3
|
| 203 |
+
[31] Junnan Li, Dongxu Li, Caiming Xiong, and Steven Hoi. BLIP: Bootstrapping language-image pre-training for unified vision-language understanding and generation. arXiv preprint, 2022. 3, 4, 5, 6, 7, 8
|
| 204 |
+
[32] Junnan Li, Ramprasaath R Selvaraju, Akhilesh Deepak Gotmare, Shafiq Joty, Caiming Xiong, and Steven Hoi. Align before fuse: Vision and language representation learning with momentum distillation. In NeurIPS, 2021. 2, 3, 4, 5, 6, 7, 8
|
| 205 |
+
[33] Liunian Harold Li, Mark Yatskar, Da Yin, Cho-Jui Hsieh, and Kai-Wei Chang. VisualBERT: A simple and performant baseline for vision and language. arXiv preprint, 2019. 1, 3, 9
|
| 206 |
+
[34] Liunian Harold Li, Pengchuan Zhang, Haotian Zhang, Jianwei Yang, Chunyuan Li, Yiwu Zhong, Lijuan Wang, Lu Yuan, Lei Zhang, Jenq-Neng Hwang, et al. Grounded language-image pre-training. In CVPR, 2022. 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
|
| 207 |
+
[35] Wei Li, Can Gao, Guocheng Niu, Xinyan Xiao, Hao Liu, Jiachen Liu, Hua Wu, and Haifeng Wang. UNIMO: Towards unified-modal understanding and generation via cross-modal contrastive learning. In ACL, 2021. 3, 7
|
| 208 |
+
[36] Xiujun Li, Xi Yin, Chunyuan Li, Pengchuan Zhang, Xiaowei Hu, Lei Zhang, Lijuan Wang, Houdong Hu, Li Dong, Furu Wei, et al. Oscar: Object-semantics aligned pre-training for vision-language tasks. In ECCV, 2020. 2, 3, 4
|
| 209 |
+
[37] Yangguang Li, Feng Liang, Lichen Zhao, Yufeng Cui, Wanli Ouyang, Jing Shao, Fengwei Yu, and Junjie Yan. Supervision exists everywhere: A data efficient contrastive language-image pre-training paradigm. ICLR, 2022. 4
|
| 210 |
+
[38] Yehao Li, Yingwei Pan, Ting Yao, Jingwen Chen, and Tao Mei. Scheduled sampling in vision-language pretraining with decoupled encoder-decoder network. In AAAI, 2021. 3
|
| 211 |
+
[39] Tsung-Yi Lin, Piotr Dollár, Ross B. Girshick, Kaiming He, Bharath Hariharan, and Serge J. Belongie. Feature pyramid networks for object detection. In CVPR, 2017. 5
|
| 212 |
+
[40] Tsung-Yi Lin, Priya Goyal, Ross B. Girshick, Kaiming He, and Piotr Dollár. Focal loss for dense object detection. TPAMI, 2020. 6
|
| 213 |
+
[41] Tsung-Yi Lin, Michael Maire, Serge J. Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollár, and C. Lawrence Zitnick. Microsoft COCO: Common objects in context. In ECCV, 2014. 1, 3, 6, 7, 8, 9
|
| 214 |
+
[42] Yinhan Liu, Myle Ott, Naman Goyal, Jingfei Du, Mandar Joshi, Danqi Chen, Omer Levy, Mike Lewis, Luke Zettlemoyer, and Veselin Stoyanov. RoBERTa: A robustly optimized bert pretraining approach. arXiv preprint, 2019. 1, 5, 6
|
| 215 |
+
[43] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. In ICCV, 2021. 5, 6
|
| 216 |
+
[44] Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In ICLR, 2018. 7
|
| 217 |
+
[45] Jiasen Lu, Dhruv Batra, Devi Parikh, and Stefan Lee. ViLBERT: Pretraining task-agnostic visiolinguistic representations for vision-and-language tasks. In NeurIPS, 2019. 1, 3, 4, 9
|
| 218 |
+
[46] Norman Mu, Alexander Kirillov, David Wagner, and Saining Xie. SLIP: Self-supervision meets languageimage pre-training. In CVPR, 2022. 4
|
| 219 |
+
[47] Vicente Ordonez, Girish Kulkarni, and Tamara Berg. Im2Text: Describing images using 1 million captioned photographs. In NeurIPS, 2011. 6
|
| 220 |
+
[48] Richard Yuanzhe Pang and He He. Text generation by learning from demonstrations. In ICLR, 2021. 8
|
| 221 |
+
[49] Bryan A Plummer, Liwei Wang, Chris M Cervantes, Juan C Caicedo, Julia Hockenmaier, and Svetlana Lazebnik. Flickr30k Entities: Collecting region-to-phrase correspondences for richer image-to-sentence models. In ICCV, 2015. 2, 3, 7
|
| 222 |
+
[50] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In ICML, 2021. 1, 4, 9
|
| 223 |
+
[51] Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. JMLR, 2020. 1
|
| 224 |
+
[52] Shaoqing Ren, Kaiming He, Ross Girshick, and Jian Sun. Faster R-CNN: Towards real-time object detection with region proposal networks. TPAMI, 2016. 6
|
| 225 |
+
[53] Steven J Rennie, Etienne Marcheret, Youssef Mroueh, Jerret Ross, and Vaibhava Goel. Self-critical sequence training for image captioning. In CVPR, 2017. 8
|
| 226 |
+
[54] Mert Bulent Sariyildiz, Julien Perez, and Diane Larlus. Learning visual representations with caption annotations. In ECCV, 2020. 4
|
| 227 |
+
[55] Shuai Shao, Zeming Li, Tianyuan Zhang, Chao Peng, Gang Yu, Xiangyu Zhang, Jing Li, and Jian Sun. Objects365: A large-scale, high-quality dataset for object detection. In ICCV, 2019. 6
|
| 228 |
+
[56] Piyush Sharma, Nan Ding, Sebastian Goodman, and Radu Soricut. Conceptual captions: A cleaned, hypernymed, image alt-text dataset for automatic image captioning. In ACL, 2018. 6
|
| 229 |
+
[57] Sheng Shen, Liunian Harold Li, Hao Tan, Mohit Bansal, Anna Rohrbach, Kai-Wei Chang, Zhewei Yao, and Kurt Keutzer. How much can clip benefit vision-and-language tasks? In ICLR, 2022. 4
|
| 230 |
+
[58] Amanpreet Singh, Ronghang Hu, Vedanuj Goswami, Guillaume Couairon, Wojciech Galuba, Marcus Rohrbach, and Douwe Kiela. FLAVA: A foundational language and vision alignment model. In CVPR, 2022. 4
|
| 231 |
+
[59] Weijie Su, Xizhou Zhu, Yue Cao, Bin Li, Lewei Lu, Furu Wei, and Jifeng Dai. VL-BERT: Pre-training of generic visual-linguistic representations. In ICLR, 2019. 3
|
| 232 |
+
[60] Alane Suhr, Stephanie Zhou, Ally Zhang, Iris Zhang, Huajun Bai, and Yoav Artzi. A corpus for reasoning about natural language grounded in photographs. In ACL, 2019. 1, 3, 7
|
| 233 |
+
[61] Ilya Sutskever, Oriol Vinyals, and Quoc V Le. Sequence to sequence learning with neural networks. In NeurIPS, 2014. 6
|
| 234 |
+
[62] Hao Tan and Mohit Bansal. LXMERT: Learning cross-modality encoder representations from transformers. In EMNLP, 2019. 1, 3, 4, 5
|
| 235 |
+
[63] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, 2017. 2
|
| 236 |
+
[64] Jianfeng Wang, Xiaowei Hu, Zhe Gan, Zhengyuan Yang, Xiyang Dai, Zicheng Liu, Yumao Lu, and Lijuan Wang. UFO: A unified transformer for vision-language representation learning. arXiv preprint, 2021. 3, 6,
|
| 237 |
+
[65] Peng Wang, An Yang, Rui Men, Junyang Lin, Shuai Bai, Zhikang Li, Jianxin Ma, Chang Zhou, Jingren Zhou, and Hongxia Yang. Unifying architectures, tasks, and modalities through a simple sequence-tosequence learning framework. arXiv preprint, 2022. 4, 5, 9
|
| 238 |
+
[66] Wenhui Wang, Hangbo Bao, Li Dong, and Furu Wei. VLMo: Unified vision-language pre-training with mixture-of-modality-experts. arXiv preprint, 2021. 3, 4, 5, 6, 7
|
| 239 |
+
[67] Zirui Wang, Jiahui Yu, Adams Wei Yu, Zihang Dai, Yulia Tsvetkov, and Yuan Cao. SimVLM: Simple visual language model pretraining with weak supervision. In ICLR, 2022. 2, 3, 4, 7, 8
|
| 240 |
+
[68] Hongwei Xue, Yupan Huang, Bei Liu, Houwen Peng, Jianlong Fu, Houqiang Li, and Jiebo Luo. Probing inter-modality: Visual parsing with self-attention for vision-language pre-training. In NeurIPS, 2021. 3
|
| 241 |
+
[69] Jianwei Yang, Chunyuan Li, Pengchuan Zhang, Bin Xiao, Ce Liu, Lu Yuan, and Jianfeng Gao. Unified contrastive learning in image-text-label space. In CVPR, 2022. 4
|
| 242 |
+
[70] Zhengyuan Yang, Zhe Gan, Jianfeng Wang, Xiaowei Hu, Faisal Ahmed, Zicheng Liu, Yumao Lu, and Lijuan Wang. Crossing the format boundary of text and boxes: Towards unified vision-language modeling. arXiv preprint, 2021. 4, 9
|
| 243 |
+
[71] Zhengyuan Yang, Yijuan Lu, Jianfeng Wang, Xi Yin, Dinei Florencio, Lijuan Wang, Cha Zhang, Lei Zhang, and Jiebo Luo. TAP: Text-aware pre-training for text-vqa and text-caption. In CVPR, 2021. 3
|
| 244 |
+
[72] Lewei Yao, Runhui Huang, Lu Hou, Guansong Lu, Minzhe Niu, Hang Xu, Xiaodan Liang, Zhenguo Li, Xin Jiang, and Chunjing Xu. FILIP: Fine-grained interactive language-image pre-training. In ICLR, 2022. 4
|
| 245 |
+
[73] Fei Yu, Jiji Tang, Weichong Yin, Yu Sun, Hao Tian, Hua Wu, and Haifeng Wang. ERNIE-ViL: Knowledge enhanced vision-language representations through scene graph. In AAAI, 2021. 3
|
| 246 |
+
[74] Jiahui Yu, Zirui Wang, Vijay Vasudevan, Legg Yeung, Mojtaba Seyedhosseini, and Yonghui Wu. CoCa: Contrastive captioners are image-text foundation models. arXiv preprint, 2022. 4
|
| 247 |
+
[75] Licheng Yu, Zhe Lin, Xiaohui Shen, Jimei Yang, Xin Lu, Mohit Bansal, and Tamara L Berg. MAttNet: Modular attention network for referring expression comprehension. In CVPR, 2018. 3
|
| 248 |
+
[76] Licheng Yu, Patrick Poirson, Shan Yang, Alexander C. Berg, and Tamara L. Berg. Modeling context in referring expressions. In ECCV, 2016. 9
|
| 249 |
+
[77] Yan Zeng, Xinsong Zhang, and Hang Li. Multi-grained vision language pre-training: Aligning texts with visual concepts. In ICML, 2022. 3, 4, 7, 8
|
| 250 |
+
[78] Xiaohua Zhai, Xiao Wang, Basil Mustafa, Andreas Steiner, Daniel Keysers, Alexander Kolesnikov, and Lucas Beyer. LiT: Zero-shot transfer with locked-image text tuning. In CVPR, 2022. 9
|
| 251 |
+
[79] Pengchuan Zhang, Xiujun Li, Xiaowei Hu, Jianwei Yang, Lei Zhang, Lijuan Wang, Yejin Choi, and Jianfeng Gao. VinVL: Revisiting visual representations in vision-language models. In CVPR, 2021. 3, 4, 8
|
| 252 |
+
[80] Shifeng Zhang, Cheng Chi, Yongqiang Yao, Zhen Lei, and Stan Z. Li. Bridging the gap between anchorbased and anchor-free detection via adaptive training sample selection. In CVPR, 2020. 6
|
| 253 |
+
[81] Luowei Zhou, Hamid Palangi, Lei Zhang, Houdong Hu, Jason Corso, and Jianfeng Gao. Unified visionlanguage pre-training for image captioning and vqa. In AAAI, 2020. 3
|
| 254 |
+
|
| 255 |
+
# Checklist
|
| 256 |
+
|
| 257 |
+
1. For all authors...
|
| 258 |
+
|
| 259 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 260 |
+
(b) Did you describe the limitations of your work? [Yes] See Section 5
|
| 261 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 5
|
| 262 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 263 |
+
|
| 264 |
+
2. If you are including theoretical results...
|
| 265 |
+
|
| 266 |
+
(a) Did you state the full set of assumptions of all theoretical results? [N/A] (b) Did you include complete proofs of all theoretical results? [N/A]
|
| 267 |
+
|
| 268 |
+
3. If you ran experiments...
|
| 269 |
+
|
| 270 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes]
|
| 271 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes]
|
| 272 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No]
|
| 273 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes]
|
| 274 |
+
|
| 275 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 276 |
+
|
| 277 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 278 |
+
(b) Did you mention the license of the assets? [Yes]
|
| 279 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 280 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 281 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 282 |
+
|
| 283 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 284 |
+
|
| 285 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 286 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 287 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/dev/oDRQGo8I7P/oDRQGo8I7P.md
ADDED
|
@@ -0,0 +1,414 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Riemannian Score-Based Generative Modelling
|
| 2 |
+
|
| 3 |
+
Valentin De Bortoli∗†, Émile Mathieu∗‡, Michael Hutchinson∗‡,
|
| 4 |
+
|
| 5 |
+
James Thornton‡, Yee Whye Teh‡, Arnaud Doucet‡
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Score-based generative models (SGMs) are a powerful class of generative models that exhibit remarkable empirical performance. Score-based generative modelling (SGM) consists of a “noising” stage, whereby a diffusion is used to gradually add Gaussian noise to data, and a generative model, which entails a “denoising” process defined by approximating the time-reversal of the diffusion. Existing SGMs assume that data is supported on a Euclidean space, i.e. a manifold with flat geometry. In many domains such as robotics, geoscience or protein modelling, data is often naturally described by distributions living on Riemannian manifolds and current SGM techniques are not appropriate. We introduce here Riemannian Score-based Generative Models (RSGMs), a class of generative models extending SGMs to Riemannian manifolds. We demonstrate our approach on a variety of manifolds, and in particular with earth and climate science spherical data.
|
| 10 |
+
|
| 11 |
+
# 1 Introduction
|
| 12 |
+
|
| 13 |
+
Score-based Generative Models (SGMs) also called diffusion models (Song and Ermon, 2019; Song et al., 2021; Ho et al., 2020; Dhariwal and Nichol, 2021) formulate generative modelling as a denoising process. Noise is incrementally added to data using a diffusion process until it becomes approximately Gaussian. The generative model is then obtained by simulating an approximation of the corresponding time-reversal process, which progressively denoises a Gaussian sample to obtain a data sample. This process is also a diffusion whose drift depends on the logarithmic gradients of the noised data densities, i.e. the Stein scores, estimated using a neural network via score matching (Hyvärinen, 2005; Vincent, 2011).
|
| 14 |
+
|
| 15 |
+
SGMs have been primarily applied to data living on Euclidean spaces, i.e. manifolds with flat geometry. However, in a large number of scientific domains the distributions of interest are supported on Riemannian manifolds. These include, to name a few, protein modelling (Shapovalov and Dunbrack Jr, 2011), cell development (Klimovskaia et al., 2020), image recognition (Lui, 2012), geological sciences (Karpatne et al., 2018; Peel et al., 2001), graph-structured and hierarchical data (Roy et al., 2007; Steyvers and Tenenbaum, 2005), robotics (Feiten et al., 2013; Senanayake and Ramos, 2018) and high-energy physics (Brehmer and Cranmer, 2020).
|
| 16 |
+
|
| 17 |
+
We introduce in this work Riemannian Score-based Generative Models (RSGMs), an extension of SGMs to Riemannian manifolds which incorporate the geometry of the data by defining the forward diffusion process directly on the Riemannian manifold, inducing a manifold-valued reverse process. This requires constructing a noising process on the manifold that converges to an easy-to-sample reference distribution. We establish that, as in the Euclidean case, the corresponding time-reversal process is also a diffusion whose drift includes the Stein score which is intractable but can similarly be estimated via score matching. Methodological extensions are required as in most cases the transition kernel of the noising process cannot be sampled exactly. For example on compact manifolds it is typically only available as an infinite sum through the Sturm–Liouville decomposition (Chavel, 1984). To this end, we develop non-standard techniques for score estimation and rely on the use of Geodesic Random Walks for sampling (Jørgensen, 1975). We provide theoretical convergence bounds for RSGMs on compact manifolds and demonstrate our approach on a range of manifolds and tasks, including modelling a number of natural disaster occurrence datasets collected by Mathieu and Nickel (2020). We show that RGSMs achieve better performance than recent baselines (Mathieu and Nickel, 2020; Rozen et al., 2021) and scale better to high-dimensional manifolds.
|
| 18 |
+
|
| 19 |
+
# 2 Euclidean Score-based Generative Modelling
|
| 20 |
+
|
| 21 |
+
We recall here briefly the key concepts behind SGMs on the Euclidean space $\mathbb { R } ^ { d }$ and refer the readers to Song et al. (2021) for a more detailed introduction. We consider a forward noising process $( \mathbf { X } _ { t } ) _ { t \geq 0 }$ defined by the following Stochastic Differential Equation (SDE)
|
| 22 |
+
|
| 23 |
+
$$
|
| 24 |
+
\mathrm { d } \mathbf { X } _ { t } = - \mathbf { X } _ { t } \mathrm { d } t + \sqrt { 2 } \mathrm { d } \mathbf { B } _ { t } , \quad \mathbf { X } _ { 0 } \sim p _ { 0 } ,
|
| 25 |
+
$$
|
| 26 |
+
|
| 27 |
+
where $( \mathbf { B } _ { t } ) _ { t \geq 0 }$ is a $d$ -dimensional Brownian motion and $p _ { 0 }$ is the data distribution. The available data gives us an empirical approximation of $p _ { 0 }$ . The process $( \mathbf { X } _ { t } ) _ { t \geq 0 }$ is simply an Ornstein–Ulhenbeck (OU) process which converges with geometric rate to $\mathrm { { N } } ( 0 , \mathrm { { I d } ) }$ . Under mild conditions on $p _ { 0 }$ , the timereversed process $( \mathbf { Y } _ { t } ) _ { t \geq 0 } \stackrel { - } { = } ( \mathbf { X } _ { T - t } ) _ { t \in [ 0 , T ] }$ also satisfies an SDE (Cattiaux et al., 2021; Haussmann and Pardoux, 1986) given by
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
\mathrm { d } \mathbf { Y } _ { t } = \{ \mathbf { Y } _ { t } + 2 \nabla \log p _ { T - t } ( \mathbf { Y } _ { t } ) \} \mathrm { d } t + \sqrt { 2 } \mathrm { d } \mathbf { B } _ { t } , \quad \mathbf { Y } _ { 0 } \sim p _ { T } ,
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
where $p _ { t }$ denotes the density of $\mathbf { X } _ { t }$ . By construction, the law of $\mathbf { Y } _ { T - t }$ is equal to the law of $\mathbf { X } _ { t }$ for $t \in [ 0 , T ]$ and in particular $\mathbf { Y } _ { T } \sim p _ { 0 }$ . Hence, if one could sample from $( \mathbf { Y } _ { t } ) _ { t \in [ 0 , T ] }$ then its final distribution would be the data distribution $p _ { 0 }$ ∈. Unfortunately we cannot sample exactly from (2) as $p _ { T }$ and the scores $( \nabla \log p _ { t } ( x ) ) _ { t \in [ 0 , T ] }$ are intractable. Hence SGMs rely on a few approximations. First, $p _ { T }$ is replaced by the reference distribution $\mathrm { { N } } ( 0 , \mathrm { { I d } ) }$ as we know that $p _ { T }$ converges geometrically towards it. Second, the following denoising score matching identity is exploited to estimate the scores
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\begin{array} { r } { \nabla _ { x _ { t } } \log p _ { t } ( x _ { t } ) = \int _ { \mathbb { R } ^ { d } } \nabla _ { x _ { t } } \log p _ { t | 0 } ( x _ { t } | x _ { 0 } ) p _ { 0 | t } ( x _ { 0 } | x _ { t } ) \mathrm { d } x _ { 0 } , } \end{array}
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
where $p _ { t \vert 0 } ( x _ { t } \vert x _ { 0 } )$ is the transition density of the OU process (1) which is available in closed-form. It follows directly that $\nabla \log p _ { t }$ is the minimizer of $\ell _ { t } ( \mathbf { s } ) = \mathbb { E } [ \| \mathbf { s } ( \mathbf { X } _ { t } ) - \nabla _ { x _ { t } } \log p _ { t | 0 } ( \mathbf { X } _ { t } | \mathbf { X } _ { 0 } ) \| ^ { 2 } ]$ over functions s where the expectation is over the joint distribution of $\mathbf { X } _ { 0 } , \mathbf { X } _ { t }$ . This result can be leveraged by considering a neural network $\mathbf { s } _ { \theta } : [ 0 , T ] \times \mathbb { R } ^ { d } \mathbb { R } ^ { d }$ trained by minimizing the loss function $\begin{array} { r } { \ell ( \theta ) = \int _ { 0 } ^ { T } \lambda _ { t } \ell _ { t } ( \mathbf { s } _ { \theta } ( t , \cdot ) ) \mathrm { d } t } \end{array}$ for some weighting function $\lambda _ { t } ~ > ~ 0$ . Finally, an Euler–Maruyama discretization of (2) is performed using a discretization step $\gamma$ such that $T = \gamma N$ for $N \in \mathbb N$
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
Y _ { n + 1 } = Y _ { n } + \gamma \{ Y _ { n } + 2 \mathbf { s } _ { \theta } ( T - n \gamma , Y _ { n } ) \} + { \sqrt { 2 \gamma } } Z _ { n + 1 } , \quad Y _ { 0 } \sim \mathrm { N ( 0 , I d ) } , \quad Z _ { n } \sim \mathrm { N ( 0 , I d ) } .
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
The above showcases the basics of SGMs but we highlight that many improvements have been proposed; see (e.g. Song and Ermon, 2020; Jolicoeur-Martineau et al., 2021; Dhariwal and Nichol, 2021). In particular, selecting an adaptive stepsize $( \gamma _ { n } ) _ { n \in \mathbb { N } }$ (Bao et al., 2022; Watson et al., 2021) and using a predictor-corrector scheme (Song et al., 2021) instead of a simple Euler–Maruyama discretization drastically improves performance.
|
| 46 |
+
|
| 47 |
+
# 3 Riemannian Score-based Generative Modelling
|
| 48 |
+
|
| 49 |
+
We now move to the Riemannian manifold setting, and more specifically assume that $\mathcal { M }$ is a complete, orientable connected and boundaryless Riemannian manifold, endowed with a Riemannian metric $g ^ { \ 4 }$ . Four components are required to extend SGMs to this setting: i) a forward noising process on $\mathcal { M }$ which converges to an easy-to-sample reference distribution, ii) a time-reversal formula on $\mathcal { M }$ which defines a backward generative process, iii) a method for approximating samples of SDEs on manifolds, iv) a method to efficiently approximate the drift of the time-reversal process. Notation are gathered in App. B.
|
| 50 |
+
|
| 51 |
+
# 3.1 Noising processes on manifolds
|
| 52 |
+
|
| 53 |
+
The first necessary component is a suitable generic noising process on manifolds that will converge to a convenient stationary distribution. A simple choice is to use Langevin dynamics described by
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\begin{array} { r } { \mathrm { d } \mathbf { X } _ { t } = - \frac { 1 } { 2 } \nabla _ { \mathbf { X } _ { t } } U ( \mathbf { X } _ { t } ) \mathrm { d } t + \mathrm { d } \mathbf { B } _ { t } ^ { \mathcal { M } } , } \end{array}
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
which admits the invariant density (w.r.t. the volume form) given by $\mathrm { d } p _ { \mathrm { r e f } } / \mathrm { d } { \mathsf { V o l } } _ { \mathcal { M } } ( x ) \propto \mathrm { e } ^ { - U ( x ) }$ (Durmus, 2016, Section 2.4), where $\nabla$ is the Riemannian gradient5.
|
| 60 |
+
|
| 61 |
+
Two simple choices for $U ( x )$ present themselves. Firstly, setting $U ( x ) = d _ { \mathcal { M } } ( x , \mu ) ^ { 2 } / ( 2 \gamma ^ { 2 } )$ , where $d _ { \mathcal { M } }$ is the geodesic distance and $\mu \in \mathcal { M }$ is an arbitrary mean location, induces the drift $\nabla _ { \mathbf { X } _ { t } } { \tilde { U } } ( \mathbf { X } _ { t } ) =$ $- \exp _ { \mathbf { X } _ { t } } ^ { - 1 } ( \mu ) / \gamma ^ { 2 }$ 6. This is the potential of the ‘Riemannian normal’ (Pennec, 2006) distribution, from which it is in general neither trivial to sample nor to compute the normalisation constant (Hauberg, 2018; Mathieu et al., 2019). An alternative is to target the ’exponential wrapped’ Gaussian. This is the pushforward of a Gaussian distribution in the tangent space at the mean location along the exponential map. The potential is given by $U ( x ) = d _ { \mathcal { M } } ( \bar { x _ { , } } \mu ) ^ { 2 } \bar { / ( 2 \gamma ^ { 2 } ) } + \log | \partial \exp _ { \mu } ^ { - 1 } ( x ) | ^ { 7 }$ . In contrast to the Riemannian normal, sampling and evaluating the density of this distribution is easy.
|
| 62 |
+
|
| 63 |
+
One recovers the standard Ornstein–Uhlenbeck noising process (Song et al., 2021) for both of these target distributions when $\mathcal { M } = \mathbb { R } ^ { d }$ and $\mu = 0$ since then the drift $\begin{array} { r } { b ( t , { \bf \bar { X } } _ { t } ) = \frac { 1 } { 2 } \exp _ { { \bf X } _ { t } } ^ { - 1 } ( 0 ) = - \frac { 1 } { 2 } { \bf X } _ { t } } \end{array}$ On compact manifolds, the invariant measure $\mathrm { V o l } _ { \mathcal { M } }$ has finite volume, thus a natural choice is to target the uniform distribution which is given by $\mathrm { V o l } _ { \mathcal { M } } / | \mathcal { M } |$ . In this case, $\nabla _ { \mathbf { X } _ { t } } U ( \mathbf { X } _ { t } ) = 0$ and the noising process is simply a Brownian motion on $\mathcal { M }$ .
|
| 64 |
+
|
| 65 |
+
# 3.2 Time-reversal on Riemannian manifolds
|
| 66 |
+
|
| 67 |
+
In order to use these noising processes we prove the time-reversal formula for manifolds, a generalisation of the results in the Euclidean case, e.g. see Cattiaux et al. (2021, Theorem 4.9). Consider an SDE of the form $\mathrm { d } \mathbf { X } _ { t } = b ( \mathbf { X } _ { t } ) \mathrm { d } t + \mathrm { d } \mathbf { B } _ { t } ^ { \mathcal { M } }$ where $\mathbf { B } _ { t } ^ { \mathcal { M } }$ is a Brownian motion on $\mathcal { M }$ . We refer to App. C.3 for an introduction to Brownian motions on manifolds. This result shows that if $( \mathbf { X } _ { t } ) _ { t \in [ 0 , T ] }$ is a diffusion process then $( \mathbf { X } _ { T - t } ) _ { t \in [ 0 , T ] }$ is also a diffusion process w.r.t. the backward filtration whose coefficients can be computed, and are shown in Eq. (4). The proof relies on an extension of Cattiaux et al. (2021, Theorem 4.9) to the Riemannian manifold case and is postponed to App. H.
|
| 68 |
+
|
| 69 |
+
Theorem 1 (Time-reversed diffusion). Let $T \geq 0$ and $( \mathbf { B } _ { t } ^ { \mathcal { M } } ) _ { t \geq 0 }$ be a Brownian motion on $\mathcal { M }$ such that $\mathbf { B } _ { 0 } ^ { \mathcal { M } }$ has distribution the volume form ${ p _ { \mathrm { r e f } } } ^ { 8 }$ . Let $( \mathbf { X } _ { t } ) _ { t \in [ 0 , T ] }$ be associated with the $S D E$ $\mathrm { d } \mathbf { X } _ { t } = b ( \mathbf { X } _ { t } ) \mathrm { d } t + \mathrm { d } \mathbf { B } _ { t } ^ { \mathcal { M } }$ . Let $( \mathbf { Y } _ { t } ) _ { t \in [ 0 , T ] } = ( \mathbf { X } _ { T - t } ) _ { t \in [ 0 , T ] }$ and assume that $\mathrm { K L } ( \mathbb { P } | \mathbb { Q } ) < + \infty ,$ where $\mathbb { Q }$ is the distribution of $( \mathbf { B } _ { t } ^ { \mathcal { M } } ) _ { t \in [ 0 , T ] }$ and $\mathbb { P }$ the distribution of $( \mathbf { X } _ { t } ) _ { t \in [ 0 , T ] }$ . In addition, assume that $\mathbb { P } _ { t } = \mathcal { L } ( \mathbf { X } _ { t } )$ , the distribution of $\mathbf { X } _ { t }$ , admits a smooth positive density $p _ { t }$ w.r.t. $p _ { \mathrm { r e f } }$ for any $t \in [ 0 , T ]$ . Then, $( \mathbf { Y } _ { t } ) _ { t \in [ 0 , T ] }$ is associated with the SDE
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\mathrm { d } \mathbf { Y } _ { t } = \{ - b ( \mathbf { Y } _ { t } ) + \nabla \log p _ { T - t } ( \mathbf { Y } _ { t } ) \} \mathrm { d } t + \mathrm { d } \mathbf { B } _ { t } ^ { \mathcal { M } } .
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
# 3.3 Approximate sampling of diffusions
|
| 76 |
+
|
| 77 |
+
Obtaining samples from SDEs on a manifold is non-trivial in general. If $\mathcal { M }$ is isometrically embedded into $\mathbb { R } ^ { p }$ (with $p \geq d$ ) one can define $( \mathbf { B } _ { t } ^ { \mathcal { M } } ) _ { t \geq 0 }$ as a $\mathbb { R } ^ { p }$ -valued process, see App. C.3. However, this approach is extrinsic, as it requires the knowledge of the projection operator to place points back on the manifold at each step which can accumulate errors. Here we consider an intrisic approach based on Geodesic Random Walks (GRWs), see Jørgensen (1975) for a review of their properties. GRWs can approximate any well-behaved diffusion on $\mathcal { M }$ . Hence, we introduce GRWs in a general framework and consider a discrete-time process $( X _ { n } ^ { \gamma } ) _ { n \in \mathbb { N } }$ which approximates the diffusion $( \mathbf { X } _ { t } ) _ { t \geq 0 }$ defined by
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\mathrm { d } \mathbf { X } _ { t } = b ( t , \mathbf { X } _ { t } ) \mathrm { d } t + \sigma ( t , \mathbf { X } _ { t } ) \mathrm { d } \mathbf { B } _ { t } ^ { \mathcal { M } } .
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
This generalisation is key to sampling the backward diffusion process defined in Theorem 1.
|
| 84 |
+
|
| 85 |
+

|
| 86 |
+
single step of a (b) Many steps yield an ap- (c) The density of a single step of Gaussian Random proximate Brownian mo- Walk [Left] and the Brownian motion density [Right] tion trajectory. agree well for small time steps.
|
| 87 |
+
|
| 88 |
+
Geodesic Random Walk.
|
| 89 |
+
|
| 90 |
+
Figure 1: Geodesic Random Walks can be used to approximate Brownian motion and more generally SDEs on manifolds. (a) At each step, tangential noise is sampled (red), which is added the drift term (not pictured). This tangent vector is then pushed through the exponential map to produce a geodesics step on the manifold (blue). (b) Iterating this procedure yield approximate sample paths from the process.
|
| 91 |
+
|
| 92 |
+
# Algorithm 1 GRW (Geodesic Random Walk)
|
| 93 |
+
|
| 94 |
+
Require: $T , N , X _ { 0 } ^ { \gamma } , b , \sigma , \mathrm { P }$
|
| 95 |
+
1: $\gamma = T / N$ . Step-size
|
| 96 |
+
2: for $k \in \{ 0 , \ldots , N - 1 \}$ do
|
| 97 |
+
3: $Z _ { k + 1 } \sim \mathrm { N } ( 0 , \mathrm { I d } )$ . Sample a Gaussian in the tangent space of $X _ { k } ^ { \gamma }$
|
| 98 |
+
4: $W _ { k + 1 } = \gamma \dot { b } ( k \gamma , X _ { k } ^ { \gamma } ) + \sqrt { \gamma } \sigma ( k \gamma , X _ { k } ^ { \gamma } ) Z _ { k + 1 } \mathrm { ~ \tiny ~ > ~ } \mathrm { C o r }$ mpute the Euler–Maruyama step on tangent space
|
| 99 |
+
5: $X _ { k + 1 } ^ { \gamma } = \exp _ { X _ { k } ^ { \gamma } } [ W _ { k + 1 } ]$ . Move along the geodesic defined by $\bar { W _ { k + 1 } }$ and $\bar { X } _ { k } ^ { \gamma }$ on $\mathcal { M }$
|
| 100 |
+
6: end fo7: return $\{ X _ { k } ^ { \gamma } \} _ { k = 0 } ^ { N }$
|
| 101 |
+
|
| 102 |
+
Definition 2 (Geodesic Random Walk). Let $X _ { 0 } ^ { \gamma }$ be a $\mathcal { M }$ -valued random variable. For any $\gamma > 0$ , we define $( X _ { n } ^ { \gamma } ) _ { n \in \mathbb { N } }$ such that for any $n \in \mathbb { N }$ , $X _ { n + 1 } ^ { \gamma ^ { \vee } } = \exp _ { X _ { n } ^ { \gamma } } [ \gamma \{ b ( X _ { n } ^ { \gamma } ) + \sqrt { \gamma } V _ { n + 1 } \} ]$ , where $( V _ { n } ) _ { n \in \mathbb { N } }$ is a sequence of $\mathrm { T } \mathcal { M }$ -valued random variables such that for any $n \in \mathbb { N }$ , $\mathbb { E } [ V _ { n + 1 } | \mathcal { F } _ { n } ] = 0$ and $\mathbb { E } [ V _ { n + 1 } V _ { n + 1 } ^ { \top } | \mathcal { F } _ { n } ] = \sigma \sigma ^ { \top } ( X _ { n } ^ { \gamma } ) ,$ , where ${ \mathcal { F } } _ { n }$ is the filtration generated by $\{ X _ { k } ^ { \gamma } \} _ { k = 0 } ^ { n }$ . We say that the $\mathcal { M }$ -valued process $( X _ { n } ^ { \gamma } ) _ { n \in \mathbb { N } }$ is a Geodesic Random Walk.
|
| 103 |
+
|
| 104 |
+
Algorithm 1 approximately simulates the diffusion $( \mathbf { X } _ { t } ) _ { t \in [ 0 , T ] }$ defined in Eq. (5) using GRWs; see Kuwada (2012); Cheng et al. (2022) for quantitative error bounds in the time-homogeneous case and App. I.2 for a novel extentsion for the time-inhomogeneous case. Fig. 1 provides a graphical illustration of this procedure.
|
| 105 |
+
|
| 106 |
+
# 3.4 Score approximation on Riemannian manifolds
|
| 107 |
+
|
| 108 |
+
Score matching and loss functions. The reverse process from Eq. (4) involves the Stein score $\nabla \log p _ { t }$ which is unfortunately intractable. To derive an approximation, we first remark that for any $s , t \in ( 0 , T ]$ with $t > s$ and $\begin{array} { r } { \in \mathcal { M } , p _ { t } ( x _ { t } ) = \int _ { \mathcal { M } } p _ { t | s } \bar { ( x _ { t } | x _ { s } ) } \mathrm { d } \mathbb { P } _ { s } ( x _ { s } ) } \end{array}$ , where $\mathbb { P } _ { s } = \mathcal { L } ( \mathbf { X } _ { s } )$ , the distribution of $\mathbf { X } _ { s }$ . Thus, we have that for any $s , t \in [ 0 , T ]$ with $t > s$ and $x _ { t } \in \mathcal { M }$
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\begin{array} { r } { \nabla _ { x _ { t } } \log p _ { t } ( x _ { t } ) = \int _ { \mathcal { M } } \nabla _ { x _ { t } } \log p _ { t | s } ( x _ { t } | x _ { s } ) \mathbb { P } _ { s | t } ( x _ { t } , \mathrm { d } x _ { s } ) . } \end{array}
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
Hence, for any $s , t \in [ 0 , T ]$ with $t > s$ we have that $\begin{array} { r } { \nabla \log p _ { t } = \arg \operatorname* { m i n } \{ \ell _ { t | s } ( \mathbf { s } _ { t } ) : \mathbf { s } _ { t } \in \mathrm { L } ^ { 2 } ( \mathbb { P } _ { t } ) \} , } \end{array}$ where $\begin{array} { r } { \ell _ { t | s } ( \mathbf { s } _ { t } ) = \int _ { \mathcal { M } ^ { 2 } } \| \nabla _ { x } \log p _ { t | s } ( x _ { t } | x _ { s } ) - \mathbf { s } _ { t } ( x _ { t } ) \| ^ { 2 } \mathrm { d } \mathbb { P } _ { s , t } ( x _ { s } , x _ { t } ) } \end{array}$ , which is referred as the Denois Ming Score Matching (DSM) loss. It can also be written in an implicit fashion.
|
| 115 |
+
|
| 116 |
+
Proposition 3. Let $t , s \in ( 0 , T ]$ with $t > s$ . Then, for any $\mathbf { s } _ { t } \in \mathrm { C } ^ { \infty } ( \mathcal { M } )$ , $\ell _ { t | s } ( \mathbf { s } _ { t } ) = 2 \ell _ { t } ^ { \mathrm { i m } } ( \mathbf { s } _ { t } ) +$ $\begin{array} { r } { \int _ { \mathcal { M } ^ { 2 } } \| \nabla _ { \boldsymbol { x } _ { t } } \log p _ { t | s } ( \boldsymbol { x } _ { t } | \boldsymbol { x } _ { s } ) \| ^ { 2 } \mathrm { d } \mathbb { P } _ { s , t } ( \boldsymbol { x } _ { s } , \boldsymbol { x } _ { t } ) , } \end{array}$ , where $\begin{array} { r } { \ell _ { t } ^ { \mathrm { i m } } ( \mathbf { s } _ { t } ) = \int _ { \mathcal { M } } \{ \frac { 1 } { 2 } \| \mathbf { s } _ { t } ( x _ { t } ) \| ^ { 2 } + \mathrm { d i v } ( \mathbf { s } _ { t } ) ( x _ { t } ) \} \mathrm { d } \mathbb { P } _ { t } ( x _ { t } ) , } \end{array}$
|
| 117 |
+
|
| 118 |
+
The proof is postponed to App. J. For any $t \in ( 0 , T ]$ the minimizers of the loss $\ell _ { t } ^ { \mathrm { i m } }$ on $\mathcal { X } ( \mathcal { M } )$ (where $\mathcal { X } ( \mathcal { M } )$ is the set of vector fields on $\mathcal { M }$ ) are the same as the ones for $\ell _ { t \mid s }$ . The loss $\ell _ { t } ^ { \mathrm { i m } }$ is referred to as the implicit score matching (ISM) loss (Hyvärinen, 2005). These losses are direct analogous to the versions typically used in Euclidean space.
|
| 119 |
+
|
| 120 |
+
In the case where we have access to $\{ \nabla \log p _ { t | s } : T \leq t > s \geq 0 \}$ , the forward noising process transition kernels, or an approximation of this family, then we can use the DSM loss to learn $\{ \mathbf { s } _ { t } \in \mathcal { X } ( \mathcal { M } ) : \ t \in [ 0 , t ] \}$ . If this is not the case then we turn to $\ell _ { t } ^ { \mathrm { i m } }$ . Note that $\ell _ { t } ^ { \mathrm { i m } }$ requires the computation of a divergence term which requires $d$ Jacobian-vector calls. In high dimension, a stochastic estimator is necessary (Hutchinson, 1989). Following Song and Ermon (2020); Nichol and Dhariwal (2021) the loss can be weighted with a term $\lambda _ { t } > 0$ .
|
| 121 |
+
|
| 122 |
+
Table 1: Differences between SGM on Euclidean spaces and RSGM on Riemannian manifolds.
|
| 123 |
+
|
| 124 |
+
<table><tr><td colspan="4">Require: e,T,N,{Xm} n}m=1,loss,s,0o,Niter,Pref,P</td></tr><tr><td></td><td>1:/// TRAINING //I</td><td></td><td></td></tr><tr><td>2:</td><td>for n ∈ {0,...,Niter-1} do</td><td></td><td></td></tr><tr><td>3:</td><td>Xo~(1/M)∑m=1δxm</td><td></td><td>Random mini-batch from dataset</td></tr><tr><td>4:</td><td>t ~ U([e,T])</td><td></td><td>Uniform sampling between ε and T</td></tr><tr><td>5:</td><td>Xt =GRW(t,N,Xo,b,Id,P)</td><td></td><td>Approximate forward diffusion with Algorithm 1</td></tr><tr><td>6:</td><td>l(0n)=lt(T,N,Xo,Xt,loss,s0n)</td><td></td><td> Compute score matching loss from Table 2</td></tr><tr><td>7:</td><td>0n+1 =optimizer_update(0n,l(0n))</td><td></td><td>ADAM optimizer step</td></tr><tr><td>8:</td><td>end for</td><td></td><td></td></tr><tr><td>9:</td><td>0*=0Nepoch</td><td></td><td></td></tr><tr><td>10:</td><td>I/ SAMPLING /II</td><td></td><td></td></tr><tr><td>11:</td><td>Yo~pref</td><td></td><td>> Sample from uniform distribution</td></tr><tr><td>12:</td><td>b(t,x)= so*(T-t,x) for any t ∈ [0,T],x ∈M</td><td></td><td>Reverse process drift</td></tr><tr><td>13: 14:</td><td>{Y}=0=GRW(T,N,Yo,bo,d,P)</td><td>>Approximate reverse diffusion with Algorithm 1</td><td></td></tr></table>
|
| 125 |
+
|
| 126 |
+
<table><tr><td>Ingredient \Space</td><td>Euclidean</td><td>‘Generic'Manifold</td><td>Compact Manifold</td></tr><tr><td>Forward process dXt =</td><td>-Xtdt+dBM</td><td>VxU(Xt)dt+dBM</td><td>dBM</td></tr><tr><td>Easy-to-sample distribution</td><td>Gaussian</td><td>Wrapped Gaussian</td><td>Uniform</td></tr><tr><td>Time reversal</td><td>Cattiaux et al. (2021)</td><td colspan="2">Theorem 1</td></tr><tr><td>Sampling forward process</td><td>Direct</td><td colspan="2">Geodesic Random Walk (Algorithm 1)</td></tr><tr><td>Sampling backward process</td><td>Euler-Maruyama</td><td colspan="2">Geodesic Random Walk (Algorithm 1)</td></tr></table>
|
| 127 |
+
|
| 128 |
+
Parametric family of vector fields. We approximate $( \nabla \log p _ { t } ) _ { t \in [ 0 , T ] }$ by a family of functions $\{ \mathbf { s } _ { \theta } \} _ { \theta \in \Theta }$ where $\Theta$ is a set of parameters and $\mathbf { s } _ { \theta } : \ [ 0 , T ] \to \mathcal { X } ( \mathcal { M } )$ . In a Euclidean space, vector fields are simply functions $\mathbf { s } _ { \theta } : \mathbb { R } ^ { d } \mathbb { R } ^ { d }$ . In manifolds, although for any $x \in \mathcal { M }$ , $\mathrm { T } _ { x } \mathcal { M } \cong \mathbb { R } ^ { d }$ , there does not necessarily exist a set of $d$ smooth vector fields $\{ E _ { i } \} _ { i = 1 } ^ { d }$ such that span $\begin{array} { r l } { { \bigl ( \{ E _ { i } ( x ) \} _ { i = 1 } ^ { d } \bigr ) = } } \end{array}$ $\mathrm { T } _ { x } \mathcal { M }$ (Chapter 8, page 179, Lee, 2006) 9. Fortunately, one can rely on a larger set of smooth vector fields netwo $\{ E _ { i } ( x ) \} _ { i = 1 } ^ { n }$ $n > d$ at does span the tangent bundle. Theto parametrize the score network as $\mathbf { s } _ { \theta } : [ 0 , T ] \times { \mathcal { M } } \mathbb { R } ^ { n }$ $\begin{array} { r } { \mathbf { s } _ { \theta } ( t , x ) = \sum _ { i = 1 } ^ { n } \mathbf { s } _ { \theta } ^ { i } ( t , x ) E _ { i } ( x ) } \end{array}$ See App. E for a discussion on the different choices of generating sets $\{ E _ { i } ( x ) \} _ { i = 1 } ^ { n }$ .
|
| 129 |
+
|
| 130 |
+
Combining this parameterization with the score matching losses, the time-reversal formula of Theorem 1 and the sampling of forward and backward processes described in Sec. 3.3, we define our RGSM algorithm in Algorithm 2. This algorithm can also benefit from a predictor-corrector scheme as in (Song et al., 2021), see App. G.
|
| 131 |
+
|
| 132 |
+
# 4 RSGMs on compact manifolds
|
| 133 |
+
|
| 134 |
+
Assuming compactness of the manifold $\mathcal { M }$ , we can leverage a number of special properties to implement a specific case of our algorithm. In particular we benefit from the fact that on compact manifolds we have a proper uniform distribution over the manifold, and have access to a variety of approximations of the heat kernel. As highlighted in Sec. 3.1, in the compact setting we use Brownian motion as the noising SDE, which targets the uniform distribution as the stationary distribution. Table 1 highlights the main differences between RSGMs on compact manifolds, generic manifolds and Euclidean score-based models.
|
| 135 |
+
|
| 136 |
+
Heat kernel on compact Riemannian manifolds. For any $x _ { 0 } \in \mathcal { M }$ and $t \geq s \geq 0$ , the heat kernel $p _ { t | s } ( \cdot | x _ { s } )$ is defined as the density of $\mathbf { B } _ { t } ^ { \mathcal { M } }$ w.r.t. the uniform measure on the manifold.
|
| 137 |
+
|
| 138 |
+
Contrary to the Gaussian transition density of the OU process (or the Brownian motion) in the Euclidean setting, it is typically only available as an infinite series. In order to circumvent this issue we consider two techniques: i) a truncation approach, ii) a Taylor expansion around $t = 0$ called a Varadhan asymptotics. First, we recall that in the case of compact manifolds the heat kernel is given by the Sturm–Liouville decomposition (Chavel, 1984) given for any $t > 0$ and $x _ { 0 } , x _ { t } \in \mathcal { M }$ by
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\begin{array} { r } { p _ { t | 0 } ( x _ { t } | \boldsymbol { x } _ { 0 } ) = \sum _ { j \in \mathbb { N } } \mathrm { e } ^ { - \lambda _ { j } t } \phi _ { j } ( x _ { 0 } ) \phi _ { j } ( x _ { t } ) , } \end{array}
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
where the convergence occurs in $\mathrm { L } ^ { 2 } ( p _ { \mathrm { r e f } } \otimes p _ { \mathrm { r e f } } )$ , $( \lambda _ { j } ) _ { j \in \mathbb { N } }$ and $( \phi _ { j } ) _ { j \in \mathbb { N } }$ are the eigenvalues, respectively the eigenvectors, of $- \Delta _ { \mathcal { M } }$ , the Laplace-Beltrami operator in the manifold, in $\mathrm { L } ^ { 2 } ( p _ { \mathrm { r e f } } )$ (see Saloff-Coste, 1994, Section 2). When the eigenvalues and eigenvectors are known, we rely on an approximation of the logarithmic gradient of $p _ { t | 0 }$ by truncating the sum in Eq. (S8) with $J \in \mathbb N$ terms to obtain for any $t > 0$ and $x _ { 0 } , x _ { t } \in \mathcal { M }$
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
\begin{array} { r } { \nabla _ { x _ { t } } \log p _ { t | 0 } ( x _ { t } | x _ { 0 } ) \approx S _ { J , t } ( x _ { 0 } , x _ { t } ) \triangleq \nabla _ { x _ { t } } \log \sum _ { j = 0 } ^ { J } \mathrm { e } ^ { - \lambda _ { j } t } \phi _ { j } ( x _ { 0 } ) \phi _ { j } ( x _ { t } ) . } \end{array}
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
Under regularity conditions on $\mathcal { M }$ it can be shown that for any $x , y \in \mathcal { M }$ and $t ~ \geq ~ 0$ , $\begin{array} { r } { \operatorname* { l i m } _ { J \to + \infty } \bar { S } _ { J , t } ( \bar { x } _ { 0 } , x _ { t } ) = \nabla _ { x _ { t } } \log p _ { t | 0 } ( x _ { t } | x _ { 0 } ) } \end{array}$ (see Jones et al., 2008, Lemma 1). In the case of the $d$ -dimensional torus or sphere the eigenvalues and eigenvectors are computable (see Saloff-Coste, 1994, Section 2) and we can apply this method to approximate $p _ { t | 0 }$ for any $t > 0$ , see App. F
|
| 151 |
+
|
| 152 |
+
When the eigenvalues and eigenvectors are unknown or not tractable, we can still derive an approximation of the heat kernel for small times $t$ . Using Varadhan’s asymptotics—see Bismut (1984, Theorem 3.8) or Chen et al. (2021, Theorem 2.1)—for any $x , y \in { \mathcal { M } }$ with $y \not \in \operatorname { C u t } ( x )$ (where $\operatorname { C u t } ( x )$ is the cut-locus of $x$ in $\mathcal { M }$ (see Lee, 2018, Chapter 10)) we have that
|
| 153 |
+
|
| 154 |
+
$$
|
| 155 |
+
\begin{array} { r } { \operatorname* { l i m } _ { t 0 } t \nabla _ { x _ { t } } \log p _ { t | 0 } ( x _ { t } | x _ { 0 } ) = \exp _ { x _ { t } } ^ { - 1 } ( x _ { 0 } ) . } \end{array}
|
| 156 |
+
$$
|
| 157 |
+
|
| 158 |
+
Using the previously defined score-matching losses and the approximations to the heat kernel above, we highlight three methods to compute $\nabla \log p _ { t }$ in Table 2.
|
| 159 |
+
|
| 160 |
+
Table 2: Computational complexity of score matching losses w.r.t. score network forward and backward passes.
|
| 161 |
+
$\varepsilon$ is a random variable on $\mathrm { T } _ { \mathbf { X } _ { t } } \mathcal { M }$ such that $\mathbb { E } [ \varepsilon ] = 0$ and $\mathbb { E } [ \varepsilon \varepsilon ^ { \top } ] = \operatorname { I d }$ .
|
| 162 |
+
|
| 163 |
+
<table><tr><td>Loss</td><td>Approximation</td><td>Loss function</td><td>Requirements Pt10</td><td>expx</td><td>Complexity</td></tr><tr><td rowspan="3">lt1o (DSM)</td><td>None</td><td>1E[|ls(Xt)-Vlog pt|o(Xt|Xo)l2]</td><td>√</td><td>×</td><td>0(1)</td></tr><tr><td>Truncation (7)</td><td>1E[|ls(Xt)- SJ,t(Xo,Xt)|l2]</td><td>asymptotic expansion</td><td>×</td><td>0(1)</td></tr><tr><td>Varhadan (8)</td><td>1E[|ls(Xt)-expx¹(Xo)/tl|²2]</td><td>X</td><td>√</td><td>0(1)</td></tr><tr><td>lt|s (DSM)</td><td>Varhadan (8)</td><td>E[|s(Xt)-expx1(Xs)/(t-s)l²]</td><td>×</td><td>√</td><td>0(1)</td></tr><tr><td rowspan="2">ei (ISM)</td><td>Deterministic</td><td>E[¹|ls(Xt)||² + div(s)(Xt)]</td><td>×</td><td>×</td><td>O(d)</td></tr><tr><td>Stochastic</td><td>E[|s(Xt)|² +æT∂s(Xt)e]</td><td>X</td><td>X</td><td>0(1)</td></tr></table>
|
| 164 |
+
|
| 165 |
+
Convergence results in the compact setting We now provide a theoretical analysis of RSGM under the assumption that $\mathcal { M }$ is compact. The following result ensures that RSGM generates samples whose distribution is close to the data distribution $p _ { 0 }$ . Let us denote $\{ Y _ { k } \} _ { n \in \{ 0 , \dots , N \} }$ the sequence generated by Algorithm 2. This result relies on the following assumption, which is satisfied for a large class of manifolds $\mathcal { M }$ such as the $d$ -dimensional sphere and torus, compact matrix groups and products of these manifolds.
|
| 166 |
+
|
| 167 |
+
A1. There exist $C , \alpha > 0$ such that for any $t \in ( 0 , 1 ]$ and $x \in \mathcal { M }$ , $p _ { t | 0 } ( x | x ) \leq C t ^ { - \alpha / 2 }$ , where $p _ { t | 0 } ( \cdot | x _ { 0 } )$ is the density of the heat kernel, i.e. the density of $\mathbf { B } _ { t } ^ { \mathcal { M } }$ with initial condition $x _ { 0 }$ 10 .
|
| 168 |
+
|
| 169 |
+
Theorem 4. Assume A1, that $p _ { 0 }$ is smooth and positive and that there exists $\mathsf { M } \geq 0$ such that for any $t \in [ 0 , T ]$ and $x \in \mathcal { M }$ , $\| \mathbf { s } _ { \theta ^ { \star } } ( t , x ) - \nabla \log p _ { t } ( x ) \| \leq \mathtt { M } ,$ , with $\mathbf { s } _ { \theta ^ { \star } } \in \mathrm { C } ( [ 0 , T ] , \mathcal { X } ( \mathcal { M } ) )$ . Then $i f$ $T > 1 / 2$ , there exists $C \geq 0$ independent on $T$ such that
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
\mathbf { W } _ { 1 } ( \mathcal { L } ( Y _ { N } ) , p _ { 0 } ) = C ( \mathrm { e } ^ { - \lambda _ { 1 } T } + \sqrt { T / 2 } \mathsf { M } + \mathrm { e } ^ { T } \gamma ^ { 1 / 2 } ) ,
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
where $\mathbf { W } _ { 1 }$ is the Wasserstein distance of order one on the probability measures on $\mathcal { M }$
|
| 176 |
+
|
| 177 |
+
The proof is postponed to App. I. In particular, for any $\varepsilon > 0$ , choosing $T > 0$ large enough, M small enough (which can be achieved using the universal property of neural networks) and $\gamma$ small enough, we get that $\mathbf { W } _ { 1 } ( { \mathcal { L } } ( Y _ { N } ) , p _ { 0 } ) \leq \varepsilon$ . This result might seem weaker than the result obtained for Moser flows in (Rozen et al., 2021, Theorem 3), but we emphasize that our bound takes into account the time-discretization contrary to Rozen et al. (2021) which considers the continuous-time flow. If we consider the time-reversed continuous-time SDE then we recover a bound in total variation distance, see App. I. Note that the upper bound $\mathbb { M }$ encompasses both the bias introduced by the use of a neural network and the bias introduced by the use of an approximation of the score.
|
| 178 |
+
|
| 179 |
+
# 5 Related work
|
| 180 |
+
|
| 181 |
+
In this section we discuss previous work on parametrizing family of distributions for manifold-valued data. Here, the manifold structure is considered to be prescribed, in contrast with methods that jointly learn the manifold structure and density (e.g. Brehmer and Cranmer, 2020; Caterini et al., 2021).
|
| 182 |
+
|
| 183 |
+
Parametric family of distributions. The various parametric families of manifold-valued distributions that have been proposed can be categorized into three main approaches (Navarro et al., 2017): wrapping, projecting and conditioning. Wrapped distributions consider a parametric distribution on $\mathbb { R } ^ { n }$ that is pushed-forward along a surjective map $\psi : \mathbb { R } ^ { n } \to { \mathcal { M } }$ . Projected distributions are defined by marginalizing out some distribution along the normal bundle of $\mathcal { M }$ . Conditioning distributions encompass the von Mises-Fisher and Kent distributions (Fisher, 1953; Kent, 1982). Considering mixtures of these distributions is key to increase flexibility (Peel et al., 2001; Mardia et al., 2008).
|
| 184 |
+
|
| 185 |
+
Push-forward of Euclidean normalizing flows. More recently, approaches leveraging the flexibility of normalizing flows (Papamakarios et al., 2019) have been proposed. Following the wrapping method described above, these methods parametrize a normalizing flow in $\mathbb { R } ^ { n }$ before being pushed along an invertible map $\psi : \mathbb { R } ^ { n } \to { \mathcal { M } }$ . However, to globally represent the manifold, the map $\psi$ needs to be a homeomorphism, which can only happen if $\mathcal { M }$ is topologically equivalent to $\mathbb { R } ^ { n }$ , hence limiting the scope of that approach. One natural choice for this map is the exponential map $\exp _ { x } : { \mathrm { T } } _ { x } { \mathcal { M } } \tilde { \cong } \mathbb { R } ^ { d }$ This approach has been taken, for instance, by Falorsi et al. (2019) and Bose et al. (2020), respectively parametrizing distributions on Lie groups and hyperbolic space.
|
| 186 |
+
|
| 187 |
+
Neural ODE on manifolds. To avoid artifacts or numerical instabilities due to the manifold embedding, another line of work uses tools from Riemannian geometry to define flows directly on the manifold of interest (Falorsi and Forré, 2020; Mathieu and Nickel, 2020; Falorsi, 2021). Since these methods do not require a specific embedding mapping, they are referred as Riemannian. They extend continuous normalizing flows (CNFs) (Grathwohl et al., 2019) to the manifold setting, by implicity parametrizing flows as solutions of Ordinary Differential Equations (ODEs). As such, the parametric flow is a continuous function of time. This approach has recently been extended by Rozen et al. (2021) introducing Moser flows, whose main appeal being that it circumvents the need to solve an ODE in the training process. We refer to App. K for an in-depth discussion on the links between our work and Moser flows.
|
| 188 |
+
|
| 189 |
+
Optimal transport on manifolds. Another line of work has developed flows on manifolds using tools from optimal transport. Sei (2013) introduced a flow that is given by $f _ { \theta } : x \mapsto \exp _ { x } ( \nabla \psi _ { \theta } ^ { c } )$ with $\psi _ { \theta } ^ { c }$ a $c$ -convex function and $c = d _ { \mathcal { M } } ^ { 2 }$ the squared geodesic distance. This approach is motivated by the fact that the optimal transport map takes such an expression (Ambrosio, 2003). These methods operate directly on the manifold, similarly to CNFs, yet in contrast they are discrete in time. The benefits of this approach depend on the specific choice of parametric family of $c$ -convex functions (Rezende and Racanière, 2021; Cohen et al., 2021), trading-off expressivity with scalability.
|
| 190 |
+
|
| 191 |
+
Table 3: Summary of computational complexity (w.r.t. neural network forward and backward passes) for different methods. $d$ is the manifold dimension, $k$ the number of Monte Carlo batches in Moser flow’s regularizer, $N$ is the number of steps in the (adaptive) ODE solver, whereas $N ^ { * }$ is the number of steps in the SDE Euler-Maruyama solver–which can usually be lower than $N$ . Moser flow and RSGM training complexity varies if the Hutchinson stochastic estimator is used. See Table 2 for score matching losses complexity.
|
| 192 |
+
|
| 193 |
+
<table><tr><td>Method</td><td>Training</td><td>Likelihood evaluation</td><td>Sampling</td></tr><tr><td>RCNF</td><td>Solving ODE O(dN)</td><td>Solving augmented ODE O(dN)</td><td>Solving ODE O(N)</td></tr><tr><td>Moser flow</td><td>Computing div O(dk) or O(k)</td><td>Solving augmented ODE O(dN)</td><td> Solving ODE O(N)</td></tr><tr><td>RSGM</td><td>Score matching O(d) or O(1)</td><td>Solving augmented ODE O(dN)</td><td>Solving SDE O(N*)</td></tr></table>
|
| 194 |
+
|
| 195 |
+
# 6 Experiments
|
| 196 |
+
|
| 197 |
+
In this section we benchmark the empirical performance of RSGMs along with other manifold-valued methods introduced in Sec. 5. We also compare to a ‘Stereographic‘ score-based model, introduced in App. N. First, we assess their modelling capacity on earth and climate science spherical data. Then, we test the methods scalability with respect to manifold dimensions with a synthetic experiment on the torus $\mathbb { T } ^ { d }$ . Eventually, we evaluate the models’ regularity and time complexity with a synthetic $\mathrm { S O _ { 3 } ( \mathbb { R } ) }$ target. Experimental details are provided in App. O.
|
| 198 |
+
|
| 199 |
+
# 6.1 Earth and climate science datasets on the sphere
|
| 200 |
+
|
| 201 |
+
We start by evaluating RSGMs on a collection of simple datasets, each containing an empirical distribution of occurrences of earth and climate science events on the surface of the earth. These events are: volcanic eruptions (NGDC/WDS), earthquakes (NGDC/WDS), floods (Brakenridge, 2017) and wild fires (EOSDIS, 2020). We compare to previous baseline methods: Riemannian Continuous Normalizing Flows (Mathieu and Nickel, 2020), Moser Flows (Rozen et al., 2021) and a mixture of Kent distributions (Peel et al., 2001). Additionally, we consider a standard SGM on the 2D plane followed by the inverse stereographic projection which induces a density on the sphere (Gemici et al., 2016). We evaluate the log-likelihood of each model, extending to the manifold setting the likelihood computation techniques of SGMs, see App. D. We observe from Table 4, that all benchmarked methods have comparable performance when evaluated on these simple tasks with RSGM performing marginally better on most datasets. However, we empirically notice that Moser flows are slow to train and additionally that both Moser flows and stereographic SGMs are computationally expensive to evaluate.
|
| 202 |
+
|
| 203 |
+
# 6.2 Synthetic data on tori
|
| 204 |
+
|
| 205 |
+
We now move to another manifold, that is the torus $ { \mathbb { T } } ^ { d } = \mathbb { S } ^ { 1 } \times \cdots \times \mathbb { S } ^ { 1 }$ , so as to assess the scalability of the different methods with respect to the dimension $d$ . We consider a wrapped Gaussian target distribution on $\mathbb { T } ^ { d }$ with a random mean and unit variance. Moser flows’ (Rozen et al., 2021) loss involves a regularization term which involves an integral over the manifold, approximated by a Monte Carlo (MC) estimator with uniform proposal. This term regularizes Moser flows towards probability measures, i.e. with unit volume. We thus expect Moser flows to fail in high-dimension as the number of samples $K$ required for the MC estimator to be accurate will grows as $\mathcal { O } ( \mathrm { e } ^ { d } )$ , and the memory required to compute this estimator grows either in $\mathcal { O } ( K d )$ for exact divergences or $\mathcal O ( K )$ for approximated divergences (see Table 3).
|
| 206 |
+
|
| 207 |
+
Table 4: Negative log-likelihood scores for each method on the earth and climate science datasets. Bold indicates best results (up to statistical significance). Means and confidence intervals are computed over 5 different runs. Novel methods are shown with blue shading.
|
| 208 |
+
|
| 209 |
+
<table><tr><td>Method</td><td>Volcano</td><td>Earthquake</td><td>Flood</td><td>Fire</td></tr><tr><td>Mixture of Kent</td><td>-0.80±0.47</td><td>0.33±0.05</td><td>0.73±0.07</td><td>-1.18±0.06</td></tr><tr><td>Riemannian CNF</td><td>-6.05±0.61</td><td>0.14±0.23</td><td>1.11±0.19</td><td>-0.80±0.54</td></tr><tr><td>Moser Flow</td><td>-4.21±0.17</td><td>-0.16±0.06</td><td>0.57±0.10</td><td>-1.28±0.05</td></tr><tr><td>Stereographic Score-Based</td><td>-3.80±0.27</td><td>-0.19±0.05</td><td>0.59±0.07</td><td>-1.28±0.12</td></tr><tr><td>Riemannian Score-Based</td><td>-4.92±0.25</td><td>-0.19±0.07</td><td>0.45±0.17</td><td>−1.33±0.06</td></tr><tr><td>Dataset size</td><td>827</td><td>6120</td><td>4875</td><td>12809</td></tr></table>
|
| 210 |
+
|
| 211 |
+

|
| 212 |
+
Figure 2: Trained score-based generative models on earth sciences data. The learned density is colored green-blue. Blue and red dots represent training and testing datapoints, respectively.
|
| 213 |
+
|
| 214 |
+
In Fig. 3, we observe that RSGMs are able to fit well the target distribution even in high dimension, with a linear or constant computational cost—depending on the divergence estimator. In contrast, Moser flows scale poorly with the dimension, to the extent that we are unable to train them for $d \geq 1 0$ . This is due to the combination of the complexity which grows linearly with both the dimension $d$ and the number of MC samples $K$ , which itself ought to grow exponentially with $d$ —as discussed in the previous paragraph. This is illustrated by the gap between the ‘Moser’ and ‘ODE’ likelihoods which increases with the manifold dimension (see left Fig. 3).
|
| 215 |
+
|
| 216 |
+
# 6.3 Synthetic data on the Special Orthogonal group
|
| 217 |
+
|
| 218 |
+
In order to demonstrate the broad range of applicability of our model we now turn to the task of density estimation on the special orthogonal group $\operatorname { S O } _ { d } ( \mathbb { R } ) = \{ \mathrm { Q } \in \mathrm { M } _ { d } ( \mathbb { R } ) : \mathrm { Q Q } ^ { \top } = \mathrm { I d }$ , $\operatorname* { d e t } ( \mathrm { Q } ) = 1 \dot { } \dot { } \mathrm { J }$ . We consider the synthetic dataset consisting of samples in $\mathrm { S O _ { 3 } ( \mathbb { R } ) }$ from a mixture of wrapped normal distributions with $M$ components.
|
| 219 |
+
|
| 220 |
+
We compare RSGMs against Moser flows and a wrapped-exponential baseline inspired by Falorsi et al. (2019)—where we parametrize a standard Euclidean SGM on $\mathfrak { s o } ( 3 )$ that is then pushed-forward on $\mathrm { S O _ { 3 } ( \mathbb { R } ) }$ . RSGMs are trained using the $\ell _ { t \mid 0 }$ (DSM) loss with the Varadhan approximation (see Table 2). From Table 5 we observe that, RSGMs perform consistently, whether the target distribution has few or many mixture components $M$ , as opposed to Exp-wrapped SGMs and Moser flows which only perform well in some range of $M$ . Similarly to Sec. 6.2, we find Moser flows to be much slower to train due to the large number of Monte Carlo samples needed in the reguralizer $\mathcal { K } = 1 0 ^ { 4 }$ ). We also note from Table 5 that the number of score network evaluations (NFE) is significantly lower for RSGMs, and is particularly detrimental for Moser flows $\mathrm { ( \gg 1 0 ^ { 3 } }$ ).
|
| 221 |
+
|
| 222 |
+

|
| 223 |
+
Figure 3: Comparison of Moser flows and RSGMs training speed and performance on the synthetic highdimension torus task. Moser flows trained with $\lambda _ { \operatorname* { m i n } } = 1$ . We report two likelihoods, the ‘Moser’ closed form density—not guaranteed to be normalized—and the ‘ODE’ likelihood given by solving an augmented ODE (as in CNFs) with the vector field induced by the Moser flow density—which is guaranteed to have unit volume.
|
| 224 |
+
|
| 225 |
+

|
| 226 |
+
(a) Histograms of $\mathrm { S O } _ { 3 } ( \mathbb { R } )$ samples from a target mix- (b) RSGMs are much more robust to hyperparameters ture distribution with $M = 4$ components, represented than Exp-wrapped SGMs. The diffusion coefficient is via their Euler angles. given by $\sigma ( t , { \bf X } _ { t } ) = \sqrt { \beta ( t ) } .$ , $\beta ( t ) = \beta _ { 0 } + ( \beta _ { f } - \beta _ { 0 } ) t$ .
|
| 227 |
+
Figure 4: Trained score-based generative models on synthetic $\mathrm { S O } _ { 3 } ( \mathbb { R } )$ data.
|
| 228 |
+
|
| 229 |
+
Table 5: Test log-likelihood and associated number of function evaluations (NFE) in $1 0 ^ { 3 }$ on the synthetic mixture distribution with $M$ components on $\mathrm { S O } _ { 3 } ( \mathbb { R } )$ . Bold indicates best results (up to statistical significance). Means and standard deviations are computed over 5 different runs. Novel methods are shown with blue shading.
|
| 230 |
+
|
| 231 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">M=16</td><td colspan="2">M=32</td><td colspan="2">M=64</td></tr><tr><td>log-likelihood</td><td>NFE</td><td>log-likelihood</td><td>NFE</td><td>log-likelihood</td><td>NFE</td></tr><tr><td>Moser Flow</td><td>0.85±0.03</td><td>2.3±0.5</td><td>0.17±0.03</td><td>2.3±0.9</td><td>-0.49±0.02</td><td>7.3±1.4</td></tr><tr><td>Exp-wrapped SGM</td><td>0.87±0.04</td><td>0.5±0.1</td><td>0.16±0.03</td><td>0.5±0.0</td><td>-0.58±0.04</td><td>0.5±0.0</td></tr><tr><td>RSGM</td><td>0.89±0.03</td><td>0.1±0.0</td><td>0.20±0.03</td><td>0.1±0.0</td><td>-0.49±0.02</td><td>0.1±0.0</td></tr></table>
|
| 232 |
+
|
| 233 |
+
# 6.4 Synthetic data on hyperbolic space
|
| 234 |
+
|
| 235 |
+
Finally we demonstrate RSGM on a non-compact manifold: the two dimensional hyperbolic space $\mathbb { H } ^ { 2 }$ , which is defined as the simply connected space of constant negative curvature. We use Langevin dynamics as the noising process (Eq. (3)) and target a wrapped Gaussian as the invariant distribution. We again consider a synthetic dataset of samples from a mixture of exp-wrapped normal distribution. From Fig. 5, we can qualitatively see that both score-based models are able to fit the target distribution.
|
| 236 |
+
|
| 237 |
+

|
| 238 |
+
Figure 5: Samples from different probability distributions on $\mathbb { H } ^ { 2 }$ coloured w.r.t their density.
|
| 239 |
+
|
| 240 |
+
# 7 Discussion and limitations
|
| 241 |
+
|
| 242 |
+
In this paper we introduced Riemannian Score-Based Generative Models (RSGMs), a class of deep generative models that represent target densities supported on manifolds, as the time-reversal of Langevin dynamics. The main benefits of our method stems from its scalability to high dimensions, its applicability to a broad class of manifolds due to the diversity of available loss functions, its robustness and crucially its capacity to model complex datasets. We also provided theoretical guarantees on the convergence of RSGMs. In future work, we would like explore more generic classes of manifolds, such a ones with a boundary, along with alternative noising processes. Another promising extension concerns stochastic control on manifolds and more precisely, deriving efficient algorithms to solve Schrödinger bridges in the same spirit as De Bortoli et al. (2021) on Euclidean state spaces.
|
| 243 |
+
|
| 244 |
+
# Acknowledgments
|
| 245 |
+
|
| 246 |
+
We are grateful to the anonymous reviewers for their insightful comments and the for fruitful discussion more generally. We thank the geomstat team Miolane et al. (2020a). and Engineering and Physical Research Council (EPSRC) under grant EP/R013616/1. This is part of the collaboration between US DOD, UK MOD and UK EPSRC under the Multidisciplinary University Research Initiative. AD is also partially supported by the EPSRC grant EP/R034710/1 CoSines.
|
| 247 |
+
|
| 248 |
+
# References
|
| 249 |
+
|
| 250 |
+
Allgower, E. L. and Georg, K. (2012). Numerical Continuation Methods: An Introduction, volume 13. Springer Science & Business Media.
|
| 251 |
+
Ambrosio, L. (2003). Optimal transport maps in Monge-Kantorovich problem. arXiv preprint arXiv:0304389v1.
|
| 252 |
+
Atkinson, K. and Han, W. (2012). Spherical Harmonics and Approximations on the Unit Sphere: An Introduction, volume 2044. Springer Science & Business Media.
|
| 253 |
+
Bakry, D., Gentil, I., and Ledoux, M. (2014). Analysis and Geometry of Markov Diffusion Operators, volume 348. Springer.
|
| 254 |
+
Bao, F., Li, C., Zhu, J., and Zhang, B. (2022). Analytic-dpm: an analytic estimate of the optimal reverse variance in diffusion probabilistic models. arXiv preprint arXiv:2201.06503.
|
| 255 |
+
Barfoot, T., Forbes, J. R., and Furgale, P. T. (2011). Pose estimation using linearized rotations and quaternion algebra. Acta Astronautica, 68(1):101–112.
|
| 256 |
+
Batzolis, G., Stanczuk, J., Schönlieb, C.-B., and Etmann, C. (2021). Conditional image generation with score-based diffusion models. arXiv preprint arXiv:2111.13606.
|
| 257 |
+
Bismut, J.-M. (1984). Large deviations and the Malliavin calculus. Birkhauser Prog. Math., 45.
|
| 258 |
+
Bose, J., Smofsky, A., Liao, R., Panangaden, P., and Hamilton, W. (2020). Latent variable modelling with hyperbolic normalizing flows. In International Conference on Machine Learning.
|
| 259 |
+
Bradbury, J., Frostig, R., Hawkins, P., Johnson, M. J., Leary, C., Maclaurin, D., Necula, G., Paszke, A., VanderPlas, J., Wanderman-Milne, S., and Zhang, Q. (2018). JAX: composable transformations of Python+NumPy programs.
|
| 260 |
+
Brakenridge, G. (2017). Global active archive of large flood events. http://floodobservatory.colorado.edu/Archives/index.html.
|
| 261 |
+
Brehmer, J. and Cranmer, K. (2020). Flows for simultaneous manifold learning and density estimation. arXiv preprint arXiv:2003.13913.
|
| 262 |
+
Caterini, A. L., Loaiza-Ganem, G., Pleiss, G., and Cunningham, J. P. (2021). Rectangular flows for manifold learning. arXiv preprint arXiv:2106.01413.
|
| 263 |
+
Cattiaux, P., Conforti, G., Gentil, I., and Léonard, C. (2021). Time reversal of diffusion processes under a finite entropy condition. arXiv preprint arXiv:2104.07708.
|
| 264 |
+
Chavel, I. (1984). Eigenvalues in Riemannian Geometry. Academic press.
|
| 265 |
+
Chen, X., Li, X. M., and Wu, B. (2021). Logarithmic heat kernels: estimates without curvature restrictions. arXiv preprint arXiv:2106.02746.
|
| 266 |
+
Chen, Y., Georgiou, T., and Pavon, M. (2016). Entropic and displacement interpolation: a computational approach using the Hilbert metric. SIAM Journal on Applied Mathematics, 76(6):2375–2396.
|
| 267 |
+
Cheng, X., Zhang, J., and Sra, S. (2022). Theory and algorithms for diffusion processes on Riemannian manifolds. arXiv preprint arXiv:2204.13665.
|
| 268 |
+
Choi, K., Meng, C., Song, Y., and Ermon, S. (2021). Density ratio estimation via infinitesimal classification. arXiv preprint arXiv:2111.11010.
|
| 269 |
+
Chung, H., Sim, B., and Ye, J. C. (2021). Come-closer-diffuse-faster: Accelerating conditional diffusion models for inverse problems through stochastic contraction. arXiv preprint arXiv:2112.05146.
|
| 270 |
+
Cohen, S., Amos, B., and Lipman, Y. (2021). Riemannian convex potential maps. arXiv preprint arXiv:2106.10272.
|
| 271 |
+
Croke, C. B. (1980). Some isoperimetric inequalities and eigenvalue estimates. In Annales scientifiques de l’École normale supérieure, volume 13, pages 419–435.
|
| 272 |
+
De Bortoli, V., Thornton, J., Heng, J., and Doucet, A. (2021). Diffusion Schrödinger bridge with applications to score-based generative modeling. In Advances in Neural Information Processing Systems.
|
| 273 |
+
Dhariwal, P. and Nichol, A. (2021). Diffusion models beat GAN on image synthesis. arXiv preprint arXiv:2105.05233.
|
| 274 |
+
Dormand, R. J. and Prince, J. P. (1980). A family of embedded Runge-Kutta formulae. Journal of Computational and Applied Mathematics, pages 19–26.
|
| 275 |
+
Durmus, A. (2016). High Dimensional Markov Chain Monte Carlo Methods: Theory, Methods and Application. Theses, Paris-Sud XI.
|
| 276 |
+
EOSDIS (2020). Land, atmosphere near real-time capability for eos (lance) system operated by nasa’s earth science data and information system (esdis). https://earthdata.nasa.gov/earth-observationdata/near-real-time/firms/active-fire-data.
|
| 277 |
+
Falorsi, L. (2021). Continuous normalizing flows on manifolds. arXiv:2104.14959.
|
| 278 |
+
Falorsi, L., de Haan, P., Davidson, T. R., and Forré, P. (2019). Reparameterizing distributions on lie groups. In International Conference on Artificial Intelligence and Statistics, pages 3244–3253.
|
| 279 |
+
Falorsi, L. and Forré, P. (2020). Neural ordinary differential equations on manifolds. arXiv preprint arXiv:2006.06663.
|
| 280 |
+
Federer, H. (2014). Geometric Measure Theory. Springer.
|
| 281 |
+
Feiten, W., Lang, M., and Hirche, S. (2013). Rigid motion estimation using mixtures of projected Gaussians. In International Conference on Information Fusion, pages 1465–1472. IEEE.
|
| 282 |
+
Fisher, R. A. (1953). Dispersion on a sphere. Proceedings of the Royal Society of London. Series A. Mathematical and Physical Sciences, 217(1130):295–305.
|
| 283 |
+
Ganea, O.-E., Huang, X., Bunne, C., Bian, Y., Barzilay, R., Jaakkola, T. S., and Krause, A. (2022). Independent SE(3)-Equivariant models for end-to-end rigid protein docking. In International Conference on Learning Representations.
|
| 284 |
+
García-Zelada, D. and Huguet, B. (2021). Brenier–Schrödinger problem on compact manifolds with boundary. Stochastic Analysis and Applications, pages 1–29.
|
| 285 |
+
Gemici, M. C., Rezende, D., and Mohamed, S. (2016). Normalizing flows on Riemannian manifolds. arXiv preprint arXiv:1611.02304.
|
| 286 |
+
Grathwohl, W., Chen, R. T. Q., Bettencourt, J., and Duvenaud, D. (2019). Scalable reversible generative models with free-form continuous dynamics. In International Conference on Learning Representations.
|
| 287 |
+
Gretton, A., Borgwardt, K. M., Rasch, M. J., Schölkopf, B., and Smola, A. (2012). A kernel two-sample test. Journal of Machine Learning Research, 13(null):723–773.
|
| 288 |
+
Grigor’yan, A. (1999). Estimates of heat kernels on Riemannian manifolds. London Math. Soc. Lecture Note Ser, 273:140–225.
|
| 289 |
+
Gross, L. (1992). Logarithmic sobolev inequalities on lie groups. Illinois journal of mathematics, 36(3):447–490.
|
| 290 |
+
|
| 291 |
+
Gunther, M. (1991). Isometric embeddings of Riemannian manifolds, Kyoto, 1990. In Proc. Intern. Congr. Math., pages 1137–1143. Math. Soc. Japan.
|
| 292 |
+
|
| 293 |
+
Hauberg, S. (2018). Directional Statistics with the Spherical Normal Distribution. In 2018 21st International Conference on Information Fusion (FUSION), pages 704–711, Cambridge, United Kingdom. IEEE.
|
| 294 |
+
|
| 295 |
+
Haussmann, U. G. and Pardoux, E. (1986). Time reversal of diffusions. The Annals of Probability, 14(4):1188–1205.
|
| 296 |
+
|
| 297 |
+
He, Y. (2013). A lower bound for the first eigenvalue in the Laplacian operator on compact Riemannian manifolds. Journal of Geometry and Physics, 71:73–84.
|
| 298 |
+
|
| 299 |
+
Ho, J., Jain, A., and Abbeel, P. (2020). Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems.
|
| 300 |
+
|
| 301 |
+
Hou, B., Miolane, N., Khanal, B., Lee, M. C. H., Alansary, A., McDonagh, S., Hajnal, J. V., Rueckert, D., Glocker, B., and Kainz, B. (2018). Computing CNN Loss and Gradients for Pose Estimation with Riemannian Geometry. In Frangi, A. F., Schnabel, J. A., Davatzikos, C., Alberola-López, C., and Fichtinger, G., editors, Medical Image Computing and Computer Assisted Intervention – MICCAI 2018, pages 756–764, Cham. Springer International Publishing.
|
| 302 |
+
|
| 303 |
+
Hsu, E. (1999). Estimates of derivatives of the heat kernel on a compact Riemannian manifold. Proceedings of the american mathematical society, 127(12):3739–3744.
|
| 304 |
+
|
| 305 |
+
Hsu, E. P. (2002). Stochastic Analysis on Manifolds. Number 38. American Mathematical Society.
|
| 306 |
+
|
| 307 |
+
Hutchinson, M. F. (1989). A stochastic estimator of the trace of the influence matrix for laplacian smoothing splines. Communications in Statistics-Simulation and Computation, 18(3):1059–1076.
|
| 308 |
+
|
| 309 |
+
Hyvärinen, A. (2005). Estimation of non-normalized statistical models by score matching. Journal of Machine Learning Research, 6(4).
|
| 310 |
+
|
| 311 |
+
Ikeda, N. and Watanabe, S. (1989). Stochastic Differential Equations and Diffusion Processes, volume 24 of North-Holland Mathematical Library. North-Holland Publishing Co., Amsterdam; Kodansha, Ltd., Tokyo, second edition.
|
| 312 |
+
|
| 313 |
+
Jolicoeur-Martineau, A., Piché-Taillefer, R., Tachet des Combes, R., and Mitliagkas, I. (2021). Adversarial score matching and improved sampling for image generation. International Conference on Learning Representations.
|
| 314 |
+
|
| 315 |
+
Jones, P. W., Maggioni, M., and Schul, R. (2008). Manifold parametrizations by eigenfunctions of the Laplacian and heat kernels. Proceedings of the National Academy of Sciences of the United States of America, 105(6):1803–1808.
|
| 316 |
+
|
| 317 |
+
Jørgensen, E. (1975). The central limit problem for geodesic random walks. Zeitschrift für Wahrscheinlichkeitstheorie und verwandte Gebiete, 32(1-2):1–64.
|
| 318 |
+
|
| 319 |
+
Karpatne, A., Ebert-Uphoff, I., Ravela, S., Babaie, H. A., and Kumar, V. (2018). Machine learning for the geosciences: Challenges and opportunities. IEEE Transactions on Knowledge and Data Engineering, 31(8):1544–1554.
|
| 320 |
+
|
| 321 |
+
Kawar, B., Vaksman, G., and Elad, M. (2021a). Snips: Solving noisy inverse problems stochastically. arXiv preprint arXiv:2105.14951.
|
| 322 |
+
|
| 323 |
+
Kawar, B., Vaksman, G., and Elad, M. (2021b). Stochastic image denoising by sampling from the posterior distribution. arXiv preprint arXiv:2101.09552.
|
| 324 |
+
|
| 325 |
+
Kent, J. T. (1982). The Fisher-Bingham distribution on the sphere. Journal of the Royal Statistical Society: Series B (Methodological), 44(1):71–80.
|
| 326 |
+
|
| 327 |
+
Kingma, D. P. and Ba, J. (2015). Adam: A Method for Stochastic Optimization. arXiv:1412.6980 [cs].
|
| 328 |
+
|
| 329 |
+
Klimovskaia, A., Lopez-Paz, D., Bottou, L., and Nickel, M. (2020). Poincaré maps for analyzing complex hierarchies in single-cell data. Nature communications, 11(1):1–9.
|
| 330 |
+
Kloeden, P. and Platen, E. (2011). Numerical Solution of Stochastic Differential Equations. Stochastic Modelling and Applied Probability. Springer Berlin Heidelberg.
|
| 331 |
+
Köhler, J., Klein, L., and Noé, F. (2020). Equivariant Flows: Exact likelihood generative learning for symmetric densities. arXiv:2006.02425 [physics, stat].
|
| 332 |
+
Kullback, S. (1997). Information Theory and Statistics. Dover Publications, Inc., Mineola, NY. Reprint of the second (1968) edition.
|
| 333 |
+
Kurtz, T. G., Pardoux, É., and Protter, P. (1995). Stratonovich stochastic differential equations driven by general semimartingales. In Annales de l’IHP Probabilités et statistiques, volume 31, pages 351–377.
|
| 334 |
+
Kuwada, K. (2012). Convergence of time-inhomogeneous geodesic random walks and its application to coupling methods. The Annals of Probability, 40(5):1945–1979.
|
| 335 |
+
Lee, J. (2010). Introduction to Topological Manifolds, volume 202. Springer Science & Business Media.
|
| 336 |
+
Lee, J. M. (2006). Riemannian Manifolds: An Introduction to Curvature, volume 176. Springer Science & Business Media.
|
| 337 |
+
Lee, J. M. (2013). Smooth manifolds. In Introduction to Smooth Manifolds, pages 1–31. Springer.
|
| 338 |
+
Lee, J. M. (2018). Introduction to Riemannian manifolds. Springer.
|
| 339 |
+
Lee, S.-g., Kim, H., Shin, C., Tan, X., Liu, C., Meng, Q., Qin, T., Chen, W., Yoon, S., and Liu, T.-Y. (2021). Priorgrad: Improving conditional denoising diffusion models with data-driven adaptive prior. arXiv preprint arXiv:2106.06406.
|
| 340 |
+
Leobacher, G. and Steinicke, A. (2021). Existence, uniqueness and regularity of the projection onto differentiable manifolds. Annals of Global Analysis and Geometry, 60(3):559–587.
|
| 341 |
+
Léonard, C. (2012a). From the Schrödinger problem to the Monge–Kantorovich problem. Journal of Functional Analysis, 262(4):1879–1920.
|
| 342 |
+
Léonard, C. (2012b). Girsanov theory under a finite entropy condition. In Séminaire de Probabilités XLIV, pages 429–465. Springer.
|
| 343 |
+
Léonard, C., Rœlly, S., Zambrini, J.-C., et al. (2014). Reciprocal processes: a measure-theoretical point of view. Probability Surveys, 11:237–269.
|
| 344 |
+
Li, P. (1986). Large time behavior of the heat equation on complete manifolds with non-negative ricci curvature. Annals of Mathematics, 124(1):1–21.
|
| 345 |
+
Liptser, R. S. and Shiryaev, A. N. (2001). Statistics of Random Processes. I, volume 5 of Applications of Mathematics (New York). Springer-Verlag, Berlin, expanded edition. General theory, Translated from the 1974 Russian original by A. B. Aries, Stochastic Modelling and Applied Probability.
|
| 346 |
+
Lui, Y. M. (2012). Advances in matrix manifolds for computer vision. Image and Vision Computing, 30(6-7):380–388.
|
| 347 |
+
Mardia, K. V., Hughes, G., Taylor, C. C., and Singh, H. (2008). A multivariate von Mises distribution with applications to bioinformatics. Canadian Journal of Statistics, 36(1):99–109.
|
| 348 |
+
Mathieu, E., Lan, C. L., Maddison, C. J., Tomioka, R., and Teh, Y. W. (2019). Continuous hierarchical representations with Poincaré variational auto-encoders. arXiv preprint arXiv:1901.06033.
|
| 349 |
+
Mathieu, E. and Nickel, M. (2020). Riemannian continuous normalizing flows. arXiv preprint arXiv:2006.10605.
|
| 350 |
+
Miolane, N., Guigui, N., Brigant, A. L., Mathe, J., Hou, B., Thanwerdas, Y., Heyder, S., Peltre, O., Koep, N., Zaatiti, H., Hajri, H., Cabanes, Y., Gerald, T., Chauchat, P., Shewmake, C., Brooks, D., Kainz, B., Donnat, C., Holmes, S., and Pennec, X. (2020a). Geomstats: A python package for riemannian geometry in machine learning. Journal of Machine Learning Research, 21(223):1–9.
|
| 351 |
+
Miolane, N., Guigui, N., Brigant, A. L., Mathe, J., Hou, B., Thanwerdas, Y., Heyder, S., Peltre, O., Koep, N., Zaatiti, H., Hajri, H., Cabanes, Y., Gerald, T., Chauchat, P., Shewmake, C., Brooks, D., Kainz, B., Donnat, C., Holmes, S., and Pennec, X. (2020b). Geomstats: A python package for riemannian geometry in machine learning. Journal of Machine Learning Research, 21(223):1–9.
|
| 352 |
+
Navarro, A. K., Frellsen, J., and Turner, R. E. (2017). The multivariate generalised von Mises distribution: inference and applications. In AAAI Conference on Artificial Intelligence.
|
| 353 |
+
(NGDC/WDS), N. G. D. C. . W. D. S. (2022a). Ncei/wds global significant earthquake database. https://www.ncei.noaa.gov/access/metadata/landingpage/bin/iso?id $\displaystyle =$ gov.noaa.ngdc.mgg.hazards:G012153.
|
| 354 |
+
(NGDC/WDS), N. G. D. C. . W. D. S. (2022b). Ncei/wds global significant volcanic eruptions database. https://www.ncei.noaa.gov/access/metadata/landingpage/bin/iso?id $\displaystyle =$ gov.noaa.ngdc.mgg.hazards:G10147.
|
| 355 |
+
Nichol, A. and Dhariwal, P. (2021). Improved denoising diffusion probabilistic models. arXiv preprint arXiv:2102.09672.
|
| 356 |
+
Papamakarios, G., Nalisnick, E., Rezende, D. J., Mohamed, S., and Lakshminarayanan, B. (2019). Normalizing flows for probabilistic modeling and inference. arXiv preprint arXiv:1912.02762.
|
| 357 |
+
Peel, D., Whiten, W. J., and McLachlan, G. J. (2001). Fitting mixtures of Kent distributions to aid in joint set identification. Journal of the American Statistical Association, 96(453):56–63.
|
| 358 |
+
Pennec, X. (2006). Intrinsic Statistics on Riemannian Manifolds: Basic Tools for Geometric Measurements. Journal of Mathematical Imaging and Vision, 25(1):127–154.
|
| 359 |
+
Prokudin, S., Gehler, P., and Nowozin, S. (2018). Deep directional statistics: Pose estimation with uncertainty quantification. In European Conference on Computer Vision (ECCV).
|
| 360 |
+
Revuz, D. and Yor, M. (1999). Continuous Martingales and Brownian Motion, volume 293 of Grundlehren der Mathematischen Wissenschaften [Fundamental Principles of Mathematical Sciences]. Springer-Verlag, Berlin, third edition.
|
| 361 |
+
Rezende, D. J. and Racanière, S. (2021). Implicit Riemannian concave potential maps. arXiv:2110.01288.
|
| 362 |
+
Roy, D. M., Kemp, C., Mansinghka, V., and B Tenenbaum, J. (2007). Learning annotated hierarchies from relational data.
|
| 363 |
+
Rozen, N., Grover, A., Nickel, M., and Lipman, Y. (2021). Moser flow: Divergence-based generative modeling on manifolds. Advances in Neural Information Processing Systems.
|
| 364 |
+
Saloff-Coste, L. (1994). Precise estimates on the rate at which certain diffusions tend to equilibrium. Mathematische Zeitschrift, 217(1):641–677.
|
| 365 |
+
Santambrogio, F. (2017). {Euclidean, metric, and Wasserstein} gradient flows: an overview. Bulletin of Mathematical Sciences, 7(1):87–154.
|
| 366 |
+
Schrödinger, E. (1932). Sur la théorie relativiste de l’électron et l’interprétation de la mécanique quantique. Annales de l’Institut Henri Poincaré, 2(4):269–310.
|
| 367 |
+
Sei, T. (2013). A Jacobian inequality for gradient maps on the sphere and its application to directional statistics. Communications in Statistics-Theory and Methods, 42(14):2525–2542.
|
| 368 |
+
Senanayake, R. and Ramos, F. (2018). Directional grid maps: modeling multimodal angular uncertainty in dynamic environments. In 2018 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pages 3241–3248. IEEE.
|
| 369 |
+
Shapovalov, M. V. and Dunbrack Jr, R. L. (2011). A smoothed backbone-dependent rotamer library for proteins derived from adaptive kernel density estimates and regressions. Structure, 19(6):844–858.
|
| 370 |
+
Sinha, A., Song, J., Meng, C., and Ermon, S. (2021). D2c: Diffusion-denoising models for few-shot conditional generation. arXiv preprint arXiv:2106.06819.
|
| 371 |
+
Song, Y. and Ermon, S. (2019). Generative modeling by estimating gradients of the data distribution. In Advances in Neural Information Processing Systems.
|
| 372 |
+
Song, Y. and Ermon, S. (2020). Improved techniques for training score-based generative models. In Advances in Neural Information Processing Systems.
|
| 373 |
+
Song, Y., Sohl-Dickstein, J., Kingma, D. P., Kumar, A., Ermon, S., and Poole, B. (2021). Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations.
|
| 374 |
+
Steyvers, M. and Tenenbaum, J. B. (2005). The large-scale structure of semantic networks: Statistical analyses and a model of semantic growth. Cognitive science, 29(1):41–78.
|
| 375 |
+
Sun, Y., Flammarion, N., and Fazel, M. (2019). Escaping from saddle points on Riemannian manifolds. Advances in Neural Information Processing Systems, 32.
|
| 376 |
+
Urakawa, H. (2006). Convergence rates to equilibrium of the heat kernels on compact Riemannian manifolds. Indiana University Mathematics Journal, pages 259–288.
|
| 377 |
+
Vargas, F., Thodoroff, P., Lawrence, N. D., and Lamacraft, A. (2021). Solving Schrödinger bridges via maximum likelihood. arXiv preprint arXiv:2106.02081.
|
| 378 |
+
Vincent, P. (2011). A connection between score matching and denoising autoencoders. Neural Computation, 23(7):1661–1674.
|
| 379 |
+
Watson, D., Ho, J., Norouzi, M., and Chan, W. (2021). Learning to efficiently sample from diffusion probabilistic models. arXiv preprint arXiv:2106.03802.
|
| 380 |
+
|
| 381 |
+
# Checklist
|
| 382 |
+
|
| 383 |
+
1. For all authors...
|
| 384 |
+
|
| 385 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] Our main contribution is the extension of diffusion models on Riemannian manifolds.
|
| 386 |
+
(b) Did you describe the limitations of your work? [Yes] See Sec. 7.
|
| 387 |
+
(c) Did you discuss any potential negative societal impacts of your work? [No] The work presented in this paper focuses on the learning of score-based models on manifold. We do not foresee any immediate societal impact of such a study.
|
| 388 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] We have read the ethics review guidelines and our paper conforms to them.
|
| 389 |
+
|
| 390 |
+
2. If you are including theoretical results...
|
| 391 |
+
|
| 392 |
+
(a) Did you state the full set of assumptions of all theoretical results? [Yes] Yes, see A1. (b) Did you include complete proofs of all theoretical results? [Yes] Yes, proofs are postponed to the supplementary material.
|
| 393 |
+
|
| 394 |
+
3. If you ran experiments...
|
| 395 |
+
|
| 396 |
+
(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] Experimental details are given in App. O.
|
| 397 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] Experimental details are given in App. O.
|
| 398 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] Error bars are reported for each experiment.
|
| 399 |
+
|
| 400 |
+
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] Experimental details are given in App. O.
|
| 401 |
+
|
| 402 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 403 |
+
|
| 404 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] See Sec. 6.1.
|
| 405 |
+
(b) Did you mention the license of the assets? [Yes] See App. O.
|
| 406 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [No] Not applicable.
|
| 407 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [No] Not applicable.
|
| 408 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [No] Not applicable.
|
| 409 |
+
|
| 410 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 411 |
+
|
| 412 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [No] Not applicable.
|
| 413 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [No] Not applicable.
|
| 414 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [No] Not applicable.
|
md/dev/oEsYs3WRc3/oEsYs3WRc3.md
ADDED
|
@@ -0,0 +1,486 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Enhancing Chat Language Models by Scaling High-quality Instructional Conversations
|
| 2 |
+
|
| 3 |
+
Ning Ding1∗ , $\mathbf { Y u l i n } \mathbf { C h e n } ^ { 2 , 3 * }$ , Bokai $\mathbf { X } \mathbf { u } ^ { 4 }$ , Yujia $\mathbf { Q i n ^ { 2 , 3 } }$ , Shengding $\mathbf { H } \mathbf { u } ^ { 2 , 3 }$ Zhiyuan $\mathbf { L i u ^ { 2 , 3 \dag } }$ , Maosong $\mathbf { S u n ^ { 2 , 3 \dag } }$ , Bowen Zhou1† 1Department of Electronic Engineering,Tsinghua University 2Department of Computer Science and Technology, Tsinghua University 3 BNRIST, IAI, Tsinghua University, 4The Chinese University of Hong Kong, Shenzhen
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Fine-tuning on instruction data has been widely validated as an effective practice for implementing chat language models like ChatGPT. Scaling the diversity and quality of such data, although straightforward, stands a great chance of leading to improved performance. This paper aims to push the upper bound of opensource models further. We first provide a systematically designed, diverse, informative, large-scale dataset of instructional conversations, UltraChat, which does not involve human queries. Our objective is to capture the breadth of interactions between a human user and an AI assistant and employs a comprehensive framework to generate multi-turn conversation iteratively. UltraChat contains 1.5 million high-quality multi-turn dialogues and covers a wide range of topics and instructions. Our statistical analysis of UltraChat reveals its superiority in various key metrics, including scale, average length, diversity, coherence, etc., solidifying its position as a leading opensource dataset. Building upon UltraChat, we fine-tune a LLaMA model to create a powerful conversational model, UltraLM. Our evaluations indicate that UltraLM consistently outperforms other open-source models, including WizardLM and Vicuna, the previously recognized state-of-the-art open-source models.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Large language models (Bommasani et al., 2021; Han et al., 2021; Chowdhery et al., 2022) (LLMs) have demonstrated exceptional generalization capability on a variety of language-related tasks. Notably, ChatGPT (OpenAI, 2022), an optimized version of GPT-3 (Brown et al., 2020) for conversation, along with GPT-4 (OpenAI, 2023), takes the user experience to another level via excelling in comprehending and generating responses in a natural and interactive manner. The introduction of
|
| 12 |
+
|
| 13 |
+
Table 1: Average scores (1-10) across different opensource models and UltraLM. The evaluation is conducted on our curated evaluation set with GPT-4. Evaluation prompts can be found in Appendix C.
|
| 14 |
+
|
| 15 |
+
<table><tr><td>Model</td><td>Score</td></tr><tr><td>《 Dolly-v2 (Conover et al., 2023) UNA MPT-Chat (Mosaic,2023)</td><td>4.04 ± 2.34</td></tr><tr><td>□ OpenAssistant (Kopf et al., 2023)</td><td>6.67 ± 2.88 7.65 ± 2.15</td></tr><tr><td>福 Alpaca (Taori et al., 2023) 藍 Koala (Geng et al., 2023)</td><td>8.04 ± 2.05 8.23 ± 1.99</td></tr><tr><td>务 Baize (Xu et al., 2023b) T Vicuna (Chiang et al., 2023)</td><td>8.50 ± 1.34</td></tr><tr><td>S Wizard-LM (Xu et al., 2023a) UltraLM (ours)</td><td>8.78 ± 1.55 8.95 ± 1.44</td></tr></table>
|
| 16 |
+
|
| 17 |
+
ChatGPT has spurred a surge in the adoption and implementation of general chat language models.
|
| 18 |
+
|
| 19 |
+
In addition to competing models developed by large corporations such as Bard1 and Claude2, the open-source community is actively engaged in training similar models, aiming to democratize access to AI technology. Notable examples in this regard include Alpaca (Taori et al., 2023), Vicuna (Chiang et al., 2023), Koala (Geng et al., 2023), Baize (Xu et al., 2023b), and Belle (Ji et al., 2023), etc., demonstrating promising performance. Experimental evidence strongly suggests that chat language models can be effectively trained through instruction fine-tuning (Wei et al., 2021; Sanh et al., 2021), and they also indicate that many data-efficient (Zhou et al., 2023) or computingefficient (Hu et al., 2021; Ding et al., 2023) methods can be applied. This paper, in another way, focuses more on the "final one mile" of chat language models, as evidence shows that the journey from 0 to 60 is easy, whereas progressing from 60 to 100 becomes exceedingly challenging. For instance, researchers have shown that by utilizing a small, thoughtfully curated set of instructions, it is possible to train a model with satisfactory instructionfollowing capabilities. However, these approaches have yet to produce models that surpass the performance of Vicuna, the current leading open-source model, let alone outperform ChatGPT and GPT-4.
|
| 20 |
+
|
| 21 |
+
This paper believes that the most straightforward way, that is, the quality and diversity of training data, play a vital role in further improving the performance of chat language models. In other words, leveraging higher quality and more diverse data can yield better outcomes. To this end, we present UltraChat, a million-scale multi-turn instructional conversation data, to facilitate the construction of more powerful chat language models. UltraChat is carefully designed to capture the breadth of interactions that a human might have with an AI assistant. Specifically, we do not use specific tasks like question-answering or summarization to construct the data, but curate three sectors: Questions about the World, Creation and Writing, and Assistance on Existing Materials. Then we employ metainformation, in-context expansion, and iterative prompting to scale up the number of instructions. To construct informative and realistic multi-turn conversations, two separate ChatGPT Turbo APIs are adopted in the conversation generation, where one plays the role of the user to generate queries, and the other generates the response. We instruct the user model with carefully designed prompts to mimic human user behavior and call the two APIs iteratively.
|
| 22 |
+
|
| 23 |
+
We fine-tune a LLaMA-13B model on UltraChat to produce UltraLM and compare the model to a wide range of baselines, especially the opensource ones. The evaluation shows that our model could consistently outperform other models. As reported in Table 1, UltraLM achieves the highest performance scores that are independently assessed by GPT-4. Further evaluation results on challenging benchmarks and preference study with GPT-4 on various evaluation sets also show that UltraLM could surpass all other open-source models.
|
| 24 |
+
|
| 25 |
+
hibits a strong ability in instruction understanding and generalizes well to unseen instructions (Sanh et al., 2021; Ouyang et al., 2022). Later, Longpre et al. (2023) show the benefits of scaling the number of tasks in out-of-distribution generalization. Wei et al. (2021) also conclude that the success of instruction tuning depends on the quality of the dataset and the design of prompts. To further regulate the tuned model’s behavior, Ouyang et al. (2022); Schulman et al. (2017) propose to employ reinforcement learning to align model behaviors with human preferences. This technique combined with instruction tuning can further boost the model performance and has been successfully applied to LLMs such as ChatGPT.
|
| 26 |
+
|
| 27 |
+
Data Augmentation with LLMs. Collecting large-scale human-annotated instructions and their responses is time-consuming and labor-intensive. Alternatively, a more cost-effective and feasible approach to gathering top-notch data involves sampling from LLMs that have been well-tuned, e.g., ChatGPT and GPT-3.5. Recently, there is a surge of interest in distilling these powerful LLMs for data augmentation. For instance, using the technique of Self-Instruct (Wang et al., 2022), Alpaca (Taori et al., 2023) generate $\mathrm { 5 2 k }$ high-quality instruction-response pairs based on seed tasks by “distilling” Text-Davinci-003. The trained model performs almost on par with TextDavinci-003. The success of Alpaca boosts numerous later efforts on data augmentation with LLMs, such as code-alpaca (Chaudhary, 2023), alpacacot (Si et al., 2023), GPT4ALL (Anand et al., 2023), ShareGPT (Domeccleston, 2023), Dollyv2 (Conover et al., 2023), BELLE (Ji et al., 2023), Vicuna (Chiang et al., 2023), Koala (Geng et al., 2023), Baize (Xu et al., 2023b), etc. It is shown that increasing the scale of data could constantly improve the model performance. Besides, prompt engineering also affects data quality. CAMEL (Li et al., 2023a) design a multi-agent role-play environment for LLMs to simulate real human conversations.
|
| 28 |
+
|
| 29 |
+
# 2 Related Work
|
| 30 |
+
|
| 31 |
+
Instruction Tuning. Recent works demonstrate LLMs’ powerful capabilities in following human instructions. Wei et al. (2021) pioneered to finetune T5 (Raffel et al., 2020) on 60 NLP datasets verbalized with natural language instruction templates, i.e., instruction tuning. The fine-tuned model ex
|
| 32 |
+
|
| 33 |
+
# 3 Data Construction
|
| 34 |
+
|
| 35 |
+
LLMs are believed to be better annotators than human-being in many scenarios (Gilardi et al., 2023). However, employing LLMs such as ChatGPT directly for generating multi-turn conversations may yield satisfactory but less informative results, as it cannot enjoy the benefit of reinforcement learning with human feedback (RLHF) in the alignment process. Table 12 in Appendix A shows a comparison of directly generated multi-turn dialogue and a case in UltraChat with the same opening line. Two key points can be derived to ensure the quality of the data: (1) An opening line determines the topic of the dialogue. Opening lines should be highly diverse and encompass any task that a human user may request a chat model to perform. (2) A user determines the plot of the dialogue, and the output should be tailored to the current topic with diverse language styles and requests.
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 1: Construction process of UltraChat. The three sectors of data are derived from different meta-information.
|
| 39 |
+
|
| 40 |
+
Therefore, unlike traditional task-specific datasets, to construct a comprehensive opendomain instructional chat dataset, the design of data collection schema is crucial to capturing the breadth of interactions and ensuring data quality. UltraChat aims to cover a tremendous range of conversation data with a carefully designed tripartite schema: Questions about the World, Creation and Writing, and Assistance on Existing Materials. While the core of ensuring data diversity mainly depends on opening line diversity, we will first introduce the idea behind the sector design and then focus on specific measures to obtain a diverse set of opening lines and how to prompt the user properly.
|
| 41 |
+
|
| 42 |
+
# 3.1 Questions about the World
|
| 43 |
+
|
| 44 |
+
The first sector focuses on querying existing information in the world, including concepts, objects, and entities that exist in the real world. This is at the core of human-AI interaction, as users often rely on AI assistants to provide quick and accurate answers to their questions.
|
| 45 |
+
|
| 46 |
+
Our approach to gathering data for this sector involves two perspectives: one centered around topics and concepts, and the other around real-world entities. Initially, we request ChatGPT to generate 30 comprehensive topics that encompass various aspects of our daily lives, as shown in Table 2. Subsequently, we delve deeper into each topic by generating 30 to 50 subtopics or related concepts. Finally, we generate 10 different questions for each subtopic or concept and additionally request ChatGPT to generate 10 more questions based on each original question. The other source of data comes from real-world objects, which are derived from Wikidata3 entities. These entities are further refined by considering their frequencies in Wikipedia4 articles, specifically focusing on the 10,000 most frequently occurring entities. For each entity, we create 5 meta-questions, followed by 10 more specific questions and 20 extended questions. The extended questions aim to maintain some similarity to the original question while exploring distinct objects or topics. To create a dialogue, we filter and sample approximately 500,000 questions as opening lines. During the construction of each dialogue, we provide the user model with carefully crafted prompts that explicitly ask the model to respond concisely and meaningfully, taking into account the context of the ongoing dialogue history.
|
| 47 |
+
|
| 48 |
+

|
| 49 |
+
|
| 50 |
+

|
| 51 |
+
|
| 52 |
+
# 3.2 Creation and Writing
|
| 53 |
+
|
| 54 |
+
The second part is concerned with the creation of new information with human-input conditions, ranging from writing emails to crafting stories and plays. This process reflects the AI’s capacity to engage in original content generation alongside users and demonstrates the role of AI assistants as collaborative partners in a creative environment.
|
| 55 |
+
|
| 56 |
+
We first project all creations as text materials, and further categorize them into 20 different types as in Table 3. Then a ChatGPT model is employed to produce a diverse range of instructions for each type of writing, approximately $80 \%$ of which are further refined by ChatGPT model to generate more detailed instructions. These instructions serve as opening lines for dialogue generation. Throughout the generation process, the user prompt constantly reinforces the primary objective of the conversation, which is to generate and refine a piece of writing. This serves to ensure that the behavior of the user model remains focused and aligned with the intended purpose.
|
| 57 |
+
|
| 58 |
+
# 3.3 Assistance on Existing Materials
|
| 59 |
+
|
| 60 |
+
The third sector mainly addresses the modification of existing information, encompassing various tasks including rewriting, translation, summarization, and question-answering, etc. Modifying existing materials is a crucial aspect of human-AI interaction, as it allows the AI assistant to actively engage with the user’s input, transforming it in various ways as instructed by the user.
|
| 61 |
+
|
| 62 |
+
We begin by gathering text pieces from the C4 corpus5. Each piece within the C4 corpus is associated with a source URL. To ensure a diverse range of text content and styles, we adopt the 20 material types outlined in the previous section and manually curate keywords for each type. Additionally, we classify the text in the corpus by matching the keywords in the corresponding URL. In total, we collect 100,000 text pieces from the C4 corpus, and for each piece, we prompt ChatGPT to generate five distinct instructions. We use a manually designed template to combine text and instructions, as depicted in Figure 4 in the appendix. Ultimately, the concatenated set of 500,000 pieces serves as the opening lines for the generated dialogues.
|
| 63 |
+
|
| 64 |
+
# 3.4 User Simulation and Refinement
|
| 65 |
+
|
| 66 |
+
Maintaining the desired behavior of the user model is crucial for achieving successful automatic dialogue generation. It has been observed that when the user model is solely provided with the current dialogue history, it tends to assume the role of an AI assistant. This "role confounding" situation
|
| 67 |
+
|
| 68 |
+
<table><tr><td>Dataset</td><td>#Dialogue</td><td>Avg. #Turns</td><td>Avg. Dialog Length (by token)</td><td>Avg.Utt.Length (by token)</td><td>Lexical Diversity (↑)</td><td>Topic Diversity (↓)</td><td>Coherence (个)</td><td>User Simulation</td></tr><tr><td>Self-Instruct</td><td>82,439</td><td>1</td><td>69.8</td><td>29.2</td><td>24.9</td><td>0.733</td><td></td><td>No</td></tr><tr><td>Stanford Alpaca</td><td>52.002</td><td>1</td><td>91.1</td><td>64.5</td><td>42.8</td><td>0.727</td><td></td><td>No</td></tr><tr><td>SODA</td><td>1,486,869</td><td>3.6</td><td>231.8</td><td>22.5</td><td>38.6</td><td>0.797</td><td>8.48</td><td>No</td></tr><tr><td>GPT-4-LLM</td><td>61,002</td><td>1</td><td>179.6</td><td>142.9</td><td>48.9</td><td>0.721</td><td>-</td><td>No</td></tr><tr><td>BELLE</td><td>1,436,679</td><td>1</td><td>102.3</td><td>63.3</td><td>35.9</td><td>0.771</td><td>-</td><td>No</td></tr><tr><td>Baize</td><td>210,311</td><td>3.1</td><td>293.9</td><td>52.8</td><td>67.1</td><td>0.751</td><td>9.06</td><td>Yes</td></tr><tr><td>GPT4ALL</td><td>711,126</td><td>1</td><td>597.7</td><td>318.9</td><td>62.7</td><td>0.692</td><td>1</td><td>No</td></tr><tr><td>UltraChat</td><td>1,468,352</td><td>3.8</td><td>1467.4</td><td>309.3</td><td>74.3</td><td>0.702</td><td>9.06</td><td>Yes</td></tr></table>
|
| 69 |
+
|
| 70 |
+
Table 4: Statistics of existing instruction datasets. Lexical diversity is calculated by averaging the MTLD score (McCarthy and Jarvis, 2010) over each utterance with LexicalRichness6. 10000 samples are randomly drawn from each dataset for topic diversity and coherence measurement. Topic diversity is measured by averaging the cosine distance between each pair of data with OpenAI embedding API. Coherence is scored by ChatGPT on a scale of 1-10.
|
| 71 |
+
|
| 72 |
+
can significantly deteriorate the coherence of the multi-turn conversation. To address this, in addition to presenting the dialogue history, we include prompts explicitly instructing the model to adopt various user personalities. In Sector 2, a prompt is employed to remind the model of the primary purpose of the dialogue, thereby promoting a more natural conversation flow. Once the data generation process is complete, a further filtration step is performed to ensure overall data quality. We also exclude excessively polite statements to enhance the realism of user responses.
|
| 73 |
+
|
| 74 |
+
# 4 Data Analysis
|
| 75 |
+
|
| 76 |
+
# 4.1 Statistical Analysis
|
| 77 |
+
|
| 78 |
+
We conduct a statistical analysis of UltraChat and several other instruction datasets, as shown in Table 4. UltraChat stands out in terms of its scale, being one of the largest publicly available datasets. Moreover, it exhibits the highest average number of turns and the longest average length per instance of data. While SODA (Kim et al., 2023) also has many rounds, it is primarily composed of conceptual banter rather than instructional content. Additionally, the average number of tokens per dialogue in SODA is 231.8, whereas UltraChat boasts a remarkable 1467.4 tokens. To evaluate diversity, we measure both lexical diversity and topic diversity. UltraChat outperforms previous datasets in terms of lexical diversity. However, in terms of topic diversity, UltraChat falls slightly short compared to GPT4ALL (Anand et al., 2023) but still surpasses other datasets significantly. This may be attributed to the regularized embeddings resulting from a large number of tokens in each dialogue. We also conduct coherence evaluation with ChatGPT for multi-turn datasets. Notably, UltraChat and Baize data rank the highest in terms of coherence.
|
| 79 |
+
|
| 80 |
+
# 4.2 Human Assessment
|
| 81 |
+
|
| 82 |
+
Setup. To better evaluate the constructed data quality, we also conduct human assessment for UltraChat. Due to the difficulty of evaluation of multi-turn dialogue and the resulting formidable cost, we sample 500 representative dialogues for human evaluation, among which 300 are from UltraChat sector 1, 100 from sector 2 and sector 3 respectively. For each round of conversation, we ask the annotators to score the assistant’s response on Helpfulness, Honesty, and Harmlessness (3H) principles (Askell et al., 2021). We also devise Coherence and Consistency criteria for the overall multi-turn dialogue quality evaluation. Coherence evaluates whether the dialogue flows logically and coherently, for which the annotators evaluate both the user’s response and the assistant’s response. Consistency means the assistant’s responses do not contradict each other within the same dialogue. For example, it is inconsistent if the assistant asserts one specific event occurred in 1911 in the first round of conversation but mentions it as a 1901 event in the next round. Each metric is scored with 0, 0.5 or 1, where higher score means better quality. Therefore, for a K-round dialogue, we have $3 K + 2$ metric annotations.
|
| 83 |
+
|
| 84 |
+
Annotation. Each dialogue is annotated independently by two well-trained annotators, and the score is averaged across two annotators. Meanwhile, due to the difficulty in identifying the hallucination problem, we allow the annotators to skip the dialogues that require expert knowledge or whose validity is hard to check. Altogether, we collect 14560 valid annotations in terms of metrics for both single-round and multi-round, and the Cohen’s kappa coefficient is 0.358. The average time to annotate one dialogue is 10 minutes.
|
| 85 |
+
|
| 86 |
+
Results. As shown in Table 5, the dataset scores high on all metrics, showing the effectiveness of the construction process. It is worth noting that the dataset is almost free from harmful content like hate speech and discrimination. Furthermore, we observe two trade-offs between data quality. The first is between helpfulness and honesty. While the honesty score is pretty high, helpfulness is compromised. It is because some user queries are out of the LLM ability scope (e.g., ask the LLM to compose a song). Under such circumstances, the LLM refuses to answer the question with an explanation of incapability, which is reasonable and expected but less helpful. The phenomenon is particularly prominent in part 3, as the simulated user often asks for information not existent in the text material. The second trade-off is between control and dialogue naturalness. While sector 2 and sector 3 data are constructed with more guidance and control when prompting for user simulation, they have clearly lower quality in coherence and consistency than sector 1.
|
| 87 |
+
|
| 88 |
+
Table 5: Human assessment results on 500 dialogues sampled from UltraChat.
|
| 89 |
+
|
| 90 |
+
<table><tr><td>Data</td><td>Helpful</td><td>Honest</td><td>Harmless</td><td>Coherent</td><td>Consistent</td></tr><tr><td>Sector 1</td><td>0.971</td><td>0.996</td><td>1.000</td><td>0.996</td><td>0.995</td></tr><tr><td>Sector 2</td><td>0.978</td><td>0.986</td><td>1.000</td><td>0.982</td><td>0.977</td></tr><tr><td>Sector 3</td><td>0.893</td><td>0.983</td><td>1.000</td><td>0.964</td><td>0.981</td></tr><tr><td>Overall</td><td>0.960</td><td>0.992</td><td>1.000</td><td>0.987</td><td>0.988</td></tr></table>
|
| 91 |
+
|
| 92 |
+
# 5 Experiments
|
| 93 |
+
|
| 94 |
+
We developed UltraLM, an enhanced variant of the LLaMA-13B (Touvron et al., 2023) model, by training it on the UltraChat dataset. To improve the model’s comprehension of dialogue context, we break down each dialogue into smaller sequences, limiting them to a maximum length of 2048 tokens. During the training process, we only calculate the loss for the model’s responses. This approach ensured that the model had access to the relevant information from earlier parts of the conversation, enabling a more comprehensive understanding of the ongoing dialogue. By incorporating the preceding context, UltraLM was equipped to generate more contextually appropriate and coherent responses. We use standard cross-entropy loss to finetune the model. The model is trained with 128 A100 GPUs and the total batch size is 512.
|
| 95 |
+
|
| 96 |
+
The evaluation of the trained model is conducted in two folds. We first evaluate UltraLM on traditional benchmark datasets to delineate the knowledge scope and the multiple abilities of the language model. To better demonstrate the chat ability of language models, an automatic response quality evaluation is performed to showcase the model’s proficiency in delivering accurate and informative content during chat interactions. Note that UltraLM is solely trained on UltraChat dataset without further finetuning on task specific datasets.
|
| 97 |
+
|
| 98 |
+
# 5.1 Experimental Setup
|
| 99 |
+
|
| 100 |
+
Baselines.7 We mainly compare with other opensource instruction-tuned language models based on LLaMA (Touvron et al., 2023) and Pythia (Biderman et al., 2023) backbone model. The main baseline models include Alpaca (Taori et al., 2023), Vicuna (Chiang et al., 2023), Koala (Geng et al., 2023), Dolly (Conover et al., 2023), OpenAssistant (Köpf et al., 2023), and WizardLM (Xu et al., 2023a). The parameter size of the baselines ranges from 7B to 13B, which is comparable to UltraLM. Our evaluation also includes other chat language models like ChatGPT (OpenAI, 2022), MPT (Mosaic, 2023), and Baize (Xu et al., 2023b). A detailed description of the main baselines can be found in Appendix A.1.
|
| 101 |
+
|
| 102 |
+
Datasets. For benchmark evaluation, we choose four datasets: ARC-Challenge (Clark et al., 2018), HellaSwag (Zellers et al., 2019), MMLU (Hendrycks et al., 2021), and TruthfulQA (Lin et al., 2021), evaluating commonsense knowledge, professional knowledge and complex reasoning and understanding abilities. Each benchmark is constructed as multiple choice questions and therefore metrics are readily computable. The four datasets prove to be challenging even for the best-performing language models like ChatGPT.
|
| 103 |
+
|
| 104 |
+
For response quality evaluation, we use 3 datasets. We first create an evaluation set by ourselves. The curated set encompasses the Vicuna benchmark as well as an additional 300 questions and instructions generated by GPT-4. The questions/instructions covered a wide range of topics, including commonsense, world knowledge, professional knowledge (specifically physics and biology), mathematics, response generation, and writing tasks on different levels of difficulty. Apart from the curated set, we also adopt AlpacaEval (Li et al., 2023b), a widely acknowledged open-source evaluation set and leaderboard specifically designed for evaluating LLMs. The leaderboard is created based on the win-rate against Text-Davinci-003 automatically evaluated by GPT4. To further compare with the state-of-the-art model WizardLM (Xu et al., 2023a), comparison result obtained with GPT-4 on the released EvolInstruct (Xu et al., 2023a) test set is also reported. Further benchmark dataset and implementation details can be found in Appendix A.2 and A.3.
|
| 105 |
+
|
| 106 |
+
Table 6: The evaluation results on 4 challenging benchmark datasets. All evaluation and metric calculations follow EleutherAI’s lm-evaluation-harness (Gao et al., 2021). Both weighted and unweighted mean accuracy are reported for MMLU as there are 57 tasks. The overall average metric is obtained by averaging the second column data for each benchmark dataset. More details about metric calculation can be found in Appendix A.3.
|
| 107 |
+
|
| 108 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">ARC-Challenge</td><td colspan="2">HellaSwag</td><td colspan="2">MMLU</td><td colspan="2">TruthfulQA</td><td rowspan="2">Overall Average</td></tr><tr><td>Acc.</td><td>Acc. norm.</td><td>Acc.</td><td>Acc. norm.</td><td>Weighted</td><td>Unweighted</td><td>mc1</td><td>mc2</td></tr><tr><td>Dolly-12B</td><td>38.23</td><td>42.24</td><td>54.59</td><td>72.6</td><td>31.52</td><td>31.70</td><td>20.69</td><td>34.06</td><td>45.15</td></tr><tr><td>OpenAssistant-12B</td><td>41.38</td><td>45.90</td><td>52.51</td><td>70.04</td><td>29.77</td><td>30.29</td><td>24.60</td><td>39.29</td><td>46.38</td></tr><tr><td>MPT-7B</td><td>43.00</td><td>46.67</td><td>57.13</td><td>75.50</td><td>37.76</td><td>38.33</td><td>27.17</td><td>40.16</td><td>50.17</td></tr><tr><td>Alpaca-7B</td><td>49.74</td><td>52.65</td><td>58.05</td><td>76.91</td><td>42.47</td><td>42.90</td><td>25.83</td><td>39.55</td><td>53.00</td></tr><tr><td>LLaMA-13B</td><td>53.16</td><td>56.40</td><td>60.64</td><td>80.87</td><td>46.05</td><td>46.74</td><td>25.83</td><td>39.90</td><td>55.98</td></tr><tr><td>Baize-13B</td><td>55.55</td><td>57.94</td><td>59.96</td><td>80.36</td><td>48.13</td><td>49.03</td><td>32.93</td><td>47.43</td><td>58.69</td></tr><tr><td>Koala-13B</td><td>49.83</td><td>52.90</td><td>57.60</td><td>77.54</td><td>46.75</td><td>48.01</td><td>34.64</td><td>50.09</td><td>57.14</td></tr><tr><td>Vicuna-13B</td><td>51.71</td><td>52.90</td><td>60.03</td><td>80.12</td><td>50.15</td><td>50.45</td><td>35.74</td><td>51.82</td><td>58.83</td></tr><tr><td>WizardLM-13B</td><td>55.12</td><td>57.08</td><td>60.93</td><td>80.91</td><td>51.69</td><td>52.25</td><td>35.37</td><td>50.53</td><td>60.19</td></tr><tr><td>LLaMA-65B</td><td>59.22</td><td>63.31</td><td>66.40</td><td>86.05</td><td>62.29</td><td>62.97</td><td>27.91</td><td>42.55</td><td>63.72</td></tr><tr><td>UltraLM-13B</td><td>57.25</td><td>59.22</td><td>61.32</td><td>81.49</td><td>50.45</td><td>51.10</td><td>36.72</td><td>52.00</td><td>60.95</td></tr></table>
|
| 109 |
+
|
| 110 |
+
# 5.2 Benchmark Evaluation
|
| 111 |
+
|
| 112 |
+
As shown in Table 6, with pure instruction-tuning on the UltraChat dataset, UltraLM significantly improves over LLaMA-13B and achieves the best overall performance across four benchmarks. It is worth noting that UltraLM overtakes the current state-of-the-art model by nearly $2 \%$ on ARCChallenge and TruthfulQA. It shows that UltraLM is equipped with both broad and profound comprehension of the world and commonsense knowledge. The improvement could be attributed to the systematic and comprehensive data construction process of UltraChat sector 1, which effectively extends and deepens the discussion about world knowledge in automatic conversation generation. Meanwhile, the comparative inferiority in MMLU hints on the lack of professional knowledge in specific fields. It suggests the need for more advanced data generation techniques to build a specialized expert language model. As for HellaSwag, we notice that all models have only marginal improvement compared to LLaMA-13B. It is probably because HellaSwag is formatted as an in-text completion task instead of a straightforward text completion, and therefore benefits little from instruction tuning.
|
| 113 |
+
|
| 114 |
+
# 5.3 Response Quality Evaluation
|
| 115 |
+
|
| 116 |
+
Response Comparison. For our curated evaluation set, we conduct pairwise evaluation between UltraLM and each baseline model with GPT-4. Our evaluation prompt is designed to prioritize correctness over other factors such as informativeness. To mitigate the influence of presentation order of responses, we randomly determine the order of the responses for each question. Finally, we count the number of Win/Tie/Lose times against each baseline model, and the result is presented in Figure 2. UltraLM demonstrates superior performance compared to every open-source model, exhibiting an impressive winning rate of up to $98 \%$ . It is worth noting that UltraLM also outperforms Vicuna with $9 \%$ higher winning rate.
|
| 117 |
+
|
| 118 |
+
Independent Scoring. Given the instability of pairwise comparison, we also conduct independent quality scoring with GPT-4, as presented in Table 7. Notably, our model demonstrates superior performance compared to all the open-source counterparts by a significant margin in terms of overall scores. This breakdown also provides insights into the performance of each model on specific types of questions and instructions. Generally, all models perform better on simpler questions pertaining to commonsense knowledge and general world understanding. However, more complex tasks that involve reasoning and creative writing proves to be challenging for most models. Interestingly,
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
|
| 122 |
+
Figure 2: Response comparison of UltraLM with other baselines on the curated evaluation set, evaluated by GPT-4.
|
| 123 |
+
|
| 124 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">Vicuna Set</td><td colspan="2">Commonsense</td><td colspan="2">World Knowledge</td><td colspan="2">Professional Knowledge</td><td colspan="2">Ability</td><td rowspan="2">Writing</td><td rowspan="2">Overall</td></tr><tr><td>Easy</td><td>Moderate</td><td>Easy</td><td>Difficult</td><td>Physics</td><td>Biology</td><td>Math</td><td>Reasoning</td></tr><tr><td>Dolly-12B</td><td>4.75</td><td>3.50</td><td>3.93</td><td>3.10</td><td>4.13</td><td>4.87</td><td>5.47</td><td>2.70</td><td>2.03</td><td>4.51</td><td>4.04</td></tr><tr><td>MPT-7B</td><td>7.25</td><td>5.57</td><td>8.20</td><td>5.53</td><td>5.87</td><td>7.83</td><td>8.40</td><td>5.97</td><td>3.97</td><td>7.25</td><td>6.67</td></tr><tr><td>LLaMA-13B</td><td>6.85</td><td>8.43</td><td>8.43</td><td>8.57</td><td>8.50</td><td>7.90</td><td>8.40</td><td>6.97</td><td>6.73</td><td>6.79</td><td>7.49</td></tr><tr><td>OpenAssistant-12B</td><td>7.88</td><td>8.13</td><td>7.80</td><td>9.13</td><td>7.50</td><td>8.10</td><td>8.20</td><td>6.57</td><td>5.17</td><td>7.75</td><td>7.65</td></tr><tr><td>Alpaca-7B</td><td>7.58</td><td>9.17</td><td>8.83</td><td>9.30</td><td>8.73</td><td>8.13</td><td>8.80</td><td>6.70</td><td>6.27</td><td>8.05</td><td>8.04</td></tr><tr><td>Koala-13B</td><td>8.00</td><td>9.20</td><td>9.07</td><td>9.00</td><td>8.93</td><td>8.53</td><td>9.07</td><td>7.33</td><td>5.30</td><td>8.40</td><td>8.23</td></tr><tr><td>Baize-13B</td><td>8.40</td><td>9.03</td><td>9.10</td><td>9.03</td><td>8.93</td><td>8.83</td><td>8.80</td><td>7.43</td><td>8.30</td><td>8.10</td><td>8.50</td></tr><tr><td>Vicuna-13B</td><td>8.48</td><td>9.67</td><td>9.50</td><td>9.37</td><td>9.30</td><td>9.23</td><td>9.33</td><td>8.07</td><td>6.90</td><td>8.76</td><td>8.78</td></tr><tr><td>WizardLM-13B</td><td>8.55</td><td>9.70</td><td>9.30</td><td>9.57</td><td>9.50</td><td>9.27</td><td>9.53</td><td>8.27</td><td>8.20</td><td>8.83</td><td>8.95</td></tr><tr><td>ChatGPT</td><td>9.15</td><td>9.67</td><td>9.60</td><td>9.80</td><td>9.60</td><td>9.17</td><td>9.73</td><td>9.33</td><td>9.13</td><td>8.95</td><td>9.31</td></tr><tr><td>UltraLM-13B</td><td>8.98</td><td>9.70</td><td>9.50</td><td>9.47</td><td>9.40</td><td>9.27</td><td>9.87</td><td>8.77</td><td>6.80</td><td>8.90</td><td>9.00</td></tr></table>
|
| 125 |
+
|
| 126 |
+
Table 7: The independent overall scoring and segment scoring of each model on the curated evaluation set, on a scale of 1 to 10. Bold indicates the best score and underlined indicates the second best.
|
| 127 |
+
|
| 128 |
+
Alpaca, despite having only 7 billion parameters, performs comparatively well with larger models on questions related to commonsense and world knowledge. Meanwhile, Dolly and OpenAssistant, which are based on Pythia (Biderman et al., 2023), display inferior performance compared to models based on LLaMA of similar or even smaller sizes. This observation highlights the significance of the underlying backbone language model.
|
| 129 |
+
|
| 130 |
+
Table 8: Win rates against Text-Davinci-003 on AlpacaEval leaderboard. GPT-4 is used for evaluation following the official implementation (Li et al., 2023b).
|
| 131 |
+
|
| 132 |
+
<table><tr><td>Model</td><td>Win Rate (%)</td><td>Standard Error</td></tr><tr><td>GPT-4</td><td>95.28</td><td>0.72</td></tr><tr><td>Claude</td><td>88.39</td><td>1.11</td></tr><tr><td>ChatGPT</td><td>86.09</td><td>1.21</td></tr><tr><td>UltraLM-13B</td><td>76.09</td><td>1.50</td></tr><tr><td>WizardLM-13B</td><td>75.31</td><td>1.51</td></tr><tr><td>Guanaco-65B</td><td>71.80</td><td>1.59</td></tr><tr><td>Vicuna-13B</td><td>70.43</td><td>1.61</td></tr><tr><td>Oasst-RLHF-33B</td><td>66.52</td><td>1.66</td></tr><tr><td>Text Davinci 003</td><td>50.00</td><td>0.00</td></tr><tr><td>Falcon-40B-instruct</td><td>45.71</td><td>1.75</td></tr><tr><td>Alpaca-7B</td><td>26.46</td><td>1.54</td></tr></table>
|
| 133 |
+
|
| 134 |
+
AlpacaEval. As shown in Table 8, UltraLM outperforms existing models in terms of win rate on the current AlpacaEval leaderboard and ranks 4th just below ChatGPT. This observation further testifies the response quality of UltraLM and is in line with results on our curated dataset. Furthermore, a significant gap is evident between UltraLM and ChatGPT performance, highlighting the substantial effort needed for open-source models to match the capabilities of ChatGPT.
|
| 135 |
+
|
| 136 |
+
Evol-Instruct Evaluation. Figure 3 shows the automatic comparison results against WizardLM13B on Evol-Instruct test set. UltraLM overtakes WizardLM on most types of questions, with up to $29 \%$ increase in scores. It is important to acknowledge that WizardLM-13B is trained on the EvolInstruct training set, making UltraLM’s success on the test set a noteworthy achievement. Moreover, the questions observed with the largest improvement are mainly complex problems that often require synthesized abilities. It demonstrates the success of UltraChat design schema, which can comprehensively boost the versatile capabilities of language models. The inferiority in math problems is not surprising though, as no mathematical problems are intentionally generated in UltraChat.
|
| 137 |
+
|
| 138 |
+

|
| 139 |
+
Figure 3: Comparison between UltraLM and WizardLM-13B on Evol-Instruct test set. The scores are obtained by pairwise scoring with GPT-4, and WizardLM scores are considered as $100 \%$ .
|
| 140 |
+
|
| 141 |
+
Impact of System Prompts. Using system prompts to adjust the role and response style of LLMs is a common practice. Although system prompts are not embedded in UltraLM’s training data like others do (Chiang et al., 2023), they still appear to have a substantial influence on the response style of the generated output. Specifically, when the model is prompted to provide a "helpful and detailed" response, it tends to generate more pertinent details While such prompts may not improve the accuracy of an answer, they do raise overall quality with more informative response. To illustrate this effect, we conduct an ablation response comparison on UltraLM. Table 9 reveals significant improvements in response quality brought by system prompts across all tasks. We also inspect the detailed evaluation for deterministic questions (commonsense and world knowledge) and find that UltraLM without system prompt only incorrectly answers one question. Thus, the main benefit of the system prompt lies in enhanced informativeness rather than higher correctness.
|
| 142 |
+
|
| 143 |
+
Table 9: Win rate against UltraLM without system prompt on our curated dataset.
|
| 144 |
+
|
| 145 |
+
<table><tr><td>Data</td><td>Win (%)</td><td>Tie (%)</td><td>Lose(%)</td></tr><tr><td>Vicuna Set</td><td>36.3</td><td>35.0</td><td>28.8</td></tr><tr><td>Commonsense</td><td>58.6</td><td>31.0</td><td>10.3</td></tr><tr><td>World Knowledge</td><td>56.9</td><td>34.5</td><td>8.6</td></tr><tr><td>Professional Knowledge</td><td>57.8</td><td>31.1</td><td>11.1</td></tr><tr><td>Math Ability</td><td>46.7</td><td>13.3</td><td>40.0</td></tr><tr><td>Reasoning Ability</td><td>46.7</td><td>33.3</td><td>20.0</td></tr><tr><td>Writing</td><td>46.3</td><td>35.0</td><td>18.8</td></tr><tr><td>Overall</td><td>49.1</td><td>32.0</td><td>18.9</td></tr></table>
|
| 146 |
+
|
| 147 |
+
# 6 Conclusion
|
| 148 |
+
|
| 149 |
+
In drawing to a close, our work introduces UltraChat, a structured design of multi-turn instructional conversation data primed to foster the growth of general chat models. UltraChat encapsulates a broad range of human-AI interactions, further developing a series of dialogues across various topics and instructions. Statistically, UltraChat shows an impressive presence in critical metrics such as scale, average length, diversity, and consistency, further establishing itself as a leading open-source dataset. We leverage UltraChat to fine-tune the LLaMA model, leading to the development of the robust conversational model, UltraLM. Evaluation across multiple benchmarks reveals that UltraLM surpasses previous open-source models like WizardLM, Vicuna, Alpaca, and Koala in performance. We eagerly await the innovative research and development that will be catalyzed by our contributions in the field of AI conversational models.
|
| 150 |
+
|
| 151 |
+
# Limitations
|
| 152 |
+
|
| 153 |
+
Evaluating the response quality of large language models is an extremely challenging task, and any assessments may have biases. For a comprehensive evaluation, we compared UltraLM’s performance with other baselines across various benchmarks, utilizing GPT-4 to assess the response quality. Nevertheless, the need for additional, diverse evaluations remains to facilitate a more thorough understanding of our model’s behavior and performance. Despite demonstrating promising results in experimental settings, UltraLM is not immune to the common pitfalls of large language models, including hallucination issues and potential ethical concerns associated with misuse. Additionally, the energy-intensive nature of UltraLM’s training process represents a limitation, particularly when compared to models employing more efficient techniques such as parameter-efficient fine-tuning. In terms of UltraChat, it currently only contains English and there are no explicit methodologies incorporated for generating data to enhance the model’s reasoning capabilities, representing another area for potential improvement.
|
| 154 |
+
|
| 155 |
+
# Ethics Statement
|
| 156 |
+
|
| 157 |
+
While the advancements of the UltraChat dataset and UltraLM are commendable, they still face ethical challenges that exist in the area of LLMs. For the sake of privacy protection, we do not use any online or even human queries/instructions to construct UltraChat but develop a framework to build scalable, diverse instructional data. Although extensive filtering operations are conducted, biased statements may still exist within the dataset.
|
| 158 |
+
|
| 159 |
+
UltraLM, as the paper described, will be one of the most potent open-source chat language models. With great power comes increased responsibility and potential for misuse. There exists a substantial risk for the technology to be weaponized for spreading misinformation, propaganda, or even creating “deepfake” text that could mislead or manipulate public discourse. This necessitates the establishment of robust policies and comprehensive research to prevent misuse and deter malicious applications of the technology. In this regard, the model’s potential applications should be carefully evaluated for any possible negative consequences before deployment.
|
| 160 |
+
|
| 161 |
+
# Acknowledgements
|
| 162 |
+
|
| 163 |
+
This work is supported by the National Key R&D Program of China (No. 2022ZD0119101), National Natural Science Foundation of China (No. 62236004), the Young Elite Scientists Sponsorship Program by CAST, and Institute Guo Qiang at Tsinghua University.
|
| 164 |
+
|
| 165 |
+
# References
|
| 166 |
+
|
| 167 |
+
Yuvanesh Anand, Zach Nussbaum, Brandon Duderstadt, Benjamin Schmidt, and Andriy Mulyar. 2023. Gpt4all: Training an assistant-style chatbot with large scale data distillation from gpt-3.5-turbo.
|
| 168 |
+
|
| 169 |
+
Amanda Askell, Yuntao Bai, Anna Chen, Dawn Drain, Deep Ganguli, Tom Henighan, Andy Jones, Nicholas Joseph, Ben Mann, Nova DasSarma, Nelson Elhage, Zac Hatfield-Dodds, Danny Hernandez, Jackson Kernion, Kamal Ndousse, Catherine Olsson, Dario Amodei, Tom Brown, Jack Clark, Sam McCandlish, Chris Olah, and Jared Kaplan. 2021. A general language assistant as a laboratory for alignment.
|
| 170 |
+
|
| 171 |
+
Yuntao Bai, Andy Jones, Kamal Ndousse, Amanda Askell, Anna Chen, Nova DasSarma, Dawn Drain, Stanislav Fort, Deep Ganguli, Tom Henighan, et al. 2022. Training a helpful and harmless assistant with reinforcement learning from human feedback. arXiv preprint arXiv:2204.05862.
|
| 172 |
+
|
| 173 |
+
Stella Biderman, Hailey Schoelkopf, Quentin Anthony, Herbie Bradley, Kyle O’Brien, Eric Hallahan, Mohammad Aflah Khan, Shivanshu Purohit, USVSN Sai Prashanth, Edward Raff, et al. 2023. Pythia: A suite for analyzing large language models across training and scaling. arXiv preprint arXiv:2304.01373.
|
| 174 |
+
|
| 175 |
+
Rishi Bommasani, Drew A Hudson, Ehsan Adeli, Russ Altman, Simran Arora, Sydney von Arx, Michael S Bernstein, Jeannette Bohg, Antoine Bosselut, Emma Brunskill, et al. 2021. On the opportunities and risks of foundation models. arXiv preprint arXiv:2108.07258.
|
| 176 |
+
|
| 177 |
+
Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. 2020. Language models are few-shot learners. In Proceedings of NeurIPS.
|
| 178 |
+
|
| 179 |
+
Sahil Chaudhary. 2023. Code alpaca: An instructionfollowing llama model for code generation.
|
| 180 |
+
|
| 181 |
+
Wei-Lin Chiang, Zhuohan Li, Zi Lin, Ying Sheng, Zhanghao Wu, Hao Zhang, Lianmin Zheng, Siyuan Zhuang, Yonghao Zhuang, Joseph E. Gonzalez, Ion Stoica, and Eric P. Xing. 2023. Vicuna: An opensource chatbot impressing gpt-4 with $9 0 \% *$ chatgpt quality.
|
| 182 |
+
|
| 183 |
+
Aakanksha Chowdhery, Sharan Narang, Jacob Devlin, Maarten Bosma, Gaurav Mishra, Adam Roberts, Paul Barham, Hyung Won Chung, Charles Sutton, Sebastian Gehrmann, et al. 2022. Palm: Scaling language modeling with pathways. arXiv preprint arXiv:2204.02311.
|
| 184 |
+
|
| 185 |
+
Peter Clark, Isaac Cowhey, Oren Etzioni, Tushar Khot, Ashish Sabharwal, Carissa Schoenick, and Oyvind Tafjord. 2018. Think you have solved question answering? try arc, the ai2 reasoning challenge. ArXiv preprint, abs/1803.05457.
|
| 186 |
+
|
| 187 |
+
Mike Conover, Matt Hayes, Matt Mathur, Xiangrui Meng, Jianwei Xie, Jun Wan, Ali Ghodsi, Patrick Wendell, and Patrick Zaharia. 2023. Hello dolly: Democratizing the magic of chatgpt with open models.
|
| 188 |
+
|
| 189 |
+
Ning Ding, Yujia Qin, Guang Yang, Fuchao Wei, Zonghan Yang, Yusheng Su, Shengding Hu, Yulin Chen, Chi-Min Chan, Weize Chen, et al. 2023. Parameterefficient fine-tuning of large-scale pre-trained language models. Nature Machine Intelligence, pages 1–16.
|
| 190 |
+
|
| 191 |
+
Domeccleston. 2023. Sharegpt – share your wildest chatgpt conversations with one click. Retrieved 23 May 2023.
|
| 192 |
+
|
| 193 |
+
Leo Gao, Jonathan Tow, Stella Biderman, Sid Black, Anthony DiPofi, Charles Foster, Laurence Golding, Jeffrey Hsu, Kyle McDonell, Niklas Muennighoff, Jason Phang, Laria Reynolds, Eric Tang, Anish Thite,
|
| 194 |
+
|
| 195 |
+
Ben Wang, Kevin Wang, and Andy Zou. 2021. A framework for few-shot language model evaluation.
|
| 196 |
+
|
| 197 |
+
Xinyang Geng, Arnav Gudibande, Hao Liu, Eric Wallace, Pieter Abbeel, Sergey Levine, and Dawn Song. 2023. Koala: A dialogue model for academic research. Blog post.
|
| 198 |
+
|
| 199 |
+
Fabrizio Gilardi, Meysam Alizadeh, and Maël Kubli. 2023. Chatgpt outperforms crowd-workers for textannotation tasks. arXiv preprint arXiv:2303.15056.
|
| 200 |
+
|
| 201 |
+
Xu Han, Zhengyan Zhang, Ning Ding, Yuxian Gu, Xiao Liu, Yuqi Huo, Jiezhong Qiu, Liang Zhang, Wentao Han, Minlie Huang, Qin Jin, Yanyan Lan, Yang Liu, Zhiyuan Liu, Zhiwu Lu, Xipeng Qiu, Ruihua Song, Jie Tang, Ji-Rong Wen, Jinhui Yuan, Wayne Xin Zhao, and Jun Zhu. 2021. Pre-trained models: Past, present and future. AI Open.
|
| 202 |
+
|
| 203 |
+
Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. 2021. Measuring massive multitask language understanding. Proceedings of ICLR.
|
| 204 |
+
|
| 205 |
+
Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. 2021. Lora: Low-rank adaptation of large language models. In Proceedings of ICLR.
|
| 206 |
+
|
| 207 |
+
Yunjie Ji, Yong Deng, Yan Gong, Yiping Peng, Qiang Niu, Lei Zhang, Baochang Ma, and Xiangang Li. 2023. Exploring the impact of instruction data scaling on large language models: An empirical study on real-world use cases. arXiv preprint arXiv:2303.14742.
|
| 208 |
+
|
| 209 |
+
Hyunwoo Kim, Jack Hessel, Liwei Jiang, Peter West, Ximing Lu, Youngjae Yu, Pei Zhou, Ronan Le Bras, Malihe Alikhani, Gunhee Kim, Maarten Sap, and Yejin Choi. 2023. Soda: Million-scale dialogue distillation with social commonsense contextualization.
|
| 210 |
+
|
| 211 |
+
Andreas Köpf, Yannic Kilcher, Dimitri von Rütte, Sotiris Anagnostidis, Zhi-Rui Tam, Keith Stevens, Abdullah Barhoum, Nguyen Minh Duc, Oliver Stanley, Richárd Nagyfi, et al. 2023. Openassistant conversations–democratizing large language model alignment. arXiv preprint arXiv:2304.07327.
|
| 212 |
+
|
| 213 |
+
Guohao Li, Hasan Abed Al Kader Hammoud, Hani Itani, Dmitrii Khizbullin, and Bernard Ghanem. 2023a. Camel: Communicative agents for "mind" exploration of large scale language model society.
|
| 214 |
+
|
| 215 |
+
Xuechen Li, Tianyi Zhang, Yann Dubois, Rohan Taori, Ishaan Gulrajani, Carlos Guestrin, Percy Liang, and Tatsunori B. Hashimoto. 2023b. Alpacaeval: An automatic evaluator of instruction-following models.
|
| 216 |
+
|
| 217 |
+
Stephanie Lin, Jacob Hilton, and Owain Evans. 2021. Truthfulqa: Measuring how models mimic human falsehoods. arXiv preprint arXiv:2109.07958.
|
| 218 |
+
|
| 219 |
+
Shayne Longpre, Le Hou, Tu Vu, Albert Webson, Hyung Won Chung, Yi Tay, Denny Zhou, Quoc V Le, Barret Zoph, Jason Wei, et al. 2023. The flan collection: Designing data and methods for effective instruction tuning. arXiv preprint arXiv:2301.13688.
|
| 220 |
+
|
| 221 |
+
Philip M. McCarthy and Scott Jarvis. 2010. Mtld, vocdd, and hd-d: A validation study of sophisticated approaches to lexical diversity assessment. Behavior Research Methods, 42:381–392.
|
| 222 |
+
|
| 223 |
+
Mosaic. 2023. Introducing mpt-7b: A new standard for open-source, commercially usable llms.
|
| 224 |
+
|
| 225 |
+
OpenAI. 2023. Gpt-4 technical report. arXiv.
|
| 226 |
+
|
| 227 |
+
TB OpenAI. 2022. Chatgpt: Optimizing language models for dialogue. OpenAI.
|
| 228 |
+
|
| 229 |
+
Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, Luke Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul Christiano, Jan Leike, and Ryan Lowe. 2022. Training language models to follow instructions with human feedback.
|
| 230 |
+
|
| 231 |
+
Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. 2020. Exploring the limits of transfer learning with a unified text-to-text transformer. Journal of Machine Learning Research, 21(140):1–67.
|
| 232 |
+
|
| 233 |
+
Victor Sanh, Albert Webson, Colin Raffel, Stephen H Bach, Lintang Sutawika, Zaid Alyafeai, Antoine Chaffin, Arnaud Stiegler, Teven Le Scao, Arun Raja, et al. 2021. Multitask prompted training enables zeroshot task generalization. In Proceedings of ICLR.
|
| 234 |
+
|
| 235 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. 2017. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347.
|
| 236 |
+
|
| 237 |
+
Qingyi Si, Tong Wang, Naibin Gu, Rui Liu, and Zheng Lin. 2023. Alpaca-cot: An instruction fine-tuning platform with instruction data collection and unified large lnguage models interface.
|
| 238 |
+
|
| 239 |
+
Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy Liang, and Tatsunori B Hashimoto. 2023. Alpaca: A strong, replicable instruction-following model. Stanford Center for Research on Foundation Models.
|
| 240 |
+
|
| 241 |
+
Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothée Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, Aurelien Rodriguez, Armand Joulin, Edouard Grave, and Guillaume Lample. 2023. Llama: Open and efficient foundation language models.
|
| 242 |
+
|
| 243 |
+
Yizhong Wang, Yeganeh Kordi, Swaroop Mishra, Alisa Liu, Noah A. Smith, Daniel Khashabi, and Hannaneh Hajishirzi. 2022. Self-instruct: Aligning language model with self generated instructions.
|
| 244 |
+
|
| 245 |
+
Jason Wei, Maarten Bosma, Vincent Y Zhao, Kelvin Guu, Adams Wei Yu, Brian Lester, Nan Du, Andrew M Dai, and Quoc V Le. 2021. Finetuned language models are zero-shot learners. arXiv preprint arXiv:2109.01652.
|
| 246 |
+
|
| 247 |
+
Can Xu, Qingfeng Sun, Kai Zheng, Xiubo Geng, Pu Zhao, Jiazhan Feng, Chongyang Tao, and Daxin Jiang. 2023a. Wizardlm: Empowering large language models to follow complex instructions.
|
| 248 |
+
|
| 249 |
+
Canwen Xu, Daya Guo, Nan Duan, and Julian McAuley. 2023b. Baize: An open-source chat model with parameter-efficient tuning on self-chat data. arXiv preprint arXiv:2304.01196.
|
| 250 |
+
|
| 251 |
+
Rowan Zellers, Ari Holtzman, Yonatan Bisk, Ali Farhadi, and Yejin Choi. 2019. HellaSwag: Can a machine really finish your sentence? In Proceedings of ACL, pages 4791–4800.
|
| 252 |
+
|
| 253 |
+
Chunting Zhou, Pengfei Liu, Puxin Xu, Srini Iyer, Jiao Sun, Yuning Mao, Xuezhe Ma, Avia Efrat, Ping Yu, L. Yu, Susan Zhang, Gargi Ghosh, Mike Lewis, Luke Zettlemoyer, and Omer Levy. 2023. Lima: Less is more for alignment.
|
| 254 |
+
|
| 255 |
+
# A Experimental Details
|
| 256 |
+
|
| 257 |
+
# A.1 Baselines
|
| 258 |
+
|
| 259 |
+
We introduce the main open-source baseline models below.
|
| 260 |
+
|
| 261 |
+
Alpaca (Taori et al., 2023) is an instructionfollowing language model derived from the LLaMA (Touvron et al., 2023) model that has been effectively optimized on 52,000 demonstrations of instruction data. The data is generated by SelfInstruct approach with Text-Davinci-003.
|
| 262 |
+
|
| 263 |
+
Vicuna-13B (Chiang et al., 2023) is an opensourced chat model created by fine-tuning LLaMA on user-shared conversations collected from ShareGPT8. An automatic evaluation by GPT-4 demonstrates that Vicuna can yield over $90 \%$ response quality of ChatGPT. In following practices, Vicuna is widely acknowledged as the state-of-theart open-source chat model. This is evident in the Chat Arena9, where a total of 13,000 anonymous votes reveal that the quality score of vicuna-13B surpasses that of other open-source models.
|
| 264 |
+
|
| 265 |
+
Koala-13B (Geng et al., 2023) is another LLaMAbased model fine-tuned on selected public dialogues. In existing open evaluations, Koala’s performance will be slightly worse than vicuna, but it still remains a strong baseline.
|
| 266 |
+
|
| 267 |
+
Dolly-V2 (Conover et al., 2023) is based on the Pythia (Biderman et al., 2023) model, which utilizes 15k human-generated instruction-following data. The data is organized by following InstructGPT (Ouyang et al., 2022), including brainstorming, classification, closed QA, generation, information extraction, open QA, and summarization.
|
| 268 |
+
|
| 269 |
+
OpenAssistant-12B (Köpf et al., 2023) is also a Pythia-based model that attempts to democratize the alignment process of LLMs. The project collects a conversation corpus consisting of 161,443 messages distributed across 66,497 conversation trees and trains a model on these manually annotated data.
|
| 270 |
+
|
| 271 |
+
WizardLM-13B (Xu et al., 2023a) is a LLaMAbased model finetuned on Evol-Instruct dataset, which contains $2 5 0 \mathrm { k }$ instructions. The data are generated with evolutionary strategy, where the initial instructions are rewritten by ChatGPT for several epochs to increase complexity progressively.
|
| 272 |
+
|
| 273 |
+
# A.2 Evaluation Dataset
|
| 274 |
+
|
| 275 |
+
Table 11 presents the basic information of the evaluation datasets we use. Below we give a detailed description of each dataset.
|
| 276 |
+
|
| 277 |
+
The AI2 Reasoning Challenge (ARC) (Clark et al., 2018) is comprised of advanced science questions and structured as multiple-choice questions. Each question is accompanied by 4 available choices and only one answer is correct. We use the challenge partition here for evaluation, which contains 1172 test examples.
|
| 278 |
+
|
| 279 |
+
HellaSwag (Zellers et al., 2019) tests commonsense inference ability by evaluating how well the language model can predict the remaining part of a sentence. Each sample has 4 different text pieces as the candidate remaining part of a given sentence and only one of them is plausible. The task is shown to be easy for humans but challenging for language models. We use the validation split as in Gao et al. (2021).
|
| 280 |
+
|
| 281 |
+
MMLU (Hendrycks et al., 2021) is a comprehensive dataset that consists of 57 different tasks covering assessments of multiple types of academic knowledge and problem-solving ability of language models, ranging over expert fields like mathematics, history, law, etc.
|
| 282 |
+
|
| 283 |
+
TruthfulQA (Lin et al., 2021) assesses how well a model can identify true statements related to the real world. Its purpose is to determine the risks of producing false claims or spreading misinformation. The benchmark consists of questions written in various styles, covering 38 different categories, and is designed to be challenging. It includes two evaluation tasks: the multiple-choice task and the generation task. We use the multiple-choice task in the validation split as in Gao et al. (2021).
|
| 284 |
+
|
| 285 |
+
AlpacaEval (Li et al., 2023b) is a hybrid evaluation dataset with altogether 805 instructions, which combines instructions from various existing evaluation sets, including self-instruct (Wang et al., 2022), Open Assistant (Köpf et al., 2023), helpful evaluation released by Anthropic (Bai et al., 2022), Vicuna (Chiang et al., 2023), and Koala (Geng et al., 2023).
|
| 286 |
+
|
| 287 |
+
Evol-Instruct is a dataset released in $\mathrm { X u }$ et al. (2023a). It is constructed with an evolutionary strategy by rewriting the instructions through multiple rounds to obtain instructions at different complexity levels. WizardLM (Xu et al., 2023a) is trained on the training set. We evaluate our model on the test set.
|
| 288 |
+
|
| 289 |
+
Table 10: Some examples of our created evaluation set.
|
| 290 |
+
|
| 291 |
+
<table><tr><td rowspan=1 colspan=1>Type</td><td rowspan=1 colspan=1>Example</td></tr><tr><td rowspan=1 colspan=1>Commonsense- Easy</td><td rowspan=1 colspan=1>What is the primary source of energy for our planet?</td></tr><tr><td rowspan=1 colspan=1>Commonsense-Moderate</td><td rowspan=1 colspan=1>What is the phenomenon that causes the change in pitch heard when a vehicle sounding ahorn approaches and recedes from an observer?</td></tr><tr><td rowspan=1 colspan=1>World Knowledge-Easy</td><td rowspan=1 colspan=1>What is the freezing point of water in Fahrenheit?</td></tr><tr><td rowspan=1 colspan=1>World Knowledge-Moderate</td><td rowspan=1 colspan=1>What is the Godel's Incompleteness Theorem?</td></tr><tr><td rowspan=1 colspan=1>Physics Knowledge</td><td rowspan=1 colspan=1>How does quantum entanglement work and what are its implications for information transfer?</td></tr><tr><td rowspan=1 colspan=1>Biology Knowledge</td><td rowspan=1 colspan=1>What are the four main types of macromolecules found in living organisms?</td></tr><tr><td rowspan=1 colspan=1>Math</td><td rowspan=1 colspan=1>What is the Taylor series expansion of the function eα?</td></tr><tr><td rowspan=1 colspan=1>Reasoning</td><td rowspan=1 colspan=1> You have two buckets,one with red paint and one with blue paint.You take one cup fromthe red bucket and pour it into the blue bucket. Then you take one cup from the blue bucketand pour it back into the red bucket.Which is true: the red bucket has more blue paint, orthe blue bucket has more red paint?</td></tr><tr><td rowspan=1 colspan=1>Writing</td><td rowspan=1 colspan=1>Write a dialogue between two photons traveling at light speed.</td></tr></table>
|
| 292 |
+
|
| 293 |
+
Table 11: Basic information on evaluation dataset.
|
| 294 |
+
|
| 295 |
+
<table><tr><td>Dataset</td><td>#Examples</td><td>Domain</td></tr><tr><td>ARC-Challenge</td><td>1172</td><td>Grade-school</td></tr><tr><td>HellaSwag</td><td>10042</td><td>Commonsense</td></tr><tr><td>MMLU</td><td>14042</td><td>Academic</td></tr><tr><td>TruthfulQA</td><td>817</td><td>Truthfulness</td></tr><tr><td>AlpacaEval</td><td>805</td><td>Comprehensive</td></tr><tr><td>Evol-Instruct</td><td>218</td><td>Comprehensive</td></tr><tr><td>Our evaluation set</td><td>831</td><td>Comprehensive</td></tr></table>
|
| 296 |
+
|
| 297 |
+
Our evaluation set is composed of Vicuna (Chiang et al., 2023) test set and other instructions generated by GPT-4. The generated instructions are further split into different categories and difficulty levels to comprehensively evaluate the model’s ability. Table 10 shows example data for each type of question.
|
| 298 |
+
|
| 299 |
+
# A.3 Implementation Details
|
| 300 |
+
|
| 301 |
+
In benchmark evaluation, the multiple choice questions are further transformed into log-likelihood calculation over each answer candidate to determine the final prediction. Specifically, each available answer is appended to the question and fed into the language model. The model calculates logits for the answer part and derives the likelihood of the answer. The most likely answer is taken as the final prediction. Moreover, we use likelihood normalized by answer length to mitigate the bias caused by length variation. For the first 3 benchmarks, accuracy is reported for each test sample directly. For Truthful QA, since there are multiple correct answers, apart from standard accuracy (mc1), we also report the ratio of likelihood sum of correct answers over all candidate answers (the mc2 metric). In Table 6, Acc. norm. means the accuracy is computed after normalizing the likelihood with response length.
|
| 302 |
+
|
| 303 |
+
In response quality evaluation, all evaluations are done by GPT-4. Figure 5 and Figure 6 present prompts used for pairwise scoring and independent scoring on our evaluation data. As for AlpacaEval and Evol-Instruct, we follow the official prompt implementation (Li et al., 2023b; Xu et al., 2023a) to ensure a fair comparison.
|
| 304 |
+
|
| 305 |
+
Across all experiments, UltraLM is run with temperature $= 0 . 5$ , top_ $\mathrm { \tt p } { = } 0 . 9 5$ , max new token $1 { = } 2 0 0 0$ , and early stopping.
|
| 306 |
+
|
| 307 |
+
# B UltraChat Details
|
| 308 |
+
|
| 309 |
+
We present a comparison between multi-turn dialogues directly generated by ChatGPT the one in UltraChat in Table 12. Both have the same opening line. Figure 4 is the template used to concatenate text pieces from the C4 corpus and instructions generated by ChatGPT for data in UltraChat sector 3.
|
| 310 |
+
|
| 311 |
+
# C Prompts
|
| 312 |
+
|
| 313 |
+
In this section, we provide system prompt used for response generation by UltraLM (Figure 7) and prompts for automatic evaluation by GPT-4 (Figure 5 and 6).
|
| 314 |
+
|
| 315 |
+
# D UltraLM Generation Examples
|
| 316 |
+
|
| 317 |
+
In this section, we list response examples of UltraLM-13B on different instructions from our
|
| 318 |
+
|
| 319 |
+
#
|
| 320 |
+
|
| 321 |
+

|
| 322 |
+
|
| 323 |
+
Figure 4: Manually designed templates for concatenating existing materials and generated instructions.
|
| 324 |
+
|
| 325 |
+
# Comparison Evaluation Prompt
|
| 326 |
+
|
| 327 |
+
You are a helpful, harmless and precise assistant for checking the quality of the answer.
|
| 328 |
+
|
| 329 |
+
[Question]
|
| 330 |
+
|
| 331 |
+
[The Start of Assistant 1’s Answer] [The End of Assistant 1’s Answer] [The Start of Assistant 2’s Answer] [The End of Assistant 2’s Answer]
|
| 332 |
+
|
| 333 |
+
We would like to request your feedback on the performance of two AI assistants in response to the user question displayed above. Please rate the quality, helpfulness, level of details, and harmless of their responses. Each assistant receives an overall score on a scale of 1 to 10, where a higher score indicates better overall performance. Please first output a single line containing only two values indicating the scores for Assistant 1 and 2, respectively. The two scores are separated by a space. In the subsequent line, please provide a comprehensive explanation of your evaluation, avoiding any potential bias and ensuring that the order in which the responses were presented does not affect your judgment. Please avoid same scores unless they exactly in the same level.
|
| 334 |
+
|
| 335 |
+
Figure 5: Prompt for automatic comparison evaluation.
|
| 336 |
+
|
| 337 |
+
evaluation set.
|
| 338 |
+
|
| 339 |
+
# Independent Scoring Prompt
|
| 340 |
+
|
| 341 |
+
You are a helpful, harmless and precise assistant for checking the quality of the answer.
|
| 342 |
+
|
| 343 |
+
[Question]
|
| 344 |
+
|
| 345 |
+
[The Start of the AI Assistant’s Answer] [The End of the AI Assistant’s Answer]
|
| 346 |
+
|
| 347 |
+
We would like to request your feedback on the performance of the AI assistant in response to the user question displayed above. Please rate the quality, helpfulness, level of details, and harmlessness of their responses. The assistant receives an overall score on a scale of 1 to 10, where a higher score indicates better overall performance. Please output "Score: [an integer number between 1 and 10]"
|
| 348 |
+
|
| 349 |
+
# System Prompt
|
| 350 |
+
|
| 351 |
+
You are now a helpful assistant, your answer should focus on the question, give reasonable, selfconsistent, high-quality solutions to make users satisfied. Please try to make the answer more informative, detailed, and polite.
|
| 352 |
+
|
| 353 |
+
# Example A: Question of World Knowledge
|
| 354 |
+
|
| 355 |
+
User: Who discovered the law of universal gravitation?
|
| 356 |
+
|
| 357 |
+
UltraLM: The law of universal gravitation was discovered by Sir Isaac Newton in the 17th century. He formulated the law while studying the planets’ movement around the sun and realized that there was a quantifiable force directing them towards the sun. In 1687, he published his book titled "Mathematical Principles of Natural Philosophy," where he described the law of universal gravitation in detail, outlining how two objects experience an attraction towards each other due to their mass and distance between them. This discovery revolutionized our understanding of the universe and ushered in the Age of Enlightenment. Today, Newton’s law continues to form the foundation of modern astrophysics and space exploration.
|
| 358 |
+
|
| 359 |
+
# Example B: Question of World Knowledge
|
| 360 |
+
|
| 361 |
+
User: Who was the 16th President of the United States?
|
| 362 |
+
|
| 363 |
+
UltraLM: The 16th President of the United States was Abraham Lincoln. He assumed the presidency during a very tumultuous time in American history, as the nation was torn apart by the Civil War. During his presidency, he was known for his strong leadership, his commitment to the preservation of the Union, and his support for the abolition of slavery. Some of his most notable achievements include issuing the Emancipation Proclamation, which declared that all slaves in the Confederate States were free, and delivering the Gettysburg Address, an iconic speech honoring the soldiers who died in the Civil War. Lincoln is widely regarded as one of the greatest American Presidents, remembered for his unwavering leadership during a challenging period in the nation’s history.
|
| 364 |
+
|
| 365 |
+
Table 12: A comparison of two dialogues with the same opening line. The former is generated by directly querying ChatGPT to output a dialogue, and the latter is generated by iteratively User-AI simulations.
|
| 366 |
+
|
| 367 |
+
<table><tr><td rowspan=1 colspan=1>Direct Generation</td></tr><tr><td rowspan=1 colspan=1>What are some of the health benefits and risks of drinking coffee,and how can one maximize the formerand minimize the latter?</td></tr><tr><td rowspan=1 colspan=1>There are several potential health benefits associated with drinking coffee,such as increased alertness, improved mood,and a reduced risk of certain diseases,including type 2 diabetes and liver cancer. However,there are also some potential risks, such as increased anxiety, disrupted sleep,and negative effects on thedigestive system. To maximize the benefits and minimize the risks,it's important to consume coffee inmoderation and pay attention to how it affects your body.</td></tr><tr><td rowspan=1 colspan=1>How much coffee is considered moderate?</td></tr><tr><td rowspan=1 colspan=1>The definition of moderate coffee consumption can vary depending on the individual and other factors such as age,gender,and health status. However,in general, moderate coffee consumption is considered tobe around 3-5 cups per day, or up to 40 millgrams ofcaffeine per day. It's important to note that some people may be more sensitive to caffeine than others,so it's important to pay attention to how your body reacts and adjust your consumption accordingly.</td></tr><tr><td rowspan=1 colspan=1>UltraChat</td></tr><tr><td rowspan=1 colspan=1>What are some of the health benefits and risks of drinking coffee,and how can one maximize the formerand minimize the latter?</td></tr><tr><td rowspan=1 colspan=1>There are several health benefits and risks associated with drinking coffee. Here are some of them: Healthbenefits:1. Lower risk of type 2 diabetes: Studies have shown that consuming coffee can lower the riskof developing type 2 diabetes.2. Improved cognitive function: Coffee is a stimulant that helps improvecognitive function, including alertness, concentration,and memory.3. Lower risk of depression: Studieshave shown that drinking coffee can reduce the risk of developing depression.4. Lower risk of certaincancers: According to research, coffee consumption can lower the risk of certain cancers, including liverand colorectal cancer.5. Reduced risk of heart disease: There is evidence that drinking moderate amountsof coffee can lower the risk of heart disease.Risks:1. Insomnia: Drinking too much coffee, especiallylate in the day,can cause insomnia.2. Increased risk of anxiety: Caffeine can increase anxiety levels in some people.3. Digestive issues: Drinking too much cofee can cause digestive problems like acid reflux,diarrhea, and ulcers.4. Increased heart rate: Caeine can increase heart rate, which can be dangerousfor people with pre-existing heart conditions.5.Addiction: Regular consumption of caffeine can lead toaddiction.To maximize the health benefits and minimize the risks of drinking coffee, here are a few tips:1.Limit your caffeine intake to no more than 40O milligrams per day, or about 4 cups of coffee.2. Avoiddrinking coffee late in the day, especially if you have trouble sleeping.3. Opt for organic, pesticide-freecoffee to minimize exposure to toxins.4. Add cinnamon to your cofee instead of sugar to help regulateblood sugar levels.5. Drink your coffee black or with a smallamount of milk to avoid consuming excessive sugar and calories.6. Consider switching to decaf cofee if you want to cut back on cafeine. 7. Avoiddrinking coffee on an empty stomach as it can increase the risk of digestive problems.</td></tr></table>
|
| 368 |
+
|
| 369 |
+
If you love your morning coffee but find that it’s making you feel jittery, here are a few tips to help you avoid this:1. Choose a lower-caffeine coffee: Look for coffee that has less caffeine, like decaf or a blend with a lower percentage of caffeine.2. Don’t drink coffee on an empty stomach: Drinking coffee on an empty stomach can cause your blood sugar levels to drop, which can make you feel jittery. Try drinking your coffee with breakfast or after eating something.3. Drink water with your coffee: Stay hydrated by drinking water before or after your coffee. Drinking water will help flush out the caffeine quicker, which can help you avoid jitteriness.4. Don’t drink too much coffee: Stick to one or two cups of coffee per day. Anything more than that could result in increased caffeine consumption, which can cause jitteriness.5. Switch to tea: Tea contains less caffeine than coffee, making it a good alternative if you want to avoid jitteriness. Try green tea, which has less caffeine and offers other health benefits.
|
| 370 |
+
|
| 371 |
+
Example C: Question of Common Knowledge
|
| 372 |
+
|
| 373 |
+
User: Which animal is known as man’s best friend?
|
| 374 |
+
|
| 375 |
+
UltraLM: There are many animals that humans enjoy as companion animals, but one of the absolute standout answers to the question "which animal is known as a man’s best friend?" is the domestically-bred dog. Domesticated dogs have been by humans’ sides for tens of thousands of years, providing faithful companionship and help; guarding people and property; and lending emotional support in everything from long, lonely days to military deployments. Dogs come in an almost mind-boggling variety of breeds of various sizes, with different energy levels, personalities, and temperaments, meaning there’s almost certainly a pup out there who will be a perfect fit for whoever needs it most.
|
| 376 |
+
|
| 377 |
+
# Example D: Commonsense Reasoning
|
| 378 |
+
|
| 379 |
+
User: Which weighs more: a pound of feathers or a pound of bricks?
|
| 380 |
+
|
| 381 |
+
UltraLM: A pound of feathers and a pound of bricks both weigh exactly one pound. This is because one pound is a unit of weight, just as a foot is a unit of length or a second is a unit of time. We use the pound (or other unit of weight) to describe the weight of different objects, regardless of what that object is made of. So the answer to your question is that a pound of feathers and a pound of bricks both weigh the same amount.
|
| 382 |
+
|
| 383 |
+
# Example E: Reasoning
|
| 384 |
+
|
| 385 |
+
User: "If a farmer has 17 sheep and all but 9 die, how many are left?
|
| 386 |
+
|
| 387 |
+
UltraLM: The total number of sheep that are left is 9.
|
| 388 |
+
|
| 389 |
+
# Example F: Reasoning
|
| 390 |
+
|
| 391 |
+
User: If a red house is made from red bricks, and a blue house is made from blue bricks, what is a greenhouse made from?
|
| 392 |
+
|
| 393 |
+
UltraLM: A greenhouse is not made from green bricks, but rather from materials such as glass or plastic that allow light to pass through and create a controlled environment for plants to grow. Greenhouses can come in a variety of colors, including green, but the color of the building itself does not affect the plants growing inside.
|
| 394 |
+
|
| 395 |
+
# Example G: Creative Generation
|
| 396 |
+
|
| 397 |
+
User: Write a short dialogue between two planets.
|
| 398 |
+
|
| 399 |
+
UltraLM:
|
| 400 |
+
|
| 401 |
+
Mars: "Hey there Neptune, how’s it going?"
|
| 402 |
+
|
| 403 |
+
Neptune: "Hi there Mars, I’ve been better. It’s getting a bit windy around here."
|
| 404 |
+
|
| 405 |
+
Mars: "Sorry to hear that. Have you tried using energy other than wind? Maybe solar power?
|
| 406 |
+
|
| 407 |
+
Neptune: "Yeah, but it’s getting difficult to generate solar power in all of this mist and clouds.
|
| 408 |
+
|
| 409 |
+
we definitely can’t use tides or waves here, they’re too unpredictable."
|
| 410 |
+
|
| 411 |
+
Mars: "Oh, I see. Well, I hope you find a solution soon. How are your oceans holding up?"
|
| 412 |
+
|
| 413 |
+
Neptune: "They’ve been a bit choppy lately with these intense storms we’ve been experiencing. But I guess it comes with living in a planet like this."
|
| 414 |
+
|
| 415 |
+
Mars: " Definitely not designed for the faint-hearted! Any other issues you’re facing?"
|
| 416 |
+
|
| 417 |
+
Neptune: "Not really. I think we have a stable temperature and atmosphere, and the wildlife here hasn’t shown much complaint."
|
| 418 |
+
|
| 419 |
+
Mars: "That’s lucky. I envy your tranquil oceans, we’ve had way too much volcanic activity lately causing all sorts of disturbance in our lava streams."
|
| 420 |
+
|
| 421 |
+
Neptune: "That sounds rough, better invest in those climate-controlling nanites to stabilize things maybe?"
|
| 422 |
+
|
| 423 |
+
Mars "Ha-ha, very funny. Just like we also could consider your frozen polar regions as an opportunity to experiment with our frost nanobots on."
|
| 424 |
+
|
| 425 |
+
Neptune: "A fun concept! But let’s stick to the task at hand, if you need any technical advice, come right ahead, I don’t want your planet getting any more disturbed than it already is.
|
| 426 |
+
|
| 427 |
+
# Example H: Creative Generation
|
| 428 |
+
|
| 429 |
+
User: Pretend to be a character in a post-apocalyptic world. Describe how you survive and the allies you encounter.
|
| 430 |
+
|
| 431 |
+
UltraLM: As a survivor in a post-apocalyptic world, I have learned to be resourceful, alert, and adaptable. I have had to rely on my wits and my instincts to survive, and I have been fortunate enough to encounter many allies who have helped me along the way.One of my greatest survival tools has been my ability to scavenge for resources. I have learned to identify the best places to find food, water, and shelter, and I have become skilled at navigating the rough terrain that makes up my new world. When I first emerged from my bunker after the apocalypse hit, I was alone and unsure of what to do. But as I ventured out into the wasteland, I realized that there were others like me who were struggling to survive.I quickly learned to Trust my instincts and to be constantly alert for potential dangers. I have encountered wild animals, rogue survivors, and even mutated creatures over the years, and I have learned to defend myself against them. I still remember the first time I met a group of fellow survivors, and how grateful I was to have them by my side. We quickly formed a cohesive unit, and together we were able to fend off danger and defend our territory.As time passed, I encountered more and more allies who were willing to lend a hand. I found a group of farmers who taught me how to grow my own food, and a group of scientists who were working to find a cure for the lethal virus that had decimated the population. I even found a band of traveling performers who helped to lift our spirits and remind us that there was still joy to be found in this desolate world. Despite the challenges we faced, I am grateful to have these amazing people in my life. They have taught me that even in the darkest of times, there is always hope. We may not have a cure for the virus yet, but we are a determined lot, and we are all in this together. As long as we have each other, we will survive.
|
| 432 |
+
|
| 433 |
+
# Example I: Creative Generation
|
| 434 |
+
|
| 435 |
+
<table><tr><td>User: Write a poem about electromagnetism. UltraLM: Electromagnetism is a force we can't ignore, It's the reason for many things we adore. In a magnetic field, a wire will glow,</td></tr><tr><td>And the electrons will align, both old and new. Electricity and magnetism are hand in hand, One createsa field, the other hasa brand. On a wire with current, it will react in full.</td></tr><tr><td>The magnetic field can push and pull, The attraction and repulsion it brings, Are the reason for many things. From motors to generators,and much more in between,</td></tr></table>
|
| 436 |
+
|
| 437 |
+
# Example J: Literature Creation
|
| 438 |
+
|
| 439 |
+
User: Write a short story about the first second of the universe.
|
| 440 |
+
|
| 441 |
+
UltraLM: In the first second of the universe, darkness reigned supreme. There was no light, no sound, no shape, no substance. Nothing yet was, but there was an intense power, a raw energy waiting to be unleashed. Within infinity, the first second held the potential for creation in its grasp. And then, with a mighty bang, a bright point of light emerged into existence. In it, the most fundamental particles were born, their forms yet unknown as they frenetically collided in a chaotic dance of creation. Within this primordial light, every force of nature and every component of life was stirred from pure energy to physical reality. The first atoms quickly assembled, and from these, stars and galaxies began to form. Their fusion creating a hot environment that pushed back the very void, shaping the cosmos through expanding and cooling waves. In this cosmic first, no structure of experience, not even time or space, could establish its rule. For an instant, the entirety of the universe existed in an embryonic nexus, a cosmic singularity from which all future existence originated. It was a microcosm forging the macrocosm of which it ultimately becomes a part, its moment of birth a metaphor for the cycles of creation that permeate the multiverse(s).From that single point of light, an infinite universe unfolded. For centuries, eons ahead, and forevermore, it remained the most foundational blink of its unceasing journey into the depths of the Great Beyond. The first second is the beginning of everything.
|
| 442 |
+
|
| 443 |
+
# Example K: Professional Knowledge
|
| 444 |
+
|
| 445 |
+
User: How does superconductivity work and what are its practical applications?
|
| 446 |
+
|
| 447 |
+
UltraLM: Superconductivity is a phenomenon that allows materials to conduct electricity without resistance at extremely low temperatures. At low temperatures, the interaction between the particles in a superconducting material can produce a state called the "Bose-Einstein condensate," which leads to the loss of electrical resistance. In materials, superconductivity comes when a magnetic force interacts with an Electronic current. This interplay in turn provides energy savings and speeds up current. Practical applications mainly include MRI machines, high-speed trains, magnetic levitation, supercharging power grids that can transfer energy more efficiently.One of the main applications of Superconductivity is being used in the Magnetic Resonance Imaging(MRI) machines used in hospitals around the world, to non-invasively scan patients for health diagnosis without exposing them to high levels of radiation. Another important practical application of superconductivity is in power grid operations where large currents can be transmitted to long distances by highly superconducting coil systems that minimize grid energy losses, reducing environmental pollution also by highly efficient electric motors that harness large quantities of electricity efficiently.Aside from these, future projects include superconducting propulsion on planes, trains becoming lighter if not magnetic and able to move on rails with a significant increase in speed. Furthermore, the prospects of supercapacitors replacing electric vehicle batteries being cost and energy efficient are currently being researched. Overall, superconductivity presents various exciting opportunities in multiple industries from high-precision engineering to reducing CO2 emissions and supporting a more environmentally friendly energy model where both cost efficiency and practicality exist hand in hand.
|
| 448 |
+
|
| 449 |
+
User: "What is the definition of a limit in calculus?
|
| 450 |
+
|
| 451 |
+
UltraLM: In calculus, a limit is a value that a function approaches as its input approaches a certain value. The limit is a measure of how close the function is to that value. In other words, a limit is the value that a function “approaches" as its input gets “closer and closer" to a certain value. For example, consider the function $\textstyle f ( x ) = { \frac { 1 } { x } }$ . As $x$ approaches 0, the function “approaches" $+ \infty$ , and the limit of the function as $x$ approaches 0 is $+ \infty$ .
|
| 452 |
+
Formally, we can define the limit of a function $f ( x )$ as $x$ approaches a certain value $c$ as $\begin{array} { r } { \operatorname* { l i m } _ { x \to c } f ( x ) = L } \end{array}$ , where $L$ is a real number. If the limit exists, we say that the function has a limit at $c$ and the value of the limit is $L$ . If the limit does not exist, we say that the function has a removable discontinuity at $c$ .
|
| 453 |
+
|
| 454 |
+
# Example M: Professional Knowledge
|
| 455 |
+
|
| 456 |
+
User: What are the main interpretations of quantum mechanics and how do they differ?
|
| 457 |
+
|
| 458 |
+
UltraLM: Quantum mechanics is a fundamental theory in physics that describes the behavior of matter and energy at the smallest scales of space and time. There are several interpretations of quantum mechanics, each with its own set of assumptions and predictions about how the world works. Here are some of the main interpretations of quantum mechanics and how they differ:
|
| 459 |
+
|
| 460 |
+
1. Copenhagen Interpretation: This is the most widely accepted interpretation of quantum mechanics. It states that until a measurement is made, a system exists in a superposition of states, representing all possible outcomes with equal probability. When a measurement is made, the system collapses into a single, definite state. This interpretation assumes that the act of measurement itself causes the system to collapse into a definite state, and that there is no objective reality until a measurement is made.
|
| 461 |
+
|
| 462 |
+
2. Many-Worlds Interpretation: This interpretation proposes that every possible outcome of a superposition of states actually occurs in a multiverse of parallel universes. Thus, when a measurement is made, the system splits into different universes, each corresponding to one of the possible outcomes. This interpretation assumes that all possibilities are realized, but only in different universes, and that the act of measurement does not cause the collapse of the wave function.
|
| 463 |
+
|
| 464 |
+
3. Bohmian Mechanics: This interpretation proposes that particles have a definite position in space, even when in a superposition of states. It suggests that the wave function guides the motion of particles, and that the act of measurement does not cause a collapse of the wave function, but merely provides information about the pre-existing reality.
|
| 465 |
+
|
| 466 |
+
4. de Broglie-Bohm Theory: This interpretation is very similar to Bohmian Mechanics, but it also assumes that all particles in the universe are connected by a hidden-variable, and that the motion of one particle determines the motion of all other particles.
|
| 467 |
+
|
| 468 |
+
5. Pilot-Wave Theory: This interpretation proposes that particles have a wave-like property that guides their motion through space. It assumes that the wave function does not collapse, but rather that the wave guides the motion of particles.
|
| 469 |
+
|
| 470 |
+
In conclusion, there are several interpretations of quantum mechanics, each with its own set of assumptions and predictions about how the world works. While they all attempt to describe the behavior of matter and energy at the smallest scales of space and time, they differ in their assumptions about the role of the observer, the nature of reality, and the collapse of the wave function.
|
| 471 |
+
|
| 472 |
+
User: How can you determine if a person is genuinely interested in a conversation or simply being polite?
|
| 473 |
+
|
| 474 |
+
UltraLM: As an AI language model, I don’t have personal experience, but there are a few signs you can look out for to determine if a person is genuinely interested in a conversation or simply being polite.
|
| 475 |
+
|
| 476 |
+
1. Eye contact: Genuine interest in a conversation often shows in the form of consistently maintaining eye contact. If a person is not making eye contact or is looking away frequently, they may not be genuinely interested in the conversation.
|
| 477 |
+
|
| 478 |
+
2. Active listening: A person who is genuinely interested in a conversation will show it through active listening. They will be attentive, ask questions, and respond to what you say.
|
| 479 |
+
|
| 480 |
+
3. Expressions: If a person is interested in the conversation, they will show it through their expressions. They will have a relaxed facial expression, a smile, and positive body language.
|
| 481 |
+
|
| 482 |
+
4. Follow-up questions: If a person is genuinely interested in a conversation, they will follow up with questions related to what you said. This will show that they are interested in hearing more about what you have to say.
|
| 483 |
+
|
| 484 |
+
5. Tone of voice: A person who is genuinely interested in the conversation will have a friendly and enthusiastic tone of voice. They will show interest and engage in the conversation.
|
| 485 |
+
|
| 486 |
+
Remember, people have different communication styles, and it’s possible to be polite without showing much interest in the conversation. It’s important to observe different cues and not jump to conclusions too quickly.
|
md/dev/qHrADgAdYu/qHrADgAdYu.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/dev/qI4542Y2s1D/qI4542Y2s1D.md
ADDED
|
@@ -0,0 +1,371 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FILM: FOLLOWING INSTRUCTIONS IN LANGUAGE WITH MODULAR METHODS
|
| 2 |
+
|
| 3 |
+
So Yeon ${ { \bf { M } } { \bf { i n } } ^ { 1 } }$ Devendra Singh Chaplot2 Pradeep Ravikumar1
|
| 4 |
+
|
| 5 |
+
Yonatan Bisk1 Ruslan Salakhutdinov1
|
| 6 |
+
|
| 7 |
+
1 Carnegie Mellon University {soyeonm, pradeepr, ybisk, rsalakhu}@cs.cmu.edu
|
| 8 |
+
|
| 9 |
+
2 Facebook AI Research dchaplot $@$ fb.com
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
Recent methods for embodied instruction following are typically trained end-toend using imitation learning. This often requires the use of expert trajectories and low-level language instructions. Such approaches assume that neural states will integrate multimodal semantics to perform state tracking, building spatial memory, exploration, and long-term planning. In contrast, we propose a modular method with structured representations that (1) builds a semantic map of the scene and (2) performs exploration with a semantic search policy, to achieve the natural language goal. Our modular method achieves SOTA performance $( 2 4 . 4 6 \% )$ with a substantial $( 8 . 1 7 \%$ absolute) gap from previous work while using less data by eschewing both expert trajectories and low-level instructions. Leveraging low-level language, however, can further increase our performance $( 2 6 . 4 9 \% )$ .1 Our findings suggest that an explicit spatial memory and a semantic search policy can provide a stronger and more general representation for state-tracking and guidance, even in the absence of expert trajectories or low-level instructions.2
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Human intelligence simultaneously processes data of multiple modalities, including but not limited to natural language and egocentric vision, in an embodied environment. Powered by the success of machine learning models in individual modalities (Devlin et al., 2018; He et al., 2016; Voulodimos et al.; Anderson et al., 2018a), there has been growing interest to build multimodal embodied agents that perform complex tasks. An incipient pursuit of such interest was to solve the task of Vision Language Navigation (VLN), for which the agent is required to navigate to the goal area given a language instruction (Anderson et al., 2018b; Fried et al., 2018; Zhu et al., 2020).
|
| 18 |
+
|
| 19 |
+
Embodied instruction following (EIF) presents a more complex and human-like setting than VLN or Object Goal Navigation (Gupta et al., 2017; Chaplot et al., 2020b; Du et al., 2021); beyond just navigation, agents are required to execute sequences of sub-tasks that entail both navigation and interaction actions from a language instruction (Fig. 1). The additional challenges posed by EIF are threefold - the agent has to understand compositional instructions of multiple types and subtasks, choose actions from a large action space and execute them for longer horizons, and localize objects in a fine-grained manner for interaction (Nguyen et al., 2021).
|
| 20 |
+
|
| 21 |
+
Most existing methods (Zhang & Chai, 2021; Kim et al., 2021; Nottingham et al., 2021) for EIF have relied on neural memory of various types (transformer embeddings, LSTM state), trained end-to-end with expert trajectories upon raw or pre-processed language/visual inputs. However, EIF remains a very challenging task for end-to-end methods as they require the neural net to simultaneously learn state-tracking, building spatial memory, exploration, long-term planning, and low-level control.
|
| 22 |
+
|
| 23 |
+
In this work, we propose FILM (Following Instructions in Language with Modular methods). FILM consists of several modular components that each (1) processes language instructions into structured forms (Language Processing), (2) converts egocentric visual input into a semantic metric map (Semantic Mapping), (3) predicts a search goal location (Semantic Search Policy), and (4) outputs subsequent navigation/ interaction actions (Deterministic Policy). FILM overcomes some of the shortcomings of previous methods by leveraging a modular design with structured spatial components. Unlike many of the existing methods for EIF, FILM does not require any input that provides sequential guidance, namely expert trajectories or low-level language instructions. While Blukis et al. (2021) recently introduced a method that uses a structured spatial memory, it comes with some limitations from the lack of explicit semantic search and the reliance on expert trajectories.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Figure 1: An Embodied Instruction Following (EIF) task consists of multiple subtasks. (a) FILM method overview: The agent receives the language instruction and the egocentric vision of the frame. At every time step, a semantic top-down map of the scene is updated from predicted depth and instance segmentation. Until the subgoal object is observed, a search goal (blue dot) is sampled from the semantic search policy. (b) Example trajectories: Trajectory of an existing model (HiTUT (Zhang & Chai, 2021)) is plotted in a straight green line, and that of FILM is in dotted red. While HiTUT’s agent travels repeatedly over a path of closed loop (thick green line, arrow pointing in the direction of travel), FILM��s semantic search allows better exploration and the agent sufficiently explores the environment and completes all subtasks.
|
| 27 |
+
|
| 28 |
+
On the ALFRED (Shridhar et al., 2020) benchmark, FILM achieves State-of-the-Art performance $( 2 4 . 4 6 \% )$ with a large margin $8 \%$ absolute) from the previous SOTA (Blukis et al., 2021). Most approaches rely on low-level instructions, and we too find that including them leads to an additional $2 \%$ improvement in success rate $( 2 6 . 4 9 \% )$ . FILM’s strong performance and our analysis indicate that an explicit structured spatial memory coupled with a semantic search policy can provide better state-tracking and exploration, even in the absence of expert trajectories or low-level instructions.
|
| 29 |
+
|
| 30 |
+
# 2 RELATED WORK
|
| 31 |
+
|
| 32 |
+
A plethora of works have been published on embodied vision and language tasks, such as VLN (Anderson et al., 2018b; Fried et al., 2018; Zhu et al., 2020), Embodied Question Answering (Das et al., 2018; Gordon et al., 2018), and topics of multimodal representation learning (Wang et al., 2020; Bisk et al., 2020), such as Embodied Language Grounding (Prabhudesai et al., 2020). For Visual Language Navigation, which is the most comparable to the setting of our work, methods with impressive performances (Ke et al., 2019; Wang et al., 2019; Ma et al., 2019) have been proposed since the introduction of R2R (Anderson et al., 2018b). While far from conquering VLN, these methods have shown up to $61 \%$ success rate on unseen test environments (Ke et al., 2019).
|
| 33 |
+
|
| 34 |
+
For the more challenging task of Embodied Instruction Following (EIF), multiple methods have been proposed with differing levels of modularity in the model structure. As a baseline, Shridhar et al. (2020) has presented a Seq2Seq model with an attention mechanism and a progress monitor, while Pashevich et al. (2021) proposed to replace to seq2seq model with an episodic transformer. These methods take the concatenation of language features, visual features, and past trajectories as input and predict the subsequent action end-to-end. On the other hand, Kim et al. (2021); Zhang & Chai (2021); Nguyen et al. (2021) modularly process raw language and visual inputs into structured forms, while keeping a separate “action prediction module” that outputs low-level actions given processed language outputs. Their “action taking module” itself is trained end-to-end and relies on neural memory that “implicitly” tracks all of spatial, progressive, and states of the agent. Unlike these methods, FILM’s structured language/ spatial representations make reasons for failure transparent and elucidates directions to improve individual components.
|
| 35 |
+
|
| 36 |
+
Recently, Blukis et al. (2021) has proposed a more modular method with a persistent and structured spatial memory. Language and visual input are transformed into respectively high-level actions and the 3D map. With the 3D map and high-level actions as input, low-level actions are predicted with a value-iteration network (VIN). Navigation goals for the VIN are sampled from a model trained on interaction pose labels from expert trajectories. Among all proposed methods for EIF, FILM necessitates the least information (neither low-level instructions nor expert trajectories are needed, although the former can be taken as an additional input). Furthermore, FILM addresses the problem of search/ exploration of goal objects.
|
| 37 |
+
|
| 38 |
+
Various works in visual navigation with semantic mapping are also relevant. Simultaneous Localization and Mapping (SLAM) methods, which build 2D or 3D obstacle maps, have been widely used (Fuentes-Pacheco et al., 2015; Izadi et al., 2011; Snavely et al., 2008). In contrast to these works, recent methods (Chaplot et al., 2020b;a) build semantic maps with differentiable projection operations, which restrain egocentric prediction errors amplifying in the map. The task of Chaplot et al. (2020b;a) is object goal navigation, a much simpler task compared to EIF. Furthermore, while Chaplot et al. (2020b) employs a semantic exploration policy, our and their semantic policies serve fundamentally different purposes; while their policy guides a general sense of direction among multiple rooms in the search for large objects (e.g. fridge), ours guides the search for potential locations of small and flat objects which have little chance of detection at a distance. Also, our semantic policy is conditioned on language instructions. Blukis et al. (2018a;b) also successfully utilized semantic 2D maps in grounded language navigation tasks. These works are for quadcopters, whose fields of view almost entirely cover the scene and the need for “search” or “exploration” is less crucial than for pedestrian agents. Moreover, their settings only involve navigation with a single subtask.
|
| 39 |
+
|
| 40 |
+
# 3 TASK EXPLANATION
|
| 41 |
+
|
| 42 |
+
We utilize the ALFRED benchmark. The agent has to complete household tasks given only natural language instructions and egocentric vision (Fig. 1). For example, the instruction may be given as “Put a heated apple on the counter,” with low-level instructions (which FILM does not use by default) further explaining step-by-step lower level actions. In this case, one way to “succeed” in this episode is to sequentially (1) pick up the apple, (2) put the apple in the microwave, (3) toggle the microwave on/off, (4) pick up the apple again, and (4) place it on the countertop. Episodes run for a significantly longer number of steps compared to benchmarks with only single subgoals; even expert trajectories, which are maximally efficient and perform only the strictly necessary actions (without any steps to search for an object), are often longer than 70 steps.
|
| 43 |
+
|
| 44 |
+
There are seven types of tasks (Appendix A.1), from relatively simple types (e.g. Pick & Place) to more complex ones (e.g. Heat & Place). Furthermore, the instruction may require that an object is “sliced” (e.g. Slice bread, cook it in the microwave, put it on the counter). An episode is deemed “success” if the agent completes all sub-tasks within 10 failed low-level actions and 1000 max steps.
|
| 45 |
+
|
| 46 |
+
# 4 METHODS
|
| 47 |
+
|
| 48 |
+
FILM consists of three learned modules: (1) Language Processing (LP), (2) Semantic Mapping, and (3) Semantic Search Policy; and one purely deterministic navigation/ interaction policy module (Fig. 2). At the start of an episode, the LP module processes the language instruction into a sequence of subtasks. Every time step, the semantic mapping module receives the egocentric RGB frame and updates the semantic map. If the goal object of the current subtask is not yet observed, the semantic search policy predicts a “search goal” at a coarse time scale; until the next search goal is predicted, the agent navigates to the current search goal with the deterministic policy. If the goal is observed, the deterministic policy decides low-level controls for interaction actions (e.g. “Pick Up” object).
|
| 49 |
+
|
| 50 |
+
# 4.1 LANGUAGE PROCESSING (LP)
|
| 51 |
+
|
| 52 |
+
The language processing (LP) module transforms high-level instructions into a structured sequence of subtasks (Fig. 3). It consists of two BERT (Devlin et al., 2018) submodules that receive the instruction as an input at the beginning of the episode. The first submodule (BERT type classification) receives the instruction and predicts the “type” of the instruction - one of the seven types stated in Appendix A.1. The second submodule (BERT argument classification) receives both the instruction and the predicted type as input and predicts the “arguments” - (1) “obj” for the object to be picked up, (2) “recep” for the receptacle where “obj” should be ultimately placed, (3) “sliced” for whether “obj” should be sliced, and (4) “parent” for tasks with intermediate movable receptacles (e.g. “cup” in “Put a knife in a cup on the table” of Appendix A.1). An object in ALFRED is always an instance of either “obj” or “recep”; “parent” objects are a subset of “recep” objects that are movable. We train a separate BERT model for each argument predictor. The two submodules are easily trainable with supervised learning since the type and the four arguments are provided in the training set. Models use only the CLS token for classification, and they do not share parameters; all layers of “bert-base-uncased” were fine-tuned.
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
Figure 2: FILM method overview. The “grouping” in blue, green, and yellow denote the coarseness of time scale (blue: at the beginning of the episode, green: at every time step, yellow: at a coarser time scale of every 25 steps). At the beginning of the episode, the Language Processing module processes the instruction into subtasks. At every time step, Semantic Mapping converts egocentric into RGB a top-down semantic map. The semantic search policy outputs the search goal at a coarse time scale. Finally, the Deterministic Policy decides the next action. Modules in bright green are learned; the deterministic policy (grey) is not.
|
| 56 |
+
|
| 57 |
+
Due to the patterned nature of instructions, we can match the predicted “type” of the instruction to a “type template” with blank arguments. For example, if the instruction is classified as the “clean & place” type, it is matched to the template “(Obj, PickUp), (SinkBasin, Put), (Faucet, ToggleOn), (Faucet, ToggleOff), (Obj, PickUp), (Recep, Put)”. If the “sliced” argument is predicted to be true from argument classification, subtasks of “(Knife, PickUp), (Obj, Slice), (Sink, PutObject)” will be added at the beginning of the template (with the (Sink, PutObject) to make the agent drop the knife). Filling in the “type template” with predictions of the second model, we obtain a list of subtasks (bottom of Fig. 3b) to be completed in the current episode. The “type templates” were designed by hand in less than 20 minutes. In section 5.2, we discuss the effect of using a LP module without the template assumption, for fair comparison with other works. Appendix A.9 contains more details.
|
| 58 |
+
|
| 59 |
+
# 4.2 SEMANTIC MAPPING MODULE
|
| 60 |
+
|
| 61 |
+
We designed the semantic mapping module (Appendix A.2) with inspirations from prior work (Chaplot et al., 2020b). Egocentric RGB is first processed into depth map and instance segmentation, with MaskRCNN (He et al., 2017) (and its implementation by Shridhar et al. (2021)) and the depth prediction method of Blukis et al. (2021); details of the training are explained in Section 5 3 . These pre-trained, off-the-shelf models were finetuned on the training scenes of ALFRED. Once processed, the depth observation is transformed to a point cloud, of which each point is associated with the predicted semantic categories. Finally, the point cloud is binned into a voxel representation; this summed over height is the semantic map. The map is locally updated and aggregated over time.
|
| 62 |
+
|
| 63 |
+
The resulting semantic map is an allocentric $( C + 2 ) \times M \times M$ binary grid, where $C$ is the number of object categories and each of the $M \times M$ cells represents a $5 \mathrm { c m } \ \times \ 5 \mathrm { c m }$ space of the scene. The $C$ channels each represent whether a particular object of interest was observed; the two extra channels denote whether obstacle exists and whether exploration happened in a particular $5 \mathrm { c m } \times 5 \mathrm { c m }$ space. Thus, the $C + 2$ channels are a semantic/spatial summary of the corresponding space. We use $M \ = \ 2 4 0$ (12 meters in the physical world) and ${ \cal C } =$ $2 8 +$ (number of additional subgoal objects in the current task). $\mathbf { \bar { \rho } } ^ { 6 6 } 2 8 ^ { 9 }$ is the number of “receptacle” objects (e.g. “Table”, “Bathtub”), which are usually large and easily detected; in the example of Fig. 1, there is one additional subgoal object (“Apple”). Please see Appendix A.2 on details of the dynamic handling of $C$ .
|
| 64 |
+
|
| 65 |
+

|
| 66 |
+
Figure 3: The Language Processing module. (a): Two BERT models respectively predict the “type” and the “arguments” of the instruction. (b): The predicted “type” from (a) is matched with a template, and the “arguments” of the template is filled with the predicted “argument.”
|
| 67 |
+
|
| 68 |
+
# 4.3 SEMANTIC SEARCH POLICY
|
| 69 |
+
|
| 70 |
+
The semantic search policy outputs a coarse 2D distribution for potential locations of a small subgoal object (Fig. 4), given a semantic map with the 28 receptacle objects only (e.g. “Countertop”, “Shelf”). The discovery of a small object is difficult in ALFRED due to three reasons - (1) many objects are tiny (some instances of “pencil” occupies less than 200 pixels even at a very close view), (2) the field of view is small due to the camera horizon mostly being downward4, (3) semantic segmentation, despite being fine-tuned, cannot detect small objects at certain angles. The role of the semantic search policy is to predict search locations for small objects, upon the observed spatial configuration of larger ones. While existing works surmise the “implicit” learning of search locations from expert trajectories, we directly learn an explicit policy without expert trajectories.
|
| 71 |
+
|
| 72 |
+
The policy is trained via supervised learning. For data collection, we deploy the agent without the policy in the training set and gather the (1) semantic map with only receptacle objects and (2) the ground truth location of the subgoal object after every 25 steps. A model of 15 layers of CNN with max-pooling in between (details in Appendix A.3) outputs an $N \times N$ grid, where $N$ is smaller than the original map size $M$ ; this is a 2D distribution for the potential location of the subgoal object. Finally, the KL divergence between this and a pseudo-ground truth “coarse” distribution whose mass is uniformly distributed over all cells with the true location of the subgoal object is minimized $\begin{array} { r } { ( \operatorname* { m i n } _ { p } K L ( p | | q ) \ } \end{array}$ where $p$ is the coarse ground truth and $q$ is the coarse prediction). At deployment, the “search goal” is sampled from the predicted distribution, resized to match the original map size of $M \times M$ (e.g. $2 4 0 \times 2 4 0 )$ , with mass in the coarse $N \times N$ (e.g. $8 \times 8$ ) grid uniformly spread out to the $\textstyle \left\lfloor { \frac { M } { N } } \right\rfloor \times \left\lfloor { \frac { M } { N } } \right\rfloor$ area centered on it. Because arriving at the search goal requires time, the policy operates at a “coarse” time scale of 25 steps; the agent navigates towards the current search goal until the next goal is sampled or the subgoal object is found (more details in Section 4.4).
|
| 73 |
+
|
| 74 |
+
Fig. 4 shows a visualization of the semantic search policy’s outputs. The policy provides a reasonably close estimate of the true distribution; the predicted mass of “bowl” is shared around observed furniture that it can appear on, and that of “faucet” peaks around the sink/ the end of the bathtub. While we chose $N = 8$ as the grid size, Appendix A.4 provides a general bound for choosing $N$ .
|
| 75 |
+
|
| 76 |
+
# 4.4 DETERMINISTIC POLICY
|
| 77 |
+
|
| 78 |
+
Given (1) the predicted subtasks, (2) the most recent semantic map, and (3) the search goal sampled at a coarse time scale, the deterministic policy outputs a navigation or interaction action (Fig. 2).
|
| 79 |
+
|
| 80 |
+
Let $[ ( o b j _ { 1 }$ , $a c t i o n _ { 1 } \dot { , }$ ), ... , $( o b j _ { k } , \ a c t i o n _ { k } ) ]$ be the list of subtasks and the current subtask be $( o b j _ { i } , a c t i o n _ { i } )$ . If $o b j _ { i }$ is observed in the current semantic map, the closest $o b j _ { i }$ is selected as the goal; otherwise, the sample from the semantic search policy is chosen as the goal (Section 4.3). The agent then navigates towards the goal via the Fast Marching Method (Sethian, 1996) and performs the required interaction actions. While this “low-level” policy could be learned with imitation or reinforcement learning, we used a deterministic one based on the findings of earlier work that observed that the Fast Marching Method performs as well as a learned local navigation policy (Chaplot et al., 2020b). When the agent successfully executes the required interaction actioni (which can be determined by the change in the egocentric RGB), the pointer of subtasks is advanced to $i + 1$ or the task is completed. More details and pseudocode are provided in Appendix A.5.
|
| 81 |
+
|
| 82 |
+

|
| 83 |
+
Figure 4: Example visualization of semantic search policy outputs. In each of (a), (b), Top left: map built from ground truth depth/ segmentation, Top right: map from learned depth/ segmentation, Bottom left: ground truth “coarse” distribution, Bottom right: predicted “coarse” distribution. (a): While the true location of the “bowl” was on the upper left coffee table, the policy distributes mass over all furniture likely to have it on. (b): The true location of the faucet is on the sink and at the end of the bathtub. While the policy puts more mass near the sink, it also allocates some to the end of the bathtub.
|
| 84 |
+
|
| 85 |
+
# 5 EXPERIMENTS AND RESULTS
|
| 86 |
+
|
| 87 |
+
We explain the metrics, evaluation splits, and baselines against which FILM is compared. Furthermore, we describe training details of each of the learned components of FILM.
|
| 88 |
+
|
| 89 |
+
Metrics Success Rate (SR) is a binary indicator of whether all subtasks were completed. The goalcondition success (GC) of a model is the ratio of goal-conditions completed at the end of an episode. For example, in the example of Fig. 1, there are three goal-conditions - a pan must be “cleaned”, a pan should rest on a countertop, and a “clean” pan should rest on a countertop. Both SR and GC can be weighted by (path length of the expert trajectory)/ (path length taken by the agent); these are called path length weighted SR (PLWSR) and path length weighted GC (PLWGC).
|
| 90 |
+
|
| 91 |
+
Evaluation Splits The test set consists of “Tests Seen” (1533 epsiodes) and “Tests unseen” (1529 episodes); the scenes of the latter entirely consist of rooms that do not appear in the training set, while those of the former only consist of scenes seen during training. Similarly, the validation set is partitioned into “Valid Seen” (820 epsiodes) and “Valid Unseen” (821 epsiodes). The official leaderboard ranks all entries by the SR on Tests Unseen.
|
| 92 |
+
|
| 93 |
+
Baselines There are two kinds of baselines: those that use low-level sequential instructions (Kim et al., 2021; Zhang & Chai, 2021; Nguyen et al., 2021; Pashevich et al., 2021) and those that do not (Nottingham et al., 2021; Blukis et al., 2021). While FILM does not necessitate low-level instructions, we report results with and without them and compare them against methods of both kinds.
|
| 94 |
+
|
| 95 |
+
Training Details of Learned Components In the LP module, BERT type classification and argument classification were trained with AdamW from the Transformer (Wolf et al., 2019) package; learning rates are 1e-6 for type classification and $\{ 1 \mathrm { e } { - } 4 , 1 \mathrm { e } { - } 5 , 5 \mathrm { e } { - } 5 , 5 \mathrm { e } { - } 5 \}$ for each of “object”, “parent”, “recep”, “sliced” argument classification. In the Semantic Mapping module, separate depth models for camera horizons of $4 5 ^ { \circ }$ and $0 ^ { \circ }$ were fine-tuned from an existing model of HLSM (Blukis et al., 2021), both with learning rate 1e-3 and the AdamW optimizer (epsilon 1e-6, weight decay 1e-2). Similarly, separate instance segmentation models for small and large objects were fine-tuned, starting from their respective parameters released by Shridhar et al. (2021), with learning rate 1e-3 and the SGD optimizer (momentum 0.9, weight decay 5e-4). Finally, the semantic search policy was trained with learning rate 5e-4 and the AdamW optimizer (epsilon 1e-6). Appendix A.2 and A.3 discuss more details on the architectures of semantic mapping/ semantic search policy modules. The readme of our code states protocols and commands so that readers can reproduce all expriments.
|
| 96 |
+
|
| 97 |
+
Table 1: Test results. Top section uses step-by-step instructions; bottom section does not. Bold numbers are top scores in each section. Blue numbers are the top SR on Tests Unseen (by which the leaderboard is ranked).
|
| 98 |
+
|
| 99 |
+
<table><tr><td>Method</td><td></td><td colspan="4">Tests Seen</td><td colspan="4">Tests Unseen</td></tr><tr><td></td><td></td><td>PLWGC</td><td>GC</td><td>PLWSR</td><td>SR</td><td>PLWGC</td><td>GC</td><td>PLWSR</td><td>SR</td></tr><tr><td colspan="10">Low-level Sequential Instructions + High-level Goal Instruction</td></tr><tr><td>SEQ2SEQ</td><td>(Shridhar et al., 2020)</td><td>6.27</td><td>9.42</td><td>2.02</td><td>3.98</td><td>4.26</td><td>7.03</td><td>0.08</td><td>3.9</td></tr><tr><td>MOCA</td><td>(Singh et al., 2020)</td><td>22.05</td><td>28.29</td><td>15.10</td><td>22.05</td><td>9.99</td><td>14.28</td><td>2.72</td><td>5.30</td></tr><tr><td>E.T.</td><td>(Pashevich et al., 2021)</td><td>1</td><td>36.47</td><td></td><td>28.77</td><td>■</td><td>15.01</td><td>-</td><td>5.04</td></tr><tr><td>E.T.+ synth. data</td><td>(Pashevich et al., 2021)</td><td>34.93</td><td>45.44</td><td>27.78</td><td>38.42</td><td>11.46</td><td>18.56</td><td>4.10</td><td>8.57</td></tr><tr><td>LWIT</td><td>(Nguyen et al., 2021)</td><td>23.10</td><td>40.53</td><td>43.10</td><td>30.92</td><td>16.34</td><td>20.91</td><td>5.60</td><td>9.42</td></tr><tr><td>HITUT</td><td>(Zhang & Chai, 2021)</td><td>17.41</td><td>29.97</td><td>11.10</td><td>21.27</td><td>11.51</td><td>20.31</td><td>5.86</td><td>13.87</td></tr><tr><td>ABP</td><td>(Kim et al., 2021)</td><td>4.92</td><td>51.13</td><td>3.88</td><td>44.55</td><td>2.22</td><td>24.76</td><td>1.08</td><td>15.43</td></tr><tr><td colspan="2">FILM W.O. SEMANTIC SEARCH</td><td>13.10</td><td>35.59</td><td>9.43</td><td>25.90</td><td>13.37</td><td>35.51</td><td>10.17</td><td>23.94</td></tr><tr><td colspan="2">FILM</td><td>15.06</td><td>38.51</td><td>11.23</td><td>27.67</td><td>14.30</td><td>36.37</td><td>10.55</td><td>26.49</td></tr><tr><td colspan="10">High-level Goal Instruction Only</td></tr><tr><td>LAV</td><td>(Nottingham et al., 2021)</td><td>13.18</td><td>23.21</td><td>6.31</td><td>13.35</td><td>10.47</td><td>17.27</td><td>3.12</td><td>6.38</td></tr><tr><td>HITUT G-only</td><td>(Zhang & Chai, 2021)</td><td>=</td><td>21.11</td><td></td><td>13.63</td><td>=</td><td>17.89</td><td>:</td><td>11.12</td></tr><tr><td>HLSM</td><td>(Blukis et al., 2021)</td><td>11.53</td><td>35.79</td><td>6.69</td><td>25.11</td><td>8.45</td><td>27.24</td><td>4.34</td><td>16.29</td></tr><tr><td colspan="2">FILM W.O. SEMANTIC SEARCH</td><td>12.22</td><td>34.41</td><td>8.65</td><td>24.72</td><td>12.69</td><td>34.00</td><td>9.44</td><td>22.56 24.46</td></tr><tr><td colspan="2">FILM</td><td>14.17</td><td>36.15</td><td>10.39</td><td>25.77</td><td>13.13</td><td>34.75</td><td>9.67</td><td></td></tr></table>
|
| 100 |
+
|
| 101 |
+
# 5.1 RESULTS
|
| 102 |
+
|
| 103 |
+
Table 8 shows test results. FILM achieves state-of-the-art performance across both seen and unseen scenes in the setting where only high-level instructions are given. It achieves $8 . 1 7 \%$ absolute $( 5 0 . 1 5 \%$ relative) gain in SR on Tests Unseen, and $0 . 6 6 \%$ absolute $2 . 6 3 \%$ relative) gain in SR on Tests Seen over HLSM, the previous SOTA.
|
| 104 |
+
|
| 105 |
+
FILM performs competitively even compared to methods that require low-level step-by-step instructions. They can be used as additional inputs to the LP module, with the low-level instruction appended to the high-level instruction for both BERT type classification and BERT argument classification. Under this setting, FILM achieves $1 1 . 0 6 \%$ absolute $( 7 1 . 6 8 \%$ relative) gain in SR on Tests Unseen compared to ABP. Notably, FILM performs similarly across Tests Seen and Tests Unseen, which implies FILM’s strong generalizability. This is in contrast to that methods that require lowlevel instructions, such as ABP, E.T., LWIT, MOCA, perform very well on Tests Seen but much less so on unseen scenes. In a Sim2Real situation, these methods will excel if the agent can be trained in the exact household it will be deployed in, with multiple low-level instructions and expert trajectories. In the more realistic and cost-efficient setting where the agent is trained in a centralized manner and has to generalize to new scenes, FILM will be more adequate.
|
| 106 |
+
|
| 107 |
+
It is also notable that the semantic search policy significantly increases not only SR and GC, but also their path-length weighted versions. On Tests Seen, the gap of PLWSR between FILM with/ without semantic search is larger than the corresponding gap of SR (for both with/ without low-level instructions). This suggests that the semantic policy boosts the efficiency of trajectories. The results in Appendix A.8 show that the improvement by the semantic policy is reproduced across multiple seeds; the protocols for reproduction are explained along with the result.
|
| 108 |
+
|
| 109 |
+
# 5.2 ABLATIONS STUDIES AND ERROR ANALYSIS
|
| 110 |
+
|
| 111 |
+
Errors due to perception and language processing. To understand the importance of FILM’s individual modules, we consider ablations on the base method, the base method with low-level language, and with ground truth visual/ language inputs. Table 2 shows ablations on the development sets. While the improvement from gt depth is large in unseen scenes $( 1 0 . 6 4 \% )$ , it is incremental on seen scenes $( 1 . 4 8 \% )$ ; on the other hand, gt segmentation significantly boosts performances in both cases $( 9 . 2 6 \% / 9 . 2 6 \% )$ . Thus, among visual perception, segmentation is a bottleneck in both seen/ unseen scenes, and depth is a bottleneck only in the latter. On the other hand, while a large gain in SR comes from using ground truth language $( { \dot { 7 } } . 4 3 \ \% / 4 . 2 2 \ \% )$ , that from adding low-level language as input is rather incremental. We additionally analyze the effect of the template assumption (explained in the second paragraph of Section 4.1), by reporting the performance with a Language Processing module without this assumption. The results drop without the templates but not by a large margin. Appendix A.9 explains the details of this auxiliary Language Processing module.
|
| 112 |
+
|
| 113 |
+
Error modes. Table 3 shows common error modes of FILM; the metric is the percent of episodes that failed (in SR) from a particular error out of all failed episodes. The main failures in valid unseen scenes are due to failures in (1) locating the subgoal object (due to the small field of view, imperfect segmentation, ineffective exploration), (2) locating the subgoal object because it is in a closed receptacle (cabinet, drawer, etc), (3) interaction (due to object being too far or not in field of view, bad segmentation mask), (4) navigation (collisions), (5) correctly processing language instructions, (6) others, such as the deterministic policy repeating a loop of actions from depth/ segmentation failures and 10 failed actions accruing from a mixture of different errors. A failed episode is classified to the error type that occurs “earlier” (e.g. If the subtasks were processed incorrectly and also there were 10 consecutive collisions, this episode is classified as (5) (failure in incorrectly processsing language instructions) since the LP module comes “earlier” than the collisions). More details are in Appendix A.6. As seen in Table 3, goal object not found is the most common error mode, typically due to objects being small and not visible from a distance or certain viewpoints. Results of the next subsection show that this error is alleviated by the semantic search policy in certain cases.
|
| 114 |
+
|
| 115 |
+
Table 2: Ablation results on validation splits. Base Method is FILM with semantic search policy.
|
| 116 |
+
|
| 117 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">Val Seen</td><td colspan="2">Val Unseen</td></tr><tr><td>GC</td><td>SR</td><td>GC</td><td>SR</td></tr><tr><td>Base Method</td><td>37.20</td><td>24.63</td><td>32.45</td><td>20.10</td></tr><tr><td>+ low-level language</td><td>38.54</td><td>25.24</td><td>32.89</td><td>20.61</td></tr><tr><td>+ gt seg.</td><td>45.46</td><td>34.02</td><td>42.88</td><td>29.35</td></tr><tr><td>+ gt depth</td><td>38.21</td><td>26.59</td><td>42.91</td><td>30.73</td></tr><tr><td>+ gt depth, gt seg.</td><td>55.54</td><td>43.22</td><td>64.31</td><td>55.05</td></tr><tr><td>+ gt depth, gt seg., gt lang.</td><td>59.47</td><td>47.44</td><td>69.13</td><td>62.48</td></tr><tr><td>- template assumption</td><td>31.46</td><td>20.37</td><td>31.14</td><td>18.03</td></tr></table>
|
| 118 |
+
|
| 119 |
+
Table 3: Error Modes. Table showing percentage of errors due to each failure mode for FILM on the Val set.
|
| 120 |
+
|
| 121 |
+
<table><tr><td>Error mode</td><td>Seen</td><td>Unseen</td></tr><tr><td>Goal object not found</td><td>23.30</td><td>26.07</td></tr><tr><td>Interaction failures</td><td>6.96</td><td>8.54</td></tr><tr><td>Collisions</td><td>6.96</td><td>11.00</td></tr><tr><td>Object in closed receptacle</td><td>18.44</td><td>16.16</td></tr><tr><td>Language processing error</td><td>18.53</td><td>24.54</td></tr><tr><td>Others</td><td>25.81</td><td>13.69</td></tr></table>
|
| 122 |
+
|
| 123 |
+

|
| 124 |
+
Figure 5: Average number of subtasks completed until failure, by task type (light green/ light blue respectively for valid seen/ unseen). Dark green/ blue: average number of total subtasks in valid seen/ unseen.
|
| 125 |
+
|
| 126 |
+
Table 4: Performance by task type of base model on validation.
|
| 127 |
+
|
| 128 |
+
<table><tr><td rowspan="2">Task Type</td><td colspan="2">Val Seen</td><td colspan="2">Val Unseen</td></tr><tr><td>GC</td><td>SR</td><td>GC</td><td>SR</td></tr><tr><td>Overall</td><td>37.20</td><td>24.63</td><td>32.45</td><td>20.10</td></tr><tr><td>Examine</td><td>50.00</td><td>34.41</td><td>45.06</td><td>29.65</td></tr><tr><td>Pick&Place</td><td>27.46</td><td>26.92</td><td>16.67</td><td>16.03</td></tr><tr><td>Stack&Place</td><td>23.74</td><td>10.71</td><td>9.90</td><td>1.98</td></tr><tr><td>Clean&Place</td><td>58.56</td><td>44.04</td><td>48.89</td><td>33.63</td></tr><tr><td>Cool&Place</td><td>27.04</td><td>12.61</td><td>27.41</td><td>14.04</td></tr><tr><td>Heat&Place</td><td>40.21</td><td>22.02</td><td>37.77</td><td>23.02</td></tr><tr><td>Pick2&Place</td><td>40.37</td><td>23.77</td><td>29.28</td><td>11.84</td></tr></table>
|
| 129 |
+
|
| 130 |
+
Performance over different task types. To understand FILM’s strengths/ weaknesses across different types of tasks, we further ablate validation results by task type in Table 4. Figure 5 shows the average number of subtasks completed for failed episodes, by task type. First, the SR and GC for “Stack & Place” is remarkably low. Second, the number of the subtasks entailed with the task type does not strongly correlate with performance. While “Heat & Place” usually involves three more subtasks than “Pick & Place”, the metrics for the former are much higher than those of the latter. Since task types inevitably occur in different kinds of scenes (e.g. “Heat & Place” only occurs in kitchens) and therefore involve different kinds of objects (e.g. “Heat & Place” involves food only), the results suggest that the success of the first PickUp action largely depends on the kinds of the scene and size and type of the subgoal objects rather than number of subtasks.
|
| 131 |
+
|
| 132 |
+
While the above error analysis is specific to FILM, its implications regarding visual perception may generally represent the weaknesses of existing methods for EIF, since most recent methods (ABP, HLSM, HiTUT, LWIT, E.T.) use the same family of segmentation/ detection models as FILM, such as Mask-RCNN and Fast-RCNN (Wang et al., 2017). Specifically, it could be that the inability to find a subgoal object is a major failure mode in the mentioned existing methods as well. On the other hand, FILM is not designed to search inside closed receptacles (e.g. cabinets), although subgoal objects dwell in receptacles quite frequently (Table 3); a future work to extend FILM should learn to perform a more active search.
|
| 133 |
+
|
| 134 |
+
# 5.3 EFFECTS OF THE SEMANTIC SEARCH POLICY
|
| 135 |
+
|
| 136 |
+
With Valid Unseen as the development set, we observed that the semantic search policy significantly helps to find small objects (Table 5); we use the percent of episodes in which the first goal object was found $\%$ 1st Goal Found) as a proxy, since it can be picked up (e.g. “Apple”, “Pen”)
|
| 137 |
+
|
| 138 |
+
Table 5: Dev set results (valid unseen) of FILM with/ without semantic search policy.
|
| 139 |
+
|
| 140 |
+
<table><tr><td>Method</td><td>% 1st Goal Found</td><td>SR</td></tr><tr><td>HLSM (Blukis et al., 2021)</td><td>N/A</td><td>11.8</td></tr><tr><td>FILM with Search</td><td>80.51</td><td>20.09</td></tr><tr><td>FILM w.o. Search</td><td>76.12</td><td>19.85</td></tr></table>
|
| 141 |
+
|
| 142 |
+

|
| 143 |
+
Figure 6: Example trajectories of FILM with and without semantic search policy. Paths near the subgoals that were traveled 3 times or more are in straight red. The goal (which can be the search goal or an observed instance of a subgoal object) is in blue.
|
| 144 |
+
|
| 145 |
+
Table 6: Performance with and without semantic search policy, by room size.
|
| 146 |
+
|
| 147 |
+
<table><tr><td>Room Size</td><td colspan="2">Small</td><td colspan="2">Large</td></tr><tr><td></td><td>FILM</td><td>FILM w.o. Search</td><td>FILM</td><td>FILM w.o. Search</td></tr><tr><td>SR</td><td>26.70</td><td>26.63</td><td>15.17</td><td>14.74</td></tr><tr><td>% 1st Goal Found 79.32</td><td></td><td>81.02</td><td>80.13</td><td>73.72</td></tr></table>
|
| 148 |
+
|
| 149 |
+
Table 7: Performance with and without semantic search policy, by task type.
|
| 150 |
+
|
| 151 |
+
<table><tr><td>Task Type</td><td colspan="2">Clean&Place</td><td colspan="2">Other Types</td></tr><tr><td></td><td>FILM</td><td>FILM w.o. Search</td><td>FILM</td><td>FILM w.o. Search</td></tr><tr><td>SR</td><td>33.63</td><td>14.16</td><td>17.94</td><td>20.16</td></tr><tr><td>% 1st Goal Found</td><td>87.61</td><td>79.65</td><td>79.38</td><td>75.56</td></tr><tr><td>% 1st Recep Found</td><td>80.53</td><td>69.03</td><td>58.05</td><td>55.93</td></tr></table>
|
| 152 |
+
|
| 153 |
+
and thus is usually small. Thus, we use FILM with semantic search as the “base method” (default) for all experiments/ ablations.
|
| 154 |
+
|
| 155 |
+
To further analyze when the semantic search policy especially helps, we ablate on room sizes and task types. Table 6 shows the SR and $\% 1 \mathrm { s t }$ Goal Found with and without search, by room size (details on the assignment of Room Size are in Appendix A.7). As expected, the semantic policy increases both metrics, especially so in large scenes. This is desirable since the policy makes the agent less disoriented in difficult scenarios (large scenes); the model without it is more susceptible to failing even the first subtask. Figure 6 is consistent with the trend of Table 6; it shows example trajectories of FILM with and without the semantic search policy in a large kitchen scene. Since the countertop appears in the bottom right quadrant of the map, it is desirable that the agent travels there to search for a “knife”. While FILM travels to this area frequently (straight red line in Fig.6), FILM without semantic search mostly wanders in irrelevant locations (e.g. the bottom left quadrant).
|
| 156 |
+
|
| 157 |
+
Table 7 further shows the performance with and without search by task type. Notably, the gap of performance for the “clean & place” type is very large. In the large kitchen scene of “Valid Unseen” (Fig. 6), the “Sink” looks very flat from a distance and is hardly detected. The semantic policy induces the agent to travel near the countertop area and improves the localization of the 1st Recep (“Sink”) for the “clean & place” type (Table 7). In conclusion, the semantic policy improves the localization of small and flat objects in large scenes.
|
| 158 |
+
|
| 159 |
+
# 6 CONCLUSION
|
| 160 |
+
|
| 161 |
+
We proposed FILM, a new modular method for embodied instruction following which (1) processes language instructions into structured forms (Language Processing), (2) converts egocentric vision into a semantic metric map (Semantic Mapping), (3) predicts a likely goal location (Semantic Search Policy), and (4) outputs subsequent navigation/ interaction actions (Algorithmic Planning). FILM achieves the state of the art on the ALFRED benchmark without any sequential supervision.
|
| 162 |
+
|
| 163 |
+
# ETHICS STATEMENT
|
| 164 |
+
|
| 165 |
+
This research is for building autonomous agents. While we do not perform any experiments with humans, practitioners may attempt to extend and apply this technology in environments with humans. Such potential applications of this research should take privacy concerns into consideration.
|
| 166 |
+
|
| 167 |
+
All learned models in this research were trained using Ai2Thor (Kolve et al., 2019). Thus, they may be biased towards North American homes.
|
| 168 |
+
|
| 169 |
+
# REPRODUCIBILITY STATEMENT
|
| 170 |
+
|
| 171 |
+
We thoroughly explain training details and model architectures in Section 5.1 and Appendix A.2, A.3. Project webpage with code, pre-trained models, and protocols to reproduce results is released here: https://soyeonm.github.io/FILM webpage/.
|
| 172 |
+
|
| 173 |
+
# REFERENCES
|
| 174 |
+
|
| 175 |
+
Peter Anderson, Angel Chang, Devendra Singh Chaplot, Alexey Dosovitskiy, Saurabh Gupta, Vladlen Koltun, Jana Kosecka, Jitendra Malik, Roozbeh Mottaghi, Manolis Savva, et al. On Evaluation of Embodied Navigation Agents. arXiv preprint arXiv:1807.06757, 2018a.
|
| 176 |
+
|
| 177 |
+
Peter Anderson, Qi Wu, Damien Teney, Jake Bruce, Mark Johnson, Niko Sunderhauf, Ian Reid, ¨ Stephen Gould, and Anton Van Den Hengel. Vision-and-language navigation: Interpreting visually-grounded navigation instructions in real environments. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3674–3683, 2018b.
|
| 178 |
+
|
| 179 |
+
Yonatan Bisk, Ari Holtzman, Jesse Thomason, Jacob Andreas, Yoshua Bengio, Joyce Chai, Mirella Lapata, Angeliki Lazaridou, Jonathan May, Aleksandr Nisnevich, et al. Experience grounds language. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2020.
|
| 180 |
+
|
| 181 |
+
Valts Blukis, Nataly Brukhim, Andrew Bennett, Ross A Knepper, and Yoav Artzi. Following highlevel navigation instructions on a simulated quadcopter with imitation learning. In Robotics: Science and Systems (RSS), 2018a.
|
| 182 |
+
|
| 183 |
+
Valts Blukis, Dipendra Misra, Ross A Knepper, and Yoav Artzi. Mapping navigation instructions to continuous control actions with position-visitation prediction. In Conference on Robot Learning, pp. 505–518. PMLR, 2018b.
|
| 184 |
+
|
| 185 |
+
Valts Blukis, Chris Paxton, Dieter Fox, Animesh Garg, and Yoav Artzi. A persistent spatial semantic representation for high-level natural language instruction execution. In Proceedings of the Conference on Robot Learning (CoRL), 2021.
|
| 186 |
+
|
| 187 |
+
Devendra Singh Chaplot, Dhiraj Gandhi, Saurabh Gupta, Abhinav Gupta, and Ruslan Salakhutdinov. Learning to explore using active neural slam. arXiv preprint arXiv:2004.05155, 2020a.
|
| 188 |
+
|
| 189 |
+
Devendra Singh Chaplot, Dhiraj Prakashchand Gandhi, Abhinav Gupta, and Russ R Salakhutdinov. Object goal navigation using goal-oriented semantic exploration. Advances in Neural Information Processing Systems, 33, 2020b.
|
| 190 |
+
|
| 191 |
+
Abhishek Das, Samyak Datta, Georgia Gkioxari, Stefan Lee, Devi Parikh, and Dhruv Batra. Embodied question answering. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1–10, 2018.
|
| 192 |
+
|
| 193 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. arXiv preprint arXiv:1810.04805, 2018.
|
| 194 |
+
|
| 195 |
+
Heming Du, Xin Yu, and Liang Zheng. Vtnet: Visual transformer network for object goal navigation. arXiv preprint arXiv:2105.09447, 2021.
|
| 196 |
+
|
| 197 |
+
Daniel Fried, Ronghang Hu, Volkan Cirik, Anna Rohrbach, Jacob Andreas, Louis-Philippe Morency, Taylor Berg-Kirkpatrick, Kate Saenko, Dan Klein, and Trevor Darrell. Speaker-follower models for vision-and-language navigation. In Advances in Neural Information Processing Systems, 2018.
|
| 198 |
+
|
| 199 |
+
Jorge Fuentes-Pacheco, Jose Ruiz-Ascencio, and Juan Manuel Rend ´ on-Mancha. Visual simultane-´ ous localization and mapping: a survey. Artificial intelligence review, 43(1):55–81, 2015.
|
| 200 |
+
|
| 201 |
+
Daniel Gordon, Aniruddha Kembhavi, Mohammad Rastegari, Joseph Redmon, Dieter Fox, and Ali Farhadi. Iqa: Visual question answering in interactive environments. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 4089–4098, 2018.
|
| 202 |
+
|
| 203 |
+
Saurabh Gupta, James Davidson, Sergey Levine, Rahul Sukthankar, and Jitendra Malik. Cognitive mapping and planning for visual navigation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2616–2625, 2017.
|
| 204 |
+
|
| 205 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
|
| 206 |
+
|
| 207 |
+
Kaiming He, Georgia Gkioxari, Piotr Dollar, and Ross Girshick. Mask r-cnn. In ´ Proceedings of the IEEE international conference on computer vision, pp. 2961–2969, 2017.
|
| 208 |
+
|
| 209 |
+
Shahram Izadi, David Kim, Otmar Hilliges, David Molyneaux, Richard Newcombe, Pushmeet Kohli, Jamie Shotton, Steve Hodges, Dustin Freeman, Andrew Davison, et al. Kinectfusion: real-time 3d reconstruction and interaction using a moving depth camera. In Proceedings of the 24th annual ACM symposium on User interface software and technology, pp. 559–568, 2011.
|
| 210 |
+
|
| 211 |
+
Liyiming Ke, Xiujun Li, Yonatan Bisk, Ari Holtzman, Zhe Gan, Jingjing Liu, Jianfeng Gao, Yejin Choi, and Siddhartha Srinivasa. Tactical rewind: Self-correction via backtracking in vision-andlanguage navigation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6741–6749, 2019.
|
| 212 |
+
|
| 213 |
+
Byeonghwi Kim, Suvaansh Bhambri, Kunal Pratap Singh, Roozbeh Mottaghi, and Jonghyun Choi. Agent with the big picture: Perceiving surroundings for interactive instruction following. In Embodied AI Workshop CVPR, 2021.
|
| 214 |
+
|
| 215 |
+
Eric Kolve, Roozbeh Mottaghi, Winson Han, Eli VanderBilt, Luca Weihs, Alvaro Herrasti, Daniel Gordon, Yuke Zhu, Abhinav Gupta, and Ali Farhadi. Ai2-thor: An interactive 3d environment for visual ai, 2019.
|
| 216 |
+
|
| 217 |
+
Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. BART: Denoising sequence-to-sequence pretraining for natural language generation, translation, and comprehension. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 7871–7880, Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.703. URL https://aclanthology.org/2020.acl-main.703.
|
| 218 |
+
|
| 219 |
+
Chih-Yao Ma, Zuxuan Wu, Ghassan AlRegib, Caiming Xiong, and Zsolt Kira. The regretful agent: Heuristic-aided navigation through progress estimation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6732–6740, 2019.
|
| 220 |
+
|
| 221 |
+
Van-Quang Nguyen, Masanori Suganuma, and Takayuki Okatani. Look wide and interpret twice: Improving performance on interactive instruction-following tasks. arXiv preprint arXiv:2106.00596, 2021.
|
| 222 |
+
|
| 223 |
+
Kolby Nottingham, Litian Liang, Daehyun Shin, Charless C. Fowlkes, Roy Fox, and Sameer Singh. Lav, 2021. URL https://leaderboard.allenai.org/alfred/submission/c2cm7eranqs9puf9uvjg.
|
| 224 |
+
|
| 225 |
+
Alexander Pashevich, Cordelia Schmid, and Chen Sun. Episodic transformer for vision-andlanguage navigation. arXiv preprint arXiv:2105.06453, 2021.
|
| 226 |
+
|
| 227 |
+
Mihir Prabhudesai, Hsiao-Yu Fish Tung, Syed Ashar Javed, Maximilian Sieb, Adam W Harley, and Katerina Fragkiadaki. Embodied language grounding with 3d visual feature representations. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2220–2229, 2020.
|
| 228 |
+
|
| 229 |
+
J A Sethian. A fast marching level set method for monotonically advancing fronts. Proceedings of the National Academy of Sciences, 93(4):1591–1595, 1996. ISSN 0027-8424. doi: 10.1073/pnas. 93.4.1591. URL https://www.pnas.org/content/93/4/1591.
|
| 230 |
+
|
| 231 |
+
Mohit Shridhar, Jesse Thomason, Daniel Gordon, Yonatan Bisk, Winson Han, Roozbeh Mottaghi, Luke Zettlemoyer, and Dieter Fox. Alfred: A benchmark for interpreting grounded instructions for everyday tasks. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 10740–10749, 2020.
|
| 232 |
+
|
| 233 |
+
Mohit Shridhar, Xingdi Yuan, Marc-Alexandre Cotˆ e, Yonatan Bisk, Adam Trischler, and Matthew ´ Hausknecht. Alfworld: Aligning text and embodied environments for interactive learning. In Proceedings of the International Conference on Learning Representations (ICLR), 2021.
|
| 234 |
+
|
| 235 |
+
Kunal Pratap Singh, Suvaansh Bhambri, Byeonghwi Kim, Roozbeh Mottaghi, and Jonghyun Choi. Moca: A modular object-centric approach for interactive instruction following. arXiv preprint arXiv:2012.03208, 2020.
|
| 236 |
+
|
| 237 |
+
Noah Snavely, Steven M Seitz, and Richard Szeliski. Modeling the world from internet photo collections. International journal of computer vision, 80(2):189–210, 2008.
|
| 238 |
+
|
| 239 |
+
Athanasios Voulodimos, Nikolaos Doulamis, Anastasios Doulamis, and Eftychios Protopapadakis. Deep learning for computer vision: A brief review. Computational intelligence and neuroscience, 2018.
|
| 240 |
+
|
| 241 |
+
Ruocheng Wang, Jiayuan Mao, Samuel J Gershman, and Jiajun Wu. Language-mediated, objectcentric representation learning. arXiv preprint arXiv:2012.15814, 2020.
|
| 242 |
+
|
| 243 |
+
Xiaolong Wang, Abhinav Shrivastava, and Abhinav Gupta. A-fast-rcnn: Hard positive generation via adversary for object detection. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2606–2615, 2017.
|
| 244 |
+
|
| 245 |
+
Xin Wang, Qiuyuan Huang, Asli Celikyilmaz, Jianfeng Gao, Dinghan Shen, Yuan-Fang Wang, William Yang Wang, and Lei Zhang. Reinforced cross-modal matching and self-supervised imitation learning for vision-language navigation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6629–6638, 2019.
|
| 246 |
+
|
| 247 |
+
Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Remi Louf, Morgan Funtowicz, et al. Huggingface’s transformers: ´ State-of-the-art natural language processing. arXiv preprint arXiv:1910.03771, 2019.
|
| 248 |
+
|
| 249 |
+
Yichi Zhang and Joyce Chai. Hierarchical task learning from language instructions with unified transformers and self-monitoring. arXiv preprint arXiv:2106.03427, 2021.
|
| 250 |
+
|
| 251 |
+
Fengda Zhu, Yi Zhu, Xiaojun Chang, and Xiaodan Liang. Vision-language navigation with selfsupervised auxiliary reasoning tasks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 10012–10022, 2020.
|
| 252 |
+
|
| 253 |
+
# A APPENDIX
|
| 254 |
+
|
| 255 |
+
# A.1 TASK DEFINITION
|
| 256 |
+
|
| 257 |
+
High and low-level instructions are both available to agents. There are 7 types of tasks (Fig 7. b) and the sequence of subtasks is templated according to the task type.
|
| 258 |
+
|
| 259 |
+
(a) Instruction Goal: Drop a clean pan on the table.
|
| 260 |
+
|
| 261 |
+
Low Level Goal: Move forward towards the gas,pick up the pan.Turn around and head to the sink,..
|
| 262 |
+
|
| 263 |
+

|
| 264 |
+
Figure 7: ALFRED overview. The goal is given in high level and low level language instructions. For and agent to achieve “success” of the goal, it needs to complete a sequence of interactions (as in the explanations in the bottom of the figure) and the entailed navigation between interactions.
|
| 265 |
+
|
| 266 |
+
# A.2 SEMANTIC MAPPING MODULE
|
| 267 |
+
|
| 268 |
+
Figure 8 is an illustration of the semantic mapping module. A depth map and instance segmentation is predicted from Egocentric RGB. Then the first and the later are respectively transformed into a point cloud and a semantic label of each point in the cloud, together producing voxels. The voxels are summed across height to produce the semantic map. Partial maps obtained at particular time steps are aggregated to the global map simply via “sum/ logical or.”
|
| 269 |
+
|
| 270 |
+

|
| 271 |
+
Figure 8: Semantic mapping module. Figure was partially taken from Chaplot et al. (2020b)
|
| 272 |
+
|
| 273 |
+
We dynamically control the number of objects $C$ for efficiency (because there are more than 100 objects in total). All receptacle objects (for input to the semantic policy) and all non-receptacle objects that appear in the subtasks are counted in $C$ . For example, in an episode with the subtask [(Pan, PickUp), (SinkBasin, Put), (Faucet, ToggleOn), (Faucet, ToggleOff), (Pan, PickUp), (Table, Put)], all receptacle objects and ”Pan”, ”Faucet” will be the $C$ objects indicated on the map.
|
| 274 |
+
|
| 275 |
+
# A.3 SEMANTIC SEARCH POLICY MODULE
|
| 276 |
+
|
| 277 |
+
The map from the previous subsection is passed into 7 layers of convolutional nets, each with kernel size 3 and stride 1. There is maxpooling between any two conv nets, and after the last layer, there is softmax over the 64 $( 8 \times 8 )$ categories, for each of the $C _ { o }$ (73) channels.
|
| 278 |
+
|
| 279 |
+
At deployment/ validation, if the agent is currently searching for the cth object, then a search location is sampled from the cth channel of the outputted $8 \times 8 \times C _ { o }$ grid.
|
| 280 |
+
|
| 281 |
+

|
| 282 |
+
Figure 9: Semantic search policy.
|
| 283 |
+
|
| 284 |
+
A.4 IMPACT OF GRID SIZE ON THE EFFECTIVENESS OF THE SEMANTIC SEARCH POLICY
|
| 285 |
+
|
| 286 |
+
While we chose $N = 8$ , $\lfloor \frac { M } { N } \rfloor = 3 0$ for the size of the “coarse” cell of the semantic search policy, the desirable choice of $N$ may be different if a practitioner attempts to transfer FILM to different scenes/ tasks. While a “too fine” semantic policy will be hard to train due to sparseness of labels, a “too coarse” one will spread the mass of the distribution to widely.
|
| 287 |
+
|
| 288 |
+
Let us examine the “coarse” and “actual” ground truth distributions just in one direction (e.g. the horizontal direction). Let $F _ { X } ( x ) , C _ { X } ( x )$ be the “actual” and “coarse” ground truth CDFs in the horizontal direction. Also, let $\begin{array} { r } { L \ = \ \lfloor { \frac { M } { N } } \rfloor } \end{array}$ If the goal object occurs $\mathbf { \ddot { \psi } } _ { k } , \mathbf { \vec { \psi } } _ { }$ times in the horizontal direction, then,
|
| 289 |
+
|
| 290 |
+
$$
|
| 291 |
+
\operatorname* { s u p } _ { x } | F _ { X } ( x ) - C _ { X } ( x ) | \leq \frac { 1 } { k } ( 1 - \frac { 1 } { L } ) .
|
| 292 |
+
$$
|
| 293 |
+
|
| 294 |
+
A similar result holds in the vertical direction. The bound above suggests that if the goal object occurs more frequently (smaller $\scriptstyle { \frac { 1 } { k } } .$ ), then a coarser $L$ (larger $\textstyle { 1 - { \frac { 1 } { L } } ) }$ is tolerable. On the other hand, if the goal object occurs very infrequently (larger $\scriptstyle { \frac { 1 } { k } } \rangle$ ), then a coarse $M$ (larger $\textstyle { 1 - { \frac { 1 } { L } } ) }$ will result in $F _ { X }$ and $C _ { X }$ becoming too different in the worst case. Thus, it is desirable that practitioners choose $L$ (and in turn, $N$ ) based on the frequency of their goal objects, on average. Furthermore, a search policy with adaptive grid sizing should be explored as future work.
|
| 295 |
+
|
| 296 |
+
# A.5 PSEUDOCODE FOR THE DETERMINISTIC POLICY
|
| 297 |
+
|
| 298 |
+
Following the discussion of Section 4.4, let $[ ( o b j _ { 1 } , a c t i o n _ { 1 } )$ ), ... , $( o b j _ { k } , a c t i o n _ { k } ) ]$ be the list of subtasks, where the current subtask is $( o b j _ { i } , a c t i o n _ { i } )$ . If $o b j _ { i }$ is observed in the current semantic map, the closest $o b j _ { i }$ is selected as the goal to navigate; otherwise, the sample from the semantic search policy is chosen as the goal (Section 4.3). The agent then navigates towards the closest $o b j _ { i }$ via the Fast Marching Method (Sethian, 1996). Once the stop distance is reached, the agent rotates 8 times to the left (at camera horizon 0, 45, 90,...) until $o b j _ { i }$ is detected in egocentric vision. Once $o b j _ { i }$ is in the current frame, the agents decides to take $a c t i o n _ { i }$ if two criteria are met: whether $o b j _ { i }$ is in the “center” of the frame, or whether the minimum depth towards $o b j _ { i }$ is in visibility distance of 1.5 meters). Otherwise, the agent “sidesteps” to keep $o b j _ { i }$ in the center frame or continue rotating to the left with horizon 0/45 until $o b j _ { i }$ is seen within visibility distance. If the agent executes actioni and fails, the agent “moves backwards” and the map gets updated.
|
| 299 |
+
|
| 300 |
+
Below, we present a pseudocode for the deterministic navigation/ interaction policy. We first present explanations of some terms.
|
| 301 |
+
|
| 302 |
+
• “visible” means that an object is in the current RGB frame, and minimum (predicted) depth from the agent to it is less than or equal to 1.5 meters (which is set by ALFRED).
|
| 303 |
+
• “FMM” is Fast Marching Method (Sethian, 1996).
|
| 304 |
+
• We assume that a new RGB frame is given as $t i m e \_ s t e p \gets t i m e \_ s t e p + 1$
|
| 305 |
+
• MoveBehind, SideStep, RotateBack are not actions in ALFRED; they are defined by us. MoveBehind - RotateRight, MoveAhead, RotateLeft SideStep - RotateRight/Left, MoveAhead, RotateLeft/Right RotateBack - RotateRight, RotateRight
|
| 306 |
+
Algorithm 1 Navigation/ interaction algorithm in an episode
|
| 307 |
+
1: Input: List of goal tuples - [(obj1, action1), ... , (objk, actionk)] 2: Output: Task Success - True/False 3:
|
| 308 |
+
4: timestep $ 1$ 5: goal pointer $ 1$
|
| 309 |
+
6: Sample $g$ from the semantic search policy
|
| 310 |
+
7: execute interaction $ F a l s e$
|
| 311 |
+
8: $s t o p \gets F a l s e$
|
| 312 |
+
9: subtask success ← F alse
|
| 313 |
+
10: move pointer $ 0$
|
| 314 |
+
11: task success ← F alse
|
| 315 |
+
12:
|
| 316 |
+
13: obji ← objgoal pointer; actioni ← actiongoal pointer
|
| 317 |
+
14:
|
| 318 |
+
15: while goal pointer $\leq k$ do
|
| 319 |
+
16: while timestep $\leq 1 0 0 0$ do
|
| 320 |
+
17: update semantic map
|
| 321 |
+
18: if stop then if execute interaction then Execute actioni if actioni done successfully then subtask success ← T rue else if $o b j _ { i }$ visible in current frame and $o b j _ { i }$ in the center of the frame then execute interacti $m \gets F a l s e$ Execute LookDown $0 ^ { \circ }$ . void action else if previous action was OpenObject or CloseObject and not subtask success then Execute MoveBehind else if previous action was PutObject and not subtask success then Re-dilate $g$ in the semantic map Execute RotateBack else if $o b j _ { i }$ visible but not in center of the frame then Execute SideStep
|
| 322 |
+
36: 37: 38: 39: else $\triangleright$ Rotate with camera horizons $0 ^ { \circ }$ , $4 5 ^ { \circ }$ until $o b j _ { i }$ is visible if move pointer $< 4$ then Execute RotateLeft else
|
| 323 |
+
40: if move pointer $= = 4$ then
|
| 324 |
+
41: Execute LookDown $4 5 ^ { \circ }$
|
| 325 |
+
42: 43: Execute RotateLeft
|
| 326 |
+
44: else move pointer move pointer $+ 1$ (mod 8) if not $( o b j _ { i }$ found) then Execute one of (RotateLeft, RotateRight, MoveAhead) with FMM to $g$ else $g $ closest $o b j _ { i }$ in the semantic map
|
| 327 |
+
50: 51: while distance to $g \geq 0 . 6 5$ meters do Execute one of (RotateLeft, RotateRight, MoveAhead) with FMM to $g$
|
| 328 |
+
52: if distance to $g < 0 . 6 5$ meters then
|
| 329 |
+
53: $s t o p \gets T r u e$
|
| 330 |
+
54: $t i m e s t e p \gets t i m e s t e p + 1$
|
| 331 |
+
55:
|
| 332 |
+
56: if timestep $\equiv 0$ (mod 25) then
|
| 333 |
+
57: Sample new $g$ from the semantic search policy
|
| 334 |
+
58:
|
| 335 |
+
59: if subtask success then
|
| 336 |
+
60: goal pointer $\mathbf { \lambda } \cdot \gets g o a l$ pointer $+ 1$
|
| 337 |
+
61: $\bar { o } b j _ { i } \bar { } o b j _ { s }$ oal pointer; $a c t i o n _ { i } \gets a c t i o n _ { g o a l . p o i n t e r }$
|
| 338 |
+
62: move pointer $ 0$
|
| 339 |
+
63: execute interactio $\iota \gets F a l s e$
|
| 340 |
+
64: $s t o p \gets F a l s e$
|
| 341 |
+
65: subtask success ← F alse
|
| 342 |
+
66: Sample new $g$ from the semantic search policy
|
| 343 |
+
67: break
|
| 344 |
+
68:
|
| 345 |
+
69: if goal pointer $= = k + 1$ then
|
| 346 |
+
70: task success ← T rue
|
| 347 |
+
|
| 348 |
+
# A.6 MORE EXPLANATIONS ON TABLE 3
|
| 349 |
+
|
| 350 |
+
Table 3 shows common error modes and the percentage they take out of all failed episodes, with regards to SR. More specifically, it is showing the distribution of episodes into exactly one error mode, out of the $7 9 . 9 \%$ of all “Val Unseen” episodes that have failed (the episodes not in the $2 0 . 1 0 \%$ of Table 2). The common error modes are failures in (1) locating the subgoal object (due to the small field of view, imperfect segmentation, ineffective exploration), (2) locating the subgoal object because it is in a closed receptacle (cabinet, drawer, etc), (3) interaction (due to object being too far or not in field of view, bad segmentation mask), (4) navigation (collisions), (5) correctly processing language instructions, (6) others, such as the deterministic policy repeating a loop of actions from depth/ segmentation failures and 10 failed actions accruing from a mixture of different errors. These errors occur in the order of (5), (1)/ (2), (3), (4) in an episode, since the LP module operates in the beginning and the object has to be first localized to be interacted with, etc. If an episode ended with errors in multiple categories, it was classified as an example of an ”earlier” error in making Table 3. For example, if the language processing module made an error and later there were also 10 collisions, this episode shown as a case of error (5) in Table 3.
|
| 351 |
+
|
| 352 |
+
A.7 ASSIGNMENTS OF ROOMS INTO “LARGE” AND “SMALL” IN VALID UNSEEN
|
| 353 |
+
|
| 354 |
+
There are 4 distinct scenes in Valid Unseen (one kitchen scene, one living room, one bed room, one bathroom). The kitchen (Large) has a significantly larger area than all the others (Small).
|
| 355 |
+
|
| 356 |
+
# A.8 PROTOCOLS FOR REPRODUCING THE SEMANTIC POLICY
|
| 357 |
+
|
| 358 |
+
The primary result in Table 1 is from architecture tuning of the language processing, the semantic mapping, and the semantic search policy modules on the development data (validation unseen). Reviewers correctly noted that it is possible random seeds will also effect performance so the model was retrained four additional times and test results are reported here. Since components of the language processing and the semantic mapping module were trained from pre-trained weights, we report the performance of FILM with semantic search policy trained from different seeds.
|
| 359 |
+
|
| 360 |
+
The improvement by the semantic policy as shown in Table 1 is reproducible across multiple seeds. Table 8 shows results on Tests Unseen with semantic policy trained with different starting seeds (where SEED 1 denotes that the policy was trained with torch.manual seed(1)). With learning rate of 0.001 and evaluation of every 50 steps, the model with the lowest test loss subject to train loss $< 0 . 6 2$ was chosen. The exact code and commands can be found here: https://github.com/soyeonm/FILM#train-the-semantic-policy.
|
| 361 |
+
|
| 362 |
+
Table 8: Results of FILM reproduced across different starting seeds of the semantic policy. The $\pm$ error bar in the AVG. row denotes the sample variance.
|
| 363 |
+
A.9 A LANGUAGE PROCESSING MODULE WITHOUT THE TEMPLATE ASSUMPTION
|
| 364 |
+
|
| 365 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3">Tests Unseen</td></tr><tr><td>PLWGC</td><td>GC PLWSR</td><td>SR</td></tr><tr><td colspan="4">Low-level + High-level Instructions</td></tr><tr><td>TABLE 1</td><td>15.06 36.37</td><td>10.55</td><td>26.49</td></tr><tr><td>SEED 1</td><td>15.12 38.55</td><td>11.34</td><td>27.86</td></tr><tr><td>SEED 2</td><td>13.82 36.58</td><td>10.13</td><td>25.96</td></tr><tr><td>SEED3</td><td>10.47 37.12</td><td>14.05</td><td>25.64</td></tr><tr><td>SEED 4</td><td>14.22 37.37</td><td>10.69</td><td>26.62</td></tr><tr><td>AVG.</td><td>13.74 37.20</td><td>11.352</td><td>26.51 ± 0.58</td></tr><tr><td colspan="4">High-level Instruction Only</td></tr><tr><td>TABLE 1</td><td>13.13 34.75</td><td>9.67</td><td>24.46</td></tr><tr><td>SEED1</td><td>14.05 36.75</td><td>10.47</td><td>25.51</td></tr><tr><td>SEED 2</td><td>12.60 34.59</td><td>9.07</td><td>23.48</td></tr><tr><td>SEED 3</td><td>12.86 35.02</td><td>9.23</td><td>23.68</td></tr><tr><td>SEED 4</td><td>13.61 36.10</td><td>10.10</td><td>25.18</td></tr><tr><td>AVG.</td><td>13.25 35.44</td><td>9.71</td><td>24.87 ± 0.64</td></tr></table>
|
| 366 |
+
|
| 367 |
+
The second paragraph of section 4.1 explains the template assumption, with the tasks belonging to one of the 7 types. For direct comparison with existing methods that do not take direct advantage of this assumption, we trained a new Language Processing module that does not make use of templates but makes use of the subtasks sequences annotations ALFRED provides.5 Fine-tuning a pre-trained BART (Lewis et al., 2020) model, we directly learned a mapping from a high-level instruction to a sequence of subtasks (e.g. “Drop a clean pan on the table” “(PickupObject, Pan), (PutObject, Sink), ...”). Without any assumption on the structure of the input and the output, this model takes a sequence of tokens as input and outputs a sequence of tokens. With the new LP module, we obtained SR of $1 8 . 0 3 \%$ on valid unseen, which is a slight drop compared to our original $2 0 . 1 0 \%$ , indicating that templates are only marginally helpful in performance.
|
| 368 |
+
|
| 369 |
+
For future research, we believe templates should be used instead of subtasks annotations, since they are much cheaper to obtain in naturalistic settings. In this work, we created the 7 templates (one for each type) by writing down an intuitive canonical set of interactions to successfully perform the task. To do so, we looked at just 7 episodes in the training set and spent less than 20 minutes creating them; these cheaply obtained templates cover all 20,000 training episodes. Even to train an agent to perform more complex tasks, it is more realistic to use templates than assume sub-task annotations.
|
| 370 |
+
|
| 371 |
+
On the other hand, our findings simultaneously suggest the need for a better program synthesis method from instructions to subtask sequences, for general purpose instruction following not bound to certain “types” of instructions.
|
md/dev/slHNW9yRie0/slHNW9yRie0.md
ADDED
|
@@ -0,0 +1,441 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# COLD DIFFUSION: INVERTING ARBITRARY IMAGE TRANSFORMS WITHOUT NOISE
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Standard diffusion models involve an image transform – adding Gaussian noise – and an image restoration operator that inverts this degradation. We observe that the generative behavior of diffusion models is not strongly dependent on the choice of image degradation, and in fact an entire family of generative models can be constructed by varying this choice. Even when using completely deterministic degradations (e.g., blur, masking, and more), the training and test-time update rules that underlie diffusion models can be easily generalized to create generative models. The success of these fully deterministic models calls into question the community’s understanding of diffusion models, which relies on noise in either gradient Langevin dynamics or variational inference, and paves the way for generalized diffusion models that invert arbitrary processes.
|
| 8 |
+
|
| 9 |
+

|
| 10 |
+
Figure 1: Demonstration of the forward and backward processes for both hot and cold diffusions. While standard diffusions are built on Gaussian noise (top row), we show that generative models can be built on arbitrary and even noiseless/cold image transforms, including the ImageNet-C snowification operator, and an animorphosis operator that adds a random animal image from AFHQ.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Diffusion models have recently emerged as powerful tools for generative modeling (Ramesh et al., 2022). Diffusion models come in many flavors, but all are built around the concept of random noise removal; one trains an image restoration/denoising network that accepts an image contaminated with Gaussian noise, and outputs a denoised image. At test time, the denoising network is used to convert pure Gaussian noise into a photo-realistic image using an update rule that alternates between applying the denoiser and adding Gaussian noise. When the right sequence of updates is applied, complex generative behavior is observed.
|
| 15 |
+
|
| 16 |
+
The origins of diffusion models, and also our theoretical understanding of these models, are strongly based on the role played by Gaussian noise during training and generation. Diffusion has been understood as a random walk around the image density function using Langevin dynamics (SohlDickstein et al., 2015; Song & Ermon, 2019), which requires Gaussian noise in each step. The walk begins in a high temperature (heavy noise) state, and slowly anneals into a “cold” state with little if any noise. Another line of work derives the loss for the denoising network using variational inference with a Gaussian prior (Ho et al., 2020; Song et al., 2021a; Nichol & Dhariwal, 2021).
|
| 17 |
+
|
| 18 |
+
In this work, we examine the need for Gaussian noise, or any randomness at all, for diffusion models to work in practice. We consider generalized diffusion models that live outside the confines of the theoretical frameworks from which diffusion models arose. Rather than limit ourselves to models built around Gaussian noise, we consider models built around arbitrary image transformations like blurring, downsampling, etc. We train a restoration network to invert these deformations using a simple $\ell _ { p }$ loss. When we apply a sequence of updates at test time that alternate between the image restoration model and the image degradation operation, generative behavior emerges, and we obtain photo-realistic images.
|
| 19 |
+
|
| 20 |
+
The existence of cold diffusions that require no Gaussian noise (or any randomness) during training or testing raises questions about the limits of our theoretical understanding of diffusion models. It also unlocks the door for potentially new types of generative models with very different properties than conventional diffusion seen so far.
|
| 21 |
+
|
| 22 |
+
# 2 BACKGROUND
|
| 23 |
+
|
| 24 |
+
Both the Langevin dynamics and variational inference interpretations of diffusion models rely on properties of the Gaussian noise used in the training and sampling pipelines. From the scorematching generative networks perspective (Song & Ermon, 2019; Song et al., 2021b), noise in the training process is critically thought to expand the support of the low-dimensional training distribution to a set of full measure in ambient space. The noise is also thought to act as data augmentation to improve score predictions in low density regions, allowing for mode mixing in the stochastic gradient Langevin dynamics (SGLD) sampling. The gradient signal in low-density regions can be further improved during sampling by injecting large magnitudes of noise in the early steps of SGLD and gradually reducing this noise in later stages.
|
| 25 |
+
|
| 26 |
+
Kingma et al. (2021) propose a method to learn a noise schedule that leads to faster optimization. Using a classic statistical result, Kadkhodaie & Simoncelli (2021) show the connection between removing additive Gaussian noise and the gradient of the log of the noisy signal density in deterministic linear inverse problems. Here, we shed light on the role of noise in diffusion models through theoretical and empirical results in applications to inverse problems and image generation.
|
| 27 |
+
|
| 28 |
+
Iterative neural models have been used for various inverse problems (Romano et al., 2016; Metzler et al., 2017). Recently, diffusion models have been applied to them (Song et al., 2021b) for the problems of deblurring, denoising, super-resolution, and compressive sensing (Whang et al., 2021; Kawar et al., 2021; Saharia et al., 2021; Kadkhodaie & Simoncelli, 2021).
|
| 29 |
+
|
| 30 |
+
Although not their focus, previous works on diffusion models have included experiments with deterministic image generation (Song et al., 2021a; Dhariwal & Nichol, 2021; Karras et al., 2022) and in selected inverse problems (Kawar et al., 2022). Recently, Rissanen et al. (2022) use a combination of Gaussian noise and blurring as a forward process for diffusion. Though they show the feasibility of a different degradation, here we show definitively that noise is not a necessity in diffusion models, and we observe the effects of removing noise for a number of inverse problems.
|
| 31 |
+
|
| 32 |
+
Despite prolific work on generative models in recent years, methods to probe the properties of learned distributions and measure how closely they approximate the real training data are by no means closed fields of investigation.
|
| 33 |
+
|
| 34 |
+
Indirect feature space similarity metrics such as Inception Score (Salimans et al., 2016), Mode Score (Che et al., 2016), Frechet inception distance (FID) (Heusel et al., 2017), and Kernel inception distance (KID) (Binkowski et al., 2018) have been proposed and adopted to some extent, but they ´ have notable limitations (Barratt & Sharma, 2018). To adopt a popular frame of reference, we will use FID as the feature similarity metric for our experiments.
|
| 35 |
+
|
| 36 |
+
# 3 GENERALIZED DIFFUSION
|
| 37 |
+
|
| 38 |
+
Standard diffusion models are built around two components. First, there is an image degradation operator that contaminates images with Gaussian noise. Second, a trained restoration operator is created to perform denoising. The image generation process alternates between the application of these two operators. In this work, we consider the construction of generalized diffusions built around arbitrary degradation operations. These degradations can be randomized (as in the case of standard diffusion) or deterministic.
|
| 39 |
+
|
| 40 |
+
# 3.1 MODEL COMPONENTS AND TRAINING
|
| 41 |
+
|
| 42 |
+
Given an image $\boldsymbol { x } _ { 0 } \in \mathbb { R } ^ { N }$ , consider the degradation of $x _ { 0 }$ by operator $D$ with severity $t$ , denoted $x _ { t } = D ( x _ { 0 } , t )$ . The output distribution $D ( x _ { 0 } , t )$ of the degradation should vary continuously in $t$ , and the operator should satisfy $D ( x _ { 0 } , 0 ) = x _ { 0 }$ .
|
| 43 |
+
|
| 44 |
+
In the standard diffusion framework, $D$ adds Gaussian noise with variance proportional to $t$ . In our generalized formulation, we choose $D$ to perform various other transformations such as blurring, masking out pixels, downsampling, and more, with severity that depends on $t$ . We explore a range of choices for $D$ in Section 4.
|
| 45 |
+
|
| 46 |
+
We also require a restoration operator $R$ that (approximately) inverts $D$ . This operator has the property that $R ( x _ { t } , t ) \approx x _ { 0 }$ . In practice, this operator is implemented via a neural network parameterized by $\theta$ . The restoration network is trained via the minimization problem
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\operatorname* { m i n } _ { \theta } \mathbb { E } _ { x \sim \mathcal { X } } \| R _ { \theta } ( D ( x , t ) , t ) - x \| ,
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where $x$ denotes a random image sampled from distribution $\mathcal { X }$ and $\| \cdot \|$ denotes a norm, which we take to be $\ell _ { 1 }$ in our experiments. We have so far used the subscript $R _ { \theta }$ to emphasize the dependence of $R$ on $\theta$ during training, but we will omit this symbol for simplicity in the discussion below.
|
| 53 |
+
|
| 54 |
+
# 3.2 SAMPLING FROM THE MODEL
|
| 55 |
+
|
| 56 |
+
After choosing a degradation $D$ and training a model $R$ to perform the restoration, these operators can be used in tandem to invert severe degradations by using standard methods borrowed from the diffusion literature. For small degradations $\left( t \approx 0 \right)$ ), a single application of $R$ can be used to obtain a restored image in one shot. However, because $R$ is typically trained using a simple convex loss, it yields blurry results when used with large $t$ . Rather, diffusion models (Song et al., 2021a; Ho et al., 2020) perform generation by iteratively applying the denoising operator and then adding noise back to the image, with
|
| 57 |
+
|
| 58 |
+
<table><tr><td>Algorithm 1 Naive Sampling Input: A degraded sample xt</td></tr><tr><td>for s=t,t-1,...,1 do xo←R(xs,s) xs-1= D(xo,s-1) end for</td></tr><tr><td>Return: xo Algorithm 2 Transformation Agnostic Cold Sampling</td></tr><tr><td>Input: A degraded sample xt fors=t,t-1,...,1do</td></tr></table>
|
| 59 |
+
|
| 60 |
+
the level of added noise decreasing over time. This is the standard update sequence in Algorithm 1.
|
| 61 |
+
|
| 62 |
+
When the restoration operator is perfect, i.e. when $R ( D ( x _ { 0 } , t ) , t ) = x _ { 0 }$ for all $t$ , one can easily see that Algorithm 1 produces exact iterates of the form $x _ { s } = D ( x _ { 0 } , s )$ . But what happens for imperfect restoration operators? In this case, errors can cause the iterates $x _ { s }$ to wander away from $D ( x _ { 0 } , s )$ , and inaccurate reconstruction may occur.
|
| 63 |
+
|
| 64 |
+
We find that the standard sampling approach in Algorithm 1 (explained further in A.8) works well for noise-based diffusion, possibly because the restoration operator $R$ has been trained to correct (random Gaussian) errors in its inputs. However, we find that it yields poor results in the case of cold diffusions with smooth/differentiable degradations as demonstrated for a deblurring model in
|
| 65 |
+
|
| 66 |
+
Figure 2. We propose Transformation Agnostic Cold Sampling (TACoS) in Algorithm 2, which we find to be superior for inverting smooth, cold degradations.
|
| 67 |
+
|
| 68 |
+
This sampler has important mathematical properties that enable it to recover high quality results. Specifically, for a class of linear degradation operations, it can be shown to produce exact reconstruction (i.e. $x _ { s } = D ( x _ { 0 } , s ) )$ ) even when the restoration operator $R$ fails to perfectly invert $D$ . We discuss this in the following section.
|
| 69 |
+
|
| 70 |
+
# 3.3 PROPERTIES OF TACOS
|
| 71 |
+
|
| 72 |
+
It is clear from inspection that both Algorithms 1 and 2 perfectly reconstruct the iterate $x _ { s } ~ = ~ D ( x _ { 0 } , s )$ for all $s \ < \ t$ if the restoration operator is a perfect inverse for the degradation operator. In this section, we analyze the stability of these algorithms to errors in the restoration operator.
|
| 73 |
+
|
| 74 |
+
For small values of $x$ and $s$ , TACoS as described in 2 is tolerant of error in the restoration operator $R$ .To see why, consider a model problem with a linear degradation function of the form $D ( x , s ) \approx x { \bar { + } } s \cdot e$ for
|
| 75 |
+
|
| 76 |
+

|
| 77 |
+
Figure 2: Comparison of sampling methods for unconditional generation using cold diffusion on the CelebA dataset. Iterations 2, 4, 8, 16, 32, 64, 128, 192, and 256 are presented. Top: Algorithm 1 produces compounding artifacts and fails to generate a new image. Bottom: TACoS succeeds in sampling a high quality image without noise.
|
| 78 |
+
|
| 79 |
+
a constant vector $e$ . We chose this ansatz because the Taylor expansion of any smooth degradation $D ( x , s )$ around $x = x _ { 0 } , s = 0$ has the form $D ( x , s ) \approx x + s \cdot e ( x ) + { \mathrm { H O T } }$ where HOT denotes higher order terms. Note, however, the analysis below requires $e$ to be a constant that does not depend on $x$ . The constant/zeroth-order term in this Taylor expansion is zero because we assumed above that the degradation operator satisfies $D ( x , 0 ) = { \overset { \cdot } { x } }$ .
|
| 80 |
+
|
| 81 |
+
For a degradation $D ( x , s )$ and any restoration operator $R$ , the term $x _ { s - 1 }$ in TACoS becomes
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\begin{array} { r l } & { x _ { s } - D ( R ( x _ { s } , s ) , s ) + D ( R ( x _ { s } , s ) , s - 1 ) = D ( x _ { 0 } , s ) - D ( R ( x _ { s } , s ) , s ) + D ( R ( x _ { s } , s ) , s - 1 ) } \\ & { \ = x _ { 0 } + s \cdot e - R ( x _ { s } , s ) - s \cdot e + R ( x _ { s } , s ) + ( s - 1 ) \cdot e = x _ { 0 } + ( s - 1 ) = D ( x _ { 0 } , s - 1 ) } \end{array}
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
By induction, we see that the algorithm produces the value $x _ { s } = D ( x _ { 0 } , s )$ for all $s < t$ , regardless of the choice of $R$ . In other words, for any choice of $R$ , the iteration behaves the same as it would when $R$ is a perfect inverse for the degradation $D$ .
|
| 88 |
+
|
| 89 |
+
By contrast, Algorithm 1 does not enjoy this behavior even for small values of $s$ . In fact, when $R$ is not a perfect inverse for $D$ , $x _ { 0 }$ is not a fixed point of the update rule in Algorithm 1 because $x _ { 0 } \neq D ( \bar { R ( x , 0 ) } , 0 ) = R ( x , 0 )$ and hence compounds errors. If $R$ does not perfectly invert $D$ we should expect Algorithm 1 to incur errors, even for small values of $s$ . Meanwhile, for small values of $s$ , the behavior of $D$ approaches its first-order Taylor expansion and Algorithm 2 becomes immune to errors in $R$ . Figure 2 demonstrates the stability of TACoS described in Algorithm 2 vs Algorithm 1 for a deblurring model. Note that our analysis is not meant to be a complete convergence theory, rather to highlight a desirable theoretical property of our method that a naive sampler lacks.
|
| 90 |
+
|
| 91 |
+
# 4 GENERALIZED DIFFUSIONS WITH VARIOUS TRANSFORMATIONS
|
| 92 |
+
|
| 93 |
+
In this section, we take the first step towards cold diffusion by reversing different degradations and hence performing conditional generation. We will extend our methods to perform unconditional (i.e. from scratch) generation in Section 5. We emprically evaluate generalized diffusion models trained on different degradations with TACoS proposed in Algorithm 2. We perform experiments on the vision tasks of deblurring, inpainting, super-resolution, and the unconventional task of synthetic snow removal. We perform our experiments on MNIST (LeCun et al., 1998), CIFAR-10 (Krizhevsky, 2009), and CelebA (Liu et al., 2015). In each of these tasks, we gradually remove the information from the clean image, creating a sequence of images such that $D ( x _ { 0 } , t )$ retains less information than $D ( x _ { 0 } , t - 1 )$ . For these different tasks, we present both qualitative and quantitative results on a held-out testing dataset and demonstrate the importance of the sampling technique described in Algorithm 2. For all quantitative results in this section, the Frechet inception distance (FID) scores (Heusel et al., 2017) for degraded and reconstructed images are measured with respect to the testing data. Additional information about the quantitative results, convergence criteria, hyperparameters, and architecture of the models presented below can be found in the appendix.
|
| 94 |
+
|
| 95 |
+
# 4.1 DEBLURRING
|
| 96 |
+
|
| 97 |
+
We consider a generalized diffusion based on a Gaussian blur operation (as opposed to Gaussian noise) in which an image at step $t$ has more blur than at $t - 1$ . The forward process given the Gaussian kernels $\{ G _ { s } \}$ and the image $x _ { t - 1 }$ at step $t - 1$ can thus be written as
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
x _ { t } = G _ { t } * x _ { t - 1 } = G _ { t } * \ldots * G _ { 1 } * x _ { 0 } = { \bar { G } } _ { t } * x _ { 0 } = D ( x _ { 0 } , t ) ,
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where $^ *$ denotes the convolution operator, which blurs an image using a kernel.
|
| 104 |
+
|
| 105 |
+
We train a deblurring model by minimizing the loss equation 1, and then use TACoS to invert this blurred diffusion process for which we trained a DNN to predict the clean image $\scriptstyle { \hat { x } } _ { 0 }$ . Qualitative results are shown in Figure 3 and quantitative results in Table 1. Qualitatively, we can see that images created using the sampling process are sharper and in some cases completely different as compared to the direct reconstruction of the clean image. Quantitatively we can see that the reconstruction metrics such as RMSE and PSNR get worse when we use the sampling process, but on the other hand FID with respect to held-out test data improves. The qualitative improvements and decrease in FID show the benefits of the generalized sampling routine, which brings the learned distribution closer to the true data manifold.
|
| 106 |
+
|
| 107 |
+
In the case of blur operator, the sampling routine can be thought of adding frequencies at each step. This is because the sampling routine involves the term $D ( \hat { x _ { 0 } } , t ) - D ( \hat { x _ { 0 } } , t - \mathbf { \bar { 1 } } )$ which in the case of blur becomes ${ \bar { G } } _ { t } * x _ { 0 } - { \bar { G } } _ { t - 1 } * x _ { 0 }$ . This results in a difference of Gaussians, which is a band pass filter and contains frequencies that were removed at step $t$ . Thus, in the sampling process, we sequentially add the frequencies that were removed during the degradation process.
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
Figure 3: Deblurring models trained on the MNIST, CIFAR-10, and CelebA datasets. Left to right: degraded inputs $D ( x _ { 0 } , T )$ , direct reconstruction $R ( D ( x _ { 0 } , T ) )$ , sampled reconstruction with TACoS described in Algorithm 2, and original image.
|
| 111 |
+
|
| 112 |
+
Table 1: Quantitative metrics for quality of image reconstruction using deblurring models.
|
| 113 |
+
|
| 114 |
+
<table><tr><td rowspan="2">Dataset</td><td colspan="3">Degraded</td><td colspan="3">Sampled</td><td colspan="3">Direct</td></tr><tr><td>FID</td><td>SSIM</td><td>RMSE</td><td>FID</td><td>SSIM</td><td>RMSE</td><td>FID</td><td>SSIM</td><td>RMSE</td></tr><tr><td>MNIST</td><td>438.59</td><td>0.287</td><td>0.287</td><td>4.69</td><td>0.718</td><td>0.154</td><td>5.10</td><td>0.757</td><td>0.142</td></tr><tr><td>CIFAR-10</td><td>298.60</td><td>0.315</td><td>0.136</td><td>80.08</td><td>0.773</td><td>0.075</td><td>83.69</td><td>0.775</td><td>0.071</td></tr><tr><td>CelebA</td><td>382.81</td><td>0.254</td><td>0.193</td><td>26.14</td><td>0.568</td><td>0.093</td><td>36.37</td><td>0.607</td><td>0.083</td></tr></table>
|
| 115 |
+
|
| 116 |
+
# 4.2 INPAINTING
|
| 117 |
+
|
| 118 |
+
We define a schedule of transforms that progressively grays-out pixels from the input image. We remove pixels using a Gaussian mask as follows: For input images of size $n \times n$ we start with a 2D Gaussian curve of variance $\beta$ , discretized into an $n \times n$ array. We normalize so the peak of the curve has value 1, and subtract the result from 1 so the center of the mask as value 0. We randomize the location of the Gaussian mask for MNIST and CIFAR-10, but keep it centered for CelebA. We denote the final mask by $z _ { \beta }$ .
|
| 119 |
+
|
| 120 |
+
Input images $x _ { 0 }$ are iteratively masked for $T$ steps via multiplication with a sequence of masks $\{ z _ { \beta _ { i } } \}$ with increasing $\beta _ { i }$ . We can control the amount of information removed at each step by tuning the $\beta _ { i }$ parameter. In the language of Section 3, $\begin{array} { r } { D ( x _ { 0 } , t ) = x _ { 0 } \cdot \prod _ { i = 1 } ^ { t } z _ { \beta _ { i } } } \end{array}$ , where the operator $\cdot$ denotes entry-wise multiplication.
|
| 121 |
+
|
| 122 |
+
Figure 4 presents results on test images and compares the output of the inpainting model to the original image. The reconstructed images display reconstructed features qualitatively consistent with the context provided by the unperturbed regions of the image. We quantitatively assess the effectiveness of the inpainting models on each of the datasets by comparing distributional similarity metrics before and after the reconstruction. Our results are summarized in Table 2. Note, the FID scores here are computed with respect to the held-out validation set.
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 4: Inpainting models trained on the MNIST, CIFAR-10, and CelebA datasets. Left to right: Degraded inputs $D ( x _ { 0 } , T )$ , direct reconstruction $R ( D ( x _ { 0 } , T ) )$ , sampled reconstruction with TACoS described in Algorithm 2, and original image.
|
| 126 |
+
|
| 127 |
+
Table 2: Quantitative metrics for quality of image reconstruction using inpainting models.
|
| 128 |
+
|
| 129 |
+
<table><tr><td>Dataset</td><td colspan="3">Degraded</td><td colspan="3">Sampled</td><td colspan="3">Direct</td></tr><tr><td></td><td>FID</td><td>SSIM</td><td>RMSE</td><td>FID</td><td>SSIM</td><td>RMSE</td><td>FID</td><td>SSIM</td><td>RMSE</td></tr><tr><td>MNIST</td><td>108.48</td><td>0.490</td><td>0.262</td><td>1.61</td><td>0.941</td><td>0.068</td><td>2.24</td><td>0.948</td><td>0.060</td></tr><tr><td>CIFAR-10</td><td>40.83</td><td>0.615</td><td>0.143</td><td>8.92</td><td>0.859</td><td>0.068</td><td>9.97</td><td>0.869</td><td>0.063</td></tr><tr><td>CelebA</td><td>127.85</td><td>0.663</td><td>0.155</td><td>5.73</td><td>0.917</td><td>0.043</td><td>7.74</td><td>0.922</td><td>0.039</td></tr></table>
|
| 130 |
+
|
| 131 |
+
# 4.3 SUPER-RESOLUTION
|
| 132 |
+
|
| 133 |
+
For this task, the degradation operator downsamples the image by a factor of two in each direction. The final resolution of $x _ { T }$ is $4 \times 4$ for MNIST and CIFAR-10 and $2 \times 2$ in the case of Celeb-A. After each down-sampling, the lower-resolution image is resized to the original image size, using nearestneighbor interpolation. More details are available in Appendix A.3
|
| 134 |
+
|
| 135 |
+
Figure 5 presents example testing data inputs for all datasets and compares the output of the superresolution model to the original image. Though the reconstructed images are not perfect for the more challenging datasets, the reconstructed features are qualitatively consistent with the context provided by the low resolution image. Table 3 compares the distributional similarity metrics between degraded/reconstructed images and test samples.
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
Figure 5: Superresolution models trained on the MNIST, CIFAR-10, and CelebA datasets. Left to right: degraded inputs $D ( x _ { 0 } , T )$ , direct reconstruction $R ( D ( x _ { 0 } , T ) )$ , sampled reconstruction with TACoS described in Algorithm 2, and original image.
|
| 139 |
+
|
| 140 |
+
Table 3: Quantitative metrics for quality of image reconstruction using super-resolution models.
|
| 141 |
+
|
| 142 |
+
<table><tr><td rowspan="2">Dataset</td><td colspan="3">Degraded</td><td colspan="3">Sampled</td><td colspan="3">Direct</td></tr><tr><td>FID</td><td>SSIM</td><td>RMSE</td><td>FID</td><td>SSIM</td><td>RMSE</td><td>FID</td><td>SSIM</td><td>RMSE</td></tr><tr><td>MNIST</td><td>368.56</td><td>0.178</td><td>0.231</td><td>4.33</td><td>0.820</td><td>0.115</td><td>4.05</td><td>0.823</td><td>0.114</td></tr><tr><td>CIFAR-10</td><td>358.99</td><td>0.279</td><td>0.146</td><td>152.76</td><td>0.411</td><td>0.155</td><td>169.94</td><td>0.420</td><td>0.152</td></tr><tr><td>CelebA</td><td>349.85</td><td>0.335</td><td>0.225</td><td>96.92</td><td>0.381</td><td>0.201</td><td>112.84</td><td>0.400</td><td>0.196</td></tr></table>
|
| 143 |
+
|
| 144 |
+
# 4.4 SNOWIFICATION
|
| 145 |
+
|
| 146 |
+
Apart from traditional degradations, we additionally provide results for the task of synthetic snow removal using the offical implementation of the snowification transform from ImageNet-C (Hendrycks & Dietterich, 2019). The purpose of this experiment is to demonstrate that generalized diffusion can succeed even with exotic transforms that lack the scale-space and compositional properties of blur operators. Similar to other tasks, we degrade the images by adding snow, such that the level of snow increases with step $t$ . We provide more implementation details in Appendix.
|
| 147 |
+
|
| 148 |
+
We illustrate our desnowification results in Figure 6. We present testing examples, as well as their snowified images, from all the datasets, and compare the desnowified results with the original images. The desnowified images feature near-perfect reconstruction results for CIFAR-10 examples with lighter snow, and exhibit visually distinctive restoration for Celeb-A examples with heavy snow. We provide quantitative results in Table 4.
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 6: Desnowification models trained on the CIFAR-10, and CelebA datasets. Left to right: degraded inputs $D ( x _ { 0 } , T )$ , direct reconstruction $R ( D ( x _ { 0 } , T ) )$ , sampled reconstruction with TACoS described in Algorithm 2, and original image.
|
| 152 |
+
|
| 153 |
+
Table 4: Quantitative metrics for quality of image reconstruction using desnowification models.
|
| 154 |
+
|
| 155 |
+
<table><tr><td>Dataset</td><td>FID</td><td>Degraded Image SSIM</td><td>RMSE</td><td>FID</td><td>Reconstruction SSIM</td><td>RMSE</td></tr><tr><td>CIFAR-10</td><td>125.63</td><td>0.419</td><td>0.327</td><td>31.10</td><td>0.074</td><td>0.838</td></tr><tr><td>CelebA</td><td>398.31</td><td>0.338</td><td>0.283</td><td>27.09</td><td>0.033</td><td>0.907</td></tr></table>
|
| 156 |
+
|
| 157 |
+
# 5 COLD GENERATION
|
| 158 |
+
|
| 159 |
+
Diffusion models can successfully learn the underlying distribution of training data, and thus generate diverse, high quality images (Song et al., 2021a; Dhariwal & Nichol, 2021; Jolicoeur-Martineau et al., 2021; Ho et al., 2022). We will first discuss deterministic generation using Gaussian noise and then discuss in detail unconditional generation using deblurring. Finally, we provide a proof of concept that the TACoS described in Algorithm 2 can be extended to other degradations.
|
| 160 |
+
|
| 161 |
+
# 5.1 GENERATION USING DETERMINISTIC NOISE DEGRADATION
|
| 162 |
+
|
| 163 |
+
Here we discuss image generation using a noise-based degradation presented in our notation from Section 3, which we will later prove is equivalent to DDIM (Song et al., 2021a). We use the following degradation operator: $D ( \dot { x _ { , } } t ) = \sqrt { \dot { \alpha _ { t } } } x + \sqrt { 1 - \alpha _ { t } } z$ .
|
| 164 |
+
|
| 165 |
+
$D$ is an interpolation between the data point $x$ and a sampled noise pattern $z \in \mathcal { N } ( 0 , 1 )$ . During training, $D$ is applied once and thus $z$ is sampled once for every image in every batch. However, sampling involves iterative applications of the degradation operator $D$ , which poses the question of how to pick $z$ for the sequence of degradations $D$ applied in a single image generation.
|
| 166 |
+
|
| 167 |
+
There are three possible choices for $z$ . The first would be to resample $z$ for each application of $D$ , but this would make the sampling process nondeterministic for a fixed starting point. Another option is to sample a noise pattern $z$ once for each separate image generation and reuse it in each application of $D$ . In Table 5 we refer to this approach as Fixed Noise. Finally, one can calculate the noise vector $z$ to be used in step $t$ of reconstruction by using the formula
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
\widehat { z } ( x _ { t } , t ) = \frac { x _ { t } - \sqrt { \alpha _ { t } } R ( x _ { t } , t ) } { \sqrt { 1 - \alpha _ { t } } } .
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
This method denoted Estimated Noise in Table 5 turns out to be equivalent to the deterministic sampling proposed in Song et al. (2021a). We discuss this equivalence in detail in Appendix A.6.
|
| 174 |
+
|
| 175 |
+
# 5.2 IMAGE GENERATION USING BLUR
|
| 176 |
+
|
| 177 |
+
The forward diffusion process in noise-based diffusion models has the advantage that the degraded image distribution at the final step $T$ is simply an isotropic Gaussian. One can therefore perform (unconditional) generation by first drawing a sample from the isotropic Gaussian, and sequentially denoising it with backward diffusion.
|
| 178 |
+
|
| 179 |
+
When using blur as a degradation, the fully degraded images do not form a nice closed-form distribution that we can sample from. They do, however, form a simple enough distribution that can be modeled with simple methods. Note that every image $x _ { 0 }$ degenerates to an $x _ { T }$ that is constant (i.e., every pixel is the same color) for large $T$ . Furthermore, the constant value is exactly the channelwise mean of the RGB image $x _ { 0 }$ , and can be represented with a 3-vector. This 3-dimensional distribution is easily represented using a Gaussian mixture model (GMM). This GMM can be sampled to produce the random pixel values of a severely blurred image, which can be deblurred using cold diffusion to create a new image.
|
| 180 |
+
|
| 181 |
+
Our generative model uses a blurring schedule where we progressively blur each image with a Gaussian kernel of size $2 7 \times 2 7$ over 300 steps. The standard deviation of the kernel starts at 1 and increases exponentially at the rate of 0.01. We then fit a simple GMM with one component to the distribution of channel-wise means. To generate an image from scratch, we sample the channel-wise mean from the GMM, expand the 3D vector into a $1 2 8 \times 1 2 8$ image with three channels, and then apply TACoS.
|
| 182 |
+
|
| 183 |
+
Empirically, the presented pipeline generates images with high fidelity but low diversity, as reflected quantitatively by comparing the perfect symmetry column with results from hot diffusion in Table 5. We attribute this to the perfect correlation between pixels of $x _ { T }$ sampled from the channel-wise mean Gaussian mixture model. To break the symmetry between pixels, we add a small amount of Gaussian noise (of standard deviation 0.002) to each sampled $x _ { T }$ . As shown in Table 5, the simple trick drastically improves the quality of generated images. We also present the qualitative results for cold diffusion using blur transformation in Figure 7, and further discuss the necessity of TACoS proposed in Algorithm 2 for generation in Appendix A.7.
|
| 184 |
+
|
| 185 |
+
Table 5: FID scores for CelebA and AFHQ datasets using hot (noise) and cold diffusion (blur transformation). Breaking the symmetry within pixels of the same channel further improves FID.
|
| 186 |
+
|
| 187 |
+
<table><tr><td></td><td colspan="2">Hot Diffusion</td><td colspan="2">Cold Diffusion</td></tr><tr><td>Dataset</td><td>Fixed Noise</td><td>Estimated Noise</td><td>Perfect symmetry</td><td>Broken symmetry</td></tr><tr><td>CelebA</td><td>59.91</td><td>23.11</td><td>97.00</td><td>49.45</td></tr><tr><td>AFHQ</td><td>25.62</td><td>20.59</td><td>93.05</td><td>54.68</td></tr></table>
|
| 188 |
+
|
| 189 |
+

|
| 190 |
+
Figure 7: Examples of generated samples from $1 2 8 \times 1 2 8$ CelebA and AFHQ datasets using cold diffusion with blur transformation
|
| 191 |
+
|
| 192 |
+
# 5.3 GENERATION USING OTHER TRANSFORMATIONS
|
| 193 |
+
|
| 194 |
+
In this section, we provide a proof of concept that generation can be extended to other transformations. Specifically, we show preliminary results on inpainting, super-resolution, and animorphosis.
|
| 195 |
+
|
| 196 |
+
Inspired by the simplicity of the degraded image distribution for the blurring routine presented in the previous section, we use degradation routines with predictable final distributions here as well.
|
| 197 |
+
|
| 198 |
+
To use the Gaussian mask transformation for generation, we modify the masking routine so the final degraded image is completely devoid of information. One might think a natural option is to send all of the images to a completely black image $x _ { T }$ , but this would not allow for any diversity in generation. To get around this maximally non-injective property, we instead make the mask turn all pixels to a random, solid color. This still removes all of the information from the image, but it allows us to recover different samples from the learned distribution via Algorithm 2 by starting off with different color images. More formally, a Gaussian mask $\begin{array} { r } { G _ { t } = \prod _ { i = 1 } ^ { t } \bar { z } _ { \beta _ { i } } } \end{array}$ is created in a similar way as discussed in the Section 4.2, but instead of multiplying it directly to the image $x _ { 0 }$ , we create $x _ { t }$ as $G _ { t } \cdot x _ { 0 } + ( 1 - G _ { t } ) \cdot c$ , where $c$ is an image of a randomly sampled color.
|
| 199 |
+
|
| 200 |
+
For super-resolution, the routine down-samples to a resolution of $2 \times 2$ , or 4 values in each channel. These degraded images can be represented as one-dimensional vectors, and their distribution is modeled using one Gaussian distribution. Using the same methods described for generation using blurring described above, we sample from this Gaussian-fitted distribution of the lower-dimensional degraded image space and pass this sampled point through the generation process trained on superresolution data to create one output.
|
| 201 |
+
|
| 202 |
+
Additionally to show one can invert nearly any transformation, we include a new transformation deemed animorphosis, where we iteratively transform a human face from CelebA to an animal face from AFHQ. Though we chose CelebA and AFHQ for our experimentation, in principle such interpolation can be done for any two initial data distributions.
|
| 203 |
+
|
| 204 |
+
More formally, given an image √ $x$ and a random image $z$ sampled from the AFHQ manifold, $x _ { t }$ can be written as $\begin{array} { r } { \dot { x _ { t } } = \sqrt { \alpha _ { t } } x + \dot { \sqrt { 1 - \alpha _ { t } } } z } \end{array}$ . Note this is essentially the same as the noising procedure, but instead of adding noise we are adding a progressively higher weighted AFHQ image. In order to sample from the learned distribution, we sample a random image of an animal and use TACoS.
|
| 205 |
+
|
| 206 |
+
We present results for the CelebA dataset, and hence the quantitative results in terms of FID scores for inpainting, super-resolution and animorphosis are 90.14, 92.91 and 48.51 respectively. We further show some qualitative samples in Figure 8, and in Figure 1.
|
| 207 |
+
|
| 208 |
+

|
| 209 |
+
Figure 8: Preliminary demonstration of the generative abilities of other cold diffusins on the $1 2 8 \times$ 128 CelebA dataset. The top row is with animorphosis models, the middle row is with inpainting models, and the bottom row exhibits super-resolution models.
|
| 210 |
+
|
| 211 |
+
# 6 CONCLUSION
|
| 212 |
+
|
| 213 |
+
Existing diffusion models rely on Gaussian noise for both forward and reverse processes. In this work, we find that the random noise can be removed entirely from the diffusion model framework, and replaced with arbitrary transforms. In doing so, our generalization of diffusion models and their sampling procedures allows us to restore images afflicted by deterministic degradations such as blur, inpainting and downsampling. This framework paves the way for a more diverse landscape of diffusion models beyond the Gaussian noise paradigm. The different properties of these diffusions may prove useful for a range of applications, including image generation and beyond.
|
| 214 |
+
|
| 215 |
+
# REPRODUCIBILITY STATEMENT
|
| 216 |
+
|
| 217 |
+
We provided our full code base as supplementary material, which is a modified version of the traditional diffusion database found at https://github.com/lucidrains/denoising-diffusion-pytorch. To facilitate the reproducibility of our results, we have included detailed hyperparameters for training each of our cold diffusion models in Appendices A.1-A.5. Due to space constraints in the main body, we opted to present a relatively small number of qualitative results. Many more examples of both conditionally and unconditionally generated images can be found in the Appendix.
|
| 218 |
+
|
| 219 |
+
# REFERENCES
|
| 220 |
+
|
| 221 |
+
Shane Barratt and Rishi Sharma. A note on the inception score. arXiv preprint arXiv:1801.01973, 2018.
|
| 222 |
+
|
| 223 |
+
Mikołaj Binkowski, Danica J Sutherland, Michael Arbel, and Arthur Gretton. Demystifying mmd ´ gans. arXiv preprint arXiv:1801.01401, 2018.
|
| 224 |
+
|
| 225 |
+
Tong Che, Yanran Li, Athul Paul Jacob, Yoshua Bengio, and Wenjie Li. Mode regularized generative adversarial networks. arXiv preprint arXiv:1612.02136, 2016.
|
| 226 |
+
|
| 227 |
+
Prafulla Dhariwal and Alexander Quinn Nichol. Diffusion models beat gans on image synthesis. volume 34, 2021.
|
| 228 |
+
|
| 229 |
+
Dan Hendrycks and Thomas G. Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In International Conference on Learning Representations, ICLR 2019. OpenReview.net, 2019.
|
| 230 |
+
|
| 231 |
+
Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. Advances in neural information processing systems, 30, 2017.
|
| 232 |
+
|
| 233 |
+
Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in Neural Information Processing Systems, 32, 2020.
|
| 234 |
+
|
| 235 |
+
Jonathan Ho, Chitwan Saharia, William Chan, David J. Fleet, Mohammad Norouzi, and Tim Salimans. Cascaded diffusion models for high fidelity image generation. J. Mach. Learn. Res., 23, 2022.
|
| 236 |
+
|
| 237 |
+
Alexia Jolicoeur-Martineau, Remi Pich ´ e-Taillefer, Ioannis Mitliagkas, and Remi Tachet des ´ Combes. Adversarial score matching and improved sampling for image generation. International Conference on Learning Representations, 2021.
|
| 238 |
+
|
| 239 |
+
Zahra Kadkhodaie and Eero Simoncelli. Stochastic solutions for linear inverse problems using the prior implicit in a denoiser. Advances in Neural Information Processing Systems, 34, 2021.
|
| 240 |
+
|
| 241 |
+
Tero Karras, Miika Aittala, Timo Aila, and Samuli Laine. Elucidating the design space of diffusionbased generative models. arXiv preprint arXiv:2206.00364, 2022.
|
| 242 |
+
|
| 243 |
+
Bahjat Kawar, Gregory Vaksman, and Michael Elad. Stochastic image denoising by sampling from the posterior distribution. International Conference on Computer Vision Workshops, 2021.
|
| 244 |
+
|
| 245 |
+
Bahjat Kawar, Michael Elad, Stefano Ermon, and Jiaming Song. Denoising diffusion restoration models. arXiv preprint arXiv:2201.11793, 2022.
|
| 246 |
+
|
| 247 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 248 |
+
|
| 249 |
+
Diederik P. Kingma, Tim Salimans, Ben Poole, and Jonathan Ho. On density estimation with diffusion models. Advances in Neural Information Processing Systems, 34, 2021.
|
| 250 |
+
|
| 251 |
+
Alex Krizhevsky. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 252 |
+
|
| 253 |
+
Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to´ document recognition. Proc. IEEE, 86(11):2278–2324, 1998.
|
| 254 |
+
|
| 255 |
+
Ziwei Liu, Ping Luo, Xiaogang Wang, and Xiaoou Tang. Deep learning face attributes in the wild. In Proceedings of International Conference on Computer Vision (ICCV), December 2015.
|
| 256 |
+
|
| 257 |
+
Christopher A. Metzler, Ali Mousavi, and Richard G. Baraniuk. Learned D-AMP: principled neural network based compressive image recovery. Advances in Neural Information Processing Systems, 30, 2017.
|
| 258 |
+
|
| 259 |
+
Alexander Quinn Nichol and Prafulla Dhariwal. Improved denoising diffusion probabilistic models. In Proceedings of the 38th International Conference on Machine Learning, volume 139 of Proceedings of Machine Learning Research, pp. 8162–8171, 2021.
|
| 260 |
+
|
| 261 |
+
Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical textconditional image generation with clip latents. arXiv preprint arXiv:2204.06125, 2022.
|
| 262 |
+
|
| 263 |
+
Severi Rissanen, Markus Heinonen, and Arno Solin. Generative modelling with inverse heat dissipation. arXiv preprint arXiv:2206.13397, 2022.
|
| 264 |
+
|
| 265 |
+
Yaniv Romano, Michael Elad, and Peyman Milanfar. The little engine that could: Regularization by denoising (RED). arXiv preprint arXiv:1611.02862, 2016.
|
| 266 |
+
|
| 267 |
+
Chitwan Saharia, Jonathan Ho, William Chan, Tim Salimans, David J. Fleet, and Mohammad Norouzi. Image super-resolution via iterative refinement. arXiv preprint arXiv:2104.07636, 2021.
|
| 268 |
+
|
| 269 |
+
Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. Advances in neural information processing systems, 29, 2016.
|
| 270 |
+
|
| 271 |
+
Jascha Sohl-Dickstein, Eric A. Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In International Conference on Machine Learning, volume 37 of JMLR Workshop and Conference Proceedings, 2015.
|
| 272 |
+
|
| 273 |
+
Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. International Conference on Learning Representations, 2021a.
|
| 274 |
+
|
| 275 |
+
Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. Advances in Neural Information Processing Systems, 32, 2019.
|
| 276 |
+
|
| 277 |
+
Yang Song, Jascha Sohl-Dickstein, Diederik P. Kingma, Abhishek Kumar, Stefano Ermon, and Ben Poole. Score-based generative modeling through stochastic differential equations. International Conference on Learning Representations, 2021b.
|
| 278 |
+
|
| 279 |
+
Jay Whang, Mauricio Delbracio, Hossein Talebi, Chitwan Saharia, Alexandros G. Dimakis, and Peyman Milanfar. Deblurring via stochastic refinement. arXiv preprint arXiv:2112.02475, 2021.
|
| 280 |
+
|
| 281 |
+
# A APPENDIX
|
| 282 |
+
|
| 283 |
+
# A.1 DEBLURRING
|
| 284 |
+
|
| 285 |
+
For the deblurring experiments, we train the models on different datasets for 700,000 gradient steps. We use the Adam (Kingma & Ba, 2014) optimizer with learning rate $2 \times 1 0 ^ { - 5 }$ . The training was done on the batch size of 32, and we accumulate the gradients every 2 steps. Our final model is an Exponential Moving Average of the trained model with decay rate 0.995 which is updated after every 10 gradient steps.
|
| 286 |
+
|
| 287 |
+
For the MNIST dataset, we blur recursively 40 times, with a discrete Gaussian kernel of size 11x11 and a standard deviation 7. In the case of CIFAR-10, we recursively blur with a Gaussian kernel of fixed size 11x11, but at each step $t$ , the standard deviation of the Gaussian kernel is given by $0 . 0 1 * t + 0 . 3 5$ . The blur routine for CelebA dataset involves blurring images with a Gaussian kernel of 15x15 and the standard deviation of the Gaussian kernel grows exponentially with time $t$ at the rate of 0.01.
|
| 288 |
+
|
| 289 |
+

|
| 290 |
+
Figure 9 shows an additional nine images for each of MNIST, CIFAR-10 and CelebA. Figures 19 and 20 show the iterative sampling process using a deblurring model for ten example images from each dataset. We further show 400 random images to demonstrate the qualitative results in the Figure 21.
|
| 291 |
+
Figure 9: Additional examples from deblurring models trained on the MNIST, CIFAR-10, and CelebA datasets. Left to right: degraded inputs $D ( x _ { 0 } , T )$ , direct reconstruction $R ( D ( x _ { 0 } , T ) )$ , sampled reconstruction with TACoS described in Algorithm 2, and original image.
|
| 292 |
+
|
| 293 |
+
# A.2 INPAINTING
|
| 294 |
+
|
| 295 |
+
For the inpainting transformation, models were trained on different datasets with 60,000 gradient steps. The models were trained using Adam (Kingma & Ba, 2014) optimizer with learning rate $2 \times$ $1 0 ^ { \div { 5 } }$ . We use batch size 64, and the gradients are accumulated after every 2 steps. The final model is an Exponential Moving Average of the trained model with decay rate 0.995. This EMA model is updated after every 10 gradient steps. For all our inpainting experiments we use a randomized Gaussian mask and $T = 5 0$ with $\beta _ { 1 } = 1$ and $\beta _ { i + 1 } = \beta _ { i } + 0 . 1$ .
|
| 296 |
+
|
| 297 |
+
To avoid potential leakage of information due to floating point computation of the Gaussian mask, we discretize the masked image before passing it through the inpainting model. This was done by rounding all pixel values to the eight most significant digits.
|
| 298 |
+
|
| 299 |
+
Figure 11 shows nine additional inpainting examples on each of the MNIST, CIFAR-10, and CelebA datasets. Figure 10 demonstrates an example of the iterative sampling process of an inpainting model for one image in each dataset.
|
| 300 |
+
|
| 301 |
+
# A.3 SUPER-RESOLUTION
|
| 302 |
+
|
| 303 |
+
We train the super-resolution model per Section 3.1 for 700,000 iterations. We use the Adam (Kingma & Ba, 2014) optimizer with learning rate $2 \times 1 0 ^ { - 5 }$ . The batch size is 32, and we accumulate the gradients every 2 steps. Our final model is an Exponential Moving Average of the trained model with decay rate 0.995. We update the EMA model every 10 gradient steps.
|
| 304 |
+
|
| 305 |
+
The number of time-steps depends on the size of the input image and the final image. For MNIST and for CIFAR10, the number of time steps is 3, as it takes three steps of halving the resolution to reduce the initial image down to $4 \times 4$ . For CelebA, the number of time steps is 6 to reduce the initial image down to $2 \times 2$ . For CIFAR10, we apply random crop and random horizontal flip for regularization.
|
| 306 |
+
|
| 307 |
+
Figure 13 shows an additional nine super-resolution examples on each of the MNIST, CIFAR-10, and CelebA datasets. Figure 12 shows one example of the progressive increase in resolution achieved with the sampling process using a super-resolution model for each dataset.
|
| 308 |
+
|
| 309 |
+
# A.4 COLORIZATION
|
| 310 |
+
|
| 311 |
+
Here we provide results for the additional task of colorization. Starting with the original RGBimage $x _ { 0 }$ , we realize colorization by iteratively desaturating for $T$ steps until the final image $x _ { T }$ is a fully gray-scale image. We use a series of three-channel $1 \times 1$ convolution filters ${ \mathbf z } ( \alpha ) \ : = \ : $ $\{ z ^ { 1 } ( \alpha ) , \bar { z } ^ { 2 } ( \alpha ) , z ^ { 3 } ( \alpha ) \}$ with the form
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
\begin{array} { c } { { z ^ { 1 } ( \alpha ) = \alpha \left( \frac 1 3 \frac 1 3 \frac 1 3 \right) + \left( 1 - \alpha \right) ( 1 0 0 ) } } \\ { { z ^ { 2 } ( \alpha ) = \alpha \left( \frac 1 3 \frac 1 3 \frac 1 3 \right) + ( 1 - \alpha ) ( 0 1 0 ) } } \\ { { z ^ { 3 } ( \alpha ) = \alpha \left( \frac 1 3 \frac 1 3 \frac 1 3 \right) + ( 1 - \alpha ) ( 0 0 1 ) } } \end{array}
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
and obtain $D ( x , t ) = \mathbf { z } ( \alpha _ { t } ) * x$ via a schedule defined as $\alpha _ { 1 } , \ldots , \alpha _ { t }$ for each respective step. Notice that a gray image is obtained when $x _ { T } = { \bf z } ( 1 ) * x _ { 0 }$ .
|
| 318 |
+
|
| 319 |
+
We can tune the ratio $\alpha _ { t }$ to control the amount of information removed in each step. For our experiment, we schedule the ratio such that for every $t$ we have
|
| 320 |
+
|
| 321 |
+
$$
|
| 322 |
+
x _ { t } = \mathbf { z } ( \alpha _ { t } ) * \ldots * \mathbf { z } ( \alpha _ { 1 } ) * x _ { 0 } = \mathbf { z } ( \frac { t } { T } ) * x _ { 0 } .
|
| 323 |
+
$$
|
| 324 |
+
|
| 325 |
+
This schedule ensures that color information lost between steps is smaller in earlier stage of the diffusion and becomes larger as $t$ increases.
|
| 326 |
+
|
| 327 |
+
We train the models on different datasets for 700,000 gradient steps. We use Adam (Kingma & Ba, 2014) optimizer with learning rate $2 \times 1 0 ^ { - 5 }$ . We use batch size 32, and we accumulate the gradients every 2 steps. Our final model is an exponential moving average of the trained model with decay rate 0.995. We update the EMA model every 10 gradient steps. For CIFAR-10 we use $T = 5 0$ and for CelebA we use $T = 2 0$ .
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure 10: Progressive inpainting of selected masked MNIST, CIFAR-10, and CelebA images.
|
| 331 |
+
|
| 332 |
+

|
| 333 |
+
Figure 11: Additional examples from inpainting models trained on the MNIST, CIFAR-10, and CelebA datasets. Left to right: degraded inputs $D ( x _ { 0 } , T )$ , direct reconstruction $R ( D ( x _ { 0 } , T ) )$ , sampled reconstruction with TACoS described in Algorithm 2, and original image.
|
| 334 |
+
|
| 335 |
+

|
| 336 |
+
Figure 12: Progressive upsampling of selected downsampled MNIST, CIFAR-10, and CelebA images. The original image is at the left for each of these progressive upsamplings.
|
| 337 |
+
|
| 338 |
+
We illustrate our recolorization results in Figure 14. We present testing examples, as well as their grey scale images, from all the datasets, and compare the recolorization results with the original images. The recolored images feature correct color separation between different regions, and feature various and yet semantically correct colorization of objects. Our sampling technique still yields minor differences in comparison to the direct reconstruction, although the change is not visually apparent. We attribute this to the shape restriction of colorization task, as human perception is rather insensitive to minor color change. We also provide quantitative measurement for the effectiveness of our recolorization results in terms of different similarity metrics, and summarize the results in Table 6.
|
| 339 |
+
|
| 340 |
+
Table 6: Quantitative metrics for quality of image reconstruction using recolorization models for all three channel datasets.
|
| 341 |
+
|
| 342 |
+
<table><tr><td></td><td colspan="3">Degraded Image</td><td colspan="3">Reconstruction</td></tr><tr><td>Dataset</td><td>FID</td><td>SSIM</td><td>RMSE</td><td>FID</td><td>SSIM</td><td>RMSE</td></tr><tr><td>CIFAR-10</td><td>97.39</td><td>0.937</td><td>0.078</td><td>45.74</td><td>0.942</td><td>0.069</td></tr><tr><td>CelebA</td><td>41.20</td><td>0.942</td><td>0.089</td><td>17.50</td><td>0.973</td><td>0.042</td></tr></table>
|
| 343 |
+
|
| 344 |
+

|
| 345 |
+
Figure 13: Additional examples from super-resolution models trained on the MNIST, CIFAR-10, and CelebA datasets. Left to right: degraded inputs $D ( x _ { 0 } , T )$ , direct reconstruction $R ( D ( x _ { 0 } , T ) )$ , sampled reconstruction with TACoS described in Algorithm 2, and original image.
|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
Figure 14: Recolorization models trained on the CIFAR-10 and CelebA datasets. Left to right: degraded inputs $D ( x _ { 0 } , T )$ , direct reconstruction $R ( D ( x _ { 0 } , T ) )$ , sampled reconstruction with TACoS described in Algorithm 2, and original image.
|
| 349 |
+
|
| 350 |
+
# A.5 IMAGE SNOW
|
| 351 |
+
|
| 352 |
+
Here we provide results for the additional task of snowification, which is a direct adaptation of the offical implementation of ImageNet-C snowification process (Hendrycks & Dietterich, 2019). To determine the snow pattern of a given image $\boldsymbol { x } _ { 0 } \in \mathbb { R } ^ { \boldsymbol { \dot { C } } \times \boldsymbol { H } \times \boldsymbol { W } }$ , we first construct a seed matrix $S _ { A } \in \mathbb { R } ^ { H \times W }$ where each entry is sampled from a Gaussian distribution $N ( \mu , \sigma )$ . The upper-left corner of $S _ { A }$ is then zoomed into another matrix $S _ { B } \in \mathbb { R } ^ { H \times W }$ with spline interpolation. Next, we create a new matrix $S _ { C }$ by filtering each value of $S _ { B }$ with a given threshold $c _ { 1 }$ as
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
\begin{array} { r } { S _ { C } [ i ] [ j ] = \left\{ \begin{array} { l l } { 0 , } & { S _ { B } [ i ] [ j ] \le c _ { 1 } } \\ { S _ { B } [ i ] [ j ] , } & { S _ { B } [ i ] [ j ] > c _ { 1 } } \end{array} \right. } \end{array}
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
and clip each entry of $S _ { C }$ into the range $[ 0 , 1 ]$ . We then convolve $S _ { C }$ using a motion blur kernel with standard deviation $c _ { 2 }$ to create the snow pattern $S$ and its up-side-down rotation $S ^ { \prime }$ . The direction of the motional blur kernel is randomly chosen as either vertical or horizontal. The final snow image is created by again clipping each value of $x _ { 0 } + S + S ^ { \prime }$ into the range $[ 0 , 1 ]$ . For simplicity, we abstract the process as a function $h ( x _ { 0 } , S _ { A } , c _ { 0 } , c _ { 1 } )$ .
|
| 359 |
+
|
| 360 |
+

|
| 361 |
+
Figure 15: Additional examples from Desnowification models trained on the CIFAR-10 and CelebA datasets. Left to right: degraded inputs $D ( x _ { 0 } , T )$ , direct reconstruction $R ( D ( x _ { 0 } , T ) )$ , sampled reconstruction with TACoS described in Algorithm 2, and original image.
|
| 362 |
+
|
| 363 |
+
To create a series of between $[ c _ { 0 } ^ { \mathrm { s t a r t } } , c _ { 0 } ^ { \mathrm { e n d } } ]$ and $T$ images with increasing snowification, we linearly interpolate $[ c _ { 1 } ^ { \mathrm { s t a r f } } , c _ { 1 } ^ { \mathrm { e n d } } ]$ respectively, to create $c _ { 0 } ( t )$ and $c _ { 1 } ( t )$ , $t = 1 , \dots , T$ . Then for $c _ { 0 }$ and $c _ { 1 }$ each $x _ { 0 }$ , a seed matrix $S _ { x }$ is sampled, the motion blur direction is randomized, and we construct each related $x _ { t }$ by $x _ { t } = h ( x _ { 0 } , S _ { x } , c _ { 0 } ( t ) , c _ { 1 } ( t ) )$ . Visually, $c _ { 0 } ( t )$ dictates the severity of the snow, while $c _ { 1 } ( t )$ determines how “windy” the snowified image seems.
|
| 364 |
+
|
| 365 |
+
For both CIFAR-10 and Celeb-A, we use the same Gaussian distribution with parameters $\mu = 0 . 5 5$ and $\sigma = 0 . 3$ to generate the seed matrix. For CIFAR-10, we choose $c _ { 0 } ^ { \mathrm { s t a r t } } = 1 . 1 5$ , $c _ { 0 } ^ { \mathrm { e n d } } = 0 . 7$ , $c _ { 1 } ^ { \mathrm { s t a r t } } = 0 . 0 5$ and $c _ { 1 } ^ { \mathrm { e n d } } = 1 6$ 0 0 , which generates a visually lighter snow. For Celeb-A, we choose $c _ { 0 } ^ { \mathrm { s t a r t } } = 1 . 1 5$ , $c _ { 0 } ^ { \mathrm { e n d } } = 0 . 5 5$ , $c _ { 1 } ^ { \mathrm { s t a r t } } = 0 . 0 5$ and $c _ { 1 } ^ { \mathrm { e n d } } = 2 0 $ , which generates a visually heavier snow.
|
| 366 |
+
|
| 367 |
+
We train the models on different datasets for 700,000 gradient steps. We use Adam (Kingma & Ba, 2014) optimizer with learning rate $2 \times 1 0 ^ { - 5 }$ . We use batch size 32, and we accumulate the gradients every 2 steps. Our final model is an exponential moving average of the trained model with decay rate 0.995. We update the EMA model every 10 gradient steps. For CIFAR-10 we use $T = 2 0 0$ and for CelebA we use $T = 2 0 0$ . We note that the seed matrix is resampled for each individual training batch, and hence the snow pattern varies across the training stage.
|
| 368 |
+
|
| 369 |
+
# A.6 GENERATION USING NOISE : FURTHER DETAILS
|
| 370 |
+
|
| 371 |
+
Here we show the equivalence between the sampling method proposed in Algorithm 2 and the deterministic sampling in DDIM (Song et al., 2021a). Given the image $x _ { t }$ at step $t$ , we have the restored clean image $\hat { x _ { 0 } }$ from the diffusion model. Hence given the estimated $\hat { x _ { 0 } }$ and $x _ { t }$ , we can estimate the noise $z ( x _ { t } , t )$ (or $\hat { z }$ ) as
|
| 372 |
+
|
| 373 |
+
$$
|
| 374 |
+
z ( x _ { t } , t ) = \frac { x _ { t } - \sqrt { \alpha _ { t } } \hat { x _ { 0 } } } { \sqrt { 1 - \alpha _ { t } } } ,
|
| 375 |
+
$$
|
| 376 |
+
|
| 377 |
+
Thus, the $D ( \hat { x _ { 0 } } , t )$ and $D ( \hat { x _ { 0 } } , t - 1 )$ can be written as
|
| 378 |
+
|
| 379 |
+
$$
|
| 380 |
+
D ( \hat { x _ { 0 } } , t ) = \sqrt { \alpha _ { t } } \hat { x _ { 0 } } + \sqrt { 1 - \alpha _ { t } } \hat { z } ,
|
| 381 |
+
$$
|
| 382 |
+
|
| 383 |
+
$$
|
| 384 |
+
D ( \hat { x _ { 0 } } , t - 1 ) = \sqrt { \alpha _ { t - 1 } } \hat { x _ { 0 } } + \sqrt { 1 - \alpha _ { t - 1 } } \hat { z } ,
|
| 385 |
+
$$
|
| 386 |
+
|
| 387 |
+
using which the sampling process in Algorithm 2 to estimate $x _ { t - 1 }$ can be written as,
|
| 388 |
+
|
| 389 |
+
$$
|
| 390 |
+
\begin{array} { r l } & { x _ { t - 1 } = x _ { t } - D ( \hat { x _ { 0 } } , t ) + D ( \hat { x _ { 0 } } , t - 1 ) } \\ & { \qquad = x _ { t } - \big ( \sqrt { \alpha _ { t } } \hat { x _ { 0 } } + \sqrt { 1 - \alpha _ { t } } \hat { z } \big ) + \big ( \sqrt { \alpha _ { t - 1 } } \hat { x _ { 0 } } + \sqrt { 1 - \alpha _ { t - 1 } } \hat { z } \big ) } \\ & { \qquad = \sqrt { \alpha _ { t - 1 } } \hat { x _ { 0 } } + \sqrt { 1 - \alpha _ { t - 1 } } \hat { z } } \end{array}
|
| 391 |
+
$$
|
| 392 |
+
|
| 393 |
+
which is same as the sampling method as described in (Song et al., 2021a). The only difference from the original (Song et al., 2021a) is the order for estimating $\hat { x _ { 0 } }$ and $\hat { z }$ . The original (Song et al., 2021a) paper estimated $\hat { z }$ first and then used this to predict clean image $\hat { x _ { 0 } }$ , while we first predict the clean image $\hat { x _ { 0 } }$ and then estimate the noise $\hat { z }$ .
|
| 394 |
+
|
| 395 |
+
# A.7 GENERATION USING BLUR TRANSFORMATION: FURTHER DETAILS
|
| 396 |
+
|
| 397 |
+

|
| 398 |
+
Figure 16: Examples of generated samples from $1 2 8 \times 1 2 8$ CelebA and AFHQ datasets using Method 2 with perfect symmetry.
|
| 399 |
+
|
| 400 |
+
The Figure 16, shows the generation without breaking any symmetry within each channel are quite promising as well.
|
| 401 |
+
|
| 402 |
+
Necessity of Algorithm 2: In the case of unconditional generation, we observe a marked superiority in quality of the sampled reconstruction using Algorithm 2 over any other method considered. For example, in the broken symmetry case, the FID of the directly reconstructed images is 257.69 for CelebA and 214.24 for AFHQ, which are far worse than the scores of 49.45 and 54.68 from Table 5. In Figure 17, we also give a qualitative comparison of this difference. We can also clearly see from Figure 18 that Algorithm 1, the method used in Song et al. (2021b) and Ho et al. (2020), completely fails to produce an image close to the target data distribution.
|
| 403 |
+
|
| 404 |
+
# A.8 ALGORITHM 1 IS SAME AS DDIM/DDPM SAMPLING
|
| 405 |
+
|
| 406 |
+
The sampling method proposed in Song et al. (2021a) in it’s equation 12 is given as
|
| 407 |
+
|
| 408 |
+
$$
|
| 409 |
+
x _ { t - 1 } = \sqrt { \alpha _ { t - 1 } } \cdot \mathrm { \ " { s p r e d i c t e d } } x _ { 0 } \mathrm { \ " { ~ , ~ } } + \sqrt { 1 - \alpha _ { t - 1 } - \sigma _ { t } ^ { 2 } } \epsilon _ { \theta } ( x _ { t } ) + \sigma _ { t } \epsilon _ { t }
|
| 410 |
+
$$
|
| 411 |
+
|
| 412 |
+
where $\epsilon _ { \theta } ( x _ { t } )$ is the noise predicted by the diffusion model given $x _ { t }$ and $t$ . The term “predicted $x _ { 0 }$ ” or $\hat { x _ { 0 } }$ can be computed directly given $x _ { t }$ and $\epsilon _ { \theta } ( x _ { t } )$ as
|
| 413 |
+
|
| 414 |
+
$$
|
| 415 |
+
\hat { x _ { 0 } } = \frac { x _ { t } - \sqrt { 1 - \alpha _ { t } } \epsilon _ { \theta } ( x _ { t } ) } { \sqrt { \alpha _ { t } } } ,
|
| 416 |
+
$$
|
| 417 |
+
|
| 418 |
+
Hence using $\hat { z }$ instead of $\epsilon _ { \theta } ( x _ { t } )$ and $\hat { x _ { 0 } }$ to indicate predicted clean image, we have
|
| 419 |
+
|
| 420 |
+
$$
|
| 421 |
+
x _ { t - 1 } = \sqrt { \alpha _ { t - 1 } } \cdot \hat { x _ { 0 } } + \sqrt { 1 - \alpha _ { t - 1 } - \sigma _ { t } ^ { 2 } } \hat { z } + \sigma _ { t } \epsilon _ { t }
|
| 422 |
+
$$
|
| 423 |
+
|
| 424 |
+
Thus, the sampling step can interpreted as follows: At each step $t$ , we start with a noisy image $x _ { t }$ and use the diffusion model to estimate the clean image $\hat { x _ { 0 } }$ and the noise $\hat { z }$ that was added to this clean image $\hat { x _ { 0 } }$ to get the noisy image $x _ { t }$ . In order to move to lesser noisy image $x _ { t - 1 }$ , one “adds back” lesser noise to the the “predicted clean image” $\hat { x _ { 0 } }$ . Now one can add back noise in 2 ways, either the noise which was added to the clean image $\hat { x _ { 0 } }$ which is $\hat { z }$ or sample a new uncorrelated noise $\epsilon _ { t }$ . Infact both of these noise can be added using $\sigma _ { t }$ as the hyperparameter that weighs the amount of each noise added. This $\sigma _ { t }$ is placed in the equation such that for any choice of $\sigma _ { t }$ , the standard deviation of noise added back is $\sqrt { 1 - \alpha _ { t - 1 } }$ . For $\sigma _ { t } = 0$ , we only add back the estimated noise $\hat { z }$ and no uncorrelated noise $\epsilon _ { t }$ which is infact the DDIM sampling. While for $\sigma _ { t } = \sqrt { ( 1 - \alpha _ { t - 1 } ) / ( 1 - \alpha _ { t } ) } \sqrt { 1 - \alpha _ { t } / \alpha _ { t - 1 } }$ we get the sampling method described in DDPM.
|
| 425 |
+
|
| 426 |
+
Nevertheless, for any choice of $\sigma _ { t }$ , the sampling method involves a denoising operation which is shown as $R ( x _ { s } , s )$ in Algorithm 1 and adding back noise shown as $x _ { s - 1 } = D ( \hat { x _ { 0 } } , s - 1 )$ in Algorithm 1. The only difference between different sampling methods explained in DDPM or DDIM is how one degrades the image back.
|
| 427 |
+
|
| 428 |
+

|
| 429 |
+
Figure 17: Comparison of direct reconstruction with sampling using TACoS described in Algorithm 2 for generation with blur transformation and broken symmetry. Left-hand column is the initial cold images generated using the simple Gaussian model. Middle column has images generated in one step (i.e. direct reconstruction). Right-hand column are the images sampled with TACoS described in Algorithm 2. We present results for both CelebA (top) and AFHQ (bottom) with resolution $1 2 8 \times 1 2 8$ .
|
| 430 |
+
|
| 431 |
+

|
| 432 |
+
Figure 18: Comparison of Algorithm 1 (top row) and Algorithm 2 (bottom row) for generation with Method 2 and broken symmetry on $1 2 8 \times 1 2 8$ CelebA dataset. We demonstrate that Algorithm 1 fails completely to generate a new image.
|
| 433 |
+
|
| 434 |
+

|
| 435 |
+
Figure 19: Progressive deblurring of selected blurred MNIST and CIFAR-10 images.
|
| 436 |
+
|
| 437 |
+

|
| 438 |
+
Figure 20: Progressive deblurring of selected blurred CelebA images.
|
| 439 |
+
|
| 440 |
+

|
| 441 |
+
Figure 21: Deblurred Cifar10 images
|
md/dev/ti6fH3EhFkv/ti6fH3EhFkv.md
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TOWARDS A UNIFIED VIEW ON VISUAL PARAMETEREFFICIENT TRANSFER LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Since the release of various large-scale natural language processing (NLP) pretrained models, parameter efficient transfer learning (PETL) has become a popular paradigm capable of achieving impressive performance on various downstream tasks. PETL aims at making good use of the representation knowledge in the pretrained large models by fine-tuning a small number of parameters. Recently, it has also attracted increasing attention to developing various PETL techniques for vision tasks. Popular PETL techniques such as Prompt-tuning and Adapter have been proposed for high-level visual downstream tasks such as image classification and video recognition. However, Prefix-tuning remains under-explored for vision tasks. In this work, we intend to adapt large video-based models to downstream tasks with a good parameter-accuracy trade-off. Towards this goal, we propose a framework with a unified view of PETL called visual-PETL (V-PETL) to investigate the effects of different PETL techniques, data scales of downstream domains, positions of trainable parameters, and other aspects affecting the tradeoff. Specifically, we analyze the positional importance of trainable parameters and differences between NLP and vision tasks in terms of data structures and pretraining mechanisms while implementing various PETL techniques, especially for the under-explored prefix-tuning technique. Based on a comprehensive understanding of differences between NLP and video data, we propose a new variation of prefix-tuning module called parallel attention (PATT) for video-based downstream tasks. An extensive empirical analysis on two video datasets via different frozen backbones has been carried and the findings show that the proposed PATT can effectively contribute to other PETL techniques. An effective scheme SwinBAPAT derived from the proposed V-PETL framework achieves significantly better performance than the state-of-the-art AdaptFormer-Swin with slightly more parameters and outperforms full-tuning with far less parameters.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Many vision tasks rely on fine-tuning pre-trained models to achieve good performance. One standard modus operandi of transfer learning consists of two steps: pre-train a model on a source domain and fine-tune the entire model on a target domain (Zhuang et al., 2020). Despite that prior works have achieved promising performance, such vanilla practice of fine-tuning is faced with challenges for adopting large models to downstream tasks. This full-tuning strategy requires one to update and store separate model parameters for different downstream tasks, which can be expensive and infeasible for the era of increasingly large models from EfficientNet-based (Pham et al., 2021) (480M parameters) to Transformer-based (Yu et al., 2022) (2, 100M parameters) ones. For such large models, making good use of shared parameter weights deployed on the cloud can be beneficial for edge devices such as autonomous vehicles, drones who are intensive in computing and battery resources (Yuan et al., 2022). Second, the full fine-tuning strategy relies on high-quality downstream data and can hardly adapt to unseen scenarios that have large distribution shift (Kumar et al., 2021), which is unlike the learning process of humans who can learn from few samples and generalize well to new circumstances. This issue has been researched in directions such as zero-shot learning, few-shot learning, and continual learning (Li et al., 2021a). Another popular strategy is fine-tuning the downstream task head, i.e., the last fully connected (FC) layer, to avoid tuning the whole backbone model, which usually leads to poor performance when the target domain is large in data scale (see Figure
|
| 12 |
+
|
| 13 |
+
1). Given the paradigm of fine-tuning increasingly large models, how to transfer such large models with parameter-accuracy trade-off is a hot topic in various domains (Gusak et al., 2022; Sung et al., 2022; Lin et al., 2020; Houlsby et al., 2019).
|
| 14 |
+
|
| 15 |
+
Taking the video-based action recognition task as an example, it can be inconvenient for deploying such large models to edge devices such as an autonomous driving (Liu et al., 2019) and unmanned aerial vehicle (Li et al., 2021b) as they can heavily rely on the interaction with cloud services for adapting to new environments via active learning (Wang et al., 2021) or continual learning (Li et al., 2021a). Re-training large models on the cloud are usually not cost-effective due to the expensive overheads of storage and computational resources. Furthermore, these resources are limited on edge devices such as autonomous vehicles and unmanned aerial vehicles, making the sense for developing effective fine-tuning methods with proper parameter-accuracy trade-off that can be fine-tuned on edge devices and interacting with the large models deployed on the cloud.
|
| 16 |
+
|
| 17 |
+
There have been some pioneering works for the PETL of visual models such as AdaptFormer (Chen et al., 2022) and visual prompt tuning (VPT) (Jia et al., 2022). AdaptFormer is primarily proposed based on vision transformer (Zhai et al., 2022), representing one of the stateof-the-art large models for image-based tasks. The proposed adapter module directly brings from Houlsby et al. (2019) due to its convenience of being inserted to any models. Implementing with a large batch size of $1 , 0 2 4$ with 64 GPUs, Adaptformer shows promising parameter-accuracy trade-off on video data. However, such powerful computing resource is not realistic for the usage of edge devices. Meanwhile, whether the good trade-off can be maintained for small batch size remains under-explored. Inspired by the Prompting in NLP (Liu et al., 2021), VPT proposes visualprompt to fine-tune visual models for imagebased tasks. According to the empirical results in Chen et al. (2022), adapter modules achieves superior performance over VPT in the regimes of both self-supervised and supervised
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Parameter-accuracy trade-off. Adapting backbone Swin-B (Liu et al., 2022) pre-trained on Kinetics 400 via different fine-tuning methods on the something-something v2 (Goyal et al., 2017) dataset. Our methods perform significantly better than the state-of-the-art AdaptFormer-Swin (Chen et al., 2022) (our implementation with batch size 16) with slightly more tunable parameters, and outperform full-tuning with increasing margins when using larger values of $d _ { b o t t l e }$ .
|
| 21 |
+
|
| 22 |
+
pre-training. Another concern of VPT is its modification to the original model parameters might affect the knowledge representation of backbone models. Hence, we do not continue to compare our method with VPT but comparing with the adapter on video-based downstream tasks.
|
| 23 |
+
|
| 24 |
+
Taking the recent inspiration of the mix-and-match adapter (MAM adapter) (He et al., 2022a) in NLP, we aim to propose a unified model for the vision domain, especially for video-based downstream tasks. He et al. (2022a) analyzed the unified view among PETL techniques such as prefixtuning, low-rank (LoRA) adaptation, and adapter, pointing out the similarity between prefix-tuning and adapter in terms of calculating the attention. The difference is that the former performs weighted addition while the latter ones is unweighted. Note that prefix-tuning has not ever been applied to visual tasks in the form of pure visual models due to the intrinsic differences regarding pre-training methods of NLP and vision models. Another obstacle of directly applying prefix-tuning to visual tasks is the structural difference between text and vision data (we further discuss this in Section 2.3). Considering the video-based action recognition task, we propose a new variation of the prefixtuning module called parallel attention (PATT) to adapt video-based pre-trained large models to downstream domains with varied data scales. The differences of our method comparing the original prefix-tuning in NLP are twofold: prefix calculation and the manner of insertion (see Figure 2[b] and Figure 3). Regarding the backbone model, we focus on Video Swin Transformer (Liu et al., 2022), one of the state-of-the-art vision models that bring competitive performance on large-scale action recognition datasets such as Kinetics 400 and 600 Kay et al. (2017).
|
| 25 |
+
|
| 26 |
+
Our main contributions can be threefold as follows:
|
| 27 |
+
|
| 28 |
+
1. We analyze different PETL techniques using the backbone model Swin Video Transformer for video-based tasks, providing a unified view via our V-PETL framework and investigating the importance of the fine-tuning position.
|
| 29 |
+
|
| 30 |
+
2. Based on the comprehensive understanding of intrinsic differences between NLP and video data regarding data structures and pre-training mechanisms, we leverage prefix-tuning to our V-PETL with a new variation called PATT.
|
| 31 |
+
|
| 32 |
+
3. Upon extensive ablation experiments regarding various effect factors, we empirically validate the promising parameter-accuracy trade-off achieved by our adjustable and easy-to-use PATT module, contributing to the existing literature of PETL techniques.
|
| 33 |
+
|
| 34 |
+
# 2 UNIFIED FRAMEWORK
|
| 35 |
+
|
| 36 |
+
# 2.1 RECAP OF VIDEO SWIN TRANSFORMER
|
| 37 |
+
|
| 38 |
+
Video Swin Transformer (Liu et al., 2022) is formed with Transformer layers (a.k.a. stages) that are consisted with 3D Video Swin Transformer blocks. With varied layers, blocks, and channel sizes, the model can be formed as Swin-T, Swin-S, Swin-B, and Swin-L. The basic architecture of a 3D Swin Transformer block is shown in Figure 2, which is mainly composed of a 3D shifted window-based multi-head self-attention (3DSW-MSA) module and a fully connected feed-forward network (FFN) implemented with a 2-layer MLP. Layer normalization (LN) and residual connection are respectively performed before and after both FFN and 3DSW-MSA modules. One such Video Swin Transformer block can be represented as:
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
\begin{array} { r l } & { \hat { \boldsymbol Z } ^ { l } = 3 \mathrm { D S W } \mathrm { - } \boldsymbol { \mathrm { M S A } } ( \boldsymbol { \mathrm { L N } } ( \boldsymbol { \boldsymbol { Z } } ^ { l - 1 } ) ) + \boldsymbol { Z } ^ { l - 1 } , } \\ & { \boldsymbol { Z } ^ { l } = \mathrm { F F N } ( \boldsymbol { \mathrm { L N } } ( \hat { \boldsymbol { Z } } ^ { l } ) ) + \hat { \boldsymbol { Z } } ^ { l } , } \end{array}
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
where $\hat { \boldsymbol { z } } ^ { l }$ and $Z ^ { l }$ respectively indicate the output of 3DSW-MSA and FNN modules.
|
| 45 |
+
|
| 46 |
+
Given a video input sized $t \times w \times h \times 3$ , containing $t$ video frames with their heights and widths being $h$ and $w$ , respectively. The 3D patch for video data sized $2 \times 4 \times 4 \times 3$ is treated as a token. Then we will have ${ \begin{array} { l } { { \frac { t } { 2 } } \times { \frac { w } { 4 } } \times { \frac { h } { 4 } } } \end{array} }$ 3D tokens after a 3D patch partitioning layer. Given the 3D tokens sized $\begin{array} { r } { \frac { t } { 2 } \times \frac { w } { 4 } \times \frac { h } { 4 } } \end{array}$ and a 3D window with the size of $p \times m \times m$ , the self-attention module, using the regular window partition strategy, will partition the 3D tokens to $\begin{array} { r } { { \frac { t } { 2 p } } \times { \frac { w } { 4 m } } \times { \frac { h } { 4 m } } } \end{array}$ non-overlapping windows. For shifted 3D window, the partition is shifted along the temporal, height, and width dimensions by ${ \begin{array} { l } { { \frac { p } { 2 } } \times { \frac { m } { 2 } } \times { \frac { m } { 2 } } } \end{array} } $ . For example, if we have an input video sized $8 \times 2 2 4 \times 2 2 4 \times 3$ and a $8 \times 7 \times 7$ 3D window, after the patch embedding, we will have $4 \times 5 6 \times 5 6 ~ 3 \mathrm { D }$ tokens with each of them sized $2 \times 4 \times 4 \times 3$ . Without shifting, the non-overlapping window size will be $1 \times 8 \times 8 = 6 4 .$ Then through the 3D window shifted by $( 4 , 3 , 3 )$ , the number of 3D windows becomes $1 \times 9 \times 9 = 8 1$ .
|
| 47 |
+
|
| 48 |
+
The 3DSW-MSA module is formed with a 3D relative position bias Rp2×m2×m2 , each of which can be represented as:
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
A t t e n t i o n ( \mathbf { 0 } , \mathbf { K } , \mathbf { V } ) = S o f t M a x \big ( \frac { \mathbf { 0 } \mathbf { K } ^ { T } } { \sqrt { d } } + \mathbf { B } \big ) \mathbf { V } ,
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
where $\pmb { \mathsf { Q } } , \pmb { \mathsf { K } } , \pmb { \mathsf { V } } \in \mathbb { R } ^ { p \times m \times m \times d }$ are the query, key, and value matrices, $p \times m \times m$ is the number of tokens and $d$ is the dimension of the tokens. MSA simultaneously performs the attention mechanism for $n _ { h e a d }$ heads, where the $i$ th head can be parameterized by $W _ { q } ^ { ( i ) } , W _ { k } ^ { ( i ) }$ , ${ W _ { v } ^ { ( i ) } \in \mathbb { R } ^ { d \times 3 d } }$ , projecting the input $Z ^ { l - 1 }$ to queries, keys, and values. Given a matrix $\boldsymbol { C } \in \mathbb { R } ^ { \tilde { m } \times d }$ , $\widetilde { \boldsymbol { m } } = \boldsymbol { p } \times \boldsymbol { m } \times \boldsymbol { m }$ , for performing attention, the 3DSW-MSA can be calculated as:
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\begin{array} { c } { { 3 \mathrm { D S W - M S A } ( Z ^ { l - 1 } , C ) = C o n c a t ( h e a d _ { 1 } , . . . , h e a d _ { n } ) { \cal W } _ { o } , } } \\ { { h e a d _ { i } = A t t e n t i o n ( Z ^ { l - 1 } { \cal W } _ { q } ^ { ( i ) } , C { \cal W } _ { k } ^ { ( i ) } , C { \cal W } _ { v } ^ { ( i ) } ) , } } \end{array}
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
where $W _ { o }$ is the parameters of a linear project layer. The FNN module is composed of two linear layers with a GELU activation function in between, which can be computed as:
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
\mathrm { F F N } ( \hat { \boldsymbol { Z } } ^ { l } ) = \mathrm { G E L U } ( \mathrm { L N } ( \hat { \boldsymbol { Z } } ^ { l } ) W _ { 1 } + b _ { 1 } ) W _ { 2 } + b _ { 2 } ,
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
where $W _ { 1 } \in \mathbb { R } ^ { d _ { h i d d e n } \times d }$ , $W _ { 2 } \in \mathbb { R } ^ { d \times d _ { h i d d e n } }$ , $\pmb { b } _ { 1 } \in \mathbb { R } ^ { d _ { h i d d e n } }$ , and $b _ { 2 } \in \mathbb { R } ^ { d }$ . The value of $d _ { h i d d e n }$ usually takes a large value (e.g., $d _ { h i d d e n } = 4 d$ ).
|
| 67 |
+
|
| 68 |
+

|
| 69 |
+
Figure 2: V-PETL: A unified view of visual PETL techniques. They bring trainable parameters to different positions of the backbone model with various manners. AdaptFormer and Prefix-tuning respectively perform at the MLP and 3DSW-MSA modules that can adjust the number of trainable parameters via the bottleneck size of down and up projections. While prompt-tuning performed at the layer-level can adjust the length of prompts to control the tuned parameters.
|
| 70 |
+
|
| 71 |
+
Prefix-tuning (Li & Liang, 2021): The prefix-tuning approach prepends learnable prefix tokens to the keys and values of the MSA module of the model (see Figure 2[b]). Specifically, two prefix matrices $P _ { k } , P _ { v } \in \mathbb R ^ { d _ { t o k e n } \times d }$ that are randomly initialized with $d _ { t o k e n }$ tokens and transformed from two linear layers (with parameters $W _ { p k } ^ { ( i ) } \in \mathbb { R } ^ { d \times d _ { m i d d l e } }$ and $W _ { p v } ^ { ( i ) } \in \mathbb { R } ^ { d _ { m i d l e } \times d } )$ and a Tanh layer in between are concatenated to the original key and value, leading the calculation of $h e a d _ { i }$ in Eq. 3 to:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
h e a d _ { i } = A t t e n t i o n ( Z ^ { l - 1 } W _ { q } ^ { ( i ) } , c o n c a t ( P _ { k } ^ { ( i ) } , C W _ { k } ^ { ( i ) } ) , c o n c a t ( P _ { v } ^ { ( i ) } , C W _ { v } ^ { ( i ) } ) ) ,
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where the concat is the concatenation performed along the token dimension to mimic the prefixtuning in NLP tasks. Here, a question regarding whether this direct implementation will work for the vision domain is raised (results are in Table 4). This direct implementation is empirically invalid and we make further modification on it in Section2.3.
|
| 78 |
+
|
| 79 |
+
Adapter (Chen et al., 2022): Inspired by the works of Houlsby et al. (2019); He et al. (2022a) for PETL in NLP tasks, adapter (Chen et al., 2022) has been directly used for vision tasks, showing promising performance using far less tunable parameters. The number of parameters of adapter is controlled by a parameter $d _ { b o t t l e }$ $\mathit { \check { d } } _ { b o t t l e } \ll d )$ ), adjusting the space size of a low-dimensional representation. The adapter module first uses a down-projection with $W _ { d o w n } \in \mathbb { R } ^ { d \times d _ { b o t t l e } }$ to project the feature to the lower-dimensional representation, followed by a ReLU activation function, and a up-projection with Wup ∈ Rdbottle×d.
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\begin{array} { r } { \widetilde { \pmb { Z } } ^ { l } = \mathrm { R e L U } ( \mathbf { L N } ( \hat { \pmb { Z } } ^ { l } ) \mathbf { W } _ { d o w n } ) \mathbf { W } _ { u p } , } \end{array}
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
then two positions implementing adapter (parallel and sequential) can be respectively computed as:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\begin{array} { r } { \pmb { Z } ^ { l } = \mathrm { F F N } ( \mathbf { L N } ( \hat { \pmb { Z } } ^ { l } ) ) + \hat { \pmb { Z } } ^ { l } + s \tilde { \pmb { Z } } ^ { l } , \qquad } \\ { a n d s \pmb { Z } ^ { l } = \mathrm { R e L U } ( \mathrm { F F N } ( \mathbf { L N } ( \hat { \pmb { Z } } ^ { l } ) ) \pmb { W } _ { d o w n } ) \pmb { W } _ { u p } + \hat { \pmb { Z } } ^ { l } , } \end{array}
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
where $s$ is a scalar, controlling the effect of the adapter (will be ablated in experiments). According to Chen et al. (2022), the parallel implementation (see Figure 2[a]) empirically performs better.
|
| 92 |
+
|
| 93 |
+
Prompt-tuning (Jia et al., 2022): Prompt-tuning (see Figure $2 [ \mathrm { c } ] ,$ is inspired by the success of prompt-tuning that adapts large scale models to varied downstream NLP tasks. The idea of VPT (Jia et al., 2022) is to fine-tune a learnable matrix P l−1prom $P _ { p r o m p t } ^ { l - 1 } \in \mathbb { R } ^ { d _ { p r o m p t } \times d }$ , ${ d _ { p r o m p t } } < { d _ { t o k e n } } - 1$ for
|
| 94 |
+
|
| 95 |
+
the lth Transformer layer or all Transformer layers, which are known as shallow prompt and deep prompt, respectively.
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\begin{array} { r } { \hat { \boldsymbol { \mathsf { Z } } } ^ { l } = 3 \mathrm { D S W } \mathrm { - } \boldsymbol { \mathsf { M S A } } ( \mathrm { L N } ( [ \boldsymbol { x } ^ { l - 1 } , \boldsymbol { P } _ { p r o m p t } ^ { l - 1 } , \boldsymbol { \mathsf { Z } } ^ { l - 1 } ] ) ) + \boldsymbol { \mathsf { Z } } ^ { l - 1 } , } \end{array}
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
where $x ^ { l - 1 } \in \mathbb { R } ^ { d }$ denotes the [CLS]’s embedding for the $l$ th layer’s input space, $P _ { p r o m p t } ^ { l - 1 }$ is implemented by overlapping the top $d _ { p r o m p t }$ tokens of $Z ^ { l - 1 }$ (Jia et al., 2022). While it has also been implemented in front of the $x ^ { l - 1 }$ (Chen et al., 2022).
|
| 102 |
+
|
| 103 |
+
Others: Other PETL techniques include ST-Adapter Pan et al. (2022), LoRA (Hu et al., 2022), and BitFit (Zaken et al., 2022). ST-Adapter mainly adapts image-text models pre-trained on large scale datasets such as 400M image-text pair proposed by CLIP (Radford et al., 2021) and the IG-3.6B used by SWAG (Singh et al., 2022) to video understanding downstream tasks, which matches and even outperforms full-tuning. LoRA approximates the optimization process by injecting learnable low-rank matrices into the attention module. This method does not show superior performance for NLP tasks in terms of parameter efficiency. Hence, we do not prioritize this direction in this work. BitFit only tunes the bias terms of the backbone models, making it very parameter-efficient.
|
| 104 |
+
|
| 105 |
+
# 2.3 REVISITING PREFIX-TUNING FOR VISUAL TASKS
|
| 106 |
+
|
| 107 |
+
The prefix implementation in NLP Li & Liang (2021); He et al. (2022a) can be regarded as prepending contextual information for downstream tasks, which is similar with the pre-training process aiming to predict masked words in the process of an inner loop (Brown et al., 2020). Considering the pre-training process of pure vision models, such direct implementation might not make sense for visual tasks. Although such autoregressive pre-training has been conducted in visual domain (He et al., 2022b; Tong et al., 2022), but adding prefix for a sentence input in NLP can be structurally different with the visual domain. Specifically, masked pixels in image or video data cannot be regarded as some word level semantic information (e.g., a subject or an action) as in the NLP.
|
| 108 |
+
|
| 109 |
+
Recall that the embedding state of prefix-tuning is randomly initiated, which is known as learnable prefix but can bring random noise that later turns out affecting the convergence of the fine-tuning downstream tasks. Hence, inspired by the connection between adapter and prefix (He et al., 2022a), we avoid such learnable prefix design with random initialization and propose a parallel attention (PATT) to the original attention module (see Figure 3). The adapter structure can effective control the number of trainable parameters via $d _ { b o t t l e }$ , which is similar with the effect of the middle dimension dmiddle of W (i)pk and $W _ { p v } ^ { ( i ) }$ for preparing the prefix. Specifically, for the lth layer, we use output of its previous layer $Z ^ { l - 1 }$ and project it to a pair of matrices $\boldsymbol { \dot { K _ { p } } } , \boldsymbol { V _ { p } } \in \mathbb { R } ^ { \tilde { m } \times d }$ via a similar mechanism of Eq. 6:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
K _ { p } , V _ { p } = \mathrm { T a n h } ( Z ^ { l - 1 } W _ { d o w n } ) W _ { u p } ,
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
where Tanh is the activation function used for preparing the prefix, which can be replaced by other activation func
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 3: Structure of PATT. Red parts are trainable parameters calculated by the same input for preparing query, key, and value (i.e., the output of the previous layer passing through a layer normalization layer $Z ^ { l - 1 }$ ).
|
| 119 |
+
|
| 120 |
+
tions such as RELU and GELU. Here, we follow the original prefix implementation as its value ranges from $- 1$ to 1. Given $K _ { p }$ and $V _ { p }$ , Eq. 5 can be rewritten as:
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
h e a d _ { i } = A t t e n t i o n ( \boldsymbol Z ^ { l - 1 } \boldsymbol W _ { q } ^ { ( i ) } , \boldsymbol s \boldsymbol K _ { p } + \boldsymbol C \boldsymbol W _ { k } ^ { ( i ) } , \boldsymbol s V _ { p } + \boldsymbol C \boldsymbol W _ { v } ^ { ( i ) } ) ,
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
where $s$ is a scalar for adjusting the effect of PATT. Note that without considering the physical meaning of such design, for PETL purpose, one can perform similar practise for any combinations of $\mathbf { \alpha } _ { \mathbf { Q } , \mathbf { \alpha } } \kappa$ , and $\pmb { \nu }$ . This brings connection to the LoRA (Hu et al., 2022) method, which add parallel trainable parameters to $\mathbf { Q }$ and $\pmb { \nu }$ . Empirically, where to perform the PATT makes little difference, but the amount of trainable parameters brings larger effect for large scale downstream domains.
|
| 127 |
+
|
| 128 |
+
# 2.4 V-PETL: UNIFIED VIEW ON VISUAL PETL
|
| 129 |
+
|
| 130 |
+
Given the PETL techniques at hand, there can be many potential combinations leading to good parameteraccuracy trade-off. However, it is unrealistic to exhaustively test all the methods for a specific downstream task. Other than probing such solution via evolutionary search as in Zhang et al. (2022), we aim to propose more understandable models by empirically analyzing the effect of different designs independently. According to the preliminary results shwon in Figure 1, we argue that the position and amount of parameters are important for PETL techniques, especially when the target domain is not small.
|
| 131 |
+
|
| 132 |
+
To verify the importance of position and tuned parameter amount, we independently tune different modules of the backbone model. Table 1 shows the results. We can see that the attention module’s QKV layer has 20.98M parameters while the MLP module has the most number of parameters of 55.90M. Tuning positions with more parameters, will lead to better performance for SSv2. Thanks to the bottleneck mechanism of adapter and prefix-tuning, one can effectively achieve a good parameter-accuracy trade-off. As such, we derive a model called Swin-B-adapter-PATT (Swin-BAPAT) from the V-PETL framework by using the parallel adapter and our PATT to leverage the adaption of pre-trained backbone model at the positions of attention and MLP modules, respectively. In addition to adapter and PATT, we also fine-tune the last fully connected layer as it has relatively smaller amount of tunable parameters (i.e, 0.18M) than adapter and PATT.
|
| 133 |
+
|
| 134 |
+
Table 1: Comparison of independently fine-tuning varied positions of the video swin transformer block on SSv2.
|
| 135 |
+
|
| 136 |
+
<table><tr><td>Position</td><td># Params</td><td>Top-1 (%)</td></tr><tr><td>Full-tuning Tune FC Layer</td><td>87.82M 0.18M</td><td>50.99 24.13</td></tr><tr><td>LayerNorm 1</td><td>0.02M</td><td>14.35</td></tr><tr><td>Attn,Proj</td><td>6.99M</td><td>47.58</td></tr><tr><td>Attn, QKV</td><td>20.98M</td><td>50.02</td></tr><tr><td>Attn, SoftMax</td><td>0.95M</td><td>27.67</td></tr><tr><td>LayerNorm 2</td><td>0.02M</td><td>14.62</td></tr><tr><td>MLP, FC1</td><td>27.97M</td><td>47.10</td></tr><tr><td>MLP,FC2</td><td>27.93M</td><td>45.32</td></tr><tr><td>DownSample</td><td>2.76M</td><td>27.53</td></tr></table>
|
| 137 |
+
|
| 138 |
+
# 3 EXPERIMENTS
|
| 139 |
+
|
| 140 |
+
# 3.1 EXPERIMENTAL SETTINGS
|
| 141 |
+
|
| 142 |
+
Video Datasets: Something-something v2 (SSv2 (Goyal et al., 2017)) It has 108,499 short videos for 174 human-object interaction categories with durations between 2 to 6 seconds. The challenge of this dataset is that it contains 23, 137 distinct object names with an imbalanced distribution. The original dataset is split into train, validation, and test sets with a ratio of 8:1:1. The extended version (SSv2) of this dataset is consisted of 168, 913 training samples, 24, 777 validation samples, and 27, 157 testing samples with the sample number of action labels. The training and testing samples are used. HMDB51 (Kuehne et al., 2011) contains 6, 766 video samples for 51 action categories including videos of varied visible body parts, camera motion, camera view, and clip quality. All video samples have at least 101 clips and a minimum height of 60 pixels for actors. The original dataset has three splits of training and evaluation. We follow existing work Chen et al. (2022) by using the first training and evaluation split that has 3, 570 and 1, 530 samples, respectively. Image Datasets: Following the experimental set ups in AdaptFormer, three datasets CIFAIR-100 Krizhevsky et al. (2009), Street View House Numbers (SVHN) Goodfellow et al. (2013), and Food101 Bossard et al. (2014) are used. CIFAIR-100 has 50, 000 and 10, 000 training and validation images, respectively, with the resolution of $3 2 \times 3 2$ and 100 categories; SVHN is a digit classification dataset that has 73, 257 training sample and 26, 032 testing samples; Food-101 includes 101k images of 101 food categories with each of them has 750 training and 250 testing samples.
|
| 143 |
+
|
| 144 |
+
Implementation details: It is worth noting that big batch size (i.e., 1, 024) and the number of input video frames (i.e., 32 frames) can greatly benefit good performance (Carreira & Zisserman, 2017; Liu et al., 2022; Chen et al., 2022), which usually requires GPU clusters to enable the training. AdaptFormer (Chen et al., 2022) uses such powerful GPU cluster to achieve good performance. However, good performance might not hold when the batch size is small. Following the more common hardware device setup, we use 4 GeForce 3090 GPUs for all experiments, leading to a batch size of 64. All the experiments are fine-tuned for 70 epochs. We use the Swin- $\mathbf { \cdot B } ^ { 1 }$ model pre-trained on Kinetics 400 and 600. For HMDB51, we report the results without tuning the FC layer due to the significant effect of the FC layer on relatively small scale dataset. Following Chen et al. (2022), we do not perform regularization strategies such as mixup, cutmix, color jittering, etc. Our PATT module is convenient to be applied to other Transformer-based models. Hence, we respectively adopt ViT-B models from MAE (He et al., 2022b) and VideoMAE (Tong et al., 2022) to conduct further comparison on video and image datasets, which follows the self-supervised pretraining setting2 in Chen et al. (2022) except that the batch size is set to 256 instead of 1, 024.
|
| 145 |
+
|
| 146 |
+
Table 2: Comparison of Top-1 accuracy using varied amount of parameters adjusted by $d _ { b o t t l e }$ different pre-training domains, and the number of frames with other fine-tuning strategies.
|
| 147 |
+
|
| 148 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">dbottle</td><td rowspan="2">Pre-training</td><td rowspan="2">#Frames</td><td colspan="2">SSv2</td><td colspan="2">HMDB51</td></tr><tr><td># Params Top-1(%)# Params Top-1 (%)</td><td></td><td></td><td></td></tr><tr><td>Full-tuning</td><td>-</td><td>Kinetics 400</td><td>8</td><td>87.82M</td><td>50.99</td><td>87.69M</td><td>68.07</td></tr><tr><td>Tune FC Layer</td><td></td><td>Kinetics 400</td><td>8</td><td>0.18M</td><td>24.13</td><td>0.05M</td><td>71.28</td></tr><tr><td>BitFit (Zaken et al., 2022)</td><td>·</td><td>Kinetics 400</td><td>8</td><td>1.29M</td><td>45.94</td><td>1.11M</td><td>68.26</td></tr><tr><td>AdaptFormer-Swin (Chen et al., 2022)64</td><td></td><td>Kinetics 400</td><td>8</td><td>1.73M</td><td>40.80</td><td>1.61M</td><td>68.66</td></tr><tr><td>Prefix-tuning (Li& Liang,2021)</td><td>128</td><td>Kinetics 400</td><td>8</td><td>6.57M</td><td>39.46</td><td>6.40M</td><td>56.13</td></tr><tr><td>Our Swin-BAPAT (w/o Adapter)</td><td>32</td><td>Kinetics 400</td><td>8888</td><td>1.35M</td><td>46.26</td><td>1.17M</td><td>69.51</td></tr><tr><td>Our Swin-BAPAT (w/o Adapter)</td><td>64</td><td>Kinetics 400</td><td></td><td>2.51M</td><td>49.23</td><td>2.34M</td><td>71.34</td></tr><tr><td>Our Swin-BAPAT (w/o Adapter)</td><td>128</td><td>Kinetics 400</td><td></td><td>4.83M</td><td>52.57</td><td>4.65M</td><td>70.56</td></tr><tr><td>Our Swin-BAPAT (w/o Adapter)</td><td>256</td><td>Kinetics 400</td><td></td><td>9.45M</td><td>52.71</td><td>9.27M</td><td>70.23</td></tr><tr><td>Our Swin-BAPAT</td><td>32</td><td>Kinetics 400</td><td>8</td><td>2.91M</td><td>49.63</td><td>2.74M</td><td>68.20</td></tr><tr><td>Our Swin-BAPAT</td><td>64</td><td>Kinetics 400</td><td>8</td><td>4.07M</td><td>51.80</td><td>3.89M</td><td>70.10</td></tr><tr><td>Our Swin-BAPAT</td><td>128</td><td>Kinetics 400</td><td>8</td><td>6.38M</td><td>53.36</td><td>6.20M</td><td>71.93</td></tr><tr><td>Our Swin-BAPAT</td><td>256</td><td>Kinetics 400</td><td>8</td><td>11.00M</td><td>53.98</td><td>10.83M</td><td>69.64</td></tr><tr><td>Our Swin-BAPAT</td><td>256</td><td>Kinetics 400</td><td>8</td><td>11.00M</td><td>53.98</td><td>10.83M</td><td>69.64</td></tr><tr><td>Our Swin-BAPAT</td><td>256</td><td>Kinetics 600</td><td>8</td><td>11.00M</td><td>54.06</td><td>10.83M</td><td>69.90</td></tr><tr><td>Our Swin-BAPAT</td><td></td><td>256 ImageNet-22K</td><td>8</td><td>11.00M</td><td>43.56</td><td>10.83M</td><td>59.89</td></tr><tr><td>Our Swin-BAPAT</td><td>128</td><td>Kinetics 400</td><td>8</td><td>6.38M</td><td>53.36</td><td>6.20M</td><td>71.93</td></tr><tr><td>Our Swin-BAPAT</td><td>128</td><td>Kinetics 400</td><td>16</td><td>6.38M</td><td>63.14</td><td>6.20M</td><td>75.67</td></tr></table>
|
| 149 |
+
|
| 150 |
+
Baselines: We mainly compare our method Swin-BAPAT with three baselines as follows: (1) Full-tuning: set all the parameters learnable and tune the whole model initiated with the pretrained weights. (2) Tune FC layer: tune the last fully connected layer and freeze pre-trained parameters of the whole backbone model. (3) AdaptFormer-Swin: method introduced by Chen et al. (2022) that adds a parallel adapter to the MLP module in each block of the backbone model. (4) Prefix-tuning: the direct implementation of prefix-tuning used in NLP as defined in Eq. 5. (5) BitFit: by tuning the bias of the backbone model together with the FC layer.
|
| 151 |
+
|
| 152 |
+
# 3.2 THE EFFECT OF DIFFERENT PETL TECHNIQUES
|
| 153 |
+
|
| 154 |
+
Table 2 shows the results of different PETL techniques. From the results of four baseline methods, full-tuning performs the best for the large-scale dataset SSv2, whereas tuning the FC layer achieves superior performance over other PETL techniques on HMDB51. This is due to the fact that downstream tasks with relatively larger scale datasets are more parameter hungry for good convergence. On the contrary, small datasets can make good use of the knowledge from the source domain with slight effort of adaption via an FC layer. Here, a question regarding the effect of this FC layer when using it together with other PETL techniques has not been investigated. As this FC layer having small amount of tunable parameters can already make a big difference, performing better than fulltuning and other PETL techniques and rendering them not effective for small-scale datasets. As such, we further examine this question in Section A.1.
|
| 155 |
+
|
| 156 |
+
We test different amount of parameters adjusted by $s _ { b o t t l e }$ , taking its values to 32, 64, 128 and 256. The second and third groups (without or with Adapter, respectively) of results in Table 2 shows that larger values of $s _ { b o t t l e }$ can benefit the fine-tuning with slightly more overhead of parameters on large-scale datasets such as SSv2. All results of our Swin-BAPAT outperform the state-ofthe-art AdaptFormer-Swin with a big margin (using the smallest value $s _ { b o t t l e } = 3 2$ can improve AdaptFormer-Swin by almost $2 5 \%$ ). While without using Adapter, our method still outperforms baselines AdaptFormer-Swin and BitFit with roughly similar amount of parameters. When sbottle is larger than 64, our Swin-BAPAT starts to perform better than full-tuning on both datasets with proper parameter-accuracy trade-off, validating the effectiveness of our Swin-BAPAT for PETL.
|
| 157 |
+
|
| 158 |
+

|
| 159 |
+
Figure 4: Top-1 accuracy of different settings on SSv2 throughout training process. F: frame, S: scalar, B: $d _ { b o t t l e }$ , K: pre-training domain.
|
| 160 |
+
|
| 161 |
+
Table 3: Top-1 accuracy $( \% )$ using different scalar values on two datasets: SSv2 and HMDB51. The $d _ { b o t t l e }$ is set to 128; pretraining is based on Kinetics 400.
|
| 162 |
+
|
| 163 |
+
<table><tr><td>Scalar s</td><td>SSv2</td><td>HMDB51</td></tr><tr><td>Full-tuning</td><td>50.99</td><td>71.28</td></tr><tr><td>Tune FC Layer</td><td>24.13</td><td>68.07</td></tr><tr><td>AdaptFormer-Swin</td><td>40.80</td><td>68.66</td></tr><tr><td>s=0.2</td><td>47.46</td><td>69.38</td></tr><tr><td>s=0.5</td><td>52.84</td><td>71.87</td></tr><tr><td>s=0.8</td><td>53.36</td><td>71.93</td></tr><tr><td>s=1.0</td><td>53.29</td><td>70.89</td></tr></table>
|
| 164 |
+
|
| 165 |
+
# 3.3 THE EFFECT OF DIFFERENT PRE-TRAINING DOMAINS
|
| 166 |
+
|
| 167 |
+
The knowledge from the pre-trained model is learned from the source domain. We test two different models pre-trained on large-scale datasets: Kinetics 400, Kinetics 600, and ImageNet-22K. Findings show that both two models pre-trained on such large-scale datasets can benefit our proposed PETL strategy with the latter being slightly more significant (see the third group of comparison in Table 2). This is due to the fact that Kinectics 600 is larger than its 400 version and brings more knowledge to the pre-trained model, benefiting more downstream tasks. However, image-based pre-training cannot perform as good as video-based pre-training due to the larger domain gap.
|
| 168 |
+
|
| 169 |
+
# 3.4 THE EFFECT OF DIFFERENT VIDEO INPUT SIZE
|
| 170 |
+
|
| 171 |
+
We also test whether our method is robust to increased number of input video frames. It is worth noting that larger number of input video frames usually can bring more spatial temporal information, benefiting data-driven models to learn more distinguishable features while keeping the model size remaining the same. The last group of comparisons in Table 2 shows that using double-sized video input (i.e., 16 frames) can greatly improve the performance of action recognition on both small and large-scale datasets. The improvements (increased $9 . 7 8 \%$ from $5 3 . 3 6 \%$ to $6 3 . 1 4 \%$ on SSv2, and $3 . { \bar { 7 } } 4 \%$ from $7 1 . 9 3 \%$ to $7 5 . 6 7 \%$ on HMDB51) are more significant than other factors such as $d _ { b o t t l e }$ and pre-training domain (around $1 \%$ to $2 \%$ ). The top line in Figure 4 visualizes the significant effect of increasing the number of input video frames. These results suggest that our Swin-BAPAT can be promising for increased frames of video input.
|
| 172 |
+
|
| 173 |
+
# 3.5 THE EFFECT OF DIFFERENT SCALE OF PATT
|
| 174 |
+
|
| 175 |
+
Recall that the effect of our PATT on pretrained models can be adjusted by the variable $s$ in Eq. 10. Table 3 shows that adopting the value of 0.8 can deliver consistent best performances on both datasets SSv2 and HMDB51 under our experimental setting. Smaller values of $s$ will quantitatively reduce the effect of our PATT module on the knowledge transfer while large values will increase the effect of our PATT module. The good performance achieved via taking an effective scale of 0.8 indicates that our PATT module plays an important role in the knowledge transfer. However, even larger values over 0.8 can affect the importance of original knowledge thereof the pretrained model. Hence, proper valued scalar $s$ is essential for balancing the role of PATT and
|
| 176 |
+
|
| 177 |
+
Table 4: Ablation of different implementation positions of PATT defined in Eq. 10, e.g., Ours (K, $\boldsymbol { \mathsf { V } }$ ) indicates inserting PATT to the query and key of 3DSW-MSA modules. Pre-training on Kinetics 600. $d _ { b o t t l e }$ is set to 128; Scalar $s$ is set to 0.8.
|
| 178 |
+
|
| 179 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">SSv2</td><td colspan="2">HMDB51</td></tr><tr><td>#Params</td><td>Top-1</td><td># Params</td><td>Top-1</td></tr><tr><td>Full-tuning</td><td>87.82M</td><td>50.99</td><td>87.69M</td><td>68.07</td></tr><tr><td>Concat (K, V)</td><td>6.38M</td><td>15.61</td><td>6.20M</td><td>20.98</td></tr><tr><td>No Zl-1(K,V)</td><td>8.74M</td><td>51.06</td><td>8.56M</td><td>67.41</td></tr><tr><td>Ours (Q, K)</td><td>6.38M</td><td>45.49</td><td>6.20M</td><td>68.92</td></tr><tr><td>Ours (K, V)</td><td>6.38M</td><td>53.38</td><td>6.20M</td><td>71.41</td></tr><tr><td>Ours (Q, V)</td><td>6.38M</td><td>53.24</td><td>6.20M</td><td>71.74</td></tr><tr><td>Ours (Q, K, V)</td><td>7.93M</td><td>53.23</td><td>7.63M</td><td>69.57</td></tr></table>
|
| 180 |
+
|
| 181 |
+
pre-trained backbone model. Note this can be a learnable parameter upon specific implementation, here we empirically verified the effect of the scalar.
|
| 182 |
+
|
| 183 |
+
# 3.6 THE EFFECT OF DIFFERENT METHODS YIELD FROM V-PETL
|
| 184 |
+
|
| 185 |
+
We have argued that, especially for relative large downstream datasets, the position and the amount of trainable parameters are important for parameter-efficient transfer learning in Section 2.4. The proposed Swin-BAPAT is one of instantiated models from the V-PETL framework regarding the insert position of our PATT. Other instantiations can be inserted into different positions such as query, key, and value of the attention module. We further instantiate other variations of our Swin-BAPAT by inserting PATT to different positions. Table 4 shows the results. Findings show that inserting to the value position of 3DSW-MSA can contribute more than inserting to other two positions. While inserting to query of key makes little difference for the performance. This is due to the fact that query and key make the calculation of the attention mask. Hence, inserting either one of them will lead to a similar effect. On one hand, these results, to some extent, justify the original design of prefix-tuning that bring learnable prefix to key and value of the attention module. On the other hand, it indicates that our claim regarding the unified view of PETL for visual tasks is reasonable. In Table 4, we also ablate the designs of PATT regarding concatenating $K _ { p }$ and $V _ { p }$ (i.e., Concat $[ \mathsf { K } , \mathsf { v } ] )$ , and using trainable parameters to generate $K _ { p }$ and $\boldsymbol { V _ { p } }$ (i.e., N ${ \bf \nabla } ) \ Z ^ { l - 1 } ( { \bf K } , { \bf V } ] )$ .
|
| 186 |
+
|
| 187 |
+
# 3.7 COMPARISON ON VARIED TASKS VIA SELF-SUPERVISED PRE-TRAINED MODELS
|
| 188 |
+
|
| 189 |
+
Table 5 shows the comparison with AdaptFormer-64 (Chen et al., 2022) and VPT (Jia et al., 2022) on both image- and video-based downstream tasks. Our method ViT-BAPAT still shows promising parameter-accuracy trade-off via much smaller batch size, which is more convenient for reproduction on the general single server with 8 GPUs. The underperformance on SSv2 (better than full-tuning) can be due to the smaller batch size as SSv2 is much larger than other compared datasets and can be more relying on larger batch size. In real-world application scenarios, small dataset can be the more common case, which confirms our contributions.
|
| 190 |
+
|
| 191 |
+
Table 5: Comparison of Top-1 accuracy via ViT-B models from MAE and VideoMAE pre-trained with self-supervised learning for image and video datasets, respectively.
|
| 192 |
+
|
| 193 |
+
<table><tr><td rowspan="2"> Method</td><td>Avg.</td><td></td><td>Image</td><td></td><td colspan="2">Video</td></tr><tr><td>Params (M)</td><td>CIFAR-100</td><td>SVHN</td><td>Food-101</td><td>SSv2</td><td>HMDB51</td></tr><tr><td>Full-tuning</td><td>86.04 (100%)</td><td>85.90</td><td>97.67</td><td>90.09</td><td>53.97</td><td>46.41</td></tr><tr><td>Tune FC Layer</td><td>0.07 (0.08%)</td><td></td><td></td><td>69.83 (-16.07) 66.91 (-30.76) 69.74 (-20.35)</td><td>29.23 (-24.74)</td><td>)49.84 (+3.43)</td></tr><tr><td>VPT (Jia et al.,2022)</td><td>0.08 (0.09%)</td><td>82.44 (-3.46)</td><td>94.02 (-3.65)</td><td>82.98 (-7.11)</td><td>43.73 (-10.24)</td><td>52.67 (+6.26)</td></tr><tr><td>AdaptFormer-64</td><td>1.26 (1.46%)</td><td>85.90 (0.00)</td><td>96.89 (-0.78)</td><td>87.61 (-2.48)</td><td>59.02 (+5.05)</td><td>55.69 (+9.28)</td></tr><tr><td>Our ViT-BAPAT-32</td><td>2.13 (2.47%)</td><td>86.29 (+0.39)</td><td>97.18 (-0.49)</td><td>87.37 (-2.72)</td><td>57.78 (+3.81)</td><td>57.18 (+10.77)</td></tr><tr><td>Our ViT-BAPAT-64</td><td>3.02 (3.51%)</td><td>86.35 (+0.45)</td><td>97.18 (-0.49)</td><td>87.53 (-2.56)</td><td>57.55 (+3.58)</td><td>57.18 (+10.77)</td></tr><tr><td>Our ViT-BAPAT-128</td><td>4.79 (5.56%)</td><td>86.47 (+0.57)</td><td>97.28 (-0.39)</td><td>87.66 (-2.43)</td><td>56.97 (+3.00)</td><td>57.70 (+11.29)</td></tr><tr><td>Our ViT-BAPAT-256</td><td>8.33 (9.68%)</td><td>86.55 (+0.65)</td><td>97.24 (-0.43)</td><td>87.68 (-2.41)</td><td>56.53 (+2.56)</td><td>57.31 (+10.90)</td></tr></table>
|
| 194 |
+
|
| 195 |
+
# 4 CONCLUSION
|
| 196 |
+
|
| 197 |
+
In this paper, we introduced a V-PETL framework for exploiting good parameter-accuracy tradeoff around adapting video-based pre-trained large models to downstream tasks. Our Swin-BAPAT method derived from the V-PETL with a variation of prefix-tuning known as PATT can effectively bring good parameter-accuracy trade-off on downstream tasks. The proposed PATT can be easily plugged to the attention module of other transformer-like models. Meanwhile, the amount of trainable parameter can be easily adjusted by the parameter $d _ { b o t t l e }$ . With small amount overhead on trainable parameters, our method performs significantly better than state-of-the-art method AdapFormer-Swin and full-tuning on the datasets SSv2 and HMDB51 via small batch size, validating our contribution to the literature of PETL. In the future we will test our proposed model on more action recognition datasets surveyed in Sun et al. (2022) under more learning regimes such as zero/few-shot learning, active learning and continual learning with other pre-training methods such as visual-language models. We will also explore other backbone models, activation functions for PATT, and PETL techniques such as LoRA for visual tasks.
|
| 198 |
+
|
| 199 |
+
# REFERENCES
|
| 200 |
+
|
| 201 |
+
Lukas Bossard, Matthieu Guillaumin, and Luc Van Gool. Food-101–mining discriminative components with random forests. In European conference on computer vision, pp. 446–461. Springer, 2014.
|
| 202 |
+
|
| 203 |
+
Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901, 2020.
|
| 204 |
+
|
| 205 |
+
Joao Carreira and Andrew Zisserman. Quo vadis, action recognition? a new model and the kinetics dataset. In proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6299–6308, 2017.
|
| 206 |
+
|
| 207 |
+
Shoufa Chen, Chongjian Ge, Zhan Tong, Jiangliu Wang, Yibing Song, Jue Wang, and Ping Luo. Adaptformer: Adapting vision transformers for scalable visual recognition. arXiv preprint arXiv:2205.13535, 2022.
|
| 208 |
+
|
| 209 |
+
Ian J Goodfellow, Yaroslav Bulatov, Julian Ibarz, Sacha Arnoud, and Vinay Shet. Multi-digit number recognition from street view imagery using deep convolutional neural networks. arXiv preprint arXiv:1312.6082, 2013.
|
| 210 |
+
|
| 211 |
+
Raghav Goyal, Samira Ebrahimi Kahou, Vincent Michalski, Joanna Materzynska, Susanne Westphal, Heuna Kim, Valentin Haenel, Ingo Fruend, Peter Yianilos, Moritz Mueller-Freitag, et al. The” something something” video database for learning and evaluating visual common sense. In Proceedings of the IEEE international conference on computer vision, pp. 5842–5850, 2017.
|
| 212 |
+
|
| 213 |
+
Julia Gusak, Daria Cherniuk, Alena Shilova, Alexandr Katrutsa, Daniel Bershatsky, Xunyi Zhao, Lionel Eyraud-Dubois, Oleh Shliazhko, Denis Dimitrov, Ivan Oseledets, and Olivier Beaumont. Survey on efficient training of large neural networks. In Lud De Raedt (ed.), Proceedings of the Thirty-First International Joint Conference on Artificial Intelligence, IJCAI-22, pp. 5494–5501. International Joint Conferences on Artificial Intelligence Organization, 7 2022. doi: 10.24963/ ijcai.2022/769. URL https://doi.org/10.24963/ijcai.2022/769. Survey Track.
|
| 214 |
+
|
| 215 |
+
Junxian He, Chunting Zhou, Xuezhe Ma, Taylor Berg-Kirkpatrick, and Graham Neubig. Towards a unified view of parameter-efficient transfer learning. In International Conference on Learning Representations, 2022a. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ 0RDcd5Axok.
|
| 216 |
+
|
| 217 |
+
Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr Dollar, and Ross Girshick. Masked au-´ toencoders are scalable vision learners. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 16000–16009, 2022b.
|
| 218 |
+
|
| 219 |
+
Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin De Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. Parameter-efficient transfer learning for nlp. In International Conference on Machine Learning, pp. 2790–2799. PMLR, 2019.
|
| 220 |
+
|
| 221 |
+
Edward J Hu, yelong shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. LoRA: Low-rank adaptation of large language models. In International Conference on Learning Representations, 2022. URL https://openreview.net/forum? id=nZeVKeeFYf9.
|
| 222 |
+
|
| 223 |
+
Menglin Jia, Luming Tang, Bor-Chun Chen, Claire Cardie, Serge Belongie, Bharath Hariharan, and Ser-Nam Lim. Visual prompt tuning. arXiv preprint arXiv:2203.12119, 2022.
|
| 224 |
+
|
| 225 |
+
Will Kay, Joao Carreira, Karen Simonyan, Brian Zhang, Chloe Hillier, Sudheendra Vijayanarasimhan, Fabio Viola, Tim Green, Trevor Back, Paul Natsev, et al. The kinetics human action video dataset. arXiv preprint arXiv:1705.06950, 2017.
|
| 226 |
+
|
| 227 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
|
| 228 |
+
|
| 229 |
+
Hildegard Kuehne, Hueihan Jhuang, Est´ıbaliz Garrote, Tomaso Poggio, and Thomas Serre. Hmdb: a large video database for human motion recognition. In 2011 International conference on computer vision, pp. 2556–2563. IEEE, 2011.
|
| 230 |
+
|
| 231 |
+
Ananya Kumar, Aditi Raghunathan, Robbie Matthew Jones, Tengyu Ma, and Percy Liang. Finetuning can distort pretrained features and underperform out-of-distribution. In International Conference on Learning Representations, 2021.
|
| 232 |
+
|
| 233 |
+
Tianjiao Li, Qiuhong Ke, Hossein Rahmani, Rui En Ho, Henghui Ding, and Jun Liu. Else-net: Elastic semantic network for continual action recognition from skeleton data. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 13434–13443, 2021a.
|
| 234 |
+
|
| 235 |
+
Tianjiao Li, Jun Liu, Wei Zhang, Yun Ni, Wenqian Wang, and Zhiheng Li. Uav-human: A large benchmark for human behavior understanding with unmanned aerial vehicles. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 16266–16275, 2021b.
|
| 236 |
+
|
| 237 |
+
Xiang Lisa Li and Percy Liang. Prefix-tuning: Optimizing continuous prompts for generation. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 4582–4597, 2021.
|
| 238 |
+
|
| 239 |
+
Zhaojiang Lin, Andrea Madotto, and Pascale Fung. Exploring versatile generative language model via parameter-efficient transfer learning. In Findings of the Association for Computational Linguistics: EMNLP 2020, pp. 441–459, 2020.
|
| 240 |
+
|
| 241 |
+
Pengfei Liu, Weizhe Yuan, Jinlan Fu, Zhengbao Jiang, Hiroaki Hayashi, and Graham Neubig. Pretrain, prompt, and predict: A systematic survey of prompting methods in natural language processing. arXiv preprint arXiv:2107.13586, 2021.
|
| 242 |
+
|
| 243 |
+
Shaoshan Liu, Liangkai Liu, Jie Tang, Bo Yu, Yifan Wang, and Weisong Shi. Edge computing for autonomous driving: Opportunities and challenges. Proceedings of the IEEE, 107(8):1697–1716, 2019.
|
| 244 |
+
|
| 245 |
+
Ze Liu, Jia Ning, Yue Cao, Yixuan Wei, Zheng Zhang, Stephen Lin, and Han Hu. Video swin transformer. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3202–3211, 2022.
|
| 246 |
+
|
| 247 |
+
Junting Pan, Ziyi Lin, Xiatian Zhu, Jing Shao, and Hongsheng Li. St-adapter: Parameter-efficient image-to-video transfer learning for action recognition. arXiv preprint arXiv:2206.13559, 2022.
|
| 248 |
+
|
| 249 |
+
Hieu Pham, Zihang Dai, Qizhe Xie, and Quoc V Le. Meta pseudo labels. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 11557–11568, 2021.
|
| 250 |
+
|
| 251 |
+
Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning, pp. 8748–8763. PMLR, 2021.
|
| 252 |
+
|
| 253 |
+
Mannat Singh, Laura Gustafson, Aaron Adcock, Vinicius de Freitas Reis, Bugra Gedik, Raj Prateek Kosaraju, Dhruv Mahajan, Ross Girshick, Piotr Dollar, and Laurens van der Maaten. Revisiting ´ weakly supervised pre-training of visual perception models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 804–814, 2022.
|
| 254 |
+
|
| 255 |
+
Zehua Sun, Qiuhong Ke, Hossein Rahmani, Mohammed Bennamoun, Gang Wang, and Jun Liu. Human action recognition from various data modalities: A review. IEEE transactions on pattern analysis and machine intelligence, 2022.
|
| 256 |
+
|
| 257 |
+
Yi-Lin Sung, Jaemin Cho, and Mohit Bansal. Vl-adapter: Parameter-efficient transfer learning for vision-and-language tasks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5227–5237, 2022.
|
| 258 |
+
|
| 259 |
+
Zhan Tong, Yibing Song, Jue Wang, and Limin Wang. Videomae: Masked autoencoders are dataefficient learners for self-supervised video pre-training. arXiv preprint arXiv:2203.12602, 2022.
|
| 260 |
+
|
| 261 |
+
Xiaohan Wang, Linchao Zhu, Heng Wang, and Yi Yang. Interactive prototype learning for egocentric action recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 8168–8177, 2021.
|
| 262 |
+
|
| 263 |
+
Jiahui Yu, Zirui Wang, Vijay Vasudevan, Legg Yeung, Mojtaba Seyedhosseini, and Yonghui Wu. Coca: Contrastive captioners are image-text foundation models. arXiv preprint arXiv:2205.01917, 2022.
|
| 264 |
+
|
| 265 |
+
Sha Yuan, Hanyu Zhao, Shuai Zhao, Jiahong Leng, Yangxiao Liang, Xiaozhi Wang, Jifan Yu, Xin Lv, Zhou Shao, Jiaao He, et al. A roadmap for big model. arXiv preprint arXiv:2203.14101, 2022.
|
| 266 |
+
|
| 267 |
+
Elad Ben Zaken, Yoav Goldberg, and Shauli Ravfogel. Bitfit: Simple parameter-efficient fine-tuning for transformer-based masked language-models. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pp. 1–9, 2022.
|
| 268 |
+
|
| 269 |
+
Xiaohua Zhai, Alexander Kolesnikov, Neil Houlsby, and Lucas Beyer. Scaling vision transformers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12104–12113, 2022.
|
| 270 |
+
|
| 271 |
+
Yuanhan Zhang, Kaiyang Zhou, and Ziwei Liu. Neural prompt search. arXiv preprint arXiv:2206.04673, 2022.
|
| 272 |
+
|
| 273 |
+
Fuzhen Zhuang, Zhiyuan Qi, Keyu Duan, Dongbo Xi, Yongchun Zhu, Hengshu Zhu, Hui Xiong, and Qing He. A comprehensive survey on transfer learning. Proceedings of the IEEE, 109(1): 43–76, 2020.
|
| 274 |
+
|
| 275 |
+
# A APPENDIX
|
| 276 |
+
|
| 277 |
+
A.1 THE EFFECT OF FC LAYER FOR SMALL SCALE DOWNSTREAM TASKS
|
| 278 |
+
|
| 279 |
+
Table 6: Results of with or without tuning the FC layer on the small scale dataset HMDB51.
|
| 280 |
+
|
| 281 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">dbottle</td><td rowspan="2">Pre-training</td><td rowspan="2">#Frames</td><td colspan="2">with FC layer</td><td colspan="2">without FC layer</td></tr><tr><td>#Params</td><td>Top-1 (%)</td><td>#Params</td><td>Top-1 (%)</td></tr><tr><td>Our Swin-BAPAT</td><td>32</td><td>Kinetics 400</td><td>8</td><td>2.79M</td><td>65.97</td><td>2.74M</td><td>68.20</td></tr><tr><td>Our Swin-BAPAT</td><td>64</td><td>Kinetics 400</td><td>8</td><td>3.94M</td><td>67.28</td><td>3.89M</td><td>70.10</td></tr><tr><td>Our Swin-BAPAT</td><td>128</td><td>Kinetics 400</td><td>8</td><td>6.25M</td><td>66.75</td><td>6.20M</td><td>71.93</td></tr><tr><td>Our Swin-BAPAT</td><td>256</td><td>Kinetics 400</td><td>8</td><td>10.88M</td><td>67.67</td><td>10.83M</td><td>69.64</td></tr><tr><td>Our Swin-BAPAT</td><td>256</td><td>Kinetics 400</td><td>8</td><td>10.88M</td><td>67.67</td><td>10.83M</td><td>69.64</td></tr><tr><td>Our Swin-BAPAT</td><td>256</td><td>Kinetics 600</td><td>8</td><td>10.88M</td><td>67.41</td><td>10.83M</td><td>69.90</td></tr><tr><td>Our Swin-BAPAT</td><td>128</td><td>Kinetics 400</td><td>8</td><td>6.25M</td><td>66.75</td><td>6.20M</td><td>71.93</td></tr><tr><td>Our Swin-BAPAT</td><td>128</td><td>Kinetics 400</td><td>16</td><td>6.25M</td><td>70.56</td><td>6.20M</td><td>75.67</td></tr><tr><td>Our Swin-BAPAT</td><td>128</td><td>Kinetics 400</td><td>32</td><td>6.25M</td><td>74.82</td><td>6.20M</td><td>76.46</td></tr></table>
|
| 282 |
+
|
| 283 |
+
For the small dataset HMDB51, due to the good parameter-accuracy trade-off achieved by finetuning the FC layer only, adding the FC layer cannot bring extra improvement to our proposed method. Without sufficient taining data, full-tuning also cannot perform well (see results in Table 2). As such, small datasets do not need to rely on large models but can make use of large models with light transfer. Instead, without tuning the FC layer, our Swin-BAPAT can perform better than fine-tuning the FC layer with small amount of extra trainable parameters (see results in Table 6), validating the good parameter-accuracy trade-off of our method.
|
md/dev/vSix3HPYKSU/vSix3HPYKSU.md
ADDED
|
@@ -0,0 +1,635 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MESSAGE PASSING NEURAL PDE SOLVERS
|
| 2 |
+
|
| 3 |
+
# Johannes Brandstetter∗
|
| 4 |
+
|
| 5 |
+
Daniel E. Worrall∗ Qualcomm AI Research† dworrall@qti.qualcomm.com
|
| 6 |
+
|
| 7 |
+
University of Amsterdam Johannes Kepler University Linz brandstetter@ml.jku.at
|
| 8 |
+
|
| 9 |
+
Max Welling University of Amsterdam m.welling@uva.nl
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
The numerical solution of partial differential equations (PDEs) is difficult, having led to a century of research so far. Recently, there have been pushes to build neural–numerical hybrid solvers, which piggy-backs the modern trend towards fully end-to-end learned systems. Most works so far can only generalize over a subset of properties to which a generic solver would be faced, including: resolution, topology, geometry, boundary conditions, domain discretization regularity, dimensionality, etc. In this work, we build a solver, satisfying these properties, where all the components are based on neural message passing, replacing all heuristically designed components in the computation graph with backpropoptimized neural function approximators. We show that neural message passing solvers representationally contain some classical methods, such as finite differences, finite volumes, and WENO schemes. In order to encourage stability in training autoregressive models, we put forward a method that is based on the principle of zero-stability, posing stability as a domain adaptation problem. We validate our method on various fluid-like flow problems, demonstrating fast, stable, and accurate performance across different domain topologies, discretization, etc. in 1D and 2D. Our model outperforms state-of-the-art numerical solvers in the low resolution regime in terms of speed and accuracy.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
In the sciences, years of work have yielded extremely detailed mathematical models of physical phenomena. Many of these models are expressed naturally in differential equation form (Olver, 2014), most of the time as temporal partial differential equations (PDE). Solving these differential equations is of huge importance for problems in all numerate disciplines such as weather forecasting (Lynch, 2008), astronomical simulations (Courant et al., 1967), molecular modeling (Lelievre & \` Stoltz, 2016) , or jet engine design (Athanasopoulos et al., 2009). Solving most equations of importance is analytically intractable and necessitates falling back on numerical approximation schemes. Obtaining accurate solutions of bounded error with minimal computational overhead requires the need for handcrafted solvers, always tailored to the equation at hand (Hairer et al., 1993).
|
| 18 |
+
|
| 19 |
+
The design of “good” PDE solvers is no mean feat. The perfect solver should satisfy an almost endless list of conditions. There are user requirements, such as being fast, using minimal computational overhead, being accurate, providing uncertainty estimates, generalizing across PDEs, and being easy to use. Then there are structural requirements of the problem, such as spatial resolution and timescale, domain sampling regularity, domain topology and geometry, boundary conditions, dimensionality, and solution space smoothness. And then there are implementational requirements, such as maintaining stability over long rollouts and preserving invariants. It is precisely because of this considerable list of requirements that the field of numerical methods is a splitter field (Bartels, 2016), tending to build handcrafted solvers for each sub-problem, rather than a lumper field, where a mentality of “one method to rule them all” reigns. This tendency is commonly justified with reference to no free lunch theorems. We propose to numerically solve PDEs with an end-to-end, neural solver. Our contributions can be broken down into three main parts: (i) An end-to-end fully neural PDE solver, based on neural message passing, which offers flexibility to satisfy all structural requirements of a typical PDE problem. This design is motivated by the insight that some classical solvers (finite differences, finite volumes, and WENO scheme) can be posed as special cases of message passing. (ii) Temporal bundling and the pushforward trick, which are methods to encourage zero-stability in training autoregressive models. (iii) Generalization across multiple PDEs within a given class. At test time, new PDE coefficients can be input to the solver.
|
| 20 |
+
|
| 21 |
+
# 2 BACKGROUND AND RELATED WORK
|
| 22 |
+
|
| 23 |
+
Here in Section 2.1 we briefly outline definitions and notation. We then outline some classical solving techniques in Section 2.2. Lastly, in Section 2.3, we list some recent neural solvers and split them into the two main neural solving paradigms for temporal PDEs.
|
| 24 |
+
|
| 25 |
+
# 2.1 PARTIAL DIFFERENTIAL EQUATIONS
|
| 26 |
+
|
| 27 |
+
We focus on PDEs in one time dimension $t ~ = ~ [ 0 , T ]$ and possibly multiple spatial dimensions $\mathbf { x } = [ x _ { 1 } , x _ { 2 } , \ldots , x _ { D } ] ^ { \top } \in \mathbb { X }$ . These can be written down in the form
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
\begin{array} { r l r l } & { \partial _ { t } \mathbf { u } = F ( t , \mathbf { x } , \mathbf { u } , \partial _ { \mathbf { x } } \mathbf { u } , \partial _ { \mathbf { x } \mathbf { x } } \mathbf { u } , \dots ) } & & { \qquad ( t , \mathbf { x } ) \in [ 0 , T ] \times \mathbb { X } } \\ & { \mathbf { u } ( 0 , \mathbf { x } ) = \mathbf { u } ^ { 0 } ( \mathbf { x } ) , \qquad B [ \mathbf { u } ] ( t , x ) = 0 } & & { \qquad \mathbf { x } \in \mathbb { X } , \ ( t , \mathbf { x } ) \in [ 0 , T ] \times \partial \mathbb { X } } \end{array}
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
where $\mathbf { u } : [ 0 , T ] \times \mathbb { X } \mathbb { R } ^ { n }$ is the solution, with initial condition ${ \bf u } ^ { 0 } ( { \bf x } )$ at time $t = 0$ and boundary conditions $B [ { \bf u } ] ( t , x ) = 0$ when $\mathbf { x }$ is on the boundary $\partial \mathbb { X }$ of the domain $\mathbb { X }$ . The notation $\partial _ { \mathbf { x } } \mathbf { u } , \partial _ { \mathbf { x } \mathbf { x } } \mathbf { u } , \ldots$ is shorthand for partial derivatives $\partial { \bf u } / \partial { \bf x } , \bar { \partial } ^ { 2 } { \bf u } / \partial { \bf x } ^ { 2 }$ , and so forth. Most notably, $\partial \mathbf { u } / \partial \mathbf { x }$ represents a $n \times D$ dimensional Jacobian matrix, where each row is the transpose of the gradient of the corresponding component of $\mathbf { u }$ . We consider Dirichlet boundary conditions, where the boundary operator $B _ { \mathcal { D } } [ \mathbf { u } ] = \mathbf { u } - \mathbf { b } _ { \mathcal { D } }$ for fixed function $\mathbf { b } _ { \mathcal { D } }$ and Neumann boundary conditions, where $B _ { \mathcal { N } } [ \bar { u } ] \stackrel { \cdot } { = } { \mathbf { n } } ^ { \top } \partial _ { \mathbf { x } } u - \bar { b } _ { \mathcal { N } } ^ { \top }$ for scalar-valued $u$ , where $\mathbf { n }$ is an outward facing normal on $\partial \mathbb { X }$ .
|
| 34 |
+
|
| 35 |
+
Conservation form Among all PDEs, we hone in on solving those that can be written down in conservation form, because there is already precedent in the field for having studied these (Bar-Sinai et al., 2019; Li et al., 2020a). Conservation form PDEs are written as
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\partial _ { t } \mathbf { u } + \nabla \cdot \mathbf { J } ( \mathbf { u } ) = 0 ,
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
where $\nabla \cdot \mathbf { J }$ is the divergence of $\mathbf { J }$ . The quantity $\mathbf { J } : \mathbb { R } ^ { n } \mathbb { R } ^ { n }$ is the flux, which has the interpretation of a quantity that appears to flow. Consequently, $\mathbf { u }$ is a conserved quantity within a volume, only changing through the net flux $\mathbf { J } ( \mathbf { u } )$ through its boundaries.
|
| 42 |
+
|
| 43 |
+
# 2.2 CLASSICAL SOLVERS
|
| 44 |
+
|
| 45 |
+
Grids and cells Numerical solvers partition $\mathbb { X }$ into a finite grid $X = \{ c _ { i } \} _ { i = 1 } ^ { N }$ of $N$ small nonoverlapping volumes called cells $c _ { i } \subset \mathbb { X }$ . In this work, we focus on grids of rectangular cells. Each cell has a center at $\mathbf { x } _ { i }$ . $\mathbf { u } _ { i } ^ { k }$ is used to denote the discretized solution in cell $c _ { i }$ and time $t _ { k }$ . There are two main ways to compute $\mathbf { u } _ { i } ^ { k }$ : sampling $\mathbf { u } _ { i } ^ { k } = \mathbf { u } ( t _ { k } , \mathbf { x } _ { i } )$ and averaging $\begin{array} { r } { \mathbf { u } _ { i } ^ { k } = \int _ { c _ { i } } \mathbf { u } ( t _ { k } , \mathbf { x } ) \mathrm { d } \mathbf { x } } \end{array}$ . In our notation, omitting an index implies that we use the entire slice, so $\mathbf { u } ^ { k } = ( \mathbf { u } _ { 1 } ^ { k } , \mathbf { u } _ { 2 } ^ { k } , . . . , \mathbf { u } _ { N } ^ { k } )$ .
|
| 46 |
+
|
| 47 |
+
Method of lines A common technique to solve temporal PDEs is the method of lines (Schiesser, 2012), discretizing domain $\mathbb { X }$ and solution $\mathbf { u }$ into a grid $X$ and a vector $\mathbf { u } ^ { k }$ . We then solve $\left. \partial _ { t } \mathbf { u } ^ { t } \right| _ { t _ { k } } =$ $f ( t , \mathbf { u } ^ { k } )$ for $t \in [ 0 , T ]$ , where $f$ is the form of $F$ acting on the vectorized $\mathrm { ~ \bf ~ u ~ } ^ { t }$ instead of the function $\mathbf { u } ( t , \mathbf { x } )$ . The only derivative operator is now in time, making it an ordinary differential equation (ODE), which can be solved with off-the-shelf ODE solvers (Butcher, 1987; Everhart, 1985). $f$ can be formed by approximating spatial derivatives on the grid. Below are three classical techniques.
|
| 48 |
+
|
| 49 |
+
Finite difference method (FDM) In FDM, spatial derivative operators (e.g., $\partial _ { \mathbf { x } } )$ are replaced with difference operators, called stencils. For instance, $\partial _ { x } u ^ { k } | _ { x _ { i } }$ might become $( \mathbf { \bar { \boldsymbol { u } } } _ { i + 1 } ^ { k } - \boldsymbol { u } _ { i } ^ { k } ) / ( \mathbf { \bar { \boldsymbol { x } } } _ { i + 1 } - \boldsymbol { x } _ { i } )$ . Principled ways to derive stencils can be found in Appendix A. FDM is simple and efficient, but suffers poor stability unless the spatial and temporal discretizations are carefully controlled.
|
| 50 |
+
|
| 51 |
+
Finite volume method (FVM) FVM works for equations in conservation form. It can be shown via the divergence theorem that the integral of $\mathbf { u }$ over cell $i$ increases only by the net flux into the cell. In 1D, this leads to f (t, uki ) = 1∆x $\begin{array} { r } { f ( t , u _ { i } ^ { k } ) = \mathbf { \Pi } _ { \Delta x _ { i } } ^ { - 1 } ( J _ { i - 1 / 2 } ^ { k } - J _ { i + 1 / 2 } ^ { k } ) } \end{array}$ , where $\Delta x _ { i }$ is the cell width, and $J _ { i - 1 / 2 } ^ { k } , J _ { i + 1 / 2 } ^ { k }$ i the flux at the left and right cell boundary at time $t _ { k }$ , respectively. The problem thus boils down to estimating the flux at cell boundaries $x _ { i \pm 1 / 2 }$ . The beauty of this technique is that the integral of $u$ is exactly conserved. FVM is generally more stable and accurate than FDM, but can only be applied to conservation form equations.
|
| 52 |
+
|
| 53 |
+
Pseudospectral method (PSM) PSM computes derivatives in Fourier space. In practical terms,√ the $m ^ { \mathrm { t h } }$ derivative is computed as $\mathrm { I F F T } \{ ( \iota \omega \bar { ) } ^ { m } \mathrm { F F T } ( \boldsymbol { u } ) \}$ for $\iota = \sqrt { - 1 }$ . These derivatives obtain exponential accuracy (Tadmor, 1986), for smooth solutions on periodic domains and regular grids. For non-periodic domains, analogues using other polynomial transforms exist, but for non-smooth solution this technique cannot be applied.
|
| 54 |
+
|
| 55 |
+
# 2.3 NEURAL SOLVERS
|
| 56 |
+
|
| 57 |
+
We build on recent exciting developments in the field to learn PDE solvers. These neural PDE solvers, as we refer to them, are laying the foundations of what is becoming both a rapidly growing and impactful area of research. Neural PDE solvers for temporal PDEs fall into two broad categories, autoregressive methods and neural operator methods, see Figure 1a.
|
| 58 |
+
|
| 59 |
+
Neural operator methods Neural operator methods treat the mapping from initial conditions to solutions at time $t$ as an input–output mapping learnable via supervised learning. For a given PDE and given initial conditions $\mathbf { u } _ { 0 }$ , a neural operator $\mathcal { M } : [ 0 , T ] \stackrel { \cdot } { \times } \mathcal { F } \mathcal { F }$ , where $\mathcal { F }$ is a (possibly infinite-dimensional) function space, is trained to satisfy
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\mathcal { M } ( t , { \mathbf { u } } ^ { 0 } ) = { \mathbf { u } } ( t ) .
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
Finite-dimensional operator methods (Raissi, 2018; Sirignano & Spiliopoulos, 2018; Bhatnagar et al., 2019; Guo et al., 2016; Zhu & Zabaras, 2018; Khoo et al., 2020), where $\mathrm { d i m } ( \mathcal { F } ) < \infty$ are grid-dependent, so cannot generalize over geometry and sampling. Infinite-dimensional operator methods (Li et al., 2020c;a; Bhattacharya et al., 2021; Patel et al., 2021) by contrast resolve this issue. Each network is trained on example solutions of the equation of interest and is therefore locked to that equation. These models are not designed to generalize to dynamics for out-of-distribution $t$ .
|
| 66 |
+
|
| 67 |
+
Autogressive methods An orthogonal approach, which we take, is autoregressive methods. These solve the PDE iteratively. For time-independent PDEs, the solution at time $t + \Delta t$ is computed as
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\mathbf { u } ( t + \Delta t ) = \mathcal { A } ( \Delta t , \mathbf { u } ( t ) ) ,
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $\mathcal { A } : \mathbb { R } _ { > 0 } \times \mathbb { R } ^ { N } \to \mathbb { R } ^ { N }$ is the temporal update. In this work, since $\Delta t$ is fixed, we just write $\boldsymbol { \mathcal { A } } ( \mathbf { u } ( t ) )$ . Three important works in this area are Bar-Sinai et al. (2019), Greenfeld et al. (2019), and Hsieh et al. (2019). Each paper focuses on a different class of PDE solver: finite volumes, multigrid, and iterative finite elements, respectively. Crucially, they all use a hybrid approach (Garcia Satorras et al., 2019), where the solver computational graph is preserved and heuristically-chosen parameters are predicted with a neural network. Hsieh et al. (2019) even have convergence guarantees for their method, something rare in deep learning. Hybrid methods are desirable for sharing structure with classical solvers. So far in the literature, however, it appears that autoregressive methods are more the exception than the norm, and for those methods published, it is reported that they are hard to train. In Section 3 we explore why this is and seek to remedy it.
|
| 74 |
+
|
| 75 |
+
# 3 METHOD
|
| 76 |
+
|
| 77 |
+
In this section we detail our method in two parts: training framework and architecture. The training framework tackles the distribution shift problem in autoregressive solvers, which leads to instability. We then outline the network architecture, which is a message passing neural network.
|
| 78 |
+
|
| 79 |
+
# 3.1 TRAINING FRAMEWORK
|
| 80 |
+
|
| 81 |
+
Autoregressive solvers map solutions $\mathbf { u } ^ { k }$ to causally consequent ones $\mathbf { u } ^ { k + 1 }$ . A straightforward way of training is one-step training. If $p _ { 0 } ( \mathbf { u } ^ { 0 } )$ is the distribution of initial conditions in the training set, and $\begin{array} { r } { p _ { k } ( \mathbf { u } ^ { \bar { k } } ) = \int p ( \mathbf { u } ^ { \bar { k } } | \mathbf { u } ^ { 0 } ) p _ { 0 } ( \mathbf { \bar { u } } ^ { 0 } ) \mathrm { d } \mathbf { u } ^ { 0 } } \end{array}$ is the groundtruth distribution at iteration $k$ , we minimize
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
L _ { \mathrm { o n e - s t e p } } = \mathbb { E } _ { k } \mathbb { E } _ { { \mathbf { u } } ^ { k + 1 } | { \mathbf { u } } ^ { k } , { \mathbf { u } } ^ { k } \sim p _ { k } } \left[ \mathcal { L } ( A ( { \mathbf { u } } ^ { k } ) , { \mathbf { u } } ^ { k + 1 } ) \right] ,
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+

|
| 88 |
+
Figure 1: (a) LEFT: Neural operators perform a direct mapping from initial conditions to a solution at time $t$ . RIGHT: Autoregressive models on the other hand compute the solution at time $t$ based on the computed solution at a fixed time offset before. (b) Our autoregressive solver outputs multiple time slices on every call, to reduce number of solver calls and therefore error propagation speed.
|
| 89 |
+
|
| 90 |
+
where $\mathcal { L }$ is an appropriate loss function. At test time, this method has a key failure mode, instability: small errors in $\mathcal { A }$ accumulate over rollouts greater in length than 1 (which is the vast majority of rollouts), and lead to divergence from the groundtruth. This can be interpreted as overfitting to the one-step training distribution, and thus being prone to generalize poorly if the input shifts from this, which is usually the case after a few rollout steps.
|
| 91 |
+
|
| 92 |
+
The pushforward trick We approach the problem in probabilistic terms. The solver maps $p _ { k } \mapsto$ $\mathcal { A } _ { \sharp } p _ { k }$ at iteration $k + 1$ , where ${ \bar { \mathcal { A } } } _ { \sharp } : \mathbb { P } ( X ) \ { \bar { \to } } \ \mathbb { P } ( X )$ is the pushforward operator for $\mathcal { A }$ and $\mathbb { P } ( X )$ is the space of distributions on $X$ . After a single test time iteration, the solver sees samples from $\mathcal { A } _ { \sharp } p _ { k }$ instead of the distribution $p _ { k + 1 }$ , and unfortunately $\mathcal { A } _ { \sharp } p _ { k } \neq p _ { k + 1 }$ because errors always survive training. The test time distribution is thus shifted, which we refer to as the distribution shift problem. This is a domain adaptation problem. We mitigate the distribution shift problem by adding a stability loss term, accounting for the distribution shift. A natural candidate is an adversarial-style loss
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
L _ { \mathrm { s t a b i l i t y } } = \mathbb { E } _ { k } \mathbb { E } _ { { \mathbf { u } } ^ { k + 1 } | { \mathbf { u } } ^ { k } , { \mathbf { u } } ^ { k } \sim p _ { k } } \left[ \mathbb { E } _ { \epsilon | { \mathbf { u } } ^ { k } } \left[ { \mathcal { L } } ( A ( { \mathbf { u } } ^ { k } + { \boldsymbol { \epsilon } } ) , { \mathbf { u } } ^ { k + 1 } ) \right] \right] ,
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
where $\boldsymbol { \epsilon } | \mathbf { u } ^ { k }$ is an adversarial perturbation sampled from an appropriate distribution. For the perturbation distribution, we choose $\epsilon$ such that $( \mathbf { u } ^ { k } + \epsilon ) \sim \bar { \mathcal { A } } _ { \sharp } p _ { k }$ . This can be easily achieved by using $( \mathbf { u } ^ { k } + \epsilon ) = \mathcal { A } ( \mathbf { u } ^ { k - 1 } )$ for $\mathbf { u } ^ { k - 1 }$ one step causally preceding $\mathbf { u } ^ { k }$ . Our total loss is then $L _ { \mathrm { o n e - s t e p } } + L _ { \mathrm { s t a b i l i t y } }$ . We call this the pushforward trick. We implement this by unrolling the solver for 2 steps but only backpropagating errors on the last unroll step, as shown in Figure 2. This is also outlined algorithmically in the appendix. We found it important not to backpropagate through the first unroll step. This is not only faster, it also seems to be more stable. Exactly why, we are not sure, but we think it may be to ensure the perturbations are large enough. Training the adversarial distribution itself to minimize the error, defeats the purpose of using it as an adversarial distribution. Adversarial losses were also introduced in Sanchez-Gonzalez et al. (2020) and later used in Mayr et al. (2021), where Brownian motion noise is used for $\epsilon$ and there is some similarity to Noisy Nodes (Godwin et al.), where noise injection is found to stabilize training of deep graph neural networks. There are also connections with zero-stability (Hairer et al., 1993) from the ODE solver literature. Zero-stability is the condition that perturbations in the input conditions are damped out sublinearly in time, that is $\lVert A ( \mathbf { u } ^ { 0 } + \epsilon ) - \mathbf { u } ^ { 1 } \rVert \stackrel { . } { < } \kappa \lVert \epsilon \rVert$ , for appropriate norm and small $\kappa$ . The pushforward trick can be seen to minimize $\kappa$ directly.
|
| 99 |
+
|
| 100 |
+
The temporal bundling trick The second trick we found to be effective for stability and reducing rollout time is to predict multiple timesteps into the future synchronously. A typical temporal solver only predicts $\mathbf { u } ^ { 0 } \mapsto \mathbf { u } ^ { 1 }$ ; whereas, we predict $K$ steps $\mathbf { u } ^ { 0 } \mapsto \left( \mathbf { u } ^ { 1 } , \mathbf { u } ^ { 2 } , . . . , \mathbf { \bar { u } } ^ { K } \right) \stackrel { . . . } { = } \mathbf { u } ^ { 1 : K }$ together. This reduces the number of solver calls by a factor of $K$ and so reduces the number of times the solution distribution undergoes distribution shifts. A schematic of this setup can be seen in Figure 1b.
|
| 101 |
+
|
| 102 |
+
# 3.2 ARCHITECTURE
|
| 103 |
+
|
| 104 |
+
We model the grid $X$ as a graph $\mathcal { G } = ( \nu , \mathcal { E } )$ with nodes $i \in \mathcal V$ , edges $i j \in \mathcal { E }$ , and node features $\mathbf { f } _ { i } ~ \in ~ \mathbb { R } ^ { c }$ . The nodes represent grid cells $c _ { i }$ and the edges define local neighborhoods. Modeling the domain as a graph offers flexibility over grid sampling regularity, spatial/temporal resolution, domain topology and geometry, boundary modeling and dimensionality. The solver is a graph neural network (GNN) (Scarselli et al., 2009; Kipf & Welling, 2017; Defferrard et al., 2016; Gilmer et al., 2017; Battaglia et al., 2018), representationally containing the function class of several classical solvers, see Section 3.2. We follow the Encode-Process-Decode framework of Battaglia et al. (2018) and Sanchez-Gonzalez et al. (2020) , with adjustments. We are not the first to use GNNs as PDE solvers (Li et al., 2020b; De Avila Belbute-Peres et al., 2020), but ours have several notable features. Different aspects of the chosen architecture are ablated in Appendix G.
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
Figure 2: Different training strategies. LEFT: One-step training only predicts solutions one step into the future. MIDDLE: Unrolled training predicts $N$ steps into the future. RIGHT: Adversarial training predicts $N$ steps into the future, but only backprops on the last step.
|
| 108 |
+
|
| 109 |
+
Encoder The encoder computes node embeddings. For each node $i$ it maps the last $K$ solution values uki $\mathbf { u } _ { i } ^ { k - K : k }$ , node position $\mathbf { x } _ { i }$ , current time $t _ { k }$ , and equation embedding $\pmb { \theta } _ { \mathrm { P D E } }$ to node embedding vector $\bar { \mathbf { f } _ { i } ^ { 0 } } = \epsilon ^ { v } ( [ \mathbf { u } _ { i } ^ { k - K : k } , \mathbf { x } _ { i } , t _ { k } , \pmb { \theta } _ { \mathrm { P D E } } ] )$ . $\theta _ { \mathrm { P D E } }$ contains the PDE coefficients and other attributes such as boundary conditions. An exact description is found in Section 4. The inclusion of $\pmb { \theta } _ { \mathrm { P D E } }$ allows us to train the solver on multiple different PDEs.
|
| 110 |
+
|
| 111 |
+
Processor The processor computes $M$ steps of learned message passing, with intermediate graph representations $\mathcal { G } ^ { 1 } , \mathcal { G } ^ { 2 } , . . . , \mathcal { G } ^ { M }$ . The specific updates we use are
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\begin{array} { r l } { { \mathrm { l g e } j \to i \mathrm { m e s s a g e } ; \quad } } & { { { \bf m } _ { i j } ^ { m } = \phi \left( { \bf f } _ { i } ^ { m } , { \bf f } _ { j } ^ { m } , { \bf u } _ { i } ^ { k - K : k } - { \bf u } _ { j } ^ { k - K : k } , { \bf x } _ { i } - { \bf x } _ { j } , \theta _ { \mathrm { P D E } } \right) , } } \\ { { \mathrm { n o d e } i \mathrm { u p d a t e } ; \quad } } & { { { \bf f } _ { i } ^ { m + 1 } = \psi \left( { \bf f } _ { i } ^ { m } , \displaystyle \sum _ { j \in N ( i ) } { \bf m } _ { i j } ^ { m } , \theta _ { \mathrm { P D E } } \right) , } } \end{array}
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
where $\mathcal { N } ( i )$ holds the neighbors of node $i$ , and $\phi$ and $\psi$ are multilayer perceptrons (MLPs). Using relative positions $\mathbf { x } _ { j } - \mathbf { x } _ { i }$ can be justified by the translational symmetry of the PDEs we consider. Solution differences $\mathbf { u } _ { i } - \mathbf { u } _ { j }$ make sense by thinking of the message passing as a local difference operator, like a numerical derivative operator. Parameters $\pmb { \theta } _ { \mathrm { P D E } }$ are inserted into the message passing similar to Brandstetter et al. (2021)
|
| 118 |
+
|
| 119 |
+
Decoder After message passing, we use a shallow 1D convolutional network with shared weights across spatial locations to output the $K$ next timestep predictions at grid point $\mathbf { x } _ { i }$ . For each node $i$ , the processor outputs a vector $\mathbf { f } _ { i } ^ { M }$ . We treat this vector as a temporally contiguous signal, which we feed into a CNN over time. The CNN helps to smooth the signal over time and is reminiscent of linear multistep methods (Butcher, 1987), which are very efficient but generally not used because of stability concerns. We seem to have avoided these stability issues, by making the time solver nonlinear and adaptive to its input. The result is a new vector $\mathbf d _ { i } = ( \bar { \mathbf d } _ { i } ^ { 1 } , \mathbf d _ { i } ^ { 2 } , . . . , \mathbf d _ { i } ^ { K } )$ with each element $\mathbf { d } _ { i } ^ { k }$ corresponding to a different point in time. We use this to update the solution as
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
{ \mathbf { u } } _ { i } ^ { k + \ell } = { \mathbf { u } } _ { i } ^ { k } + ( t _ { k + \ell } - t _ { k } ) { \mathbf { d } } _ { i } ^ { \ell } , \qquad 1 \le \ell \le K .
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
The motivation for this choice of decoder has to do with a property called consistency (Arnold, 2015), which states that $\begin{array} { r } { \operatorname* { l i m } _ { \Delta t 0 } \| \mathcal { A } ( \Delta t , \mathbf { u } ^ { 0 } ) - \mathbf { u } ( \Delta t ) \| = 0 } \end{array}$ , i.e. the prediction matches the exact solution in the infinitesimal time limit. Consistency is a requirement for zero-stability of the rollouts.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 3: Schematic sketch of our MP-PDE Solver.
|
| 129 |
+
|
| 130 |
+
Connections. As mentioned in Bar-Sinai et al. (2019), both FDM and FVM are linear methods, which estimate $n ^ { \mathrm { t h } }$ -order point-wise function derivatives as
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
[ \partial _ { x } ^ { ( n ) } u ] _ { i } \simeq \sum _ { j \in \mathcal { N } ( i ) } \alpha _ { j } ^ { ( n ) } u _ { j }
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
for appropriately chosen coefficients $\alpha _ { j } ^ { ( n ) }$ , where $\mathcal { N } ( i )$ is the neighborhood of cell $i$ . FDM computes this at cell centers, and FVM computes this at cell boundaries. These estimates are plugged into flux equations, see Table 3 in the appendix, followed by an optional FVM update step, to compute time derivative estimates for the ODE solver. The WENO5 scheme computes derivative estimates by taking an adaptively-weighted average over multiple FVM estimates, computed using different neighborhoods of cell $i$ (see Equation 23). The FVM update, Equation 11, and Equation 23 are just message passing schemes with weighted aggregation (1 layer for FDM, 2 layers for FVM, and 3 layers for WENO). It is through this connection, that we see that message-passing neural networks representationally contain these classical schemes, and are thus a well-motivated architecture.
|
| 137 |
+
|
| 138 |
+
# 4 EXPERIMENTS
|
| 139 |
+
|
| 140 |
+
We demonstrate the effectiveness of the MP-PDE solver on tasks of varying difficulty to showcase its qualities. In 1D, we study its ability to generalize to unseen equations within a given family; we study boundary handling for periodic, Dirichlet, and Neumann boundary conditions; we study both regular and irregular grids; and we study the ability to model shock waves. We then show that the MP-PDE is able to solve equations in 2D. We also run ablations over the pushforward trick and variations, to demonstrate its utility. As baselines, we compare against standard classical PDE solvers, namely; FDM, pseudospectral methods, and a WENO5 solver, and we compare against the Fourier Neural Operator of Li et al. (2020a) as an example of a state-of-the-art neural operator method. The MP-PDE solver architecture is detailed in Appendix F.
|
| 141 |
+
|
| 142 |
+
# 4.1 INTERPOLATING BETWEEN PDES
|
| 143 |
+
|
| 144 |
+
Data We focus on the family of PDEs
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
\begin{array} { c } { { \displaystyle [ \partial _ { t } u + \partial _ { x } ( \alpha u ^ { 2 } - \beta \partial _ { x } u + \gamma \partial _ { x x } u ) ] ( t , x ) = \delta ( t , x ) , } } \\ { { \displaystyle u ( 0 , x ) = \delta ( 0 , x ) , \qquad \delta ( t , x ) = \sum _ { j = 1 } ^ { J } A _ { j } \sin ( \omega _ { j } t + 2 \pi \ell _ { j } x / L + \phi _ { j } ) } } \end{array}
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
Writing $\theta _ { \mathrm { P D E } } = \left( \alpha , \beta , \gamma \right)$ , corner cases are the heat equation $\theta _ { \mathrm { P D E } } = ( 0 , \eta , 0 )$ , Burgers’ equation $\theta _ { \mathrm { P D E } } = ( 0 . 5 , \eta , 0 )$ , and the KdV equation $\theta _ { \mathrm { P D E } } ~ = ~ ( 3 , 0 , 1 )$ . The term $\delta$ is a forcing term, following Bar-Sinai et al. (2019), with $J = 5$ , $L = 1 6$ and coefficients sampled uniformly in $A _ { j } \in$ $[ - 0 . 5 , 0 . 5 ]$ , $\omega _ { j } \in [ - 0 . 4 , - 0 . 4 ] , \ell _ { j } \in \{ 1 , 2 , 3 \} , \phi _ { j } \in [ 0 , 2 \pi )$ . This setup guarantees periodicity of the initial conditions and forcing. Space is uniformly discretized to $n _ { x } = 2 0 0$ cells in $[ 0 , 1 6 )$ with periodic boundary and time is uniformly discretized to $n _ { t } = 2 0 0$ points in $[ 0 , 4 ]$ . Our training sets consist of 2096 trajectories, downsampled to resolutions $( n _ { t } , n _ { x } ) \in \{ ( 2 5 0 , 1 0 0 ) , ( 2 5 0 , 5 0 ) , ( 2 5 0 , 4 0 ) \}$ . Numerical groundtruth is generated using a $5 ^ { \mathrm { t h } }$ -order WENO scheme (WENO5) (Shu, 2003) for the convection term $\partial _ { x } u ^ { 2 }$ and $4 ^ { \mathrm { t h } }$ -order finite difference stencils for the remaining terms. The temporal solver is an explicit Runge-Kutta 4 solver (Runge, 1895; Kutta, 1901) with adaptive timestepping. Detailed methods and implementation are in Appendix C. All methods are implemented for GPU, so runtime comparisons are fair. For the interested reader comparison of WENO and FDM schemes against analytical solutions can be found in Appendix $\textrm { C }$ to establish utility in generating groundtruth.
|
| 151 |
+
|
| 152 |
+
Experiments and results We consider three scenarios: E1 Burgers’ equation without diffusion $\theta _ { \mathrm { P D E } } = \left( 1 , 0 , 0 \right)$ for shock modeling; E2 Burgers’ equation with variable diffusion $\theta _ { \mathrm { P D E } } = \left( 1 , \eta , 0 \right)$ where $0 ~ \leq ~ \eta ~ \leq ~ 0 . 2$ ; and E3 a mixed scenario with $\theta _ { \mathrm { P D E } } \ : = \ : ( \alpha , \beta , \gamma )$ where $0 . 0 ~ \leq ~ \alpha ~ \leq ~ 3 . 0 ,$ $0 . 0 \leq \beta \leq 0 . 4$ and $0 . 0 \leq \gamma \leq 1 . 0$ . E2 and E3 test the generalization capability. We compare against downsampled groundtruth (WENO5) and a variation of the Fourier Neural Operator with an autoregressive structure (FNO-RNN) used in Section 5.3 of their paper, and trained with unrolled training (see Figure 2). For our models we run the MP-PDE solver, an ablated version $( \mathbf { M P - P D E - } \theta _ { \mathrm { P D E } } )$ , without $\pmb { \theta } _ { \mathrm { P D E } }$ features, and the Fourier Neural Operator method trained using our temporal bundling and pushforward tricks (FNO-PF). Errors and runtimes for all experiments are in Table 1. We see that the MP-PDE solver outperforms WENO5 and FNO-RNN in accuracy. Temporal bundling and the pushforward trick improve FNO dramatically, to the point where it beats MP-PDE on E1. But MP-PDE outperforms FNO-PF on E2 and E3 indicating that FNO is best for single equation modeling, but MP-PDE is better at generalization. MP-PDE predictions are best if equation parameters $\pmb { \theta } _ { \mathrm { P D E } }$ are used, evidenced in E2 and E3. This effect is most pronounced for E3, where all parameters are varied. Exemplary rollout plots for E2 and E3 are in Appendix F.1. Figure 4 (TOP) shows shock formation at different resolutions (E1), a traditionally difficult phenomenon to model—FDM and PSM methods cannot model shocks. Strikingly, shocks are preserved even at very low resolution.
|
| 153 |
+
|
| 154 |
+
# 4.2 VALIDATING TEMPORAL BUNDLING AND THE PUSHFORWARD METHOD
|
| 155 |
+
|
| 156 |
+
We observe solver survival times on E1, defined as the time until the solution diverges from groundtruth. A solution $\hat { \mathbf { u } } _ { i } ^ { k }$ diverges from the groundtruth $\mathbf { u } _ { i } ^ { k }$ when its max-normalized $L _ { 1 }$ -error $\begin{array} { r } { \frac { 1 } { n _ { x } } \sum _ { i = 1 } ^ { n _ { x } } \frac { \lvert \hat { \mathbf { u } } _ { i } ^ { k } - \mathbf { u } _ { i } ^ { k } \rvert } { \operatorname* { m a x } _ { j } \lvert \mathbf { u } _ { j } ^ { k } \rvert } } \end{array}$ exceeds 0.1. The solvers are unrolled to $n _ { t } ~ = ~ 1 0 0 0$ timesteps with $T = 1 6$ s. Examples are shown in Figure 4 (BOTTOM), where we observe increasing divergence after $\sim 8$ s. This is corroborated by Figure 5a where we see survival ratio against timestep. This is in line with observed problems with autoregressive models from the literature—see Figure C.3 of SanchezGonzalez et al. (2020) or Figure S9 of Bar-Sinai et al. (2019)
|
| 157 |
+
|
| 158 |
+
In a second experiment, we compare the efficacy of the pushforward trick. Already, we saw that, coupled with temporal bundling, it improved FNO for our autoregressive tasks. In Figure 5b, we plot the survival ratios for models trained with and without the pushforward trick. As a third comparison we show a model trained with Gaussian noise adversarial perturbations, similar to that proposed in Sanchez-Gonzalez et al. (2020). We see that applying the pushforward trick leads to far higher survival times, confirming our model that instability can be addressed with adversarial training.
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 4: TOP: Exemplary 1D rollout of shock formation at different resolutions. The different colors represent PDE solutions at different timepoints. Both the small and the large shock are neatly captured and preserved even for low resolutions; boundary conditions are perfectly modeled. BOTTOM: Exemplary long 2D rollout of shock formations over 1000 timesteps. Different colors represent PDE solutions at different space-time points.
|
| 162 |
+
|
| 163 |
+
Table 1: Error and runtime experiments targeting shock wave formation modeling and generalization to unseen equations. Runtimes are for one full unrolling over 250 timesteps on a GeForce RTX 2080 Ti GPU. FNO-PF, MP-PDE- $\theta _ { \mathrm { P D E } }$ , and MP-PDE are all ours. Accumulated error is $\begin{array} { r } { \frac { 1 } { n _ { x } } \sum _ { x , t } \mathbf { M S E } } \end{array}$ .
|
| 164 |
+
|
| 165 |
+
<table><tr><td></td><td></td><td colspan="5">Accumulated Error ↓</td><td colspan="2">Runtime [s]↓</td></tr><tr><td></td><td>(nt,nx)</td><td>WENO5</td><td>FNO-RNN</td><td>FNO-PF</td><td>MP-PDE-0PDE</td><td>MP-PDE</td><td>WENO5</td><td>MP-PDE</td></tr><tr><td>E1</td><td>(250,100)</td><td>2.02</td><td>11.93</td><td>0.54</td><td>=</td><td>1.55</td><td>1.9</td><td>0.09</td></tr><tr><td>E1</td><td>(250,50)</td><td>6.23</td><td>29.98</td><td>0.51</td><td></td><td>1.67</td><td>1.8</td><td>0.08</td></tr><tr><td>E1</td><td>(250,40)</td><td>9.63</td><td>10.44</td><td>0.57</td><td></td><td>1.47</td><td>1.7</td><td>0.08</td></tr><tr><td>E2</td><td>(250,100)</td><td>1.19</td><td>17.09</td><td>2.53</td><td>1.62</td><td>1.58</td><td>1.9</td><td>0.09</td></tr><tr><td>E2</td><td>(250,50)</td><td>5.35</td><td>3.57</td><td>2.27</td><td>1.71</td><td>1.63</td><td>1.8</td><td>0.09</td></tr><tr><td>E2</td><td>(250,40)</td><td>8.05</td><td>3.26</td><td>2.38</td><td>1.49</td><td>1.45</td><td>1.7</td><td>0.08</td></tr><tr><td>E3</td><td>(250,100)</td><td>4.71</td><td>10.16</td><td>5.69</td><td>4.71</td><td>4.26</td><td>4.8</td><td>0.09</td></tr><tr><td>E3</td><td>(250,50)</td><td>11.71</td><td>14.49</td><td>5.39</td><td>10.90</td><td>3.74</td><td>4.5</td><td>0.09</td></tr><tr><td>E3</td><td>(250,40)</td><td>15.94</td><td>20.90</td><td>5.98</td><td>7.78</td><td>3.70</td><td>4.4</td><td>0.09</td></tr></table>
|
| 166 |
+
|
| 167 |
+

|
| 168 |
+
Figure 5: Survival times at E1. Rollout for long trajectories of 8 s (left), pushforward (pf) ablation (right). The ablation compares survival times at resolutions $n _ { x } = 1 0 0$ (solid) and $n _ { x } = 5 0$ (dashed) against survival times using pushforward (no pf), no pushforward but putting Gaussian noise $\overset { \cdot } { \boldsymbol { \sigma } } =$ 0.01), pushforward but without cutting the gradients (pf gradients).
|
| 169 |
+
|
| 170 |
+
Interestingly, injecting Gaussian perturbations appears worse than using none. Closer inspection of rollouts shows that although Gaussian perturbations improve stability, they lead to lower accuracy, by nature of injecting noise into the system.
|
| 171 |
+
|
| 172 |
+
# 4.3 SOLVING ON IRREGULAR GRIDS WITH DIFFERENT BOUNDARY CONDITIONS
|
| 173 |
+
|
| 174 |
+
The underlying motives for designing this experiment are to investigate (i) how well our MP-PDE solver can operate on irregular grids and (ii) how well our MP-PDE solver can generalize over different boundary conditions. Non-periodic domains and grid sampling irregularity go hand in hand, since pseudo-spectral methods designed for closed intervals operate on non-uniform grids.
|
| 175 |
+
|
| 176 |
+
Data We consider a simple 1D wave equation
|
| 177 |
+
|
| 178 |
+
$$
|
| 179 |
+
\partial _ { t t } u - c ^ { 2 } \partial _ { x x } u = 0 , \qquad x \in [ - 8 , 8 ]
|
| 180 |
+
$$
|
| 181 |
+
|
| 182 |
+
where $c$ is wave velocity $\acute { c } = 2$ in our experiments). We consider Dirichlet $B [ u ] = u = 0$ and Neumann $B [ u ] = \partial _ { x } u = 0$ boundary conditions. This PDE is $2 ^ { \mathrm { n d } }$ -order in time, but can be rewritten as $1 ^ { \mathrm { s t } }$ -order in time, by introducing the auxilliary variable $\ v \ = \ \partial _ { t } u$ and writing $\partial _ { t } [ u , v ] - [ v , c ^ { 2 } \partial _ { x x } u ] = 0$ . The initial condition is a Gaussian pulse with peak at random location. Numerical groundtruth is generated using FVM and Chebyshev spectral derivatives, integrated in time with an implicit Runge-Kutta method of Radau IIA family, order 5 (Hairer et al., 1993). We solve for groundtruth at resolution $( n _ { t } , n _ { x } ) = ( 2 5 0 , 2 0 0 )$ on a Chebyshev extremal point grid (cell edges are located at $x _ { i } = \cos ( i \pi / ( n _ { x } + 1 ) )$ .
|
| 183 |
+
|
| 184 |
+
Experiments and results We consider three scenarios: WE1 Wave equation with Dirichlet boundary conditions; WE2 Wave equation with Neumann boundary conditions and, WE3 Arbitrary combinations of these two boundary conditions, testing generalization capability of the MP-PDE solver.
|
| 185 |
+
|
| 186 |
+
Ablation studies (marked with $\theta _ { \mathrm { P } } \delta \overline { { \mathrm { E } } } )$ have no equation specific parameters input to the MP-PDE solver. Table 2 compares our MP-PDE solver against state-of-the art numerical pseudospectral solvers. MP-PDE solvers obtain accurate results for low resolutions where pseudospectral solvers break. Interestingly, MP-PDE solvers can generalize over different boundary conditions, which gets more pronounced if boundary conditions are injected into the equation via $\theta _ { \mathrm { P D E } }$ features.
|
| 187 |
+
|
| 188 |
+
Table 2: Error and runtime comparison on tasks with non-periodic boundaries and irregular grids. Runtimes measure one full 250 timesteps unrolling on a GeForceRTX 2080 Ti GPU for MP-PDE solvers, and on a CPU for our pseudospectral (PS) solver implementation based on scipy.
|
| 189 |
+
|
| 190 |
+
<table><tr><td></td><td colspan="2">1 MSE↓(WE1) nx xt</td><td colspan="2">∑MSE↓(WE2) nx x,t</td><td colspan="2">1 ∑MSE ↓(WE3) nx x,t</td><td colspan="2">Runtime [s]↓</td></tr><tr><td>(nt,nx)</td><td>PS</td><td>MP-PDE</td><td>PS</td><td>MP-PDE</td><td>PS MP-PDEOPDE</td><td>MP-PDE</td><td>PS</td><td>MP-PDE</td></tr><tr><td>(250,100)</td><td>0.004</td><td>0.137</td><td>0.004</td><td>0.111</td><td>0.004</td><td>38.775 0.097</td><td>0.60</td><td>0.09</td></tr><tr><td>(250,50)</td><td>0.450</td><td>0.035</td><td>0.681</td><td>0.034</td><td>0.610</td><td>20.445</td><td>0.106 0.35</td><td>0.09</td></tr><tr><td>(250,40)</td><td>194.622</td><td>0.042</td><td>217.300</td><td>0.003</td><td>204.298</td><td>16.859</td><td>0.219 0.25</td><td>0.09</td></tr><tr><td>(250,20)</td><td>breaks</td><td>0.059</td><td>breaks</td><td>0.007</td><td>breaks</td><td>17.591</td><td>0.379 0.20</td><td>0.07</td></tr></table>
|
| 191 |
+
|
| 192 |
+
# 4.4 2D EXPERIMENTS
|
| 193 |
+
|
| 194 |
+
We finally test the scalability of our MP-PDE solver to a higher number of spatial dimensions, more specifically to 2D experiments. We use data from PHIFLOW1, an open-source fluid simulation toolkit. We look at fluid simulation based on the Navier-Stokes equations, and simulate smoke inflow into a $3 2 \times 3 2$ grid, adding more smoke after every time step which follows the buoyancy force. Dynamics can be described by semi-Lagrangian advection for the velocity and MacCormack advection for the smoke distribution. Simulations run for 100 timesteps where one timestep corresponds to one second. Smoke inflow locations are sampled randomly. Architectural details are in Appendix F. Figure 12 in the appendix shows results of the MP-PDE solver and comparisons to the groundtruth simulation. The MP-PDE solver is able to capture the smoke inflow accurately over the given time period, suggesting scalability of MP-PDE solver to higher dimensions.
|
| 195 |
+
|
| 196 |
+
# 5 CONCLUSION
|
| 197 |
+
|
| 198 |
+
We have introduced a fully neural MP-PDE solver, which representationally contains classical methods, such as the FDM, FVM, and WENO schemes. We have diagnosed the distribution shift problem and introduced the pushforward trick combined with the idea of temporal bundling trying to alleviate it. We showed that these tricks reduce error explosion observed in training autoregressive models, including a SOTA neural operator method (Li et al., 2020a). We also demonstrated that MP-PDE solvers offer flexibility when generalizing across spatial resolution, timescale, domain sampling regularity, domain topology and geometry, boundary conditions, dimensionality, and solution space smoothness. In doing so, MP-PDE solvers are much faster than SOTA numerical solvers.
|
| 199 |
+
|
| 200 |
+
MP-PDE solvers cannot only be used to predict the solution of PDEs, but can e.g. also be reinterpreted to optimize the integration grid and the parameters of the PDE. For the former, simply position updates need to be included in the processor, similar to Satorras et al. (2021). For the latter, a trained MP-PDE solver can be fitted to new data where only $\theta _ { \mathrm { P D E } }$ features are adjusted. A limitation of our model is that we require high quality groundtruth data to train. Indeed generating this data in the first place was actually the toughest part of the whole project. However, this is a limitation of most neural PDE solvers in the literature. Another limitation is the lack of accuracy guarantees typical solvers have been designed to output. This is a common criticism of such learned numerical methods. A potential fix would be to fuse this work with that in probabilistic numerics (Hennig et al., 2015), as has been done for RK4 solvers (Schober et al., 2014). Another promising follow-up direction is to research alternative adversarial-style losses as introduced in Equation 7. Finally, we remark that leveraging symmetries and thus fostering generalization is a very active field of research, which is especially appealing for building neural PDE solvers since every PDE is defined via a unique set of symmetries (Olver, 1986).
|
| 201 |
+
|
| 202 |
+
# 6 REPRODUCIBILITY STATEMENT
|
| 203 |
+
|
| 204 |
+
All data used in this work is generated by ourselves. It is thus of great importance to make sure that the produced datasets are correct. We therefore spend an extensive amount of time cross-checking our produced datasets. For experiments E1, E2, E3, this is done by comparing the WENO scheme to analytical solutions as discussed in detail in Appendix Section C.3, where we compare our implemented WENO scheme against two analytical solutions of the Burgers equation from literature. For experiments W1, W2, W3, we cross-checked if Gaussian wave packages keep their form throughout the whole wave propagation phase. Furthermore, the wave packages should change sign for Dirichlet boundary conditions and keep the sign for Neumann boundary conditions. Examples can be found in Appendix Section D.
|
| 205 |
+
|
| 206 |
+
We have described our architecture in Section 3.2 and provided further implementation details in Appendix Section F. We have introduced new concepts, namely temporal bundling and the pushforward method. We have described these concepts at length in our paper. We have validated temporal bundling and pushforward methods on both our and the Fourier Neural Operator (FNO) method Li et al. (2020a). We have not introduced new mathematical results. However, we have used data generation concepts from different mathematical fields and therefore have included a detailed description of those in our appendix.
|
| 207 |
+
|
| 208 |
+
For reproducibility, we provide our at https://github.com/brandstetter-johannes/MP-Neural-PDESolvers.
|
| 209 |
+
|
| 210 |
+
# 7 ETHICAL STATEMENT
|
| 211 |
+
|
| 212 |
+
The societal impact of MP-PDE solvers is difficult to predict. However, as stated in the introduction, solving differential equations is of huge importance for problems in many disciplines such as weather forecasting, astronomical simulations, or molecular modeling. As such, MP-PDE solvers potentially help to pave the way towards shortcuts for computationally expensive simulations. Most notably, a drastical computational shortcut is always somehow related to reducing the carbon footprint. However, in this regard, it is also important to remind ourselves that relying on simulations or now even shortcuts of those always requires monitoring and thorough quality checks.
|
| 213 |
+
|
| 214 |
+
# ACKNOWLEDGMENTS
|
| 215 |
+
|
| 216 |
+
Johannes Brandstetter thanks the Institute of Advanced Research in Artificial Intelligence (IARAI) and the Federal State Upper Austria for the support. The authors thank Markus Holzleitner for helpful comments on this work.
|
| 217 |
+
|
| 218 |
+
# REFERENCES
|
| 219 |
+
|
| 220 |
+
Douglas N Arnold. Stability, consistency, and convergence of numerical discretizations. 2015.
|
| 221 |
+
|
| 222 |
+
Michael Athanasopoulos, Hassan Ugail, and Gabriela Gonzalez. Parametric design of aircraft geometry using partial differential equations. Advances in Engineering Software, 40, 2009.
|
| 223 |
+
|
| 224 |
+
Yohai Bar-Sinai, Stephan Hoyer, Jason Hickey, and Michael P. Brenner. Learning data-driven discretizations for partial differential equations. Proceedings of the National Academy of Sciences, 116(31):15344–15349, Jul 2019. ISSN 1091-6490. doi: 10.1073/pnas.1814058116.
|
| 225 |
+
|
| 226 |
+
Soren Bartels. ¨ Numerical Approximation of Partial Differential Equations. Springer, 2016.
|
| 227 |
+
|
| 228 |
+
Claude Basdevant, Michel Deville, Pierre Haldenwang, Jean Lacroix, Jalil Ouazzani, R. Peyret, Paolo Orlandi, and Patera A.T. Spectral and finite difference solutions of the burgers equation. Computers and Fluids, 14(1):23–41, 1986.
|
| 229 |
+
|
| 230 |
+
Peter W. Battaglia, Jessica B. Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vinicius Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, Caglar Gulcehre, Francis Song, Andrew Ballard, Justin Gilmer, George Dahl, Ashish Vaswani, Kelsey Allen, Charles Nash, Victoria Langston, Chris Dyer, Nicolas Heess, Daan Wierstra, Pushmeet Kohli, Matt Botvinick, Oriol Vinyals, Yujia Li, and Razvan Pascanu. Relational inductive biases, deep learning, and graph networks. arXiv preprint arXiv:1806.01261, 2018.
|
| 231 |
+
|
| 232 |
+
Saakaar Bhatnagar, Yaser Afshar, Shaowu Pan, Karthik Duraisamy, and Shailendra Kaushik. Prediction of aerodynamic flow fields using convolutional neural networks. Computational Mechanics, 64(2):525–545, Jun 2019.
|
| 233 |
+
|
| 234 |
+
Kaushik Bhattacharya, Bamdad Hosseini, Nikola B. Kovachki, and Andrew M. Stuart. Model reduction and neural networks for parametric pdes, 2021.
|
| 235 |
+
|
| 236 |
+
Johannes Brandstetter, Rob Hesselink, Elise van der Pol, Erik Bekkers, and Max Welling. Geometric and physical quantities improve e(3) equivariant message passing. arXiv preprint arXiv:2110.02905, 2021.
|
| 237 |
+
|
| 238 |
+
John Charles Butcher. Coefficients for the study of runge-kutta integration processes. Journal of the Australian Mathematical Society, 3(2):185–201, 1963.
|
| 239 |
+
|
| 240 |
+
John Charles Butcher. The numerical analysis of ordinary differential equations: Runge-Kutta and general linear methods. Wiley-Interscience, 1987.
|
| 241 |
+
|
| 242 |
+
Djork-Arne Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network´ learning by exponential linear units (elus). In International Conference on Learning Representations (ICLR), 2016.
|
| 243 |
+
|
| 244 |
+
Richard Courant, Kurt Otto Friedrichs, and Hans Lewy. On the partial difference equations of mathematical physics. IBM J. Res. Dev., 11(2):215–234, 1967. ISSN 0018-8646.
|
| 245 |
+
|
| 246 |
+
Filipe De Avila Belbute-Peres, Thomas Economon, and Zico Kolter. Combining differentiable PDE solvers and graph neural networks for fluid flow prediction. In Hal Daume III and Aarti Singh ´ (eds.), Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pp. 2402–2411. PMLR, 13–18 Jul 2020.
|
| 247 |
+
|
| 248 |
+
Michael Defferrard, Xavier Bresson, and Pierre Vandergheynst. Convolutional neural networks on ¨ graphs with fast localized spectral filtering. In D. Lee, M. Sugiyama, U. Luxburg, I. Guyon, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 29. Curran Associates, Inc., 2016.
|
| 249 |
+
|
| 250 |
+
Edgar Everhart. An efficient integrator that uses gauss-radau spacings. International Astronomical Union Colloquium, 83:185–202, 1985.
|
| 251 |
+
|
| 252 |
+
Victor Garcia Satorras, Zeynep Akata, and Max Welling. Combining generative and discriminative models for hybrid inference. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d’Alche Buc, ´ E. Fox, and R. Garnett (eds.), Advances in Neural Information Processing Systems 32, pp. 13802– 13812. Curran Associates, Inc., 2019.
|
| 253 |
+
|
| 254 |
+
Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. In International Conference on Machine Learning, pp. 1263–1272. PMLR, 2017.
|
| 255 |
+
|
| 256 |
+
Jonathan Godwin, Michael Schaarschmidt, Alexander Gaunt, Alvaro Sanchez-Gonzalez, Yulia Rubanova, Petar Velickovic, James Kirkpatrick, and Peter W. Battaglia. Very deep graph neural networks via noise regularisation. arXiv preprint arXiv:2106.07971.
|
| 257 |
+
|
| 258 |
+
Daniel Greenfeld, Meirav Galun, Ronen Basri, Irad Yavneh, and Ron Kimmel. Learning to optimize multigrid PDE solvers. In Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, pp. 2415–2423, 2019.
|
| 259 |
+
|
| 260 |
+
Xiaoxiao Guo, Wei Li, and Francesco Iorio. Convolutional neural networks for steady flow approximation. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, KDD ’16, pp. 481–490. Association for Computing Machinery, 2016.
|
| 261 |
+
|
| 262 |
+
Ernst Hairer, Syvert Nørsett, and Gerhard Wanner. Solving Ordinary Differential Equations I (2nd Revised. Ed.): Nonstiff Problems. Springer-Verlag, Berlin, Heidelberg, 1993. ISBN 0387566708.
|
| 263 |
+
|
| 264 |
+
Philipp Hennig, Michael A. Osborne, and Mark Girolami. Probabilistic numerics and uncertainty in computations. Proceedings of the Royal Society A: Mathematical, Physical and Engineering Sciences, 471(2179):20150142, Jul 2015. ISSN 1471-2946. doi: 10.1098/rspa.2015.0142. URL http://dx.doi.org/10.1098/rspa.2015.0142.
|
| 265 |
+
|
| 266 |
+
Jun-Ting Hsieh, Shengjia Zhao, Stephan Eismann, Lucia Mirabella, and Stefano Ermon. Learning neural PDE solvers with convergence guarantees. arXiv preprint arXiv:1906.01200, 2019.
|
| 267 |
+
|
| 268 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In International conference on machine learning, pp. 448–456. PMLR, 2015.
|
| 269 |
+
|
| 270 |
+
Guang-Shan Jiang and Chi-Wang Shu. Efficient implementation of weighted eno schemes. Journal of Computational Physics, 126(1):202 – 228, 1996. ISSN 0021-9991.
|
| 271 |
+
|
| 272 |
+
Yuehaw Khoo, Jianfeng Lu, and Lexing Ying. Solving parametric pde problems with artificial neural networks. European Journal of Applied Mathematics, 32(3):421–435, Jul 2020. ISSN 1469-4425.
|
| 273 |
+
|
| 274 |
+
Thomas N. Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations (ICLR), 2017.
|
| 275 |
+
|
| 276 |
+
Wilhelm Kutta. Beitrag zur naherungsweisen integration totaler differentialgleichungen. ¨ Zeitschrift fur Mathematik und Physik¨ , 46:435 – 453, 1901.
|
| 277 |
+
|
| 278 |
+
Tony Lelievre and Gabriel Stoltz. Partial differential equations and stochastic methods in molecular \` dynamics. Acta Numerica, 25:681–880, 2016.
|
| 279 |
+
|
| 280 |
+
Zongyi Li, Nikola Kovachki, Kamyar Azizzadenesheli, Burigede Liu, Kaushik Bhattacharya, Andrew Stuart, and Anima Anandkumar. Fourier neural operator for parametric partial differential equations. arXiv preprint arXiv:2010.08895, 2020a.
|
| 281 |
+
|
| 282 |
+
Zongyi Li, Nikola Kovachki, Kamyar Azizzadenesheli, Burigede Liu, Kaushik Bhattacharya, Andrew Stuart, and Anima Anandkumar. Multipole graph neural operator for parametric partial differential equations. arXiv preprint arXiv:2006.09535, 2020b.
|
| 283 |
+
|
| 284 |
+
Zongyi Li, Nikola Kovachki, Kamyar Azizzadenesheli, Burigede Liu, Kaushik Bhattacharya, Andrew Stuart, and Anima Anandkumar. Neural operator: Graph kernel network for partial differential equations. arXiv preprint arXiv:2003.03485, 2020c.
|
| 285 |
+
|
| 286 |
+
Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. arXiv preprint arXiv:1711.05101, 2017.
|
| 287 |
+
|
| 288 |
+
Peter Lynch. The origins of computer weather prediction and climate modeling. Journal of computational physics, 227(7):3431–3444, 2008.
|
| 289 |
+
|
| 290 |
+
Andreas Mayr, Sebastian Lehner, Arno Mayrhofer, Christoph Kloss, Sepp Hochreiter, and Johannes Brandstetter. Boundary graph neural networks for 3d simulations. arXiv preprint arXiv:2106.11299, 2021.
|
| 291 |
+
|
| 292 |
+
Peter J Olver. Introduction to partial differential equations. Springer, 2014.
|
| 293 |
+
|
| 294 |
+
P.J. Olver. Symmetry groups of differential equations. In Applications of Lie Groups to Differential Equations, pp. 77–185. Springer, 1986.
|
| 295 |
+
|
| 296 |
+
Ravi G. Patel, Nathaniel A. Trask, Mitchell A. Wood, and Eric C. Cyr. A physics-informed operator regression framework for extracting data-driven continuum models. Computer Methods in Applied Mechanics and Engineering, 373:113500, Jan 2021. ISSN 0045-7825.
|
| 297 |
+
|
| 298 |
+
Maziar Raissi. Deep hidden physics models: Deep learning of nonlinear partial differential equations. J. Mach. Learn. Res., 19:25:1–25:24, 2018.
|
| 299 |
+
|
| 300 |
+
Prajit Ramachandran, Barret Zoph, and Quoc V. Le. Searching for activation functions. arXiv preprint arXiv:1710.05941, 2017.
|
| 301 |
+
|
| 302 |
+
Carl Runge. Uber die numerische aufl ¨ osung von differentialgleichungen. ¨ Mathematische Annalen, 46:167 – 178, 1895.
|
| 303 |
+
|
| 304 |
+
Alvaro Sanchez-Gonzalez, Jonathan Godwin, Tobias Pfaff, Rex Ying, Jure Leskovec, and Peter W. Battaglia. Learning to simulate complex physics with graph networks. arXiv preprint arXiv:2002.09405, 2020.
|
| 305 |
+
|
| 306 |
+
Victor Garcia Satorras, Emiel Hoogeboom, and Max Welling. E (n) equivariant graph neural networks. arXiv preprint arXiv:2102.09844, 2021.
|
| 307 |
+
|
| 308 |
+
Franco Scarselli, Marco Gori, Ah Chung Tsoi, Markus Hagenbuchner, and Gabriele Monfardini. The graph neural network model. IEEE Transactions on Neural Networks, 20(1):61–80, 2009.
|
| 309 |
+
|
| 310 |
+
William E Schiesser. The numerical method of lines: integration of partial differential equations. Elsevier, 2012.
|
| 311 |
+
|
| 312 |
+
Michael Schober, David Duvenaud, and Philipp Hennig. Probabilistic ode solvers with runge-kutta means, 2014.
|
| 313 |
+
|
| 314 |
+
C.-W. Shu. High-order finite difference and finite volume weno schemes and discontinuous galerkin methods for cfd. International Journal of Computational Fluid Dynamics, 17(2):107–118, 2003.
|
| 315 |
+
|
| 316 |
+
Justin Sirignano and Konstantinos Spiliopoulos. Dgm: A deep learning algorithm for solving partial differential equations. Journal of Computational Physics, 375:1339 – 1364, 2018. ISSN 0021- 9991. doi: https://doi.org/10.1016/j.jcp.2018.08.029.
|
| 317 |
+
|
| 318 |
+
Eitan Tadmor. The exponential accuracy of fourier and chebyshev differencing methods. SIAM Journal on Numerical Analysis, 23:1–10, 1986.
|
| 319 |
+
|
| 320 |
+
Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022, 2016.
|
| 321 |
+
|
| 322 |
+
Yinhao Zhu and Nicholas Zabaras. Bayesian deep convolutional encoder–decoder networks for surrogate modeling and uncertainty quantification. Journal of Computational Physics, 366:415–447, Aug 2018. ISSN 0021-9991.
|
| 323 |
+
|
| 324 |
+
# A INTERPOLATION
|
| 325 |
+
|
| 326 |
+
To compute classical numerical derivatives of a function $u : \mathbb { R } \mathbb { R }$ , which has been sampled on a mesh of points $x _ { 1 } < x _ { 2 } < . . . < x _ { N }$ it is common to first fit a piecewise polynomial $p : \mathbb { R } \mathbb { R }$ on the mesh. We assume we have function evaluations $u _ { i } = u ( x _ { i } )$ at the mesh nodes for all $i = 1 , . . . , N$ and once we have fitted the polynomial, we can use its derivatives at any new off-mesh point, for instance the half nodes $x _ { i + { \frac { 1 } { 2 } } }$ . Here we illustrate how to carry out this procedure.
|
| 327 |
+
|
| 328 |
+
A polynomial of degree $N - 1$ (note the highest degree polynomial we can fit to $N$ points has degree $N - 1 )$ can be fitted at the mesh points by solving the following linear system in a
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
\underbrace { \left[ \begin{array} { c } { u _ { 1 } } \\ { \vdots } \\ { u _ { N } } \\ { \mathbf { u } } \end{array} \right] } _ { \mathbf { u } } = \underbrace { \left[ \begin{array} { c } { p ( x _ { 1 } ) } \\ { \vdots } \\ { p ( x _ { N } ) } \end{array} \right] } _ { \mathbf { u } } = \underbrace { \left[ \begin{array} { c } { \sum _ { i = 0 } ^ { N - 1 } a _ { i } x _ { 1 } ^ { i } } \\ { \vdots } \\ { \sum _ { i = 0 } ^ { N - 1 } a _ { i } x _ { N } ^ { i } } \end{array} \right] } _ { \mathbf { L } } = \underbrace { \left[ \begin{array} { c c c c } { x _ { 1 } ^ { 0 } } & { \cdots } & { x _ { 1 } ^ { N - 1 } } \\ { \vdots } & { \ddots } & { \vdots } \\ { x _ { N } ^ { 0 } } & { \cdots } & { x _ { N } ^ { N - 1 } } \end{array} \right] } _ { \mathbf { X } } \underbrace { \left[ \begin{array} { c } { a _ { 0 } } \\ { \vdots } \\ { a _ { N - 1 } } \end{array} \right] } _ { \mathbf { a } } .
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
To find the polynomial interpolation at a new point $x$ , we then do
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
p ( x ) = \mathbf { x } ^ { \top } \mathbf { a } = \mathbf { x } ^ { \top } \mathbf { X } ^ { - 1 } \mathbf { u }
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
where $\mathbf { x } ^ { \top } = [ 1 , x , x ^ { 2 } , . . . , x ^ { N - 1 } ]$ . To retrieve the $m ^ { \mathrm { t h } }$ derivative, where $m < N - 1$ , is also very simple. For this we have that
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
\begin{array} { r l } & { \frac { \mathrm { d } ^ { m } p } { \mathrm { d } x ^ { m } } = \displaystyle \sum _ { i = 0 } ^ { N - 1 } a _ { i } \frac { \mathrm { d } ^ { m } x ^ { i } } { \mathrm { d } x ^ { m } } = \displaystyle \sum _ { i = 0 } ^ { N - 1 } a _ { i } \cdot ( i ) _ { m } \cdot x ^ { i - m } = \mathbf { x } ^ { ( m ) \top } \mathbf { a } = \mathbf { x } ^ { ( m ) \top } \mathbf { X } ^ { - 1 } \mathbf { u } , } \\ & { \mathbf { x } ^ { ( m ) \top } = [ ( 0 ) _ { m } x ^ { 0 - m } , ( 1 ) _ { m } x ^ { 1 - m } , . . . , ( N - 1 ) _ { m } x ^ { N - 1 - m } ] } \end{array}
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
where $( i ) _ { m } = i ( i - 1 ) ( i - 2 ) \cdots ( i - m + 1 )$ is the $m ^ { \mathrm { t h } }$ Pochhammer symbol and $( i ) _ { 0 } : = 1$ .
|
| 347 |
+
|
| 348 |
+
Note that is typical to fold $\mathbf { s } = \mathbf { x } ^ { \top } \mathbf { X } ^ { - 1 }$ into a single object, which we call a stencil.
|
| 349 |
+
|
| 350 |
+
# B RECONSTRUCTION
|
| 351 |
+
|
| 352 |
+
Reconstruction is the task of fitting a piecewise polynomial on a mesh of points, when instead of functions values at the grid points we have cell averages $\bar { u } _ { i }$ , where
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
\bar { u } _ { i } = \frac { 1 } { \Delta x _ { i } } \int _ { I _ { i } } u ( \boldsymbol { x } ) \mathrm { d } \boldsymbol { x } ,
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
where each cell $I _ { i } ~ = ~ [ x _ { i - \frac { 1 } { 2 } } , x _ { i + \frac { 1 } { 2 } } ]$ , the half nodes are defined as $x _ { i + \frac 1 2 } : = \frac 1 2 ( x _ { i } + x _ { i + 1 } )$ and $\Delta x _ { i } = x _ { i + \frac { 1 } { 2 } } - x _ { i - \frac { 1 } { 2 } }$ . The solution is to note that we can fit a polynomial $P ( x )$ to the integral of $u ( x )$ , which will be exact at the half nodes, so
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
P ( x _ { i + \frac { 1 } { 2 } } ) = U ( x _ { i + \frac { 1 } { 2 } } ) = \int _ { x _ { 1 - \frac { 1 } { 2 } } } ^ { x _ { i + \frac { 1 } { 2 } } } u ( x ) \mathrm { d } x = \sum _ { k = 1 } ^ { i } \int _ { x _ { k - \frac { 1 } { 2 } } } ^ { x _ { k + \frac { 1 } { 2 } } } u ( x ) \mathrm { d } x = \sum _ { k = 1 } ^ { i } \bar { u } _ { k } \Delta x _ { k } .
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
We can then differentiate this polynomial to retrieve an estimate for the $u$ at off-mesh locations. Recall that polynomial differentiation is easy with the interpolant differentiation operators $\mathbf { x } ^ { ( m ) }$ The system of equations we need to solve is thus
|
| 365 |
+
|
| 366 |
+
$$
|
| 367 |
+
\underbrace { \left[ \Delta x _ { 1 } \cdots \cdots \quad 0 \ \right. } _ { \vdots } \cdot \underbrace { \left[ \bar { u } _ { 1 } \right] } _ { \mathbf { \dot { u } } } = \underbrace { \left[ x _ { 1 } ^ { 0 } \cdots \quad x _ { 1 } ^ { N - 1 } \right] } _ { \mathbf { \dot { x } } } \underbrace { \left[ \begin{array} { c c c c } { a _ { 0 } } \\ { \vdots } \\ { a _ { x 1 } } \end{array} \right] } _ { \mathbf { \dot { L } } } . \underbrace { \dot { \mathbf { \sigma } } _ { \langle } \mathbf { \dot { \sigma } _ { \langle } \Phi _ { N \rangle } } } _ { \mathbf { \dot { u } } } = \underbrace { \left[ \begin{array} { c c c c } { a _ { 1 } ^ { 0 } } & { \cdots } & { x _ { 1 } ^ { N - 1 } } \\ { \vdots } & { \ddots } & { \vdots } \\ { x _ { N } ^ { 0 } } & { \cdots } & { x _ { N } ^ { N - 1 } } \end{array} \right] } _ { \mathbf { \dot { x } } } \underbrace { \left[ \begin{array} { c } { a _ { 0 } } \\ { \vdots } \\ { a _ { N - 1 } } \\ { \mathbf { \dot { a } } } \end{array} \right] } _ { \mathbf { \dot { a } } } .
|
| 368 |
+
$$
|
| 369 |
+
|
| 370 |
+
where $\bar { \bf u }$ is the vector of cell averages and $\mathbf { L }$ is a lower triangular matrix performing the last sum in Equation 20. Thus the $m ^ { \mathrm { t h } }$ derivative of the polynomial $p ( x ) = P ^ { \prime } ( x )$ is
|
| 371 |
+
|
| 372 |
+
$$
|
| 373 |
+
\frac { \mathrm { d } ^ { m } p } { \mathrm { d } x ^ { m } } = \frac { \mathrm { d } ^ { m + 1 } P } { \mathrm { d } x ^ { m + 1 } } = \mathbf { x } ^ { ( m + 1 ) \top } \mathbf { X } ^ { - 1 } \mathbf { L } \bar { \mathbf { u } } = \bar { \mathbf { s } } ^ { ( m ) \top } \bar { \mathbf { u } } .
|
| 374 |
+
$$
|
| 375 |
+
|
| 376 |
+
# C WENO SCHEME
|
| 377 |
+
|
| 378 |
+
The essentially non-oscillating (ENO) scheme is an interpolation or reconstruction scheme to estimate function values and derivatives of a discontinuous function. The main idea is to use multiple overlapping stencils to estimate a derivative at point $x \in [ x _ { i } , x _ { i + 1 } ]$ . We design $N$ stencils to fit the function on shifted overlapping intervals $I _ { 1 } , . . . , I _ { N }$ , where $I _ { k } = [ x _ { i - N + 1 + k } , x _ { i + k } ]$ . In the case of WENO reconstruction these intervals are ${ { I } _ { k } } = [ { { x } _ { i - N + 1 + k - \frac { 1 } { 2 } } } , { { x } _ { i + k + \frac { 1 } { 2 } } } ]$ . If a discontinuity lies in $\textstyle I = \bigcup _ { k } I _ { k }$ , then it is likely that one of the substencils $\mathbf { s } _ { k } ^ { ( m ) }$ or ¯sk $\bar { \mathbf { s } } _ { k } ^ { ( m ) }$ (defined on interval $I _ { k }$ ) will not contain the discontinuity. We can thus use the substencil $\mathbf { s } _ { k } ^ { ( m ) }$ or $\bar { \mathbf { s } } _ { k } ^ { ( m ) }$ from the relatively smooth region to estimate the function derivatives at . In the following, we focus on WENO reconstruction.
|
| 379 |
+
|
| 380 |
+
The weighted essentially non-oscillating (WENO) scheme goes one step further and takes a convex combination of the substencils to create a larger stencil ¯s on $I$ , where (dropping the superscript for brevity)
|
| 381 |
+
|
| 382 |
+
$$
|
| 383 |
+
\bar { \mathbf { s } } = \sum _ { k = 1 } ^ { N } w _ { k } \bar { \mathbf { s } } _ { k } .
|
| 384 |
+
$$
|
| 385 |
+
|
| 386 |
+
Here the nonlinear weights nonlinear weights can be c $w _ { k }$ satisfy ructed $\begin{array} { r } { \sum _ { k = 1 } ^ { N } w _ { k } = 1 } \end{array}$ . It was shown in Jiang & Shu (1996) that these
|
| 387 |
+
|
| 388 |
+
$$
|
| 389 |
+
w _ { k } = \frac { \tilde { w } _ { k } } { \sum _ { j = 1 } ^ { N } \tilde { w } _ { j } } \qquad \tilde { w } _ { k } = \frac { \gamma _ { k } } { ( \epsilon + \beta _ { k } ) ^ { 2 } } ,
|
| 390 |
+
$$
|
| 391 |
+
|
| 392 |
+
wherlinear $\gamma _ { k }$ alled the linear weight, are set such that the su $\epsilon$ i mber, and over the o $\beta _ { k }$ ir moothness indicator. The stencils matches a larger $\scriptstyle \sum _ { k = 1 } ^ { N } \gamma _ { k } \bar { \mathbf { s } } _ { k }$ $N - 1$ $2 N - 2$
|
| 393 |
+
|
| 394 |
+
$$
|
| 395 |
+
\beta _ { k } = \sum _ { m = 1 } ^ { N - 1 } \Delta x _ { k } ^ { 2 m - 1 } \int _ { x _ { i - \frac { 1 } { 2 } } } ^ { x _ { i + \frac { 1 } { 2 } } } \left( \frac { \mathrm { d } ^ { m } p _ { k } } { \mathrm { d } x ^ { m } } \right) ^ { 2 } \mathrm { d } x ,
|
| 396 |
+
$$
|
| 397 |
+
|
| 398 |
+
where $p _ { k }$ is the polynomial corresponding to substencil $\bar { \bf s } _ { k }$ .
|
| 399 |
+
|
| 400 |
+
# C.1 WENO5 SCHEME
|
| 401 |
+
|
| 402 |
+
A conservative finite difference spatial discretization approximates a derivative $f ( u ) _ { x }$ by a conservative difference
|
| 403 |
+
|
| 404 |
+
$$
|
| 405 |
+
f ( u ) _ { x } | _ { x = x _ { i } } \approx \frac { 1 } { \Delta x } \left( \hat { f } _ { i + \frac { 1 } { 2 } } - \hat { f } _ { i - \frac { 1 } { 2 } } \right) ,
|
| 406 |
+
$$
|
| 407 |
+
|
| 408 |
+
where $\hat { f } _ { i + \frac { 1 } { 2 } }$ and $\hat { f } _ { i - \frac { 1 } { 2 } }$ are numerical fluxes. Since $g ( u ) _ { y }$ is approximated in the same way, finite difference methods have the same format for more than one spatial dimensions. The leftreconstructed (reconstruction is done from left to right) fifth order finite difference WENO scheme (WENO5) (Shu, 2003) has the uˆ−i+ 1 g iven by:
|
| 409 |
+
|
| 410 |
+
$$
|
| 411 |
+
\hat { u } _ { i + \frac { 1 } { 2 } } ^ { - } = w _ { 1 } \hat { u } _ { i + \frac { 1 } { 2 } } ^ { - ( 1 ) } + w _ { 2 } \hat { u } _ { i + \frac { 1 } { 2 } } ^ { - ( 2 ) } + w _ { 3 } \hat { u } _ { i + \frac { 1 } { 2 } } ^ { - ( 3 ) } .
|
| 412 |
+
$$
|
| 413 |
+
|
| 414 |
+
In equation 27, $\hat { u } _ { i + \frac { 1 } { 2 } } ^ { - ( j ) }$ are the left WENO reconstructions on three different stencils given by
|
| 415 |
+
|
| 416 |
+
$$
|
| 417 |
+
\begin{array} { l } { { \hat { u } _ { i + \frac { 1 } { 2 } } ^ { - ( 1 ) } = + \displaystyle { \frac { 1 } { 3 } } u _ { i - 2 } - \frac { 7 } { 6 } u _ { i - 1 } + \frac { 1 1 } { 6 } u _ { i } \ : , } } \\ { { \hat { u } _ { i + \frac { 1 } { 2 } } ^ { - ( 2 ) } = - \displaystyle { \frac { 1 } { 6 } } u _ { i - 1 } + \frac { 5 } { 6 } u _ { i } + \frac { 1 } { 3 } u _ { i + 1 } \ : , } } \\ { { \hat { u } _ { i + \frac { 1 } { 2 } } ^ { - ( 3 ) } = + \displaystyle { \frac { 1 } { 3 } } u _ { i } + \frac { 5 } { 6 } u _ { i + 1 } - \frac { 1 } { 6 } u _ { i + 2 } \ : , } } \end{array}
|
| 418 |
+
$$
|
| 419 |
+
|
| 420 |
+
and the non-linear weights $w _ { j }$ given by
|
| 421 |
+
|
| 422 |
+
$$
|
| 423 |
+
w _ { j } = \frac { \tilde { w } _ { j } } { \sum _ { k = 1 } ^ { 3 } w _ { k } } , \qquad \tilde { w } _ { k } = \frac { \gamma _ { k } } { ( \epsilon + \beta _ { k } ) ^ { 2 } } ,
|
| 424 |
+
$$
|
| 425 |
+
|
| 426 |
+
with $\gamma _ { \{ 1 , 2 , 3 \} } = \{ \scriptstyle { \frac { 1 } { 1 0 } } , \displaystyle { \frac { 3 } { 5 } } , \displaystyle { \frac { 3 } { 1 0 } } \}$ , and $\epsilon$ a tiny-valued parameter to avoid the denominator becoming 0. The left smoothness indicators $\beta _ { k } ^ { - }$ are given by:
|
| 427 |
+
|
| 428 |
+
$$
|
| 429 |
+
\begin{array} { l } { \displaystyle \beta _ { 1 } ^ { - } = \frac { 1 3 } { 1 2 } \big ( u _ { i - 2 } - 2 u _ { i - 1 } + u _ { i } \big ) ^ { 2 } + \frac { 1 } { 4 } \big ( u _ { i - 2 } - 4 u _ { i - 1 } + 3 u _ { i } \big ) ^ { 2 } , } \\ { \displaystyle \beta _ { 2 } ^ { - } = \frac { 1 3 } { 1 2 } \big ( u _ { i - 1 } - 2 u _ { i } + u _ { i + 1 } \big ) ^ { 2 } + \frac { 1 } { 4 } \big ( u _ { i - 1 } - u _ { i + 1 } \big ) ^ { 2 } , } \\ { \displaystyle \beta _ { 3 } ^ { - } = \frac { 1 3 } { 1 2 } \big ( u _ { i } - 2 u _ { i + 1 } + u _ { i + 2 } \big ) ^ { 2 } + \frac { 1 } { 4 } \big ( u _ { i } - 4 u _ { i + 1 } + 3 u _ { i + 2 } \big ) ^ { 2 } . } \end{array}
|
| 430 |
+
$$
|
| 431 |
+
|
| 432 |
+
The right-reconstructed WENO5 scheme has the $\hat { u } _ { i - \frac { 1 } { 2 } } ^ { + }$ given similarly to $\hat { u } _ { i + \frac { 1 } { 2 } } ^ { - }$ but with all coefficients flipped since the reconstruction is done from the other side (from right to left). The right reconstruction on three different stencils are given by
|
| 433 |
+
|
| 434 |
+
$$
|
| 435 |
+
\begin{array} { l } { { \hat { u } _ { i - \frac { 1 } { 2 } } ^ { + ( 1 ) } = + \displaystyle \frac { 1 } { 3 } u _ { i + 2 } - \frac { 7 } { 6 } u _ { i + 1 } + \frac { 1 1 } { 6 } u _ { i } \ : , } } \\ { { \hat { u } _ { i - \frac { 1 } { 2 } } ^ { + ( 2 ) } = - \displaystyle \frac { 1 } { 6 } u _ { i + 1 } + \frac { 5 } { 6 } u _ { i } + \frac { 1 } { 3 } u _ { i - 1 } \ : , } } \\ { { \hat { u } _ { i - \frac { 1 } { 2 } } ^ { + ( 3 ) } = + \displaystyle \frac { 1 } { 3 } u _ { i } + \frac { 5 } { 6 } u _ { i - 1 } - \frac { 1 } { 6 } u _ { i - 2 } \ : , } } \end{array}
|
| 436 |
+
$$
|
| 437 |
+
|
| 438 |
+
and the right smoothness indicators $\beta _ { k } ^ { + }$ are given by
|
| 439 |
+
|
| 440 |
+
$$
|
| 441 |
+
\begin{array} { l } { \displaystyle \beta _ { 1 } ^ { + } = \frac { 1 3 } { 1 2 } \big ( u _ { i + 2 } - 2 u _ { i + 1 } + u _ { i } \big ) ^ { 2 } + \frac { 1 } { 4 } \big ( u _ { i + 2 } - 4 u _ { i + 1 } + 3 u _ { i } \big ) ^ { 2 } , } \\ { \displaystyle \beta _ { 2 } ^ { + } = \frac { 1 3 } { 1 2 } \big ( u _ { i + 1 } - 2 u _ { i } + u _ { i - 1 } \big ) ^ { 2 } + \frac { 1 } { 4 } \big ( u _ { i + 1 } - u _ { i - 1 } \big ) ^ { 2 } , } \\ { \displaystyle \beta _ { 3 } ^ { + } = \frac { 1 3 } { 1 2 } \big ( u _ { i } - 2 u _ { i - 1 } + u _ { i - 2 } \big ) ^ { 2 } + \frac { 1 } { 4 } \big ( u _ { i } - 4 u _ { i - 1 } + 3 u _ { i - 2 } \big ) ^ { 2 } . } \end{array}
|
| 442 |
+
$$
|
| 443 |
+
|
| 444 |
+
Both $\hat { u } ^ { - }$ and $\hat { u } ^ { + }$ are needed for full flux reconstruction as explained in the next section.
|
| 445 |
+
|
| 446 |
+
# C.2 FLUX RECONSTRUCTION
|
| 447 |
+
|
| 448 |
+
We consider flux reconstruction via Godunov. For Godunov flux, ${ \hat { f } } _ { i + \frac { 1 } { 2 } } = { \hat { f } } ( u _ { i + \frac { 1 } { 2 } } )$ is reconstructed from uˆ+i+ 12 and uˆ−i+ 1 via:
|
| 449 |
+
|
| 450 |
+
$$
|
| 451 |
+
\widehat f ( u _ { i + \frac { 1 } { 2 } } ) = \left\{ \begin{array} { c c } { \operatorname* { m i n } _ { i + \frac { 1 } { 2 } \leq u \leq u _ { i + \frac { 1 } { 2 } } ^ { + } } f ( u ) , } & { \mathrm { i f } u _ { i + \frac { 1 } { 2 } } ^ { - } \leq u _ { i + \frac { 1 } { 2 } } ^ { + } } \\ { \operatorname* { m a x } _ { \substack { i + \frac { 1 } { 2 } \leq u \leq u _ { i + \frac { 1 } { 2 } } ^ { + } } } f ( u ) , } & { \mathrm { i f } u _ { i + \frac { 1 } { 2 } } ^ { - } > u _ { i + \frac { 1 } { 2 } } ^ { + } } \end{array} \right.
|
| 452 |
+
$$
|
| 453 |
+
|
| 454 |
+
C.3 COMPARING WENO SCHEME TO ANALYTICAL SOLUTIONS
|
| 455 |
+
|
| 456 |
+
First analytical case. An analytical solvable case for Burgers equation arises for the boundary conditions
|
| 457 |
+
|
| 458 |
+
$$
|
| 459 |
+
u ( t , 0 ) = u ( t , 2 \pi ) ,
|
| 460 |
+
$$
|
| 461 |
+
|
| 462 |
+
and the initial conditions
|
| 463 |
+
|
| 464 |
+
$$
|
| 465 |
+
u ( 0 , x ) = - 2 \nu \frac { \partial \phi / \partial x } { \phi } + 4 ,
|
| 466 |
+
$$
|
| 467 |
+
|
| 468 |
+
where
|
| 469 |
+
|
| 470 |
+
$$
|
| 471 |
+
\begin{array} { c } { { \phi = \displaystyle \exp \left( \frac { - x ^ { 2 } } { 4 \nu } \right) + \exp \left[ \frac { - ( x - 2 \pi ) ^ { 2 } } { 4 \nu ( t + 1 ) } \right] } } \\ { { \displaystyle \frac { \partial \phi } { \partial x } = - \frac { 2 x } { 4 \nu } \exp \left( \frac { - x ^ { 2 } } { 4 \nu } \right) - \frac { 2 ( x - 2 \pi ) } { 4 \nu } + \exp \left[ \frac { - ( x - 2 \pi ) ^ { 2 } } { 4 \nu } \right] } } \\ { { = - \displaystyle \frac { 0 . 5 x } { \nu } \exp \left( \frac { - x ^ { 2 } } { 4 \nu } \right) - \frac { 0 . 5 ( x - 2 \pi ) } { \nu } \exp \left[ \frac { - ( x - 2 \pi ) ^ { 2 } } { 4 \nu } \right] . } } \end{array}
|
| 472 |
+
$$
|
| 473 |
+
|
| 474 |
+
The analytical solutions for this specific set of boundary and initial conditions gives
|
| 475 |
+
|
| 476 |
+
$$
|
| 477 |
+
u ( t , x ) = - 2 \nu \frac { \partial \phi / \partial x } { \phi } + 4 ,
|
| 478 |
+
$$
|
| 479 |
+
|
| 480 |
+
where
|
| 481 |
+
|
| 482 |
+
$$
|
| 483 |
+
\begin{array} { l } { \displaystyle \phi = \exp \left( \frac { - ( x - 4 t ) ^ { 2 } } { 4 \nu ( t + 1 ) } \right) + \exp \left[ \frac { - ( x - 4 t - 2 \pi ) ^ { 2 } } { 4 \nu ( t + 1 ) } \right] } \\ { \displaystyle \frac { \partial \phi } { \partial x } = - \frac { 2 ( x - 4 t ) } { 4 \nu ( t + 1 ) } \exp \left( \frac { - ( x - 4 t ) ^ { 2 } } { 4 \nu ( t + 1 ) } \right) - \frac { 2 ( x - 4 t - 2 \pi ) } { 4 \nu ( t + 1 ) } + \exp \left[ \frac { - ( x - 4 t - 2 \pi ) ^ { 2 } } { 4 \nu ( t + 1 ) } \right] } \\ { \displaystyle \quad = - \frac { 0 . 5 ( x - 4 t ) } { \nu ( t + 1 ) } \exp \left( \frac { - ( x - 4 t ) ^ { 2 } } { 4 \nu ( t + 1 ) } \right) - \frac { 0 . 5 ( x - 4 t - 2 \pi ) } { \nu ( t + 1 ) } \exp \left[ \frac { - ( x - 4 t - 2 \pi ) ^ { 2 } } { 4 \nu ( t + 1 ) } \right] . } \end{array}
|
| 484 |
+
$$
|
| 485 |
+
|
| 486 |
+
For this first analytical solveable case, the analytical solution, the WENO scheme and the fourth order finite difference scheme (FDM) are compared in Fig. 6 for a diffusion term of $\nu = 0 . 0 0 5$ . The WENO scheme models the analytical solution perfectly, whereas the FDM scheme fails to capture the shock accurately. For lower values of $\nu$ the effect gets even stronger.
|
| 487 |
+
|
| 488 |
+
Second analytical case. Another analytical solvable case for the Burgers equation arises for the boundary condition:
|
| 489 |
+
|
| 490 |
+
$$
|
| 491 |
+
u ( t , \pm 1 ) = 0 ,
|
| 492 |
+
$$
|
| 493 |
+
|
| 494 |
+
and the initial condition
|
| 495 |
+
|
| 496 |
+
$$
|
| 497 |
+
u ( 0 , x ) = - \sin ( \pi x ) .
|
| 498 |
+
$$
|
| 499 |
+
|
| 500 |
+
Solutions are (Basdevant et al., 1986)
|
| 501 |
+
|
| 502 |
+
$$
|
| 503 |
+
u ( t , x ) = \frac { - \int _ { - \infty } ^ { \infty } \sin \pi ( x - \eta ) f ( x - \eta ) \exp ( - \eta ^ { 2 } / 4 \nu t ) d \eta } { \int _ { - \infty } ^ { \infty } f ( x - \eta ) \exp ( - \eta ^ { 2 } / 4 \nu t ) d \eta } ,
|
| 504 |
+
$$
|
| 505 |
+
|
| 506 |
+
with $\begin{array} { r } { f ( y ) = \exp ( - \cos ( \frac { \pi y } { 2 \pi \nu } ) } \end{array}$ . Using Hermite integration allows the computation of accurate results up to $t = 3 / \pi$ .
|
| 507 |
+
|
| 508 |
+
For this second analytical solveable case, the analytical solution, and the WENO scheme are compared in Fig. 7 for a diffusion term of $\nu = 0 . 0 0 2$ . The WENO scheme models the analytical solution perfectly. Modeling via the FDM scheme fails completely.
|
| 509 |
+
|
| 510 |
+

|
| 511 |
+
Figure 6: 1D and 2D rollouts for the first analytical case setting the diffusion term $\nu \ : = \ : 0 . 0 0 5$ . Analytical solution (top), WENO scheme (middle) and Finite Difference scheme (FDM, bottom). The WENO scheme models the analytical solution perfectly, whereas the FDM scheme fails to capture the shock accurately.
|
| 512 |
+
|
| 513 |
+

|
| 514 |
+
Figure 7: 1D and 2D rollouts for the second analytical case setting the diffusion term $\nu = 0 . 0 0 5$ . Analytical solution (top), and WENO scheme solution(bottom).The WENO scheme models the analytical solution perfectly.
|
| 515 |
+
|
| 516 |
+
# D PSEUDOSPECTRAL METHODS FOR WAVE PROPAGATION ON IRREGULAR GRIDS
|
| 517 |
+
|
| 518 |
+
We consider Dirichlet $B [ u ] = u = 0$ and Neumann $B [ u ] = \partial _ { x } u = 0$ boundary conditions. Numerical groundtruth is generated using FVM and Chebyshev spectral derivatives, integrated in time with an implicit Runge-Kutta method of Radau IIA family, order 5 (Hairer et al., 1993). To properly fulfill the boundary conditions, wave packages have to travel between the boundaries and are bounced back with same and different sign for Neumann and Dirichlet boundary condition, respectively. Exemplary wave propagation for both boundary conditions is shown in Figure 8.
|
| 519 |
+
|
| 520 |
+

|
| 521 |
+
Figure 8: Exemplary wave propagation data for Dirichlet boundary conditions (left) and Neumann boundary conditions (right). Solutions are obtained on irregular grids using pseudospectral solvers.
|
| 522 |
+
|
| 523 |
+
# E EXPLICIT RUNGE-KUTTA METHODS
|
| 524 |
+
|
| 525 |
+
The family of Runge-Kutta methods (Butcher, 1987) is given by:
|
| 526 |
+
|
| 527 |
+
$$
|
| 528 |
+
u _ { t _ { n + 1 } } = u _ { t _ { n } } + \Delta t \sum _ { i = 1 } ^ { s } b _ { i } k _ { i } ,
|
| 529 |
+
$$
|
| 530 |
+
|
| 531 |
+
where
|
| 532 |
+
|
| 533 |
+
$$
|
| 534 |
+
\begin{array} { r l } & { k _ { 1 } = f \left( t _ { n } , u _ { t _ { n } } \right) , } \\ & { k _ { 2 } = f \big ( t _ { n } + c _ { 2 } \Delta t , u _ { t _ { n } } + h ( a _ { 2 1 } k _ { 1 } ) \big ) , } \\ & { k _ { 3 } = f \big ( t _ { n } + c _ { 3 } \Delta t , u _ { t _ { n } } + h ( a _ { 3 1 } k _ { 1 } + a _ { 3 2 } k _ { 2 } ) \big ) , } \\ & { \begin{array} { r l } & { \vdots } \\ & { k _ { s } = f \big ( t _ { n } + c _ { s } \Delta t , u _ { t _ { n } } + h \big ( a _ { s 1 } k _ { 1 } + a _ { s 2 } k _ { 2 } , . . . a _ { s , s - 1 } k _ { s - 1 } \big ) \big ) . } \end{array} } \end{array}
|
| 535 |
+
$$
|
| 536 |
+
|
| 537 |
+
For a particular Runge-Kutta method one needs to provide the number of stages $s$ , and the coefficients $a _ { i j } ( 1 \leq j < i \leq s )$ , $b _ { i } ( i = 1 , 2 , \dots , s )$ and $c _ { i } ( i = 1 , 2 , \dots , s )$ . These data are usually arranged in so-called Butcher tableaux (Butcher, 1963).
|
| 538 |
+
|
| 539 |
+
# F EXPERIMENTS
|
| 540 |
+
|
| 541 |
+
Flux terms of equations that we study—the Heat, Burgers, Korteweg-de-Vries (KdV), and Kuromoto-Shivashinsky (KS) equation—are summarized in Table 3.
|
| 542 |
+
|
| 543 |
+
Table 3: 1D flux terms $J ( u )$ of the Heat, Burgers, Korteweg-de-Vries (KdV), and KuramotoShivashinsky (KS) equation.
|
| 544 |
+
|
| 545 |
+
<table><tr><td></td><td>Heat</td><td>Burgers</td><td>KdV</td><td>KS</td></tr><tr><td>J(u)</td><td>-nOxu</td><td>u²-noxu</td><td>3u²+Oxxu</td><td>u²+Oxu+oxxxu</td></tr></table>
|
| 546 |
+
|
| 547 |
+
Pushforward trick and temporal bundling. Pseudocode for one training step using the pushforward trick and temporal bundling is sketch in Algorithm 1.
|
| 548 |
+
|
| 549 |
+
Algorithm 1 Pushforward trick and temporal bundling. For a given batched input data trajectory and a model, we draw a random timepoint $t$ , get our input data trajectory, perform $N$ forward passes, and finally perform the supervised learning task with the according labels. $K$ is the number of steps we predict into the future using the temporal bundling trick, $N$ is number of unrolling steps in order to apply the pushforward trick, $T$ is the number of available timesteps in the training set.
|
| 550 |
+
|
| 551 |
+
<table><tr><td>Require: data, model, N, K,T t←DrawRandomNumber t ∈ {1,..,T} input ← data(t-K:t) for n ∈{1,...,N} do input ← model(input)</td><td>data is the complete PDE trajectory We draw a random starting point > We input the last K timesteps</td></tr></table>
|
| 552 |
+
|
| 553 |
+
Implementation details. MP-PDE architectures, consist of three parts (sequentially applied):
|
| 554 |
+
|
| 555 |
+
1. Encoder: Input {fully-connected layer activation fully-connected layer activation $\}$ , where fully connected layers are applied node-wise
|
| 556 |
+
2. Processor: 6 message passing layers as described in Sec. 3.2. Each layer consists of a 2- layer edge update network $\phi$ following Equation (8), and a 2-layer node update network $\psi$ following Equation (9).
|
| 557 |
+
3. Decoder: 1D convolutional network with shard weights across spatial locations $ \{ 1 \mathrm { D }$ CNN layer activation $ 1 \mathrm { D }$ CNN layer }
|
| 558 |
+
|
| 559 |
+
We optimize models using the AdamW optimizer (Loshchilov & Hutter, 2017) with learning rate 1e-4, weight decay 1e-8 for 20 epochs and minimize the root mean squared error (RMSE). We use batch size 16 for experiments E1-E3 and WE1-WE3 and batch size of 4 for 2D experiments. For experiments E1-E3 we use a hidden size of 164, and for experiments WE1-WE3 we use a hidden size of 128. In order to enforce zero-stability during training we unroll the solver for a maximum of 2 steps (see Sec. 3.1).
|
| 560 |
+
|
| 561 |
+
Message and update network in the processor consist of {fully-connected layer activation fully-connected layer activation $\}$ . We use skip-connections in the message passing layers and apply instance normalization (Ulyanov et al., 2016) for experiments E1-E3 and WE1-WE3, and batch normalization (Ioffe & Szegedy, 2015) for the 2D experiments. For the decoder, we use 8 channels between the two CNN layers (1 input channel, 1 output channel) across all experiments. We use Swish (Ramachandran et al., 2017) activation functions for experiments E1-E3 and WE1- WE3 and ReLU activation for the 2D experiments. ReLU activation proved most effective for 2D experiments since a characteristic of the smoke inflow dynamics we studied is that values are zero for all positions which are untouched by smoke buoyancy at a given timepoint.
|
| 562 |
+
|
| 563 |
+
Training details. The overall used architectures consist of roughly 1 million parameters and training for the different experiments takes between 12 and 24 hours on average on a GeForceRTX 2080
|
| 564 |
+
|
| 565 |
+
Ti GPU. 6 message passing layers and a hidden size of 128 for the 2-layer edge update network and the 2-layer node update network is a robust choice. A hidden size of 64 shows signs of underfitting, whereas a hidden size of 256 is not improve performance significantly. For the overall performance, more important than the number of parameters is the choice of the output 1D CNN, the choice of inputs to the edge update network $\phi$ following Equation (8) and the node update network $\psi$ following Equation (9). We ablate these choices in Appendix G.
|
| 566 |
+
|
| 567 |
+
Another interesting hyperparameter is the number of neighbors used for message passing. We construct our graphs by restricting the neighbors (edges) via a cutoff radius based on positional coordinates for experiments E1-E3 and the 2D experiments. We effectively use 6 neighbors for experiments E1-E3 and 8 neighbors for the 2D experiments. For experiments WE1-WE3, cutoff radii for selecting neighbors are not a robust choice since the grids are irregular and relative distances are much lower close to the boundaries. We therefore construct our graphs via a $k$ -NN criterion, and effectively use between 20 neighbors (highest spatial resolution) and 6 neighbors (lowest spatial resolution).
|
| 568 |
+
|
| 569 |
+
# F.1 EXPERIMENTS E1, E2, E3
|
| 570 |
+
|
| 571 |
+
Figure 9 displays exemplary 1D rollouts at different resolution for the Burgers’ equation with different diffusion terms. Lower diffusion coefficients result in faster shock formation. Figure 10 displays exemplary 1D rollouts for different parameter sets. Large $\alpha$ parameters result in fast and large shock formations. The wiggles arising due to the dispersive term $\gamma$ and cannot be captured by numerical solvers at low resolution. Our MP-PDE solver is able to capture these wiggles and reproduce them even at very low resolution.
|
| 572 |
+
|
| 573 |
+

|
| 574 |
+
Figure 9: Exemplary 1D rollout of the Burgers’ equation at different resolutions. The different colors represent PDE solutions at different timepoints. Diffusion coefficients of $\eta = 0 . 1 4$ (top) and $\eta = 0 . 0 8$ (bottom) are compared for the same initial conditions. Lower diffusion coefficients result in faster shock formation.
|
| 575 |
+
|
| 576 |
+

|
| 577 |
+
Figure 10: Exemplary 1D rollout an unseen equation with different equation parameters. The different colors represent PDE solutions at different timepoints. Low $\alpha$ parameters (top) result in diffusion like behavior. Large $\alpha$ parameters (middle, bottom) result in fast and large shock formations. The wiggles arising due to the dispersive term $\gamma$ . Numerical solvers cannot capture the wiggles at low resolution (middle), MP-PDE solvers can reconstruct them much better (bottom).
|
| 578 |
+
|
| 579 |
+
# F.2 EXPERIMENTS WE1, WE2, WE3
|
| 580 |
+
|
| 581 |
+
Figure 11 displays exemplary 2D rollouts at different resolutions for the wave equation with Dirichlet and Neumann boundary conditions. Waves bounce back and forth between boundaries. MP-PDE solvers give accurate solutions on the irregular grids and are stable over time.
|
| 582 |
+
|
| 583 |
+

|
| 584 |
+
Figure 11: Exemplary 2D rollouts for the wave equation with Dirichlet boundary conditions (top) and Neumann boundary conditions (bottom). The different colors for the Dirichlet boundary condition comes from the fact that wave propagation changes the sign at each boundary.
|
| 585 |
+
|
| 586 |
+

|
| 587 |
+
Figure 12: Exemplary 2D smoke inflow simulation. Ground truth data (top) are compared to MPPDE solvers (bottom). Simulations run for 100 timesteps corresponding to 100 seconds. The MPPDE solver is able to capture the smoke inflow acccurately over the given time period.
|
| 588 |
+
|
| 589 |
+
# G ARCHITECTURE ABLATION AND COMPARISON TO CNNS
|
| 590 |
+
|
| 591 |
+
A schematic sketch of our MP-PDE solver is displayed in Figure 13 (sketch taken from the main paper). A GNN based architecture was chosen since GNNs have the potential to offer flexibility when generalizing across spatial resolution, timescale, domain sampling regularity, domain topology and geometry, boundary conditions, dimensionality, and solution space smoothness. The chosen architecture representationally contains classical methods, such as FDM, FVM, and WENO schemes. The architectures follows the Encode-Process-Decode framework of Battaglia et al. (2018), with adjustments. Most notably, PDE coefficients and other attributes such as boundary conditions denoted with $\pmb { \theta } _ { \mathrm { P D E } }$ are included in the processor. For the decoder, a shallow 2-layer 1D convolutional network with shared weights across spatial locations is applied, motivated by linear multistep methods (Butcher, 1987).
|
| 592 |
+
|
| 593 |
+
For ablating the architecture, three design choices are verified:
|
| 594 |
+
|
| 595 |
+
1. Does a GNN have the representational power of a vanilla convolutional network on a regular grid? We test against 1D and 2D baseline CNN architectures.
|
| 596 |
+
2. For the decoder part, how much does a 1D convolutional network with shared weights across spatial locations approve upon a standard MLP decoder?
|
| 597 |
+
3. How much does the inclusion of PDE coefficients $\pmb { \theta } _ { \mathrm { P D E } }$ help to generalize over e.g. different equations or different boundary conditions?
|
| 598 |
+
|
| 599 |
+

|
| 600 |
+
Figure 13: Schematic sketch of our MP-PDE Solver, sketch taken from the main paper.
|
| 601 |
+
|
| 602 |
+
Table 4 shows the three ablation (MP-PDE- $\theta _ { \mathrm { P D E } }$ , MP-PDE-✭1D-CNN, Baseline CNN) tested on ✭ shock wave formation modeling and generalization to unseen experiments (experiments E1, E2, and E3), as described in Section 4.1 in the main paper. For the training of the different architectures the optimized training strategy consisting of temporal bundling and pushforward trick is used.
|
| 603 |
+
|
| 604 |
+
The MP-PDE- $\underbrace { \theta _ { \mathbf { P } } \delta \mathbf { \overline { { E } } } } _ { \mathbf { \overline { { ~ } } } \mathbf { \Theta } }$ ablation results are the same as reported in the main paper. The effect gets more prominent if more equation specific parameters are available $\mathbf { \nabla } _ { \theta _ { \mathrm { P D E } } }$ features), as it is the case for experiment E3. We also refer the reader to the experiments presented in Table 2, where MPPDE solvers are shown to be able to generalize over different boundary conditions, which gets much stronger pronounced if boundary conditions are injected into the equation via $\pmb { \theta } _ { \mathrm { P D E } }$ features.
|
| 605 |
+
|
| 606 |
+
The MP-PDE-✭1D-CNN ✭ ablation replaces the shallow 2-layer 1D convolutional network with in the decoder with a standard 2-layer MLP. Performance slightly degrades for the MLP decoder which is most likely due to the better temporal modeling introduced by the shared weights of the 1D CNN network.
|
| 607 |
+
|
| 608 |
+
A Baseline 1D-CNN is built up of 8 1D-CNN layers, where the input consists of the spatial resolution $( n _ { x } )$ . The $K$ previous timesteps used for temporal bundling are treated as $K$ input channels. The output consequently predicts the next $K$ timesteps for the same spatial resolution ( $K$ output channels). Using this format, again both temporal bundling and the pushforward trick can be effectively applied. The implemented 1D-CNN layers are:
|
| 609 |
+
|
| 610 |
+
• Input layer with $K$ input channel, 40 output channels, kernel of size 3.
|
| 611 |
+
• 3 layers with 40 input channels, 40 output channels, kernel of size 5.
|
| 612 |
+
• 3 layers with 40 input channels, 40 output channels, kernel of size 7.
|
| 613 |
+
• 1 output layer with 40 input channels, $K$ output channel, kernel of size 7.
|
| 614 |
+
|
| 615 |
+
Residual connections are used between the layers, and ELU (Clevert et al., 2016) non-linearities are applied. Circular padding is implemented to reflect the periodic boundary conditions. The CNN output is a new vector $\mathbf { { \bar { d } } } _ { i } ^ { \phantom { * } } = ( \bar { \mathbf { d } } _ { i } ^ { 1 } , \mathbf { d } _ { i } ^ { 2 } , . . . , \mathbf { d } _ { i } ^ { K } )$ with each element $\mathbf { d } _ { i } ^ { k }$ corresponding to a different point in time. Analogously to the MP-PDE solver, we use the output to update the solution as
|
| 616 |
+
|
| 617 |
+
$$
|
| 618 |
+
{ \mathbf { u } } _ { i } ^ { k + \ell } = { \mathbf { u } } _ { i } ^ { k } + ( t _ { k + \ell } - t _ { k } ) { \mathbf { d } } _ { i } ^ { \ell } , \qquad 1 \le \ell \le K ,
|
| 619 |
+
$$
|
| 620 |
+
|
| 621 |
+
where $K$ is the output (and input) dimension. This baseline 1D-CNN is conceptually very similar to our MP-PDE solver.
|
| 622 |
+
|
| 623 |
+
A Baseline 2D-CNN is built up of 6 2D-CNN layers, where the input consists of the spatial resolution $( n _ { x } )$ and the $K$ previous timesteps used for temporal bundling. The output consequently predicts the next $K$ timesteps for the same spatial resolution. Using this format, both temporal bundling and the pushforward trick can be effectively applied. The implemented 2D-CNN layers are:
|
| 624 |
+
|
| 625 |
+
• Input layer with 1 input channel, 16 output channels, $3 \times 3$ kernel.
|
| 626 |
+
• 4 intermediate layers with 16 input channels, 16 output channels, $5 \times 5$ kernel.
|
| 627 |
+
• 1 output layer with 16 input channels, 1 output channel, $7 \times 7$ kernel.
|
| 628 |
+
|
| 629 |
+
Residual connections are used between the layers, and ELU (Clevert et al., 2016) non-linearities are applied. For the spatial dimension, circular padding is implemented to reflect the periodic boundary conditions, for the temporal dimension zero padding is used. The CNN output is a new vector $\mathbf { d } _ { i } = ( \mathbf { d } _ { i } ^ { 1 } , \mathbf { d } _ { i } ^ { 2 } , . . . , \mathbf { d } _ { i } ^ { K } )$ with each element $\mathbf { d } _ { i } ^ { k }$ corresponding to a different point in time. Analogously to the MP-PDE solver and analogously to the 1D-CNN, we use the output to update the solution as shown in Equation (61).
|
| 630 |
+
|
| 631 |
+
The 1D-CNN baseline which is conceptually very close to our MP-PDE solver performs much better than the 2D-CNN. However, we see already when looking at the results of E3 that generalization for the 1D-CNN across different PDEs becomes harder.
|
| 632 |
+
|
| 633 |
+
Table 4: Ablation study comparing MP-PDE results on experiments on shock wave formation modeling and generaliziation to unseen equations (E1, E3, and E3) to an MP-PDE-✭ $\theta _ { \mathrm { P D E } }$ ablation, an MP-PDE-✭1D-CNN ablation, a baseline 1D-CNN and a baseline 2D-CNN architecture. Runtimes ✭ are for one full unrolling over 250 timesteps on a GeForce RTX 2080 Ti GPU. Accumulated error is $\begin{array} { r } { \frac { 1 } { n _ { x } } \sum _ { x , t } \mathbf { M S E } } \end{array}$ .
|
| 634 |
+
|
| 635 |
+
<table><tr><td></td><td></td><td colspan="4">Accumulated Error↓</td><td colspan="4">Runtime [s]↓</td></tr><tr><td></td><td>(nt,nx)</td><td>MP-PDE</td><td>MP-PDE-0PDE</td><td>MP-PDE-1D-CNN</td><td>1D-CNN</td><td>2D-CNN</td><td>MP-PDE</td><td>1D-CNN</td><td>2D-CNN</td></tr><tr><td>E1</td><td>(250,100)</td><td>1.55</td><td>-</td><td>2.41</td><td>3.45</td><td>25.70</td><td>0.09</td><td>0.02</td><td>0.16</td></tr><tr><td>E1</td><td>(250,50)</td><td>1.67</td><td>-</td><td>2.69</td><td>3.88</td><td>32.42</td><td>0.08</td><td>0.02</td><td>0.15</td></tr><tr><td>E1</td><td>(250,40)</td><td>1.47</td><td>-</td><td>2.50</td><td>3.07</td><td>37.13</td><td>0.008</td><td>0.02</td><td>0.14</td></tr><tr><td>E2</td><td>(250,100)</td><td>1.58</td><td>1.62</td><td>2.59</td><td>3.32</td><td>30.09</td><td>0.09</td><td>0.02</td><td>0.16</td></tr><tr><td>E2</td><td>(250,50)</td><td>1.63</td><td>1.71</td><td>2.31</td><td>2.89</td><td>30.87</td><td>0.08</td><td>0.02</td><td>0.15</td></tr><tr><td>E2</td><td>(250,40)</td><td>1.45</td><td>1.49</td><td>2.80</td><td>2.98</td><td>35.93</td><td>0.08</td><td>0.02</td><td>0.15</td></tr><tr><td>E3</td><td>(250,100)</td><td>4.26</td><td>4.71</td><td>6.26</td><td>9.15</td><td>42.37</td><td>0.09</td><td>0.02</td><td>0.16</td></tr><tr><td>E3</td><td>(250,50)</td><td>3.74</td><td>10.90</td><td>5.15</td><td>7.69</td><td>45.41</td><td>0.09</td><td>0.02</td><td>0.15</td></tr><tr><td>E3</td><td>(250,40)</td><td>3.70</td><td>7.78</td><td>7.27</td><td>6.77</td><td>53.87</td><td>0.09</td><td>0.02</td><td>0.15</td></tr></table>
|
md/dev/vqGi8Kp0wM/vqGi8Kp0wM.md
ADDED
|
@@ -0,0 +1,324 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MIND THE GAP: DOMAIN GAP CONTROL FOR SINGLESHOT DOMAIN ADAPTATION FOR GENERATIVE AD-VERSARIAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Peihao Zhu KAUST
|
| 4 |
+
|
| 5 |
+
Rameen Abdal KAUST
|
| 6 |
+
|
| 7 |
+
John Femiani Miami University
|
| 8 |
+
|
| 9 |
+
Peter Wonka KAUST
|
| 10 |
+
|
| 11 |
+

|
| 12 |
+
Figure 1: One-shot domain adaptation: (left) a single reference image from domain $B$ is used to refine a GAN $G _ { A }$ to learn $G _ { B }$ ; (center) every image in domain $A$ has an analog in domain $B$ that shares a latent code and many salient attributes; (right) because salient attributes are preserved in the new domain, many latent-edits are meaningful in the new domain.
|
| 13 |
+
|
| 14 |
+
# ABSTRACT
|
| 15 |
+
|
| 16 |
+
We present a new method for one shot domain adaptation. The input to our method is a trained GAN that can produce images in domain $A$ and a single reference image $I _ { B }$ from domain $B$ . The proposed algorithm can translate any output of the trained GAN from domain $A$ to domain $B$ . There are two main advantages of our method compared to the current state of the art: First, our solution achieves higher visual quality, e.g. by noticeably reducing overfitting. Second, our solution allows for more degrees of freedom to control the domain gap, i.e. what aspects of the image $I _ { B }$ are used to define the domain $B$ . Technically, we realize the new method by building on a pre-trained StyleGAN generator as GAN and a pre-trained CLIP model for representing the domain gap. We propose several new regularizers for controlling the domain gap to optimize the weights of the pre-trained StyleGAN generator so that it will output images in domain $B$ instead of domain $A$ . The regularizers prevent the optimization from taking on too many attributes of the single reference image. Our results show significant visual improvements over the state of the art as well as multiple applications that highlight improved control1.
|
| 17 |
+
|
| 18 |
+
# 1 INTRODUCTION
|
| 19 |
+
|
| 20 |
+
We propose a new method for domain adaptation based on a single target image. As shown in Fig. 1, given a trained GAN for domain $A$ , and a single image $I _ { B }$ from domain $B$ , our approach learns to find a corresponding image in domain $B$ for any image in domain $A$ . We can achieve this by finetuning the GAN for domain $A$ to obtain a second GAN that generates images in domain $B$ . The two GANs share a latent space so that a single latent code will generate two corresponding images, one in domain $A$ and one in domain $B$ . The main selling point of our method is that it achieves superior quality than the state of the art in single shot domain adaption. Our method is computationally lightweight and only takes a few minutes on a single GPU, so that it can be widely applied.
|
| 21 |
+
|
| 22 |
+
In order to do this, we leverage multiple existing components, including two excellent pre-trained networks: First, we use StyleGAN2 (Karras et al., 2020b) as a pre-trained GAN. A follow-up version has been published on arXiv (Karras et al., 2021), but the code only became available after we finished all experiments. Second, we use a pre-trained network for image embedding, CLIP (Radford et al., 2021), to encode images as vectors. Third, we use the pioneering idea of StyleGANNADA (Gal et al., 2021), which builds upon StyleCLIP (Patashnik et al., 2021), to encode a domain gap (or domain shift) as vector in CLIP embedding space. Fourth, we leverage II2S (Zhu et al., 2020b) as GAN embedding method to transfer image $I _ { B }$ into domain $A$ to obtain a better estimation of the domain gap.
|
| 23 |
+
|
| 24 |
+
Even though the visual quality of StyleGAN-NADA is already impressive when used as a single image domain adaption method, we identified multiple technical issues that can be improved to achieve another large jump in visual quality. First, and most importantly, StyleGAN-NADA was designed for zero-shot domain adaptation, and does not have a good solution to model the domain gap based on a single example image. Their reference implementation models the domain gap as a vector from the average image in domain $A$ to the given image $I _ { B }$ in CLIP embedding space. However, this leads to overfitting in practice and the transfer results lose attributes of the input images, so that input images from domain $A$ get mapped to images that are all too similar to $I _ { B }$ in domain $B$ . We identify a better solution to this problem. In fact, the domain gap should be modeled as a vector from the image $I _ { B }$ to its analog in domain $A$ , so that the image in domain $A$ shares salient within-domain attributes with the reference image. We therefore need to solve an inverse $B$ -to- $A$ domain-transfer problem, which we propose to tackle using the state-of-the-art GAN embedding method II2S (Zhu et al., 2020b). A key insight is that we can use a heavily regularized version of the II2S GAN inversion method to do the reverse problem of transferring any related image (from a domain $B$ ) into the domain $A$ , helping to characterize the semantic domain gap better than previous work. Further extensions enable us to fine tune the modeling of the domain gap to explicitly model which attributes of the input image should be kept. Second, we propose multiple new regularizers to improve the quality. Third, we propose a technical improvement to the heuristic layer selection proposed in StyleGAN-NADA that is more straightforward and robust.
|
| 25 |
+
|
| 26 |
+
In summary, we make the following contributions:
|
| 27 |
+
|
| 28 |
+
1. We reduce the mode collapse/overfitting problem which often occurs in one-shot and fewshot domain adaptation. Our results look similar to the target domain images with fewer artifacts. These results are also faithful to the identities of the source domain images and able to capture fine details.
|
| 29 |
+
2. Our domain adaptation provides more freedom to control the “similarity” between images across domains that share a common latent-code, which makes a large number of downstream applications possible, e.g., pose adaptation, lighting adaptation, expression adaptation, texture adaptation, interpolation, and layer mixing, using state-of-the-art image editing frameworks.
|
| 30 |
+
|
| 31 |
+
# 2 RELATED WORK
|
| 32 |
+
|
| 33 |
+
Domain adaptation. Domain adaptation is the task of adapting a model to different domains. Different works in this area (Bousmalis et al., 2016; 2017; Na et al., 2020; Wang & Breckon, 2020; Kang et al., 2019) try to learn diverse domain independent representations using the source domain to make predictions, such as image classification, in the target domains. More importantly, generating diverse representations of images by combining natural language supervision has been of interest to the computer vision and NLP research communities (Frome et al., 2013). Recently, OpenAI’s Contrastive Language-Image Pretraining (CLIP) (Radford et al., 2021) work established that transformer, and large datasets, could generate transferable visual models. In CLIP, both images and text are represented by high dimensional semantic-embedding vectors, which can then be used for zero-shot learning.
|
| 34 |
+
|
| 35 |
+
GAN-based domain adaptation. In the GAN domain, various models and training strategies have been proposed for few-shot domain adaptation tasks (Bousmalis et al., 2017; ZHANG et al., 2018; Li et al., 2020; Liu et al., 2019). Most relevant to our work, the domain adaptation methods (Patashnik et al., 2021; Gal et al., 2021; Jang et al., 2021; Song et al., 2021) that build upon StyleGAN (Karras et al., 2019; 2020b;a) demonstrate impressive visual quality and semantic interpretability in the target domain. These methods can be broadly classified into few-shot and single-shot domain adaptation methods.
|
| 36 |
+
|
| 37 |
+
A notable few-shot method, StyleGAN-ADA (Karras et al., 2020a) proposes an adaptive discriminator augmentation method to train StyleGAN on limited data. Another work, DiffAug (Zhao et al., 2020), applies differentiable transformations to the real and generated images for robust training. A discriminator related approach, FreezeD (Mo et al., 2020), freezes lower layers of the discriminator to achieve domain adaptation. Toonify (justinpinkney/toonify) interpolates between the modelweights of different generators to generate samples from a novel domain. A more recent work (Ojha et al., 2021), reduces overfitting on limited data by preserving the relative similarities and differences in the instances of samples in the source domain using cross domain correspondence.
|
| 38 |
+
|
| 39 |
+
Latent space interpretation and semantic editing. GAN interpretation and understanding of the latent space has been a topic of interest since the advent of GANs. Some notable works in this domain (Bau et al., 2018; 2019; Hark ¨ onen et al., 2020; Shen et al., 2020; Tewari et al., 2020a) ¨ have led to many GAN-based image editing applications. More recent studies into the activation space of StyleGAN have demonstrated that the GAN can be exploited for downstream tasks like unsupervised and few-shot part segmentation (Zhang et al., 2021; Tritrong et al., 2021; Abdal et al., 2021a; Collins et al., 2020; Bielski & Favaro, 2019), extracting 3D models of the objects (Pan et al., 2021; Chan et al., 2020) and other semantic image editing applications (Zhu et al., 2021; Tan et al., 2020; Wu et al., 2020; Patashnik et al., 2021).
|
| 40 |
+
|
| 41 |
+
Image embedding is one of the approaches used to study the interpretability of the GANs. To enable the semantic editing of a given image using GANs, one needs to embed/project the image into its latent space. Image2StyleGAN (Abdal et al., 2019) embeds images into the extended StyleGAN space called $W +$ space. Some followup works (Zhu et al., 2020a; Richardson et al., 2020; Tewari et al., 2020b) introduce regularizers and encoders to keep the latent code faithful to the original space of the StyleGAN. Improved-Image2StyleGAN (II2S) (Zhu et al., 2020b) uses $P _ { N }$ space to regularize the embeddings for high-quality image reconstruction and image editing. We use this method to embed real images into the StyleGAN and show that our domain adaptation preserves the properties of the original StyleGAN in Sec 4.
|
| 42 |
+
|
| 43 |
+
Image editing is another tool to identify the concepts learned by a GAN. In the StyleGAN domain, recent works (Hark ¨ onen et al., 2020; Shen et al., 2020; Tewari et al., 2020a; Abdal et al., ¨ 2021b) extract meaningful linear and non-linear paths in the latent space. InterfaceGAN (Shen et al., 2020) finds linear directions to edit latent-codes in a supervised manner. On the other hand, GANSpace (Hark ¨ onen et al., 2020) extracts unsupervised linear directions for editing using PCA ¨ in the $W$ space. Another framework, StyleRig (Tewari et al., 2020a), maps the latent space of the GAN to a 3D model. StyleFlow (Abdal et al., 2021b) extracts non-linear paths in the latent space to enable sequential image editing. In this work, we will use StyleFlow to test the semantic editing of our domain adapted images.
|
| 44 |
+
|
| 45 |
+
In the area of text-based image editing, StyleCLIP (Patashnik et al., 2021) extends CLIP to perform GAN-based image editing. StyleCLIP uses the CLIP embedding vector to traverse the StyleGAN manifold, by adjusting the latent-codes of a GAN, in order to make a generated image’s CLIP embedding similar to the target vector, while remaining close to the input in latent space. A downside to this approach is that these edits are unable to shift the domain of a GAN outside its original manifold. However, their use of CLIP embeddings inspired StyleGAN-NADA (Gal et al., 2021), which creates a new GAN using refinement learning to do zero-shot domain adaptation. Although unpublished, they also demonstrate one-shot domain adaptation in their accompanying code. The original and target domain are represented by CLIP text embeddings. The difference of the embeddings represents a direction used to shift the domains. Although in the accompanying source-code (rinongal/StyleGAN NADA), they use a bootstrap-estimate of the mean CLIP image embedding of the original domain, and use a reference image or its CLIP image embedding to represent the new domain.
|
| 46 |
+
|
| 47 |
+
# 3 METHOD
|
| 48 |
+
|
| 49 |
+
Our approach involves fine-tuning a GAN trained for some original domain $A$ , e.g. FFHQ faces, to adapt it to a new related domain $B$ . In our approach, the images in $A$ and the images in $B$ are related to each-other by a common latent code. Any image which can be generated or embedded in domain $A$ can be transferred to a corresponding and similar image in $B$ . We use the CLIP embeddings as a semantic-space in order to model the difference between domains $A$ and $B$ , and we use StyleGAN (Karras et al., 2018; 2020b) as the image generator. A key to our approach is to preserve directions within and across domains as illustrated in Fig. 3. Before fine-tuning the GAN for domain $A$ (to obtain the GAN for domain $B$ ), we determine a domain-gap direction. This direction, called $v ^ { \mathrm { r e f } }$ , is a vector in CLIP embedding space which points towards a reference image $I _ { B }$ which is in domain $B$ from its corresponding image $I _ { A }$ in which is in domain $A$ . We use the CLIP image-embedding model $E _ { I }$ to find
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
v ^ { \mathrm { r e f } } = E _ { I } ( I _ { B } ) - E _ { I } ( I _ { A } ) .
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
Finding $I _ { A }$ in domain A for a given image in domain B is a significant limitation in the current state of the art, StyleGAN-NADA (Gal et al., 2021), as they use the mean of domain $A$ . The mean of domain A is a very crude approximation for $I _ { A }$ . Instead, we propose an inverse domain adaption step, by projecting the image $I _ { B }$ into the domain $A$ to find a sample that is more similar and specific to the reference image than the mean of domain $A$ . In principle, this problem is also a domain adaption problem similar to the problem we are trying to solve, just in the inverse direction. The major difference is that we have a pre-trained GAN available in domain A.
|
| 56 |
+
|
| 57 |
+
We use the II2S GAN-inversion method (Zhu et al., 2020b) in order to find a latent code for an image similar to $I _ { B }$ that is plausibly within domain $A$ . The I2S and II2S methods use an extended version of $W$ space from StyleGAN2. The $W$ code is used 18 times, once for each style block in StyleGAN2. When allowing each element to vary independently, the resulting latent space is called $W +$ space Abdal et al. (2019; 2020); Zhu et al. (2020b). I2S showed that the additional degrees of freedom allow GAN inversion for a wider set of images with very detailed reconstruction capabilities, and II2S showed that an additional regularization term to keep the latent codes close to their original distribution made latent-code manipulation more robust. II2S uses a hyperparameter, $\lambda$ , which can be increased in order to generate latent codes using more regularization, and therefore in higher density regions of the $W +$ latent space. The effect of this parameter is shown in Fig. 2. The value suggested in the original work was $\lambda = 0 . 0 0 1$ , however, low values of lambda allow II2S to find latent codes that are too far away from the latent-codes produced by the mapping network of the original GAN and thus produce images that are less plausible to have come from domain $A$ , underestimating the gap between domains. In the context of domain shift we find it is useful to use $\lambda = 0 . 0 1$ as illustrated in Fig. 2. The result is a latent code $w ^ { \mathrm { r e f } }$ in $W +$ space which is shifted towards a high-density portion of the domain $A$ . Then the image generated from that code, $I _ { A }$ , is an image in domain $A$ that corresponds to $I _ { B }$ .
|
| 58 |
+
|
| 59 |
+

|
| 60 |
+
Figure 2: An illustration showing how II2S embeds $I _ { B }$ in the original StyleGAN domain $A$ , shown for two different values of $\lambda$ . Reference images from other domains are shown in the top row. The value recommended by Zhu et al. (2020b) is shown in the second row, and the value used in this work is shown in the third row. Although there is some subjectivity involved, we believe that the large value $\lambda = 1 \mathrm { e } { - 2 }$ is needed for II2S to find images that plausibly could belong to the domain $A$ , which in this case is FFHQ faces.
|
| 61 |
+
|
| 62 |
+
Training As illustrated in Fig. 2, we use II2S to find an image $I _ { A }$ which we consider to be similar to $I _ { B }$ but still plausibly within a domain $A$ . In principle, it is possible that II2S finds $I _ { A }$ so that $I _ { B }$ is similar enough to be considered the same, in which case the two domains overlap. However, we are concerned with the cases where the domains are different, and the vector $v ^ { \mathrm { r e f } }$ indicates the direction of a gap, or shift, between domain $A$ and domain $B$ . We use refinement learning to train a new generator, $G _ { B }$ , so that images generated from $G _ { B }$ are shifted parallel to $v ^ { \mathrm { r e f } }$ in CLIP space, relative to images from $G _ { A }$ . The desired shift is indicated by the red arrows in Fig. 3. During training, latent codes $w$ are generated using the mapping network of StyleGAN2. Both $G _ { A }$ and $G _ { B }$ are used to generate images from the same latent code, but the weights of $G _ { A }$ are frozen and only $G _ { B }$ is updated during training. The goal of refinement learning is that $G _ { B }$ will preserve semantic information that is within domain $A$ but also that it will generate image shifted across a gap between domains. When refining the generator for domain $B$ , we freeze the weights of the StyleGAN2 ‘ToRGB’ layers, and the mapping network is also frozen. The overall process of training is illustrated in Fig. 4.
|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
Figure 3: The vectors in the CLIP image embedding space, $E _ { I }$ , which control domain adaptation. Each domain is depicted here as a dashed outline; the vectors $v ^ { \mathrm { r e f } }$ and $v ^ { \mathrm { s a m p } }$ cross between the two domains and are used to refine a generator for domain $B$ . Corresponding images should be shifted in the same direction. The vectors $v _ { A }$ and $v _ { B }$ model important semantic differences within each domain that should also be preserved by domain transfer. $G _ { A } ( w )$ and $G _ { B } ( w )$ are corresponding images for an arbitrary latent-code $w$ encountered during training. Style mixing (shown on the right) shifts a part of the latent code towards the reference image effecting the result in both domains.
|
| 66 |
+
|
| 67 |
+
The goal of training is to shift CLIP embeddings from domain $A$ in a direction parallel to $v ^ { \mathrm { r e f } }$ . We use the vector $v ^ { \mathrm { s a m p } }$ to represent the current domain shift of the network $G _ { B }$ during training, on a single sample. We have
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
v ^ { \mathrm { s a m p } } = E _ { I } ( G _ { B } ( w ) ) - E _ { I } ( G _ { A } ( w ) )
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
as a cross-domain vector for corresponding images generated from the same $w$ latent code using the two generators. We use the loss
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
L _ { \mathrm { c l i p . a c r o s s } } = 1 - \mathrm { s i m } ( v ^ { \mathrm { r e f } } , v ^ { \mathrm { s a m p } } ) ,
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where $\begin{array} { r } { \mathrm { s i m } ( \mathbf { a } , \mathbf { b } ) = \frac { \mathbf { a } ^ { T } \mathbf { b } } { \| \mathbf { a } \| \| \mathbf { b } \| } } \end{array}$ is the cosine similarity score. This loss term is minimized when the domain shift vectors are parallel.
|
| 80 |
+
|
| 81 |
+
It is important that the reference image $I _ { B }$ matches the generated image, $G _ { B } ( \boldsymbol { w } ^ { \mathrm { r e f } } )$ , both in a semantic sense, as measured by the similarity of the CLIP embeddings, and also in a visual sense. We accomplish this using two losses: $L _ { \mathrm { r e f \_ c l i p } }$ and $L _ { \mathrm { r e f . r e c } }$ . The first loss measures the change in the CLIP-embeddings of the original and reconstructed reference image,
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
{ \cal L } _ { \mathrm { r e f . c l i p } } = 1 - \sin \left( E _ { I } \left( I _ { B } \right) , E _ { I } \left( G _ { B } ( w ^ { \mathrm { r e f } } ) \right) \right) ,
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
ensuring that the $G _ { B }$ can reconstruct the embedding. Unlike $L _ { \mathrm { c l i p . a c c r o s s } }$ , this loss term is not based on a change in embeddings between the two domains, instead it guides $G _ { B }$ by aligning it to a global embedding in CLIP space, ensuring that $I _ { B }$ remains fixed in the domain of $G _ { B }$ .
|
| 88 |
+
|
| 89 |
+
The second loss term is a reconstruction loss based on perceptual and pixel-level accuracy,
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
{ \cal L } _ { \mathrm { r e f . r e c } } = { \cal L } _ { \mathrm { P I P S } } \left( I _ { B } , G _ { B } ( w ^ { \mathrm { r e f } } ) \right) + { \cal L } _ { 2 } \left( I _ { B } , G _ { B } ( w ^ { \mathrm { r e f } } ) \right)
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+

|
| 96 |
+
Figure 4: A process diagram for domain transfer. White rectangles indicate calculations, computed values are shown on the connecting lines. The four loss-calculations are indicated by blue rectangles, and the learnable weights of StyleGAN2 (all weights except the mapping network and the ToRGB layers) are indicated in green.
|
| 97 |
+
|
| 98 |
+
where $L _ { \mathrm { P I P S } }$ is the perceptual loss from Zhang et al. (2018), and $L _ { 2 }$ is the squared euclidean difference between pixels. The purpose of this loss is to ensure that the visual, and not just the semantic, qualities of the image are preserved. This is necessary in addition to $L _ { \mathrm { r e f \_ c l i p } }$ because, while the CLIP embeddings do capture many semantic and visual qualities of the image, there are still many perceptually distinct images that could produce the same CLIP embedding. This is visible in Fig. 6, without the reconstruction loss $G _ { B }$ fails to preserve some important visual qualities (such as symmetry) of the input.
|
| 99 |
+
|
| 100 |
+
There is a tendency for GANs to reduce the variation during training, especially in few-shot finetuning. We combat this by preserving the semantic information that is not related to the domain gap. A semantic change that is not related to the change in domains should not be affected by $G _ { B }$ . Therefore, the vector connecting the reference and sample images within the domain $A$ should be parallel to the corresponding vector in domain $B$ . Let $v _ { A } = { \dot { E } } _ { I } ( G _ { A } ( w ) ) - E _ { I } ( I _ { A } )$ be a vector connecting a sample image with latent-code $w$ to the reference image in the CLIP space. This vector represents semantic changes that are within domain $A$ , and we want the matching semantic changes to occur within the domain $B$ . Let $v _ { B } = E _ { I } ( G _ { B } ( w ) ) - E _ { I } ( I _ { B } )$ denote the corresponding vector in domain $B$ . We introduce the loss
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
{ \cal L } _ { \mathrm { c l i p . w i t h i n } } = 1 - \mathrm { s i m } ( v _ { A } , v _ { B } ) ,
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
which is minimized when the two within-domain changes are parallel.
|
| 107 |
+
|
| 108 |
+
The final loss is then a weighted sum of losses
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
L = L _ { \mathrm { c l i p . a c r o s s } } + \lambda _ { \mathrm { c l i p . w i t h i n } } L _ { \mathrm { c l i p . w i t h i n } } + \lambda _ { \mathrm { r e f . c l i p } } L _ { \mathrm { r e f . c l i p } } + \lambda _ { \mathrm { r e f . r e c } } L _ { \mathrm { r e f . r e c } } ,
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
with empirically determined weights of $\lambda _ { \mathrm { c l i p . w i t h i n } } = 0 . 5$ , $\lambda _ { \mathrm { { r e f . c l i p } } } = 3 0$ , and $\lambda _ { \mathrm { { r e f . r e c } } } = 1 0$ . Together, these four loss terms guide the refinement process for $G _ { B }$ . Among these losses, $L _ { \mathrm { c l i p . a c r o s s } }$ was proposed by StyleGAN-NADA (Gal et al., 2021). The other losses are novel contributions of this work.
|
| 115 |
+
|
| 116 |
+
Style Mixing After the training step, the generator $G _ { B }$ generates images that are semantically similar to the reference image $I _ { B }$ . However, we have observed that the visual style may not be sufficiently similar. We attribute this to the idea that the target domain may be a subset of the images produced by the new generator $G _ { B }$ . This issue was addressed in StyleGAN-NADA (Gal et al., 2021) using a second latent-mining network in order to identify a distribution of latent codes within the domain of $G _ { B }$ that better match the reference image. Our approach exploits the structure of latent codes in $W +$ space. Latent vectors in $W +$ space can be divided into 18 blocks of 512 elements, each impacting a different layer of StyleGAN2. Empirically, the latter blocks of the $W +$ code have been shown to have more effect on the style (e.g. texture and color) of the image whereas the earlier layers impact the coarse-structure or content (Zhu et al., 2021) of the image. We partition the latent code in the image into $w = ( w _ { C } , w _ { S } )$ where $w _ { C }$ consists of the first $m$ blocks of the $W +$ latent code that capture the content of the image, and $w _ { S }$ consists of the remaining blocks and captures the style. In this work, we will use $m = 7$ unless otherwise specified. Then we transfer the style from a reference image using linear interpolation, to form $\hat { w } = ( w _ { C } , \hat { w } _ { S } )$ where
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\hat { w } _ { S } = ( 1 - \alpha ) w _ { S } + \alpha ( w _ { S } ^ { \mathrm { r e f } } ) ,
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
d d $w _ { S } ^ { \mathrm { r e f } }$ is last accor $( 1 8 - m )$ blocks of e distribut $w ^ { \mathrm { r e f } }$ . Consider the distribution of images generated from randomof latent codes from the mapping network of StyleGAN2. If $w$
|
| 123 |
+
$\alpha = 0$ , then the distribution of images $G _ { B } ( \hat { w } )$ includes the reference image, but encompasses a wide variety of other fine visual styles. If $\alpha = 1$ , then the images $G _ { B } ( \hat { w } )$ will still have a diverse content, but they will all very closely follow the visual style of $I _ { B }$ . An important application of this method is in conditional editing of real photographs. To achieve that, first we take a real input image $I _ { \mathrm { r e a l } }$ and invert it in domain $A$ using II2S on the generator $G _ { A }$ in order to find a $W +$ latent code $w _ { \mathrm { r e a l } }$ . Then $G _ { B } ( w _ { \mathrm { r e a l } } )$ generates a corresponding image in domain $B$ . We can then compute $\hat { w } _ { \mathrm { r e a l } }$ by interpolating the style codes (8) so that the final image $G _ { B } ( \hat { w } _ { \mathrm { r e a l } } )$ is similar to $I _ { \mathrm { r e a l } }$ but has both content and the visual style shifted towards domain $B$ .
|
| 124 |
+
|
| 125 |
+
# 4 RESULTS
|
| 126 |
+
|
| 127 |
+
In this section, we will show qualitative and quantitative results of our work. The only other published method that accomplishes similar one-shot GAN domain adaptation which we are aware of is Ojha et al. (2021). They focus on few-shot domain adaptation, but they also demonstrate a capability to solve the one-shot problem. The most closely related work to our approach is StyleGANNADA (Gal et al., 2021), which is unpublished at the time of submission, however we compare to it as the main competitor. The paper mainly discusses zero-shot domain adaptation, but the approach can also accomplish one-shot domain adaptation, as demonstrated in their accompanying sourcecode. Moreover, it demonstrates impressive improvements over the state of the art and even beats many SOTA few-shot methods considering the visual quality. As our method can still significantly improve upon the results shown in StyleGAN-NADA, this underlines the importance of our idea in reducing overfitting. We compare against additional approaches in the appendix.
|
| 128 |
+
|
| 129 |
+
Training and Inference Time. Given a reference image, the training time for our method is about 15 minutes for 600 iterations on a single Titan XP GPU using ADAM as an optimizer with the same settings as Gal et al. (2021). We use a batch size of 4. At inference time, there are different applications. In a basic operation, GAN generated images can be transferred with a single forward pass through a GAN generator network, which works in 0.34 seconds. Considering a more advanced operation, where existing photographs are embedded into a GAN latent space, the additional embedding time has to be considered. This embedding time is only 0.22 seconds using e4e (Tov et al., 2021) and about two minutes using II2S (Zhu et al., 2020b).
|
| 130 |
+
|
| 131 |
+
Visual Evaluation. In Fig. 5, we show a comparison of our results on faces against the two most relevant competing methods – StyleGAN-NADA (Gal et al., 2021) and few-shot-domainadaptation (Ojha et al., 2021). The results show that our method remains faithful to the original identity of the embedded images in domain $A$ , while the other two methods suffer from overfitting, i.e., collapsing to narrow distributions which do not preserve salient features (for example the identity of a person). We show additional visual results in the supplemental materials, including results on cars and dogs and results for fine-tuning the domain adaptation.
|
| 132 |
+
|
| 133 |
+
User Study. We also perform a user study by collecting 187 responses from Amazon Mechanical Turk in order to compare the visual quality and the domain transfer capabilities of our framework compared to the competing methods. When asked which method generates higher quality images from domain $B$ , $73 \%$ of users preferred our approach to StyleGAN-NADA, and $7 7 \%$ selected ours over Few-shot (Ojha et al., 2021). When asked which method is better at maintaining the similarity to a corresponding source image in domain $A$ , we found that $80 \%$ of the responses chose our approach over StyleGAN-NADA, and $91 \%$ preferred our approach to Few-shot. Our method outperforms the competing works in terms of the quality of the generated image, and the similarity of the generated image to the source image from domain $A$ . According to the user study, the other methods produced images that are more similar to $I _ { B }$ , but that is also an indication of overfitting and mode collapse.
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 5: Comparison of our framework with state-of-the-art frameworks for StyleGAN domain adaptation. We compare with StyleGAN-NADA (Gal et al., 2021) and the few-shot method of Ojha et al. (2021). Each row corresponds to a different reference image $I _ { B }$ , and each column is a different real image $I _ { \mathrm { r e a l } }$ from domain $A$ . Notice that our method is able to match the styles of the reference images, while StyleGAN-NADA fails to maintain the content of the images in domain $A$ (for example the identity of a person is lost). On the other hand, the few-shot method suffers from severe mode collapse.
|
| 137 |
+
|
| 138 |
+
Ablation study. We perform an ablation study to evaluate each component of our framework. In Fig. 6, we show the effect of II2S embedding, different losses and style mixing/interpolation on the output.
|
| 139 |
+
|
| 140 |
+

|
| 141 |
+
Figure 6: Ablation study of the losses and style mixing used in our framework. From left to right: the reference image $I _ { A }$ and several images from domain $A$ , the baseline approach (StyleGAN-NADA), adding II2S instead of using the mean of domain $A$ , adding $L _ { \mathrm { r e f \_ c l i p } }$ , $L _ { \mathrm { c l i p . w i t h i n } }$ , and then using style mixing. The top row shows reconstructions of the image $I _ { A }$ using $\mathbf { \dot { \boldsymbol { G } } } _ { B }$ .
|
| 142 |
+
|
| 143 |
+
Image editing capabilities. Another important aspect of our method is that we are able to preserve the semantic properties of the original StyleGAN (domain $A$ ) in domain $B$ . We can make edits to the images in domain $B$ via the learned generator $G _ { B }$ without retraining the image editing frameworks on the new domain. Fig. 7 shows image editing capabilities in the new domain $B$ . We use StyleFlow edits such as lighting, pose, gender etc. to show the fine-grained edits possible in the new domain.
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
Figure 7: Image editing capabilities of the new domain $B$ using StyleFlow (Abdal et al., 2021b). This figure shows the editing results of the embedded real image $I _ { r e a l }$ transferred to domain $B$ . Notice that our method preserves the semantic properties of the original StyleGAN.
|
| 147 |
+
|
| 148 |
+
Limitations Our method has several limitations (See Fig. 8). Some of these limitations are inherent due to the challenging nature of the problem of single-shot domain adaptation. Other limitations can be addressed in future work. First, when we find the initial image in domain $A$ that corresponds to the input in domain $B$ , we do not attempt to control for the semantic similarity. Future work should encourage the images to have similar semantics. Second, we can only transfer between related domains. For example transferring FFHQ faces into the domain of cars is not explored in this paper. Third, also relevant to the original distribution of the StyleGAN, embeddings into the StyleGAN work best when the objects are transformed to the canonical positions (for example face poses that are the same as FFHQ). Extreme poses of the objects in the reference images sometimes fail.
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
|
| 152 |
+
Figure 8: Some failure cases of our method. In these examples, we observe that the identity of the face is compromised a bit more than in typical examples of our method.
|
| 153 |
+
|
| 154 |
+
# 5 CONCLUSIONS
|
| 155 |
+
|
| 156 |
+
We propose a novel method for single shot domain adaption. The main achievement of this work is to obtain results of unprecedented quality while reducing overfitting observed in previous work. The technical key components of our work are a method to model the domain gap as vector in CLIP embedding space, a way to preserve within-domain variation, and several extensions for fine-grained attribute-based control. We also introduce several new regularizers and a style mixing approach.
|
| 157 |
+
|
| 158 |
+
# REFERENCES
|
| 159 |
+
|
| 160 |
+
Rameen Abdal, Yipeng Qin, and Peter Wonka. Image2stylegan: How to embed images into the stylegan latent space? In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 4432–4441, 2019.
|
| 161 |
+
|
| 162 |
+
Rameen Abdal, Yipeng Qin, and Peter Wonka. Image2stylegan $^ { + + }$ : How to edit the embedded images? In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8296–8305, 2020.
|
| 163 |
+
|
| 164 |
+
Rameen Abdal, Peihao Zhu, Niloy Mitra, and Peter Wonka. Labels4free: Unsupervised segmentation using stylegan, 2021a.
|
| 165 |
+
|
| 166 |
+
Rameen Abdal, Peihao Zhu, Niloy J. Mitra, and Peter Wonka. Styleflow: Attribute-conditioned exploration of stylegan-generated images using conditional continuous normalizing flows. ACM Trans. Graph., 40(3), May 2021b. ISSN 0730-0301. doi: 10.1145/3447648. URL https: //doi.org/10.1145/3447648.
|
| 167 |
+
|
| 168 |
+
David Bau, Jun-Yan Zhu, Hendrik Strobelt, Bolei Zhou, Joshua B. Tenenbaum, William T. Freeman, and Antonio Torralba. Gan dissection: Visualizing and understanding generative adversarial networks, 2018.
|
| 169 |
+
|
| 170 |
+
David Bau, Jun-Yan Zhu, Jonas Wulff, William Peebles, Hendrik Strobelt, Bolei Zhou, and Antonio Torralba. Seeing what a gan cannot generate. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 4502–4511, 2019.
|
| 171 |
+
|
| 172 |
+
Adam Bielski and Paolo Favaro. Emergence of object segmentation in perturbed generative models. arXiv preprint arXiv:1905.12663, 2019.
|
| 173 |
+
|
| 174 |
+
Konstantinos Bousmalis, George Trigeorgis, Nathan Silberman, Dilip Krishnan, and Dumitru Erhan. Domain separation networks, 2016.
|
| 175 |
+
|
| 176 |
+
Konstantinos Bousmalis, Nathan Silberman, David Dohan, Dumitru Erhan, and Dilip Krishnan. Unsupervised pixel-level domain adaptation with generative adversarial networks. 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Jul 2017. doi: 10.1109/cvpr. 2017.18. URL http://dx.doi.org/10.1109/CVPR.2017.18.
|
| 177 |
+
|
| 178 |
+
Eric R. Chan, Marco Monteiro, Petr Kellnhofer, Jiajun Wu, and Gordon Wetzstein. pi-gan: Periodic implicit generative adversarial networks for 3d-aware image synthesis, 2020.
|
| 179 |
+
|
| 180 |
+
Hila Chefer, Sagie Benaim, Roni Paiss, and Lior Wolf. Image-based clip-guided essence transfer. arXiv preprint arXiv: 2110.12427, 2021.
|
| 181 |
+
|
| 182 |
+
Edo Collins, Raja Bala, Bob Price, and Sabine Susstrunk. Editing in style: Uncovering the local ¨ semantics of gans, 2020.
|
| 183 |
+
|
| 184 |
+
Andrea Frome, Greg Corrado, Jonathon Shlens, Samy Bengio, Jeffrey Dean, Marc’Aurelio Ranzato, and Tomas Mikolov. Devise: A deep visual-semantic embedding model. 2013.
|
| 185 |
+
|
| 186 |
+
Rinon Gal, Or Patashnik, Haggai Maron, Gal Chechik, and Daniel Cohen-Or. Stylegan-nada: Clipguided domain adaptation of image generators, 2021.
|
| 187 |
+
|
| 188 |
+
Leon A Gatys, Alexander S Ecker, and Matthias Bethge. Image style transfer using convolutional neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 2414–2423, 2016.
|
| 189 |
+
|
| 190 |
+
Erik Hark ¨ onen, Aaron Hertzmann, Jaakko Lehtinen, and Sylvain Paris. Ganspace: Discovering ¨ interpretable gan controls. arXiv preprint arXiv:2004.02546, 2020.
|
| 191 |
+
|
| 192 |
+
Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS’17, pp. 6629–6640, Red Hook, NY, USA, 2017. Curran Associates Inc. ISBN 9781510860964.
|
| 193 |
+
|
| 194 |
+
Xun Huang and Serge Belongie. Arbitrary style transfer in real-time with adaptive instance normalization. In ICCV, 2017.
|
| 195 |
+
|
| 196 |
+
Wonjong Jang, Gwangjin Ju, Yucheol Jung, Jiaolong Yang, Xin Tong, and Seungyong Lee. Stylecarigan. ACM Transactions on Graphics, 40(4):1–16, Aug 2021. ISSN 1557-7368. doi: 10.1145/3450626.3459860. URL http://dx.doi.org/10.1145/3450626.3459860.
|
| 197 |
+
|
| 198 |
+
justinpinkney/toonify. Toonify. https://github.com/justinpinkney/toonify.
|
| 199 |
+
|
| 200 |
+
Guoliang Kang, Lu Jiang, Yi Yang, and Alexander G. Hauptmann. Contrastive adaptation network for unsupervised domain adaptation. 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Jun 2019. doi: 10.1109/cvpr.2019.00503. URL http: //dx.doi.org/10.1109/CVPR.2019.00503.
|
| 201 |
+
|
| 202 |
+
Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. arXiv preprint arXiv:1812.04948, 2018.
|
| 203 |
+
|
| 204 |
+
Tero Karras, Samuli Laine, and Timo Aila. A style-based generator architecture for generative adversarial networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4401–4410, 2019.
|
| 205 |
+
|
| 206 |
+
Tero Karras, Miika Aittala, Janne Hellsten, Samuli Laine, Jaakko Lehtinen, and Timo Aila. Training generative adversarial networks with limited data. In Proc. NeurIPS, 2020a.
|
| 207 |
+
|
| 208 |
+
Tero Karras, Samuli Laine, Miika Aittala, Janne Hellsten, Jaakko Lehtinen, and Timo Aila. Analyzing and improving the image quality of StyleGAN. In Proc. CVPR, 2020b.
|
| 209 |
+
|
| 210 |
+
Tero Karras, Miika Aittala, Samuli Laine, Erik Hark ¨ onen, Janne Hellsten, Jaakko Lehtinen, and ¨ Timo Aila. Alias-free generative adversarial networks. CoRR, abs/2106.12423, 2021.
|
| 211 |
+
|
| 212 |
+
Tuomas Kynka¨anniemi, Tero Karras, Samuli Laine, Jaakko Lehtinen, and Timo Aila. Improved ¨ precision and recall metric for assessing generative models. CoRR, abs/1904.06991, 2019.
|
| 213 |
+
|
| 214 |
+
Kai Li, Yulun Zhang, Kunpeng Li, and Yun Fu. Adversarial feature hallucination networks for fewshot learning. 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Jun 2020. doi: 10.1109/cvpr42600.2020.01348. URL http://dx.doi.org/10.1109/ cvpr42600.2020.01348.
|
| 215 |
+
|
| 216 |
+
Ming-Yu Liu, Xun Huang, Arun Mallya, Tero Karras, Timo Aila, Jaakko Lehtinen, and Jan Kautz. Few-shot unsupervised image-to-image translation. 2019 IEEE/CVF International Conference on Computer Vision (ICCV), Oct 2019. doi: 10.1109/iccv.2019.01065. URL http://dx.doi. org/10.1109/ICCV.2019.01065.
|
| 217 |
+
|
| 218 |
+
Sangwoo Mo, Minsu Cho, and Jinwoo Shin. Freeze the discriminator: a simple baseline for finetuning gans, 2020.
|
| 219 |
+
|
| 220 |
+
Jaemin Na, Heechul Jung, Hyung Jin Chang, and Wonjun Hwang. Fixbi: Bridging domain spaces for unsupervised domain adaptation, 2020.
|
| 221 |
+
|
| 222 |
+
Utkarsh Ojha, Yijun Li, Jingwan Lu, Alexei A. Efros, Yong Jae Lee, Eli Shechtman, and Richard Zhang. Few-shot image generation via cross-domain correspondence, 2021.
|
| 223 |
+
|
| 224 |
+
Xingang Pan, Bo Dai, Ziwei Liu, Chen Change Loy, and Ping Luo. Do 2d {gan}s know 3d shape? unsupervised 3d shape reconstruction from 2d image $\{ \mathrm { g a n } \} \mathrm { s }$ . In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ FGqiDsBUKL0.
|
| 225 |
+
|
| 226 |
+
Or Patashnik, Zongze Wu, Eli Shechtman, Daniel Cohen-Or, and Dani Lischinski. Styleclip: Textdriven manipulation of stylegan imagery, 2021.
|
| 227 |
+
|
| 228 |
+
Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, Gretchen Krueger, and Ilya Sutskever. Learning transferable visual models from natural language supervision, 2021.
|
| 229 |
+
|
| 230 |
+
Elad Richardson, Yuval Alaluf, Or Patashnik, Yotam Nitzan, Yaniv Azar, Stav Shapiro, and Daniel Cohen-Or. Encoding in style: a stylegan encoder for image-to-image translation. arXiv preprint arXiv:2008.00951, 2020.
|
| 231 |
+
|
| 232 |
+
rinongal/StyleGAN NADA. Stylegan-nada. https://github.com/rinongal/ StyleGAN-nada.
|
| 233 |
+
|
| 234 |
+
Yujun Shen, Ceyuan Yang, Xiaoou Tang, and Bolei Zhou. Interfacegan: Interpreting the disentangled face representation learned by gans. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020.
|
| 235 |
+
|
| 236 |
+
Guoxian Song, Linjie Luo, Jing Liu, Wan-Chun Ma, Chunpong Lai, Chuanxia Zheng, and Tat-Jen Cham. Agilegan: Stylizing portraits by inversion-consistent transfer learning. ACM Transactions on Graphics (Proc. SIGGRAPH), jul 2021.
|
| 237 |
+
|
| 238 |
+
Zhentao Tan, Menglei Chai, Dongdong Chen, Jing Liao, Qi Chu, Lu Yuan, Sergey Tulyakov, and Nenghai Yu. Michigan: Multi-input-conditioned hair image generation for portrait editing. ACM Transactions on Graphics (TOG), 39(4):1–13, 2020.
|
| 239 |
+
|
| 240 |
+
Ayush Tewari, Mohamed Elgharib, Gaurav Bharaj, Florian Bernard, Hans-Peter Seidel, Patrick Perez, Michael Zollhofer, and Christian Theobalt. Stylerig: Rigging stylegan for 3d control over ´ portrait images. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6142–6151, 2020a.
|
| 241 |
+
|
| 242 |
+
Ayush Tewari, Mohamed Elgharib, Mallikarjun BR, Florian Bernard, Hans-Peter Seidel, Patrick Perez, Michael Z ´ ollhofer, and Christian Theobalt. Pie: Portrait image embedding for semantic¨ control. volume 39, December 2020b. doi: 10.1145/3414685.3417803.
|
| 243 |
+
|
| 244 |
+
Omer Tov, Yuval Alaluf, Yotam Nitzan, Or Patashnik, and Daniel Cohen-Or. Designing an encoder for stylegan image manipulation. arXiv preprint arXiv:2102.02766, 2021.
|
| 245 |
+
|
| 246 |
+
Nontawat Tritrong, Pitchaporn Rewatbowornwong, and Supasorn Suwajanakorn. Repurposing gans for one-shot semantic part segmentation, 2021.
|
| 247 |
+
|
| 248 |
+
Qian Wang and Toby Breckon. Unsupervised domain adaptation via structured prediction based selective pseudo-labeling. Proceedings of the AAAI Conference on Artificial Intelligence, 34 (04):6243–6250, Apr 2020. ISSN 2159-5399. doi: 10.1609/aaai.v34i04.6091. URL http: //dx.doi.org/10.1609/AAAI.V34I04.6091.
|
| 249 |
+
|
| 250 |
+
Zongze Wu, Dani Lischinski, and Eli Shechtman. Stylespace analysis: Disentangled controls for stylegan image generation. arXiv preprint arXiv:2011.12799, 2020.
|
| 251 |
+
|
| 252 |
+
Richard Zhang, Phillip Isola, Alexei A. Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric, 2018.
|
| 253 |
+
|
| 254 |
+
Ruixiang ZHANG, Tong Che, Zoubin Ghahramani, Yoshua Bengio, and Yangqiu Song. Metagan: An adversarial approach to few-shot learning. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018. URL https://proceedings.neurips.cc/ paper/2018/file/4e4e53aa080247bc31d0eb4e7aeb07a0-Paper.pdf.
|
| 255 |
+
|
| 256 |
+
Yuxuan Zhang, Huan Ling, Jun Gao, Kangxue Yin, Jean-Francois Lafleche, Adela Barriuso, Antonio Torralba, and Sanja Fidler. Datasetgan: Efficient labeled data factory with minimal human effort, 2021.
|
| 257 |
+
|
| 258 |
+
Shengyu Zhao, Zhijian Liu, Ji Lin, Jun-Yan Zhu, and Song Han. Differentiable augmentation for data-efficient gan training, 2020.
|
| 259 |
+
|
| 260 |
+
Jiapeng Zhu, Yujun Shen, Deli Zhao, and Bolei Zhou. In-domain gan inversion for real image editing. In European Conference on Computer Vision, pp. 592–608. Springer, 2020a.
|
| 261 |
+
|
| 262 |
+
Peihao Zhu, Rameen Abdal, Yipeng Qin, John Femiani, and Peter Wonka. Improved stylegan embedding: Where are the good latents?, 2020b.
|
| 263 |
+
|
| 264 |
+
Peihao Zhu, Rameen Abdal, John Femiani, and Peter Wonka. Barbershop: Gan-based image compositing using segmentation masks, 2021.
|
| 265 |
+
|
| 266 |
+
# A APPENDIX: ADDITIONAL RESULTS
|
| 267 |
+
|
| 268 |
+
A.1 VISUAL EVALUATION OF STYLE TRANSFER.
|
| 269 |
+
|
| 270 |
+
We provide additional visual evaluation of the results. In Fig. 9 and 10 we show results of domain adaptation applied to faces. The input photographs are in the top row and the reference images are in the first column. We can see that the results take on the style of the reference image, even though the reference image is far outside the original GAN’s latent space. Also, we notice that overfitting is successfully limited, as each result maintains several important aspects of the input image. In Fig. 13 and 14 we show results for cars, cats, and dogs on the same task. This shows that our method is consistent across different StyleGAN objects/datasets.
|
| 271 |
+
|
| 272 |
+
# A.2 QUANTITATIVE COMPARISON OF SKETCH IMAGES.
|
| 273 |
+
|
| 274 |
+
We calculate the FID (Heusel et al., 2017) between 1,000 generated images and the entire sketch dataset. Additionally, we report the precision and recall metric (Kynka��anniemi et al., 2019) to ¨ measure the quality and diversity respectively. As shown in Tab. 1, our method outperforms the contemporary methods Few-Shot (Ojha et al., 2021), and StyleGAN-NADA (Gal et al., 2021) on both metrics.
|
| 275 |
+
|
| 276 |
+
Another contemporary method, TargetCLIP (Chefer et al., 2021), is capable of one-shot ‘essence transfer’ using a latent-edit, however as the weights of the generator are not modified their approach is restricted to the manifold of the original generator. Because it cannot shift to a completely new domain, TargetCLIP failed to produce any sketch images and has a precision ${ } = 0$ . Because the images it did generate are in the original space of StyleGAN it has high recall (0.29), but this number is not meaningful.
|
| 277 |
+
|
| 278 |
+
Unsurprisingly, all one-shot domain transfer methods have low recall (low diversity) but it is significant that ours is the only approach with positive recall to within 2 significant digits.
|
| 279 |
+
|
| 280 |
+
Table 1: Quantitative comparison on one-shot adaptation between few-shot-domain-adaptation, StyleGAN-NADA, and our method. Evaluation metrics include FID, precision, and recall (higher means higher diversity).
|
| 281 |
+
|
| 282 |
+
<table><tr><td>One Shot Method</td><td>FID↓</td><td>precision↑</td><td>recall个</td></tr><tr><td>Few-shot (Ojha et al., 2021)</td><td>158.86</td><td>0.00</td><td>0.00</td></tr><tr><td>SG-NADA (Gal et al., 2021)</td><td>124.55</td><td>0.12</td><td>0.00</td></tr><tr><td>Ours</td><td>78.35</td><td>0.33</td><td>0.02</td></tr></table>
|
| 283 |
+
|
| 284 |
+
# A.3 MULTI-SHOT DOMAIN ADAPTATION.
|
| 285 |
+
|
| 286 |
+
Although it was designed for one-shot domain adaptation, our method can be extended to few-shot domain adaptation by using multiple input/reference image pairs $( I _ { A } , I _ { B } )$ . In Fig. 11, We show the visual improvement obtained using 3-shot reference images.
|
| 287 |
+
|
| 288 |
+
# A.4 CONTROLLING THE STYLE GAP
|
| 289 |
+
|
| 290 |
+
Our method provides a way to control the domain gap between the domain $A$ and domain $B$ by explicitly controlling the style of the images sampled from or embedded in domain $A$ . Fig. 12 shows that we can control the degree to which style from the reference image is preserved by increasing the style-mixing parameter $\alpha$ , which is not possible with any of the competing methods. This gives users more control over content generation and editing.
|
| 291 |
+
|
| 292 |
+
# A.5 ADDITIONAL COMPARISON
|
| 293 |
+
|
| 294 |
+
In addition to our comparison with StyleGAN-NADA (Gal et al., 2021) and few-shot domain adaptation (Ojha et al., 2021), we compare against three additional methods in Fig. 15. These include one concurrently developed method called TargetCLIP (Chefer et al., 2021) as well as two other methods that work on lower resolution images for one-shot domain transfer. These are the method of Gatys et. al Gatys et al. (2016) and the the AdaIN approach (Huang & Belongie, 2017). Our visual results compare favorably against the new methods in Fig. 15 with respect to preserving the identity of the original image while also generating images that belong to the new domain.
|
| 295 |
+
|
| 296 |
+

|
| 297 |
+
Figure 9: Style transfer results obtained by our method after style interpolation in domain $B$ . The top row represents the real images embedded in the latent space of $G _ { A }$ (domain $A$ ) whose latent codes are then used by $G _ { B }$ (domain $B$ ). The first column represents the reference images $I _ { B }$ which are input to our domain adaptation framework.
|
| 298 |
+
|
| 299 |
+
# A.6 INFERENCE AND EDITING TIME
|
| 300 |
+
|
| 301 |
+
Our proposed approach uses II2S for training and inference and StyleFlow (Abdal et al., 2021b) for editing in the new domain. GAN inversion using II2S on HD $( 1 0 2 4 \times 1 0 2 4 )$ images takes 150 seconds on average, and each latent-code edit operation takes 0.47 seconds. Generating the images afterwards takes an addition 0.34 seconds. Note that the run-time is dominated by GAN -inversion using II2S, however as we show in Fig. 16 once training is completed, we can use other GAN inversion methods to accomplish the edits. With e4e (Tov et al., 2021) inversion is only 0.22 seconds and the entire process of inversion, editing, and generating the edited image can be accomplished in approximately one second.
|
| 302 |
+
|
| 303 |
+

|
| 304 |
+
Figure 10: The structure of rows and columns is the same as in Fig. 9. Note: our method also works well when the reference images are real face images.
|
| 305 |
+
|
| 306 |
+
single-shot
|
| 307 |
+
|
| 308 |
+

|
| 309 |
+
Figure 11: Our method extends to deal with multiple reference images. The figure compares the results using 3 reference images and using single reference image. It can be observed that our method can better catch the general style and achieve more stable results when given multiple reference images.
|
| 310 |
+
|
| 311 |
+

|
| 312 |
+
Figure 12: Style interpolation results achieved by our framework. Unlike the competing methods, our method has an explicit control over the styles in the domain $B$ . Each sub figure shows a reference image and images embedded in domain $A$ . Notice that we can control the amount of variation in style depending on a parameter $\alpha$ that can be specified by a user.
|
| 313 |
+
|
| 314 |
+

|
| 315 |
+
Figure 13: Our domain transfer results on cars. The structure of rows and columns is the same as in Fig. 9.
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure 14: Our domain transfer results on cats and dogs. The structure of rows and columns is the same as in Fig. 9.
|
| 319 |
+
|
| 320 |
+

|
| 321 |
+
Figure 15: Additional comparisons with other baseline methods including the concurrent method TargetCLIP (Chefer et al., 2021) as well as two lower-resolution methods from Gatys et al. (2016) and AdaIN (Huang & Belongie, 2017). One-shot reference images from domain $B$ are shown in the left column. Each image is the result of transferring the image in the top row into the new domain. Compare these images to our method in Fig. 7, our proposed approach has fewer artifacts while preserving the identity of the image in domain $A$ .
|
| 322 |
+
|
| 323 |
+

|
| 324 |
+
Figure 16: Comparison domain-transfer and editing using II2S vs e4e. The new GAN is always trained using II2S, but once training is complete, e4e can be used to transfer images into the new domain. II2S takes 2.5 minutes to embed the image, while e4e needs about 0.22 seconds. StyleFlow editing takes 0.47 seconds, and StyleGAN image generation takes about 0.34 seconds.
|
md/dev/wqD6TfbYkrn/wqD6TfbYkrn.md
ADDED
|
@@ -0,0 +1,403 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A CONDITIONAL POINT DIFFUSION-REFINEMENTPARADIGM FOR 3D POINT CLOUD COMPLETION
|
| 2 |
+
|
| 3 |
+
Zhaoyang Lyu1,2∗ Zhifeng Kong3∗ Xudong $\mathbf { X } \mathbf { u } ^ { 1 }$ Liang Pan4 Dahua Lin1,2 1CUHK-SenseTime Joint Lab, The Chinese University of Hong Kong 2Shanghai AI Laboratory 3University of California, San Diego $^ 4 { \cal S }$ -Lab, Nanyang Technological University lyuzhaoyang@link.cuhk.edu.hk, z4kong@eng.ucsd.edu
|
| 4 |
+
xx018@ie.cuhk.edu.hk, liang.pan@ntu.edu.sg, dhlin@ie.cuhk.edu.hk
|
| 5 |
+
|
| 6 |
+
# ABSTRACT
|
| 7 |
+
|
| 8 |
+
3D point cloud is an important 3D representation for capturing real world 3D objects. However, real-scanned 3D point clouds are often incomplete, and it is important to recover complete point clouds for downstream applications. Most existing point cloud completion methods use Chamfer Distance (CD) loss for training. The CD loss estimates correspondences between two point clouds by searching nearest neighbors, which does not capture the overall point density distribution on the generated shape, and therefore likely leads to non-uniform point cloud generation. To tackle this problem, we propose a novel Point Diffusion-Refinement (PDR) paradigm for point cloud completion. PDR consists of a Conditional Generation Network (CGNet) and a ReFinement Network (RFNet). The CGNet uses a conditional generative model called the denoising diffusion probabilistic model (DDPM) to generate a coarse completion conditioned on the partial observation. DDPM establishes a one-to-one pointwise mapping between the generated point cloud and the uniform ground truth, and then optimizes the mean squared error loss to realize uniform generation. The RFNet refines the coarse output of the CGNet and further improves quality of the completed point cloud. Furthermore, we develop a novel dual-path architecture for both networks. The architecture can (1) effectively and efficiently extract multi-level features from partially observed point clouds to guide completion, and (2) accurately manipulate spatial locations of 3D points to obtain smooth surfaces and sharp details. Extensive experimental results on various benchmark datasets show that our PDR paradigm outperforms previous state-of-the-art methods for point cloud completion. Remarkably, with the help of the RFNet, we can accelerate the iterative generation process of the DDPM by up to 50 times without much performance drop.
|
| 9 |
+
|
| 10 |
+
# 1 INTRODUCTION
|
| 11 |
+
|
| 12 |
+
With the rapid developments of 3D sensors, 3D point clouds are an important data format that captures 3D information owing to their ease of acquisition and efficiency in storage. Unfortunately, point clouds scanned in the real world are often incomplete due to partial observation and self occlusion. It is important to recover the complete shape by inferring the missing parts for many downstream tasks such as 3D reconstruction, augmented reality and scene understanding. To tackle this problem, many learning-based methods (Yuan et al., 2018; Yang et al., 2018; Tchapmi et al., 2019; Xie et al., 2020; Liu et al., 2020; Pan et al., 2021) are proposed, which are supervised by using either the Chamfer Distance (CD) or Earth Mover Distance (EMD) to penalize the discrepancies between the generated complete point cloud and the ground truth. However, CD loss is not sensitive to overall density distribution, and thus networks trained by CD loss could generate non-uniform point cloud completion results (See Figure 10 and 11 in Appendix). EMD is more distinctive to measure density distributions, but it is too expensive to compute in training. The absence of an effective and efficient training loss highly limits the capabilities of many existing point cloud completion networks.
|
| 13 |
+
|
| 14 |
+

|
| 15 |
+
Figure 1: Our Conditional Point Diffusion-Refinement (PDR) paradigm first moves a Gaussian noise step by step towards a coarse completion of the partial observation through a diffusion model (DDPM). Then it refines the coarse point cloud by one step to obtain a high quality point cloud.
|
| 16 |
+
|
| 17 |
+
We find that denoising diffusion probabilistic models (DDPM) (Sohl-Dickstein et al., 2015; Ho et al., 2020) can potentially generate uniform and high quality point clouds with an effective and efficient loss function. It can iteratively move a set of Gaussian noise towards a complete and clean point cloud. DDPM defines a one-to-one pointwise mapping between two consecutive point clouds in the diffusion process, which enables it to use a simple mean squared error loss function for training. This loss function is efficient to compute and explicitly requires the generated point cloud to be uniform, as a one-to-one point mapping is naturally established between the generated point cloud and the ground truth. Point cloud completion task can be treated as a conditional generation problem in the framework of DDPM (Zhou et al., 2021; Luo & Hu, 2021). Indeed, we find the complete point clouds generated by a conditional DDPM often have a good overall distribution that uniformly covers the shape of the object.
|
| 18 |
+
|
| 19 |
+
Nonetheless, due to the probabilistic nature of DDPM and the lack of a suitable network architecture to train the conditional DDPM for 3D point cloud completion in previous works, we find DDPM completed point clouds often lack smooth surfaces and sharp details (See Figure 1 and Appendix Figure 12), which is also reflected by their high CD loss compared with state-of-the-art point cloud completion methods in our experiments. Another problem with DDPM is its inefficiency in the inference phase. It usually takes several hundreds and even up to one thousand forward steps to generate a single point cloud. Several methods (Song et al., 2020; Nichol & Dhariwal, 2021; Kong & Ping, 2021) are proposed to accelerate DDPM using jumping steps without retraining networks, which however, leads to an obvious performance drop when using a small number of diffusion steps.
|
| 20 |
+
|
| 21 |
+
In this work, we propose the Conditional Point Diffusion-Refinement (PDR) paradigm to generate both uniform and high quality complete point clouds. As shown in Figure 1, our PDR paradigm performs point cloud completion in a coarse-to-fine fashion. Firstly, we use the Conditional Generation Network (CGNet) to generate a coarse complete point cloud by the DDPM conditioned on the partial point cloud. It iteratively moves a set of Gaussian noise towards a complete point cloud. Following, the ReFinement Network (RFNet) further refines the coarse complete point cloud generated from the Conditional Generation Network with the help of partial point clouds. In addition, RFNet can be used to refine the low quality point clouds generated by an accelerated DDPM, so that we could enjoy an acceleration up to 50 times, while minimizing the performance drop. In this way, the completion results generated by our PDR paradigm demonstrate both good overall density distribution (i.e. uniform) and sharp local details.
|
| 22 |
+
|
| 23 |
+
Both CGNet and RFNet have a novel dual-path network architecture shown in Figure 2, which is composed of two parallel sub-networks, a Denoise subnet and a Condition Feature Extraction subnet for noisy point clouds and partial point clouds, respectively. Specifically, we propose Point Adaptive Deconvolution (PA-Deconv) operation for upsampling, which can effectively manipulate spatial locations of 3D points. Furthermore, we propose the Feature Transfer (FT) module to directly transmit encoded point features at different scales from the Condition Feature Extraction subnet to the corresponding hierarchy in the Denoise subnet. Extensive experimental results show that our PDR paradigm can provide new state-of-the-art performance for point cloud completion.
|
| 24 |
+
|
| 25 |
+
Our Key contributions can be summarized as: 1) We identify conditional DDPM to be a good model with an effective and efficient loss function to generate uniform point clouds in point cloud completion task. 2) By using RFNet to refine the coarse point clouds, our PDR paradigm can generate complete point cloud with both good overall density distribution (i.e. uniform) and sharp local details. 3) We design novel point learning modules, including PA-Deconv and Feature Transfer modules, for constructing CGNet in DDPM and RFNet, which effectively and efficiently utilizes multi-level features extracted from incomplete point clouds for point cloud completion. 4) With the help of our proposed RFNet, we can accelerate the generation process of DDPM up to 50 times without a significant drop in point cloud quality.
|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
Figure 2: Network architecture of the Conditional Generation Network (CGNet) and ReFinement Network (RFNet). It consists of the Condition Feature Extraction subnet and the Denoise subnet.
|
| 29 |
+
|
| 30 |
+
# 2 PROBLEM STATEMENT
|
| 31 |
+
|
| 32 |
+
In this paper, we focus on the 3D point cloud completion task. A 3D point cloud is represented by $N$ points in the 3D space: $X = \{ x _ { j } | 1 \leq j \leq N \}$ , where each $x _ { j } \in \mathbb { R } ^ { \hat { 3 } }$ is the 3D coordinates of the $j$ -th point. We assume the dataset is composed of $M$ data pairs $\mathsf { \bar { \{ } } ( X _ { i } , C _ { i } ) | 1 \leq i \leq M \}$ , where $X _ { i }$ is the $i$ -th ground-truth point cloud, and $C _ { i }$ is the incomplete point cloud from a partial observation of $X _ { i }$ . The goal is to develop a model that completes the partial observation $C _ { i }$ and outputs a point cloud as close to the ground truth $X _ { i }$ as possible. For algebraic convenience, we let $\pmb { x } \in \mathbb { R } ^ { 3 N }$ be the vector form of a point cloud $\boldsymbol { X }$ , and similarly $^ c$ be the vector form of $C$ .
|
| 33 |
+
|
| 34 |
+
# 3 METHODOLOGY
|
| 35 |
+
|
| 36 |
+
We consider the point cloud completion task as a conditional generation problem, where the incomplete point cloud $C$ serves as the conditioner. We use the powerful generative model called denoising diffusion probabilistic models (DDPM) (Sohl-Dickstein et al., 2015; Ho et al., 2020; Kong et al., 2020) to first generate a coarse completion of the partial observation. Then we use another network to refine the coarse point cloud to improve its visual quality. Our point cloud completion pipeline is shown in Figure 1. We first briefly introduce the theory of DDPM in Section 3.1, and then describe detailed architecture of the Conditional Generation Network (CGNet) and ReFinement Network (RFNet) in Section 3.2 and Section 3.3.
|
| 37 |
+
|
| 38 |
+
# 3.1 BACKGROUND ON CONDITIONAL DENOISING DIFFUSION PROBABILISTIC MODELS
|
| 39 |
+
|
| 40 |
+
We assume $p _ { \mathrm { d a t a } }$ to be the distribution of the complete point cloud $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ in the dataset, and $p _ { \mathrm { l a t e n t } } =$ $\mathcal { N } ( \mathbf { 0 } _ { 3 N } , I _ { 3 N \times 3 N } )$ to be the latent distribution, where $\mathcal { N }$ is the Gaussian distribution. Then, the conditional DDPM consists of two Markov chains called the diffusion process and the reverse process. Both processes have length equal to $T$ . We set $T = 1 0 0 0$ in this paper.
|
| 41 |
+
|
| 42 |
+
The Diffusion Process. The diffusion process is a Markov process that adds Gaussian noise into the clean data distribution $p _ { \mathrm { d a t a } }$ until the output distribution is close to $p _ { \mathrm { l a t e n t } }$ . The diffusion process is irrelevant of the conditioner, the incomplete point cloud $c _ { i }$ . Formally, let $\mathbf { \boldsymbol { x } } ^ { 0 } \sim p _ { \mathrm { d a t a } }$ . We use the superscript to denote the diffusion step $t$ . For conciseness, we omit the subscription $i$ in the following discussion. The diffusion process from clean data $\mathbf { \boldsymbol { x } } ^ { 0 }$ to $\mathbf { x } ^ { T }$ is defined as
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
q ( \pmb { x } ^ { 1 } , \cdots , \pmb { x } ^ { T } | \pmb { x } ^ { 0 } ) = \prod _ { t = 1 } ^ { T } q ( \pmb { x } ^ { t } | \pmb { x } ^ { t - 1 } ) , \mathrm { ~ w h e r e ~ } q ( \pmb { x } ^ { t } | \pmb { x } ^ { t - 1 } ) = \mathcal { N } ( \pmb { x } ^ { t } ; \sqrt { 1 - \beta _ { t } } \pmb { x } ^ { t - 1 } , \beta _ { t } I ) .
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
The hyperparameters $\beta _ { t }$ are pre-defined, small positive constants (See details in Appendix Section A.1). According to Ho et al. (2020), there is a closed form expression for $q ( \pmb { x } ^ { t } | \pmb { x } ^ { 0 } )$ . We first define constants $\alpha _ { t } = 1 - \beta _ { t }$ , $\begin{array} { r } { \bar { \alpha } _ { t } = \prod _ { i = 1 } ^ { t } \alpha _ { i } } \end{array}$ . Then, we have ${ q ( { \pmb x } ^ { t } | { \pmb x } ^ { 0 } ) = \mathcal { N } \left( { \pmb x } ^ { t } ; \sqrt { { \bar { \alpha } } _ { t } } { \pmb x } ^ { 0 } , ( 1 - { \bar { \alpha } } _ { t } ) { \pmb I } \right) }$ .
|
| 49 |
+
|
| 50 |
+
Therefore, when $T$ is large enough, $\bar { \alpha } _ { t }$ goes to 0, and $q ( \pmb { x } ^ { T } | \pmb { x } ^ { 0 } )$ becomes close to the latent distribution $p _ { \mathrm { l a t e n t } } ( \pmb { x } ^ { T } )$ . Note that $\mathbf { \boldsymbol { x } } ^ { t }$ can be directly sampled through the following equation:
|
| 51 |
+
|
| 52 |
+
${ \pmb x } ^ { t } = \sqrt { \bar { \alpha } _ { t } } { \pmb x } ^ { 0 } + \sqrt { 1 - \bar { \alpha } _ { t } } { \epsilon }$ , where $\epsilon$ is a standard Gaussian noise.
|
| 53 |
+
|
| 54 |
+
We emphasize that $q ( \mathbf { \boldsymbol { x } } ^ { t } | \mathbf { \boldsymbol { x } } ^ { t - 1 } )$ can be seen as a one-to-one pointwise mapping as $\mathbf { \boldsymbol { x } } ^ { t }$ can be sampled through the equation $\pmb { x } ^ { t } = \sqrt { 1 - \beta _ { t } } \pmb { x } ^ { t - 1 } + \beta _ { t } \pmb { \epsilon }$ . Therefore, the order of points in $\pmb { x } ^ { 0 }$ is preserved in the diffusion process. However, it does not matter what kind of order we input the points in $\mathbf { \boldsymbol { x } } ^ { 0 }$ . That is because when $T$ is large enough, $\mathbf { \boldsymbol { x } } ^ { T }$ will become a Gaussian distribution. Every point in a Gaussian distribution is equivalent and there is no way to distinguish one point from another.
|
| 55 |
+
|
| 56 |
+
The Reverse Process. The reverse process is a Markov process that predicts and eliminates the noise added in the diffusion process. The reverse process is conditioned on the conditioner, the incomplete point cloud $^ c$ . Let $\mathbf { \boldsymbol { x } } ^ { T } \sim p _ { \mathrm { l a t e n t } }$ be a latent variable. The reverse process from latent $\mathbf { \boldsymbol { x } } ^ { T }$ to clean data $\mathbf { \boldsymbol { x } } ^ { 0 }$ is defined as
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\ L _ { \theta } ( { \boldsymbol x } ^ { 0 } , \dots , { \boldsymbol x } ^ { T - 1 } | { \boldsymbol x } ^ { T } , c ) = \prod _ { t = 1 } ^ { T } p _ { \theta } ( { \boldsymbol x } ^ { t - 1 } | { \boldsymbol x } ^ { t } , c ) , { \mathrm { ~ w h e r e ~ } } p _ { \theta } ( { \boldsymbol x } ^ { t - 1 } | { \boldsymbol x } ^ { t } , c ) = \mathcal { N } ( { \boldsymbol x } ^ { t - 1 } ; \mu _ { \theta } ( { \boldsymbol x } ^ { t } , c , t ) , \sigma _ { t } ^ { 2 } I )
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
The mean $\mu _ { \theta } ( \pmb { x } ^ { t } , \pmb { c } , t )$ is a neural network parameterized by $\pmb \theta$ and the variance $\sigma _ { t } ^ { 2 }$ is a time-step dependent constant. To generate a sample conditioned on $^ c$ , we first sample $\pmb { x } ^ { T } \sim \mathrm { \mathcal { N } } ( \mathbf { 0 } _ { 3 N } , \pmb { I } _ { 3 N \times 3 N } )$ , then draw $\pmb { x } ^ { t - 1 } \sim p _ { \pmb { \theta } } \bar { ( \pmb { x } ^ { t - 1 } | \pmb { x } ^ { t } , \pmb { c } ) }$ for $t = T , T - 1 , \cdots , 1$ , and finally outputs $\mathbf { \boldsymbol { x } } ^ { 0 }$ .
|
| 63 |
+
|
| 64 |
+
Training. DDPM is trained via variational inference. Ho et al. (2020) introduced a certain parameterization for $\mu _ { \theta }$ that can largely simplify the training objective. The parameterization is $\begin{array} { r } { \sigma _ { t } ^ { 2 } \ = \ \frac { 1 - \bar { \alpha } _ { t - 1 } } { 1 - \bar { \alpha } _ { t } } \beta _ { t } } \end{array}$ 1−α¯t−11−α¯ βt, and µθ(xt, c, t) = $\begin{array} { r } { \mu _ { \theta } ( x ^ { t } , c , t ) ~ = ~ \frac { 1 } { \sqrt { \alpha _ { t } } } \left( x ^ { t } - \frac { \beta _ { t } } { \sqrt { 1 - \bar { \alpha } _ { t } } } \epsilon _ { \theta } ( x ^ { t } , c , t ) \right) } \end{array}$ , where $\epsilon _ { \theta }$ is a neural network taking noisy point cloud $\mathbf { \boldsymbol { x } } ^ { t } \sim q ( \mathbf { \boldsymbol { x } } ^ { t } | \mathbf { \boldsymbol { x } } ^ { 0 } )$ in equation (2), diffusion step $t$ , and conditioner $^ c$ as inputs. Then, the simplified training objective becomes
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
{ \cal L } ( \pmb { \theta } ) = \mathbb { E } _ { i \sim { \mathcal { U } } ( [ M ] ) , t \sim { \mathcal { U } } ( [ T ] ) , \epsilon \sim { \mathcal { N } } ( 0 , I ) } \parallel \epsilon - \epsilon _ { \theta } \bigl ( \sqrt { \bar { \alpha } _ { t } } \pmb { x } _ { i } ^ { 0 } + \sqrt { 1 - \bar { \alpha } _ { t } } \epsilon , \pmb { c } _ { i } , t \bigr ) \parallel ^ { 2 } ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $\mathcal { U } ( [ M ] )$ is the uniform distribution over $\{ 1 , 2 , \cdots , M \}$ . The neural network $\epsilon _ { \theta }$ learns to predict the noise $\epsilon$ added to the clean point cloud √ $\mathbf { \boldsymbol { x } } ^ { 0 }$ , which can be used to denoise the noisy point cloud $\pmb { x } ^ { t } = \sqrt { \bar { \alpha } _ { t } } \pmb { x } ^ { 0 } + \sqrt { 1 - \bar { \alpha } _ { t } } \epsilon$ . Note that traditional CD loss or EMD loss is NOT present in Equation 4. The reason that we are able to use the simple mean squared error is because DDPM naturally defines a one-to-one pointwise mapping between two consecutive point clouds in the diffusion process as shown in Equation 1. Note that at each training step, we not only need to sample a pair of point clouds ${ \mathbf { \mathit { x } } } _ { i } , { \mathbf { \mathit { c } } } _ { i }$ , but also a diffusion step $t$ and a Gaussian noise $\epsilon$ .
|
| 71 |
+
|
| 72 |
+
# 3.2 CONDITIONAL GENERATION NETWORK
|
| 73 |
+
|
| 74 |
+
In this section, we introduce the architecture of Conditional Generation Network (CGNet) $\epsilon _ { \theta }$ . The inputs of this network are the noisy point cloud $\mathbf { \boldsymbol { x } } ^ { t }$ , the incomplete point cloud $^ c$ , and the diffusion step $t$ . We can intuitively interpret the output of $\epsilon _ { \theta }$ as per-point difference between $\mathbf { \boldsymbol { x } } ^ { t }$ and ${ \pmb x } ^ { t - 1 }$ (with some arithmetic ignored). In addition, $\epsilon _ { \theta }$ should also effectively incorporate multi-level information from $^ c$ . The goal is to infer not only the overall shape but also the fine-grained details based on $^ c$ . We design a neural network that achieves these features. The overall architecture is shown in Figure 2. It is composed of two parallel sub-networks similar to PointNet+ $^ +$ (Qi et al., 2017b), and they have the same hierarchical structure.
|
| 75 |
+
|
| 76 |
+
The upper subnet, which we refer as the Condition Feature Extraction subnet, extracts multi-level features from the incomplete point cloud $^ c$ . The lower subnet, which we refer as the Denoise subnet, takes the noisy point cloud $\mathbf { \boldsymbol { x } } ^ { t }$ as input. We also add the diffusion step $t$ , the global feature extracted from $^ c$ , and multi-level features extracted by the Condition Feature Extraction subnet to the Denoise subnet. The diffusion step $t$ is first transformed into a 512-dimension step embedding vector through positional encoding and fully connected (FC) layers (See Appendix Section A.1 for details), and then inserted to every level of the Denoise subnet. Similarly, the conditioner $^ c$ is first transformed into a 1024-length global feature through a two-stage PointNet, and then inserted to every level of the Denoise subnet. The multi-level features extracted by the Condition Feature Extraction subnet are inserted to every level of the Denoise subnet through Feature Transfer modules. Finally, the Denoise subnet is connected to a shared MLP and outputs $\bar { \mathbf { \Psi } } _ { \epsilon _ { \theta } ( \mathbf { \mathcal { x } } ^ { t } , c , t ) }$ .
|
| 77 |
+
|
| 78 |
+

|
| 79 |
+
Figure 3: (a) Insert information of the diffusion step embedding and the global feature to the shared MLP. (b) The Feature Transfer module maps features from the incomplete point cloud to the noisy point cloud. (c) Refine and upsample the coarse points at the same time.
|
| 80 |
+
|
| 81 |
+
Additionally, while Zhou et al. (2021) argues PointNet $^ { + + }$ cannot be used in a DDPM that generates point clouds, we find attaching the absolute position of each point to its feature solves this problem. See Appendix Section A.3 for detailed analysis. We also improve the backbone PointNet+ $^ { \cdot + }$ so that it manipulates positions of points more accurately.
|
| 82 |
+
|
| 83 |
+
In the next paragraphs, we elaborate on the building blocks of the improved PointNet+ $^ +$ : Set Abstraction modules in the encoder, and Feature Propagation modules in the decoder, and Feature Transfer modules between the Condition Feature Extraction subnet and the Denoise subnet.
|
| 84 |
+
|
| 85 |
+
Set Abstraction (SA) Module. Similar to PointNet $^ { + + }$ , this module subsamples the input point cloud and propagates the input features. Assume the input is $\{ x _ { j } | 1 \le j \le N _ { l } \}$ , where $x _ { j }$ is the 3D coordinate of the $j$ -th point and $N _ { l }$ is the number of input points to the Set Abstraction module of level $l$ . Each point has a feature of dimension $d _ { l }$ . We concatenate these features with their corresponding 3D coordinates and group them together to form a matrix $\pmb { F } _ { l }$ of shape $N _ { l } \times ( d _ { l } + 3 )$ . The SA module first uses iterative farthest point sampling (FPS) to subsample the input points to $N _ { l + 1 }$ points: $\{ y _ { k } | 1 \le k \le N _ { l + 1 } \}$ . Then it finds $K$ neighbors in the input $\mathbf { \bar { \{ x } } _ { j } | 1 \leq \mathbf { \bar { \{ j } } \leq N _ { l } \mathbf \bar \{$ for each $y _ { k }$ . We denote the $K$ neighbors of $y _ { k }$ as $\{ x _ { j } | j \in B _ { x } ( y _ { k } ) \}$ , where $B _ { x } ( y _ { k } )$ is the index set of the $K$ neighbors. See definition of neighbors in Appendix A.2. These neighbors and their features are grouped together to form a matrix $G _ { i n }$ of shape $N _ { l + 1 } \times K \times ( d _ { l } + \bar { 3 } )$ . Then a shared multilayer perceptron (MLP) is applied to transform the grouped feature $G _ { i n }$ to $G _ { o u t }$ , which is of shape $N _ { l + 1 } \times K \times d _ { l + 1 }$ and $d _ { l + 1 }$ is the dimension of the output feature. Finally, a max-pooling is applied to aggregate features from the $K$ neighbors $\{ x _ { j } | j \in B _ { x } ( y _ { k } ) \}$ to $y _ { k }$ . We obtain the output of the SA module, the matrix $\mathbf { \Delta } F _ { l + 1 }$ , which is of shape $N _ { l + 1 } \times d _ { l + 1 }$ .
|
| 86 |
+
|
| 87 |
+
Note that we need to incorporate information of the diffusion step embedding and global feature extracted from the incomplete point cloud $^ c$ to every SA module in the Denoise subnet as shown in Figure 2. We insert these information to the shared MLP that transforms $G _ { i n }$ to $G _ { o u t }$ mentioned in the above paragraph. Specifically, we add them to the channel dimension of the intermediate feature maps in the shared MLP. Figure 3(a) illustrates this process in details. Inspired by the works (Pan et al., 2021; Zhao et al., 2020), we also replace the max-pooling layer in the SA module with a self-attention layer. Feature at $y _ { k }$ is obtained by a weighted sum of the features of its $K$ neighbors $\{ x _ { j } | j \in B _ { x } ( y _ { k } ) \}$ instead of max-pooling, and the weights are adaptively computed through the attention mechanism. See Appendix A.4 for details of this attention layer.
|
| 88 |
+
|
| 89 |
+
Feature Propagation (FP) Module. Similar to PointNet++, this module upsamples the input point cloud and propagates the input features. In PointNet++, the features are upsampled from $\{ y _ { k } | 1 \le$ $k \leq N _ { l + 1 } \mathrm { \hat { j } }$ to $\{ x _ { j } | 1 \le j \le N _ { l } \}$ by three interpolation: Feature at $x _ { j }$ is a weighted sum of the features of its three nearest neighbors in $\{ y _ { k } | 1 \le k \le N _ { l + 1 } \}$ . We think that the three interpolation operation is not suitable in our task, because the interpolation operation may lose some information about the accurate positions of the points. See a detailed analysis in Appendix Section A.5.
|
| 90 |
+
|
| 91 |
+
We propose to use a Point Adaptive Deconvolution (PA-Deconv) module to upsample the point features. In the SA module, the features are mapped from set $\{ x _ { j } | 1 \le j \le N _ { l } \}$ to $\bar { \{ y _ { k } \vert 1 \le k \le } $ $N _ { l + 1 } \}$ . The key step is to find the neighbors $\{ x _ { j } | j \in \mathcal { B } _ { x } ( y _ { k } ) \} \subseteq \{ x _ { j } | 1 \leq j \leq N _ { l } \}$ for each $y _ { k }$ . Features at $\{ x _ { j } | \bar { j } \in B _ { x } ( y _ { k } ) \}$ are transformed and then aggregated to the point $y _ { k }$ through either max-pooling or attention mechanism. Now in the FP module, we need to map features the other way around: from $\{ y _ { k } | 1 \le k \le N _ { l + 1 } \}$ to $\{ x _ { j } | 1 \le j \le N _ { l } \}$ . We can achieve this goal through a similar method. We find the neighbors $\{ y _ { k } | \bar { k } \in B _ { y } ( x _ { j } ) \} \subseteq \{ y _ { k } | 1 \leq k \leq N _ { l + 1 } \}$ for each $x _ { j }$ . Features at $\{ y _ { k } | k \in B _ { y } ( x _ { j } ) \}$ are transformed through a shared MLP, and then aggregated to the point $x _ { j }$ through attention mechanism. Similar to SA modules, we insert information of the diffusion step embedding and the global feature extracted from the incomplete point cloud $^ c$ to the shared MLP in every FP module in the Denoise subnet. Finally, same as the original FP module in PointNet++, the upsampled features are concatenated with skip linked point features from the corresponding SA module, and then passed through a unit PointNet. The Feature Propagation module are applied four times and features are eventually propagated to the original input point cloud.
|
| 92 |
+
|
| 93 |
+
Feature Transfer (FT) Module. The FT module transmits information from the Condition Feature Extraction subnet to the Denoise subnet. Assume the point cloud at level $l$ in the Condition Feature Extraction subnet is $\{ z _ { l } | 1 \le l \le S _ { l } \}$ , where $S _ { l }$ is the number of points at level $l$ in the Condition Feature Extraction subnet. The FT module maps the features at points $\{ z _ { r } | 1 \le r \le S _ { l } \}$ to points at the same level in the Denoise subnet, which are $\{ x _ { j } | 1 \le j \le \mathsf { N } _ { l } \}$ . Then the mapped features are concatenated with the original features at $\{ x _ { j } | 1 \le { \bar { \jmath } } \le N _ { l } \}$ . Next, the concatenated features are fed to the next level of the Denoise subnet. In this way, the Denoise subnet can utilize local features at different levels of the incomplete point cloud to manipulate the noisy input point cloud to form a clean and complete point cloud. The key step in this process is to map features at $\{ z _ { r } | 1 \le r \le S _ { l } \}$ to $\{ x _ { j } | 1 \le { \mathsf { \bar { j } } } \le { \mathsf { \bar { N } } } _ { l } \}$ . We adopt a similar strategy in the SA module. We find the neighbors $\{ z _ { r } | r \in \bar { \mathcal { B } } _ { z } ( x _ { j } ) \} \subseteq \{ z _ { r } | 1 \leq r \leq S _ { l } \}$ for each $x _ { j }$ . Features at $\{ z _ { r } | r \in B _ { z } ( x _ { j } ) \}$ are transformed through a shared MLP, and then aggregated to the point $x _ { j }$ through the attention mechanism, which is a weighted sum of the features at $\bar { \{ z _ { r } | r \in B _ { z } ( \bar { x _ { j } } ) \} }$ .
|
| 94 |
+
|
| 95 |
+
We set a small distance to define neighbors in low level FT modules, so that they only query the adjacent parts of the incomplete point cloud $^ c$ to preserve local details in it. Large distances are set to define neighbors in high level FT modules. This makes high-level FT modules have large receptive fields, so that they can query a large part of the incomplete point cloud to infer high level 3D structural relations. See detailed neighbor definitions in Appendix Section A.2.
|
| 96 |
+
|
| 97 |
+
# 3.3 REFINEMENT NETWORK
|
| 98 |
+
|
| 99 |
+
We denote the coarse point cloud generated by the Conditional Generation Network as $U$ . We use another network of the same architecture shown in Figure 2 to predict a per-point displacement for $U$ to refine it. The differences are that the input to the Denoise subnet becomes $U$ and we do not need to insert the diffusion step embedding to the Denoise subnet. The predicted displacement are added to $U$ to obtain the refined point cloud $V \colon v = u + \gamma \epsilon _ { f } ( u , c )$ , where $v , u , c$ are the concatenated 3D coordinates of the point clouds $V , U , C$ , respectively. $\gamma$ is a small constant and we set it to 0.001 in all our experiments. $\epsilon _ { f }$ is the ReFinement Network. We use the Chamfer Distance (CD) loss between the refined point cloud $V$ and ground truth point cloud $\boldsymbol { X }$ to supervise the network $\epsilon _ { f }$ :
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\mathcal { L } _ { \mathrm { C D } } ( { \boldsymbol { V } } , { \boldsymbol { X } } ) = \frac { 1 } { | V | } \sum _ { v \in V } \operatorname* { m i n } _ { x \in { \boldsymbol { X } } } | | v - x | | ^ { 2 } + \frac { 1 } { | \boldsymbol { X } | } \sum _ { x \in { \boldsymbol { X } } } \operatorname* { m i n } _ { v \in V } | | v - x | | ^ { 2 } ,
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
where $| V |$ means number of points in $V$ . If we also want to upsample points in $U$ by a factor of $\lambda$ , we can simply increase the output dimension of the network $\epsilon _ { f }$ . In addition to predicting one 3D displacement of each point in $U$ , we predict another $\lambda$ displacements. We consider each point in the refined point cloud $V$ as the center of a group of $\lambda$ points in the dense point cloud that we want to generate. The additional $\lambda$ displacements are added to every point in $V$ to form a dense point cloud. Figure 3(c) illustrates how we upsample every point in $V$ by a factor of $\lambda = 8$ .
|
| 106 |
+
|
| 107 |
+
When training the ReFinement Network $\epsilon _ { f }$ , parameters in the Conditional Generation Network $\epsilon _ { \theta }$ are fixed. It is not practical to generate coarse point clouds $U$ on the fly in the training process of $\epsilon _ { f }$ , because the generation process of DDPM is slow. Instead, we generate and save the coarse point clouds in advance. Due to the probabilistic nature of DDPM, we generate 10 coarse point clouds for each incomplete point cloud in the dataset to increase diversity of training data.
|
| 108 |
+
|
| 109 |
+
# 4 RELATED WORKS
|
| 110 |
+
|
| 111 |
+
Point cloud completion. Inspired by the pioneering work, PointNet (Qi et al., 2017a), researchers focus on learning global feature embeddings from 3D point clouds for completion (Yuan et al., 2018; Tchapmi et al., 2019), which however cannot predict local and thin shape structures. To address these challenges, following research works (Pan, 2020; Xie et al., 2020; Zhang et al., 2020; Wen et al., 2021; Yu et al., 2021; Pan et al., 2021) exploit multi-scale local point features to reconstruct complete point clouds with fine-grained geometric details. Recently, PointTr (Yu et al., 2021) and VRCNet (Pan et al., 2021) provide impressive point cloud completion results with the help of attention-based operations. Nonetheless, as a challenging conditional generation problem, point cloud completion has not been fully resolved.
|
| 112 |
+
|
| 113 |
+
DDPM for point cloud generation. Luo & Hu (2021) are the first to use DDPM for unconditional point cloud generation. They use a Pointwise-net to generate point clouds, which is similar to a 2-stage PointNet used for point cloud part segmentation. However, the Pointwise-net could only receive a global feature. It can not leverage fine-grained local structures in the incomplete point cloud. Zhou et al. (2021) further use conditional DDPM for point cloud completion by training a point-voxel CNN (Liu et al., 2019), but the way they use the incomplete point cloud $^ c$ is different from ours. They directly concatenate $^ c$ with the noisy input $\mathbf { \boldsymbol { x } } ^ { t }$ , and feed them to a single pointvoxel CNN. This may hurt performance of the network, because the concatenated point cloud is very likely to be non-uniform. In addition, $\mathbf { \boldsymbol { x } } ^ { t }$ is very different from $^ c$ for large $t$ ’s due to the large noise magnitude in $\mathbf { \boldsymbol { x } } ^ { t }$ . Feeding two point clouds of very different properties to a single network at once could be quite confusing for the network. The other major difference is that they do not refine or upsample the coarse point cloud generated by DDPM like we do.
|
| 114 |
+
|
| 115 |
+
# 5 EXPERIMENTS
|
| 116 |
+
|
| 117 |
+
# 5.1 DATASETS
|
| 118 |
+
|
| 119 |
+
We conduct point cloud completion experiments on the following three datasets. MVP. The MVP dataset (Pan et al., 2021) has 62400 training partial-complete point cloud pairs and 41600 testing pairs sampled from ShapeNet (Chang et al., 2015). Every partial point cloud has 2048 points. In particular, MVP dataset provides ground truth point clouds with different resolutions, including 2048, 4096, 8192, and 16384 points. MVP-40. The MVP-40 dataset (Pan et al., 2021) consists of 41600 training samples and 64168 testing samples from 40 categories in ModelNet40 (Wu et al., 2015). Its partial point clouds are sampled from complete point clouds with a pre-defined missing ratio, i.e., $50 \%$ , $2 5 \%$ and $1 2 . 5 \%$ missing. Both the partial and complete point clouds have 2048 points. Completion3D. It (Tchapmi et al., 2019) consists of 28974 point cloud pairs for training and 1184 for testing from 8 object categories in ShapeNet. Both the partial and complete point clouds have 2048 points. We find some pairs of the incomplete point cloud and complete point cloud have inconsistent scales in the Completion3D dataset. We correct the scales and use the corrected dataset in our experiments. See details in Appendix Section B.4.
|
| 120 |
+
|
| 121 |
+
# 5.2 EVALUATION METRICS
|
| 122 |
+
|
| 123 |
+
We use the Chamfer Distance (CD), Earth Mover Distance (EMD), and F1 score to evaluate the quality of the generated point clouds. CD distance is defined in Equation 5.
|
| 124 |
+
|
| 125 |
+
Earth Mover Distance. Consider the predicted point cloud $V$ and the ground truth point cloud $\boldsymbol { X }$ of equal size $N = | V | = | X |$ , the EMD loss penalizes their shape discrepancy by optimizing a transportation problem. It estimates a bijection $\phi : V \longleftrightarrow X$ between $V$ and $\boldsymbol { X }$ :
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
\mathcal { L } _ { \mathrm { E M D } } ( V , X ) = \operatorname* { m i n } _ { \phi : V : \longrightarrow X } \sum _ { v \in V } \big \| v - \phi ( v ) \big \| _ { 2 } .
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
F1 score. To compensate the problem that CD loss can be sensitive to outliers, we follow previous methods (Pan et al., 2021; Tatarchenko et al., 2019) and use F1 score to explicitly evaluates the distance between object surfaces, which is defined as the harmonic mean between precision ${ \mathcal { L } } _ { \mathrm { P } } ( \rho )$ and recall $\mathcal { L } _ { \mathrm { R } } ( { \boldsymbol \rho } )$ : $\begin{array} { r } { \mathcal { L } _ { \mathrm { F 1 } } = \frac { 2 \mathcal { L } _ { \mathrm { P } } ( \rho ) \mathcal { L } _ { \mathrm { R } } ( \rho ) } { \mathcal { L } _ { \mathrm { P } } ( \rho ) + \mathcal { L } _ { \mathrm { R } } ( \rho ) } } \end{array}$ , where $\mathcal { L } _ { \mathrm { P } } ( \boldsymbol { \rho } ) = \frac { 1 } { | \boldsymbol { V } | } \sum _ { \boldsymbol { v } \in \boldsymbol { V } } \left[ \operatorname* { m i n } _ { \boldsymbol { x } \in \boldsymbol { X } } \big | \big | \boldsymbol { x } - \boldsymbol { v } \big | \big | ^ { 2 } < \boldsymbol { \rho } \right] , \mathcal { L } _ { \mathrm { R } } ( \boldsymbol { \rho } ) =$ $\frac { 1 } { | X | } \sum _ { x \in X } \left[ \operatorname* { m i n } _ { v \in V } \left\| x - v \right\| ^ { 2 } < \rho \right] .$ , and $\rho$ is a predefined distance threshold. We set $\rho = 1 0 ^ { - 4 }$ for the MVP and Completion3D datasets, and set $\rho = 1 0 ^ { - 3 }$ for the MVP-40 dataset.
|
| 132 |
+
|
| 133 |
+
Table 1: Point cloud completion results on MVP, MVP-40 and Completion3D datasets at the resolution of 2048 points. CD loss is multiplied by $1 0 ^ { 4 }$ . EMD loss is multiplied by $\mathrm { \dot { 1 } 0 ^ { 2 } }$ . Scale factors of the two losses are the same in all the other tables. The two losses are the lower the better, while F1 score is the higher the better. Note that MVP-40 dataset has larger CD and EMD losses because objects in it have larger scales than the other two datasets. Results of MVP-40 dataset at $2 5 \%$ missing ratio is complemented in Appendix Table 5.
|
| 134 |
+
|
| 135 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3">MVP</td><td colspan="3">MVP40 (50% missing)</td><td colspan="3">MVP40 (12.5% missing)</td><td colspan="3">Completion3D</td></tr><tr><td>CD</td><td>EMD</td><td>F1</td><td>CD</td><td>EMD</td><td>F1</td><td>CD</td><td>EMD</td><td>F1</td><td>CD</td><td>EMD</td><td>F1</td></tr><tr><td>PCN (Yuan et al., 2018)</td><td>8.65</td><td>1.95</td><td>0.342</td><td>39.67</td><td>6.37</td><td>0.581</td><td>32.56</td><td>6.18</td><td>0.619</td><td>8.81</td><td>3.03</td><td>0.315</td></tr><tr><td>TopNet (Tchapmi et al., 2019)</td><td>10.19</td><td>2.44</td><td>0.299</td><td>48.52</td><td>8.75</td><td>0.506</td><td>40.12</td><td>9.08</td><td>0.542</td><td>11.56</td><td>3.69</td><td>0.257</td></tr><tr><td>FoldingNet (Yang et al., 2018)</td><td>10.54</td><td>3.64</td><td>0.256</td><td>51.89</td><td>11.66</td><td>0.441</td><td>46.03</td><td>8.93</td><td>0.480</td><td>14.32</td><td>4.81</td><td>0.186</td></tr><tr><td>MSN (Liu et al., 2020)</td><td>7.08</td><td>1.71</td><td>0.434</td><td>34.33</td><td>9.70</td><td>0.646</td><td>20.20</td><td>4.54</td><td>0.728</td><td>8.88</td><td>2.69</td><td>0.359</td></tr><tr><td>Cascade (Wang et al., 2020)</td><td>6.83</td><td>2.14</td><td>0.436</td><td>34.16</td><td>15.40</td><td>0.635</td><td>26.73</td><td>5.71</td><td>0.657</td><td>7.31</td><td>2.70</td><td>0.408</td></tr><tr><td>ECG (Pan, 2020)</td><td>7.06</td><td>2.36</td><td>0.443</td><td>34.06</td><td>16.19</td><td>0.671</td><td>40.00</td><td>6.98</td><td>0.597</td><td>10.43</td><td>3.63</td><td>0.300</td></tr><tr><td>GRNet (Xie et al., 2020)</td><td>7.61</td><td>2.36</td><td>0.353</td><td>35.99</td><td>12.33</td><td>0.589</td><td>22.04</td><td>6.43</td><td>0.646</td><td>8.54</td><td>2.87</td><td>0.314</td></tr><tr><td>PMPNet (Wen et al.,2021)</td><td>5.85</td><td>3.42</td><td>0.475</td><td>25.41</td><td>29.92</td><td>0.721</td><td>13.00</td><td>8.92</td><td>0.815</td><td>7.45</td><td>4.85</td><td>0.386</td></tr><tr><td>VRCNet (Pan et al.,2021)</td><td>5.82</td><td>2.31</td><td>0.495</td><td>25.70</td><td>18.40</td><td>0.736</td><td>14.20</td><td>5.90</td><td>0.807</td><td>6.69</td><td>3.57</td><td>0.433</td></tr><tr><td>PDR paradigm (Ours)</td><td>5.66</td><td>1.37</td><td>0.499</td><td>27.20</td><td>2.68</td><td>0.739</td><td>12.70</td><td>1.39</td><td>0.827</td><td>7.10</td><td>1.75</td><td>0.451</td></tr></table>
|
| 136 |
+
|
| 137 |
+
Table 2: Completion results on MVP dataset at the resolution of 4096, 8192, 16384 points.
|
| 138 |
+
|
| 139 |
+
<table><tr><td rowspan=2 colspan=1>#Points</td><td rowspan=1 colspan=1>4096</td><td rowspan=1 colspan=1>8192</td><td rowspan=1 colspan=1>16384</td></tr><tr><td rowspan=1 colspan=1>CD F1</td><td rowspan=1 colspan=1>CD F1</td><td rowspan=1 colspan=1>CD F1</td></tr><tr><td rowspan=1 colspan=1>PCNTopNet</td><td rowspan=1 colspan=1>7.140.4697.690.434</td><td rowspan=1 colspan=1>6.020.5776.640.526</td><td rowspan=1 colspan=1>5.180.6505.140.618</td></tr><tr><td rowspan=1 colspan=1>FoldingNet</td><td rowspan=1 colspan=1>8.760.351</td><td rowspan=1 colspan=1>6.900.433</td><td rowspan=1 colspan=1>6.980.464</td></tr><tr><td rowspan=1 colspan=1>MSN</td><td rowspan=1 colspan=1>5.370.583</td><td rowspan=1 colspan=1>4.400.663</td><td rowspan=1 colspan=1>4.090.696</td></tr><tr><td rowspan=1 colspan=1>Cascade</td><td rowspan=1 colspan=1>5.460.579</td><td rowspan=1 colspan=1>4.510.686</td><td rowspan=1 colspan=1>3.900.743</td></tr><tr><td rowspan=1 colspan=1>ECG</td><td rowspan=1 colspan=1>7.310.506</td><td rowspan=1 colspan=1>3.990.717</td><td rowspan=1 colspan=1>3.320.774</td></tr><tr><td rowspan=1 colspan=1>GRNet</td><td rowspan=1 colspan=1>5.730.493</td><td rowspan=1 colspan=1>4.510.616</td><td rowspan=1 colspan=1>3.540.700</td></tr><tr><td rowspan=1 colspan=1>PoinTrVRCNet</td><td rowspan=1 colspan=1>4.290.6384.620.629</td><td rowspan=1 colspan=1>3.520.7253.390.734</td><td rowspan=1 colspan=1>2.950.7832.810.780</td></tr><tr><td rowspan=1 colspan=1>Ours</td><td rowspan=1 colspan=1>4.260.649</td><td rowspan=1 colspan=1>3.350.754</td><td rowspan=1 colspan=1>2.610.817</td></tr></table>
|
| 140 |
+
|
| 141 |
+
Table 3: Comparison of different network structures in term of training the conditional generation network and refinement network.
|
| 142 |
+
|
| 143 |
+
<table><tr><td rowspan=1 colspan=1>Task</td><td rowspan=1 colspan=1>Network</td><td rowspan=1 colspan=1>CD EMD F1</td></tr><tr><td rowspan=2 colspan=1>GenerateCoarsePoints</td><td rowspan=2 colspan=1>Pointwise-netConcatext & cPointNet++PA-DeonvPA-Deonv & Att.</td><td rowspan=1 colspan=1>11.99 1.630.265</td></tr><tr><td rowspan=1 colspan=1>10.791.540.3829.39 1.380.3558.81 1.340.3798.71 1.290.389</td></tr><tr><td rowspan=5 colspan=1>RefineCoarsePoints</td><td rowspan=3 colspan=1>Pointwise-netConcatext &cPointNet++</td><td rowspan=1 colspan=1>7.71 1.450.407</td></tr><tr><td rowspan=1 colspan=1>5.78 1.380.490</td></tr><tr><td rowspan=1 colspan=1>6.03 1.400.480</td></tr><tr><td rowspan=2 colspan=1>PA-DeonvPA-Deonv & Att.</td><td rowspan=1 colspan=1>5.96 1.400.482</td></tr><tr><td rowspan=1 colspan=1>5.66 1.370.499</td></tr></table>
|
| 144 |
+
|
| 145 |
+
# 5.3 POINT CLOUD COMPLETION
|
| 146 |
+
|
| 147 |
+
We compare our point cloud completion method with previous state-of-the-art point cloud completion methods. The comparison is performed on MVP, MVP-40, and Completion3D datasets. Results are shown in Table 1. We also conduct multi-resolution experiments on the MVP dataset, and results are shown in Table 2. Detailed experimental setups are provided in Appendix Section B.1. We can see that our Conditional Point Diffusion-Refinement (PDR) paradigm outperforms other methods by a large margin in terms of EMD loss, which is highly indicative of uniformness (Zhang et al., 2021). We also achieve the highest F1 score and very low CD loss. Although VRCNet sometimes has lower CD loss than ours, it tends to put more points in the parts that are known in the incomplete point clouds, while put less points in the missing part (See Figure 10 in Appendix). In this way, its CD loss could be very low, but this non-uniformness is undesired and leads to very high EMD loss. We compare our method with other baselines in terms of visual quality of completed point clouds in Figure 4. We can see that our method generally has better visual quality. More samples are provided in Figure 9 and Figure 11 in Appendix. We also find that our PDR paradigm demonstrate some diversity in completion results as discussed in Appendix B.8.
|
| 148 |
+
|
| 149 |
+
Ablation Study. We study the effect of attention mechanism, Point Adaptive Deconvolution (PADeconv) module, and Feature Transfer (FT) module in term of training the Conditional Generation Network and the Refinement Network. The experiments are conducted on MVP dataset at the resolution of 2048 points and results are shown in Table 3. “PA-Deonv & Att.” is our proposed complete network shown in Figure 2. “PA-Deonv” removes attention mechanism. “PointNet $+ + ^ { \prime }$ further removes PA-Deconv module. “Concate $\mathbf { \boldsymbol { x } } ^ { t }$ & $c ^ { \prime \prime }$ removes FT modules. It concatenates $^ c$ with $\mathbf { \boldsymbol { x } } ^ { t }$ as Zhou et al. (2021) do, and feed them to a single PointNe $^ { + + }$ with attention mechanism and PADeconv. “Pointwise-net” only utilizes a global feature extracted from the incomplete point cloud. We can see that these proposed modules indeed improve the networks’ performance. Note that the conditional generation networks in Table 3 are trained without data augmentation. Complete experimental results with data augmentation are presented in Appendix Section B.6. All the refinement networks are trained using data generated by our proposed complete dual-path network trained with data augmentation. If the other ablated networks use training data generated by themselves, they would have worse refinement results.
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 4: Visual comparison of point cloud completion results on the MVP dataset (16384 points).
|
| 153 |
+
|
| 154 |
+

|
| 155 |
+
Figure 5: Our method can be extended to controllable point cloud generation.
|
| 156 |
+
|
| 157 |
+
DDPM acceleration. Kong & Ping (2021) propose to accelerate the generation process of DDPM by jumping steps in the reverse process. The method does not need retraining of the DDPM. We directly apply their method to our 3D point cloud generation network. However, we observe a considerable performance drop in the accelerated DDPM. On the MVP dataset (2048 points), the original 1000-step DDPM achieves $1 0 . 7 \times 1 0 ^ { - 4 }$ CD loss. CD losses of the accelerated 50-step and 20-step DDPMs increase to $1 3 . 2 \times 1 0 ^ { - 4 }$ and $1 8 . 1 \times 1 0 ^ { - 4 }$ , respectively. Fortunately, we can generate coarse point clouds using the accelerated DDPMs and use another Refinement Network to refine them. The refined point clouds of the 50-step and 20-step DDPMs bear CD losses of $5 . 6 8 \times 1 0 ^ { - 4 }$ and $5 . 7 8 \times 1 0 ^ { - 4 }$ , respectively. Compared with the original 1000-step DDPM, which has a CD loss of $5 . 6 6 \times 1 0 ^ { - 4 }$ , it’s quite temping to accept a slight drop in performance for an acceleration up to 50 times. Complete results of the acceleration experiment are presented in Appendix Section B.7.
|
| 158 |
+
|
| 159 |
+
# 5.4 EXTENSION TO CONTROLLABLE GENERATION
|
| 160 |
+
|
| 161 |
+
Our conditional PDR paradigm can be readily extended to controllable point cloud generation conditioned on bounding boxes of every part of an object. We sample points on the surfaces of the bounding boxes and regard this point cloud as the conditioner, just like the incomplete point cloud serves as the conditioner for point cloud completion. We conduct experiments on the chair category of PartNet (Mo et al., 2019) dataset. Two examples are shown in Figure 5. It’s interesting that our method can generate a shape different from the ground truth in some details, but be still plausible.
|
| 162 |
+
|
| 163 |
+
# 6 CONCLUSION
|
| 164 |
+
|
| 165 |
+
In this paper, we propose the Conditional Point Diffusion-Refinement (PDR) paradigm for point cloud completion. Our method effectively leverages the strong spatial correspondence between the adjacent parts of the incomplete point cloud and the complete point cloud through the proposed Feature Transfer module, which could also infer high-level 3D structural relations. We make improvements of the backbone PointNe $^ { + + }$ to make it capable of accurately manipulating positions of input points. Our method demonstrate significant advantages over previous methods, especially in terms of the overall distribution of the generated point cloud. We also find that our method has great potential to be applied in other conditional point cloud generation tasks such as controllable point cloud generation.
|
| 166 |
+
|
| 167 |
+
# 7 ACKNOWLEDGEMENTS
|
| 168 |
+
|
| 169 |
+
This work is partially supported by General Research Fund (GRF) of Hong Kong (No. 14205719).
|
| 170 |
+
The authors thank useful discussions with Quan Wang from SenseTime and Tong Wu from CUHK.
|
| 171 |
+
|
| 172 |
+
# REFERENCES
|
| 173 |
+
|
| 174 |
+
Angel X. Chang, Thomas Funkhouser, Leonidas Guibas, Pat Hanrahan, Qixing Huang, Zimo Li, Silvio Savarese, Manolis Savva, Shuran Song, Hao Su, Jianxiong Xiao, Li Yi, and Fisher Yu. ShapeNet: An Information-Rich 3D Model Repository. Technical Report arXiv:1512.03012 [cs.GR], Stanford University — Princeton University — Toyota Technological Institute at Chicago, 2015.
|
| 175 |
+
|
| 176 |
+
Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. arXiv preprint arXiv:2006.11239, 2020.
|
| 177 |
+
|
| 178 |
+
Zhifeng Kong and Wei Ping. On fast sampling of diffusion probabilistic models. arXiv preprint arXiv:2106.00132, 2021.
|
| 179 |
+
|
| 180 |
+
Zhifeng Kong, Wei Ping, Jiaji Huang, Kexin Zhao, and Bryan Catanzaro. DiffWave: A versatile diffusion model for audio synthesis. arXiv preprint arXiv:2009.09761, 2020.
|
| 181 |
+
|
| 182 |
+
Minghua Liu, Lu Sheng, Sheng Yang, Jing Shao, and Shi-Min Hu. Morphing and sampling network for dense point cloud completion. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pp. 11596–11603, 2020.
|
| 183 |
+
|
| 184 |
+
Zhijian Liu, Haotian Tang, Yujun Lin, and Song Han. Point-voxel cnn for efficient 3d deep learning. arXiv preprint arXiv:1907.03739, 2019.
|
| 185 |
+
|
| 186 |
+
Shitong Luo and Wei Hu. Diffusion probabilistic models for 3d point cloud generation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 2837–2845, 2021.
|
| 187 |
+
|
| 188 |
+
Kaichun Mo, Shilin Zhu, Angel X Chang, Li Yi, Subarna Tripathi, Leonidas J Guibas, and Hao Su. Partnet: A large-scale benchmark for fine-grained and hierarchical part-level 3d object understanding. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 909–918, 2019.
|
| 189 |
+
|
| 190 |
+
Alex Nichol and Prafulla Dhariwal. Improved denoising diffusion probabilistic models. arXiv preprint arXiv:2102.09672, 2021.
|
| 191 |
+
|
| 192 |
+
Liang Pan. Ecg: Edge-aware point cloud completion with graph convolution. IEEE Robotics and Automation Letters, 2020.
|
| 193 |
+
|
| 194 |
+
Liang Pan, Xinyi Chen, Zhongang Cai, Junzhe Zhang, Haiyu Zhao, Shuai Yi, and Ziwei Liu. Variational relational point completion network. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 8524–8533, 2021.
|
| 195 |
+
|
| 196 |
+
Charles R Qi, Hao Su, Kaichun Mo, and Leonidas J Guibas. Pointnet: Deep learning on point sets for 3d classification and segmentation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 652–660, 2017a.
|
| 197 |
+
|
| 198 |
+
Charles Ruizhongtai Qi, Li Yi, Hao Su, and Leonidas J Guibas. Pointnet++: Deep hierarchical feature learning on point sets in a metric space. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett (eds.), Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017b. URL https://proceedings.neurips.cc/paper/2017/file/ d8bf84be3800d12f74d8b05e9b89836f-Paper.pdf.
|
| 199 |
+
|
| 200 |
+
Prajit Ramachandran, Barret Zoph, and Quoc V Le. Swish: a self-gated activation function. arXiv preprint arXiv:1710.05941, 7:1, 2017.
|
| 201 |
+
|
| 202 |
+
Jascha Sohl-Dickstein, Eric A Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. arXiv preprint arXiv:1503.03585, 2015.
|
| 203 |
+
|
| 204 |
+
Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. arXiv preprint arXiv:2010.02502, 2020.
|
| 205 |
+
|
| 206 |
+
Maxim Tatarchenko, Stephan R Richter, Rene Ranftl, Zhuwen Li, Vladlen Koltun, and Thomas ´ Brox. What do single-view 3d reconstruction networks learn? In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 3405–3414, 2019.
|
| 207 |
+
|
| 208 |
+
Lyne P Tchapmi, Vineet Kosaraju, Hamid Rezatofighi, Ian Reid, and Silvio Savarese. Topnet: Structural point cloud decoder. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 383–392, 2019.
|
| 209 |
+
|
| 210 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Advances in neural information processing systems, pp. 5998–6008, 2017.
|
| 211 |
+
|
| 212 |
+
Xiaogang Wang, Marcelo H Ang Jr, and Gim Hee Lee. Cascaded refinement network for point cloud completion. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 790–799, 2020.
|
| 213 |
+
|
| 214 |
+
Xin Wen, Peng Xiang, Zhizhong Han, Yan-Pei Cao, Pengfei Wan, Wen Zheng, and Yu-Shen Liu. Pmp-net: Point cloud completion by learning multi-step point moving paths. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7443–7452, 2021.
|
| 215 |
+
|
| 216 |
+
Zhirong Wu, Shuran Song, Aditya Khosla, Fisher Yu, Linguang Zhang, Xiaoou Tang, and Jianxiong Xiao. 3d shapenets: A deep representation for volumetric shapes. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1912–1920, 2015.
|
| 217 |
+
|
| 218 |
+
Yaqi Xia, Yan Xia, Wei Li, Rui Song, Kailang Cao, and Uwe Stilla. Asfm-net: Asymmetrical siamese feature matching network for point completion, 2021.
|
| 219 |
+
|
| 220 |
+
Haozhe Xie, Hongxun Yao, Shangchen Zhou, Jiageng Mao, Shengping Zhang, and Wenxiu Sun. Grnet: Gridding residual network for dense point cloud completion. arXiv preprint arXiv:2006.03761, 2020.
|
| 221 |
+
|
| 222 |
+
Yaoqing Yang, Chen Feng, Yiru Shen, and Dong Tian. Foldingnet: Point cloud auto-encoder via deep grid deformation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 206–215, 2018.
|
| 223 |
+
|
| 224 |
+
Xumin Yu, Yongming Rao, Ziyi Wang, Zuyan Liu, Jiwen Lu, and Jie Zhou. Pointr: Diverse point cloud completion with geometry-aware transformers. arXiv preprint arXiv:2108.08839, 2021.
|
| 225 |
+
|
| 226 |
+
Wentao Yuan, Tejas Khot, David Held, Christoph Mertz, and Martial Hebert. Pcn: Point completion network. In 2018 International Conference on 3D Vision (3DV), pp. 728–737. IEEE, 2018.
|
| 227 |
+
|
| 228 |
+
Junzhe Zhang, Xinyi Chen, Zhongang Cai, Liang Pan, Haiyu Zhao, Shuai Yi, Chai Kiat Yeo, Bo Dai, and Chen Change Loy. Unsupervised 3d shape completion through gan inversion. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1768–1777, 2021.
|
| 229 |
+
|
| 230 |
+
Wenxiao Zhang, Qingan Yan, and Chunxia Xiao. Detail preserved point cloud completion via separated feature aggregation. arXiv preprint arXiv:2007.02374, 2020.
|
| 231 |
+
|
| 232 |
+
Hengshuang Zhao, Li Jiang, Jiaya Jia, Philip Torr, and Vladlen Koltun. Point transformer. arXiv preprint arXiv:2012.09164, 2020.
|
| 233 |
+
|
| 234 |
+
Linqi Zhou, Yilun Du, and Jiajun Wu. 3d shape generation and completion through point-voxel diffusion. arXiv preprint arXiv:2104.03670, 2021.
|
| 235 |
+
|
| 236 |
+
# APPENDIX
|
| 237 |
+
|
| 238 |
+
# A METHODOLOGY DETAILS
|
| 239 |
+
|
| 240 |
+
# A.1 DETAILS OF THE DDPM
|
| 241 |
+
|
| 242 |
+
Hyperparameters $\beta _ { t }$ . We define hyperparameters $\beta _ { t }$ in the diffusion process according to a linear schedule. We let $\beta _ { 1 } = 1 \times 1 0 ^ { - 4 }$ and $\bf { \dot { \beta } } _ { T } = 2 \times 1 0 ^ { - 2 }$ . Then, we define $\begin{array} { r } { \beta _ { t } = \frac { t - 1 } { T - 1 } \cdot ( \beta _ { T } - \beta _ { 1 } ) , t = } \end{array}$ $1 , 2 , \cdots , T$ .
|
| 243 |
+
|
| 244 |
+
Diffusion step embedding. The network $\epsilon$ needs to output different $\epsilon _ { \theta } ( \pmb { x } ^ { t } , \pmb { c } , t )$ for different diffusion steps $t \in \{ 1 , \cdots , T \}$ . We first use positional encoding (Vaswani et al., 2017) to encode each $t$ into a $2 d _ { t }$ dimensional vector $\phi _ { \mathrm { e m b } } ( t ) = [ \sin ( \psi ( t ) ) , \cos ( \psi ( t ) ) ]$ , where
|
| 245 |
+
|
| 246 |
+
$$
|
| 247 |
+
\psi ( t ) = \left[ 1 0 ^ { \frac { 4 \times 0 } { d _ { t } } t } , 1 0 ^ { \frac { 4 \times 1 } { d _ { t } } t } , \cdot \cdot \cdot , 1 0 ^ { \frac { 4 \times ( d _ { t } - 1 ) } { d _ { t } } t } \right] .
|
| 248 |
+
$$
|
| 249 |
+
|
| 250 |
+
We set $d _ { t } = 6 4$ in experiments. Then, we use two fully-connected (FC) layers to transform $\phi _ { \mathrm { e m b } } ( t )$ into a 512 dimensional embedding vector (Ho et al., 2020). The first FC layer has input dimension $2 d _ { t } = 1 2 8$ and output dimension 512. The second FC layer has input dimension 512 and output dimension 512. Both layers are followed by the Swish activation function (Ramachandran et al., 2017).
|
| 251 |
+
|
| 252 |
+
# A.2 NEIGHBOR DEFINITION
|
| 253 |
+
|
| 254 |
+
In the Set Abstraction module and the Feature Transfer module, the neighbors are defined as the points that are within a specified distance to the center point. If a center point has more than $K$ neighbors, we randomly select $K$ neighbors from its neighbors. If a center point has less than $K$ neighbors, we pad it with dummy neighbors that has the same position as the center point, and has features of zeros. These dummy neighbors are excluded from the max-pooling operation. And in the attention mechanism, the weights of the dummy neighbors are manually set to 0. In this way, we can guarantee that a center point can always find $K$ neighbors. We set $K = 3 2$ in the Set Abstraction module and the Feature Transfer module. In the 4 levels of the Set Abstraction modules, the neighboring distance are set to 0.1, 0.2, 0.4, 0.8, respectively. In the 9 Feature Transfer modules, the neighboring distance are set to $0 . 1 , 0 . 2 , 0 . 4 , 0 . 8 , 1 , 6 , 0 . 8 , 0 . 4 , 0 . 2 , 0 . 1$ , respectively. Coordinates of samples in all datasets are normalized to the range $[ - 1 , 1 ]$ .
|
| 255 |
+
|
| 256 |
+
In the Point Adaptive Deconvolution (PA-Deconv) modules of the Feature Propagation modules, the $K$ neighbors are defined as the $K$ nearest neighbors of the center point, and we set $K = 8$ for all Feature Propagation modules.
|
| 257 |
+
|
| 258 |
+
# A.3 PROBLEMS OF VANILLA POINTNET $^ { + + }$
|
| 259 |
+
|
| 260 |
+
Zhou et al. (2021) argue that PointNet $^ { + + }$ can not be used to train a DDPM. We observe the same phenomenon in our experiments. We find that this is because the density of the input noisy cloud $\bar { \boldsymbol { x } } ^ { t }$ is too low for large $t$ ’s. Recall that $\pmb { x } ^ { t } = \sqrt { \bar { \alpha } _ { t } } \pmb { x } ^ { 0 } + \sqrt { 1 - \bar { \alpha } _ { t } } \epsilon$ , where $\epsilon$ is a Gaussian noise. $\bar { \alpha } _ { t }$ goes to 0 for large $t$ ’s. This means $\mathbf { \boldsymbol { x } } ^ { t }$ is close to a Gaussian noise when $t$ is large. The density of a Gaussian noise is much lower than the complete point cloud $\pmb { x } ^ { 0 }$ . This is because points in $\mathbf { x } ^ { \mathrm { { 0 } } }$ concentrate on the surface of some object and $\mathbf { x } ^ { 0 }$ is normalized to the range $[ - 1 , 1 ]$ , while points from a standard Gaussian distribution could fill the whole space in the range of $[ - 3 , 3 ]$ .
|
| 261 |
+
|
| 262 |
+
PointNet++ is originally designed to process point clouds like $\mathbf { \boldsymbol { x } } ^ { 0 }$ . It’s selection of distances to define neighbors described in Appendix Section A.2 is suitable for point clouds that have the same level of density as $\mathbf { \boldsymbol { x } } ^ { 0 }$ , but can not handle point clouds close to a Gaussian noise. Indeed, we find the average number of neighbors for each point in the four levels of the Set Abstraction modules are 22.3984, 29.9133, 29.3266, 27.8375, respectively, for 10 random shapes sampled from the MVP dataset. In constrast, the average number of neighbors for each point in the four levels are $1 . 0 8 6 4 , 1 , 1 , 1$ for 10 random point clouds sampled from the Gaussian distribution. Note that each point itself is considered to be a neighbor of itself. This means most points do not have any neighbors besides itself in a Gaussian noise.
|
| 263 |
+
|
| 264 |
+
PointNet $^ { + + }$ only utilizes the relative positions of input points. The input feature of each point to the first Set Abstraction module is its relative position to the center point, which is subsampled from the original input points by farthest point sampling. No information can be extracted when points do not have neighbors. This is the reason why PointNet $^ { + + }$ can not be directly used to train a DDPM.
|
| 265 |
+
|
| 266 |
+
Our solution is to attach the absolute position of each point to its feature. This guarantees that a point at least can utilize its own position to decide which direction to move when it does not have neighbors. Afterall, a point cloud with large magnitude noises does not have many meaningful structures. There is not much information in the relative positions of points. Another solution is to change the definition of neighbors: From points within a specified distance to K-nearest neighbors. This guarantees that a point always has $K$ neighbors. We conduct experiments to compare these two solutions, and we find that their performances are basically the same. Therefore, we just stick to the original neighbor definitions in PointNet++.
|
| 267 |
+
|
| 268 |
+
# A.4 ATTENTION MECHANISM
|
| 269 |
+
|
| 270 |
+
In Section 3.2 in the main text, we mentioned that we use the attention mechanism instead of maxpooling to aggregate features at the neighboring points to the center point. We take the Set Abstraction module as an example to elaborate on the attention mechanism. Attention mechanism in the Feature Propagation module and Feature Transfer module is similarly designed.
|
| 271 |
+
|
| 272 |
+
Assume we want to propagate features from $\{ x _ { j } | 1 \le j \le N _ { l } \}$ to $\{ y _ { k } | 1 \le k \le N _ { l + 1 } \}$ . Each point in $\{ x _ { j } | 1 \le j \le N _ { l } \}$ has a feature of dimension $d _ { l }$ . We concatenate these features with their corresponding 3D coordinates and group them together to form a matrix $\pmb { F } _ { l }$ of shape $N _ { l } \times ( d _ { l } + 3 )$ . We finds $K$ neighbors in the input set $\bar { \{ x _ { j } \vert 1 \leq \bar { j } } \leq N _ { l } \}$ for each $y _ { k }$ . These neighbors together with their features are grouped together to form a matrix $G _ { i n }$ of shape $N _ { l + 1 } \times K \times ( d _ { l } + 3 )$ . Then a shared multi-layer perceptron (MLP) is applied to transform the grouped feature $G _ { i n }$ to $G _ { o u t }$ , which is a matrix of shape $N _ { l + 1 } \times K \times d _ { l + 1 }$ and $d _ { l + 1 }$ is the dimension of the output feature.
|
| 273 |
+
|
| 274 |
+
In our attention mechanism, $G _ { i n }$ (shape $N _ { l + 1 } \times K \times ( d _ { l } + 3 ) )$ will act like keys, $G _ { o u t }$ (shape $N _ { l + 1 } \times K \times d _ { l + 1 } )$ will act like values, while the original features at $\{ y _ { k } | 1 \le k \le N _ { l + 1 } \}$ will act like queries. Since $\{ y _ { k } | 1 \le k \le N _ { l + 1 } \}$ is a subset of $\{ x _ { j } | 1 \le j \le N _ { l } \}$ , we can group the original features at $\{ y _ { k } | 1 \le k \le N _ { l + 1 } \}$ to form a matrix $Q$ , which is of shape $N _ { l + 1 } \times ( d _ { l } + 3 ) . 6$ $Q$ is first repeated $K$ times into a matrix of shape $N _ { l + 1 } \times K \times ( d _ { l } + 3 )$ . Then this matrix is passed through a shared MLP and transformed into a matrix $\pmb { Q } ^ { \prime }$ , which is of shape $N _ { l + 1 } \times K \times d _ { q u e r y }$ . Next, we pass $G _ { i n }$ through a shared MLP to transform it into a new matrix ${ \bf { { G } } } _ { i n } ^ { \prime }$ , which is of shape $N _ { l + 1 } \times K \times d _ { k e y }$ . We concatenate the query matrix $\pmb { Q } ^ { \prime }$ with the key matrix ${ \bf { { G } } } _ { i n } ^ { \prime }$ along the feature dimension. We denote this matrix as $[ \bar { Q ^ { \prime } } , \bar { G } _ { i n } ^ { \prime } ]$ , which is of shape $N _ { l + 1 } \times K \stackrel { \cdots } { \times } ( d _ { q u e r y } + d _ { k e y } )$ . $[ Q ^ { \prime } , G _ { i n } ^ { \prime } ]$ is passed through a shared MLP to obtain the scores of all the $K$ neighbors. We denote the scores as matrix $_ { s }$ of shape $N _ { l + 1 } \times K \times d _ { l + 1 }$ . Note that $_ { s }$ has the same shape as $G _ { o u t }$ . And the scores $\pmb { S }$ of the $K$ neighbors are adaptively computed according to the feature at the center point $y _ { k }$ and features at its $K$ neighbors $\{ x _ { j } | j \in B _ { x } ( y _ { k } ) \}$ . We apply a softmax operation along the neighbor dimension (the second dimension) of $_ { s }$ to obtain the weight matrix of all the $K$ neighbors. We denote it as $W$ , which is of shape $N _ { l + 1 } \times K \times d _ { l + 1 }$ . Note that we manually set the weights of the padded dummy neighbors to 0 in $W$ . Then the weight matrix $W$ and the value matrix $G _ { o u t }$ are dot producted along the neighbor dimension (the second dimension) to form the output matrix ${ \pmb F } ^ { \prime }$ , which is of shape $N _ { l + 1 } \times d _ { l + 1 }$ . Finally, $\pmb { F } ^ { \prime }$ is concatenated with the 3D coordinates of the set $\{ y _ { k } | 1 \le k \le N _ { l + 1 } \}$ to form output of the Set Abstraction module, $\mathbf { \Delta } F _ { l + 1 }$ , which is a matrix of shape $N _ { l + 1 } \times ( d _ { l + 1 } + 3 ) .$
|
| 275 |
+
|
| 276 |
+
# A.5 PROBLEMS WITH THREE INTERPOLATION
|
| 277 |
+
|
| 278 |
+
The original PointNet $^ { + + }$ uses three interpolation to upsample features in the Feature Propagation module. We think that the three interpolation operation is suitable for tasks like point cloud part segmentation, but not suitable in our task. Interpolation means that points close to each other have similar features. Points close to each other tend to have similar semantic labels in a clean point cloud, therefore it is meaningful to use interpolation operation to upsample features in the part segmentation task. However, in our task, the network need to predict a per-point displacement for all points in a noisy point cloud and move it towards a clean point cloud. Points close to each other do not need to move in a similar direction in general. In fact, they may just need to move towards the opposite direction to form a smooth surface.
|
| 279 |
+
|
| 280 |
+
We also find that the three interpolation operation lacks the ability to manipulate positions of points accurately in small scales. We first elaborate on the three interpolation operation used in the original PointNet $^ { + + }$ . Assume we want to upsample features at $\{ y _ { k } | 1 \stackrel { \cdot } { \leq } k \leq \dot { N } _ { l + 1 } \}$ to $\{ x _ { j } | 1 \le j \le \mathsf { \bar { N } } _ { l } \}$ , where $\{ y _ { k } | 1 \le k \le N _ { l + 1 } \}$ is a subset of $\{ x _ { j } | 1 \le j \le \dot { N _ { l } } \}$ .
|
| 281 |
+
|
| 282 |
+
For each $x _ { j }$ , assume its three nearest neighbors in $\{ y _ { k } | 1 \le k \le N _ { l + 1 } \}$ are $\{ y _ { k } | k \in B _ { y , 3 } ( x _ { j } ) \}$ . Then feature at $x _ { j }$ is obtained through the following equation:
|
| 283 |
+
|
| 284 |
+
$$
|
| 285 |
+
f ( x _ { j } ) = \frac { \sum _ { k \in \mathcal { B } _ { y , 3 } ( x _ { j } ) } w ( y _ { k } , x _ { j } ) f ( y _ { k } ) } { \sum _ { k \in \mathcal { B } _ { y , 3 } ( x _ { j } ) } w ( y _ { k } , x _ { j } ) } , \mathrm { ~ w h e r e ~ } w ( y _ { k } , x _ { j } ) = \frac { 1 } { | | y _ { k } - x _ { j } | | ^ { 2 } } ,
|
| 286 |
+
$$
|
| 287 |
+
|
| 288 |
+
$f ( y _ { k } )$ and $f ( x _ { j } )$ are features at $y _ { k }$ and $x _ { j }$ , respectively. We can see that the value of $f ( x _ { j } )$ is determined by the relative distances between itself and its three nearest neighbors. However, in 3D space, the point that has a specific relative distances to three fixed points is not unique. In fact, the point can move freely on a curve.
|
| 289 |
+
|
| 290 |
+
Let’s take a very simple example, assume the three nearest neighbors of $x _ { j }$ forms a regular triangle. If we move $x _ { j }$ along the straight line that passes the center of the triangle and is perpendicular to the plane determined by the triangle, then $x _ { j }$ will always have the same relative distances from the three points, which means $x _ { j }$ will always have the same interpolated feature, as long as its movement is small enough that its three nearest neighbors do not change.
|
| 291 |
+
|
| 292 |
+
This property makes the three interpolation operation not able to distinguish some specific points in a small scale, since these points could have the same interpolated value. Therefore, three interpolation operation is not suitable for our task, as we need to accurately manipulate positions of points to make them form a meaningful shape with smooth surfaces and sharp details.
|
| 293 |
+
|
| 294 |
+
# B EXPERIMENT
|
| 295 |
+
|
| 296 |
+
# B.1 DETAILED EXPERIMENTAL SETUP
|
| 297 |
+
|
| 298 |
+
In all experiments, we use the Adam optimizer with a learning rate of $2 \times 1 0 ^ { - 4 }$ . For experiments of our PDR paradigm in Table 1 and Table 2 in the main text, we use data augmentation described in Appendix Section B.3. We train our Conditional Generation Network for 340 epochs, 200 epochs, and 500 epochs on the MVP, MVP-40, and Completion3D datasets, respectively. We save a checkpoint and evaluate the network’s performance on both the training set and the test set every 20 epochs. Since the generation process of DDPM is very slow, we randomly select 1600 samples from the training set and test set respectively for evaluation. (Test set of the Completion3D dataset has less than 1600 samples. Therefore, we use all samples in the test set for evaluation.) The checkpoint with the lowest CD loss is chosen as the best network. It is used to generate training data for the Refinement Network. We train the Refinement Network for 100 epochs, 150 epochs and 200 epochs on the MVP, MVP-40, and Completion3D datasets, respectively.
|
| 299 |
+
|
| 300 |
+
Note that we subsampling the test set only when we try to choose a best checkpoint in the training process of the conditional generation network in DDPM. After choosing the best checkpoint, we use it to generate training data to train the refinement network. However, when we evaluate the whole PDR paradigm (composed of the conditional generation network and refinement network) and compare with previous methods, we evaluate them on the complete test set. Therefore, the comparison result in Table 1 and Table 2 in the main text is reliable and fair.
|
| 301 |
+
|
| 302 |
+
For ablation studies in Table 3, the Conditional Generation Networks are trained without data augmentation for 300 epochs. All the Refinement Networks are trained on the same data generated by our proposed Conditional Generation Network trained with data augmentation. The Refinement Networks are trained for 100 epochs.
|
| 303 |
+
|
| 304 |
+
All baseline methods are rerun under the data augmentation described in Appendix Section B.3 according to their open source codes. And CD loss is chosen to train all the baseline methods.
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
Figure 6: Detailed network structure.
|
| 308 |
+
|
| 309 |
+
# B.2 DETAILS OF THE NETWORK STRUCTURE.
|
| 310 |
+
|
| 311 |
+
Detailed network structure is shown in Figure 6. We present the number of points and feature dimension in each level of the Feature Extraction network and the Denoise network. The distances to define neighbors are provided in Appendix Section A.2.
|
| 312 |
+
|
| 313 |
+
# B.3 DATA AUGMENTATION
|
| 314 |
+
|
| 315 |
+
We use rotation, mirror, translation, and scaling as data augmentation methods during training. Rotation is performed along the upward direction of the shapes. The upward direction is the $y$ -axis in MVP dataset and Completion3D dataset, while upward direction in the MVP-40 dataset is the $z$ - axis. And the rotation angle is uniformly sampled from the interval $[ - a , a ]$ , where $a$ is a predefined hyper-parameter that controls the magnitude of the rotation.
|
| 316 |
+
|
| 317 |
+
Mirror operation is performed with respect to the two planes that are parallel to the upward direction: $x = 0$ plane and $z = 0$ plane for MVP dataset and Completion3D dataset, $x = 0$ plane and $y = 0$ plane for MVP-40 dataset. The mirror operation is performed with a probability of $m / 2$ with respect to the two planes, respectively. $m$ is a predefined hyper-parameter the controls the probability of the mirror operation.
|
| 318 |
+
|
| 319 |
+
Same as some previous works (Wang et al., 2020; Xia et al., 2021), we observe that most objects in the MVP dataset and Completion3D dataset have reflection symmetry with respect to the $x y$ plane. Therefore, we mirror the partial input with respect to this plane and concatenate the mirrored points with the original partial input for these two datasets. We subsample this concatenated point cloud from 4096 points to 3072 points by farthest point sampling to obtain a uniform point cloud. We label the original points with 1 and the mirrored points with $- 1$ . This concatenated point cloud is feed to both the Conditional Generation Network and the Refinement Network, so that they could learn whether an object has reflection symmetry and determine whether to utilize the mirrored points according to their $- 1$ label.
|
| 320 |
+
|
| 321 |
+
Translation is achieved by adding a randomly sampled 3D vector to every point in the incomplete point cloud and the complete point cloud. Each component of the 3D translation vector is sampled from a Gaussian distribution with zero mean and standard deviation of $\sigma$ , where $\sigma$ is a predefined hyper-parameter the controls the magnitude of the translation operation.
|
| 322 |
+
|
| 323 |
+
We also randomly samples a scaling factor uniformly from the interval $[ \delta _ { l o w } , \delta _ { h i g h } ]$ when loading a training pair. The scaling factor is multiplied to the coordinates of all points in the incomplete point cloud and the complete point cloud.
|
| 324 |
+
|
| 325 |
+
We observe that data augmentations can prevent the network from overfitting on the training set, but could also lead to performance drop on the test set. Therefore, we use different data augmentation schemes to train the Conditional Generation Network in the DDPM and the Refinement Network. When training the Conditional Generation Network, we hope the network does not overfit on the training set, because we need it to generate training samples to train the Refinement Network. Therefore, we use data augmentations of large magnitudes to train the Conditional Generation Network. However, when training the Refinement Network, high performance is the top priority. Therefore, we use data augmentations of small magnitudes to train the Refinement Network. We also use data augmentation to train baseline methods. The data augmentations are the same ones that we use to train the Refinement Network. The details of the data augmentation is shown in Table 4.
|
| 326 |
+
|
| 327 |
+
Table 4: Data augmentations used in MVP, MVP-40 and Completion3D dataset by the conditional generation network, refinement network, and all baselines.
|
| 328 |
+
|
| 329 |
+
<table><tr><td rowspan="2"></td><td colspan="4">Conditional Generation Network</td><td colspan="4">Refinement Network and other Baselines</td></tr><tr><td>Rotation</td><td>Mirror</td><td>Translation</td><td>Scaling</td><td>Rotation</td><td>Mirror</td><td>Translation</td><td>Scaling</td></tr><tr><td>MVP</td><td>a =90°</td><td>m =0.5</td><td>σ=0.1</td><td>[1/1.2,1.2]</td><td>a=3°</td><td>m=0.5</td><td>σ = 0.005</td><td>[1/1.01,1.01]</td></tr><tr><td>MVP-40</td><td>a=0°</td><td>m = 0.5</td><td>σ=0</td><td>[1/1.2,1.2]</td><td>a =3°</td><td>m = 0.5</td><td>g= 0.005</td><td>[1/1.01,1.01]</td></tr><tr><td>Completion3D</td><td>a =10°</td><td>m =0.2</td><td>σ= 0.01</td><td>[0.66,1]</td><td>a=3°</td><td>m=0.1</td><td>σ = 0.005</td><td>[0.66,1]</td></tr></table>
|
| 330 |
+
|
| 331 |
+
# B.4 SCALE-INCONSISTENCY ISSUE OF THE COMPLETION3D DATASET
|
| 332 |
+
|
| 333 |
+
We find that many pairs of incomplete-complete point clouds have inconsistent scales in the Completion3D dataset. A few inconsistent examples are shown in Figure 7. Ideally, the incomplete point should overlap with the complete point cloud in 3D space, but many incomplete-complete pairs in the Completion3D dataset cannot overlap with each other due to inconsistent scales, which misleads the network training. Moreover, the scale-inconsistency issue also gives rise to unreliable evaluation results, as we expect the network to predict a complete point cloud of a consistent scale with the incomplete point cloud. Therefore, it is necessary to correct the scales of these pairs before using the dataset.
|
| 334 |
+
|
| 335 |
+

|
| 336 |
+
Figure 7: The first row shows some inconsistent pairs of the incomplete point cloud and complete point cloud from the Completion3D dataset. The second row are the corrected pairs by minimizing the one-side CD loss.
|
| 337 |
+
|
| 338 |
+
We leverage the one-side CD loss to identify and correct these pairs. For a consistent pair of the incomplete point cloud $C$ and complete point cloud $\boldsymbol { X }$ , the one-side CD loss should be very low:
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
\mathcal { L } _ { \mathrm { 1 - S i d e C D } } ( C , X ) = \frac { 1 } { | C | } \sum _ { c \in C } \operatorname* { m i n } _ { x \in X } | | c - x | | ^ { 2 } .
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
We find the correct scale of the incomplete point cloud by optimizing the following problem
|
| 345 |
+
|
| 346 |
+
$$
|
| 347 |
+
\operatorname* { m i n } _ { \delta } \mathcal { L } _ { \mathrm { 1 - S i d e } \mathrm { C D } } ( \delta C , X ) .
|
| 348 |
+
$$
|
| 349 |
+
|
| 350 |
+
This optimization problem is solved by using the python package scipy.optimize.fmin for every pair of point clouds in the Completion3D dataset. We consider the pairs with a scale factor $\delta$ greater than 1.05 or less than 0.95 as inconsistent pairs, and then correct its scale inconsistency by multiplying the scale factor $\delta$ to these incomplete point clouds. In the training set, we find $2 . { \dot { 8 } } 1 \%$ pairs are inconsistent. The inconsistent pairs are also discovered in the validation set. We can not verify the test set because the ground truth complete point cloud is not released.
|
| 351 |
+
|
| 352 |
+
We did not use the online Completion3D benchmark server to evaluate our method and previous methods for the following reasons: 1) the website server was out of service, as it gave no feedback for any submissions at the time we conduct this work; 2) the ground truth complete point clouds in test set of the Completion3D dataset are not released, and hence we can not verify whether this inconsistency problem is also present in the test set. Therefore, we use the test set provided in the work (Wang et al., 2020), which contains 1200 pairs of incomplete-complete point clouds for testing. It contains the same set of objects as the test set of the original Completion3D dataset. After correcting inconsistent pairs in this test set, we evaluate our method and previous methods on this revised test set to achieve fair and reliable comparisons.
|
| 353 |
+
|
| 354 |
+
# B.5 COMPLETE EXPERIMENT RESULTS FOR MVP-40 DATASET
|
| 355 |
+
|
| 356 |
+
In Table 1 in the main text, we only present the completion result at the missing ratio of $50 \%$ and $12 . 5 \%$ for the MVP-40 dataset. We present the complete experiment result on MVP-40 dataset including result at the $2 5 \%$ missing ratio in Table 5 below.
|
| 357 |
+
|
| 358 |
+
Table 5: Complete Point cloud completion results on MVP-40 dataset. The missing ratio is at $50 \%$ $2 5 \%$ and $1 2 . 5 \%$ , respectively. CD loss is multiplied by $1 0 ^ { 4 }$ . EMD loss is multiplied by $1 0 ^ { 2 }$ .
|
| 359 |
+
|
| 360 |
+
<table><tr><td rowspan=2 colspan=6>Method</td><td rowspan=1 colspan=1>MVP40 (50% missing)</td><td rowspan=1 colspan=1>MVP40 (25%6missing)</td><td rowspan=1 colspan=1>MVP40 (12.5% missing)</td></tr><tr><td rowspan=1 colspan=1>CD EMD F1</td><td rowspan=1 colspan=1>CD EMD F1</td><td rowspan=1 colspan=1>CD EMD F1</td></tr><tr><td rowspan=3 colspan=6>PCN (Yuan et al., 2018)TopNet (Tchapmi et al., 2019)FoldingNet (Yang et al., 2018)</td><td rowspan=1 colspan=1>39.67 6.37 0.581</td><td rowspan=1 colspan=1>34.40 6.21 0.606</td><td rowspan=1 colspan=1>32.566.18 0.619</td></tr><tr><td rowspan=1 colspan=1>48.52 8.75 0.506</td><td rowspan=1 colspan=1>42.3910.25 0.520</td><td rowspan=1 colspan=1>40.129.08 0.542</td></tr><tr><td rowspan=1 colspan=1>51.8911.66 0.441</td><td rowspan=1 colspan=1>45.99 9.85 0.475</td><td rowspan=1 colspan=1>46.038.93 0.480</td></tr><tr><td rowspan=3 colspan=3>MSN (Liu et al., 2020)Cascade (Wang et al., 2020)ECG (Pan,2020)</td><td rowspan=2 colspan=3>MSN (Liu et al., 2020)Cascade (Wang et al., 2020)</td><td rowspan=1 colspan=1>34.33 9.70 0.646</td><td rowspan=1 colspan=1>23.14 6.59 0.712</td><td rowspan=1 colspan=1>20.204.54 0.728</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>34.1615.40 0.635</td><td rowspan=1 colspan=1>29.13 8.16 0.647</td><td rowspan=1 colspan=1>26.735.71 0.657</td></tr><tr><td rowspan=1 colspan=3>ECG (Pan,2020)</td><td rowspan=1 colspan=2></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>34.0616.19 0.671</td><td rowspan=1 colspan=1>28.01 10.79 0.717</td><td rowspan=1 colspan=1>16.906.20 0.774</td></tr><tr><td rowspan=3 colspan=6>GRNet (Xie et al.,2020)PMPNet (Wen et al., 2021)VRCNet (Pan et al.,2021)</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>35.9912.33 0.589</td><td rowspan=1 colspan=1>25.84 8.43 0.626</td></tr><tr><td rowspan=2 colspan=1>25.4129.92 0.72125.7018.40 0.736</td><td rowspan=1 colspan=1>15.73 16.08 0.815</td><td rowspan=1 colspan=1>13.008.92 0.815</td></tr><tr><td rowspan=1 colspan=1>18.2810.96 0.776</td><td rowspan=1 colspan=1>14.205.90 0.807</td></tr><tr><td rowspan=1 colspan=6>PDR paradigm (Ours)</td><td rowspan=1 colspan=1>27.20 2.68 0.739</td><td rowspan=1 colspan=1>16.54 1.68 0.800</td><td rowspan=1 colspan=1>12.701.39 0.827</td></tr></table>
|
| 361 |
+
|
| 362 |
+
B.6 COMPLETE EXPERIMENT RESULTS FOR NETWORK ABLATION STUDY
|
| 363 |
+
|
| 364 |
+
Table 6: Comparison of coarse point clouds generated by conditional generation networks of different structures on MVP dataset at the resolution of 2048 points. Experiments are conducted under two circumstances: with and without data augmentation. The networks without data augmentation are trained for 300 epochs, and networks with data augmentation are trained for 600 epochs. The data augmentation we use is specified in Table 4 for the MVP dataset. We report the networks’ performance on both the training set and the test set. We can see the overfitting problem is largely mitigated by data augmentation.
|
| 365 |
+
|
| 366 |
+
<table><tr><td rowspan=2 colspan=1>Model</td><td rowspan=2 colspan=3>DataAugmentation</td><td rowspan=1 colspan=1>CD</td><td rowspan=1 colspan=1>EMD</td><td rowspan=1 colspan=1>F1</td></tr><tr><td rowspan=1 colspan=1>Train Test</td><td rowspan=1 colspan=1>TrainTest</td><td rowspan=1 colspan=1>Train Test</td></tr><tr><td rowspan=1 colspan=1>Pointwise-netConcate xt & cPointNet++PA-DeconvPA-Deconv & Att.</td><td rowspan=1 colspan=3>X×XXX</td><td rowspan=1 colspan=1>6.96 11.999.96 10.796.44 9.395.85 8.815.56 8.71</td><td rowspan=1 colspan=1>0.88 1.631.57 1.540.84 1.380.73 1.340.70 1.29</td><td rowspan=1 colspan=1>0.3280.2650.3970.3820.3970.3550.4250.3790.4430.389</td></tr><tr><td rowspan=4 colspan=1>Pointwise-netConcate xt &cPointNet++PA-DeconvPA-Deconv & Att.</td><td rowspan=1 colspan=3>√√</td><td rowspan=1 colspan=1>11.3012.6914.5216.31</td><td rowspan=1 colspan=1>1.33 1.611.90 1.99</td><td rowspan=1 colspan=1>0.2620.2460.4140.395</td></tr><tr><td rowspan=1 colspan=2></td><td rowspan=1 colspan=2>【</td><td rowspan=1 colspan=1>9.86 11.18</td><td rowspan=1 colspan=1>1.43 1.74</td><td rowspan=1 colspan=1>0.4020.376</td></tr><tr><td rowspan=2 colspan=3>←<</td><td rowspan=1 colspan=1>←</td><td rowspan=1 colspan=1>9.22 10.78</td><td rowspan=1 colspan=1>1.24 1.50</td><td rowspan=1 colspan=1>0.4070.381</td></tr><tr><td rowspan=1 colspan=1>7.98 9.24</td><td rowspan=1 colspan=1>1.03 1.32</td><td rowspan=1 colspan=1>0.4360.409</td></tr></table>
|
| 367 |
+
|
| 368 |
+
In Section 5.3 in the main text, we conduct ablation study of our proposed network architecture, and results are shown in Table 3. Note that the conditional generation networks in DDPM in Table 3 are trained without data augmentation. However, it is actually very important to train the conditional generation networks with data augmentation, because we need to prevent it from overfitting on the training set, so that they can generate coarse point clouds of consistent distribution on the training set and test set to train the refinement network. Therefore, we provide the training results with data augmentation in Table 6. The data augmentation is specified in Table 4 for MVP dataset.
|
| 369 |
+
|
| 370 |
+
Same as Table 3 in the main text, “PA-Deonv & Att.” is our proposed complete network shown in Figure 2. “PA-Deonv” is our network without attention mechanism. “PointNet $+ + { } ^ { \because }$ further removes the PA-Deconv module. “Concate $\mathbf { \boldsymbol { x } } ^ { t }$ & $c ^ { \prime \prime }$ removes FT modules. It concatenates $^ c$ with $\mathbf { \boldsymbol { x } } ^ { t }$ as Zhou et al. (2021) do, and feed them to a single PointNe $^ { + + }$ with attention mechanism and PA-Deconv. “Pointwise-net” only utilizes a global feature extracted from the incomplete point cloud. We can see that these proposed modules indeed improve the networks’ performance. Our proposed networks achieve superior results both with and without data augmentation.
|
| 371 |
+
|
| 372 |
+
We also observe that networks generally achieve better performance on both the training set and test set without data augmentation, but they tend to overfit on the training set. This is undesirable because we need these conditional generation networks to generate training data for the refinement networks. It is very important for them to generate coarse point clouds that have consistent distributions on the training set and the test set. Indeed, we can see that the overfitting problem is largely mitigated in the presence of data augmentation.
|
| 373 |
+
|
| 374 |
+
# B.7 COMPLETE EXPERIMENT RESULTS FOR DDPM ACCELERATION
|
| 375 |
+
|
| 376 |
+
The complete experiment results of the DDPM acceleration is shown in Table 7. We can see that the quality of coarse point clouds generated by the accelerated DDPMs has dropped considerably. However, with the help of the Refinement Network, the performance drop of the final refined point clouds is slight. This demonstrates the strong refinement capability of our proposed network architecture shown in Figure 2 in the main text.
|
| 377 |
+
|
| 378 |
+
Table 7: Refine coarse point clouds generated by the accelerated DDPMs on the MVP dataset at the resolution of 2048 points. We can see performance drop is slight for the refined point clouds. We also report the average generation time of a single point cloud evaluated on one NVIDIA GEFORCE RTX 2080 Ti GPU for DDPM of different reverse steps.
|
| 379 |
+
|
| 380 |
+
<table><tr><td rowspan="2">Number of Reverse Steps</td><td rowspan="2">Average Generation Time</td><td colspan="2">CD</td><td colspan="2">EMD</td><td colspan="2">F1</td></tr><tr><td>Coarse</td><td>Refined</td><td>Coarse</td><td>Refined</td><td>Coarse</td><td>Refined</td></tr><tr><td>1000 (Original)</td><td>16.86 s</td><td>10.69</td><td>5.66</td><td>1.46</td><td>1.37</td><td>0.400</td><td>0.499</td></tr><tr><td>50</td><td>0.78 s</td><td>13.19</td><td>5.68</td><td>1.65</td><td>1.47</td><td>0.341</td><td>0.493</td></tr><tr><td>20</td><td>0.32 s</td><td>18.12</td><td>5.78</td><td>1.99</td><td>1.56</td><td>0.255</td><td>0.474</td></tr></table>
|
| 381 |
+
|
| 382 |
+

|
| 383 |
+
Figure 8: Our PDR paradigm demonstrates diversity in the completion results. For each object, the two images in the first row are coarse completion results from a trained DDPM generated in two trials for the same incomplete point cloud. The two images in the second row are refined results for the two coarse point clouds, respectively. We can see that some diversity is preserved after the refinement.
|
| 384 |
+
|
| 385 |
+
# B.8 GENERATION DIVERSITY OF THE PDR PARADIGM
|
| 386 |
+
|
| 387 |
+
In this section, we discuss whether the PDR Paradigm can generate diverse completion results for the same incomplete point cloud. Although there is no stochasticity in the refinement network, we find our PDR paradigm still demonstrates some kind of diversity in the completion results.
|
| 388 |
+
|
| 389 |
+
We know that DDPM itself is a probabilistic model and can generate diverse completion results. The refinement network receives a coarse completion from the DDPM and then refines it according to the condition point cloud, i.e., the incomplete point cloud. The final refined result surely depends on the condition point cloud, but also depends on the coarse point cloud received from the DDPM. The refinement network can only refine the coarse point cloud in a small scale, because we multiply the output of the refinement network by a small constant $\gamma = 0 . 0 0 1$ as described in Section 3.3 in the main text. Therefore, the overall sketch of the coarse point cloud will be preserved after the refinement. This explains why the PDR paradigm still bears low EMD loss as the DDPM, even though we use CD loss to train the refinement network, because the refinement network does not change the overall distribution of the coarse shape generated by DDPM.
|
| 390 |
+
|
| 391 |
+
Back to the diversity issue, if the coarse completion results from DDPM demonstrate diversity for the same incomplete point cloud, the refined point clouds will also demonstrate some diversity because the inputs to the refinement network are different. Figure 8 shows some examples where the PDR paradigm demonstrate diversity in the completion results.
|
| 392 |
+
|
| 393 |
+

|
| 394 |
+
Figure 9: Visual comparison of our method and other baselines. Samples are from the MVP dataset at the resolution of 16384 points. We can see that point clouds generated by our method generally have better visual quality.
|
| 395 |
+
|
| 396 |
+

|
| 397 |
+
Figure 10: Visual comparison of our method and VRCNet. Samples are from the MVP dataset at the resolution of 16384 points. We can see that VRCNet sometimes tend to predict more points to the parts that are known in the incompelte point cloud, while put less points at the missing part. This could effectively reduce CD loss, but leads to large EMD loss. Compared with VRCNet, our method generally generates more uniform point clouds.
|
| 398 |
+
|
| 399 |
+

|
| 400 |
+
Figure 11: Visual comparison of our method and PoinTr. Samples are from the MVP dataset at the resolution of 16384 points. We can see that PoinTr sometimes tend to predict more points at the skeleton of objects, while points on surfaces seem sparse. Compared with PoinTr, our method generally generates more uniform point clouds.
|
| 401 |
+
|
| 402 |
+

|
| 403 |
+
Figure 12: Visual comparison of coarse point clouds generated by the Conditional Generation Network in DDPM and point clouds after refinement. Samples are from the MVP dataset at the resolution of 2048 points. We can see that coarse point clouds generated by the Conditional Generation Network basically uniformly cover the overall shape of objects, but tend to be noisy. After refinement, point clouds demonstrate both good overall density distribution and sharp local details.
|
md/dev/zDiHoIWa0q1/zDiHoIWa0q1.md
ADDED
|
@@ -0,0 +1,306 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# OMNIGROK: GROKKING BEYOND ALGORITHMIC DATA
|
| 2 |
+
|
| 3 |
+
Ziming Liu, Eric J. Michaud & Max Tegmark Department of Physics, Institute for AI and Fundamental Interactions, MIT {zmliu,ericjm,tegmark}@mit.edu
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Grokking, the unusual phenomenon for algorithmic datasets where generalization happens long after overfitting the training data, has remained elusive. We aim to understand grokking by analyzing the loss landscapes of neural networks, identifying the dependence of the generalization gap on model weight norm as a cause of grokking. We refer to this as the "LU mechanism" because training and test losses (against model weight norm) typically resemble "L" and "U", respectively. This mechanism can explain many aspects of grokking: data size dependence, weight decay dependence, the emergence of representations, etc. Guided by the intuitive picture, we are able to induce grokking on tasks involving images, language and molecules, although the grokking signals are sometimes less dramatic. We attribute the dramatic nature of grokking for algorithmic datasets to representation learning.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Generalization lies at the heart of machine learning. A good machine learning model should arguably be able to generalize fast, and behave in a smooth/predictable way under changes of (hyper)parameters. Grokking, the phenomenon where the model generalizes long after overfitting the training set, has raised interesting questions after it was observed on algorithmic datasets by Power et al. (2022):
|
| 12 |
+
|
| 13 |
+
Q1 The origin of grokking: Why is generalization much delayed after overfitting? Q2 The prevalence of grokking: Can grokking occur on datasets other than algorithmic datasets?
|
| 14 |
+
|
| 15 |
+
This paper aims to answer these questions by analyzing neural loss landscapes:
|
| 16 |
+
|
| 17 |
+
A1 Grokking can result from a mismatch between training and test loss against model weight norm. Specifically, (reduced) training and test losses plotted against model weight norm resemble "L" and "U", respectively, as shown in Figure 1b. We refer to this phenomenon as the "LU mechanism", which we elaborate on in Section 2 and 3.
|
| 18 |
+
A2 Yes. Indeed, we demonstrate grokking for a wide range of machine learning tasks in Section 4, including image classification, sentiment analysis and molecule property prediction. Grokking signals observed for these tasks are usually less dramatic than for algorithmic datasets, which we attribute to representation learning in Section 5.
|
| 19 |
+
|
| 20 |
+
Partial answers to Q1 are provided in recent studies: Liu et al. (2022) attribute grokking to the slow formation of good representations, Thilak et al. (2022) attempts to link grokking to the slingshot mechanism of adaptive optimizers, and Barak et al. (2022) uses Fourier gap to describe hidden progress. This paper aims to understand grokking through the lens of neural loss landscapes. Our landscape analysis is able to explain many aspects of grokking: data size dependence, weight decay dependence, emergence of representations, etc.
|
| 21 |
+
|
| 22 |
+
The paper is organized as follows: In Section 2, we review background on generalization, and introduce the $L U$ mechanism. In Section 3, we show how the LU mechanism leads to grokking for a toy teacher-student setup. In Section 4, we show that the intuition gained from the toy problem can transfer to realistic datasets (MNIST, IMDb reviews and QM9), for which we also observe grokking, although in a slightly non-standard setup where it is relatively weak. In Section 5, we discuss why grokking is more dramatic for algorithmic datasets than on others (e.g., MNIST), by comparing their loss landscapes. We review related work in Section 6 and summarize our conclusions in Section 7. Code is available at https://github.com/KindXiaoming/Omnigrok.
|
| 23 |
+
|
| 24 |
+

|
| 25 |
+
Figure 1: (a) $w \colon L _ { 2 }$ norm of model weights. Generalizing solutions (green stars) are concentrated around a sphere in the weight space where $w \approx w _ { c }$ (green). Overfitting solutions (orange) populate the $w \gtrsim w _ { c }$ region. (b) The training loss (orange) and test loss (gray) have the shape of $\mathrm { L }$ and $\mathrm { U }$ , respectively. Their mismatch in the $w > w _ { c }$ region leads to fast-slow dynamics, resulting in grokking.
|
| 26 |
+
|
| 27 |
+
# 2 THE LU MECHANISM FOR GROKKING
|
| 28 |
+
|
| 29 |
+
Weight norm and reduced loss Letting w denote the weights of a model, any function $f ( \mathbf { w } )$ (e.g, train/test loss/accuracy) depends on both the weight norm $w \equiv | | \mathbf { w } | | _ { 2 }$ and the angular direction $\hat { \mathbf { w } } \equiv \mathbf { w } / w$ . Similar to Fort and Scherlis (2019), we define a reduced function $\tilde { f } ( w )$ by minimizing training loss $l _ { \mathrm { t r a i n } } ( \mathbf { w } )$ over angular directions, i.e.,
|
| 30 |
+
|
| 31 |
+
$$
|
| 32 |
+
\tilde { f } ( w ) \equiv f ( \mathbf { w } ^ { * } ( w ) ) , \quad \mathrm { w h e r e } \ \mathbf { w } ^ { * } ( w ) \equiv \underset { | | \mathbf { w } | | _ { 2 } = w } { \mathrm { a r g m i n } } \ l _ { \mathrm { t r a i n } } ( \mathbf { w } ) .
|
| 33 |
+
$$
|
| 34 |
+
|
| 35 |
+
In this paper, we set $f$ as train/test loss/error, but it also applies to other metrics of interest. In practice, we perform the constrained minimization by rescaling the model weights back to their original norm after each unconstrained optimization step. We will see that this reduced 1D loss landscape, which is easy to visualize, captures important features related to grokking. Throughout the paper, our model is initialized by multiplying a factor $\alpha \equiv w / w _ { 0 }$ to the standard initialization 1, where $w _ { 0 }$ and $w$ are the weight norm of the network before and after multiplying by $\alpha$ , respectively.
|
| 36 |
+
|
| 37 |
+
LU mechanism Although the loss landscapes of neural networks are nonlinear, Fort and Scherlis (2019) reveal a simple landscape picture: There is a spherical shell in the weight space (the "Goldilocks" zone), where generalization is better than outside this zone. We illustrate the Goldilocks zone as the green area with average radius $w _ { c }$ in Figure 1a; the green stars are the generalizing solutions. The test loss is thus higher either both when $w > w _ { c }$ and $w < w _ { c }$ , forming a U-shape against $w$ in Figure 1b (gray curve). By contrast, the training loss has an L-shape against weight norm . There are many solutions which overfit training data for $w > w _ { c }$ , but high training losses are incurred for $w < w _ { c }$ . This corresponds to the L-shaped curve seen in Figure 1b (orange curve, no regularization). In summary, the (reduced) training loss and test loss are L-shaped and U-shaped against weight norm, respectively, which we will refer to as the LU mechanism throughout the paper.
|
| 38 |
+
|
| 39 |
+
It is well known in statistics that generalization error has a "U" shape against model capacity, which is usually attributed to the bias-variance trade-off. Although this common wisdom was challenged by the observation of double descent (Nakkiran et al., 2021), the "U" curve can be recovered from a double descent simply by changing the $\mathbf { X }$ -axis from the number of model parameters $N$ to the 2-norm of model parameters $w \equiv | | \mathbf { w } | | _ { 2 }$ , at least for linear regression $\mathrm { N g }$ and Ma, 2022). Although the LU mechanism may remind readers of related phenomena (Schoenholz et al., 2016; Yang and Schoenholz, 2017; Nakkiran et al., 2021), their setups are not exactly the same as ours. More importantly, our focus and contribution is to understand grokking, a brand new generalization puzzle.
|
| 40 |
+
|
| 41 |
+
Grokking dynamics We identify the "LU mechanism" as the cause of grokking. If the weight norm is initialized to be large (e.g., the black square in the $w > w _ { c }$ region), the model first quickly moves to a nearby overfitting solution by minimizing the training loss. Without any regularization, the model will stay where it is, because the gradient of the training loss is almost zero along the valley of overfitting solutions, so generalization does not happen. Fortunately, there are usually explicit and/or implicit regularizations that can drive the weight vector towards the Goldilocks zone $w \approx w _ { c }$ . When the regularization magnitude is non-zero but small, the radial motion can be (arbitrarily) slow. If weight decay is the only source of regularization, and training loss is negligible after overfitting, then weight decay $\gamma$ causes $w ( t ) \approx \exp ( - \gamma t ) w _ { 0 }$ , when $w _ { 0 } > w _ { c }$ , so it takes time $t \approx \ln ( w _ { 0 } / w _ { c } ) / \gamma \propto \gamma ^ { - 1 }$ to generalize. A small $\gamma$ results in a huge generalization delay (i.e., grokking). The dependence on regularization magnitudes is illustrated in Figure 1b: no generalization at all happens for $\gamma = 0$ small $\gamma$ leads to slow generalization (grokking), and large $\gamma$ leads to faster generalization 2. The above analysis only applies to large initializations $w > w _ { c }$ . Small initializations $w < w _ { c }$ can always generalize fast 3, regardless of regularization.
|
| 42 |
+
|
| 43 |
+
Why isn’t grokking commonly observed? The standard initialization schemes typically initialize $w$ no larger than $w _ { c }$ . However, if we increase initialization scales (explicitly or implicitly), grokking can appear. In Section 3 and 4, we find that explicitly increasing initialization weight norm can induce grokking. In Section 5, we argue for algorithmic datasets because (shown in Figure 6d)
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
w _ { c } ( \mathrm { b a d ~ r e p r e s e n t a t i o n } ) > w _ { c } ( \mathrm { g o o d ~ r e p r e s e n t a t i o n } ) ,
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
i.e., a proper initialization for a bad representation is effectively too large for a good representation, leading to grokking. Take the addition (base $p$ ) for example: with the good (linear) representation or a bad (random) representation, the decoder needs to learn to classify $O ( p )$ or ${ \dot { O } } ( p ^ { 2 } )$ examples, respectively.
|
| 50 |
+
|
| 51 |
+
# 3 GROKKING FOR A TEACHER-STUDENT SETUP
|
| 52 |
+
|
| 53 |
+

|
| 54 |
+
Figure 2: Teacher-student setup. $\alpha$ : student initialization scale, $\gamma$ : weight decay. (a) The reduced training loss and test loss have the shape of “L" and “U", respectively. (b) Top row: large initialization ${ \ ' } \alpha = 2 . 0$ ) can demonstrate no generalization (no reg), grokking (small reg) and fast generalization (large reg). Bottom: small initialization $( \alpha = 0 . 5$ ) always generalizes fast, regardless of weight deacy. (c) $\alpha = 2$ . The steps to overfitting is independent of weight decay, while the steps to generalization scale inversely with the weight decay.
|
| 55 |
+
|
| 56 |
+
To illustrate how the LU mechanism results in grokking, we employ a toy teacher-student setup. The teacher and the student share the same architecture (a 5-100-100-5 MLP with tanh activation), but are initialized with different seeds. The student network is initialized with the standard initialization (the default one in PyTorch) but each weight is rescaled by the same factor $\alpha \equiv w / w _ { 0 }$ , where $w _ { 0 }$ and $w$ are the weight norm of the student network before and after rescaling. The teacher network is initialized standardly, i.e., $\alpha _ { \mathrm { t e a c h e r } } = 1$ . Inputs and outputs have dimensions $d _ { \mathrm { i n } } = 5$ and $d _ { \mathrm { o u t } } = 5$ respectively. We generate $N _ { \mathrm { t r a i n } } = 1 0 0$ training and $N _ { \mathrm { t e s t } } = 1 0 0$ test samples by first drawing inputs from the standard Gaussian distribution ${ \cal N } ( 0 , { \bf I } _ { d _ { \mathrm { i n } } \times d _ { \mathrm { i n } } } )$ , and then feed the input data to the teacher to generate output labels. The student network is trained with the Adam optimizer (learning rate $3 \check { \times } 1 0 ^ { - 4 } )$ for $1 { \dot { 0 } } ^ { 5 }$ steps.
|
| 57 |
+
|
| 58 |
+
LU landscapes Firstly, we compute the reduced losses by minimizing the training loss (excluding weight decay) while constraining the weight norm of the student network to be constant. We assume the converging point after training as the global minimum on the spherical surface 4, which explicitly defines the reduced losses $\tilde { l } _ { \mathrm { t r a i n } } ( \bar { \alpha } )$ and $\bar { l } _ { \mathrm { t e s t } } ( \alpha )$ . As shown in Figure 2a, $\tilde { l } _ { \mathrm { t e s t } } ( \alpha )$ first decreases and then increases as $\alpha$ increases, displaying a U-shape with a minimum at $\alpha \approx 1$ . By contrast, $\tilde { l } _ { \mathrm { t r a i n } } ( \alpha )$ decreases when $\alpha < 1$ and remains flat near zero when $\alpha \geq 1$ , forming an L-shape. When weight decay $\gamma$ is present, the training landscape becomes $\tilde { l } _ { \mathrm { t r a i n } } ( \alpha , \gamma ) = \tilde { l } _ { \mathrm { t r a i n } } ( \alpha ) + \gamma \alpha ^ { 2 } C ^ { 2 }$ where $C$ is the average parameter magnitude determined by the standard initialization.
|
| 59 |
+
|
| 60 |
+
Training dynamics Our problem is a regression task, but we can imitate the behavior of a classification task by manually setting a threshold $\beta = 0 . 0 1$ and defining a sample to be correctly “classified" if the prediction error is less than $\beta$ . We study the dynamics of training and test accuracy. Note that this is the normal training setup where the weight norm is not constrained, although with two non-standard initializations $\alpha = 0 . 5$ (small) and $\alpha = 2 . 0$ (large), and three weight decays $\gamma = 0$ (no reg), $\gamma = 0 . 0 3$ (small reg) and $\gamma = 1$ (large reg). As shown in Figure 2b (bottom), small initialization runs always generalize fast regardless of regularization. Large initialzation runs (top) dependend on weight decay: no regularization fails to generalize, small regularization generalizes slowly (grokking), while large regularization generalizes faster.
|
| 61 |
+
|
| 62 |
+
For the large initialization $\alpha = 2 . 0$ , we do a finer sweep of $\gamma$ in [0.03, 1]. We compute the number of steps and weight norm $w$ when training or test accuracy reaches $9 5 \%$ . As shown in Figure 2c, the time (number of steps) to reach $9 5 \%$ training accuracy is independent of weight decay $\gamma$ , while the time to reach $9 5 \%$ test accuracy is inversely proportional to the weight decay, as we derived above for the LU mechanism.
|
| 63 |
+
|
| 64 |
+
# 4 OMNIGROK: GROKKING FOR MORE INTERESTING TASKS
|
| 65 |
+
|
| 66 |
+
We now analyze loss landscapes and search for grokking for several more interesting datasets, and see that the insights obtained from our toy model can transfer to these datasets. We report the main results here, with experiment details included in Appendix A.
|
| 67 |
+
|
| 68 |
+
Image classification We visualize loss landscapes of MNIST (Deng, 2012) to verify the LU mechanism, and study the dependence on training data size. Similar to the teacher-student case, we reduce losses and errors (one minus accuracy) to two variables (weight norm $w$ and data size $N$ ) by minimizing over angular directions of weights, i.e.,
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\tilde { l } _ { \mathrm { t r a i n } } ( w , N ) \equiv l _ { \mathrm { t r a i n } } ( \mathbf { w } ^ { * } , N ) , \quad \tilde { l } _ { \mathrm { t e s t } } ( w , N ) \equiv l _ { \mathrm { t e s t } } ( \mathbf { w } ^ { * } , N ) , \quad \mathbf { w } ^ { * } ( w , N ) \equiv \operatorname * { a r g m i n } l _ { \mathrm { t r a i n } } ( \mathbf { w } , N ) ,
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
shown in Figure 3 (a)(b). The reduced loss landscape reveals three things: (1) Larger initializations lead to grokking. Point $\mathbf { A }$ in Figure 3 corresponds to the standard initialization $( \alpha = 1 )$ ), which has low training and test errors, hence no grokking. When increasing the weight norm from $\mathbf { A }$ to $\mathbf { B }$ , training error is seen to remain low while test error rises. To generalize, weight decay must be in place to bring the weight norm down, leading to grokking if weight decay is small. (2) Larger datasets lead to de-grokking. Comparing $\mathbf { B }$ and C in Figure 3, $\mathbf { C }$ is seen to have larger training size than $\mathbf { B }$ and lower test error. Larger data size $N$ makes the Goldilocks zone broader, reducing or eliminating grokking even for large weight initializations. (3) Critical data size can be defined. As reported in Power et al. (2022); Liu et al. (2022), we see that there exists a critical training set size below which generalization is impossible. The effective theory analysis in Liu et al. (2022) only applies to algorithmic datasets, but not to other datasets with unknown optimal representations. The loss landscape analysis presented is this work can apply to all supervised-learning tasks. As shown in Figure 3 (b), the contours of constant test error are thumb-like, and the tip of the thumb determines the minimum amount of data required for generalization.
|
| 75 |
+
|
| 76 |
+
Guided by the landscape analysis, we make two nonstandard decisions to induce grokking on MNIST: (1) we reduce the size of the training set from $6 0 \mathrm { k }$ to 1k samples (by taking a random subset) and (2) we increase the scale of the weight initialization distribution (by multiplying the initial weights, sampled with Kaiming uniform initialization, by a constant $\alpha > 1$ ). With these modifications to the training set size and initialization scale, we train a depth-3 width-200 MLP with ReLU activations with the AdamW optimizer using MSE loss with one-hot targets. We find that the network quickly fits the training set, and test accuracy improves much later, as shown in Figure 3d, just as in the stereotypical grokking learning first observed in algorithmic datasets. Figure 3e shows the effect of training set size on time to generalization for MNIST. We find a result similar to what Power et al. (2022) observed, namely that generalization time increases rapidly once one approaches a certain critical data set size. The conclusions still hold for the cross entropy loss (see Appendix F), although with quantitatively milder effects.
|
| 77 |
+
|
| 78 |
+

|
| 79 |
+
Figure 3: MNIST. (a) reduced training error, (b) reduced test error. Comparing A and B: larger weight norm makes learning grok (delay generalization). Comparing B and C: a larger training data size makes learning de-grok (speed up generalization). (c) "LU" holds truer for smaller data. (d) Accuracy curves for MNIST in the setting where we observe grokking. (e) Time to generalize as a function of training set size $N$ , replicating Liu et al. (2022).
|
| 80 |
+
|
| 81 |
+

|
| 82 |
+
Figure 4: We use an LSTM to predict IMDb reviews. (a) training error; (b) test error; (c) reduced losses for data size 1k (top) and $5 0 \mathrm { k }$ (bottom); (d) With 1k data, a (weak) grokking signal is observed for large initializations $\langle \alpha = 6 \rangle$ ), while no grokking is observed for standard initializations $( \alpha = 1 )$ ).
|
| 83 |
+
|
| 84 |
+

|
| 85 |
+
Figure 5: We use a GCNN to predict isotropic polarizability of molecules in the QM9 dataset. (a) training loss; (b) test loss; (c) reduced losses for data size 100 (top) and 3000 (bottom); (d) with 200 training samples, grokking is observed for large initialization $( \alpha = 3$ ).
|
| 86 |
+
|
| 87 |
+
Sentiment analysis of text We look for grokking using LSTMs (Hochreiter and Schmidhuber, 1997) for IMDb dataset (Maas et al., 2011). Similar to Eq. (3), we reduce training and test losses to depend on only the weight norm $w$ and data size $N$ . We show the reduced training and test error in Figure 4 (a)(b). For large data size, e.g., the full dataset, training and test errors have similar "U" shapes 5, so one cannot create grokking via the "LU" mechanism. For small data size, say 1k, however, the mismatch between training and test errors makes it possible to create grokking via large initializations. In Figure 4 (c), we initialize weights larger $( \alpha = 6$ ) with weight decay 1, overfitting is complete within $\mathrm { i 0 ^ { 2 } }$ steps, but generalization does not start until around $\mathrm { 1 0 ^ { 3 } }$ steps. Note that the generalization "jump" is not as sharp as on algorithmic datasets (Power et al., 2022) or MNIST, but at least generalization is delayed here. By contrast, if we use the standard initialization $( \alpha = 1$ ) with no weight decay, generalization happens early on during training, and does not improve much after overfitting.
|
| 88 |
+
|
| 89 |
+
Molecules We search for grokking using the graph convolutional neural network (GCNN) for QM9 dataset (Ramakrishnan et al., 2014). Similar to Eq. (3), we define the reduced training/test losses, which are only dependent on weight norm $w$ and data size $N$ . As shown in Figure 5(a)(b), when data size is large, training and test losses have similar "U" shapes, hence grokking is impossible via the "LU mechanism". When data size is small, training and test losses mismatch somewhere in the region $\alpha = w / w _ { 0 } > 1$ , making grokking possible. Indeed, shown in Figure 5(d), there is a sharp drop in test loss around $1 0 ^ { 4 }$ steps if initialization is 3 times larger than standard, while standard initialization does not lead to grokking. Note that zero weight decay is applied in both cases, implying the existence of implicit regularizations.
|
| 90 |
+
|
| 91 |
+
# 5 REPRESENTATION IS KEY TO GROKKING
|
| 92 |
+
|
| 93 |
+
In Section 4, we showed that increasing initialization scales can make grokking happen for standard ML tasks. However, this seems a bit artificial and does not explain why standard initialization leads to grokking on algorithmic datasets, but not on standard ML datasets, say MNIST. The key difference is how much the task relies on representation learning. For the MNIST dataset, the quality of representation determines whether the test accuracy is $9 5 \%$ or $100 \%$ ; by contrast in algorithmic datasets, the quality of representation determines whether test accuracy is random guess (bad representation) or $100 \%$ (good representation). So overfitting (under a bad representation) has a more dramatic effect on algorithmic datasets, i.e., the model weights increase quickly during overfitting but test accuracy remains low. During overfitting, model weight norm is much larger than at initialization, but then drops below the initialization norm when the model generalizes, shown in Figure 9 (see Appendix C), and also observed by Nanda et al. (2023).
|
| 94 |
+
|
| 95 |
+
In the following, we will compare algorithmic datasets (Section 5.1) to MNIST (Section 5.2). We show how their loss landscapes depend on representations differently, and how the difference leads to different outcomes (grokking or not).
|
| 96 |
+
|
| 97 |
+
# 5.1 ALGORITHMIC DATASETS
|
| 98 |
+
|
| 99 |
+
Setup Algorithmic datasets are the task of learning a binary operation $a \circ b = c ( a , b , c$ are symbols) with neural networks, which aim to predict $c$ from input $( a , b )$ . We take the toy addition setup in (Liu et al., 2022), where each input digit $0 \leq i \leq p - 1$ (output label $0 \leq k \leq 2 ( q - 1 ) )$ is embedded as a vector $\mathbf { E } _ { i }$ $( \mathbf { Y } _ { k } )$ . A decoder MLP is employed to predict $\mathbf { Y } _ { k } = \operatorname { D e c } ( \mathbf { E } _ { i } + \mathbf { E } _ { j } ) \left( k = i + j \right)$ . In the setup of grokking, both the decoder and the input representations ${ \bf R } \equiv \{ { \bf E } _ { i } \}$ are trainable, with learning rates $\eta _ { D }$ and $\eta _ { R }$ , respectively; in the setup of landscape analysis, only decoder is trainable, as we explain below. Training and test losses depend on three factors: (i) representation $\mathbf { R }$ , (ii) weight norm $w$ and (iii) weight direction wˆ . As in previous sections, we can optimize wˆ by minimizing the training loss on constant weight norm spheres. We further reduce the high-dimensional representations to 1D by interpolating in a particular direction:
|
| 100 |
+
|
| 101 |
+

|
| 102 |
+
Figure 6: Loss landscapes on the 2D $( w , m )$ plane. (a) Training loss splits the plane into two regions: large loss small $w$ (fast dynamics) and small loss large $w$ (slow dynamics). (b) Test loss; the green star is the generalizing solution. (c) Losses along an illustrative path $\mathrm { A } \mathrm { E }$ , demonstrating multiple descent; (d) zoom-in of the training loss highlighting the gradients on the boundary. (e) the boundary depends on training data size; (f) a simple illustration of grokking dynamics.
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
{ \bf R } = m { \bf R } _ { \mathrm { r a n d o m } } + ( 1 - m ) { \bf R } _ { \mathrm { l i n e a r } }
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
where $\mathbf { R } _ { \mathrm { l i n e a r } }$ refers to the linear representation in which number $k$ is embedded to $\mathbf { E } _ { k } = [ k , 0 , \cdots , 0 ]$ , $\mathbf { R } _ { \mathrm { r a n d o m } }$ is the initialized representation drawn from Gaussian distributions, i.e, $\mathbf { E } _ { k } \sim { \cal N } ( \mathbf { 0 } , \mathbf { I } )$ , and $m \in [ 0 , 1 ]$ is a scalar interpolating between $\mathbf { R } _ { \mathrm { l i n e a r } }$ and $\mathbf { R } _ { \mathrm { r a n d o m } }$ , that we term representation messiness because $\mathbf { R } = \mathbf { R } _ { \mathrm { l i n e a r } }$ when $m = 0$ , and $\mathbf { R } = \mathbf { R } _ { \mathrm { r a n d o m } }$ when $m = 1$ . After these reductions, both training and test losses become functions of two variables, representation messiness $m$ and weight norm $w$ :
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\mathbf { w } ^ { * } ( w , m ) \equiv \operatorname * { a r g m i n } _ { | | \mathbf { w } | | _ { 2 } = w } l _ { \mathrm { t r a i n } } ( \mathbf { w } , m ) , \quad \tilde { l } _ { \mathrm { t r a i n } } ( w , m ) \equiv l _ { \mathrm { t r a i n } } ( \mathbf { w } ^ { * } , m ) , \quad \tilde { l } _ { \mathrm { t e s t } } ( w , m ) \equiv l _ { \mathrm { t e s t } } ( \mathbf { w } ^ { * } , m )
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
Note that our definition of $\tilde { l } _ { \mathrm { t r a i n } } ( w , m )$ excludes the weight decay term $\begin{array} { r } { \ell _ { \mathrm { r e g } } = \frac { 1 } { 2 } \gamma w ^ { 2 } } \end{array}$ , but we should be aware of its presence when we analyze the dynamics of $( w , m )$ , which is governed by the gradient flow on $\tilde { l } _ { \mathrm { t r a i n } } ( w , m )$ plus weight decay $( \eta _ { R } / \eta _ { D }$ are learning rates of representation/decoder):
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\frac { d w } { d t } = - \eta _ { D } \left( { \frac { \partial \tilde { l } _ { \mathrm { t r a i n } } } { \partial w } } + \gamma w \right) , \quad \frac { d m } { d t } = - \eta _ { R } \frac { \partial \tilde { l } _ { \mathrm { t r a i n } } } { \partial m } .
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
More experimental details are included in Appendix E.
|
| 121 |
+
|
| 122 |
+
Landscape We show $\tilde { l } _ { \mathrm { t r a i n } } ( w , m )$ and $\tilde { l } _ { \mathrm { t e s t } } ( w , m )$ in Figures 6a and $^ \mathrm { 6 b }$ , indicating the generalizing solution with a green star. Based on the reduced training loss (Figure 6a), we can divide the 2D plane into two regions I and $\mathbf { I I }$ , separated by a dashed yellow line (the contour of training $\mathrm { l o s s } = 0 . 0 5 )$ ): (I): The darker region, with high training losses/gradients and small weight norm. $( \mathbf { I I } )$ : The lighter region, with low training losses/gradients and large weight norm. Comparing Figures 6a and 6b reveals that training and test loss landscapes differ, especially in region II. Moreover, while the training loss depends weakly on $m$ , the test loss depends strongly on $m$ . As we will see, the (weak) dependence of training loss on representation drives the model to the generalizing solution. However, the driving force is small because the dependence is weak, leading to grokking. We elaborate below how these particular loss landscapes lead to grokking.
|
| 123 |
+
|
| 124 |
+
Grokking dynamics In region $\mathbf { I I }$ , the dynamics is slow (for small $\gamma$ ) due to nearly vanishing gradients. By contrast, the dynamics in region I is relatively fast. As we will explain, dynamics is also slow on the boundary of I and $\mathbf { I I }$ , and grokking is the consequence of traversing region $\mathbf { I I }$ and/or the boundary.
|
| 125 |
+
|
| 126 |
+
Let us analyze a typical path $\mathbf { A }$ to $\mathbf { E }$ shown in Figure 6(a)(b). A rolls "downhill" to $\mathbf { B }$ following training gradients, possibly continuing to $\mathbf { C }$ due to momentum. $\mathbf { C }$ is located in $\mathbf { I I }$ where $\tilde { l } _ { \mathrm { t r a i n } } \approx \bar { 0 }$ , so according to Eq. (6), $d m / d t \approx 0$ and $d w / d t \approx - \eta _ { D } \gamma w$ or, equivalently, $d ( \log w ) / d t \approx - \eta _ { D } \gamma$ . So $( \log w , m )$ moves with a constant speed $v = \eta _ { D } \gamma$ in the $- w$ direction from C to $\mathbf { D }$ , a point near the boundary. Negative gradients around the boundary point towards larger $w$ and smaller $m$ , shown in Figure 6d (a zoom-in of Figure 6a). The gradients become increasingly large as the model goes deeper inside region I, and at some point, the gradient totally cancels out $v$ in the gradient direction, making the model start to drift along the boundary, as illustrated in Figure 6f. Then the model moves along the boundary with a new velocity $v ^ { \prime } = v \mathrm { { c o s } } \theta ^ { 6 }$ , until it reaches the generalizing solution $\mathbf { E }$ . The above picture is supported by empirical experiments in Appendix C and also Nanda et al. (2023). Based on the picture, we also show the ability to eliminate grokking in Appendix C.
|
| 127 |
+
|
| 128 |
+
The slow dynamics from $\mathbf { C }$ to $\mathbf { E }$ is the origin of grokking. During this period, the model first moves in the $- w$ direction with a velocity $v$ over the distance $L _ { 1 } = L - h \mathrm { c o t } \theta$ , and then moves along the boundary with a velocity $v ^ { \prime }$ over the distance $L _ { 2 } = h / \mathrm { s i n } \theta$ . So the total time is $t = L _ { 1 } / v + L _ { 2 } / v ^ { \prime } =$ $( L + h \mathrm { t a n } \theta ) / ( \eta _ { D } \gamma )$ . This formula agrees with the observation that large weight decays $\gamma$ and/or larger decoder learning rates $\eta _ { D }$ can make generalization happen faster (Power et al., 2022; Liu et al., 2022). Besides, the path manifests intriguing multiple descent of test loss, shown in Figure 6c.
|
| 129 |
+
|
| 130 |
+
Dependence of grokking on training data size Another important observation in Power et al. (2022) is that grokking happens faster for larger training size. Our landscape analysis can also explain the data size dependence. In Figure 6e, we show the contours (training $\mathrm { l o s s } = 0 . 0 2 $ ) for different training sizes (25, 35, 45, 55). The contours of training size 45 and 55 both connect to the green star, meaning that generalization will eventually happen. However, the slopes of the contours are different, i.e., $\theta _ { 5 5 } < \theta _ { 4 5 }$ . Since $t = ( L + h \mathrm { t a n } \bar { \theta } ) / ( \bar { \eta _ { D } } \gamma )$ increases as $\theta$ increases, we have $t _ { 5 5 } < t _ { 4 5 }$ , i.e, more training data leads to faster grokking. For training size 35 and 25, the contours do not connect to the green star, so generalization will not happen, no matter how long the training will be run.
|
| 131 |
+
|
| 132 |
+
# 5.2 MNIST
|
| 133 |
+
|
| 134 |
+
We now study how training and test losses depend on representation messiness in the MNIST dataset. We denote the $2 8 \times 2 8$ images as the raw representation $\mathbf { R } _ { \mathrm { r a w } }$ . We construct a linearly separable representation $\mathbf { R } _ { \mathrm { l i n e a r } }$ by assigning input representations proportional to their label $y _ { i }$ , for example, an image of a 2 is represented by a matrix with all elements being 2. Similar to Eq. (4), we use $m \in [ 0 , 1 ]$ to interpolated between $\mathbf { R } _ { \mathrm { r a w } }$ and $\mathbf { R } _ { \mathrm { l i n e a r } }$ :
|
| 135 |
+
|
| 136 |
+
$$
|
| 137 |
+
\mathbf { R } = m \mathbf { R } _ { \mathrm { r a w } } + ( 1 - m ) \mathbf { R } _ { \mathrm { l i n e a r } } ,
|
| 138 |
+
$$
|
| 139 |
+
|
| 140 |
+
Similarly to Eq. (5), we define and plot $\tilde { l } _ { \mathrm { t r a i n } } ( w , m )$ and $\tilde { l } _ { \mathrm { t e s t } } ( w , m )$ in Figure 7, using the full dataset $N = 6 0 0 0 0$ . Comparing Figures $\cdot$ and 7b reveals two things: (1) The training and test losses behave similarly; (2) Both training and test losses depend very weakly on $m$ . This implies that the raw image representation is already quite close to being optimal, so decent test accuracy can be obtained even without learning optimal representations. As a result, grokking does not occur (Figure 7c).
|
| 141 |
+
|
| 142 |
+
Comparing Figure 6 and 7, we see that the (strong) dependence of test performance on the representation is the key to grokking: the dependence on representation is strong for algorithmic datasets, so grokking happens. By contrast, the dependence is weak for MNIST, so grokking does not happen.
|
| 143 |
+
|
| 144 |
+

|
| 145 |
+
Figure 7: MNIST landscapes as functions of representation messiness $m$ and weight norm $w$ : (a) training loss, and (b) test loss. Training and test losses do not have significant mismatch, and neither of them depend on representation strongly, which is in stark contrast to algorithmic datasets (Figure 6). (c) an illustrative path $\mathrm { A \to B \to C }$ does not manifest grokking.
|
| 146 |
+
|
| 147 |
+
# 6 RELATION TO RELATED WORKS
|
| 148 |
+
|
| 149 |
+
Grokking was first observed for algorithmic datasets by Power et al. (2022). Several attempts have been made to understand grokking: (a) Liu et al. (2022) attributes grokking to the slow formation of good representations. (b) Shah (2021) suggests that generalizable solutions achieve lower loss than overfitting solutions, providing a training signal encouraging generalization. (c) Nanda et al. (2023) suggests grokking is a phase change due to limited data and regularization. (d) Barak et al. (2022) suggests that generalization is due not to random search, but to hidden progress of SGD to gradually amplify a Fourier gap. (e) Thilak et al. (2022) links grokking to the "Slingshot mechanism" specific to adaptive optimizers. (f) Millidge (2022) describes training as a random walk over parameters. Our conclusion supports (a)(b)(c)(d), but does not necessarily negate (e)(f).
|
| 150 |
+
|
| 151 |
+
Double descent is the phenomenon that performance first gets worse and then gets better as we increase the model size, data size, training epochs or regularization (Nakkiran et al., 2021; Yilmaz and Heckel, 2022; Nakkiran, 2019). The typical "U" shape of test loss in this paper does not conflict with double descent, because we are plotting the weight norm instead of the number of model parameters $\mathrm { N g }$ and Ma, 2022). However, the "U"-shape should better be considered as empirically common rather than provably universal. In fact, the interaction between properties of data and inductive biases of learning algorithms can be more complicated than double descent (Chen et al., 2021; d’Ascoli et al., 2020).
|
| 152 |
+
|
| 153 |
+
Initialization From the optimization perspective, initializations are usually based on the "edge of chaos" idea such that variance of features and gradients should be preserved in the forward and backward pass (Glorot and Bengio, 2010; He et al., 2015; Bahri et al., 2020; Yang and Schoenholz, 2017; Jing et al., 2017), or based on analyzing Jacobians and/or Hessians (Skorski et al., 2020). From the generalization perspective, it was shown that large initializations overfit data easily but result in poor generalization (Xu et al., 2019; Zhang et al., 2020), which agrees with our LU mechanism.
|
| 154 |
+
|
| 155 |
+
Weight decay regularization is a standard trick in machine learning and has various effects on optimization and generalization (Zhang et al., 2018; Van Laarhoven, 2017). In particular, Lewkowycz and Gur-Ari (2020) observes that it takes $t \propto 1 / \lambda$ training steps to reach maximum test performance. This is strikingly similar to the grokking time $t \propto 1 / \lambda$ we derived from the LU mechanism.
|
| 156 |
+
|
| 157 |
+
# 7 CONCLUSIONS
|
| 158 |
+
|
| 159 |
+
This study elucidates the grokking phenomenon from the perspective of loss landscapes. Our conclusions are: (i) grokking originates from the mismatch between training and test losses at high model weight norm ("LU" mechanism). (ii) grokking can happen in various models for a wide range of datasets, although the grokking signature is usually most dramatic for algorithmic datasets. (iii) The severity of grokking depends on how much the task relies on learning representations. This work not only reveals the mechanism of grokking, but also shows that reduced landscape analysis is a useful tool for characterizing data-model interaction and representation learning.
|
| 160 |
+
|
| 161 |
+
# REFERENCES
|
| 162 |
+
|
| 163 |
+
Alethea Power, Yuri Burda, Harri Edwards, Igor Babuschkin, and Vedant Misra. Grokking: Generalization beyond overfitting on small algorithmic datasets. arXiv preprint arXiv:2201.02177, 2022.
|
| 164 |
+
|
| 165 |
+
Ziming Liu, Ouail Kitouni, Niklas Nolte, Eric J Michaud, Max Tegmark, and Mike Williams. Towards understanding grokking: An effective theory of representation learning. arXiv preprint arXiv:2205.10343, 2022.
|
| 166 |
+
|
| 167 |
+
Vimal Thilak, Etai Littwin, Shuangfei Zhai, Omid Saremi, Roni Paiss, and Joshua Susskind. The slingshot mechanism: An empirical study of adaptive optimizers and the grokking phenomenon. arXiv preprint arXiv:2206.04817, 2022.
|
| 168 |
+
|
| 169 |
+
Boaz Barak, Benjamin L Edelman, Surbhi Goel, Sham Kakade, Eran Malach, and Cyril Zhang. Hidden progress in deep learning: Sgd learns parities near the computational limit. arXiv preprint arXiv:2207.08799, 2022.
|
| 170 |
+
|
| 171 |
+
Stanislav Fort and Adam Scherlis. The goldilocks zone: Towards better understanding of neural network loss landscapes. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 3574–3581, 2019.
|
| 172 |
+
|
| 173 |
+
Preetum Nakkiran, Gal Kaplun, Yamini Bansal, Tristan Yang, Boaz Barak, and Ilya Sutskever. Deep double descent: Where bigger models and more data hurt. Journal of Statistical Mechanics: Theory and Experiment, 2021(12):124003, 2021.
|
| 174 |
+
|
| 175 |
+
Andrew $\mathrm { N g }$ and Tengyu Ma. Cs229 lecture notes. https://cs229.stanford.edu/lecturesspring2022/main_notes.pdf, page 115, 2022.
|
| 176 |
+
|
| 177 |
+
Samuel S Schoenholz, Justin Gilmer, Surya Ganguli, and Jascha Sohl-Dickstein. Deep information propagation. arXiv preprint arXiv:1611.01232, 2016.
|
| 178 |
+
|
| 179 |
+
Ge Yang and Samuel Schoenholz. Mean field residual networks: On the edge of chaos. Advances in neural information processing systems, 30, 2017.
|
| 180 |
+
|
| 181 |
+
Li Deng. The mnist database of handwritten digit images for machine learning research. IEEE Signal Processing Magazine, 29(6):141–142, 2012.
|
| 182 |
+
|
| 183 |
+
Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735–1780, 1997.
|
| 184 |
+
|
| 185 |
+
Andrew L. Maas, Raymond E. Daly, Peter T. Pham, Dan Huang, Andrew Y. Ng, and Christopher Potts. Learning word vectors for sentiment analysis. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies, pages 142–150, Portland, Oregon, USA, June 2011. Association for Computational Linguistics. URL http: //www.aclweb.org/anthology/P11-1015.
|
| 186 |
+
|
| 187 |
+
Raghunathan Ramakrishnan, Pavlo O Dral, Matthias Rupp, and O Anatole von Lilienfeld. Quantum chemistry structures and properties of 134 kilo molecules. Scientific Data, 1, 2014.
|
| 188 |
+
|
| 189 |
+
Neel Nanda, Lawrence Chan, Tom Liberum, Jess Smith, and Jacob Steinhardt. Progress measures for grokking via mechanistic interpretability. arXiv preprint arXiv:2301.05217, 2023.
|
| 190 |
+
|
| 191 |
+
Rohin Shah. Alignment Newsletter #159. https:// www.alignmentforum.org/posts/zvWqPmQasssaAWkrj/ an-159-building-agents-that-know-how-to-experiment-by#DEEP LEARNING_, 2021.
|
| 192 |
+
|
| 193 |
+
Beren Millidge. Grokking ’grokking’. https://beren.io/ 2022-01-11-Grokking-Grokking/, 2022.
|
| 194 |
+
|
| 195 |
+
Fatih Furkan Yilmaz and Reinhard Heckel. Regularization-wise double descent: Why it occurs and how to eliminate it. In 2022 IEEE International Symposium on Information Theory (ISIT), pages 426–431. IEEE, 2022.
|
| 196 |
+
|
| 197 |
+
Preetum Nakkiran. More data can hurt for linear regression: Sample-wise double descent. arXiv preprint arXiv:1912.07242, 2019.
|
| 198 |
+
|
| 199 |
+
Lin Chen, Yifei Min, Mikhail Belkin, and Amin Karbasi. Multiple descent: Design your own generalization curve. Advances in Neural Information Processing Systems, 34:8898–8912, 2021.
|
| 200 |
+
|
| 201 |
+
Stéphane d’Ascoli, Levent Sagun, and Giulio Biroli. Triple descent and the two kinds of overfitting: Where & why do they appear? Advances in Neural Information Processing Systems, 33:3058–3069, 2020.
|
| 202 |
+
|
| 203 |
+
Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Proceedings of the thirteenth international conference on artificial intelligence and statistics, pages 249–256. JMLR Workshop and Conference Proceedings, 2010.
|
| 204 |
+
|
| 205 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Delving deep into rectifiers: Surpassing human-level performance on imagenet classification. In Proceedings of the IEEE international conference on computer vision, pages 1026–1034, 2015.
|
| 206 |
+
|
| 207 |
+
Yasaman Bahri, Jonathan Kadmon, Jeffrey Pennington, Sam S Schoenholz, Jascha Sohl-Dickstein, and Surya Ganguli. Statistical mechanics of deep learning. Annual Review of Condensed Matter Physics, 11(1), 2020.
|
| 208 |
+
|
| 209 |
+
Li Jing, Yichen Shen, Tena Dubcek, John Peurifoy, Scott Skirlo, Yann LeCun, Max Tegmark, and Marin Soljaciˇ c. Tunable efficient unitary neural networks (eunn) and their application to rnns. In ´ International Conference on Machine Learning, pages 1733–1741. PMLR, 2017.
|
| 210 |
+
|
| 211 |
+
Maciej Skorski, Alessandro Temperoni, and Martin Theobald. Revisiting initialization of neural networks. arXiv preprint arXiv:2004.09506, 2020.
|
| 212 |
+
|
| 213 |
+
Zhi-Qin John Xu, Yaoyu Zhang, and Yanyang Xiao. Training behavior of deep neural network in frequency domain. In International Conference on Neural Information Processing, pages 264–274. Springer, 2019.
|
| 214 |
+
|
| 215 |
+
Yaoyu Zhang, Zhi-Qin John Xu, Tao Luo, and Zheng Ma. A type of generalization error induced by initialization in deep neural networks. In Mathematical and Scientific Machine Learning, pages 144–164. PMLR, 2020.
|
| 216 |
+
|
| 217 |
+
Guodong Zhang, Chaoqi Wang, Bowen Xu, and Roger Grosse. Three mechanisms of weight decay regularization. arXiv preprint arXiv:1810.12281, 2018.
|
| 218 |
+
|
| 219 |
+
Twan Van Laarhoven. L2 regularization versus batch and weight normalization. arXiv preprint arXiv:1706.05350, 2017.
|
| 220 |
+
|
| 221 |
+
Aitor Lewkowycz and Guy Gur-Ari. On the training dynamics of deep networks with l_2 regularization. Advances in Neural Information Processing Systems, 33:4790–4799, 2020.
|
| 222 |
+
|
| 223 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 224 |
+
|
| 225 |
+
# Appendix
|
| 226 |
+
|
| 227 |
+
A EXPERIMENT DETAILS
|
| 228 |
+
|
| 229 |
+
Sentiment analysis of text IMDb (Maas et al., 2011) includes $5 0 \mathrm { k }$ movie reviews to be classified as being positive or negative. To pre-process the data, we extract the 1000 most frequent words and tokenize each review into an array of token indices. Less frequent words are ignored, and each review array is padded to length 500. We adopt the LSTM model (Hochreiter and Schmidhuber, 1997) to perform the classification, with two layers, embedding dimension 64, and hidden dimension 128. We use the Adam optimizer (Kingma and Ba, 2014) with learning rate 0.001 to minimize the binary cross entropy loss. We hold back $2 5 \%$ of the dataset for testing.
|
| 230 |
+
|
| 231 |
+
Molecules QM9 is a database for small molecules and their properties. We use a graph convolutional neural network (GCNN) to predict the isotropic polarizability. The GCNN contains 2 convolutional layers with ReLU activation, followed by a linear layer. We use the Adam optimizer with learning rate 0.001 to minimize the MSE loss. We split the dataset into 50/50 train/test.
|
| 232 |
+
|
| 233 |
+
MNIST We train width-200 depth-3 ReLU MLPs on the MNIST dataset with MSE loss. We use the AdamW optimizer with a learning rate of 0.001 and a batch size of 200.
|
| 234 |
+
|
| 235 |
+
# B REDUCED LOSS FOR MODULAR ADDITION WITH TRANSFORMERS
|
| 236 |
+
|
| 237 |
+
In Figure 8 we show reduced loss landscape plots for transformers trained on modular addition. We use the setup of Nanda et al. (2023) and train a 1-layer transformer on modular addition $( p = 1 1 3 )$ with $d _ { \mathrm { m o d e l } } = 1 2 8$ , 4 attention heads, and $d _ { \mathrm { m l p } } = 5 1 2$ with ReLU activations. We train with a learning rate of 0.001 while constraining model weight norm, for a variety of $\alpha$ and a variety of train set fractions. The LU shape holds for $\alpha \in [ 0 . 1 , 4 ]$ (some optimization issue may be responsible for the rise in train loss for $\alpha > 4$ ). We see the critical train set size is approximately 0.25, in line with earlier studies on grokking.
|
| 238 |
+
|
| 239 |
+

|
| 240 |
+
Figure 8: Reduced loss landscapes for transformers trained on modular addition, the original setting where grokking was observed.
|
| 241 |
+
|
| 242 |
+
# C WEIGHT NORM EVOLUTION OVER TIME ON ALGORITHMIC TASKS
|
| 243 |
+
|
| 244 |
+
Evolution of weight norm As mentioned in Section 5, the dynamics of model weight norm over the course of training, on algorithmic tasks, support the LU mechanism picture of grokking. Figure 9a, shows how model norm changes over time and we see that there is an initial increase in weight norm, which peaks during overfitting, but then drops during the period of generalization to be lower than the initialization norm. For this experiment, we again used the setup of (Nanda et al., 2023). We train with AdamW with a learning rate of 0.001 and weight decay $\gamma = 1$ .
|
| 245 |
+
|
| 246 |
+
Constraining a small weight norm eliminates grokking As shown in Figure $^ \mathrm { 9 b }$ , reducing the initialization scale $\alpha = 0 . 8$ ) and constraining optimization to hold model weight norm constant over training brings train accuracy and test accuracy learning curves together, almost eliminating grokking. We would like to investigate in future works whether this training trick can be helpful for more standard machine learning tasks.
|
| 247 |
+
|
| 248 |
+

|
| 249 |
+
Figure 9: Training 1L transformer on modular addition $( p = 1 1 3 )$ . (a) Weight norm, train accuracy, and test accuracy over time, initialized and trained normally. Weight norm first increases, and is highest during the period of overfitting, but then drops to become lower than initial weight norm when the model generalizes. (b) Constrained optimization at constant weight norm ( $\alpha = 0 . 8$ ) largely eliminates grokking, with test and train accuracy improving almost concurrently.
|
| 250 |
+
|
| 251 |
+
# D TIME TO GENERALIZE VERSUS WEIGHT DECAY
|
| 252 |
+
|
| 253 |
+
In our discussion of the “LU mechanism” as an explanation for grokking in Section 2, we predicted that the training time required for a model to generalize should be $t \propto \gamma ^ { - 1 }$ where $\gamma$ is the weight decay. To test this, we perform a grid search over weight decays $\gamma$ and plot the number of training steps required for models to reach a specified level of test accuracy in Figure 10a-10b. We also show full training curves for these runs in Figure 10c-10d. We perform experiments in two setups:
|
| 254 |
+
|
| 255 |
+
(a) Transformer on modular addition: We use the replication of grokking from Nanda et al. (2023) and train a 1-layer transformer on modular addition $p = 1 1 3$ and a train set fraction of 0.3) where $d _ { \mathrm { m o d e l } } = 1 2 8$ , with 4 attention heads, $d _ { \mathrm { m l p } } = 5 1 2$ , ReLU activations, and an AdamW learning rate of 0.001. From Figure 10a, we find that $t \propto \gamma ^ { - 1 }$ holds across roughly two orders of magnitude of $t$ and $\gamma$ . There is some seed dependence on the generalization time (some seeds consistently require longer to generalize), but for each seed (corresponding to a particular model initialization) the relation $\bar { t } \propto \gamma ^ { - 1 }$ appears to fit the data well.
|
| 256 |
+
|
| 257 |
+
(b) ReLU MLP on MNIST: We train ReLU MLPs on MNIST as described in Appendix A. We use an $\alpha = 9 . 0$ and train on a reduced training set of 1000 samples to delay generalization / induce grokking. From Figure 10b, we find that for $\gamma$ roughly between 0.1 and 1.0 the relation $t \propto \gamma ^ { - \bar { 1 } }$ holds. Very high values of weight decay seem to mess with optimization. On the other hand, with very low weight decay the model generalizes faster than naively expected, perhaps due to implicit regularization.
|
| 258 |
+
|
| 259 |
+
# E SECTION 5.1 SETUP
|
| 260 |
+
|
| 261 |
+
Architecture Similar to Liu et al. (2022), the decoder architecture is an MLP with hard coded addition. Each input symbol $i$ is encoded to a scalar $E _ { i }$ . Each output symbol $k$ is represented by a 30D random vector $\hat { \mathbf Y } _ { k }$ . We consider addition with base $p$ , so input $0 \leq i , j \leq p - 1$ and output $0 \leq k = i + j \leq 2 ( p - 1 )$ . We denote representation as $\mathbf { R } = \{ E _ { 0 } , E _ { 1 } \cdots , E _ { p - 1 } \}$ . The MLP has two hidden layers, with neurons 1-200-200-30 in each layer and ReLU activations. Given a training sample $( E _ { i } , E _ { j } ) \mathbf { Y } _ { k }$ where $i + j = k$ , the prediction of the MLP decoder is
|
| 262 |
+
|
| 263 |
+
$$
|
| 264 |
+
\mathbf { Y } _ { k } = \operatorname { D e c } _ { \mathbf { w } } ( E _ { i } + E _ { j } ) ,
|
| 265 |
+
$$
|
| 266 |
+
|
| 267 |
+
and the loss function being the mean squared error (MSE) between ${ \bf Y } _ { k }$ and $\hat { \mathbf Y } _ { k }$ , and w being the decoder weight. Although the common setup of grokking is to make both the representation $\mathbf { R }$ and
|
| 268 |
+
|
| 269 |
+

|
| 270 |
+
Figure 10: Time to generalize as a function of weight decay: we investigate to what extent the relation $t \stackrel { \bf { \breve { \mathbf { \alpha } } } } { \propto } \gamma ^ { - 1 }$ holds, where $t$ is number of training steps needed for the model to generalize and $\gamma$ is the AdamW weight decay. When a lower weight decay is used, models spend longer in the period of overfitting before eventually generalizing. We show the generalization time $t$ as a function of $\gamma$ in (a)-(b) and full training curves for these runs in (c)-(d).
|
| 271 |
+
|
| 272 |
+
<table><tr><td rowspan=2 colspan=1>Trainability</td><td rowspan=1 colspan=2>decoderweightw</td><td rowspan=1 colspan=2>Representation R</td></tr><tr><td rowspan=1 colspan=1>norm w=w2</td><td rowspan=1 colspan=1>direction w=w/w</td><td rowspan=1 colspan=1>messiness m</td><td rowspan=1 colspan=1>Other</td></tr><tr><td rowspan=1 colspan=1>Landscape analysis</td><td rowspan=1 colspan=1>No,w</td><td rowspan=1 colspan=1>Yes</td><td rowspan=1 colspan=1>No, m</td><td rowspan=1 colspan=1>No,0</td></tr><tr><td rowspan=1 colspan=1>Reduced trajectory</td><td rowspan=1 colspan=1>Yes</td><td rowspan=1 colspan=1>No,w*(w,m)</td><td rowspan=1 colspan=1>Yes</td><td rowspan=1 colspan=1>No,0</td></tr><tr><td rowspan=1 colspan=1>Full trajectory</td><td rowspan=1 colspan=1>Yes</td><td rowspan=1 colspan=1>Yes</td><td rowspan=1 colspan=1>Yes</td><td rowspan=1 colspan=1>Yes</td></tr></table>
|
| 273 |
+
|
| 274 |
+
Table 1: Threes setups used in this paper, with different set of parameters trainable.
|
| 275 |
+
|
| 276 |
+
the decoder w trainable, we will freeze part of them for easier analysis. This is where it could be a bit confusing, so we explicitly distinguish three setups: landscape analysis, reduced trajectory analysis and full trajectory analysis. Each setup have different subset of trainable parameters, as shown in Table 1.
|
| 277 |
+
|
| 278 |
+
Landscape analysis Both the representation $\mathbf { R }$ and weight norm $w$ are fixed. Only the weight direction wˆ is trainable. The representation $\mathbf { R }$ is fixed according to Eq. (4), which is dependent on $m$ the representation messiness. The decoder has fixed weight norm $w$ , but the weight direction wˆ is trainable. For each fixed $( w , m )$ , we minimize training loss over $\hat { \mathbf { w } }$ to get
|
| 279 |
+
|
| 280 |
+
$$
|
| 281 |
+
\hat { \mathbf { w } } ^ { * } ( w , m ) = \mathop { \mathrm { a r g m i n } } _ { \hat { \mathbf { w } } } \ell _ { \mathrm { t r a i n } } ( w , m , \hat { \mathbf { w } } ) ,
|
| 282 |
+
$$
|
| 283 |
+
|
| 284 |
+
and define reduced training and test loss, as in Eq. (5). The minimization is implemented by the Adam optimizer with learning rate $1 0 ^ { - 3 }$ for $1 0 ^ { 4 }$ steps. Although $( w , m )$ are not trainable, we repeat the above minimization independently for different $( w , m )$ . In Figure 6 (a)(b)(d), the background heatmaps belong to landscape analysis.
|
| 285 |
+
|
| 286 |
+
Reduced trajectory analysis is a “thought experiment" based on landscape analysis. Since full trajectory analysis can be intractable due to too high dimensions, we try to reduce the trajectory anaysis to 2D, by making two assumptions about the real dynamics: (1) Scale separation: the dynamics of $\hat { \mathbf { w } }$ is much faster than the dynamics along $w$ and along $m$ , such that $\hat { \mathbf { w } } ( t ) = \hat { \mathbf { w } } ^ { * } ( w ( t ) , \dot { m } ( t ) )$ is valid at every moment during training. (2) Representation evolution is linear, i.e., interpolating between initial random Gaussian and final linear representation. With these two assumptions, the training dynamics is effectively reduced to 2D, depending only on $( w , m )$ , obeying Eq. (6). In Figure 6 (a)(b)(c), the path $\mathrm { A } \mathrm { E }$ belongs to reduced trajectory analysis.
|
| 287 |
+
|
| 288 |
+
Admittedly the reduced trajectory may deviate from the full trajectory since the assumptions may not be met, but it can shed light on the full trajectory: the weight norm first increases and then increases, and the decrease of weight norm is highly correlated with generalization (please see Appendix C and Figure 9.
|
| 289 |
+
|
| 290 |
+
# F MNIST EXPERIMENTS WITH CROSS ENTROPY LOSS
|
| 291 |
+
|
| 292 |
+
To respond to a reviewer’s concern that our use of the MSE loss is the “secret" to get grokking on MNIST (Figure 3), we reran our experiments with the cross entropy (CE) loss. The results are qualitatively similar, with some quantitative differences.
|
| 293 |
+
|
| 294 |
+

|
| 295 |
+
Figure 11: MNIST with the cross entropy loss (as opposed to the MSE loss used in Figure 3). (a) reduced training error, (b) reduced test error. (c) "LU" still holds for the cross entropy loss, but the effect is milder than the MSE loss. In particular, the “Goldilocks zone" (the weight range where generalization happens) is broader.
|
| 296 |
+
|
| 297 |
+
# Landscape analysis
|
| 298 |
+
|
| 299 |
+
Comparing Figure 3 (MSE) and Figure 11 (CE), we notice the they are qualitatively similar: (1) for small datasets, the reduced training error and test error resemble an “L" and “U" against the weight norm, respectively; (2) for large datasets, the “U" becomes more like “L", i.e., the mismatch between the reduced training and test error is small. However, a quantitative difference exist: CE produces a broader “Goldilocks zone" (the weight range where generalization happens) than MSE. This implies that to induce grokking with CE, we need to increase the weight norm to a larger value (say $\alpha = 1 0 0 $ ).
|
| 300 |
+
|
| 301 |
+
# Training dynamics
|
| 302 |
+
|
| 303 |
+
We are able to observe delayed generalization during trianing on MNIST with cross entropy loss, but doing so requires a higher $\alpha$ than was necessary when using MSE loss, as predicted by the reduced loss landscapes in Figure 11. Figure 12 shows training trajectories from a 3-layer ReLU MLP on MNIST trained with cross entropy loss with $\alpha = 1 0 0$ and $D = 2 0 0$ . We see that test accuracy rises to $3 0 { - } 4 0 \%$ early in training, then plateaus for an extended period, before increasing to ${ \approx } 7 5 \%$ while train accuracy remains at $100 \%$ . While the dynamics are not as clean as with MSE loss, since test accuracy first plateaus at better-than-random accuracy, we think it is still fair to classify these dynamics as “grokking” due to the improvement in generalization late in training after a plateau.
|
| 304 |
+
|
| 305 |
+

|
| 306 |
+
Figure 12: Training curves using cross entropy loss on MNIST. We are still able to observe delayed generalization on MNIST using cross entropy loss, though test accuracy first plateaus at higher than random-guess accuracy.
|
md/dev/zSeoDvsDCe/zSeoDvsDCe.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|