Datasets:
Add files using upload-large-folder tool
Browse files- md/train/2VXyy9mIyU3/2VXyy9mIyU3.md +0 -0
- md/train/3g5KdPD8LIL/3g5KdPD8LIL.md +504 -0
- md/train/9uFiX_HRsIL/9uFiX_HRsIL.md +221 -0
- md/train/Aw96fN64soV/Aw96fN64soV.md +334 -0
- md/train/B1hYRMbCW/B1hYRMbCW.md +671 -0
- md/train/BJj6qGbRW/BJj6qGbRW.md +346 -0
- md/train/BJlgt2EYwr/BJlgt2EYwr.md +266 -0
- md/train/BkgnhTEtDS/BkgnhTEtDS.md +381 -0
- md/train/BkgzniCqY7/BkgzniCqY7.md +580 -0
- md/train/BkxthxHYvr/BkxthxHYvr.md +368 -0
- md/train/ByxhOyHYwH/ByxhOyHYwH.md +246 -0
- md/train/DktZb97_Fx/DktZb97_Fx.md +634 -0
- md/train/H1gpET4YDB/H1gpET4YDB.md +283 -0
- md/train/H1gsz30cKX/H1gsz30cKX.md +437 -0
- md/train/HJV1zP5xg/HJV1zP5xg.md +385 -0
- md/train/HJewiCVFPB/HJewiCVFPB.md +408 -0
- md/train/HJlSmC4FPS/HJlSmC4FPS.md +310 -0
- md/train/HJrDIpiee/HJrDIpiee.md +184 -0
- md/train/HkCjNI5ex/HkCjNI5ex.md +275 -0
- md/train/HkgeGeBYDB/HkgeGeBYDB.md +327 -0
- md/train/Hkxr1nCcFm/Hkxr1nCcFm.md +474 -0
- md/train/Hy6GHpkCW/Hy6GHpkCW.md +367 -0
- md/train/HyzMyhCcK7/HyzMyhCcK7.md +578 -0
- md/train/IXexLXymbZ9/IXexLXymbZ9.md +516 -0
- md/train/LwEQnp6CYev/LwEQnp6CYev.md +0 -0
- md/train/MXmmuhJYPdU/MXmmuhJYPdU.md +249 -0
- md/train/MuSYkd1hxRP/MuSYkd1hxRP.md +0 -0
- md/train/N1i6BJzouX4/N1i6BJzouX4.md +261 -0
- md/train/OGg9XnKxFAH/OGg9XnKxFAH.md +286 -0
- md/train/QjINdYOfq0b/QjINdYOfq0b.md +390 -0
- md/train/S1GkToR5tm/S1GkToR5tm.md +307 -0
- md/train/SJCscQcge/SJCscQcge.md +323 -0
- md/train/SJICXeWAb/SJICXeWAb.md +311 -0
- md/train/SK7A5pdrgov/SK7A5pdrgov.md +319 -0
- md/train/SkeuexBtDr/SkeuexBtDr.md +398 -0
- md/train/SkxbDsR9Ym/SkxbDsR9Ym.md +531 -0
- md/train/TmkN9JmDJx1/TmkN9JmDJx1.md +502 -0
- md/train/US-TP-xnXI/US-TP-xnXI.md +0 -0
- md/train/a-xFK8Ymz5J/a-xFK8Ymz5J.md +457 -0
- md/train/e12NDM7wkEY/e12NDM7wkEY.md +351 -0
- md/train/ebS5NUfoMKL/ebS5NUfoMKL.md +357 -0
- md/train/hu2aMLzOxC/hu2aMLzOxC.md +270 -0
- md/train/jh-rTtvkGeM/jh-rTtvkGeM.md +0 -0
- md/train/rh0vIXw6i33/rh0vIXw6i33.md +396 -0
- md/train/rkeZIJBYvr/rkeZIJBYvr.md +383 -0
- md/train/rkgPnhNFPB/rkgPnhNFPB.md +509 -0
- md/train/rylBK34FDS/rylBK34FDS.md +352 -0
- md/train/rylejExC-/rylejExC-.md +581 -0
- md/train/sy4Kg_ZQmS7/sy4Kg_ZQmS7.md +0 -0
- md/train/zx_uX-BO7CH/zx_uX-BO7CH.md +487 -0
md/train/2VXyy9mIyU3/2VXyy9mIyU3.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/3g5KdPD8LIL/3g5KdPD8LIL.md
ADDED
|
@@ -0,0 +1,504 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CUD-NET: Color Universal Design Neural Filter for the Color Weakness
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
1 Information on images should be visually understood to anyone, including the color
|
| 11 |
+
2 weakness. However, it is not recognizable if color that seems distorted to the color
|
| 12 |
+
3 weakness meets an adjacent object. We suggest CUD-NET1 based on convolutional
|
| 13 |
+
4 deep neural network to generate color universal design (CUD) images that satisfy
|
| 14 |
+
5 both color preservation and distinguishment of color for input images. CUD-NET
|
| 15 |
+
6 regresses the node point of the piecewise linear function based on information of
|
| 16 |
+
7 input images and comprises a specific filter per image. We present the following
|
| 17 |
+
8 methods to generate CUD images for the color weakness. First, we refine the CUD
|
| 18 |
+
9 dataset on specific criteria by color experts. Second, the input image information
|
| 19 |
+
10 is expanded through the pre-processing specialized on the color weakness vision.
|
| 20 |
+
11 Third, we suggest a multi-modal feature fusion architecture that combines features
|
| 21 |
+
12 to process expanded images. Finally, we suggest a deformable loss function by the
|
| 22 |
+
13 composition of the predicted image through the model to avoid the one-to-many
|
| 23 |
+
14 problems of the dataset.
|
| 24 |
+
|
| 25 |
+
# 15 1 Introduction
|
| 26 |
+
|
| 27 |
+
# 16 1.1 Motivation
|
| 28 |
+
|
| 29 |
+
17 The green and red color blindness are made up of $8 \%$ of males and $0 . 5 \%$ of females in Northern
|
| 30 |
+
18 European descent[Won11], which is almost up to rate of one person in 20 people. Green and red
|
| 31 |
+
19 blindness is the most common pattern, followed by blue, yellow, and total color blindness. In this
|
| 32 |
+
20 paper, we generate Color Universal Design (CUD) images, which are color weakness friendly design
|
| 33 |
+
21 forms, through deep learning around the aspect of the red color weakness (protanopia) and green
|
| 34 |
+
22 color weakness (deuteranopia) vision. Protanopia is insensitive to red color and deuteranopia is
|
| 35 |
+
23 insensitive to green color, although it varies depending on individual color weakness extent.
|
| 36 |
+
|
| 37 |
+
There are studies that help color discrimination to the color weakness, including wearable devices and surgeries[VZCR20]. However, since these research require time and cost, we simply generate CUD images with an image enhancement method based on deep learning to make the corresponding color visible for the color weakness. For an example of the left-above image $I$ in Figure 1, the people who are not color weakness can distinguish the letter $\cdot 5 '$ in the image. But as a deuteranopia vision in left-below image $I ^ { d }$ , the surrounding color and the letter $\cdot 5 '$ are very analogous, making it ambiguous to distinguish the bound of adjacent object. The right-bottom target image ${ \bf \bar { \boldsymbol { T } } } ^ { d }$ , refined image by color expert designers, shows that the letter $\cdot 5 '$ appeared well at the deuteranopia vision. Here, we define the non-CUD objects as the letter $\cdot 5 '$ and surroundings invisible to deuteranopia vision in the image $I$ , and define the CUD objects as the letter $\bullet _ { 5 } ,$ and surroundings visible to deuteranopia vision in the image $T$ . In other words, CUD object means that adjacent objects are distinguishable on both the
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
Figure 1: Comparisons of the non-CUD image, our CUD-NET’s predicted image, and CUD image. The above row is represented in normal vision, and below row is represented in deuteranopia vision.
|
| 41 |
+
|
| 42 |
+
35 normal vision and the color weakness vision. The non-CUD object means that adjacent objects are
|
| 43 |
+
36 distinguishable on normal vision but not the color weakness vision. Consequently, we generate $\hat { I }$ that
|
| 44 |
+
37 satisfies CUD with a specific filter to the image $I$ .
|
| 45 |
+
38 We want to apply as weak filter as possible to CUD objects to preserve color, which requires a
|
| 46 |
+
39 certain level of object comprehension mechanism to do so. There are various studies from classic
|
| 47 |
+
40 PCA[WEG87] to machine learning-based object segmentation methods[TSC20, $Z \mathrm { G L } ^ { * } 2 0 ]$ to define
|
| 48 |
+
41 specific objects or areas in image. The research on semantic segmentation, which even provides labels
|
| 49 |
+
42 between objects, seems that deep learning still does not have a complete comprehension of all objects
|
| 50 |
+
43 in the real-world. The visual question answering to arbitrary questions about object’s interactions,
|
| 51 |
+
44 the most general issue on comprehension of object, does not have high transmission power to be
|
| 52 |
+
45 practical uses $[ \mathrm { A H B ^ { * } } 1 8$ , $\mathrm { K Z G ^ { * } } 1 7$ , $\mathrm { L Y L } ^ { * } 2 0 ]$ . Therefore, we expand feature of the input image around
|
| 53 |
+
46 the information of color weakness vision and define the robust neural filter. In summary, we suggest
|
| 54 |
+
47 a CUD-NET that generates an image suitable for CUD, while complying with the color preservation
|
| 55 |
+
48 for the source image.
|
| 56 |
+
49 In this paper, we suggest the Color Universal Design Network (CUD-NET) to satisfy both color
|
| 57 |
+
50 preservation and contrast of non-CUD objects (CUD suitability). We introduce 4 core contributions
|
| 58 |
+
51 of CUD-NET.
|
| 59 |
+
|
| 60 |
+
• Dataset refinement criteria for CUD image We refine training data into two groups, the one with a simple color tone image based on H and $\mathrm { v }$ in the HSV color space, the other with two or more non-CUD objects that must be distinguished in publications. • Image pre-processing for CUD-NET We carry out pre-processing to expand the information of the input image. Input image $I$ is reconstructed with three expanded feature information with noise removed. Multi-modal feature fusion architecture We define a feature layer, the fusion layer, and a regression layer to handle pre-processed images. The three features from the feature extracting layer are combined into the one fusion feature, and finally a filter is constructed by regressing the node point of the piecewise linear function, or indicator of filter. • Variational loss function We suggest a deformable loss function by the composition of the predicted image through the model. Our data have a problem of one-to-many, where the specific color in input image $I$ is mapped into multiple colors in target image $T$ .
|
| 61 |
+
|
| 62 |
+
# 65 1.2 Related Works
|
| 63 |
+
|
| 64 |
+
66 Image-to-Image translation based on GAN GAN is used in various image translation areas,
|
| 65 |
+
67 including image generation, style transfer, and colorization[KWK21, IZZE17]. In a preliminary
|
| 66 |
+
68 experiment, Cycle-GAN[PEZZ20] has reached the best performance in maximizing the contrast of
|
| 67 |
+
69 non-CUD objects. However, our goal is to keep the color preservation of the input image as well,
|
| 68 |
+
70 so in the case of black color, which has lost all its color of the input image, it is considered the
|
| 69 |
+
71 worst case for color preservation. Enlighten-GAN[JGL $^ { * } 2 1$ ] complements those instability, enabling
|
| 70 |
+
72 them to generate more stable results on color preservation. But since most of the GAN-based image
|
| 71 |
+
73 translation fixes the size of the predicted image, reshaping a high-resolution image causes information
|
| 72 |
+
74 loss of source image. Also, it is difficult to reconstruct the complete geometry for the source image
|
| 73 |
+
75 as it generates images through the dilated convolution layer.
|
| 74 |
+
76 Image enhancement based on neural filter estimation Unlike GAN, there are researches that
|
| 75 |
+
77 scale the pixel values of images based on neural filter estimation $[ \mathrm { W } \mathrm { Z F ^ { * } } 1 9 $ , DLT18, BCPS19]. Zero
|
| 76 |
+
78 $\mathrm { D C E } [ \mathrm { G L G } ^ { * } 2 0 ]$ is a low-light image enhancement research that provides a brighter visual display
|
| 77 |
+
79 of input image. It estimates pixel-wise and high-order filter for dynamic range adjustment of input
|
| 78 |
+
80 images with lightweight deep network, DCE-Net. DeepLPF $\mathbf { M M M } ^ { * } 2 0 ]$ tried to solve the problem by
|
| 79 |
+
81 using a graduated filter, elliptical filter, and polynomial filter. The authors not only tried to visually
|
| 80 |
+
82 enhance the contrast of images but also to comprise stable filters that are easy to understand for
|
| 81 |
+
83 the spectators while keeping the color preservation. In our problem, however, the contrast factor is
|
| 82 |
+
84 almost same results as the input image in both visions, while complying the high color preservation,
|
| 83 |
+
85 resulting over-stable filter. It is assumed that the inability in comprehension of object’s interaction
|
| 84 |
+
86 leads to over-stable filter.
|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
Figure 2: The ideal color conversion of predicted image between contrast and color preservation. Non-CUD object $a$ should increase the gap compared to the input image and preserve its original color, while the CUD object $b$ maintain both contrast and color.
|
| 88 |
+
|
| 89 |
+
# 87 2 Methodology
|
| 90 |
+
|
| 91 |
+
88 We define the ideal predicted image as an increase in the contrast between non-CUD objects and the
|
| 92 |
+
89 color preservation for the input image. The non-CUD object $a$ should be mapped into $\acute { a }$ and CUD
|
| 93 |
+
90 object $b$ should preserve its color and contrast like an ideal example of Figure 2. However, as our
|
| 94 |
+
91 neural filter affects the whole pixels throughout the image, we have the constraint of applying the
|
| 95 |
+
92 same filter to objects $a$ and $b$ . It is very hard to make the contrast and color of object $b$ exactly the
|
| 96 |
+
93 same as before the filter adjustment while maximizing the contrast of object $a$ . Therefore, we propose
|
| 97 |
+
94 a deep learning-based regression to comprise the specific filter per image that maximizes the contrast
|
| 98 |
+
95 of object $a$ while minimizing the adjustment of features on object $b$ .
|
| 99 |
+
96 First, we propose a solution to maximize the contrast of the $\mathrm { L }$ channel values in CIELab color
|
| 100 |
+
97 space[RG19]. We empirically confirmed that protanopia and deuteranopia, which account for the
|
| 101 |
+
98 most proportion of color weakness, can distinguish the difference by $\mathrm { L }$ channel values in common
|
| 102 |
+
99 when the non-CUD objects are adjacent to each other. To illustrate Figure 1 again, the $\mathrm { L }$ channel
|
| 103 |
+
100 value of letter $^ { \bullet } 5 ^ { \bullet }$ in image $I$ is 61 and the surrounding color is 61. The distinguishment between
|
| 104 |
+
101 the two objects is easy to normal vision, however the image $I ^ { d }$ , the deuteranopia vision, is very
|
| 105 |
+
102 ambiguous. On the contrary, the CUD target image $T$ and $T ^ { d }$ have a difference of $\mathrm { L }$ channel value 75
|
| 106 |
+
103 for the letter $\bullet _ { 5 } ,$ and 45 for the surroundings, making it easy to distinguish between the normal and
|
| 107 |
+
104 the deuteranopia vision. Due to the characteristics of these data, we refine a data pair by defining a
|
| 108 |
+
105 criterion that separates two invisible non-CUD objects by $\mathrm { L }$ channel values.
|
| 109 |
+
106 Secondly, we propose a variational loss function and multi-modal feature fusion network for color
|
| 110 |
+
107 preservation. It can be said that the increase in the contrast of $\mathrm { L }$ channel values between non-CUD
|
| 111 |
+
108 objects is quantitatively superior, but not in the case of increasing the differences in color preservation
|
| 112 |
+
109 of input images. When non-CUD objects exist, as a simple example, the most likely way to maximize
|
| 113 |
+
110 contrast is to polarize the color of the object black and white. But it is the result of complete ignorance
|
| 114 |
+
111 for color preservation, so just enabling to distinguish between non-CUD objects is not always a good
|
| 115 |
+
112 answer. A strong filter must be applied to distinguish non-CUD object, but its impact should not be
|
| 116 |
+
113 too extensive to leading the loss of information in CUD objects. In this paper, we solve this problem
|
| 117 |
+
114 by taking an appropriate trade-off of color preservation and contrast of L channel value.
|
| 118 |
+
|
| 119 |
+
# 115 2.1 Dataset refinement criteria for CUD image
|
| 120 |
+
|
| 121 |
+
116 The training data is refined by two groups. The one is vectorized image with two colors divided
|
| 122 |
+
117 by value $\mathrm { v }$ and hue degree H in HSV color space[HMKO19], and the other is image with two
|
| 123 |
+
118 or more objects that must be distinguished while preserving the color of non-CUD objects. The
|
| 124 |
+
119 training data is grouped about 1,600 color combinations into the same V and then simulates them
|
| 125 |
+
120 with the deuteranopia vision, converting to the adjacent color family to comply color preservation.
|
| 126 |
+
121 All conversions are scaled within only S and V in HSV color space to increase at least 15 difference
|
| 127 |
+
122 in the L channel value of selected non-CUD objects. The colors are combined with the 10 essential H
|
| 128 |
+
123 and tones, and the similar color simulated with the deuteranopia vision was converted. Consequently,
|
| 129 |
+
124 the key part of refining training data is preservation of color, allowing the models to comply with the
|
| 130 |
+
125 same approach on learning.
|
| 131 |
+
|
| 132 |
+
# 2.2 Image pre-processing
|
| 133 |
+
|
| 134 |
+
127 Our model regresses node points of piecewise linear function, which will be described in the model
|
| 135 |
+
128 architecture section, and the final filter is a multiplication operation for the input image. Therefore,
|
| 136 |
+
129 the multiplication operations of less than the number 1 tend to fade the color saturation. The image
|
| 137 |
+
130 without color inversion converges the white color value to 1, so if the multiplying value is in the [0,
|
| 138 |
+
131 1] range, the white color is shifted to the black. By inverting the color of input image, it ignores the
|
| 139 |
+
132 multiplication operations for white value with 0.
|
| 140 |
+
133 We generate the map image $I ^ { m }$ based on original RGB input images calculating the difference value
|
| 141 |
+
134 between the image with an aspect of normal vision and the image with an aspect of deuteranopia vision.
|
| 142 |
+
135 Recent studies have been conducted to augment the information or expanded the models’ perspective
|
| 143 |
+
136 through transformer models[JSZK16, RFB15]. In our experiment, however, the transformer model
|
| 144 |
+
137 tends to generate the predicted image ignoring the source color, which result in the polarized color to
|
| 145 |
+
138 black and white like Cycle-GAN’s.
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
{ \cal I } ^ { m } = \vert i n v e r t ( I ^ { n } ) - i n v e r t ( I ^ { d } ) \vert
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
{ \cal I } ~ = ~ \delta \left( c a t ^ { c h a n n e l } \left( I ^ { n } , I ^ { d } , I ^ { m } \right) \right)
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+
139 After applying color inversion from the original RGB input image $I ^ { n }$ , we generate the image $I ^ { d }$ with
|
| 156 |
+
140 an aspect of deuteranopia vision in equation 1. From these two generated images, we can get the
|
| 157 |
+
141 absolute difference value to compose the map image $I ^ { m }$ . In equation 2, the final input $I$ concatenated
|
| 158 |
+
142 with $9 \times H \times W$ dimensions passes through the model. The $\bar { \delta } ( . )$ clips output to a range of [0, 1].
|
| 159 |
+
|
| 160 |
+
# 2.3 Model Architecture
|
| 161 |
+
|
| 162 |
+
144 CUD-NET regresses the node points of piecewise linear filter function from the input. The value
|
| 163 |
+
145 of each node points computes the multiplication operation and generates the predicted image. The
|
| 164 |
+
146 input $I$ is compressed into 3 feature blocks matching each input through convolution layer, pooling
|
| 165 |
+
147 layer, and global pooling layer. The input with 9 channels is separated into $3 \times 3$ channels before
|
| 166 |
+
148 passing the model. The first 3 channels are literally used as the main inputs, where the multiplication
|
| 167 |
+
149 operation takes place, while the remaining 6 channels are used as features.
|
| 168 |
+
150 First of all, we use multi-modal fusion architecture for three separate inputs to extract expanded
|
| 169 |
+
151 features. The three inputs converted to the HSV color space pass through a weights-sharing convolu
|
| 170 |
+
152 tion layer to extract a feature block corresponding to the inputs. Each convolution layer consists of
|
| 171 |
+
153 kernel size $^ { = 3 }$ , stride $^ { : = 1 }$ , and padding=1, reducing dimension through average pooling. We empirically
|
| 172 |
+
154 noticed that the most values of output feature have distribution within the range of [-1, 1] with valid
|
| 173 |
+
155 values for constructing the node points, so we use hyperbolic tan for activation function. Since we
|
| 174 |
+
156 use inputs with unstructured image size, the last global pooling block holds the size of the feature
|
| 175 |
+
157 instead of the average pooling block[LCY14].
|
| 176 |
+
158 The three feature blocks are combined through the multi-modal compact bilinear pooling gate
|
| 177 |
+
159 $( \mathbf { M C B } ) [ \mathbf { F P Y ^ { * } } 1 6 ]$ , following the fusion process shown in Figure 3. The MCB gate allows both
|
| 178 |
+
160 features to interact in a multiplicative way with low memory consumption and computation
|
| 179 |
+
161 times. The fusion features are complemented to enhanced feature through the split attention
|
| 180 |
+
162 mechanism $[ Z \mathrm { W } Z ^ { \ast } 2 0 ]$ . At the beginning of the experiment, we have applied the convolutional
|
| 181 |
+
163 block attention mechanism[WPLK18] of each MCB gate, but we found that it does not make sense
|
| 182 |
+
164 of understanding the feature itself, so we apply only one attention block to the last fusion feature.
|
| 183 |
+
165 The enhanced feature pass through the fully-connected regression layer. We picked the 64 points
|
| 184 |
+
166 to be regressed to compose the piecewise linear function, which is empirically confirmed to the
|
| 185 |
+
167 optimized number of points in this research. The first half of the values construct the node points of
|
| 186 |
+
168 the S channel and the other half comprise the $\mathrm { v }$ channel in HSV color space. Finally, node points
|
| 187 |
+
169 become the scaling factors to generate predicted image in equation 3[MMS19].
|
| 188 |
+
|
| 189 |
+

|
| 190 |
+
Figure 3: Overview structure of CUD image generation
|
| 191 |
+
|
| 192 |
+
$$
|
| 193 |
+
S \left( I _ { i } ^ { s , v } \right) = k _ { 0 } + \sum _ { m = 0 } ^ { M - 1 } \left( k _ { m + 1 } - k _ { m } \right) \delta \left( M I _ { i } ^ { s , v } - m \right)
|
| 194 |
+
$$
|
| 195 |
+
|
| 196 |
+
170 The total number of node point $M$ , each pixel values of S, V channel in input image $I _ { i } ^ { s , v }$ are
|
| 197 |
+
171 multiplicated with the slope of actual regressed value $k _ { m }$ , the $m - t h$ generated node point. The
|
| 198 |
+
172 specific node points $M$ is scaled through a multiplication operation to pixel value of the input image
|
| 199 |
+
173 according to each node point.
|
| 200 |
+
|
| 201 |
+
# 174 2.4 Loss function
|
| 202 |
+
|
| 203 |
+
175 Our dataset has one-to-many problems between input and target data. In dataset pair
|
| 204 |
+
176 $( I _ { 1 } , T _ { 1 } )$ , $( I _ { 2 } , T _ { 2 } )$ , . . . , $( I _ { n } , T _ { n } )$ , for example, the red color in $I _ { 1 }$ can be targeted to purple color in
|
| 205 |
+
177 $T _ { 1 }$ , and the red color in $I _ { 2 }$ can be targeted to orange color in $T _ { 2 }$ . With these one-to-many dataset
|
| 206 |
+
178 structures, we design the loss function $\mathcal { L }$ that expresses the potential and the diversity of predicted
|
| 207 |
+
179 image in equation 4.
|
| 208 |
+
|
| 209 |
+
$$
|
| 210 |
+
\mathcal { L } = \sum _ { i = 1 } ^ { N } L a b _ { l o s s } \left( V \left( \Phi \left( \hat { I } _ { i } \right) \right) \right) + H _ { l o s s } \left( \Phi \left( \hat { I } _ { i } \right) \right)
|
| 211 |
+
$$
|
| 212 |
+
|
| 213 |
+
180 Stencil Masking As explained in the dataset refining criteria, we do not proceed with color
|
| 214 |
+
181 conversion for all areas in the target images, but only for areas with color combinations that are
|
| 215 |
+
182 invisible to the deuteranopia (non-CUD object). For this reason, the input image has color regions of
|
| 216 |
+
183 converting color and unconverting color, which also can be referred to as non-CUD object and CUD
|
| 217 |
+
184 object. To imply the color bound to model, the stencil masking method is introduced.
|
| 218 |
+
|
| 219 |
+
$$
|
| 220 |
+
\Phi \left( { \hat { I } } _ { i } \right) = { \hat { I } } _ { i j } \parallel ( I _ { i j } \cdot T _ { i j } )
|
| 221 |
+
$$
|
| 222 |
+
|
| 223 |
+
185 We consist a stencil maps through the logical and operations ’·’ of each pixel value $I _ { i j }$ , $T _ { i j }$ . Stencil
|
| 224 |
+
186 map can specify the non-CUD area and be computed with predicted image $\hat { I } _ { i j }$ of logical or operation
|
| 225 |
+
187 ’ $| |$ ’in equation 5. Consequently, CUD object of the image adjusted with a stencil mask does not carry
|
| 226 |
+
188 out the neural filter computation, such as the same way we refine the target image. This refined image
|
| 227 |
+
189 is calculated on the loss function.
|
| 228 |
+
190 CIELab Loss We use the CIELab channel loss function to maximize the contrast of color on
|
| 229 |
+
191 deuteranopia vision. To stabilize the contrast and brightness of the predicted image, we calculate the
|
| 230 |
+
192 MS· SSIM(multi-scale structural similarity[WSB03]) of $\mathrm { L }$ channel.
|
| 231 |
+
|
| 232 |
+
$$
|
| 233 |
+
L a b _ { l o s s } = \left\| L a b \left( \hat { I } _ { i } ^ { r g b } \right) - L a b \left( T _ { i } ^ { r g b } \right) \right\| _ { 1 } + M S \cdot S S I M \left( L a b \left( \hat { I } _ { i } ^ { L } \right) , L a b \left( T _ { i } ^ { L } \right) \right)
|
| 234 |
+
$$
|
| 235 |
+
|
| 236 |
+
193 The $L a b \left( . \right)$ expression in equation 6 returns the CIELab channel corresponding to the RGB channel,
|
| 237 |
+
194 and all calculations are made only on the L channel.
|
| 238 |
+
195 Histogram Loss We use the histogram loss function to comply with the color preservation of the
|
| 239 |
+
196 image. The RGB channel is used to preserve its color, contrary to using only the $\mathrm { L }$ channel in other
|
| 240 |
+
197 loss functions. Handling the RGB channel as a loss function rather than using Lab’s ab channels has
|
| 241 |
+
198 shown better results on color preservation.
|
| 242 |
+
|
| 243 |
+
$$
|
| 244 |
+
H _ { l o s s } = - { \omega _ { h i s t } } \int N \left( \hat { I } _ { i } ^ { r g b } ; \sigma \right) - { \cal N } \left( T _ { i } ^ { r g b } ; \sigma \right)
|
| 245 |
+
$$
|
| 246 |
+
|
| 247 |
+
199 When simply designing a loss function with the L1 distance of the RGB channel pixel values, it was
|
| 248 |
+
200 very sensitive to certain values and the gradients are diverged, resulting in an untrainable experiment.
|
| 249 |
+
201 Therefore, we used a gaussian expansion method $[ S \mathbf { A } C ^ { * } 1 7 ]$ denoted by $N ( . )$ to infer a differentiable
|
| 250 |
+
202 histogram loss function in equation 7. We compute the difference of the RGB channel of the
|
| 251 |
+
203 differentiable histogram function, which can be altered to mean squared error or cosine similarity.
|
| 252 |
+
204 The scaler $\omega _ { h i s t }$ is determined in inverse proportion to the size of the input image. By maintaining
|
| 253 |
+
205 the RGB similarity between the predicted image and the target image, we can comply with the color
|
| 254 |
+
206 preservation.
|
| 255 |
+
207 Variational Prediction There are various ways to maximize difference of the L channel in the
|
| 256 |
+
208 image. And the target image is converted at least two colors compared to the input image. However,
|
| 257 |
+
209 the predicted image of the model is generated by the neural filter, so it is unpredictable which area
|
| 258 |
+
210 of color is modified. Therefore, if the color in predicted image is over-shifted or in the color value
|
| 259 |
+
211 of opposite shifts to the target, the loss will rather increase. In addition to one-to-many problem
|
| 260 |
+
212 that the data pair itself does not matches one-to-one in a particular color, it is necessary to generate
|
| 261 |
+
213 alternative predicted image with the same aspect of the data pair. We calculate the loss function with
|
| 262 |
+
214 a variational prediction based on the predicted image for potential color shifts.
|
| 263 |
+
215 The first potential is the case of excessive shifts. Assume that $I _ { i } ^ { L } = \{ 7 4 , 4 1 , 7 9 \}$ , $\hat { I } _ { i } ^ { L } = \{ 9 7 , 1 0 , 7 0 \}$ ,
|
| 264 |
+
216 $T _ { i } ^ { L } \ = \ \{ 5 0 , 4 1 , 8 0 \}$ in L channel value. The first and third components of each image is non-CUD
|
| 265 |
+
217 objects, and second component is CUD object. Therefore, we refined data paired with a difference of
|
| 266 |
+
218 15 on L channel. Here, we clip the excessive $\mathrm { L }$ channel value in $\hat { I } _ { i } ^ { L }$ by equation 8. Up to this point,
|
| 267 |
+
219 no calculation is made as no value is exceeded in this example. The second potential is the case of
|
| 268 |
+
220 opposite shifts. It can be said that a complete neural filter has been proceeded for value 97, 10, 70
|
| 269 |
+
221 where $\mathrm { L }$ channel difference is 27. However, if we actually calculate the mean square error between
|
| 270 |
+
222 $\hat { I } _ { i } ^ { L }$ and $T _ { i } ^ { L }$ , it will be an large value over 1k. Here we can generate alternative predicted image from
|
| 271 |
+
223 equation 9 and 10.
|
| 272 |
+
|
| 273 |
+
$$
|
| 274 |
+
c l i p \left( \hat { I } _ { i j } \right) \ = \ \left\{ { m a x } { \left( \hat { I } _ { i j } , { T } _ { i j } \right) } , \qquad I _ { i j } \ > T _ { i j } \right.
|
| 275 |
+
$$
|
| 276 |
+
|
| 277 |
+
$$
|
| 278 |
+
R _ { 1 } = \ 2 I _ { i j } - \ \hat { I } _ { i j } , R _ { 2 } = \ \hat { I } _ { i j }
|
| 279 |
+
$$
|
| 280 |
+
|
| 281 |
+
$$
|
| 282 |
+
V \left( { \hat { I } } _ { i j } \right) = a r g m i n \left( \left\| c l i p \left( R _ { 1 , 2 } \right) - T _ { i j } \right\| _ { 2 } \right)
|
| 283 |
+
$$
|
| 284 |
+
|
| 285 |
+
224 As mentioned above, we define thresholds by the maximum and minimum value of each corresponding
|
| 286 |
+
225 pixel position of $\hat { I } _ { i } ^ { L }$ and $T _ { i } ^ { L }$ . By computing a difference of residual map and the input image, we
|
| 287 |
+
226 induce the alternative two images $R _ { 1 }$ , $R _ { 2 }$ . As a result, $\hat { I } _ { i } ^ { L }$ with a smaller L2 distance is selected to
|
| 288 |
+
227 alternative predicted image in equation 10, and it is finally computed with loss function compared to
|
| 289 |
+
228 the $T _ { i } ^ { L }$ . The above equation establishes $V \left( \Phi \left( \hat { I } _ { i } \right) \right) = \{ \stackrel { \cdot } { 5 4 } , 4 1 , \stackrel { \cdot } { 8 0 } \}$ and the mean square error to the
|
| 290 |
+
229 target image is approximately 5, which is agreeable loss value respect to $\hat { I } _ { i } ^ { L }$ itself.
|
| 291 |
+
230 Identity Loss[ZPIE17, TPW16] We use $\mathcal { L } _ { i d e n t i t y } \left( T _ { i } \right)$ to apprehend the CUD object to the model.
|
| 292 |
+
231 In the case of target image that already satisfy the CUD, the filter should be relatively weakly applied
|
| 293 |
+
232 than input image. The input of identity loss is target image $T _ { i j }$ instead of input image $I _ { i j }$ , and the
|
| 294 |
+
233 reference of the loss function is also target image $T _ { i j }$ to maintain the value itself. In computing
|
| 295 |
+
234 identity loss, we do not require variational prediction as we cannot judge the potential region by
|
| 296 |
+
235 equation 10.
|
| 297 |
+
|
| 298 |
+
# 236 3 Experiments
|
| 299 |
+
|
| 300 |
+
237 The experiment was performed with Tesla V100 SXM2 and Intel Xeon Gold 5120 and the computation
|
| 301 |
+
238 speed was about 40 images per minutes. We refined a dataset with Adobe Photoshop to maximize
|
| 302 |
+
239 contrast in the L channel by adjusting saturation and brightness for areas that require color conversion
|
| 303 |
+
240 based on deuteranopia vision simulation. Color experts has refined about 1,500 vectorized image for
|
| 304 |
+
241 the training data and 300 publication images for the validation data. All the comparative experimental
|
| 305 |
+
242 models used the same train, test, validation data in this paper. We used the inference data in
|
| 306 |
+
243 publications, which is almost composed of vectorized images, as colors often appear distorted in a
|
| 307 |
+
244 gradation-rich image. The Figure 4 is arranged in descending order of the number of combinations in
|
| 308 |
+
245 colors from the top image.
|
| 309 |
+
246 Both structure similarity (SSIM)[ZBSS04] and peak signal to noise ratio (PSNR) in Table 1 can
|
| 310 |
+
247 indicate whether the image is suitable for CUD or not. As a notable aspect, the result has shown that
|
| 311 |
+
248 comparative models with lower metrics are sensitive to high-gradation input images, which generated
|
| 312 |
+
249 color-heterogeneous image. SSIM and PSNR itself can determine the increase in contrast compared
|
| 313 |
+
250 to the target image but do not determine whether the color preservation complied. Therefore, we
|
| 314 |
+
251 evaluated SSIM and PSNR with three references, inputs images $I$ , predicted images $\hat { I }$ , and target
|
| 315 |
+
252 images $T$ . The higher the estimation of the $\hat { I }$ and $I$ , the more color preservation factor worked.
|
| 316 |
+
253 The higher the estimation of the $\hat { I }$ and $T$ , the more increase in contrast can be considered. We also
|
| 317 |
+
254 define SSIM mean absolute error, PSNR mean absolute error to measure the extent of the conversion
|
| 318 |
+
255 between the $F : I T$ and $F : \dot { I } \hat { I }$ in equation 11 and 12, respectively. The $N$ is total number
|
| 319 |
+
256 of inference data.
|
| 320 |
+
|
| 321 |
+
$$
|
| 322 |
+
S S I M \cdot M A E = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } | S S I M ( \hat { I } _ { i } , \mathcal { T } _ { i } ) - S S I M ( I _ { i } , T _ { i } ) |
|
| 323 |
+
$$
|
| 324 |
+
|
| 325 |
+
$$
|
| 326 |
+
P S N R \cdot M A E = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } | P S N R ( \hat { I } _ { i } , \mathcal { T } _ { i } ) - P S N R ( I _ { i } , T _ { i } ) |
|
| 327 |
+
$$
|
| 328 |
+
|
| 329 |
+

|
| 330 |
+
Figure 4: Comparisons of predicted images in deuteranopia vision. The color experts selected the validation data that do not satisfy the CUD in publications.
|
| 331 |
+
|
| 332 |
+
Table 1: Evaluation table of comparison experiment. The CUD-NET with a low bottle-neck feature achieves better results in the experiment of the deuteranopia and the protanopia subjects(Figure 5), although the evaluation metrics are lower than that of CUD-NET.
|
| 333 |
+
|
| 334 |
+
<table><tr><td rowspan=1 colspan=1>Architecture</td><td rowspan=1 colspan=1>sSIM(i,1)</td><td rowspan=1 colspan=1>SSIM(i,T)</td><td rowspan=1 colspan=1>PSNR(i,1)</td><td rowspan=1 colspan=1>PSNR(i,T)</td><td rowspan=1 colspan=1>SSIM-MAE</td><td rowspan=1 colspan=1>PSNR·MAE</td></tr><tr><td rowspan=2 colspan=1>Cycle-GANZero-DCE</td><td rowspan=1 colspan=1>0.630</td><td rowspan=1 colspan=1>0.634</td><td rowspan=1 colspan=1>13.28</td><td rowspan=1 colspan=1>13.83</td><td rowspan=1 colspan=1>0.3191</td><td rowspan=1 colspan=1>8.4430</td></tr><tr><td rowspan=1 colspan=1>0.924</td><td rowspan=1 colspan=1>0.888</td><td rowspan=1 colspan=1>21.95</td><td rowspan=1 colspan=1>18.67</td><td rowspan=1 colspan=1>0.0661</td><td rowspan=1 colspan=1>3.7300</td></tr><tr><td rowspan=2 colspan=1>DeepLPFEnlighten-GAN</td><td rowspan=1 colspan=1>0.850</td><td rowspan=1 colspan=1>0.831</td><td rowspan=1 colspan=1>26.31</td><td rowspan=1 colspan=1>20.34</td><td rowspan=1 colspan=1>0.1220</td><td rowspan=1 colspan=1>2.0566</td></tr><tr><td rowspan=1 colspan=1>0.820</td><td rowspan=1 colspan=1>0.808</td><td rowspan=1 colspan=1>21.85</td><td rowspan=1 colspan=1>19.58</td><td rowspan=1 colspan=1>0.1470</td><td rowspan=1 colspan=1>3.9983</td></tr><tr><td rowspan=1 colspan=1>Enlighten-GAN(scaled)</td><td rowspan=1 colspan=1>0.966</td><td rowspan=1 colspan=1>0.921</td><td rowspan=1 colspan=1>24.86</td><td rowspan=1 colspan=1>21.36</td><td rowspan=1 colspan=1>0.0392</td><td rowspan=1 colspan=1>3.4937</td></tr><tr><td rowspan=2 colspan=1>CUD-NET(low bottle-neck feature)CUD-NET</td><td rowspan=1 colspan=1>0.897</td><td rowspan=1 colspan=1>0.866</td><td rowspan=1 colspan=1>27.77</td><td rowspan=1 colspan=1>21.01</td><td rowspan=1 colspan=1>0.0901</td><td rowspan=1 colspan=1>2.0826</td></tr><tr><td rowspan=1 colspan=1>0.962</td><td rowspan=1 colspan=1>0.924</td><td rowspan=1 colspan=1>29.54</td><td rowspan=1 colspan=1>21.19</td><td rowspan=1 colspan=1>0.0312</td><td rowspan=1 colspan=1>1.4760</td></tr></table>
|
| 335 |
+
|
| 336 |
+
257 Cycle-GAN and Zero-DCE showed worse result than others. Cycle-GAN model had difficulty
|
| 337 |
+
258 reconstructing a geometry of a particular object, and overall color had low saturation and brightness,
|
| 338 |
+
259 resulting in color conversion into an almost grey scale image. Zero-DCE is faded in color, and the
|
| 339 |
+
260 contrast was not much different from the input image. The overall image lost its color preservation,
|
| 340 |
+
261 which we focused to solve in this paper.
|
| 341 |
+
262 DeepLPF meets both the color preservation and contrast that we deal with for. However, DeepLPF
|
| 342 |
+
263 tends to color be over-stably filtered for the images with fewer color combinations. Although the
|
| 343 |
+
264 color preservation has complied better than other experiments, there were many failed results from
|
| 344 |
+
265 the perspective of contrast, which the over-stable filter leads to by DeepLPF.
|
| 345 |
+
266 Remarkably, predicted images of Enlighten-GAN showed reasonable results. However, simple color
|
| 346 |
+
267 combinations or the images with already satisfying the CUD often showed results degenerated with
|
| 347 |
+
268 low CUD suitability. Enlighten-GAN was able to generate the results we targeted, but its deviation of
|
| 348 |
+
269 filter is so high that it sometimes failed to satisfy the contrast even on simple images or decreased
|
| 349 |
+
270 the contrast. As the problem of GAN-based method including Enlighten-GAN, moreover, model
|
| 350 |
+
271 fixes the width and height of the predicted image. If width and height of $T$ and $I$ down-scaled
|
| 351 |
+
|
| 352 |
+
to size of Enlighten-GAN 272 $\hat { I }$ (approximately 25K pixels in this experiment), the $S S I M \left( \hat { I } , I \right)$ and $P S N R \left( \hat { I } , T \right)$ showed higher estimation in some metrics than CUD-NET. In the opposite case of $\hat { I }$ up-scaled to size of $T$ and $I$ , the significantly low estimation was recorded due to the information loss of up-scaling problem.
|
| 353 |
+
|
| 354 |
+
CUD-NET showed stable and robust predicted images in both color preservation and increase in the contrast compared to other experiments. In comparing the values in the same region of $I$ and $\hat { I }$ , the model scaled two $\mathrm { L }$ channel values with opposite side in the most of case, the one goes up and the other goes down. When we reduced the number of bottle-neck feature of model, it tends to record relatively high deviation of filter scales according to the number of combinations of colors. In summary, the CUD-NET showed the highest estimations for 4 evaluation metrics. Moreover, as our model adopted a neural filter unlike generation models, there is no loss of information regarding the scaling of predicted images.
|
| 355 |
+
|
| 356 |
+

|
| 357 |
+
Figure 5: The box bar is ordered to the left side, input image $I$ , Enlighten-GAN, DeepLPF, CUDNET. The y position of box bar represents a mean and length of the box bar represents a deviation of each experiment. The lower the graph is, the higher the rank is.
|
| 358 |
+
|
| 359 |
+
284 The figure 5 shows the evaluation of the deuteranopia and the protanopia. The evaluation metrics
|
| 360 |
+
285 consist of object distinguishability and color harmony in order of input image I, predicted image
|
| 361 |
+
286 of Enlighten GAN, DeepLPF, and CUD-NET. User study has tested upon the total of 6 subjects, 4
|
| 362 |
+
287 deuteranomaly and 2 protanomaly. The subjects were asked to list the ranks of object distinguishability
|
| 363 |
+
288 and color harmony of 4-paired-image for each model-blinded item. As the experimental results,
|
| 364 |
+
289 the deuteranopia subject ranked the 1-st in the object distinguishability of CUD-NET at an average
|
| 365 |
+
290 rank of 1.821, followed by Enlighten-GAN at an average rank of 2.512. Similarly, the protanopia
|
| 366 |
+
291 subject also ranked the 1-st in CUD, followed by Enlighten-GAN, DeepLPF, and input images. The
|
| 367 |
+
292 evaluation of color harmony showed that the subjects tend to assume that the image with a good
|
| 368 |
+
293 object distinguishability has good color harmony preferentially. For a total of six subjects, the five
|
| 369 |
+
294 subjects chose the CUD-NET, with the exception of one who ranked Enlighten-GAN by a subtle gap
|
| 370 |
+
|
| 371 |
+
# 295 4 Conclusion
|
| 372 |
+
|
| 373 |
+
296 In this paper, we proposed deep network to generate CUD images from non-CUD input images. The
|
| 374 |
+
297 pre-processing and multi-modal fusion layer could comprehend the information for color weakness,
|
| 375 |
+
298 and the variational loss function makes the model further adapt to CUD dataset. Compared to other
|
| 376 |
+
299 research, we are able to maintain high-resolution images and both stable color preservation and
|
| 377 |
+
300 contrast with neural filter per images.
|
| 378 |
+
301 Our current research shows a robust filter for a single color, such as vectorized images, but it is
|
| 379 |
+
302 difficult to expect stable results in the case of a real-world image with high gradation in hues. We
|
| 380 |
+
303 consider the same limitation of our work when the certain pixel values react sensitively, making noise
|
| 381 |
+
304 appear more prominent in the predicted image. In the future, we plan to create additional datasets
|
| 382 |
+
305 with gradation on the vectorized image and focus on the fusion layer to improve performance of the
|
| 383 |
+
306 model.
|
| 384 |
+
307 References
|
| 385 |
+
308 [AHB∗18] ANDERSON P., HE X., BUEHLER C., TENEY D., JOHNSON M., GOULD S., ZHANG L.: Bottom
|
| 386 |
+
309 up and top-down attention for image captioning and visual question answering. In Proceedings of
|
| 387 |
+
310 the IEEE Conference on Computer Vision and Pattern Recognition (CVPR) (June 2018).
|
| 388 |
+
311 [BCPS19] BIANCO S., CUSANO C., PICCOLI F., SCHETTINI R.: Content-preserving tone adjustment for
|
| 389 |
+
312 image enhancement. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern
|
| 390 |
+
313 Recognition (CVPR) Workshops (June 2019).
|
| 391 |
+
314 [DLT18] DENG Y., LOY C. C., TANG X.: Aesthetic-driven image enhancement by adversarial learning.
|
| 392 |
+
315 In Proceedings of the 26th ACM International Conference on Multimedia (New York, NY, USA,
|
| 393 |
+
316 2018), MM ’18, Association for Computing Machinery, p. 870–878. URL: https://doi.org/
|
| 394 |
+
317 10.1145/3240508.3240531, doi:10.1145/3240508.3240531.
|
| 395 |
+
318 $\mathrm { [ F P Y ^ { * } 1 6 ] }$ FUKUI A., PARK D. H., YANG D., ROHRBACH A., DARRELL T., ROHRBACH M.: Multimodal
|
| 396 |
+
319 compact bilinear pooling for visual question answering and visual grounding, 2016. arXiv:
|
| 397 |
+
320 1606.01847.
|
| 398 |
+
321 [GLG∗20] GUO C., LI C., GUO J., LOY C. C., HOU J., KWONG S., CONG R.: Zero-reference deep curve
|
| 399 |
+
322 estimation for low-light image enhancement. In Proceedings of the IEEE/CVF Conference on
|
| 400 |
+
323 Computer Vision and Pattern Recognition (CVPR) (June 2020).
|
| 401 |
+
324 [HMKO19] HIRA S., MATSUMOTO A., KIHARA K., OHTSUKA S.: Hue rotation (hr) and hue blending (hb):
|
| 402 |
+
325 Real-time image enhancement methods for digital component video signals to support red-green
|
| 403 |
+
326 color-defective observers. Journal of the Society for Information Display 27, 7 (2019), 409–426.
|
| 404 |
+
327 URL: https://onlinelibrary.wiley.com/doi/abs/10.1002/jsid.758, arXiv:https:
|
| 405 |
+
328 //onlinelibrary.wiley.com/doi/pdf/10.1002/jsid.758, doi:https://doi.org/10.
|
| 406 |
+
329 1002/jsid.758.
|
| 407 |
+
330 [IZZE17] ISOLA P., ZHU J.-Y., ZHOU T., EFROS A. A.: Image-to-image translation with conditional
|
| 408 |
+
331 adversarial networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern
|
| 409 |
+
332 Recognition (CVPR) (July 2017).
|
| 410 |
+
333 [JGL∗21] JIANG Y., GONG X., LIU D., CHENG Y., FANG C., SHEN X., YANG J., ZHOU P., WANG Z.:
|
| 411 |
+
334 Enlightengan: Deep light enhancement without paired supervision. IEEE Transactions on Image
|
| 412 |
+
335 Processing 30 (2021), 2340–2349. doi:10.1109/TIP.2021.3051462.
|
| 413 |
+
336 [JSZK16] JADERBERG M., SIMONYAN K., ZISSERMAN A., KAVUKCUOGLU K.: Spatial transformer
|
| 414 |
+
337 networks, 2016. arXiv:1506.02025.
|
| 415 |
+
338 [KWK21] KUMAR M., WEISSENBORN D., KALCHBRENNER N.: Colorization transformer. In International
|
| 416 |
+
339 Conference on Learning Representations (2021). URL: https://openreview.net/forum?id=
|
| 417 |
+
340 5NA1PinlGFu.
|
| 418 |
+
341 [KZG∗17] KRISHNA R., ZHU Y., GROTH O., JOHNSON J., HATA K., KRAVITZ J., CHEN S., KALANTIDIS
|
| 419 |
+
342 Y., LI L.-J., SHAMMA D. A., BERNSTEIN M. S., FEI-FEI L.: Visual genome: Connecting
|
| 420 |
+
343 language and vision using crowdsourced dense image annotations. Int. J. Comput. Vision 123, 1
|
| 421 |
+
344 (May 2017), 32–73. URL: https://doi.org/10.1007/s11263-016-0981-7, doi:10.1007/
|
| 422 |
+
345 s11263-016-0981-7.
|
| 423 |
+
346 [LCY14] LIN M., CHEN Q., YAN S.: Network in network, 2014. arXiv:1312.4400.
|
| 424 |
+
347 $[ \mathrm { L Y L } ^ { * } 2 0 ]$ LI X., YIN X., LI C., ZHANG P., HU X., ZHANG L., WANG L., HU H., DONG L., WEI F.,
|
| 425 |
+
348 CHOI Y., GAO J.: Oscar: Object-semantics aligned pre-training for vision-language tasks. In
|
| 426 |
+
349 Computer Vision – ECCV 2020 (Cham, 2020), Vedaldi A., Bischof H., Brox T., Frahm J.-M.,
|
| 427 |
+
350 (Eds.), Springer International Publishing, pp. 121–137.
|
| 428 |
+
351 $[ \mathbf { M M M } ^ { * } 2 0 ]$ MORAN S., MARZA P., MCDONAGH S., PARISOT S., SLABAUGH G.: Deeplpf: Deep local
|
| 429 |
+
352 parametric filters for image enhancement. In Proceedings of the IEEE/CVF Conference on
|
| 430 |
+
353 Computer Vision and Pattern Recognition (CVPR) (June 2020).
|
| 431 |
+
354 [MMS19] MORAN S., MCDONAGH S., SLABAUGH G.: Curl: Neural curve layers for global image
|
| 432 |
+
355 enhancement, 2019. arXiv:1911.13175.
|
| 433 |
+
356 [PEZZ20] PARK T., EFROS A. A., ZHANG R., ZHU J.-Y.: Contrastive learning for unpaired image-to-image
|
| 434 |
+
357 translation. In Computer Vision – ECCV 2020 (Cham, 2020), Vedaldi A., Bischof H., Brox T.,
|
| 435 |
+
358 Frahm J.-M., (Eds.), Springer International Publishing, pp. 319–345.
|
| 436 |
+
359 [RFB15] RONNEBERGER O., FISCHER P., BROX T.: U-net: Convolutional networks for biomedical image
|
| 437 |
+
360 segmentation. In Medical Image Computing and Computer-Assisted Intervention – MICCAI 2015
|
| 438 |
+
361 (Cham, 2015), Navab N., Hornegger J., Wells W. M., Frangi A. F., (Eds.), Springer International
|
| 439 |
+
362 Publishing, pp. 234–241.
|
| 440 |
+
363 [RG19] RIBEIRO M., GOMES A. J. P.: Recoloring algorithms for colorblind people: A survey. ACM
|
| 441 |
+
364 Comput. Surv. 52, 4 (Aug. 2019). URL: https://doi.org/10.1145/3329118, doi:10.1145/
|
| 442 |
+
365 3329118.
|
| 443 |
+
366 [SAC∗17] SCHÜTT K. T., ARBABZADAH F., CHMIELA S., MÜLLER K. R., TKATCHENKO A.: Quantum
|
| 444 |
+
367 chemical insights from deep tensor neural networks. Nature Communications 8, 1 (2017).
|
| 445 |
+
368 [TPW16] TAIGMAN Y., POLYAK A., WOLF L.: Unsupervised cross-domain image generation, 2016.
|
| 446 |
+
369 arXiv:1611.02200.
|
| 447 |
+
370 [TSC20] TAO A., SAPRA K., CATANZARO B.: Hierarchical multi-scale attention for semantic segmentation,
|
| 448 |
+
371 2020. arXiv:2005.10821.
|
| 449 |
+
372 [VZCR20] VARIKUTI V. N., ZHANG C., CLAIR B., REYNOLDS A. L.: Effect of enchroma glasses on color
|
| 450 |
+
373 vision screening using ishihara and farnsworth d-15 color vision tests. Journal of American Associ
|
| 451 |
+
374 ation for Pediatric Ophthalmology and Strabismus 24, 3 (2020), 157.e1–157.e5. URL: https:
|
| 452 |
+
375 //www.sciencedirect.com/science/article/pii/S1091853120301002, doi:https://
|
| 453 |
+
376 doi.org/10.1016/j.jaapos.2020.03.006.
|
| 454 |
+
377 [WEG87] WOLD S., ESBENSEN K., GELADI P.: Principal component analysis. Chemo
|
| 455 |
+
378 metrics and Intelligent Laboratory Systems 2, 1 (1987), 37–52. Proceedings of
|
| 456 |
+
379 the Multivariate Statistical Workshop for Geologists and Geochemists. URL: https:
|
| 457 |
+
380 //www.sciencedirect.com/science/article/pii/0169743987800849, doi:https://
|
| 458 |
+
381 doi.org/10.1016/0169-7439(87)80084-9.
|
| 459 |
+
382 [Won11] WONG B.: Points of view: Color blindnesss, 2011. doi:https://doi.org/10.1038/nmeth.
|
| 460 |
+
383 1618.
|
| 461 |
+
384 [WPLK18] WOO S., PARK J., LEE J.-Y., KWEON I. S.: Cbam: Convolutional block attention module. In
|
| 462 |
+
385 Proceedings of the European Conference on Computer Vision (ECCV) (September 2018).
|
| 463 |
+
386 [WSB03] WANG Z., SIMONCELLI E. P., BOVIK A. C.: Multiscale structural similarity for image quality
|
| 464 |
+
387 assessment. In The Thrity-Seventh Asilomar Conference on Signals, Systems Computers, 2003
|
| 465 |
+
388 (2003), vol. 2, pp. 1398–1402 Vol.2. doi:10.1109/ACSSC.2003.1292216.
|
| 466 |
+
389 [WZF∗19] WANG R., ZHANG Q., FU C.-W., SHEN X., ZHENG W.-S., JIA J.: Underexposed photo
|
| 467 |
+
390 enhancement using deep illumination estimation. In Proceedings of the IEEE/CVF Conference on
|
| 468 |
+
391 Computer Vision and Pattern Recognition (CVPR) (June 2019).
|
| 469 |
+
392 [ZBSS04] ZHOU WANG, BOVIK A. C., SHEIKH H. R., SIMONCELLI E. P.: Image quality assessment:
|
| 470 |
+
393 from error visibility to structural similarity. IEEE Transactions on Image Processing 13, 4 (2004),
|
| 471 |
+
394 600–612. doi:10.1109/TIP.2003.819861.
|
| 472 |
+
395 [ZGL∗20] ZOPH B., GHIASI G., LIN T.-Y., CUI Y., LIU H., CUBUK E. D., LE Q. V.: Rethinking
|
| 473 |
+
396 pre-training and self-training, 2020. arXiv:2006.06882.
|
| 474 |
+
397 [ZPIE17] ZHU J.-Y., PARK T., ISOLA P., EFROS A. A.: Unpaired image-to-image translation using
|
| 475 |
+
398 cycle-consistent adversarial networks. In Proceedings of the IEEE International Conference on
|
| 476 |
+
399 Computer Vision (ICCV) (Oct 2017).
|
| 477 |
+
400 [ZWZ∗20] ZHANG H., WU C., ZHANG Z., ZHU Y., LIN H., ZHANG Z., SUN Y., HE T., MUELLER
|
| 478 |
+
401 J., MANMATHA R., LI M., SMOLA A.: Resnest: Split-attention networks, 2020. arXiv:
|
| 479 |
+
402 2004.08955.
|
| 480 |
+
|
| 481 |
+
# 403 Checklist
|
| 482 |
+
|
| 483 |
+
1. For all authors...
|
| 484 |
+
|
| 485 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 486 |
+
(b) Did you describe the limitations of your work? [Yes] See on conclusion section
|
| 487 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A] This work is for positive societal impacts
|
| 488 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 489 |
+
|
| 490 |
+
2. If you ran experiments...
|
| 491 |
+
|
| 492 |
+
(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 on github: https://github.com/Anonymous68864576/CUD-NET-anonymous
|
| 493 |
+
|
| 494 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] on github repository
|
| 495 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See on section 2.3
|
| 496 |
+
(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 on Experiment section
|
| 497 |
+
|
| 498 |
+
3. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 499 |
+
|
| 500 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] Cooperated with Co-author
|
| 501 |
+
(b) Did you mention the license of the assets? [Yes] on github repository
|
| 502 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] on github repository
|
| 503 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [Yes] on github repository
|
| 504 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
md/train/9uFiX_HRsIL/9uFiX_HRsIL.md
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CLIPORT: What and Where Pathways for Robotic Manipulation
|
| 2 |
+
|
| 3 |
+
Mohit Shridhar 1,† Lucas Manuelli 2 Dieter Fox 1,2 1University of Washington 2NVIDIA mshr@cs.washington.edu lmanuelli@nvidia.com fox@cs.washington.edu
|
| 4 |
+
|
| 5 |
+
cliport.github.io
|
| 6 |
+
|
| 7 |
+
Abstract: How can we imbue robots with the ability to manipulate objects precisely but also to reason about them in terms of abstract concepts? Recent works in manipulation have shown that end-to-end networks can learn dexterous skills that require precise spatial reasoning, but these methods often fail to generalize to new goals or quickly learn transferable concepts across tasks. In parallel, there has been great progress in learning generalizable semantic representations for vision and language by training on large-scale internet data, however these representations lack the spatial understanding necessary for fine-grained manipulation. To this end, we propose a framework that combines the best of both worlds: a two-stream architecture with semantic and spatial pathways for vision-based manipulation. Specifically, we present CLIPORT, a language-conditioned imitationlearning agent that combines the broad semantic understanding (what) of CLIP [1] with the spatial precision (where) of Transporter [2]. Our end-to-end framework is capable of solving a variety of language-specified tabletop tasks from packing unseen objects to folding cloths, all without any explicit representations of object poses, instance segmentations, memory, symbolic states, or syntactic structures. Experiments in simulated and real-world settings show that our approach is data efficient in few-shot settings and generalizes effectively to seen and unseen semantic concepts. We even learn one multi-task policy for 10 simulated and 9 real-world tasks that is better or comparable to single-task policies.
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Ask a person to “get a scoop of coffee beans” or “fold the cloth in half” and they can naturally take concepts like scoop or fold and ground them in concrete physical actions within an accuracy of a few centimeters. We humans do this intuitively, without explicit geometric or kinematic models of coffee beans or cloths. Moreover, we can generalize to a broad range of tasks and concepts from a minimal set of examples on what needs to be achieved. How can we imbue robots with this ability to efficiently ground abstract semantic concepts in precise spatial reasoning?
|
| 12 |
+
|
| 13 |
+
Recently, a number of end-to-end frameworks have been proposed for vision-based manipulation [2, 3, 4, 5]. While these methods do not use any explicit representations of object poses, instance segmentations, or symbolic states, they can only replicate demonstrations with a narrow range of variability and have no notion of the semantics underlying the tasks. Switching from packing red pens to blue pens involves collecting a new training set [2], or if using goal-conditioned policies, involves the user providing a goal-image from the scene [5, 6]. In realistic human-robot interaction settings, collecting additional demonstrations or providing goal-images is often infeasible and unscalable. A natural solution to both these problems is to condition policies with natural language. Language provides an intuitive interface for specifying goals and also for implicitly transferring concepts across tasks. While language-grounding for manipulation has been explored in the past [7, 8, 9, 10], these pipelines are limited by object-centric representations that cannot handle granular or deformable objects and often do not reason about perception and action in an integrated manner. In parallel, there has been great progress in learning models for visual representations [11, 12] and aligning representations of vision and language [13, 14, 15] by training on large-scale internet data. However, these models lack a fine-grained understanding on how to manipulate objects, i.e. physical affordances.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1. Language-Conditioned Manipulation Tasks: CLIPORT is a broad framework applicable to a wide range of language-conditioned manipulation tasks in tabletop settings. We conduct large-scale experiments in Ravens [2] on 10 simulated tasks (a-j) with 1000s of unique instances per task. See Appendix A for challenges pertaining to each task. CLIPORT can even learn one multi-task model for all 10 tasks that achieves better or comparable performance to single-task models. Similarly, we demonstrate our approach on a Franka Panda manipulator with one multi-task model for 9 real-world tasks (k-o; only 5 shown) trained with just 179 image-action pairs.
|
| 17 |
+
|
| 18 |
+
To this end, we propose the first framework that combines the best of both worlds: end-to-end learning for fine-grained manipulation with the multi-goal and multi-task generalization capabilities of vision-language grounding systems. We introduce a two-stream architecture for manipulation with semantic and spatial pathways broadly inspired by (or vaguely analogous to) the two-stream hypothesis in cognitive psychology [16, 17, 18]. Specifically, we present CLIPORT, a languageconditioned imitation-learning agent that integrates the semantic understanding (what) of CLIP [1] with the spatial precision (where) of Transporter [2]. Transporter has been applied to a wide range of rearragement tasks from industrial packing [2] to manipulating deformable objects [6]. The key insight of the approach is formulating tabletop manipulation as a series of pick-and-place affordance predictions, where the objective is to detect actions rather than detect objects and then learn a policy. This action-centric approach to perception [19] is data efficient and effective at circumventing the need for explicit “objectness” in learnt representations. However, Transporter is a tabula rasa system that learns all visual representations from scratch and so every new goal or task requires collecting a new set of demonstrations. To address this problem, we bake in a strong semantic prior while learning policies. We condition our semantic stream with visual and language-goal features from a pre-trained CLIP model [1]. Since CLIP is pre-trained to align image and language features from millions of image-caption pairs from the internet, it provides a powerful prior for grounding semantic concepts that are common across tasks like categories, parts, shapes, colors, texts, and other visual attributes, all without a top-down pipeline that requires bounding boxes or instance segmentations [13, 14, 15, 20]. This allows us to formulate tabletop rearrangement as a series of language-conditioned affordance predictions, a predominantly vision-based inference problem, and thus benefit from the strengths of data-driven paradigms like scale and generalization.
|
| 19 |
+
|
| 20 |
+
To study these benefits, we conduct large-scale experiments in the Ravens [2] framework with a simulated suction-gripper robot. We propose 10 language-conditioned tasks with 1000s of unique instances per task that require both semantic and spatial reasoning (see Figure $1 \ \mathrm { a - j }$ ). CLIPORT is not only effective at solving these tasks, but surprisingly, it can even learn a multi-task model for all 10 tasks that achieves better or comparable performance to single-task models. Further, our evaluations indicate that our multi-task model can effectively transfer attributes like “pink block” across tasks, having never seen pink blocks or the word ‘pink’ in the context of the evaluation task. We also demonstrate our approach on a Franka Panda manipulator with one multi-task model for 9 real-world tasks trained with just 179 image-action pairs (see Figure $1 \ k { - } 0$ ).
|
| 21 |
+
|
| 22 |
+
In summary, our contributions are as follows:
|
| 23 |
+
|
| 24 |
+
• An extended benchmark of language-grounding tasks for manipulation in Ravens [2].
|
| 25 |
+
• Two-stream architecture for using internet pre-trained vision-language models for conditioning precise manipulation policies with language goals.
|
| 26 |
+
• Empirical results on a broad range of manipulation tasks, including multi-task models, validated with real-robot experiments.
|
| 27 |
+
|
| 28 |
+
The benchmark, code, and pre-trained models are available at: cliport.github.io.
|
| 29 |
+
|
| 30 |
+
# 2 Related Work
|
| 31 |
+
|
| 32 |
+
Vision-based Manipulation. Traditionally, perception for manipulation has centered around object detectors, segmentors, and pose estimators [21, 22, 23, 24, 25, 26]. These methods cannot handle deformable objects, granular media, or generalize to unseen objects without object-specific training data. Alternatively, dense descriptors [27, 28, 29] and keypoint representations [30, 31, 32] forgo segmentation and pose representations, but do not reason about sequential actions and struggle to represent scenes with variable numbers of objects. On the other hand, end-to-end perception-toaction models can learn precise sequential policies [2, 4, 6, 33, 34, 35], but these methods have limited understanding of semantic concepts and rely on goal-images to condition policies. In contrast, Yen-Chen et. al [36] showed that pre-training on semantic tasks like classification and segmentation helps in improving efficiency and generalization of grasping predictions.
|
| 33 |
+
|
| 34 |
+
Semantic Models. With the advent of large-scale models [37, 38, 39], a number of methods for learning joint vision and language representations have been proposed [13, 14, 15, 20, 40]. However, these methods are restricted to bounding boxes or instance segmentations, which make them inapplicable for detecting things like piles of coffee beans or squares on a chessboard. Alternatively, works in contrastive learning forgo top-down object-detection and learn continuous representations by pre-training on unlabeled data [11, 12]. Recently, CLIP [1] applied a similar approach to align vision and language representations by training on millions of image-caption pairs from the internet.
|
| 35 |
+
|
| 36 |
+
Language Grounding for Robotics. Several works have proposed systems for instructing robots with natural language [7, 8, 9, 10, 41, 42, 43, 44, 45, 46, 47]. However, these methods use disentangled pipelines for perception and action with the language primarily being used to guide the perception. As such, these pipelines lack the spatial precision necessary for tasks like folding cloths. Recently, Lynch et. al [48] proposed an end-to-end system for grounding language in continuous control, but it requires several hours of human teleoperation data for a single simulated desk setting.
|
| 37 |
+
|
| 38 |
+
Two-Stream Architectures are prevalent in action-recognition networks [49, 50, 51] and audiorecognition systems [52, 53]. In robotics, Zeng et. al [54] and Jang et. al [55] have proposed twostream pipelines for affordance predictions of novel objects. The former requires goal-images and the latter is restricted to one-step grasps with single-category goals. In contrast, our framework provides a rich and intuitive interface with composable language commands for sequential tasks.
|
| 39 |
+
|
| 40 |
+
# 3 CLIPORT
|
| 41 |
+
|
| 42 |
+
CLIPORT is an imitation-learning agent based on four key principles: (1) Manipulation through a two-step primitive where each action involves a start and final end-effector pose. (2) Visual representations of actions that are equivariant to translations and rotations [56, 57]. (3) Two separate pathways for semantic and spatial information. (4) Language-conditioned policies for specifying goals and also transferring concepts across tasks. Combining (1) and (2) from Transporter with (3) and (4) allows us to achieve generalizable policies that go beyond just imitating demonstrations.
|
| 43 |
+
|
| 44 |
+
Section 3.1 describes the problem formulation, gives an overview of Transporter [2], and presents our language-conditioned model. Section 3.2 provides details on the training approach.
|
| 45 |
+
|
| 46 |
+
# 3.1 Language-Conditioned Manipulation
|
| 47 |
+
|
| 48 |
+
We consider the problem of learning a goal-conditioned policy $\pi$ that outputs actions $\mathbf { a } _ { t }$ given input $\gamma _ { t } = ( \mathbf { o } _ { t } , \mathbf { l } _ { t } )$ consisting of a visual observation $\mathbf { o } _ { t }$ and an English language instruction ${ \bf l } _ { t }$ :
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\pi ( \gamma _ { t } ) = \pi ( \mathbf { o } _ { t } , \mathbf { l } _ { t } ) \mathbf { a } _ { t } = ( { \mathcal { T } } _ { \mathrm { p i c k } } , { \mathcal { T } } _ { \mathrm { p l a c e } } ) \in \mathcal { A }
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
Figure 2. CLIPORT Two-Stream Architecture. An overview of the semantic and spatial streams. The semantic stream uses a frozen CLIP ResNet50 [1] to encode RGB input, and its decoder layers are conditioned with tiled language features from the CLIP sentence encoder. The spatial stream encodes RGB-D input, and its decoder layers are laterally fused with the semantic stream. The final output is a map of dense pixelwise features that is used for pick or place affordance predictions. This same two-stream architecture is used in all 3 FullyConvolutional-Networks $f _ { \mathrm { p i c k } }$ , $\Phi _ { \mathrm { q u e r y } }$ , and $\Phi _ { \mathrm { k e y } }$ with $f _ { \mathrm { p i c k } }$ is used to predict pick actions, and $\Phi _ { \mathrm { q u e r y } }$ and $\Phi _ { \mathrm { k e y } }$ are used to predict place actions. See Appendix C for the exact architecture.
|
| 56 |
+
|
| 57 |
+
The actions $\mathbf { a } = ( T _ { \mathrm { p i c k } } , T _ { \mathrm { p l a c e } } )$ specify the end-effector pose for picking and placing, respectively. We consider tabletop tasks where $\mathcal { T } _ { \mathrm { p i c k } } , \mathcal { T } _ { \mathrm { p l a c e } } \in \mathbf { S } \mathbf { E } ( 2 )$ . The visual observation $\mathbf { o } _ { t }$ is a top-down orthographic RGB-D reconstruction of the scene where each pixel corresponds to a point in 3D space. The language instruction ${ \bf l } _ { t }$ either specifies step-by-step instructions e.g. “pack the scissors” “pack the purple tape” etc., or a single goal description for the whole task e.g “pack all the blue and yellow boxes in the brown box”. See Figure 4 for specific examples.
|
| 58 |
+
|
| 59 |
+
We assume access to a dataset $\mathcal { D } = \{ \zeta _ { 1 } , \zeta _ { 2 } , \ldots , \zeta _ { n } \}$ of $n$ expert demonstrations with associated discrete-time input-action pairs $\zeta _ { i } = \{ ( \mathbf { o } _ { 1 } , \mathbf { l } _ { 1 } , \mathbf { a } _ { 1 } ) , ( \mathbf { o } _ { 2 } , \mathbf { l } _ { 2 } , \mathbf { a } _ { 2 } ) , . . . \}$ where $\mathbf { a } _ { t } = ( T _ { \mathrm { p i c k } } , T _ { \mathrm { p l a c e } } )$ corresponds to expert pick-and-place coordinates at timestep $t$ . These expert demonstrations are used to supervise the policy $\pi$ .
|
| 60 |
+
|
| 61 |
+
Transporter for Pick-and-Place. The policy $\pi$ is trained with Transporter [2] to perform spatial manipulation. The model first (i) attends to a local region to decide where to pick, then (ii) computes a placement location by finding the best match through cross-correlation of deep visual features.
|
| 62 |
+
|
| 63 |
+
Following Transporter [2, 6], the policy $\pi$ is composed of two action-value modules (Q-functions): The pick module $\mathcal { Q } _ { \mathrm { p i c k } }$ decides where to pick, and conditioned on this pick action the place module $\mathcal { Q } _ { \mathrm { p l a c e } }$ decides where to place. These modules are implemented as Fully-Convolutional-Networks (FCNs) that are translationally equivariant by design. As we will describe in more detail below, we extend these networks to two-stream architectures that can handle language input. The pick FCN $f _ { \mathrm { p i c k } }$ takes input $\gamma _ { t } = \left( \mathbf { o } _ { t } , \mathbf { l } _ { t } \right)$ and outputs a dense pixelwise prediction $\mathbf { \bar { \mathcal { Q } } _ { \mathrm { p i c k } } } ^ { } \in \mathbb { R } ^ { H \times \dot { W } }$ of action-values, where are used to predict the pick action $\tau _ { \mathrm { p i c k } }$ :
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\mathcal { T } _ { \mathrm { p i c k } } = \underset { ( u , v ) } { \mathrm { a r g m a x } } \ : \mathcal { Q } _ { \mathrm { p i c k } } ( ( u , v ) | \gamma _ { t } )
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
Since $\mathbf { o } _ { t }$ is an orthographic heightmap, each pixel location $( u , v )$ can be mapped to a 3D picking location using the known camera calibration. $f _ { \mathrm { p i c k } }$ is trained in a supervised manner to predict the pick action $\mathcal { T } _ { \mathrm { p i c k } }$ that imitates the expert demonstration with the specified language instruction at timestep $t$ .
|
| 70 |
+
|
| 71 |
+
The second FCN $\Phi _ { \mathrm { q u e r y } }$ takes in $\gamma _ { t } [ \mathcal { T } _ { \mathrm { p i c k } } ]$ , which is a $c \times c$ crop of $\mathbf { o } _ { t }$ centered at $\tau _ { \mathrm { p i c k } }$ along with the language instruction ${ \bf l } _ { t }$ , and outputs a query feature embedding of shape $\mathbb { R } ^ { c \times c \times d }$ . The third FCN $\Phi _ { \mathrm { k e y } }$ consumes the full input $\gamma _ { t }$ and outputs a key feature embedding of shape $\mathbb { R } ^ { H \times W \times d }$ . The place action-values $\mathcal { Q } _ { \mathrm { p l a c e } }$ are then computed by cross-correlating the query and key features:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\begin{array} { r } { \mathcal { Q } _ { \mathrm { p l a c e } } ( \Delta \tau | \gamma _ { t } , \mathcal { T } _ { \mathrm { p i c k } } ) = \left( \Phi _ { \mathrm { q u e r y } } ( \gamma _ { t } [ \mathcal { T } _ { \mathrm { p i c k } } ] ) * \Phi _ { \mathrm { k e y } } ( \gamma _ { t } ) \right) [ \Delta \tau ] } \end{array}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where $ { \Delta \tau } \in S E ( 2 )$ represents a potential placement pose. Since $\mathbf { o } _ { t }$ is an orthographic heightmap, rotations in the placement pose $\Delta \tau$ can be captured by stacking $k$ discrete angle rotations of the crop before passing it through the query network $\Phi _ { \mathrm { q u e r y } }$ . Then $\begin{array} { r } { \mathcal { T } _ { \mathrm { p l a c e } } ^ { \mathrm { ~ \tiny ~ \bar { ~ } ~ } } = \arg \operatorname* { m a x } _ { \Delta \tau } \mathcal { Q } _ { \mathrm { p l a c e } } ( \Delta \tau | \gamma _ { t } , \mathcal { T } _ { \mathrm { p i c k } } ) , } \end{array}$ , where the place module is trained to imitate the placements in the expert demonstrations. For all models, we use $c = 6 4$ , $k = 3 6$ and $d = 3$ . As in Transporter [2, 6], our framework can be extended to handle any motion primitive like pushing, sliding, etc. that can be parameterized by two end-effector poses at each timestep. For more details, we refer the reader to the original paper [2].
|
| 78 |
+
|
| 79 |
+
Two-Stream Architecture. In CLIPORT, we extend the network architecture of all three FCNs $f _ { \mathrm { p i c k } }$ , $\Phi _ { \mathrm { q u e r y } }$ and $\Phi _ { \mathrm { k e y } }$ from Transporter [2] to allow for language input and reasoning about high-level semantic concepts. We extend the FCNs to two-pathways: semantic (ventral) and spatial (dorsal). The semantic stream is conditioned with language features at the bottleneck and fused with intermediate features from the spatial stream. See Figure 2 for an overview of the architecture.
|
| 80 |
+
|
| 81 |
+
The spatial stream is identical to the ResNet architecture in Transporter – a tabula rasa network that takes in RGB-D input $\mathbf { o } _ { t }$ and outputs dense features through an hourglass encoder-decoder model. The semantic stream uses a frozen pre-trained CLIP ResNet50 [1] to encode the RGB input2 $\tilde { \mathbf { o } } _ { t }$ up until the penultimate layer $\tilde { \mathbf { o } } _ { t } \mathbf { v } _ { t } ^ { ( 0 ) } : \mathbb { R } ^ { 7 \times 7 \times 2 0 4 8 }$ and then introduces decoding layers that ! t upsample the feature tensors to mimic the spatial stream $\mathbf { v } _ { t } ^ { ( l - 1 ) } \to \mathbf { v } _ { t } ^ { ( l ) } : \mathbb { R } ^ { h \times w \times C }$ at each layer $l$ .
|
| 82 |
+
|
| 83 |
+
The language instruction ${ \bf l } _ { t }$ is encoded with CLIP’s Transformer-based sentence encoder to produce a goal encoding $\mathbf { l } _ { t } \mathbf { g } _ { t } : \mathbb { R } ^ { 1 0 2 4 }$ . This goal encoding $\mathbf { g } _ { t }$ is downsampled with fully-connected layers to match the channel dimension $C$ and tiled to match the spatial dimensions of the decoder features such that $\mathbf { g } _ { t } \ \to \ \mathbf { g } _ { t } ^ { ( l ) } \ : \ \mathbb { R } ^ { h \times w \times C }$ . The decoder features are then conditioned with the tiled goal features through an element-wise product $\mathbf { v } _ { t } ^ { ( l ) } \odot \mathbf { g } _ { t } ^ { ( l ) }$ (Hadamard product). Since CLIP was trained with contrastive loss on the dot-product alignment between pooled image features and language encodings, the element-wise product allows us to use this alignment while the tiling preserves the spatial dimensions of the visual features. This language conditioning is repeated for three subsequent layers after the bottleneck inspired by LingUNet [58]. We also add skip connections to these layers from the CLIP ResNet50 encoder to utilize different levels of semantic information from shapes to parts to object-level concepts [59]. Finally, following existing two-stream architectures in videoaction recognition [51], we add lateral connections from the spatial stream to the semantic stream. These connections invothe channel dimension ng , w $1 \times 1$ uceare $[ \mathbf { v } _ { t } ^ { ( l ) } \odot \mathbf { g } _ { t } ^ { ( l ) } ; \mathbf { d } _ { t } ^ { ( l ) } ] : \mathbb { R } ^ { h \times w \times C _ { \mathbf { v } } + C _ { \mathbf { d } } } \mathbb { R } ^ { h \times w \times \check { C } _ { \mathbf { v } } }$ $\mathbf { v } _ { t } ^ { ( l ) }$ ) and d(l)t the semantic and spatial tensors at layer $l$ , respectively. For the final fusion of dense features, addition for $f _ { \mathrm { p i c k } }$ and $1 \times 1$ conv fusion for $\Phi _ { \mathrm { q u e r y } }$ and $\Phi _ { \mathrm { k e y } }$ worked the best empirically. See Appendix C for details on the exact architecture.
|
| 84 |
+
|
| 85 |
+
# 3.2 Implementation Details
|
| 86 |
+
|
| 87 |
+
Training from demonstrations. Similar to Transporter [2] we train CLIPORT through imitation learning from a set of expert demonstrations $\mathcal { D } = \{ \zeta _ { 1 } , \zeta _ { 2 } , . . . , \zeta _ { n } \}$ consisting of discrete-time inputaction pairs $\zeta _ { i } = \{ ( \mathbf { o } _ { 1 } , \mathbf { \bar { l } } _ { 1 } , \mathbf { a } _ { 1 } ) , ( \mathbf { o } _ { 2 } , \mathbf { l } _ { 2 } , \mathbf { a } _ { 2 } ) , \dots \}$ . During training, we randomly sample an inputaction pair from the dataset and supervise the model end-to-end with one-hot pixel encodings of demonstration actions $Y _ { \mathrm { p i c k } } : \mathbb { R } ^ { H \times \dot { W } \times k }$ and $Y _ { \mathrm { p l a c e } } : \mathbb { R } ^ { H \times W \times k }$ with $k$ discrete rotations. In simulated experiments with the suction-gripper, we use $k = 1$ for pick actions and $k = 3 6$ for place actions. The model is trained with cross-entropy loss: $\mathcal { L } = \dot { - } \mathbb { E } _ { Y _ { \mathrm { { p i c k } } } } [ \log \mathcal { V } _ { \mathrm { { p i c k } } } ] - \mathbb { E } _ { Y _ { \mathrm { { 0 i c e } } } } [ \log \mathcal { \bar { V } } _ { \mathrm { { p l a c e } } } ]$ where $\mathcal { V } _ { \mathrm { p i c k } } = \operatorname { s o f t m a x } \left( \mathcal { Q } _ { \mathrm { p i c k } } ( ( u , v ) | \gamma _ { t } ) \right)$ and $\mathcal { V } _ { \mathrm { p l a c e } } = \mathrm { s o f t m a x } ( \mathcal { Q } _ { \mathrm { p l a c e } } ( ( u ^ { \prime } , v ^ { \prime } , \omega ^ { \prime } ) | \gamma _ { t } , \dot { \mathcal { T } } _ { \mathrm { p i c k } } ) )$ . Compared to the original Transporter models that were trained for 40K iterations, we train our models for $2 0 0 \mathrm { K }$ iterations (with data augmentation; see Appendix E) to account for additional semantic variation in tasks – randomized colors, shapes, objects. All models are trained on a single commodity GPU for 2 days with a batch size of 1.
|
| 88 |
+
|
| 89 |
+
Training multi-task models. Multi-task training is nearly identical to single-task training except for the sampling of training data. First, we randomly sample a task, and then select a random inputaction pair from that task in the dataset. Using this strategy, all tasks are equally likely to be sampled but longer horizon tasks are less likely to reach full coverage of input-action pairs available in the dataset. To compensate for this, we train all multi-task models $3 \times$ longer for 600K iterations or 6 GPU days.
|
| 90 |
+
|
| 91 |
+
# 4 Results
|
| 92 |
+
|
| 93 |
+
We perform experiments both in simulation and hardware aimed at answering the following questions: 1) How effective is the language-conditioned two-stream architecture for fine-grained manipulation compared to one-stream alternatives and other simpler baselines? 2) Is it possible to train a multi-task model for all tasks, and how well does it perform and generalize? 3) How well do these models generalize to seen and unseen semantic attributes like colors, shapes, and object categories?
|
| 94 |
+
|
| 95 |
+
# 4.1 Simulation Setup
|
| 96 |
+
|
| 97 |
+
Environment. All simulated experiments are based on a Universal Robot UR5e with a suction gripper. The setup provides a systematic and reproducible environment for evaluation, especially for benchmarking the ability to ground semantic concepts like colors and object categories. The input observation is a top-down RGB-D reconstruction from 3 cameras positioned around a rectangular table: one in the front, one on the left shoulder, and one on the right shoulder, all pointing towards the center. Each camera has a resolution of $6 4 0 \times 4 8 0$ and is noiseless.
|
| 98 |
+
|
| 99 |
+
Language-Conditioned Manipulation Tasks. We extend the Ravens benchmark [2] set in PyBullet [60] with 10 language-conditioned manipulation tasks. See Figure 1 for examples and Table 3 for challenges associated with each task. Each task instance is constructed by sampling a set of objects and attributes: poses, colors, sizes, and object categories. 8 of the 10 tasks have two variants, denoted by seen and unseen, depending on whether the task has unseen attributes (e.g. color) at test time. For colors: $\mathbb { T } _ { \mathrm { s e e n c o l o r s } } = \{ \mathtt { y e l l o w }$ , brown, gray, cyan} and $\mathbb { T } _ { \mathrm { u n s e e n c o l o r s } } =$ {orange, purple, pink, white $\}$ with 3 overlapping colors $\mathbb { T } _ { \mathrm { a l l } } ~ = ~ \{ \mathrm { r e d }$ , green, blue} used in both the seen and unseen spilts. For packing objects, we use 56 tabletop objects from the Google Scanned Objects dataset [61] and split them into 37 seen and 19 unseen objects. The language instructions are constructed from templates for simulated experiments, and human-annotated for real-world experiments. For more details about individual tasks, see Appendix A.
|
| 100 |
+
|
| 101 |
+
Evaluation Metric. We adopt the 0 (fail) to 100 (success) scores proposed in the Ravens benchmark [2]. The score assigns partial credit based on the task, e.g. $3 / 5 \Rightarrow 6 0 . 0$ for packing 3 out of 5 objects specified in the instructions, or $3 0 / 5 6 \Rightarrow 5 3 . 6$ for pushing 30 out of 56 particles into the correct zone. See Appendix A for the specific evaluation metric used in each task. During an evaluation episode, an agent keeps interacting with the scene until an oracle indicates task-completion. We report scores on 100 evaluation runs for agents trained with $n = 1 , 1 0$ , 100, 1000 demonstrations.
|
| 102 |
+
|
| 103 |
+
# 4.2 Simulation Results
|
| 104 |
+
|
| 105 |
+
Table 1 presents results from our large-scale experiments in Ravens [2] and Figure 3 summarizes these results with average scores across seen and unseen splits.
|
| 106 |
+
|
| 107 |
+

|
| 108 |
+
Figure 3. Average scores across seen and unseen splits for all tasks in Table 1.
|
| 109 |
+
|
| 110 |
+
# Baseline Methods. To study
|
| 111 |
+
|
| 112 |
+
the effectiveness of our two-stream architecture, we broadly compare against two baselines: Transporter-only and CLIP-only. Transporter-only is the original Transporter [2], or equivalently, the spatial stream of CLIPORT with RGB-D input. Although Transporter-only does not receive any language goals, it shows what can be achieved through chance by exploiting the most likely actions seen during training. On the other hand, CLIP-only is just the semantic stream of CLIPORT with RGB and language input. CLIP-only shows what can be achieved by fine-tuning a pre-trained semantic model for manipulation without spatial information, particularly depth.
|
| 113 |
+
|
| 114 |
+
Two-Stream Performance. Figure 3 (seen) captures the essence of our main claims. The performance of Transporter-only saturates at $5 0 \%$ since it doesn’t use the language instruction to ground the desired goal. CLIP-only does have a goal, but lacks the spatial precision to go the last mile and thus saturates at $7 6 \%$ . Only CLIPORT (single) achieves more than $9 0 \%$ , which indicates that both the semantic and spatial streams are crucial for fine-grained manipulation. Further, CLIPORT (single) achieves $8 6 \%$ on most tasks with just 100 demonstrations, showcasing its efficiency.
|
| 115 |
+
|
| 116 |
+
In addition to these baselines, we present various ablations and alternative one-stream and twostream models in Appendix F. To briefly summarize these results, CLIP is essential for few-shot
|
| 117 |
+
|
| 118 |
+
<table><tr><td></td><td colspan="4">packing-box-pairs seen-colors</td><td colspan="4">packing-box-pairs unseen-colors</td><td colspan="4">packing-seen-google objects-seq</td><td colspan="4">packing-unseen-google objects-seq</td><td colspan="4">packing-seen-google objects-group</td><td colspan="4">packing-unseen-google objects-group</td></tr><tr><td>Method</td><td>1</td><td>10</td><td>100</td><td>1000</td><td>1 10</td><td>100</td><td>1000</td><td>1</td><td>10</td><td>100</td><td>1000</td><td>1</td><td>10</td><td>100</td><td>1000</td><td>1</td><td>10</td><td>100</td><td>1000</td><td>1</td><td>10</td><td>100</td><td>1000</td></tr><tr><td>Transporter-only [2]</td><td>44.2 55.2 54.2</td><td></td><td></td><td></td><td></td><td></td><td>54.1</td><td>26.2 39.7</td><td></td><td>45.4</td><td></td><td></td><td>19.9 29.8</td><td>28.7</td><td>37.3</td><td></td><td></td><td></td><td>59.9</td><td></td><td></td><td>46.2 54.7 49.8</td><td></td></tr><tr><td>CLIP-only</td><td></td><td></td><td></td><td>52.4</td><td>34.648.747.2</td><td></td><td></td><td></td><td></td><td></td><td>46.3</td><td></td><td></td><td></td><td></td><td></td><td>60.0 54.3 61.5</td><td></td><td></td><td></td><td></td><td></td><td>:52.0</td></tr><tr><td>RN50-BERT</td><td></td><td></td><td></td><td></td><td>38.6 69.7 88.5 87.1 33.0 65.5 68.8</td><td></td><td>61.2</td><td></td><td>29.1 67.9</td><td>)89.3</td><td>95.8</td><td></td><td></td><td></td><td>37.1 49.4 60.4 57.8</td><td></td><td>52.5 62.0 89.6 92.7</td><td></td><td></td><td></td><td></td><td></td><td>43.465.9 73.1 70.0</td></tr><tr><td>CLIPORT (single)</td><td></td><td></td><td></td><td></td><td>36.2 64.0 94.7 90.3 31.4 52.7 65.6</td><td></td><td>72.1</td><td></td><td>32.948.4 87.9 94.0</td><td></td><td></td><td></td><td></td><td></td><td>)29.348.548.356.1 71.9</td><td>52.7</td><td></td><td></td><td></td><td></td><td></td><td></td><td>46.452.9 76.586.4 43.2 52.0 66.3 73.7</td></tr><tr><td>CLIPORT (multi)</td><td colspan="4">51.6 82.9 92.7 66.888.694.196.659.0 69.776.271.441.678.485.084.4 40.751.165.870.371.384.689.68.368.4 69.678.480.3</td><td colspan="4">98.2 45.6 65.3 68.6 71.5</td><td colspan="4"></td><td colspan="4">14.8 59.5 86.8 96.2 27.2 50.0 65.5</td><td colspan="4">67.0 84.1</td><td colspan="4">94.061.5 66.2 78.4 81.5</td></tr><tr><td rowspan="4"> CLIPORT (multi-attr)</td><td colspan="4"></td><td colspan="4">46.2 72.0 86.2 80.3</td><td colspan="4"></td><td colspan="4">35.4 45.1 78.9 87.4</td><td colspan="4"></td><td colspan="4">48.6 69.3 84.8 89.1</td></tr><tr><td></td><td>stack-block-pyramid seq-seen-colors</td><td></td><td></td><td>stack-block-pyramid</td><td>seq-unseen-colors</td><td></td><td></td><td>separating-piles seen-colors</td><td></td><td></td><td></td><td>separating-piles unseen-colors</td><td></td><td></td><td></td><td>towers-of-hanoi</td><td></td><td></td><td></td><td></td><td>towers-of-hanoi</td><td></td></tr><tr><td>1</td><td>10</td><td>100</td><td>1000</td><td>1</td><td>10</td><td>100</td><td>1000 1</td><td>10</td><td>100</td><td>1000</td><td></td><td>10</td><td></td><td>1000</td><td>1</td><td>seq-seen-colors 10</td><td></td><td></td><td></td><td></td><td></td><td>seq-unseen-colors</td></tr><tr><td></td><td>4.5</td><td>2.3</td><td>5.2 4.5</td><td>3.0</td><td>4.0</td><td>2.3</td><td>5.8</td><td>42.7</td><td>52.3</td><td>42.0</td><td>48.4</td><td>1 41.2 49.2</td><td></td><td>100 44.7</td><td>52.3</td><td>67.9</td><td>98.0</td><td>100 1000 99.9</td><td></td><td>1</td><td>10 100 24.344.671.7 80.7</td><td>1000</td></tr><tr><td>Transporter-only [2] CLIP-only</td><td>6.328.7 55.7 54.8</td><td></td><td></td><td></td><td>2.012.2</td><td>18.3</td><td></td><td>19.543.5</td><td>55.0</td><td>84.9 90.25</td><td></td><td>59.949.6</td><td></td><td>73.0</td><td>71.0</td><td>25.4 9.4</td><td>52.6 88.645.3</td><td></td><td></td><td></td><td></td><td></td><td>24.747.067.0 58.0</td></tr><tr><td>RN50-BERT CLIPORT (single)</td><td>5.335.0 89.097.5 28.364.7 93.3 98.8</td><td></td><td></td><td></td><td>6.2 12.2 13.7 24.3</td><td>21.5 31.2</td><td>30.7 41.3</td><td>31.8 47.8 54.5 59.5</td><td></td><td>93.1</td><td>98.0</td><td>)47.2</td><td>46.546.533.444.4 51.0</td><td>41.3 76.6</td><td>44.9 75.2</td><td>59.4</td><td>28.0 66.1 92.9</td><td>91.392.1 97.4100</td><td></td><td>56.1</td><td></td><td></td><td>17.4 75.1 85.3 89.3 89.7 95.9 99.4</td></tr><tr><td>CLIPORT (multi)</td><td>33.5 75.3 96.8 96.5 23.3 26.831.7 22.2 48.9 72.4 90.3 89.0 56.6 62.6 64.9 62.8</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>49.9 51.8 48.2 59.8</td><td></td><td></td><td></td><td></td><td>61.6 96.3 98.7 98.1</td><td></td><td></td><td></td><td></td><td></td><td>60.1 65.6 76.7 68.7</td></tr><tr><td> CLIPORT (multi-attr)</td><td>一</td><td></td><td></td><td></td><td></td><td></td><td>15.5 51.5 59.3 79.8</td><td>assembling-kits-seq</td><td></td><td></td><td></td><td>assembling-kits-seq</td><td></td><td></td><td></td><td>put-blocks-in-bowls</td><td></td><td></td><td></td><td></td><td></td><td></td><td>56.7 78.0 88.3 96.9 put-blocks-in-bowls</td></tr><tr><td></td><td></td><td>align-rope</td><td></td><td></td><td> packing-unseen-shapes</td><td></td><td></td><td></td><td>seen-colors</td><td></td><td></td><td></td><td></td><td>unseen-colors</td><td></td><td></td><td>seen-colors</td><td></td><td></td><td></td><td></td><td>unseen-colors</td><td></td></tr><tr><td>Transporter-only [2]</td><td>1</td><td>10</td><td>100</td><td>1000</td><td>1</td><td>10 100</td><td>1000</td><td>1</td><td>10</td><td>100</td><td>1000</td><td>1</td><td>10</td><td>100</td><td>1000</td><td>1</td><td>10</td><td>100</td><td>1000</td><td>1</td><td>10</td><td>100</td><td>1000</td></tr><tr><td>CLIP-only</td><td>6.930.633.1</td><td></td><td></td><td>51.5</td><td></td><td>16.0 20.0 22.0</td><td>22.0</td><td>5.8</td><td>11.6</td><td></td><td>28.6 29.6</td><td>7.8</td><td>17.6</td><td>25.6</td><td>28.4</td><td>16.8 333.3 62.7</td><td></td><td></td><td>64.7</td><td>11.7</td><td></td><td>17.2 14.8</td><td>18.7 11.2 34.2 33.2 44.5</td></tr><tr><td>RN50-BERT CLIPORT (single)</td><td></td><td>3.125.063.8</td><td>13.4 48.7 70.4</td><td>70.7 57.1</td><td>19.0 25.0</td><td>13.0 28.0 44.0 32.0</td><td>50.0 44.0</td><td>0.8 2.2</td><td>9.2 5.6</td><td>19.8 11.6</td><td>23.0 21.8</td><td>2.0 1.6</td><td>4.6 6.4</td><td>10.8 10.4</td><td>19.8 18.4</td><td>23.5 60.2 93.5 13.8 44.581.2</td><td></td><td>91.8</td><td>97.7</td><td></td><td></td><td></td><td>223.030.323.8</td></tr><tr></table>
|
| 119 |
+
|
| 120 |
+
Table 1. Language-Conditioned Test Results. Task success scores (mean $\%$ ) from 100 evaluation instances vs. # of training demonstrations (1, 10, 100, or 1000). The challenges pertaining to each task are described in Appendix A. CLIPORT (single) models are trained on seen splits, and evaluated on both seen and unseen splits. CLIPORT (multi) models are trained on seen splits of all 10 tasks with 1T, 10T, 100T, and 1000T demonstrations where $\mathbb { T } = 1 0$ . CLIPORT (multi-attr) indicate CLIPORT (multi) models trained on seen-and-unseen splits from all tasks except for that one particular heldout task, for which it is trained only the seen split. See Figure 3 for an overview with average scores.
|
| 121 |
+
|
| 122 |
+
learning (i.e. $n \geq 1 0 .$ ) in lieu of semantic stream alternatives like ImageNet-trained ResNet50 [62] with BERT [38]. Image-goal models outperform CLIPORT (single) in packing Google objects, but this is only because they do not have to solve the language-grounding problem.
|
| 123 |
+
|
| 124 |
+
Multi-Task Performance. In realistic scenarios, we want the robot to be capable of any task, not just one task. We investigate this through CLIPORT (multi) in Table 1 with one multi-task model trained on all 10 tasks. CLIPORT (multi) models are trained only on seen-splits of tasks, so an unseen attribute like ‘pink’ is consistent throughout single and multi-task settings. Surprisingly, CLIPORT (multi) outperforms single-task CLIPORT (single) models in $4 1 / 7 2 = 5 7 \%$ of the evaluations in Table 1. This trend is also evident in Figure 3 (seen), especially in instances with 100 demonstrations or less. Although CLIPORT (multi) is trained on more diverse data from other tasks, both CLIPORT (multi) and CLIPORT (single) have access to the same amount of data per task. This supports our premise that language is a strong conditioning mechanism for reusing concepts from other tasks without learning them from scratch. It also validates a trait of data-driven approaches where training on lots of diverse data leads to more robust and generalizable representations [1, 63]. However, CLIPORT (multi) performs worse on longer-horizon tasks like align-rope. We hypothesize that this is because longer-horizon tasks get less coverage of input-action pairs in the dataset. Future works could use better sampling methods that balance tasks according to their average time horizon.
|
| 125 |
+
|
| 126 |
+
Generalizing to Unseen Attributes. Tasks that require generalizing to novel colors, shapes, and objects are more difficult and all our agents achieve relatively lower performance on these tasks, as shown in Figure 3 (unseen). However, CLIPORT (single) models do substantially better than chance, i.e., Transporter-only. The lower performances are due to the difficulty of grounding unseen attributes such as ‘pink’ and ‘orange’ in the language instruction “put the pink block on the orange bowl”, when the agent has never encountered words ‘orange’, ‘pink’ or their corresponding visual characteristics in the context of the physical environment. Although pre-trained CLIP has been exposed to the attribute ‘pink’, it could correspond to different concepts in the physical setting depending on factors like lighting condition, and thus requires at least few examples to condition the trainable semantic decoder layers. Additionally, we notice that CLIPORT (single) is also less prone to overfitting compared to Transporter-only. As evidenced in towers-of-hanoi-seq-unseen-colors task in Table 1, Transporter-only suffers from a performance drop because of rings with unseen colors despite the fact that Tower of Hanoi can be solved without attending to the colors and simply focusing on the ring size. We hypothesize that since CLIP was trained on diverse internet data, it enables our agent to focus on task-relevant concepts while ignoring irrelevant aspects of the task.
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 4. Affordance predictions from CLIPORT (multi) models in sim (left two) and real settings (right three). More examples in Appendix H.
|
| 130 |
+
|
| 131 |
+
Transferring Attributes across Tasks. One solution for dealing with unseen attributes is to explicitly learn these attributes from other tasks. We study this with CLIPORT (multi-attr) in Table 1 and Figure 3 (unseen). For these models, CLIPORT (multi) is trained on both seen-and-unseen splits from all tasks except for the task being evaluated on, for which it was only trained on the seen split. As such, this evaluation measures whether having seen pink blocks in put-blocks-in-bowl-unseen-colors helps solve “pack all the pink and cyan boxes” in packing-box-pairs-unseen-colors. Results indicate that such explicit transfers result in significant improvements. For instance, on the put-blocks-inbowls-unseen-colors task for $n = 1 0 0 0$ , CLIPORT (multi)’s performance increases from 45.8 to 75.7.
|
| 132 |
+
|
| 133 |
+
# 4.3 Real-Robot Experiments
|
| 134 |
+
|
| 135 |
+
We validated our results in hardware with a Franka Panda manipulator. See Appendix D for setup details. Table 2 reports success rates for a multi-task model trained and evaluated on 9 real-world tasks. Due to COVID restrictions, we could not conduct largescale user-studies, so we report on small train (5-10 demos) and test sets (5-10 runs) per task. Overall, CLIPORT (multi) is effective at few-shot learning with just 179 samples, and the performances roughly correspond to those in simulated experiments, with simple block manipulation tasks achieving $\sim 7 0 \%$ . We estimate that for more robust real-world performance at least 50 to 100 training demonstrations are necessary, as evident in Figure 3. Interestingly, we observed that the model sometimes exploits biases in the training data instead of learning to ground instructions. For instance, in Put Blocks in Bowl, the training set consisted of only one datapoint on “yellow blocks” being placed inside a “blue bowl”. This made it difficult to condition the model to place “yellow blocks” in non-blue bowls. But instances with just one or two examples where a colored block went to different colored bowls was sufficient to make the model pay attention to the language. In summary, unbiased datasets containing both a good coverage of expected skills and invariances, and a decent number of training demonstrations, are crucial for good real-world performance.
|
| 136 |
+
|
| 137 |
+
<table><tr><td>Task # Train (Samples) #Test Succ.%</td></tr><tr><td>Stack Blocks</td></tr><tr><td>5 (13) 10 70.0 5(10) 10 65.0</td></tr><tr><td>Put Blocks in Bowl Pack Objects 10 (31) 10 60.0</td></tr><tr><td>Move Rook 4(29) 10 70.0</td></tr><tr><td>Fold Cloth 9(9) 10 57.0</td></tr><tr><td>Read Text 2(26) 10 55.0</td></tr><tr><td>Loop Rope 4(12) 10 60.0</td></tr><tr><td>Sweep Beans 5 (23) 5 60.6</td></tr><tr><td>Pick Cherries 4(26) 5 75.0</td></tr></table>
|
| 138 |
+
|
| 139 |
+
Table 2. Success rates $( \% )$ of a multi-task model trained an evaluated 9 real-world tasks (see Figure 1). Samples indicate total image-action pairs, e.g 1 in Figure 9.
|
| 140 |
+
|
| 141 |
+
# 5 Conclusion
|
| 142 |
+
|
| 143 |
+
We introduced CLIPORT, an end-to-end framework for language-conditioned fine-grained manipulation. Our experiments, specifically with multi-task models, indicate that data-driven approaches to generalization have yet to be fully-exploited in robotics. Coupled with the right action abstraction and spatio-semantic priors, end-to-end methods can quickly learn new skills without requiring top-down pipelines that need task-specific engineering.
|
| 144 |
+
|
| 145 |
+
While CLIPORT can solve a range of tabletop tasks, extending it to dexterous 6-DOF manipulation that goes beyond the two-step primitive remains a challenge. As such, it cannot handle complex partially-observable scenes, or output continuous control for multi-fingered hands, or predict task-completion (see Appendix I for an extended discussion). But overall, we are excited by the confluence of data and structural priors for building scalable and generalizable robotic systems.
|
| 146 |
+
|
| 147 |
+
# Acknowledgments
|
| 148 |
+
|
| 149 |
+
All simulated experiments were facilitated through the Hyak computing cluster funded by the STF at the University of Washington. We thank Mohak Bhardwaj for help with the Franka setup at UW. We are also grateful to our colleagues Chris Xie, Jesse Thomason, and Valts Blukis for providing feedback on the initial draft. This work was funded in part by ONR under award #1140209-405780.
|
| 150 |
+
|
| 151 |
+
# References
|
| 152 |
+
|
| 153 |
+
[1] A. Radford, J. W. Kim, C. Hallacy, A. Ramesh, G. Goh, S. Agarwal, G. Sastry, A. Askell, P. Mishkin, J. Clark, G. Krueger, and I. Sutskever. Learning Transferable Visual Models From Natural Language Supervision. arXiv:2103.00020 [cs], Feb. 2021.
|
| 154 |
+
[2] A. Zeng, P. Florence, J. Tompson, S. Welker, J. Chien, M. Attarian, T. Armstrong, I. Krasin, D. Duong, V. Sindhwani, and J. Lee. Transporter networks: Rearranging the visual world for robotic manipulation. Conference on Robot Learning (CoRL), 2020.
|
| 155 |
+
[3] I. Akkaya, M. Andrychowicz, M. Chociej, M. Litwin, B. McGrew, A. Petron, A. Paino, M. Plappert, G. Powell, R. Ribas, et al. Solving rubik’s cube with a robot hand. arXiv preprint arXiv:1910.07113, 2019.
|
| 156 |
+
[4] D. Kalashnikov, A. Irpan, P. Pastor, J. Ibarz, A. Herzog, E. Jang, D. Quillen, E. Holly, M. Kalakrishnan, V. Vanhoucke, et al. Qt-opt: Scalable deep reinforcement learning for visionbased robotic manipulation. Conference on Robot Learning (CoRL), 2018.
|
| 157 |
+
[5] D. Kalashnikov, J. Varley, Y. Chebotar, B. Swanson, R. Jonschkowski, C. Finn, S. Levine, and K. Hausman. Mt-opt: Continuous multi-task robotic reinforcement learning at scale. arXiv preprint arXiv:2104.08212, 2021.
|
| 158 |
+
[6] D. Seita, P. Florence, J. Tompson, E. Coumans, V. Sindhwani, K. Goldberg, and A. Zeng. Learning to rearrange deformable cables, fabrics, and bags with goal-conditioned transporter networks. In IEEE International Conference on Robotics and Automation (ICRA), 2021.
|
| 159 |
+
[7] M. Shridhar and D. Hsu. Interactive visual grounding of referring expressions for human-robot interaction. In Proceedings of Robotics: Science and Systems (RSS), 2018.
|
| 160 |
+
[8] C. Matuszek, L. Bo, L. Zettlemoyer, and D. Fox. Learning from unscripted deictic gesture and language for human-robot interactions. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 28, 2014.
|
| 161 |
+
[9] M. Bollini, S. Tellex, T. Thompson, N. Roy, and D. Rus. Interpreting and executing recipes with a cooking robot. In Experimental Robotics, pages 481–495. Springer, 2013.
|
| 162 |
+
[10] D. K. Misra, J. Sung, K. Lee, and A. Saxena. Tell me dave: Context-sensitive grounding of natural language to manipulation instructions. The International Journal of Robotics Research (IJRR), 35(1-3):281–300, 2016.
|
| 163 |
+
[11] T. Chen, S. Kornblith, M. Norouzi, and G. Hinton. A simple framework for contrastive learning of visual representations. In International conference on machine learning, pages 1597–1607. PMLR, 2020.
|
| 164 |
+
[12] K. He, H. Fan, Y. Wu, S. Xie, and R. Girshick. Momentum contrast for unsupervised visual representation learning. In The IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 9729–9738, 2020.
|
| 165 |
+
[13] J. Lu, D. Batra, D. Parikh, and S. Lee. Vilbert: Pretraining task-agnostic visiolinguistic representations for vision-and-language tasks. In Advances in Neural Information Processing Systems (NeuRIPS), 2019.
|
| 166 |
+
[14] 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 European Conference on Computer Vision, pages 104–120. Springer, 2020.
|
| 167 |
+
[15] H. Tan and M. Bansal. Lxmert: Learning cross-modality encoder representations from transformers. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2019.
|
| 168 |
+
[16] D. H. Hubel and T. N. Wiesel. Receptive fields and functional architecture in two nonstriate visual areas (18 and 19) of the cat. Journal of neurophysiology, 28(2):229–289, 1965.
|
| 169 |
+
[17] M. Livingstone and D. Hubel. Segregation of form, color, movement, and depth: anatomy, physiology, and perception. Science, 240(4853):740–749, 1988.
|
| 170 |
+
[18] A. Derrington and P. Lennie. Spatial and temporal contrast sensitivities of neurones in lateral geniculate nucleus of macaque. The Journal of physiology, 357(1):219–240, 1984.
|
| 171 |
+
[19] J. J. Gibson. The ecological approach to visual perception: classic edition. Psychology Press, 2014.
|
| 172 |
+
[20] A. Kamath, M. Singh, Y. LeCun, I. Misra, G. Synnaeve, and N. Carion. Mdetr–modulated detection for end-to-end multi-modal understanding. arXiv preprint arXiv:2104.12763, 2021.
|
| 173 |
+
[21] K. He, G. Gkioxari, P. Dollar, and R. Girshick. Mask r-cnn. In ´ The IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2017.
|
| 174 |
+
[22] Y. Xiang, T. Schmidt, V. Narayanan, and D. Fox. Posecnn: A convolutional neural network for 6d object pose estimation in cluttered scenes. In Proceedings of Robotics: Science and Systems (RSS), 2018.
|
| 175 |
+
[23] M. Zhu, K. G. Derpanis, Y. Yang, S. Brahmbhatt, M. Zhang, C. Phillips, M. Lecce, and K. Daniilidis. Single image 3d object detection and pose estimation for grasping. In 2014 IEEE International Conference on Robotics and Automation (ICRA), pages 3936–3943. IEEE, 2014.
|
| 176 |
+
[24] A. Zeng, K.-T. Yu, S. Song, D. Suo, E. Walker, A. Rodriguez, and J. Xiao. Multi-view selfsupervised deep learning for 6d pose estimation in the amazon picking challenge. In 2017 IEEE international conference on robotics and automation (ICRA), pages 1386–1383. IEEE, 2017.
|
| 177 |
+
[25] X. Deng, Y. Xiang, A. Mousavian, C. Eppner, T. Bretl, and D. Fox. Self-supervised 6d object pose estimation for robot manipulation. In 2020 IEEE International Conference on Robotics and Automation (ICRA), pages 3665–3671. IEEE, 2020.
|
| 178 |
+
[26] C. Xie, Y. Xiang, A. Mousavian, and D. Fox. The best of both modes: Separately leveraging rgb and depth for unseen object instance segmentation. In Conference on Robot Learning (CoRL), pages 1369–1378. PMLR, 2020.
|
| 179 |
+
[27] P. R. Florence, L. Manuelli, and R. Tedrake. Dense object nets: Learning dense visual object descriptors by and for robotic manipulation. In Conference on Robot Learning (CoRL), 2018.
|
| 180 |
+
[28] P. Florence, L. Manuelli, and R. Tedrake. Self-supervised correspondence in visuomotor policy learning. IEEE Robotics and Automation Letters, 5(2):492–499, 2019.
|
| 181 |
+
[29] P. Sundaresan, J. Grannen, B. Thananjeyan, A. Balakrishna, M. Laskey, K. Stone, J. E. Gonzalez, and K. Goldberg. Learning rope manipulation policies using dense object descriptors trained on synthetic depth data. In 2020 IEEE International Conference on Robotics and Automation (ICRA), pages 9411–9418. IEEE, 2020.
|
| 182 |
+
[30] L. Manuelli, W. Gao, P. Florence, and R. Tedrake. kpam: Keypoint affordances for categorylevel robotic manipulation. In International Symposium on Robotics Research (ISRR), 2019.
|
| 183 |
+
[31] T. D. Kulkarni, A. Gupta, C. Ionescu, S. Borgeaud, M. Reynolds, A. Zisserman, and V. Mnih. Unsupervised learning of object keypoints for perception and control. Advances in neural information processing systems (NeuRIPS), 32:10724–10734, 2019.
|
| 184 |
+
[32] X. Liu, R. Jonschkowski, A. Angelova, and K. Konolige. Keypose: Multi-view 3d labeling and keypoint estimation for transparent objects. In The IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 11602–11610, 2020.
|
| 185 |
+
[33] K. Zakka, A. Zeng, J. Lee, and S. Song. Form2fit: Learning shape priors for generalizable assembly from disassembly. In 2020 IEEE International Conference on Robotics and Automation (ICRA), pages 9404–9410. IEEE, 2020.
|
| 186 |
+
[34] S. Song, A. Zeng, J. Lee, and T. Funkhouser. Grasping in the wild: Learning 6dof closedloop grasping from low-cost demonstrations. IEEE Robotics and Automation Letters, 5(3): 4978–4985, 2020.
|
| 187 |
+
[35] Y. Wu, W. Yan, T. Kurutach, L. Pinto, and P. Abbeel. Learning to Manipulate Deformable Objects without Demonstrations. In Proceedings of Robotics: Science and Systems (RSS), 2020.
|
| 188 |
+
[36] L. Yen-Chen, A. Zeng, S. Song, P. Isola, and T.-Y. Lin. Learning to see before learning to act: Visual pre-training for manipulation. In IEEE International Conference on Robotics and Automation (ICRA), 2020.
|
| 189 |
+
[37] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin. Attention is all you need. In Advances in Neural Information Processing Systems (NeuRIPS), 2017.
|
| 190 |
+
[38] J. Devlin, M. W. Chang, K. Lee, and K. Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics (NAACL), 2018.
|
| 191 |
+
[39] 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. In International Conference on Learning Representations, 2020.
|
| 192 |
+
[40] F. Yu, J. Tang, W. Yin, Y. Sun, H. Tian, H. Wu, and H. Wang. Ernie-vil: Knowledge enhanced vision-language representations through scene graph. arXiv preprint arXiv:2006.16934, 2020.
|
| 193 |
+
[41] Y. Bisk, D. Yuret, and D. Marcu. Natural language communication with robots. In Proceedings of the North American Chapter of the Association for Computational Linguistics (NAACL), pages 751–761, 2016.
|
| 194 |
+
[42] J. Thomason, S. Zhang, R. J. Mooney, and P. Stone. Learning to interpret natural language commands through human-robot dialog. In Twenty-Fourth International Joint Conference on Artificial Intelligence (IJCAI), 2015.
|
| 195 |
+
[43] J. Hatori, Y. Kikuchi, S. Kobayashi, K. Takahashi, Y. Tsuboi, Y. Unno, W. Ko, and J. Tan. Interactively picking real-world objects with unconstrained spoken language instructions. In Proceedings of International Conference on Robotics and Automation (ICRA), 2018.
|
| 196 |
+
[44] Y. Chen, R. Xu, Y. Lin, and P. A. Vela. A Joint Network for Grasp Detection Conditioned on Natural Language Commands. arXiv:2104.00492 [cs], Apr. 2021.
|
| 197 |
+
[45] V. Blukis, R. A. Knepper, and Y. Artzi. Few-shot object grounding for mapping natural language instructions to robot control. In Conference on Robot Learning (CoRL), 2020.
|
| 198 |
+
[46] C. Paxton, Y. Bisk, J. Thomason, A. Byravan, and D. Fox. Prospection: Interpretable plans from language by predicting the future. In International Conference on Robotics and Automation (ICRA), pages 6942–6948. IEEE, 2019.
|
| 199 |
+
[47] S. Tellex, T. Kollar, S. Dickerson, M. Walter, A. Banerjee, S. Teller, and N. Roy. Understanding natural language commands for robotic navigation and mobile manipulation. In Proceedings of the AAAI Conference on Artificial Intelligence (AAAI), 2011.
|
| 200 |
+
[48] C. Lynch and P. Sermanet. Grounding language in play. arXiv preprint arXiv:2005.07648, 2020.
|
| 201 |
+
[49] K. Simonyan and A. Zisserman. Two-stream convolutional networks for action recognition in videos. arXiv preprint arXiv:1406.2199, 2014.
|
| 202 |
+
[50] C. Feichtenhofer, A. Pinz, and A. Zisserman. Convolutional two-stream network fusion for video action recognition. In The IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 1933–1941, 2016.
|
| 203 |
+
[51] C. Feichtenhofer, H. Fan, J. Malik, and K. He. Slowfast networks for video recognition. In Proceedings of the IEEE/CVF International Conference on Computer Vision (CVPR), pages 6202–6211, 2019.
|
| 204 |
+
[52] E. Kazakos, A. Nagrani, A. Zisserman, and D. Damen. Slow-fast auditory streams for audio recognition. In ICASSP 2021-2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 855–859. IEEE, 2021.
|
| 205 |
+
[53] F. Xiao, Y. J. Lee, K. Grauman, J. Malik, and C. Feichtenhofer. Audiovisual slowfast networks for video recognition. arXiv preprint arXiv:2001.08740, 2020.
|
| 206 |
+
[54] A. Zeng, S. Song, K.-T. Yu, E. Donlon, F. R. Hogan, M. Bauza, D. Ma, O. Taylor, M. Liu, E. Romo, et al. Robotic pick-and-place of novel objects in clutter with multi-affordance grasping and cross-domain image matching. In 2018 IEEE international conference on robotics and automation (ICRA), pages 3750–3757. IEEE, 2018.
|
| 207 |
+
[55] E. Jang, S. Vijayanarasimhan, P. Pastor, J. Ibarz, and S. Levine. End-to-end learning of semantic grasping. In Conference on Robot Learning (CoRL), Proceedings of Machine Learning Research. PMLR, 2017.
|
| 208 |
+
[56] R. Kondor and S. Trivedi. On the generalization of equivariance and convolution in neural networks to the action of compact groups. In International Conference on Machine Learning (ICML), 2018.
|
| 209 |
+
[57] T. Cohen and M. Welling. Group equivariant convolutional networks. In International conference on machine learning (ICML), 2016.
|
| 210 |
+
[58] D. Misra, A. Bennett, V. Blukis, E. Niklasson, M. Shatkhin, and Y. Artzi. Mapping instructions to actions in 3d environments with visual goal prediction. In Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing (EMNLP), 2018.
|
| 211 |
+
[59] G. Goh, N. C. †, C. V. †, S. Carter, M. Petrov, L. Schubert, A. Radford, and C. Olah. Multimodal neurons in artificial neural networks. Distill, 2021. doi:10.23915/distill.00030. https://distill.pub/2021/multimodal-neurons.
|
| 212 |
+
[60] E. Coumans and Y. Bai. Pybullet, a python module for physics simulation for games, robotics and machine learning. 2016.
|
| 213 |
+
[61] Google scanned objects dataset, 2020. URL https://app.ignitionrobotics.org/ GoogleResearch/fuel/collections/Google%20Scanned%20Objects.
|
| 214 |
+
[62] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In The IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 770–778, 2016.
|
| 215 |
+
[63] J. Lu, V. Goswami, M. Rohrbach, D. Parikh, and S. Lee. 12-in-1: Multi-task vision and language representation learning. In The IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020.
|
| 216 |
+
[64] A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. arXiv preprint arXiv:1912.01703, 2019.
|
| 217 |
+
[65] V. Sanh, L. Debut, J. Chaumond, and T. Wolf. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108, 2019.
|
| 218 |
+
[66] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. Imagenet: A large-scale hierarchical image database. In 2009 IEEE conference on computer vision and pattern recognition, pages 248–255. Ieee, 2009.
|
| 219 |
+
[67] J. Mao, C. Gan, P. Kohli, J. B. Tenenbaum, and J. Wu. The neuro-symbolic concept learner: Interpreting scenes, words, and sentences from natural supervision. arXiv preprint arXiv:1904.12584, 2019.
|
| 220 |
+
[68] D. Ding, F. Hill, A. Santoro, and M. Botvinick. Object-based attention for spatio-temporal reasoning: Outperforming neuro-symbolic models with flexible distributed architectures. arXiv preprint arXiv:2012.08508, 2020.
|
| 221 |
+
[69] E. M. Bender, T. Gebru, A. McMillan-Major, and S. Shmitchell. On the dangers of stochastic parrots: Can language models be too big? In Proceedings of the 2021 ACM Conference on Fairness, Accountability, and Transparency, pages 610–623, 2021.
|
md/train/Aw96fN64soV/Aw96fN64soV.md
ADDED
|
@@ -0,0 +1,334 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Neural Analysis and Synthesis: Reconstructing Speech from Self-Supervised Representations
|
| 2 |
+
|
| 3 |
+
Hyeong-Seok Choi1,4 Juheon Lee1,4 Wansoo Kim1,4
|
| 4 |
+
|
| 5 |
+
Jie Hwan Lee4 Hoon Heo4 Kyogu Lee1,2,3,4
|
| 6 |
+
|
| 7 |
+
1MARG, Department of Intelligence and Information, Seoul National University 2GSAI 3AIIS 4Supertone Inc.
|
| 8 |
+
|
| 9 |
+
{kekepa15, juheon2, wansookim, kglee}@snu.ac.kr, {wiswisbus, hoon}@supertone.ai
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
We present a neural analysis and synthesis (NANSY) framework that can manipulate voice, pitch, and speed of an arbitrary speech signal. Most of the previous works have focused on using information bottleneck to disentangle analysis features for controllable synthesis, which usually results in poor reconstruction quality. We address this issue by proposing a novel training strategy based on information perturbation. The idea is to perturb information in the original input signal (e.g., formant, pitch, and frequency response), thereby letting synthesis networks selectively take essential attributes to reconstruct the input signal. Because NANSY does not need any bottleneck structures, it enjoys both high reconstruction quality and controllability. Furthermore, NANSY does not require any labels associated with speech data such as text and speaker information, but rather uses a new set of analysis features, i.e., wav2vec feature and newly proposed pitch feature, Yingram, which allows for fully self-supervised training. Taking advantage of fully selfsupervised training, NANSY can be easily extended to a multilingual setting by simply training it with a multilingual dataset. The experiments show that NANSY can achieve significant improvement in performance in several applications such as zero-shot voice conversion, pitch shift, and time-scale modification 1.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
Analyzing and synthesizing an arbitrary speech signal is inarguably a significant research topic that has been studied for decades. Traditionally, this has been studied in the digital signal processing (DSP) field using fundamental methods such as sinusoidal modeling or linear predictive coding (LPC), and it is the analysis and synthesis framework that lies at the heart of those fundamental methods $[ \sqrt { 2 6 } , \bigstar ]$ . These traditional methods, however, are limited in terms of controllability because the decomposed representations are still low-level representations. It is obvious that the closer we decompose a signal into high-level/interpretable representations, the more we gain access to the controllability. Given this consideration, we aim to design a neural analysis and synthesis (NANSY) framework by decomposing a speech signal into analysis features that represent pronunciation, timbre, pitch, and energy. The decomposed representations can be manipulated and re-synthesized, enabling users to manipulate speech signals in various ways.
|
| 18 |
+
|
| 19 |
+
It is worth noting that many similar ideas have been recently proposed in the context of voice conversion applications. We categorize the previous works in two ways, i.e., 1. Text-based approach,
|
| 20 |
+
|
| 21 |
+
2. Information bottleneck approach. The first approach exploits the fact that the text modality is inherently disentangled from the speaker identity. One of the most popular text-based approaches is to use a pre-trained automatic speech recognition (ASR) network to extract a phonetic posteriogram (PPG) and use it as a linguistic feature [41]. Then, combining the PPG with the target speaker information, the features are re-synthesized to a speech signal. Another alternative approach is to directly use text scripts by aligning it to a paired source signal $\mathbb { \lVert 3 3 \rVert }$ . Although these ideas have shown promising results, it is important to note that these approaches have common problems. First, in order to extract the PPG features, it is required to train an ASR network in a supervised manner, which demands a lot of paired text and waveform datasets. Additionally, the language dependency of the ASR network limits the model’s capability to be extended to multilingual settings or languages with low-resources. To address these concerns, efforts have been made to divert from using the text information and the most popular approach is to use an information bottleneck. The key idea is to restrict the information flow by reducing time/channel dimension, and normalizing/quantizing intermediate representations [36, 10, 51]. Although these ideas have been explored in many ways, one critical problem is that there exists an inevitable trade-off between the degree of disentanglement and the reconstruction quality. In other words, there is a trade-off between speaker similarity and the preservation of original content such as linguistic and pitch information.
|
| 22 |
+
|
| 23 |
+
To avoid the major concern of the text-based approach, we suggest to use two analysis features which are wav2vec and a newly proposed feature, Yingram. In order to preserve the linguistic information without any text information, we utilize wav2vec $2 . 0 \mathbb { H }$ , trained on 53 languages in total $\mathbb { m }$ . While the features from wav2vec 2.0 have mostly been used for a downstream task, we seek the possibility of using them for an upstream/generation task. In addition, we propose a new feature that can effectively represent and control pitch information. Although it is the fundamental frequency $( f _ { 0 } )$ that is mostly used to represent the pitch information, $f _ { 0 }$ is sometimes ill-defined when there exists sub-harmonics in the signal (e.g., vocal fry) [16, 1, 2]. We address this issue by proposing a controllable but more abstract feature than $f _ { 0 }$ that still includes information such as sub-harmonics. Because the proposed feature is heavily inspired by the famous Yin algorithm $\mathbb { \lVert \lambda \rVert }$ , we refer to this feature as Yingram.
|
| 24 |
+
|
| 25 |
+
Although the analysis features above have enough information to reconstruct the original speech signal, we have found that the information in the proposed analysis features share common information such as pitch and timbre. To disentangle the common information so each feature can control a specific attribute for its desired purpose (e.g., wav2vec linguistic information only, Yingram pitch information only), we propose an information perturbation approach, a simple yet effective solution to this problem. The idea is to simply perturb all the information we do not want to control from the input features, thereby training the neural network to not extract the undesirable attributes from the features. Through this way, the model no longer suffers from the unavoidable trade-off between reconstruction quality and feature disentanglement, unlike the information bottleneck approach.
|
| 26 |
+
|
| 27 |
+
Lastly, we would like to deal with unseen languages at test time. To this end, we propose a new test-time self-adaptation (TSA) strategy. The proposed self-adaptation strategy does not fine-tune the model parameters but only the input linguistic feature, which consequently modifies the mispronounced parts of the reconstructed sample. Because the proposed TSA requires only a single sample at test-time, it adds a large flexibility for the model to be used in many scenarios (e.g., low-resource language).
|
| 28 |
+
|
| 29 |
+
The contributions of this paper are as follows:
|
| 30 |
+
|
| 31 |
+
• We propose a neural analysis and synthesis (NANSY) framework that can be trained in a fully self-supervised manner (no text, no speaker information needed). The proposed method is based on a new set of analysis features and information perturbation.
|
| 32 |
+
• The proposed model can be used for various applications, including zero-shot voice conversion, formant preserving pitch shift, and time-scale modification.
|
| 33 |
+
• We propose a new test-time self-adaptation (TSA) technique than can be used even on unseen languages using only a single test-time speech sample.
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
Figure 1: The overview of the training procedure and information flow of the proposed neural analysis and synthesis (NANSY) framework. The waveform is first perturbed using functions $f$ and $g$ . $f$ perturbs formant, pitch, and frequency response. $g$ perturbs formant and frequency response while preserving pitch. w2v denotes wav2vec encoder and spk denotes a speaker embedding network. L, P, S, E denotes Linguistic, Pitch, Speaker, and Energy information, respectively. The tilde symbol is attached when the information is perturbed using the perturbation functions. The dashed boxes denote the modules that are being trained.
|
| 37 |
+
|
| 38 |
+
# 2.1 Analysis Features
|
| 39 |
+
|
| 40 |
+
Linguistic To reconstruct an intelligible speech signal, it is crucial to extract rich linguistic information from the speech signal. To this end, we resort to XLSR-53: a wav2vec 2.0 model pre-trained on $5 6 \mathrm { k }$ hours of speech in 53 languages [11]. The extracted features from XLSR-53 have shown superior performance on downstream tasks such as ASR, especially on low-resource languages. We conjecture, therefore, that the extracted features from this model can provide language-agnostic linguistic information. Now the question is, from which layer should the features be extracted? Recently, it has been reported that the representation from different layers of wav2vec 2.0 exhibit different characteristics. Especially, Shah et al. $\mathbb { \lVert 3 9 \rVert }$ showed that it is the output from the middle layer that has the most relevant characteristics to pronunciation2. In light of this empirical observation, we decided to use the intermediate features of XLSR-53. More specifically, we used the output from the 12th layer of the 24-layer transformer encoder.
|
| 41 |
+
|
| 42 |
+
Speaker Perhaps the most common approach to extract speaker embeddings is to first train a speaker recognition network in a supervised manner and then reuse the network for the generation task, assuming that the speaker embedding from the trained network can represent the characteristics of unseen speakers [21, 36]. Here we would like to take one step further and assume that we do not have speaker labels to train a speaker recognition network in a supervised manner. To mitigate this disadvantage, we again use the representation from XLSR-53, which makes the proposed method fully self-supervised. To determine which layer of XLSR-53 to extract the representation from, we first analyzed the features from each layer. Specifically, we averaged the representation of each layer along the time-axis and visualized utterances of 20 randomly selected speakers from the VCTK dataset using TSNE [47, 46]. In Fig. $\bigstar$ we can observe that the representation from the 1st layer of XLSR-53 already forms clusters for each speaker, while the latter layers (especially the last layer) tend to lack them. Note that this is in accordance with the previous observation in $\dot { \mathbb { I B } }$ . Taking this into consideration, we train a speaker embedding network that uses the 1st layer of XLSR-53 as an input. For the speaker embedding network, we borrow the neural architecture from a state-of-the-art speaker recognition network $\pmb { \mathbb { I } } \pmb { \ 4 } \|$ , which is based on 1D-convolutional neural networks (1D-CNN) with an attentive statistics pooling layer. The speaker embedding was $L _ { 2 }$ -normalized before conditioning. The speaker embeddings of seen and unseen speakers during training are also shown in Fig. 2.
|
| 43 |
+
|
| 44 |
+
Pitch Due to the irregular periodicity of the glottal pulse, we often hear creaky voice in speech, which is usually manifested as jitter or sub-harmonics in signals. This makes hard for $f _ { 0 }$ trackers to estimate $f _ { 0 }$ because the $f _ { 0 }$ itself is not well defined in such cases [16, 1, 2]. We take a hint from the popular Yin algorithm to address this issue. The Yin algorithm uses the cumulative mean normalized difference function $d _ { t } ^ { \prime } ( \tau )$ to extract frame-wise features from a raw waveform, which is defined as follows,
|
| 45 |
+
|
| 46 |
+

|
| 47 |
+
Figure 2: The visualization of intermediate representations of XLSR-53 using TSNE.
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
d _ { t } ^ { \prime } ( \tau ) = \left\{ \begin{array} { l l } { 1 , } & { \mathrm { i f } \ \tau = 0 } \\ { d _ { t } ( \tau ) / \sum _ { j = 1 } ^ { \tau } d _ { t } ( j ) , } & { \mathrm { o t h e r w i s e . } } \end{array} \right.
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
The $d _ { t } ( \tau )$ is a difference function that outputs a small value when there exists a periodicity on time-lag $\tau$ and it is defined as follows,
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
d _ { t } ( \tau ) = \sum _ { j = 1 } ^ { W } \left( x _ { j } - x _ { j + \tau } \right) ^ { 2 } = r _ { t } ( 0 ) + r _ { t + \tau } ( 0 ) - 2 r _ { t } ( \tau ) ,
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where $t , \tau , W$ , and $r _ { t }$ denote frame index, time lag, window size, and the auto-correlation function, respectively. After some post processing steps, the Yin algorithm selects $f _ { 0 }$ from multiple $f _ { 0 }$ candidates. See $\mathbb { \lVert \lambda \rVert }$ for more details. Rather than explicitly selecting $f _ { 0 }$ , we would like to train the network to generate pitch harmonics from the output of the function $d _ { t } ^ { \prime } ( \tau )$ . However, $d _ { t } ^ { \prime } ( \tau )$ itself is limited to be used as a pitch feature because it lacks controllability, unlike $f _ { 0 }$ . Therefore, we propose Yingram $Y$ by converting the time-lag axis to the midi-scale axis as follows,
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
Y _ { t } ( m ) = \frac { d _ { t } ^ { \prime } ( \lceil c ( m ) \rceil ) - d _ { t } ^ { \prime } ( \lfloor c ( m ) \rfloor ) } { \lceil c ( m ) \rceil - \lfloor c ( m ) \rfloor } \cdot ( c ( m ) - \lfloor c ( m ) \rfloor ) + d _ { t } ^ { \prime } ( \lfloor c ( m ) \rfloor ) ,
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
c ( m ) = \frac { s r } { 4 4 0 \cdot 2 ^ { ( \frac { m - 6 9 } { 1 2 } ) } } ,
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $m$ , $c ( m )$ , and $s r$ denote midi note, midi-to-lag conversion function, and sampling rate, respectively. We set 20 bins of Yingram to represent a semitone range. In addition, we set Yingram to represent the frequency between $1 0 . 7 7 \mathrm { h z }$ and $1 0 0 0 . 4 0 \mathrm { h z }$ by setting $W$ to 2048 and the range of $\tau$ between 22 and 2047. In the training stage, the input to the synthesis network is the frequency range between $2 5 . 1 1 \mathrm { h z }$ and $4 3 0 . 1 9 \mathrm { h z }$ , which is shown as scope in Fig. $\textcircled { 3 }$ After the training is finished, we can change the pitch by shifting the scope. That is, in the inference stage, one could simply change the pitch of the speech signal by shifting the scope. For example, if we move the scope down 20 bins, the pitch can be raised by a semitone.
|
| 70 |
+
|
| 71 |
+

|
| 72 |
+
Figure 3: The visualization of Yingram and the corresponding mel spectrogram.
|
| 73 |
+
|
| 74 |
+
Energy For the energy feature, we simply took an average from a log-mel spectrogram along the frequency axis.
|
| 75 |
+
|
| 76 |
+
# 2.2 Synthesis Network
|
| 77 |
+
|
| 78 |
+

|
| 79 |
+
Figure 4: The outputs of $\mathcal { G } _ { S }$ and $\mathcal { G } _ { F }$ . The two outputs from each generator are summed to reconstruct a mel spectrogram.
|
| 80 |
+
|
| 81 |
+
It is well-known that speech production can be explained by source-filter theory. Inspired by this, we separate synthesis networks into two parts, source generator $\mathcal { G } _ { S }$ and filter generator $\mathcal { G } _ { F }$ . While the energy and speaker features are common inputs for both generators, $\mathcal { G } _ { S }$ and $\mathcal { G } _ { F }$ differ in that they take Yingram and wav2vec features, respectively. Because the acoustic feature can be interpreted as a sum of source and filter in the log magnitude domain, we incorporate inductive bias in the model by summing the outputs from each generator similarly to $[ [ 2 5 ] ]$ . As will be discussed in more detail in the next section, even though the training loss is only defined using mel spectrograms, the network learns to separately generate the spectral envelope and pitch harmonics as shown in Fig. $4 .$ Note that this separation not only provides the interpretability to the model but also enables formant preserving pitch shifting. To summarize, the acoustic feature, mel spectrogram $\hat { M }$ , is generated as follows,
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\hat { M } = \mathcal { G } _ { S } ( \mathrm { Y i n g r a m } , S , E ) + \mathcal { G } _ { F } ( \mathrm { w a v } 2 \mathrm { v e c } , S , E ) ,
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
where $S$ and $E$ denote speaker embedding and energy features. We used stacks of 1D-CNN layers with gated linear units (GLU) $\pmb { \mathbb { I } }$ for generators. The detailed neural architecture of the generator is described in Appendix $\mathbf { B } .$ Note that each generator shares the same neural architecture. The only difference is the input features to the networks. Finally, the generated mel spectrogram is converted to waveform using the pre-trained HiFi-GAN vocoder $\pmb { \Vert 2 4 \Vert }$ .
|
| 88 |
+
|
| 89 |
+
# 3 Training
|
| 90 |
+
|
| 91 |
+
# 3.1 Information Perturbation
|
| 92 |
+
|
| 93 |
+
In our initial experiments, a neural network can be easily trained to reconstruct mel spectrograms using only the wav2vec feature. This implies that the wav2vec feature contains not only rich linguistic information but also information related to pitch and speaker. For that reason, we would like to train $\mathcal { G } _ { F }$ to selectively extract only the linguistic-related information from the wav2vec feature, not pitch and speaker information. In addition, we would like to train $\mathcal { G } _ { S }$ to selectively extract only the pitch-related information from the Yingram feature, not speaker information. To this end, we propose to perturb the information included in input waveform $x$ by using three functions that are 1. formant shifting $( f s )$ , 2. pitch randomization $( p r )$ , and 3. random frequency shaping using a parametric equalizer $( p e q ) \ L ^ { | 3 | }$ We applied a function $f$ on the wav2vec input, which is a chain of all three functions as follows, $\bar { f ( x ) } = \bar { f s ( p r ( p e q ( x ) ) ) }$ . On the Yingram side, we applied function $g$ , which is a chain of two functions $f s$ and peq so that $f _ { 0 }$ information is still preserved as follows, $g ( x ) = f s ( p e q ( x ) )$ . This way, we expect $\mathcal { G } _ { F }$ to take only the linguistic-related information from the wav2vec feature, and $\mathcal { G } _ { S }$ to take only pitch-related from the Yingram feature. Since the wav2vec and Yingram features can no longer provide the speaker-related information, the control of speaker information becomes uniquely dependent on the speaker embedding. The overview of the information flow is shown in Fig.
|
| 94 |
+
|
| 95 |
+
1. The hyperparameters of the perturbation functions are described more in Appendix A.
|
| 96 |
+
|
| 97 |
+
# 3.2 Training Loss
|
| 98 |
+
|
| 99 |
+
We used L1 loss between the generated mel spectrogram $\hat { M }$ and ground truth mel spectrogram $M$ to train the generators and speaker embedding network. However, it is well-known that the speech synthesis networks trained with L1 or L2 loss suffer from over-smootheness of the generated acoustic feature, which results in poor quality of the speech signal. Therefore, in addition to the L1 loss, we used the recent speaker conditional generative adversarial training method to mitigate this issue [8]. Writing the discriminator as $\bar { \cal D } ( { \cal M } , { \pmb { c } } _ { + } , { \pmb { c } } _ { - } ) : = \sigma ( h ( { \cal M } , { \pmb { c } } _ { + } , { \pmb { c } } _ { - } ) )$ , Choi et al. $\checkmark$ proposed to use projection conditioning $\mathbb { \left[ \left[ 2 \right] \right] }$ not only with the positive pairs but also with the negative pairs as follows,
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
h ( M , \pmb { c } _ { + } , \pmb { c } _ { - } ) = \psi ( \phi ( M ) ) + \pmb { c } _ { + } ^ { T } \phi ( M ) - \pmb { c } _ { - } ^ { T } \phi ( M ) ,
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
where $M$ denotes a mel spectrogram, $\sigma ( \cdot )$ denotes a sigmoid function, $c _ { + }$ denotes a speaker embedding from a positively paired input speech sample, and $c _ { - }$ denotes a speaker embedding from a randomly sampled speech utterance. $\phi ( \cdot )$ denotes an output from the intermediate layer of discriminator and $\psi ( \cdot )$ denotes a function that maps input vector to a scalar value. The detailed neural architecture of $\mathcal { D }$ is shown in Appendix B. The loss functions for discriminator $L _ { \mathcal { D } }$ and generator $L _ { \mathcal { G } }$ are as follows:
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\begin{array} { r l } & { L _ { \mathcal { D } } = - \mathbb { E } _ { ( M , c _ { + } , c _ { - } ) \sim p _ { d a t a } , \hat { M } \sim p _ { g e n } } [ l o g ( \sigma ( h ( M , c _ { + } , \pmb { c } _ { - } ) ) ) - l o g ( \sigma ( h ( \hat { M } , \pmb { c } _ { + } , \pmb { c } _ { - } ) ) ) ] , } \\ & { L _ { \mathcal { G } } = - \mathbb { E } _ { ( M , c _ { + } , c _ { - } ) \sim p _ { d a t a } , \hat { M } \sim p _ { g e n } } [ l o g ( \sigma ( h ( \hat { M } , \pmb { c } _ { + } , \pmb { c } _ { - } ) ) ) ] + | M - \hat { M } | . } \end{array}
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
# 3.3 Test-time Self-Adaptation
|
| 112 |
+
|
| 113 |
+
Although the synthesis network can reconstruct an intelligible speech from the wav2vec feature in most cases, we observed that the network sometimes outputs speech signals with wrong pronunciation, especially when tested on unseen languages. To alleviate this problem, we propose to modify only the input representation, that is, the wav2vec feature, without having to train the whole network again from scratch. As shown in Fig. $\textcircled { 5 }$ we first compute L1 loss between the generated mel spectrogram $\hat { M }$ and ground truth mel spectrogram $M$ in the test-time. Then, we
|
| 114 |
+
|
| 115 |
+

|
| 116 |
+
Figure 5: The illustration of TSA.
|
| 117 |
+
|
| 118 |
+
update only the parameterized wav2vec feature using the backpropagation signal from the loss. Note that the loss gradient (shown in red) is backpropagated only through the filter generator. Because this test-time training scheme requires only a single test-time sample and updates the input parameters by targeting the test-time sample itself, we call it test-time self-adaptation (TSA).
|
| 119 |
+
|
| 120 |
+
# 4 Experiments
|
| 121 |
+
|
| 122 |
+
# 4.1 Implementation Details
|
| 123 |
+
|
| 124 |
+
Dataset To train NANSY on English, we used two datasets, i.e., 1. VCTK4 [47], 2. train-clean-360 subset of LibriTTS3 [54]. We trained the model using $90 \%$ of samples for each speaker. The speakers of train-clean-360 were included to the training set only when the total length of speech samples exceeds 15 minutes. To test on English speech samples we used two datasets; 1. For the seen speaker test we used $10 \%$ unseen utterances of VCTK. 2. For the unseen speaker test we used test-clean subset of LibriTTS.
|
| 125 |
+
|
| 126 |
+
To train NANSY on multi-language, we used $\mathrm { C S S 1 0 ^ { 3 } }$ dataset $\lVert \overline { { 3 2 } } \rVert$ . CSS10 includes 10 speakers and each speaker use different language. Note that there is no English speaking speaker included in CSS10. To train the model, we used $90 \%$ of samples for each speaker. To test on multilingual speech samples, we used the rest $10 \%$ unseen utterances of CSS10.
|
| 127 |
+
|
| 128 |
+
Training We used $2 2 , 0 5 0 \mathrm { h z }$ sampling rate for every analysis feature except for wav2vec input that takes waveform with the sampling rate of $1 6 { , } 0 0 0 \mathrm { h z }$ . We used 80 bands for mel spectrogram, where FFT, window, and hop size were set to 1024, 1024, and 256, respectively. The samples were randomly cropped approximately to 1.47-second, which results in 128 mel spectrogram frames. The networks were trained using Adam optimizer with $\beta _ { 1 } = 0 . 5$ and $\beta _ { 2 } = 0 . 9$ . The learning rate was fixed to $1 0 ^ { - 4 }$ . We trained every model using one RTX 3090 with batch size 32. The training was done after 50 epochs.
|
| 129 |
+
|
| 130 |
+
# 4.2 Reconstruction
|
| 131 |
+
|
| 132 |
+
For the reconstruction (analysis and synthesis) tests, we report character error rate (CER $( \% )$ ), and 5-scale mean opinon score (MOS ([1-5])), 5-scale degradation mean opinion score (DMOS ([1-5])). For MOS, higher is better. For DMOS and CER, lower is better. To estimate the characters from speech samples, we used google cloud ASR API. For MOS and DMOS, we used amazon mechanical turk (MTurk). The details of MOS and DMOS are shown in Appendix D.
|
| 133 |
+
|
| 134 |
+
Yingram vs $f _ { 0 }$ We compared two models trained with Yingram and $f _ { 0 }$ to check which pitch feature shows more robust reconstruction performance. We used RAPT algorithm for $f _ { 0 }$ estimation $\lVert \overline { { 4 2 } } \rVert$ which is known as a reliable $f _ { 0 }$ tracker among many other algorithms $\overline { { \| 2 2 } }$ . Because RAPT algorithm works sufficiently well in most cases, we first manually listened to the reconstructed samples using the model trained with $f _ { 0 }$ . We first chose 30 reconstructed samples in the testset that failed to faithfully reconstruct the original samples using the model trained with $f _ { 0 }$ . After that we reconstructed the same 30 samples using the model trained with Yingram. Finally, we conducted ABX test to ask participants which of the two samples (A and B) sounds closer to the original sample (X). The ABX test was conducted on MTurk. The results showed that the participants chose Yingram with a chance of $6 8 . 3 \%$ . This shows that Yingram can be used as a more robust pitch feature than $f _ { 0 }$ , when $f _ { 0 }$ cannot be accurately estimated.
|
| 135 |
+
|
| 136 |
+
Reconstruction test We randomly sampled 50 speech samples from VCTK (seen speaker) and sampled another 50 speech samples from test-clean subset of LibriTTS (unseen speaker) to test the reconstruction performance of NANSY trained on English datasets. The results in Table $\bigstar$ shows that NANSY can perform high quality analysis and synthesis task. In addition, to test if the proposed framework can cover various languages, we trained and tested it with the multilingual dataset, CSS10. We randomly sampled 100 speech samples from CSS10 to test the reconstruction performance of NANSY trained on multi-language. The results are shown in Table $\boxed { 2 }$ Although we do not impose any explicit labels for each language, the model was able to reconstruct various languages with high quality. The results of CER on each language is shown in Fig. $\bigtriangledown$ MUL.
|
| 137 |
+
|
| 138 |
+
Table 1: English reconstruction results.
|
| 139 |
+
|
| 140 |
+
<table><tr><td></td><td>CER</td><td>MOS</td><td>DMOS</td></tr><tr><td>GT</td><td>n/a</td><td>4.28 ± 0.09</td><td>n/a</td></tr><tr><td>Recon</td><td>5.6</td><td>4.18 ± 0.09</td><td>1.93 ± 0.09</td></tr></table>
|
| 141 |
+
|
| 142 |
+
Table 2: Multilingual reconstruction results.
|
| 143 |
+
|
| 144 |
+
<table><tr><td></td><td>CER</td><td>MOS</td><td>DMOS</td></tr><tr><td>GT</td><td>n/a</td><td>4.19 ± 0.08</td><td>n/a</td></tr><tr><td>Recon</td><td>7.3</td><td>4.14 ± 0.09</td><td>1.74 ± 0.09</td></tr></table>
|
| 145 |
+
|
| 146 |
+
Test-time self-adaptation To test the proposed test-time self-adaptation (TSA), we compared the CER performance of NANSY trained in three different configurations, 1. English (ENG), 2. English with TSA (ENG-TSA), 3. Multi-language (MUL). For every experiment, we iteratively updated the wav2vec feature 100 times. The results are shown in Fig. $\triangledown$ Naturally, MUL generally showed better CER performance than other configurations. Interestingly, however, ENG-TSA sometimes showed similar or even better performance than MUL, which shows the effectiveness of the proposed TSA technique.
|
| 147 |
+
|
| 148 |
+

|
| 149 |
+
Figure 6: The CER results on 10 languages (NL: Dutch, HU: Hungarian, FR: French, JP: Japanese, CH: Chinese, RU: Russian, FI: Finnish, GR: Greek, ES: Spanish, DE: German).
|
| 150 |
+
|
| 151 |
+
# 4.3 Voice conversion
|
| 152 |
+
|
| 153 |
+
NANSY can perform zero-shot voice conversion by simply passing the desired target speech utterance to the speaker embedding network. We first compared the English voice conversion performance of NANSY with recently proposed zero-shot voice conversion models. Next, we tested the multilingual voice conversion performance. Finally, we tested unseen language voice conversion for both seen speaker and unseen speaker targets. Note that in every voice conversion experiment, we shifted the median pitch of a source utterance to the median pitch of a target utterance by shifting the scope of Yingram. We measured naturalness with 5-scale mean opinion score (MOS [1-5]). Speaker similarity (SSIM $( \% )$ ) were measured with a binary decision and uncertainty options, following $\pmb { \Vert 5 0 \Vert }$ . For MOS and SSIM, we again used MTurk. The details of MOS and SSIM are shown in Appendix D. One of the crucial criteria for evaluating the quality of the converted samples is to check the intelligibility of them. Previous zero-shot voice conversion models, however, have only reported MOS or SSIM and have been negligent on assessing the intelligibility of the converted samples [36, 10, 51]. To this end, we report character error rate (CER $( \% ) _ { , }$ ) between estimated characters of source and converted pairs. To estimate the characters from speech samples, we used google cloud ASR API.
|
| 154 |
+
|
| 155 |
+
Algorithm comparison Here, we report three source-to-target speaker conversion settings, 1. seen-to-seen (many-to-many, M2M), 2. unseen-to-seen (any-to-many, A2M), 3. unseen-to-unseen (any-to-any, A2A). For every setting, we considered 4 gender-to-gender combination, i.e., male-tomale $( { \mathrm { m } } 2 { \mathrm { m } } )$ , male-to-female (m2f), female-to-male $( \mathrm { f } 2 \mathrm { m } )$ , and female-to-female (f2f). For M2M setting, we randomly sampled 25 seen speakers from VCTK and randomly assigned 2 random speakers from VCTK, resulting in 200 $( = 2 5 { \times } 2 { \times } 4 )$ conversion pairs in total. For A2M setting, we randomly sampled 10 seen speakers from test-clean subset of LibriTTS and randomly assigned 2 random speakers from VCTK resulting in 80 $( = 1 0 \times 2 \times 4 )$ ) conversion pairs in total. For A2A setting, we randomly sampled 10 seen speakers from test-clean subset of LibriTTS and randomly assigned 2 random speakers from test-clean subset of LibriTTS resulting in 80 $( = 1 0 \times 2 \times 4 )$ conversion pairs in total. We trained three baseline models with official implementations - ${ \mathrm { V Q V C } } +$ [51], AdaIN $[ \mathbb { 1 0 } ]$ , AUTOVC $\pmb { \mathbb { B } } 6 \|$ - using the same dataset and mel spectrogram configuration as NANSY. For a fair comparison, we used a pre-trained HiFi-GAN vocoder for every model. Table $\triangledown$ shows that NANSY significantly outperforms previous models in terms of every evaluation measure. This implies that the proposed information perturbation approach does not suffer from the trade-off between CER and SSIM unlike information bottleneck approaches. The SSIM results for all possible gender-to-gender combinations are shown in Fig. 9 in Appendix C.
|
| 156 |
+
|
| 157 |
+
<table><tr><td>一</td><td></td><td>M2M</td><td></td><td></td><td>A2M</td><td></td><td></td><td>A2A</td><td></td></tr><tr><td></td><td></td><td>[CER[%] MOS[1-5]</td><td></td><td></td><td>]SSIM[%]|CER[%]MOS[1-5]</td><td></td><td></td><td>SSIM[%]|CER[%] MOS[1-5]</td><td>SSIM[%]</td></tr><tr><td>SRC as TGT</td><td>n/a</td><td>4.23 ± 0.05</td><td>0</td><td>n/a</td><td>4.28 ± 0.09</td><td>0.60</td><td>n/a</td><td>4.26 ± 0.07</td><td>0.25</td></tr><tr><td>TGT as TGT</td><td>n/a</td><td>4.32 ± 0.05</td><td>94.9</td><td>n/a</td><td>4.29 ± 0.05</td><td>92.4</td><td>n/a</td><td>4.27 ± 0.07</td><td>96.2</td></tr><tr><td>VQVC+</td><td>54.0</td><td>1.76 ± 0.05</td><td>54.5</td><td>74.7</td><td>1.73 ± 0.11</td><td>15.6</td><td>69.3</td><td>1.83 ± 0.09</td><td>13.8</td></tr><tr><td>AdaIN</td><td>62.9</td><td>2.22 ± 0.07</td><td>24.0</td><td>79.6</td><td>1.92 ± 0.12</td><td>18.1</td><td>59.3</td><td>2.12 ± 0.10</td><td>21.2</td></tr><tr><td>AUTOVC</td><td>31.7</td><td>3.41 ±0.06</td><td>47.3</td><td>36.1</td><td>2.74 ±0.11</td><td>33.2</td><td>28.2</td><td>2.59 ±0.08</td><td>23.3</td></tr><tr><td>NANSY</td><td>7.5</td><td>3.79 ± 0.07</td><td>91.4</td><td>7.6</td><td>3.73 ± 0.05</td><td>88.1</td><td>8.6</td><td>3.44 ± 0.07</td><td>64.6</td></tr></table>
|
| 158 |
+
|
| 159 |
+
Table 3: Evaluation results on English voice conversion. SRC and TGT denote, source and target, respectively.
|
| 160 |
+
|
| 161 |
+
Multilingual voice conversion We tested multilingual voice conversion performance with the model trained on the multilingual dataset, CSS10. We randomly sampled 50 samples for each language speaker from CSS10 and assigned random single target speaker from CSS10 for each source language, resulting in 500 $( = 5 0 \times 1 0 )$ ) conversion pairs in total. The results in Table 4 show that the proposed framework can successfully perform multilingual voice conversion by training it with the multilingual dataset. However, there is still a room for improvement for multilingual voice conversion when comparing to the results in Table 3, where NANSY is just trained on English.
|
| 162 |
+
|
| 163 |
+
Unseen language voice conversion We tested the voice conversion performance on unseen source languages using NANSY trained on English. We tested the performance on two settings, 1. unseen source language (CSS10) to seen target voice (VCTK) and 2. unseen source language (CSS10) to unseen target voice (CSS10). For the first experiment, we randomly sampled 50 samples for each unseen language speaker from CSS10 and assigned random English target speakers from VCTK, resulting in 500 $( = 5 0 \times 1 0 )$ conversion pairs in total. The second experiment was conducted identically to the multilingual voice conversion experiment setting. The results in Table $\boxed { 5 }$ shows that NANSY can be successfully extended even to unseen language sources, although there was a decrease on SSIM compared to the results in Table 4 $( 6 9 . 5 \% \bar { } 6 \bar { 1 } . 0 \% )$ ).
|
| 164 |
+
|
| 165 |
+
Table 4: The multilingual voice conversion results. The model was trained using only CSS10.
|
| 166 |
+
|
| 167 |
+
<table><tr><td></td><td>|CER MOS</td><td>SSIM</td></tr><tr><td></td><td>TGT as TGT|n/a 4.23 ±0.06</td><td>98.0</td></tr><tr><td>NANSY</td><td>18.8 3.68 ±0.09</td><td>69.5</td></tr></table>
|
| 168 |
+
|
| 169 |
+
<table><tr><td></td><td colspan="3">Seen Speaker</td></tr><tr><td></td><td>|CER MOS</td><td>SSIM|CER</td><td>MOS SSIM</td></tr><tr><td>TGT as TGT NANSY</td><td>n/a 4.24 ±0.07 14.8 3.75 ± 0.10</td><td>100 90.0</td><td>n/a 4.23 ± 0.06 92.0 15.6 3.76 ± 0.09 61.0</td></tr></table>
|
| 170 |
+
|
| 171 |
+
Table 5: The voice conversion results on unseen language dataset, CSS10. The model was trained using only the English datasets.
|
| 172 |
+
|
| 173 |
+
# 4.4 Pitch shift and time-scale modification
|
| 174 |
+
|
| 175 |
+
To check the robustness of pitch shift (PS) and time-scale modification (TSM) performance of NANSY, we compared it with other robust algorithms, i.e., PSOLA 5 and WORLD vocoder [29, 28].
|
| 176 |
+
|
| 177 |
+
Pitch shift We tested PS performance with 5 semitone ranges, -6, -3, 0, 3, 6. The pitch was changed by shifting the scope of the proposed Yingram feature. Note that $\mathbf { \bar { \rho } } _ { 0 } ,$ was used to check analysissynthesis performance. We randomly selected 20 samples for each semitone range from $10 \%$ unseen utterances of VCTK. We evaluated the naturalness of speech samples with MOS on MTurk. The results in Table $6$ show that NANSY generally outperforms algorithms such as PSOLA and WORLD vocoder on PS task.
|
| 178 |
+
|
| 179 |
+
Time-scale modification We tested TSM performance with 5 time-scale ratios, 1/2, 1/1.5, 1, 1.5, 2. The time-scale was modified by simply manipulating the hop length of the analysis features. Note that $\cdot _ { 1 } \cdot$ was used to check analysis-synthesis performance. We randomly selected 20 samples for each time-scale ratio from $10 \%$ unseen utterances of VCTK. We evaluated the naturalness of speech samples with MOS on MTurk. The results in Table 7 show that NANSY achieved competitive performance on TSM compared to the well-established PSOLA and WORLD vocoder.
|
| 180 |
+
|
| 181 |
+
<table><tr><td></td><td>-6</td><td>-3</td><td>0</td><td>3</td><td>6</td></tr><tr><td>WORLD 28</td><td>3.433.53</td><td></td><td></td><td>33.853.63</td><td>3.53</td></tr><tr><td>PSOLA 四</td><td></td><td></td><td></td><td></td><td>3.633.553.933.753.48</td></tr><tr><td>NANSY</td><td>3.60 3.68</td><td></td><td>4.05</td><td>3.90</td><td>3.78</td></tr></table>
|
| 182 |
+
|
| 183 |
+
Table 6: Pitch shift results.
|
| 184 |
+
|
| 185 |
+
Table 7: Time-scale modification results.
|
| 186 |
+
|
| 187 |
+
<table><tr><td></td><td>1/2</td><td>1/1.5 1</td><td>1.5</td><td>2</td></tr><tr><td>WORLD I28I</td><td>2.403.603.833.38</td><td></td><td></td><td>83.03</td></tr><tr><td>PSOLA 四</td><td>2.55 3.66 3.953.68</td><td></td><td></td><td>2.85</td></tr><tr><td>NANSY</td><td>2.453.63</td><td>33.983.70</td><td></td><td>2.93</td></tr></table>
|
| 188 |
+
|
| 189 |
+
# 5 Related Works
|
| 190 |
+
|
| 191 |
+
Self-supervised representation learning and synthesis of speech There has been an increasing interest in the self-supervised learning methods within the machine learning and speech processing community. Oord et al. [31] first proposed to use noise contrastive estimation loss to train speech representations. Baevski et al. [4] extended this idea by integrating masked language modeling $\mathbb { \lVert 1 5 \rVert }$ . Another popular self-supervised learning method for speech representation is to train a neural network by targeting multiple self-supervision tasks [34, 37]. Most recently, $\pmb { \Vert 3 5 \Vert }$ used the discrete disentangled self-supervised representations to re-synthesize them into a waveform. Although using the discrete units has its own advantage in that it is disentangled with speaker information, we found that an inaccurate quantization process often leads to mispronounced samples, which is why we turned to use continuous representation as it can provide more accurate results on linguistic information.
|
| 192 |
+
|
| 193 |
+
Zero-shot voice conversion Research on zero-shot voice conversion has been most actively conducted through the information bottleneck approach. Qian et al. $\textcircled { \lvert 3 6 \rvert }$ proposed to perform zero-shot voice conversion by utilizing the pre-trained speaker recognition network and information bottleneck by carefully designing the bottleneck of an auto-encoder. Inspired by the success of style conversion in computer vision, Chou and Lee $\mathbb { \ m }$ also focused on restricting the information flow using instance normalization $\pm \ddagger { 4 }$ and adaptive instance normalization $\mathbb { \lVert 1 9 \rVert }$ . Lastly, Wu et al. [51] used multiple vector quantization layers $\bar { \mathbb { B } } \bar { 0 } \bar { 1 }$ to restrict the information flow.
|
| 194 |
+
|
| 195 |
+
Inductive bias for audio generation It has been shown that neural networks can be combined with traditional speech/sound production models for efficient and strong performance. One of the speech production models that has been integrated with neural networks is the source-filter model. By modeling source and filter components with deep networks, it has been used for applications such as vocoder [49, 23, 45] and acoustic feature generation $\lVert 2 5 \rVert$ . Furthermore, Engel et al. $\mathbb { \ m }$ proposed to integrate a harmonic plus noise model $\bar { \big \| } \bar { 3 8 } \bar { \big \| }$ and neural networks to produce natural audio signal.
|
| 196 |
+
|
| 197 |
+
Consistency learning Learning representations by augmenting the data has been one of the key ideas to leverage the performance of classification tasks [43, 52]. This shares the similar idea with the proposed information perturbation strategy in that the data is perturbed so that the neural network must learn to ignore the perturbations and learn the consistency from the data. However, the key difference between the consistency learning and the information perturbation is that the information perturbation method is designed for “generative” task and that it is the “decoder” (e.g., Generator) that is trained to selectively take the essential attributes to reconstruct the signal from the given perturbed representations.
|
| 198 |
+
|
| 199 |
+
# 6 Conclusions and Discussion
|
| 200 |
+
|
| 201 |
+
In this work, we proposed a neural analysis and synthesis framework (NANSY) that can perform zero-shot voice conversion, formant preserving pitch shift, and time-scale modification with a single model. The proposed model can be trained in a fully self-supervised manner, that is, it can be trained without any labeled data such as text or speaker information. We showed the effectiveness of the proposed information perturbation approach by showing the voice conversion results on various settings. Furthermore, we showed the effectiveness of the proposed TSA method by testing it on unseen languages, which shows the possibility of NANSY to be extended on low-resource languages. Although the proposed method empowers controllability over several attributes of a speech signal, it is still limited in terms of lacking controllability over linguistic information. As a future work, therefore, we would like to investigate on a hybrid approach that integrates text information as a side input so that the user can manipulate even the linguistic information in the speech signal. Finally, to prevent the proposed framework being used maliciously (e.g., voice phishing), it would be important to develop a detection algorithm that can discriminate a synthesized speech sample from a real speech sample. To examine the potential of such a detection system, we have tried using the trained Discriminator from the NANSY framework, which is expected to discriminate fake samples from real samples. We measured the accuracy of classifying 185 reconstructed samples and 185 ground truth samples. In addition, we measured the accuracy of classifying 560 voice conversion samples and 560 ground truth samples. The accuracy was $9 1 . 4 \%$ on the reconstruction set and $9 5 . 5 \%$ on the voice conversion set. This shows the possibility of Discriminator being used as a byproduct network to discriminate real speech samples from fake speech samples. However, we also found that Discriminator is prone to being deceived by the generated samples from other speech generative models as Discriminator was not jointly trained with those generative models. Therefore, we expect more robust synthesized speech detection algorithms to be developed in the future such as [48, 40, 9, 6].
|
| 202 |
+
|
| 203 |
+
# Broader Impacts
|
| 204 |
+
|
| 205 |
+
The proposed NANSY framework shows that a generative model can benefit from self-supervised representations. By choosing proper domain specific “information perturbation” functions, we believe that one can achieve controllable generative modeling in a fully self-supervised way. The information perturbation training strategy may also be used for other modalities and facilitate self-supervised representation learning methods too. With the proposed training framework, one can manipulate various aspects of speech samples. Among the various controllabilities, it is rather obvious that the voice conversion technique can be misused and potentially harm other people. More concretely, there are possible scenarios where it is being used by random unidentified users and contributing to spreading fake news. In addition, it can raise concerns about biometric security systems based on speech. To mitigate such issues, the proposed system should not be released without a consent so that it cannot be easily used by random users with malicious intentions. That being said, there is still a potential for this technology to be used by unidentified users. As a more solid solution, therefore, we believe a detection system that can discriminate between fake and real speech should be developed. The preliminary results of the detection system is reported in section 6.
|
| 206 |
+
|
| 207 |
+
# Acknowledgments and Disclosure of Funding
|
| 208 |
+
|
| 209 |
+
This work was supported by Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government(MSIT) [NO.2021-0-01343, Artificial Intelligence Graduate School Program (Seoul National University)]
|
| 210 |
+
|
| 211 |
+
References
|
| 212 |
+
[1] Luc Ardaillon. Synthesis and expressive transformation of singing voice. PhD thesis, 11 2017.
|
| 213 |
+
[2] Luc Ardaillon and Axel Roebel. Gci detection from raw speech using a fully-convolutional network. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 6739–6743. IEEE, 2020.
|
| 214 |
+
[3] Bishnu S Atal and Suzanne L Hanauer. Speech analysis and synthesis by linear prediction of the speech wave. The journal of the acoustical society of America, 50(2B):637–655, 1971.
|
| 215 |
+
[4] Alexei Baevski, Yuhao Zhou, Abdelrahman Mohamed, and Michael Auli. wav2vec 2.0: A framework for self-supervised learning of speech representations. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 12449–12460. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper/2020/file/ 92d1e1eb1cd6f9fba3227870bb6d7f07-Paper.pdf.
|
| 216 |
+
[5] Paul Boersma and Vincent Van Heuven. Speak and unspeak with praat. Glot International, 5 (9/10):341–347, 2001.
|
| 217 |
+
[6] Clara Borrelli, Paolo Bestagini, Fabio Antonacci, Augusto Sarti, and Stefano Tubaro. Synthetic speech detection through short-term and long-term prediction traces. EURASIP Journal on Information Security, 2021(1):1–14, 2021.
|
| 218 |
+
[7] Mingjian Chen, Xu Tan, Bohan Li, Yanqing Liu, Tao Qin, sheng zhao, and Tie-Yan Liu. Adaspeech: Adaptive text to speech for custom voice. In International Conference on Learning Representations, 2021. URL https://openreview.net/forum?id=Drynvt7gg4L.
|
| 219 |
+
[8] Hyeong-Seok Choi, Changdae Park, and Kyogu Lee. From inference to generation: End-to-end fully self-supervised generation of human face from speech. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=H1guaREYPr.
|
| 220 |
+
[9] Yeunju Choi, Youngmoon Jung, and Hoirin Kim. Neural mos prediction for synthesized speech using multi-task learning with spoofing detection and spoofing type classification. In 2021 IEEE Spoken Language Technology Workshop (SLT), pages 462–469. IEEE, 2021.
|
| 221 |
+
[10] Ju-Chieh Chou and Hung-Yi Lee. One-Shot Voice Conversion by Separating Speaker and Content Representations with Instance Normalization. In Proc. Interspeech 2019, pages 664– 668, 2019. doi: 10.21437/Interspeech.2019-2663. URL http://dx.doi.org/10.21437/ Interspeech.2019-2663.
|
| 222 |
+
[11] Alexis Conneau, Alexei Baevski, Ronan Collobert, Abdelrahman Mohamed, and Michael Auli. Unsupervised cross-lingual representation learning for speech recognition. arXiv preprint arXiv:2006.13979, 2020.
|
| 223 |
+
[12] Yann N Dauphin, Angela Fan, Michael Auli, and David Grangier. Language modeling with gated convolutional networks. In International conference on machine learning, pages 933–941. PMLR, 2017.
|
| 224 |
+
[13] Alain De Cheveigné and Hideki Kawahara. Yin, a fundamental frequency estimator for speech and music. The Journal of the Acoustical Society of America, 111(4):1917–1930, 2002.
|
| 225 |
+
[14] Brecht Desplanques, Jenthe Thienpondt, and Kris Demuynck. ECAPA-TDNN: Emphasized Channel Attention, Propagation and Aggregation in TDNN Based Speaker Verification. In Proc. Interspeech 2020, pages 3830–3834, 2020. doi: 10.21437/Interspeech.2020-2650. URL http://dx.doi.org/10.21437/Interspeech.2020-2650.
|
| 226 |
+
|
| 227 |
+
[15] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171–4186, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1423. URL https://www.aclweb.org/anthology/N19-1423.
|
| 228 |
+
|
| 229 |
+
[16] Thomas Drugman, Paavo Alku, Abeer Alwan, and Bayya Yegnanarayana. Glottal source processing: From analysis to applications. Computer Speech & Language, 28(5):1117–1138, 2014. ISSN 0885-2308. doi: https://doi.org/10.1016/j.csl.2014.03.003. URL https://www. sciencedirect.com/science/article/pii/S0885230814000229.
|
| 230 |
+
|
| 231 |
+
[17] Jesse Engel, Lamtharn (Hanoi) Hantrakul, Chenjie Gu, and Adam Roberts. Ddsp: Differentiable digital signal processing. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id=B1x1ma4tDr.
|
| 232 |
+
|
| 233 |
+
[18] Zhiyun Fan, Meng Li, Shiyu Zhou, and Bo Xu. Exploring wav2vec 2.0 on speaker verification and language identification. arXiv preprint arXiv:2012.06185, 2020.
|
| 234 |
+
|
| 235 |
+
[19] Xun Huang and Serge Belongie. Arbitrary style transfer in real-time with adaptive instance normalization. In Proceedings of the IEEE International Conference on Computer Vision, pages 1501–1510, 2017.
|
| 236 |
+
|
| 237 |
+
[20] Yannick Jadoul, Bill Thompson, and Bart De Boer. Introducing parselmouth: A python interface to praat. Journal of Phonetics, 71:1–15, 2018.
|
| 238 |
+
|
| 239 |
+
[21] Ye Jia, Yu Zhang, Ron J. Weiss, Quan Wang, Jonathan Shen, Fei Ren, Zhifeng Chen, Patrick Nguyen, Ruoming Pang, Ignacio Lopez-Moreno, and Yonghui Wu. Transfer learning from speaker verification to multispeaker text-to-speech synthesis. In Advances in Neural Information Processing Systems, pages 4485–4495, 2018.
|
| 240 |
+
|
| 241 |
+
[22] Denis Jouvet and Yves Laprie. Performance analysis of several pitch detection algorithms on simulated and real noisy speech data. In 2017 25th European Signal Processing Conference (EUSIPCO), pages 1614–1618. IEEE, 2017.
|
| 242 |
+
|
| 243 |
+
[23] Lauri Juvela, Bajibabu Bollepalli, Vassilis Tsiaras, and Paavo Alku. Glotnet—a raw waveform model for the glottal excitation in statistical parametric speech synthesis. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 27(6):1019–1030, 2019.
|
| 244 |
+
|
| 245 |
+
[24] Jungil Kong, Jaehyeon Kim, and Jaekyoung Bae. Hifi-gan: Generative adversarial networks for efficient and high fidelity speech synthesis. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 17022–17033. Curran Associates, Inc., 2020. URL https://proceedings.neurips. cc/paper/2020/file/c5d736809766d46260d816d8dbc9eb44-Paper.pdf.
|
| 246 |
+
|
| 247 |
+
[25] Juheon Lee, Hyeong-Seok Choi, Chang-Bin Jeon, Junghyun Koo, and Kyogu Lee. Adversarially Trained End-to-End Korean Singing Voice Synthesis System. In Proc. Interspeech 2019, pages 2588–2592, 2019. doi: 10.21437/Interspeech.2019-1722. URL http://dx.doi.org/10. 21437/Interspeech.2019-1722.
|
| 248 |
+
|
| 249 |
+
[26] Robert McAulay and Thomas Quatieri. Speech analysis/synthesis based on a sinusoidal representation. IEEE Transactions on Acoustics, Speech, and Signal Processing, 34(4):744–754, 1986.
|
| 250 |
+
|
| 251 |
+
[27] Takeru Miyato and Masanori Koyama. cGANs with projection discriminator. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum? id=ByS1VpgRZ.
|
| 252 |
+
|
| 253 |
+
[28] Masanori Morise, Fumiya Yokomori, and Kenji Ozawa. World: a vocoder-based high-quality speech synthesis system for real-time applications. IEICE TRANSACTIONS on Information and Systems, 99(7):1877–1884, 2016.
|
| 254 |
+
|
| 255 |
+
[29] Eric Moulines and Francis Charpentier. Pitch-synchronous waveform processing techniques for text-to-speech synthesis using diphones. Speech communication, 9(5-6):453–467, 1990.
|
| 256 |
+
|
| 257 |
+
[30] Aaron van den Oord, Oriol Vinyals, and Koray Kavukcuoglu. Neural discrete representation learning. arXiv preprint arXiv:1711.00937, 2017.
|
| 258 |
+
|
| 259 |
+
[31] Aaron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018.
|
| 260 |
+
|
| 261 |
+
[32] Kyubyong Park and Thomas Mulc. CSS10: A Collection of Single Speaker Speech Datasets for 10 Languages. In Proc. Interspeech 2019, pages 1566–1570, 2019. doi: 10.21437/Interspeech. 2019-1500. URL http://dx.doi.org/10.21437/Interspeech.2019-1500.
|
| 262 |
+
|
| 263 |
+
[33] Seung-won Park, Doo-young Kim, and Myun-chul Joe. Cotatron: Transcription-guided speech encoder for any-to-many voice conversion without parallel data. arXiv preprint arXiv:2005.03295, 2020.
|
| 264 |
+
|
| 265 |
+
[34] Santiago Pascual, Mirco Ravanelli, Joan Serrà, Antonio Bonafonte, and Yoshua Bengio. Learning Problem-Agnostic Speech Representations from Multiple Self-Supervised Tasks. In Proc. Interspeech 2019, pages 161–165, 2019. doi: 10.21437/Interspeech.2019-2605. URL http://dx.doi.org/10.21437/Interspeech.2019-2605.
|
| 266 |
+
|
| 267 |
+
[35] Adam Polyak, Yossi Adi, Jade Copet, Eugene Kharitonov, Kushal Lakhotia, Wei-Ning Hsu, Abdelrahman Mohamed, and Emmanuel Dupoux. Speech Resynthesis from Discrete Disentangled Self-Supervised Representations. In Proc. Interspeech 2021, pages 3615–3619, 2021. doi: 10.21437/Interspeech.2021-475.
|
| 268 |
+
|
| 269 |
+
[36] Kaizhi Qian, Yang Zhang, Shiyu Chang, Xuesong Yang, and Mark Hasegawa-Johnson. Autovc: Zero-shot voice style transfer with only autoencoder loss. In International Conference on Machine Learning, pages 5210–5219. PMLR, 2019.
|
| 270 |
+
|
| 271 |
+
[37] Mirco Ravanelli, Jianyuan Zhong, Santiago Pascual, Pawel Swietojanski, Joao Monteiro, Jan Trmal, and Yoshua Bengio. Multi-task self-supervised learning for robust speech recognition. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 6989–6993. IEEE, 2020.
|
| 272 |
+
|
| 273 |
+
[38] Xavier Serra et al. Musical sound modeling with sinusoids plus noise. Musical signal processing, pages 91–122, 1997.
|
| 274 |
+
|
| 275 |
+
[39] Jui Shah, Yaman Kumar Singla, Changyou Chen, and Rajiv Ratn Shah. What all do audio transformer models hear? probing acoustic representations for language delivery and its structure. arXiv preprint arXiv:2101.00387, 2021.
|
| 276 |
+
|
| 277 |
+
[40] Arun Kumar Singh and Priyanka Singh. Detection of ai-synthesized speech using cepstral & bispectral statistics. arXiv preprint arXiv:2009.01934, 2020.
|
| 278 |
+
|
| 279 |
+
[41] Lifa Sun, Kun Li, Hao Wang, Shiyin Kang, and Helen Meng. Phonetic posteriorgrams for manyto-one voice conversion without parallel data training. In 2016 IEEE International Conference on Multimedia and Expo (ICME), pages 1–6. IEEE, 2016.
|
| 280 |
+
|
| 281 |
+
[42] David Talkin and W Bastiaan Kleijn. A robust algorithm for pitch tracking (rapt). Speech coding and synthesis, 495:518, 1995.
|
| 282 |
+
|
| 283 |
+
[43] Antti Tarvainen and Harri Valpola. Mean teachers are better role models: Weightaveraged consistency targets improve semi-supervised deep learning results. arXiv preprint arXiv:1703.01780, 2017.
|
| 284 |
+
|
| 285 |
+
[44] Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Instance normalization: The missing ingredient for fast stylization. arXiv preprint arXiv:1607.08022, 2016.
|
| 286 |
+
|
| 287 |
+
[45] Jean-Marc Valin and Jan Skoglund. Lpcnet: Improving neural speech synthesis through linear prediction. In ICASSP 2019-2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 5891–5895. IEEE, 2019.
|
| 288 |
+
|
| 289 |
+
[46] Laurens Van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(11), 2008.
|
| 290 |
+
|
| 291 |
+
[47] Christophe Veaux, Junichi Yamagishi, and Simon King. The voice bank corpus: Design, collection and data analysis of a large regional accent speech database. In 2013 international conference oriental COCOSDA held jointly with 2013 conference on Asian spoken language research and evaluation (O-COCOSDA/CASLRE), pages 1–4. IEEE, 2013.
|
| 292 |
+
[48] Run Wang, Felix Juefei-Xu, Yihao Huang, Qing Guo, Xiaofei Xie, Lei Ma, and Yang Liu. Deepsonar: Towards effective and robust detection of ai-synthesized fake voices. In Proceedings of the 28th ACM International Conference on Multimedia, pages 1207–1216, 2020.
|
| 293 |
+
[49] Xin Wang, Shinji Takaki, and Junichi Yamagishi. Neural source-filter-based waveform model for statistical parametric speech synthesis. In ICASSP 2019-2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 5916–5920. IEEE, 2019.
|
| 294 |
+
[50] Mirjam Wester, Zhizheng Wu, and Junichi Yamagishi. Analysis of the voice conversion challenge 2016 evaluation results. In Interspeech, pages 1637–1641, 2016.
|
| 295 |
+
[51] Da-Yi Wu, Yen-Hao Chen, and Hung yi Lee. VQVC $^ +$ : One-Shot Voice Conversion by Vector Quantization and U-Net Architecture. In Proc. Interspeech 2020, pages 4691–4695, 2020. doi: 10.21437/Interspeech.2020-1443. URL http://dx.doi.org/10.21437/Interspeech. 2020-1443.
|
| 296 |
+
[52] Qizhe Xie, Zihang Dai, Eduard Hovy, Minh-Thang Luong, and Quoc V Le. Unsupervised data augmentation for consistency training. arXiv preprint arXiv:1904.12848, 2019.
|
| 297 |
+
[53] Vadim Zavalishin. The art of va filter design. Native Instruments, Berlin, Germany, 2012.
|
| 298 |
+
[54] Heiga Zen, Viet Dang, Rob Clark, Yu Zhang, Ron J. Weiss, Ye Jia, Zhifeng Chen, and Yonghui Wu. Libritts: A corpus derived from librispeech for text-to-speech. In Interspeech, pages 1526–1530, 2019.
|
| 299 |
+
|
| 300 |
+
# Checklist
|
| 301 |
+
|
| 302 |
+
1. For all authors...
|
| 303 |
+
|
| 304 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes] We described the goal and contribution of this paper and conducted experiments accordingly.
|
| 305 |
+
(b) Did you describe the limitations of your work? [Yes] We explained the limitation of this work in the conclusion.
|
| 306 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] We discussed the potential negative societal impacts (e.g., voice phishing) of our work in the conclusion.
|
| 307 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] We have read the ethics review guidelines.
|
| 308 |
+
|
| 309 |
+
2. If you are including theoretical results...
|
| 310 |
+
|
| 311 |
+
(a) Did you state the full set of assumptions of all theoretical results? [No] We do not include theoretical results.
|
| 312 |
+
(b) Did you include complete proofs of all theoretical results? [No] We do not include theoretical results.
|
| 313 |
+
|
| 314 |
+
3. If you ran experiments...
|
| 315 |
+
|
| 316 |
+
(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] The code is proprietary.
|
| 317 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See section $4 . 1$ and Appendix A.
|
| 318 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] We have included the error bars for crowdsourcing evaluation.
|
| 319 |
+
|
| 320 |
+
(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 section 4.1.
|
| 321 |
+
|
| 322 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 323 |
+
|
| 324 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes] We cited all three datasets we used for experiments.
|
| 325 |
+
(b) Did you mention the license of the assets? [Yes] See section 4.1.
|
| 326 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [No] We did not curate/release any new assets.
|
| 327 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [Yes] We cited the paper of the datasets we are using in which they explain all the details regarding speaker recruitment.
|
| 328 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes] We used speaker labels to split the datasets as described in section 4.1.
|
| 329 |
+
|
| 330 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 331 |
+
|
| 332 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [Yes] We have attached the screenshots of MTurk instructions in Appendix D.
|
| 333 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [Yes] This work is approved by IRB (IRB No. 2105/004-008). We have announced that the de-identified information such as worker ID will be collected through MTurk instructions.
|
| 334 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [Yes] It is shown in Appendix D.
|
md/train/B1hYRMbCW/B1hYRMbCW.md
ADDED
|
@@ -0,0 +1,671 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ON THE REGULARIZATION OF WASSERSTEIN GANS
|
| 2 |
+
|
| 3 |
+
Henning Petzka∗ Fraunhofer Institute IAIS, Sankt Augustin, Germany henning.petzka@gmail.com
|
| 4 |
+
|
| 5 |
+
Asja Fischer∗& Denis Lukovnikov Department of Computer Science, University of Bonn, Germany asja.fischer@gmail.com lukovnik@cs.uni-bonn.de
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Since their invention, generative adversarial networks (GANs) have become a popular approach for learning to model a distribution of real (unlabeled) data. Convergence problems during training are overcome by Wasserstein GANs which minimize the distance between the model and the empirical distribution in terms of a different metric, but thereby introduce a Lipschitz constraint into the optimization problem. A simple way to enforce the Lipschitz constraint on the class of functions, which can be modeled by the neural network, is weight clipping. Augmenting the loss by a regularization term that penalizes the deviation of the gradient norm of the critic (as a function of the network’s input) from one, was proposed as an alternative that improves training. We present theoretical arguments why using a weaker regularization term enforcing the Lipschitz constraint is preferable. These arguments are supported by experimental results on several data sets.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
General adversarial networks (GANs) (Goodfellow et al., 2014) are a class of generative models that have recently gained a lot of attention. They are based on the idea of defining a game between two competing neural networks (NNs): a generator and a classifier (or discriminator). While the classifier aims at distinguishing generated from real data, the generator tries to generate samples which the classifier can not distinguish from the ones from the empirical distribution. Realizing the potential behind this new approach to generative models, more recent contributions focused on the stabilization of training, including ensemble methods (Tolstikhin et al., 2017), improved network structure (Radford et al., 2015; Salimans et al., 2016) and theoretical improvements (Nowozin et al., 2016; Salimans et al., 2016; Arjovsky & Bottou, 2017; Chen et al., 2016) that helped to successfully model complex distributions using GANs.
|
| 14 |
+
|
| 15 |
+
It was proposed by Arjovsky et al. (2017) to train generator and discriminator networks by minimizing the Wasserstein-1 distance, a distance with properties superior to the Jensen-Shannon distance (used in the original GAN) in terms of convergence. Accordingly, this version of GAN was called Wasserstein GAN (WGAN). The change of metric introduces a new minimization problem, which requires the discriminator function to lie in the space of 1-Lipschitz functions. In the same paper, the Lipschitz constraint was guaranteed by performing weight clipping, i.e., by constraining the parameters of the discriminator NN to be smaller than a given value in magnitude. An improved training strategy was proposed by Gulrajani et al. (2017) based on results from optimal transport theory (see Villani, 2008). Here, instead of clipping weights, the loss gets augmented by a regularization term that penalizes any deviation of the norm of the gradient of the critic function (with respect to its input) from one.
|
| 16 |
+
|
| 17 |
+
We review these results and present both theoretical considerations and empirical results, leading to the proposal of a less restrictive regularization term for WGANs.1 More precisely, our contributions are as follows:
|
| 18 |
+
|
| 19 |
+
• We review the arguments that the regularization technique proposed by Gulrajani et al. (2017) is based on and make the following two observations: (i) The regularization strategy requires training samples and generated samples to be drawn from a certain joint distribution. In practice, however, samples are drawn independently from their marginals. (ii) The arguments further assume the discriminator to be differentiable. We explain why both can be harmful for training.
|
| 20 |
+
|
| 21 |
+
• We propose a less restrictive regularization term and present empirical results strongly supporting our theoretical considerations.
|
| 22 |
+
|
| 23 |
+
# 2 OPTIMAL TRANSPORT
|
| 24 |
+
|
| 25 |
+
We will require the notion of a coupling of two probability distributions. Although a coupling can be defined more generally, we state the definition in the setting of our interest, i.e., we consider all spaces involved to equal $\mathbb { R } ^ { n }$ .
|
| 26 |
+
|
| 27 |
+
Definition 1. Let $\mu$ and $\nu$ be two probability distributions on $\mathbb { R } ^ { n }$ . A coupling $\pi$ of $\mu$ and $\nu$ is a probability distribution on $\mathbb { R } ^ { n } \times \mathbb { R } ^ { n }$ such that $\pi ( A , \mathbb { R } ^ { n } ) = \mu ( A )$ and $\pi ( \mathbb { R } ^ { n } , A ) = \nu ( A )$ for all measurable sets $A \subseteq \mathbb { R } ^ { n }$ . The set of all couplings of $\mu$ and $\nu$ is denoted by $\Pi ( \mu , \nu )$ .
|
| 28 |
+
|
| 29 |
+
The following theorem plays a central role in the theory of optimal transport (OT) and is known as the Kantorovich duality. Note, that the presented theorem is a less general, but to our needs adapted version of Theorem 5.10 from Villani (2008).2 A proof of how to derive our version from the referenced one can be found in Appendix C.1. We will denote by $\mathcal { L } i p _ { 1 }$ the set of all 1-Lipschitz functions, i.e., the set of all functions $f$ such that $f ( y ) - f ( x ) \leq | | { \dot { x } } - { \bar { y } } | | _ { 2 }$ for all $x , y$ .
|
| 30 |
+
|
| 31 |
+
Theorem 1 (Kantorovich). Let $\mu$ and $\nu$ be two probability distributions on $\mathbb { R } ^ { n }$ such that $\begin{array} { r } { \int _ { \mathbb { R } ^ { n } } | | x | | _ { 2 } d \mu ( x ) < \infty } \end{array}$ and $\begin{array} { r } { \int _ { \mathbb { R } ^ { n } } | | x | | _ { 2 } d \nu ( x ) < \infty } \end{array}$ . Then
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
\operatorname* { m i n } _ { \pi \in \Pi ( \mu , \nu ) } \int _ { \mathbb { R } ^ { n } \times \mathbb { R } ^ { n } } | | x - y | | _ { 2 } d \pi ( x , y ) = \operatorname* { m a x } _ { f \in \mathcal { L } i p _ { 1 } } \left( \int _ { \mathbb { R } ^ { n } } f ( x ) d \mu ( x ) - \int _ { \mathbb { R } ^ { n } } f ( x ) d \nu ( x ) \right) \ .
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
In particular, both minimum and maximum exist.
|
| 38 |
+
|
| 39 |
+
(ii) The following two statements are equivalent:
|
| 40 |
+
|
| 41 |
+
(a) $\pi ^ { * }$ is an optimal coupling (minimizing the value on the left hand side of (1)). (b) Any optimal function $f ^ { \ast } \in \mathcal { L } i p _ { 1 }$ (at which the maximum is attained for the right hand side of (1)) satisfies that for all $( x , y )$ in the support of $\pi ^ { * }$ : $f ^ { * } ( x ) - f ^ { * } ( y ) = | | x - y | | _ { 2 }$ .
|
| 42 |
+
|
| 43 |
+
The field of OT offers several approaches to the computation of optimal couplings. To speed up the computation of an optimal coupling, Cuturi (2013) introduced a regularized version of the primal problem in which an entropic term $E ( \pi )$ is added leading to the minimization of $\begin{array} { r } { \int _ { \mathbb { R } ^ { n } \times \mathbb { R } ^ { n } } | | x \stackrel { \cdot } { - } y | | _ { 2 } \ d \pi ( x , y ) + \epsilon E ( \pi ) } \end{array}$ , with regularization parameter $\epsilon$ . Regularized OT was generalized by Dessein et al. (2016) to a more general class of regularization terms $\Omega ( \pi )$ . As we will discuss in Section 5, the learning algorithm we propose in this paper has connections to the approach using $\begin{array} { r } { \Omega ( \pi ) = \int \left( \frac { \mathrm { d } \pi ( x , y ) } { \mathrm { d } \mu ( x ) \mathrm { d } \nu ( y ) } \right) ^ { 2 } \mathrm { d } \mu ( x ) \mathrm { d } \nu ( y ) } \end{array}$ . By Blondel et al. (2017), this leads to the dual problem given by
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\operatorname* { s u p } _ { f , g } \left\{ \mathbb { E } _ { x \sim \mu } [ f ( x ) ] - \mathbb { E } _ { y \sim \nu } [ g ( y ) ] - \frac { 4 } { \epsilon } \int \int \operatorname* { m a x } \left\{ 0 , \left( f ( x ) - g ( y ) - | | x - y | | _ { 2 } \right) \right\} ^ { 2 } \mathrm { d } \mu ( x ) \mathrm { d } \nu ( y ) \right\} \ .
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
# 3 WASSERSTEIN GANS
|
| 50 |
+
|
| 51 |
+
Formally, given an empirical distribution $\mu$ , a class of generative distributions $\nu$ over some space $\mathcal { X }$ , and a class of discriminators $d : \mathcal { X } [ 0 , 1 ]$ , GAN training (Goodfellow et al., 2014) aims at solving the optimization problem given by $\begin{array} { r } { \operatorname* { m i n } _ { \nu } \operatorname* { m a x } _ { d } \mathbb { E } _ { x \sim \mu } [ \log ( d ( x ) ) ] + \mathbb { E } _ { y \sim \nu } [ \log ( 1 - d ( y ) ) ] } \end{array}$ . 3 In practice, the parameters of the generator and the discriminator networks are updated in an alternating fashion based on (several steps) of stochastic gradient descent. The discriminator thereby tries to assign a value close to zero to generated data points and values close to one to real data points. As an opposing agent, the generator aims to produce data where the discriminator expects to see real data. Theorem 1 by Goodfellow et al. (2014) shows that, if the optimal discriminator is found in each iteration, minimization of the resulting loss function of the generator leads to minimization of the Jensen-Shannon (JS) divergence. Instead of minimizing the JS divergence, Arjovsky et al. (2017) proposed to minimize the Wasserstein-1 distance, also known as Earth-Mover (EM) distance, which is defined for any Polish space $( M , c )$ and probability distributions $\mu$ and $\nu$ on $M$ by
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
W ( \mu , \nu ) = \operatorname* { i n f } _ { \pi \in \Pi ( \mu , \nu ) } \int _ { M \times M } c ( x , y ) d \pi ( x , y ) .
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
From the Kantorovich duality (see Theorem 1, (i)) it follows that, in the special case we are considering, the infimum is attained and, instead of computing this minimum in Equation (3), the Wasserstein-1 distance can also be computed as
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
W ( \mu , \nu ) = \operatorname* { m a x } _ { f \in \mathcal { L } i p _ { 1 } } \mathbb { E } _ { x \sim \mu } [ f ( x ) ] - \mathbb { E } _ { y \sim \nu } [ f ( y ) ] \mathrm { ~ , ~ }
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
where the maximum is taken over the set of all 1-Lipschitz functions $\mathcal { L } i p _ { 1 }$
|
| 64 |
+
|
| 65 |
+
Thus, the WGAN objective is to solve
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\operatorname* { m i n } _ { \nu } \operatorname* { m a x } _ { f \in \mathcal { L } i p _ { 1 } } \mathbb { E } _ { x \sim \mu } [ f ( x ) ] - \mathbb { E } _ { y \sim \nu } [ f ( y ) ] \mathrm { ~ , ~ }
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
which can be achieved by alternating gradient descent updates for the generating network $\nu$ and the 1-Lipschitz function $f$ (also modeled by a NN), just as in the case of the original GAN. The objective of the generator is still to generate real-looking data points and is led by function values of $f$ that plays the role of an appraiser (or critic). The appraiser’s goal is to assign a value of confidence to each data point, which is as low as possible on generated data points and as high as possible on real data. The confidence value it can assign is bounded by a constraint of similarity, where similarity is measured by the distance of data points. This can be motivated by the idea that similar points should have similar values of confidence for being real. The new role of the critic helps to solve convergence problems, but the interpretation of its value as classifying real (close to 1) and fake data (close to 0) is lost. We refer to Appendix A for a detailed discussion.
|
| 72 |
+
|
| 73 |
+
# 4 IMPROVED TRAINING OF WGANS
|
| 74 |
+
|
| 75 |
+
Modeling the WGAN critic function by a NN raises the question on how to enforce the 1-Lipschitz constraint of the objective in Equation (5). As proposed by Arjovsky et al. (2017) a simple way to restrict the class of functions $f$ that can be modeled by the NN to $\alpha$ -Lipschitz continuous functions (for some $\alpha$ ) is to perform weight clipping, i.e. to enforce the parameters of the network not to exceed a certain value $c _ { \operatorname* { m a x } } > 0$ in absolute value. As the authors note, this is not a good but simple choice. We further demonstrate this in Appendix B by proving (for a standard NN architecture) that, using weight clipping, the optimal function is in general not contained in the class of functions modeled by the network.
|
| 76 |
+
|
| 77 |
+
Recently, an alternative to weight clipping was proposed by Gulrajani et al. (2017). The basic idea is to augment the WGAN loss by a regularization term that penalizes the deviation of the gradient norm of the critic with respect to its input from one (leading to a variant referred to as WGAN-GP, where GP stands for gradient penalty). More precisely, the loss of the critic to be minimized is then given by
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\begin{array} { r } { \mathbb { E } _ { y \sim \nu } [ f ( y ) ] - \mathbb { E } _ { x \sim \mu } [ f ( x ) ] + \lambda \mathbb { E } _ { \hat { x } \sim \tau } [ ( | | \nabla f ( \hat { x } ) | | _ { 2 } - 1 ) ^ { 2 } ] \ , } \end{array}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where $\tau$ is the distribution of $\hat { x } = t x + ( 1 - t ) y$ for $t \sim U [ 0 , 1 ]$ and $x \sim \mu , y \sim \nu$ being a real and a generated sample, respectively. The regularization term is derived based on the following result.
|
| 84 |
+
|
| 85 |
+
Proposition 1. Let $\mu$ and $\nu$ be two probability distributions on $\mathbb { R } ^ { n }$ . Let $f ^ { * }$ be an optical critic, leading to the maximum $\begin{array} { r } { \operatorname* { m a x } _ { f \in \mathcal { L } i p _ { 1 } } \bar { \int } _ { \mathbb { R } ^ { n } } f ( x ) \mathop { d \mu ( x ) } - \int _ { \mathbb { R } ^ { n } } f ( x ) \mathop { d \nu } ( x ) } \end{array}$ , and let $\pi ^ { * }$ be an optimal coupling with respect to $\begin{array} { r } { \operatorname* { m i n } _ { \pi \in \Pi ( \mu , \nu ) } \int _ { \mathbb { R } ^ { n } \times \mathbb { R } ^ { n } } | | x - y | | _ { 2 } d \pi ( x , y ) } \end{array}$ . If $f ^ { * }$ is differentiable and $x _ { t } =$ $t x + ( 1 - t ) y$ for $0 \leq t \leq 1$ , it holds that $\begin{array} { r } { \mathbb { P } _ { ( x , y ) \sim \pi ^ { * } } \Big [ ( \nabla f ^ { * } ( x _ { t } ) = \frac { y - x _ { t } } { | | y - x _ { t } | | } ) \Big ] = 1 } \end{array}$ . This in particular implies, that the norms of the gradients are one $\pi ^ { * }$ -almost surely on such points $x _ { t }$ .
|
| 86 |
+
|
| 87 |
+
For the convenience of the reader, we provide a simple argument for obtaining this result in Appendix C.2.
|
| 88 |
+
|
| 89 |
+
Note, that Proposition 1 holds only when $f ^ { * }$ is differentiable and $x$ and $y$ are sampled from the optimal coupling $\pi ^ { * }$ . However, sampling independently from the marginal distributions $\mu$ and $\nu$ very likely results in points $( x , y )$ that lie outside the support of $\pi ^ { * }$ . Furthermore, the optimal cost function $f ^ { * }$ does not need not to be differentiable everywhere. These two points will be discussed in more detail in the following subsections.
|
| 90 |
+
|
| 91 |
+
# 4.1 SAMPLING FROM THE MARGINALS INSTEAD OF THE OPTIMAL COUPLING
|
| 92 |
+
|
| 93 |
+
Observation 1. Suppose $f ^ { * } \in \mathcal L i p _ { 1 }$ is an optimal critic function and $\pi ^ { * }$ the optimal coupling determined by the Kantorovich duality in Theorem 1. Then $| f ^ { * } ( y ) - f ^ { * } ( x _ { t } ) | = | | x _ { t } - y | | _ { 2 }$ on the line $x _ { t } = t x + ( 1 - t ) y$ , $0 \leq t \leq 1$ , for $( x , y )$ sampled from $\pi ^ { * }$ , but not necessarily on the lines connecting an arbitrary pair of a real and $a$ generated data point, i.e. arbitrary $x \sim \mu$ and $y \sim \nu$ .
|
| 94 |
+
|
| 95 |
+
Consider the examples in Figure 1, where every $\mathrm { X }$ denotes a sample from the generator and every O a real data sample. Optimal couplings $\pi ^ { * }$ are indicated in red, and values of an optimal critic function are indicated in blue (optimality is shown in Appendix A.1).
|
| 96 |
+
|
| 97 |
+

|
| 98 |
+
Figure 1: A one (left) and a two (right) dimensional example showing that $f ^ { * } ( \mathbf { O } )$ - $f ^ { * } ( \mathbf { X } ) { = } | \mathbf { O } { - } \mathbf { X } |$ only holds for coupled pairs $( \mathbf { X } , 0 ) \sim \pi ^ { * }$ .
|
| 99 |
+
|
| 100 |
+
In the one-dimensional example on the left, the left-most X and the right-most O satisfy $f ^ { * } ( 0 ) -$ $f ^ { * } ( \mathbf { \boldsymbol { X } } ) = \frac { 1 } { 7 } | 0 - \mathbf { \boldsymbol { X } } | \neq | 0 - \dot { \mathbf { \boldsymbol { X } } | }$ , illustrating that the basis for the derivation of the condition, that the norm of the gradient equals one between generated and real points, only holds for points sampled from the optimal coupling. Note, while here the gradient is still of norm 1 almost everywhere, this does not necessarily hold in higher dimensions, where not all points lie on a line between some pair of points sampled from $\pi ^ { * }$ . This is exemplified for two dimensions on the right side of Figure 1, where blue numbers with $a \in \mathbb { R }$ denote the values of an optimal critic function at these points (the values at these points is all that matters). Without loss of generality we can assume the value at position $( 1 , 2 )$ to be zero, taking into account that an optimal critic function remains optimal under addition of an arbitrary constant. Since the Lipschitz constraint of $f ^ { * }$ must be satisfied, we get $1 - a \leq { \sqrt { 2 } }$ and $a + 1 \le { \sqrt { 2 } }$ . Therefore $a \in [ \bar { 1 } - \sqrt { 2 } , \sqrt { 2 } - 1 ]$ and one of the inequalities of the Lipschitz constraint must be strict.
|
| 101 |
+
|
| 102 |
+
# 4.2 DIFFERENTIABILITY OF THE CRITIC
|
| 103 |
+
|
| 104 |
+
Observation 2. The assumption of differentiability of the optimal critic is not valid at points of interest.
|
| 105 |
+
|
| 106 |
+
Consider the example of two discrete probability distributions and its optimal critic function $f ^ { * }$ shown on the left in Figure 2. We can see that the indicated function $f ^ { * } ( x ) = 1 - | x | \in \mathcal { L } i p _ { 1 }$ is optimal as it leads to an equality in the equation of the Kantorovich dual. (Also, it is the only continuous function, up to a constant, that realizes $f ^ { * } ( x ) - f ^ { * } ( y ) = | y - x |$ for coupled points $( x , y )$ .) However, it is not differentiable at 0.
|
| 107 |
+
|
| 108 |
+

|
| 109 |
+
Figure 2: Non-differentiable optimal critic functions $\mathrm { f ^ { * } }$ (shown in blue). Left: For two discrete distributions: Circles and crosses belong to samples from the empirical distribution and the generative model, respectively. An approximating differentiable function is shown in green. Right: For two continuous distributions: The empirical distribution $\mu$ is shown in gray, the generative distribution $\nu$ is shown in green.
|
| 110 |
+
|
| 111 |
+
The counterexample can be made continuous by considering the points as the center points of Gaussians, as illustrated on the right in Figure 2. This is formalized by the following proposition showing that the critic indicated in blue is indeed optimal for the depicted gray Gaussian of real data and the green mixture of two Gaussians of generated data.
|
| 112 |
+
|
| 113 |
+
Proposition 2. Let $\mu = \mathcal { N } ( 0 , 1 )$ be a normal distribution centered around zero and $\nu = \nu _ { - 1 } + \nu _ { 1 }$ be a mixture of the two normal distributions $\begin{array} { r } { \nu _ { - 1 } = \frac { 1 } { 2 } \mathcal { N } ( - 1 , 1 ) } \end{array}$ and $\begin{array} { r } { \nu _ { 1 } = \frac { 1 } { 2 } \mathcal { N } ( 1 , 1 ) } \end{array}$ over the real line. If $\mu$ describes the distribution of real data and $\nu$ describes the distribution of the generative model, then an optimal critic function is given by $\phi ^ { * } ( x ) = - | x |$ .
|
| 114 |
+
|
| 115 |
+
The proof can be found in Appendix C.3.
|
| 116 |
+
|
| 117 |
+
The issue with non-differentiability can be generalized to higher-dimensional spaces based on the observation that an optimal coupling is in general not deterministic. Deterministic couplings are particularly nice in the sense that they allow a transport plan assigning each point $x$ from one distribution deterministically to a point $y$ of the other distribution, without having to split any masses (the search for deterministic optimal couplings is called the Monge problem). However, in a lot of settings no deterministic coupling exists. The notion of a deterministic coupling is formalized in the following definition.
|
| 118 |
+
|
| 119 |
+
Definition 2. Let $( X , \mu )$ and $( Y , \nu )$ be two probability spaces. A coupling $\pi \in \Pi ( \mu , \nu )$ is called deterministic if there is a measurable function $\rho : X Y$ such that su $\eta ( \pi ) \subseteq \{ ( x , \rho ( x ) ) | x \in X \}$ .
|
| 120 |
+
|
| 121 |
+
We can now formulate the following observation.
|
| 122 |
+
|
| 123 |
+
Observation 3. Suppose $\pi ^ { * }$ is a non-deterministic optimal coupling between two probability distributions over $\mathbb { R } ^ { n }$ so that there exist points $( x , y )$ and $( x , y ^ { \prime } )$ in $s u p p ( \pi ^ { * } )$ . Suppose further that there is no $\lambda > 0$ with $( y - x ) = \lambda \cdot ( y ^ { \prime } - x )$ (in particular this implies $y \ne y ^ { \prime }$ ). Then any optimal critic function $f ^ { * }$ is not differentiable at $x$ .
|
| 124 |
+
|
| 125 |
+
The arguments can be found in Appendix C.5.
|
| 126 |
+
|
| 127 |
+
In practice, where the optimal critic is approximated by a NN, the situation is slightly different: A function modeled by an NN is (almost) everywhere differentiable (depending on the activation functions). By the Stone-Weierstrass theorem, on compact sets, we can approximate any (Lipschitz-)continuous function by differentiable functions uniformly. Nevertheless, it seems to be a strong constraint on an approximating function to have a gradient of norm one in the neighborhood of a non-differentiability (cf. Figure 2 (a)). Therefore, we argue – in contrast to the argumentation of Gulrajani et al. (2017) – that the gradient should not be assumed to equal one for arbitrary points on the line between an arbitrary real point $x$ and a generated point $y$ .
|
| 128 |
+
|
| 129 |
+
# 5 HOW TO REGULARIZE WGANS
|
| 130 |
+
|
| 131 |
+
In the following, we will discuss how the regularization of WGANs can be improved.
|
| 132 |
+
|
| 133 |
+
Penalizing the violation of the Lipschitz constraint. For the critic function, we have nothing more at hand than the inequality of the Lipschitz-constraint. Moreover (as shown in Lemma 1 in the Appendix) the exhaustion of the Lipschitz constant is automatic by maximizing the objective function. Therefore, a natural choice of regularization is to penalize the given constraint directly, i.e., sample two points $x \sim \mu$ and $y \sim \nu$ from the empirical and the generated distribution respectively and add the regularization term
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
\left( \operatorname* { m a x } \left\{ 0 , { \frac { | f ( x ) - f ( y ) | } { | | x - y | | _ { 2 } } } - 1 \right\} \right) ^ { 2 }
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
to the cost function. (We square to penalize larger deviations more than smaller ones.) Note the similarity of the regularization term to the squared Hinge loss, which is also used to turn a hard constraint into a soft one in the optimization problem connected to support vector machines.
|
| 140 |
+
|
| 141 |
+
Alternatively, since the NN generates (almost everywhere) differentiable functions, we can penalize whenever gradient norms are strictly larger than one, an option referred to as “one-sided penalty” and shortly discussed as an alternative to penalizing any deviation from one by Gulrajani et al. $( 2 0 1 7 ) ^ { 4 }$ . Note that enforcing the gradient to be smaller than one in norm has the advantage that we penalize when the partial derivative has norm $> 1$ into the direction of steepest descent. Hence, all partial derivatives are implicitly enforced to be bounded in norm by one, too. At the same time, enforcing $\leq 1$ for the gradient of smooth approximating functions is not an unreasonable constraint even at points of non-differentiability. For these reasons we suggest to add the regularization term $\big ( \operatorname* { m a x } { \{ 0 , \lvert \lvert \nabla f ( \hat { x } ) \rvert \rvert - 1 \} } \big ) ^ { 2 }$ to the cost function. Different ways of sampling the point $\hat { x }$ are analyzed in Appendix D.4. Thus, our proposed method (WGAN-LP, where LP stands for Lipschitz penalty) alternates between updating the discriminator to minimize
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
\begin{array} { r } { \mathbb { E } _ { y \sim \nu } [ f ( y ) ] - \mathbb { E } _ { x \sim \mu } [ f ( x ) ] + \lambda \mathbb { E } _ { \hat { x } \sim \tau } [ ( \operatorname* { m a x } \left\{ 0 , | | \nabla f ( \hat { x } ) | | - 1 \right\} ) ^ { 2 } ] \ , } \end{array}
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
(where $\tau$ depends on the concrete sampling strategy chosen) and updating the generator network modeling $\nu$ to minimize $- \mathbb { E } _ { y \sim \nu } [ f ( y ) ]$ using gradient descent.
|
| 148 |
+
|
| 149 |
+
The connection to regularized optimal transport. Consider Equation (2) of regularized OT. For a hard constraint $f ( x ) - g ( y ) \leq | | x - y | | _ { 2 }$ , one can attain the supremum over $\bar { \mathbb { E } } _ { x \sim \mu } [ f ( x ) ] -$ $\mathbb { E } _ { y \sim \nu } [ g ( y ) ] - 0$ by setting $f ( x ) = \operatorname* { i n f } _ { y } g ( y ) + | | x - y | | _ { 2 } = g ( x )$ and subsequently maximize over one function only. Taking the advantage of dealing with a single function as a motivation, one may similarly replace $f = g$ in Equation 2, which uses a soft constraint (even though this can now only approximate the supremum). This leads to an objective of minimizing
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
\mathbb { E } _ { y \sim \nu } [ f ( y ) ] - \mathbb { E } _ { x \sim \mu } [ f ( x ) ] + \frac { 4 } { \epsilon } \int \int \operatorname* { m a x } \big \{ 0 , ( f ( x ) - f ( y ) - | | x - y | | _ { 2 } ) \big \} ^ { 2 } \mathrm { d } \mu ( x ) \mathrm { d } \nu ( y )
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+
that, similarly to Equation (7), softly penalizes whenever $f ( x ) - f ( y ) > | | x - y | | _ { 2 }$ for a real sample $x$ and a generated sample $y$ . It is noteworthy that to justify the replacement $f \ = \ g$ one would require a high regularization parameter $\lambda = \frac { 4 } { \epsilon }$ of the dual problem, which corresponds to a low regularization of the primal problem.
|
| 156 |
+
|
| 157 |
+
Dependence on the regularization hyperparameter $\lambda$ . Let $\mathcal { L } _ { \lambda } ^ { G P }$ and $\mathcal { L } _ { \lambda } ^ { L P }$ denote the infimums of the regularized losses over a class of (differentiable) critic functions $f$ from Equation (6) (WGANGP) and Equation (8) (WGAN-LP) respectively. For the comparison of these optimal losses we have the following result (proof in Appendix C.4).
|
| 158 |
+
|
| 159 |
+
# Proposition 3.
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
\begin{array} { r } { \mathcal { L } _ { \lambda } ^ { L P } \le \mathcal { L } _ { \lambda } ^ { G P } \le \mathcal { L } _ { \lambda } ^ { L P } + \lambda } \end{array}
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
In particular, for small $\lambda$ the optimal scores approximately agree. On the other hand, increasing $\lambda$ strengthens the soft constraints, which means that the theoretical observations from Section 4 become more pertinent with growing $\lambda$ . Our experiments show exactly the behavior that WGANLP and WGAN-GP perform very similarly for small $\lambda$ , while WGAN-LP performs much better for larger values of $\lambda$ and its performance is much less dependent on the choice of hyperparameter $\lambda$ .
|
| 166 |
+
|
| 167 |
+
A more general view. The Kantorovich duality theorem holds in a quite general setting. For example, a different metric can be substituted for the Euclidean distance $| | \cdot | | _ { 2 }$ . Taking $| | \cdot | | _ { 2 } ^ { \bar { p } }$ for a different natural number $p$ for example leads to the minimization of the Wasserstein distance of order $p$ (i.e., the Wasserstein- $p$ distance). Based on the dual problem to the computation of the Wasserstein distance of order $p$ (as given by the Kantorovich duality theorem) we still need to maximize Equation (5) with the only difference that 1-Lipschitz-continuity is now measured with respect to $| | \cdot | | _ { 2 } ^ { p }$ . For our training method this entails that the only modification to make is to use the regularization term given by (7), where the Euclidean distance is replaced by the metric of interest. We provide experimental results for the Wasserstein-2 distance in Appendix D.5.
|
| 168 |
+
|
| 169 |
+
Recently, by Bellemare et al. (2017), the Wasserstein distance was replaced by the energy distance 5. For the training of Cramer GANs, the authors apply the GP-penalty term proposed by Gulrajani et al. (2017). We expect that using the LP-penalty term instead is also beneficial for Cramer GANs.
|
| 170 |
+
|
| 171 |
+
# 6 EXPERIMENTS
|
| 172 |
+
|
| 173 |
+
We perform several experiments on three toy data sets, 8Gaussians, 25Gaussians, and Swiss Roll 6, to compare the effect of different regularization terms. More specifically, we compare the performance of WGAN-GP and WGAN-LP as described in Equations (6) and (8) respectively, where the penalty was applied to points randomly sampled on the line between the training sample $x$ and the generated sample $y$ . Other sampling methods are discussed in Appendix D.4.
|
| 174 |
+
|
| 175 |
+
Both, the generator network and the critic network, are simple feed-forward NNs with three hidden Leaky ReLU layers, each containing 512 neurons, and one linear output layer. The dimensionality of the latent variables of the generator network was set to two. During training, 10 critic updates are performed for every generator update, except for the first 25 generator updates, where the critic is updated 100 times for each generator update in order to get closer to the optimal critic in the beginning of training. Both networks were trained using RMSprop (Tijmen & Hinton, 2012) with learning rate $5 \cdot 1 0 ^ { - 5 }$ and a batch size of 256.
|
| 176 |
+
|
| 177 |
+
To see whether our findings on toy data sets can be transferred to real world settings, we trained bigger WGAN-GPs and WGAN-LPs on CIFAR-10 as it is described below. Code for the reproduction of our results is available under https://github.com/lukovnikov/improved_wgan_ training .
|
| 178 |
+
|
| 179 |
+
Level sets of the critic. A qualitative way to evaluate the learned critic function for a twodimensional data set is by displaying its level sets, as it was done by Gulrajani et al. (2017) and Kodali et al. (2017). The level sets after 10, 50, 100 and 1000 training iterations of a WGAN trained with the GP and LP penalty on the Swiss Roll data set are shown in Figure 3. Similar experimental results for the 8Gaussians and 25Gaussian data sets can be found in Appendix D.1.
|
| 180 |
+
|
| 181 |
+
It becomes clear that with a penalty weight of $\lambda = 1 0$ , which corresponds to the hyperparameter value suggested by Gulrajani et al. (2017), the WGAN-GP does neither learn a good critic function nor a good model of the data generating distribution. With a smaller regularization parameter, $\lambda = 1$ , learning is stabilized. However, with the LP-penalty a good critic is learned even with a high penalty weight in only a few iterations and the level sets show higher regularity. Training a WGAN-LP with lower penalty weight led to equivalent observations (results not shown). We also experimented with much higher values for $\lambda$ , which led to almost the same results as for $\lambda = 1 0$ , which emphasizes that LP-penalty based training is less sensitive to the choice of $\lambda$ .
|
| 182 |
+
|
| 183 |
+
Evolution of the critic loss. To yield a fair comparison of methods applying different regularization terms, we display values of the critic’s loss functions without the regularization term throughout training. Results for WGAN-GPs and WGAN-LPs are shown in Figure 4.
|
| 184 |
+
|
| 185 |
+
The optimization of the critic with the GP-penalty and $\lambda = 5$ is very unstable: the loss is oscillating heavily around 0. When we use the LP-penalty instead, the critic’s loss smoothly reduces to zero, which is what we expect when the generative distribution $\nu$ steadily converges to the empirical distribution $\mu$ . Also note that we would expect the negative of the critic’s loss to be slightly positive, as a good critic function assigns higher values to real data points $x \sim \mu$ and lower values to generated points $y \sim \nu$ . This is exactly what we observe when using the LP-penalty Interestingly, when using the LP-penalty in combination with a very high penalty weight, like $\lambda = 1 0 0$ , we obtain the same results, indicating that the constraint is always fulfilled for $\lambda = 1 0$ already. Using $\lambda = 1$ in combination with the GP-penalty on the other hand stabilized training but still results in fluctuations in the beginning of the training (results shown in Appendix D.2).
|
| 186 |
+
|
| 187 |
+

|
| 188 |
+
Figure 3: Level sets of the critic $f$ of WGANs during training, after 10, 50, 100, 500, and 1000 iterations. Yellow corresponds to high, purple to low values of $f$ . Training samples are indicated in red, generated samples in blue. Top: GP-penalty with $\lambda = 1 0$ . Middle: GP-penalty with $\lambda = 1$ . Bottom: LP-penalty with $\lambda = 1 0$ .
|
| 189 |
+
|
| 190 |
+

|
| 191 |
+
Figure 4: Evolution of the negative of WGAN critic’s loss (without the regularization term) for $\lambda = 5$ . Median results over the 20 runs (blue area indicates quantiles, green dots outliers). Left: For the GP-penalty. Right: For the LP-penalty.
|
| 192 |
+
|
| 193 |
+
Estimating the Wasserstein distance. In order to estimate how the actual Wasserstein distance between the real and generated distribution evolves during training, we compute the cost of minimum assignment based on Euclidean distance between sets of samples from the real and generated distributions, using the Kuhn-Munkres algorithm (Kuhn, 1955). We use a sample set size of 500 to maintain reasonable computation time and estimate the distance every 10th iteration over the course of 500 iterations. All experiments were repeated 10 times for different random seeds. From the results for WGAN-GP and WGAN-LP with $\lambda = 5$ shown in Figure 5, we conclude that the proposed LP-penalty leads to smaller estimated Wasserstein distance and less fluctuations during training.
|
| 194 |
+
|
| 195 |
+
Table 1: Inception Score on CIFAR-10. Reported are the maximal mean values reached during training. Means are computed over 10 image sets, variances given in parenthesis.
|
| 196 |
+
|
| 197 |
+
<table><tr><td>PENALTYWEIGHT</td><td>WGAN-GP</td><td>WGAN-LP</td></tr><tr><td></td><td></td><td></td></tr><tr><td>0.1</td><td>7.781 (± 0.104)</td><td>8.017(± 0.075)</td></tr><tr><td>5</td><td>7.817 (± 0.095)</td><td>7.859 (± 0.085)</td></tr><tr><td>10</td><td>7.840 (± 0.066)</td><td>7.989 (± 0.119)</td></tr><tr><td>100</td><td>7.548 (± 0.102)</td><td>7.815 (± 0.038)</td></tr><tr><td>200</td><td>7.472 (± 0.070)</td><td>7.721 (± 0.105)</td></tr></table>
|
| 198 |
+
|
| 199 |
+
When training WGAN-GPs with a regularization parameter of $\lambda = 1$ , training is stabilized as well (see Appendix D.3), indicating that the effect of using a GP-penalty is highly dependent on the right choice of $\lambda$ .
|
| 200 |
+
|
| 201 |
+

|
| 202 |
+
Figure 5: Evolution of the approximated Wasserstein-1 distance during training of WGANs $\lambda = 5$ , median results over 10 runs). Left: For the GP-penalty. Right: For the LP-penalty.
|
| 203 |
+
|
| 204 |
+
Sample quality on CIFAR-10. We trained WGANs with the same ResNet generator and discriminator and the same hyperparameters as Gulrajani et al. (2017) and computed the Inception score (Salimans et al., 2016) throughout training (plots can be found in Appendix D.6). The maximal scores reached in 100000 training iterations with different regularization parameters are reported in Table 1. WGAN-LP reaches the similar or slightly better Inception score as WGAN-GP with small penalty weight $( \lambda \leq 1 0 )$ , while being more stable to other choices of this hyperparameter. This is especially interesting in the light of a recent large scale study, which also reported a strong dependence of sample quality on $\lambda$ for WGAN-GP (see, Figure 8 and 9 in Lucic et al., 2017). Another interesting observation can be made by monitoring the value of the regularization term during training, as in Figure 6), where contributions to the penalty from $| | \nabla f ( \hat { x } ) \bar { | | } > 1$ are shown in the upper and contributions $| | \nabla f ( \hat { x } ) | | < 1$ (only existing for WGAN-GP) are shown in the lower half plane. While the values of the one-sided regularization of WGAN-LP are only slightly larger for larger $\lambda$ (100 compared to 5) the regularization of WGAN-GP shows a strong dependence on the choice of the regularization parameter. For $\lambda = 5$ the penalty contributions from gradient norms smaller than one almost vanished (we found this getting even more severe for even smaller regularization parameters). That is, in a setting where WGAN-GP is performing fine it actually acts similar to WGAN-LP.
|
| 205 |
+
|
| 206 |
+
Related penalties We tested the effects of using the regularization terms given by Equation (7) and Equation (9) instead of the the proposed regularization given in Equation (8). Both lead to good performance on toy data but to considerably worse results on CIFAR-10, where training was very unstable. Results are shown in Appendix D.7
|
| 207 |
+
|
| 208 |
+

|
| 209 |
+
Figure 6: Comparison of the magnitude of the gradient penalty during training on CIFAR, showing $< 1$ and $> 1$ contributions (i.e. $\mathbf { \dot { m } } \mathrm { i n } ( 0 , | | \nabla f ( \mathbf { \dot { \hat { x } } } ) | | - 1 ) ^ { \mathbf { \dot { 2 } } }$ resp. $\operatorname* { m a x } ( \bar { 0 } , | | \nabla f ( \bar { { \boldsymbol x } } ) | | - 1 ) ^ { 2 } )$ ). Left: for regularization parameter $\lambda = 5$ . Right: for regularization parameter $\lambda = 1 0 0$ . The (one-sided) gradient penalty of WGAN-LP is depicted in blue (solid), the gradient penalty of WGAN-GP in red (dashed). All the values for every iteration (one mini-batch) are shown in light blue and red. Dark blue and red lines show the mean over a sliding window of size 500. The figure shows that the part of the gradient penalty of WGAN-GP penalizing a gradient $\leq 1$ almost vanishes for a small regularization parameter, bringing it close to WGAN-LP. For larger values of the regularization parameter, the total penalty of WGAN-GP and its contributing parts are larger than the penalty of WGAN-LP, however, the performance of WGAN-GP suffers more.
|
| 210 |
+
|
| 211 |
+
# 7 CONCLUSION
|
| 212 |
+
|
| 213 |
+
For stable training of Wasserstein GANs, we propose to use the following penalty term to enforce the Lipschitz constraint that appears in the objective function:
|
| 214 |
+
|
| 215 |
+
$$
|
| 216 |
+
\mathbb { E } _ { \hat { x } \sim \tau } [ ( \operatorname* { m a x } \left\{ 0 , \vert \vert \nabla f ( \hat { x } ) \vert \vert - 1 \right\} ) ^ { 2 } ] \tau .
|
| 217 |
+
$$
|
| 218 |
+
|
| 219 |
+
We presented theoretical and empirical evidence that this gradient penalty performs better than the previously considered approaches of clipping weights and of applying the stronger gradient penalty given by $\mathbb { E } _ { \hat { x } \sim \tau } [ ( | | \nabla f ( \bar { x } ) | | _ { 2 } - 1 ) ^ { 2 } ]$ . In addition to more stable learning behavior, the proposed regularization term leads to lower sensitivity to the value of the penalty weight $\lambda$ (demonstrating smooth convergence and well-behaved critic scores throughout the whole training process for different values of $\lambda$ ).
|
| 220 |
+
|
| 221 |
+
# ACKNOWLEDGMENTS
|
| 222 |
+
|
| 223 |
+
This work is supported in part by the European Union under the Horizon 2020 Framework Program for the project WDAqua (GA 642795).
|
| 224 |
+
|
| 225 |
+
The authors thank the anonymous reviewers for their valuable suggestions.
|
| 226 |
+
|
| 227 |
+
# REFERENCES
|
| 228 |
+
|
| 229 |
+
Mart´ın Arjovsky and Leon Bottou. Towards principled methods for training generative adversarial ´ networks. arXiv e-print, arXiv:1701.04862, 2017.
|
| 230 |
+
Mart´ın Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein generative adversarial networks. ´ In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, pp. 214–223, 2017.
|
| 231 |
+
Marc G. Bellemare, Ivo Danihelka, Will Dabney, Shakir Mohamed, Balaji Lakshminarayanan, Stephan Hoyer, and Remi Munos. The Cramer distance as a solution to biased Wasserstein gra- ´ dients. arXiv e-print, arXiv:1705.10743, 2017.
|
| 232 |
+
Mathieu Blondel, Vivien Seguy, and Antoine Rolet. Smooth and sparse optimal transport. arXiv e-prints, arXiv:1710.06276, 2017.
|
| 233 |
+
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 29, pp. 2172–2180, 2016.
|
| 234 |
+
Marco Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In Advances in Neural Information Processing Systems 26, pp. 2292–2300, 2013.
|
| 235 |
+
Arnaud Dessein, Nicolas Papadakis, and Jean-Luc Rouas. Regularized optimal transport and the rot mover’s distance. arXiv e-prints, arXiv:1610.06447, 2016.
|
| 236 |
+
David A. Edwards. On the Kantorovich–Rubinstein theorem. Expositiones Mathematicae, 29(4): 387 – 398, 2011.
|
| 237 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in Neural Information Processing Systems 27, pp. 2672–2680, 2014.
|
| 238 |
+
Ishaan Gulrajani, Faruk Ahmed, Mart´ın Arjovsky, Vincent Dumoulin, and Aaron C. Courville. Improved training of Wasserstein GANs. arXiv e-prints, arXiv:1704.00028, 2017.
|
| 239 |
+
Naveen Kodali, Jacob D. Abernethy, James Hays, and Zsolt Kira. How to train your DRAGAN. arXiv e-prints, arXiv:1705.07215v3, 2017.
|
| 240 |
+
Harold W. Kuhn. The Hungarian method for the assignment problem. Naval Research Logistics Quarterly, 2:83–97, 1955.
|
| 241 |
+
Mario Lucic, Karol Kurach, Marcin Michalski, Sylvain Gelly, and Olivier Bousquet. Are GANs created equal? A large-scale study. arXiv e-prints, arXiv:1711.10337, 2017.
|
| 242 |
+
Sebastian Nowozin, Botond Cseke, and Ryota Tomioka. f-gan: Training generative neural samplers using variational divergence minimization. In Advances in Neural Information Processing Systems 29, pp. 271–279. 2016.
|
| 243 |
+
Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. arXiv e-prints, arXiv:1511.06434, 2015.
|
| 244 |
+
Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, Xi Chen, and Xi Chen. Improved techniques for training gans. In Advances in Neural Information Processing Systems 29, pp. 2234–2242. 2016.
|
| 245 |
+
Gabor J Sz ´ ekely and Maria L Rizzo. Energy statistics: A class of statistics based on distances. ´ Journal of statistical planning and inference, 143(8):1249–1272, 2013.
|
| 246 |
+
Tieleman Tijmen and Geoffrey Hinton. Lecture 6.5—RmsProp: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural Networks for Machine Learning, 2012.
|
| 247 |
+
Ilya Tolstikhin, Sylvain Gelly, Olivier Bousquet, Carl-Johann Simon-Gabriel, and Bernhard Scholkopf. Adagan: Boosting generative models. ¨ arXiv e-prints, arXiv:1701.02386, 2017.
|
| 248 |
+
Cedric Villani. ´ Optimal Transport: Old and New. Grundlehren der mathematischen Wissenschaften. Springer Berlin Heidelberg, 2008. ISBN 9783540710509.
|
| 249 |
+
|
| 250 |
+
# A PROPERTIES OF AN OPTIMAL CRITIC FUNCTION OF WGANS
|
| 251 |
+
|
| 252 |
+
An issue of the original GAN discriminator was that it outputs zero every time it is certain to see generated data, independent on how far away a generated data point lies from the real distribution. As a consequence, locally, there is no incentive for the generator to rather generate a value closer to (but still off) the real data; GAN critic’s optimal value is zero in either case. The WGAN’s optimal critic function measures this distance which helps for the generated distribution to converge, but the interpretation of the absolute value as indicating real (close to 1) and fake data (close to 0) is lost. And worse, there is even no guarantee that the relative values of the optimal critic function help to decide what is real and what is fake. Although this does not seem to cause major problems for the iterative training procedure in practice, we still consider it worthwhile to give a specific example justifying the following observation.
|
| 253 |
+
|
| 254 |
+
Observation 4. The WGAN generator could learn wrong things, basing its decision on the values of the optimal critic function, i.e., if it generates at locations of high critic function values.
|
| 255 |
+
|
| 256 |
+
Consider the following setting, where the X’s represent generated and the O’s represent real data points.
|
| 257 |
+
|
| 258 |
+

|
| 259 |
+
Figure 7: Values of the WGAN critic function for some generated data points can be higher than the critic’s values for some real data points. Thus, fake and real points can not be distinguished based on the critics values alone. Real data points are represented by O, generated by X.
|
| 260 |
+
|
| 261 |
+
An optimal coupling in this example is quite obvious: We connect the left-most O with the X on the left, and then extend by an arbitrary matching of the other O’s with the other X’s. It is then not hard to verify that the indicated critic function with slope 1 or $- 1$ almost everywhere leads to an equality in the Kantorovich duality and hence is optimal. The value of the critic function at the left-most X is higher than the value at the right-most O, suggesting to generate images at the wrong position. This issue might be fixed by the alternating updates of generator and critic at a later stage of training when less X’s are generated so far on the right side of the O’s. The critic function will then flatten the peak, eventually assigning a lower value to an $\mathrm { X }$ on the left than to any of the O’s.
|
| 262 |
+
|
| 263 |
+
Remark 1. The same holds (with only a slight change of the critic function $f$ ) if the $X$ ’s and $O _ { s }$ denote the centers of Gaussians. This can be shown with similar arguments as those in the proofs in Appendix C.3.
|
| 264 |
+
|
| 265 |
+
# A.1 PROVING OPTIMALITY OF CERTAIN COMBINATIONS OF COUPLING AND CRITIC FUNCTION
|
| 266 |
+
|
| 267 |
+
We show here that the coupling and critic function indicated in Figure 1 are indeed optimal.
|
| 268 |
+
|
| 269 |
+
In the one-dimensional example on the left, $\begin{array} { r } { \int _ { \mathbb { R } \times \mathbb { R } } | x - y | d \pi ^ { * } ( x , y ) = \frac { 1 } { 7 } ( 1 + 1 + 1 + 1 + 1 + 1 + 1 ) = } \end{array}$ $\begin{array} { r } { \int _ { \mathbb { R } } f ^ { * } ( x ) d \mu ( x ) - \int _ { \mathbb { R } } f ^ { * } ( x ) d \nu ( x ) } \end{array}$ and thus $\pi ^ { * }$ and $f ^ { * }$ are indeed optimal.
|
| 270 |
+
|
| 271 |
+
In the two-dimensional example on the right, the coupling indicated in red and the critic function (described by its function values in blue) are optimal, since with this choice we have
|
| 272 |
+
|
| 273 |
+
$\begin{array} { r } { \int _ { \mathbb { R } ^ { n } \times \mathbb { R } ^ { n } } | | x - y | | _ { 2 } \ d \pi ^ { * } ( x , y ) \ = \ \frac { 1 } { 2 } ( 1 + 1 ) \ = \ 1 } \end{array}$ and $\begin{array} { r } { \int _ { \mathbb { R } ^ { n } } f ^ { * } ( y ) \ d \nu ( y ) \ - \ \int _ { \mathbb { R } ^ { n } } f ^ { * } ( x ) \ d \mu ( x ) \ = } \end{array}$ $\textstyle { \frac { 1 } { 2 } } ( 1 + a + 1 ) - { \frac { 1 } { 2 } } ( 0 + a ) = 1$ . Equality of the left hand side and right hand side of the equation proves optimality on both sides.
|
| 274 |
+
|
| 275 |
+
# B THE ISSUE WITH THE WEIGHT CLIPPING APPROACH
|
| 276 |
+
|
| 277 |
+
The critic function of WGAN is given by a neural network, which raises the question on how to enforce the 1-Lipschitz constraint in the maximization problem of the objective in Equation (5). As Arjovsky et al. (2017) point out, it does not matter whether to maximize over 1-Lipschitz or $\alpha$ - Lipschitz continuous functions, since we can equivalently optimize $\alpha \cdot W ( \mu , \nu )$ instead of $W ( \mu , \nu )$ . An easy consideration leads to the following lemma.
|
| 278 |
+
|
| 279 |
+
Lemma 1. The optimal critic function $f ^ { * }$ (leading to the maximum in Eq. (4)) exhausts the Lipschitz constraint for given $\alpha$ in the sense that there is a pair of points $( x , y )$ such that $f ^ { * } ( x ) - f ^ { * } ( y ) =$ $\alpha | | x - y | | _ { 2 }$ .
|
| 280 |
+
|
| 281 |
+
Proof. If supx6=y n f ∗(y)−f ∗(x)||x−y|| o = c < α , then g = 1c f ∗ generates a contradiction to the optimality of $f ^ { * }$ . (Alternatively, in the case $\alpha = 1$ , it follows directly from Theorem 1, (ii), that the transport is optimal if and only if the Lipschitz constraint of one is exhausted for any two points of the coupling.) □
|
| 282 |
+
|
| 283 |
+
Observation 5. Weight clipping is not a good strategy to enforce the Lipschitz constraint for the critic function.
|
| 284 |
+
|
| 285 |
+
First note that by clipping the weights we enforce a common Lipschitz constraint, where the common Lipschitz constant $\bar { \alpha }$ is defined as the minimal $\alpha \in \mathbb { R }$ such that ${ \overline { { f ( x ) - f ( y ) } } } \leq \alpha \| x - y \| _ { 2 }$ for all $x , y$ and all functions $f$ that can be generated by the network under weight clipping. The actual value of $\bar { \alpha }$ does not follow directly from the weight clipping constant $c _ { \mathrm { m a x } }$ but can be computed from the structure of the network. From Lemma 1 we know that an optimal $f ^ { * }$ exhausts the Lipschitz constraint. We will now show exemplarily for deep NN with rectified linear unit (ReLU) activation functions that there is an extremely limited number of functions generated by the NN using weight clipping that do exhaust the implicitly given common Lipschitz constraint $\bar { \alpha }$ . It follows that, in almost all cases, the optimal $f ^ { * }$ is not in the class of functions that can be generated by the network under the weight clipping constraint.
|
| 286 |
+
|
| 287 |
+
Proposition 4. Consider a (deep) NN with ReLU activation functions and linear output layer. A function generated by the NN under constraining each weight in absolute value by $c _ { m a x }$ exhausts the common Lipschitz constraint if and only if
|
| 288 |
+
|
| 289 |
+
(a) The weight matrix of the first layer consists of constant columns with value $c _ { m a x } o r - c _ { m a x } .$
|
| 290 |
+
|
| 291 |
+
$( b )$ The weights of all other layers are given by a matrix $C ^ { m a x }$ with every entry equal to $c _ { m a x }$
|
| 292 |
+
|
| 293 |
+
Proof. We need to determine every function $f ^ { * }$ generated by the neural network, such that we can find points $x ^ { * } \neq y ^ { * }$ with $f ^ { * } ( y ^ { * } ) - f ^ { * } ( x ^ { * } ) = \bar { \alpha } | | x ^ { * } - y ^ { * } | | _ { 2 }$ . Recall that $\bar { \alpha }$ is defined as the minimal $\alpha$ satisfying $f ( y ) - f ( x ) \leq \alpha \vert \vert x - y \vert \vert _ { 2 }$ for all functions $f$ generated by the neural network and all points $x , y$ .
|
| 294 |
+
|
| 295 |
+
In the following, we will denote by $\alpha ( f )$ the Lipschitz constant of $f$ , i.e., the smallest $\alpha \in \mathbb { R }$ such that $f ( x ) - f ( y ) \leq \alpha \vert \vert x - y \vert \vert _ { 2 }$ for all $x , y$ .
|
| 296 |
+
|
| 297 |
+
Every function generated by the neural net is a composition of functions
|
| 298 |
+
|
| 299 |
+
$$
|
| 300 |
+
f = f _ { n } \circ { \mathrm { r e l u } } \circ f _ { n - 1 } \circ . . . \circ { \mathrm { r e l u } } \circ f _ { 1 } .
|
| 301 |
+
$$
|
| 302 |
+
|
| 303 |
+
with linear functions $f _ { i }$ and relu denoting a layer of activation functions with rectifier linear units. Since each linear function $f _ { i }$ is Lipschitz continuous with Lipschitz constant $\alpha ( f _ { i } )$ and relu is Lipschitz continuous with $\alpha ( \mathrm { r e l u } ) = 1$ , it follows that $f$ is Lipschitz continuous with $\begin{array} { r } { \dot { \alpha } ( f ) \le \prod _ { i } \alpha ( \bar { f } _ { i } ) } \end{array}$ . Moreover, equality holds if there is a pair of points $( x , y )$ such that the consecutive images witness the maximal Lipschitz constant $\alpha ( f _ { i } )$ and $\alpha ( \mathrm { { r e l u } ) }$ for each of the individual functions making up the composition of $f$ . More formally, equality holds if and only if there is a tuple of pairs of points $( \boldsymbol { x } ^ { ( i ) } , \boldsymbol { y } ^ { ( \bar { i } ) } )$ , $1 \leq i \leq n - 1$ , such that for all $1 \leq i \leq n$ ,
|
| 304 |
+
|
| 305 |
+
(i) $\boldsymbol { x } ^ { ( i ) } \neq \boldsymbol { y } ^ { ( i ) }$
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
| f _ { i } ( x ^ { ( i ) } ) - f _ { i } ( y ^ { ( i ) } ) | = \alpha ( f _ { i } ) | | x ^ { ( i ) } - y ^ { ( i ) } | | _ { 2 }
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
(iv) All entries of $f _ { i } ( x ^ { ( i ) } )$ and $f _ { i } ( y ^ { ( i ) } )$ are larger or equal to zero. This is equivalent to the condition that
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
\begin{array} { r } { | \mathrm { r e l u } ( f _ { i } ( x ^ { ( i ) } ) ) - \mathrm { r e l u } ( f _ { i } ( y ^ { ( i ) } ) ) | = \alpha ( \mathrm { r e l u } ) | | f _ { i } ( x ^ { ( i ) } ) - f _ { i } ( y ^ { ( i ) } ) | | _ { 2 } \ . } \end{array}
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
It follows that to determine $f ^ { * }$ we need to maximize $\alpha ( f _ { i } )$ for the linear layers with weight constraint $c _ { \mathrm { m a x } }$ and find a sequence of points $( x ^ { ( i ) } , y ^ { ( i ) } )$ that satisfy (i)-(iv). The existence of the sequence of points shows that $\begin{array} { r } { \bar { \alpha } ( f ^ { * } ) = \bar { \prod } _ { i = 1 } ^ { n } \alpha ( f _ { i } ) } \end{array}$ and maximizing each $\alpha ( f _ { i } )$ then shows that
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
\alpha ( f ^ { * } ) = \prod _ { i = 1 } ^ { n } \alpha ( f _ { i } ) = \bar { \alpha } .
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
Since, as we will show, the conditions in (a) and (b) maximize the Lipschitz constraint of each layer individually, the existence of suitable $( x ^ { ( i ) } , y ^ { ( i ) } )$ proves the if-direction of the proposition.
|
| 324 |
+
|
| 325 |
+
For the only-if direction, we will see that the ability to find the sequence of points gives restrictions on how to maximize $\alpha ( f _ { i } )$ of an individual layer, leading to the more restrictive condition of (b) for all but the first layer (cf. (a)).
|
| 326 |
+
|
| 327 |
+
So let us first maximize the Lipschitz constraint of each linear layer and then make sure that we can find the corresponding points. We write the linear layer as a matrix multiplication $f _ { i } ( x ) = A ^ { ( i ) } x$ . Using linearity,
|
| 328 |
+
|
| 329 |
+
$$
|
| 330 |
+
\alpha ( f _ { i } ) = \operatorname* { m a x } _ { | | z | | _ { 2 } = 1 } | | A ^ { ( i ) } z | | _ { 2 } \ ,
|
| 331 |
+
$$
|
| 332 |
+
|
| 333 |
+
and our goal can be reformulated to finding the matrix $A ^ { ( i ) }$ maximizing $\alpha ( f _ { i } )$
|
| 334 |
+
|
| 335 |
+
For any fixed $z$ , $| | A ^ { ( i ) } z | | _ { 2 }$ is maximized exactly when each vector entry is maximized in absolute value. Now, with $A ^ { ( i ) } = ( a _ { j , k } ^ { ( i ) } ) _ { j , k }$ and $\operatorname { s g n } ( { \mathord { \cdot } } )$ denoting the sign function,
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
| ( A ^ { ( i ) } z ) _ { j } | = \left| \sum _ { k } a _ { j , k } ^ { ( i ) } z _ { k } \right| \leq \sum _ { k } | a _ { j , k } ^ { ( i ) } | | z _ { k } | \leq \sum _ { k } c _ { \operatorname* { m a x } } | z _ { k } | \mathrm { ( b y ~ t h e ~ w e i g h t ~ c o n s t r a i n t ) }
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
= \sum _ { k } ( c _ { \mathrm { m a x } } \cdot \mathrm { s g n } ( z _ { k } ) ) \cdot z _ { k }
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
and equality holds if and only if $A ^ { ( i ) }$ or $- A ^ { ( i ) }$ consists of columns of constant entry with the value $c _ { \mathrm { m a x } } \cdot \mathrm { s g n } ( z _ { k } )$ in column $k$ . It follows that
|
| 346 |
+
|
| 347 |
+
$$
|
| 348 |
+
\alpha ( f _ { i } ) = \operatorname* { m a x } _ { | | z | | _ { 2 } = 1 } | | A ^ { ( i ) } z | | _ { 2 } = \operatorname* { m a x } _ { | | z | | _ { 2 } = 1 } c _ { \operatorname* { m a x } } \cdot | | z | | _ { 1 }
|
| 349 |
+
$$
|
| 350 |
+
|
| 351 |
+
$$
|
| 352 |
+
= c _ { \operatorname* { m a x } } \sqrt { d i m ( z ) }
|
| 353 |
+
$$
|
| 354 |
+
|
| 355 |
+
with equality if and only if $\begin{array} { r } { z _ { k } = \pm \frac { 1 } { \sqrt { d i m ( z ) } } } \end{array}$ for all $k$ .
|
| 356 |
+
|
| 357 |
+
Hence, for the first linear layer we need to choose a matrix $A ^ { ( 1 ) }$ satisfying (a) of the statement of the proposition.
|
| 358 |
+
|
| 359 |
+
Now, we find a pair $( x ^ { ( 1 ) } , y ^ { ( 1 ) } )$ with
|
| 360 |
+
|
| 361 |
+
$$
|
| 362 |
+
x ^ { ( 1 ) } - y ^ { ( 1 ) } = a \cdot ( \pm 1 , \pm 1 , \ldots , \pm 1 ) { \mathrm { f o r ~ s o m e ~ } } a \neq 0
|
| 363 |
+
$$
|
| 364 |
+
|
| 365 |
+
such that
|
| 366 |
+
|
| 367 |
+
$$
|
| 368 |
+
\mathtt { s g n } ( x _ { k } ^ { ( 1 ) } ) = \mathtt { s g n } ( y _ { k } ^ { ( 1 ) } ) = \mathtt { s g n } ( x _ { k } ^ { ( 1 ) } - y _ { k } ^ { ( 1 ) } ) = \mathtt { t h e ~ s i g n ~ o f ~ c o l u m n } k \mathrm { ~ o f ~ } A ^ { ( 1 ) } .
|
| 369 |
+
$$
|
| 370 |
+
|
| 371 |
+
This is the only possibility to ensure (iii) and (iv) of the conditions above. Note that also (i) holds for $( x ^ { ( 1 ) } , y ^ { ( 1 ) } )$ , and (ii) (together with (iv)) determines $( x ^ { ( 2 ) } , y ^ { ( 2 ) } )$ uniquely from $( x ^ { ( 1 ) } , y ^ { ( 1 ) } )$ as
|
| 372 |
+
|
| 373 |
+
$$
|
| 374 |
+
\begin{array} { r } { x ^ { ( 2 ) } = A ^ { ( 1 ) } x ^ { ( 1 ) } = c _ { \operatorname* { m a x } } \cdot \vert \vert x ^ { ( 1 ) } \vert \vert _ { 1 } \cdot ( 1 , 1 , . . . , 1 ) } \\ { \& } \end{array} .
|
| 375 |
+
$$
|
| 376 |
+
|
| 377 |
+
We may assume that $| | x ^ { ( 1 ) } | | _ { 1 } ~ > ~ | | y ^ { ( 1 ) } | | _ { 1 }$ . (Otherwise, switch the roles of $x$ and $y$ . In the case of equality, we need to choose a different pair for $( x ^ { ( 1 ) } , y ^ { ( 1 ) } )$ not to violate (i) for $( x ^ { ( 2 ) } , y ^ { ( 2 ) } )$ .) Then we have that $x ^ { ( 2 ) } \neq y ^ { ( 2 ) }$ ,
|
| 378 |
+
|
| 379 |
+
$$
|
| 380 |
+
+ 1 = \mathrm { s g n } ( x _ { k } ^ { ( 2 ) } ) = \mathrm { s g n } ( y _ { k } ^ { ( 2 ) } ) = \mathrm { s g n } ( x _ { k } ^ { ( 2 ) } - y _ { k } ^ { ( 2 ) } ) \mathrm { f o r } \mathrm { a l l } k .
|
| 381 |
+
$$
|
| 382 |
+
|
| 383 |
+
Using the same arguments as above, it follows that for such $( x ^ { ( 2 ) } , y ^ { ( 2 ) } )$ , to maximize the Lipschitz constant of $f _ { 2 }$ (and to guarantee that the maximum is reached at $( x ^ { ( 2 ) } , y ^ { ( 2 ) } ) )$ , we need to have $A ^ { ( 2 ) }$ equal to a matrix with $c _ { \mathrm { m a x } }$ at each position.
|
| 384 |
+
|
| 385 |
+
Now (i)-(iv) also hold for the second layer and one may now proceed by induction to show that for $i \geq 2$ , $A ^ { ( i ) }$ contains only $c _ { \mathrm { m a x } }$ for each of its entries. This is the only way to maximize the Lipschitz constraint for functions generated by the neural net, and it does indeed hold $| | f ^ { * } ( x ^ { * } ) - f ^ { * } ( y ^ { * } ) | | _ { 2 } =$ ${ \bar { \alpha } } | | x - y | | _ { 2 }$ with $x ^ { * } = x ^ { ( 1 ) } , y ^ { * } = y ^ { ( 1 ) }$ and
|
| 386 |
+
|
| 387 |
+
$$
|
| 388 |
+
( x ^ { ( i ) } , y ^ { ( i ) } ) = ( f _ { i } \circ \mathsf { r e l u } \circ f _ { i - 1 } \circ \dots \circ \mathsf { r e l u } \circ f _ { 1 } ( x ^ { * } ) , f _ { i } \circ \mathsf { r e l u } \circ f _ { i - 1 } \circ \dots \circ \mathsf { r e l u } \circ f _ { 1 } ( y ^ { * } ) ) .
|
| 389 |
+
$$
|
| 390 |
+
|
| 391 |
+
# C PROOFS
|
| 392 |
+
|
| 393 |
+
# C.1 PROOF OF THEOREM 1
|
| 394 |
+
|
| 395 |
+
Proof. We provide the arguments how to derive our version from Theorem 5.10 of Villani (2008).
|
| 396 |
+
|
| 397 |
+
With $c ( x , y ) = | | x - y | | _ { 2 }$ , our assumptions imply (with $c _ { \mathcal { X } } = c _ { \mathcal { Y } } = | | \cdot | | _ { 2 } )$ that all conclusions of Theorem 5. $1 0 \ ( i ) - ( i i i )$ hold. Moreover, 5.4 of Villani (2008) shows that in this case $\psi = \psi ^ { c }$ (in the notation of Villani (2008)) and $c$ -convexity is the same as 1-Lipschitz continuity. This leads to our formulation in (i) and the existence of an optimal coupling $\pi ^ { * }$ and an optimal critic function $f ^ { * }$ by part (iii).
|
| 398 |
+
|
| 399 |
+
If we let
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
\Gamma _ { f } = \{ ( x , y ) \in \mathbb { R } ^ { n } \times \mathbb { R } ^ { n } \mid f ( x ) - f ( y ) = | | x - y | | _ { 2 } \}
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
then it follows from the proof of Theorem 5.10 that the set $\Gamma$ in part 5.10 (iii) is given by $\Gamma =$ Tf∗∈Lip optimal Γf∗ , where f ∗ being optimal means that it leads to a maximum on the RHS of equation (1).
|
| 406 |
+
|
| 407 |
+
To prove our part $( i i )$ from 5.10, let $\pi ^ { * }$ be optimal. Then, by 5.10 (iii), $\pi ^ { * } ( \Gamma ) = 1$ . Hence, in particular, $\pi ^ { * } ( \Gamma _ { f ^ { * } } ) = 1$ for all optimal $f ^ { * } \in \mathcal { L } i p _ { 1 }$ . This shows that (a) implies (b). For the other direction, we use that if $\pi ^ { * } ( \Gamma _ { f ^ { * } } ) = 1$ for all optimal $f ^ { * }$ , then $\pi ^ { * } ( \Gamma ) = 1$ , which by Theorem 5.10 (iii) is equivalent to $\pi ^ { * }$ being optimal. □
|
| 408 |
+
|
| 409 |
+
# C.2 PROOF OF PROPOSITION 1
|
| 410 |
+
|
| 411 |
+
Proof. It follows from Theorem 1 (ii) that for all $( x , y )$ in the support of $\pi ^ { * }$ we have $\left| f ^ { * } ( y ) - \right.$ $f ^ { * } ( { \dot { x } } ) | = | | x - y | | _ { 2 }$ . Considering the line between $x$ and $y$ , the 1-Lipschitz constraint implies that the values of $f ^ { * }$ have to follow a linear function (since assuming that the slope was smaller than one at some point would imply that the differentiable function must have a slope larger than one somewhere else between $x$ and $y$ , which contradicts the 1-Lipschitz constraint). It follows that at each point on the line, the partial derivative has norm equal to one into the direction pointing from the real data point $x$ to the generated one $y$ (which are coupled by the corresponding optimal coupling). Since, by the 1-Lipschitz constraint, the maximal norm of a partial derivative at any point into any direction is one, the given direction is the direction of maximal descent, i.e. equals the gradient.
|
| 412 |
+
|
| 413 |
+
# C.3 PROOF OF PROPOSITION 2
|
| 414 |
+
|
| 415 |
+
To prove Proposition 2, we first prove that $\phi ^ { * } ( x ) = - | x |$ is the optimal critic function for certain distributions with non-overlapping support, and then reduce the example with Gaussian functions to this simplified setting.
|
| 416 |
+
|
| 417 |
+
Proposition 5. Let $f$ and $g$ be two continuous functions on the real line that satisfy the following conditions:
|
| 418 |
+
|
| 419 |
+
• $f$ and $g$ are symmetric with respect to the y-axis.
|
| 420 |
+
• $f ( x ) \geq 0$ and $g ( x ) \geq 0$ for all $x$ .
|
| 421 |
+
• If $s u p p _ { \circ } ( h ) = \{ x \in \mathbb { R } \mid h ( x ) > 0 \}$ denotes the open support of a continuous function $h$ , then $s u p p _ { \circ } ( f ) \cap s u p p _ { \circ } ( g ) = \emptyset$ .
|
| 422 |
+
• $f$ has connected support (this implies that $f$ is centered around 0 because of the symmetry). • $\begin{array} { r } { \int _ { \mathbb { R } } f ( x ) d x = \int _ { \mathbb { R } } g ( x ) d x . } \end{array}$
|
| 423 |
+
|
| 424 |
+
Then the maximum of $\begin{array} { r } { \int _ { \mathbb { R } } \phi ( x ) ( f ( x ) - g ( x ) ) d x } \end{array}$ over $\phi \in \mathcal { L } i p _ { 1 }$ is maximized for $\phi ^ { * } ( x ) = - | x |$ .
|
| 425 |
+
|
| 426 |
+
Proof. Before going into the technical details, we wish to point out the simple idea of the proof, which is to transport the left/right half of the distribution given by $g$ to the left/right half of the distribution given by $f$ respectively.
|
| 427 |
+
|
| 428 |
+
We first multiply both $f$ and $g$ by a constant number $c$ such that
|
| 429 |
+
|
| 430 |
+
$$
|
| 431 |
+
\int _ { \mathbb { R } } c \cdot f ( x ) d x = \int _ { \mathbb { R } } c \cdot g ( x ) d x = 1 .
|
| 432 |
+
$$
|
| 433 |
+
|
| 434 |
+
Then $c \cdot f$ and $c \cdot g$ define probability density functions. A function $\phi \in \mathcal { L } i p _ { 1 }$ maximizes $\begin{array} { r } { \int _ { \mathbb { R } } \phi ( x ) ( c \cdot } \end{array}$ $f ( x ) - c \cdot g ( x ) ) d x$ if and only if it maximizes $\begin{array} { r } { \int _ { \mathbb { R } } \phi ( x ) ( f ( x ) - g ( x ) ) d x } \end{array}$ . We therefore may assume from now on that
|
| 435 |
+
|
| 436 |
+
$$
|
| 437 |
+
\int _ { \mathbb { R } } f ( x ) d x = \int _ { \mathbb { R } } g ( x ) d x = 1 .
|
| 438 |
+
$$
|
| 439 |
+
|
| 440 |
+
Now it suffices to find a coupling $\pi$ of the probability distributions defined by $f$ and $g$ (that is itself defined by a probability density function $\pi : \mathbb { R } \times \mathbb { R } \to \mathbb { R }$ ) such that for $\phi ( x ) = - | x |$ we get
|
| 441 |
+
|
| 442 |
+
$$
|
| 443 |
+
\int _ { \mathbb { R } \times \mathbb { R } } | x - y | \cdot \pi ( x , y ) d x d y = \int _ { \mathbb { R } } \phi ( x ) ( f ( x ) - g ( x ) ) d x .
|
| 444 |
+
$$
|
| 445 |
+
|
| 446 |
+
The proof then follows from the Kantorovich duality theorem 1, because the right hand side is always smaller or equal to the left hand side for arbitrary coupling $\pi$ and function $\phi \in \mathcal { L } i p _ { 1 }$ and is consequently maximized when equality holds. By the assumption of symmetry, we may write $g = g _ { 1 } + g _ { 2 }$ where the support $\operatorname { s u p p } ( g _ { 1 } ) { \overset { \cdot } { \subseteq } } \{ x \mid x { \overset { \cdot } { < } } 0 \}$ and $g _ { 2 } \bar { ( } x ) = g _ { 1 } \bar { ( } - x )$ for all $x$ . The area under $g _ { 1 } ( x )$ equals half the area under $f ( x )$ , or put differently,
|
| 447 |
+
|
| 448 |
+
$$
|
| 449 |
+
\int _ { \mathbb { R } } g _ { 1 } ( x ) d x = \int _ { \mathbb { R } } f ( x ) \delta _ { ( - \infty , 0 ] } ( x ) d x = \frac { 1 } { 2 } .
|
| 450 |
+
$$
|
| 451 |
+
|
| 452 |
+
We now consider the probability density function $\pi _ { 1 } : \mathbb { R } \times \mathbb { R } \to \mathbb { R }$ given by
|
| 453 |
+
|
| 454 |
+
$$
|
| 455 |
+
\pi _ { 1 } ( x , y ) = 2 g _ { 1 } ( x ) \cdot 2 f ( y ) \cdot \delta _ { ( - \infty , 0 ] } ( y ) ,
|
| 456 |
+
$$
|
| 457 |
+
|
| 458 |
+
which defines a coupling between the two distributions given by the probability density functions $2 g _ { 1 }$ and $2 f \cdot \delta _ { ( - \infty , 0 ] }$ . For later use we note that
|
| 459 |
+
|
| 460 |
+
$$
|
| 461 |
+
\int _ { x \in \mathbb { R } } \pi _ { 1 } ( x , y ) d x = 2 \cdot f ( y ) \cdot \delta _ { ( - \infty , 0 ] } ( y ) { \mathrm { ~ a n d ~ } } \int _ { y \in \mathbb { R } } \pi _ { 1 } ( x , y ) d y = 2 \cdot g _ { 1 } ( x ) .
|
| 462 |
+
$$
|
| 463 |
+
|
| 464 |
+
We define $\pi _ { 2 } ( x , y ) = \pi _ { 1 } ( - x , - y )$ for $y \ne 0$ and $\pi _ { 2 } ( x , 0 ) = 0$ . Further, we let $\pi = { \textstyle { \frac { 1 } { 2 } } } \pi _ { 1 } + { \textstyle { \frac { 1 } { 2 } } } \pi _ { 2 }$ Then $\pi$ defines a coupling between $g$ and $f$ as can be seen by computing
|
| 465 |
+
|
| 466 |
+
$$
|
| 467 |
+
\int _ { x \in \mathbb { R } } \pi ( x , y ) d x = \frac { 1 } { 2 } \int _ { x \in \mathbb { R } } \pi _ { 1 } ( x , y ) d x + \frac { 1 } { 2 } \int _ { x \in \mathbb { R } } \pi _ { 2 } ( x , y ) d x
|
| 468 |
+
$$
|
| 469 |
+
|
| 470 |
+
$$
|
| 471 |
+
= \frac { 1 } { 2 } \int _ { x \in \mathbb { R } } \pi _ { 1 } ( x , y ) d x + \frac { 1 } { 2 } \int _ { x \in \mathbb { R } } \pi _ { 1 } ( - x , - y ) \delta _ { \{ y \neq 0 \} } ( y ) d x
|
| 472 |
+
$$
|
| 473 |
+
|
| 474 |
+
$$
|
| 475 |
+
= f ( y ) \delta _ { ( - \infty , 0 ] } ( y ) + f ( y ) \delta _ { ( 0 , \infty ) } ( y ) = f ( y )
|
| 476 |
+
$$
|
| 477 |
+
|
| 478 |
+
and
|
| 479 |
+
|
| 480 |
+
$$
|
| 481 |
+
\int _ { y \in \mathbb { R } } \pi ( x , y ) d y = \frac { 1 } { 2 } \int _ { y \in \mathbb { R } } \pi _ { 1 } ( x , y ) d y + \frac { 1 } { 2 } \int _ { y \in \mathbb { R } } \pi _ { 2 } ( x , y ) d y
|
| 482 |
+
$$
|
| 483 |
+
|
| 484 |
+
$$
|
| 485 |
+
\frac { 1 } { 2 } \int _ { y \in \mathbb { R } } { \pi } _ { 1 } ( x , y ) d y + \frac { 1 } { 2 } \int _ { y \in \mathbb { R } } { \pi } _ { 1 } ( - x , - y ) \delta _ { \{ y \neq 0 \} } ( y ) d y
|
| 486 |
+
$$
|
| 487 |
+
|
| 488 |
+
$$
|
| 489 |
+
= g _ { 1 } ( x ) + g _ { 1 } ( - x ) = g _ { 1 } ( x ) + g _ { 2 } ( x ) = g ( x )
|
| 490 |
+
$$
|
| 491 |
+
|
| 492 |
+
We have established the existence of some coupling between $f$ and $g$ and we will now compute its transport costs. We will subsequently show that this equals $\begin{array} { r } { \int _ { \mathbb { R } } ( - | x | ) ( f ( x ) - g ( x ) ) d x } \end{array}$ , hence both $\pi$ and $\phi$ are optimal by realizing the Kantorovich duality.
|
| 493 |
+
|
| 494 |
+
We aim at showing $\begin{array} { r } { \int _ { \mathbb { R } \times \mathbb { R } } | x - y | \pi ( x , y ) d x d y = \int _ { \mathbb { R } } ( - | x | ) ( f ( x ) - g ( x ) ) d x . } \end{array}$
|
| 495 |
+
|
| 496 |
+
$$
|
| 497 |
+
\int _ { \mathbb { R } \times \mathbb { R } } | x - y | \pi ( x , y ) d x d y \overset { s y m m e t r y } { = } \int _ { \mathbb { R } \times \mathbb { R } } | x - y | \pi _ { 1 } ( x , y ) d x d y
|
| 498 |
+
$$
|
| 499 |
+
|
| 500 |
+
$$
|
| 501 |
+
= \int _ { \mathbb { R } \times \mathbb { R } } ( y - x ) \pi _ { 1 } ( x , y ) d x d y .
|
| 502 |
+
$$
|
| 503 |
+
|
| 504 |
+
The latter equation holds because for $( x , y )$ in the support of $\pi _ { 1 }$ we have $x \leq y$ . (To see this, note that support of $\pi _ { 1 }$ is a subset of the support of $g _ { 1 } \times \left( f \cdot \delta _ { ( - \infty , 0 ] } \right) .$ .) Let
|
| 505 |
+
|
| 506 |
+
$$
|
| 507 |
+
x _ { 0 } = \frac { \int _ { \mathbb { R } } x \cdot g _ { 1 } ( x ) d x } { \int _ { \mathbb { R } } g _ { 1 } ( x ) d x } , \mathrm { ~ a n d ~ } y _ { 0 } = \frac { \int _ { \mathbb { R } } y \cdot f ( y ) \cdot \delta _ { ( - \infty , 0 ) } ( y ) d y } { \int _ { \mathbb { R } } f ( y ) \cdot \delta _ { ( - \infty , 0 ) } ( y ) d y } .
|
| 508 |
+
$$
|
| 509 |
+
|
| 510 |
+
Then
|
| 511 |
+
|
| 512 |
+
$$
|
| 513 |
+
\int _ { \mathbb { R } } ( x - x _ { 0 } ) \cdot g _ { 1 } ( x ) d x = 0 { \mathrm { ~ a n d ~ } } \int _ { \mathbb { R } } ( y - y _ { 0 } ) \cdot f ( y ) \cdot \delta _ { ( - \infty , 0 ] } ( y ) d y = 0 .
|
| 514 |
+
$$
|
| 515 |
+
|
| 516 |
+
Now, it follows that
|
| 517 |
+
|
| 518 |
+
$$
|
| 519 |
+
\int _ { \mathbb { R } \times \mathbb { R } } ( y - x ) \pi _ { 1 } ( x , y ) d x d y = \int _ { \mathbb { R } \times \mathbb { R } } ( y - y _ { 0 } + y _ { 0 } - x ) \pi _ { 1 } ( x , y ) d x d y
|
| 520 |
+
$$
|
| 521 |
+
|
| 522 |
+
$$
|
| 523 |
+
= \int _ { x } \int _ { y } ( y - y _ { 0 } ) \pi _ { 1 } ( x , y ) d x d y + \int _ { x } \int _ { y } ( y _ { 0 } - x ) \pi _ { 1 } ( x , y ) d x d y
|
| 524 |
+
$$
|
| 525 |
+
|
| 526 |
+
$$
|
| 527 |
+
= \int _ { y } ( y - y _ { 0 } ) \int _ { x } \pi _ { 1 } ( x , y ) d x d y + \int _ { x } \int _ { y } ( y _ { 0 } - x ) \pi _ { 1 } ( x , y ) d x d y
|
| 528 |
+
$$
|
| 529 |
+
|
| 530 |
+
$$
|
| 531 |
+
= 2 \underbrace { \int _ { y } ( y - y _ { 0 } ) \cdot f ( y ) \cdot \delta _ { ( - \infty , 0 ] } ( y ) d y } _ { = 0 } + \int _ { x } \int _ { y } ( y _ { 0 } - x _ { 0 } + x _ { 0 } - x ) \pi _ { 1 } ( x , y ) d x d y
|
| 532 |
+
$$
|
| 533 |
+
|
| 534 |
+
$$
|
| 535 |
+
= ( y _ { 0 } - x _ { 0 } ) \int _ { x } \int _ { y } \pi _ { 1 } ( x , y ) d x d y + \int _ { x } ( x _ { 0 } - x ) \underbrace { \int _ { y } \pi _ { 1 } ( x , y ) d y } _ { = 2 g _ { 1 } ( x ) } d x
|
| 536 |
+
$$
|
| 537 |
+
|
| 538 |
+
Hence,
|
| 539 |
+
|
| 540 |
+
$$
|
| 541 |
+
\int _ { { \mathbb R } \times { \mathbb R } } | x - y | \pi ( x , y ) d x d y = ( y _ { 0 } - x _ { 0 } ) = \frac { \int _ { { \mathbb R } } y \cdot f ( y ) \cdot \delta _ { ( - \infty , 0 ) } ( y ) d y } { \frac { 1 } { 2 } } - \frac { \int _ { { \mathbb R } } x \cdot g _ { 1 } ( x ) d x } { \frac { 1 } { 2 } } .
|
| 542 |
+
$$
|
| 543 |
+
|
| 544 |
+
$$
|
| 545 |
+
\begin{array} { l } { { \displaystyle = 2 \int _ { \mathbb R } x \cdot ( f ( x ) \cdot \delta _ { ( - \infty , 0 ) } ( x ) - g _ { 1 } ( x ) ) d x } } \\ { { \displaystyle \quad = 2 \int _ { - \infty } ^ { 0 } x \cdot ( f ( x ) - g ( x ) ) d x } } \\ { { \displaystyle \quad = 2 \int _ { - \infty } ^ { 0 } ( - | x | ) \cdot ( f ( x ) - g ( x ) ) d x } } \\ { { \displaystyle \quad \it { s y m m e t r y } \int _ { \mathbb R } ( - | x | ) \cdot ( f ( x ) - g ( x ) ) d x } } \end{array}
|
| 546 |
+
$$
|
| 547 |
+
|
| 548 |
+
We are now able to proof Proposition 2
|
| 549 |
+
|
| 550 |
+
Proof to Proposition 2. Let $f$ denote the probability density function of $\mathcal { N } ( 0 , 1 )$ and $\begin{array} { r } { g = \frac { 1 } { 2 } g _ { - 1 } + } \end{array}$ $\textstyle { \frac { 1 } { 2 } } g _ { 1 }$ denote the sum of half the probability density functions $g _ { - 1 }$ of $\mathcal { N } ( - 1 , 1 )$ and $g _ { 1 }$ of $\mathcal { N } ( 1 , 1 )$ . Let
|
| 551 |
+
|
| 552 |
+
$$
|
| 553 |
+
\tilde { f } ( x ) = \operatorname* { m a x } \left\{ 0 , \left( f ( x ) - g ( x ) \right) \right\} \mathrm { ~ a n d ~ } \tilde { g } ( x ) = \operatorname* { m a x } \left\{ 0 , \left( g ( x ) - f ( x ) \right) \right\} ,
|
| 554 |
+
$$
|
| 555 |
+
|
| 556 |
+
i.e. $\tilde { f }$ and $\tilde { g }$ are the positive and the negative part of $( f - g )$ . Then $\tilde { f }$ and $\tilde { g }$ satisfy the hypothesis of Proposition 5 and the maximum
|
| 557 |
+
|
| 558 |
+
$$
|
| 559 |
+
\operatorname* { m a x } _ { \phi \in \mathcal { L } i p _ { 1 } } \int _ { \mathbb { R } } \phi ( x ) ( f ( x ) - g ( x ) ) d x = \operatorname* { m a x } _ { \phi \in \mathcal { L } i p _ { 1 } } \int _ { \mathbb { R } } \phi ( x ) ( \tilde { f } ( x ) - \tilde { g } ( x ) ) d x
|
| 560 |
+
$$
|
| 561 |
+
|
| 562 |
+
is obtained for $\phi ^ { * } ( x ) = - | x |$ .
|
| 563 |
+
|
| 564 |
+
# C.4 PROOF OF PROPOSITION 3
|
| 565 |
+
|
| 566 |
+
Proof. For any fixed function $f$ and $\lambda > 0$ , the two regularized losses of the critic function $f$ are of the form
|
| 567 |
+
|
| 568 |
+
$$
|
| 569 |
+
\mathcal { L } _ { \lambda } ^ { L P } ( f ) = c + \lambda \int \operatorname* { m a x } \{ 0 , ( h ( z ) - 1 ) \} ^ { 2 } ) \mathrm { d } \tau ( z ) \mathrm { a n d } \mathcal { L } _ { \lambda } ^ { G P } ( f ) = c + \lambda \int ( h ( z ) - 1 ) ^ { 2 } ) \mathrm { d } \tau ( z )
|
| 570 |
+
$$
|
| 571 |
+
|
| 572 |
+
for some real number $c$ , a function $h$ with with $h ( z ) \geq 0$ for all $z$ and a probability distribution $\tau$ Since for any real number $0 \leq a$ we have that
|
| 573 |
+
|
| 574 |
+
$$
|
| 575 |
+
\operatorname* { m a x } \{ 0 , ( a - 1 ) \} ^ { 2 } \leq ( a - 1 ) ^ { 2 } \leq \operatorname* { m a x } \{ 0 , ( a - 1 ) \} ^ { 2 } + 1
|
| 576 |
+
$$
|
| 577 |
+
|
| 578 |
+
it follows that
|
| 579 |
+
|
| 580 |
+
$$
|
| 581 |
+
\begin{array} { r } { \mathcal { L } _ { \lambda } ^ { L P } ( f ) \leq \mathcal { L } _ { \lambda } ^ { G P } ( f ) \leq \mathcal { L } _ { \lambda } ^ { L P } ( f ) + \lambda . } \end{array}
|
| 582 |
+
$$
|
| 583 |
+
|
| 584 |
+
Therefore the inequalities also hold for the infimum over a class of functions, hence
|
| 585 |
+
|
| 586 |
+
$$
|
| 587 |
+
\begin{array} { r } { \mathcal { L } _ { \lambda } ^ { L P } \leq \mathcal { L } _ { \lambda } ^ { G P } \leq \mathcal { L } _ { \lambda } ^ { L P } + \lambda . } \end{array}
|
| 588 |
+
$$
|
| 589 |
+
|
| 590 |
+
# C.5 THE ARGUMENTS SUPPORTING OBSERVATION 3
|
| 591 |
+
|
| 592 |
+
For the coupled pairs $( x , y )$ and $( x , y ^ { \prime } )$ we have that the partial derivatives at $x$ into the directions of $y$ and $y ^ { \prime }$ respectively have an absolute value of one. If there are two such directions and $f ^ { * }$ is differentiable, then the norm of its gradient must be larger than one, contradicting the 1-Lipschitz constraint. Indeed, recall that, considering $f$ as a function on the line $\{ x + \lambda \cdot v \mid \lambda \in \mathbb { R } \}$ with $v$ of unit length, the slope of $f$ at $x$ is given by $\nabla f ( x ) \cdot v = D _ { v } ( f ( x ) )$ . Now
|
| 593 |
+
|
| 594 |
+
$$
|
| 595 |
+
\nabla f ( \boldsymbol { x } ) \cdot \boldsymbol { v } = | | \nabla f ( \boldsymbol { x } ) | | _ { 2 } \cdot \cos ( \theta _ { v } )
|
| 596 |
+
$$
|
| 597 |
+
|
| 598 |
+
with $\theta _ { v }$ being the angle between the vector $\nabla f ( x )$ and the unit vector $v$ . Equation (10) with $\cos ( \theta _ { v } ) = 1$ has a unique solution for $v$ with $\begin{array} { r } { v \ = \ \frac { \nabla f ( x ) } { | | \nabla f ( x ) | | _ { 2 } } } \end{array}$ . It follows that, if for two different directions $v , v ^ { \prime }$ we have $D _ { v } ( f ( x ) ) = D _ { v ^ { \prime } } ( f ( x ) ) \ { = } \ 1$ , then $\cos ( \theta _ { v } ) \ = \ \cos ( \theta _ { v ^ { \prime } } ) \ < \ 1$ and $| | \nabla f ( x ) | | _ { 2 } > 1$ .
|
| 599 |
+
|
| 600 |
+
# D ADDITIONAL EXPERIMENTAL RESULTS
|
| 601 |
+
|
| 602 |
+
# D.1 LEVEL SETS OF THE CRITIC
|
| 603 |
+
|
| 604 |
+

|
| 605 |
+
Figure 8: Level sets of the critic (yellow corresponds to high, purple to low values) of WGANs during training (after 10, 50, 100, 500, and 1000 iterations) on the 8Gaussian data set. Top: GPpenalty $\lambda = 1 0$ ). Middle: GP-penalty $\lambda = 1$ ). Bottom: LP-penalty $\lambda = 1 0$ ).
|
| 606 |
+
|
| 607 |
+

|
| 608 |
+
Figure 9: Level sets of the critic (yellow corresponds to high, purple to low values) of WGANs during training (after 10, 50, 100, 500, and 1000 iterations) on the 25Gaussian data set. Top: GPpenalty $\lambda = 1 0$ ). Middle: GP-penalty $\lambda = 1$ ). Bottom: LP-penalty $\lambda = 1 0$ ).
|
| 609 |
+
|
| 610 |
+

|
| 611 |
+
Figure 10: Evolution of the WGAN-GP critics loss without the regularization term $\lambda = 1$ ). Left: Median results over the 20 runs (blue area indicates quantiles, green dots outliers). Right: Single runs.
|
| 612 |
+
|
| 613 |
+
D.3 EVOLUTION OF THE EM DISTANCE
|
| 614 |
+
|
| 615 |
+

|
| 616 |
+
Figure 11: Evolution of the approximated EM distance during training WGAN-GPs with $\lambda = 1$ . Left: Median results over the 10 runs. Right: Single runs.
|
| 617 |
+
|
| 618 |
+
# D.4 DIFFERENT SAMPLING METHODS
|
| 619 |
+
|
| 620 |
+
We analyzed the effect of the GP- and the LP-penalty using different sampling procedures. In particular, we compared the sampling procedure proposed by Gulrajani et al. (2017) with variants, which generate the samples used for the regularization term by adding random noise either onto training points or onto both training and generated samples. We refer to this as “local perturbation” in the following.7 The evolution of the critics loss when using this local perturbation can be seen in Figure 12. Results are qualitatively similar to those when using the sampling procedure proposed by Gulrajani et al. (2017). Interestingly, WGAN-GP training is stabilized at a later stage if one only adds noise to training examples and not to generated examples. This indicates that enforcing the GP-penalty close to the data manifold is less harmful. However, the critic’s loss is still much more fluctuating than when training a WGAN-LP.
|
| 621 |
+
|
| 622 |
+
The evolution of the approximated EM distance when using local perturbation (by adding noise to the training examples only) is shown in Figure 13. Training with the GP-penalty leads to larger fluctuations of the approximated Wasserstein-1 distance than training with the LP-penalty. However, fluctuations are less severe compared to the setting when the GP-penalty is used in combination with the sampling procedure proposed by Gulrajani et al. (2017).
|
| 623 |
+
|
| 624 |
+

|
| 625 |
+
Figure 12: Evolution of the WGAN critic’s negative loss with local sampling (without the regularization term). Left: Median results over the 20 runs. Right: Single runs. Top: GP-penalty when generating samples by perturbing training samples only. Middle: For GP-penalty, perturbing training and generated samples. Bottom: LP-penalty, perturbing training and generated samples (very similar to perturbing only training samples)
|
| 626 |
+
|
| 627 |
+

|
| 628 |
+
Figure 13: Evolution of the approximated EM distance during training of WGANs with local perturbation $\lambda = 5$ ). Left: Median results over the 10 runs. Right: Single runs. Top: For the GP-penalty. Bottom: For the LP-penalty
|
| 629 |
+
|
| 630 |
+
# D.5 OPTIMIZING THE WASSERSTEIN-2 DISTANCE
|
| 631 |
+
|
| 632 |
+
We trained a WGAN with the objective of minimizing the Wasserstein-2 distance8, that is, with the regularization term given by
|
| 633 |
+
|
| 634 |
+
$$
|
| 635 |
+
\operatorname* { m a x } \left( \left\{ 0 , { \frac { | f ( x ) - f ( y ) | } { | | x - y | | _ { 2 } ^ { 2 } } } - 1 \right\} \right) ^ { 2 } \ ,
|
| 636 |
+
$$
|
| 637 |
+
|
| 638 |
+
and penalty weight $\lambda = 1 0$ . Results for the evolution of the critics loss and the approximated EM distance during training on the Swiss Roll data set are shown in Figure 14. Both critic loss and EM reduce smoothly, which makes the Wasserstein-2 distance (in combination with its theoretical properties) an interesting candidate to further investigations.
|
| 639 |
+
|
| 640 |
+

|
| 641 |
+
Figure 14: Evolution of the WGAN critics loss (Left) and the approximated EM distance (Right) for a WGAN-LP trained to minimize the Wasserstein-2 distance $\lambda = 1 0$ ). Shown are the medians over 5 runs.
|
| 642 |
+
|
| 643 |
+
# D.6 EXPERIMENTAL RESULTS ON CIFAR
|
| 644 |
+
|
| 645 |
+
Inception score. The inception score was proposed by Salimans et al. (2016) to evaluate the quality of images $x$ sampled from a generative model $\nu$ based on the Inception model. Let $p ( y | x )$ be the conditional probability of label $y$ for image $x$ under the Inception model and $\begin{array} { r } { p ( y ) = \int p ( y | x ) \nu ( x ) d x } \end{array}$ the marginal probability of labels $y$ with respect to samples generated from $\nu$ . Then the Inception score is given by
|
| 646 |
+
|
| 647 |
+
$$
|
| 648 |
+
\exp \left( \mathbb { E } _ { x \sim \nu } [ K L ( p ( y | x ) , p ( y ) ] ) \right) \ .
|
| 649 |
+
$$
|
| 650 |
+
|
| 651 |
+
Intuitively, a good generative model should produce samples for which the conditional label distribution has low entropy, while the variability over samples and thus the entropy of the marginal label distribution should be high. Therefore, a higher Inception score indicates a better performance of the generative model.
|
| 652 |
+
|
| 653 |
+
The maximal Inception scores reported in Table 1 are representative for the general evolution of the scores for WGAN-LP and WGAN-GP during training. As an example we show the evolution of the Inception score for penalty weights of $\lambda = 5$ and $\lambda = 1 0 0$ in Figure 15. It becomes clear that WGAN-GP performs similar to WGAN-LP for small values of the regularization parameter but much worse for larger values (this was consistently observed in all experiments). In Figure 16 we compare the performance of WGAN-LP and WGAN-GP in terms of the critics loss on a separate validation set, which again demonstrates a more stable behavior for WGAN-LP with respect to the choice of lambda.
|
| 654 |
+
|
| 655 |
+

|
| 656 |
+
Figure 15: Evolution of Inception score on CIFAR for WGAN-LP in blue (solid) and WGAN-GP in red (dotted). Left: for regularization parameter $\lambda = 5$ . Right: for regularization parameter $\lambda = 1 0 0$ .
|
| 657 |
+
|
| 658 |
+
We also trained WGAN-GP and WGAN-LP with a conditional model (making use of the label information of CIFAR10) with $\lambda = 1 0$ and found a similar performance for both, i.e. $8 . 5 3 7 \pm 0 . 1 3 3$ and $8 . 4 6 2 \pm 0 . 1 1 5$ for WGAN-GP and WGAN-LP, respectively.
|
| 659 |
+
|
| 660 |
+

|
| 661 |
+
Figure 16: Evolution of validation loss on CIFAR. Black/purple curves indicate the total loss, blue curves the loss without regularization term, and red the regularization term only. Light colored curves indicate the true values, dark solid lines the average over a window of 5 iterations. Left: WGAN-GP. Right: WGAN-LP. Top: with $\lambda = 5$ . Bottom: with $\lambda = 1 0 0$ .
|
| 662 |
+
|
| 663 |
+
# D.7 RELATED PENALTIES
|
| 664 |
+
|
| 665 |
+
Level sets for WGANs trained with the regularization terms given by Equation (7) and (9) and penalty weight 10 are shown in Figure 17. As the evolution of the level sets and the sampled points indicate, training properly converges. However, on CIFAR-10, the same penalties did not lead to good results. As shown in Figure 18, using (7) for regularization initially lead to improving Inception scores but then quickly started to diverge, while using (9) lead to even greater instability.
|
| 666 |
+
|
| 667 |
+

|
| 668 |
+
Figure 17: Level sets of the critic $f$ of WGANs during training, after 10, 50, 100, 500, and 1000 iterations. Yellow corresponds to high, purple to low values of $f$ . Training samples are indicated in red, generated samples in blue. Top: With the regularization term given in Equation (7) and $\lambda = 1 0$ . Bottom: With the regularization term given in Equation (9) and $\lambda = 1 0$ .
|
| 669 |
+
|
| 670 |
+

|
| 671 |
+
Figure 18: Inception scores for regularization Equation (7) for penalty weights 100 (red) and 5 (blue), shown on the left, and Inception scores for training with the regularization Equation (9) for penalty weights 100 (red) and 5 (blue), shown on the right.
|
md/train/BJj6qGbRW/BJj6qGbRW.md
ADDED
|
@@ -0,0 +1,346 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FEW-SHOT LEARNING WITH GRAPH NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Victor Garcia∗ Amsterdam Machine Learning Lab University of Amsterdam Amsterdam, 1098 XH, NL v.garciasatorras@uva.nl
|
| 4 |
+
|
| 5 |
+
Joan Bruna
|
| 6 |
+
Courant Institute of Mathematical Sciences
|
| 7 |
+
New York University
|
| 8 |
+
New York City, NY, 10010, USA
|
| 9 |
+
bruna@cims.nyu.edu
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
We propose to study the problem of few-shot learning with the prism of inference on a partially observed graphical model, constructed from a collection of input images whose label can be either observed or not. By assimilating generic message-passing inference algorithms with their neural-network counterparts, we define a graph neural network architecture that generalizes several of the recently proposed few-shot learning models. Besides providing improved numerical performance, our framework is easily extended to variants of few-shot learning, such as semi-supervised or active learning, demonstrating the ability of graph-based models to operate well on ‘relational’ tasks.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Supervised end-to-end learning has been extremely successful in computer vision, speech, or machine translation tasks, thanks to improvements in optimization technology, larger datasets and streamlined designs of deep convolutional or recurrent architectures. Despite these successes, this learning setup does not cover many aspects where learning is nonetheless possible and desirable.
|
| 18 |
+
|
| 19 |
+
One such instance is the ability to learn from few examples, in the so-called few-shot learning tasks. Rather than relying on regularization to compensate for the lack of data, researchers have explored ways to leverage a distribution of similar tasks, inspired by human learning Lake et al. (2015). This defines a new supervised learning setup (also called ‘meta-learning’) in which the input-output pairs are no longer given by iid samples of images and their associated labels, but by iid samples of collections of images and their associated label similarity.
|
| 20 |
+
|
| 21 |
+
A recent and highly-successful research program has exploited this meta-learning paradigm on the few-shot image classification task Lake et al. (2015); Koch et al. (2015); Vinyals et al. (2016); Mishra et al. (2017); Snell et al. (2017). In essence, these works learn a contextual, task-specific similarity measure, that first embeds input images using a CNN, and then learns how to combine the embedded images in the collection to propagate the label information towards the target image.
|
| 22 |
+
|
| 23 |
+
In particular, Vinyals et al. (2016) cast the few-shot learning problem as a supervised classification task mapping a support set of images into the desired label, and developed an end-to-end architecture accepting those support sets as input via attention mechanisms. In this work, we build upon this line of work, and argue that this task is naturally expressed as a supervised interpolation problem on a graph, where nodes are associated with the images in the collection, and edges are given by a trainable similarity kernels. Leveraging recent progress on representation learning for graphstructured data Bronstein et al. (2017); Gilmer et al. (2017), we thus propose a simple graph-based few-shot learning model that implements a task-driven message passing algorithm. The resulting architecture is trained end-to-end, captures the invariances of the task, such as permutations within the input collections, and offers a good tradeoff between simplicity, generality, performance and sample complexity.
|
| 24 |
+
|
| 25 |
+
Besides few-shot learning, a related task is the ability to learn from a mixture of labeled and unlabeled examples — semi-supervised learning, as well as active learning, in which the learner has the option to request those missing labels that will be most helpful for the prediction task. Our graphbased architecture is naturally extended to these setups with minimal changes in the training design. We validate experimentally the model on few-shot image classification, matching state-of-the-art performance with considerably fewer parameters, and demonstrate applications to semi-supervised and active learning setups.
|
| 26 |
+
|
| 27 |
+
Our contributions are summarized as follows:
|
| 28 |
+
|
| 29 |
+
• We cast few-shot learning as a supervised message passing task which is trained end-to-end using graph neural networks.
|
| 30 |
+
• We match state-of-the-art performance on Omniglot and Mini-Imagenet tasks with fewer parameters.
|
| 31 |
+
• We extend the model in the semi-supervised and active learning regimes.
|
| 32 |
+
|
| 33 |
+
The rest of the paper is structured as follows. Section 2 describes related work, Sections 3, 4 and 5 present the problem setup, our graph neural network model and the training, and Section 6 reports numerical experiments.
|
| 34 |
+
|
| 35 |
+
# 2 RELATED WORK
|
| 36 |
+
|
| 37 |
+
One-shot learning was first introduced by Fei-Fei et al. (2006), they assumed that currently learned classes can help to make predictions on new ones when just one or few labels are available. More recently, Lake et al. (2015) presented a Hierarchical Bayesian model that reached human level error on few-shot learning alphabet recongition tasks.
|
| 38 |
+
|
| 39 |
+
Since then, great progress has been done in one-shot learning. Koch et al. (2015) presented a deeplearning model based on computing the pair-wise distance between samples using Siamese Networks, then, this learned distance can be used to solve one-shot problems by $\mathbf { k }$ -nearest neighbors classification. Vinyals et al. (2016) Presented an end-to-end trainable $\mathbf { k }$ -nearest neighbors using the cosine distance, they also introduced a contextual mechanism using an attention LSTM model that takes into account all the samples of the subset $\tau$ when computing the pair-wise distance between samples. Snell et al. (2017) extended the work from Vinyals et al. (2016), by using euclidean distance instead of cosine which provided significant improvements, they also build a prototype representation of each class for the few-shot learning scenario. Mehrotra & Dukkipati (2017) trained a deep residual network together with a generative model to approximate the pair-wise distance between samples.
|
| 40 |
+
|
| 41 |
+
A new line of meta-learners for one-shot learning is rising lately: Ravi & Larochelle (2016) introduced a meta-learning method where an LSTM updates the weights of a classifier for a given episode. Munkhdalai & Yu (2017) also presented a meta-learning architecture that learns meta-level knowledge across tasks, and it changes its inductive bias via fast parametrization. Finn et al. (2017) is using a model agnostic meta-learner based on gradient descent, the goal is to train a classification model such that given a new task, a small amount of gradient steps with few data will be enough to generalize. Lately, Mishra et al. (2017) used Temporal Convolutions which are deep recurrent networks based on dilated convolutions, this method also exploits contextual information from the subset $\tau$ providing very good results.
|
| 42 |
+
|
| 43 |
+
Another related area of research concerns deep learning architectures on graph-structured data. The GNN was first proposed in Gori et al. (2005); Scarselli et al. (2009), as a trainable recurrent messagepassing whose fixed points could be adjusted discriminatively. Subsequent works Li et al. (2015); Sukhbaatar et al. (2016) have relaxed the model by untying the recurrent layer weights and proposed several nonlinear updates through gating mechanisms. Graph neural networks are in fact natural generalizations of convolutional networks to non-Euclidean graphs. Bruna et al. (2013); Henaff et al. (2015) proposed to learn smooth spectral multipliers of the graph Laplacian, albeit with high computational cost, and Defferrard et al. (2016); Kipf & Welling (2016) resolved the computational bottleneck by learning polynomials of the graph Laplacian, thus avoiding the computation of eigenvectors and completing the connection with GNNs. In particular, Kipf & Welling (2016) was the first to propose the use of GNNs on semi-supervised classification problems. We refer the reader to Bronstein et al. (2017) for an exhaustive literature review on the topic. GNNs and the analogous Neural Message Passing Models are finding application in many different domains. Battaglia et al.
|
| 44 |
+
|
| 45 |
+
(2016); Chang et al. (2016) develop graph interaction networks that learn pairwise particle interactions and apply them to discrete particle physical dynamics. Duvenaud et al. (2015); Kearnes et al. (2016) study molecular fingerprints using variants of the GNN architecture, and Gilmer et al. (2017) further develop the model by combining it with set representations Vinyals et al. (2015), showing state-of-the-art results on molecular prediction.
|
| 46 |
+
|
| 47 |
+
# 3 PROBLEM SET-UP
|
| 48 |
+
|
| 49 |
+
We describe first the general setup and notations, and then particularize it to the case of few-shot learning, semi-supervised learning and active learning.
|
| 50 |
+
|
| 51 |
+
We consider input-output pairs $( \mathcal { T } _ { i } , Y _ { i } ) _ { i }$ drawn iid from a distribution $P$ of partially-labeled image collections
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\begin{array} { r c l } { { { \cal T } } } & { { = } } & { { \{ \{ ( x _ { 1 } , l _ { 1 } ) , \dots ( x _ { s } , l _ { s } ) \} , \{ \tilde { x } _ { 1 } , \dots , \tilde { x } _ { r } \} , \{ \bar { x } _ { 1 } , \dots , \bar { x } _ { t } \} ; l _ { i } \in \{ 1 , K \} , x _ { i } , \tilde { x } _ { j } , \bar { x } _ { j } \sim \{ \mathcal { P } _ { l } ( \mathbb { R } ^ { N } ) \} \} , } } \\ { { { \cal Y } } } & { { = } } & { { ( y _ { 1 } , \dots , y _ { t } ) \in \{ 1 , K \} ^ { t } , } } \\ { { } } & { { } } & { { ( 1 ) } } \end{array}
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
for arbitrary values of $s , r , t$ and $K$ . Where $s$ is the number of labeled samples, $r$ is the number of unlabeled samples $r > 0$ for the semi-supervised and active learning scenarios) and $t$ is the number of samples to classify. $K$ is the number of classes. We will focus in the case $t = 1$ where we just classify one sample per task $\tau$ . $\mathcal { P } _ { l } ( \mathbb { R } ^ { N } )$ denotes a class-specific image distribution over $\mathbb { R } ^ { N }$ . In our context, the targets $Y _ { i }$ are associated with image categories of designated images $\bar { x } _ { 1 } , \ldots , \bar { x } _ { t } \in \mathcal { T } _ { i }$ with no observed label. Given a training set $\{ ( \mathcal { T } _ { i } , Y _ { i } ) _ { i } \} _ { i \leq L }$ , we consider the standard supervised learning objective
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\operatorname* { m i n } _ { \Theta } \frac { 1 } { L } \sum _ { i \leq L } \ell ( \Phi ( \mathcal { T } _ { i } ; \Theta ) , Y _ { i } ) + \mathcal { R } ( \Theta ) ,
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
using the model $\Phi ( { \mathcal { T } } ; \Theta ) = p ( Y \mid { \mathcal { T } } )$ specified in Section 4 and $\mathcal { R }$ is a standard regularization objective.
|
| 64 |
+
|
| 65 |
+
Few-Shot Learning When $r = 0$ , $t = 1$ and $s = q K$ , there is a single image in the collection with unknown label. If moreover each label appears exactly $q$ times, this setting is referred as the $q$ -shot, $K$ -way learning.
|
| 66 |
+
|
| 67 |
+
Semi-Supervised Learning When $r > 0$ and $t = 1$ , the input collection contains auxiliary images $\tilde { x } _ { 1 } , \ldots , \tilde { x } _ { r }$ that the model can use to improve the prediction accuracy, by leveraging the fact that these samples are drawn from common distributions as those determining the output.
|
| 68 |
+
|
| 69 |
+
Active Learning In the active learning setting, the learner has the ability to request labels from the sub-collection $\{ \tilde { x } _ { 1 } , \ldots , \tilde { x } _ { r } \}$ . We are interested in studying to what extent this active learning can improve the performance with respect to the previous semi-supervised setup, and match the performance of the one-shot learning setting with $s _ { 0 }$ known labels when $s + r = s _ { 0 }$ , $s \ll s _ { 0 }$ .
|
| 70 |
+
|
| 71 |
+
# 4 MODEL
|
| 72 |
+
|
| 73 |
+
This section presents our approach, based on a simple end-to-end graph neural network architecture. We first explain how the input context is mapped into a graphical representation, then detail the architecture, and next show how this model generalizes a number of previously published few-shot learning architectures.
|
| 74 |
+
|
| 75 |
+
# 4.1 SET AND GRAPH INPUT REPRESENTATIONS
|
| 76 |
+
|
| 77 |
+
The input $\tau$ contains a collection of images, both labeled and unlabeled. The goal of few-shot learning is to propagate label information from labeled samples towards the unlabeled query image. This propagation of information can be formalized as a posterior inference over a graphical model determined by the input images and labels.
|
| 78 |
+
|
| 79 |
+
Following several recent works that cast posterior inference using message passing with neural networks defined over graphs Scarselli et al. (2009); Duvenaud et al. (2015); Gilmer et al. (2017), we associate $\tau$ with a fully-connected graph $G _ { \mathcal { T } } = ( V , E )$ where nodes $v _ { a } \in V$ correspond to the images present in $\tau$ (both labeled and unlabeled). In this context, the setup does not specify a fixed similarity $e _ { a , a ^ { \prime } }$ between images $x _ { a }$ and $x _ { a ^ { \prime } }$ , suggesting an approach where this similarity measure is learnt in a discriminative fashion with a parametric model similarly as in Gilmer et al. (2017), such as a siamese neural architecture. This framework is closely related to the set representation from Vinyals et al. (2016), but extends the inference mechanism using the graph neural network formalism that we detail next.
|
| 80 |
+
|
| 81 |
+

|
| 82 |
+
Figure 1: Visual representation of One-Shot Learning setting.
|
| 83 |
+
|
| 84 |
+
# 4.2 GRAPH NEURAL NETWORKS
|
| 85 |
+
|
| 86 |
+
Graph Neural Networks, introduced in Gori et al. (2005); Scarselli et al. (2009) and further simplified in Li et al. (2015); Duvenaud et al. (2015); Sukhbaatar et al. (2016) are neural networks based on local operators of a graph $G = ( V , E )$ , offering a powerful balance between expressivity and sample complexity; see Bronstein et al. (2017) for a recent survey on models and applications of deep learning on graphs.
|
| 87 |
+
|
| 88 |
+
In its simplest incarnation, given an input signal $F \in \mathbb { R } ^ { V \times d }$ on the vertices of a weighted graph $G$ , we consider a family $\mathcal { A }$ of graph intrinsic linear operators that act locally on this signal. The simplest is the adjacency operator $\mathsf { \bar { A } } : \mathsf { F } \mapsto A ( F )$ where $\begin{array} { r } { ( A F ) _ { i } : = \sum _ { j \sim i } w _ { i , j } \mathbf { \bar { F } } _ { j } } \end{array}$ , with $i \sim j$ iff $( i , j ) \in E$ and $w _ { i , j }$ its associated weight. A GNN layer $\operatorname { G c } ( \cdot )$ receives as input a signal $\mathbf { x } ^ { ( k ) } \in \mathbb { R } ^ { V \times d _ { k } }$ and produces $\mathbf { x } ^ { ( k + 1 ) } \in \mathbb { R } ^ { V \times d _ { k + 1 } }$ as
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
{ \bf x } _ { l } ^ { ( k + 1 ) } = { \bf G } { \bf c } ( { \bf x } ^ { ( k ) } ) = \rho \left( \sum _ { B \in \mathcal { A } } B { \bf x } ^ { ( k ) } \theta _ { B , l } ^ { ( k ) } \right) \mathrm { ~ , ~ } l = d _ { 1 } \mathrm { ~ . ~ . ~ } d _ { k + 1 } \mathrm { ~ , ~ }
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where $\Theta = \{ \theta _ { 1 } ^ { ( k ) } , \dots , \theta _ { | \mathcal { A } | } ^ { ( k ) } \} _ { k }$ , ${ \boldsymbol { \theta } _ { B } ^ { ( k ) } \in \mathbb { R } ^ { d _ { k } \times d _ { k + 1 } } }$ , are trainable parameters and $\rho ( \cdot )$ is a point-wise non-linearity, chosen in this work to be a ‘leaky’ ReLU et al. (2015).
|
| 95 |
+
|
| 96 |
+
Authors have explored several modeling variants from this basic formulation, by replacing the pointwise nonlinearity with gating operations Duvenaud et al. (2015), or by generalizing the generator family to Laplacian polynomials Defferrard et al. (2016); Kipf & Welling (2016); Bruna et al. (2013), or including $2 ^ { J }$ -th powers of $A$ to $\mathcal { A }$ , $A _ { J } = \operatorname* { m i n } ( 1 , A ^ { 2 ^ { J } } )$ to encode $2 ^ { J }$ -hop neighborhoods of each node Bruna & Li (2017). Cascaded operations in the form (2) are able to approximate a wide range of graph inference tasks. In particular, inspired by message-passing algorithms, Kearnes et al. (2016); Gilmer et al. (2017) generalized the GNN to also learn edge features $\tilde { A } ^ { ( k ) }$ from the current node hidden representation:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\tilde { A } _ { i , j } ^ { ( k ) } = \varphi _ { \tilde { \theta } } ( \mathbf { x } _ { i } ^ { ( k ) } , \mathbf { x } _ { j } ^ { ( k ) } ) ,
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+

|
| 103 |
+
Figure 2: Graph Neural Network ilustration. The Adjacency matrix is computed before every Convolutional Layer.
|
| 104 |
+
|
| 105 |
+
where $\varphi$ is a symmetric function parametrized with e.g. a neural network. In this work, we consider a Multilayer Perceptron stacked after the absolute difference between two vector nodes. See eq. 4:
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\varphi _ { \tilde { \theta } } ( \mathbf { x } _ { i } ^ { ( k ) } , \mathbf { x } _ { j } ^ { ( k ) } ) = \mathbf { M L P } _ { \tilde { \theta } } ( a b s ( \mathbf { x } _ { i } ^ { ( k ) } - \mathbf { x } _ { j } ^ { ( k ) } ) )
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
Then $\varphi$ is a metric, which is learned by doing a non-linear combination of the absolute difference between the individual features of two nodes. Using this architecture the distance property Symmetry $\varphi _ { \tilde { \theta } } ( a , b ) = \varphi _ { \tilde { \theta } } ( b , a )$ is fulfilled by construction and the distance property Identity $\varphi _ { \tilde { \theta } } ( a , a ) = 0$ is easily learned.
|
| 112 |
+
|
| 113 |
+
The trainable adjacency is then normalized to a stochastic kernel by using a softmax along each row. The resulting update rules for node features are obtained by adding the edge feature kernel $\tilde { A } ^ { ( k ) }$ into the generator family $\mathcal { A } = \{ \tilde { A } ^ { ( k ) } , \mathbf { 1 } \}$ and applying (2). Adjacency learning is particularly important in applications where the input set is believed to have some geometric structure, but the metric is not known a priori, such as is our case.
|
| 114 |
+
|
| 115 |
+
In general graphs, the network depth is chosen to be of the order of the graph diameter, so that all nodes obtain information from the entire graph. In our context, however, since the graph is densely connected, the depth is interpreted simply as giving the model more expressive power.
|
| 116 |
+
|
| 117 |
+
Construction of Initial Node Features The input collection $\tau$ is mapped into node features as follows. For images $x _ { i } \in \mathcal T$ with known label $l _ { i }$ , the one-hot encoding of the label is concatenated with the embedding features of the image at the input of the GNN.
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\mathbf { x } _ { i } ^ { ( 0 ) } = \left( \phi ( { x } _ { i } ) , h ( l _ { i } ) \right) ,
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
where $\phi$ is a Convolutional neural network and $h ( l ) \ \in \ \mathbb { R } _ { + } ^ { K }$ is a one-hot encoding of the label. Architectural details for $\phi$ are detailed in Section 6.1.1 and 6.1.2. For images $\tilde { x } _ { j } , \bar { x } _ { j ^ { \prime } }$ with unknown label $l _ { i }$ , we modify the previous construction to account for full uncertainty about the label variable by replacing $h ( l )$ with the uniform distribution over the $K$ -simplex: $V _ { j } \doteq ( \phi ( \tilde { x } _ { j } ) , K ^ { - 1 } \mathbf { 1 } _ { K } )$ , and analogously for $\bar { x }$ .
|
| 124 |
+
|
| 125 |
+
# 4.3 RELATIONSHIP WITH EXISTING MODELS
|
| 126 |
+
|
| 127 |
+
The graph neural network formulation of few-shot learning generalizes a number of recent models proposed in the literature.
|
| 128 |
+
|
| 129 |
+
Siamese Networks Siamese Networks Koch et al. (2015) can be interpreted as a single layer message-passing iteration of our model, and using the same initial node embedding (5) $\mathbf { x } _ { i } ^ { ( 0 ) } =$ $( \phi ( x _ { i } ) , h _ { i } )$ , using a non-trainable edge feature
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
\varphi ( \mathbf { x } _ { i } , \mathbf { x } _ { j } ) = \lVert \phi ( x _ { i } ) - \phi ( x _ { j } ) \rVert , \tilde { A } ^ { ( 0 ) } = \mathrm { s o f t m a x } ( - \varphi ) ,
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
and resulting label estimation
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
\hat { Y } _ { * } = \sum _ { j } \tilde { A } _ { * , j } ^ { ( 0 ) } \langle \mathbf { x } _ { j } ^ { ( 0 ) } , u \rangle ,
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
with $u$ selecting the label field from $\mathbf { x }$ . In this model, the learning is reduced to learning image embeddings $\phi ( x _ { i } )$ whose euclidean metric is consistent with the label similarities.
|
| 142 |
+
|
| 143 |
+
Prototypical Networks Prototypical networks Snell et al. (2017) evolve Siamese networks by aggregating information within each cluster determined by nodes with the same label. This operation can also be accomplished with a gnn as follows. we consider
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
\tilde { A } _ { i , j } ^ { ( 0 ) } = \left\{ \begin{array} { c c } { q ^ { - 1 } } & { \mathrm { i f } l _ { i } = l _ { j } } \\ { 0 } & { \mathrm { o t h e r w i s e . } } \end{array} \right.
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+
where $q$ is the number of examples per class, and
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
\mathbf { x } _ { i } ^ { ( 1 ) } = \sum _ { j } \tilde { A } _ { i , j } ^ { ( 0 ) } \mathbf { x } _ { j } ^ { ( 0 ) } ,
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+
where $\mathbf { x } ^ { ( 0 ) }$ is defined as in the Siamese Networks. We finally apply the previous kernel $\tilde { A } ^ { ( 1 ) } =$ softmax $\left( \varphi \right)$ applied to $\mathbf { x } ^ { ( 1 ) }$ to yield class prototypes:
|
| 156 |
+
|
| 157 |
+
$$
|
| 158 |
+
\hat { Y } _ { * } = \sum _ { j } \tilde { A } _ { * , j } ^ { ( 1 ) } \langle \mathbf { x } _ { j } ^ { ( 1 ) } , u \rangle .
|
| 159 |
+
$$
|
| 160 |
+
|
| 161 |
+
Matching Networks Matching networks Vinyals et al. (2016) use a set representation for the ensemble of images in $\tau$ , similarly as our proposed graph neural network model, but with two important differences. First, the attention mechanism considered in this set representation is akin to the edge feature learning, with the difference that the mechanism attends always to the same node embeddings, as opposed to our stacked adjacency learning, which is closer to Vaswani et al. (2017). In other words, instead of the attention kernel in (3), matching networks consider attention mechanisms of the form A˜(k)∗,j $\tilde { A } _ { * , j } ^ { ( k ) } = \varphi ( \mathbf { x } _ { * } ^ { ( k ) } , \mathbf { x } _ { j } ^ { ( T ) } )$ , where $\underset { - } { \mathbf { x } _ { j } ^ { ( T ) } }$ is the encoding function for the elements of the support set, obtained with bidirectional LSTMs. In that case, the support set encoding is thus computed independently of the target image. Second, the label and image fields are treated separately throughout the model, with a final step that aggregates linearly the labels using a trained kernel. This may prevent the model to leverage complex dependencies between labels and images at intermediate stages.
|
| 162 |
+
|
| 163 |
+
# 5 TRAINING
|
| 164 |
+
|
| 165 |
+
We describe next how to train the parameters of the GNN in the different setups we consider: fewshot learning, semi-supervised learning and active learning.
|
| 166 |
+
|
| 167 |
+
# 5.1 FEW-SHOT AND SEMI-SUPERVISED LEARNING
|
| 168 |
+
|
| 169 |
+
In this setup, the model is asked only to predict the label $Y$ corresponding to the image to classify $\bar { x } \in \tau$ , associated with node $^ *$ in the graph. The final layer of the GNN is thus a softmax mapping the node features to the $K$ -simplex. We then consider the Cross-entropy loss evaluated at node $^ *$ :
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
\ell ( \Phi ( \mathcal { T } ; \Theta ) , Y ) = - \sum _ { k } y _ { k } \log P ( Y _ { * } = y _ { k } \mid \mathcal { T } ) .
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
The semi-supervised setting is trained identically — the only difference is that the initial label fields of the node will be filled with the uniform distribution on nodes corresponding to $\tilde { x } _ { j }$ .
|
| 176 |
+
|
| 177 |
+
# 5.2 ACTIVE LEARNING
|
| 178 |
+
|
| 179 |
+
In the Active Learning setup, the model has the intrinsic ability to query for one of the labels from $\{ \tilde { x } _ { 1 } , \ldots , \tilde { x } _ { r } \}$ . The network will learn to ask for the most informative label in order to classify the sample $\bar { x } \in \mathcal { T }$ . The querying is done after the first layer of the GNN by using a Softmax attention over the unlabeled nodes of the graph. For this we apply a function $g ( \mathbf { x } _ { i } ^ { ( 1 ) } ) \in \mathbb { R } ^ { 1 }$ that maps each unlabeled vector node to a scalar value. Function $g$ is parametrized by a two layers neural network. A Softmax is applied over the $\{ 1 , \ldots , r \}$ scalar values obtained after applying $g$ :
|
| 180 |
+
|
| 181 |
+
$$
|
| 182 |
+
\mathrm { A t t e n t i o n } = \mathrm { S o f t m a x } ( g ( \mathbf { x } _ { \{ 1 , \dots , r \} } ^ { ( 1 ) } ) )
|
| 183 |
+
$$
|
| 184 |
+
|
| 185 |
+
In order to query only one sample, we set all elements from the $A t t e n t i o n \in \mathbb { R } ^ { r }$ vector to 0 except for one. At test time we keep the maximum value, at train time we randomly sample one value based on its multinomial probability. Then we multiply this sampled attention by the label vectors:
|
| 186 |
+
|
| 187 |
+
$$
|
| 188 |
+
w \cdot h ( l _ { i ^ { * } } ) = \langle \mathrm { A t t e n t i o n } ^ { \prime } , h ( l _ { \{ 1 , \dots , r \} } ) \rangle
|
| 189 |
+
$$
|
| 190 |
+
|
| 191 |
+
The label of the queried vector $h ( l _ { i ^ { * } } )$ is obtained, scaled by the weight $w \in ( 0 , 1 )$ . This value is then summed to the current representation $\mathbf { x } _ { i ^ { * } } ^ { ( 1 ) }$ , since we are using dense connections in our GNN model we can sum this $w \cdot h ( l _ { i ^ { * } } )$ value directly to where the uniform label distribution was concatenated
|
| 192 |
+
|
| 193 |
+
$$
|
| 194 |
+
\mathbf { x } _ { i ^ { * } } ^ { ( 1 ) } = [ \mathbf { G c } ( \mathbf { x } _ { i ^ { * } } ^ { ( 0 ) } ) , \mathbf { x } _ { i ^ { * } } ^ { ( 0 ) } ] = [ \mathbf { G c } ( \mathbf { x } _ { i ^ { * } } ^ { ( 0 ) } ) , ( \phi ( x _ { i ^ { * } } ) , h ( l _ { i ^ { * } } ) ) ]
|
| 195 |
+
$$
|
| 196 |
+
|
| 197 |
+
After the label has been summed to the current node, the information is forward propagated. This attention part is trained end-to-end with the rest of the network by backpropagating the loss from the output of the GNN.
|
| 198 |
+
|
| 199 |
+
# 6 EXPERIMENTS
|
| 200 |
+
|
| 201 |
+
For the few-shot, semi-supervised and active learning experiments we used the Omniglot dataset presented by Lake et al. (2015) and Mini-Imagenet dataset introduced by Vinyals et al. (2016) which is a small version of ILSVRC-12 Krizhevsky et al. (2012). All experiments are based on the $q$ -shot, $K$ -way setting. For all experiments we used the same values $q$ -shot and $K$ -way for both training and testing.
|
| 202 |
+
|
| 203 |
+
Code available at: https://github.com/vgsatorras/few-shot-gnn
|
| 204 |
+
|
| 205 |
+
# 6.1 DATASETS AND IMPLEMENTATION
|
| 206 |
+
|
| 207 |
+
# 6.1.1 OMNIGLOT
|
| 208 |
+
|
| 209 |
+
Dataset: Omniglot is a dataset of 1623 characters from 50 different alphabets, each character/class has been drawn by 20 different people. Following Vinyals et al. (2016) implementation we split the dataset into 1200 classes for training and the remaining 423 for testing. We augmented the dataset by multiples of 90 degrees as proposed by Santoro et al. (2016).
|
| 210 |
+
|
| 211 |
+
Architectures: Inspired by the embedding architecture from Vinyals et al. (2016), following Mishra et al. (2017), a CNN was used as an embedding $\phi$ function consisting of four stacked blocks of $\{ 3 \times 3$ -convolutional layer with 64 filters, batch-normalization, $2 \times 2$ max-pooling, leaky-relu} the output is passed through a fully connected layer resulting in a 64-dimensional embedding. For the GNN we used 3 blocks each of them composed by 1) a module that computes the adjacency matrix and 2) a graph convolutional layer. A more detailed description of each block can be found at Figure 3.
|
| 212 |
+
|
| 213 |
+
# 6.1.2 MINI-IMAGENET
|
| 214 |
+
|
| 215 |
+
Dataset: Mini-Imagenet is a more challenging dataset for one-shot learning proposed by Vinyals et al. (2016) derived from the original ILSVRC-12 dataset Krizhevsky et al. (2012). It consists of $8 4 \times 8 4$ RGB images from 100 different classes with 600 samples per class. It was created with the purpose of increasing the complexity for one-shot tasks while keeping the simplicity of a light size dataset, that makes it suitable for fast prototyping. We used the splits proposed by Ravi & Larochelle (2016) of 64 classes for training, 16 for validation and 20 for testing. Using 64 classes for training, and the 16 validation classes only for early stopping and parameter tuning.
|
| 216 |
+
|
| 217 |
+
Architecture: The embedding architecture used for Mini-Imagenet is formed by 4 convolutional layers followed by a fully-connected layer resulting in a 128 dimensional embedding. This light architecture is useful for fast prototyping:
|
| 218 |
+
|
| 219 |
+
$1 \times \{ 3 \times 3$ -conv. layer (64 filters), batch normalization, max pool $( 2 , 2 )$ , leaky relu $\}$ , $1 \times \{ 3 \times 3$ -conv. layer (96 filters), batch normalization, max $\mathrm { p o o l } ( 2 , 2 )$ , leaky relu}, $1 \times \{ 3 \times 3$ -conv. layer (128 filters), batch normalization, max $\mathrm { p o o l } ( 2 , 2 )$ , leaky relu, dropout $\left( 0 . 5 \right) \}$ , $1 \times \{ 3 \times 3$ -conv. layer (256 filters), batch normalization, max $\mathrm { p o o l } ( 2 , 2 )$ , leaky relu, dropout $\left( 0 . 5 \right) \}$ , $1 \times \left\{ \begin{array} { r l } \end{array} \right.$ fc-layer (128 filters), batch normalization}.
|
| 220 |
+
|
| 221 |
+
The two dropout layers are useful to avoid overfitting the GNN in Mini-Imagenet dataset. The GNN architecture is similar than for Omniglot, it is formed by 3 blocks, each block is described at Figure 3.
|
| 222 |
+
|
| 223 |
+
# 6.2 FEW-SHOT
|
| 224 |
+
|
| 225 |
+
Few-shot learning experiments for Omniglot and Mini-Imagenet are presented at Table 1 and Table 2 respectively.
|
| 226 |
+
|
| 227 |
+
We evaluate our model by performing different ${ \bf q }$ -shot, K-way experiments on both datasets. For every few-shot task $\tau$ , we sample $K$ random classes from the dataset, and from each class we sample $q$ random samples. An extra sample to classify is chosen from one of that $K$ classes.
|
| 228 |
+
|
| 229 |
+
Omniglot: The GNN method is providing competitive results while still remaining simpler than other methods. State of the art results are reached in the 5-Way and 20-way 1-shot experiments. In the 20-Way 1-shot setting the GNN is providing slightly better results than Munkhdalai & Yu (2017) while still being a more simple approach. The TCML approach from Mishra et al. (2017) is in the same confidence interval for 3 out of 4 experiments, but it is slightly better for the 20-Way 5-shot, although the number of parameters is reduced from ${ \sim } 5 \mathbf { M }$ (TCML) to $\sim 3 0 0 \mathrm { K }$ (3 layers GNN).
|
| 230 |
+
|
| 231 |
+
At Mini-Imagenet table we are also presenting a baseline ”Our metric learning $\mathbf { \chi } + K N N ^ { \prime }$ where no information has been aggregated among nodes, it is a K-nearest neighbors applied on top of the pair-wise learnable metric $\bar { \varphi _ { \theta } } ( \mathbf { x } _ { i } ^ { ( 0 ) } , \mathbf { x } _ { j } ^ { ( 0 ) } )$ and trained end-to-end, this learnable metric is competitive by itself compared to other state of the art methods. Even so, a significant improvement (from $6 4 . 0 2 \%$ to $6 6 . 4 1 \%$ ) can be seen for the 5-shot 5-Way Mini-Imagenet setting when aggregating information among nodes by using the full GNN architecture. A variety of embedding functions $\phi$ are used among the different papers for Mini-Imagenet experiments, in our case we are using a simple network of 4 conv. layers followed by a fully connected layer (Section 6.1.2) which served us to compare between Our GNN and Our metric learning $+ ~ K N N$ and it is useful for fast prototyping. More complex embeddings have proven to produce better results, at Mishra et al. (2017) a deep residual network is used as embedding network $\phi$ increasing the accuracy considerably. Regarding the TCML architecture in Mini-Imagenet, the number of parameters is reduced from ${ \sim } 1 1 \mathbf { M }$ (TCML) to ${ \sim } 4 0 0 \mathrm { K }$ (3 layers GNN).
|
| 232 |
+
|
| 233 |
+
<table><tr><td rowspan="2"></td><td colspan="2"> 5-Way</td><td colspan="2">20-Way</td></tr><tr><td>1-shot</td><td>5-shot</td><td>1-shot</td><td>5-shot</td></tr><tr><td>Model Pixels Vinyals et al. (2016)</td><td>41.7%</td><td>63.2%</td><td>26.7%</td><td>42.6%</td></tr><tr><td>Siamese Net Koch et al. (2015)</td><td>97.3%</td><td>98.4%</td><td>88.2%</td><td>97.0%</td></tr><tr><td>Matching Networks Vinyals et al. (2016)</td><td>98.1%</td><td>98.9%</td><td>93.8%</td><td>98.5%</td></tr><tr><td>N.Statistician Edwards & Storkey (2016)</td><td>98.1%</td><td>99.5%</td><td>93.2%</td><td>98.1%</td></tr><tr><td>Res.Pair-Wise Mehrotra & Dukkipati (2017)</td><td>-</td><td>-</td><td>94.8%</td><td>-</td></tr><tr><td>Prototypical Networks Snellet al. (2017)</td><td>97.4%</td><td>99.3%</td><td>95.4%</td><td>98.8%</td></tr><tr><td>ConvNet with Memory Kaiser et al. (2017)</td><td>98.4%</td><td>99.6%</td><td>95.0%</td><td>98.6%</td></tr><tr><td>Agnostic Meta-learner Finn et al. (2017)</td><td>98.7 ±0.4%</td><td>99.9 ±0.3%</td><td>95.8 ±0.3%</td><td>98.9 ±0.2%</td></tr><tr><td>MetaNetworks Munkhdalai& Yu (2017)</td><td>98.9%</td><td>=</td><td>97.0%</td><td></td></tr><tr><td>TCML Mishra et al. (2017)</td><td></td><td>98.96% ±0.20% 99.75% ±0.11% 97.64% ±0.30% 99.36% ±0.18%</td><td></td><td></td></tr><tr><td>Our GNN</td><td>99.2%</td><td>99.7%</td><td>97.4%</td><td>99.0%</td></tr></table>
|
| 234 |
+
|
| 235 |
+
Table 1: Few-Shot Learning — Omniglot accuracies. Siamese Net results are extracted from Vinyals et al. (2016) reimplementation.
|
| 236 |
+
|
| 237 |
+
Table 2: Few-shot learning — Mini-Imagenet average accuracies with $9 5 \%$ confidence intervals.
|
| 238 |
+
|
| 239 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">5-Way</td></tr><tr><td>1-shot</td><td>5-shot</td></tr><tr><td>Matching Networks Vinyals et al. (2016)</td><td>43.6%</td><td>55.3%</td></tr><tr><td>Prototypical Networks Snel et al. (2017)</td><td>46.61% ±0.78%</td><td>65.77% ±0.70%</td></tr><tr><td>Model Agnostic Meta-learner Finn et al. (2017)</td><td>48.70% ±1.84%</td><td>63.1% ±0.92%</td></tr><tr><td>Meta Networks Munkhdalai & Yu (2017)</td><td>49.21% ±0.96</td><td></td></tr><tr><td>Ravi &Larochelle Ravi & Larochelle (2016)</td><td>43.4% ±0.77%</td><td>60.2% ±0.71%</td></tr><tr><td>TCML Mishra et al. (2017)</td><td>55.71% ±0.99%</td><td>68.88% ±0.92%</td></tr><tr><td>Our metric learning + KNN</td><td>49.44% ±0.28%</td><td>64.02% ±0.51%</td></tr><tr><td>Our GNN</td><td>50.33% ±0.36%</td><td>66.41% ±0.63%</td></tr></table>
|
| 240 |
+
|
| 241 |
+
# 6.3 SEMI-SUPERVISED
|
| 242 |
+
|
| 243 |
+
Semi-supervised experiments are performed on the 5-way 5-shot setting. Different results are presented when $20 \%$ and $40 \%$ of the samples are labeled. The labeled samples are balanced among classes in all experiments, in other words, all the classes have the same amount of labeled and unlabeled samples.
|
| 244 |
+
|
| 245 |
+
Two strategies can be seen at Tables 3 and 4. ”GNN - Trained only with labeled” is equivalent to the supervised few-shot setting, for example, in the 5-Way 5-shot $20 \%$ -labeled setting, this method is equivalent to the 5-way 1-shot learning setting since it is ignoring the unlabeled samples. ”GNN - Semi supervised” is the actual semi-supervised method, for example, in the 5-Way 5-shot $20 \%$ - labeled setting, the GNN receives as input 1 labeled sample per class and 4 unlabeled samples per class.
|
| 246 |
+
|
| 247 |
+
Omniglot results are presented at Table 3, for this scenario we observe that the accuracy improvement is similar when adding images than when adding labels. The GNN is able to extract information from the input distribution of unlabeled samples such that only using $20 \%$ of the labels in a 5-shot semi-supervised environment we get same results as in the $40 \%$ supervised setting.
|
| 248 |
+
|
| 249 |
+
In Mini-Imagenet experiments, Table 4, we also notice an improvement when using semi-supervised data although it is not as significant as in Omniglot. The distribution of Mini-Imagenet images is more complex than for Omniglot. In spite of it, the GNN manages to improve by ${ \sim } 2 \%$ in the $20 \%$ and $40 \%$ settings.
|
| 250 |
+
|
| 251 |
+
Table 3: Semi-Supervised Learning — Omniglot accuracies.
|
| 252 |
+
|
| 253 |
+
<table><tr><td></td><td colspan="3">5-Way 5-shot</td></tr><tr><td>Model</td><td>20%-labeled</td><td>40%-labeled</td><td>100 %-labeled</td></tr><tr><td>GNN - Trained only with labeled</td><td>99.18%</td><td>99.59%</td><td>99.71%</td></tr><tr><td>GNN -Semi supervised</td><td>99.59%</td><td>99.63%</td><td>99.71%</td></tr></table>
|
| 254 |
+
|
| 255 |
+
Table 4: Semi-Supervised Learning — Mini-Imagenet average accuracies with $9 5 \%$ confidence intervals.
|
| 256 |
+
|
| 257 |
+
<table><tr><td></td><td colspan="3">5-Way 5-shot</td></tr><tr><td>Model</td><td>20%-labeled</td><td>40%-labeled</td><td>100 %-labeled</td></tr><tr><td>GNN - Trainedonlywithlabeled</td><td>50.33% ±0.36%</td><td>56.91% ±0.42%</td><td>66.41% ±0.63%</td></tr><tr><td>GNN - Semi supervised</td><td>52.45% ±0.88%</td><td>58.76% ±0.86%</td><td>66.41% ±0.63%</td></tr></table>
|
| 258 |
+
|
| 259 |
+
# 6.4 ACTIVE LEARNING
|
| 260 |
+
|
| 261 |
+
We performed Active Learning experiments on the 5-Way 5-shot set-up when $20 \%$ of the samples are labeled. In this scenario our network will query for the label of one sample from the unlabeled ones. The results are compared with the Random baseline where the network chooses a random sample to be labeled instead of one that maximally reduces the loss of the classification task $\tau$ .
|
| 262 |
+
|
| 263 |
+
Results are shown at Table 5. The results of the GNN-Random criterion are close to the Semisupervised results for $20 \%$ -labeled samples from Tables 3 and 4. It means that selecting one random label practically does not improve the accuracy at all. When using the GNN-AL learned criterion, we notice an improvement of $\sim 3 . 4 \%$ for Mini-Imagenet, it means that the GNN manages to correctly choose a more informative sample than a random one. In Omniglot the improvement is smaller since the accuracy is almost saturated and the improving margin is less.
|
| 264 |
+
|
| 265 |
+
<table><tr><td>Method</td><td>5-Way 5-shot20%-labeled</td><td>Method</td><td>5-Way 5-shot 20%-labeled</td></tr><tr><td>GNN - AL</td><td>99.62%</td><td>GNN - AL</td><td>55.99% ±1.35%</td></tr><tr><td>GNN - Random</td><td>99.59%</td><td>GNN - Random</td><td>52.56% ±1.18%</td></tr></table>
|
| 266 |
+
|
| 267 |
+
Table 5: Omniglot (left) and Mini-Imagneet (right), average accuracies are shown at both tables, the GNN-AL is the learned criterion that performs Active Learning by selecting the sample that will maximally reduce the loss of the current classification. The GNN - Random is also selecting one sample, but in this case a random one. Mini-Imagenet results are presented with $9 5 \%$ confidence intervals.
|
| 268 |
+
|
| 269 |
+
# 7 CONCLUSIONS
|
| 270 |
+
|
| 271 |
+
This paper explored graph neural representations for few-shot, semi-supervised and active learning. From the meta-learning perspective, these tasks become supervised learning problems where the input is given by a collection or set of elements, whose relational structure can be leveraged with neural message passing models. In particular, stacked node and edge features generalize the contextual similarity learning underpinning previous few-shot learning models.
|
| 272 |
+
|
| 273 |
+
The graph formulation is helpful to unify several training setups (few-shot, active, semi-supervised) under the same framework, a necessary step towards the goal of having a single learner which is able to operate simultaneously in different regimes (stream of labels with few examples per class, or stream of examples with few labels). This general goal requires scaling up graph models to millions of nodes, motivating graph hierarchical and coarsening approaches Defferrard et al. (2016).
|
| 274 |
+
|
| 275 |
+
Another future direction is to generalize the scope of Active Learning, to include e.g. the ability to ask questions Rothe et al. (2017), or in reinforcement learning setups, where few-shot learning is critical to adapt to non-stationary environments.
|
| 276 |
+
|
| 277 |
+
# ACKNOWLEDGMENTS
|
| 278 |
+
|
| 279 |
+
This work was partly supported by Samsung Electronics (Improving Deep Learning using Latent Structure).
|
| 280 |
+
|
| 281 |
+
# REFERENCES
|
| 282 |
+
|
| 283 |
+
Peter Battaglia, Razvan Pascanu, Matthew Lai, Danilo Jimenez Rezende, et al. Interaction networks for learning about objects, relations and physics. In Advances in Neural Information Processing Systems, pp. 4502–4510, 2016.
|
| 284 |
+
|
| 285 |
+
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.
|
| 286 |
+
|
| 287 |
+
Joan Bruna and Xiang Li. Community detection with graph neural networks. arXiv preprint arXiv:1705.08415, 2017.
|
| 288 |
+
|
| 289 |
+
Joan Bruna, Wojciech Zaremba, Arthur Szlam, and Yann LeCun. Spectral networks and locally connected networks on graphs. Proc. ICLR, 2013.
|
| 290 |
+
|
| 291 |
+
Michael B. Chang, Tomer Ullman, Antonio Torralba, and Joshua B. Tenenbaum. A compositional object-based approach to learning physical dynamics. ICLR, 2016.
|
| 292 |
+
|
| 293 |
+
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. 3837–3845, 2016.
|
| 294 |
+
|
| 295 |
+
David Duvenaud, Dougal Maclaurin, Jorge Aguilera-Iparraguirre, Rafael Gomez-Bombarelli, Tim- ´ othy Hirzel, Alan Aspuru-Guzik, and Ryan P Adams. Convolutional networks on graphs for ´ learning molecular fingerprints. In Neural Information Processing Systems, 2015.
|
| 296 |
+
|
| 297 |
+
Harrison Edwards and Amos Storkey. Towards a neural statistician. arXiv preprint arXiv:1606.02185, 2016.
|
| 298 |
+
|
| 299 |
+
Li Fei-Fei, Rob Fergus, and Pietro Perona. One-shot learning of object categories. IEEE transactions on pattern analysis and machine intelligence, 28(4):594–611, 2006.
|
| 300 |
+
|
| 301 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. arXiv preprint arXiv:1703.03400, 2017.
|
| 302 |
+
|
| 303 |
+
Justin Gilmer, Samuel S Schoenholz, Patrick F Riley, Oriol Vinyals, and George E Dahl. Neural message passing for quantum chemistry. arXiv preprint arXiv:1704.01212, 2017.
|
| 304 |
+
|
| 305 |
+
M. Gori, G. Monfardini, and F. Scarselli. A new model for learning in graph domains. In Proc. IJCNN, 2005.
|
| 306 |
+
|
| 307 |
+
M. Henaff, J. Bruna, and Y. LeCun. Deep convolutional networks on graph-structured data. arXiv:1506.05163, 2015.
|
| 308 |
+
|
| 309 |
+
Łukasz Kaiser, Ofir Nachum, Aurko Roy, and Samy Bengio. Learning to remember rare events. arXiv preprint arXiv:1703.03129, 2017.
|
| 310 |
+
|
| 311 |
+
Steven Kearnes, Kevin McCloskey, Marc Berndl, Vijay Pande, and Patrick Riley. Molecular graph convolutions: moving beyond fingerprints. Journal of computer-aided molecular design, 30(8): 595–608, 2016.
|
| 312 |
+
|
| 313 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
|
| 314 |
+
|
| 315 |
+
Gregory Koch, Richard Zemel, and Ruslan Salakhutdinov. Siamese neural networks for one-shot image recognition. In ICML Deep Learning Workshop, volume 2, 2015.
|
| 316 |
+
|
| 317 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012.
|
| 318 |
+
|
| 319 |
+
Brenden M Lake, Ruslan Salakhutdinov, and Joshua B Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332–1338, 2015.
|
| 320 |
+
|
| 321 |
+
Yujia Li, Daniel Tarlow, Marc Brockschmidt, and Richard Zemel. Gated graph sequence neural networks. arXiv preprint arXiv:1511.05493, 2015.
|
| 322 |
+
|
| 323 |
+
Akshay Mehrotra and Ambedkar Dukkipati. Generative adversarial residual pairwise networks for one shot learning. arXiv preprint arXiv:1703.08033, 2017.
|
| 324 |
+
|
| 325 |
+
Nikhil Mishra, Mostafa Rohaninejad, Xi Chen, and Pieter Abbeel. Meta-learning with temporal convolutions. arXiv preprint arXiv:1707.03141, 2017.
|
| 326 |
+
|
| 327 |
+
Tsendsuren Munkhdalai and Hong Yu. Meta networks. arXiv preprint arXiv:1703.00837, 2017.
|
| 328 |
+
|
| 329 |
+
Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. ICLR, 2016.
|
| 330 |
+
|
| 331 |
+
Anselm Rothe, Brenden Lake, and Todd Gureckis. Question asking as program generation. NIPS, 2017.
|
| 332 |
+
|
| 333 |
+
Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. Metalearning with memory-augmented neural networks. In International conference on machine learning, pp. 1842–1850, 2016.
|
| 334 |
+
|
| 335 |
+
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.
|
| 336 |
+
Jake Snell, Kevin Swersky, and Richard S Zemel. Prototypical networks for few-shot learning. arXiv preprint arXiv:1703.05175, 2017.
|
| 337 |
+
Sainbayar Sukhbaatar, Rob Fergus, et al. Learning multiagent communication with backpropagation. In Advances in Neural Information Processing Systems, pp. 2244–2252, 2016.
|
| 338 |
+
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.
|
| 339 |
+
Oriol Vinyals, Samy Bengio, and Manjunath Kudlur. Order matters: Sequence to sequence for sets. arXiv preprint arXiv:1511.06391, 2015.
|
| 340 |
+
Oriol Vinyals, Charles Blundell, Tim Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In Advances in Neural Information Processing Systems, pp. 3630–3638, 2016.
|
| 341 |
+
Bing Xu, Naiyan Wang, Tianqi Chen, and Mu Li. Empirical evaluation of rectified activations in convolutional network. arXiv preprint arXiv:1505.00853, 2015.
|
| 342 |
+
|
| 343 |
+
# APPENDIX
|
| 344 |
+
|
| 345 |
+

|
| 346 |
+
Figure 3: GNN model. Three blue blocks are used for Omniglot and Mini-Imagenet. $( \mathrm { n f } { = } 9 6 ) ,$ ).
|
md/train/BJlgt2EYwr/BJlgt2EYwr.md
ADDED
|
@@ -0,0 +1,266 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# STABILIZING DARTS WITH AMENDED GRADIENT ESTIMATION ON ARCHITECTURAL PARAMETERS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Differentiable neural architecture search has been a popular methodology of exploring architectures for deep learning. Despite the great advantage of search efficiency, it often suffers weak stability, which hinders it from being applied to a large search space or being flexibly adjusted to different scenarios. This paper investigates DARTS, the currently most popular differentiable search algorithm, and points out an important factor of instability, which lies in its approximation on the gradients of architectural parameters. In the current status, the optimization algorithm can converge to another point which results in dramatic inaccuracy in the re-training process. Based on this analysis, we propose an amending term for computing architectural gradients by making use of a direct property of the optimality of network parameter optimization. Our approach mathematically guarantees that gradient estimation follows a roughly correct direction, which leads the search stage to converge on reasonable architectures. In practice, our algorithm is easily implemented and added to DARTS-based approaches efficiently. Experiments on CIFAR and ImageNet demonstrate that our approach enjoys accuracy gain and, more importantly, enables DARTS-based approaches to explore much larger search spaces that have not been studied before.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Neural architecture search (NAS) has been an important topic in the research area of automated machine learning (AutoML). The idea is to replace the manual way of designing neural network architectures with an automatic algorithm, by which deep learning methods become more flexible in fitting complex data distributions, e.g., large-scale image datasets. Early efforts of NAS involved using heuristic search methods such as reinforcement learning (Zoph & Le, 2017; Zoph et al., 2018) and evolutionary algorithms (Real et al., 2017; Xie & Yuille, 2017) to sample networks from a large search space, and optimizing each sampled network individually to evaluate its quality. Despite notable successes obtained by this methodology, it often requires a vast amount of computation, which obstacles its applications in the scenarios of limited resources. Inspired by the idea of reusing and sharing parameters among trained networks, DARTS (Liu et al., 2019b) was designed as a ‘one-shot’ solution of NAS. The major difference from the aforementioned methods is a differentiable formulation of architecture search and an end-to-end mechanism which optimizes model weights (such as convolution) and architectural weights simultaneously. Recently, improvements upon DARTS were made in various aspects (Chen et al., 2019; Xu et al., 2019; Liang et al., 2019), making it a reasonable tradeoff between search cost and performance.
|
| 12 |
+
|
| 13 |
+
Despite its broad applications, the current pipeline of DARTS (or, generally speaking, differentiable NAS approaches) suffers a critical weakness known as instability. Researchers reported (Liang et al., 2019) that DARTS-based algorithms can sometimes generate weird architectures that produce considerably worse accuracy than those generated in other individual runs, or even significantly worse than randomly generated architectures. There indeed exist tricks designed by human expertise (Chen et al., 2019; Nayman et al., 2019; Liang et al., 2019) to alleviate this issue, but we point out that these approaches violated the ideology of NAS, which is to maximally prevent human interventions. Moreover, even with such add-ons, a dramatic property of DARTS persists and has not been studied carefully in prior work. When DARTS, as well as its variants, gets trained for a longer time, e.g., from the default number of 50 epochs to 200 epochs, we surprisingly observe that all these approaches converge to very similar architectures, in which almost all edges are occupied by skip-connect (a.k.a., identity). These architectures, with fewer trainable parameters, are often far from producing high accuracy in particular on large datasets like ImageNet, but they somehow produce sufficiently high validation accuracy in the search stage. In other words, convergence in search often leads to bad performance in re-training. This is why some previous DARTS-based approaches advocated for early termination (Liang et al., 2019), a practical but non-essential solution. Also, we conjecture that early termination also contributes to the lack of stability and, more importantly, trustfulness, of DARTS-based approaches.
|
| 14 |
+
|
| 15 |
+
This paper delves deep into the inconsistency between convergence and performance. We show that the devil lies in optimizing the loss function of the super-network, $\mathcal { L } _ { \mathrm { v a l } } ( \bar { \omega } ^ { \star } ( \alpha ) , \alpha )$ ( $\omega$ and $_ { \pmb { \alpha } }$ denote network and architectural parameters, respectively, and $\omega ^ { \star } ( \alpha )$ is the global optimum of $\omega$ given $_ \alpha$ ), in which ω and α get updated alternately. Following the chain rule, ∇αLval(ω?(α) , α)|α=αt equals to $\nabla _ { \alpha } \mathcal { L } _ { \mathrm { v a l } } ( \omega , \alpha ) | _ { \omega = \omega ^ { \star } ( \alpha _ { t } ) , \alpha = \alpha _ { t } } + \left. \nabla _ { \alpha } \omega ^ { \star } ( \alpha ) \right| _ { \alpha = \alpha _ { t } }$ · $\nabla _ { \omega } \mathcal { L } _ { \mathrm { v a l } } ( \omega , \alpha ) | _ { \omega = \omega ^ { \star } ( \alpha _ { t } ) , \alpha = \alpha _ { t } }$ , in which the first term is easy to compute while the second term is not, mainly because $\omega ^ { \star } ( \alpha )$ is difficult to estimate, and so is the term of ∇αω?(α)|α=αt . DARTS-based approaches performed inaccurate approximation for this purpose, in which the first-order version of DARTS directly discarded the second term – but this term is often numerically significant, and the second-order version of DARTS applied an approximation to this term which is not mathematically guaranteed (see Section 3.4). Consequently, the accuracy of $\nabla _ { \alpha } \mathcal { L } _ { \mathrm { v a l } } \big ( \omega ^ { \star } ( \alpha ) , \alpha \big ) | _ { \alpha = \alpha _ { t } }$ cannot be guaranteed, and hence the update of $_ { \pmb { \alpha } }$ can be problematic. To the best of our knowledge, this issue is not studied by existing DARTS-based approaches.
|
| 16 |
+
|
| 17 |
+
To deal with this problem, we propose an alternative way of computing $\nabla _ { \alpha } \omega ^ { \star } ( \alpha ) | _ { \alpha = \alpha _ { t } }$ . We make use of an important property, i.e., $\nabla _ { \omega } \mathcal { L } _ { \mathrm { t r a i n } } ( \omega , \alpha ) | _ { \omega = \omega ^ { \star } ( \alpha ^ { \dagger } ) , \alpha = \alpha ^ { \dagger } } \ \equiv \ \mathbf { 0 }$ holds for any $\alpha ^ { \dagger }$ , which directly comes from the optimality of $\omega ^ { \star } ( \alpha )$ . Differentiating both sides with respect to $\alpha ^ { \dagger }$ , we obtain a new equality which enables computing derives $\nabla _ { \alpha } \omega ^ { \star } ( \alpha ) | _ { \alpha = \alpha _ { t } }$ with the inverse of the Hesse matrix, $\nabla _ { \omega } ^ { 2 } \mathcal { L } _ { \mathrm { t r a i n } } ( \omega , \alpha ) \big | _ { \omega = \omega ^ { \star } ( \alpha ) , \alpha = \alpha _ { t } }$ . This idea enables us to achieve a more accurate approximation on $\nabla _ { \alpha } \mathcal { L } _ { \mathrm { v a l } } \big ( \omega ^ { \star } ( \alpha ) , \alpha \big ) | _ { \alpha = \alpha _ { t } }$ when $\omega ^ { \star } ( \alpha )$ is not available. Mathematically, we prove that when we have $\omega ^ { \mathrm { e s t } } \approx \omega ^ { \star } ( \alpha _ { t } )$ , the inner angle between the second term and our approximate term is smaller than 90 degrees. Note that this property does not hold in existing DARTS-based algorithms. Our final solution involves using the amended second term of ∇αLval(ω?(α) , α)|α=αt meanwhile keeping the first term unchanged, which goes one step further in optimizing the supernetwork, which reflects in a higher validation accuracy in the search stage.
|
| 18 |
+
|
| 19 |
+
Our approach is very easily implemented. The overall computational overhead is comparable to the second-order version of DARTS. Experiments are performed on image classification, with popular datasets including CIFAR and ImageNet being used. In all experiments, we allow the search stage to come to a complete convergence and report competitive accuracy among current state-of-thearts. The stability of our approach also enables us to close the gap between hyper-parameters of search and evaluation, as well as explore more complex search spaces, which are believed to be correct directions of NAS but existing DARTS-based approaches would mostly fail. Therefore, we believe our algorithm can expand the application scenario of differentiable NAS methods in particular DARTS-based approaches.
|
| 20 |
+
|
| 21 |
+
The remainder of this paper is organized as follows. We briefly review related work in Section 2, and illustrate our approach of amending architectural gradients in Section 3. After experiments are shown in Section 4, we conclude this work in Section 5.
|
| 22 |
+
|
| 23 |
+
# 2 RELATED WORK
|
| 24 |
+
|
| 25 |
+
With the era of big data and powerful computational resources, deep learning (LeCun et al., 2015), in particular, deep neural networks (Krizhevsky et al., 2012), have rapidly grown up to be the standard tool for learning representations in a complicated feature space. Recent years have witnessed the trend of using deeper (He et al., 2016) and denser (Huang et al., 2017) networks to boost recognition performance, while there is no justification that whether these manually designed architectures are best for each specific task, e.g., image classification. To advance, researchers started considering the possibility of learning network architectures automatically from data, which led to the appearance of neural architecture search (NAS) (Zoph & Le, 2017), which is now popular and known as a sub research field in automated machine learning (AutoML).
|
| 26 |
+
|
| 27 |
+
The common pipeline of NAS starts with a pre-defined space of network operators. Since the search space is often large (e.g., containing $1 0 ^ { 1 0 }$ or even more possible architectures), it is unlikely that exhaustive search is tractable, and thus heuristic search methods are widely applied for speedup. Typical examples include reinforcement learning (Zoph & Le, 2017; Zoph et al., 2018; Liu et al., 2018a) and evolutionary algorithms (Real et al., 2017; Xie & Yuille, 2017; Real et al., 2019). These approaches followed a general pipeline that samples a set of architectures from a learnable distribution, evaluates them and learns from rewards by updating the distribution. In an early age, each sampled architecture underwent an individual training process from scratch and thus the overall computational overhead is large, e.g., hundreds of even thousands of GPU-days. To alleviate the burden, researchers started to share computation among training sampled architectures, with the key lying in reusing network weights trained previously (Cai et al., 2018) or starting from a well-trained super-network (Pham et al., 2018). These efforts shed light on the so-called one-shot architecture search methods, which required training the super-network only once and thus ran more efficiently, e.g., two or three orders of magnitude faster than conventional approaches.
|
| 28 |
+
|
| 29 |
+
Within the scope of one-shot architecture search, an elegant solution lies in jointly formulating architecture search and approximation, so that it is possible to apply end-to-end optimization for training network and architectural parameters simultaneously. This methodology is known today as differentiable NAS, and a typical example is DARTS (Liu et al., 2019b), which constructed a super-network with all possible operators contained and decoupled, and the goal is to determine the weights of these architectural parameters, followed by pruning and re-training stages. This kind of approach allowed more flexible search space to be constructed, unlike conventional approaches with either reinforcement or evolutionary learning, which suffer from the computational burden and thus must constrain search within a relatively small search space (Tan & Le, 2019).
|
| 30 |
+
|
| 31 |
+
Despite the inspirations brought by differentiable NAS, these approaches still suffer a few critical issues that narrow down their applications in practice. One significant drawback lies in the lack of stability, which reflects in the way that results of differentiable search can be impacted by very small perturbations, e.g., initialization of architectural weights, training hyper-parameters, and even randomness in the training process. Existing solutions include running search for several individual times and choosing the best one in validation (Liu et al., 2019b), or using other kinds of techniques such as decoupling modules (Cai et al., 2019; Guo et al., 2019), adjusting search space during optimization (Noy et al., 2019; Chen et al., 2019; Nayman et al., 2019), regularization $\mathrm { { X u } }$ et al., 2019), early termination (Liang et al., 2019), etc., however, these approaches seemed to develop heuristic remedies rather than analyze it from the mathematical fundamentals, e.g., how instability happens in mathematics.
|
| 32 |
+
|
| 33 |
+
In this paper, we investigate the stability issue in mathematics and show that the results produced by the current approaches are much less reliable than people used to think. Then, we fix this issue by amending optimization of the architectural parameters, so that each step of the update gets closer to the correct direction. We show great improvement on stability in a fundamental task, image classification, while we believe our approach can be applied to a wide range of tasks including object detection (Ghiasi et al., 2019), semantic segmentation (Liu et al., 2019a), hyper-parameter learning (Cubuk et al., 2019), etc.
|
| 34 |
+
|
| 35 |
+
# 3 STABILIZING DARTS WITH AMENDED GRADIENTS
|
| 36 |
+
|
| 37 |
+
In this section, we first show that DARTS can fail dramatically when it gets trained till convergence, and then we mathematically analyze how this problem is related to inaccurate approximation in optimization, following which we present our solution to amend this error and thus stabilize DARTS.
|
| 38 |
+
|
| 39 |
+
# 3.1 PRELIMINARIES: DIFFERENTIABLE NEURAL ARCHITECTURE SEARCH
|
| 40 |
+
|
| 41 |
+
Differentiable NAS approaches start with defining a super-network, which is constrained in a search space with a pre-defined number of layers and a limited set of neural operators. The core idea is to introduce a ‘soft’ way operator selection (i.e., using a weighted sum over the outputs of a few operators instead of taking the output of only one), so that optimization can be done in an end-toend manner. Mathematically, the super-network is a function $\mathbf { f } \left( \mathbf { x } ; \omega , \alpha \right)$ , with $\mathbf { x }$ being input, and parameterized by network parameters $\omega$ (e.g., convolutional kernels) and architectural parameters $_ { \pmb { \alpha } }$ (e.g., indicating the importance of each operator between each pair of layers). $\mathbf { f } \left( \mathbf { x } ; \omega , \alpha \right)$ is differentiable to both $\omega$ and $_ { \pmb { \alpha } }$ , so that gradient-based approaches can be applied for optimization.
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 1: Left: a typical search process of the first-order DARTS, in which 200 search epochs are used. Red, green and blue lines indicate the average weight of none, the ratio of dominant skipconnect operators (over 14 normal edges) and the re-training accuracy, with respect to the number of search epochs, respectively. Right: the normal cell obtained after 200 search epochs, in which all preserved operators are skip-connect. We executed both first-order and second-order DARTS for several times, and such failure consistently happens in each individual run.
|
| 45 |
+
|
| 46 |
+
In the example of DARTS, $\mathbf { f } \left( \mathbf { x } ; \omega , \alpha \right)$ is composed of a few cells, each of which contains $N$ nodes, and there is a pre-defined set, $\mathcal { E }$ , denoting which pairs of nodes are connected. For each connected node pair $( i , j ) , i < j$ , node $j$ takes the output of node $i$ , $\mathbf { x } _ { i }$ , as a part of its input, and propagate it through a pre-defined operator set, $\mathcal { O }$ , with all outputs summed up:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\mathbf { y } ^ { ( i , j ) } \left( \mathbf { x } _ { i } \right) = \sum _ { o \in \mathcal { O } } \frac { \exp ( \alpha _ { o } ^ { ( i , j ) } ) } { \sum _ { o ^ { \prime } \in \mathcal { O } } \exp ( \alpha _ { o } ^ { ( i , j ) } ) } \cdot o ( \mathbf { x } _ { i } ) .
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
Here, a softmax term is computed by architectural weights to normalize outputs. Within each unit of the search process, $\omega$ and $_ { \pmb { \alpha } }$ get optimized alternately. After search, the operator $o$ with the maximal value of $\alpha _ { o } ^ { ( i , j ) }$ is preserved for each edge $( i , j )$ . All network parameters $\omega$ are discarded and the obtained architecture is re-trained from scratch1.
|
| 53 |
+
|
| 54 |
+
# 3.2 DARTS FAILS: THE CONTRADICTORY BETWEEN CONVERGENCE AND PERFORMANCE
|
| 55 |
+
|
| 56 |
+
Our research is motivated by an observation that DARTS, at the end of a regular training process with, say, 50 epochs (Liu et al., 2019b), has not yet arrived at or even got close to convergence, yet the weight of the none (a.k.a., zero) operator is consistently the largest on each edge of the normal cell. To verify this, we increase the length of each training stage by 4 times, i.e., from 50 to 200 epochs. Two weird phenomena are observed, both of which are shown in the left part of Figure 1. First, the weight of the none operator monotonically goes up – at 200 epochs, the weight has achieved 0.97 on each edge of the normal cells, however, this operator is not considered in the final architecture. Second, almost all preserved operators are skip-connect (a.k.a., identity), a parameter-free operator that contributes little to feature learning – and surprisingly, it occupies $3 0 \%$ to $7 0 \%$ of the weight remained by none. Such a network has much fewer parameters than a well-designed one, and thus it usually reports unsatisfying performance at the re-training stage. This indicates that, in the context of DARTS, there exists a contradictory between search convergence and re-training accuracy.
|
| 57 |
+
|
| 58 |
+
We point out that this is a critical issue, which suggests that when using DARTS-based approaches, one does not hope the search process to achieve convergence as it implies bad performance. In other words, each ‘successful’ architecture comes from an early-terminated search process. Consequently, the initialization of parameters $\scriptstyle { \mathbf { \alpha } } _ { \alpha }$ and $\omega$ ), the hyper-parameters of search (e.g., learning rate) and the time of terminating search become important and thus need to be determined by experience (Liang et al., 2019). This weakens the stability as well as explainability of search and, more importantly, violates the fundamental ideology of AutoML, i.e., maximally reducing human interference and determining the best architecture by training data.
|
| 59 |
+
|
| 60 |
+
# 3.3 DELVING DEEP INTO MATHEMATICS: PROBLEM AND SOLUTION
|
| 61 |
+
|
| 62 |
+
We point out that the reason lies in inaccurate estimation of the gradient with respect to $_ { \pmb { \alpha } }$ , namely, $\nabla _ { \alpha } \bar { \mathcal { L } } _ { \mathrm { v a l } } \big ( \omega ^ { \star } ( \alpha ) , \alpha \big ) | _ { \alpha = \alpha _ { t } }$ . Following the chain rule of gradients, this quantity equals to
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\nabla _ { \alpha } \mathcal { L } _ { \mathrm { v a l } } ( \omega , \alpha ) | _ { \omega = \omega ^ { \star } ( \alpha _ { t } ) , \alpha = \alpha _ { t } } + \nabla _ { \alpha } \omega ^ { \star } ( \alpha ) | _ { \alpha = \alpha _ { t } } \cdot \nabla _ { \omega } \mathcal { L } _ { \mathrm { v a l } } ( \omega , \alpha ) | _ { \omega = \omega ^ { \star } ( \alpha _ { t } ) , \alpha = \alpha _ { t } } ,
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+
in which the first term is relatively easy to compute (as is done by the first-order version of DARTS), while the second term, in particular $\mathrm { \nabla } \nabla _ { \alpha } \omega ^ { \star } ( \bar { \alpha } ) | _ { \alpha = \alpha _ { t } }$ , is not. The first-order version of DARTS directly discarded this term, but it often has significant numerical values which are not negligible. The second-order version of DARTS indeed proposed an approximation to this term, but, as we shall see in the next subsection, can incur a large approximation error (the inner-product between the correct and estimated directions can be smaller than 0). Consequently, there can be a significant gap between the estimated and true values of $\nabla _ { \alpha } \mathcal { L } _ { \mathrm { v a l } } \big ( \omega ^ { \star } ( \alpha ) , \alpha \big ) | _ { \alpha = \alpha _ { t } }$ . Such inaccuracy accumulates with every update on $_ { \pmb { \alpha } }$ , and gradually causes $_ { \pmb { \alpha } }$ to converge to weird solutions that are far from optimum, e.g., the entire super-network is dominated by none and skip-connect operators. We name this phenomenon as the gradient trap during optimization.
|
| 69 |
+
|
| 70 |
+
To estimate $\nabla _ { \alpha } \omega ^ { \star } ( \alpha ) | _ { \alpha = \alpha _ { t } }$ , we first make a reasonable assumption that $\nabla _ { \alpha } \omega ^ { \star } ( \alpha ) | _ { \alpha = \alpha _ { t } }$ has finite values. Then, we make use of an important property, i.e., $\nabla _ { \omega } \mathcal { L } _ { \mathrm { t r a i n } } ( \omega , \alpha ) | _ { \omega = \omega ^ { \star } ( \alpha ^ { \dagger } ) , \alpha = \alpha ^ { \dagger } } \ \equiv \ \mathbf { 0 }$ holds for any $\alpha ^ { \dagger }$ . This is property directly comes from the optimality of $\omega ^ { \star } ( \alpha )$ , but it has never been used by existing approaches. Applying differentiation with respect to any $\alpha ^ { \dagger }$ to both sides of this equality, we have $\bar { \nabla _ { \alpha ^ { \dagger } } } \left( \nabla _ { \omega } \mathcal { L } _ { \mathrm { t r a i n } } ( \omega , \bar { \alpha } ) | _ { \omega = \omega ^ { \star } ( \alpha ^ { \dagger } ) , \alpha = \alpha ^ { \dagger } } \right) \equiv \mathbf { 0 }$ . When $ { \alpha } ^ { \dagger } = { \alpha } _ { t }$ , it becomes:
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\nabla _ { \alpha ^ { \dagger } } \left. \left( \nabla _ { \omega } \mathcal { L } _ { \mathrm { t r a i n } } ( \omega , \alpha ) \vert _ { \omega = \omega ^ { \star } ( \alpha ^ { \dagger } ) , \alpha = \alpha ^ { \dagger } } \right) \right. _ { \alpha ^ { \dagger } = \alpha _ { t } } = 0 .
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
Again, applying the chain rule to the left-hand side gives:
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\nabla _ { \alpha , \omega } ^ { 2 } \mathcal { L } _ { \mathrm { t r a i n } } ( \omega , \alpha ) \big | _ { \omega = \omega ^ { * } ( \alpha _ { t } ) , \alpha = \alpha _ { t } } + \nabla _ { \alpha } \omega ^ { \star } ( \alpha ) \big | _ { \alpha = \alpha _ { t } } \cdot \left. \nabla _ { \omega } ^ { 2 } \mathcal { L } _ { \mathrm { t r a i n } } ( \omega , \alpha ) \right| _ { \omega = \omega ^ { * } ( \alpha _ { t } ) , \alpha = \alpha _ { t } } = \mathbf { 0 } ,
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
where we use the notation $\nabla _ { { \boldsymbol { \alpha } } , \omega } ^ { 2 } ( \cdot ) ~ \equiv ~ \nabla _ { { \boldsymbol { \alpha } } } ( \nabla _ { \omega } ( \cdot ) )$ throughout the remaining part of this paper. Here, ∇2ωLtrain(ω, α)ω=ω?(α ),α=α is the Hesse matrix corresponding to the optimum $\omega ^ { \star } ( \alpha _ { t } )$ , which is symmetric and positive-definite, and thus invertible. This gives us an estimation that $\nabla _ { \alpha } \omega ^ { \star } ( \alpha ) | _ { \alpha = \alpha _ { t } } = - \left. \nabla _ { \alpha , \omega } ^ { 2 } \mathcal { L } _ { \mathrm { t r a i n } } ( \omega , \alpha ) \right| _ { \omega = \omega ^ { \star } ( \alpha _ { t } ) , \alpha = \alpha _ { t } } \cdot \mathbf { H } ^ { - 1 } .$ . Substituting it into Equation 2 gives:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\begin{array} { r l r } & { } & { \nabla _ { \alpha } \mathcal { L } _ { \mathrm { v a l } } ( \omega ^ { \star } ( \alpha ) , \alpha ) | _ { \alpha = \alpha _ { t } } = \nabla _ { \alpha } \mathcal { L } _ { \mathrm { v a l } } ( \omega , \alpha ) | _ { \omega = \omega ^ { \star } ( \alpha _ { t } ) , \alpha = \alpha _ { t } } - } \\ & { } & { \nabla _ { \alpha , \omega } ^ { 2 } \mathcal { L } _ { \mathrm { t r a i n } } ( \omega , \alpha ) | _ { \omega = \omega ^ { \star } ( \alpha _ { t } ) , \alpha = \alpha _ { t } } \cdot \mathbf { H } ^ { - 1 } \cdot \nabla _ { \omega } \mathcal { L } _ { \mathrm { v a l } } ( \omega , \alpha ) | _ { \omega = \omega ^ { \star } ( \alpha _ { t } ) , \alpha = \alpha _ { t } } . } \end{array}
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
Note that Equation 5 does not involve any approximation. The only issue comes from the term of ${ \bf H } ^ { - 1 }$ , which is computationally intractable due to the large dimensionality of $\mathbf { H }$ (it is related to the number of network parameters, which often exceeds one million in a typical super-network).
|
| 89 |
+
|
| 90 |
+
# 3.4 APPROXIMATIONS IN COMPUTING THE INVERSE HESSE MATRIX
|
| 91 |
+
|
| 92 |
+
Let us denote Equation 5 in an abbreviated form of $\mathbf { g } = \mathbf { g } _ { 1 } + \mathbf { g } _ { 2 }$ , in which $\mathbf { g } _ { 1 }$ , the first-order term of DARTS, is easily computed, while $\mathbf { g } _ { 2 }$ is not due to the computation of ${ \bf H } ^ { - 1 }$ . Here, we propose an alternative solution which constructs an approximation term $\mathbf { g } _ { 2 } ^ { \prime }$ :
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\begin{array} { r } { \mathbf { g } _ { 2 } ^ { \prime } = - \eta \cdot \left. \nabla _ { \alpha , \omega } ^ { 2 } \mathcal { L } _ { \mathrm { t r a i n } } ( \omega , \alpha ) \right| _ { \omega = \omega ^ { * } ( \alpha _ { t } ) , \alpha = \alpha _ { t } } \cdot \mathbf { H } \cdot \left. \nabla _ { \omega } \mathcal { L } _ { \mathrm { v a l } } ( \omega , \alpha ) \right| _ { \omega = \omega ^ { * } ( \alpha _ { t } ) , \alpha = \alpha _ { t } } , } \end{array}
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
where $\eta > 0$ is named the amending coefficient. In what follows, we show that $\mathbf { g } _ { 2 } ^ { \prime }$ is indeed a reasonable approximation of $\mathbf { g } _ { 2 }$ . Since
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\begin{array} { r l } & { \langle \mathbf { g } _ { 2 } ^ { \prime } , \mathbf { g } _ { 2 } \rangle = \boldsymbol { \eta } \cdot \left. \nabla _ { \omega } \mathcal { L } _ { \mathrm { v a l } } ( \omega , \alpha ) \right| _ { \omega = \omega ^ { \star } ( \alpha _ { t } ) , \alpha = \alpha _ { t } } \boldsymbol { \mathsf { T } } \cdot \left. \mathbf { H } ^ { - 1 } \cdot \nabla _ { \omega , \alpha } ^ { 2 } \mathcal { L } _ { \mathrm { t r a i n } } ( \omega , \alpha ) \right| _ { \omega = \omega ^ { \star } ( \alpha _ { t } ) , \alpha = \alpha _ { t } } \cdot } \\ & { \qquad \nabla _ { \alpha , \omega } ^ { 2 } \mathcal { L } _ { \mathrm { t r a i n } } ( \omega , \alpha ) \big | _ { \omega = \omega ^ { \star } ( \alpha _ { t } ) , \alpha = \alpha _ { t } } \cdot \mathbf { H } \cdot \nabla _ { \omega } \mathcal { L } _ { \mathrm { v a l } } ( \omega , \alpha ) \big | _ { \omega = \omega ^ { \star } ( \alpha _ { t } ) , \alpha = \alpha _ { t } } , } \end{array}
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
the product of the two terms between ${ \bf H } ^ { - 1 }$ and $\mathbf { H }$ is a semi-positive-definite matrix, and so is the matrix after similarity transformation, which directly gives $\left. \mathbf { g } _ { 2 } ^ { \prime } , \mathbf { g } _ { 2 } \right. \geqslant 0$ .
|
| 105 |
+
|
| 106 |
+
In summary, we decompose the gradient of architectural parameters into two terms, $\mathbf { g } _ { 1 }$ and $\mathbf { g } _ { 2 }$ , compute $\mathbf { g } _ { 1 }$ directly and use an approximation to $\mathbf { g } _ { 2 }$ so that the angle between the accurate and approximated terms is smaller than 90 degrees. In comparison, existing DARTS-based approaches either discarded $\mathbf { g } _ { 2 }$ entirely or used a mathematically non-explainable approximation $\mathbf { \bar { g } } _ { 2 } ^ { \prime \prime } = \mathbf { \bar { \nu } } \eta \cdot \nabla _ { \alpha , \omega } ^ { 2 } \mathcal { L } _ { \mathrm { t r a i n } } ( \omega , \mathbf { \bar { \alpha } } ) | _ { \omega = \omega ^ { * } ( \alpha _ { t } ) , \alpha = \alpha _ { t } } \cdot \mathbf { I } \cdot \nabla _ { \omega } \mathcal { L } _ { \mathrm { v a l } } ( \omega , \mathbf { \bar { \alpha } } ) | _ { \omega = \omega ^ { * } ( \alpha _ { t } ) , \alpha = \alpha _ { t } } .$ . None of them are reasonable because $\mathbf { g } _ { 2 }$ can be large, yet there is no guarantee that $\left. \mathbf { g } _ { 2 } ^ { \prime \prime } , \mathbf { g } _ { 2 } \right. \geqslant 0$ , i.e., the secondorder DARTS can lead the algorithm to a wrong direction.
|
| 107 |
+
|
| 108 |
+
The rationality of our approach is also verified by the validation process, i.e., in updating architectural parameters. The first-order DARTS, by directly discarding $\mathbf { g } _ { 2 }$ , reported an average validation accuracy of $9 0 . 5 \%$ in search space $S _ { 1 }$ (see Section 4.1.3) on the CIFAR10 dataset. The second-order DARTS added $\mathbf { g } _ { 2 } ^ { \prime \prime }$ , which has no guarantee that $\left. { { \bf { g } } _ { 2 } ^ { \prime \prime } , { \bf { g } } _ { 2 } } \right. \mathrm { ~ \ \ \geqslant ~ 0 ~ }$ , and thus resulted in a reduced validation accuracy. Our approach, by adding $\mathbf { g } _ { 2 } ^ { \prime }$ , achieves a validation accuracy of $9 1 . 5 \%$ , implying that our optimization works better than DARTS. This eventually results in the advantage of searched architectures, which will be verified in Section 4.1.2.
|
| 109 |
+
|
| 110 |
+
The remainder part of computing $\mathbf { g } _ { 2 } ^ { \prime }$ simply follows conventions, which we replace $\omega ^ { \star } ( \alpha )$ with the current $\omega ^ { \mathrm { e s t } }$ as the most accurate approximation we can get2. Computing ${ \bf g } _ { 2 } ^ { \bar { \prime } }$ with Equation 6 requires both ∇2α,ωLtrain(ω, α)ω=ω?(αt),α=αt and $\nabla _ { \omega } \mathcal { L } _ { \mathrm { v a l } } ( \omega , \alpha ) | _ { \omega = \omega ^ { \star } ( \alpha _ { t } ) , \alpha = \alpha _ { t } }$ , while DARTS needs the former one with $\omega ^ { \star } ( \alpha _ { t } )$ estimated in two steps. Therefore, computing Equation 6 requires similar computational overhead compared to the second-order version of DARTS. In experiments, each search epoch requires around 0.02 GPU-days on the standard 8-cell space on CIFAR10.
|
| 111 |
+
|
| 112 |
+
# 3.5 DISCUSSIONS AND RELATIONSHIP TO PRIOR WORK
|
| 113 |
+
|
| 114 |
+
The core benefit brought by our approach is the consistency between search and evaluation. This is indeed a fundamental idea of NAS, but it was ignored by existing approaches since they have been perplexed by a more significant error caused by inaccurate optimization. After the error, we point out a few prior conventions that need to be adjusted accordingly, including using different depths (e.g., DARTS used 8 cells in search and 20 cells in evaluation) and widths (e.g., DARTS used a basic channel number of 16 in search and 36 in evaluation) during search and evaluation, as well as using different training strategies (e.g., during re-training, a few regularization techniques including Cutout (DeVries & Taylor, 2017), Dropout (Srivastava et al., 2014) and auxiliary loss were used, but none of them appeared in search). More importantly, the search process was followed by edge removal (8 out of 14 connections were preserved) which caused a significant difference between the network architectures of search and evaluation. Our approach provides the opportunity to bridge the gap between search and evaluation, which we will show in Section 4.1.2 that unifying these hyper-parameters leads to better performance.
|
| 115 |
+
|
| 116 |
+
A few prior differentiable search approaches noticed the issue of instability, but they chose to solve it in different manners. For example, P-DARTS (Chen et al., 2019) fixed the number of preserved skip-connect operators, PC-DARTS (Xu et al., 2019) used edge normalization to eliminate the none operator, while XNAS (Nayman et al., 2019) and DARTS $^ { + }$ (Liang et al., 2019) introduced a few human expertise to stabilize search. However, we point out that (i) either P-DARTS or PC-DARTS, with carefully designed methods or tricks, can also fail in a sufficiently long search process (more than 200 epochs); and that (ii) XNAS and DART $\vdots +$ , by adding human expertise, somewhat violated the design nature of AutoML, in which one is expected to avoid introducing too many hand-designed rules.
|
| 117 |
+
|
| 118 |
+
Another line of NAS, besides differentiable methods, is to use either reinforcement learning or an evolutionary algorithm as a controller of heuristic search and train each sampled network to get some kind of rewards, e.g., validation accuracy. In the viewpoint of optimization, this pipeline mainly differs from the differentiable one in that optimizing $_ { \pmb { \alpha } }$ is decoupled from optimizing $\omega$ , so that it does not require $\omega$ to arrive at $\omega ^ { \ast }$ , but only need a reasonable approximation of $\omega ^ { \ast }$ to predict model performance – this is an important reason that such algorithms often produce stable results. Our approach sheds light on introducing a similar property, i.e., robustness to approximated $\omega ^ { \star }$ , which helps in stabilizing differentiable search approaches.
|
| 119 |
+
|
| 120 |
+
# 4 EXPERIMENTS
|
| 121 |
+
|
| 122 |
+
# 4.1 RESULTS ON CIFAR10
|
| 123 |
+
|
| 124 |
+
The CIFAR10 dataset (Krizhevsky & Hinton, 2009) has 50,000 training and 10,000 testing images, sized $3 2 \times 3 2$ , and equally distributed over 10 classes. We mainly use this dataset to evaluate the stability of our approach, as well as analyze the impacts of different search options and parameters.
|
| 125 |
+
|
| 126 |
+
# 4.1.1 IMPACT OF THE AMENDING COEFFICIENT
|
| 127 |
+
|
| 128 |
+
We first investigate how the amending coefficient, $\eta$ , defined in Equation 6, impacts architecture search. We search and re-train similarly as DARTS. During the search, all operators are assigned equal weights on each edge. We use a base channel number of 16, and a batch size of 96. An Adam optimizer is used to update architectural parameters, with a learning rate of 0.0003, a weight decay of 0.001 and a momentum of (0.5, 0.999). The number of epochs is to be discussed later. During re-training, the base channel number is increased to 36. An SGD optimizer is used with an initial learning rate of 0.025, decaying following the cosine annealing rule and arriving at 0 after 600 epochs. The weight decay is set to be 0.0003, and the momentum is 0.9.
|
| 129 |
+
|
| 130 |
+
To arrive at convergence, we run the search stage for 500 epochs. We evaluate different $\eta$ values from 0 to 1, and the architectures corresponding to $\eta = 0$ (equivalent to DARTS), $\eta = 0 . 1$ and $\eta = 1$ are summarized in Figure 2. We can see that $\eta = 0 . 1$ converges, after 500, into a reasonable architecture that achieves an error rate of $3 . 0 8 \%$ on CIFAR10. We emphasize that, even with more search epochs, this architecture is not likely to change, as the preserved operator on each edge has a weight not smaller than 0.5, and most of these weights are still growing gradually.
|
| 131 |
+
|
| 132 |
+
When $\eta$ is very small, e.g., $\eta = 0 . 0 0 1$ or $\eta = 0 . 0 1$ , the change brought by this amending term to architecture search is ignorable, and our approach shows almost the same behavior as the first-order version of DARTS, i.e., $\eta = 0$ . In addition, when $\eta$ grows up, e.g., from 0.001 to 0.01, although the search process eventually runs into an architecture with all skip-connect operators, the number of epochs needed for a complete failure is significantly postponed, which verifies that the amending term indeed pulls architecture search away from the gradient trap.
|
| 133 |
+
|
| 134 |
+

|
| 135 |
+
Figure 2: Normal (left) and reduction (right) cells (the standard DARTS space) obtained by different amending coefficients, namely, $\eta = 0$ (top), $\eta = 0 . 1$ (middle) and $\eta = 1$ (bottom).
|
| 136 |
+
|
| 137 |
+
On the other hand, if we use a sufficiently large $\eta$ value, e.g., $\eta = 1$ , the amending term, $\mathbf { g } _ { 2 } ^ { \prime }$ , can dominate optimization, so that the first term, i.e., the gradient of architectural parameters, has limited effects in updating $_ \alpha$ . Note that the amending term is closely related to network regularization, therefore, in the scenarios of a large $\eta$ , the network significantly prefers avg-pooling to other operators, as avg-pooling can smooth feature maps and avoid over-fitting. However, avg-pooling is also a parameter-free operator, so the performance of such architectures is also below satisfaction.
|
| 138 |
+
|
| 139 |
+
Following these analyses, we simply use $\eta = 0 . 1$ for all later experiments. We do not tune $\eta$ very carefully, though it is possible to determine $\eta$ automatically using a held-out validation set. Besides, we find that the best architecture barely changes after 100 search epochs, which we fix the total length to be 100 epochs in all remaining experiments.
|
| 140 |
+
|
| 141 |
+
# 4.1.2 CONSISTENCY BETWEEN SEARCH AND EVALUATION
|
| 142 |
+
|
| 143 |
+
As discussed in Section 3.5, it is important to alleviate the difference between search and evaluation. We make the following modifications, listed from most to least important. First, to avoid edge removal, we fix the edges in each cell, so that each node $i$ is connected to node $i - 1$ and the least indexed node (denoted by $c _ { k - 2 }$ in most conventions), resulting in 8 edges in each cell. Note that our approach also works well with all 14 edges preserved, but we have used 8 edges to be computationally fair to DARTS. Second, we unify the width (the number of basic channels) as 36 for both search and evaluation. Third, we add normalization techniques, including Cutout (DeVries & Taylor, 2017), Dropout (Srivastava et al., 2014) and an auxiliary loss tower, into the search stage.
|
| 144 |
+
|
| 145 |
+
We use the amending coefficient $\eta = 0 . 1$ learned from previous experiments, i.e., without modification, the searched architecture, denoted by $\mathbb { A } _ { \mathrm { o r i g } }$ , is shown in the middle column of Figure 2. After modification, the obtained architecture, denoted by $\mathbb { A } _ { \mathrm { n e w } }$ , is shown in Figure 3. We re-train both networks on CIFAR10, with or without the option that stacking duplicate cells to make the network deeper (with 20 cells). With a standard re-training process, $\mathbb { A } _ { \mathrm { o r i g } }$ reports a $3 . 6 7 \%$ error with 8 cells, and a $3 . 0 8 \%$ error with 20 cells; and the corresponding numbers are $3 . 2 0 \%$ and $2 . 8 1 \%$ for $\mathbb { A } _ { \mathrm { n e w } }$ . We find that $\mathbb { A } _ { \mathrm { n e w } }$ is consistently better than $\mathbb { A } _ { \mathrm { o r i g } }$ , which suggests that alleviating the gap indeed helps. This also reminds us of the significant depth gap (Chen et al., 2019) between search and re-training (the network has 8 cells in search, but 20 cells in re-training), and this gap also obstructs our approach from achieving better performance. We will investigate this issue in the following part.
|
| 146 |
+
|
| 147 |
+
# 4.1.3 EXPLORING MORE COMPLEX SEARCH SPACES
|
| 148 |
+
|
| 149 |
+
We note tremendous efforts made by existing approaches to alleviate the depth gap, while our solution is a direct one, thanks to the stability of our approach which enables us to directly explore larger search spaces. Here, we denote the original search space used in DARTS as $S _ { 1 }$ , which has six normal cells and two reduction cells, and all normal cells share the same set of architectural parameters and so do the reduction cells. Note that we have fixed the edges in this space, resulting in the total number of possible architectures to reduce from $1 . 1 \times 1 0 ^ { 1 8 }$ to $3 . 3 \times 1 0 ^ { 1 \bar { 3 } }$ . We also explore a more complex search space, denoted by $S _ { 2 }$ , in which we relax the constraint that either normal cells or reduction cells should be the same, and also the number of cells increases from 8 to 20, to be applied in re-training. Here, limited by GPU memory, we cannot support all seven operators to be searched, so we only choose two, namely skip-connect and sep-conv- $3 x 3$ , which have very different properties. This setting allows a total of $1 . 5 \times 1 0 ^ { 4 8 }$ architectures to appear, much larger than $S _ { 1 }$ .
|
| 150 |
+
|
| 151 |
+
Results are listed in Table 1. In $S _ { 1 }$ , our approach achieves a moderate error rate of $2 . 8 1 \%$ , mainly because the assumption of consistency between search and re-training does not hold. In $S _ { 2 }$ , with directly searching in deep architectures, our result is significantly boosted (an error rate of $2 . 6 0 \%$ , the architecture is shown in the middle row of Figure 3). Again, we emphasize that we report retraining results based on an converged architecture, which stands out from existing DARTS-based approaches which required early termination.
|
| 152 |
+
|
| 153 |
+
In $S _ { 2 }$ , we compare our approach against both DARTS (no amending term) and random search. We observe that DARTS produces weird architectures (the bottom row of Figure 3), that high-layer cells are mostly occupied by skip-connect, which is not likely to fully utilize the ability of the supernetwork. Regarding random search, we follow DARTS by randomly sampling 20 valid architectures from each of $S _ { 1 }$ and $S _ { 2 }$ , and using a small validation dataset to choose the best two architectures for re-training. Given a fixed number of probes, it becomes more and more difficult to sufficiently explore a large space. The deficits of DARTS and random search on CIFAR10 are $0 . 2 5 \%$ and $0 . { \bar { 2 } } 9 \%$ , respectively, which do not seem to be very large arguably because CIFAR10 is relatively easy and our edge-fixed search space guarantees sufficient depth. However, when we transfer these architectures to ImageNet, the deficits become much larger, i.e., with $1 . 7 \%$ and $0 . 8 \%$ top-1 accuracy drops, respectively (DARTS produces inferior performance to random search). These results remind us of prior work (Xie et al., 2019) which claimed that random search works sufficiently well in large search spaces. Here, we leave a comment on this debate, demonstrating that a large space indeed raises challenges to architecture search, but a stabilized search algorithm still has the ability of to find more powerful architectures.
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Figure 3: Top: normal and reduction cells found in $ { \boldsymbol { S } } _ { 1 }$ . Middle & Bottom: the overall architecture found in $S _ { 2 }$ by DARTS, with and without the amended term, in which red and blue edges indicate skip-connect and sep-conv- $. 3 x 3$ operators, respectively.
|
| 157 |
+
|
| 158 |
+
# 4.1.4 COMPARISON TO THE STATE-OF-THE-ARTS
|
| 159 |
+
|
| 160 |
+
Finally, we compare our approach with recent approaches, in particular, differentiable ones. Result are shown in Table 1. Our approach produces competitive results among state-of-the-arts, although it does not seem to beat others. We note that existing approaches often used additional tricks, e.g., PDARTS assumed a fixed number of skip-connect operators, which shrinks the search space (so as to guarantee stability). More importantly, all these differentiable search approaches must be terminated in an early stage, which makes them less convincing as search has not arrived at convergence. These tricks somewhat violate the ideology of neural architecture search; in comparison, our research, though not producing the best performance, seems going along a correct and promising direction.
|
| 161 |
+
|
| 162 |
+
<table><tr><td rowspan="2">Architecture</td><td>Test Err.</td><td>Params</td><td>Search Cost</td><td rowspan="2">Search Method</td></tr><tr><td>(%)</td><td>(M)</td><td>(GPU-days)</td></tr><tr><td>DenseNet-BC (Huang et al.,2017)</td><td>3.46</td><td>25.6</td><td>-</td><td>manual</td></tr><tr><td>ENAS (Pham et al.,2018) w/ Cutout</td><td>2.89</td><td>4.6</td><td>0.5</td><td>RL</td></tr><tr><td>NASNet-A (Zoph et al.,2018) w/Cutout</td><td>2.65</td><td>3.3</td><td>1800</td><td>RL</td></tr><tr><td>NAONet-WS (Luo et al.,2018)</td><td>3.53</td><td>3.1</td><td>0.4</td><td>NAO</td></tr><tr><td>Hireachical Evolution (Liu et al.,2018b)</td><td>3.75±0.12</td><td>15.7</td><td>300</td><td>evolution</td></tr><tr><td>AmoebaNet-B (Real et al.,2019) w/ Cutout</td><td>2.55±0.05</td><td>2.8</td><td>3150</td><td>evolution</td></tr><tr><td>PNAS (Liu et al., 2018a)</td><td>3.41±0.09</td><td>3.2</td><td>225</td><td>SMBO</td></tr><tr><td>DARTS (first-order) (Liu et al.,2019b) w/ Cutout</td><td>3.00±0.14</td><td>3.3</td><td>0.4</td><td>gradient-based</td></tr><tr><td>DARTS (second-order) (Liu et al.,20i9b) w/Cutout</td><td>2.76±0.09</td><td>3.3</td><td>1.0</td><td>gradient-based</td></tr><tr><td>SNAS (moderate) (Xie etal.,2018) w/ Cutout</td><td>2.85±0.02</td><td>2.8</td><td>1.5</td><td>gradient-based</td></tr><tr><td>ProxylessNAS (Cai et al.,2019) w/Cutout</td><td>2.08</td><td>-</td><td>4.0</td><td>gradient-based</td></tr><tr><td>P-DARTS (Chen et al.,2019) w/ Cutout</td><td>2.50</td><td>3.4</td><td>0.3</td><td>gradient-based</td></tr><tr><td>BayesNAS (Zhou et al.,2019) w/ Cutout</td><td>2.81±0.04</td><td>3.4</td><td>0.2</td><td>gradient-based</td></tr><tr><td>PC-DARTS (Xu et al.,2019) w/ Cutout</td><td>2.57±0.07</td><td>3.6</td><td>0.1</td><td>gradient-based</td></tr><tr><td>Amended-DARTS,S1,w/Cutout</td><td>2.81±0.21</td><td>3.5</td><td>1.0</td><td>gradient-based</td></tr><tr><td>Amended-DARTS,S2,w/Cutout</td><td>2.60±0.15</td><td>3.6</td><td>1.1</td><td>gradient-based</td></tr></table>
|
| 163 |
+
|
| 164 |
+
Table 1: Comparison with state-of-the-art network architectures on CIFAR10.
|
| 165 |
+
|
| 166 |
+
<table><tr><td rowspan="2">Architecture</td><td colspan="2">Test Err. (%)</td><td rowspan="2">Params (M)</td><td rowspan="2">×+ (M)</td><td rowspan="2">Search Cost (GPU-days)</td><td rowspan="2">Search Method</td></tr><tr><td>top-1</td><td>top-5</td></tr><tr><td>Inception-v1 (Szegedy et al.,2015)</td><td>30.2</td><td>10.1</td><td>6.6</td><td>1448</td><td>-</td><td>manual</td></tr><tr><td>MobileNet (Howard etal.,2017)</td><td>29.4</td><td>10.5</td><td>4.2</td><td>569</td><td></td><td>manual</td></tr><tr><td>ShuffleNet 2× (v1) (Zhang et al.,2018)</td><td>26.4</td><td>10.2</td><td>~5</td><td>524</td><td></td><td>manual</td></tr><tr><td>ShuffleNet 2× (v2) (Ma et al.,2018)</td><td>25.1</td><td>-</td><td>~5</td><td>591</td><td>-</td><td>manual</td></tr><tr><td>NASNet-A (Zoph et al., 2018)</td><td>26.0</td><td>8.4</td><td>5.3</td><td>564</td><td>1800</td><td>RL</td></tr><tr><td>MnasNet-92 (Tan et al.,2019)</td><td>25.2</td><td>8.0</td><td>4.4</td><td>388</td><td>-</td><td>RL</td></tr><tr><td>PNAS (Liu et al., 2018a)</td><td>25.8</td><td>8.1</td><td>5.1</td><td>588</td><td>225</td><td>SMBO</td></tr><tr><td>AmoebaNet-C (Real et al.,2019)</td><td>24.3</td><td>7.6</td><td>6.4</td><td>570</td><td>3150</td><td>evolution</td></tr><tr><td>DARTS (second-order) (Liu et al.,2019b)</td><td>26.7</td><td>8.7</td><td>4.7</td><td>574</td><td>4.0</td><td>gradient-based</td></tr><tr><td>SNAS (mild) (Xie et al., 2018)</td><td>27.3</td><td>9.2</td><td>4.3</td><td>522</td><td>1.5</td><td>gradient-based</td></tr><tr><td>BayesNAS (Zhou et al.,2019)</td><td>26.5</td><td>8.9</td><td>3.9</td><td>-</td><td>0.2</td><td>gradient-based</td></tr><tr><td>P-DARTS (CIFAR10) (Chen et al.,2019)</td><td>24.4</td><td>7.4</td><td>4.9</td><td>557</td><td>0.3</td><td>gradient-based</td></tr><tr><td>ProxylessNAS (GPU) (Cai et al., 2019)</td><td>24.9</td><td>7.5</td><td>7.1</td><td>465</td><td>8.3</td><td>gradient-based</td></tr><tr><td>PC-DARTS (Xu et al., 2019)‡</td><td>24.2</td><td>7.3</td><td>5.3</td><td>597</td><td>3.8</td><td>gradient-based</td></tr><tr><td>DARTS+ (Liang et al., 2019)‡</td><td>23.9</td><td>7.4</td><td>5.1</td><td>582</td><td>6.8</td><td>gradient-based</td></tr><tr><td>Amended-DARTS, S2</td><td>24.3</td><td>7.4</td><td>5.5</td><td>590</td><td>1.1</td><td>gradient-based</td></tr></table>
|
| 167 |
+
|
| 168 |
+
Table 2: Comparison with state-of-the-art architectures on ILSVRC2012. All searched architectures are fit into the mobile setting. ‡ indicates architectures searched on ImageNet.
|
| 169 |
+
|
| 170 |
+
# 4.2 RESULTS ON ILSVRC2012
|
| 171 |
+
|
| 172 |
+
ILSVRC2012 (Russakovsky et al., 2015) is the most commonly used subset of ImageNet (Deng et al., 2009). It contains 1.3M training images and 50K testing images, which are almost evenly distributed over all 1,000 categories. We directly use the $S _ { 2 }$ architecture obtained from CIFAR10 experiments and enlarge it with a basic number of channels of 42, so that the FLOPs of our model is 590M, i.e., fitting the mobile setting. During re-training, there are a total of 250 epochs. We use an SGD optimizer with an initial learning rate of 0.5 (decaying linearly after each epoch), a momentum of 0.9 and a weight decay of $3 \times 1 0 ^ { - 5 }$ . On NVIDIA Tesla V100 GPUs, the entire re-training process takes around 24 GPU-days.
|
| 173 |
+
|
| 174 |
+
The comparison of our approach to existing approaches is shown in Table 2. Our approach achieves a top-1 error rate of $2 4 . { \bar { 3 } } \bar { \% }$ without any common optimization tricks such as AutoAugment (Cubuk et al., 2019) and Squeeze-and-Excitation modules (Hu et al., 2018). This result is competitive among state-of-the-arts, and it is obtained after convergence is achieved in the search stage. On the other hand, without the amending term, DARTS converges to a solution that skip-connected and sep-conv$3 x 3$ are largely separated, on which the re-training performance is even inferior to random search.
|
| 175 |
+
|
| 176 |
+
# 5 CONCLUSIONS
|
| 177 |
+
|
| 178 |
+
In this paper, we present an effective approach for stabilizing differentiable neural architecture search. Our motivation comes from that DARTS-based approaches mostly generate all-skip-connect architectures when they are executed for a sufficient number of epochs. We analyze this weird phenomenon mathematically and find the reason to lie in the dramatic inaccuracy in estimating gradients of architectural parameters. With an alternative approximation based on the optimality of network parameters, we guarantee the update of architectural parameters to be in a correct direction. In DARTS-based search spaces on CIFAR10 and ImageNet, our approach shows improved stability, in particular in large search spaces, as well as improved performance in the re-training stage.
|
| 179 |
+
|
| 180 |
+
Our research sheds light on future research on NAS in several aspects. First, we reveal that previous differentiable approaches were mostly built upon a dangerous pipeline, and mostly introduced heavy human expertise to avoid failure. By fixing the ‘system error’ of this pipeline, we provide a platform that NAS approaches can compete in the ability of NAS. Second, our approach enables researchers to explore even bigger search spaces that have not been studied before (due to search instability).
|
| 181 |
+
|
| 182 |
+
REFERENCES
|
| 183 |
+
H. Cai, T. Chen, W. Zhang, Y. Yu, and J. Wang. Efficient architecture search by network transformation. In AAAI Conference on Artificial Intelligence, 2018.
|
| 184 |
+
H. Cai, L. Zhu, and S. Han. Proxylessnas: Direct neural architecture search on target task and hardware. 2019.
|
| 185 |
+
X. Chen, L. Xie, J. Wu, and Q. Tian. Progressive differentiable architecture search: Bridging the depth gap between search and evaluation. In International Conference on Computer Vision, 2019.
|
| 186 |
+
E. D. Cubuk, B. Zoph, D. Mane, V. Vasudevan, and Q. V. Le. Autoaugment: Learning augmentation policies from data. In Computer Vision and Pattern Recognition, 2019.
|
| 187 |
+
J. Deng, W. Dong, R. Socher, L. J. Li, K. Li, and L. Fei-Fei. Imagenet: A large-scale hierarchical image database. In Computer Vision and Pattern Recognition, 2009.
|
| 188 |
+
T. DeVries and G. W. Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017.
|
| 189 |
+
G. Ghiasi, T. Y. Lin, and Q. V. Le. Nas-fpn: Learning scalable feature pyramid architecture for object detection. In Computer Vision and Pattern Recognition, 2019.
|
| 190 |
+
Z. Guo, X. Zhang, H. Mu, W. Heng, Z. Liu, Y. Wei, and J. Sun. Single path one-shot neural architecture search with uniform sampling. arXiv preprint arXiv:1904.00420, 2019.
|
| 191 |
+
K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Computer Vision and Pattern Recognition, 2016.
|
| 192 |
+
A. G. Howard, M. Zhu, B. Chen, D. Kalenichenko, W. Wang, T. Weyand, M. Andreetto, and H. Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017.
|
| 193 |
+
J. Hu, L. Shen, and G. Sun. Squeeze-and-excitation networks. In Computer Vision and Pattern Recognition, 2018.
|
| 194 |
+
G. Huang, Z. Liu, L. Van Der Maaten, and K. Q. Weinberger. Densely connected convolutional networks. In Computer Vision and Pattern Recognition, 2017.
|
| 195 |
+
A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems, 2012.
|
| 196 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, 2009.
|
| 197 |
+
Y. LeCun, Y. Bengio, and G. E. Hinton. Deep learning. Nature, 521(7553):436, 2015.
|
| 198 |
+
H. Liang, S. Zhang, J. Sun, X. He, W. Huang, K. Zhuang, and Z. Li. Darts+: Improved differentiable architecture search with early stopping. arXiv preprint arXiv:1909.06035, 2019.
|
| 199 |
+
C. Liu, B. Zoph, M. Neumann, J. Shlens, W. Hua, L. J. Li, L. Fei-Fei, A. L. Yuille, J. Huang, and K. Murphy. Progressive neural architecture search. In European Conference on Computer Vision, 2018a.
|
| 200 |
+
C. Liu, L. C. Chen, F. Schroff, H. Adam, W. Hua, A. L. Yuille, and L. Fei-Fei. Auto-deeplab: Hierarchical neural architecture search for semantic image segmentation. In Computer Vision and Pattern Recognition, 2019a.
|
| 201 |
+
H. Liu, K. Simonyan, O. Vinyals, C. Fernando, and K. Kavukcuoglu. Hierarchical representations for efficient architecture search. In International Conference on Learning Representations, 2018b.
|
| 202 |
+
H. Liu, K. Simonyan, and Y. Yang. Darts: Differentiable architecture search. In International Conference on Learning Representations, 2019b.
|
| 203 |
+
R. Luo, F. Tian, T. Qin, E. Chen, and T. Y. Liu. Neural architecture optimization. In Advances in Neural Information Processing Systems, 2018.
|
| 204 |
+
N. Ma, X. Zhang, H. T. Zheng, and J. Sun. Shufflenet v2: Practical guidelines for efficient cnn architecture design. In European Conference on Computer Vision, 2018.
|
| 205 |
+
N. Nayman, A. Noy, T. Ridnik, I. Friedman, R. Jin, and L. Zelnik-Manor. Xnas: Neural architecture search with expert advice. arXiv preprint arXiv:1906.08031, 2019.
|
| 206 |
+
A. Noy, N. Nayman, T. Ridnik, N. Zamir, S. Doveh, I. Friedman, R. Giryes, and L. Zelnik-Manor. Asap: Architecture search, anneal and prune. arXiv preprint arXiv:1904.04123, 2019.
|
| 207 |
+
H. Pham, M. Guan, B. Zoph, Q. V. Le, and J. Dean. Efficient neural architecture search via parameter sharing. In International Conference on Machine Learning, 2018.
|
| 208 |
+
E. Real, S. Moore, A. Selle, S. Saxena, Y. L. Suematsu, J. Tan, Q. V. Le, and A. Kurakin. Large-scale evolution of image classifiers. In International Conference on Machine Learning, 2017.
|
| 209 |
+
E. Real, A. Aggarwal, Y. Huang, and Q. V. Le. Regularized evolution for image classifier architecture search. In AAAI Conference on Artificial Intelligence, 2019.
|
| 210 |
+
O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, et al. Imagenet large scale visual recognition challenge. International Journal of Computer Vision, 115(3):211–252, 2015.
|
| 211 |
+
N. Srivastava, G. E. Hinton, A. Krizhevsky, I. Sutskever, and R. Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15(1): 1929–1958, 2014.
|
| 212 |
+
C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. In Computer Vision and Pattern Recognition, 2015.
|
| 213 |
+
M. Tan and Q. V. Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In International Conference on Machine Learning, 2019.
|
| 214 |
+
M. Tan, B. Chen, R. Pang, V. Vasudevan, M. Sandler, A. Howard, and Q. V. Le. Mnasnet: Platformaware neural architecture search for mobile. In Computer Vision and Pattern Recognition, 2019.
|
| 215 |
+
L. Xie and A. L. Yuille. Genetic CNN. In International Conference on Computer Vision, 2017.
|
| 216 |
+
S. Xie, H. Zheng, C. Liu, and L. Lin. SNAS: Stochastic neural architecture search. arXiv preprint arXiv:1812.09926, 2018.
|
| 217 |
+
S. Xie, A. Kirillov, R. Girshick, and K. He. Exploring randomly wired neural networks for image recognition. In International Conference on Computer Vision, 2019.
|
| 218 |
+
Y. Xu, L. Xie, X. Zhang, X. Chen, G. J. Qi, Q. Tian, and H. Xiong. Pc-darts: Partial channel connections for memory-efficient differentiable architecture search. arXiv preprint arXiv:1907.05737, 2019.
|
| 219 |
+
X. Zhang, X. Zhou, M. Lin, and J. Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. In Computer Vision and Pattern Recognition, 2018.
|
| 220 |
+
H. Zhou, M. Yang, J. Wang, and W. Pan. Bayesnas: A bayesian approach for neural architecture search. arXiv preprint arXiv:1905.04919, 2019.
|
| 221 |
+
B. Zoph and Q. V. Le. Neural architecture search with reinforcement learning. In International Conference on Learning Representations, 2017.
|
| 222 |
+
B. Zoph, V. Vasudevan, J. Shlens, and Q. V. Le. Learning transferable architectures for scalable image recognition. In Computer Vision and Pattern Recognition, 2018.
|
| 223 |
+
|
| 224 |
+
# A APPENDIX
|
| 225 |
+
|
| 226 |
+
# A.1 A TOY EXAMPLE TO SHOW THE IMPORTANCE OF $\mathbf { g } _ { 2 }$
|
| 227 |
+
|
| 228 |
+
Let the loss function be $\begin{array} { l l l } { { \mathcal L } \left( \omega , \alpha ; x \right) } & { = } & { \left( \omega x - \alpha \right) ^ { 2 } } \end{array}$ . Then, the only difference between $\mathcal { L } _ { \mathrm { t r a i n } } \left( \omega , \alpha \right) = \mathcal { L } \left( \omega , \alpha ; x _ { \mathrm { t r a i n } } \right)$ and $\mathcal { L } _ { \mathrm { v a l i d } } \left( \omega , \alpha \right) = \mathcal { L } \left( \omega , \alpha ; x _ { \mathrm { v a l i d } } \right)$ lies in the input, $_ { \textbf { \em x } }$ . Assume the input of training data is ${ x } _ { \mathrm { t r a i n } } = 1$ and the input validation data is $\pmb { x } _ { \mathrm { v a l i d } } = 2$ . It is easy to derive that the local optimum of $\mathcal { L } _ { \mathrm { t r a i n } } \left( \omega , \alpha \right)$ is $\omega ^ { \ast } \left( \alpha \right) = \alpha$ . Substituting $\pmb { x } _ { \mathrm { v a l i d } } = 2$ into $\mathcal { L } _ { \mathrm { v a l i d } } \left( \omega , \alpha \right)$ yields ${ \mathcal { L } } _ { \mathrm { v a l i d } } \left( \omega , \alpha \right) = \left( 2 \omega - \alpha \right) ^ { 2 }$ . When $\mathbf { \alpha } _ { \alpha } = \mathbf { \alpha } _ { \mathbf { \alpha } _ { \mathbf { t } } }$ , $\omega$ arrives at $\omega ^ { \ast } \left( \alpha _ { \mathrm { t } } \right)$ , so $\mathbf { g } _ { 1 } = 2 \left( \alpha _ { \mathrm { t } } - 2 \alpha _ { \mathrm { t } } \right) = - 2 \alpha _ { \mathrm { t } }$ and $\mathbf { g } _ { 2 } = 4 \alpha _ { \mathrm { t } }$ . When $\omega$ arrives at ${ { \omega } ^ { * } } \left( \alpha \right) , { { \mathcal { L } } _ { v a l i d } } \left( { { \omega } ^ { * } } \left( \alpha \right) , \alpha \right) = { { \alpha } ^ { 2 } }$ , $\mathbf { g } \left( \alpha _ { \mathrm { t } } \right) = 2 \alpha _ { \mathrm { t } } = \mathbf { g } _ { 1 } + \mathbf { g } _ { 2 }$ . In summary, both $\mathbf { g } _ { 1 }$ and $\mathbf { g } _ { 2 }$ are important, but DARTS chose to ignore $\mathbf { g } _ { 2 }$ which can cause a dramatic error in approximation.
|
| 229 |
+
|
| 230 |
+
# A.2 THE COMPLEXITY OF $\mathbf { g } _ { 2 } ^ { ' }$ CAN BE SUBSTANTIALLY REDUCED USING THE FINITEDIFFERENCE APPROXIMATION
|
| 231 |
+
|
| 232 |
+
We use the finite difference approximation just like DARTS. Let $\epsilon$ be a small scalar, $\omega _ { 1 } \ = \ \omega + \epsilon \nabla _ { \omega } \mathcal { L } _ { \mathrm { v a l } } ( \omega , \alpha )$ , $\omega _ { 2 } ~ = ~ \omega - \epsilon \nabla _ { \omega } \mathcal { L } _ { \mathrm { v a l } } ( \omega , \alpha )$ . Then: $\begin{array} { r l } { \mathbf { H } \cdot \nabla _ { \omega } \mathcal { L } _ { \mathrm { v a l } } ( \omega , \alpha ) } & { = } \end{array}$ $\frac { \nabla _ { \omega } \mathcal { L } _ { \mathrm { t r a i n } } ( \omega _ { 1 } , \alpha ) - \nabla _ { \omega } \mathcal { L } _ { \mathrm { t r a i n } } ( \omega _ { 2 } , \alpha ) } { \mathrm { . } }$ . $\begin{array} { r l r } { \omega _ { 3 } } & { { } = } & { \omega \ + \ \frac { \nabla _ { \omega } \mathcal { L } _ { \mathrm { t r a i n } } ( \omega _ { 1 } , \alpha ) - \nabla _ { \omega } \mathcal { L } _ { \mathrm { t r a i n } } ( \omega _ { 2 } , \alpha ) } { 2 } } \end{array}$ , $\omega _ { 4 } = \omega - \frac { } { }$ 2 . Then: $\frac { \nabla _ { \omega } \mathcal { L } _ { \mathrm { t r a i n } } ( \omega _ { 1 } , \alpha ) ^ { - \infty } \nabla _ { \omega } \mathcal { L } _ { \mathrm { t r a i n } } ( \omega _ { 2 } , \alpha ) } { 2 }$ $\begin{array} { r } { \mathbf { g } _ { 2 } ^ { \prime } = - \pmb { \eta } \times \frac { \nabla _ { \omega } \mathcal { L } _ { \mathrm { v a l } } ( \omega _ { 3 } , \alpha ) - \bar { \nabla _ { \omega } } \mathcal { L } _ { \mathrm { v a l } } ( \omega _ { 4 } , \alpha ) } { 2 \epsilon } } \end{array}$
|
| 233 |
+
|
| 234 |
+
# A.3 A TOY EXAMPLE TO SHOW THE IMPORTANCE OF THE “GRADIENT TRAP”
|
| 235 |
+
|
| 236 |
+
We have a small toy case to show the influence of the “gradient trap”. We searched for a small super-network in the DARTS’s search space, which only has two cells(we searched for 600 epochs).
|
| 237 |
+
|
| 238 |
+
When we train the super-network in the “training sets in search phase” and validate in the “validation sets in search phase”, the test error using $\mathbf { g } _ { 2 } ^ { ' }$ is $1 0 . 5 \%$ while the test error without ${ \bf g } _ { 2 } ^ { ' }$ is $1 2 . 8 \%$ .
|
| 239 |
+
|
| 240 |
+
When we train the super-network in the training sets and validate in the validation sets, the test error using ${ \bf g } _ { 2 } ^ { ' }$ is $5 . 4 \%$ while the test error without $\mathbf { g } _ { 2 } ^ { ' }$ is $7 . 4 \%$ .
|
| 241 |
+
|
| 242 |
+
When we generalize and train the network in the training sets and validate in the validation sets, the test error using ${ \bf g } _ { 2 } ^ { ' }$ is $6 . 2 \%$ while the test error without $\mathbf { g } _ { 2 } ^ { \prime }$ is $7 . 4 \%$ .
|
| 243 |
+
|
| 244 |
+
In this case the “gradient trap” will cause a dramatic accuracy drop of the super-network.
|
| 245 |
+
|
| 246 |
+
# A.4 SEARCH WITH DIFFERENT SEEDS
|
| 247 |
+
|
| 248 |
+
We ran our search algorithms with different seeds for 5 times in $S _ { 2 }$ and evaluated each discovered architecture for 3 times. The lowest test error is $2 . 5 7 { \pm } 0 . 1 1 \%$ and the highest is $2 . 6 3 { \pm } 0 . 1 3 \%$ . We did the same thing on $S _ { 1 }$ and the lowest and the highest test errors are $2 . 7 1 \pm 0 . 1 5 \%$ and $2 . 9 2 \pm 0 . 0 9 \%$ , respectively.
|
| 249 |
+
|
| 250 |
+
As we expected, the results in $S _ { 1 }$ are less robust than those in $S _ { 2 }$ . The main reason is the difference between search and evaluation, including the different depths of search and evaluation networks and the the discretization stage of the standard DARTS method.
|
| 251 |
+
|
| 252 |
+
More importantly, our approach survives after 500 (and even more) epochs, while DARTS degenerates to an all-skip-connect architecture in all $( 1 0 + )$ individual runs.
|
| 253 |
+
|
| 254 |
+
A.5 THEORETICAL ANALYSIS OF SEMI-POSITIVE-DEFINITE MATRIX AFTER SIMILARITY TRANSFORMATION
|
| 255 |
+
|
| 256 |
+
$\mathbf { A } = \mathbf { C } ^ { T } \cdot \mathbf { C } .$ , A is a semi-positive-definite matrix. In this case, the number of different eigenvalues is far less than the dimension of A(hundreds compared to millions). $\mathbf { H }$ is a real symmetric positivedefinite matrix.
|
| 257 |
+
|
| 258 |
+
Let $\big \{ \alpha _ { \mathrm { i } } \big \}$ be a set of eigenvectors w.r.t $\mathbf { A } ( \alpha _ { \mathrm { i } } ^ { T } \cdot \alpha _ { \mathrm { i } } = 1 )$ ), then $\{ \mathbf { H } \cdot \mathbf { \boldsymbol { \alpha } } _ { \mathrm { i } } \}$ is a set of eigenvectors w.r.t $\mathbf { H } \cdot \dot { \mathbf { A } } \cdot \dot { \mathbf { H } } ^ { - 1 }$ , $\{ \mathbf { H } ^ { - 1 } \cdot \mathbf { \bar { \alpha } } _ { \mathrm { i } } \}$ is a set of eigenvectors w.r.t $\mathbf { H } ^ { - 1 } \cdot \mathbf { A } \cdot \mathbf { H }$ , and $\{ \lambda _ { \mathrm { i } } \}$ is a set of eigenvectors shared by them.
|
| 259 |
+
|
| 260 |
+
Let $\beta$ be an eigenvector $\begin{array} { r } { \mathbf { \operatorname { p f } } \mathbf { H } { \cdot } \mathbf { A } { \cdot } \mathbf { H } ^ { - 1 } + \mathbf { H } ^ { - 1 } { \cdot } \mathbf { A } { \cdot } \mathbf { H } , \beta = \sum _ { \mathrm { i } = 1 } ^ { \mathrm { n } } a _ { \mathrm { i } } \times \mathbf { H } \cdot \alpha _ { \mathrm { i } } = \sum _ { \mathrm { i } = 1 } ^ { \mathrm { n } } b _ { \mathrm { i } } \times \mathbf { H } ^ { - 1 } \cdot \alpha _ { \mathrm { i } } . } \end{array}$ $\begin{array} { r l } & { \qquad \mathrm { E } : = \dots \qquad \mathrm { A } : \mathrm { H } ^ { - 1 } + \mathrm { H } ^ { - 1 } \cdot \mathrm { A } \cdot \mathrm { H } \cdot \mathrm { \Lambda } \mathrm { H } \cdot \mathrm { \Lambda } \beta = \mathrm { \Lambda } \lambda \beta , \quad \mathrm { ~ a } : = 1 \times \mathrm { H } \cdot \mathrm { \Lambda } \alpha _ { \mathrm { i } } + \sum _ { \mathrm { i } = 1 } ^ { \mathrm { n } } b _ { \mathrm { i } } \lambda _ { \mathrm { i } } \times \mathrm { H } ^ { - 1 } \cdot \alpha _ { \mathrm { i } } = } \\ & { \underset { \mathrm { - i } = 1 } { \sum } a _ { \mathrm { i } } \lambda \times \mathrm { H } \cdot \alpha _ { \mathrm { i } } = \sum _ { \mathrm { i } = 1 } ^ { \mathrm { n } } b _ { \mathrm { i } } \lambda \times \mathrm { H } ^ { - 1 } \cdot \alpha _ { \mathrm { i } } . } \\ & { \underset { \mathrm { - i } = 1 } { \sum } \left( \lambda _ { \mathrm { i } } - \lambda \right) a _ { \mathrm { i } } b _ { \mathrm { i } } = - \sum _ { \mathrm { i } = 1 } ^ { \mathrm { n } } \left( \lambda _ { \mathrm { i } } - \lambda \right) b _ { \mathrm { i } } \alpha _ { \mathrm { i } } ^ { T } \cdot \mathrm { H } ^ { - 1 } \cdot \sum _ { \mathrm { i } = 1 } ^ { \mathrm { n } } \left( \lambda _ { \mathrm { i } } - \lambda \right) b _ { \mathrm { i } } \mathrm { H } ^ { - 1 } \cdot \alpha _ { \mathrm { i } } \le 0 } \end{array}$
|
| 261 |
+
|
| 262 |
+
A is a real symmetric matrix, so we have many sets of $\big \{ \alpha _ { \mathrm { i } } \big \}$ that is orthogonal to each other. $\beta ^ { T } \cdot \beta =$ $\textstyle \sum _ { \mathrm { i } = 1 } ^ { \mathrm { n } } a _ { \mathrm { i } } b _ { \mathrm { i } } \geq 0$ , For every eigenvalue, the dimension of the subspace will be very high in the case of neural architecture search, so we assume that we can choose a set of $\big \{ \alpha _ { \mathrm { i } } \big \}$ orthogonal to each other from the subspace satisfying Pni+1j=ni $\sum _ { \mathrm { j = n _ { i } } } ^ { \mathrm { n _ { i + 1 } - 1 } } a _ { \mathrm { j } } b _ { \mathrm { j } } \geq 0$ in most cases $\mathrm { { \acute { n } _ { i } } }$ is the id of the first eigenvector w.r.t $\lambda _ { \mathrm { i } }$ ).
|
| 263 |
+
|
| 264 |
+
$\begin{array} { r } { \sum _ { \mathrm { i = 1 } } ^ { \mathrm { n } } \left( \lambda _ { \mathrm { i } } - \lambda \right) a _ { \mathrm { i } } b _ { \mathrm { i } } = \sum _ { \mathrm { i = 1 } } ^ { \mathrm { n } } \left( \lambda _ { \mathrm { i } } - \lambda \right) \sum _ { \mathrm { j = n _ { i } } } ^ { \mathrm { n _ { i + 1 } - 1 } } a _ { \mathrm { j } } b _ { \mathrm { j } } \le 0 } \end{array}$ so $\boldsymbol { \lambda }$ cannot be smaller than zero.
|
| 265 |
+
|
| 266 |
+
All of the eigenvalues w.r.t real symmetric matrix $\mathbf { H } \cdot \mathbf { A } \cdot \mathbf { H } ^ { - 1 } + \mathbf { H } ^ { - 1 } \cdot \mathbf { A } \cdot \mathbf { H }$ is not smaller than zero, so it is semi-positive-definite. Then we get that $\mathbf { H } ^ { - 1 } \cdot \mathbf { A } \cdot \mathbf { H }$ is semi-positive-definite.
|
md/train/BkgnhTEtDS/BkgnhTEtDS.md
ADDED
|
@@ -0,0 +1,381 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FEATURE INTERACTION INTERPRETABILITY: A CASE FOR EXPLAINING AD-RECOMMENDATION SYSTEMS VIA NEURAL INTERACTION DETECTION
|
| 2 |
+
|
| 3 |
+
Michael Tsang1, Dehua Cheng2, Hanpeng $\mathbf { L i u } ^ { 1 }$ , Xue Feng2, Eric Zhou2, and Yan Liu1
|
| 4 |
+
|
| 5 |
+
1Department of Computer Science, University of Southern California {tsangm,hanpengl,yanliu.cs}@usc.edu 2Facebook AI {dehuacheng,xfeng,hanningz}@fb.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Recommendation is a prevalent application of machine learning that affects many users; therefore, it is important for recommender models to be accurate and interpretable. In this work, we propose a method to both interpret and augment the predictions of black-box recommender systems. In particular, we propose to interpret feature interactions from a source recommender model and explicitly encode these interactions in a target recommender model, where both source and target models are black-boxes. By not assuming the structure of the recommender system, our approach can be used in general settings. In our experiments, we focus on a prominent use of machine learning recommendation: ad-click prediction. We found that our interaction interpretations are both informative and predictive, e.g., significantly outperforming existing recommender models. What’s more, the same approach to interpret interactions can provide new insights into domains even beyond recommendation, such as text and image classification.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Despite their impact on users, state-of-the-art recommender systems are becoming increasingly inscrutable. For example, the models that predict if a user will click on an online advertisement are often based on function approximators that contain complex components in order to achieve optimal recommendation accuracy. The complex components come in the form of modules for better learning relationships among features, such as interactions between user and ad features (Cheng et al., 2016; Guo et al., 2017; Wang et al., 2017; Lian et al., 2018; Song et al., 2018). Although efforts have been made to understand the feature relationships, there is still no method that can interpret the feature interactions learned by a generic recommender system, nor is there a strong commercial incentive to do so.
|
| 14 |
+
|
| 15 |
+
In this work, we identify and leverage feature interactions that represent how a recommender system generally behaves. We propose a novel approach, Global Interaction Detection and Encoding for Recommendation (GLIDER), which detects feature interactions that span globally across multiple data-instances from a source recommender model, then explicitly encodes the interactions in a target recommender model, both of which can be black-boxes. GLIDER achieves this by first utilizing our ongoing work on Neural Interaction Detection (NID) (Tsang et al., 2017) with a data-instance perturbation method called LIME (Ribeiro et al., 2016) over a batch of data samples. GLIDER then explicitly encodes the collected global interactions into a target model via sparse feature crossing.
|
| 16 |
+
|
| 17 |
+
In our experiments on ad-click recommendation, we found that the interpretations generated by GLIDER are illuminating, and the detected global interactions can significantly improve the target model’s prediction performance. Because our interaction interpretation method is very general, we also show that the interpretations are informative in other domains: text, image, graph, and dna modeling.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: A simplified overview of GLIDER. $\textcircled{1}$ GLIDER utilizes Neural Interaction Detection and LIME together to interpret feature interactions learned by a source black-box model at a data instance, denoted by the large green plus sign. $\textcircled{2}$ GLIDER identifies interactions that consistently appear over multiple data samples, then explicitly encodes these interactions in a target black-box recommender model $f _ { r e c }$ .
|
| 21 |
+
|
| 22 |
+
Our contributions are as follows:
|
| 23 |
+
|
| 24 |
+
1. We propose feature interaction interpretations of general prediction models via interaction detection.
|
| 25 |
+
2. Based on this approach, we propose GLIDER to detect and explicitly encode global feature interactions in black-box recommender systems. This process is a form of automatic feature engineering.
|
| 26 |
+
3. Through experiments, we demonstrate the overall interpretability of detected feature interactions on a variety of domains and show that the interactions can be leveraged to improve recommendation accuracy.
|
| 27 |
+
|
| 28 |
+
# 2 NOTATIONS AND BACKGROUND
|
| 29 |
+
|
| 30 |
+
Notations: Vectors are represented by boldface lowercase letters, such as $\mathbf { x }$ or $\mathbf { z }$ . The $i$ -th entry of a vector $\mathbf { x }$ is denoted by $x _ { i }$ . For a set $s$ , its cardinality is denoted by $| S |$ .
|
| 31 |
+
|
| 32 |
+
Let $d$ be the number of features in a dataset. An interaction, $\mathcal { T }$ , is a subset of feature indices: ${ \mathcal { T } } \subseteq \{ 1 , 2 , \ldots , d \}$ , where $| \mathcal { T } |$ is always $\geq 2$ . A higher-order interaction always has $| \mathcal { T } | \geq 3$ . For a vector $\mathbf { x } \in \mathbb { R } ^ { d }$ , let $\mathbf { x } _ { \mathcal { I } } \in \mathbb { R } ^ { | \mathcal { I } | }$ be restricted to the dimensions of $\mathbf { x }$ specified by $\mathcal { T }$ .
|
| 33 |
+
|
| 34 |
+
Let a black-box model be $f ( \cdot ) : \mathbb { R } ^ { p } \mathbb { R }$ . A black-box recommender model uses tabular feature types, as discussed later in this section. In classification tasks, we assume $f$ is a class logit. $p$ and $d$ may be different depending on feature transformations.
|
| 35 |
+
|
| 36 |
+
Feature Interactions: By definition, a model $f$ learns a statistical (non-additive) feature interaction $\mathcal { T }$ if and only if $f$ cannot be decomposed into a sum of $| \mathcal { T } |$ arbitrary subfunctions $f _ { i }$ , each excluding a corresponding interaction variable (Friedman et al., 2008; Sorokina et al., 2008; Tsang et al., 2017), i.e., $\begin{array} { r } { f ( \mathbf { x } ) \neq \bar { \sum } _ { i \in \mathcal { T } } f _ { i } ( \mathbf { x } _ { \{ 1 , 2 , \ldots , d \} \backslash i } ) } \end{array}$ .
|
| 37 |
+
|
| 38 |
+
For example, a multiplication between two features, $x _ { 1 }$ and $x _ { 2 }$ , is a feature interaction because it cannot be represented as an addition of univariate functions, i.e., $x _ { 1 } x _ { 2 } \neq f _ { 1 } ( x _ { 2 } ) + f _ { 2 } ( x _ { 1 } )$ .
|
| 39 |
+
|
| 40 |
+
Recommendation Systems: A recommender system, $f _ { r e c } ( \cdot )$ , is a model of two feature types: dense numerical features and sparse categorical features. Since the one-hot encoding of categorical feature $x _ { c }$ can be high-dimensional, it is commonly represented in a low-dimensional embedding $\scriptstyle \mathbf { e } _ { c } \ =$ $o n e \mathbf { \mathcal { - } } h o t ( x _ { c } ) \mathbf { V } _ { c }$ via embedding matrix $\mathbf { V } _ { c }$ .
|
| 41 |
+
|
| 42 |
+
# 3 FEATURE INTERACTIONS IN BLACK-BOX MODELS
|
| 43 |
+
|
| 44 |
+
We start by explaining how to obtain a data-instance level (local) interpretation of feature interactions by utilizing interaction detection on feature perturbations.
|
| 45 |
+
|
| 46 |
+
# 3.1 FEATURE PERTURBATION AND INFERENCE
|
| 47 |
+
|
| 48 |
+
Given a data instance $\mathbf { x } \in \mathbb { R } ^ { p }$ , LIME proposed to perturb the data instance by sampling a separate binary representation $\tilde { \mathbf { x } } \in \{ 0 , 1 \} ^ { d }$ of the same data instance. Let $\xi : \{ 0 , 1 \} ^ { d } \overset { \cdot } { } \mathbb { R } ^ { p }$ be the map from the binary representation to the perturbed data instance. Starting from a binary vector of all ones that map to the original features values in the data instance, LIME uniformly samples the number of random features to switch to 0 or the “off” state. In the data instance, “off” could correspond to a 0 embedding vector for categorical features or mean value over a batch for numerical features. It is possible for $d < p$ by grouping features in the data instance to correspond to single binary features in $\tilde { \bf x }$ . An important step is getting black-box predictions of the perturbed data instances to create a dataset with binary inputs and prediction targets: $\mathcal { D } = \{ ( \tilde { \mathbf { x } } _ { i } , y _ { i } ) ~ | ~ y _ { i } = f ( \xi ( \tilde { \mathbf { x } } _ { i } ) ) , \tilde { \mathbf { x } } _ { i } \in \{ 0 , 1 \} ^ { d } \}$ . Though we use LIME’s approach, the next section is agnostic to the instance perturbation method.
|
| 49 |
+
|
| 50 |
+
# 3.2 FEATURE INTERACTION DETECTION
|
| 51 |
+
|
| 52 |
+
Feature interaction detection is concerned with identifying feature interactions in a dataset (Bien et al., 2013; Purushotham et al., 2014; Lou et al., 2013; Friedman et al., 2008). Typically, proper interaction detection requires a pre-processing step to remove correlated features that adversely affect detection performance (Sorokina et al., 2008). As long as features in dataset $\mathcal { D }$ are generated in an uncorrelated fashion, e.g., through random sampling, we can directly use $\mathcal { D }$ to detect feature interactions from black-box model $f$ at data instance x.
|
| 53 |
+
|
| 54 |
+
# 3.2.1 NEURAL INTERACTION DETECTION
|
| 55 |
+
|
| 56 |
+
$f$ can be an arbitrary function and can generate highly nonlinear targets in $\mathcal { D }$ , so we focus on detecting interactions that could have generic forms. In light of this, we leverage our method, Neural Interaction Detection (NID) (Tsang et al., 2017), which accurately and efficiently detects generic non-additive and arbitrary-order statistical feature interactions. NID detects these interactions by training a lasso-regularized multilayer perceptron (MLP) on a dataset, then identifying the features that have high-magnitude weights to common hidden units. NID is efficient by greedily testing the top-interaction candidates of every order at each of $h$ first-layer hidden units, enabling arbitraryorder interaction detection in $O ( h d )$ tests within one MLP.
|
| 57 |
+
|
| 58 |
+
# 3.2.2 GRADIENT-BASED NEURAL INTERACTION DETECTION
|
| 59 |
+
|
| 60 |
+
Besides the non-additive definition of statistical interaction, a gradient definition also exists based on mixed partial derivatives (Friedman et al., 2008), i.e., a function $F ( \cdot )$ exhibits statistical interaction $\mathcal { T }$ among features $z _ { i }$ indexed by $i _ { 1 } , i _ { 2 } , \dotsc , i _ { | \mathcal { T } | } \in \mathcal { T }$ if
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
E _ { \mathbf { z } } \left[ \frac { \partial ^ { | \mathcal { T } | } F ( \mathbf { z } ) } { \partial z _ { i _ { 1 } } \partial z _ { i _ { 2 } } \dots \partial z _ { i _ { | \mathcal { T } | } } } \right] ^ { 2 } > 0 .
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
The advantage of this definition is that it allows exact interaction detection from model gradients (Ai & Norton, 2003); however, this definition contains a computationally expensive expectation, and typical neural networks with ReLU activation functions do not permit mixed partial derivatives. For the task of local interpretation, we only examine a single data instance $\mathbf { x }$ , which avoids the expectation. We turn $F$ into an MLP $g ( \cdot )$ with smooth, infinitely-differentiable activation functions such as softplus, which closely follows ReLU (Glorot et al., 2011). We then train the MLP with the same purpose as $\ S 3 . 2 . 1$ to faithfully capture interactions in perturbation dataset $\mathcal { D }$ . Given these conditions, we define an alternate gradient-based neural interaction detector (GradientNID) as:
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\omega ( \mathcal { T } ) = \left( \frac { \partial ^ { | \mathcal { T } | } g ( \tilde { \mathbf { x } } ) } { \partial \tilde { x } _ { i _ { 1 } } \partial \tilde { x } _ { i _ { 2 } } \hdots \partial \tilde { x } _ { i _ { | \mathcal { T } | } } } \right) ^ { 2 } ,
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
where $\omega$ is the strength of the interaction $\mathcal { T }$ , $\tilde { \mathbf { x } }$ is the representation of $\mathbf { x }$ , and the MLP $g$ is trained on $\mathcal { D }$ . While GradientNID exactly detects interactions from the explainer MLP, it needs to compute interaction strengths $\omega$ for feature combinations that grow exponentially in number as $| \mathcal { T } |$ increases. We recommend restricting GradientNID to low-order interactions.
|
| 73 |
+
|
| 74 |
+
Algorithm 1 Global Interaction Detection in GLIDER
|
| 75 |
+
|
| 76 |
+
<table><tr><td>Input: dataset B, recommender model frec Output: G = {(Ii,ci)}: global interactions Ii and their counts ci over the dataset</td></tr><tr><td>1:G ← initialize occurrence dictionary for global interactions</td></tr><tr><td>2:for each data sample x within dataset B do</td></tr><tr><td>3: S ← MADEX(frec, X)</td></tr><tr><td>4: G ← increment the occurrence count of Ij ∈ S, ∀j = 1,2,...,|S|</td></tr><tr><td>5: sort G by most frequently occurring interactions</td></tr><tr><td>6:[optional prune subset interactions in G within a target number of interactions K</td></tr></table>
|
| 77 |
+
|
| 78 |
+
# 3.3 SCOPE
|
| 79 |
+
|
| 80 |
+
Based on $\ S 3 . 1$ and $\ S 3 . 2$ , we define a function, $\mathtt { M A D E X } ( f , \mathbf { x } )$ , that takes as inputs black-box $f$ and data instance $\mathbf { x }$ , and outputs ${ \cal { S } } = \{ { \cal { T } } _ { i } \} _ { i = 1 } ^ { k }$ , a set of top- $k$ detected feature interactions. MADEX stands for “Model-Agnostic Dependency Explainer”.
|
| 81 |
+
|
| 82 |
+
In some cases, it is necessary to identify a $k$ threshold. Because of the importance of speed for local interpretations, we simply use a linear regression with additional multiplicative terms to approximate the gains given by interactions in $s$ , where $k$ starts at 0 and is incremented until the linear model’s predictions stop improving.
|
| 83 |
+
|
| 84 |
+
# 4 GLIDER: GLOBAL INTERACTION DETECTION AND ENCODING FOR RECOMMENDATION
|
| 85 |
+
|
| 86 |
+
We now discuss the different components of GLIDER: detecting global interactions in $\ S 4 . 1$ , then encoding these interactions in recommender systems in $\ S 4 . 2$ . Recommender systems are interesting because they have pervasive application in real-world systems, and their features are often very sparse. By sparse features, we mean features with many categories, e.g., millions of user IDs. The sparsity makes interaction detection challenging especially when applied directly on raw data because the one-hot encoding of sparse features creates an extremely large space of potential feature combinations (Fan et al., 2015).
|
| 87 |
+
|
| 88 |
+
# 4.1 GLOBAL INTERACTION DETECTION
|
| 89 |
+
|
| 90 |
+
In this section, we explain the first step of GLIDER. As defined in $\ S 3 . 3$ , MADEX takes as input a blackbox model $f$ and data instance $\mathbf { x }$ . In the context of this section, MADEX inputs a source recommender system $f _ { r e c }$ and data instance $\mathbf { x } = [ x _ { 1 } , x _ { 2 } , \ldots , x _ { p } ]$ . $x _ { i }$ is the $i$ -th feature field and is either a dense or sparse feature. $p$ is both the total number of feature fields and the number of perturbation variables $( p = d )$ ). We define global interaction detection as repeatedly running MADEX over a batch of data instances, then counting the occurrences of the same detected interactions, shown in Algorithm 1. The occurrence counts are not only a useful way to rank global interaction detections, but also a sanity check to rule out the chance that the detected feature combinations are random selections.
|
| 91 |
+
|
| 92 |
+
One potential concern with Alg. 1 is that it could be slow depending on the speed of MADEX. In our experiments, the entire process took less than one hour when run in parallel over a batch of 1000 samples with $\sim 4 0$ features on a 32-CPU server with 2 GPUs. This algorithm only needs to be run once to obtain the summary of global interactions.
|
| 93 |
+
|
| 94 |
+
# 4.2 TRUNCATED FEATURE CROSSES
|
| 95 |
+
|
| 96 |
+
The global interaction $\mathcal { T } _ { i }$ , outputted by Alg. 1, is used to create a synthetic feature $x _ { \mathcal { T } _ { i } }$ for a target recommender system. The synthetic feature $x _ { \mathcal { T } _ { i } }$ is created by explicitly crossing sparse features indexed in $\mathcal { T } _ { i }$ . If interaction $\mathcal { T } _ { i }$ involves dense features, we bucketize the dense features before crossing them. The synthetic feature is sometimes called a cross feature (Wang et al., 2017; Luo et al., 2019) or conjunction feature (Rosales et al., 2012; Chapelle et al., 2015).
|
| 97 |
+
|
| 98 |
+
In this context, a cross feature is an $n$ -ary Cartesian product among $n$ sparse features. If we denote $\mathcal { X } _ { 1 } , \mathcal { X } _ { 2 } , \ldots , \mathcal { X } _ { n }$ as the set of IDs for each respective feature $x _ { 1 } , x _ { 2 } , \ldots , x _ { n }$ , then their cross feature $x _ { \{ 1 , . . . , n \} }$ takes on all possible values in
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\mathcal { X } _ { 1 } \times \dots \times \mathcal { X } _ { n } = \{ ( x _ { 1 } , \dots , x _ { n } ) ~ | ~ x _ { i } \in \mathcal { X } _ { i } , \forall i = 1 , \dots , n \}
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
Accordingly, the cardinality of this cross feature is $\left| { \mathcal { X } } _ { 1 } \right| \times \cdots \times \left| { \mathcal { X } } _ { n } \right|$ and can be extremely large, yet many combinations of values in the cross feature are likely unseen in the training data. Therefore, we generate a truncated form of the cross feature with only seen combinations of values, $\mathbf { x } _ { \mathcal { T } } ^ { ( j ) }$ , where $j$ is a sample index in the training data, and $\mathbf { x } _ { \mathcal { T } } ^ { ( j ) }$ is represented as a sparse ID in the cross feature $x \tau$ . We further reduce the cardinality by requiring the same cross feature ID to occur more than times in a batch of samples, or set to a default ID otherwise. These truncation steps significantly reduce the embedding sizes of each cross feature while maintaining their representation power. Once cross features $\{ x _ { \mathbb { Z } _ { i } } \bar \} _ { i }$ are included in a target recommender system, it can be trained as per usual.
|
| 105 |
+
|
| 106 |
+
# 4.3 MODEL DISTILLATION VS. ENHANCEMENT
|
| 107 |
+
|
| 108 |
+
There are dual perspectives of GLIDER: as a method for model distillation or model enhancement. If a strong source model is used to detect global interactions which are then encoded in more resourceconstrained target models, then GLIDER adopts a teacher-student type distillation process. If interaction encoding augments the same model where the interactions were detected from, then GLIDER tries to enhance the model’s ability to represent the interactions.
|
| 109 |
+
|
| 110 |
+
# 5 RELATED WORKS
|
| 111 |
+
|
| 112 |
+
Interaction Interpretations: A variety of methods exist to detect feature interactions learned in specific models but not black-box models. For example, RuleFit (Friedman et al., 2008), Additive Groves (Sorokina et al., 2008), and Tree-Shap (Lundberg et al., 2018) detect interactions specifically in trees; likewise PaD2 (Gevrey et al., 2006) and NID (Tsang et al., 2017) detect interactions in multilayer perceptrons. Some methods have attempted to interpret feature groups in black-box models, such as Anchors (Ribeiro et al., 2018), Agglomerative Contextual Decomposition (Singh et al., 2019), and Context-Aware methods (Singla et al., 2019); however, these methods were not intended to identify feature interactions.
|
| 113 |
+
|
| 114 |
+
Explicit Interaction Representation: There are increasingly methods for explicitly representing interactions in models. Cheng et al. (2016), Guo et al. (2017), Wang et al. (2017), and Lian et al. (2018) directly incorporate multiplicative cross terms in neural network architectures and Song et al. (2018) use attention as an interaction module, all of which are intended to improve the neural network’s function approximation. This line of work found that predictive performance can improve with dedicated interaction modeling. Luo et al. (2019) followed up by proposing feature sets from data then explicitly encoding them via feature crossing, but this method’s proposals are limited by beam search. Our work approaches this problem from a model interpretation standpoint.
|
| 115 |
+
|
| 116 |
+
Black-Box Local vs. Global Interpretations: Data-instance level local interpretation methods are more flexible at explaining general black-box models; however, global interpretations, which cover multiple data instances, have become increasingly desirable to summarize model behavior. Locally Interpretable Model-Agnostic Explanations (LIME) (Ribeiro et al., 2016) and Integrated Gradients (Sundararajan et al., 2017) are some of the most used methods to locally interpret any classifier and neural predictor respectively. There are some methods for global black-box interpretations, such as shuffle-based feature importance (Fisher et al., 2018), submodular pick (Ribeiro et al., 2016), and visual concept extraction (Kim et al., 2018). Our work offers a new tooling option.
|
| 117 |
+
|
| 118 |
+
# 6 EXPERIMENTS
|
| 119 |
+
|
| 120 |
+
# 6.1 SETUP
|
| 121 |
+
|
| 122 |
+
In our experiments, we study interaction interpretation and encoding on real-world data. The hyperparameters in MADEX are as follows. For all experiments, our perturbation datasets $\mathcal { D }$ contain 5000 training samples and 500 samples for each validation and testing. Our usage of NID or GradientNID as the interaction detector (§3.2) depends on the experimental setting. For all experiments that only examine single data instances, we use GradientNID for its exactness and pairwise interaction detection; otherwise, we use NID for its higher-order interaction detection. The MLPs for NID and GradientNID have architectures of 256-128-64 first-to-last hidden layer sizes, and they are trained with learning rate of $\mathrm { 1 e - 2 }$ , batchsize of 100, and the ADAM optimizer. NID uses ReLU activations and an $\ell _ { 1 }$ regularization of $\lambda _ { 1 } = 1 \mathrm { e } { - 4 }$ , whereas GradientNID uses softplus activations and a structural regularizer as MLP+linear regression, which we found offers strong test performance. In general, models are trained with early stopping on validation sets.
|
| 123 |
+
|
| 124 |
+
For LIME perturbations, we need to establish what a binary 0 maps to via $\xi$ in the raw data instance (§3.1). In domains involving embeddings, i.e., sparse features and word embeddings, the 0 (“off”) state is the zeroed embedding vector. For dense features, it is the mean feature value over a batch; for images, the mean superpixel RGB of the image. For our DNA experiment, we use a random nucleotide other than the original one. These settings correspond to what is used in literature (Ribeiro et al., 2016; 2018). In our graph experiment, the nodes within the neighborhood of a test node are perturbed, where each node is zeroed during perturbation.
|
| 125 |
+
|
| 126 |
+
# 6.2 EXPERIMENTS ON CTR RECOMMENDATION
|
| 127 |
+
|
| 128 |
+
In this section, we provide experiments with GLIDER on models trained for clickthrough-rate (CTR) prediction. The recommender models we study include commonly reported baselines, which all use neural networks: Wide&Deep (Cheng et al., 2016), DeepFM (Guo et al., 2017), Deep&Cross (Wang et al., 2017), xDeepFM (Lian et al., 2018), and AutoInt (Song et al., 2018).
|
| 129 |
+
|
| 130 |
+
Table 1: CTR dataset statistics
|
| 131 |
+
|
| 132 |
+
<table><tr><td>Dataset</td><td>#Samples</td><td>#Features</td><td>Total # Sparse IDs</td></tr><tr><td>Criteo</td><td>45,840,617</td><td>39</td><td>998,960</td></tr><tr><td>Avazu</td><td>40,428,967</td><td>23</td><td>1,544,428</td></tr></table>
|
| 133 |
+
|
| 134 |
+
AutoInt is the reported state-of-the-art in academic literature, so we use the model settings and data splits provided by AutoInt’s official public repository1. For all other recommender models, we use public implementations2 with the same original architectures reported in literature, set all embedding sizes to 16, and tune the learning rate and optimizer to reach or surpass the test logloss reported by the AutoInt paper (on AutoInt’s data splits). From tuning, we use the Adagrad optimizer (Duchi et al., 2011) with learning rate of 0.01. All models use early stopping on validation sets.
|
| 135 |
+
|
| 136 |
+
The datasets we use are benchmark CTR datasets with the largest number of features: Criteo3 and Avazu4, whose data statistics are shown in Table 1. Criteo and Avazu both contain $4 0 +$ millions of user records on clicking ads, with Criteo being the primary benchmark in CTR research (Cheng et al., 2016; Guo et al., 2017; Wang et al., 2017; Lian et al., 2018; Song et al., 2018; Luo et al., 2019).
|
| 137 |
+
|
| 138 |
+
# 6.2.1 GLOBAL INTERACTION DETECTION
|
| 139 |
+
|
| 140 |
+

|
| 141 |
+
Figure 2: Occurrence counts (Total: 1000) vs. rank of detected interactions from AutoInt on Criteo and Avazu datasets. \* indicates a higher-order interaction (details in
|
| 142 |
+
|
| 143 |
+
For each dataset, we train a source AutoInt model, $f _ { r e c }$ , then run global interaction detection via Algorithm 1 on a batch of 1000 samples from the validation set. A full global detection experiment finishes in less than one hour when run in parallel on either Criteo or Avazu datasets in a 32-CPU Intel Xeon E5-2640 v2 $\textcircled { a } \ 2 . 0 0 \mathrm { G H z }$ server with 2 Nvidia 1080 Ti GPUs. The detection results across datasets are shown in Figure 2 Appendix G). as plots of detection counts versus rank. Because the Avazu dataset contains non-anonymized features, we directly show its top-10 detected global interactions in Table 2a.
|
| 144 |
+
|
| 145 |
+
Table 2: Understanding feature interactions: top global feature interactions for (a) an ad targeting system via Algorithm 1 and (b) a text sentiment analyzer via $\ S 6 . 3 . 2$ (later). The tables are juxtaposed to assist in understanding feature interactions, i.e., nuanced changes among interacting variables lead to significant changes in prediction probabilities. The prediction outcomes are ad-clicks by users for (a) and text sentiment for (b).
|
| 146 |
+
(a) Explanation of an ad targeting system
|
| 147 |
+
|
| 148 |
+
<table><tr><td>Count (Total:1000)</td><td>Interaction</td></tr><tr><td>525</td><td>{device_ip,hour}</td></tr><tr><td>235</td><td>{device_id,device_ip,hour}</td></tr><tr><td>217</td><td>{device_id,app-id}</td></tr><tr><td>203</td><td>{device_ip,device_model, hour}</td></tr><tr><td>194</td><td>{site_id, site_domain}</td></tr><tr><td>190</td><td>{site_id, hour}</td></tr><tr><td>187</td><td>{device_ip,site_id,hour}</td></tr><tr><td>183</td><td>{site_id,site_domain,hour}</td></tr><tr><td>179</td><td>{device_id,hour}</td></tr><tr><td>179</td><td>{device_id,device_ip,device_model,hour}</td></tr></table>
|
| 149 |
+
|
| 150 |
+
(b) Explanation of a sentiment analyzer
|
| 151 |
+
|
| 152 |
+
<table><tr><td>Count (Total:40)</td><td>Interaction (ordered)</td></tr><tr><td>36</td><td>never, fails</td></tr><tr><td>30</td><td>suspend,disbelief</td></tr><tr><td>30</td><td>too, bad</td></tr><tr><td>29</td><td>very, funny</td></tr><tr><td>29</td><td>neither, nor</td></tr><tr><td>28</td><td>not, miss</td></tr><tr><td>27</td><td>recent, memory</td></tr><tr><td>27</td><td>not, good</td></tr><tr><td>26</td><td>no,denying</td></tr><tr><td>25</td><td>not, bad</td></tr></table>
|
| 153 |
+
|
| 154 |
+
From Figure 2, we see that the same interactions are detected very frequently across data instances, and many of the interactions are higher-order interactions. The interaction counts are very significant. For example, any top-1 occurrence count $> 2 5$ is significant for the Criteo dataset $( p < 0 . 0 5 ) $ , and likewise $> 7 1$ for the Avazu dataset, assuming a conservative search space of only up to 3-way interactions ( $| \mathcal { I } | \le 3 )$ . Our top-1 occurrence counts are 691 $\left( \gg 2 5 \right)$ ) for Criteo and 525 $( \gg 7 1 )$ ) for Avazu.
|
| 155 |
+
|
| 156 |
+
In Table 2a, the top-interactions are explainable. For example, the interaction between “device ip” and “hour” (in UTC time) makes sense because users - here identified by IP addresses - have ad-click behaviors dependent on their time zones. This is a general theme with many of the top-interactions5. As another example, the interaction between “device id” and “app id” makes sense because ads are targeted to users based on the app they’re in.
|
| 157 |
+
|
| 158 |
+
# 6.2.2 INTERACTION ENCODING
|
| 159 |
+
|
| 160 |
+
Based on our results from the previous section $( \ S 6 . 2 . 1 )$ , we turn our attention to explicitly encoding the detected global interactions in target baseline models via truncated feature crosses (detailed in $\ S 4 . 2 )$ . In order to generate valid cross feature IDs, we bucketize dense features into a maximum of 100 bins before crossing them and require that final cross feature IDs occur more than $T = 1 0 0$ times over a training batch of one million samples.
|
| 161 |
+
|
| 162 |
+
We take AutoInt’s top- $K$ global interactions on each dataset from $\ S 6 . 2 . 1$ with subset interactions excluded (Algorithm 1, line 6) and encode the interactions in each baseline model including AutoInt itself. $K$ is tuned on valiation sets, and model hyperparameters are the same between a baseline and one with encoded interactions. We set $K = 4 0$ for Criteo and $K = 1 0$ for Avazu.
|
| 163 |
+
|
| 164 |
+
In Table 3, we found that GLIDER often obtains significant gains in performance based on standard deviation, and GLIDER often reaches or exceeds a desired 0.001 improvement for the Criteo dataset (Cheng et al., 2016; Guo et al., 2017; Wang et al., 2017; Song et al., 2018). The improvements are especially visible with DeepFM on Criteo. We show how this model’s test performance varies with different $K$ in Figure 3. All performance gains are obtained at limited cost of extra model parameters (Table 4) thanks to the truncations applied to our cross features. To avoid extra parameters entirely, we recommend feature selection on the new and existing features.
|
| 165 |
+
|
| 166 |
+
One one hand, the evidence that AutoInt’s detected interactions can improve other baselines’ performance suggests the viability of interaction distillation. On the other hand, evidence that AutoInt’s performance on Criteo can improve using its own detected interactions suggests that AutoInt may benefit from learning interactions more explicitly. In either model distillation or enhancement settings, we found that GLIDER performs especially well on industry production models trained on large private datasets with thousands of features.
|
| 167 |
+
|
| 168 |
+
Table 3: Test prediction performance by encoding top- $K$ global interactions in baseline recommender systems on the Criteo and Avazu datasets (5 trials). $K$ are 40 and 10 for Criteo and Avazu respectively. $^ { 6 6 } +$ GLIDER” means the inclusion of detected global interactions to corresponding baselines. The “Setting” column is labeled relative to the source of detected interactions: AutoInt. \* scores by Song et al. (2018).
|
| 169 |
+
|
| 170 |
+
<table><tr><td rowspan="2">Setting</td><td rowspan="2">Model</td><td colspan="2">Criteo</td><td colspan="2">Avazu</td></tr><tr><td>AUC</td><td>logloss</td><td>AUC</td><td>logloss</td></tr><tr><td rowspan="7">Distillation</td><td>Wide&Deep +GLIDER</td><td>0.8069 ± 5e-4</td><td>0.4446 ± 4e-4</td><td>0.7794± 3e-4</td><td>0.3804 ± 2e-4</td></tr><tr><td>DeepFM</td><td>0.8080±3e-4 0.8079 ± 3e-4</td><td>0.4436 ± 3e-4 0.4436± 2e-4</td><td>0.7795 ± 1e-4 0.7792 ± 3e-4</td><td>0.3802 ± 9e-5 0.3804±9e-5</td></tr><tr><td>+ GLIDER</td><td>0.8097± 2e-4</td><td>0.4420±2e-4</td><td>0.7795 ± 2e-4</td><td>0.3802 ± 2e-4</td></tr><tr><td>Deep&Cross</td><td>0.8076 ± 2e-4</td><td>0.4438± 2e-4</td><td>0.7791 ± 2e-4</td><td>0.3805± 1e-4</td></tr><tr><td>+ GLIDER</td><td>0.8086±3e-4</td><td>0.4428± 2e-4</td><td>0.7792 ± 2e-4</td><td>0.3803 ± 9e-5</td></tr><tr><td>xDeepFM</td><td>0.8084± 2e-4</td><td>0.4433 ± 2e-4</td><td>0.7785± 3e-4</td><td>0.3808 ± 2e-4</td></tr><tr><td>+ GLIDER</td><td>0.8097±3e-4</td><td>0.4421± 3e-4</td><td>0.7787 ± 4e-4</td><td>0.3806± 1e-4</td></tr><tr><td rowspan="2">Enhancement</td><td>AutoInt *</td><td>0.8083</td><td>0.4434</td><td>0.7774</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td>0.3811</td></tr><tr><td></td><td>+ GLIDER</td><td>0.8090±2e-4</td><td>0.4426± 2e-4</td><td>0.7773 ± 1e-4</td><td>0.3811 ± 5e-5</td></tr></table>
|
| 171 |
+
|
| 172 |
+
Table 4: # parameters of the models in Table 3. M denotes million.
|
| 173 |
+
|
| 174 |
+
<table><tr><td>Model</td><td>Criteo</td><td>Avazu</td></tr><tr><td>Wide&Deep</td><td>18.1M</td><td>27.3M</td></tr><tr><td>+ GLIDER</td><td>19.3M (+6.8%)</td><td>27.6M (+1.0%)</td></tr><tr><td>DeepFM + GLIDER</td><td>17.5M</td><td>26.7M</td></tr><tr><td></td><td>18.3M (+4.8%)</td><td>26.9M(+0.6%)</td></tr><tr><td>Deep&Cross + GLIDER</td><td>17.5M 18.7M (+6.9%)</td><td>26.1M 26.4M (+1.0%)</td></tr><tr><td>xDeepFM</td><td></td><td></td></tr><tr><td>+ GLIDER</td><td>18.5M 21.7M(+17.2%)</td><td>27.6M 28.3M (+2.5%)</td></tr><tr><td></td><td></td><td></td></tr><tr><td>AutoInt</td><td>16.4M</td><td>25.1M</td></tr><tr><td>+ GLIDER</td><td>17.3M (+5.1%)</td><td>25.2M(+0.6%)</td></tr></table>
|
| 175 |
+
|
| 176 |
+

|
| 177 |
+
Figure 3: Test logloss vs. $K$ of DeepFM on the Criteo dataset (5 trials).
|
| 178 |
+
|
| 179 |
+
# 6.3 INTERPRETATIONS ON OTHER DOMAINS
|
| 180 |
+
|
| 181 |
+
Since the proposed interaction interpretations are not entirely limited to recommender systems, we demonstrate interpretations on more general black-box models. Specifically, we experiment with the function MADEX $( \cdot )$ defined in $\ S 3 . 3$ , which inputs a black-box $f$ , data-instance x, and outputs a set of top- $k$ interactions. The models we use are trained on very different tasks, i.e., ResNet152: an image classifier pretrained on ImageNet ‘14 (Russakovsky et al., 2015; He et al., 2016), Sentiment-LSTM: a 2-layer bi-directional long short-term memory network (LSTM) trained on the Stanford Sentiment Treebank (SST) (Socher et al., 2013; Tai et al., 2015), DNA-CNN: a 2-layer 1D convolutional neural network (CNN) trained on MYC-DNA binding data6 (Mordelet et al., 2013; Yang et al., 2013; Alipanahi et al., 2015; Zeng et al., 2016; Wang et al., 2018; Barrett et al., 2012), and GCN: a 3-layer Graph Convolutional Network trained on the Cora dataset (Kipf & Welling, 2016; Sen et al., 2008). In order to make informative comparisons to the linear LIME baseline, we use LIME’s sample weighting strategy and kernel size (0.25) in this section. We first provide quantitative validation for the detected interactions of all four models in $\ S 6 . 3 . 1$ , followed by qualitative results for ResNet152, Sentiment-LSTM, and DNA-CNN in $\ S 6 . 3 . 2$ .
|
| 182 |
+
|
| 183 |
+
# 6.3.1 QUANTITATIVE
|
| 184 |
+
|
| 185 |
+
To quantitatively validate our interaction interpretations of general black-box models, we measure the local explanation fidelity of the interactions via prediction performance. As suggested in $\ S 3 . 3$ and $\ S 4 . 2$ , encoding feature interactions is a way to increase a model’s function representation, but this also means that prediction performance gains over simpler first-order models (e.g., linear regression) is a way to test the significance of the detected interactions. In this section, we use neural network function approximators for each top-interaction from the ranking $\{ \mathcal { T } _ { i } \}$ given by MADEX’s interaction detector (in this case NID). Similar to the $k$ -thresholding description in $\ S 3 . 3$ , we start at $k = 0$ , which is a linear regression, then increment $k$ with added MLPs for each $\mathcal { T } _ { i }$ among $\{ \mathcal { T } _ { i } \} _ { i = 1 } ^ { k }$ until validation performance stops improving, denoted at $k = L$ . The MLPs all have architectures of 64-32-16 first-to-last hidden layer sizes and use the binary perturbation dataset $\mathcal { D }$ (from $\ S 3 . 1 \rrangle$ .
|
| 186 |
+
|
| 187 |
+
Table 5: Prediction performance (mean-squared error; lower is better) with $( k > 0 )$ ) and without $( k \ = \ 0$ ) interactions for random data instances in the test sets of respective black-box models. $k = L$ corresponds to the interaction at a rank threshold. $2 \le k < L$ are excluded because not all instances have 2 or more interactions. Only results with detected interactions are shown. At least $9 4 \%$ $\left( \geq 1 8 8 \right)$ of the data instances had interactions across 5 trials for each model and score statistic.
|
| 188 |
+
|
| 189 |
+
<table><tr><td></td><td>k</td><td>DNA-CNN</td><td>Sentiment-LSTM</td><td>ResNet152</td><td>GCN</td></tr><tr><td>linear LIME</td><td>0</td><td>10e-3±le-3</td><td>8.0e-2±6e-3</td><td>1.9 ±0.1</td><td>7.1e3±7e2</td></tr><tr><td>MADEX (ours)</td><td>1</td><td>8e-3±2e-3</td><td>3.8e-2±6e-3</td><td>1.7 ± 0.1</td><td>5.7e3± 7e2</td></tr><tr><td>MADEX (ours)</td><td>L</td><td>5.0e-3±8e-4</td><td>0.4e-2±3e-3</td><td>0.9± 0.2</td><td>2e3±1e3</td></tr></table>
|
| 190 |
+
|
| 191 |
+
Test prediction performances are shown in Table 5 for $k \in \{ 0 , 1 , L \}$ . The average number of features of $\mathcal { D }$ among the black-box models ranges from 18 to 112. Our quantitative validation shows that adding feature interactions for DNA-CNN, SentimentLSTM, and ResNet152, and adding node interactions for GCN result in significant performance gains when averaged over 40 randomly selected data instances in the test set.
|
| 192 |
+
|
| 193 |
+
# 6.3.2 QUALITATIVE
|
| 194 |
+
|
| 195 |
+
For our qualitative analysis, we provide interaction interpretations via MADEX $( \cdot )$ of ResNet152, SentimentLSTM, and DNA-CNN on test samples. The interpretations are given by $\stackrel { \cdot } { S } = \{ { \cal T } _ { i } \} _ { i = 1 } ^ { k }$ , a set of $k$ detected interactions, which are shown in Figure 4 for ResNet152 and SentimentLSTM. For reference, we also show the top “main effects” by LIME’s original linear regression, which select the top-5 features that attribute towards the predicted class7.
|
| 196 |
+
|
| 197 |
+
In Figure 4a, the “interaction” columns show selected features from MADEX’s interactions between Quickshift superpixels (Vedaldi & Soatto, 2008; Ribeiro et al., 2016). To reduce the number of interactions per image, we merged interactions that have overlap coefficient $\geq ~ 0 . 5$ (Vijaymeena & Kavitha, 2016). From (a) ResNet152 interpretations
|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
top prediction: trolleybus, trolley coach, trackless trolley
|
| 201 |
+
Figure 4: Qualitative examples (more in Appendix D & E)
|
| 202 |
+
|
| 203 |
+
<table><tr><td rowspan="2">Original sentence</td><td rowspan="2">Predi- ction</td><td rowspan="2">Main effects</td><td colspan="2">Interactions (ours)</td></tr><tr><td>I</td><td>I</td></tr><tr><td>It never fails to engage us.</td><td>pos.</td><td>never, us</td><td>never, fails</td><td></td></tr><tr><td>The movie makes absolutely no sense.</td><td>neg.</td><td>no, sense</td><td>absolutely, no</td><td>no, sense</td></tr><tr><td>The central story lacks punch.</td><td>neg.</td><td>lacks</td><td>story, lacks</td><td>lacks, punch</td></tr></table>
|
| 204 |
+
|
| 205 |
+
the figure, we see that the interactions form a single region or multiple regions of the image. They also tend to be complementary to LIME’s main effects and are sometimes more informative. For example, the interpretations of the “shark” classification show that interaction detection finds the shark fin whereas main effects do not. Interpretations of Sentiment-LSTM are shown in Figure 4b, excluding common stop words (Appendix C). We again see the value of MADEX’s interactions, which show salient combinations of words, such as “never, fails”, “absolutely, no”, and “lacks, punch”.
|
| 206 |
+
|
| 207 |
+
In our experiments on DNA-CNN, we consistently detected the interaction between “CACGTG” nucleotides, which form a canonical DNA sequence (Staiger et al., 1989). The interaction was detected $9 7 . 3 \%$ out of 187 CACGTG appearances in the test set.
|
| 208 |
+
|
| 209 |
+
In order to run consistency experiments now on Sentiment-LSTM, word interactions need to be detected consistently across different sentences, which na¨ıvely would require an exorbitant amount of sentences. Instead, we initially collect interaction candidates by running MADEX over all sentences in the SST test set, then select the word interactions that appear multiple times. We assume that word interactions are ordered but not necessarily adjacent or positionally bound, e.g., (not, good) $\ne ( \mathrm { g o o d }$ , not), but their exact positions don’t matter. We use the larger IMDB dataset (Maas et al., 2011) to collect different sets of sentences that contain the same ordered words as each interaction candidate (but the sentences are otherwise random). The ranked detection counts of the target interactions on their individual sets of sentences are shown in Table 2b. The average sentence length is 33 words, and interaction occurrences are separated by 2 words on average.
|
| 210 |
+
|
| 211 |
+
# 7 CONCLUSION
|
| 212 |
+
|
| 213 |
+
We proposed a way to interpret feature interactions in general prediction models, and we proposed GLIDER to detect and encode these interactions in black-box recommender systems. In our experiments on recommendation, we found that our detected global interactions are explainable and that explicitly encoding them can improve predictions. We further validated our interaction interpretations on image, text, graph, and dna models. We hope the interpretations encourage investigation into the complex behaviors of prediction models, especially models with large societal impact. Some opportunities for future work are generating correct attributions for interaction interpretations, preventing false-positive interactions from out-of-distribution feature perturbations, and performing interaction distillation from multiple models rather than just one.
|
| 214 |
+
|
| 215 |
+
# ACKNOWLEDGMENTS
|
| 216 |
+
|
| 217 |
+
We would like to sincerely thank everyone who has provided their generous feedback for this work. Thank you Youbang Sun, Dongxu Ren, and Beibei Xin for offering early-stage brainstorming and prolonged discussions. Thank you Yuping Luo for providing advice on theoretical analysis of model interpretation. Thank you Rich Caruana for your support and insight. Thank you Artem Volkhin, Levent Ertoz, Ellie Wen, Long Jin, Dario Garcia, and the rest of the Facebook personalization team for your feedback on the paper content. Last but not least, thank you anonymous reviewers for your thorough comments and suggestions. This work was supported by National Science Foundation Awards IIS-1254206 and IIS-1539608, granted to co-author Yan Liu in her academic role at the University of Southern California.
|
| 218 |
+
|
| 219 |
+
# REFERENCES
|
| 220 |
+
|
| 221 |
+
Chunrong Ai and Edward C Norton. Interaction terms in logit and probit models. Economics letters, 80(1):123–129, 2003.
|
| 222 |
+
|
| 223 |
+
Babak Alipanahi, Andrew Delong, Matthew T Weirauch, and Brendan J Frey. Predicting the sequence specificities of dna-and rna-binding proteins by deep learning. Nature biotechnology, 33 (8):831, 2015.
|
| 224 |
+
|
| 225 |
+
Tanya Barrett, Stephen E Wilhite, Pierre Ledoux, Carlos Evangelista, Irene F Kim, Maxim Tomashevsky, Kimberly A Marshall, Katherine H Phillippy, Patti M Sherman, Michelle Holko, et al. Ncbi geo: archive for functional genomics data sets—update. Nucleic acids research, 41(D1): D991–D995, 2012.
|
| 226 |
+
|
| 227 |
+
Jacob Bien, Jonathan Taylor, and Robert Tibshirani. A lasso for hierarchical interactions. Annals of statistics, 41(3):1111, 2013.
|
| 228 |
+
|
| 229 |
+
Olivier Chapelle, Eren Manavoglu, and Romer Rosales. Simple and scalable response prediction for display advertising. ACM Transactions on Intelligent Systems and Technology (TIST), 5(4): 61, 2015.
|
| 230 |
+
|
| 231 |
+
Tianqi Chen and Carlos Guestrin. Xgboost: A scalable tree boosting system. In Proceedings of the 22nd acm sigkdd international conference on knowledge discovery and data mining, pp. 785–794. ACM, 2016.
|
| 232 |
+
|
| 233 |
+
Heng-Tze Cheng, Levent Koc, Jeremiah Harmsen, Tal Shaked, Tushar Chandra, Hrishi Aradhye, Glen Anderson, Greg Corrado, Wei Chai, Mustafa Ispir, et al. Wide & deep learning for recommender systems. In Proceedings of the 1st workshop on deep learning for recommender systems, pp. 7–10. ACM, 2016.
|
| 234 |
+
|
| 235 |
+
John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12(Jul):2121–2159, 2011.
|
| 236 |
+
|
| 237 |
+
Yingying Fan, Yinfei Kong, Daoji Li, Zemin Zheng, et al. Innovated interaction screening for highdimensional nonlinear classification. The Annals of Statistics, 43(3):1243–1272, 2015.
|
| 238 |
+
|
| 239 |
+
Aaron Fisher, Cynthia Rudin, and Francesca Dominici. Model class reliance: Variable importance measures for any machine learning model class, from the “rashomon” perspective. arXiv preprint arXiv:1801.01489, 2018.
|
| 240 |
+
|
| 241 |
+
Jerome H Friedman, Bogdan E Popescu, et al. Predictive learning via rule ensembles. The Annals of Applied Statistics, 2(3):916–954, 2008.
|
| 242 |
+
|
| 243 |
+
Muriel Gevrey, Ioannis Dimopoulos, and Sovan Lek. Two-way interaction of input variables in the sensitivity analysis of neural network models. Ecological modelling, 195(1-2):43–50, 2006.
|
| 244 |
+
|
| 245 |
+
Xavier Glorot, Antoine Bordes, and Yoshua Bengio. Deep sparse rectifier neural networks. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 315–323, 2011.
|
| 246 |
+
|
| 247 |
+
Huifeng Guo, Ruiming Tang, Yunming Ye, Zhenguo Li, and Xiuqiang He. Deepfm: a factorizationmachine based neural network for ctr prediction. In Proceedings of the 26th International Joint Conference on Artificial Intelligence, pp. 1725–1731. AAAI Press, 2017.
|
| 248 |
+
|
| 249 |
+
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.
|
| 250 |
+
|
| 251 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 252 |
+
|
| 253 |
+
Giles Hooker. Discovering additive structure in black box functions. In Proceedings of the tenth ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 575–580. ACM, 2004.
|
| 254 |
+
|
| 255 |
+
Been Kim, Martin Wattenberg, Justin Gilmer, Carrie Cai, James Wexler, Fernanda Viegas, et al. Interpretability beyond feature attribution: Quantitative testing with concept activation vectors (tcav). In International Conference on Machine Learning, pp. 2673–2682, 2018.
|
| 256 |
+
|
| 257 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. arXiv preprint arXiv:1609.02907, 2016.
|
| 258 |
+
|
| 259 |
+
Jianxun Lian, Xiaohuan Zhou, Fuzheng Zhang, Zhongxia Chen, Xing Xie, and Guangzhong Sun. xdeepfm: Combining explicit and implicit feature interactions for recommender systems. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 1754–1763. ACM, 2018.
|
| 260 |
+
|
| 261 |
+
Yin Lou, Rich Caruana, Johannes Gehrke, and Giles Hooker. Accurate intelligible models with pairwise interactions. In Proceedings of the 19th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 623–631. ACM, 2013.
|
| 262 |
+
|
| 263 |
+
Scott M Lundberg, Gabriel G Erion, and Su-In Lee. Consistent individualized feature attribution for tree ensembles. arXiv preprint arXiv:1802.03888, 2018.
|
| 264 |
+
|
| 265 |
+
Yuanfei Luo, Mengshuo Wang, Hao Zhou, Quanming Yao, Wei-Wei Tu, Yuqiang Chen, Wenyuan Dai, and Qiang Yang. Autocross: Automatic feature crossing for tabular data in real-world applications. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, 2019.
|
| 266 |
+
|
| 267 |
+
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, pp. 142–150, Portland, Oregon, USA, June 2011. Association for Computational Linguistics. URL http: //www.aclweb.org/anthology/P11-1015.
|
| 268 |
+
|
| 269 |
+
Christopher D. Manning, Prabhakar Raghavan, and Hinrich Schutze. ¨ Introduction to Information Retrieval. Cambridge University Press, New York, NY, USA, 2008. ISBN 0521865719, 9780521865715.
|
| 270 |
+
|
| 271 |
+
Fantine Mordelet, John Horton, Alexander J Hartemink, Barbara E Engelhardt, and Raluca Gordan.ˆ Stability selection for regression-based models of transcription factor–dna binding specificity. Bioinformatics, 29(13):i117–i125, 2013.
|
| 272 |
+
|
| 273 |
+
W James Murdoch, Peter J Liu, and Bin Yu. Beyond word importance: Contextual decomposition to extract interactions from lstms. International Conference on Learning Representations, 2018.
|
| 274 |
+
|
| 275 |
+
Sanjay Purushotham, Martin Renqiang Min, C-C Jay Kuo, and Rachel Ostroff. Factorized sparse learning models with interpretable high order feature interactions. In Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 552–561. ACM, 2014.
|
| 276 |
+
|
| 277 |
+
Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. Why should i trust you?: Explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining, pp. 1135–1144. ACM, 2016.
|
| 278 |
+
|
| 279 |
+
Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. Anchors: High-precision model-agnostic explanations. In AAAI Conference on Artificial Intelligence, 2018.
|
| 280 |
+
|
| 281 |
+
Romer Rosales, Haibin Cheng, and Eren Manavoglu. Post-click conversion modeling and analysis ´ for non-guaranteed delivery display advertising. In Proceedings of the fifth ACM international conference on Web search and data mining, pp. 293–302. ACM, 2012.
|
| 282 |
+
|
| 283 |
+
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.
|
| 284 |
+
|
| 285 |
+
Victor Sanh, Lysandre Debut, Julien Chaumond, and Thomas Wolf. Distilbert, a distilled version of bert: smaller, faster, cheaper and lighter. arXiv preprint arXiv:1910.01108, 2019.
|
| 286 |
+
|
| 287 |
+
Prithviraj Sen, Galileo Namata, Mustafa Bilgic, Lise Getoor, Brian Galligher, and Tina Eliassi-Rad. Collective classification in network data. AI magazine, 29(3):93–93, 2008.
|
| 288 |
+
|
| 289 |
+
Chandan Singh, W James Murdoch, and Bin Yu. Hierarchical interpretations for neural network predictions. International Conference on Learning Representations, 2019.
|
| 290 |
+
|
| 291 |
+
Sahil Singla, Eric Wallace, Shi Feng, and Soheil Feizi. Understanding impacts of high-order loss approximations and features in deep learning interpretation. arXiv preprint arXiv:1902.00407, 2019.
|
| 292 |
+
|
| 293 |
+
Richard Socher, Alex Perelygin, Jean Wu, Jason Chuang, Christopher D Manning, Andrew $\mathrm { N g }$ , and Christopher Potts. Recursive deep models for semantic compositionality over a sentiment treebank. In Proceedings of the 2013 conference on empirical methods in natural language processing, pp. 1631–1642, 2013.
|
| 294 |
+
|
| 295 |
+
Weiping Song, Chence Shi, Zhiping Xiao, Zhijian Duan, Yewen Xu, Ming Zhang, and Jian Tang. Autoint: Automatic feature interaction learning via self-attentive neural networks. arXiv preprint arXiv:1810.11921, 2018.
|
| 296 |
+
|
| 297 |
+
Daria Sorokina, Rich Caruana, Mirek Riedewald, and Daniel Fink. Detecting statistical interactions with additive groves of trees. In Proceedings of the 25th international conference on Machine learning, pp. 1000–1007. ACM, 2008.
|
| 298 |
+
|
| 299 |
+
Dorothee Staiger, Hildegard Kaulen, and Jeff Schell. A cacgtg motif of the antirrhinum majus chalcone synthase promoter is recognized by an evolutionarily conserved nuclear protein. Proceedings of the National Academy of Sciences, 86(18):6930–6934, 1989.
|
| 300 |
+
|
| 301 |
+
Mukund Sundararajan, Ankur Taly, and Qiqi Yan. Axiomatic attribution for deep networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3319– 3328. JMLR. org, 2017.
|
| 302 |
+
|
| 303 |
+
Kai Sheng Tai, Richard Socher, and Christopher D Manning. Improved semantic representations from tree-structured long short-term memory networks. arXiv preprint arXiv:1503.00075, 2015.
|
| 304 |
+
|
| 305 |
+
Michael Tsang, Dehua Cheng, and Yan Liu. Detecting statistical interactions from neural network weights. arXiv preprint arXiv:1705.04977, 2017.
|
| 306 |
+
|
| 307 |
+
Andrea Vedaldi and Stefano Soatto. Quick shift and kernel methods for mode seeking. In European Conference on Computer Vision, pp. 705–718. Springer, 2008.
|
| 308 |
+
|
| 309 |
+
MK Vijaymeena and K Kavitha. A survey on similarity measures in text mining. Machine Learning and Applications: An International Journal, 3(2):19–28, 2016.
|
| 310 |
+
|
| 311 |
+
Meng Wang, Cheng Tai, Weinan E, and Liping Wei. Define: deep convolutional neural networks accurately quantify intensities of transcription factor-dna binding and facilitate evaluation of functional non-coding variants. Nucleic acids research, 46(11):e69–e69, 2018.
|
| 312 |
+
|
| 313 |
+
Ruoxi Wang, Bin Fu, Gang Fu, and Mingliang Wang. Deep & cross network for ad click predictions. In Proceedings of the ADKDD’17, pp. 12. ACM, 2017.
|
| 314 |
+
|
| 315 |
+
Lin Yang, Tianyin Zhou, Iris Dror, Anthony Mathelier, Wyeth W Wasserman, Raluca Gordan, and ˆ Remo Rohs. Tfbsshape: a motif database for dna shape features of transcription factor binding sites. Nucleic acids research, 42(D1):D148–D155, 2013.
|
| 316 |
+
|
| 317 |
+
Haoyang Zeng, Matthew D Edwards, Ge Liu, and David K Gifford. Convolutional neural network architectures for predicting dna–protein binding. Bioinformatics, 32(12):i121–i127, 2016.
|
| 318 |
+
|
| 319 |
+
# A EFFECT OF EXTRA PARAMETERS BY INTERACTION ENCODINGS VS. ENLARGED EMBEDDINGS
|
| 320 |
+
|
| 321 |
+
In this section, we study whether increasing embedding size can obtain similar prediction performance gains as explicitly encoding interactions via GLIDER. We increase the embedding dimension sizes of every sparse feature in baseline recommender models to match the total number of model parameters of baseline $^ +$ GLIDER as close as possible. The embedding sizes we used to obtain similar parameter counts are shown in Table 6. For the Avazu dataset, all of the embedding sizes remain unchanged because they were already the target size. The corresponding prediction performances of all models are shown in Table 7. We observed that directly increasing embedding size / parameter counts generally did not give the same level of performance gains that GLIDER provided.
|
| 322 |
+
|
| 323 |
+
Table 6: Comparison of # model parameters between baseline models with enlarged embeddings and original baselines $^ +$ GLIDER (from Tables 3 and 4). The models with enlarged embeddings are denoted by the asterick $( ^ { * } )$ . The embedding dimension of sparse features is denoted by “emb. size”. Percent differences are relative to baseline\* models. M denotes million, and the ditto mark (”) means no change in the above line.
|
| 324 |
+
|
| 325 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">Criteo</td><td colspan="2">Avazu</td></tr><tr><td>emb. size</td><td># params</td><td>emb. size</td><td># params</td></tr><tr><td>Wide&Deep*</td><td>17</td><td>19.1M</td><td>16</td><td>27.3M</td></tr><tr><td>Wide&Deep</td><td>16</td><td>18.1M</td><td>16</td><td>;</td></tr><tr><td>+ GLIDER</td><td>16</td><td>19.3M (+1.1%)</td><td>16</td><td>27.6M (+1.0%)</td></tr><tr><td>DeepFM*</td><td>17</td><td>18.5M</td><td>16</td><td>26.7M</td></tr><tr><td>DeepFM</td><td>16</td><td>17.5M</td><td>16</td><td>;</td></tr><tr><td>+GLIDER</td><td>16</td><td>18.3M(-0.9%)</td><td>16</td><td>26.9M (+0.6%)</td></tr><tr><td>Deep&Cross*</td><td>17</td><td>18.5M</td><td>16</td><td>26.1M</td></tr><tr><td>Deep&Cross</td><td>16</td><td>17.5M</td><td>16</td><td>;</td></tr><tr><td>+ GLIDER</td><td>16</td><td>18.7M(+1.0%)</td><td>16</td><td>26.4M (+1.0%)</td></tr><tr><td>xDeepFM*</td><td>19</td><td>21.5M</td><td>16</td><td>27.6M</td></tr><tr><td>xDeepFM</td><td>16</td><td>18.5M</td><td>16</td><td>;</td></tr><tr><td>+GLIDER</td><td>16</td><td>21.7M (+0.7%)</td><td>16</td><td>28.3M (+2.5%)</td></tr><tr><td>AutoInt*</td><td>17</td><td>17.4M</td><td>16</td><td>25.1M</td></tr><tr><td>AutoInt</td><td>16</td><td>16.4M</td><td>16</td><td>;</td></tr><tr><td>+ GLIDER</td><td>16</td><td>17.3M(-1.0%)</td><td>16</td><td>25.2M (+0.6%)</td></tr></table>
|
| 326 |
+
|
| 327 |
+
Table 7: Test prediction performance corresponding to the models shown in Table 6
|
| 328 |
+
|
| 329 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">Criteo</td><td colspan="2">Avazu</td></tr><tr><td>AUC</td><td>logloss</td><td>AUC</td><td>logloss</td></tr><tr><td>Wide&Deep*</td><td>0.8072 ± 3e-4</td><td>0.4443 ± 2e-4</td><td>0.7794±3e-4</td><td>0.3804± 2e-4</td></tr><tr><td>Wide&Deep</td><td>0.8069± 5e-4</td><td>0.4446± 4e-4</td><td>;</td><td>;</td></tr><tr><td>+ GLIDER</td><td>0.8080 ±3e-4</td><td>0.4436 ± 3e-4</td><td>0.7795± 1e-4</td><td>0.3802 ± 9e-5</td></tr><tr><td>DeepFM*</td><td>0.8080±4e-4</td><td>0.4435 ± 4e-4</td><td>0.7792 ± 3e-4</td><td>0.3804 ± 9e-5</td></tr><tr><td>DeepFM</td><td>0.8079±3e-4</td><td>0.4436± 2e-4</td><td>;</td><td>;</td></tr><tr><td>+GLIDER</td><td>0.8097± 2e-4</td><td>0.4420± 2e-4</td><td>0.7795± 2e-4</td><td>0.3802 ± 2e-4</td></tr><tr><td>Deep&Cross*</td><td>0.8081±2e-4</td><td>0.4434±2e-4</td><td>0.7791± 2e-4</td><td>0.3805 ±1e-4</td></tr><tr><td>Deep&Cross + GLIDER</td><td>0.8076±2e-4</td><td>0.4438 ± 2e-4</td><td>;</td><td>;</td></tr><tr><td></td><td>0.8086 ±3e-4</td><td>0.4428 ± 2e-4</td><td>0.7792 ± 2e-4</td><td>0.3803 ± 9e-5</td></tr><tr><td>xDeepFM* xDeepFM</td><td>0.8088±1e-4</td><td>0.4429 ±1e-4</td><td>0.7785±3e-4 ”</td><td>0.3808± 2e-4</td></tr><tr><td>+ GLIDER</td><td>0.8084± 2e-4</td><td>0.4433 ± 2e-4</td><td></td><td>”</td></tr><tr><td>AutoInt*</td><td>0.8097 ± 3e-4</td><td>0.4421± 3e-4</td><td>0.7787± 4e-4</td><td>0.3806 ± 1e-4</td></tr><tr><td>AutoInt</td><td>0.8087±2e-4</td><td>0.4431± 1e-4</td><td>0.7774±1e-4</td><td>0.3811 ± 8e-5</td></tr><tr><td></td><td>0.8083</td><td>0.4434</td><td>”</td><td>;</td></tr><tr><td>+ GLIDER</td><td>0.8090 ± 2e-4</td><td>0.4426± 2e-4</td><td>0.7773±1e-4</td><td>0.3811 ± 5e-5</td></tr></table>
|
| 330 |
+
|
| 331 |
+
# B EFFECT OF DENSE FEATURE BUCKETIZATION
|
| 332 |
+
|
| 333 |
+
We examine the effect of dense feature bucketization on cross feature parameter efficiency for the Criteo dataset, which contains 13 dense features. Figure 5 shows the effects of varying the number of dense buckets on the embedding sizes of the cross features involving dense features. Both the effects on the average and individual embedding size are shown. 14 out of 40 of the cross features involved a dense feature. Different cross features show different parameter patterns as the number of buckets increases (Figure 5b). One one hand, the parameter count sometimes increases then asymptotes. Our requirement that a valid cross feature ID occurs more than $T$ times (§4.2) restricts the growth in parameters. On the other hand, the parameter count sometimes decreases, which happens when the dense bucket size becomes too small to satisfy the $T$ occurrence restriction. In all cases, the parameter counts are kept limited, which is important for overall parameter efficiency.
|
| 334 |
+
|
| 335 |
+

|
| 336 |
+
Figure 5: The effects of varying the number of buckets on (a) on the average embedding size of cross features involving dense features and (b) the individual embedding sizes of the same cross features.
|
| 337 |
+
|
| 338 |
+
# C STOP WORDS
|
| 339 |
+
|
| 340 |
+
For all qualitative interpretations on text (in $\ S 6 . 3 . 2$ and Appendix D), we preprocessed sentences to remove stop words. We use the same stop words suggested by Manning et al. (2008), i.e., $\{ \mathbf { a } ,$ , an, and, are, as, at, be, by, for, from, has, he, in, is, it, its, of, on, that, the, to, was, were, will, with $\}$ .
|
| 341 |
+
|
| 342 |
+
# D QUALITATIVE RESULTS ON SENTIMENT-LSTM VS. BERT
|
| 343 |
+
|
| 344 |
+
In this section, we compare the word interactions discovered by MADEX on Sentiment-LSTM versus BERT. These models perform with accuracies of $8 7 \%$ and $9 2 \%$ respectively on the SST test set. We use a public pre-trained BERT, i.e., DistilBERT (Sanh et al., 2019), which is available online8. The interaction detector we use is GradientNID $( \ S 3 . 2 . 2 )$ , and sample weighting is disabled for this comparison. The top-2 interactions for each model are shown in Table 8 on random sentences from the SST test set.
|
| 345 |
+
|
| 346 |
+
Table 8: Top-ranked word interactions $\mathcal { T } _ { i }$ from Sentiment-LSTM and BERT on randomly selected sentences in the SST test set.
|
| 347 |
+
|
| 348 |
+
<table><tr><td rowspan="2">Original sentence</td><td colspan="2">Sentiment-LSTM</td><td colspan="2">BERT</td></tr><tr><td>I</td><td>I</td><td>I</td><td>I</td></tr><tr><td>An intelligent, earnest, intimate film that drops the ball only when it pauses for blunt exposition to make sure you're getting its metaphysical point.</td><td>intelligent, metaphysical</td><td>metaphysical, point</td><td>intelligent, earnest</td><td>drops, ball</td></tr><tr><td>It's not so much enjoyable to watch as it is enlightening to listen to new sides of a previous reality,and to visit with some of the people who were able to make an impact in the theater world.</td><td>not, enjoyable</td><td>not, so</td><td>not, much</td><td>not, enlightening</td></tr><tr><td>Uneasy mishmash of styles and genres.</td><td>uneasy, mishmash</td><td>mishmash, genres</td><td>uneasy, mishmash</td><td>uneasy, styles</td></tr><tr><td>You're better off staying home and watching the X-Files.</td><td>x, files</td><td>off, x</td><td>better, off</td><td>you, off</td></tr><tr><td>If this is the Danish idea of a good time, prospective tourists might want to consider a different destination-some jolly country embroiled ina bloody civil war,perhaps.</td><td>if, this</td><td>if, good</td><td>if, jolly</td><td> jolly, country</td></tr><tr><td>We can see the wheels turning,and we might resent it sometimes,but this is still a nice little picture,made by bright and friendly souls with a lot of good cheer.</td><td>resent, nice</td><td>we,resent</td><td>nice, good</td><td>nice,made</td></tr><tr><td>One of the greatest family-oriented, fantasy-adventure movies ever.</td><td>family, oriented</td><td>greatest, family</td><td>greatest, family</td><td>adventure, movies</td></tr><tr><td>It's so full of wrong choices that all you can do is shake your head in disbelief- and worry about what classic Oliver Parker intends to mangle next time.</td><td>so,wrong</td><td>full, wrong</td><td>so, wrong</td><td>so, full</td></tr><tr><td>Itsmysteries are transparentlyobvious,and it's too slowly paced to be a thriller.</td><td>mysteries, transparently</td><td>paced, thriller</td><td>too, thriller</td><td>too, paced</td></tr><tr><td>This miserable excuse of a movie runs on empty,believing flatbush machismo will get it through.</td><td>miserable, runs</td><td>excuse,get</td><td>runs,empty</td><td>miserable, runs</td></tr></table>
|
| 349 |
+
|
| 350 |
+
# E ADDITIONAL QUALITATIVE RESULTS FOR RESNET152
|
| 351 |
+
|
| 352 |
+

|
| 353 |
+
Figure 6: Additional qualitative results, following Figure 4a, on random test images in ImageNet. Interactions are denoted by $\mathcal { T } _ { i }$ and are unordered. Overlapping interactions with overlap coefficient $\geq 0 . 5$ are merged to reduce $| \{ \mathcal { T } _ { i } \} |$ per test image.
|
| 354 |
+
|
| 355 |
+
# F DETECTION PERFORMANCE OF MADEX VS. BASELINES
|
| 356 |
+
|
| 357 |
+
We compare the detection performances between MADEX and baselines on identifying feature interactions learned by complex models, i.e., XGBoost (Chen & Guestrin, 2016), Multilayer Perceptron (MLP), and Long Short-Term Memory Network (LSTM) (Hochreiter & Schmidhuber, 1997). The baselines are Tree-Shap: a method to identify interactions in tree-based models like XGBoost (Lundberg et al., 2018), MLP-ACD+: a modified version of ACD (Singh et al., 2019; Murdoch et al., 2018) to search all pairs of features in MLP to find the best interaction candidate, and LSTM-ACD+: the same as MLP-ACD $^ +$ but for LSTMs. All baselines are local interpretation methods. For MADEX, we sample continuous features from a truncated normal distribution $\mathcal { N } ( \mathbf { x } , \sigma ^ { 2 } \mathbf { I } )$ centered at a specified data instance $\mathbf { x }$ and truncated at $\sigma$ . Our MADEX experiments consist of two methods, NID and GradNID (shorthand for GradientNID).
|
| 358 |
+
|
| 359 |
+
Table 9: Data generating functions with interactions
|
| 360 |
+
|
| 361 |
+
<table><tr><td>F1(x)=</td><td>10x1x2+</td></tr><tr><td>F2(x)=</td><td>x102+∑3i 10</td></tr><tr><td>F3(x)=</td><td></td></tr><tr><td>F4(x)=</td><td></td></tr></table>
|
| 362 |
+
|
| 363 |
+
We evaluate interaction detection performance by using synthetic data where ground truth interactions are known (Hooker, 2004; Sorokina et al., 2008). We generate 10e3 samples of synthetic data using functions $F _ { 1 } - F _ { 4 }$ (Table 9) with continuous features uniformly distributed between $- 1$ to 1. Next, we train complex models (XGBoost, MLP, and LSTM) on this data. Lastly, we run MADEX and the baselines on 10 trials of 20 data instances at randomly sampled locations on the synthetic function domain. Between trials, the complex models are trained with different random initialization to test the stability of each interpretation method. Interaction detection performance is computed by the average R-precision (Manning et al., $2 0 0 8 ) ^ { 9 }$ of interaction rankings across the sampled data instances.
|
| 364 |
+
|
| 365 |
+
Results are shown in Table 10. MADEX (NID and GradNID) performs well compared to the baselines. On the tree-based model, MADEX can compete with the tree-specific baseline Tree-Shap, which only detects pairwise interactions. On MLP and LSTM, MADEX performs significantly better than $\mathbf { A C D + }$ . The performance gain is especially large in the LSTM setting. Comparing NID and GradNID, NID tends to perform better in this experiment because it takes its entire sampling region into account whereas GradNID examines a single data instance.
|
| 366 |
+
|
| 367 |
+
Table 10: Detection Performance in R-Precision (higher the better). $\sigma = 0 . 6$ (max: 3.2). “Tree” is XGBoost. \*Does not detect higher-order interactions. $\dagger$ Requires an exhaustive search of all feature combinations.
|
| 368 |
+
|
| 369 |
+
<table><tr><td></td><td colspan="3">Tree</td><td colspan="3">MLP</td><td colspan="3">LSTM</td></tr><tr><td></td><td>Tree-Shap</td><td>NID</td><td>GradNID</td><td>MLP-ACD+</td><td>NID</td><td>GradNID</td><td>LSTM-ACD+</td><td>NID</td><td>GradNID</td></tr><tr><td>F1(x)</td><td>1±0</td><td>1±0</td><td>0.96± 0.04</td><td>0.63±0.08</td><td>1±0</td><td>1±0</td><td>0.3±0.2</td><td>1±0</td><td>1±0</td></tr><tr><td>F(x)</td><td>1±0</td><td>0.3± 0.4</td><td>0.6±0.4</td><td>0.41 ± 0.06</td><td>1±0</td><td>0.95 ± 0.04</td><td>0.01±0.02</td><td>0.99 ±0.02</td><td>0.95±0.04</td></tr><tr><td>F(x)</td><td>1±0</td><td>1±0</td><td>1±0</td><td>0.3±0.2</td><td>1±0</td><td>1±0</td><td>0.05±0.08</td><td>1±0</td><td>1±0</td></tr><tr><td>F4(x)</td><td>*</td><td>1±0</td><td>+</td><td>+</td><td>1±0</td><td>+</td><td>+</td><td>1±0</td><td>+</td></tr></table>
|
| 370 |
+
|
| 371 |
+
# G HIGHER-ORDER INTERACTIONS
|
| 372 |
+
|
| 373 |
+
This section shows how often different orders of higher-order interactions are identified by GLIDER / MADEX. Figure 7 plots the occurrence counts of global interactions detected in AutoInt for the Criteo and Avazu dataset, which correspond to the results in Figure 2. Here we show the occurrence counts of higher-order interactions, where the exact interaction cardinality is annotated besides each data point. 3-way interactions are the most common type, followed by 4-, then 5-way interactions.
|
| 374 |
+
|
| 375 |
+
Figure 8 plots histograms of interaction cardinalities for all interactions detected from ResNet152 and Sentiment-LSTM across 1000 random samples in their test sets. The average number of features are 66 and 18 for ResNet152 and Sentiment-LSTM respectively. Higher-order interactions are common in both models.
|
| 376 |
+
|
| 377 |
+

|
| 378 |
+
Figure 7: Occurrence counts (total: 1000) vs. rank of interactions detected from AutoInt on (a) Criteo and (b) Avazu datasets. Each higher-order interaction is annotated with its interaction cardinality.
|
| 379 |
+
|
| 380 |
+

|
| 381 |
+
Figure 8: Histograms of interaction sizes for interactions detected in (a) ResNet152 and (b) Sentiment-LSTM across 1000 random samples in respective test sets.
|
md/train/BkgzniCqY7/BkgzniCqY7.md
ADDED
|
@@ -0,0 +1,580 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# STRUCTURED ADVERSARIAL ATTACK: TOWARDS GENERAL IMPLEMENTATION AND BETTER INTERPRETABILITY
|
| 2 |
+
|
| 3 |
+
Kaidi $\mathbf { X } \mathbf { u } ^ { 1 * }$ Sijia $\mathbf { L i u ^ { 2 * } }$ Pu Zhao1 Pin-Yu Chen2 Huan Zhang3 Quanfu Fan2
|
| 4 |
+
Deniz Erdogmus1 Yanzhi Wang1 Xue Lin1
|
| 5 |
+
1Northeastern University, USA
|
| 6 |
+
2MIT-IBM Watson AI Lab, IBM Research, USA
|
| 7 |
+
3University of California, Los Angeles, USA
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
When generating adversarial examples to attack deep neural networks (DNNs), $\ell _ { p }$ norm of the added perturbation is usually used to measure the similarity between original image and adversarial example. However, such adversarial attacks perturbing the raw input spaces may fail to capture structural information hidden in the input. This work develops a more general attack model, i.e., the structured attack (StrAttack), which explores group sparsity in adversarial perturbations by sliding a mask through images aiming for extracting key spatial structures. An ADMM (alternating direction method of multipliers)-based framework is proposed that can split the original problem into a sequence of analytically solvable subproblems and can be generalized to implement other attacking methods. Strong group sparsity is achieved in adversarial perturbations even with the same level of $\ell _ { p }$ -norm distortion $( p \in \{ 1 , 2 , \infty \} )$ as the stateof-the-art attacks. We demonstrate the effectiveness of StrAttack by extensive experimental results on MNIST, CIFAR-10 and ImageNet. We also show that StrAttack provides better interpretability (i.e., better correspondence with discriminative image regions) through adversarial saliency map (Papernot et al., 2016b) and class activation map (Zhou et al., 2016). Our code is available at https://github.com/KaidiXu/StrAttack.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Deep learning achieves exceptional successes in domains such as image recognition (He et al., 2016; Geifman & ElYaniv, 2017), natural language processing (Hinton et al., 2012; Harwath et al., 2016), medical diagnostics (Chen et al., 2016; Shi et al., 2018) and advanced control (Silver et al., 2016; Fu et al., 2017). Recent studies (Szegedy et al., 2013; Goodfellow et al., 2014; Nguyen et al., 2015; Kurakin et al., 2016; Carlini & Wagner, 2017) show that DNNs are vulnerable to adversarial attacks implemented by generating adversarial examples, i.e., adding well-designed perturbations to original legal inputs. Delicately crafted adversarial examples can mislead a DNN to recognize them as any target image label, while the perturbations appears unnoticeable to human eyes. Adversarial attacks against
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Group sparsity demonstrated in adversarial perturbations obtained by C&W attack and our StrAttack, where ‘ostrich’ is the original label, and ‘unicycle’ is the misclassified label. Here each group is a region of $1 3 \times 1 3 \times 3$ pixels and the strength of adversarial perturbations (through their $\ell _ { 2 }$ norm) at each group is represented by heatmap. C&W attack perturbs almost all groups, while StrAttack yields strong group sparsity, with more semantic structure: the perturbed image region matches the feature of the target object, namely, the frame of the unicycle.
|
| 19 |
+
|
| 20 |
+
DNNs not only exist in theoretical models
|
| 21 |
+
|
| 22 |
+
but also pose potential security threats to the real world (Kurakin et al., 2016; Evtimov et al., 2017; Papernot et al., 2017). Several explanations are proposed to illustrate why there exist adversarial examples to DNNs based on hypotheses such as model linearity and data manifold (Goodfellow et al., 2014; Gilmer et al., 2018). However, little is known to their origins, and convincing explanations remain to be explored.
|
| 23 |
+
|
| 24 |
+
Besides achieving the goal of (targeted) mis-classification, an adversarial example should be as “similar” to the original legal input as possible to be stealthy. Currently, the similarity is measured by the $\ell _ { p }$ norm $( p = 0 , 1 , 2 , \infty )$ of the added perturbation (Szegedy et al., 2013; Carlini & Wagner, 2017; Chen et al., 2017b;a), i.e., $\ell _ { p }$ norm is being minimized when generating adversarial example. However, measuring the similarity between the original image and its adversarial example by $\ell _ { p }$ norm is neither necessary nor sufficient (Sharif et al., 2018). Besides, no single measure can be perfect for human perceptual similarity (Carlini & Wagner, 2017) and such adversarial attacks may fail to capture key information hidden in the input such as spatial structure or distribution. Spurred by that, this work implements a new attack model i.e., structured attack (StrAttack) that imposes group sparsity on adversarial perturbations by extracting structures from the inputs. As shown in Fig. 1, we find that StrAttack identifies minimally sufficient regions that make attacks successful, but without incurring extra pixel-level perturbation power. The major contributions are summarized as below.
|
| 25 |
+
|
| 26 |
+
• (Structure-driven attack) This work is the first attempt towards exploring group-wise sparse structures when implementing adversarial attacks, but without losing $\ell _ { p }$ distortion performance when compared to state-of-the-art attacking methods. (Generality) We show that the proposed attack model covers many norm-ball based attacks such as C&W (Carlini & Wagner, 2017) and EAD (Chen et al., 2017a). (Efficient implementation) We develop an efficient algorithm to generate structured adversarial perturbations by leveraging the alternating direction method of multipliers (ADMM). We show that ADMM splits the original complex problem into subproblems, each of which can be solved analytically. Besides, we show that ADMM can further be used to refine an arbitrary adversarial attack under the fixed sparse structure. (Interpretability) The generated adversarial perturbations demonstrate clear correlations and interpretations between original and target images. With the aid of adversarial saliency map (Papernot et al., 2016b) and class activation map (Zhou et al., 2016), we show that the obtained group-sparse adversarial patterns better shed light on the mechanisms of adversarial perturbations to fool DNNs.
|
| 27 |
+
|
| 28 |
+
Related work Many works studied norm-ball constrained adversarial attacks. For example, FGM (Goodfellow et al., 2014) and IFGSM (Kurakin et al., 2017) attack methods were proposed to maximize the classification error subject to $\ell _ { \infty }$ -norm based distortion constraints. Moreover, L-BFGS (Szegedy et al., 2013) and C&W (Carlini & Wagner, 2017) attacks found an adversarial example by minimizing its $\ell _ { 2 }$ -norm distortion. By contrast, JSMA (Papernot et al., 2016b) and one-pixel (Su et al., 2017) attacks attempted to generate adversarial examples by perturbing the minimum number of pixels, namely, minimizing the $\ell _ { 0 }$ norm of adversarial perturbations. Different from the above norm-ball constrained attacks, some works (Karmon et al., 2018; Brown et al., 2017) crafted adversarial examples by adding noise patches. However, the resulting adversarial perturbations are no longer imperceptible to humans. Here we argue that imperceptibility could be important since it helps us to understand how/why DNNs are vulnerable to adversarial attacks while perturbing natural examples just by indistinguished adversarial noise.
|
| 29 |
+
|
| 30 |
+
In the aforementioned norm-ball constrained adversarial attacks, two extremely opposite principles have been applied: C&W attack (or $\ell _ { \infty }$ attacks) seeks the minimum image-level distortion but allows to modify all pixels; one-pixel attack only perturbs a few pixels but suffers a high pixel-level distortion. Both attacking principles might lead to a high noise visibility due to perturbing too many pixels or perturbing a few pixels too much. In this work, we wonder if there exists a more effective attack that can be as successful as existing attacks but achieves a tradeoff between the perturbation power and the number of perturbed pixels. We will show that the proposed StrAttack is able to identify sparse perturbed regions that make attacks successful, but without incurring extra pixel-level perturbations. It is also worth mentioning that one-pixel attack has much lower attack success rate on ImageNet than C&W attack and StrAttack.
|
| 31 |
+
|
| 32 |
+
In addition to adversarial attacks, many defense works have been proposed. Examples include defensive distillation (Papernot et al., 2016c) that distills the original DNN and introduces temperature into the softmax layer, random mask (Anonymous, 2019) that modifies the DNN structures by randomly removing certain neurons before training, adversarial training through enlarging the training dataset with adversarial examples, and robust adversarial training (Madry et al., 2017; Sinha et al., 2018) through the min-max optimization. It is commonly known that the robust adversarial training method ensures the strongest defense performance against adversarial attacks on MNIST and CIFAR-10. In this work, we will evaluate the effectiveness of StrAttack to three defense methods, a) defensive distillation (Papernot et al., 2016c), b) adversarial training via data augmentation (Tramèr et al., 2018) and c) robust adversarial training (Madry et al., 2017).
|
| 33 |
+
|
| 34 |
+
Although the adversarial attack and defense have attracted an increasing amount of attention, the visual explanation on adversarial perturbations is less explored since the distortion power is minimized and the resulting adversarial effects become imperceptible to humans. The work (Dong et al., 2017) attempted to understand how the internal representations of DNNs are affected by adversarial examples. However, only an ensemble-based attack was considered, which fails to distinguish the effectiveness of different norm-ball constrained adversarial attacks. Unlike (Dong et al., 2017), we employ the interpretability tools, adversarial saliency map (ASM) (Papernot et al., 2016b) and class activation map (CAM) (Zhou et al., 2016) to measure the effectiveness of different attacks in terms of their interpretability. Here ASM provides sensitivity analysis for pixel-level perturbation’s impact on label classification, and CAM localizes class-specific image discriminative regions (Xiao et al., 2018). We will show that the sparse adversarial pattern obtained by StrAttack offers a great interpretability through ASM and CAM compared with other norm-ball constrained attacks.
|
| 35 |
+
|
| 36 |
+
# 2 STRUCTURED ATTACK: EXPLORE GROUP STRUCTURES FROM IMAGES
|
| 37 |
+
|
| 38 |
+
In the section, we introduce the concept of StrAttack, motivated by the question: ‘what possible structures could adversarial perturbations have to fool DNNs?’ Our idea is to divide an image into sub-groups of pixels and then penalize the corresponding group-wise sparsity. The resulting sparse groups encode minimally sufficient adversarial effects on local structures of natural images.
|
| 39 |
+
|
| 40 |
+
Let $\pmb { \Delta } \in \mathbb { R } ^ { W \times H \times C }$ be an adversarial perturbation added to an original image $\mathbf { X } _ { 0 }$ , where $W \times H$ gives the spatial region, and $C$ is the depth, e.g., $C = 3$ for RGB images. To characterize the local structures of $\pmb { \Delta }$ , we introduce a sliding mask $\mathcal { M }$ with stride $S$ and size $r \times r \times C$ . When $S = 1$ , the mask moves one pixel at a time; When $S = 2$ , the mask jumps 2 pixels at a time while sliding. By adjusting the stride $S$ and the mask size $r$ , different group splitting schemes can be obtained. If $S \ < \ r$ , the resulting groups will contain overlapping pixels. By contrast, groups will become non-overlapped when $S = r$ .
|
| 41 |
+
|
| 42 |
+
A sliding mask $\mathcal { M }$ finally divides $\pmb { \Delta }$ into a set of groups $\{ \Delta _ { { \mathcal G } _ { p , q } } \}$ for $p \in [ P ]$ and $q \in [ Q ]$ , where $P = ( W - r ) / S + 1$ , $Q = ( H - r ) / S + 1$ , and $[ n ]$ denotes the integer set $\{ 1 , 2 , \ldots , n \}$ . Given the groups $\{ \Delta _ { { \mathcal G } _ { p , q } } \}$ , the group sparsity can be characterized through the following sparsity-inducing function (Yuan $\&$ Lin, 2006; Bach et al., 2012; Liu et al., 2015), motivated by the problem of group Lasso (Yuan & Lin, 2006):
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\begin{array} { r } { g ( \Delta ) = \sum _ { p = 1 } ^ { P } \sum _ { q = 1 } ^ { Q } \| \Delta { \mathcal { G } } _ { p , q } \| _ { 2 } , } \end{array}
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
where $\Delta _ { { \mathcal G } _ { p , q } }$ denotes the set of pixels of $\pmb { \Delta }$ indexed by $\mathcal { G } _ { p , q }$ , and $\| \cdot \| _ { 2 }$ is the $\ell _ { 2 }$ norm. We refer readers to Fig. A1 for an illustrative example of our concepts on groups and group sparsity.
|
| 49 |
+
|
| 50 |
+
# 3 STRUCTURED ADVERSARIAL ATTACK WITH ADMM
|
| 51 |
+
|
| 52 |
+
In this section, we start by proposing a general framework to generate prediction-evasive adversarial examples, where the adversary relies only on gradients of the loss function with respect to inputs of DNNs. Our model takes into account both commonly-used adversarial distortion metrics and the proposed group-sparsity regularization that encodes spatial structures in attacks. We show that the process of generating structured adversarial examples leads to an optimization problem that is difficult to solve using the existing optimizers Adam (for C&W attack) and FISTA (for EAD attack) (Carlini & Wagner, 2017; Chen et al., 2017a). To circumvent this challenge, we develop an efficient optimization method via alternating direction method of multipliers (ADMM).
|
| 53 |
+
|
| 54 |
+
Given an original image $\mathbf { x } _ { 0 } \in \mathbb { R } ^ { n }$ , we aim to design the optimal adversarial perturbation $\pmb { \delta } \in \mathbb { R } ^ { n }$ so that the adversarial example $( \mathbf { x } _ { 0 } + \pmb { \delta } )$ misleads DNNs trained on natural images. Throughout this paper, we use vector representations of the adversarial perturbation $\pmb { \Delta }$ and the original image $\mathbf { X } _ { 0 }$ without loss of generality. A well designed perturbation $\pmb { \delta }$ can be obtained by solving optimization problems of the following form,
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\begin{array} { r l } { \underset { \delta } { \mathrm { m i n i m i z e } } } & { \ f ( \mathbf { x } _ { 0 } + \pmb { \delta } , t ) + \gamma D ( \pmb { \delta } ) + \tau g ( \pmb { \delta } ) } \\ { \mathrm { s u b j e c t ~ t o } } & { \ ( \mathbf { x } _ { 0 } + \pmb { \delta } ) \in [ 0 , 1 ] ^ { n } , \ \lVert \pmb { \delta } \rVert _ { \infty } \leq \epsilon , } \end{array}
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
where $f ( \mathbf { x } , t )$ denotes the loss function for crafting adversarial example given a target class $t$ , $D ( \delta )$ is a distortion function that controls the perceptual similarity between a natural image and a perturbed image, $\begin{array} { r } { g ( \delta ) = \sum _ { p = 1 } ^ { P } \sum _ { q = 1 } ^ { Q } \| \delta _ { { \mathcal G } _ { p , q } } \| _ { 2 } } \end{array}$ is given by (1), and $\| \cdot \| _ { p }$ signifies the $\ell _ { p }$ norm. In problem (2), the ‘hard’ constraints ensure the validness of created adversarial examples with $\epsilon$ - tolerant perturbed pixel values. And the non-negative regularization parameters $\gamma$ and $\tau$ place our emphasis on the distortion of an adversarial example (to an original image) and group sparsity of adversarial perturbation. Tuning the regularization parameters will be discussed in Appendix F.
|
| 61 |
+
|
| 62 |
+
Problem (2) gives a quite general formulation for design of adversarial examples. If we remove the group-sparsity regularizer $g ( \delta )$ and the $\ell _ { \infty }$ constraint, problem (2) becomes the same as the C&W attack (Carlini & Wagner, 2017). More specifically, if we further set the distortion function $D ( \delta )$ to the form of $\ell _ { 0 }$ , $\ell _ { 2 }$ or $\ell _ { \infty }$ norm, then we obtain C&W $\ell _ { 0 }$ , $\ell _ { 2 }$ or $\ell _ { \infty }$ attack. If $D ( \delta )$ is specified by the elastic-net regularizer, then problem (2) becomes the formulation of EAD attack (Chen et al., 2017a).
|
| 63 |
+
|
| 64 |
+
In this paper, we specify the loss function of problem (2) as below, which yields the best known performance of adversaries (Carlini & Wagner, 2017),
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
f ( \mathbf { x } _ { 0 } + \pmb { \delta } , t ) = c \cdot \operatorname* { m a x } \{ \operatorname* { m a x } _ { j \neq t } Z ( \mathbf { x } _ { 0 } + \pmb { \delta } ) _ { j } - Z ( \mathbf { x } _ { 0 } + \pmb { \delta } ) _ { t } , - \kappa \} ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $Z ( \mathbf { x } ) _ { j }$ is the $j$ th element of logits $Z ( \mathbf { x } )$ , representing the output before the last softmax layer in DNNs, and $\kappa$ is a confidence parameter that is usually set to zero if the attack transferability is not much cared. We choose $D ( \delta ) \overset { \cdot } { = } \lVert \delta \rVert _ { 2 } ^ { 2 }$ for a fair comparison with the $\mathrm { C } \& \mathbf { W } \ \ell _ { 2 }$ adversarial attack. In this section, we assume that $\{ \mathcal { G } _ { p , q } \}$ are non-overlapping groups, i.e., $\mathcal { G } _ { p , q } \cap \mathcal { G } _ { p ^ { \prime } , q ^ { \prime } } = \emptyset$ for $q \neq q ^ { \prime }$ or $p \neq p ^ { \prime }$ . The overlapping case will be studied in the next section.
|
| 71 |
+
|
| 72 |
+
The presence of multiple non-smooth regularizers and ‘hard’ constraints make the existing optimizers Adam and FISTA (Carlini & Wagner, 2017; Chen et al., $2 0 1 7 \mathrm { a }$ ; Kingma & Ba, 2015; Beck & Teboulle, 2009) inefficient for solving problem (2). First, the subgradient of the objective function of problem (2) is difficult to obtain especially when $\{ \mathcal { G } _ { p , q } \}$ are overlapping groups. Second, it is impossible to compute the proximal operations required for FISTA with respect to all non-smooth regularizers and ‘hard’ constraints. Different from the existing work, we show that ADMM, a firstorder operator splitting method, helps us to split the original complex problem (2) into a sequence of subproblems, each of which can be solved analytically.
|
| 73 |
+
|
| 74 |
+
We reformulate problem (2) in a way that lends itself to the application of ADMM,
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\begin{array} { r l } { \underset { \delta , { \mathbf z } , { \mathbf w } , { \mathbf y } } { \mathrm { m i n i m i z e } } } & { \ f ( \mathbf z + \mathbf x _ { 0 } ) + \gamma D ( \delta ) + \tau \sum _ { i = 1 } ^ { P Q } \| \mathbf y _ { \mathcal D _ { i } } \| _ { 2 } + h ( \mathbf w ) } \\ { \mathrm { s u b j e c t ~ t o } } & { \ \mathbf z = \delta , \ \mathbf z = \mathbf y , \ \mathbf z = \mathbf w , } \end{array}
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where $\mathbf { z } , \mathbf { y }$ and w are newly introduced variables, for ease of notation let $\mathcal { D } _ { ( q - 1 ) P + p } = \mathcal { G } _ { p , q }$ , and $h ( \mathbf { w } )$ is an indicator function with respect to the constraints of problem (2),
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
h ( \mathbf { w } ) = { \left\{ \begin{array} { l l } { 0 } & { { \mathrm { ~ i f ~ } } ( \mathbf { x } _ { 0 } + \mathbf { w } ) \in [ 0 , 1 ] ^ { n } , \ \| \mathbf { w } \| _ { \infty } \leq \epsilon , } \\ { \infty } & { { \mathrm { ~ o t h e r w i s e . } } } \end{array} \right. }
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
ADMM is performed by minimizing the augmented Lagrangian of problem (4),
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\begin{array} { r l r } & { } & { L ( { \bf z } , \delta , { \bf y } , { \bf w } , { \bf u } , { \bf v } , { \bf s } ) = f ( { \bf z } + { \bf x } _ { 0 } ) + \gamma D ( \delta ) + \tau \sum _ { i = 1 } ^ { P Q } \| { \bf y } { \boldsymbol { \pi } } _ { i } \| _ { 2 } + h ( { \bf w } ) + { \bf u } ^ { T } ( \delta - { \bf z } ) } \\ & { } & { + { \bf v } ^ { T } ( { \bf y } - { \bf z } ) + { \bf s } ^ { T } ( { \bf w } - { \bf z } ) + \frac { \rho } { 2 } \| \delta - { \bf z } \| _ { 2 } ^ { 2 } + \frac { \rho } { 2 } \| { \bf y } - { \bf z } \| _ { 2 } ^ { 2 } + \frac { \rho } { 2 } \| { \bf w } - { \bf z } \| _ { 2 } ^ { 2 } , \quad } \end{array}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where u, v and s are Lagrangian multipliers, and $\rho > 0$ is a given penalty parameter. ADMM splits all of optimization variables into two blocks and adopts the following iterative scheme,
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\begin{array} { r l } & { \{ \delta ^ { k + 1 } , \mathbf w ^ { k + 1 } , \mathbf y ^ { k + 1 } \} = \underset { \delta , \mathbf w , \mathbf y } { \operatorname* { a r g m i n } } L ( \delta , \mathbf z ^ { k } , \mathbf w , \mathbf y , \mathbf u ^ { k } , \mathbf v ^ { k } , \mathbf s ^ { k } ) , } \\ & { } \\ & { \mathbf z ^ { k + 1 } = \underset { \mathbf z } { \operatorname* { a r g m i n } } L ( \delta ^ { k + 1 } , \mathbf z , \mathbf w ^ { k + 1 } , \mathbf y ^ { k + 1 } , \mathbf u ^ { k } , \mathbf v ^ { k } , \mathbf s ^ { k } ) , } \\ & { \left\{ \begin{array} { l l } { \mathbf u ^ { k + 1 } = \mathbf u ^ { k } + \rho ( \delta ^ { k + 1 } - \mathbf z ^ { k + 1 } ) , } \\ { \mathbf v ^ { k + 1 } = \mathbf v ^ { k } + \rho ( \mathbf y ^ { k + 1 } - \mathbf z ^ { k + 1 } ) , } \\ { \mathbf s ^ { k + 1 } = \mathbf s ^ { k } + \rho ( \mathbf w ^ { k + 1 } - \mathbf z ^ { k + 1 } ) , } \end{array} \right. } \end{array}
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
where $k$ is the iteration index, steps (7)-(8) are used for updating primal variables, and the last step (9) is known as the dual update step. We emphasize that the crucial property of the proposed ADMM approach is that, as we demonstrate in Proposition 1, the solution to problem (7) can be found in parallel and exactly.
|
| 99 |
+
|
| 100 |
+
Proposition 1 When $D ( \delta ) = \| \delta \| _ { 2 } ^ { 2 }$ , the solution to problem (7) is given by
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\begin{array} { r l } & { \delta ^ { k + 1 } = \frac { \rho } { \rho + 2 \gamma } \mathbf { a } , } \\ & { [ \mathbf { w } ^ { k + 1 } ] _ { i } = \left\{ \begin{array} { l l } { \operatorname* { m i n } \{ 1 - [ \mathbf { x } _ { 0 } ] _ { i } , \epsilon \} } & { b _ { i } > \operatorname* { m i n } \{ 1 - [ \mathbf { x } _ { 0 } ] _ { i } , \epsilon \} } \\ { \operatorname* { m a x } \{ - [ \mathbf { x } _ { 0 } ] _ { i } , - \epsilon \} } & { b _ { i } < \operatorname* { m a x } \{ - [ \mathbf { x } _ { 0 } ] _ { i } , - \epsilon \} \quad f o r \ i \in [ n ] , } \\ { b _ { i } } & { o t h e r w i s e , } \end{array} \right. } \\ & { [ \mathbf { y } ^ { k + 1 } ] _ { \mathcal { D } _ { i } } = \Big ( 1 - \frac { \tau } { \rho \| [ \mathbf { c } ] _ { \mathcal { D } _ { i } } \| _ { 2 } } \Big ) _ { + } [ \mathbf { c } ] _ { \mathcal { D } _ { i } } , \ i \in [ P Q ] , } \end{array}
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where $\mathbf { a } : = \mathbf { z } ^ { k } - \mathbf { u } ^ { k } / \rho , \mathbf { b } : = \mathbf { z } ^ { k } - \mathbf { s } ^ { k } / \rho , \mathbf { c } : = \mathbf { z } ^ { k } - \mathbf { v } ^ { k } / \rho , ( x ) _ { + } = x$ if $x \geq 0$ and 0 otherwise, $[ \mathbf { x } ] _ { i }$ denotes the ith element of $\mathbf { x }$ , and $[ \mathbf { x } ] _ { \mathcal { D } _ { i } }$ denotes the sub-vector of $\mathbf { x }$ indexed by $\mathcal { D } _ { i }$ .
|
| 107 |
+
|
| 108 |
+
Proof: See Appendix B.
|
| 109 |
+
|
| 110 |
+
It is clear from Proposition 1 that introducing auxiliary variables does not increase the computational complexity of ADMM since (10)-(12) can be solved in parallel. Moreover, if another distortion metric (different from $D ( \delta ) = \lvert \lvert \delta \rvert \rvert _ { 2 } ^ { 2 } )$ is used, then ADMM only changes at the $\delta$ -step (10).
|
| 111 |
+
|
| 112 |
+
We next focus on the $\mathbf { z }$ -minimization step (8), which can be equivalently transformed into
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\operatorname* { m i n i m i z e } _ { \mathbf { z } } \quad f ( \mathbf { x } _ { 0 } + \mathbf { z } ) + \frac { \rho } { 2 } \| \mathbf { z } - \mathbf { a } ^ { \prime } \| _ { 2 } ^ { 2 } + \frac { \rho } { 2 } \| \mathbf { z } - \mathbf { b } ^ { \prime } \| _ { 2 } ^ { 2 } + \frac { \rho } { 2 } \| \mathbf { z } - \mathbf { c } ^ { \prime } \| _ { 2 } ^ { 2 } ,
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where $\mathbf { a } ^ { \prime } : = \delta ^ { k + 1 } + \mathbf { u } ^ { k } / \rho$ , $\mathbf b ^ { \prime } : = \mathbf w ^ { k + 1 } + \mathbf s ^ { k } / \rho$ , and $\mathbf { c } ^ { \prime } : = \mathbf { y } ^ { k + 1 } + \mathbf { v } ^ { k } / \rho$ . We recall that attacks studied in this paper belongs to ‘first-order’ adversaries (Madry et al., 2017), which only have access to gradients of the loss function $f$ . Spurred by that, we solve problem (13) via a linearization technique that is commonly used in stochastic/online ADMM (Ouyang et al., 2013; Suzuki, 2013; Liu et al., 2018) or linearized ADMM (Boyd et al., 2011; Liu et al., 2017). Specifically, we replace the function $f$ with its first-order Taylor expansion at the point $\mathbf { z } ^ { k }$ by adding a Bregman divergence term $( \eta _ { k } / 2 ) \lvert | \mathbf { z } - \mathbf { z } ^ { k } \rvert | _ { 2 } ^ { 2 }$ . As a result, problem (13) becomes
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\begin{array} { r l } { \underset { \mathbf { z } } { \mathrm { m i n i m i z e } } } & { ( \nabla f ( \mathbf { z } ^ { k } + \mathbf { x } _ { 0 } ) ) ^ { T } ( \mathbf { z } - \mathbf { z } ^ { k } ) + \displaystyle \frac { \eta _ { k } } { 2 } \| \mathbf { z } - \mathbf { z } ^ { k } \| _ { 2 } ^ { 2 } + \displaystyle \frac { \rho } { 2 } \| \mathbf { z } - \mathbf { a } ^ { \prime } \| _ { 2 } ^ { 2 } } \\ & { + \displaystyle \frac { \rho } { 2 } \| \mathbf { z } - \mathbf { b } ^ { \prime } \| _ { 2 } ^ { 2 } + \displaystyle \frac { \rho } { 2 } \| \mathbf { z } - \mathbf { c } ^ { \prime } \| _ { 2 } ^ { 2 } , } \end{array}
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
where $1 / \eta _ { k } > 0$ is a given decaying parameter, e.g., $\eta _ { k } = \alpha \sqrt { k }$ for some $\alpha > 0$ , and the Bregman divergence term stabilizes the convergence of $\mathbf { z }$ -minimization step. It is clear that problem (14) yields a quadratic program with the closed-form solution
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\begin{array} { r } { \mathbf { z } ^ { k + 1 } = \left( 1 / \left( \eta _ { k } + 3 \rho \right) \right) \left( \eta _ { k } \mathbf { z } ^ { k } + \rho \mathbf { a } + \rho \mathbf { b } + \rho \mathbf { c } - \nabla f ( \mathbf { z } ^ { k } + \mathbf { x } _ { 0 } ) \right) . } \end{array}
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
In summary, the proposed ADMM algorithm alternatively updates (7)-(9), which yield closed-form solutions given by (10)-(12) and (15). The convergence of linearized ADMM for nonconvex optimization was recently proved by (Liu et al., 2017), and thus provides theoretical validity of our approach. Compared to the existing solver for generation of adversarial examples (Carlini & Wagner, 2017; Papernot et al., 2016b), our algorithm offers two main benefits, efficiency and generality. That is, the computations for every update step are efficiently carried out, and our approach can be applicable to a wide class of attack formulations.
|
| 131 |
+
|
| 132 |
+
# 4 OVERLAPPING GROUP AND REFINED STRATTACK
|
| 133 |
+
|
| 134 |
+
In this section, we generalize our proposed ADMM solution framework to the case of generating adversarial perturbations with overlapping group structures. We then turn to an attack refining model under fixed sparse structures. We will show that both extensions can be unified under the ADMM framework. In particular, the refined approach will allow us to gain deeper insights on the structural effects on adversarial perturbations.
|
| 135 |
+
|
| 136 |
+
# 4.1 OVERLAPPING GROUP STRUCTURE
|
| 137 |
+
|
| 138 |
+
We recall that groups $\{ \mathcal { D } _ { i } \}$ (also denoted by $\{ \mathcal { G } _ { p , q } \} )$ studied in Sec. 3 could be overlapped with each other; see an example in Fig. A1. Therefore, $\{ \mathcal { D } _ { i } \}$ is in general a cover rather than a partition of $[ n ]$ . To address the challenge in coupled group variables, we introduce multiple copies of the variable y in problem (4), and achieve the following modification
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\begin{array} { r l } { \underset { \delta , { \mathbf { z } } , { \mathbf { w } } , \{ { \mathbf { y } } _ { i } \} } { \mathrm { m i n i m i z e } } } & { \ f ( { \mathbf { z } } + { \mathbf { x } } _ { 0 } ) + \gamma D ( \delta ) + \tau \sum _ { i = 1 } ^ { P Q } \| \mathbf { y } _ { i , \mathcal { D } _ { i } } \| _ { 2 } + h ( \mathbf { w } ) } \\ { \mathrm { s u b j e c t ~ t o } } & { \ \mathbf { z } = \delta , \ \mathbf { z } = \mathbf { w } , \ \mathbf { z } = \mathbf { y } _ { i } , \quad i \in [ P Q ] , } \end{array}
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
where compared to problem (4), there exist $P Q$ variables $\mathbf { y } _ { i } \in \mathbb { R } ^ { n }$ for $i \in [ P Q ]$ , and ${ \bf y } _ { i , \mathcal { D } _ { i } }$ denotes the subvector of $\mathbf { y } _ { i }$ with indices given by $\mathcal { D } _ { i }$ . It is clear from (16) that groups $\{ \mathcal { D } _ { i } \}$ become nonoverlapped since each of them lies in a different copy $\mathbf { y } _ { i }$ . The ADMM algorithm for solving problem (16) maintains a similar procedure as (7)-(9) except $\mathbf { y }$ -step (12) and $\mathbf { z }$ -step (15); see Proposition 2.
|
| 145 |
+
|
| 146 |
+
Proposition 2 Given the same condition of Proposition $I$ , the ADMM solution to problem (16) involves the $\delta$ -step same as $( I O )$ , the w-step same as $( l I )$ , and two modified y- and $\mathbf { z }$ -steps,
|
| 147 |
+
|
| 148 |
+
$$
|
| 149 |
+
\left\{ \begin{array} { l l } { \left[ \mathbf { y } _ { i } ^ { k + 1 } \right] _ { \mathcal { D } _ { i } } = \left( 1 - \frac { \tau } { \rho \| [ \mathbf { c } _ { i } ] _ { \mathcal { D } _ { i } } \| _ { 2 } } \right) _ { + } [ \mathbf { c } _ { i } ] _ { \mathcal { D } _ { i } } } \\ { \left[ \mathbf { y } _ { i } ^ { k + 1 } \right] _ { [ n ] / \mathcal { D } _ { i } } = [ \mathbf { c } _ { i } ] _ { [ n ] / \mathcal { D } _ { i } } } \\ { \mathbf { z } ^ { k + 1 } = \left( 1 / \left( \eta _ { k } + 2 \rho + P Q \rho \right) \right) \left( \eta _ { k } \mathbf { z } ^ { k } + \rho \mathbf { a } ^ { \prime } + \rho \mathbf { b } ^ { \prime } + \rho \sum _ { i = 1 } ^ { P Q } \mathbf { c } _ { i } ^ { \prime } - \nabla f ( \mathbf { z } ^ { k } + \mathbf { x } _ { 0 } ) \right) , } \end{array} \right.
|
| 150 |
+
$$
|
| 151 |
+
|
| 152 |
+
where $\mathbf { c } _ { i } : = \mathbf { z } ^ { k } - \mathbf { v } _ { i } ^ { k } / \rho , \mathbf { v }$ $\mathbf { v } _ { i }$ is the Lagrangian multiplier associated with equality constraint $\mathbf { y } _ { i } = \mathbf { z }$ , similar to (9) we obtain $\mathbf v _ { i } ^ { k + 1 } = \mathbf v _ { i } ^ { k } + \rho ( \mathbf y ^ { k + 1 } - \mathbf z ^ { k + 1 } ) , [ \tau$ $[ n ] / \mathcal { D } _ { i }$ denotes the difference of sets $[ n ]$ and $\mathcal { D } _ { i } , \mathbf { a } ^ { \prime }$ and $\mathbf { b } ^ { \prime }$ have been defined in (13), and $\mathbf c _ { i } ^ { \prime } = \mathbf y _ { i } ^ { k + 1 } + \mathbf v _ { i } ^ { k } / \rho$ .
|
| 153 |
+
|
| 154 |
+
Proof: See Appendix C.
|
| 155 |
+
|
| 156 |
+
We note that updating $P Q$ variables $\left\{ \mathbf { y } _ { i } \right\}$ is decomposed as shown in (17). However, the side effect is the need of $P Q$ times more storage space than the $\mathbf { y }$ -step (12) when groups are non-overlapped.
|
| 157 |
+
|
| 158 |
+
# 4.2 REFINED STRATTACK UNDER FIXED SPARSE PATTERN
|
| 159 |
+
|
| 160 |
+
The approaches proposed in Sec. 3 and Sec. 4.1 help us to identify structured sparse patterns in adversarial perturbations. This section presents a method to refine structured attacks under fixed group sparse patterns. Let $\delta ^ { * }$ denote the solution to problem (2) solved by the proposed ADMM method. We define a $\sigma$ -sparse perturbation $\delta$ via $\delta ^ { * }$ ,
|
| 161 |
+
|
| 162 |
+
$$
|
| 163 |
+
\delta _ { i } = 0 \mathrm { i f } \delta _ { i } ^ { * } \leq \sigma , \mathrm { f o r a n y } i \in [ n ] ,
|
| 164 |
+
$$
|
| 165 |
+
|
| 166 |
+
where a hard thresholding operator is applied to $\delta ^ { * }$ with tolerance $\sigma$ . Our refined model imposes the fixed $\sigma$ -sparse structure (19) into problem (2). This leads to
|
| 167 |
+
|
| 168 |
+
$$
|
| 169 |
+
\begin{array} { r l } { \underset { \delta } { \mathrm { m i n i m i z e } } } & { f ( \mathbf { x } _ { 0 } + \pmb { \delta } ) + \gamma D ( \pmb { \delta } ) } \\ { \mathrm { s u b j e c t ~ t o } } & { ( \mathbf { x } _ { 0 } + \pmb { \delta } ) \in [ 0 , 1 ] ^ { n } , \| \pmb { \delta } \| _ { \infty } \leq \epsilon } \\ & { \delta _ { i } = 0 , \mathrm { i f ~ } i \in S _ { \sigma } , } \end{array}
|
| 170 |
+
$$
|
| 171 |
+
|
| 172 |
+
where $\scriptstyle { \mathcal { S } } _ { \sigma }$ is defined by (19), i.e., $S _ { \sigma } : = \left\{ j \vert \delta _ { j } ^ { * } \leq \sigma \right.$ , $j \in [ n ] \}$ . Compared to problem (2), the groupsparse penalty function is eliminated as it has been known as $a$ priori. With the priori knowledge of group sparsity, problem (20) is formulated to optimize and refine the non-zero groups, thus achieving better performance on highlighting and exploring the perturbation structure. Problem (20) can be solved using ADMM, and its solution is presented in Proposition 3.
|
| 173 |
+
|
| 174 |
+
Proposition 3 The ADMM solution to problem (20) is given by
|
| 175 |
+
|
| 176 |
+
$$
|
| 177 |
+
\begin{array} { r } { [ \delta ^ { k + 1 } ] _ { i } = \left\{ \begin{array} { l l } { 0 } & { i \in \mathcal { S } _ { \sigma } } \\ { \operatorname* { m i n } \{ 1 - [ { \mathbf { x } } _ { 0 } ] _ { i } , \epsilon \} } & { \frac { \rho } { 2 \gamma + \rho } a _ { i } > \operatorname* { m i n } \{ 1 - [ { \mathbf { x } } _ { 0 } ] _ { i } , \epsilon \} , i \notin \mathcal { S } _ { \sigma } } \\ { \operatorname* { m a x } \{ - [ { \mathbf { x } } _ { 0 } ] _ { i } , - \epsilon \} } & { \frac { \rho } { 2 \gamma + \rho } a _ { i } < \operatorname* { m a x } \{ - [ { \mathbf { x } } _ { 0 } ] _ { i } , - \epsilon \} , i \notin \mathcal { S } _ { \sigma } } \\ { \frac { \rho } { 2 \gamma + \rho } a _ { i } } & { o t h e r w i s e , } \end{array} \right. } \\ { [ \mathbf { z } ^ { k + 1 } ] _ { i } = \left\{ \begin{array} { l l } { 0 } & { i \in \mathcal { S } _ { \sigma } } \\ { 1 / ( \eta _ { k } + \rho ) \left[ \eta _ { k } [ \mathbf { z } ^ { k } ] _ { i } + \rho [ \mathbf { a } ^ { \prime } ] _ { i } - [ \nabla f ( \mathbf { z } ^ { k } + { \mathbf { x } } _ { 0 } ) ] _ { i } \right] } & { i \notin \mathcal { S } _ { \sigma } , } \end{array} \right. } \end{array}
|
| 178 |
+
$$
|
| 179 |
+
|
| 180 |
+
for $i \in \lceil n \rceil$ , where $\mathbf { z } = \delta$ is the introduced auxiliary variable similar to (4), $\mathbf { a } : = \delta ^ { k + 1 } - \mathbf { u } ^ { k } / \rho ,$ $\bar { \mathbf { a } } ^ { \prime } : = \delta ^ { k + 1 ^ { \prime } } + \mathbf { u } ^ { k } / \rho$ , $\mathbf { u } ^ { k + 1 } = \mathbf { u } ^ { k } + \rho ( \delta ^ { k + 1 } - \mathbf { z } ^ { k + 1 } ) ,$ , and $\rho$ and $\eta _ { k }$ have been defined in (6) and $( I 4 )$ . The ADMM iterations can be initialized by $\delta ^ { * }$ , the known solution to problem (2).
|
| 181 |
+
|
| 182 |
+
Proof: See Appendix D.
|
| 183 |
+
|
| 184 |
+
# 5 EMPIRICAL PERFORMANCE OF STRATTACK
|
| 185 |
+
|
| 186 |
+
We evaluate the performance of the proposed StrAttack on three image classification datasets, MNIST (Lecun et al., 1998), CIFAR-10 (Krizhevsky & Hinton, 2009) and ImageNet (Deng et al., 2009). To make fair comparison with the C&W $\ell _ { 2 }$ attack (Carlini & Wagner, 2017), we use $\ell _ { 2 }$ norm as the distortion function $D ( \delta ) = \| \delta \| _ { 2 } ^ { 2 }$ . And we also compare with FGM (Goodfellow et al., 2014) and IFGSM $\ell _ { 2 }$ attacks (Kurakin et al., 2017) as a reference. We evaluate attack success rate (ASR)1 as well as $\ell _ { p }$ distortion metrics for $p \in \{ 0 , 1 , 2 , \infty \}$ . The detailed experiment setup is presented in Appendix F. Our code is available at https://github.com/KaidiXu/StrAttack.
|
| 187 |
+
|
| 188 |
+
For each attack method on MNIST or CIFAR-10, we choose 1000 original images from the test dataset as source and each image has 9 target labels. So a total of 9000 adversarial examples are generated for each attack method. On ImageNet, each attack method tries to craft 900 adverdarial examples with 100 random images from the test dataset and 9 random target labels for each image.
|
| 189 |
+
|
| 190 |
+
Fig. 2 compares adversarial examples generated by StrAttack and C&W attack on each dataset. We observe that the perturbation of the C&W attack has poor group sparsity, i.e., many non-zeros groups with small magnitudes. However, the ASR of the C&W attack is quite sensitive to these small perturbations. As applying a threshold to have the same $\ell _ { 0 }$ norm as our attack, we find that only $6 . 7 \%$ of adversarial examples generated from C&W attack remain valid. By contrast, StrAttack is able to highlight the most important group structures (local regions) of adversarial perturbations without attacking other pixels. For example, StrAttack misclassifies a natural image (4 in MNIST) as an incorrect label 3. That is because the pixels that appears in the structure of 3 are more significantly perturbed by our attack; see the top right plots of Fig. 2. Furthermore, the ‘goose-sorrel’ example shows that misclassification occurs when we just perturb a small number of non-sparse group regions on goose’s head, which is more consistent with human perception. We refer readers to Appendix G for more results.
|
| 191 |
+
|
| 192 |
+
By quatitatively analysis, we report $\ell _ { p }$ norms and ASR in Table 1 for $p \in \{ 0 , 1 , 2 , \infty \}$ . We show that StrAttack perturbs much fewer pixels (smaller $\ell _ { 0 }$ norm), but it is comparable to or even better than other attacks in terms of $\ell _ { 1 } , \ell _ { 2 }$ , and $\ell _ { \infty }$ norms. Specifically, the FGM attack yields the worst performance in both ASR and $\ell _ { p }$ distortion. On MNIST and CIFAR-10, StrAttack outperforms other attacks in $\ell _ { 0 }$ , $\ell _ { 1 }$ and $\ell _ { \infty }$ distortion. On ImageNet, StrAttack outperforms C&W attack in $\ell _ { 0 }$ and $\ell _ { 1 }$ distortion. Since the C&W attacking loss directly penalizes the $\ell _ { 2 }$ norm, it often causes smaller $\ell _ { 2 }$ distortion than StrAttack. We also observe that the overlapping case leads to the adversarial perturbation of less sparsity (in terms of $\ell _ { 0 }$ norm) compared to the non-overlapping case. This is not surprising, since the sparsity of the overlapping region is controlled by at least two groups. However, compared to C&W attack, the use of overlapping groups in StrAttack still yields sparser perturbations. Unless specified otherwise, we focus on the case of non-overlapping groups to generate the most sparse adversarial perturbations. We highlight that although a so-called one-pixel attack (Su et al., 2017) also yields very small $\ell _ { 0 }$ norm, it is at the cost of very large $\ell _ { \infty }$ distortion. Unlike one-pixel attack, StrAttack achieves the sparsity without losing the performance of $\ell _ { \infty }$ , $\ell _ { 1 }$ and $\ell _ { 2 }$ distortion.
|
| 193 |
+
|
| 194 |
+
Furthermore, we compare the performance of StrAttack with the C&W $\ell _ { \infty }$ attack and IFGSM while attacking the robust model (Madry et al., 2017) on MNIST. We remark that all the considered attack methods are performed under the same $\ell _ { \infty }$ -norm based distortion constraint with an upper bound $\epsilon \in \{ 0 . 1 , 0 . 2 , 0 . 3 , 0 . 4 \}$ . Here we obtain a (refined) StrAttack subject to $\| \pmb { \delta } \| _ { \infty } \le \epsilon$ by solving problem (20) at $\gamma = 0$ . In Table 2, we demonstrate the ASR and the number of perturbed pixels for various attacks over 5000 (untargeted) adversarial examples. The ASR define as the proportion of the final perturbation results less than given $\epsilon \in \{ 0 . 1 , 0 . 2 , 0 . 3 , 0 . 4 \}$ bound over number of test images. Here an successful attack is defined by an attack that can fool DNNs and meets the $\ell _ { \infty }$ distortion constraint. As we can see, StrAttack can achieve the similar ASR compared to other attack methods, however, it perturbs a much less number of pixels. Next, we evaluate the performance of StrAttack against two defense mechanisms: defensive distillation (Papernot et al., 2016c) and adversarial training (Tramèr et al., 2018). We observe that StrAttack is able to break the two defense methods with $100 \%$ ASR. More details are provided in Appendix H.
|
| 195 |
+
|
| 196 |
+

|
| 197 |
+
Figure 2: C&W attack vs StrAttack. Here each grid cell represents a $2 \times 2 , 2 \times 2$ , and $1 3 \times 1 3$ small region in MNIST, CIFAR-10 and ImageNet, respectively. The group sparsity of perturbation is represented by heatmap. The colors on heatmap represent average absolute value of distortion scale to [0, 255]. The left two columns correspond to results of using C&W attack. The right two columns show results of StrAttack.
|
| 198 |
+
|
| 199 |
+
Table 1: Adversarial attack success rate (ASR) and $\ell _ { p }$ distortion values for various attacks.
|
| 200 |
+
|
| 201 |
+
<table><tr><td rowspan="2">Data Set</td><td rowspan="2">Attack Method</td><td colspan="5">BestCase</td><td colspan="5">Average Case</td><td colspan="5">Worst Case</td></tr><tr><td>ASR</td><td>lo</td><td>l1</td><td>l2</td><td>lo</td><td>ASR</td><td>l</td><td>l1</td><td>l2</td><td>lo</td><td>ASR</td><td>lo</td><td>l1</td><td>l2</td><td>lo</td></tr><tr><td rowspan="5">MNIST</td><td>FGM</td><td>99.3</td><td>456.5 549.5</td><td>28.2</td><td>2.32</td><td>0.57</td><td>35.8</td><td>466</td><td>39.4</td><td>3.17</td><td>0.717</td><td>0</td><td>N.A</td><td>N.A.</td><td>N.A.</td><td>N.A.</td></tr><tr><td>IFGSM</td><td>100</td><td></td><td>18.3</td><td>1.57</td><td>0.4</td><td>100</td><td>588</td><td>30.9</td><td>2.41</td><td>0.566</td><td>99.8</td><td>640.4</td><td>50.98</td><td>3.742</td><td>0.784</td></tr><tr><td>C&W</td><td>100</td><td>479.8</td><td>13.3</td><td>1.35</td><td>0.397</td><td>100</td><td>493.4</td><td>21.3</td><td>1.9</td><td>0.528</td><td>99.7</td><td>524.3</td><td>29.9</td><td>2.45</td><td>0.664</td></tr><tr><td>StrAttack</td><td>100</td><td>73.2</td><td>10.9</td><td>1.51</td><td>0.384</td><td>100</td><td>119.4</td><td>18.05</td><td>2.16</td><td>0.47</td><td>100</td><td>182.0</td><td>26.9</td><td>2.81</td><td>0.5</td></tr><tr><td>+overlap</td><td>100</td><td>84.4</td><td>9.2</td><td>1.32</td><td>0.401</td><td>100</td><td>157.4</td><td>16.2</td><td>1.95</td><td>0.508</td><td>100</td><td>260.9</td><td>22.9</td><td>2.501</td><td>0.653</td></tr><tr><td rowspan="5">CIFAR-10</td><td>FGM</td><td>98.5</td><td>3049</td><td>12.9</td><td>0.389</td><td>0.046</td><td>44.1</td><td>3048</td><td>34.2</td><td>0.989</td><td>0.113</td><td>0.2</td><td>3071</td><td>61.3</td><td>1.76</td><td>0.194</td></tr><tr><td>IFGSM</td><td>100</td><td>3051</td><td>6.22</td><td>0.182</td><td>0.02</td><td>100</td><td>3051</td><td>13.7</td><td>0.391</td><td>0.0433</td><td>100</td><td>3060</td><td>22.9</td><td>0.655</td><td>0.075</td></tr><tr><td>C&W</td><td>100</td><td>2954</td><td>6.03</td><td>0.178</td><td>0.019</td><td>100</td><td>2956</td><td>12.1</td><td>0.347</td><td>0.0364</td><td>99.9</td><td>3070</td><td>16.8</td><td>0.481</td><td>0.0536</td></tr><tr><td>StrAttack</td><td>100</td><td>264</td><td>3.33</td><td>0.204</td><td>0.031</td><td>100</td><td>487</td><td>7.13</td><td>0.353</td><td>0.050</td><td>100</td><td>772</td><td>12.5</td><td>0.563</td><td>0.075</td></tr><tr><td>+overlap</td><td>100</td><td>295</td><td>3.35</td><td>0.169</td><td>0.029</td><td>100</td><td>562</td><td>7.05</td><td>0.328</td><td>0.047</td><td>100</td><td>920</td><td>12.9</td><td>0.502</td><td>0.063</td></tr><tr><td rowspan="4">ImageNet</td><td>FGM</td><td>12</td><td>264917</td><td>152</td><td>0.477</td><td>0.0157</td><td>2</td><td>263585</td><td>51.3</td><td>0.18</td><td>0.00614</td><td>0</td><td>N.A.</td><td>N.A.</td><td>N.A.</td><td>N.A.</td></tr><tr><td>IFGSM</td><td>100</td><td>267079</td><td>299.32</td><td>0.9086</td><td>0.02964</td><td>100</td><td>267293</td><td>723</td><td>2.2</td><td>0.0792</td><td>98</td><td>267581</td><td>1378</td><td>4.22</td><td>0.158</td></tr><tr><td>C&W</td><td>100</td><td>267916</td><td>127</td><td>0.471</td><td>0.016</td><td>100</td><td>263140</td><td>198</td><td>0.679</td><td>0.03</td><td>100</td><td>265212</td><td>268</td><td>0.852</td><td>0.041</td></tr><tr><td>StrAttack</td><td>100</td><td>14462</td><td>55.2</td><td>0.719</td><td>0.058</td><td>100</td><td>52328</td><td>152</td><td>1.06</td><td>0.075</td><td>100</td><td>80722</td><td>197</td><td>1.35</td><td>0.122</td></tr></table>
|
| 202 |
+
|
| 203 |
+
\* Please refer to Appendix F for the definition of best case, best case and worst case. \*\* N.A. means not available in the case of zero ASR, +overlap means structured attack with overlapping groups.
|
| 204 |
+
|
| 205 |
+
Lastly, we evaluate the transferability of StrAttack from Inception V3 (Szegedy et al., 2016) to other network models including Inception V2, Inception V4 (Szegedy et al., 2017), ResNet 50, ResNet 152 (He et al., 2016), DenseNet 121 and DenseNet 161 (Huang et al., 2017). For comparison, we also present the transferbility of IFGSM and C&W. This experiment is performed under 1000 (target) adversarial examples on ImageNet2. It can be seen from in Table 3 that StrAttack yields the largest attack success rate while transferring to almost every network model.
|
| 206 |
+
|
| 207 |
+
Table 2: Attack success rate (ASR) and $\ell _ { 0 }$ norm of adversarial perturbations for various attacks against robust adversarial training based defense on MNIST.
|
| 208 |
+
|
| 209 |
+
<table><tr><td></td><td>ASR at ε = 0.1</td><td>ASR at e = 0.2</td><td>ASR at e = 0.3</td><td>ASR at ε = 0.4</td><td>l</td></tr><tr><td>IFGSM</td><td>0.01</td><td>0.02</td><td>0.09</td><td>0.94</td><td>654</td></tr><tr><td>C&W loattack</td><td>0.01</td><td>0.02</td><td>0.10</td><td>0.96</td><td>723</td></tr><tr><td>StrAttack</td><td>0.01</td><td>0.02</td><td>0.10</td><td>0.99</td><td>279</td></tr></table>
|
| 210 |
+
|
| 211 |
+
Table 3: Comparison of transferability of different attacks over 6 ImageNet models.
|
| 212 |
+
|
| 213 |
+
<table><tr><td></td><td>Incept V2</td><td>Incept V4</td><td>ResNet50</td><td>ResNet152</td><td>DenseNet121</td><td>DenseNet161</td></tr><tr><td>IFGSM</td><td>0.27</td><td>0.22</td><td>0.27</td><td>0.19</td><td>0.16</td><td>0.19</td></tr><tr><td>C&W</td><td>0.25</td><td>0.24</td><td>0.23</td><td>0.23</td><td>0.15</td><td>0.15</td></tr><tr><td>StrAttack</td><td>0.28</td><td>0.27</td><td>0.25</td><td>0.25</td><td>0.26</td><td>0.25</td></tr></table>
|
| 214 |
+
|
| 215 |
+
# 6 STRATTACK OFFERS BETTER INTERPRETABILITY
|
| 216 |
+
|
| 217 |
+
In this section, we evaluate the effects of structured adversarial perturbations on image classification through adversarial saliency map (ASM) (Papernot et al., 2016b) and class activation map (CAM) (Zhou et al., 2016). Here we recall that ASM measures the impact of pixel-level perturbations on label classification, and CAM localizes class-specific image discriminative regions that we use to visually explain adversarial perturbations (Xiao et al., 2018). We will show that compared to C&W attack, StrAttack meets better interpretability in terms of (a) a higher ASM score and (b) a tighter connection with CAM, where the metric (a) implies interpretability at a micro-level, namely, perturbing pixels with largest impact on image classification, and the metric (b) demonstrates interpretability at a macro-level, namely, perturbations can be mapped to the most discriminative image regions localized by CAM.
|
| 218 |
+
|
| 219 |
+
Given an input image $\mathbf { x } _ { \mathrm { 0 } }$ and a target class $t$ , let $\mathrm { A S M } ( \mathbf { x } _ { 0 } , t ) \in \mathbb { R } ^ { d }$ denote ASM scores for every pixel of $\mathbf { x } _ { \mathrm { 0 } }$ corresponding to $t$ . We elaborate on the mathematical definition of ASM in Appendix E. Generally speaking, the ith element of $\mathrm { A S M } ( \mathbf { x } _ { 0 } , t )$ , denoted by $\mathrm { A S M } ( \mathbf { x } _ { 0 } , t ) [ i ]$ , measures how much the classification score with respect to the target label $t$ will increase and that with respect to the original label $t _ { 0 }$ will decrease if a perturbation is added to the pixel $i$ . With the aid of ASM, we then define a Boolean map $\mathbf { B } _ { \mathrm { A S M } } \in \mathbb { R } ^ { \bar { d } }$ to encode the regions of $\mathbf { x } _ { \mathrm { 0 } }$ most sensitive to targeted adversarial attacks, where $\begin{array} { r } { \mathbf { B } _ { \mathrm { A S \bar { M } } } ( i ) = 1 } \end{array}$ if $\mathrm { A S M } ( \mathbf { x } _ { 0 } , t ) > \nu$ , and 0 otherwise. Here $\nu$ is a given threshold to highlight the most sensitive pixels. we then define the interpretability score (IS) via ASM,
|
| 220 |
+
|
| 221 |
+
$$
|
| 222 |
+
\mathrm { I S } ( \delta ) = \| \mathbf { B } _ { \mathrm { A S M } } \circ \pmb { \delta } \| _ { 2 } / \| \pmb { \delta } \| _ { 2 } ,
|
| 223 |
+
$$
|
| 224 |
+
|
| 225 |
+
where $\circ$ is the element-wise product. The rationale behind (23) is that $\mathrm { I S } ( \delta ) 1$ if the sensitive region identified by ASM perfectly predicts the locations of adversarial perturbations. By contrast, if $\mathrm { \bar { I S } } ( \delta ) \to 0$ , then adversarial perturbations cannot be interpreted by ASM. In Fig. 3(a), we compare IS of our proposed attack with C&W attack versus the threshold $\nu$ , valued by different percentiles of ASM scores. We obsreve that our attack outperforms C&W attack in terms of IS, since the former is able to extract important local structures of images by penalizing the group sparsity of adversarial perturbations. It seems that our improvement is not significant. However, StrAttack just perturbs very few pixels to obtain this benefit, leading to perturbations with more semantic structure; see Fig. 3(b) for an illustrative example.
|
| 226 |
+
|
| 227 |
+
Besides ASM, we show that the effect of adversarial perturbations can be visually explained through the class-specific discriminative image regions localized by CAM (Zhou et al., 2016). In Fig. 3(c), we illustrate CAM and demonstrate the differences between our attack and C&W in terms of their connections to the most discriminative regions of $\mathbf { x } _ { \mathrm { 0 } }$ with label $t _ { 0 }$ . We observe that the mechanism of StrAttack can be better interpreted from CAM: only a few adversarial perturbations are needed to suppress the feature of the original image with the true label. By replacing ASM with CAM, we can similarly compute IS in (23) averaged over 500 examples on ImageNet, yielding 0.65 for C&W attack and 0.77 for our attack. More examples of ASM and CAM can be viewed in Appendix E.
|
| 228 |
+
|
| 229 |
+
To better interpret the mechanism of adversarial examples, we study adversarial attacks on some complex images, where the objects of the original and target labels exist simultaneously as shown in Fig. 4. It can be visualized from CAM that both C&W attack and StrAttack yields similar adversarial effects on natural images: Adversarial perturbations are used to suppress the most discriminative region with respect to the true label, and simultaneously promotes the discriminative region of the target label. The former principle is implied by the location of perturbed regions and $C ( \mathbf { x } _ { 0 } , t _ { 0 } )$ in Fig. 4, and the latter can be seen from $C ( \mathbf { x } _ { \mathrm { C W } } , t )$ or $\boldsymbol { C } ( \mathbf { x } _ { \mathrm { S t r } } , t )$ against $C ( \mathbf { x } _ { 0 } , t )$ . However, compared to C&W attack, StrAttack perturbs much less but ‘right’ pixels which have better correspondence with class-specific discriminative image regions localized by CAM.
|
| 230 |
+
|
| 231 |
+

|
| 232 |
+
Figure 3: Interpretabilicy comparison of StrAttack and C&W attack. (a) ASM-based IS vs $\nu$ , given from the 30th percentile to the 90th percentile of ASM scores. (b) Overlay ASM and $\mathbf { B } _ { \mathrm { A S M } } \circ \delta$ on top of image with the true label ‘Tibetan Mastiff’ and the target label ‘streetcar’. From left to right: original image, ASM (darker color represents larger value of ASM score), $\mathbf { B } _ { \mathrm { A S M } } \circ \delta$ under StrAttack, and $\mathbf { B } _ { \mathrm { A S M } } \circ \delta$ under C&W attack. Here $\nu$ in $\mathbf { B } _ { \mathrm { A S M } }$ is set by the 90th percentile of ASM scores. (c) From left to right: original image with true label ‘stove’, CAM of ‘stove’, and perturbations with target label ‘water ouzel’ under StrAttack and C&W.
|
| 233 |
+
|
| 234 |
+
# 7 CONCLUSION
|
| 235 |
+
|
| 236 |
+
This work explores group-wise sparse structures when implementing adversarial attacks. Different from previous works that use $\ell _ { p }$ norm to measure the similarity between an original image and an adversarial example, this work incorporates group-sparsity regularization into the problem formulation of generating adversarial examples and achieves strong group sparsity in the obtained adversarial perturbations. Leveraging ADMM, we develop an efficient implementation to generate structured adversarial perturbations, which can be further used to refine an arbitrary adversarial attack under fixed group sparse structures. The proposed ADMM framewrok is general enough for implementing many state-of-the-art attacks. We perform extensive experiments using MNIST, CIFAR-10 and ImageNet datasets, showing that our structured adversarial attack (StrAttack) is much stronger than the existing attacks and its better interpretability from group sparse structures aids in uncovering the origins of adversarial examples.
|
| 237 |
+
|
| 238 |
+
# ACKNOWLEDGEMENT
|
| 239 |
+
|
| 240 |
+
This work is supported by Air Force Research Laboratory FA8750-18-2-0058, and U.S. Office of Naval Research. Sijia Liu, Pin-Yu Chen, Huan Zhang and Quanfu Fan were supported by the MITIBM Watson Ai Lab, IBM Research.
|
| 241 |
+
|
| 242 |
+
# REFERENCES
|
| 243 |
+
|
| 244 |
+
Anonymous. Random mask: Towards robust convolutional neural networks. In Submitted to International Conference on Learning Representations, 2019. URL https://openreview. net/forum?id ${ . } = { }$ SkgkJn05YX. under review.
|
| 245 |
+
|
| 246 |
+
F. Bach, R. Jenatton, J. Mairal, and G. Obozinski. Optimization with sparsity-inducing penalties. Foundations and Trends $\textsuperscript { \textregistered }$ in Machine Learning, 4(1):1–106, 2012.
|
| 247 |
+
|
| 248 |
+
A. Beck and M. Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM journal on imaging sciences, 2(1):183–202, 2009.
|
| 249 |
+
|
| 250 |
+
S. Boyd, N. Parikh, E. Chu, B. Peleato, J. Eckstein, et al. Distributed optimization and statistical learning via the alternating direction method of multipliers. Foundations and Trends $\textsuperscript { \textregistered }$ in Machine Learning, 3(1):1–122, 2011.
|
| 251 |
+
|
| 252 |
+

|
| 253 |
+
|
| 254 |
+
$t _ { 0 }$ : Bosto n bu ll, t : bucket $t _ { 0 }$ : holster, t : revo lver $t _ { 0 }$ : pug, t: street sign
|
| 255 |
+
|
| 256 |
+

|
| 257 |
+
|
| 258 |
+

|
| 259 |
+
Figure 4: CAMs of adversarial examples generated by the C&W attack and StrAttack under the original label $\left( t _ { 0 } \right)$ and target label $\mathbf { \rho } ( t )$ . Here $\scriptstyle \mathbf { 1 } \mathbf { 2 } \mathbf { C } \mathbf { W }$ and ${ \pmb x } _ { \mathrm { S t r } }$ denote adversarial examples crafted by different attacks. At each row, the subplots from left to right represent the original image $\scriptstyle { \mathbf { 2 } } 0$ , perturbations generated by C&W attack, perturbations generated by StrAttack, and CAMs with respect to natural or adversarial example under $t _ { 0 }$ or $t$ . Here the class $c$ specified CAM with respect to image $\mathbf { x }$ is denoted by $C ( \mathbf { x } , c )$ .
|
| 260 |
+
|
| 261 |
+
Tom B Brown, Dandelion Mané, Aurko Roy, Martín Abadi, and Justin Gilmer. Adversarial patch. arXiv preprint arXiv:1712.09665, 2017.
|
| 262 |
+
|
| 263 |
+
N. Carlini and D. Wagner. Towards evaluating the robustness of neural networks. In Security and Privacy (SP), 2017 IEEE Symposium on, pp. 39–57. IEEE, 2017.
|
| 264 |
+
|
| 265 |
+
J. Chen, L. Yang, Y. Zhang, M. Alber, and D. Chen. Combining fully convolutional and recurrent neural networks for 3d biomedical image segmentation. In Advances in Neural Information Processing Systems, pp. 3036–3044, 2016.
|
| 266 |
+
|
| 267 |
+
P.-Y. Chen, Y. Sharma, H. Zhang, J. Yi, and C.-J. Hsieh. Ead: elastic-net attacks to deep neural networks via adversarial examples. arXiv preprint arXiv:1709.04114, 2017a.
|
| 268 |
+
|
| 269 |
+
P.-Y. Chen, H. Zhang, Y. Sharma, J. Yi, and C.-J. Hsieh. Zoo: Zeroth order optimization based black-box attacks to deep neural networks without training substitute models. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, pp. 15–26. ACM, 2017b.
|
| 270 |
+
|
| 271 |
+
J. Deng, W. Dong, R. Socher, L. Li, K. Li, and F.-F. Li. Imagenet: A large-scale hierarchical image database. In Computer Vision and Pattern Recognition, 2009. CVPR 2009. IEEE Conference on, pp. 248–255. IEEE, 2009.
|
| 272 |
+
|
| 273 |
+
Y. Dong, H. Su, J. Zhu, and F. Bao. Towards interpretable deep neural networks by leveraging adversarial examples. arXiv preprint arXiv:1708.05493, 2017.
|
| 274 |
+
|
| 275 |
+
I. Evtimov, K. Eykholt, E. Fernandes, T. Kohno, B. Li, A. Prakash, A. Rahmati, and D. Song. Robust physical-world attacks on machine learning models. arXiv preprint arXiv:1707.08945, 2017.
|
| 276 |
+
|
| 277 |
+
J. Fu, J. Co-Reyes, and S. Levine. Ex2: Exploration with exemplar models for deep reinforcement learning. In Advances in Neural Information Processing Systems, pp. 2574–2584, 2017.
|
| 278 |
+
|
| 279 |
+
Y. Geifman and R. El-Yaniv. Selective classification for deep neural networks. In Advances in neural information processing systems, pp. 4885–4894, 2017.
|
| 280 |
+
|
| 281 |
+
J. Gilmer, L. Metz, F. Faghri, S. Schoenholz, M. Raghu, M. Wattenberg, and I. Goodfellow. Adversarial spheres. arXiv preprint arXiv:1801.02774, 2018.
|
| 282 |
+
I. Goodfellow, J. Shlens, and C. Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014.
|
| 283 |
+
D. Harwath, A. Torralba, and J. Glass. Unsupervised learning of spoken language with visual context. In Advances in Neural Information Processing Systems, pp. 1858–1866, 2016.
|
| 284 |
+
K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
|
| 285 |
+
G. Hinton, L. Deng, D. Yu, G. Dahl, A.-r. Mohamed, N. Jaitly, A. Senior, V. Vanhoucke, P. Nguyen, T. Sainath, et al. Deep neural networks for acoustic modeling in speech recognition: The shared views of four research groups. IEEE Signal Processing Magazine, 29(6):82–97, 2012.
|
| 286 |
+
Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In CVPR, volume 1, pp. 3, 2017.
|
| 287 |
+
D. Karmon, D. Zoran, and Y. Goldberg. Lavan: Localized and visible adversarial noise. arXiv preprint arXiv:1801.02608, 2018.
|
| 288 |
+
D. Kingma and J. Ba. Adam: A method for stochastic optimization. 2015 ICLR, arXiv preprint arXiv:1412.6980, 2015. URL http://arxiv.org/abs/1412.6980.
|
| 289 |
+
A. Krizhevsky and G. Hinton. Learning multiple layers of features from tiny images. Master’s thesis, Department of Computer Science, University of Toronto, 2009.
|
| 290 |
+
A. Kurakin, I. Goodfellow, and S. Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016.
|
| 291 |
+
A. Kurakin, I. Goodfellow, and S. Bengio. Adversarial machine learning at scale. 2017 ICLR, arXiv preprint arXiv:1611.01236, 2017. URL http://arxiv.org/abs/1611.01236.
|
| 292 |
+
Y. Lecun, L. Bottou, Y. Bengio, and P. Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, Nov 1998. ISSN 0018-9219. doi: 10.1109/5.726791.
|
| 293 |
+
Q. Liu, X. Shen, and Y. Gu. Linearized admm for non-convex non-smooth optimization with convergence analysis. arXiv preprint arXiv:1705.02502, 2017.
|
| 294 |
+
S. Liu, S. Kar, M. Fardad, and P. K. Varshney. Sparsity-aware sensor collaboration for linear coherent estimation. IEEE Transactions on Signal Processing, 63(10):2582–2596, 2015.
|
| 295 |
+
S. Liu, J. Chen, P.-Y. Chen, and A. O. Hero. Zeroth-order online admm: Convergence analysis and applications. In Proceedings of the Twenty-First International Conference on Artificial Intelligence and Statistics, volume 84, pp. 288–297, April 2018.
|
| 296 |
+
A. Madry, A. Makelov, L. Schmidt, D. Tsipras, and A. Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017.
|
| 297 |
+
A. Nguyen, J. Yosinski, and J. Clune. Deep neural networks are easily fooled: High confidence predictions for unrecognizable images. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 427–436, 2015.
|
| 298 |
+
H. Ouyang, N. He, L. Tran, and A. Gray. Stochastic alternating direction method of multipliers. In International Conference on Machine Learning, pp. 80–88, 2013.
|
| 299 |
+
N. Papernot, I. Goodfellow, R. Sheatsley, R. Feinman, and P. McDaniel. cleverhans v1.0.0: an adversarial machine learning library. arXiv preprint arXiv:1610.00768, 2016a.
|
| 300 |
+
N. Papernot, P. McDaniel, S. Jha, M. Fredrikson, B. Celik, and A. Swami. The limitations of deep learning in adversarial settings. In Security and Privacy (EuroS&P), 2016 IEEE European Symposium on, pp. 372–387. IEEE, 2016b.
|
| 301 |
+
N. Papernot, P. McDaniel, X. Wu, S. Jha, and A. Swami. Distillation as a defense to adversarial perturbations against deep neural networks. In Security and Privacy (SP), 2016 IEEE Symposium on, pp. 582–597. IEEE, 2016c.
|
| 302 |
+
N. Papernot, P. McDaniel, I. Goodfellow, S. Jha, Z. Celik, and A. Swami. Practical black-box attacks against machine learning. In Proceedings of the 2017 ACM on Asia Conference on Computer and Communications Security, pp. 506–519. ACM, 2017.
|
| 303 |
+
N. Parikh, S. Boyd, et al. Proximal algorithms. Foundations and Trends $\textsuperscript { \textregistered }$ in Optimization, 1(3): 127–239, 2014.
|
| 304 |
+
M. Sharif, L. Bauer, and M. K. Reiter. On the suitability of lp-norms for creating and preventing adversarial examples. CoRR, abs/1802.09653, 2018.
|
| 305 |
+
X. Shi, M. Sapkota, F. Xing, F. Liu, L. Cui, and L. Yang. Pairwise based deep ranking hashing for histopathology image classification and retrieval. Pattern Recognition, 81:14 – 22, 2018. ISSN 0031-3203. doi: https://doi.org/10.1016/j.patcog.2018.03.015. URL http: //www.sciencedirect.com/science/article/pii/S0031320318301055.
|
| 306 |
+
D. Silver, A. Huang, C. Maddison, A. Guez, L. Sifre, G. Van Den Driessche, J. Schrittwieser, I. Antonoglou, V. Panneershelvam, M. Lanctot, et al. Mastering the game of go with deep neural networks and tree search. nature, 529(7587):484–489, 2016.
|
| 307 |
+
A. Sinha, H. Namkoong, and J. Duchi. Certifying some distributional robustness with principled adversarial training. 2018.
|
| 308 |
+
Dong Su, Huan Zhang, Hongge Chen, Jinfeng Yi, Pin-Yu Chen, and Yupeng Gao. Is robustness the cost of accuracy?–a comprehensive study on the robustness of 18 deep image classification models. arXiv preprint arXiv:1808.01688, 2018.
|
| 309 |
+
J. Su, D. Vargas, and S. Kouichi. One pixel attack for fooling deep neural networks. arXiv preprint arXiv:1710.08864, 2017.
|
| 310 |
+
T. Suzuki. Dual averaging and proximal gradient descent for online alternating direction multiplier method. In International Conference on Machine Learning, pp. 392–400, 2013.
|
| 311 |
+
C. Szegedy, W. Zaremba, I. Sutskever, J. Bruna, D. Erhan, I. Goodfellow, and R. Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013.
|
| 312 |
+
C. Szegedy, V. Vanhoucke, S. Ioffe, J. Shlens, and Z. Wojna. Rethinking the inception architecture for computer vision. 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2818–2826, 2016.
|
| 313 |
+
Christian Szegedy, Sergey Ioffe, Vincent Vanhoucke, and Alexander A Alemi. Inception-v4, inception-resnet and the impact of residual connections on learning. In AAAI, volume 4, pp. 12, 2017.
|
| 314 |
+
F. Tramèr, A. Kurakin, N. Papernot, I. Goodfellow, D. Boneh, and P. McDaniel. Ensemble adversarial training: Attacks and defenses. 2018 ICLR, arXiv preprint arXiv:1705.07204, 2018.
|
| 315 |
+
C. Xiao, J. Zhu, B. Li, W. He, M. Liu, and D. Song. Spatially transformed adversarial examples. CoRR, abs/1801.02612, 2018. URL http://arxiv.org/abs/1801.02612.
|
| 316 |
+
M. Yuan and Y. Lin. Model selection and estimation in regression with grouped variables. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 68(1):49–67, 2006.
|
| 317 |
+
B. Zhou, A. Khosla, A. Lapedriza, A. Oliva, and A. Torralba. Learning deep features for discriminative localization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2921–2929, 2016.
|
| 318 |
+
|
| 319 |
+
# APPENDIX
|
| 320 |
+
|
| 321 |
+
# A ILLUSTRATIVE EXAMPLE OF GROUP SPARSITY
|
| 322 |
+
|
| 323 |
+

|
| 324 |
+
Figure A1: An example of $4 \times 4$ perturbation matrix under sliding masks with different strides. The values of matrix elements are represented by color’s intensity (white stands for 0). Left: Non-overlapping groups with $r = 2$ and $S = 2$ . Right: Overlapping groups with $r = 2$ and $S = 1$ . In both cases, two groups $\mathcal { G } _ { 1 , 1 }$ and $\mathcal { G } _ { 1 , 2 }$ are highlighted, where $\mathcal { G } _ { 1 , 1 }$ is non-sparse, and $\mathcal { G } _ { 1 , 2 }$ is sparse.
|
| 325 |
+
|
| 326 |
+
# B PROOF OF PROPOSITION 1
|
| 327 |
+
|
| 328 |
+
We recall that the augmented Lagrangian function $L ( \delta , \mathbf { z } , \mathbf { w } , \mathbf { y } , \mathbf { u } , \mathbf { v } , \mathbf { s } )$ is given by
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
\begin{array} { r l r } & { } & { L ( { \bf z } , \delta , { \bf y } , { \bf w } , { \bf u } , { \bf v } , { \bf s } ) = f ( { \bf z } + { \bf x } _ { 0 } ) + \gamma D ( \delta ) + \tau \sum _ { i = 1 } ^ { P Q } \| { \bf y } _ { \mathcal { D } _ { i } } \| _ { 2 } + h ( { \bf w } ) + { \bf u } ^ { T } ( \delta - { \bf z } ) } \\ & { } & { + { \bf v } ^ { T } ( { \bf y } - { \bf z } ) + { \bf s } ^ { T } ( { \bf w } - { \bf z } ) + \displaystyle \frac { \rho } { 2 } \| \delta - { \bf z } \| _ { 2 } ^ { 2 } + \displaystyle \frac { \rho } { 2 } \| { \bf y } - { \bf z } \| _ { 2 } ^ { 2 } + \displaystyle \frac { \rho } { 2 } \| { \bf w } - { \bf z } \| _ { 2 } ^ { 2 } . } \end{array}
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
Problem (7), to minimize $L ( \delta , \mathbf { z } ^ { k } , \mathbf { w } , \mathbf { y } , \mathbf { u } ^ { k } , \mathbf { v } ^ { k } , \mathbf { s } ^ { k } )$ , can be decomposed into three sub-problems:
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
\operatorname* { m i n i m i z e } _ { \delta } \gamma D ( \pmb { \delta } ) + \frac { \rho } { 2 } \| \pmb { \delta } - \mathbf { a } \| _ { 2 } ^ { 2 } ,
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
\operatorname* { m i n i m i z e } _ { \mathbf { w } } { h ( \mathbf { w } ) } + \frac { \rho } { 2 } \| \mathbf { w } - \mathbf { b } \| _ { 2 } ^ { 2 } ,
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
$$
|
| 345 |
+
\underset { \mathbf { y } } { \mathrm { m i n i m i z e } } \ \tau \sum _ { i = 1 } ^ { P Q } \| \mathbf { y } _ { \mathcal { D } _ { i } } \| _ { 2 } + \frac { \rho } { 2 } \| \mathbf { y } - \mathbf { c } \| _ { 2 } ^ { 2 } ,
|
| 346 |
+
$$
|
| 347 |
+
|
| 348 |
+
where $\mathbf { a } : = \mathbf { z } ^ { k } - \mathbf { u } ^ { k } / \rho , \mathbf { b } : = \mathbf { z } ^ { k } - \mathbf { s } ^ { k } / \rho$ , and $\mathbf { c } : = \mathbf { z } ^ { k } - \mathbf { v } ^ { k } / \rho .$ .
|
| 349 |
+
|
| 350 |
+
$\delta$ -step Suppose $D ( \delta ) = \| \delta \| _ { 2 } ^ { 2 }$ , then the solution to problem (25) is easily acquired as below
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
\delta ^ { k + 1 } = \frac { \rho } { \rho + 2 \gamma } \mathbf { a }
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
w-step Based on the definition of $h ( \mathbf { w } )$ , problem (26) becomes
|
| 357 |
+
|
| 358 |
+
$$
|
| 359 |
+
\begin{array} { r l } { \underset { \mathbf { w } } { \mathrm { m i n i m i z e } } } & { \| \mathbf { w } - \mathbf { b } \| _ { 2 } ^ { 2 } } \\ { \mathrm { s u b j e c t ~ t o } } & { ( \mathbf { x } _ { 0 } + \mathbf { w } ) \in [ 0 , 1 ] ^ { n } , \ \| \mathbf { w } \| _ { \infty } \leq \epsilon . } \end{array}
|
| 360 |
+
$$
|
| 361 |
+
|
| 362 |
+
Problem (29) is equivalent to
|
| 363 |
+
|
| 364 |
+
$$
|
| 365 |
+
\begin{array} { r l } { \underset { w _ { i } } { \mathrm { m i n i m i z e } } } & { ( w _ { i } - a _ { i } ) _ { 2 } ^ { 2 } } \\ { \mathrm { s u b j e c t ~ t o } } & { - [ \mathbf { x } _ { 0 } ] _ { i } \leq w _ { i } \leq 1 - [ \mathbf { x } _ { 0 } ] _ { i } , | w _ { i } | \leq \epsilon } \end{array}
|
| 366 |
+
$$
|
| 367 |
+
|
| 368 |
+
for $i \in [ n ]$ , where $x _ { i }$ or $[ \mathbf { x } ] _ { i }$ represents the $i$ th element of $\mathbf { x }$ , and $1 - [ { \bf x } _ { 0 } ] _ { i } > 0$ since $[ \mathbf { x } _ { 0 } ] _ { i } \in [ 0 , 1 ]$ . Problem (30) then yields the solution
|
| 369 |
+
|
| 370 |
+
$$
|
| 371 |
+
[ \mathbf { w } ^ { k + 1 } ] _ { i } = \left\{ \begin{array} { l l } { \operatorname* { m i n } \{ 1 - [ \mathbf { x } _ { 0 } ] _ { i } , \epsilon \} } & { a _ { i } > \operatorname* { m i n } \{ 1 - [ \mathbf { x } _ { 0 } ] _ { i } , \epsilon \} } \\ { \operatorname* { m a x } \{ - [ \mathbf { x } _ { 0 } ] _ { i } , - \epsilon \} } & { a _ { i } < \operatorname* { m a x } \{ - [ \mathbf { x } _ { 0 } ] _ { i } , - \epsilon \} } \\ { a _ { i } } & { \mathrm { o t h e r w i s e } . } \end{array} \right.
|
| 372 |
+
$$
|
| 373 |
+
|
| 374 |
+
y-step Problem (27) becomes
|
| 375 |
+
|
| 376 |
+
$$
|
| 377 |
+
\underset { \mathbf { y } } { \mathrm { m i n i m i z e } } \sum _ { i = 1 } ^ { P Q } \| \mathbf { y } _ { \mathcal { D } _ { i } } \| _ { 2 } + \frac { \rho } { 2 \tau } \| \mathbf { y } - \mathbf { c } \| _ { 2 } ^ { 2 } ,
|
| 378 |
+
$$
|
| 379 |
+
|
| 380 |
+
The solution is given by the proximal operator associated with the $\ell _ { 2 }$ norm with parameter $\tau / \rho$ (Parikh et al., 2014)
|
| 381 |
+
|
| 382 |
+
$$
|
| 383 |
+
[ { \bf y } ^ { k + 1 } ] _ { \mathcal { D } _ { i } } = \left( 1 - \frac { \tau } { \rho \| [ { \bf c } ] _ { \mathcal { D } _ { i } } \| _ { 2 } } \right) _ { + } [ { \bf c } ] _ { \mathcal { D } _ { i } } , \ i \in [ P Q ] ,
|
| 384 |
+
$$
|
| 385 |
+
|
| 386 |
+
where recall that $\cup _ { i \in [ P Q ] } { \mathcal { D } } _ { i } = [ n ]$ , and $\mathcal { D } _ { i } \cap \mathcal { D } _ { j } = \emptyset$ if $i \neq j$ .
|
| 387 |
+
|
| 388 |
+
# C PROOF OF PROPOSITION 2
|
| 389 |
+
|
| 390 |
+
The augmented Lagrangian of problem (16) is given by
|
| 391 |
+
|
| 392 |
+
$$
|
| 393 |
+
\begin{array} { l } { { \displaystyle \langle { \bf z } , \delta , { \bf w } , \{ \bf y } _ { i } \rangle , { \bf u } , { \bf v } _ { i } , { \bf s } \rangle = f ( { \bf z } + { \bf x } _ { 0 } ) + \gamma D ( \delta ) + h ( { \bf w } ) + \tau \sum _ { i = 1 } ^ { P Q } \| { \bf y } _ { i } , { \mathcal D } _ { i } \| _ { 2 } + { \bf u } ^ { T } ( \delta - { \bf z } ) + { \bf s } ^ { T } ( { \bf w } - { \bf z } ) } \\ { { \displaystyle \qquad + \sum _ { i = 1 } ^ { P Q } { \bf v } _ { i } ^ { T } ( { \bf y } _ { i } - { \bf z } ) + \frac { \rho } { 2 } \| \delta - { \bf z } \| _ { 2 } ^ { 2 } + \frac { \rho } { 2 } \| { \bf w } - { \bf z } \| _ { 2 } ^ { 2 } + \frac { \rho } { 2 } \sum _ { i = 1 } ^ { P Q } \| { \bf y } _ { i } - { \bf z } \| _ { 2 } ^ { 2 } } , } \end{array}
|
| 394 |
+
$$
|
| 395 |
+
|
| 396 |
+
where u, $\mathbf { v } _ { i }$ and s are the Lagrangian multipliers.
|
| 397 |
+
|
| 398 |
+
ADMM decomposes the optimization variables into two blocks and adopts the following iterative scheme,
|
| 399 |
+
|
| 400 |
+
$$
|
| 401 |
+
\begin{array} { r l } & { \{ \delta ^ { k + 1 } , \mathbf w ^ { k + 1 } , \mathbf y _ { i } ^ { k + 1 } \} = \underset { \delta , \mathbf w , \{ \mathbf y _ { i } \} } { \arg \operatorname* { m i n } } L ( \mathbf z ^ { k } , \delta , \mathbf w , \mathbf y _ { i } , \mathbf u ^ { k } , \mathbf v _ { i } ^ { k } , \mathbf s ^ { k } ) , } \\ & { } \\ & { \mathbf z ^ { k + 1 } = \underset { \mathbf z } { \arg \operatorname* { m i n } } L ( \mathbf z , \delta ^ { k + 1 } , \mathbf w ^ { k + 1 } , \mathbf y _ { i } ^ { k + 1 } , \mathbf u ^ { k } , \mathbf v _ { i } ^ { k } , \mathbf s ^ { k } ) , } \\ & { \left\{ \begin{array} { l l } { \mathbf u ^ { k + 1 } = \mathbf u ^ { k } + \rho ( \delta ^ { k + 1 } - \mathbf z ^ { k + 1 } ) , } \\ { \mathbf v _ { i } ^ { k + 1 } = \mathbf v _ { i } ^ { k } + \rho ( \mathbf y _ { i } ^ { k + 1 } - \mathbf z ^ { k + 1 } ) , \mathrm { ~ f o r ~ } i \in [ P Q ] , } \\ { \mathbf s ^ { k + 1 } = \mathbf s ^ { k } + \rho ( \mathbf w ^ { k + 1 } - \mathbf z ^ { k + 1 } ) , } \end{array} \right. } \end{array}
|
| 402 |
+
$$
|
| 403 |
+
|
| 404 |
+
where $k$ is the iteration index. Problem (35) can be split into three subproblems as shown below,
|
| 405 |
+
|
| 406 |
+
$$
|
| 407 |
+
\operatorname* { m i n i m i z e } _ { \delta } \gamma D ( \pmb { \delta } ) + \frac { \rho } { 2 } \| \pmb { \delta } - \mathbf { a } \| _ { 2 } ^ { 2 } ,
|
| 408 |
+
$$
|
| 409 |
+
|
| 410 |
+
$$
|
| 411 |
+
\operatorname* { m i n i m i z e } _ { \mathbf { w } } ~ h ( \mathbf { w } ) + \frac { \rho } { 2 } \| \mathbf { w } - \mathbf { b } \| _ { 2 } ^ { 2 } ,
|
| 412 |
+
$$
|
| 413 |
+
|
| 414 |
+
$$
|
| 415 |
+
\operatorname* { m i n i m i z e } _ { \mathbf { y } _ { i } } { \tau } | | \mathbf { y } _ { i , \mathcal { D } _ { i } } | | _ { 2 } + \frac { \rho } { 2 } | | \mathbf { y } _ { i } - \mathbf { c } _ { i } | | _ { 2 } ^ { 2 } , \mathrm { f o r } i \in [ P Q ] .
|
| 416 |
+
$$
|
| 417 |
+
|
| 418 |
+
where $\mathbf { a } = \mathbf { z } ^ { k } - \mathbf { u } ^ { k } / \rho$ , $\mathbf { b } = \mathbf { z } ^ { k } - \mathbf { s } ^ { k } / \rho$ and $\mathbf { c } _ { i } = \mathbf { z } ^ { k } - \mathbf { v } _ { i } ^ { k } / \rho$ . Each problem has a closed form solution. Note that the solutions to problem (38) and problem (39) are given (28) and (31).
|
| 419 |
+
|
| 420 |
+
$\mathbf { y } _ { i }$ -step Problem (40) can be rewritten as
|
| 421 |
+
|
| 422 |
+
$$
|
| 423 |
+
\displaystyle \operatorname* { m i n i m i z e } _ { \mathbf { y } _ { i } } \ : \tau \| \mathbf { y } _ { i , \mathcal { D } _ { i } } \| _ { 2 } + \frac { \rho } { 2 } \| \mathbf { y } _ { i , \mathcal { D } _ { i } } - [ \mathbf { c } _ { i } ] _ { \mathcal { D } _ { i } } \| _ { 2 } ^ { 2 } + \frac { \rho } { 2 } \| \mathbf { y } _ { i , [ n ] / \mathcal { D } _ { i } } - [ \mathbf { c } _ { i } ] _ { [ n ] / \mathcal { D } _ { i } } \| _ { 2 } ^ { 2 } , \mathrm { ~ f o r ~ } i \in [ P Q ] ,
|
| 424 |
+
$$
|
| 425 |
+
|
| 426 |
+
which can be decomposed into
|
| 427 |
+
|
| 428 |
+
$$
|
| 429 |
+
\begin{array} { r l } & { \underset { { \bf y } _ { i , \mathcal { D } _ { i } } } { \mathrm { m i n i m i z e ~ } } \tau \| { \bf y } _ { i , \mathcal { D } _ { i } } \| _ { 2 } + \frac { \rho } { 2 } \| { \bf y } _ { i , \mathcal { D } _ { i } } - [ { \bf c } _ { i } ] _ { \mathcal { D } _ { i } } \| _ { 2 } ^ { 2 } , \mathrm { ~ f o r ~ } i \in [ P Q ] , } \end{array}
|
| 430 |
+
$$
|
| 431 |
+
|
| 432 |
+
and
|
| 433 |
+
|
| 434 |
+
$$
|
| 435 |
+
\mathop { \operatorname* { m i n i m i z e } } _ { \mathbf { y } _ { i , [ n ] / \mathcal { D } _ { i } } } ~ \| \mathbf { y } _ { i , [ n ] / \mathcal { D } _ { i } } - [ \mathbf { c } _ { i } ] _ { [ n ] / \mathcal { D } _ { i } } \| _ { 2 } ^ { 2 } , \mathrm { f o r } i \in [ P Q ] .
|
| 436 |
+
$$
|
| 437 |
+
|
| 438 |
+
The solution to problem (42) can be obtained through the block soft thresholding operator (Parikh et al., 2014),
|
| 439 |
+
|
| 440 |
+
$$
|
| 441 |
+
\big [ \mathbf { y } _ { i } ^ { k + 1 } \big ] _ { \mathcal { D } _ { i } } = \left( 1 - \frac { \tau } { \rho \| \big [ \mathbf { c } _ { i } \big ] _ { \mathcal { D } _ { i } } \| _ { 2 } } \right) _ { + } [ \mathbf { c } _ { i } ] _ { \mathcal { D } _ { i } } , \mathrm { f o r } i \in [ P Q ] ,
|
| 442 |
+
$$
|
| 443 |
+
|
| 444 |
+
The solution to problem (43) is given by,
|
| 445 |
+
|
| 446 |
+
$$
|
| 447 |
+
\begin{array} { r } { \left[ \mathbf { y } _ { i } ^ { k + 1 } \right] _ { [ n ] / \mathcal { D } _ { i } } = [ \mathbf { c } _ { i } ] _ { [ n ] / \mathcal { D } _ { i } } , \mathrm { f o r } i \in [ P Q ] . } \end{array}
|
| 448 |
+
$$
|
| 449 |
+
|
| 450 |
+
z-step Problem (36) can be simplified to
|
| 451 |
+
|
| 452 |
+
$$
|
| 453 |
+
\operatorname* { m i n i m i z e } _ { \mathbf { z } } \quad f ( \mathbf { x } _ { 0 } + \mathbf { z } ) + \frac { \rho } { 2 } \| \mathbf { z } - \mathbf { a } ^ { \prime } \| _ { 2 } ^ { 2 } + \frac { \rho } { 2 } \| \mathbf { z } - \mathbf { b } ^ { \prime } \| _ { 2 } ^ { 2 } + \frac { \rho } { 2 } \sum _ { i = 1 } ^ { P Q } \| \mathbf { z } - \mathbf { c } _ { i } ^ { \prime } \| _ { 2 } ^ { 2 } ,
|
| 454 |
+
$$
|
| 455 |
+
|
| 456 |
+
where $\mathbf { a } ^ { \prime } : = \delta ^ { k + 1 } + \mathbf { u } ^ { k } / \rho$ , $\mathbf b ^ { \prime } : = \mathbf w ^ { k + 1 } + \mathbf s ^ { k } / \rho$ , and $\mathbf c _ { i } ^ { \prime } : = \mathbf y _ { i } ^ { k + 1 } + \mathbf v _ { i } ^ { k } / \rho$ . We solve problem (46) using the linearization technique (Suzuki, 2013; Liu et al., 2018; Boyd et al., 2011). More specifically, the function $f$ is replaced with its first-order Taylor expansion at the point $\mathbf { z } ^ { k }$ by adding a Bregman divergence term $( \eta _ { k } \mathbf { \dot { / } } 2 ) \lVert \mathbf { z } - \mathbf { z } ^ { k } \rVert _ { 2 } ^ { 2 }$ . As a result, problem (46) becomes
|
| 457 |
+
|
| 458 |
+
$$
|
| 459 |
+
\begin{array} { r l } { \underset { \mathbf { z } } { \mathrm { m i n i m i z e } } } & { ( \nabla f ( \mathbf { z } ^ { k } + \mathbf { x } _ { 0 } ) ) ^ { T } ( \mathbf { z } - \mathbf { z } ^ { k } ) + \displaystyle \frac { \eta _ { k } } { 2 } \| \mathbf { z } - \mathbf { z } ^ { k } \| _ { 2 } ^ { 2 } + \displaystyle \frac { \rho } { 2 } \| \mathbf { z } - \mathbf { a } ^ { \prime } \| _ { 2 } ^ { 2 } } \\ & { + \displaystyle \frac { \rho } { 2 } \| \mathbf { z } - \mathbf { b } ^ { \prime } \| _ { 2 } ^ { 2 } + \displaystyle \frac { \rho } { 2 } \sum _ { i = 1 } ^ { P Q } \| \mathbf { z } - \mathbf { c } _ { i } ^ { \prime } \| _ { 2 } ^ { 2 } , } \end{array}
|
| 460 |
+
$$
|
| 461 |
+
|
| 462 |
+
whose solution is given by
|
| 463 |
+
|
| 464 |
+
$$
|
| 465 |
+
\mathbf { z } ^ { k + 1 } = \frac { \eta _ { k } \mathbf { z } ^ { k } + \rho \mathbf { a } ^ { \prime } + \rho \mathbf { b } ^ { \prime } + \rho \sum _ { i = 1 } ^ { P Q } \mathbf { c } _ { i } ^ { \prime } - \nabla f ( \mathbf { z } ^ { k } + \mathbf { x } _ { 0 } ) } { \eta _ { k } + ( 2 + P Q ) \rho } .
|
| 466 |
+
$$
|
| 467 |
+
|
| 468 |
+
# D PROOF OF PROPOSITION 3
|
| 469 |
+
|
| 470 |
+
We start by converting problem (20) into the ADMM form
|
| 471 |
+
|
| 472 |
+
$$
|
| 473 |
+
\begin{array} { r l } { \underset { \delta , \mathbf { z } } { \mathrm { m i n i m i z e } } } & { \ f ( \mathbf { x } _ { 0 } + \mathbf { z } ) + g ( \mathbf { z } ) + \gamma D ( \delta ) + h ( \delta ) + g ( \delta ) } \\ { \mathrm { s u b j e c t \ t o } } & { \ \delta = \mathbf { z } , } \end{array}
|
| 474 |
+
$$
|
| 475 |
+
|
| 476 |
+
where $\mathbf { z }$ and $\delta$ are optimization variables, $g ( \delta )$ is an indicator function with respect to the constraint $\{ \delta _ { i } = 0$ , if $i \in \mathcal { S } _ { \sigma } \bar \}$ , and $h ( \delta )$ is the other indicator function with respect to the other constraints $( \mathbf { x } _ { 0 } + \pmb { \delta } ) \in [ 0 , 1 ] ^ { n }$ , $\| \pmb { \delta } \| _ { \infty } \le \epsilon$ .
|
| 477 |
+
|
| 478 |
+
The augmented Lagrangian of problem (20) is given by
|
| 479 |
+
|
| 480 |
+
$$
|
| 481 |
+
L ( \boldsymbol { \delta } , \mathbf { z } , \mathbf { u } ) = f ( \mathbf { z } + \mathbf { x } _ { 0 } ) + g ( \mathbf { z } ) + \gamma D ( \boldsymbol { \delta } ) + h ( \boldsymbol { \delta } ) + g ( \boldsymbol { \delta } ) + \mathbf { u } ^ { T } ( \boldsymbol { \delta } - \mathbf { z } ) + \frac { \rho } { 2 } \| \boldsymbol { \delta } - \mathbf { z } \| _ { 2 } ^ { 2 } ,
|
| 482 |
+
$$
|
| 483 |
+
|
| 484 |
+
where $\mathbf { u }$ is the Lagrangian multiplier.
|
| 485 |
+
|
| 486 |
+
ADMM yields the following alternating steps
|
| 487 |
+
|
| 488 |
+
$$
|
| 489 |
+
\begin{array} { r l } & { \delta ^ { k + 1 } = \underset { \delta } { \arg \operatorname* { m i n } } L ( \delta , \mathbf { z } ^ { k } , \mathbf { u } ^ { k } ) } \\ & { \mathbf { z } ^ { k + 1 } = \underset { \mathbf { z } } { \arg \operatorname* { m i n } } L ( \delta ^ { k + 1 } , \mathbf { z } , \mathbf { u } ^ { k } ) } \\ & { \mathbf { u } ^ { k + 1 } = \mathbf { u } ^ { k } + \rho ( \delta ^ { k + 1 } - \mathbf { z } ^ { k + 1 } ) . } \end{array}
|
| 490 |
+
$$
|
| 491 |
+
|
| 492 |
+
$\delta$ -step Suppose $D ( \delta ) = \| \delta \| _ { 2 } ^ { 2 }$ , problem (51) becomes
|
| 493 |
+
|
| 494 |
+
$$
|
| 495 |
+
\begin{array} { r l } { \underset { \delta } { \mathrm { m i n i m i z e } } } & { \gamma \| \pmb { \delta } \| _ { 2 } ^ { 2 } + \frac { \rho } { 2 } \| \pmb { \delta } - \mathbf { a } \| _ { 2 } ^ { 2 } } \\ { \mathrm { s u b j e c t ~ t o } } & { ( \mathbf { x } _ { 0 } + \pmb { \delta } ) \in [ 0 , 1 ] ^ { n } , \| \pmb { \delta } \| _ { \infty } \leq \epsilon } \\ & { \delta _ { i } = 0 , \mathrm { i f ~ } i \in \mathcal { S } _ { \sigma } , } \end{array}
|
| 496 |
+
$$
|
| 497 |
+
|
| 498 |
+
where $\mathbf { a } : = \mathbf { z } ^ { k } - \mathbf { u } ^ { k } / \rho$ . Problem (54) can be decomposed elementwise
|
| 499 |
+
|
| 500 |
+
$$
|
| 501 |
+
\begin{array} { r l } { \underset { \delta _ { i } } { \mathrm { m i n i m i z e } } } & { \frac { 2 \gamma + \rho } { \rho } \delta _ { i } ^ { 2 } - 2 a _ { i } \delta _ { i } + a _ { i } ^ { 2 } = \frac { 2 \gamma + \rho } { \rho } \left( \delta _ { i } - \frac { \rho } { 2 \gamma + \rho } a _ { i } \right) ^ { 2 } } \\ { \mathrm { s u b j e c t \ t o } } & { \left( [ \mathbf { x } _ { 0 } ] _ { i } + \delta _ { i } \right) \in [ 0 , 1 ] , ~ | \delta _ { i } | \leq \epsilon } \\ & { \delta _ { i } = 0 , ~ \mathrm { i f } ~ i \in \mathcal { S } _ { \sigma } . } \end{array}
|
| 502 |
+
$$
|
| 503 |
+
|
| 504 |
+
The solution to problem (55) is then given by
|
| 505 |
+
|
| 506 |
+
$$
|
| 507 |
+
[ \delta ^ { k + 1 } ] _ { i } = \left\{ \begin{array} { l l } { 0 } & { i \in { \mathcal { S } } _ { \sigma } } \\ { \operatorname* { m i n } \{ 1 - [ { \mathbf { x } } _ { 0 } ] _ { i } , \epsilon \} } & { \frac { \rho } { 2 \gamma + \rho } a _ { i } > \operatorname* { m i n } \{ 1 - [ { \mathbf { x } } _ { 0 } ] _ { i } , \epsilon \} , i \notin { \mathcal { S } } _ { \sigma } } \\ { \operatorname* { m a x } \{ - [ { \mathbf { x } } _ { 0 } ] _ { i } , - \epsilon \} } & { \frac { \rho } { 2 \gamma + \rho } a _ { i } < \operatorname* { m a x } \{ - [ { \mathbf { x } } _ { 0 } ] _ { i } , - \epsilon \} , i \notin { \mathcal { S } } _ { \sigma } } \\ { \frac { \rho } { 2 \gamma + \rho } a _ { i } } & { \mathrm { o t h e r w i s e } . } \end{array} \right.
|
| 508 |
+
$$
|
| 509 |
+
|
| 510 |
+
$\mathbf { z }$ -step Problem (52) yields
|
| 511 |
+
|
| 512 |
+
$$
|
| 513 |
+
\begin{array} { r l } { \underset { \mathbf { z } } { \mathrm { m i n i m i z e } } } & { { } f ( \mathbf { x } _ { 0 } + \mathbf { z } ) + \displaystyle \frac { \rho } { 2 } \| \mathbf { z } - \mathbf { a } ^ { \prime } \| _ { 2 } ^ { 2 } } \\ { \mathrm { s u b j e c t ~ t o } } & { { } z _ { i } = 0 , \mathrm { ~ i f ~ } i \in \mathcal { S } _ { \sigma } , } \end{array}
|
| 514 |
+
$$
|
| 515 |
+
|
| 516 |
+
where $\mathbf { a } ^ { \prime } = \delta ^ { k + 1 } + \mathbf { u } ^ { k } / \rho$ . We solve problem (57) using the linearization technique (Suzuki, 2013; Liu et al., 2018; Boyd et al., 2011),
|
| 517 |
+
|
| 518 |
+
$$
|
| 519 |
+
\begin{array} { l l } { \mathrm { m i n i m i z e } } & { ( \nabla f ( \mathbf { x } _ { 0 } + \mathbf { z } ^ { k } ) ) ^ { T } ( \mathbf { z } - \mathbf { z } ^ { k } ) + \displaystyle \frac { \eta _ { k } } { 2 } \| \mathbf { z } - \mathbf { z } ^ { k } \| _ { 2 } ^ { 2 } + \displaystyle \frac { \rho } { 2 } \| \mathbf { z } - \mathbf { a } ^ { \prime } \| _ { 2 } ^ { 2 } } \\ { \mathrm { s u b j e c t ~ t o } } & { z _ { i } = 0 , \mathrm { ~ i f ~ } i \in \mathcal { S } _ { \sigma } , } \end{array}
|
| 520 |
+
$$
|
| 521 |
+
|
| 522 |
+
where $\eta _ { k }$ is a decaying parameter associated with the Bregman divergence term $\| \mathbf { z } - \mathbf { z } ^ { k } \| _ { 2 } ^ { 2 }$ . In problems (57) and (58), only variables $\left\{ z _ { i } \right\}$ satisfying $i \notin S _ { \sigma }$ are unknown. The solution to problem (58) is then given by
|
| 523 |
+
|
| 524 |
+
$$
|
| 525 |
+
\begin{array} { r } { [ \mathbf { z } ^ { k + 1 } ] _ { i } = \left\{ \begin{array} { l l } { 0 } & { i \in \mathcal { S } _ { \sigma } } \\ { \frac { \eta _ { k } [ \mathbf { z } ^ { k } ] _ { i } + \rho [ \mathbf { a } ^ { \prime } ] _ { i } - [ \nabla f ( \mathbf { z } ^ { k } + \mathbf { x } _ { 0 } ) ] _ { i } } { \eta _ { k } + \rho } } & { i \notin \mathcal { S } _ { \sigma } . } \end{array} \right. } \end{array}
|
| 526 |
+
$$
|
| 527 |
+
|
| 528 |
+
# E ADVERSARIAL SALIENCY MAP (ASM) AND CLASS ACTIVATION MAPPING (CAM)
|
| 529 |
+
|
| 530 |
+
$\mathrm { A S M } ( \mathbf { x } , t ) \in \mathbb { R } ^ { d }$ is defined by the forward derivative of a neural network given the input sample $\mathbf { x }$ and the target label $t$ (Papernot et al., 2016b)
|
| 531 |
+
|
| 532 |
+
$$
|
| 533 |
+
\begin{array} { r } { \mathrm { A S M } ( \mathbf { x } , t ) [ i ] = \left\{ \begin{array} { l l } { 0 } & { \mathrm { i f } \frac { \partial Z ( \mathbf { x } ) _ { t } } { \partial \mathbf { x } _ { i } } < 0 \mathrm { o r } \sum _ { j \neq t } \frac { \partial Z ( \mathbf { x } ) _ { j } } { \partial \mathbf { x } _ { i } } > 0 } \\ { \left( \frac { \partial Z ( \mathbf { x } ) _ { t } } { \partial \mathbf { x } _ { i } } \right) \left| \sum _ { j \neq t } \frac { \partial Z ( \mathbf { x } ) _ { j } } { \partial \mathbf { x } _ { i } } \right| } & { \mathrm { o t h e r w i s e } , } \end{array} \right. } \end{array}
|
| 534 |
+
$$
|
| 535 |
+
|
| 536 |
+
where $Z ( \mathbf { x } ) _ { j }$ is the $j$ th element of logits $Z ( \mathbf { x } )$ , representing the output before the last softmax layer in DNNs. If there exist many classes in a dataset (e.g., 1000 classes in ImageNet), then computing $\textstyle \sum _ { j \neq t } { \frac { \partial Z ( \mathbf { x } ) _ { j } } { \partial \mathbf { x } _ { i } } }$ t ∂Z(x)j∂x is intensive. To circumvent the scalability issue of ASM, we focus on the logit change with respect to the true label $t _ { 0 }$ and the target label $t$ only. More specifically, we consider three quantities, $\begin{array} { r } { \frac { \partial Z ( \mathbf { x } ) _ { t } } { \partial \mathbf { x } _ { i } } , - \frac { \partial Z ( \mathbf { x } ) _ { 0 } } { \partial \mathbf { x } _ { i } } } \end{array}$ , and $\begin{array} { r } { \left( \frac { \partial Z ( \mathbf { x } ) _ { t } } { \partial \mathbf { x } _ { i } } \right) \left| \sum _ { j \neq t } \frac { \partial Z ( \mathbf { x } ) _ { j } } { \partial \mathbf { x } _ { i } } \right| , } \end{array}$ , which correspond to a) promotion of the score of the target label $t$ , b) suppression of the classification score of the true label $t _ { 0 }$ , and c) a dual role on suppression and promotion. As a result, we modify (60) as
|
| 537 |
+
|
| 538 |
+
$$
|
| 539 |
+
\begin{array} { r } { \mathrm { A S M } ( \mathbf { x } , t ) [ i ] = \left\{ \begin{array} { l l } { 0 } & { \mathrm { ~ i f ~ } \frac { \partial Z ( \mathbf { x } ) _ { t } } { \partial \mathbf { x } _ { i } } < 0 \mathrm { ~ o r ~ } \frac { \partial Z ( \mathbf { x } ) _ { t _ { 0 } } } { \partial \mathbf { x } _ { i } } > 0 } \\ { \left( \frac { \partial Z ( \mathbf { x } ) _ { t } } { \partial \mathbf { x } _ { i } } \right) \left| \frac { \partial Z ( \mathbf { x } ) _ { t _ { 0 } } } { \partial \mathbf { x } _ { i } } \right| } & { \mathrm { ~ o t h e r w i s e } . } \end{array} \right. } \end{array}
|
| 540 |
+
$$
|
| 541 |
+
|
| 542 |
+
CAM allows us to visualize the perturbation of adversaries on predicted class scores given any pair of image and object label, and highlights the discriminative object regions detected by CNNs (Zhou et al., 2016). In Fig. A2, we show ASM and the discriminative regions identified by CAM on several ImageNet samples.
|
| 543 |
+
|
| 544 |
+

|
| 545 |
+
Figure A2: (a) Overlay ASM and $\mathbf { B } _ { \mathrm { A S M } } \circ \delta$ on top of image with the true and the target label. From left to right: original image, ASM (darker color represents larger value of ASM score), $\mathbf { B } _ { \mathrm { A S M } } \circ \delta$ under our attack, and $\mathbf { B } _ { \mathrm { A S M } } \circ \pmb { \delta }$ under C&W attack. Here $\nu$ in $\mathbf { B } _ { \mathrm { A S M } }$ is set by the 90th percentile of ASM scores. (b) From left to right: original image, CAM of original label, and perturbations with target label generated from the StrAttack and C&W attack, respectively.
|
| 546 |
+
|
| 547 |
+
# F EXPERIMENT SETUP AND PARAMETER SETTING
|
| 548 |
+
|
| 549 |
+
In this work, we consider targeted adversarial attacks since they are believed stronger than untargeted attacks. For targeted attacks, we have different methods to choose the target labels. The average case selects the target label randomly among all the labels that are not the correct label. The best case performs attacks using all incorrect labels, and report the target label that is the least difficult to attack. The worst case performs attacks using all incorrect labels, and report the target label which is the most difficult to attack.
|
| 550 |
+
|
| 551 |
+
In our experiments, two networks are trained for MNIST and CIFAR-10, respectively, and a pretrained network is utilized for ImageNet. The model architectures for MNIST and CIFAR-10 are the same, both with four convolutional layers, two max pooling layers, two fully connected layers and a softmax layer. It can achieve $9 9 . 5 \%$ and $80 \%$ accuracy on MNIST and CIFAR-10, respectively. For ImageNet, a pre-trained Inception v3 network (Szegedy et al., 2016) is applied which can achieve $96 \%$ top-5 accuracy. All experiments are conducted on machines with NVIDIA GTX 1080 TI GPUs.
|
| 552 |
+
|
| 553 |
+
The implementations of FGM and IFGM are based on the CleverHans package (Papernot et al., 2016a). The key distortion parameter $\epsilon$ is determined by a fine-grained grid search. For IFGM, we perform 10 FGM iterations and the distortion parameter $\epsilon ^ { \prime }$ is set to $\epsilon / 1 0$ for effectiveness as shown in Tramèr et al. (2018). The implementation of the C&W attack is based on the opensource code provided by Carlini & Wagner (2017). The maximum iteration number is set to 1000 and it has 9 binary search steps.
|
| 554 |
+
|
| 555 |
+
In the StrAttack, the group size for MNIST and CIFAR-10 is $2 \times 2$ and its stride is set to 2 if the non-overlapping mask is used, otherwise the group size is $3 \times 3$ and stride is 2. The group size for ImageNet is $1 3 \times 1 3$ and its stride is set to 13. In ADMM, the parameter $\rho$ achieves a trade-off between the convergence rate and the convergence value. A larger $\rho$ could make ADMM converging faster but usually leads to perturbations with larger $\ell _ { p }$ distortion values. A proper configuration of the parameters is suggested as follows: We set the penalty parameter $\rho = 1$ , decaying parameter in (14) $\eta _ { 1 } = 5$ , $\tau = 2$ and $\gamma = 1$ . Moreover, we set $c$ defined in (3) to 0.5 for MNIST, 0.25 for CIFAR-10, and 2.5 for ImageNet. Refined attack technique proposed in Sec. 4.2 is applied for all experiments, we set $\sigma$ is equal to $3 \%$ quantile value of non-zero perturbation in $\delta ^ { * }$ . We observe that $73 \%$ of $\delta ^ { * }$ can be retrained to a $\sigma$ -sparse perturbation successfully which proof the effective of our refined attack step.
|
| 556 |
+
|
| 557 |
+
# G SUPPLEMENTARY EXPERIMENTAL RESULTS
|
| 558 |
+
|
| 559 |
+

|
| 560 |
+
Figure A3: C&W attack vs StrAttack on MNIST with grid size $2 \times 2$ .
|
| 561 |
+
|
| 562 |
+
Some random choice samples from MNIST (Fig. A3), CIFAR-10 (Fig. A4) and ImageNet (Fig. A5) compare StrAttack with C&W attack. For better sparse visual effect, we only show non-overlapping mask function results here. From these samples, we can discover a consistent phenomenon that our StrAttack is more interested in some particular regions, they usually appear on the objects or their edges in original images, distinctly seen in MNIST (Fig. A3) and ImageNet (Fig. A5).
|
| 563 |
+
|
| 564 |
+
# H STRATTACK AGAINST DEFENSIVE DISTILLATION AND ADVERSARIALTRAINING
|
| 565 |
+
|
| 566 |
+
In this section, we present the performance of the StrAttack against defensive distillation (Papernot et al., 2016c) and adversarial training (Tramèr et al., 2018). In defensive distillation, we evaluate the
|
| 567 |
+
|
| 568 |
+

|
| 569 |
+
Figure A4: C&W attack vs StrAttack on CIFAR-10 with grid size $2 \times 2$ .
|
| 570 |
+
|
| 571 |
+
StrAttack for different temperature parameters on MNIST and CIFAR-10. We generate 9000 adversarial examples with 1000 randomly selected images from MNIST and CIFAR-10, respectively. The attack success rates of the StrAttack for different temperatures $T$ are all $100 \%$ . The reason is that distillation at temperature $T$ makes the logits approximately $T$ times larger but does not change the relative values of logits. The StrAttack which works on the relative values of logits does not fail.
|
| 572 |
+
|
| 573 |
+
We further use the StrAttack to break DNNs training on adversarial examples (Tramèr et al., 2018) with their correct labels on MNIST. The StrAttack is performed on three neural networks: the first network is unprotected, the second is obtained by retraining with $9 0 0 0 \mathrm { C } \& \mathrm { { W } }$ adversarial examples, and the third network is retained with 9000 adversarial examples crafted by the StrAttack. The success rate and distortions on the three networks are shown in Table A1. The StrAttack can break all three networks with $100 \%$ success rate. However, adversarial training shows certain defense effects as an increase on the $\ell _ { 1 }$ or $\ell _ { 2 }$ distortion on the latter two networks over the unprotected network is observed.
|
| 574 |
+
|
| 575 |
+
Table A1: StrAttack against adversarial training on MNIST
|
| 576 |
+
|
| 577 |
+
<table><tr><td rowspan="2">Adversarial training</td><td colspan="3">Best case</td><td colspan="3">Averagecase</td><td colspan="3">Worst case</td></tr><tr><td>ASR</td><td>l1</td><td>l2</td><td>ASR</td><td>l1</td><td>l2</td><td>ASR</td><td>l1</td><td>l2</td></tr><tr><td>None</td><td>100</td><td>10.9</td><td>1.51</td><td>100</td><td>18.05</td><td>2.16</td><td>100</td><td>26.9</td><td>2.81</td></tr><tr><td>C&W</td><td>100</td><td>16.1</td><td>1.87</td><td>100</td><td>25.1</td><td>2.58</td><td>100</td><td>34.2</td><td>3.26</td></tr><tr><td>structured</td><td>100</td><td>15.6</td><td>1.86</td><td>100</td><td>25.1</td><td>2.61</td><td>100</td><td>34.6</td><td>3.31</td></tr></table>
|
| 578 |
+
|
| 579 |
+

|
| 580 |
+
Figure A5: C&W attack vs StrAttack on ImageNet with grid size $1 3 \times 1 3$ .
|
md/train/BkxthxHYvr/BkxthxHYvr.md
ADDED
|
@@ -0,0 +1,368 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CONDITIONAL GENERATION OF MOLECULES FROM DISENTANGLED REPRESENTATIONS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Though machine learning approaches have shown great success in estimating properties of small molecules, the inverse problem of generating molecules with desired properties remains challenging. This difficulty is in part because the set of molecules which have a given property is structurally very diverse. Treating this inverse problem as a conditional distribution estimation task, we draw upon work in learning disentangled representations to learn a conditional distribution over molecules given a desired property, where the molecular structure is encoded in a continuous latent random variable. By including property information as an input factor independent from the structure representation, one can perform conditional molecule generation via a “style transfer” process, in which we explicitly set the property to a desired value at generation time. In contrast to existing approaches, we disentangle the latent factors from the property factors using a regularization term which constrains the generated molecules to have the property provided to the generation network, no matter how the latent factor changes.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Conditional molecule generation is far from being solved. The main challenge is the enormous and discrete nature of the molecules space and the fact that molecule properties are highly sensitive to molecular structure (Kirkpatrick & Ellis, 2004). Approaches to conditional generation are typically two-step, either using a model or genetic algorithm to generate candidates which are later filtered, or learning a continuous embedding of the discrete molecules and optimizing in a real-valued representation space. The former is computationally expensive, the latter performs conditional generation only very obliquely.
|
| 12 |
+
|
| 13 |
+
We propose a conditional generative model that produces candidate molecules which targeting a desired property in a single step. This approach builds on work in structured deep generative models (Kingma et al., 2014; Siddharth et al., 2017), which aim to learn a disentangled representation that factors into observed properties we want to control for, and latent factors that account for the remaining features which are either hard to annotate or irrelevant to the properties we wish to optimize.
|
| 14 |
+
|
| 15 |
+
We derive a regularizer for supervised variational autoencoders which exploits property information that we provide as supervision, ensuring that produced molecules adhere to target properties they are conditioned on. We demonstrate the ability of our model to perform accurate conditional molecule generation and a sort of “style transfer” on molecules, where a latent representation for a single molecule can have its target properties perturbed independently of its learnt structural characteristics, allowing direct and efficient generation of candidates for local optimization of molecules.
|
| 16 |
+
|
| 17 |
+
# 2 BACKGROUND
|
| 18 |
+
|
| 19 |
+
Molecule discovery tasks come in two flavors. Global optimization seeks to find molecules that have a particular target property. Local optimization starts from some initial molecule and searches for molecules which have a desired property while not straying too far from the prototype. There is some overlap in methods used in the two approaches.
|
| 20 |
+
|
| 21 |
+
# 2.1 DEEP GENERATIVE MODELS FOR MOLECULES
|
| 22 |
+
|
| 23 |
+
Virtual screening methods start from a large database of possible molecules and retain the promising ones (Eckert & Bajorath, 2007), as measured by some quality function $f ( \cdot )$ . Machine learning approaches expand on this by dynamically generating additional candidate molecules; Segler et al. (2017) uses a stacked LSTM to produce large numbers of novel molecules which have similar characteristics to an existing database.
|
| 24 |
+
|
| 25 |
+
For properties which are expensive to evaluate, generating large sets of candidate molecules is not particularly useful. More sample-efficient global search can be achieved using Bayesian optimization methods, which use a generative model with a latent space that functions as a continuous representation of molecules (Gomez-Bombarelli et al., 2016; Kusner et al., 2017). Optimization is then ´ carried out over this continuous representation space to find candidates which are expected to have the desired property. Local gradient-based search can also be applied on continuous latent spaces to optimize the latent representation with respect to a target property (Jin et al., 2018; Liu et al., 2018).
|
| 26 |
+
|
| 27 |
+
A challenge for these latent variable models is to reliably produce valid molecules. Character variational autoencoders (CVAEs) (Gomez-Bombarelli et al., 2016) generate molecules one character ´ at a time, and are prone to syntactic and semantic errors; the grammar-based variational autoencoder (GVAE) (Kusner et al., 2017) and syntax-directed variational autoencoder (SD-VAE) (Dai et al., 2018) instead operate in the space of context-free and attribute grammars, respectively, to ensure syntactic validity. Other work generative models that operates on graph representations (Simonovsky & Komodakis, 2018; De Cao & Kipf, 2018; Jin et al., 2018; You et al., 2018; Liu et al., 2018), largely improving the ability to generate valid molecules.
|
| 28 |
+
|
| 29 |
+
Suppose we are given a training set of pairs $\mathcal { D } = \{ ( \mathbf { x } _ { i } , \mathbf { y } _ { i } ) \} , i = 1 , \ldots , N .$ , where x corresponds to molecules and y represents a value of some properties of the molecule $\mathbf { x }$ . Assume the molecules represent an i.i.d. sample from some unknown distribution $\tilde { p } ( { \bf x } )$ , which assigns high probability to molecules believed to be useful for a given task. Aside from Segler et al. (2017), which has no latent space and thus directly trains via maximum likelihood, these latent variable models are trained by optimizing a standard ELBO objective for variational autoencoders (?). This entails learning a stochastic encoder $q _ { \phi } ( { \bf z } | { \bf x } )$ which maps molecules into a latent space, and a stochastic decoder $p _ { \boldsymbol { \theta } } ( \mathbf { x } | \mathbf { z } )$ for reconstructing molecules, by maximizing
|
| 30 |
+
|
| 31 |
+
$$
|
| 32 |
+
\mathcal { L } ( \boldsymbol { \theta } , \boldsymbol { \phi } ) = \sum _ { i = 1 } ^ { N } \bigg \{ \mathbb { E } _ { q _ { \boldsymbol { \phi } } ( \mathbf { z } _ { i } | \mathbf { x } _ { i } ) } [ \log p _ { \boldsymbol { \theta } } ( \mathbf { x } _ { i } | \mathbf { z } _ { i } ) ] - D _ { K L } ( q _ { \boldsymbol { \phi } } ( \mathbf { z } _ { i } | \mathbf { x } _ { i } ) | | p ( \mathbf { z } _ { i } ) ) \bigg \} .
|
| 33 |
+
$$
|
| 34 |
+
|
| 35 |
+
Notably, the objective is not a function of y: most existing generative models with latent variables do not perform direct conditional generation, and approaches for targeted molecule discovery are bolted on to the learnt model. Some, e.g. Kusner et al. (2017), are trained in an “unsupervised” manner, agnostic to any property which later may need to be optimized. Others, e.g. Gomez-Bombarelli ´ et al. (2016); Liu et al. (2018), train the autoencoder jointly alongside a function to predict y from z, hoping to guide the latent space to be also good for predicting the desired property. A recent exception is Assouel et al. (2018), which learns a deterministic autoencoder where the decoder takes the latent code and the desired property as input, using a mutual information term in training to steer the model towards generating molecules whose target properties match the input. Guimaraes et al. (2017); De Cao & Kipf (2018); You et al. (2018) instead learn generation models optimized towards specific metrics, such as drug-likeliness and solubility; the major downside is that these models must be retrained each time for a new property. In contrast, the autoencoder-based methods can be re-used to optimize towards any particular value of the property.
|
| 36 |
+
|
| 37 |
+
# 2.2 STYLE TRANSFER WITH SUPERVISED VAES
|
| 38 |
+
|
| 39 |
+
While the latent representations learned through standard VAE models perform well on the task of molecule reconstruction they do not necessarily provide interpretable factorised representations. A disentangled representation gives us additional control on the molecule generation process, allowing us to modify a single property leaving the remaining unaffected (Bengio et al., 2013a). In many cases important variation in the data is easy to annotate. For example in the case of molecule datasets we have access to different functional descriptors of the molecules obtained by chemoinformatics software such as RDKit (Landrum). Particularly useful to us here are supervised methods for learning disentangled representations (Kingma et al., 2014; Siddharth et al., 2017). These are distinct from unsupervised disentangling approaches such as InfoGAN (Chen et al., 2016) or $\beta$ -VAE (Higgins et al., 2017), which encourages the latent factor to learn a disentangled representation by modifying the objective to promote component independence.
|
| 40 |
+
|
| 41 |
+
We will learn representations that specifically disentangle molecular properties of interest which we may later want to modify. Kingma et al. (2014) demonstrates how disentangling can be used to take two MNIST images of different digits, written in different styles, and independently change the digit while holding the style constant. An analogous operation on molecules would involve holding the physical structure of a molecule (its “style”) relatively fixed while modifying a salient property. Unlike (say) the style transfer example for the MNIST digits, the conditional distribution of molecules with a particular value of properties might be very diverse; for example, the QED score attempts to measure the drug-likeness of a molecule, and the set of molecules generated at high values of this score would hopefully have high probability on a large, varied set of molecules. An essential challenge here is that the property only provides a very weak signal as to the overall structure of the molecule. To account for this diversity, we model the conditional distribution with a latent variable $\mathbf { z }$ , such that $\begin{array} { r } { p _ { \theta } ( \mathbf { x } | \mathbf { y } ) = \int p _ { \theta } ( \mathbf { x } | \mathbf { z } , \mathbf { y } ) p ( \mathbf { \bar { z } } ) d \mathbf { z } } \end{array}$ .
|
| 42 |
+
|
| 43 |
+
Disentangling the latent code $\mathbf { z }$ from the property y enables style transfer. This is done by taking an initial $\mathbf { x }$ , computing the posterior over the latent variable $\mathbf { z }$ , and then generating a new $\mathbf { x } ^ { \prime }$ with the property modified to have a target value $\mathbf { y } ^ { \prime }$ , with $p _ { \theta } ( \mathbf { x } ^ { \prime } | \mathbf { y } ^ { \prime } , \mathbf { x } ) =$ $\begin{array} { r } { \int p _ { \theta } ( \mathbf { x } ^ { \prime } | \mathbf { y } ^ { \prime } , \mathbf { z } ) p _ { \theta } ( \mathbf { z } | \mathbf { x } ) d \mathbf { z } } \end{array}$ .
|
| 44 |
+
|
| 45 |
+

|
| 46 |
+
Figure 1: A demonstration of style transfer
|
| 47 |
+
|
| 48 |
+
Concretely, this involves fitting a joint generative model of the form $p _ { \boldsymbol { \theta } } ( \mathbf { x } , \mathbf { y } , \mathbf { z } ) = p _ { \boldsymbol { \theta } } ( \mathbf { x } | \mathbf { y } , \mathbf { z } ) p ( \mathbf { y } ) \bar { p ( \mathbf { z } ) }$ , in which $\mathbf { y }$ and $\mathbf { z }$ are independent under the prior, and we assume a unit multivariate normal prior $p ( \mathbf { z } )$ . To infer the latent variable $\mathbf { z }$ we will use a variational distribution $q _ { \phi } ( { \bf z } | { \bf x } )$ , which takes the form of a multivariate normal distribution with parameters a nonlinear function of $\mathbf { x }$ , to approximate the true posterior $p _ { \theta } ( \mathbf { z } | \mathbf { x } , \mathbf { y } )$ . This objective function
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
\mathcal { L } _ { E L B O } ( \theta , \phi ) = \sum _ { i = 1 } ^ { N } \left\{ \mathbb { E } _ { q _ { \phi } ( \mathbf { z } _ { i } | \mathbf { x } _ { i } ) } [ \log p _ { \theta } ( \mathbf { x } _ { i } | \mathbf { y } _ { i } , \mathbf { z } _ { i } ) ] - D _ { K L } ( q _ { \phi } ( \mathbf { z } _ { i } | \mathbf { x } _ { i } ) | | p ( \mathbf { z } _ { i } ) ) \right\}
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
corresponds to learning a supervised VAE (Kingma et al., 2014), and represents a fairly na¨ıve approach to modeling a conditional distribution.
|
| 55 |
+
|
| 56 |
+
# 3 CONDITIONAL GENERATION BY DISENTANGLING
|
| 57 |
+
|
| 58 |
+
Maximizing this conditional ELBO in Eq (2) will likely yield good reconstructions of molecules from an embedding $\mathbf { z }$ (alongside the true property y), but for properties which only weakly inform the generative model there is nothing to enforce that the variable $\mathbf { y }$ actually directly has an effect on the generative process. Since the value $\mathbf { y }$ is something we know is a derived property of the molecule $\mathbf { x }$ , it is completely possible for all information about y to also be encoded in the representation $\mathbf { z }$ , in which case there is no guarantee that the learnt likelihood $p _ { \theta } ( \mathbf { x } | \mathbf { y } , \mathbf { z } )$ actually takes into account the value of $\mathbf { y }$ — in fact, we know it is possible to fit variational autoencoders where the decoder simply has the form $p _ { \boldsymbol { \theta } } ( \mathbf { x } | \mathbf { z } )$ — and we are relying on the utility of $\mathbf { y }$ in reconstructions to see any sort of disentangling effect.
|
| 59 |
+
|
| 60 |
+
# 3.1 CONSTRAINED ELBO
|
| 61 |
+
|
| 62 |
+
In the case of conditional generation of molecules, we often have access to some oracle function $f$ (possibly non-differentiable) which for any given $\mathbf { x }$ outputs a property estimate $\mathbf { y }$ , for instance, the chemoinformatics software RDKit (Landrum). Since for conditional generation our ultimate goal is to generate a molecule $\mathbf { x }$ for any given target property $\mathbf { y } _ { 0 }$ , which then actually has $f ( \mathbf { x } ) = \bar { \mathbf { y } } _ { 0 }$ , we can reframe the problem by introducing hard constraints on the generated values, i.e. if restricting to values of $\mathbf { y }$ in the training set,
|
| 63 |
+
|
| 64 |
+
$$
|
| 65 |
+
\begin{array} { r l } & { \underset { \theta , \phi } { \operatorname* { m a x } } \mathcal { L } _ { E L B O } ( \theta , \phi ) } \\ & { \mathrm { s u b j e c t ~ t o ~ } \mathbb { E } _ { \mathbf { x } \sim p ( \mathbf { x } \mid \mathbf { y } _ { i } ) } [ \mathbb { I } [ f ( \mathbf { x } ) = \mathbf { y } _ { i } ] ] = 1 } \end{array}
|
| 66 |
+
$$
|
| 67 |
+
|
| 68 |
+

|
| 69 |
+
Figure 2: Setting and modeling pipeline for conditional generation of molecules, with supervision provided via an external property prediction oracle. Red lines correspond to non-differentiable components, including both a potentially complex sampling process and the property prediction itself. The blue dashed line corresponds to the approximate property predictor, which aims to predict the expected value of the property from a continuous relaxation, marginalized over the sampling process.
|
| 70 |
+
|
| 71 |
+
for all $i = 1 , \ldots , N$ . This is an unreasonably hard constraint, unlikely to be satisfied by any distribution other than one which simply places a point mass on the single training $\mathbf { x } _ { i }$ associated with $\mathbf { y } _ { i }$ , but we can relax it by considering that (unlike the molecular space $\mathbf { x }$ ) the property space $\mathbf { y }$ is typically smooth, as many properties are continuous-valued and correspond to a human-interpretable scale. Following Ma et al. (2018) and Hu et al. (2017), we reframe the constraint as a soft penalty on the ELBO,
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\mathcal { L } ( \theta , \phi ) = \mathcal { L } _ { E L B O } ( \theta , \phi ) - \frac { \lambda _ { 1 } } { 2 } \sum _ { i = 1 } ^ { N } \mathbb { E } _ { \hat { \mathbf { x } } \sim p _ { \theta } ( \mathbf { x } | \mathbf { y } _ { i } ) } \Vert f ( \hat { \mathbf { x } } ) - \mathbf { y } _ { i } \Vert ^ { 2 }
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
so that they are consistent with the property prediction, i.e., as we have an oracle function $f$ which enable us to access the property of any generated data, we can explicitly add a soft constraint to our loss function to provide explicit guidance for the generative model such that $f ( \hat { \mathbf x } ) = \mathbf y$ . This constraint is expected to hold for any pair $\displaystyle ( \mathbf { x } , \mathbf { y } )$ we may happen to come across, not just those in the training data. We also show optimizing the relaxed constraint is equivalent to maximizing mutual information with the target $\mathbf { y } _ { i }$ and generated molecule $\hat { \bf x }$ ; for details see appendix Section 6.1.
|
| 78 |
+
|
| 79 |
+
# 3.2 APPROXIMATING THE PROPERTY PREDICTOR
|
| 80 |
+
|
| 81 |
+
Introducing the regularizer as in Eq. (3) implicitly guides the reconstruction to take into account the property information, such that the reconstructed data should exhibit properties which match the input properties it is conditioned on. However, existing implementations of $f$ are often non-differentiable or CPU-bound, and $\hat { \bf x }$ are discrete samples from a categorical distribution, all of which means the gradient of the regularizer can’t flow back to the generator. This is outlined in Figure 2. To enable the gradient based methods on GPUs during training and avoid discrete sampling, one approach would be to first fit a differentiable approximation to $f$ , and then use either a Gumbel-softmax relaxation (Jang et al., 2016) or tricks like a “straight-through” estimator (Bengio et al., 2013b) as a continuous approximation for the discrete samples. Instead, we propose bypassing the discrete sampling step entirely and learning a function $f _ { \omega }$ that can map from a learned representation of the molecules directly to molecules property (Hu et al., 2017).
|
| 82 |
+
|
| 83 |
+
To do this, we take as input the last hidden layer of the decoder network which parameterizes $p _ { \theta } ( \mathbf { x } | \mathbf { z } , \mathbf { y } )$ , denoting this deterministic transformation as $g _ { \boldsymbol { \theta } } ( \mathbf { z } , \mathbf { y } )$ . For the grammar VAE and the syntax-directed VAE, this last layer $\mathbf { h } = g _ { \boldsymbol { \theta } } ( \mathbf { z } , \mathbf { y } )$ is the output of a recurrent layer that generates logits corresponding to unmasked and unnormalized log probabilities for each character at each position in the string; see Kusner et al. (2017) and Dai et al. (2018) for details on the implementation of the somewhat complex sampling process in the decoder. Ideally, $f _ { \omega }$ would estimate the property distribution obtained by marginalizing out the discrete sampling step, with
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
f _ { \omega } ( \mathbf { h } \equiv g _ { \theta } ( \mathbf { z } , \mathbf { y } _ { 0 } ) ) \approx \mathbb { E } _ { p _ { \theta } ( \mathbf { x } | \mathbf { z } , \mathbf { y } _ { 0 } ) } [ f ( \mathbf { x } ) ] ,
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
where we condition on $\mathbf { z }$ , and $\mathbf { y } _ { 0 }$ refers to an arbitrary input target property.
|
| 90 |
+
|
| 91 |
+
Assuming the approximation in Eq. (4), we have
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\begin{array} { r } { \mathbb { E } _ { p _ { \theta } ( \hat { \mathbf { x } } | \mathbf { y } _ { i } ) } \| f ( \hat { \mathbf { x } } ) - \mathbf { y } _ { i } \| ^ { 2 } = \mathbb { E } _ { p ( \mathbf { z } ) } \left[ \mathbb { E } _ { p _ { \theta } ( \hat { \mathbf { x } } | \mathbf { y } _ { i } , \mathbf { z } ) } \| f ( \hat { \mathbf { x } } ) - \mathbf { y } _ { i } \| ^ { 2 } \right] \approx \mathbb { E } _ { p ( \mathbf { z } ) } \| f _ { \omega } ( g _ { \theta } ( \mathbf { z } , \mathbf { y } _ { i } ) ) - \mathbf { y } _ { i } \| ^ { 2 } , } \end{array}
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
an expectation over a real-valued variable which does not depend on any of the parameters we are estimating, meaning we can use a simple path estimate of the gradient with respect to $\theta , \omega$ by exchanging the gradient with the expectation. We thus define a regularization term
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\mathcal { L } _ { d i s e n t } ( \theta , \omega ) = \frac { \lambda _ { 1 } } { 2 } \sum _ { i = 1 } ^ { N } \mathbb { E } _ { p ( \mathbf { z } ) } \| f _ { \omega } \big ( g _ { \theta } ( \mathbf { z } , \mathbf { y } _ { i } ) \big ) - \mathbf { y } _ { i } \| ^ { 2 }
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
which can be used as a drop-in replacement for the non-differentiable penalty term in Eq. (3), yielding a candidate objective function
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\mathcal { L } ( \theta , \phi ) \approx \hat { \mathcal { L } } _ { \omega } ( \theta , \phi ) = \mathcal { L } _ { E L B O } ( \theta , \phi ) - \mathcal { L } _ { d i s e n t } ( \theta , \omega )
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
3.3 LEARNING THE PROPERTY ESTIMATOR JOINTLY WITH GENERATIVE MODEL
|
| 110 |
+
|
| 111 |
+
While one could imagine attempting to learn $f _ { \omega }$ jointly with $\phi , \theta$ by direct optimization of Eq. (6), in practice this is very unstable, as values of $g _ { \boldsymbol { \theta } } ( \mathbf { z } , \mathbf { y } _ { i } )$ early in training may correspond to very poor generated molecules $\hat { \mathbf { x } } _ { i }$ which may not have properties at all similar to $\mathbf { y } _ { i }$ . This can be sidestepped by training the property estimator jointly as part of an extended generative model on [x, y].
|
| 112 |
+
|
| 113 |
+
We note that the property estimator $f _ { \omega }$ parameterizes a probability distribution $p _ { \omega } ( f ( \mathbf { x } ) | \mathbf { z } , \mathbf { y } _ { 0 } )$ , where $\mathbf { x } \sim p _ { \theta } ( \mathbf { x } | \mathbf { z } , \mathbf { y } _ { 0 } )$ and f is the oracle function that $f ( \mathbf { x } ) = \mathbf { y }$ . With a Gaussian distribution over the error, we can consider
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
p _ { \omega } ( f ( \mathbf { x } ) \vert \mathbf { z } , \mathbf { y } _ { 0 } ) = \mathcal { N } ( f ( \mathbf { x } ) \vert f _ { \omega } ( g _ { \theta } ( \mathbf { z } , \mathbf { y } _ { 0 } ) ) , \lambda _ { 2 } ^ { - 1 } \mathbf { I } )
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
for small, fixed $\lambda _ { 2 }$ . Therefore, we propose defining a new ELBO based on a joint autoencoder for $\{ f ( \mathbf { x } _ { i } ) , \mathbf { y } _ { i } ) \}$ , albeit with a factorization such that the input $\mathbf { y } _ { i }$ bypasses the encoder and is passed directly into the decoder, with a joint likelihood
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
p _ { \{ \theta , \omega \} } ( \mathbf { x } _ { i } , f ( \mathbf { x } _ { i } ) | \mathbf { z } _ { i } , \mathbf { y } _ { i } ) = p _ { \omega } ( f ( \mathbf { x } _ { i } ) | \mathbf { z } _ { i } , \mathbf { y } _ { i } ) p _ { \theta } ( \mathbf { x } _ { i } | \mathbf { z } _ { i } , \mathbf { y } _ { i } ) .
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
This yields a joint ELBO for the training set of
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
\mathcal { L } _ { E L B O } ( \omega , \theta , \phi ) = \sum _ { i = 1 } ^ { N } \mathbb { E } _ { q _ { \phi } ( \mathbf { z } | \mathbf { x } _ { i } ) } \left[ \log \frac { p _ { \omega } ( f ( \mathbf { x } _ { i } ) | \mathbf { z } , \mathbf { y } _ { i } ) p _ { \theta } ( \mathbf { x } _ { i } | \mathbf { z } , \mathbf { y } _ { i } ) p ( \mathbf { z } ) } { q _ { \phi } ( \mathbf { z } | \mathbf { x } _ { i } ) } \right] .
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
Note that we can rewrite this ELBO as a function of the previous one, with
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\mathcal { L } _ { E L B O } ( \boldsymbol { \omega } , \boldsymbol { \theta } , \boldsymbol { \phi } ) = \mathcal { L } _ { E L B O } ( \boldsymbol { \theta } , \boldsymbol { \phi } ) - \frac { \lambda _ { 2 } } { 2 } \sum _ { i = 1 } ^ { N } \mathbb { E } _ { \boldsymbol { q } _ { \boldsymbol { \phi } } ( \mathbf { z } | \mathbf { x } _ { i } ) } \| f _ { \boldsymbol { \omega } } \big ( g _ { \boldsymbol { \theta } } ( \mathbf { z } , \mathbf { y } _ { i } ) \big ) - \mathbf { y } _ { i } \| _ { 2 } ^ { 2 } ,
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
where we also see that $\mathcal { L } _ { E L B O } ( \omega , \theta , \phi ) \leq \mathcal { L } _ { E L B O } ( \theta , \phi )$ , allowing us to define an objective
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\hat { \mathcal { L } } ( \omega , \theta , \phi ) = \mathcal { L } _ { E L B O } ( \omega , \theta , \phi ) - \mathcal { L } _ { d i s e n t } ( \theta , \omega ) ,
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
which is a lower bound on Eq. (6). Notice the two terms we have added to the original ELBO are quite similar, differing only in choice of distribution: for learning $f _ { \omega }$ , we wish to use values of $\mathbf { z }$ simulated form the approximate posterior $q _ { \phi } ( { \bf z } | { \bf x } )$ , whereas for enforcing a constraint across all possible generations we simulate $\mathbf { z }$ from the prior $p ( \mathbf { z } )$ .
|
| 144 |
+
|
| 145 |
+
# 3.4 GRADIENT ESTIMATION
|
| 146 |
+
|
| 147 |
+
As the regularizer $\mathcal { L } _ { d i s e n t } ( \theta , \omega )$ encourages disentangling by constraining the molecules generated from $\mathbf { y } _ { i }$ to have property $\mathbf { y } _ { i }$ no matter what value $\mathbf { z }$ takes, we found that it does not necessarily evaluate at meaningful values of $\mathbf { z }$ when sampled randomly from $p ( \mathbf { z } )$ . This roughly corresponds to the notion that not all combinations of “style” and property are physically attainable; ideally for style transfer we would like the generated molecule to stay “close” in structure to the original molecule that we intended to modify. When estimating (gradients of) the soft constraint term $\mathcal { L } _ { d i s e n t } ( \theta , \omega )$ , we found it advantageous to use samples of $\mathbf { z }$ which correspond to encodings of actual data points, as opposed to random samples from the prior. We approximate expectations with respect to $p ( \mathbf { x } )$ by looking at the so-called marginal posterior; we note that
|
| 148 |
+
|
| 149 |
+
Table 1: Reconstruction performance and generation quality (Valid, Unique, Novel).
|
| 150 |
+
|
| 151 |
+
<table><tr><td rowspan="2">Model</td><td colspan="3">QM9</td><td colspan="5">ZINC</td></tr><tr><td>Reconstruction %</td><td>Valid%</td><td>Unique %</td><td>Novel %</td><td>Reconstruction %</td><td>Valid%</td><td>Unique %</td><td>Novel %</td></tr><tr><td>CVAE Gómez-Bombarelli et al. (2016)</td><td>3.61</td><td>10.30</td><td>=</td><td>90.0</td><td>44.6</td><td>0.70</td><td>·</td><td>100</td></tr><tr><td>GVAE Kusner et al. (2017)</td><td>96.00</td><td>60.20</td><td>=</td><td>80.90</td><td>53.70</td><td>7.20</td><td>=</td><td>100</td></tr><tr><td>SD-VAE Dai et al.(2018)</td><td>97.84</td><td>98.40</td><td>99.28</td><td>91.97</td><td>76.20</td><td>43.50</td><td>-</td><td>-</td></tr><tr><td>Sup-VAE-1-GRU</td><td>97.53</td><td>93.66</td><td>91.30</td><td>92.05</td><td>74.12</td><td>32.84</td><td>94.61</td><td>100</td></tr><tr><td>CGD-VAE-1-GRU</td><td>99.27</td><td>95.61</td><td>93.65</td><td>87.87</td><td>88.64</td><td>29.00</td><td>99.24</td><td>100</td></tr><tr><td>Sup-VAE-3-GRU</td><td>97.81</td><td>97.90</td><td>95.09</td><td>89.47</td><td>82.40</td><td>36.16</td><td>86.26</td><td>100</td></tr><tr><td>CGD-VAE-3-GRU</td><td>99.31</td><td>97,80</td><td>98.77</td><td>96.21</td><td>81.80</td><td>37.78</td><td>98.75</td><td>100</td></tr></table>
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
p ( \mathbf { z } ) = \int p _ { \theta } ( \mathbf { z } | \mathbf { x } ) p _ { \theta } ( \mathbf { x } ) d \mathbf { x } \approx \frac { 1 } { N } \sum _ { j } p _ { \theta } ( \mathbf { z } | \mathbf { x } _ { j } ) \approx \frac { 1 } { N } \sum _ { j } q _ { \phi } ( \mathbf { z } | \mathbf { x } _ { j } ) ,
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
where the first approximation uses the empirical data distribution as an approximation to the model marginal $p _ { \theta } ( \mathbf { x } )$ , and the second uses our variational posterior approximation $q _ { \phi } ( { \bf z } | { \bf x } )$ . We define this quantity as $\begin{array} { r } { q ( \mathbf { z } ) = \frac { 1 } { N } \sum _ { j } q _ { \phi } ( \mathbf { z } | \mathbf { x } _ { j } ) } \end{array}$ , a mixture of Gaussians, which we can sample from by drawing random values from our dataset and then drawing from their encoding distributions.
|
| 158 |
+
|
| 159 |
+
When we use this in estimating gradients of the soft constraint, we can use samples from the same minibatch, exactly corresponding to a property transfer task. That is, for any particular $y _ { i }$ in the dataset, we can estimate
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
\begin{array} { r } { \mathbb { E } _ { p ( \mathbf { z } ) } \nabla _ { \theta , \omega } \| f _ { \omega } \big ( g _ { \theta } ( \mathbf { z } , \mathbf { y } _ { i } ) \big ) - \mathbf { y } _ { i } \| ^ { 2 } \approx \mathbb { E } _ { q ( \mathbf { z } _ { j } | \mathbf { x } _ { j } ) } \nabla _ { \theta , \omega } \| f _ { \omega } \big ( g _ { \theta } ( \mathbf { z } , \mathbf { y } _ { i } ) \big ) - \mathbf { y } _ { i } \| ^ { 2 } . } \end{array}
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
for any uniformly randomly sampled $j \neq i$ . By sampling $\mathbf { z } _ { j }$ from $q ( \mathbf { z } _ { j } | \mathbf { x } _ { j } )$ where $j \neq i$ , we make sure that all the label information decoder is receiving comes from the actual $\mathbf { y } _ { i }$ that is feed to the decoder and $\mathbf { z } _ { j }$ does not include any information about label. This can be evaluated easily by simply evaluating the penalty term of Eq. (10) twice per minibatch; once as in Eq. (10), and once to approximate $\mathcal { L } _ { d i s e n t } ( \theta , \omega )$ by permuting the properties in the minibatch to be assigned to incorrect molecules. We detail the training algorithm in Section 6.2 of the appendix.
|
| 166 |
+
|
| 167 |
+
# 4 EXPERIMENTS
|
| 168 |
+
|
| 169 |
+
We experiment with the QM9 dataset (Ramakrishnan et al., 2014), that contains $1 3 4 \mathbf { k }$ molecules with up to 9 heavy atoms, and the ZINC dataset (Sterling & Irwin, 2015) containing $2 5 0 \mathrm { k }$ druglike molecules. Our goal here is two-fold: we would like to understand (1) whether a supervised variational autoencoder is capable of learning suitable conditional distributions over molecules, and (2) to what extent this task is assisted by the additional regularization term corresponding to the soft constraint.
|
| 170 |
+
|
| 171 |
+
We represent molecules using the one-hot encoding of their SMILES production rules (Kusner et al., 2017) and add a semantic constraint (Dai et al., 2018) on the decoder network to avoid generating syntactically correct but semantically invalid molecules. We use 80 production rules to describe molecules and set the maximum SMILES sequence length to 100 for the QM9 dataset and 278 for the Zinc dataset. We experiment with the logP property of the molecules (Wildman & Crippen, 1999). We use the same encoder and decoder network structure as Dai et al. (2018) with the only difference that our decoder takes as input the concatenation of $\mathbf { y } , \mathbf { z }$ . We give the details of the architecture in the appendix section 6.2.
|
| 172 |
+
|
| 173 |
+
We evaluate the reconstruction accuracy and the quality of the molecules generated by our method, which we denote by CGD-VAE (conditional generation with disentangling) and compare against CVAE (Gomez-Bombarelli et al., 2016), GVAE (Kusner et al., 2017), and SD-VAE (Dai et al., 2018). ´ We explore its conditional generation performance in two settings: controlling only the property value and controlling both the property value and the molecule structure to what can be seen as property transfer. We took the results of CVAE, GVAE from the literature. For SD-VAE we used the authors code with the default values to generate results for QM9 since these were not available for QM9. We also implemented supervised VAE versions of SD-VAE which we denote Sup-VAE-X-GRU $\mathrm { ( X \in \{ 1 , 3 \} }$ , denotes GRU layers) and which can do conditional generation.
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
Figure 3: Conditional generation given the desired $\mathrm { l o g P { = } { - } 0 . 5 7 5 9 }$ , row molecules have a logP within a $15 \%$ range of the desired one.
|
| 177 |
+
|
| 178 |
+

|
| 179 |
+
Figure 4: Property transfer
|
| 180 |
+
|
| 181 |
+
Before proceeding with the experiments we will give some additional details on how we do conditional generation from $p _ { \theta } ( \mathbf { x } | \mathbf { y } _ { 0 } )$ given the target property $\mathbf { y } _ { 0 }$ . Instead of marginalizing over the prior marginal inference distribution mass of the dataset is in the late $p ( z )$ , we mirror the approach taken during training and integrate over an approximation to the $\begin{array} { r } { q _ { \phi } ( \mathbf { z } ) = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } q _ { \phi } ( \mathbf { z } | \mathbf { x } _ { i } ) } \end{array}$ which better characterizes where the large and we do not wish to keep the $N$ entire dataset available at test time, we approximate $q _ { \phi } ( \mathbf { z } )$ with an isotropic Gaussian distribution $\hat { q } _ { \sigma } ( \mathbf { z } ) = \mathcal { N } ( \mathbf { z } | \mathbf { 0 } , \sigma ^ { 2 } \mathbf { I } )$ . We estimate $\sigma$ for each model by Monte Carlo samples from $q _ { \phi } ( \mathbf { z } )$ . For the supervised VAE without the soft constraint regularizer this yields 0.053 for QM9 and 0.118 for ZINC. For our model with the soft constraint we get 0.0354 for QM9 and 0.096 for ZINC. We do conditional generation of $\mathbf { x }$ given $\mathbf { y } _ { 0 }$ by sampling from $\begin{array} { r } { p _ { \theta } ( \mathbf { x } | \mathbf { y } _ { 0 } ) = \int \hat { q } _ { \sigma } ( \mathbf { z } ) p _ { \theta } ( \mathbf { x } | \mathbf { z } , \mathbf { y } _ { 0 } ) d \mathbf { z } } \end{array}$ .
|
| 182 |
+
|
| 183 |
+
We evaluate reconstruction performance in terms of the correctly reconstructed molecules on test sets of size 10k for QM9 and $5 \mathrm { k }$ for ZINC, for the latter we used the default test set. We evaluate the generated molecules’ quality by the percentage of valid, unique (i.e. percentage of unique molecules among the generated valid molecules) and novel (i.e. percentage of molecules never seen in the training set among the generated molecules) molecules. We estimate these quantities by sampling 10k (5K for ZINC) $\mathbf { z }$ from the ${ \hat { q } } _ { \sigma } ( \mathbf { z } )$ and coupling each one of them with a logP value, $\mathbf { y }$ , randomly selected from the test set, and we subsequently decode the $\mathbf { z } , \mathbf { y }$ concatenation. We can see that our model has a better reconstruction performance compared to the baselines while in some cases generating slightly less valid molecules table 1. In terms of the three quality measures achieves an excellent performance across all three metrics being always one of the two best performing methods for any metric.
|
| 184 |
+
|
| 185 |
+
To visualise how the conditional generation operates we randomly sample from the test set some molecule and obtain its property value $\mathbf { y } _ { 0 }$ . We then draw 50 random samples $\mathbf { z } _ { i }$ from $\hat { q } _ { \sigma } ( \mathbf { z } )$ and decode the $\left[ \mathbf { z } _ { i } , \mathbf { y } _ { 0 } \right]$ vectors. Among the generated valid molecules we compute the percentage of those that have a property value $\mathbf { y } _ { i }$ that is within a $15 \%$ range from the $\mathbf { y } _ { 0 }$ property value. In Figure 3 we present the molecules obtained for a test molecule that had a logP of $- 0 . 5 7 5 9$ . Out of the 50 generated molecules 46 were valid of which we give the five that were within a $15 \%$ range from the $\mathbf { y } _ { 0 }$ value in Figure 3. As we can see we get molecules that are structurally very different from the original one yet they have similar logP value.
|
| 186 |
+
|
| 187 |
+
To quantify the quality of the conditional generations we measure the correlation between the property value we obtain by the conditional generation and the property value on which we conditioned the generation. We randomly sample $1 0 0 0 { \textbf { y } }$ values from the test set and $1 0 0 0 \textbf { z }$ values from the approximate learned prior $\hat { q } _ { \sigma } ( \mathbf { z } )$ . We decode each pair, obtain $\hat { \mathbf { x } } \sim p _ { \theta } ( \mathbf { x } | \mathbf { y } , \mathbf { z } )$ , and then measure the correlation of the original y with the $\hat { \mathbf { y } }$ of generated $\hat { \bf x }$ . In Table 2, we give the correlation estimates for our method and the Sup-VAE baselines. As we can see our method has a considerably higher correlation score between the input and the obtained property than Sup-VAE. Conditional generation seems considerably harder for the ZINC dataset for all methods.
|
| 188 |
+
|
| 189 |
+
To visualise the style transfer behavior of our model we randomly sample two molecules $\mathbf { x } _ { A } , \mathbf { x } _ { B }$ from the test set. We then sample $\mathbf { z } _ { A }$ from the learned posterior $q _ { \phi } ( \mathbf { z } | \mathbf { x } _ { A } )$ . We subsequently decode $\left[ \mathbf { z } _ { A } , \mathbf { y } _ { B } \right]$ , $\mathbf { y } _ { B }$ is the property of $\mathbf { x } _ { B }$ , and get a new molecule $\hat { \mathbf { x } } _ { A B }$ . Ideally, the obtained molecule $\hat { \mathbf { x } } _ { A B }$ should have a property value (logP) close to the target $\mathbf { y } _ { B }$ and be similar to $\mathbf { x } _ { A }$ . In Figure 4 we give one such example. To put the results into context in Figure 8 in appendix, we give the results of a virtual screening method, where we select from the full dataset five molecules which are structurally similar to $\mathbf { x } _ { A }$ and have logP values close to $\mathbf { y } _ { B }$ . As we can see the molecule that our model generates is a new one.
|
| 190 |
+
|
| 191 |
+

|
| 192 |
+
Figure 5: Style transfer. The $\mathbf { z }$ of the nine real molecules placed in the $\mathbf { X }$ -axis is combined with 11 y property values, sampled in [-4.9, 4.9], the resulting pair is decoded to a molecule.
|
| 193 |
+
|
| 194 |
+
To quantify the style transfer performance we proceed in exactly the same manner as we did to quantify the conditional generation performance. However, now instead of sampling $\mathbf { z }$ from the approximate learned prior, ${ \hat { q } } _ { \sigma } ( \mathbf { z } )$ , we first sample some $\mathbf { x }$ from the test set and then we sample $\mathbf { z }$ from the learned posterior $q ( \mathbf { z } | \mathbf { x } )$ . The results are in the second column of Table 2. As we can see the correlation values are now lower than the ones we obtained in the simple conditional generation case. This can be explained by the fact that now we are forcing a specific combination of structure, z comes from a real molecule, and property, which might simply be physically infeasible since the molecule space is discrete and not all combinations are possible. In addition, as it was the case for the conditional generation, style transfer is considerably more difficult for the ZINC dataset.
|
| 195 |
+
|
| 196 |
+
We further explore the style transfer and visualize how our model covers the combined space of molecule structure and properties. We sample nine molecules from the QM9 test set, and get their $\mathbf { z }$ encodings. For each such encoding we decode the vectors $[ \mathbf { z } , y ] , y \in [ - 4 . 9 , 4 . 9 ]$ , with the $y$ (logP) interval sampled at 11 points. We give in Figure 5 the resulting valid molecules, each column there corresponds to one of the nine original molecules, the ones surrounded by dotted rectangle, and their decodings with different logP values.For each original molecule we give the generated molecules ordered along the y axis according to the y property that they actually exhibit. The x-axis does not provide an ordering of the original molecules according to $\mathbf { Z }$ , in fact we have ordered the original molecules by their y property. As we can see not all $( \mathbf { z } , y )$ combinations produce a result. These holes can be explained either by the physical infeasibility of the combination and/or a limitation of the learned model.
|
| 197 |
+
|
| 198 |
+
We can use conditional generation to control in a fine manner the value of the desired property, to what can be seen as direct property optimization. We visualise the level of control we have on an experiment with a single molecule (with logP is -1.137), which we randomly sample from the test set. We obtain its $\mathbf { z }$ encoding and perform generations with increased logP taking values in 1000 point grid in $\left[ - 1 . 1 3 7 , 4 . 9 \right]$ . We then decode $\left[ \mathbf { z } , \mathbf { y } _ { i } \right]$ and compute the logP value of the generated molecules. Among the 1000 generated molecules only 19 are unique. We get an increase of logP of a very discrete nature, Figure 6. As already discussed not all combinations of structure and properties are possible. The generated molecules themselves are shown in the supplemental material.
|
| 199 |
+
|
| 200 |
+
<table><tr><td>Model</td><td></td><td>z~qo(z)</td><td>z~q(z|x)</td></tr><tr><td rowspan="4">QM9</td><td>Sup-VAE-1-GRU</td><td>0.5420</td><td>0.2526</td></tr><tr><td>CGD-VAE-1-GRU</td><td>0.7185</td><td>0.5005</td></tr><tr><td>Sup-VAE-3-GRU</td><td>0.6958</td><td>0.4204</td></tr><tr><td>CGD-VAE-3-GRU</td><td>0.7414</td><td>0.4715</td></tr><tr><td rowspan="4">ZINC</td><td>Sup-VAE-1-GRU</td><td>0.2301</td><td>0.0481</td></tr><tr><td>CGD-VAE-1-GRU</td><td>0.3877</td><td>0.0880</td></tr><tr><td>Sup-VAE-3-GRU</td><td>0.3514</td><td>0.1808</td></tr><tr><td>CGD-VAE-3-GRU</td><td>0.3966</td><td>0.1559</td></tr></table>
|
| 201 |
+
|
| 202 |
+
Table 2: Correlation between the desired input property and the obtained property . $\mathbf { z } \sim \hat { q } _ { \sigma } ( \mathbf { z } )$ corresponding to conditional generation), and x, $\mathbf { z } \sim q ( \mathbf { z } | \mathbf { x } )$ to property transfer case.
|
| 203 |
+
|
| 204 |
+

|
| 205 |
+
Figure 6: Property optimization. Given a start molecule (red), we combine its $\mathbf { z }$ with $1 0 0 0 \log \mathrm { P }$ values and decode (blue)
|
| 206 |
+
|
| 207 |
+

|
| 208 |
+
|
| 209 |
+

|
| 210 |
+
Figure 7: A comparison of simulated logP values and Tanimoto similarity to a target on the ZINC dataset. While the stacked LSTM model has high accuracy in terms of matching the desired property, it would require drawing many samples before finding any close matches to any particular desired prototype. The CGD-VAE-3-GRU model represents a middle ground between a standard VAE model which does not condition on the property, and the stacked LSTM model which does not learn a reusable representation.
|
| 211 |
+
|
| 212 |
+
# 4.1 CONDITIONAL LSTM BASELINE
|
| 213 |
+
|
| 214 |
+
Finally, we consider a variant of the stacked LSTM model of Segler et al. (2017), with no latent space, where the model is modified to take a target logP value as an additional input at each generation step. This model forms a very strong baseline for many distribution matching tasks (Liu et al., 2018; ?), though as best we are aware this has never been used directly for conditional generation given a target property. We use a modification of the implementation provided by (?) with three layers and default settings, and fit the model by maximum likelihood training on $\begin{array} { r } { p _ { \theta } ( \mathbf { x } | \mathbf { y } ) = \prod _ { t = 1 } ^ { T } p _ { \theta } ( x _ { t } | x _ { 1 : t - 1 } , \mathbf { y } ) } \end{array}$ .
|
| 215 |
+
|
| 216 |
+
Training on the ZINC dataset, we find the generated molecules from this model have a very high correlation 0.975 with the target logP value, greatly outperforming any of the latent variable models we consider. This suggests that such a model would be very useful for generating candidates globally, but as the model has no latent variable it is not amenable to style transfer. We observe this in Figure 7, which samples 100 candidate molecules from both the stacked LSTM model and for CGD-VAE-3- GRU, conditioning on the property of one randomly-chosen test set example, while computing the Tanimoto similarity (computed using Morgan fingerprints of radius 2) to a second randomly-chosen test set example, across 200 pairs. The VAE has higher Tanimoto similarities as it can condition on the latent variable of the target molecule, representing a trade-off against the better adherence to the target property value of the unconditioned LSTM.
|
| 217 |
+
|
| 218 |
+
# 5 CONCLUSION
|
| 219 |
+
|
| 220 |
+
We presented a single step approach for the conditional generation of molecules with desired properties. Our model allows also to condition generation on a prototype molecule with a desired high-level structure. This work thus directly inverts the traditional relationship between molecules and their properties. We found that training the deep generative models conditional on target properties, following a supervised VAE approach, does not appreciably harm the quality of the unconditional generative model as measured by validity, novelty, and uniqueness of samples. Furthermore, we see that the additional act of regularizing the output using an approximate property predictor helps improve both reconstruction accuracy and property correlations in most combinations of tasks and datasets, particularly for the smaller QM9 dataset and for smaller models with fewer RNN layers. We also note that although none of the deep latent variable models are competitive with an LSTM baseline when purely considering generation conditioned on a target property value, the low Tanimoto similarity between randomly sampled candidates and an arbitrary style transfer target makes clear that such a model is not suitable for targeted generation of candidates which are close in structure to a particular prototype.
|
| 221 |
+
|
| 222 |
+
In future work, we want to explore how to further improve the correlation between the desired input properties to the decoder, and the properties of the generated molecules. Moreover, we want also to condition on multiple properties; while this is in principle possible in our framework, we do not explore it empirically here. Modifying a single property while constraining the remaining to be close to the original can further aggravate the infeasibility problem, as not all combinations of molecular properties may even be feasible, perhaps requiring learning a dependency structure between multiple properties.
|
| 223 |
+
|
| 224 |
+
# REFERENCES
|
| 225 |
+
|
| 226 |
+
Rim Assouel, Mohamed Ahmed, Marwin H. Segler, Amir Saffari, and Yoshua Bengio. Defactor: Differentiable edge factorization-based probabilistic graph generation. CoRR, abs/1811.09766, 2018. URL http://arxiv.org/abs/1811.09766.
|
| 227 |
+
|
| 228 |
+
Yoshua Bengio, Aaron Courville, and Pascal Vincent. Representation learning: A review and new perspectives. IEEE transactions on pattern analysis and machine intelligence, 35(8):1798–1828, 2013a.
|
| 229 |
+
|
| 230 |
+
Yoshua Bengio, Nicholas Leonard, and Aaron Courville. Estimating or propagating gradients through ´ stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013b.
|
| 231 |
+
|
| 232 |
+
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, pp. 2172–2180, 2016.
|
| 233 |
+
|
| 234 |
+
Junyoung Chung, Caglar Gulcehre, KyungHyun Cho, and Yoshua Bengio. Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555, 2014.
|
| 235 |
+
|
| 236 |
+
Hanjun Dai, Yingtao Tian, Bo Dai, Steven Skiena, and Le Song. Syntax-directed variational autoencoder for structured data. arXiv preprint arXiv:1802.08786, 2018.
|
| 237 |
+
|
| 238 |
+
Nicola De Cao and Thomas Kipf. MolGAN: An implicit generative model for small molecular graphs. May 2018.
|
| 239 |
+
|
| 240 |
+
Hanna Eckert and Jurgen Bajorath. Molecular similarity analysis in virtual screening: foundations, ¨ limitations and novel approaches. Drug discovery today, 12(5-6):225–233, 2007.
|
| 241 |
+
|
| 242 |
+
Rafael Gomez-Bombarelli, David K. Duvenaud, Jos ´ e Miguel Hern ´ andez-Lobato, Jorge Aguilera- ´ Iparraguirre, Timothy D. Hirzel, Ryan P. Adams, and Alan Aspuru-Guzik. Automatic chemical ´ design using a data-driven continuous representation of molecules. CoRR, abs/1610.02415, 2016. URL http://arxiv.org/abs/1610.02415.
|
| 243 |
+
|
| 244 |
+
Gabriel Lima Guimaraes, Benjamin Sanchez-Lengeling, Carlos Outeiral, Pedro Luis Cunha Farias, and Alan Aspuru-Guzik. Objective-Reinforced generative adversarial networks (ORGAN) for ´ sequence generation models. May 2017.
|
| 245 |
+
|
| 246 |
+
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 International Conference on Learning Representations, 2017.
|
| 247 |
+
|
| 248 |
+
Zhiting Hu, Zichao Yang, Xiaodan Liang, Ruslan Salakhutdinov, and Eric P Xing. Toward controlled generation of text. In Proceedings of the 34th International Conference on Machine LearningVolume 70, pp. 1587–1596. JMLR. org, 2017.
|
| 249 |
+
|
| 250 |
+
Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparameterization with gumbel-softmax. arXiv preprint arXiv:1611.01144, 2016.
|
| 251 |
+
|
| 252 |
+
Wengong Jin, Regina Barzilay, and Tommi Jaakkola. Junction tree variational autoencoder for molecular graph generation. arXiv preprint arXiv:1802.04364, 2018.
|
| 253 |
+
|
| 254 |
+
Diederik P Kingma, Shakir Mohamed, Danilo Jimenez Rezende, and Max Welling. Semi-supervised learning with deep generative models. In Advances in Neural Information Processing Systems, pp. 3581–3589, 2014.
|
| 255 |
+
|
| 256 |
+
Peter Kirkpatrick and Clare Ellis. Chemical space. Nature, 432(7019):823, 2004.
|
| 257 |
+
|
| 258 |
+
Matt J Kusner, Brooks Paige, and Jose Miguel Hern ´ andez-Lobato. Grammar variational autoencoder. ´ arXiv preprint arXiv:1703.01925, 2017.
|
| 259 |
+
|
| 260 |
+
Greg Landrum. Rdkit: Open-source cheminformatics. URL http://www.rdkit.org.
|
| 261 |
+
|
| 262 |
+
Qi Liu, Miltiadis Allamanis, Marc Brockschmidt, and Alexander Gaunt. Constrained graph variational autoencoders for molecule design. In Advances in Neural Information Processing Systems 31, pp. 7806–7815. 2018.
|
| 263 |
+
|
| 264 |
+
Tengfei Ma, Jie Chen, and Cao Xiao. Constrained generation of semantically valid graphs via regularizing variational autoencoders. In Advances in Neural Information Processing Systems 31, pp. 7113–7124. 2018.
|
| 265 |
+
|
| 266 |
+
Raghunathan Ramakrishnan, Pavlo O Dral, Matthias Rupp, and O Anatole Von Lilienfeld. Quantum chemistry structures and properties of 134 kilo molecules. Scientific data, 1:140022, 2014.
|
| 267 |
+
|
| 268 |
+
Marwin HS Segler, Thierry Kogej, Christian Tyrchan, and Mark P Waller. Generating focused molecule libraries for drug discovery with recurrent neural networks. ACS central science, 4(1): 120–131, 2017.
|
| 269 |
+
|
| 270 |
+
N. Siddharth, Brooks Paige, Jan-Willem Van de Meent, Alban Desmaison, Noah Goodman, Pushmeet Kohli, Frank Wood, and Philip Torr. Learning disentangled representations with semi-supervised deep generative models. In Advances in Neural Information Processing Systems, pp. 5925–5935, 2017.
|
| 271 |
+
|
| 272 |
+
Martin Simonovsky and Nikos Komodakis. Graphvae: Towards generation of small graphs using variational autoencoders. arXiv preprint arXiv:1802.03480, 2018.
|
| 273 |
+
|
| 274 |
+
Teague Sterling and John J Irwin. Zinc 15–ligand discovery for everyone. Journal of chemical information and modeling, 55(11):2324–2337, 2015.
|
| 275 |
+
|
| 276 |
+
Scott A Wildman and Gordon M Crippen. Prediction of physicochemical parameters by atomic contributions. Journal of chemical information and computer sciences, 39(5):868–873, 1999.
|
| 277 |
+
|
| 278 |
+
Jiaxuan You, Bowen Liu, Rex Ying, Vijay Pande, and Jure Leskovec. Graph convolutional policy network for goal-directed molecular graph generation. In Advances in Neural Information Processing Systems 31, pp. 6412–6422. 2018.
|
| 279 |
+
|
| 280 |
+
# 6 APPENDIX
|
| 281 |
+
|
| 282 |
+
# 6.1 THE REGULARISER AND ITS RELATION TO THE MUTUAL INFORMATION MAXIMIZATION
|
| 283 |
+
|
| 284 |
+
The soft constrain in the loss 3, in fact , is equivalent to a simple maximizing mutual information formulation between generated molecules $\hat { \bf x }$ and the target property $\mathbf { y }$ provided to the generator. Assume the true conditional distribution is $\tilde { p } ( \mathbf { y } | \mathbf { x } )$ :
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
\begin{array} { r l } & { \mathbf { I } ( \mathbf { y } ; \hat { \mathbf { x } } ) = H ( \mathbf { y } ) - H ( \mathbf { y } \vert \hat { \mathbf { x } } ) } \\ & { \qquad = H ( \mathbf { y } ) + \mathbb { E } _ { \hat { \mathbf { x } } \sim p _ { \theta } ( \mathbf { x } \vert \mathbf { y } ) } \mathbb { E } _ { \mathbf { y } ^ { \prime } \sim \tilde { p } ( \mathbf { y } \vert \hat { \mathbf { x } } ) } [ \log \tilde { p } ( \mathbf { y } ^ { \prime } \vert \hat { \mathbf { x } } ) ] } \end{array}
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
We do not know the true distribution $\tilde { p } ( \mathbf { y } | \hat { \mathbf { x } } )$ , however, the RDKit provides an estimation $p ( \mathbf { y } \vert \hat { \mathbf { x } } )$ of the distribution assuming a Gaussian distribution over error:
|
| 291 |
+
|
| 292 |
+
$$
|
| 293 |
+
p ( \mathbf { y } \vert \hat { \mathbf { x } } ) = \mathcal { N } ( \mathbf { y } \vert f ( \hat { \mathbf { x } } ) , \lambda _ { 1 } ^ { - 1 } \mathbf { I } )
|
| 294 |
+
$$
|
| 295 |
+
|
| 296 |
+
where $f$ is the molecule property estimator, i.e., RDKit. We have:
|
| 297 |
+
|
| 298 |
+
$$
|
| 299 |
+
\begin{array} { l } { { \displaystyle { \bf I } ( { \bf y } ; \hat { \bf x } ) = H ( { \bf y } ) + \mathbb { E } _ { \hat { \bf x } \sim p _ { \theta } ( { \bf x } \mid { \bf y } ) } \mathbb { E } _ { { \bf y } ^ { \prime } \sim \tilde { p } ( { \bf y } \mid \hat { \bf x } ) } [ \log \frac { \tilde { p } ( { \bf y } ^ { \prime } \mid \hat { \bf x } ) } { p ( { \bf y } ^ { \prime } \mid \hat { \bf x } ) } p ( { \bf y } ^ { \prime } \mid \hat { \bf x } ) ] } \ ~ } \\ { { \displaystyle ~ = H ( { \bf y } ) + \mathbb { E } _ { \hat { \bf x } \sim p _ { \theta } ( { \bf x } \mid { \bf y } ) } [ D _ { k l } ( \tilde { p } ( { \bf y } ^ { \prime } \mid \hat { \bf x } ) \vert \vert p ( { \bf y } ^ { \prime } \vert \hat { \bf x } ) ) + \mathbb { E } _ { { \bf y } ^ { \prime } \sim \tilde { p } ( { \bf y } \mid \hat { \bf x } ) } \log p ( { \bf y } ^ { \prime } \mid \hat { \bf x } ) ] } \ ~ } \\ { { \displaystyle ~ \geq H ( { \bf y } ) + \mathbb { E } _ { \hat { \bf x } \sim p _ { \theta } ( { \bf x } \mid { \bf y } ) } [ \mathbb { E } _ { { \bf y } ^ { \prime } \sim \tilde { p } ( { \bf y } \mid \hat { \bf x } ) } \log p ( { \bf y } ^ { \prime } \mid \hat { \bf x } ) ] } } \end{array}
|
| 300 |
+
$$
|
| 301 |
+
|
| 302 |
+
By following the Lemma 5.1 given in Chen et al. (2016), we have
|
| 303 |
+
|
| 304 |
+
$$
|
| 305 |
+
\mathbf { I } ( \mathbf { y } ; \hat { \mathbf { x } } ) \geq H ( \mathbf { y } ) + \mathbb { E } _ { \mathbf { y } \sim p ( \mathbf { y } ) , \hat { \mathbf { x } } \sim p _ { \theta } ( \mathbf { x } | \mathbf { y } ) } [ \log p ( \mathbf { y } | \hat { \mathbf { x } } ) ]
|
| 306 |
+
$$
|
| 307 |
+
|
| 308 |
+
As $H ( \mathbf { y } )$ is constant, minimizing $\mathbb { E } _ { \hat { \mathbf { x } } \sim p _ { \theta } ( \mathbf { x } | \mathbf { y } _ { i } ) } \| f ( \hat { \mathbf { x } } ) - \mathbf { y } _ { i } \| ^ { 2 }$ is equivalent to maximizing $\mathbf { I } ( \mathbf { y } ; \hat { \mathbf { x } } )$ under the assumption that $p ( \mathbf { y } \vert \hat { \mathbf { x } } )$ is close to $\tilde { p } ( \mathbf { y } | \hat { \mathbf { x } } )$
|
| 309 |
+
|
| 310 |
+
# 6.2 ARCHITECTURE AND TRAINING PROCEDURE DESCRIPTION
|
| 311 |
+
|
| 312 |
+
We use the same encoder and decoder network structure as Dai et al. (2018) with the only difference that our decoder takes as input the concatenation of $\mathbf { y } , \mathbf { z }$ . As GRU layers become computationally expensive when the sequences length increase, we also examined the model using less layer GRU. To be precise, the decoder in Dai et al. (2018) takes the from of a dense hidden layer with ReLU activation followed by three layers GRU Chung et al. (2014). We tried two different settings of decoder: in the first setting, we feed the concatenation of $\mathbf { y } , \mathbf { z }$ to dense layer then apply one layer GRU, in the second setting, to enhance the effect of $\mathbf { y }$ in the decoder, we feed y not only to the dense layer but also to each layer of GRU. Furthermore, we set the dimension of the latent representation to 56. For the oracle function estimator $f _ { w }$ , we use the same network architecture as the encoder (there is no parameter sharing) and we add one more fully connected layer followed by a Tanh transformation.
|
| 313 |
+
|
| 314 |
+
To speed up convergence, we initialize the $f _ { w }$ from a pre-training, where we train $f _ { w }$ on the welltrained (maximum 500 epochs with early stopping) supervised VAE’s decoder output to predict the molecules property value. We also initialize the parameters of the encoder/decoder networks with the partially trained supervised VAE model (after 40 epochs for QM9, 100 epochs for ZINC). We do not update $\omega$ and $\phi , \theta$ simultaneously, instead we do an alternate optimization. We update $\omega$ continuously for five epochs while holding $\phi , \theta$ and do the same for updating $\phi , \theta$ . We set the hyper-parameter value $\lambda _ { 1 }$ to 50 and $\lambda _ { 2 }$ to 1. The mini-batch size is set to 300 for QM9 and 100 for ZINC. We use ADAM optimizer with learning rate 0.0001 and pytorch lr-schedular on the validation loss. The general training algorithm is described in below algorithm block1. In our experiment, to train $f _ { \omega }$ , we skipped the second term in step 7, which means we only train $f _ { \omega }$ on the training data but not the newly generated molecules obtained by permuting the property. The reason for this is that, during the training, we found that it is easy for the model to learn to reconstruct but hard to conditionally generate the molecules with given properties while we have no guidance of what the molecules should look like. Further more, some combination of $\mathbf { z }$ and $\mathbf { y }$ are physically not feasible. In this case, when the conditional generation is not good enough yet during the training, we end up fitting $f _ { \omega }$ on the miss represented molecules representations and it makes the optimization harder.
|
| 315 |
+
|
| 316 |
+
# Algorithm 1 Training algorithm
|
| 317 |
+
|
| 318 |
+
1: Initialize $p _ { \theta } ( \mathbf { x } | \mathbf { z } , \mathbf { y } )$ , $q _ { \phi } ( { \bf z } | { \bf x } )$ , $f _ { w }$
|
| 319 |
+
2: for i=1,2, . . . , N (maximum epoch number) do
|
| 320 |
+
3: for ${ \bf j } = 1 , 2 , \ldots , { \bf L }$ , sample a minibatch $D = ( { \bf X } , { \bf Y } ) = \{ { \bf x } _ { i } , { \bf y } _ { i } ) \} _ { i = 1 } ^ { M }$ of M samples do
|
| 321 |
+
4: randomly permute the property set $\mathbf { Y }$ to obtain $\mathbf { Y } ^ { \ast }$ and define a label permuted mini
|
| 322 |
+
batch $D ^ { * } = ( \mathbf { X } , \mathbf { \bar { Y } } ^ { * } ) = \{ \mathbf { x } _ { i } , \mathbf { y } _ { i } ^ { * } \} _ { i = 1 } ^ { \bar { M } }$
|
| 323 |
+
5: $\begin{array} { l } { { \displaystyle \theta ^ { j } = \theta ^ { j - 1 } - \gamma \big ( - \nabla _ { \theta } \mathcal { L } _ { E L B O } \big ( \theta , \phi , \omega \big ) + \frac { \lambda _ { 1 } } { 2 } \sum _ { \substack { ( \mathbf { x } _ { i } , \mathbf { y } _ { i } ) \in D ^ { * } } } \mathbb { E } _ { q ( \mathbf { z } | \mathbf { x } _ { i } ) } \nabla _ { \theta } \| f _ { \omega } \big ( g _ { \theta } \big ( \mathbf { z } , \mathbf { y } _ { i } \big ) \big ) - \mathbf { y } _ { i } \| ^ { 2 } \big ) } } \\ { { \displaystyle \phi ^ { j } = \phi ^ { j - 1 } - \gamma \big ( - \nabla _ { \phi } \mathcal { L } _ { E L B O } \big ( \theta , \phi , \omega \big ) \big ) } } \\ { { \displaystyle w ^ { j } = w ^ { j - 1 } - \gamma \big ( \frac { \lambda _ { 2 } } { 2 } \sum _ { \substack { ( \mathbf { x } _ { i } , \mathbf { y } _ { i } ) \in D } } \mathbb { E } _ { q ( \mathbf { z } | \mathbf { x } _ { i } ) } \nabla _ { \omega } \| f _ { \omega } \big ( g _ { \theta } ( \mathbf { z } , \mathbf { y } _ { i } ) \big ) - \mathbf { y } _ { i } \| ^ { 2 } + \frac { \lambda _ { 1 } } { 2 } \sum _ { \substack { ( \mathbf { x } _ { i } , \mathbf { y } _ { i } ) \in D ^ { * } } } \mathbb { E } _ { q ( \mathbf { z } | \mathbf { x } _ { i } ) } \nabla _ { \omega } \| f _ { \omega } \big ( g _ { \theta } ( \mathbf { z } , \mathbf { y } _ { i } ) \big ) - \mathbf { y } _ { i } \| ^ { 2 } \big ) } } \end{array}$
|
| 324 |
+
6:
|
| 325 |
+
7:
|
| 326 |
+
|
| 327 |
+
# 6.3 USE A FIXED PRE-TRAINED PROPERTY PREDICTION FUNCTION
|
| 328 |
+
|
| 329 |
+
We also investigate the case where we train the property prediction function $f _ { \omega }$ on the well trained supervised VAE output and keep it fixed during the training of the main model. We give the performance in tables 3, 4. Using a fixed $f _ { \omega }$ , in terms of reconstruction and generation performance, delivers mixed results 3. However, in terms of conditional generation 4, it does perform better than the baselines but worse compared to the case where we also update $f _ { \omega }$ during the learning.
|
| 330 |
+
|
| 331 |
+
Table 3: Sup-VAE-1-GRU /Sup-VAE-3-GRU: supervised version of SD-VAE model where y is been feed to only the first layer/all layer decoder. CGD-VAE: our model, conditional generation with disentangling. The result for CVAE and GVAE are taken from the literature, ”-” refers that those measures are not reported. The rest of baseline result is obtained by rerunning (SD-VAE) and editing the original code (Sup-VAE).
|
| 332 |
+
|
| 333 |
+
<table><tr><td></td><td colspan="3">QM9</td><td colspan="5">ZINC</td></tr><tr><td>Model</td><td>Reconstruction %</td><td>Valid%</td><td>Unique %</td><td>Novel %</td><td>Reconstruction %</td><td>Valid%</td><td>Unique %</td><td>Novel %</td></tr><tr><td>CVAE</td><td>3.61</td><td>10.30</td><td>1</td><td>90.00</td><td>44.60</td><td>0.70</td><td>-</td><td>100</td></tr><tr><td>GVAE</td><td>96.00</td><td>60.20</td><td>=</td><td>80.90</td><td>53.70</td><td>7.20</td><td></td><td>100</td></tr><tr><td>SD-VAE</td><td>97.84</td><td>98.40</td><td>99.28</td><td>91.97</td><td>76.20</td><td>43.50</td><td>-</td><td>、</td></tr><tr><td>Sup-VAE-1-GRU</td><td>97.53</td><td>93.66</td><td>91.30</td><td>92.05</td><td>74.12</td><td>32.84</td><td>95.61</td><td>100</td></tr><tr><td>CGD-VAE-1-GRU</td><td>98.96</td><td>95.03</td><td>92.77</td><td>89.74</td><td>67.46</td><td>17.38</td><td>82.44</td><td>100</td></tr><tr><td>Sup-VAE-3-GRU</td><td>97.81</td><td>97.9</td><td>95.09</td><td>89.47</td><td>82.40</td><td>36.16</td><td>86.26</td><td>100</td></tr><tr><td>CGD-VAE-3-GRU</td><td>96.9</td><td>93.8</td><td>98.29</td><td>89.55</td><td>81.80</td><td>37.78</td><td>98.70</td><td>100</td></tr></table>
|
| 334 |
+
|
| 335 |
+
<table><tr><td></td><td>Model</td><td>z~qq(z)</td><td>z ~ q(z|x)</td></tr><tr><td rowspan="4">QM9</td><td>Sup-VAE-1-GRU</td><td>0.5420</td><td>0.2526</td></tr><tr><td>CGD-VAE-1-GRU</td><td>0.6331</td><td>0.3835</td></tr><tr><td>Sup-VAE-3-GRU</td><td>0.6958</td><td>0.4204</td></tr><tr><td>CGD-VAE-3-GRU</td><td>0.6665</td><td>0.4507</td></tr><tr><td rowspan="4">ZINC</td><td>Sup-VAE-1-GRU</td><td>0.2301</td><td>0.0481</td></tr><tr><td>CGD-VAE-1-GRU</td><td>0.2981</td><td>0.0866</td></tr><tr><td>Sup-VAE-3-GRU</td><td>0.3638</td><td>0.1818</td></tr><tr><td>CGD-VAE-3-GRU</td><td>0.3765</td><td>0.1310</td></tr></table>
|
| 336 |
+
|
| 337 |
+
Table 4: Correlation between the desired input property and the obtained property when z is sampled from the approximate learned prior, $\mathbf { z } \sim \hat { q } _ { \sigma } ( \mathbf { z } )$ , (conditional generation), and when $\mathbf { z }$ is sampled from the learned posterior given some x, $\mathbf { z } \sim q ( \mathbf { z } | \mathbf { x } )$ , (property transfer).
|
| 338 |
+
|
| 339 |
+
# 6.4 VIRTUAL SCREENING
|
| 340 |
+
|
| 341 |
+
The figure 8 displays the results of a virtual screening method, where we select from the full dataset five molecules which are structurally similar to $\mathbf { x } _ { A }$ in figure 4 in section 4 and have logP values close to $\mathbf { y } _ { B }$ . As we can see the molecule that our model generates is a new one.
|
| 342 |
+
|
| 343 |
+

|
| 344 |
+
Figure 8: Molecules selected with virtual screening over the full dataset in a manner that they are structurally similar to the A molecule of figure 4 while they have a logP value which is close to the logP value of the B molecule also of figure 4
|
| 345 |
+
|
| 346 |
+
# 6.5 METRICS AS FUNCTION OF $\mathbf { y } - \mathbf { y } ^ { \prime }$
|
| 347 |
+
|
| 348 |
+
The validity and novelty were mainly used to assess purely the generative model performance. However, it is also interesting to see if the model capable of generating valid and novel molecules if we start from an existing molecules and drift away from the original label, i.e., if we get $\mathbf { z }$ from $q ( \mathbf { z } | \mathbf { x } )$ , and then compare different values from $p ( \mathbf { \bar { x } } | \mathbf { z } , \mathbf { y } ^ { \prime } )$ as $\mathbf { y } ^ { \prime }$ moves far from y. We randomly sample a molecule $\mathbf { x }$ whose LogP is y from the test set, then sample $1 0 \textbf { z }$ from $q ( \mathbf { z } | \mathbf { x } )$ . For each such $\mathbf { z }$ we couple it with a $\mathbf { y } ^ { \prime }$ that is different that $\mathbf { y }$ , and sample 10 molecules from $p ( \mathbf { x } | \mathbf { z } , \mathbf { y } ^ { \prime } )$ . Eventually, for each such $\mathbf { y } ^ { \prime }$ , starting from original molecule $\mathbf { x }$ , we generated 100 molecules, and we report the validity, uniqueness and novelty as a function of $\mathbf { y } - \mathbf { y } ^ { \prime }$ . The figure 9 displays result of repeating above process for 20 randomly sampled $\displaystyle ( \mathbf { x } , \mathbf { y } )$ along 100 grid points for $\mathbf { y } - \mathbf { y } ^ { \prime }$ . The result confirms that on a big data set, conditional generative models uniqueness, validity and novelty performance is not affected by the size of the modification done on the property. However, on a small dataset, uniqueness is not affected. As expected, novelty increases as the properties modification size increases and validity drops slightly as the property modification size increase.
|
| 349 |
+
|
| 350 |
+

|
| 351 |
+
Figure 9: CGD-VAE-3-GRU model validity, novelty, uniqueness performance on property transfer task as a function of $\mathbf { y } - \mathbf { y } ^ { \prime }$ on QM9 dataset.
|
| 352 |
+
|
| 353 |
+

|
| 354 |
+
Figure 10: CGD-VAE-3-GRU model validity, novelty, uniqueness performance on property transfer task as a function of $\mathbf { y } - \mathbf { y } ^ { \prime }$ on ZINC dataset.
|
| 355 |
+
|
| 356 |
+
With our model, during the generation, we observe that sampling from the approximated marginal posterior improves generation performance when compered to sampling from the prior. Here we investigate if this findings holds for other baseline models or not. We explored the behavior of baselines when the $\mathbf { z }$ is sampled from the approximate marginal posterior, we observe that for CVAE and GVAE the validity did not change (as the ${ \hat { q } } ( \mathbf { z } )$ and $p ( \mathbf { z } )$ are essentially identical); for the SD-VAE the validity increases (Table 5).
|
| 357 |
+
|
| 358 |
+
SDVAE
|
| 359 |
+
Table 5: Baseline model performance on ZINC
|
| 360 |
+
|
| 361 |
+
<table><tr><td></td><td>Valid%</td><td>Unique %</td><td>Novel %</td></tr><tr><td>z ~qσ(z)</td><td>56.05</td><td>80.69</td><td>100</td></tr><tr><td>z ~p(z)</td><td>43.50</td><td>82.26</td><td>100</td></tr></table>
|
| 362 |
+
|
| 363 |
+
# 6.7 MOLECULE PROPERTY OPTIMIZATION
|
| 364 |
+
|
| 365 |
+
Figure 11 is the visualization of the generated molecules from property optimization task, given in figure 6 section 4. The molecules are generated by increasing the logP of a given molecule, i.e. we hold $\mathbf { z }$ fixed and increase the y value. Among the all generated molecules, 19 of them are unique.
|
| 366 |
+
|
| 367 |
+

|
| 368 |
+
Figure 11: Molecules generated with an increasing logP
|
md/train/ByxhOyHYwH/ByxhOyHYwH.md
ADDED
|
@@ -0,0 +1,246 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FAST TASK ADAPTATION FOR FEW-SHOT LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Few-shot classification is a challenging task due to the scarcity of training examples for each class. The key lies in generalization of prior knowledge learned from large-scale base classes and fast adaptation of the classifier to novel classes. In this paper, we introduce a two-stage framework. In the first stage, we attempt to learn task-agnostic feature on base data with a novel Metric-Softmax loss. The Metric-Softmax loss is trained against the whole label set and learns more discriminative feature than episodic training. Besides, the Metric-Softmax classifier can be applied to base and novel classes in a consistent manner, which is critical for the generalizability of the learned feature. In the second stage, we design a task-adaptive transformation which adapts the classifier to each few-shot setting very fast within a few tuning epochs. Compared with existing fine-tuning scheme, the scarce examples of novel classes are exploited more effectively. Experiments show that our approach outperforms current state-of-the-arts by a large margin on the commonly used mini-ImageNet and CUB-200-2011 benchmarks.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
In recent years, deep learning models have achieved great success in many visual tasks such as image classification (Krizhevsky et al., 2012), object detection (Girshick, 2015) and semantic segmentation (Long et al., 2015). In general, training a deep network needs massively labeled instances which leads to expensive manual annotation cost. In contrast, humans can learn novel concepts from only one or a few examples. Analogously, few-shot learning aims to recognize unseen instances by accessing just a small number of labeled images in each class. Unfortunately, naive methods such as re-training or fine-tuning the model on novel data would severely suffer from overfitting and provide poor result (Finn et al., 2017). The major difficulty lies in the exceedingly limited data, which can hardly represent the class distribution.
|
| 12 |
+
|
| 13 |
+
In the task of few-shot classification, we are given three datasets, namely training set, support set and query set. The training set (also known as base dataset) normally contains large-scale labeled data for learning of prior knowledge. The support set and query set contain a small number of examples which are drawn from unseen classes disjoint with the training set. We are expected to classify the query images, leveraging the prior knowledge from the base training set and the limited cue from the support images. If the support set contains $k$ annotated images for each of $m$ unique classes, then this task is called $m$ -way $k$ -shot classification.
|
| 14 |
+
|
| 15 |
+
Previous works on few-shot learning can be roughly divided into two categories, namely metalearning based and metric learning based. The former typically learns a meta-learner model on base data and generalizes it to novel unseen data. Usually, a recurrent neural network (Santoro et al., 2016) or long short-term memory network (Hochreiter & Schmidhuber, 1997) is utilized to learn a memory network to store knowledge. The latter attempts to learn a feature embedding where samples of the same class are closer to each other than samples of different classes. To make training on base data and inference on novel data consistent, a so-called episodic training strategy is widely employed (Vinyals et al., 2016; Snell et al., 2017; Sung et al., 2018). There are two limitations in metric learning based approaches. One is that episodic training only considers local sample similarity in current data batch. As shown in Snell et al. (2017), the limited number of classes pertraining episode is harmful for discriminative feature learning, while simply increasing it leads to better performance. However, in a sampled episode, a large number of classes is infeasible due to limited GPU memory. The other limitation is that most existing methods only utilize the labeled support images in novel classes as templates for feature similarity comparison. We argue that the support images could be better exploited to improve the performance.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Overview of the proposed FTA framework, which is composed of two stages.
|
| 19 |
+
|
| 20 |
+
In this work, we introduce a two-stage framework named Fast Task Adaption (FTA). As illustrated in Figure 1, the few-shot classification task is decomposed into two steps, i.e. task-agnostic feature learning on base data and adaptation of the classifier to each few-shot learning task. To learn more general and discriminative feature on base data, we propose a novel Metric-Softmax loss, which is an improvement of the Softmax loss. Specifically, we replace the score computing in softmax with a Gaussian kernel-based radial basis function. The Metric-Softmax loss is trained against the full base classes, overcoming the limitation of small number of classes in episodic training. Moreover, the Metric-Softmax classifier can be applied to base and novel classes in the same way. The consistency between training and inference is well preserved. After task-agnostic feature is learned, we design a novel task-adaptive transformation to adapt the classifier to current few-shot learning task. It is essentially an affine transformation applied to features of novel images. Notably, compared with fine-tuning re-initialized weights, it exhibits the desirable characteristics of fast convergence and superior performance. In this way, the aforementioned weaknesses of existing metric learning based methods are well addressed, leading to significant accuracy improvement. Experimental results on the mini-ImageNet and CUB-200-2011 datasets show that our approach consistently outperforms current state-of-the-art methods with respect to various backbone networks.
|
| 21 |
+
|
| 22 |
+
The main contributions of this paper can be summarized as follows.
|
| 23 |
+
|
| 24 |
+
• We propose the Metric-Softmax loss, which learns highly discriminative feature and ensures the consistency between training and inference as well. We design a novel task-adaptive transformation to adapt the classifier to novel classes efficiently and effectively.
|
| 25 |
+
• We improve few-shot classification significantly and achieve state-of-the-art performance on two common few-shot learning benchmarks.
|
| 26 |
+
|
| 27 |
+
# 2 RELATED WORK
|
| 28 |
+
|
| 29 |
+
In this section, we briefly review the previous approaches relevant to ours and current state-of-the-art methods we compare with in experiments.
|
| 30 |
+
|
| 31 |
+
Meta-learning based methods aim to learn task-agnostic knowledge from a sequence of similar tasks which have enough training data and apply it to new tasks for fast adaption. Ravi & Larochelle (2017) utilize an LSTM-based network to control the parameter optimization process, which results in better generalization than SGD when training on a few labeled samples. Qiao et al. (2018) propose to adapt a pre-trained network to novel classes by directly predicting the parameters from the activations. MAML (Finn et al., 2017) learns sensitive and general initial parameters, which can fast adapt to a novel task with only one or a few steps of gradient-descent update. MTL (Sun et al., 2019) learns to adapt a deep neural network for few-shot learning tasks by learning scaling and shifting functions of weights for each task. Cai et al. (2018) use a contextual learner to predict the parameters of an embedding network for unlabeled data by using memory slots. Mishra et al. (2018) propose a meta-learner architecture that combines temporal convolutions and soft attention.
|
| 32 |
+
|
| 33 |
+
Metric learning based methods aim to learn a feature embedding that preserves the class neighborhood structure. Specifically, samples of the same class are closer than samples of different classes in the learned embedding space. Matching networks (Vinyals et al., 2016) combine attention and memory together by learning a network that maps a small labeled support set and an unlabeled example to its label. They also first introduce the episodic training strategy, where the training process mimics the test scenario based on support-query metric learning. Prototypical network (Snell et al., 2017) uses the mean feature of each class as its corresponding prototype representation to learn a similarity metric space. Relation network (Sung et al., 2018) learns a deep non-linear distance metric by considering the relation between query images and support images. Satorras & Estrach (2018) propose a graph neural network to learn the feature similarity between query and support set. Our approach belongs to this category. Compared with existing methods, our major improvements are the Metric-Softmax loss for generic feature learning and the task-adaptive transformation for fast task adaptation.
|
| 34 |
+
|
| 35 |
+
Other methods. Zhang et al. (2018) propose a GAN-based approach to help few-shot classifiers to learn sharper decision boundary. Si et al. (2019) propose a progressive cluster purification method for transductive few-shot learning. Li et al. (2019) propose a deep nearest neighbor neural network for few-shot learning. Chen et al. (2019) give a consistent comparative analysis of several representative few-shot classification algorithms and show that the depth of backbone network matters. Besides, they attempt to fine-tune a Softmax classifier on the support set. On the contrary, we first apply an affine transformation to features of the support images, and compute the class centroids of the transformed features as the classfier’s weights. Concretely, we learn the affine transforming matrix rather than directly fine-tune the randomly initialized weights. Optimizing the transformation is computationally more stable even when one example per-class is available.
|
| 36 |
+
|
| 37 |
+
# 3 METHOD
|
| 38 |
+
|
| 39 |
+
As shown in Figure 1, the proposed FTA framework is composed of two stages, namely task-agnostic feature learning stage and fast task adaptation stage. In the first stage, we train the network on the base data with the proposed Metric-Softmax loss. After that, we fix the parameters of the network backbone and use it as a feature extractor. In the second stage, we learn a task-adaptive classifier, which is also a Metric-Softmax classifier with its weights replaced with affine transformed features of the support images. The affine transformation $g$ is named Task-Adaptive Transformation (TAT), which is learned on the scarce support set. With proper initialization, training of $g$ converges very fast within a few epochs. After training finishes, $g$ is applied to both support and query images.
|
| 40 |
+
|
| 41 |
+
In this section, we first elaborately describe the proposed Metric-Softmax loss. Since it is an improvement of the Softmax loss, we first give a brief review of the Softmax loss and reveal the issue of discrepancy between training and inference. Then we explain how to address this issue with the Metric-Softmax loss. Finally, we introduce the task-adaptive transformation for fast task adaptation.
|
| 42 |
+
|
| 43 |
+
# 3.1 SOFTMAX CLASSIFIER
|
| 44 |
+
|
| 45 |
+
Feature learning with the Softmax loss has achieved great success in many feature ranking tasks like person re-identification (Zhang et al., 2017) and face verification (Wen et al., 2016). Given an image $\boldsymbol { X }$ of base classes, a backbone network $f$ is applied to project $\boldsymbol { X }$ into feature space $\pmb { h } = f ( \pmb { X } ) , \pmb { h } \in \mathbb { R } ^ { d }$ . Then, the logits $_ { z }$ are computed by feeding $^ { h }$ into an affine transformation:
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\begin{array} { r } { \pmb { z } = \pmb { W } ^ { T } \pmb { h } + \pmb { b } , } \end{array}
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
where $W \in \mathbb { R } ^ { d \times c }$ and $\pmb { b } \in \mathbb { R } ^ { c }$ are the transforming weights. $c$ is the number of classes in base data. The Softmax classifier predicts the probability score that the image belongs to class $i$ by
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
s _ { i } = \mathrm { s o f t m a x } ( z ) _ { i } = \frac { \exp ( z _ { i } ) } { \sum _ { j } ^ { c } \exp ( z _ { j } ) }
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
The Softmax loss is an assembly of the Softmax classifier and cross-entropy loss. Suppose the one-hot category label of the image is ${ \pmb y } \in \{ 0 , 1 \} ^ { c }$ , the training cross-entropy loss is defined as
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\mathcal { L } = - \sum _ { j } ^ { c } y _ { j } \log ( s _ { j } )
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
During inference, if a test image belongs to one of the training classes, its label can be predicted by
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\hat { y } = \arg \operatorname* { m a x } _ { i } s _ { i }
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
In this case, the scores in both training and inference are computed by an affine transformation and softmax function applied to the feature vector $^ { h }$ . However, in the context of few-shot learning, the query image for testing belongs to a novel class unseen in training. A common way to classify the novel query image is to compare its similarities to the few labeled support images, which share the same label space with the query image. Concretely, for $m$ -way $k$ -shot classification, we can extract features of the support images, and compute the mean feature for each class by
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\bar { \boldsymbol { h } } _ { i } = \frac { 1 } { k } \sum _ { j } ^ { k } f ( \boldsymbol { X } _ { j } ^ { i } )
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
Here, $X _ { j } ^ { i }$ denotes the $j$ -th image of class $i$ in the support set. The label of a query image $\boldsymbol { X }$ can be predicted by
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\hat { y } = \mathop { \arg \operatorname* { m i n } } _ { i } | | f ( X ) - \bar { \pmb { h } } _ { i } | |
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
Rather than an inner-product between $^ { h }$ and column vectors of the weight matrix $( \boldsymbol { z } _ { i } = \boldsymbol { W } _ { : , i } ^ { T } \boldsymbol { h } + \boldsymbol { b } _ { i } )$ followed by softmax function in the previous case, the prediction is based on the euclidean distance between the query and support features. We argue that this discrepancy hurts the transferability of features pre-trained on base data to novel data.
|
| 82 |
+
|
| 83 |
+
# 3.2 METRIC-SOFTMAX CLASSIFIER
|
| 84 |
+
|
| 85 |
+
To eliminate this discrepancy, we improve the Softmax classifier by redefining the probability score calculating function. Specifically, we replace the $\exp ( z _ { i } )$ term in Equation 2 with a Gaussian kernel-based radial basis function, whose center is the column vector of a learnable weight matrix $W _ { : , i } , W \in \mathbb { R } ^ { d \times c }$ . Then the score can be computed by
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
s _ { i } = \frac { \exp ( - \alpha \vert \vert { h - W _ { : , i } } \vert \vert ) } { \sum _ { j } ^ { c } \exp ( - \alpha \vert \vert { h - W _ { : , j } } \vert \vert ) } ,
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
where $\alpha \in \mathbb { R } , \alpha > 0$ is a hyper-parameter for scaling and $^ { h }$ is an L2-normalized feature vector. In this way, it can be easily derived that arg max $s _ { i }$ is equal to $\arg \operatorname* { m i n } _ { i } \left| \left| \boldsymbol { h } - \boldsymbol { W } _ { : , i } \right| \right|$ . Here $W _ { : , i }$ can i
|
| 92 |
+
be interpreted as the centroid of class $i$ in the learned embedding space. That means the training procedure is essentially optimizing the euclidean distance-based similarity between images to their corresponding class centroids. During training, the cross-entropy loss is adopted as in the Softmax loss.
|
| 93 |
+
|
| 94 |
+
During inference, we replace $W _ { : , i }$ with the mean feature (see Equation 5) of class $i$ in the support set. Then classification of a query image is conducted according to Equation 4. Like episodic training, the consistency between training and inference is well preserved. And we easily enjoy the benefit of more general and discriminative feature learned with the cross-entropy loss. It is worth noting that the number of classes during inference on novel data is independent from the base dataset, which makes it flexible enough to adapt to different few-shot classification tasks.
|
| 95 |
+
|
| 96 |
+
# 3.3 FAST TASK ADAPTATION
|
| 97 |
+
|
| 98 |
+
Although the feature learned on the large-scale base data is highly general and discriminative, it is unlikely to perfectly fit arbitrary novel classes. A proper adaptation to each few-shot task is beneficial. To leverage the valuable cue provided by the support images, a straightforward choice is to fine-tune a specific Softmax classifier as in Chen et al. (2019). However, even with the feature extractor being fixed, it is still difficult to train the classifier due to easy overfitting on small dataset. In contrast, we design a parameterized transformation function $g$ to adapt the general feature to current few-shot learning task,
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\begin{array} { r } { h ^ { \prime } = g ( h ) } \end{array}
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
Concretely, $g$ is simply a zero-offset affine transformation: $g ( \pmb { h } ) = \pmb { M } ^ { T } \pmb { h } ,\pmb { M } \in \mathbb { R } ^ { d \times d }$ . For $m$ - way $k$ -shot classification, we reconstruct an $m$ -class Metric-Softmax classifier whose weight matrix $\bar { \pmb { W } } \in \mathbb { R } ^ { d \times m }$ is derived from the transformed features of the support images
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\bar { W } _ { : , i } = \frac { 1 } { k } \sum _ { j } ^ { k } g ( \pmb { h } _ { ( i , j ) } )
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
Here $\pmb { h } _ { ( i , j ) }$ denotes the feature of $j$ -th image in class $i$ . It is worth mentioning that both the transformed feature vector $g ( h )$ and each column of the weight matrix $\bar { \pmb { W } }$ should be L2-normalized. And now, the computation of probability score is defined as
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
s _ { i } = \frac { \exp ( - \alpha \vert \vert g ( \pmb { h } ) - \bar { \pmb { W } } _ { : , i } \vert \vert ) } { \sum _ { j } ^ { c } \exp ( - \alpha \vert \vert g ( \pmb { h } ) - \bar { \pmb { W } } _ { : , j } \vert \vert ) }
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
The transformation $g$ is trained on all labeled images in the support set with the cross-entropy loss. To ease optimization, the transforming matrix $M$ is initialized with an identity matrix. After training of $g$ finishes, it is applied to both support and query images. And the final prediction of a query image $\boldsymbol { X }$ is computed by
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\hat { y } = \underset { i } { \arg \operatorname* { m i n } } \left| \left| g ( f ( X ) ) - \bar { W } _ { : , i } \right| \right|
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
# 4 EXPERIMENTS
|
| 123 |
+
|
| 124 |
+
# 4.1 DATASETS
|
| 125 |
+
|
| 126 |
+
We conduct few-shot classification experiments on two common benchmarks, namely miniImageNet (Vinyals et al., 2016) and CUB-200-2011 (Wah et al., 2011).
|
| 127 |
+
|
| 128 |
+
mini-ImageNet is first proposed by Vinyals et al. (2016) for few-shot classification evaluation. It consists of 100 classes and 600 images per class, which is a subset sampled from the ImageNet dataset (Deng et al., 2009). In our experiments, we follow the dataset splits proposed in Ravi & Larochelle (2017), which takes 64, 16 and 20 classes for training, validation and testing respectively.
|
| 129 |
+
|
| 130 |
+
CUB-200-2011 is initially proposed for fine-grained classification of birds. It contains 200 categories and 11,788 images in total. We follow the evaluation protocol used in Hilliard et al. (2018), which randomly splits the dataset into 100, 50 and 50 classes for training, validation and testing.
|
| 131 |
+
|
| 132 |
+
# 4.2 IMPLEMENTATION DETAILS
|
| 133 |
+
|
| 134 |
+
To make a fair comparison with existing works, we evaluate our method for three commonly used backbone networks, namely Conv-4 (Vinyals et al., 2016), ResNet-10 (Chen et al., 2019) and ResNet-12 (Oreshkin et al., 2018). Besides difference in depth and architecture, Conv-4 and ResNet12 expect an input size of $8 4 \times 8 4$ , while ResNet-10 takes $2 2 4 \times 2 2 4$ images as input, following the setting in existing works. In our experiments, we mainly focus on the 5-way 1-shot and 5-way 5-shot classification settings which are the most commonly used in existing works. The test episode contains 5 classes and each class contains 1 (or 5) support image(s) and 15 query images. For all experiments, we report the mean accuracy over 1200 randomly sampled episodes and the $9 5 \%$ confidence interval.
|
| 135 |
+
|
| 136 |
+
Table 1: Few-shot classification results on the test set of the mini-ImageNet dataset. ∗Results reported by Chen et al. (2019).
|
| 137 |
+
|
| 138 |
+
<table><tr><td>Method</td><td>Backbone</td><td>5-way 1-shot</td><td> 5-way 5-shot</td></tr><tr><td rowspan="2">MatchingNet*(Vinyals et al., 2016) ProtoNet (Snell et al., 2017) MAML (Finn et al., 2017) RelationNet (Sung et al., 2018) PABN (Huang et al., 2019) Baseline++ (Chen et al., 2019)</td><td rowspan="2">Conv-4</td><td>48.14±0.78 49.42±0.78 48.70±1.84</td><td>63.48±0.66 68.20±0.66</td></tr><tr><td>50.44±0.82 51.87±0.45</td><td>63.11±0.92 65.32±0.70</td></tr><tr><td rowspan="2">DN4 (Li et al., 2019) FTA (Ours) MetaGAN (Zhang et al., 2018) SNAIL (Mishra et al., 2018)</td><td rowspan="2">AdaResNet (Munkhdalai et al.,2018) ResNet-12</td><td>48.24±0.75 51.24±0.74 52.13±0.53</td><td>66.43±0.63 71.02±0.64 80.35±0.41</td></tr><tr><td>52.71±0.64 55.71±0.99 56.88±0.62 58.5±0.3</td><td>68.63±0.67 68.88±0.92 71.94±0.57</td></tr></table>
|
| 139 |
+
|
| 140 |
+
Our implementation is based on PyTorch (Paszke et al., 2017). We apply the same data augmentation as Chen et al. (2019), including random cropping, horizontal flipping and color jittering in both feature learning and fast task adaptation stages. The Adam (Kingma & Ba, 2015) optimizer with $\epsilon = 1 0 ^ { - 3 }$ , $\beta _ { 1 } \stackrel { - } { = } 0 . 9$ and $\beta _ { 2 } = 0 . 9 9 9$ is used. In the feature learning stage, the backbone network is trained from scratch for 300 epochs in total with a batch size of 32. We decay the learning rate by a factor of 0.1 every 75 epochs. The scaling factor $\alpha$ used in Metric-Softmax is set to 15 for mini-ImageNet and 1 for CUB-200-2011. In the task adaptation stage, we use the same optimizer with different learning rate. We set the learning rate to 0.005 for the 1-shot setting and 0.05 for the 5-shot setting. $\alpha$ is set to 0.25 and 2 for the 1-shot and 5-shot settings respectively. We fine-tune the weights of the transformation $g$ for 20 epochs. Note that all the hyper-parameters are determined by the performance on the validation set of each dataset.
|
| 141 |
+
|
| 142 |
+
# 4.3 COMPARISONS WITH THE STATE-OF-THE-ARTS
|
| 143 |
+
|
| 144 |
+
Results on mini-ImageNet. Table 1 shows a comparison of our method to current state-of-the-arts on the mini-ImageNet dataset. Classification accuracies are reported for two backbone networks, i.e. Conv-4 and ResNet-12. For Conv-4 backbone, we achieve the best accuracy in both 5-way 1-shot and 5-way 5-shot settings. Our method boosts the performance for the 5-shot setting, surpassing the second best by $9 . 3 3 \%$ and $2 . 1 0 \%$ for the Conv-4 and ResNet-12 backbones respectively. A closer analysis on the larger improvement for the 5-shot setting than 1-shot setting is given in the discussion section.
|
| 145 |
+
|
| 146 |
+
Results on CUB-200-2011. On this dataset, we find that there is no work reporting the few-shot performance for the ResNet-12 backbone. For a fair comparison, we report the accuracies of the Conv-4 and ResNet-10 backbones. As shown in Table 2, similar to mini-ImageNet, our method outperforms the second best method by a large margin $( 8 7 . 9 2 \%$ vs. $8 1 . 9 0 \%$ for Conv-4 and $9 2 . 8 9 \%$ vs. $8 7 . 4 5 \%$ for ResNet-10) in the 5-way 5-shot setting. In the 1-shot setting, we achieve the best performance for ResNet-10 and comparable accuracy to PABN $6 5 . 1 1 \%$ vs. $6 6 . 7 1 \%$ for Conv-4. It is worth mentioning that in PABN, the max-pooling layers of the backbone network are replaced with bilinear pooling, which is specially optimized for fine-grained classification tasks. We expect further accuracy improvement by incorporating such techniques in our method.
|
| 147 |
+
|
| 148 |
+
Results under Domain Shift. To evaluate the generalizability of the task-agnostic feature learned with the proposed Metric-Softmax loss, we perform the cross domain experiments. In the cross domain scenario, we swap the training sets of the two datasets. Specifically, in the miniImageNet CUB-200-2011 setting, the training set is comprised of the 64 base classes from miniImageNet, while the validation and test data come from CUB-200-2011. Similarly, in the CUB$2 0 0 { - } 2 0 1 1 \{ 1 \to$ mini-ImageNet setting, we use the 100-class base data of CUB-200-2011 for general feature learning and evaluate its performance on the mini-ImageNet dataset. We report the results under the same setting as Devos & Grossglauser (2019) in Table 3. Compared with existing methods, our approach achieves the highest accuracy in all settings. Notably, we improve SubspaceNet by $2 2 . 6 7 \%$ in the mini-ImageNet CUB-200-2011 setting. The strong cross domain performance is mainly attributed to the task-adaptive transformation $g$ of our FTA. If it is disabled, the accuracy drops drastically from $8 5 . 3 8 \%$ to $6 7 . 2 2 \%$ . Another observation is that the performance degrades more in CUB-200-2011 mini-ImageNet than mini-ImageNet CUB-200-2011. This is because mini-ImageNet contains more abundant classes than CUB-200-2011 and the network can learn more general and discriminative feature.
|
| 149 |
+
|
| 150 |
+
Table 2: Few-shot classification results on the test set of the CUB-200-2011 dataset.
|
| 151 |
+
|
| 152 |
+
<table><tr><td>Method</td><td>Backbone</td><td>5-way 1-shot</td><td>5-way 5-shot</td></tr><tr><td>MatchingNet (Vinyals et al., 2016)</td><td rowspan="6">Conv-4</td><td>61.16±0.89</td><td>72.86±0.70</td></tr><tr><td>ProtoNet (Snell et al.,2017)</td><td>51.31±0.91</td><td>70.77±0.69</td></tr><tr><td>MAML (Finn et al., 2017)</td><td>55.92±0.95</td><td>72.09±0.76</td></tr><tr><td>RelationNet (Sung et al.,2018)</td><td>62.45±0.98</td><td>76.11±0.69</td></tr><tr><td>PABN (Huang et al., 2019)</td><td>66.71±0.43</td><td>76.90±0.21</td></tr><tr><td>Baseline++ (Chen et al., 2019) DN4 (Li et al., 2019)</td><td>60.53±0.83</td><td>79.34±0.61</td></tr><tr><td rowspan="3">FTA (Ours) Baseline++ (Chen et al., 2019)</td><td rowspan="3">ResNet-10</td><td>53.15±0.84 65.11±0.65</td><td>81.90±0.60 87.92±0.38</td></tr><tr><td></td><td></td></tr><tr><td>69.55±0.89 72.92±0.90</td><td>85.17±0.50</td></tr><tr><td colspan="2">SubspaceNet (Devos & Grossglauser,2019) FTA (Ours)</td><td>73.19±0.62</td><td>87.45±0.48 92.89±0.28</td></tr></table>
|
| 153 |
+
|
| 154 |
+
Table 3: Identical domain and cross domain results for 5-way 5-shot classification using the ResNet10 backbone. The dataset names (mini-ImageNet and CUB-200-2011) are abbreviated to mini and CUB respectively for brevity.
|
| 155 |
+
|
| 156 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">Identical Domain</td><td colspan="2">Cross Domain</td></tr><tr><td>mini-ImageNet</td><td>CUB-200-2011</td><td>mini → CUB</td><td>CUB →mini</td></tr><tr><td>MatchingNet</td><td>69.14±0.69</td><td>83.75±0.60</td><td>52.59±0.71</td><td>48.95±0.67</td></tr><tr><td>ProtoNet</td><td>73.77±0.64</td><td>85.70±0.52</td><td>59.22±0.74</td><td>53.58±0.73</td></tr><tr><td>RelationNet</td><td>69.97±0.68</td><td>82.67±0.61</td><td>54.36±0.71</td><td>45.27±0.66</td></tr><tr><td>SubspaceNet</td><td>74.03±0.68</td><td>87.45±0.48</td><td>62.71±0.71</td><td>56.66±0.68</td></tr><tr><td>FTA (Ours)</td><td>86.44±0.36</td><td>92.89±0.28</td><td>85.38±0.45</td><td>58.35±0.52</td></tr></table>
|
| 157 |
+
|
| 158 |
+
# 5 DISCUSSION
|
| 159 |
+
|
| 160 |
+
Ablation Study of FTA. As shown in Table 4, compared with the Softmax classifier, the proposed Metric-Softmax classifier improves the accuracy by $4 . 7 7 \%$ and $3 . 4 1 \%$ in the 5-way 1-shot and 5- way 5-shot settings respectively. This improvement is attributed to elimination of the discrepancy between training and inference brought by our Metric-Softmax classifier. By incorporating the taskadaptive transformation, the performance is further boosted, especially in the 5-shot setting.
|
| 161 |
+
|
| 162 |
+
TAT vs. Fine-tuning. To leverage the cue from the supported set, an alternative method is to fine-tune a re-initialized Metric-Softmax classifier similar to Chen et al. (2019). Figure 2 shows a comparison of the proposed task-adaptive transformation to the alternative fine-tuning scheme. In terms of convergence speed, TAT takes only 5 epochs to get an appreciable performance. However, direct fine-tuning takes over 40 epochs to converge for the 5-way 5-shot setting. For the 5-way 1- shot setting, it barely improves the accuracy. In terms of final performance, TAT is far more superior over direct fine-tuning.
|
| 163 |
+
|
| 164 |
+
Table 4: Ablation study of FTA on the mini-ImageNet dataset using the ResNet-12 backbone.
|
| 165 |
+
|
| 166 |
+
<table><tr><td>Method</td><td>Metric-Softmax</td><td>TAT</td><td> 5-way 1-shot</td><td> 5-way 5-shot</td></tr><tr><td>Softmax Classifier</td><td>×</td><td>×</td><td>48.62±0.56</td><td>69.99±0.57</td></tr><tr><td>Metric-Softmax Classifier</td><td></td><td>×</td><td>53.39±0.55</td><td>73.40±0.47</td></tr><tr><td>FTA</td><td>√</td><td>√</td><td>58.03±0.58</td><td>80.73±0.44</td></tr></table>
|
| 167 |
+
|
| 168 |
+

|
| 169 |
+
Figure 2: Performance comparison of TAT to direct fine-tuning on the mini-ImageNet dataset using the ResNet-12 backbone. Accuracies on the test set at different training epochs are plotted.
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
|
| 173 |
+

|
| 174 |
+
Figure 3: Schematic illustration of different feature transformations by TAT in the 5-way 1-shot (a) and 5-way 5-shot (b) settings. Circles of different colors represent the features of different classes. In (b) the black circles indicate the centroid of each class.
|
| 175 |
+
|
| 176 |
+
Why does FTA improve the 5-shot setting more than 1-shot setting? As shown in Section 4.3, our FTA outperforms existing methods more significantly in the 5-shot setting than 1-shot setting. It can be explained by the mechanism of the task-adaptive transformation. In the 1-shot setting, only one image is available in each class. Then Equation 9 degenerates to $\bar { \pmb { W } } _ { : , i } ~ = ~ g ( \pmb { h } _ { ( i , 1 ) } \big )$ . For an image with label $y , y \in \{ 1 , 2 , 3 , 4 , 5 \}$ , the numerator of Equation 10 becomes a constant: $\exp ( - \alpha | | g ( \pmb { h } _ { ( y , 1 ) } ) - g ( \pmb { h } _ { ( y , 1 ) } ) | | ) = 1$ . Now minimizing the cross-entropy means minimizing the denominator of Equation 10, which is equivalent to maximizing the total distance of this feature to others: $\begin{array} { r } { \sum _ { j } ^ { 5 } | | g ( \bar { \pmb h } _ { ( y , 1 ) } ) - g ( \pmb h _ { ( j , 1 ) } ) | | } \end{array}$ . As illustrated in Figure 3(a), task-adaptive transformation only enlarges the distance among different classes in the 1-shot setting. However, for the 5-shot setting (see Figure $3 ( \mathbf { b } ) )$ ), the transformation not only enlarges inter-class distance but also shrinks the intra-class distance, which helps to improve the classifier.
|
| 177 |
+
|
| 178 |
+
# 6 CONCLUSIONS
|
| 179 |
+
|
| 180 |
+
In this paper, we propose the Metric-Softmax loss which can adequately explore the feature similarities in the whole base dataset with the premise of keeping the classifier consistent between training and inference. In addition, we take full advantage of the few labeled novel data by introducing a parameterized transformation to adapt the learned general feature to each few-shot classification task. Our approach is particularly helpful for the 5-shot setting. We leave further improvement for the 1-shot setting as our future work.
|
| 181 |
+
|
| 182 |
+
# REFERENCES
|
| 183 |
+
|
| 184 |
+
Qi Cai, Yingwei Pan, Ting Yao, Chenggang Yan, and Tao Mei. Memory matching networks for one-shot image recognition. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4080–4088, 2018.
|
| 185 |
+
|
| 186 |
+
Wei-Yu Chen, Yen-Cheng Liu, Zsolt Kira, Yu-Chiang Frank Wang, and Jia-Bin Huang. A closer look at few-shot classification. In ICLR 2019 : 7th International Conference on Learning Representations, 2019.
|
| 187 |
+
|
| 188 |
+
Jun Deng, Wenjie Dong, Richard Socher, Li-Jia Li, Kehui Li, and Li Fei-Fei. Imagenet: A largescale hierarchical image database. In 2009 IEEE Conference on Computer Vision and Pattern Recognition, pp. 248–255, 2009.
|
| 189 |
+
|
| 190 |
+
Arnout Devos and Matthias Grossglauser. Subspace networks for few-shot classification. arXiv preprint arXiv:1905.13613, 2019.
|
| 191 |
+
|
| 192 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In ICML’17 Proceedings of the 34th International Conference on Machine Learning - Volume 70, pp. 1126–1135, 2017.
|
| 193 |
+
|
| 194 |
+
Ross B. Girshick. Fast r-cnn. In 2015 IEEE International Conference on Computer Vision (ICCV), pp. 1440–1448, 2015.
|
| 195 |
+
|
| 196 |
+
Nathan Hilliard, Lawrence Phillips, Scott Howland, Artem Yankov, Courtney D. Corley, and ¨ Nathan O. Hodas. Few-shot learning with metric-agnostic conditional embeddings. arXiv preprint arXiv:1802.04376, 2018.
|
| 197 |
+
|
| 198 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural Computation, 9(8): 1735–1780, 1997.
|
| 199 |
+
|
| 200 |
+
Huaxi Huang, Junjie Zhang, Jian Zhang, Qiang Wu, and Jingsong Xu. Compare more nuanced: Pairwise alignment bilinear network for few-shot fine-grained learning. In 2019 IEEE International Conference on Multimedia and Expo (ICME), pp. 91–96, 2019.
|
| 201 |
+
|
| 202 |
+
Diederik P. Kingma and Jimmy Lei Ba. Adam: A method for stochastic optimization. In ICLR 2015 : International Conference on Learning Representations 2015, 2015.
|
| 203 |
+
|
| 204 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E. Hinton. Imagenet classification with deep convolutional neural networks. neural information processing systems, 141(5):1097–1105, 2012.
|
| 205 |
+
|
| 206 |
+
Kwonjoon Lee, Subhransu Maji, Avinash Ravichandran, and Stefano Soatto. Meta-learning with differentiable convex optimization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 10657–10665, 2019.
|
| 207 |
+
|
| 208 |
+
Wenbin Li, Lei Wang, Jinglin Xu, Jing Huo, Yang Gao, and Jiebo Luo. Revisiting local descriptor based image-to-class measure for few-shot learning. arXiv preprint arXiv:1903.12290, 2019.
|
| 209 |
+
|
| 210 |
+
Jonathan Long, Evan Shelhamer, and Trevor Darrell. Fully convolutional networks for semantic segmentation. In 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 3431–3440, 2015.
|
| 211 |
+
|
| 212 |
+
Nikhil Mishra, Mostafa Rohaninejad, Xi Chen, and Pieter Abbeel. A simple neural attentive metalearner. In ICLR 2018 : International Conference on Learning Representations 2018, 2018.
|
| 213 |
+
|
| 214 |
+
Tsendsuren Munkhdalai, Xingdi Yuan, Soroush Mehri, and Adam Trischler. Rapid adaptation with conditionally shifted neurons. In ICML 2018: Thirty-fifth International Conference on Machine Learning, pp. 3661–3670, 2018.
|
| 215 |
+
|
| 216 |
+
Boris N. Oreshkin, Pau Rodr´ıguez Lopez, and Alexandre Lacoste. Tadam: Task dependent adaptive ´ metric for improved few-shot learning. In NIPS 2018: The 32nd Annual Conference on Neural Information Processing Systems, pp. 721–731, 2018.
|
| 217 |
+
|
| 218 |
+
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 Autodiff Workshop, 2017.
|
| 219 |
+
|
| 220 |
+
Siyuan Qiao, Chenxi Liu, Wei Shen, and Alan L. Yuille. Few-shot image recognition by predicting parameters from activations. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7229–7238, 2018.
|
| 221 |
+
|
| 222 |
+
Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In ICLR 2017 : International Conference on Learning Representations 2017, 2017.
|
| 223 |
+
|
| 224 |
+
Avinash Ravichandran, Rahul Bhotika, and Stefano Soatto. Few-shot learning with embedded class models and shot-free meta training. In The IEEE International Conference on Computer Vision (ICCV), October 2019.
|
| 225 |
+
|
| 226 |
+
Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy P. Lillicrap. Meta-learning with memory-augmented neural networks. In ICML’16 Proceedings of the 33rd International Conference on International Conference on Machine Learning - Volume 48, pp. 1842–1850, 2016.
|
| 227 |
+
|
| 228 |
+
Victor Garcia Satorras and Joan Bruna Estrach. Few-shot learning with graph neural networks. In ICLR 2018 : International Conference on Learning Representations 2018, 2018.
|
| 229 |
+
|
| 230 |
+
Chenyang Si, Wentao Chen, Wei Wang, Liang Wang, and Tieniu Tan. Progressive cluster purification for transductive few-shot learning. arXiv preprint arXiv:1906.03847, 2019.
|
| 231 |
+
|
| 232 |
+
Jake Snell, Kevin Swersky, and Richard S. Zemel. Prototypical networks for few-shot learning. In Advances in Neural Information Processing Systems, pp. 4077–4087, 2017.
|
| 233 |
+
|
| 234 |
+
Qianru Sun, Yaoyao Liu, Tat-Seng Chua, and Bernt Schiele. Meta-transfer learning for few-shot learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 403–412, 2019.
|
| 235 |
+
|
| 236 |
+
Flood Sung, Yongxin Yang, Li Zhang, Tao Xiang, Philip H.S. Torr, and Timothy M. Hospedales. Learning to compare: Relation network for few-shot learning. In 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 1199–1208, 2018.
|
| 237 |
+
|
| 238 |
+
Oriol Vinyals, Charles Blundell, Timothy P. Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. Matching networks for one shot learning. In NIPS’16 Proceedings of the 30th International Conference on Neural Information Processing Systems, pp. 3637–3645, 2016.
|
| 239 |
+
|
| 240 |
+
Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge J. Belongie. The caltechucsd birds-200-2011 dataset. Advances in Water Resources, 2011.
|
| 241 |
+
|
| 242 |
+
Yandong Wen, Kaipeng Zhang, Zhifeng Li, and Yu Qiao. A discriminative feature learning approach for deep face recognition. In European Conference on Computer Vision, pp. 499–515, 2016.
|
| 243 |
+
|
| 244 |
+
Ruixiang Zhang, Tong Che, Zoubin Ghahramani, Yoshua Bengio, and Yangqiu Song. Metagan: An adversarial approach to few-shot learning. In NIPS 2018: The 32nd Annual Conference on Neural Information Processing Systems, pp. 2371–2380, 2018.
|
| 245 |
+
|
| 246 |
+
Xuan Zhang, Hao Luo, Xing Fan, Weilai Xiang, Yixiao Sun, Qiqi Xiao, Wei Jiang, Chi Zhang, and Jian Sun. Alignedreid: Surpassing human-level performance in person re-identification. arXiv preprint arXiv:1711.08184, 2017.
|
md/train/DktZb97_Fx/DktZb97_Fx.md
ADDED
|
@@ -0,0 +1,634 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SENSEI: SENSITIVE SET INVARIANCE FOR ENFORCING INDIVIDUAL FAIRNESS
|
| 2 |
+
|
| 3 |
+
# Yuekai Sun
|
| 4 |
+
|
| 5 |
+
Mikhail Yurochkin
|
| 6 |
+
IBM Research
|
| 7 |
+
MIT-IBM Watson AI Lab
|
| 8 |
+
mikhail.yurochkin@ibm.com
|
| 9 |
+
|
| 10 |
+
Department of Statistics University of Michigan yuekai@umich.edu
|
| 11 |
+
|
| 12 |
+
# ABSTRACT
|
| 13 |
+
|
| 14 |
+
In this paper, we cast fair machine learning as invariant machine learning. We first formulate a version of individual fairness that enforces invariance on certain sensitive sets. We then design a transport-based regularizer that enforces this version of individual fairness and develop an algorithm to minimize the regularizer efficiently. Our theoretical results guarantee the proposed approach trains certifiably fair ML models. Finally, in the experimental studies we demonstrate improved fairness metrics in comparison to several recent fair training procedures on three ML tasks that are susceptible to algorithmic bias.
|
| 15 |
+
|
| 16 |
+
# 1 INTRODUCTION
|
| 17 |
+
|
| 18 |
+
As machine learning (ML) models replace humans in high-stakes decision-making and decisionsupport roles, concern regarding the consequences of algorithmic bias is growing. For example, ML models are routinely used in criminal justice and welfare to supplement humans, but they may have racial, class, or geographic biases (Metz & Satariano, 2020). In response, researchers proposed many formal definitions of algorithmic fairness as a first step towards combating algorithmic bias.
|
| 19 |
+
|
| 20 |
+
Broadly speaking, there are two kinds of definitions of algorithmic fairness: group fairness and individual fairness. In this paper, we focus on enforcing individual fairness. At a high-level, the idea of individual fairness is the requirement that a fair algorithm should treat similar individuals similarly. Individual fairness was dismissed as impractical because there is no consensus on which users are similar for many ML tasks. Fortunately, there is a flurry of recent work that addresses this issue (Ilvento, 2019; Wang et al., 2019; Yurochkin et al., 2020; Mukherjee et al., 2020). In this paper, we assume there is a similarity metric for the ML task at hand and consider the task of enforcing individual fairness. Our main contributions are:
|
| 21 |
+
|
| 22 |
+
1. we define distributional individual fairness, a variant of Dwork et al.’s original definition of individual fairness that is (i) more amenable to statistical analysis and (ii) easier to enforce by regularization;
|
| 23 |
+
2. we develop a stochastic approximation algorithm to enforce distributional individual fairness when training smooth ML models;
|
| 24 |
+
3. we show that the stochastic approximation algorithm converges and the trained ML model generalizes under standard conditions;
|
| 25 |
+
4. we demonstrate the efficacy of the approach on three ML tasks that are susceptible to algorithmic bias: income-level classification, occupation prediction, and toxic comment detection.
|
| 26 |
+
|
| 27 |
+
# 2 ENFORCING INDIVIDUAL FAIRNESS WITH SENSITIVE SET INVARIANCE (SENSEI)
|
| 28 |
+
|
| 29 |
+
# 2.1 A TRANSPORT-BASED DEFINITION OF INDIVIDUAL FAIRNESS
|
| 30 |
+
|
| 31 |
+
Let $\mathcal { X }$ and $\mathcal { V }$ be the space of inputs and outputs respectively for the supervised learning task at hand. For example, in classification tasks, $\mathcal { V }$ may be the probability simplex. An ML model is a function $h : \mathcal { X } \mathcal { Y }$ in a space of functions $\mathcal { H }$ (e.g. the set of all neural nets with a certain architecture).
|
| 32 |
+
|
| 33 |
+
Dwork et al. (2011) define individual fairness as $L$ -Lipschitz continuity of an ML model $h$ with respect to appropriate metrics on $\mathcal { X }$ and $\mathcal { V }$ :
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
d _ { \mathcal { V } } ( h ( x ) , h ( x ^ { \prime } ) ) \leq L d _ { \mathcal { X } } ( x , x ^ { \prime } )
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
for all $x , x ^ { \prime } \in { \mathcal { X } }$ . The choice of $d _ { \mathcal { Y } }$ is often determined by the form of the output. For example, if the ML model outputs a vector of the logits, then we may pick the Euclidean norm as $d _ { \mathcal { Y } }$ (Kannan et al., 2018; Garg et al., 2018). The metric $d _ { \mathcal { X } }$ is the crux of (2.1) because it encodes our intuition of which inputs are similar for the ML task at hand. For example, in natural language processing tasks, $d _ { \mathcal { X } }$ may be a metric on word/sentence embeddings that ignores variation in certain sensitive directions. In light of the importance of the similarity metric in (2.1) to enforcing individual fairness, there is also a line of work on learning the similarity metric from data (Ilvento, 2019; Wang et al., 2019; Mukherjee et al., 2020). In our experiments, we adapt the methods from Yurochkin et al. (2020) to learn similarity metrics.
|
| 40 |
+
|
| 41 |
+
Although intuitive, individual fairness is statistically and computationally intractable. Statistically, it is generally impossible to detect violations of individual fairness on zero measure subset of the sample space. Computationally, individual fairness is a Lipschitz restriction, and such restrictions are hard to enforce. In this paper, we address both issues by lifting (2.1) to the space of probability distributions on $\mathcal { X }$ to obtain an “average case” version of individual fairness. This version (i) is more amenable to statistical analysis, (ii) is easy to enforce by minimizing a data-dependent regularizer, and (iii) preserves the intuition behind Dwork et al. (2011)’s original definition of individual fairness.
|
| 42 |
+
|
| 43 |
+
Definition 2.1 (distributional individual fairness (DIF)). Let , $\delta > 0$ be tolerance parameters and $\Delta ( { \mathcal { X } } \times { \mathcal { X } } )$ be the set of probability measures on $\mathcal { X } \times \mathcal { X }$ . Define
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
R ( h ) \triangleq \left\{ \begin{array} { l l } { \operatorname* { s u p } _ { \Pi \in \Delta ( { \mathcal { X } } \times { \mathcal { X } } ) } } & { { \mathbf { E } } _ { \Pi } \big [ d _ { { \mathcal { Y } } } ( h ( X ) , h ( X ^ { \prime } ) ) \big ] } \\ { s u b j e c t t o } & { { \mathbf { E } } _ { \Pi } \big [ d _ { { \mathcal { X } } } ( X , X ^ { \prime } ) \big ] \leq \epsilon } \\ & { \Pi ( \cdot , { \mathcal { X } } ) = P _ { X } } \end{array} \right\} .
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
where $P _ { X }$ is the (marginal) distribution of the inputs in the ML task at hand. An ML model $h$ is $( \epsilon , \delta )$ -distributionally individually fair $( D I F )$ iff $R ( h ) \leq \delta$ .
|
| 50 |
+
|
| 51 |
+
We remark that DIF only depends on $h$ and $P _ { X }$ . It does not depend on the (conditional) distribution of the labels $P _ { Y \mid X }$ , so it does not depend on the performance of the ML model. In other words, it is possible for a model to perform poorly and be perfectly DIF (e.g. the constant model $h ( x ) = 0$ ).
|
| 52 |
+
|
| 53 |
+
The optimization problem in (2.2) formalizes correspondence studies in the empirical literature (Bertrand & Duflo, 2016). Here is a prominent example.
|
| 54 |
+
|
| 55 |
+
Example 2.2. Bertrand & Mullainathan studied racial bias in the US labor market. The investigators responded to help-wanted ads in Boston and Chicago newspapers with fictitious resumes. To manipulate the perception of race, they randomly assigned African-American or white sounding names to the resumes. The investigators concluded there is discrimination against African-Americans because the resumes assigned white names received $50 \%$ more callbacks for interviews than the resumes.
|
| 56 |
+
|
| 57 |
+
We view Bertrand & Mullainathan’s investigation as evaluating the objective in (2.3) at a special $T$ . Let $\mathcal { X }$ be the space of resumes, and $h : \mathcal { X } \{ 0 , 1 \}$ be the decision rule that decides whether a resume receives a callback. Bertrand & Mullainathan implicitly pick the $T$ that reassigns the name on a resume from an African-American sounding name to a white one (or vice versa) and measures discrimination with the difference between callback rates before and after reassignment:
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\mathbf { E } _ { P } \left[ 1 \{ h ( X ) \neq h ( T ( X ) ) \} \right] = \mathbf { P } \{ h ( X ) \neq h ( T ( X ) ) \} .
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
We consider distributional individual fairness a variant of Dwork et al.’s original definition. It is not a fundamentally new definition of algorithmic fairness because it encodes the same intuition as Dwork et al.’s original definition. Most importantly, it remains an individual notion of algorithmic fairness because it compares individuals to similar (close in $d _ { \mathcal { X } }$ ) individuals.
|
| 64 |
+
|
| 65 |
+
# 2.2 DIF VERSUS INDIVIDUAL FAIRNESS
|
| 66 |
+
|
| 67 |
+
It is hard to directly compare Dwork et al.’s original definition of individual fairness and DIF directly. First, they are parameterized differently: the original definition (2.1) is parameterized by a Lipschitz constant $L$ , while DIF is parameterized by an $( \epsilon , \delta )$ pair. Intuitively, (2.1) enforces (approximate) invariance at all scales (at any $\epsilon > 0$ ), while DIF only enforces invariance at one scale (determined by the input tolerance parameter). Second, (2.1) enforces invariance uniformly on $\mathcal { X }$ , while (2.2) enforces invariance on average. Although DIF seems a weaker notion of algorithmic fairness than (2.1) (average fairness vs uniform fairness), DIF is actually more stringent in some ways because the constraints in (2.2) are looser. This is evident in the Mongé version of the optimization problem in (2.2):
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\begin{array} { r l } { \operatorname* { s u p } _ { T : \mathcal { X } \to \mathcal { X } } } & { \mathbf { E } _ { P } \left[ d _ { \mathcal { Y } } ( h ( X ) , h ( T ( X ) ) ) \right] } \\ { \mathrm { s u b j e c t ~ t o ~ } } & { \mathbf { E } _ { P } \left[ d _ { \mathcal { X } } ( X , T ( X ) ) \right] \le \epsilon . } \end{array}
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
The map corresponding to (2.1)
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\begin{array} { r } { T _ { \mathrm { I F } } ( x ) \triangleq \arg \operatorname* { m a x } _ { d _ { \mathcal { X } } ( x , x ^ { \prime } ) \leq \epsilon } d _ { \mathcal { Y } } ( h ( x ) , h ( x ^ { \prime } ) ) } \end{array}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
maps each $x$ to its worse-case counterpart $x ^ { \prime }$ in (2.1). It is not hard to see that $T _ { \mathrm { I F } }$ is a feasible map for (2.3), but it may not be optimal. This is because (2.3) only restricts $T$ to transport points by at most $\epsilon$ on average; the optimal $T$ may transport some points by more than $\epsilon$ .
|
| 80 |
+
|
| 81 |
+
To make the two definitions more comparable, we consider an $\epsilon { - } \delta$ version of individual fairness. A model $h : \mathcal { X } \to \mathcal { Y }$ satisfies $( \epsilon , \delta )$ -individual fairness at $x \in \mathcal { X }$ if and only if
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\begin{array} { r } { d _ { \mathcal { Y } } ( h ( x ) , h ( T _ { \mathrm { I F } } ( x ) ) ) = \operatorname* { s u p } _ { d _ { \mathcal { X } } ( x , x ^ { \prime } ) \leq \epsilon } d _ { \mathcal { Y } } ( h ( x ) , h ( x ^ { \prime } ) ) \leq \delta . } \end{array}
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
To arrive at (2.4), we start by observing that (2.1) is equivalent to
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\begin{array} { r } { \operatorname* { s u p } _ { x \in \mathcal { X } } d _ { \mathcal { Y } } ( h ( x ) , h ( T _ { \mathrm { I F } } ( x ) ) ) \le L \epsilon \mathrm { f o r } \operatorname * { a n y } x \in \mathcal { X } \mathrm { ~ a n d ~ } \epsilon > } \end{array}
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
We fix $x$ and $\epsilon$ and re-parameterize the right side with $\delta$ to obtain (2.4). It is possible to show that if $h$ is $( \epsilon , \delta )$ -DIF, then there exists $\delta ^ { \prime }$ such that it satisfies $( \epsilon , \delta ^ { \prime } )$ -individual fairness for “most” $x$ ’s. We formally state this result in a proposition.
|
| 94 |
+
|
| 95 |
+
Proposition 2.3. If $h : \mathcal { X } \to \mathcal { Y }$ is $( \epsilon , \delta )$ -DIF, then
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\begin{array} { r } { P _ { X } ( d _ { \mathcal { Y } } ( h ( X ) , h ( T _ { \mathrm { I F } } ( X ) ) ) \ge \tau ) \le \frac { \delta } { \tau } f o r a n y \tau > 0 . } \end{array}
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
# 2.3 ENFORCING DIF
|
| 102 |
+
|
| 103 |
+
There are two general approaches to enforcing invariance conditions such as (2.2). The first is distributionally robust optimization (DRO):
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\begin{array} { r } { \operatorname* { m i n } _ { h \in \mathcal { H } } L _ { \mathrm { a d v } } ( h ) \triangleq \operatorname* { s u p } _ { P ^ { \prime } : W _ { d } ( P , P ^ { \prime } ) \leq \epsilon } { \bf E } _ { P ^ { \prime } } \big [ \ell ( Y ^ { \prime } , h ( X ^ { \prime } ) ) \big ] , } \end{array}
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
where $\ell$ is a loss function and $W _ { d } ( P , Q )$ is the Wasserstein distance between distributions on $\mathcal { X } \times \mathcal { V }$ induced by the transport cost function $c ( ( x , y ) , ( x ^ { \prime } y ^ { \prime } ) ) \triangleq d _ { \mathcal { X } } ( x , x ^ { \prime } ) + \infty \cdot 1 \{ y \neq y ^ { \prime } \}$ . This approach is very similar to adversarial training, and it was considered by Yurochkin et al. (2020) for enforcing (their modification of) individual fairness. In this paper, we consider a regularization approach to enforcing (2.2):
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\begin{array} { r } { \operatorname* { m i n } _ { h \in \mathcal { H } } L ( h ) + \rho R ( h ) , \quad L ( h ) \triangleq \mathbf { E } \big [ \ell ( Y , h ( X ) ) \big ] , } \end{array}
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
where $\rho > 0$ is a regularization parameter and the regularizer $R$ is defined in (2.2). An obvious advantage of the regularization approach is it allows the user to fine-tune the trade-off between goodness-of-fit and fairness by adjusting $\rho$ (see Figure 1; in Figure 3 of Appendix D we show the lack of such flexibility in the method of Yurochkin et al. (2020)). As we shall see, although the two approaches share many theoretical properties, we show in Section 4 that the regularization approach has superior empirical performance. We defer a more in-depth comparison between the two approaches to subsection 2.4.
|
| 116 |
+
|
| 117 |
+
At first blush, the regularized risk minimization problem (2.6) is not amenable to stochastic optimization because $R$ is not an expected value of a function of the training examples. Fortunately, by appealing to duality, it is possible to obtain a dual formulation of $R$ that is suitable for stochastic optimization.
|
| 118 |
+
|
| 119 |
+
Theorem 2.4 (dual form of $R$ ). If $d y ( h ( x ) , h ( x ^ { \prime } ) ) - \lambda d _ { \mathcal { X } } ( x , x ^ { \prime } )$ is continuous (in $( x , x ^ { \prime } )$ ) for any $\lambda \geq 0$ , then
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\begin{array} { r } { R ( h ) = \operatorname* { i n f } _ { \lambda \geq 0 } \{ \lambda \epsilon + { \bf E } _ { P x } \left[ r _ { \lambda } ( h , X ) \right] \} , r _ { \lambda } ( h , X ) \triangleq \operatorname* { s u p } _ { x ^ { \prime } \in \mathcal { X } } \{ d y ( h ( X ) , h ( x ^ { \prime } ) ) - \lambda d _ { \mathcal { X } } ( X , x ^ { \prime } ) \} . } \end{array}
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
Figure 1: The decision surface of a one hidden layer neural network trained with SenSeI as the fair regularization parameter $\rho$ varies. In this ML task, points on a horizontal line (points with identical $y$ -values) are similar, but the training data is biased because $P _ { Y \mid X }$ is not constant on horizontal lines. We see that fair regularization (eventually) corrects the bias in the data.
|
| 127 |
+
|
| 128 |
+
We defer the proof of this result to Appendix A. In light of the dual form of the fair regularizer, the regularized risk minimization problem is equivalently
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
\begin{array} { r } { \operatorname* { m i n } _ { h \in \mathcal { H } } \operatorname* { i n f } _ { \lambda \ge 0 } { \bf E } _ { P } \big [ \ell ( Y , h ( X ) ) + \rho ( \lambda \epsilon + r _ { \lambda } ( h , X ) ) \big ] , } \end{array}
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
where $r _ { \lambda }$ is defined in Theorem 2.4, which has the form of minimizing an expected value of a function of the training examples. To optimize with respect to $h$ , we parameterize the function space $\mathcal { H }$ with a parameter $\mathbf { \bar { \theta } } \in \Theta \mathsf { \bar { \Lambda } } \subset \mathbf { R } ^ { d }$ and consider a stochastic approximation approach to finding the best parameter. Let $w \triangleq ( \theta , \lambda )$ and $Z \triangleq ( X , Y )$ . The stochastic optimization problem we wish to solve is
|
| 135 |
+
|
| 136 |
+
$\begin{array} { r } { \operatorname* { m i n } _ { w \in \Theta \times { \bf R } _ { + } } F ( w ) \triangleq { \bf E } _ { P } \big [ f ( w , Z ) \big ] , \quad f ( w , Z ) \triangleq \ell ( Y , h _ { \theta } ( X ) ) + \rho ( \lambda \epsilon + r _ { \lambda } ( h _ { \theta } , X ) ) . } \end{array}$ (2.8) It is not hard to see that (2.8) is a stochastic optimization problem. We summarize Sensitive Set Invariance (SenSeI) for stochastic optimization of (2.8) in Algorithm 1.
|
| 137 |
+
|
| 138 |
+
# Algorithm 1 SenSeI: Sensitive Set Invariance
|
| 139 |
+
|
| 140 |
+
<table><tr><td>inputs: starting point (0o,Xo), step sizes (nt)</td></tr><tr><td>repeat</td></tr><tr><td>(Xt1,Yt1),...,(Xtb,YtB)~P > sample mini-batch from P</td></tr><tr><td>xtb←argmax'∈x{dy(hθ(Xtb),h(x'))-Xtdx(Xtb,x')},b∈[B] generate worst-case examples</td></tr><tr><td></td></tr><tr><td>λt+1←max{0,Xt-ntp(∈-B∑b=1dx(Xtb,xtb)},</td></tr><tr><td>0t+1←t-nt(∑-{e(Yth(t)))+p{dy(h(Xt),(x)))) until converged</td></tr></table>
|
| 141 |
+
|
| 142 |
+
# 2.4 ADVERSARIAL TRAINING VS FAIR REGULARIZATION
|
| 143 |
+
|
| 144 |
+
Adversarial training is a popular approach to training invariant ML models. It was originally developed to defend ML models against adversarial examples (Goodfellow et al., 2014; Madry et al., 2017). There are many versions of adversarial training; the Wasserstein distributionally robust optimization (DRO) version by Sinha et al. (2017) is most closely related to (2.5). The direct goal of adversarial training is training ML models whose risk is small on adversarial examples, and the robust risk that adversarial training seeks to minimize (2.5) is exactly the risk on adversarial examples.
|
| 145 |
+
|
| 146 |
+
An indirect consequence of adversarial training is invariance to imperceptible changes to the inputs. Recall an adversarial example is a training example with the same label as a non-adversarial training example whose inputs differ imperceptibly from those of a training example. Thus (successful) adversarial training leads to ML models that ignore such imperceptible changes and are thus invariant in “imperceptible neighborhoods” of the training examples.
|
| 147 |
+
|
| 148 |
+
Unlike adversarial training, which leads to invariance as an indirect consequence of adversarial robustness, fair regularization enforces fairness by explicitly minimizing a fair regularizer. A key benefit of invariance regularization is it permits practitioners to fine-tune the trade-off between goodness-of-fit and invariance by adjusting the regularization parameter (see Figure 1).
|
| 149 |
+
|
| 150 |
+
# 2.5 RELATED WORK
|
| 151 |
+
|
| 152 |
+
There are three lines of work on enforcing individual fairness. There is a line of work that enforces group fairness with respect to many (possibly overlapping) groups to avoid disparate treatment of individuals (Hébert-Johnson et al., 2017; Kearns et al., 2017; Kim et al., 2018a;b). At a high-level, these methods repeatedly find groups in which group fairness is violated and updates the ML model to correct violations. Compared to these methods that approximate individual fairness with group fairness, we directly enforce individual fairness.
|
| 153 |
+
|
| 154 |
+
There is another line of work on enforcing individual fairness without knowledge of the similarity metric. Gillen et al. (2018); Rothblum & Yona (2018); Jung et al. (2019) reduce the problem of enforcing individual fairness to a supervised learning problem by minimizing the number of violations. Instead of a similarity metric, these algorithms rely on an oracle that detects violations of individual fairness. Garg et al. (2018) enforce individual fairness by penalizing the expected difference in predictions between counterfactual inputs. Instead of a similarity metric, this algorithm relies a way of generating counterfactual inputs. Our approach complements these methods by relying on a similarity metric instead of such oracles. This allows us to take advantage of recent work on learning fair metrics (Ilvento, 2019; Wang et al., 2019; Yurochkin et al., 2020; Mukherjee et al., 2020).
|
| 155 |
+
|
| 156 |
+
Most similar to our work is SenSR (Yurochkin et al., 2020) that also assumes access to a similarity metric. SenSR is based on adversarial training, i.e. it enforces a risk-based notion of individual fairness that only requires the risk of the ML model to be similar on similar inputs. In contrast, our method is based on fair regularization, i.e. it enforces a notion of individual fairness that requires the outputs of the ML model to be similar. The latter is stronger (it implies the former) and is much closer to Dwork et al.’s original definition. In addition, the risk-based notion of SenSR ties accuracy to fairness. Our approach separates these two (usually conflicting) goals and allows practitioners to more easily adjust the trade-off between accuracy and fairness as demonstrated in our experimental studies.
|
| 157 |
+
|
| 158 |
+
Finally, there is a line of work that proposes pre-processing techniques to learn a fair representation of the individuals and training an ML model that accepts the fair representation as input (Zemel et al., 2013; Bower et al., 2018; Madras et al., 2018; Lahoti et al., 2019). These works are complimentary to ours as we propose an in-processing algorithm.
|
| 159 |
+
|
| 160 |
+
# 3 THEORETICAL PROPERTIES OF SENSEI
|
| 161 |
+
|
| 162 |
+
In this section, we describe some theoretical properties of SenSeI. We defer all proofs to Appendix A. First, Algorithm 1 is an instance of a stochastic gradient method, and its convergence properties are well-studied. Even if $f ( w , Z )$ is non-convex in $w$ , the algorithm converges (globally) to a stationary point (see Appendix A for a rigorous statement). Second, the fair regularizer is data-dependent, and it is unclear whether minimizing its empirical counterpart (3.1) enforces distributional fairness. We show that the fair regularizer generalizes under standard conditions. Consequently,
|
| 163 |
+
|
| 164 |
+
1. it is possible for practitioners to certify that an ML model $h$ is DIF a posteriori by checking $\hat { R } ( h )$ (even if $h$ was trained by minimizing $\widehat { R } )$ ;
|
| 165 |
+
2. fair regularization enforces distributional individual fairness (as long as the hypothesis class includes DIF ML models);
|
| 166 |
+
|
| 167 |
+
Notation Let $\{ ( X _ { i } , Y _ { i } ) \} _ { i = 1 } ^ { n }$ be the training set and ${ \widehat { P } } _ { X }$ be the empirical distribution of the inputs. Define $\widehat { L } : \mathcal H \to \mathbf { R }$ as the empirical risk and $\widehat { R } : \mathcal { H } \to \mathbf { R }$ as the empirical counterpart of the fair regularizer $R$ (2.2):
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
\widehat { R } ( h ) \triangleq \left\{ \begin{array} { l l } { \operatorname* { m a x } _ { \Pi \in \Delta ( \mathcal { X } \times \mathcal { X } ) } } & { \mathbf { E } _ { \Pi } \big [ d y ( h ( X ) , h ( X ^ { \prime } ) ) \big ] } \\ { \mathrm { s u b j e c t ~ t o ~ } } & { \mathbf { E } _ { \Pi } \big [ d _ { \mathcal { X } } ( X , X ^ { \prime } ) \big ] \leq \epsilon } \\ & { \Pi ( \cdot , \mathcal { X } ) = \widehat { P } _ { X } , } \end{array} \right\} .
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
Define the loss class $\mathcal { L }$ and its counterpart for the fair regularizer as
|
| 174 |
+
|
| 175 |
+
$$
|
| 176 |
+
\begin{array} { r l r } & { } & { \mathcal { L } \triangleq \{ \ell _ { h } : \mathcal { Z } \to { \bf R } \mid h \in \mathcal { H } \} , \quad \ell _ { h } ( z ) \triangleq \ell ( h ( x ) , y ) , } \\ & { } & { \mathcal { D } \triangleq \{ d _ { h } : \mathcal { X } \times \mathcal { X } \to { \bf R } _ { + } \mid h \in \mathcal { H } \} , \quad d _ { h } ( x , x ^ { \prime } ) \triangleq d _ { \mathcal { V } } ( h ( x ) , h ( x ^ { \prime } ) ) . } \end{array}
|
| 177 |
+
$$
|
| 178 |
+
|
| 179 |
+
We measure the complexity of $\mathcal { D }$ and $\mathcal { L }$ with their entropy integrals with respect to to the uniform metric: $\begin{array} { r } { J ( \mathcal { D } / \mathcal { L } ) \triangleq \int _ { 0 } ^ { \infty } \log N ( \mathcal { D } / \mathcal { L } , \| \cdot \| _ { \infty } , \epsilon ) ^ { \frac { 1 } { 2 } } d \epsilon } \end{array}$ , where $N ( \mathcal { D } , \| \cdot \| _ { \infty } , \epsilon )$ is the $\epsilon$ -covering number of $\mathcal { D }$ in the uniform metric. The main benefit of using entropy integrals instead of Rademacher or Gaussian complexities to measure the complexity of $\mathcal { D }$ and $\mathcal { L }$ is it does not depend on the distribution of the training examples. This allows us to obtain generalization error bounds for counterfactual training sets that are similar to the (observed) training set. Finally, define the diameter of $\mathcal { X }$ in the $d _ { \mathcal { X } }$ metric, that of $\mathcal { V }$ in the $d _ { \mathcal { Y } }$ metric as $\begin{array} { r } { D _ { \mathcal { X } } \triangleq \operatorname* { s u p } _ { x , x ^ { \prime } \in \mathcal { X } } d _ { \mathcal { X } } ( x , x ^ { \prime } ) } \end{array}$ , $\begin{array} { r } { D _ { \mathcal { Y } } \triangleq \operatorname* { s u p } _ { y , y ^ { \prime } \in \mathcal { Y } } d _ { \mathcal { Y } } ( y , y ^ { \prime } ) } \end{array}$ . The first result shows that the fair regularizer $R ( h )$ generalizes. We assume $D _ { \mathcal { X } }$ , $D _ { c Y } < \infty$ . This is a boundedness condition on $\mathcal { X } \times \mathcal { V }$ , and it is a common simplifying assumption in statistical learning theory. We also assume $J ( \mathcal { D } ) < \infty$ . This is a standard assumption that appears in many uniform convergence results.
|
| 180 |
+
|
| 181 |
+
Theorem 3.1. As long as $D _ { \mathcal { X } } , D _ { \mathcal { Y } }$ , and $J ( { \mathcal { G } } )$ are all finite, with probability at least $1 - t$ :
|
| 182 |
+
|
| 183 |
+
$$
|
| 184 |
+
\begin{array} { r } { \operatorname* { s u p } _ { h \in \mathcal { H } } | \widehat { R } ( h ) - R ( h ) | \leq \frac { 4 8 ( J ( \mathcal { D } ) + \frac { 1 } { \epsilon } D _ { \mathcal { X } } D _ { \mathcal { Y } } ) } { \sqrt { n } } + D _ { \mathcal { Y } } ( \frac { \log \frac { 2 } { t } } { 2 n } ) ^ { \frac { 1 } { 2 } } . } \end{array}
|
| 185 |
+
$$
|
| 186 |
+
|
| 187 |
+
Theorem 3.1 implies it is possible to certify that an ML model $h$ satisfies distributional individual fairness (modulo error terms that vanish in the large-sample limit) by inspecting $\widehat { R } ( h )$ . This is important because a practitioner may inspect $\widehat { R } ( h )$ after training to verify whether the trained ML model $h$ is fair enough. Theorem 3.1 assures the user that $\widehat { R } ( h )$ is close to $R ( h )$ .
|
| 188 |
+
|
| 189 |
+
# 4 COMPUTATIONAL EXPERIMENTS
|
| 190 |
+
|
| 191 |
+
In this section we present empirical evidence that SenSeI trains individually fair ML models in practice and study the trade-off between accuracy and fairness parametrized by $\rho$ (defined in (2.6)).
|
| 192 |
+
|
| 193 |
+
Baselines We compare SenSeI to empirical risk minimization (Baseline) and two recent approaches for training individually fair ML models: Sensitive Subspace Robustness (SenSR) (Yurochkin et al., 2020) that uses DRO to achieve robustness to perturbations in a fair metric, and Counterfactual Logit Pairing (CLP) (Garg et al., 2018) that penalizes the differences in the output of an ML model on training examples and hand-crafted counterfactuals. We provide implementation details of SenSeI and the baselines in Appendix B.
|
| 194 |
+
|
| 195 |
+
# 4.1 TOXIC COMMENT DETECTION
|
| 196 |
+
|
| 197 |
+
We consider the task of training a classifier to identify toxic comments, i.e. rude or disrespectful messages in online conversations. Identifying and moderating toxic comments is crucial for facilitating inclusive online conversations. Data is available through the “Toxic Comment Classification Challenge” Kaggle competition. We utilize the subset of the dataset that is labeled with a range of identity contexts (e.g. “muslim”, “white”, “black”, “homosexual gay or lesbian”). Many of the toxic comments in the train data also relate to these identities leading to a classifier with poor test performance on the sets of comments with some of the identity contexts (group fairness violation) and prediction rule utilizing words such as “gay” to flag a comment as toxic (individual fairness violation). To obtain good features we use last layer representation of BERT (base, uncased) (Devlin et al., 2018) fine tuned on a separate subset of $5 0 0 \mathrm { k }$ randomly selected comments without identity labels. We then train a 2000 hidden units neural network with these BERT features.
|
| 198 |
+
|
| 199 |
+
Counterfactuals and fair metric. CLP (Garg et al., 2018) requires defining a set of counterfactual tokens. The training proceeds by taking an input comment and if it contains a counterfactual token replacing it with another random counterfactual token. For example, if “gay” and “straight” are among the counterfactual tokens, comment “Some people are gay” may be modified to “Some people are straight”. Then difference in logit outputs of the classifier on the original and modified comments is used as a regularizer. For toxicity classification Garg et al. (2018) adopted a set of 50 counterfactual tokens from (Dixon et al., 2018). Counterfactuals allow for a simple fair metric learning procedure via factor analysis: since any variation in representation of a data point and its counterfactuals is considered undesired, Yurochkin et al. (2020); Mukherjee et al. (2020) proposed to use a Mahalanobis metric with the major directions of variation among counterfactuals projected out. We utilize this approach here to obtain fair metric for training SenSR (Yurochkin et al., 2020) and SenSeI. See Appendix B.1 for additional details regarding the fair metric construction in the experiments.
|
| 200 |
+
|
| 201 |
+
Table 1: Summary of Toxicity classification experiment over 10 restarts
|
| 202 |
+
|
| 203 |
+
<table><tr><td></td><td>BA</td><td>CTF score</td><td>PC</td><td>BA STD</td><td>ACC STD</td></tr><tr><td>Baseline</td><td>0.807±0.002</td><td>0.072±0.002</td><td>0.621±0.014</td><td>0.044±0.003</td><td>0.081±0.004</td></tr><tr><td>SenSeI</td><td>0.791±0.005</td><td>0.029±0.005</td><td>0.773±0.043</td><td>0.035±0.003</td><td>0.052±0.003</td></tr><tr><td>SenSR</td><td>0.794±0.003</td><td>0.043±0.005</td><td>0.729±0.044</td><td>0.036±0.002</td><td>0.059±0.004</td></tr><tr><td>CLP</td><td>0.795±0.006</td><td>0.032±0.006</td><td>0.763±0.048</td><td>0.038±0.003</td><td>0.056±0.004</td></tr></table>
|
| 204 |
+
|
| 205 |
+
Table 2: Summary of Bios classification experiment over 10 restarts
|
| 206 |
+
|
| 207 |
+
<table><tr><td></td><td>BA</td><td>CTF score</td><td>PC</td><td>Gap RMS</td><td>Gap ABS</td></tr><tr><td>Baseline</td><td>0.842±0.002</td><td>0.028±0.001</td><td>0.942±0.001</td><td>0.120±0.004</td><td>0.080±0.003</td></tr><tr><td>SenSeI</td><td>0.843±0.003</td><td>0.003±0.000</td><td>0.977±0.001</td><td>0.086±0.005</td><td>0.054±0.003</td></tr><tr><td>SenSR</td><td>0.842±0.003</td><td>0.004±0.000</td><td>0.976±0.001</td><td>0.087±0.004</td><td>0.054±0.003</td></tr><tr><td>CLP</td><td>0.841±0.003</td><td>0.005±0.000</td><td>0.974±0.001</td><td>0.087±0.005</td><td>0.056±0.004</td></tr></table>
|
| 208 |
+
|
| 209 |
+
Comparison metrics. To evaluate individual fairness of the classifiers we use test data and 50 counterfactuals to check if the classifier toxicity decision varies across counterfactuals. For example, is prediction for “Some people are gay” same as for “Some people are straight”? An intuitive fair metric should be 0 on a pair of such comments and prediction of the classifier should not change based on the Dwork et al.’s individual fairness definition. We report Counterfactual Token Fairness (CTF) score (Garg et al., 2018) that quantifies variance across counterfactuals of the predicted probability that a comment is toxic, and Prediction Consistency (PC) equal to the portion of test comments where prediction is the same across all 50 counterfactual variations.
|
| 210 |
+
|
| 211 |
+
For goodness-of-fit we use balanced accuracy due to class imbalance. To quantify group fairness we follow accuracy parity notion (Zafar et al., 2017; Zhao et al., 2019). Here protected groups correspond to the identity context labels available in the data and accuracy parity quantifies whether a classifier is equally accurate on, e.g., comments labeled to have “white” context and those labeled with “black”. There are 9 protected groups and we report standard deviation of the accuracies and balanced accuracies across them. We present mathematical expressions for each of the metrics in Appendix C for completeness.
|
| 212 |
+
|
| 213 |
+
Results. We repeat our experiment 10 times with random 70-30 train-test splits, every time utilizing a random subset of 25 counterfactuals during training. Results are summarized in Table 1. SenSeI on average outperforms other fair training methods on all individual and group fairness metrics at the cost of slightly lower balanced accuracy. SenSR has the lowest prediction consistency score suggesting that our fair regularization is more effective in enforcing individual fairness than adversarial training. This observation aligns with the empirical study by Yang et al. (2019) comparing various invariance enforcing techniques for spatial robustness in image recognition.
|
| 214 |
+
|
| 215 |
+
SenSeI also outperforms CLP: our approach uses optimization to find worst case perturbations of the data according to a fair metric induced by counterfactuals, while CLP chooses a random perturbation among the counterfactuals. SenSeI is searching for a perturbation on every data point that potentially allows to generalize to unseen counterfactuals, while CLP can only perturb comments that explicitly contain a counterfactual known during training time. In Figure 2 we verify that both SenSeI and CLP allow to “trade” fairness and accuracy by varying the regularization strength $\rho$ (in the table we used $\rho = 5$ for both). We also notice the effect of worst case optimization opposed to random sampling: SenSeI has higher prediction consistency at the cost of balanced accuracy.
|
| 216 |
+
|
| 217 |
+
# 4.2 OCCUPATION PREDICTION
|
| 218 |
+
|
| 219 |
+
Online professional presence via dedicated services or personal websites is the common practice in many industries. ML systems can be trained using data from these sources to identify person’s occupation and used by recruiters to assist in finding suitable candidates for the job openings. Gender imbalances in occupations may trigger biases in such ML systems exacerbating societal inequality. De-Arteaga et al. (2019) proposed Bias in Bios dataset to study fairness in occupation prediction from a person’s bio. The dataset consists of $4 0 0 \mathrm { k }$ textual bio descriptions and the goal is to predict one of the 28 occupations. We again use BERT fine-tuned on the train data to obtain bio representations and then train a 2000 hidden neurons neural networks using each of the fair training methods.
|
| 220 |
+
|
| 221 |
+

|
| 222 |
+
Figure 2: Balanced accuracy (BA) and prediction consistency (PC) trade-off.
|
| 223 |
+
|
| 224 |
+
Table 3: Adult experiment over 10 restarts. Prior methods are duplicated from Yurochkin et al. (2020)
|
| 225 |
+
|
| 226 |
+
<table><tr><td></td><td>BA,%</td><td>S-Con.</td><td>GR-Con.</td><td>GapG RMS</td><td>GapR RMS</td><td>GapG max</td><td>GapR max</td></tr><tr><td>SenSR</td><td>78.9</td><td>.934</td><td>.984</td><td>.068</td><td>.055</td><td>.087</td><td>.067</td></tr><tr><td>Baseline</td><td>82.9</td><td>.848</td><td>.865</td><td>.179</td><td>.089</td><td>.216</td><td>.105</td></tr><tr><td>Project</td><td>82.7</td><td>.868</td><td>1.00</td><td>.145</td><td>.064</td><td>.192</td><td>.086</td></tr><tr><td>Adv. debiasing</td><td>81.5</td><td>.807</td><td>.841</td><td>.082</td><td>.070</td><td>.110</td><td>.078</td></tr><tr><td>CoCL</td><td>79.0</td><td>1</td><td>1</td><td>.163</td><td>.080</td><td>.201</td><td>.109</td></tr><tr><td>SenSeI (p= 40)</td><td>76.8</td><td>.945</td><td>.963</td><td>.043</td><td>.054</td><td>.053</td><td>.064</td></tr></table>
|
| 227 |
+
|
| 228 |
+
Counterfactuals and fair metric. Counterfactuals definition for this problem is the gender analog of the Bertrand & Mullainathan (2004) investigation of the racial bias in the labor market. For each bio we create a counterfactual bio by replacing male pronouns with the corresponding female ones and vice a versa. For the fair metric we use same approach as in the Toxicity study.
|
| 229 |
+
|
| 230 |
+
Comparison metrics. We use the same individual fairness metrics. To compare group fairness we report root mean squared gap (Gap RMS) and mean absolute gap (Gap ABS) between male and female true positive rates for each of the occupations following prior studies of this dataset (Romanov et al., 2019; Prost et al., 2019). For performance we report balanced accuracy due to imbalance in occupation proportions in the data.
|
| 231 |
+
|
| 232 |
+
Results. We repeat the experiment 10 times with 70-30 train-test splits and summarize results in Table 2 (for SenSeI and CLP we set $\rho = 5$ ). Comparing to the Toxicity experiment, we note that individual fairness metrics are much better. In particular, attaining prediction consistency is easier because there is only one type of counterfactuals. Overall, fairness metrics are comparable across fair training methods with a slight SenSeI advantage. It is interesting to note mild accuracy improvement: learning a classifier invariant to gender can help to avoid spurious correlations between occupations and gender present in the data. We present fairness accuracy “trade-off” in Figure 2 — increasing regularization strength has clear upward trend in terms of the prediction consistency without decreasing accuracy. This experiments is an example where fairness can be improved without ”trading” performance.
|
| 233 |
+
|
| 234 |
+
We note two prior group fairness studies of the Bios dataset: Romanov et al. (2019) and Prost et al. (2019). Both reported worse classification results and fairness metrics. Better classification performance in our work is likely attributed to using BERT for obtaining bios feature vectors. For the group fairness, we note that relative to baseline improvement with SenSeI is more significant.
|
| 235 |
+
|
| 236 |
+
# 4.3 INCOME PREDICTION
|
| 237 |
+
|
| 238 |
+
The Adult dataset (Bache & Lichman, 2013) is a common benchmark in the group fairness literature. The task is to predict if a person earns more than $\$ 50\mathbf { k }$ per year using information about their education, gender, race, marital status, hours worked per week, etc. Yurochkin et al. (2020) studied individual fairness on Adult by considering prediction consistency with respect to demographic features: race and gender (GR-Con.) and marital status (S-Con., i.e. spouse consistency). To quantify group fairness they used RMS gaps and maximum gaps between true positive rates across genders $\bar { ( \mathrm { G a p } _ { G } ^ { \mathrm { R M S } } }$ and ${ \mathrm { G a p } } _ { G } ^ { \operatorname* { m a x } } ,$ ) and races ${ ( \mathrm { G a p } _ { R } ^ { \mathrm { R M S } } }$ and ${ \mathrm { G a p } } _ { R } ^ { \operatorname* { m a x } } .$ ). Due to class imbalance, performance is quantified with balanced accuracy (B-Acc). For the fair metric they used Mahalanobis distance with race, gender and a logistic regression vector predicting gender projected out. We note that CLP was proposed as a fair training method for text classification (Garg et al., 2018) and is not applicable on Adult because it is not clear how to define counterfactuals. We compare SenSeI to results reported in Yurochkin et al. (2020). In Table 3 we show that with sufficiently large regularization strength $\rho = 4 0$ SenSeI is able to further reduce all group fairness gaps and improve one of the individual fairness metrics, however trading off some accuracy.
|
| 239 |
+
|
| 240 |
+
# 5 SUMMARY AND DISCUSSION
|
| 241 |
+
|
| 242 |
+
In this paper, we studied a regularization approach to enforcing individual fairness. We defined distributional individual fairness, a variant of Dwork et al.’s original definition of individual fairness and a data-dependent regularizer that enforces this distributional fairness (see Definition 2.1). We also developed a stochastic approximation algorithm to solve regularized empirical risk minimization problems and showed that it trains ML models with distributional fairness guarantees. Finally, we showed that the algorithm mitigates algorithmic bias on three ML tasks that are susceptible to such biases: income-level classification, occupation prediction, and toxic comment detection.
|
| 243 |
+
|
| 244 |
+
# ACKNOWLEDGEMENTS
|
| 245 |
+
|
| 246 |
+
This paper is based upon work supported by the National Science Foundation (NSF) under grants no. 1830247 and 1916271. Any opinions, findings, and conclusions or recommendations expressed in this paper are those of the authors and do not necessarily reflect the views of the NSF.
|
| 247 |
+
|
| 248 |
+
# REFERENCES
|
| 249 |
+
|
| 250 |
+
K. Bache and M. Lichman. UCI machine learning repository. 2013.
|
| 251 |
+
|
| 252 |
+
Marianne Bertrand and Esther Duflo. Field Experiments on Discrimination. Technical Report w22014, National Bureau of Economic Research, Cambridge, MA, February 2016.
|
| 253 |
+
|
| 254 |
+
Marianne Bertrand and Sendhil Mullainathan. Are Emily and Greg More Employable Than Lakisha and Jamal? A Field Experiment on Labor Market Discrimination. American Economic Review, 94 (4):991–1013, September 2004. ISSN 0002-8282. doi: 10.1257/0002828042002561.
|
| 255 |
+
|
| 256 |
+
Jose Blanchet and Karthyek R. A. Murthy. Quantifying Distributional Model Risk via Optimal Transport. arXiv:1604.01446 [math, stat], April 2016.
|
| 257 |
+
|
| 258 |
+
Amanda Bower, Laura Niss, Yuekai Sun, and Alexander Vargo. Debiasing representations by removing unwanted variation due to protected attributes. arXiv:1807.00461 [cs], July 2018.
|
| 259 |
+
|
| 260 |
+
Maria De-Arteaga, Alexey Romanov, Hanna Wallach, Jennifer Chayes, Christian Borgs, Alexandra Chouldechova, Sahin Geyik, Krishnaram Kenthapadi, and Adam Tauman Kalai. Bias in Bios: A Case Study of Semantic Representation Bias in a High-Stakes Setting. Proceedings of the Conference on Fairness, Accountability, and Transparency - FAT\* ’19, pp. 120–128, 2019. doi: 10.1145/3287560.3287572.
|
| 261 |
+
|
| 262 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding. arXiv:1810.04805 [cs], October 2018.
|
| 263 |
+
|
| 264 |
+
Lucas Dixon, John Li, Jeffrey Sorensen, Nithum Thain, and Lucy Vasserman. Measuring and Mitigating Unintended Bias in Text Classification. In Proceedings of the 2018 AAAI/ACM Conference on AI, Ethics, and Society - AIES ’18, pp. 67–73, New Orleans, LA, USA, 2018. ACM Press. ISBN 978-1-4503-6012-8. doi: 10.1145/3278721.3278729.
|
| 265 |
+
|
| 266 |
+
Cynthia Dwork, Moritz Hardt, Toniann Pitassi, Omer Reingold, and Rich Zemel. Fairness Through Awareness. arXiv:1104.3913 [cs], April 2011.
|
| 267 |
+
|
| 268 |
+
Sahaj Garg, Vincent Perot, Nicole Limtiaco, Ankur Taly, Ed H. Chi, and Alex Beutel. Counterfactual Fairness in Text Classification through Robustness. arXiv:1809.10610 [cs, stat], September 2018.
|
| 269 |
+
|
| 270 |
+
Saeed Ghadimi and Guanghui Lan. Stochastic First- and Zeroth-order Methods for Nonconvex Stochastic Programming. arXiv:1309.5549 [cs, math, stat], September 2013.
|
| 271 |
+
|
| 272 |
+
Stephen Gillen, Christopher Jung, Michael Kearns, and Aaron Roth. Online Learning with an Unknown Fairness Metric. arXiv:1802.06936 [cs], February 2018.
|
| 273 |
+
|
| 274 |
+
Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and Harnessing Adversarial Examples. December 2014.
|
| 275 |
+
|
| 276 |
+
Úrsula Hébert-Johnson, Michael P. Kim, Omer Reingold, and Guy N. Rothblum. Calibration for the (Computationally-Identifiable) Masses. arXiv:1711.08513 [cs, stat], November 2017.
|
| 277 |
+
|
| 278 |
+
Christina Ilvento. Metric Learning for Individual Fairness. arXiv:1906.00250 [cs, stat], June 2019.
|
| 279 |
+
|
| 280 |
+
Christopher Jung, Michael Kearns, Seth Neel, Aaron Roth, Logan Stapleton, and Zhiwei Steven Wu. Eliciting and Enforcing Subjective Individual Fairness. arXiv:1905.10660 [cs, stat], May 2019.
|
| 281 |
+
|
| 282 |
+
Harini Kannan, Alexey Kurakin, and Ian Goodfellow. Adversarial Logit Pairing. arXiv:1803.06373 [cs, stat], March 2018.
|
| 283 |
+
|
| 284 |
+
Michael Kearns, Seth Neel, Aaron Roth, and Zhiwei Steven Wu. Preventing Fairness Gerrymandering: Auditing and Learning for Subgroup Fairness. arXiv:1711.05144 [cs], November 2017.
|
| 285 |
+
|
| 286 |
+
Michael P. Kim, Amirata Ghorbani, and James Zou. Multiaccuracy: Black-Box Post-Processing for Fairness in Classification. arXiv:1805.12317 [cs, stat], May 2018a.
|
| 287 |
+
|
| 288 |
+
Michael P. Kim, Omer Reingold, and Guy N. Rothblum. Fairness Through Computationally-Bounded Awareness. arXiv:1803.03239 [cs], March 2018b.
|
| 289 |
+
|
| 290 |
+
Preethi Lahoti, Krishna P. Gummadi, and Gerhard Weikum. iFair: Learning Individually Fair Data Representations for Algorithmic Decision Making. arXiv:1806.01059 [cs, stat], February 2019.
|
| 291 |
+
|
| 292 |
+
Jaeho Lee and Maxim Raginsky. Minimax Statistical Learning with Wasserstein Distances. arXiv:1705.07815 [cs], May 2017.
|
| 293 |
+
|
| 294 |
+
David Luenberger. OPTIMIZATION BY VECTOR SPACE METHODS. John Wiley & Sons, 1968.
|
| 295 |
+
|
| 296 |
+
David Madras, Elliot Creager, Toniann Pitassi, and Richard Zemel. Learning Adversarially Fair and Transferable Representations. arXiv:1802.06309 [cs, stat], February 2018.
|
| 297 |
+
|
| 298 |
+
Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards Deep Learning Models Resistant to Adversarial Attacks. arXiv:1706.06083 [cs, stat], June 2017.
|
| 299 |
+
|
| 300 |
+
Cade Metz and Adam Satariano. An Algorithm That Grants Freedom, or Takes It Away. The New York Times, February 2020. ISSN 0362-4331.
|
| 301 |
+
|
| 302 |
+
Debarghya Mukherjee, Mikhail Yurochkin, Moulinath Banerjee, and Yuekai Sun. Two simple ways to learn individual fairness metrics from data. In International Conference on Machine Learning, July 2020.
|
| 303 |
+
|
| 304 |
+
Flavien Prost, Nithum Thain, and Tolga Bolukbasi. Debiasing Embeddings for Reduced Gender Bias in Text Classification. arXiv:1908.02810 [cs, stat], August 2019.
|
| 305 |
+
|
| 306 |
+
R. Tyrrell Rockafellar and Roger J.-B. Wets. Variational Analysis. Number 317 in Grundlehren Der Mathematischen Wissenschaften. Springer, Berlin, corr. 2nd print edition, 2004. ISBN 978-3-540-62772-2.
|
| 307 |
+
|
| 308 |
+
Alexey Romanov, Maria De-Arteaga, Hanna Wallach, Jennifer Chayes, Christian Borgs, Alexandra Chouldechova, Sahin Geyik, Krishnaram Kenthapadi, Anna Rumshisky, and Adam Tauman Kalai. What’s in a Name? Reducing Bias in Bios without Access to Protected Attributes. arXiv:1904.05233 [cs, stat], April 2019.
|
| 309 |
+
|
| 310 |
+
Guy N. Rothblum and Gal Yona. Probably Approximately Metric-Fair Learning. arXiv:1803.03242 [cs], March 2018.
|
| 311 |
+
|
| 312 |
+
Aman Sinha, Hongseok Namkoong, and John Duchi. Certifying Some Distributional Robustness with Principled Adversarial Training. arXiv:1710.10571 [cs, stat], October 2017.
|
| 313 |
+
|
| 314 |
+
Hanchen Wang, Nina Grgic-Hlaca, Preethi Lahoti, Krishna P. Gummadi, and Adrian Weller. An Empirical Study on Learning Fairness Metrics for COMPAS Data with Human Supervision. arXiv:1910.10255 [cs], October 2019.
|
| 315 |
+
|
| 316 |
+
Fanny Yang, Zuowen Wang, and Christina Heinze-Deml. Invariance-inducing regularization using worst-case transformations suffices to boost accuracy and spatial robustness. arXiv:1906.11235 [cs, stat], June 2019.
|
| 317 |
+
|
| 318 |
+
Mikhail Yurochkin, Amanda Bower, and Yuekai Sun. Training individually fair ML models with sensitive subspace robustness. In International Conference on Learning Representations, Addis Ababa, Ethiopia, 2020.
|
| 319 |
+
|
| 320 |
+
Muhammad Bilal Zafar, Isabel Valera, Manuel Gomez Rodriguez, and Krishna P. Gummadi. Fairness Beyond Disparate Treatment & Disparate Impact: Learning Classification without Disparate Mistreatment. Proceedings of the 26th International Conference on World Wide Web - WWW ’17, pp. 1171–1180, 2017. doi: 10.1145/3038912.3052660.
|
| 321 |
+
|
| 322 |
+
Rich Zemel, Yu Wu, Kevin Swersky, Toni Pitassi, and Cynthia Dwork. Learning Fair Representations. In International Conference on Machine Learning, pp. 325–333, February 2013.
|
| 323 |
+
|
| 324 |
+
Han Zhao, Amanda Coston, Tameem Adel, and Geoffrey J. Gordon. Conditional Learning of Fair Representations. In International Conference on Learning Representations, September 2019.
|
| 325 |
+
|
| 326 |
+
# A THEORETICAL PROPERTIES
|
| 327 |
+
|
| 328 |
+
We collect the proofs of all the theoretical results in the paper here. We restate the results before proving them for the reader’s convenience. We assume that $( \mathcal { X } , d _ { \mathcal { X } } )$ and $( \mathcal { V } , d _ { \mathcal { V } } )$ are complete and separable metric spaces (Polish spaces).
|
| 329 |
+
|
| 330 |
+
# A.1 DIF AND INDIVIDUAL FAIRNESS
|
| 331 |
+
|
| 332 |
+
Proposition A.1 (Proposition 2.3). If $h : \mathcal { X } \to \mathcal { Y }$ is $( \epsilon , \delta )$ -DIF, then
|
| 333 |
+
|
| 334 |
+
$$
|
| 335 |
+
\begin{array} { r } { P _ { X } ( \operatorname* { s u p } _ { d _ { \mathcal { X } } ( x , x ^ { \prime } ) \leq \epsilon } d y ( h ( x ) , h ( x ^ { \prime } ) ) \geq \tau ) \leq \frac { \delta } { \tau } . } \end{array}
|
| 336 |
+
$$
|
| 337 |
+
|
| 338 |
+
Proof. Recall
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
\begin{array} { r } { T _ { \mathrm { I F } } \triangleq \arg \operatorname* { m a x } _ { d _ { \mathcal { X } } ( x , x ^ { \prime } ) \leq \epsilon } d _ { \mathcal { Y } } ( h ( x ) , h ( x ^ { \prime } ) ) . } \end{array}
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
is feasible for (the Mongé version of) (2.2). Thus $R ( h ) \leq \delta$ implies ${ \bf E } _ { P x } \left[ d y ( X , T _ { \mathrm { I F } } ( X ) ) \right] \leq \delta$ Markov’s inequality implies $\begin{array} { r } { P _ { X } ( d _ { \mathcal { V } } ( X , T _ { \mathrm { I F } } ( X ) ) \ge \tau ) \le \frac { \delta } { \tau } } \end{array}$ for any $\tau > 0$ . □
|
| 345 |
+
|
| 346 |
+
# A.2 CONVERGENCE PROPERTIES OF SENSEI
|
| 347 |
+
|
| 348 |
+
Algorithm 1 is an instance of a stochastic gradient method, and its convergence properties are wellstudied. Even if $f ( w , Z )$ is non-convex in $w$ , the algorithm converges (globally) to a stationary point. This a well-known result in stochastic approximation, and we state it here for completeness.
|
| 349 |
+
|
| 350 |
+
Theorem A.2 (Ghadimi & Lan (2013)). Let
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
\begin{array} { r } { \sigma ^ { 2 } \geq { \bf E } \big [ \| \frac { 1 } { B } \sum _ { b = 1 } ^ { B } \partial _ { w } f ( w , Z _ { b } ) - \partial F ( w ) \| _ { 2 } ^ { 2 } \big ] } \end{array}
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
e an upper bound of the variance of the stochastic gradient. As long as $F$ is $L$ -strongly smooth,
|
| 357 |
+
|
| 358 |
+
$$
|
| 359 |
+
\begin{array} { r } { F ( w ^ { \prime } ) \leq F ( w ) + \langle \partial F ( w ) , w ^ { \prime } - w \rangle + \frac { L } { 2 } \| w - w ^ { \prime } \| _ { 2 } ^ { 2 } } \end{array}
|
| 360 |
+
$$
|
| 361 |
+
|
| 362 |
+
for any $w , w ^ { \prime } \in \Theta \times \mathbf { R } _ { + }$ , then Algorithm $\cdot$ with constant step sizes $\begin{array} { r } { \eta _ { t } = \big ( \frac { 2 B \epsilon _ { 0 } } { L \sigma ^ { 2 } T } \big ) ^ { \frac { 1 } { 2 } } } \end{array}$ satisfies
|
| 363 |
+
|
| 364 |
+
$$
|
| 365 |
+
\begin{array} { r } { \frac { 1 } { T } \sum _ { t = 1 } ^ { T } \mathbf { E } \big [ \| \partial F ( w _ { t } ) \| _ { 2 } ^ { 2 } \big ] \leq \sigma ( \frac { 8 L \epsilon _ { 0 } } { B T } ) , } \end{array}
|
| 366 |
+
$$
|
| 367 |
+
|
| 368 |
+
where $\epsilon _ { \mathrm { 0 } }$ is any upper bound of the suboptimality of $w _ { 0 }$
|
| 369 |
+
|
| 370 |
+
In other words, Algorithm 1 finds an $\epsilon$ -stationary point of (2.8) in at most $O ( \textstyle { \frac { 1 } { \epsilon ^ { 2 } } } )$ iterations. If $F$ has more structure (e.g. convexity), then Algorithm 1 may converge faster.
|
| 371 |
+
|
| 372 |
+
# A.3 PROOF OF DUALITY RESULTS IN SECTION 2
|
| 373 |
+
|
| 374 |
+
Theorem A.3 (Theorem 2.4). If $d y ( h ( x ) , h ( x ^ { \prime } ) ) - \lambda d _ { \mathcal { X } } ( x , x ^ { \prime } )$ is continuous (in $( x , x ^ { \prime } ) )$ for any $\lambda \geq 0$ , then
|
| 375 |
+
|
| 376 |
+
$$
|
| 377 |
+
\begin{array} { r l r } & { } & { R ( h ) = \operatorname* { i n f } _ { \lambda \ge 0 } \{ \lambda \epsilon + { \bf E } _ { P _ { X } } \left[ r _ { \lambda } ( h , X ) \right] \} , } \\ & { } & { r _ { \lambda } ( h , X ) \triangleq \operatorname* { s u p } _ { x ^ { \prime } \in \mathcal { X } } \{ d _ { \mathcal { V } } ( h ( X ) , h ( x ^ { \prime } ) ) - \lambda d _ { \mathcal { X } } ( X , x ^ { \prime } ) \} . } \end{array}
|
| 378 |
+
$$
|
| 379 |
+
|
| 380 |
+
Proof. We abuse notation and denote the function $d y ( h ( x ) , h ( x ^ { \prime } ) )$ as $d _ { \mathcal { Y } } \circ h$ . We recognize the optimization problem in (2.2) as an (infinite dimensional) linear optimization problem:
|
| 381 |
+
|
| 382 |
+
$$
|
| 383 |
+
R ( h ) \triangleq \left\{ \begin{array} { l l } { \operatorname* { s u p } _ { \Pi : \Delta ( \mathcal { X } \times \mathcal { X } ) } } & { \langle \Pi , d _ { \mathcal { Y } } \circ h \rangle = \mathbf { E } _ { \Pi } \big [ d _ { \mathcal { Y } } ( h ( X ) , h ( X ^ { \prime } ) ) \big ] } \\ { \mathrm { s u b j e c t ~ t o ~ } } & { \langle \Pi , d _ { \mathcal { X } } \rangle = \mathbf { E } _ { \Pi } \big [ d _ { \mathcal { X } } ( X , X ^ { \prime } ) \big ] \leq \epsilon } \\ & { \Pi ( \cdot , \mathcal { X } ) = P _ { \mathcal { X } } , } \end{array} \right.
|
| 384 |
+
$$
|
| 385 |
+
|
| 386 |
+
It is not hard check Slater’s condition: $d \Pi ( x , x ^ { \prime } ) = { \bf 1 } \{ x = x ^ { \prime } \} d P ( x )$ is strictly feasible. Thus we have strong duality (see Theorem 8.7.1 in (Luenberger, 1968)):
|
| 387 |
+
|
| 388 |
+
$$
|
| 389 |
+
\begin{array} { r l r } & { } & { R ( h ) = \operatorname* { s u p } _ { \Pi : \Pi ( \cdot , \mathcal { X } ) = P _ { X } } \operatorname* { i n f } _ { \lambda \geq 0 } \langle \Pi , d _ { \mathcal { Y } } \circ h \rangle + \lambda ( \epsilon - \langle \Pi , d _ { \mathcal { X } } \rangle ) } \\ & { } & { \quad = \operatorname* { s u p } _ { \Pi : \Pi ( \cdot , \mathcal { X } ) = P _ { X } } \operatorname* { i n f } _ { \lambda \geq 0 } \lambda \epsilon + \langle \Pi , d _ { \mathcal { Y } } \circ h - \lambda d _ { \mathcal { X } } \rangle \quad } \\ & { } & { \quad = \operatorname* { i n f } _ { \lambda \geq 0 } \{ \lambda \epsilon + \operatorname* { s u p } _ { \Pi : \Pi ( \cdot , \mathcal { X } ) = P _ { X } } \langle \Pi , d _ { \mathcal { Y } } \circ h - \lambda d _ { \mathcal { X } } \rangle \} , } \end{array}
|
| 390 |
+
$$
|
| 391 |
+
|
| 392 |
+
It remains to show
|
| 393 |
+
|
| 394 |
+
$$
|
| 395 |
+
\begin{array} { r } { \operatorname* { s u p } _ { \Pi : \Pi ( \cdot , x ) = P } \langle d _ { \mathcal { Y } } \circ h - \lambda d _ { \mathcal { X } } , \Pi \rangle = \mathbf { E } _ { P } \left[ \operatorname* { s u p } _ { x ^ { \prime } \in \mathcal { X } } \{ d _ { \mathcal { Y } } ( h ( X ) , h ( x ^ { \prime } ) ) - \lambda d _ { \mathcal { X } } ( X , x ^ { \prime } ) \} \right] . } \end{array}
|
| 396 |
+
$$
|
| 397 |
+
|
| 398 |
+
$\leq$ direction The integrands in (A.1) satisfy
|
| 399 |
+
|
| 400 |
+
( $\begin{array} { r } { d _ { \mathcal { V } } \circ h - \lambda d _ { \mathcal { X } } ) ( x , x ^ { \prime } ) = d _ { \mathcal { V } } ( h ( x ) , h ( x ^ { \prime } ) ) - \lambda d _ { \mathcal { X } } ( x , x ^ { \prime } ) \leq \operatorname* { s u p } _ { x ^ { \prime } \in \mathcal { X } } \big \{ d _ { \mathcal { V } } ( h ( x ) , h ( x ^ { \prime } ) ) - \lambda d _ { \mathcal { X } } ( x , x ^ { \prime } ) \big \} , } \end{array}$ so the integrals satisfy the $\leq$ version of (A.1).
|
| 401 |
+
|
| 402 |
+
$\geq$ direction Let $\mathcal { Q }$ be the set of all Markov kernels from $\mathcal { X }$ to $\mathcal { X }$ . We have
|
| 403 |
+
|
| 404 |
+
$$
|
| 405 |
+
\begin{array} { r l r } { { \operatorname* { s u p } _ { \Pi : \Pi ( \cdot , \mathcal { X } ) = P } \langle d y \circ h - \lambda d _ { \mathcal { X } } , \Pi \rangle = \operatorname* { s u p } _ { Q \in \mathcal { Q } } \int _ { \mathcal { X } \times \mathcal { X } } d y ( h ( x ) , h ( x ^ { \prime } ) ) - \lambda d _ { \mathcal { X } } ( x , x ^ { \prime } ) d Q ( x ^ { \prime } \mid x ) d P ( x ) } } \\ & { } & { \ge \operatorname* { s u p } _ { T : \mathcal { X } \to \mathcal { X } } \int _ { \mathcal { X } } d y ( h ( x ) , h ( T ( x ) ) ) - \lambda d _ { \mathcal { X } } ( x , T ( x ) ) d P ( x ) , } \end{array}
|
| 406 |
+
$$
|
| 407 |
+
|
| 408 |
+
where we recalled $Q ( A \mid x ) = \mathbf { 1 } \{ T ( x ) \in A \}$ is a Markov kernel in the second step. (Technically, in the second step, we only sup over $T$ ’s that are decomposable (see Definition 14.59 in Rockafellar & Wets (2004)) with respect to $P$ , but we gloss over this detail here.) We appeal to the technology of integrands (Rockafellar & Wets, 2004) to interchange integration and maximization. We assumed $d _ { \mathscr { y } } \circ h - \lambda d _ { \mathscr { x } }$ is continuous, so it is a normal integrand (see Corollary 14.34 in Rockafellar & Wets (2004)). Thus it is OK to interchange integration and maximization (see Theorem 14.60 in Rockafellar & Wets (2004)):
|
| 409 |
+
|
| 410 |
+
$$
|
| 411 |
+
\operatorname* { s u p } _ { T : \mathcal { X } \to \mathcal { X } } \int _ { \mathcal { X } } d y ( h ( x ) , h ( T ( x ) ) ) - \lambda d _ { \mathcal { X } } ( x , T ( x ) ) d P ( x ) = \int _ { \mathcal { X } } \operatorname* { s u p } _ { x ^ { \prime } \in \mathcal { X } } \left\{ d y ( h ( x ) , h ( x ^ { \prime } ) ) - \lambda d _ { \mathcal { X } } ( x , x ^ { \prime } ) \right\} d P ( x ) .
|
| 412 |
+
$$
|
| 413 |
+
|
| 414 |
+
This shows the $\geq$ direction of (A.1).
|
| 415 |
+
|
| 416 |
+
We remark that it is not necessary to rely on the technology of normal integrands to interchange expectation and maximization in the proof of Theorem 2.4. For example, Blanchet & Murthy (2016) prove a similar strong duality result without resorting to normal integrands. We do so here to simplify the proof.
|
| 417 |
+
|
| 418 |
+
# A.4 PROOFS OF GENERALIZATION RESULTS IN SECTION 3
|
| 419 |
+
|
| 420 |
+
Theorem A.4 (Theorem 3.1). As long as $D _ { \mathcal { X } } , D _ { \mathcal { Y } } , J ( \mathcal { G } )$ are all finite,
|
| 421 |
+
|
| 422 |
+
$$
|
| 423 |
+
\begin{array} { r } { \operatorname* { s u p } _ { f \in \mathcal { F } } | \mathbf { E } _ { \widehat { P } } \big [ f ( Z ) \big ] - \mathbf { E } _ { P } \big [ f ( Z ) \big ] | \leq \frac { 4 8 ( J ( \mathcal { D } ) + \frac { 1 } { \epsilon } D x D y ) } { \sqrt { n } } + D y ( \frac { \log \frac { 2 } { t } } { 2 n } ) ^ { \frac { 1 } { 2 } } } \end{array}
|
| 424 |
+
$$
|
| 425 |
+
|
| 426 |
+
with probability at least $1 - t$ .
|
| 427 |
+
|
| 428 |
+
Proof. Let
|
| 429 |
+
|
| 430 |
+
$$
|
| 431 |
+
\widehat { R } ( h ) \triangleq \left\{ \begin{array} { l l } { \operatorname* { m a x } _ { \Pi \in \Delta ( \mathcal { X } \times \mathcal { X } ) } } & { \mathbf { E } _ { \Pi } \big [ d y ( h ( X ) , h ( X ^ { \prime } ) ) \big ] } \\ { \mathrm { s u b j e c t ~ t o ~ } } & { \mathbf { E } _ { \Pi } \big [ d _ { \mathcal { X } } ( X , X ^ { \prime } ) \big ] \leq \epsilon } \\ & { \Pi ( \cdot , \mathcal { X } ) = \widehat { P } _ { X } , } \end{array} \right\} .
|
| 432 |
+
$$
|
| 433 |
+
|
| 434 |
+
where ${ \widehat { P } } _ { X }$ is the empirical distribution of the inputs in the training set. By Theorem 2.4, we have
|
| 435 |
+
|
| 436 |
+
$$
|
| 437 |
+
\begin{array} { r l } & { \widehat { R } ( h ) - R ( h ) = \operatorname* { i n f } _ { \lambda \geq 0 } \{ \lambda \epsilon + \mathbf { E } _ { \widehat { P } _ { X } } \left[ r _ { \lambda } ( h , X ) \right] \} - \operatorname* { i n f } _ { \lambda \geq 0 } \{ \lambda \epsilon + \mathbf { E } _ { P _ { X } } \left[ r _ { \lambda } ( h , X ) \right] \} } \\ & { \qquad = \operatorname* { i n f } _ { \lambda \geq 0 } \{ \lambda \epsilon + \mathbf { E } _ { \widehat { P } _ { X } } \left[ r _ { \lambda } ( h , X ) \right] \} - \lambda _ { * } \epsilon - \mathbf { E } _ { \widehat { P } _ { X } } \left[ r _ { \lambda _ { * } } ( h , X ) \right] } \\ & { \qquad \leq \mathbf { E } _ { \widehat { P } _ { X } } \left[ r _ { \lambda _ { * } } ( h , X ) \right] \} - \mathbf { E } _ { P _ { X } } \left[ r _ { \lambda _ { * } } ( h , X ) \right] , } \end{array}
|
| 438 |
+
$$
|
| 439 |
+
|
| 440 |
+
where $\begin{array} { r } { \lambda _ { * } \in \arg \operatorname* { m i n } _ { \lambda \geq 0 } \lambda \epsilon + \mathbf { E } _ { P _ { X } } \left[ r _ { \lambda } ( h , X ) \right] } \end{array}$ . The infimum is attained because
|
| 441 |
+
|
| 442 |
+
$$
|
| 443 |
+
\begin{array} { r } { \operatorname* { i n f } _ { \lambda \ge 0 } \{ \lambda \epsilon + \mathbf { E } _ { P _ { X } } \left[ r _ { \lambda } ( h , X ) \right] \} } \end{array}
|
| 444 |
+
$$
|
| 445 |
+
|
| 446 |
+
is an strictly feasible (infinite-dimensional) linear optimization problem (see proof of Theorem 2.4). To bound $\lambda _ { * }$ , we observe that $r _ { \lambda } ( h , X ) \ge 0$ for any $h \in { \mathcal { H } } , \lambda \geq 0$ :
|
| 447 |
+
|
| 448 |
+
$$
|
| 449 |
+
\begin{array} { r l } & { r _ { \lambda } ( h , X ) = \operatorname* { s u p } _ { x ^ { \prime } \in { \mathcal { X } } } \{ d _ { { \mathcal { V } } } ( h ( X ) , h ( x ^ { \prime } ) ) - \lambda d _ { { \mathcal { X } } } ( X , x ^ { \prime } ) \} } \\ & { \qquad \geq d _ { { \mathcal { V } } } ( h ( X ) , h ( X ) ) - \lambda d _ { { \mathcal { X } } } ( X , X ) . } \end{array}
|
| 450 |
+
$$
|
| 451 |
+
|
| 452 |
+
This implies
|
| 453 |
+
|
| 454 |
+
$$
|
| 455 |
+
R ( h ) = \lambda _ { * } \epsilon + \mathbb { E } _ { P _ { X } } \left[ r _ { \lambda _ { * } } ( h , X ) \right] \geq \lambda _ { * } \epsilon .
|
| 456 |
+
$$
|
| 457 |
+
|
| 458 |
+
We rearrange to obtain a bound on $\lambda _ { * }$ :
|
| 459 |
+
|
| 460 |
+
$$
|
| 461 |
+
\lambda _ { * } \leq \frac { 1 } { \epsilon } R ( h ) \leq \frac { 1 } { \epsilon } D _ { \mathscr { y } } \triangleq \bar { \lambda } .
|
| 462 |
+
$$
|
| 463 |
+
|
| 464 |
+
This is admittedly a crude bound, but it is good enough here. Similarly,
|
| 465 |
+
|
| 466 |
+
$$
|
| 467 |
+
R ( h ) - \widehat { R } ( h ) \leq { \bf E } _ { P _ { X } } \left[ r _ { \widehat { \lambda } _ { * } } ( h , X ) \right] \} - { \bf E } _ { \widehat { P } _ { X } } \left[ r _ { \widehat { \lambda } _ { * } } ( h , X ) \right] ,
|
| 468 |
+
$$
|
| 469 |
+
|
| 470 |
+
where $\begin{array} { r } { \widehat { \lambda } _ { * } \in \arg \operatorname* { m i n } _ { \lambda \geq 0 } \lambda \epsilon + \mathbf { E } _ { \widehat { P } _ { X } } \left[ r _ { \lambda } ( h , X ) \right] } \end{array}$ , and $\widehat { \lambda } _ { * } \leq \bar { \lambda }$ . Combining (A.2) and (A.4), we obtain
|
| 471 |
+
|
| 472 |
+
$$
|
| 473 |
+
\begin{array} { r } { | \widehat { R } ( h ) - R ( h ) | \leq \operatorname* { s u p } _ { f \in \mathcal { F } } \big | \mathbf { E } _ { \widehat { P } } \big [ f ( Z ) \big ] - \mathbf { E } _ { P } \big [ f ( Z ) \big ] \big | , } \end{array}
|
| 474 |
+
$$
|
| 475 |
+
|
| 476 |
+
where $\mathcal { F } \triangleq \{ r _ { \lambda } ( h , \cdot ) \ | \ h \in \mathcal { H } , \lambda \in [ 0 , \bar { \lambda } ] \}$ . It is possible to bound $\begin{array} { r } { \operatorname* { s u p } _ { f \in \mathcal { F } } | \mathbf { E } _ { \widehat { P } } \big [ f ( Z ) \big ] - \mathbf { E } _ { P } \big [ f ( Z ) \big ] | } \end{array}$ bwith results from statistical learning theory. First, we observe that the functions in $\mathcal { F }$ are bounded:
|
| 477 |
+
|
| 478 |
+
$$
|
| 479 |
+
0 \leq r _ { \lambda } ( h , X ) \leq \frac { 1 } { \epsilon } \operatorname* { s u p } _ { y , y ^ { \prime } \in \mathcal { V } } d _ { \mathcal { V } } ( y , y ^ { \prime } ) .
|
| 480 |
+
$$
|
| 481 |
+
|
| 482 |
+
Thus $\begin{array} { r } { \operatorname* { s u p } _ { f \in \mathcal { F } } \left| \mathbf { E } _ { \widehat { P } } \big [ f ( Z ) \big ] - \mathbf { E } _ { P } \left[ f ( Z ) \right] \right| } \end{array}$ has bounded differences inequality, so it concentrates sharply baround its expectation. By the bounded-differences inequality and a standard symmetrization argument,
|
| 483 |
+
|
| 484 |
+
$$
|
| 485 |
+
\begin{array} { r } { \operatorname* { s u p } _ { f \in \mathcal { F } } \big | \mathbf { E } _ { \widehat { P } } \big [ f ( Z ) \big ] - \mathbf { E } _ { P } \big [ f ( Z ) \big ] \big | \leq 2 \Re _ { n } ( \mathcal { F } ) + D _ { \mathcal { V } } ( \frac { \log \frac { 2 } { t } } { 2 n } ) ^ { \frac { 1 } { 2 } } } \end{array}
|
| 486 |
+
$$
|
| 487 |
+
|
| 488 |
+
with probability at least $1 - t$ , where $\Re _ { n } ( \mathcal { F } )$ is the Rademacher complexity of $\mathcal { F }$
|
| 489 |
+
|
| 490 |
+
$$
|
| 491 |
+
\begin{array} { r } { \mathfrak { R } _ { n } ( \mathcal { F } ) = \mathbf { E } \big [ \operatorname* { s u p } _ { f \in \mathcal { F } } \frac { 1 } { n } \sum _ { i = 1 } ^ { n } \sigma _ { i } f ( Z _ { i } ) \big ] . } \end{array}
|
| 492 |
+
$$
|
| 493 |
+
|
| 494 |
+
It remains to study $\textstyle { \frac { 1 } { n } } \sum _ { i = 1 } ^ { n } \sigma _ { i } f ( Z _ { i } )$ n is sub-Gaussian with respect to to the metric . First, we show that the -indexed Rademacher process $X _ { f }$ ,
|
| 495 |
+
|
| 496 |
+
$$
|
| 497 |
+
\begin{array} { r l } & { | \mathcal { F } \big ( ( h _ { 1 } , \lambda _ { 1 } ) , ( h _ { 2 } , \lambda _ { 2 } ) \big ) \triangleq \operatorname* { s u p } _ { x _ { 1 } , x _ { 2 } \in \mathcal { X } } \big | d y \big ( h _ { 1 } ( x _ { 1 } ) , h _ { 1 } ( x _ { 2 } ) \big ) - d y \big ( h _ { 2 } ( x _ { 1 } ) , h _ { 2 } ( x _ { 2 } ) \big ) \big | + D _ { \mathcal { X } } \big | \lambda _ { 1 } - \lambda _ { 1 } \big | : } \\ & { \mathrm { \Lambda } \mathrm { \Lambda } } \\ & { = \mathbf { E } \big [ \mathrm { e x p } ( t ( X _ { f _ { 1 } } - X _ { f _ { 2 } } ) \big ) \big ] } \\ & { \quad = \mathbf { E } \big [ \mathrm { e x p } \big ( \frac { t } { n } \sum _ { i = 1 } ^ { n } \sigma _ { i } ( r _ { \lambda _ { 1 } } ( h _ { 1 } , X _ { i } ) - r _ { \lambda _ { 2 } } ( h _ { 2 } , X _ { i } ) \big ) \big ) \big ] } \\ & { \quad = \mathbf { E } \big [ \mathrm { e x p } \big ( \frac { t } { n } \sigma ( r _ { \lambda _ { 1 } } ( h _ { 1 } , X _ { i } ) - r _ { \lambda _ { 2 } } ( h _ { 2 } , X _ { i } ) ) \big ) \big ) \big ] ^ { n } } \\ & { \quad = \mathbf { E } \big [ \mathrm { e x p } \Big ( \frac { t } { n } \sigma ( \operatorname* { s u p } _ { x _ { 1 } ^ { \prime } \in \mathcal { X } } \operatorname { i n f } _ { x _ { 2 } ^ { \prime } \in \mathcal { X } } d y \big ( h _ { 1 } ( X _ { i } ) , h _ { 1 } ( x _ { 1 } ^ { \prime } ) \big ) - \lambda _ { 1 } d _ { \mathcal { X } } ( x _ { 1 } , X ) - d _ { \mathcal { V } } ( h _ { 2 } ( X _ { i } ) , h _ { 2 } ( x _ { 2 } ^ { \prime } ) ) + \lambda _ { 2 } } \\ & \quad \leq \mathbf { E } \big [ \mathrm { e x p } \big ( \frac { t } { n } \sigma ( \operatorname* { s u p } _ { x _ { 1 } \in \mathcal { X } } d y \big ( h _ { 1 } ( X _ { i } ) , h _ { 1 } ( x _ { 1 } ^ { \prime } ) \big ) - d y \big ( h _ { 2 } ( X _ { i } ) , h _ { 2 } ( x \end{array}
|
| 498 |
+
$$
|
| 499 |
+
|
| 500 |
+
Let $N ( \mathcal { F } , d _ { \mathcal { F } } , \epsilon )$ be the $\epsilon$ -covering number of $\mathcal { F }$ in the $d _ { \mathcal { F } }$ metric. We observe
|
| 501 |
+
|
| 502 |
+
$$
|
| 503 |
+
\begin{array} { r } { N ( \mathcal { F } , d _ { \mathcal { F } } , \epsilon ) \leq N ( \mathcal { D } , \| \cdot \| _ { \infty } , \frac { \epsilon } { 2 } ) \cdot N ( [ 0 , \bar { \lambda } ] , | \cdot | , \frac { \epsilon } { 2 D _ { \mathcal { X } } } ) . } \end{array}
|
| 504 |
+
$$
|
| 505 |
+
|
| 506 |
+
By Dudley’s entropy integral,
|
| 507 |
+
|
| 508 |
+
$$
|
| 509 |
+
\begin{array} { l } { \displaystyle \mathfrak { R } _ { n } ( \mathcal { F } ) \leq \frac { 1 2 } { \sqrt { n } } \int _ { 0 } ^ { \infty } \log N ( \mathcal { F } , d _ { \mathcal { F } } , \epsilon ) ^ { \frac { 1 } { 2 } } d \epsilon } \\ { \displaystyle \quad \leq \frac { 1 2 } { \sqrt { n } } \int _ { 0 } ^ { \infty } \left( \log N ( \mathcal { D } , \| \cdot \| _ { \infty } , \frac { \epsilon } { 2 } ) + N \big ( [ 0 , \bar { \lambda } ] , | \cdot | , \frac { \epsilon } { 2 D x } \big ) \right) ^ { \frac { 1 } { 2 } } d \epsilon } \\ { \displaystyle \quad \leq \frac { 1 2 } { \sqrt { n } } \left( \int _ { 0 } ^ { \infty } \log N ( \mathcal { D } , \| \cdot \| _ { \infty } , \frac { \epsilon } { 2 } ) ^ { \frac { 1 } { 2 } } d \epsilon + \int _ { 0 } ^ { \infty } N \big ( [ 0 , \bar { \lambda } ] , | \cdot | , \frac { \epsilon } { 2 D x } \big ) ^ { \frac { 1 } { 2 } } d \epsilon \right) } \\ { \displaystyle \quad \leq \frac { 2 4 J ( \mathcal { D } ) } { \sqrt { n } } + \frac { 2 4 D _ { x } \bar { \lambda } } { \sqrt { n } } \int _ { 0 } ^ { \frac { 1 } { 2 } } \log ( \frac { 1 } { \epsilon } ) d \epsilon . } \end{array}
|
| 510 |
+
$$
|
| 511 |
+
|
| 512 |
+
We check that $\begin{array} { r } { \int _ { 0 } ^ { \frac { 1 } { 2 } } \log ( \frac { 1 } { \epsilon } ) d \epsilon < 1 } \end{array}$ to arrive at Theorem 3.1.
|
| 513 |
+
|
| 514 |
+
The chief technical novelty of this proof is the bound on $\lambda _ { * }$ in terms of the diameter of the output space. This bound allows us to restrict the relevant function class in a way that allows us to appeal to standard techniques from empirical process theory to obtain uniform convergence results. In prior work (e.g. Lee & Raginsky (2017)), this bound relies on smoothness properties of the loss, but this precludes non-smooth $d _ { \mathcal { Y } }$ in our problem setting.
|
| 515 |
+
|
| 516 |
+
Corollary A.5. Assume there is $h _ { 0 } \in \mathcal { H }$ such that $L ( h _ { 0 } ) + \rho R ( h _ { 0 } ) < \delta _ { 0 }$ . As long as $D _ { \mathcal { X } } , D _ { \mathcal { Y } } , J ( \mathcal { L } )$ , and $J ( { \mathcal { G } } )$ are all finite, any global minimizer $\begin{array} { r } { \widehat { h } \in \arg \operatorname* { m i n } _ { h \in \mathcal { H } } \widehat { L } ( h ) + \rho \widehat { R } ( h ) } \end{array}$ satisfies
|
| 517 |
+
|
| 518 |
+
$$
|
| 519 |
+
L ( \hat { h } ) + \rho R ( \hat { h } ) \leq \delta _ { 0 } + 2 \left( \frac { 2 4 J ( \mathcal { L } ) + 4 8 \rho ( J ( \mathcal { D } ) + \frac { 1 } { \epsilon } D x D y ) } { \sqrt { n } } + ( \bar { L } + \rho D y ) ( \frac { \log \frac { 2 } { t } } { 2 n } ) ^ { \frac { 1 } { 2 } } \right)
|
| 520 |
+
$$
|
| 521 |
+
|
| 522 |
+
with probability at least $1 - 2 t$ .
|
| 523 |
+
|
| 524 |
+
Proof. Let $F ( h ) \triangleq L ( h ) + \rho R ( h )$ and $\widehat F$ be its empirical counterpart. The optimality of $\hat { h }$ implies
|
| 525 |
+
|
| 526 |
+
$$
|
| 527 |
+
\begin{array} { r } { { \boldsymbol { \mathcal { F } } } ( \widehat { h } ) = F ( \widehat { h } ) - \widehat { F } ( \widehat { h } ) + \widehat { F } ( \widehat { h } ) - \widehat { F } ( h _ { 0 } ) + \widehat { F } ( h _ { 0 } ) - F ( h _ { 0 } ) + F ( h _ { 0 } ) \le \delta _ { 0 } + 2 \operatorname* { s u p } _ { h \in \mathcal { H } } \vert \widehat { F } ( h ) - F ( h ) \vert . } \end{array}
|
| 528 |
+
$$
|
| 529 |
+
|
| 530 |
+
We have
|
| 531 |
+
|
| 532 |
+
$$
|
| 533 |
+
\begin{array} { r } { \operatorname* { s u p } _ { h \in \mathcal { H } } | \widehat { F } ( h ) - F ( h ) | \leq \operatorname* { s u p } _ { h \in \mathcal { H } } | \widehat { L } ( h ) - L ( h ) | + \rho \operatorname* { s u p } _ { h \in \mathcal { H } } | \widehat { R } ( h ) - R ( h ) | . } \end{array}
|
| 534 |
+
$$
|
| 535 |
+
|
| 536 |
+
We assumed $\ell$ is bounded, so $\begin{array} { r } { \operatorname* { s u p } _ { h \in \mathcal { H } } | \widehat { L } ( h ) - L ( h ) | } \end{array}$ has bounded differences inequality, so it concentrates sharply around its expectation. By the bounded-differences inequality and a standard symmetrization argument,
|
| 537 |
+
|
| 538 |
+
$$
|
| 539 |
+
\operatorname* { s u p } _ { h \in \mathcal { H } } | \widehat { L } ( h ) - L ( h ) | \leq 2 \Re _ { n } ( \mathcal { L } ) + \bar { L } ( \frac { \log \frac { 2 } { t } } { 2 n } ) ^ { \frac { 1 } { 2 } }
|
| 540 |
+
$$
|
| 541 |
+
|
| 542 |
+
with probability at least $1 - t$ , where $\Re _ { n } ( \mathcal { L } )$ is the Rademacher complexity of $\mathcal { L }$ . By Dudley’s entropy integral,
|
| 543 |
+
|
| 544 |
+
$$
|
| 545 |
+
\Re _ { n } ( { \mathcal { L } } ) \leq { \frac { 1 2 } { \sqrt { n } } } \int _ { 0 } ^ { \infty } \log N ( { \mathcal { L } } , \| \cdot \| _ { \infty } , \epsilon ) ^ { \frac { 1 } { 2 } } d \epsilon ,
|
| 546 |
+
$$
|
| 547 |
+
|
| 548 |
+
so the first term on the right side of (A.6) is at most
|
| 549 |
+
|
| 550 |
+
$$
|
| 551 |
+
\operatorname* { s u p } _ { h \in \mathcal { H } } | \widehat { L } ( h ) - L ( h ) | \leq \frac { 2 4 J ( \mathcal { L } ) } { \sqrt { n } } + \bar { L } ( \frac { \log \frac { 2 } { t } } { 2 n } ) ^ { \frac { 1 } { 2 } }
|
| 552 |
+
$$
|
| 553 |
+
|
| 554 |
+
with probability at least $1 - t$ . Theorem 3.1 implies the second term on the right side of (A.6) is at most
|
| 555 |
+
|
| 556 |
+
$$
|
| 557 |
+
\operatorname* { s u p } _ { h \in \mathcal { H } } | \widehat { R } ( h ) - R ( h ) | \leq \frac { 4 8 ( J ( \mathcal { D } ) + \frac { 1 } { \epsilon } D _ { \mathcal { X } } D _ { \mathcal { Y } } ) } { \sqrt { n } } + D _ { \mathcal { Y } } ( \frac { \log \frac { 2 } { t } } { 2 n } ) ^ { \frac { 1 } { 2 } }
|
| 558 |
+
$$
|
| 559 |
+
|
| 560 |
+
with probability at least $1 - t$ . We combine the bounds to arrive at the stated result.
|
| 561 |
+
|
| 562 |
+
# B SENSEI AND BASELINES IMPLEMENTATION DETAILS
|
| 563 |
+
|
| 564 |
+
In this section we describe implementation details of all methods and hyperparameter selection to facilitate reproducibility of the experimental results reported in the main text.
|
| 565 |
+
|
| 566 |
+
Improving balanced accuracy All three datasets we consider have noticeable class imbalances: over $80 \%$ comments in toxicity classification are non-toxic; several occupations in the Bias in Bios dataset are scarcely present (see Figure 1 in De-Arteaga et al. (2019) for details); about $7 5 \%$ of individuals in the Adult dataset make below $\$ 50\mathrm { k }$ a year. Because of this class imbalance we choose to report balanced accuracy to quantify classification performance of different methods. Balanced accuracy is simply an average of true positive rates of all classes. To improve balanced accuracy for all methods we use balanced mini-batches following Yurochkin et al. (2020), i.e. when sampling a mini-batch we enforce that every class is equally represented.
|
| 567 |
+
|
| 568 |
+
Fair regularizer distance metric Recall that fair regularizer in Definition 2.1 of the main text requires selecting a distance metric on the classifier outputs $d y ( h ( x ) , h ( x ^ { \prime } ) )$ . This distance is also required for the implementation of Counterfactual Logit Pairing (CLP) (Garg et al., 2018). In a $K$ -class problem, let $h ( x ) \in \mathbf { R } ^ { K }$ denote a vector of $K$ logits of a classifier for an observation $x$ then for both SenSeI and CLP we define $\begin{array} { r } { d _ { \mathcal { V } } ( h ( x ) , h ( x ^ { \prime } ) ) \stackrel { = } { = } \frac { 1 } { K } \| h ( x ) - h ( x ^ { \prime } ) \| _ { 2 } ^ { 2 } } \end{array}$ , i.e. mean squared difference between logits of $x$ and $x ^ { \prime }$ . This is one of the choices empirically studied by Yang et al. (2019) for image classification. We defer exploring alternative fairness regularizer distance metrics for future work.
|
| 569 |
+
|
| 570 |
+
Data processing and classifier architecture Data processing and classifier are shared across all methods in all experiments. In Toxicity experiment we utilized BERT (Devlin et al., 2018) finetuned on a random $33 \%$ subset of the data. We downloaded the fine-tuned model from one of the Kaggle kernels.1 In the Bios experiment for each train-test split we fine-tuned BERT-Base, Uncased2 for 3 epochs with mini-batch size 32, learning rate 2e−5 and 128 maximum sequence length. In both Toxicity and Bios experiments we obtained 768-dimensional sentence representations by average-pooling token embeddings of the corresponding fined-tuned BERTs. Then we trained a fully connected neural network with one hidden layer consisting of 2000 neurons with ReLU activations using BERT sentence representations as inputs.
|
| 571 |
+
|
| 572 |
+
For Adult experiment we followed data processing and classifier choice (i.e. 100 hidden units neural network) as described in Yurochkin et al. (2020).
|
| 573 |
+
|
| 574 |
+
Hyperparameters selection In Table 4 for each hyperparameter we summarize its meaning, abbreviation, name in the code provided with the submission3 and methods where it is used.
|
| 575 |
+
|
| 576 |
+
To select hyperparameters for each experiment we performed a grid search on an independent train-test split. Then we fixed selected hyperparameters and ran 10 experiment repetitions with random train test splits (these results are reported in the main text). Hyperparameter choices for all experiments are summarized in Tables 5, 6, 7. For the Adult experiment we duplicated results for all prior methods from Yurochkin et al. (2020).
|
| 577 |
+
|
| 578 |
+
Table 4: Hyperparameter names and notations
|
| 579 |
+
|
| 580 |
+
<table><tr><td></td><td>notation</td><td>name in code</td><td>relevant methods</td></tr><tr><td>Number of optimization steps</td><td>E</td><td>epoch</td><td>All</td></tr><tr><td>Mini-batch size</td><td>B</td><td>batch_size</td><td>All</td></tr><tr><td>Parameter learning rate n</td><td>n</td><td>lr</td><td>All</td></tr><tr><td>Subspace attack step size</td><td>S</td><td>adv_step</td><td>SenSeI, SenSR</td></tr><tr><td>Number of subspace attack steps</td><td>se</td><td>adv_epoch</td><td>SenSeI, SenSR</td></tr><tr><td>Full attack step size</td><td>f</td><td>l2_attack</td><td>SenSeI, SenSR</td></tr><tr><td>Number of full attack steps</td><td>fe</td><td>adv_epoch_full</td><td>SenSeI, SenSR</td></tr><tr><td>Attack budget E</td><td>E</td><td>ro</td><td>SenSeI, SenSR</td></tr><tr><td>Fair regularization strength p</td><td>p</td><td>fair_reg</td><td>SenSeI, CLP</td></tr></table>
|
| 581 |
+
|
| 582 |
+
Table 5: Hyperparameter choices in Toxicity experiment
|
| 583 |
+
|
| 584 |
+
<table><tr><td></td><td>E</td><td>B</td><td>m</td><td>S</td><td>se</td><td>S</td><td>fe</td><td>E</td><td>p</td></tr><tr><td>Baseline</td><td>100k</td><td>256</td><td>1e-5</td><td>一</td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>SenSR</td><td>100k</td><td>256</td><td>1e-5</td><td>0.1</td><td>10</td><td>0</td><td>0</td><td>0</td><td></td></tr><tr><td>SenSeI</td><td>100k</td><td>256</td><td>1e-5</td><td>0.1</td><td>10</td><td>0</td><td>0</td><td>0</td><td>5</td></tr><tr><td>CLP</td><td>100k</td><td>256</td><td>1e-5</td><td>一</td><td></td><td></td><td></td><td>一</td><td>5</td></tr></table>
|
| 585 |
+
|
| 586 |
+
Table 6: Hyperparameter choices in Bios experiment
|
| 587 |
+
|
| 588 |
+
<table><tr><td></td><td>E</td><td>B</td><td>n</td><td>S</td><td>se</td><td>S</td><td>fe</td><td>E</td><td>p</td></tr><tr><td>Baseline</td><td>100k</td><td>504</td><td>1e-6</td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>SenSR</td><td>100k</td><td>504</td><td>1e-5</td><td>0.1</td><td>50</td><td>0.01</td><td>10</td><td>0.1</td><td></td></tr><tr><td>SenSeI</td><td>100k</td><td>504</td><td>1e-5</td><td>0.1</td><td>50</td><td>0.01</td><td>10</td><td>0.1</td><td>5</td></tr><tr><td>CLP</td><td>100k</td><td>504</td><td>1e-5</td><td>一</td><td></td><td>一</td><td></td><td>一</td><td>5</td></tr></table>
|
| 589 |
+
|
| 590 |
+
Table 7: Hyperparameter choices in Adult experiment
|
| 591 |
+
|
| 592 |
+
<table><tr><td></td><td>E</td><td>B</td><td>n</td><td>S</td><td>se</td><td>f</td><td>fe</td><td>E</td><td>p</td></tr><tr><td>SenSeI</td><td>200k</td><td>1000</td><td>1e-5</td><td>5</td><td>50</td><td>0.001</td><td>50</td><td>0.01</td><td>40</td></tr></table>
|
| 593 |
+
|
| 594 |
+
# B.1 FAIR METRIC LEARNING DETAILS
|
| 595 |
+
|
| 596 |
+
Following Yurochkin et al. (2020); Mukherjee et al. (2020) we consider the fair metric of the form $d _ { \mathcal { X } } ( x , x ^ { \prime } ) \overset { } { = } ( x - x ^ { \prime } ) ^ { T } \Sigma ( x - x ^ { \prime } )$ . We utilize their sensitive subspace idea writing $\Sigma = I - P _ { r a n ( A ) }$ i.e. an orthogonal complement projector of the subspace spanned by the columns of $A \in \mathbb { R } ^ { d \times k }$ . Here $A$ encodes the $k$ directions of sensitive variations that should be ignored by the fair metric $d$ is the data dimension), such as differences in sentence embeddings due to gender pronouns in the Bios experiment or due to identity (counterfactual) tokens in the Toxicity experiment.
|
| 597 |
+
|
| 598 |
+
Synthetic experiment In the synthetic experiment in Figure 1 we consider a fair metric ignoring variation along the $x$ -axis coordinate, i.e. $\bar { A ^ { \mathbf { \alpha } } } = [ 1 \mathbf { \beta } 0 ] ^ { T }$ .
|
| 599 |
+
|
| 600 |
+
Toxicity experiment To compute $A$ we utilize FACE algorithm of Mukherjee et al. (2020) (see section 2.1 and Algorithm 1 in their paper). Here groups of comparable samples are the BERT embeddings of sentences from the train data and their modifications obtained using 25 counterfactuals known at the training time. For example, suppose we have a sentence “Some people are gay” in the train data and the list of known counterfactuals is “gay”, “straight” and “muslim”. Then we can obtain two comparable sentences: “Some people are straight” and “Some people are muslim”. BERT embeddings of the original and two created sentences constitute a group of comparable sentences. Embeddings of groups of comparable sentences are the inputs to Algorithm 1 of Mukherjee et al. (2020), which consists of a per-group centering step followed by a singular value decomposition. Taking the top $k = 2 5$ singular vectors gives us matrix of sensitive directions $A$ defining the fair metric.
|
| 601 |
+
|
| 602 |
+
Bios experiment We again utilize FACE algorithm of Mukherjee et al. (2020) to obtain the fair metric. Here the counterfactual modification is based on male and female gender pronouns. For example, sentence “He went to law school” is modified to “She went to law school”. As a result, each group of comparable samples consists of a pair of bios (original and modified). Let $\ b { X } \in \mathbb { R } ^ { n \times d }$ be the data matrix of BERT embeddings of the $n$ train bios, and let $X ^ { \prime } \in \mathbb { R } ^ { n \times d }$ be the corresponding modified bios. Here Algorithm 1 of Mukherjee et al. (2020) is equivalent to performing SVD on $X - X ^ { \prime }$ . We take the top $k = 2 5$ singular vectors to obtain sensitive directions $A$ and the corresponding fair metric.
|
| 603 |
+
|
| 604 |
+
Adult experiment In this experiment $A$ consists of three vectors: a vector of zeros with 1 in the gender coordinate; a vector of zeros with 1 in the race coordinate; and a vector of logistic regression coefficients trained to predict gender using the remaining features (and 0 in the gender coordinate). This sensitive subspace construction replicates the approach Yurochkin et al. (2020) utilized in their Adult experiment for obtaining the fair metric. Please see Appendix B.1 and Appendix $\mathrm { D }$ in their paper for additional details.
|
| 605 |
+
|
| 606 |
+
# C FAIRNESS EVALUATION METRICS DEFINITIONS
|
| 607 |
+
|
| 608 |
+
Individual fairness To compare individual fairness we used two metrics: prediction consistency and Counterfactual Token Fairness (CTF) score of Garg et al. (2018). The idea behind these metrics is to quantify changes in prediction when modifying original data in ways that intuitively should not change behavior of an individually fair classifier.
|
| 609 |
+
|
| 610 |
+
For Toxicity experiment an individually fair classifier should not change its prediction when a word “gay” in a comment is replaced with a word “straight”. For example, we expect toxicity predictions on “Some people are gay” and “Some people are straight” to be the same. Following prior work (Dixon et al., 2018; Garg et al., 2018) we considered a set of 50 tokens4 that should not affect the classifier when interchanged. For any comment that contains at least one of these 50 tokens we can create 49 versions of it via a simple word replacement and evaluate classifier prediction and probability of being toxic for each of the 50 variations (including the original). Prediction consistency is the proportion of comments (with at least one of the 50 tokens) where prediction is the same on all 50 variations. CTF score is the average (across all comments with at least one of the 50 tokens) standard deviation of the toxicity probability across 50 variations.
|
| 611 |
+
|
| 612 |
+
We use similar individual fairness metrics for the Bios experiment. We create a single variation of each bio by interchanging “he” and “she”; “his” and “her”; “him” and “hers”; “himself” and “herself”; “mr” and “ms” or “mrs”; original name with a random name from a different gender sampled among those present in the data. Prediction consistency is computed as before using 2 variations (including the original one) of each bio. Note that although there are fewer variations, there are significantly more classes in the Bios dataset. CTF score in the average (across all bios) squared Euclidean distance between the vectors of class probabilities for the 2 bio variations.
|
| 613 |
+
|
| 614 |
+
In the Adult experiment we compute same individual fairness metrics as in Yurochkin et al. (2020). S-Con. (spouse consistency) is the prediction consistency when creating data variations by altering marital status feature. GR-Con. (gender and race consistency) is the prediction consistency when creating data variations by altering race and gender features.
|
| 615 |
+
|
| 616 |
+
Group fairness In our experiments we observed that enforcing individual fairness also has positive effect on group fairness metrics.
|
| 617 |
+
|
| 618 |
+
In the Toxicity experiment we used accuracy parity (Zafar et al., 2017; Zhao et al., 2019) to quantify group fairness. There are multiple protected groups in the Toxicity dataset (e.g. “muslim”, “white”, “black”, “homosexual or lesbian”) that correspond to human annotated identity contexts (not necessarily mutually exclusive). To account for this when evaluating accuracy parity we computed accuracies for each of the protected groups and reported their standard deviation. Large standard deviation implies that classifier is significantly more accurate on some protected groups than on the others. Because of the class imbalance we also reported standard deviation of the corresponding balanced accuracies.
|
| 619 |
+
|
| 620 |
+
For the Bios experiment we used same group fairness metrics as in the prior works studying this dataset (Romanov et al., 2019; Prost et al., 2019). Here protected attribute is binary: male or female genders. Let $\mathrm { T P R } _ { 0 , k }$ and $\mathrm { T P R } _ { 1 , k }$ denote true positive rates for class $k$ for protected attributes 0 and 1. Then TPR gap for class $k$ is $\mathrm { G a p } _ { k } = | \mathrm { T P R } _ { 0 , k } - \mathrm { T P R } _ { 1 , k } |$ . The summary statistics we report are Gap $\begin{array} { r } { \mathrm { R M S } = \sqrt { \frac { 1 } { K } \sum _ { k } \mathrm { G a p } _ { k } ^ { 2 } } } \end{array}$ and $\begin{array} { r } { \mathrm { G a p \ A B S } = \frac { 1 } { K } \sum _ { k } \mathrm { G a p } _ { k } . } \end{array}$ .
|
| 621 |
+
|
| 622 |
+
For the Adult experiment we used same group fairness metrics as in Yurochkin et al. (2020), which correspond to Gap RMS described above and Gap $\mathbf { M A X } = \mathbf { m a x } _ { k } \mathbf { G a p } _ { k }$ , evaluated with respect to race and gender (both are binary protected attributes in the dataset).
|
| 623 |
+
|
| 624 |
+
# D ADDITIONAL FAIRNESS-ACCURACY TRADE-OFF RESULTS
|
| 625 |
+
|
| 626 |
+
Synthetic data experiment In Figure 1 we demonstrated how SenSeI allows to control fairnessaccuracy trade-off in simulations by plotting the decision boundary of the corresponding classifier for varying $\rho$ . In Figure 3 we show the lack of such flexibility in SenSR (Yurochkin et al., 2020): varying the radius of the DRO ball $\epsilon$ in their definition of individual fairness results in a horizontal decision boundary even for $\epsilon = 0$ . SenSR ties loss to fairness in its objective, and in this experiment loss can be increased significantly for anything but a horizontal decision boundary (fair metric allows free movement along the $\mathbf { X }$ -axis and a data-point can be perturbed in horizontal direction even for $\epsilon = 0$ ).
|
| 627 |
+
|
| 628 |
+

|
| 629 |
+
Figure 3: The decision surface of a one hidden layer neural network trained with SenSR (Yurochkin et al., 2020) as the DRO radius $\epsilon$ varies. Problem setting is the same as in Figure 1. Even for $\epsilon = 0$ , SenSR prioritizes fairness over accuracy producing a horizontal decision surface. It is unable to achieve intermediate behaviors of SenSeI trading accuracy and fairness as in Figure 1 (a,b,c).
|
| 630 |
+
|
| 631 |
+
Toxicity and Bios experiments In Figure 2 we presented trade-offs between prediction consistency and balanced accuracy for SenSeI and CLP (Garg et al., 2018) for the Toxicity and Bios experiments. For completeness we also present corresponding CTF score and balanced accuracy trade-offs in Figure 4. As with the prediction consistency, we see that increasing fair regularization strength $\rho$ allows to train classifiers with better individual fairness properties. SenSeI outperforms CLP as it trains classifiers with lower CTF score across all values of $\rho$ .
|
| 632 |
+
|
| 633 |
+

|
| 634 |
+
Figure 4: Balanced accuracy (BA) and CTF score trade-off on Toxicity and Bios experiments
|
md/train/H1gpET4YDB/H1gpET4YDB.md
ADDED
|
@@ -0,0 +1,283 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BLOCKWISE SELF-ATTENTION FOR LONG DOCUMENT UNDERSTANDING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We present BlockBERT, a lightweight and efficient BERT model that is designed to better modeling long-distance dependencies. Our model extends BERT by introducing sparse block structures into the attention matrix to reduce both memory consumption and training time, which also enables attention heads to capture either short- or long-range contextual information. We conduct experiments on several benchmark question answering datasets with various paragraph lengths. Results show that BlockBERT uses $1 8 . 7 \substack { - 3 6 . 1 \% }$ less memory and reduces the training time by $1 2 . 0 { - } 2 5 . 1 \%$ , while having comparable and sometimes better prediction accuracy, compared to an advanced BERT-based model, RoBERTa.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Recent emergence of the pre-training and fine-tuning paradigm, exemplified by methods like ELMo (Peters et al., 2018), GPT-2 (Radford et al., 2019), BERT (Devlin et al., 2019), XLNet (Yang et al., 2019) and RoBERTa (Liu et al., 2019), has drastically reshaped the landscape of the natural language processing research. These methods first pre-train a deep model with language model objectives using a large corpus and then fine-tune the model using in-domain supervised data for target applications. Despite its conceptual simplicity, this paradigm has reestablished the new state-ofthe-art baselines across various tasks, such as question answering (Devlin et al., 2019), coreference resolution (Joshi et al., 2019b), relation extraction (Soares et al., 2019) and text retrieval (Lee et al., 2019; Nogueira & Cho, 2019), to name a few.
|
| 12 |
+
|
| 13 |
+
Building such models in practice, however, is an extremely resource-intensive process. For instance, the training of BERT-family models is notoriously expensive. Devlin et al. (2019) report that it takes four days for pre-training BERT-Base/BERT-Large on 4/16 Cloud TPUs, respectively. In order to reduce the pre-training time of RoBERTa to 1 day, Liu et al. (2019) use 1,024 V100 GPUs. One crucial factor that contributes to the long training time is the memory consumption of these deep models, as it directly affects the batch size. Although the fine-tuning stage is relatively inexpensive, the memory issue still restricts the scenarios in which BERT can be used. For instance, “it is currently not possible to re-produce most of the BERT-Large results on the paper using a GPU with 12GB-16GB of RAM, because the maximum batch size that can fit in memory is too small.1”
|
| 14 |
+
|
| 15 |
+
Although one may think that model size is the main contributor to the large memory consumption, our analysis (Section 2.1) shows that one of the main bottlenecks is actually dot-product selfattention, operated in multiple layers of Transformers (Vaswani et al., 2017), the building block of BERT. As the attention operation is quadratic to the sequence length, this fundamentally limits the maximum length of the input sequence, and thus restricts the model capacity in terms of capturing long-distance dependencies. As a result, downstream tasks have to either truncate their sequences to leading tokens (Nogueira & Cho, 2019) or split their sequences with a sliding window (Joshi et al., 2019a;b). Ad-hoc handling of long sequences is also required in the pre-training stage, such as updating the model using only short sequences in the early stage (Devlin et al., 2019).
|
| 16 |
+
|
| 17 |
+
Common strategies for reducing memory consumption, unfortunately, do not work. For instance, shrinking the model by lowering the number of layers $L$ , attention heads $A$ , or hidden units $H$ leads to significant performance degradation (Vaswani et al., 2017; Devlin et al., 2019) and does not address the long sequence issue. Alternatively, general low-memory training techniques, such as microbatching (Huang et al., 2018) and gradient checkpointing (Chen et al., 2016) essentially trade off training time for memory consumption, prolongs the already lengthy training process.
|
| 18 |
+
|
| 19 |
+
In this work, we explore a different strategy, sparsifying the attention layers, intending to design a lightweight and effective BERT that can model long sequences in a memory-efficient way. Our BlockBERT extends BERT by introducing sparse block substructures into the attention matrix to reduce both memory consumption and the number of floating point operations (FLOPs), which also enables attention heads to capture either short- or long-range contextual information. Compared to the previous method that also enforces sparsity (e.g., Child et al. (2019)), our approach is much simpler mathematically and very easy to implement. More importantly, the results of experiments conducted on several benchmark question answering datasets with various paragraph lengths show that BlockBERT performs comparably or even better than the original BERT-family models, while enjoying an $1 8 . 7 \substack { - 3 6 . 1 \% }$ reduction in memory usage and $1 2 . 0 { - } 2 5 . 1 \%$ reduction in training time.
|
| 20 |
+
|
| 21 |
+
The rest of the paper is organized as follows. Section 2 gives a brief introduction of the BERT model, along with an in-depth analysis of its memory usage during training time. We describe our proposed model in Section 3 and contrast it with existing methods that aim for creating a lighter model. Section 4 presents the experimental results and ablation studies, followed by a short survey of other related work in Section 5 and the conclusion in Section 6.
|
| 22 |
+
|
| 23 |
+
# 2 BACKGROUND: MEMORY BOTTLENECK IN TRAINING BERT
|
| 24 |
+
|
| 25 |
+
We briefly review BERT and introduce its memory profiling in this section. Following the paradigm of language model pre-training and down-stream task fine-tuning, BERT (Devlin et al., 2019) consists of multiple layers of bidirectional Transformers (Vaswani et al., 2017), where each Transformer encoder has a multi-head self-attention layer and a position-wise feed-forward layer. Using the same notation as in (Devlin et al., 2019), we denote the number of Transformer layers by $L$ , the number of hidden units by $H$ , the number of attention heads by $A$ , the sequence length by $N$ and the batch size by $B$ . We also assume the feed-forward hidden unit size to be $4 H$ .2
|
| 26 |
+
|
| 27 |
+
# 2.1 MEMORY PROFILING
|
| 28 |
+
|
| 29 |
+
Training BERT is a memory-intensive process. In order to identify the bottleneck, we follow the memory model proposed by Sohoni et al. (2019), where the memory usage throughout neural network training is categorized into three main types: (1) Model Memory is used to store model parameters; (2) Optimizer Memory is the additional memory used by the specific learning algorithm during the process; (3) Activation Memory consists of the outputs of each layer, which are cached for reuse in backpropagation to compute gradients.
|
| 30 |
+
|
| 31 |
+
Take BERT-Base training as an example. The model has 110M parameters, so the model memory uses $0 . 2 \mathrm { \ G B }$ if stored in half-precision floating-point format (FP16). For Adam (Kingma & Ba, 2014), the optimizer needs additional memory to store the gradients, first moments, and second moments of model parameters. If stored using the same precision, the optimizer memory should be three times of model memory.3 To calculate the exact size of activation memory is not trivial because it depends heavily on the implementation of the toolkit. Instead, we measure it empirically by training BERT-Base using Adam with a memory profiler (more details are provided in Appendix A.2).
|
| 32 |
+
|
| 33 |
+
We use 32 NVIDIA V100 GPUs for training. Each single GPU thus consumes a mini-batch of size $b ~ = ~ B / 3 2 ~ = ~ 8 .$ . Figure 1a shows the profiling result for a single GPU, where the model/optimizer/activation memory consumes $0 . 2 1 / 1 . 0 3 / 8 . 4 9$ GB, resp. We can see that activation memory accounts for the vast majority of the total GPU memory $( 8 7 . 6 \% )$ and is clearly the bottleneck. Notice that although our analysis is done on BERT-Base, it can be easily generalized to BERT-Large and other models such as RoBERTa (Liu et al., 2019) and XLNet (Yang et al., 2019).
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
Figure 1: Memory Profiling for BERT
|
| 37 |
+
|
| 38 |
+
# 2.2 A REGRESSION ANALYSIS ON ACTIVATION MEMORY
|
| 39 |
+
|
| 40 |
+
For BERT, or more specifically, Transformer, the activation memory corresponds to intermediate results of different layers It grows linearly in all the model hyper-parameters, except the sequence length $N$ , due to the attention layers. To quantify more clearly the $O ( N )$ and $O ( N ^ { 2 } )$ components in the activation memory, we conduct a regression analysis as follows. Assume that the activation memory (in each GPU) is a polynomial $\bar { a _ { 2 } } b \bar { N } ^ { 2 } + a _ { 1 } \bar { b } \bar { N } + a _ { 0 }$ , where $b$ is the batch size in each GPU. If we fix the total number of tokens in a GPU, i.e., $b \times N$ , to be constant (in our case, 4096), we should have a linear function w.r.t. $N$ , i.e., $4 0 9 6 a _ { 2 } N + 4 0 9 6 a _ { 1 } + a _ { 0 }$ . We enumerate $N$ from $\{ 1 2 8 , 2 5 6 , 5 1 2 , 1 0 2 4 \}$ in our experiments, and plot the corresponding profiled activation memory in Figure 1b. Using ordinary least squares (OLS), with $b \times N = 4 0 9 6$ , the estimated linear function for activation memory is $0 . 0 0 7 1 5 \times N + 4 . 8 3$ , where the first term is responsible for the $O ( N ^ { 2 } )$ component. When $N = 5 1 2$ , we can see that for BERT-Base, the $O ( N ^ { 2 } )$ component accounts for 3.66 GB and $O ( N )$ accounts for 4.83 GB. When the sequence length $N$ increases to 1024, however, the $O ( N ^ { 2 } )$ component increases to 7.32 GB, while $O ( \bar { N } )$ is unchanged.
|
| 41 |
+
|
| 42 |
+
# 2.3 GENERAL TECHNIQUES FOR REDUCING MEMORY USAGE IN MODEL TRAINING
|
| 43 |
+
|
| 44 |
+
Observing that activation memory is the bottleneck, we discuss the effectiveness of common memory reduction techniques for BERT training below.
|
| 45 |
+
|
| 46 |
+
Low Precision (Micikevicius et al., 2017): Low precision is to use half-precision or mixed-precision for training neural networks. This technique has been widely used in Transformer training (Ott et al., 2019; Liu et al., 2019). In this work, we already assume to use mixed-precision training by default, as indicated in the aforementioned analysis.
|
| 47 |
+
|
| 48 |
+
Microbatching (Huang et al., 2018): Microbatching is to split a batch into small microbatches (which can be fit into memory), and then run forward and backward passes on them separately with gradients for each micro-batch accumulated. Because it runs forward/backward pass multiple times for a single batch, it trades off time for memory.
|
| 49 |
+
|
| 50 |
+
Gradient Checkpointing (Chen et al., 2016): Gradient checkpointing saves memory by only caching activations of a subset of layers. The un-cached activations will be recomputed during backpropagation from the latest checkpoint. This strategy trades off time for memory by repeating computations that require large memory and will obviously extend the model training time.
|
| 51 |
+
|
| 52 |
+
Knowledge Distillation (Hinton et al., 2015): Knowledge distillation aims to compress and transfer knowledge from a teacher model to a simpler student model. However, knowledge distillation relies on a teacher model (which is still expensive in training time) and usually suffers from a certain degree of performance degradation.
|
| 53 |
+
|
| 54 |
+
As common techniques are limited in reducing both the training time and memory usage, we investigate how to optimize the dot-product attention layers and introduce our approach next.
|
| 55 |
+
|
| 56 |
+
# 3 MODEL: BLOCKBERT
|
| 57 |
+
|
| 58 |
+
Following (Vaswani et al., 2017), the dot-product attention in Transformer is defined as:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\operatorname { A t t e n t i o n } ( Q , K , V ) = \operatorname { s o f t m a x } \biggl ( \frac { Q K ^ { \top } } { \sqrt { d } } \biggr ) V .
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where $Q , K , V \in \mathbb { R } ^ { N \times d }$ with $N$ to be the sequence length and $d$ to be a hidden dimension. As we can see, the inner product between $Q$ and $\kappa$ consumes $\bar { O } ( N ^ { 2 } )$ memory. One simple way to reduce memory consumption of attention is to sparsify the attention matrix. Suppose we have a masking matrix $\mathbf { \bar { \chi } } M \in \{ 0 , \mathbf { \bar { 1 } } \} ^ { N \times N }$ . We define a masked version of attention as follows:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\mathrm { A t t e n t i o n } ( Q , K , V , M ) = \mathrm { s o f t m a x } \bigg ( \frac { Q K ^ { \top } } { \sqrt { d } } \odot M \bigg ) V ,
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
with operator $\odot$ defined by
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
( \pmb { A } \odot \pmb { M } ) _ { i j } = \left\{ \begin{array} { l l } { \pmb { A } _ { i j } } & { \mathrm { i f } \ M _ { i j } = 1 } \\ { - \infty } & { \mathrm { i f } \ M _ { i j } = 0 } \end{array} \right. .
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
In this work, we design $M$ to be a sparse block matrix, which not only reduces memory and the number of floating point operations (FLOPs) but also benefits from efficient dense matrix support from deep learning frameworks, such as PyTorch and Tensorflow. More formally, we split the length- $. N$ input sequence into $n$ partitions, with each partition of length $\textstyle { \frac { N } { n } }$ .4 The $N \times N$ attention matrix is then partitioned into $n \times n$ blocks, where each block matrix is of size $\textstyle { \frac { N } { n } } \times { \frac { N } { n } }$ Nn . A sparse block matrix $M$ can be defined by a permutation $\pi$ of $\{ 1 , 2 , \cdots , n \}$ :
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
M _ { i j } = \left\{ \begin{array} { l l } { 1 } & { \mathrm { i f } \pi \left( \lfloor \frac { ( i - 1 ) n } { N } + 1 \rfloor \right) = \lfloor \frac { ( j - 1 ) n } { N } + 1 \rfloor } \\ { 0 } & { \mathrm { o t h e r w i s e . } } \end{array} \right.
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
By writing $Q , K , V$ as be block matrices, such that $\begin{array} { r } { \pmb { Q } = \left[ \pmb { Q } _ { 1 } ^ { \top } \quad \cdot \cdot \mathrm { ~ ~ \lambda ~ } \pmb { Q } _ { n } ^ { \top } \right] ^ { \top } , \pmb { K } = \left[ \pmb { K } _ { 1 } ^ { \top } \quad \cdot \cdot \mathrm { ~ ~ \lambda ~ } \pmb { K } _ { n } ^ { \top } \right] ^ { \top } } \end{array}$ and $V _ { . } = \left[ \boldsymbol { v } _ { 1 } ^ { \top } \quad \cdot \cdot \quad \boldsymbol { v } _ { n } ^ { \top } \right] ^ { \top }$ and pluging them into Equation 1, we can formally define Blockwise Attention as follows:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\mathrm { B l o c k w i s e - A t t e n t i o n } ( Q , K , V , M ) = \left[ \begin{array} { c } { { \mathrm { s o f t m a x } \bigg ( \frac { Q _ { 1 } K _ { \pi ( 1 ) } ^ { \top } } { \sqrt { d } } \bigg ) V _ { \pi ( 1 ) } } } \\ { { \vdots } } \\ { { \mathrm { s o f t m a x } \bigg ( \frac { Q _ { n } K _ { \pi ( n ) } ^ { \top } } { \sqrt { d } } \bigg ) V _ { \pi ( n ) } } } \end{array} \right] .
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
sult, it only needs to compute and store . In other words, BlockBERT reduces the $Q _ { i } K _ { \pi ( i ) } ^ { \top } ~ ( i = 1 , \cdot \cdot \cdot n )$ , each of which has sizememory consumption and $\textstyle { \frac { N } { n } } \times { \frac { N } { n } }$ $O ( N ^ { 2 } )$ FLOPs by a factor of $n$ , since $\begin{array} { r } { \frac { N } { n } \times \frac { N } { n } \times n = \frac { N \times N } { n } } \end{array}$ .
|
| 89 |
+
|
| 90 |
+
# 3.1 BLOCKWISE MULTI-HEAD ATTENTION
|
| 91 |
+
|
| 92 |
+
Analogous to Multi-head Attention (Vaswani et al., 2017), we allow queries, keys, and values to be projected multiple times and perform blockwise attentions in parallel. Moreover, different blockwise attention heads can use different masking matrices. The outputs of multiple heads are then concatenated and aggregated with another linear projection. Let $A$ be the number of attention heads and $H$ the number of hidden units. Blockwise multi-head attention is formally defined by:
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\begin{array} { r l } & { \mathrm { i o n } ( Q , K , V ) = \mathrm { C o n c a t } ( \mathrm { h e a d } _ { 1 } , \cdot \cdot \cdot \mathrm { h e a d } _ { \cal A } ) { \cal W } ^ { \cal O } } \\ & { \quad \mathrm { w h e r e ~ h e a d } _ { i } = \mathrm { B l o c k w i s e } { \mathrm { - A t t e n t i o n } ( Q W _ { i } ^ { \it Q } , K W _ { i } ^ { \it K } , V W _ { i } ^ { \it V } , { M } _ { i } ) } , } \end{array}
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
with $\begin{array} { r } { d = \frac { H } { A } , W _ { i } ^ { Q } , W _ { i } ^ { K } , W _ { i } ^ { V } \in \mathbb { R } ^ { H \times d } } \end{array}$ and the projection matrix $W ^ { O } \in \mathbb { R } ^ { H \times H }$ . Each masking matrix $M _ { i }$ is determined by permutation $\pi _ { i }$ according to Equation 2. In particular, we choose $\pi$ from permutations generated by shifting one position: $\sigma = ( 2 , 3 , \cdots , n , 1 )$ , i.e., we select $\pi \in$ $\{ \sigma , \sigma ^ { \dot { 2 } } , \cdots , \sigma ^ { n } \}$ . For example, with 12 attention heads $A = 1 2$ ) and 2 blocks $( n \ = \ 2$ ), one configuration can be assigning 10 heads to permutation $( 1 , 2 )$ and the other 2 heads to permutation $( 2 , 1 )$ . Figure 2 illustrates the blockwise multi-head attention with the block numbers $\bar { n } \in \{ 2 , 3 \}$ . Blockwise sparsity captures both local and long-distance dependencies in a memory-efficiency way, which is crucial for long-document understanding tasks. For instance, the identity permutation, i.e., $( 1 , 2 , \cdots , n )$ , enables each token to attend its nearby tokens in self-attention. Tokens within the same local group attend a long-distance group of tokens together in other permutations. Our proposed BlockBERT essentially replaces the multi-head attention layers in Transformer/BERT with blockwise multi-head attention.
|
| 99 |
+
|
| 100 |
+

|
| 101 |
+
Figure 2: Architecture of Blockwise Multi-head Attention.
|
| 102 |
+
|
| 103 |
+

|
| 104 |
+
Figure 3: Regression analysis on activation memory for BERT and BlockBERT.
|
| 105 |
+
|
| 106 |
+
Table 1: Estimated $O ( N ^ { 2 } )$ and $O ( N )$ activation memory for BERT and BlockBERT.
|
| 107 |
+
|
| 108 |
+
<table><tr><td>N</td><td>b</td><td>Model</td><td>Act.Mem. (GB) O(N) O(N2)</td></tr><tr><td rowspan="3">512</td><td rowspan="3">8</td><td>BERT</td><td>4.83 3.66</td></tr><tr><td>BlockBERT n=2</td><td>4.84 1.83</td></tr><tr><td>BlockBERT n=3</td><td>4.87 1.22</td></tr><tr><td rowspan="3">1024</td><td rowspan="3">4</td><td>BERT</td><td>4.83 7.32</td></tr><tr><td>BlockBERT n=2</td><td>4.84 3.66</td></tr><tr><td>BlockBERT n=3</td><td>4.87 2.44</td></tr></table>
|
| 109 |
+
|
| 110 |
+
# 3.2 ANALYSIS OF MEMORY USAGE REDUCTION
|
| 111 |
+
|
| 112 |
+
To validate our claim that BlockBERT with $n \times n$ blocks can reduce the $O ( N ^ { 2 } )$ memory use by a factor of $n$ , we perform the same memory profiling as described in sections 2.1 and 2.2. Again, We fix the number of tokens in each GPU $\left( b \times N = 4 0 9 6 \right)$ ) and choose $N$ from $\{ 1 2 8 , 2 5 6 , 5 1 2 , 1 0 2 4 , 2 0 4 8 \} .$ 5 As we can see from Figure 3 and Table 1, the empirical results align well with the theoretical values. When we set block size to be 2 and 3 for BlockBERT, their estimated $O ( N ^ { 2 } )$ activation memory decreases to 1/2 and $1 / 3$ of BERT’s $O ( N ^ { 2 } )$ activation memory, resp. As shown in Table 2, for the sequence length $N = 5 1 2$ , BlockBERT with $^ \textrm { \scriptsize 2 / 3 }$ blocks saves $1 8 . 7 \% / \ 2 3 . 8 \%$ overall memory, resp. The saving is more significant for longer sequences. When $N = 1 0 2 4$ , the overall memory reduction of BlockBERT with $^ { 2 / 3 }$ blocks is $2 7 . 3 \% / 3 6 . 1 \%$ , resp.
|
| 113 |
+
|
| 114 |
+
# 4 EXPERIMENTS
|
| 115 |
+
|
| 116 |
+
We evaluate the pre-training and fine-tuning performance of BlockBERT. In particular, when $n = 2$ , we denote 10:2 to be the configuration which distributes 10 heads to permutation $( 1 , 2 )$ and 2 to permutation $( 2 , 1 )$ ; when $n = 3$ , we denote 8:2:2 to be the configuration which assigns 8, 2, 2 heads
|
| 117 |
+
|
| 118 |
+
Table 2: Pre-training Performance Analysis.
|
| 119 |
+
|
| 120 |
+
<table><tr><td>N</td><td>Model</td><td>Training Time (day)</td><td>Memory (per GPU, GB)</td><td>Heads Config.</td><td>Valid. ppl</td></tr><tr><td rowspan="3">512</td><td>RoBERTa-1seq</td><td>6.62</td><td>9.73</td><td>1</td><td>3.58</td></tr><tr><td>BlockBERT n=2</td><td>5.83 (-12.0%)</td><td>7.91 (-18.7%)</td><td>10:2</td><td>3.56</td></tr><tr><td>BlockBERT n=3</td><td>5.80 (-12.5%)</td><td>7.32 (-23.8%)</td><td>8:2:2</td><td>3.71</td></tr><tr><td rowspan="3">1024</td><td>RoBERTa-1seq</td><td>9.66</td><td>13.39</td><td>-</td><td>3.60</td></tr><tr><td>BlockBERT n=2</td><td>7.51 (-22.3%)</td><td>9.73 (-27.3%)</td><td>9:3</td><td>3.57</td></tr><tr><td>BlockBERT n=3</td><td>7.23 (-25.1%)</td><td>8.55 (-36.1%)</td><td>8:2:2</td><td>3.63</td></tr></table>
|
| 121 |
+
|
| 122 |
+
to permutation $( 1 , 2 , 3 )$ , $( 2 , 3 , 1 )$ , and $( 3 , 1 , 2 )$ , resp. We compare BlockBERT with the following baselines:
|
| 123 |
+
|
| 124 |
+
Google BERT The pre-trained base model from Devlin et al. (2019).
|
| 125 |
+
|
| 126 |
+
RoBERTa-2seq and RoBERTa-1seq We compare with two versions of RoBERTa (Liu et al., 2019). RoBERTa-2seq is trained with both masked language model (MLM) task and next sentence prediction (NSP) task, while RoBERTa-1seq refers to the pre-training model with only MLM task.
|
| 127 |
+
|
| 128 |
+
SparseBERT We pre-train BERT models with its Transformer encoder replaced by a Sparse Transformer encoder (Child et al., 2019). We set its sparsity hyper-parameters stride $\ell = 1 2 8$ and expressivity $c = 3 2$ . The attention masks used for Sparse Transformer encoder are illustrated in Figure 5.
|
| 129 |
+
|
| 130 |
+
# 4.1 PRE-TRAINING
|
| 131 |
+
|
| 132 |
+
All the models follow the base setting, i.e., $L = 1 2 , H = 7 6 8 , A = 1 2$ and are trained on the same corpus — BooksCorpus and English Wikipedia with uncased word piece tokens. We fix the number of tokens per batch $B \times N = 1 3 1 , 0 7 2$ , i.e., if sequence length $N = 5 1 2$ then batch size $B = 2 5 6$ , if sequence length $N = 1 0 2 4$ then batch size $B = 1 2 8$ . The detailed pre-training configuration is listed in Table 6 in Appendix A.1. Moreover, the pre-training of SparseBERT and BlockBERT follows the RoBERTa-1seq setting, i.e., we drop the NSP (Next Sentence Prediction) task, and an input sequence is up to $N$ tokens until it reaches a document boundary. A summary of the pretraining performance comparison between BlockBERT and RoBERTa-1seq is shown in Table 2. Besides memory saving, we also achieve a significant speedup. For example, when $N = 1 0 2 4$ , BlockBERT $( n = 2$ ) reduces the training time from RoBERTa’s 9.7 days to 7.5 days.
|
| 133 |
+
|
| 134 |
+
# 4.2 FINE-TUNING TASKS
|
| 135 |
+
|
| 136 |
+
We evaluate BlockBERT on several question answering tasks, including SQuAD 1.1/2.0 (Rajpurkar et al., 2018) and five other tasks from the MrQA shared task6 — HotpotQA (Yang et al., 2018), NewsQA (Trischler et al., 2017), SearchQA (Dunn et al., 2017), TriviaQA (Joshi et al., 2017) and NaturalQA (Kwiatkowski et al., 2019). Since MrQA does not have an official test set, we follow Joshi et al. (2019a) who split the development set evenly to build a new development set and test set.
|
| 137 |
+
|
| 138 |
+
These QA datasets have different paragraph length distribution patterns and are thus ideal for testing the effectiveness of BlockBERT. For example, SQuAD, NaturalQA, and HotpotQA consist of mostly short paragraphs (shorter than 512), while paragraphs in SearchQA (average length 1,004) and TriviaQA (average length 934) have around 1,000 tokens. This means that for SearchQA and TriviaQA, a BERT model with sequence length $N = 5 1 2$ can only capture half of the context. The detailed paragraph length distributions can be found in Figure 6.
|
| 139 |
+
|
| 140 |
+
For all the pre-trained models, we adopt the same fine-tuning QA setup from Devlin et al. (2019). The tokenized paragraph $( p _ { 1 } , \cdots , p _ { s } )$ and question $( q _ { 1 } , \cdots , q _ { t } )$ are concatenated to be a sequence [CLS] $\mid q _ { 1 } \cdot \cdot \cdot q _ { t } [ \mathsf { S E P } ] p _ { 1 } \cdot \cdot \cdot p _ { s }$ [SEP]. The sequence is then fed into the pre-trained model with two extra linear layers for predicting the start and end positions of the answer spans. The detailed fine-tuning setting is listed in Appendix A.4. Table 3 and Table 4 report the experimental results.
|
| 141 |
+
|
| 142 |
+
Table 3: Dev set results on SQuAD 1.1/2.0. The result of XLNet(-Base) is from (Yang et al., 2019).
|
| 143 |
+
|
| 144 |
+
<table><tr><td></td><td></td><td colspan="2">SQuAD 1.1</td><td colspan="2">SQuAD 2.0</td></tr><tr><td>N</td><td>Model</td><td>EM</td><td>F1</td><td>EM</td><td>F1</td></tr><tr><td>=</td><td>Human Perf.</td><td>82.30</td><td>91.20</td><td>86.80</td><td>89.40</td></tr><tr><td></td><td>Google BERT</td><td>81.19</td><td>88.45</td><td>74.08</td><td>77.16</td></tr><tr><td></td><td>XLNet</td><td>-</td><td>-</td><td>78.46</td><td>81.33</td></tr><tr><td></td><td>RoBERTa-2seq</td><td>82.91</td><td>89.78</td><td>75.79</td><td>79.17</td></tr><tr><td>512</td><td>RoBERTa-1seq</td><td>84.43</td><td>91.48</td><td>79.22</td><td>82.27</td></tr><tr><td></td><td>SparseBERT</td><td>80.49</td><td>88.09</td><td>74.15</td><td>76.96</td></tr><tr><td></td><td>BlockBERT n=2,10:2</td><td>84.08</td><td>90.77</td><td>78.34</td><td>81.46</td></tr><tr><td></td><td>BlockBERT n=3,8:2:2</td><td>82.37</td><td>89.64</td><td>77.33</td><td>80.33</td></tr><tr><td></td><td>RoBERTa-1seq</td><td>84.58</td><td>91.14</td><td>79.34</td><td>82.26</td></tr><tr><td></td><td>SparseBERT</td><td>81.02</td><td>88.37</td><td>74.51</td><td>77.57</td></tr><tr><td>1024</td><td>BlockBERT n=2,9:3</td><td>83.65</td><td>90.74</td><td>78.55</td><td>81.45</td></tr><tr><td></td><td>BlockBERT n=3,8:2:2</td><td>82.74</td><td>90.05</td><td>76.79</td><td>79.84</td></tr></table>
|
| 145 |
+
|
| 146 |
+
BlockBERT $\scriptstyle ( \mathbf { n } = 2 )$ v.s. RoBERTa-1seq Comparing BlockBERT $( n = 2$ ) with RoBERTa-1seq on pre-trained model with $N = 5 1 2$ , we observe an absolute F1 difference from 0.04 (in NaturalQA) to 1.18 (in NewsQA), with average difference to be 0.55. For $N = 1 0 2 4$ , BlockBERT achieves more comparable or even better performance (in SearchQA, NewsQA, and HotpotQA) to RoBERTa-1seq. The average difference on F1 reduces to 0.27.
|
| 147 |
+
|
| 148 |
+
BlockBERT v.s. SparseBERT For $N = 5 1 2$ , it is interesting that BlockBERT with 3 blocks (density $3 3 . 3 3 \%$ ) performs better then SparseBERT (density $4 4 . 2 0 \%$ ) in both SQuAD and MrQA tasks. Similar patterns can be observed for $N = 1 0 2 4$ . These results show that off-diagonal masking matrices, e.g., the masking matrix defined by permutation $( 2 , 1 )$ , play crucial roles in BlockBERT.
|
| 149 |
+
|
| 150 |
+
Effect of Long Sequence Pre-training Our observations are twofold. (1) Long sequence pretraining benefits long sequence fine-tuning. In TriviaQA and SearchQA, of which paragraph lengths are around 1024, pre-training models with $N = 1 0 2 4$ achieve significantly better performance. (2) The heterogeneity of pre-training and fine-tuning sequence length may hurt performance. For example, in SQuAD, we do not see significant performance gain by using pre-trained models with $N = 1 0 2 4$ ; in HotpotQA and NewsQA, longer sequence pre-training even hurts performance.
|
| 151 |
+
|
| 152 |
+
Effect of #Blocks It is not surprising that BlockBERT with 2 blocks ${ \it n } = 2$ ) performs better than that with 3 blocks ${ \mathrm { ~ \ : ~ } } ( n = 3$ ), because it keeps more attention matrix entries. The biggest difference is in SQuAD 2.0 and NewsQA with $N = 1 0 2 4$ , where we observe an absolute loss of 1.6 F1 by increasing block number from 2 to 3.
|
| 153 |
+
|
| 154 |
+
In summary, not only BlockBERT saves training time and memory, but it also has competitive and sometimes better performance, especially for tasks with longer sequences. This demonstrates the effectiveness of our blockwise multi-head attention approach.
|
| 155 |
+
|
| 156 |
+
Table 4: MrQA test results (Tasks are sorted decreasingly by average paragraph length).
|
| 157 |
+
|
| 158 |
+
<table><tr><td></td><td></td><td colspan="2">SearchQA</td><td colspan="2">TriviaQA</td><td colspan="2">NewsQA</td><td colspan="2">NaturalQA</td><td colspan="2">HotpotQA</td></tr><tr><td>N</td><td>Model</td><td>EM</td><td>F1</td><td>EM</td><td>F1</td><td>EM</td><td>F1</td><td>EM</td><td>F1</td><td>EM</td><td>F1</td></tr><tr><td rowspan="6">512</td><td>Google BERT</td><td>74.94</td><td>80.37</td><td>70.18</td><td>75.35</td><td>51.27</td><td>66.25</td><td>66.13</td><td>78.29</td><td>60.50</td><td>77.08</td></tr><tr><td>RoBERTa-2seq</td><td>76.12</td><td>81.74</td><td>71.92</td><td>76.79</td><td>52.45</td><td>66.73</td><td>66.98</td><td>78.63</td><td>61.52</td><td>77.81</td></tr><tr><td>RoBERTa-1seq</td><td>77.09</td><td>82.62</td><td>73.65</td><td>78.22</td><td>56.13</td><td>70.64</td><td>67.14</td><td>79.07</td><td>62.77</td><td>79.28</td></tr><tr><td>SparseBERT</td><td>73.36</td><td>79.01</td><td>68.71</td><td>73.15</td><td>51.18</td><td>65.47</td><td>65.53</td><td>77.46</td><td>58.54</td><td>74.85</td></tr><tr><td>BlockBERT n=2,10:2</td><td>76.68</td><td>82.33</td><td>72.36</td><td>77.53</td><td>54.66</td><td>69.46</td><td>66.94</td><td>79.03</td><td>62.13</td><td>79.15</td></tr><tr><td>BlockBERT n=3,8:2:2</td><td>75.54</td><td>81.07</td><td>72.05</td><td>76.74</td><td>53.82</td><td>68.39</td><td>66.14</td><td>78.47</td><td>60.64</td><td>77.46</td></tr><tr><td rowspan="4">1024</td><td>RoBERTa-1seq</td><td>77.47</td><td>83.12</td><td>75.29</td><td>80.20</td><td>55.00</td><td>69.64</td><td>68.28</td><td>80.35</td><td>61.89</td><td>78.71</td></tr><tr><td>SparseBERT</td><td>74.83</td><td>80.54</td><td>70.56</td><td>75.34</td><td>51.67</td><td>67.16</td><td>65.07</td><td>77.31</td><td>59.65</td><td>76.02</td></tr><tr><td>BlockBERT n=2, 9:3</td><td>77.95</td><td>83.51</td><td>75.06</td><td>79.41</td><td>55.44</td><td>70.08</td><td>67.31</td><td>79.39</td><td>62.13</td><td>78.94</td></tr><tr><td>BlockBERT n=3,8:2:2</td><td>76.98</td><td>82.76</td><td>74.78</td><td>79.28</td><td>53.48</td><td>68.50</td><td>65.91</td><td>78.20</td><td>61.89</td><td>78.18</td></tr></table>
|
| 159 |
+
|
| 160 |
+
# 4.3 ABLATION STUDY
|
| 161 |
+
|
| 162 |
+
We fix the assignment of attention heads in above experiments. For example, BlockBERT with sequence length $N = 5 1 2$ and 2 blocks is trained with ten heads using permutation $( 1 , 2 )$ and the other two using permutation $( 2 , 1 )$ . However, we know that there are other ways to partition twelve attention heads, e.g., seven heads for permutation $( 1 , 2 )$ and the other five for permutation $( 2 , 1 )$ . It would be interesting to see how the assignment of heads affects model performance. In this section, we grid search attention head assignments and plot their best validation performance in $1 . 2 \mathbf { M }$ training steps. The results are shown in Figure 4.
|
| 163 |
+
|
| 164 |
+
Our observations are threefold: (1) Identity permutations, i.e., $( 1 , 2 )$ and $( 1 , 2 , 3 )$ , are important. As shown in Figure 4, all optimal solutions assign considerable attention heads to block diagonal matrices, since those matrices enable each token to attend to its nearby tokens; (2) Non-identity permutations follow the rule of “vital few and trivial many.” Although identity permutations are important, assigning all attention heads to them (corresponding to 12:0 and 12:0:0 in Figure 4) significantly hurts performance, since the model can not learn long-term dependencies with only identity permutation; (3) Pre-training performance and fine-tuning performance are correlated but not always consistent. When $n = 3$ , pre-training performance suggests 10:1:1 to be the best head assignment — ten heads for permutation $( 1 , 2 , 3 )$ , one head for $( 2 , 3 , 1 )$ and one head for $( 3 , 1 , 2 )$ , but we observe that the configuration of 8:2:2 achieves better performance in fine-tuning tasks.
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 4: Ablation over blockwise attention heads assignment.
|
| 168 |
+
|
| 169 |
+
# 5 RELATED WORK
|
| 170 |
+
|
| 171 |
+
In this section, we review the related work of memory optimization for neural network training and recent efforts to simplify Transformer and BERT. In recent years, there is an increasing interest in training neural networks with low-memory (Sohoni et al., 2019). Mainstream techniques include low-precision training (Micikevicius et al., 2017), microbatching (Huang et al., 2018), gradient checkpointing (Chen et al., 2016). Another line of researches studies this problem from a theoretical perspective, including the recently proposed lottery ticket hypothesis (Frankle & Carbin, 2018). Since the invention of Transformer (Vaswani et al., 2017; Dai et al., 2019) and its successful application on language model pre-training (Devlin et al., 2019; Radford et al., 2019; Yang et al., 2019; Liu et al., 2019), there have been several studies attempted to simplify it from different perspectives. The first line of research focuses on attention matrix sparsification, such as Star Transformer (Guo et al., 2019), Sparse Transformer (Child et al., 2019), Adaptive Sparse Transformer (Correia et al., 2019; Sukhbaatar et al., 2019), Log-Sparse Transformer (Li et al., 2019), etc. However, due to limited support for sparse tensor from current deep learning platforms, most of studies have to represent a sparse matrix using a dense matrix with a binary mask or rely on customized CUDA kernels (Gray et al., 2017). The second line of research attempts to prune redundant heads in Transformer, such as Voita et al. (2019) and Michel et al. (2019). The third line of research focuses on knowledge distillation, including DistilBERT7 which distills BERT using a smaller BERT and Tang et al. (2019) which distills BERT with BiLSTM (Hochreiter & Schmidhuber, 1997).
|
| 172 |
+
|
| 173 |
+
# 6 CONCLUSION
|
| 174 |
+
|
| 175 |
+
In this work, we study lightweight BERT model with the goal of achieving both efficiency and effectiveness. We profile and analyze the memory bottlenecks of BERT, and focus on optimize dotproduct self-attention, which consumes quadratic memory with respect to the sequence length. To reduce both training time and memory consumption, we present BlockBERT, which sparsifies the attention matrices to be sparse block matrices. The proposed model achieves time and memory saving without significant loss of performance. In the future, we would like to explore more applications of BlockBERT on NLP tasks involving long sequences such as coreference resolution (Joshi et al., 2019b) and document-level machine translation (Miculicich et al., 2018), and also non-NLP tasks such as protein sequence modeling (Rives et al., 2019).
|
| 176 |
+
|
| 177 |
+
# REFERENCES
|
| 178 |
+
|
| 179 |
+
Tianqi Chen, Bing Xu, Chiyuan Zhang, and Carlos Guestrin. Training deep nets with sublinear memory cost. arXiv preprint arXiv:1604.06174, 2016.
|
| 180 |
+
Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. arXiv preprint arXiv:1904.10509, 2019.
|
| 181 |
+
Gonc¸alo M Correia, Vlad Niculae, and Andre FT Martins. Adaptively sparse transformers. ´ arXiv preprint arXiv:1909.00015, 2019.
|
| 182 |
+
Zihang Dai, Zhilin Yang, Yiming Yang, William W Cohen, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context. arXiv preprint arXiv:1901.02860, 2019.
|
| 183 |
+
Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In NAACL-HLT’ 2019, pp. 4171–4186, 2019.
|
| 184 |
+
Matthew Dunn, Levent Sagun, Mike Higgins, V Ugur Guney, Volkan Cirik, and Kyunghyun Cho. Searchqa: A new q&a dataset augmented with context from a search engine. arXiv preprint arXiv:1704.05179, 2017.
|
| 185 |
+
Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. arXiv preprint arXiv:1803.03635, 2018.
|
| 186 |
+
Scott Gray, Alec Radford, and Diederik P Kingma. Gpu kernels for block-sparse weights. arXiv preprint arXiv:1711.09224, 2017.
|
| 187 |
+
Qipeng Guo, Xipeng Qiu, Pengfei Liu, Yunfan Shao, Xiangyang Xue, and Zheng Zhang. Startransformer. In NAACL-HLT’ 2019, pp. 1315–1325, 2019.
|
| 188 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 189 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 190 |
+
Yanping Huang, Yonglong Cheng, Dehao Chen, HyoukJoong Lee, Jiquan Ngiam, Quoc V Le, and Zhifeng Chen. Gpipe: Efficient training of giant neural networks using pipeline parallelism. arXiv preprint arXiv:1811.06965, 2018.
|
| 191 |
+
Mandar Joshi, Eunsol Choi, Daniel Weld, and Luke Zettlemoyer. Triviaqa: A large scale distantly supervised challenge dataset for reading comprehension. In ACL’ 17, pp. 1601–1611, 2017.
|
| 192 |
+
Mandar Joshi, Danqi Chen, Yinhan Liu, Daniel S Weld, Luke Zettlemoyer, and Omer Levy. Spanbert: Improving pre-training by representing and predicting spans. arXiv preprint arXiv:1907.10529, 2019a.
|
| 193 |
+
Mandar Joshi, Omer Levy, Daniel S Weld, and Luke Zettlemoyer. Bert for coreference resolution:
|
| 194 |
+
|
| 195 |
+
Baselines and analysis. arXiv preprint arXiv:1908.09091, 2019b.
|
| 196 |
+
|
| 197 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 198 |
+
|
| 199 |
+
Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee, et al. Natural questions: a benchmark for question answering research. Transactions of the Association for Computational Linguistics, 7:453–466, 2019.
|
| 200 |
+
|
| 201 |
+
Kenton Lee, Ming-Wei Chang, and Kristina Toutanova. Latent retrieval for weakly supervised open domain question answering. arXiv preprint arXiv:1906.00300, 2019.
|
| 202 |
+
|
| 203 |
+
Shiyang Li, Xiaoyong Jin, Yao Xuan, Xiyou Zhou, Wenhu Chen, Yu-Xiang Wang, and Xifeng Yan. Enhancing the locality and breaking the memory bottleneck of transformer on time series forecasting. arXiv preprint arXiv:1907.00235, 2019.
|
| 204 |
+
|
| 205 |
+
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.
|
| 206 |
+
|
| 207 |
+
Paul Michel, Omer Levy, and Graham Neubig. Are sixteen heads really better than one? arXiv preprint arXiv:1905.10650, 2019.
|
| 208 |
+
|
| 209 |
+
Paulius Micikevicius, Sharan Narang, Jonah Alben, Gregory Diamos, Erich Elsen, David Garcia, Boris Ginsburg, Michael Houston, Oleksii Kuchaiev, Ganesh Venkatesh, et al. Mixed precision training. arXiv preprint arXiv:1710.03740, 2017.
|
| 210 |
+
|
| 211 |
+
Lesly Miculicich, Dhananjay Ram, Nikolaos Pappas, and James Henderson. Document-level neural machine translation with hierarchical attention networks. In EMNLP’ 18, pp. 2947–2954, 2018.
|
| 212 |
+
|
| 213 |
+
Rodrigo Nogueira and Kyunghyun Cho. Passage re-ranking with bert. arXiv preprint arXiv:1901.04085, 2019.
|
| 214 |
+
|
| 215 |
+
Myle Ott, Sergey Edunov, Alexei Baevski, Angela Fan, Sam Gross, Nathan Ng, David Grangier, and Michael Auli. fairseq: A fast, extensible toolkit for sequence modeling. arXiv preprint arXiv:1904.01038, 2019.
|
| 216 |
+
|
| 217 |
+
Matthew Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 2227–2237, 2018.
|
| 218 |
+
|
| 219 |
+
Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. 2019.
|
| 220 |
+
|
| 221 |
+
Pranav Rajpurkar, Robin Jia, and Percy Liang. Know what you don’t know: Unanswerable questions for squad. arXiv preprint arXiv:1806.03822, 2018.
|
| 222 |
+
|
| 223 |
+
Alexander Rives, Siddharth Goyal, Joshua Meier, Demi Guo, Myle Ott, C Lawrence Zitnick, Jerry Ma, and Rob Fergus. Biological structure and function emerge from scaling unsupervised learning to 250 million protein sequences. bioRxiv, pp. 622803, 2019.
|
| 224 |
+
|
| 225 |
+
Livio Baldini Soares, Nicholas FitzGerald, Jeffrey Ling, and Tom Kwiatkowski. Matching the blanks: Distributional similarity for relation learning. arXiv preprint arXiv:1906.03158, 2019.
|
| 226 |
+
|
| 227 |
+
Nimit Sharad Sohoni, Christopher Richard Aberger, Megan Leszczynski, Jian Zhang, and Christopher Re. Low-memory neural network training: A technical report. ´ arXiv preprint arXiv:1904.10631, 2019.
|
| 228 |
+
|
| 229 |
+
Sainbayar Sukhbaatar, Edouard Grave, Piotr Bojanowski, and Armand Joulin. Adaptive attention span in transformers. arXiv preprint arXiv:1905.07799, 2019.
|
| 230 |
+
|
| 231 |
+
Raphael Tang, Yao Lu, Linqing Liu, Lili Mou, Olga Vechtomova, and Jimmy Lin. Distilling taskspecific knowledge from bert into simple neural networks. arXiv preprint arXiv:1903.12136, 2019.
|
| 232 |
+
|
| 233 |
+
Adam Trischler, Tong Wang, Xingdi Yuan, Justin Harris, Alessandro Sordoni, Philip Bachman, and Kaheer Suleman. Newsqa: A machine comprehension dataset. In Proceedings of the 2nd Workshop on Representation Learning for NLP, pp. 191–200, 2017.
|
| 234 |
+
|
| 235 |
+
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.
|
| 236 |
+
|
| 237 |
+
Elena Voita, David Talbot, Fedor Moiseev, Rico Sennrich, and Ivan Titov. Analyzing multi-head self-attention: Specialized heads do the heavy lifting, the rest can be pruned. arXiv preprint arXiv:1905.09418, 2019.
|
| 238 |
+
|
| 239 |
+
Zhilin Yang, Peng Qi, Saizheng Zhang, Yoshua Bengio, William W. Cohen, Ruslan Salakhutdinov, and Christopher D. Manning. HotpotQA: A dataset for diverse, explainable multi-hop question answering. In EMNLP’ 18, 2018.
|
| 240 |
+
|
| 241 |
+
Zhilin Yang, Zihang Dai, Yiming Yang, Jaime Carbonell, Ruslan Salakhutdinov, and Quoc V Le. Xlnet: Generalized autoregressive pretraining for language understanding. arXiv preprint arXiv:1906.08237, 2019.
|
| 242 |
+
|
| 243 |
+
# A APPENDIX
|
| 244 |
+
|
| 245 |
+
# A.1 NOTATIONS AND PRE-TRAINING HYPER-PARAMETERS
|
| 246 |
+
|
| 247 |
+
The notations and pre-training hyper-parameters are listed in Table 5 and Table 6.
|
| 248 |
+
|
| 249 |
+
Table 5: BERT notations.
|
| 250 |
+
|
| 251 |
+
<table><tr><td></td><td>Description</td><td>Base</td><td>Large</td></tr><tr><td>B</td><td>Batch size</td><td>256</td><td>256</td></tr><tr><td>A</td><td># Self-attention heads</td><td>12</td><td>16</td></tr><tr><td>L</td><td>#Layers</td><td>12</td><td>24</td></tr><tr><td>H</td><td># Hidden units</td><td>768</td><td>1024</td></tr><tr><td>4H</td><td>#Feed-forward hidden units</td><td>3072</td><td>4096</td></tr><tr><td>N</td><td>Sequence length</td><td>512</td><td>512</td></tr></table>
|
| 252 |
+
|
| 253 |
+
Table 6: Pre-training hyperparameters.
|
| 254 |
+
|
| 255 |
+
<table><tr><td>Hyper-parameter</td><td>Value</td></tr><tr><td>Vocabulary Size</td><td>30,522</td></tr><tr><td>Dropout</td><td>0.1</td></tr><tr><td>Attention dropout</td><td>0.1</td></tr><tr><td>Warmup steps</td><td>10K</td></tr><tr><td>Weight decay</td><td>0.01</td></tr><tr><td>Max steps</td><td>2.4M</td></tr><tr><td>Initial learning rate</td><td>0.00025</td></tr><tr><td>Learning rate decay</td><td>Linear</td></tr><tr><td>Adam ∈</td><td>1e-8</td></tr><tr><td>Adam β1</td><td>0.9</td></tr><tr><td>Adam β2</td><td>0.999</td></tr><tr><td>Gradient Clipping</td><td>1.0</td></tr></table>
|
| 256 |
+
|
| 257 |
+
# A.2 PROFILER IMPLEMENTATION
|
| 258 |
+
|
| 259 |
+
Among the three types of training memory, model memory and optimizer memory is relatively easy to profile (can be computed by enumerate each tenor and summing up tensor.numel() $\star$ tensor.element size()). To calculate activation memory, Sohoni et al. (2019) traverse PyTorch’s autograd graph and sum up necessary storage space. They find that the summation of model memory, optimizer memory and activation memory matches PyTorch memory profiling tool torch.cuda.max memory allocated. Based on their observation, we use
|
| 260 |
+
|
| 261 |
+
torch.cuda.max memory allocated − model memory − optimizer memory as an estimate to activation memory. When profiling BERT, we first pre-train it for 1000 steps, and then compute its model and optimizer memory. Finally, we esitmate its activation memory according to Equation 4.
|
| 262 |
+
|
| 263 |
+
# A.3 SPARSEBERT
|
| 264 |
+
|
| 265 |
+
The sparse masking matrices we use for Sparse Transformer (Child et al., 2019) are shown in Figure 5. We adopt the implementation from Fairseq8.
|
| 266 |
+
|
| 267 |
+

|
| 268 |
+
Figure 5: The sparse masking matrices we use in Sparse Transformer (fixed mode) encoder. White color indicates attention values to be masked. (a) $\bar { N } = 5 1 2 , \ell = 1 2 8 , c = 3 2$ , density $4 4 . 2 0 \%$ ; (b) $N = 1 0 2 4 , \ell = 1 2 8$ , $c = 3 2$ , density $3 4 . 9 7 \%$ .
|
| 269 |
+
|
| 270 |
+
# A.4 FINE-TUNING SETTINGS
|
| 271 |
+
|
| 272 |
+
Our fine-tuning is implemented based on code base from HuggingFace9 and SpanBERT (Joshi et al., 2019a). We use max sequence length $\it { \Omega } = \it { N }$ , i.e., we allow fine-tuning task to input sequences as long as the pre-training model. If the input sequence is too long to fit the max sequence lengt $\neg = N$ constraints, we use a sliding window of stride 128 to split it. We grid search learning rate from {5e-6, 1e-5, 2e-5, 3e-5, 5e-5} and batch size from $\{ 1 6 , 3 2 \}$ . The fine-tuning is performed for 4 epoches.
|
| 273 |
+
|
| 274 |
+

|
| 275 |
+
Figure 6: Paragraph length (after tokenization) distribution. The distribution of SQuAD 2.0 is very similar to SQuAD 1.1, so we only plot SQuAD 1.1 here.
|
| 276 |
+
|
| 277 |
+
# A.5 TEST EFFICIENCY
|
| 278 |
+
|
| 279 |
+
We benchmark test efficiency of RoBERTa and our proposed BlockBERT. The benchmark code follows huggingface10. All experiments are run 30 times on a 32GB V100 GPU with half precision (FP16). We report the average running time at Table 7. As we can see, BlockBERT does achieve speedup and memory reduction during test time. Take $8 \times 1 0 2 4$ , i.e., batch size $B = 8$ sequence length $N = 1 0 2 4$ , as an example, we can see that BlockBERT with 2 blocks saves $2 7 . 8 \%$ of test time, and BlockBERT with 3 blocks saves more $( 3 0 . 4 \% )$ . As for memory, we can observe that RoBERTa can not handle an input of $1 6 \times 1 0 2 4$ , while it is possible for BlockBERT to work on it.
|
| 280 |
+
|
| 281 |
+
<table><tr><td>B×N</td><td>8×1024</td><td>16×1024</td><td>24×1024</td><td>32×1024</td></tr><tr><td>RoBERTa</td><td>0.1371</td><td>OOM</td><td>0OM</td><td>OOM</td></tr><tr><td>BlockBERT n=2</td><td>0.0990</td><td>0.1869</td><td>0OM</td><td>0OM</td></tr><tr><td>BlockBERT n=3</td><td>0.0954</td><td>0.1790</td><td>0.2634</td><td>OOM</td></tr></table>
|
| 282 |
+
|
| 283 |
+
Table 7: Test time statistics (sec) for different input size (Batch size $\times$ Sequence length). OOM indicates out-of-memory.
|
md/train/H1gsz30cKX/H1gsz30cKX.md
ADDED
|
@@ -0,0 +1,437 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# FIXUP INITIALIZATION: RESIDUAL LEARNING WITHOUT NORMALIZATION
|
| 2 |
+
|
| 3 |
+
Hongyi Zhang∗ MIT hongyiz@mit.edu
|
| 4 |
+
|
| 5 |
+
Yann N. Dauphin† Google Brain yann@dauphin.io
|
| 6 |
+
|
| 7 |
+
Tengyu Ma‡
|
| 8 |
+
Stanford University
|
| 9 |
+
tengyuma@stanford.edu
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
Normalization layers are a staple in state-of-the-art deep neural network architectures. They are widely believed to stabilize training, enable higher learning rate, accelerate convergence and improve generalization, though the reason for their effectiveness is still an active research topic. In this work, we challenge the commonly-held beliefs by showing that none of the perceived benefits is unique to normalization. Specifically, we propose fixed-update initialization (Fixup), an initialization motivated by solving the exploding and vanishing gradient problem at the beginning of training via properly rescaling a standard initialization. We find training residual networks with Fixup to be as stable as training with normalization — even for networks with 10,000 layers. Furthermore, with proper regularization, Fixup enables residual networks without normalization to achieve state-of-the-art performance in image classification and machine translation.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Artificial intelligence applications have witnessed major advances in recent years. At the core of this revolution is the development of novel neural network models and their training techniques. For example, since the landmark work of He et al. (2016), most of the state-of-the-art image recognition systems are built upon a deep stack of network blocks consisting of convolutional layers and additive skip connections, with some normalization mechanism (e.g., batch normalization (Ioffe & Szegedy, 2015)) to facilitate training and generalization. Besides image classification, various normalization techniques (Ulyanov et al., 2016; Ba et al., 2016; Salimans & Kingma, 2016; Wu & He, 2018) have been found essential to achieving good performance on other tasks, such as machine translation (Vaswani et al., 2017) and generative modeling (Zhu et al., 2017). They are widely believed to have multiple benefits for training very deep neural networks, including stabilizing learning, enabling higher learning rate, accelerating convergence, and improving generalization.
|
| 18 |
+
|
| 19 |
+
Despite the enormous empirical success of training deep networks with normalization, and recent progress on understanding the working of batch normalization (Santurkar et al., 2018), there is currently no general consensus on why these normalization techniques help training residual neural networks. Intrigued by this topic, in this work we study
|
| 20 |
+
|
| 21 |
+
(i) without normalization, can a deep residual network be trained reliably? (And if so,) (ii) without normalization, can a deep residual network be trained with the same learning rate, converge at the same speed, and generalize equally well (or even better)?
|
| 22 |
+
|
| 23 |
+
Perhaps surprisingly, we find the answers to both questions are Yes. In particular, we show:
|
| 24 |
+
|
| 25 |
+
• Why normalization helps training. We derive a lower bound for the gradient norm of a residual network at initialization, which explains why with standard initializations, normalization techniques are essential for training deep residual networks at maximal learning rate. (Section 2)
|
| 26 |
+
|
| 27 |
+
• Training without normalization. We propose Fixup, a method that rescales the standard initialization of residual branches by adjusting for the network architecture. Fixup enables training very deep residual networks stably at maximal learning rate without normalization. (Section 3)
|
| 28 |
+
|
| 29 |
+
• Image classification. We apply Fixup to replace batch normalization on image classification benchmarks CIFAR-10 (with Wide-ResNet) and ImageNet (with ResNet), and find Fixup with proper regularization matches the well-tuned baseline trained with normalization. (Section 4.2)
|
| 30 |
+
|
| 31 |
+
• Machine translation. We apply Fixup to replace layer normalization on machine translation benchmarks IWSLT and WMT using the Transformer model, and find it outperforms the baseline and achieves new state-of-the-art results on the same architecture. (Section 4.3)
|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
Figure 1: Left: ResNet basic block. Batch normalization (Ioffe & Szegedy, 2015) layers are marked in red. Middle: A simple network block that trains stably when stacked together. Right: Fixup further improves by adding bias parameters. (See Section 3 for details.)
|
| 35 |
+
|
| 36 |
+
In the remaining of this paper, we first analyze the exploding gradient problem of residual networks at initialization in Section 2. To solve this problem, we develop Fixup in Section 3. In Section 4 we quantify the properties of Fixup and compare it against state-of-the-art normalization methods on real world benchmarks. A comparison with related work is presented in Section 5.
|
| 37 |
+
|
| 38 |
+
# 2 PROBLEM: RESNET WITH STANDARD INITIALIZATIONS LEAD TO EXPLODING GRADIENTS
|
| 39 |
+
|
| 40 |
+
Standard initialization methods (Glorot & Bengio, 2010; He et al., 2015; Xiao et al., 2018) attempt to set the initial parameters of the network such that the activations neither vanish nor explode. Unfortunately, it has been observed that without normalization techniques such as BatchNorm they do not account properly for the effect of residual connections and this causes exploding gradients. Balduzzi et al. (2017) characterizes this problem for ReLU networks, and we will generalize this to residual networks with positively homogenous activation functions. A plain (i.e. without normalization layers) ResNet with residual blocks $\{ F _ { 1 } , \ldots , F _ { L } \}$ and input $\mathbf { x } _ { \mathrm { 0 } }$ computes the activations as
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
\mathbf { x } _ { l } = \mathbf { x } _ { 0 } + \sum _ { i = 0 } ^ { l - 1 } F _ { i } ( \mathbf { x } _ { i } ) .
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
ResNet output variance grows exponentially with depth. Here we only consider the initialization, view the input $\mathbf { x } _ { \mathrm { 0 } }$ as fixed, and consider the randomness of the weight initialization. We analyze the variance of each layer $\mathbf { x } _ { l }$ , denoted by $\mathrm { V a r } [ { \bf x } _ { l } ]$ (which is technically defined as the sum of the variance of all the coordinates of $\mathbf { x } _ { l }$ .) For simplicity we assume the blocks are initialized to be zero mean, i.e., $\mathbb { E } [ F _ { l } ( \mathbf { x } _ { l } ) \mid \mathbf { x } _ { l } ] = 0$ . By $\mathbf { x } _ { l + 1 } = \mathbf { x } _ { l } + F _ { l } ( \mathbf { x } _ { l } )$ , and the law of total variance, we have $\mathrm { V a r } [ \mathbf { x } _ { l + 1 } ] = \mathbb { E } [ \mathrm { V a r } [ F ( \mathbf { x } _ { l } ) | \mathbf { x } _ { l } ] ] + \mathrm { V a r } ( \mathbf { x } _ { l } )$ . Resnet structure prevents $\mathbf { x } _ { l }$ from vanishing by forcing the variance to grow with depth, i.e. $\mathrm { V a r } [ \mathbf { x } _ { l } ] < \mathrm { V a r } [ \mathbf { x } _ { l + 1 } ]$ if $\mathbb { E } [ \mathrm { V a r } [ F ( \mathbf { x } _ { l } ) | \mathbf { x } _ { l } ] ] > 0$ . Yet, combined with initialization methods such as He et al. (2015), the output variance of each residual branch $\mathrm { V a r } [ F _ { l } ( \mathbf { x } _ { l } ) | \mathbf { x } _ { l } ]$ will be about the same as its input variance $\mathrm { V a r } [ \mathbf { x } _ { l } ]$ , and thus $\mathrm { V a r } [ \mathbf { x } _ { l + 1 } ] \approx 2 \mathrm { V a r } [ \mathbf { x } _ { l } ]$ . This causes the output variance to explode exponentially with depth without normalization (Hanin & Rolnick, 2018) for positively homogeneous blocks (see Definition 1). This is detrimental to learning because it can in turn cause gradient explosion.
|
| 47 |
+
|
| 48 |
+
As we will show, at initialization, the gradient norm of certain activations and weight tensors is lower bounded by the cross-entropy loss up to some constant. Intuitively, this implies that blowup in the logits will cause gradient explosion. Our result applies to convolutional and linear weights in a neural network with ReLU nonlinearity (e.g., feed-forward network, CNN), possibly with skip connections (e.g., ResNet, DenseNet), but without any normalization.
|
| 49 |
+
|
| 50 |
+
Our analysis utilizes properties of positively homogeneous functions, which we now introduce.
|
| 51 |
+
|
| 52 |
+
Definition 1 (positively homogeneous function of first degree). A function $f : \mathbb { R } ^ { m } \mathbb { R } ^ { n }$ is called positively homogeneous (of first degree) (p.h.) if for any input $\mathbf { x } \in \mathbb { R } ^ { m }$ and $\alpha > 0$ , $f ( \alpha \mathbf { x } ) = \alpha f ( \mathbf { x } )$ .
|
| 53 |
+
|
| 54 |
+
Definition 2 (positively homogeneous set of first degree). Let $\theta = \{ \theta _ { i } \} _ { i \in S }$ be the set of parameters of $f ( \mathbf { x } )$ and $\bar { \theta _ { p h } } = \{ \bar { \theta } _ { i } \} _ { i \in S _ { p h } \subset S }$ . We call $\theta _ { p h }$ a positively homogeneous set (of first degree) (p.h. set) if for any $\alpha > 0$ , $f ( { \bf { x } } ; \theta \dot { \bf { \delta } } \theta _ { p h } , \alpha \theta _ { p h } ) = \alpha f ( { \bf { x } } ; \theta \dot { \bf { \delta } } \theta _ { p h } , \theta _ { p h } )$ , where $\alpha \theta _ { p h }$ denotes $\{ \alpha \theta _ { i } \} _ { i \in S _ { p h } }$ .
|
| 55 |
+
|
| 56 |
+
Intuitively, a p.h. set is a set of parameters $\theta _ { p h }$ in function $f$ such that for any fixed input $\mathbf { x }$ and fixed parameters $\theta \setminus \theta _ { p h } , \bar { f } ( \theta _ { p h } ) \triangleq f ( \mathbf { x } ; \theta \setminus \theta _ { p h } , \theta _ { p h } )$ is a p.h. function.
|
| 57 |
+
|
| 58 |
+
Examples of p.h. functions are ubiquitous in neural networks, including various kinds of linear operations without bias (fully-connected (FC) and convolution layers, pooling, addition, concatenation and dropout etc.) as well as ReLU nonlinearity. Moreover, we have the following claim:
|
| 59 |
+
|
| 60 |
+
Proposition 1. A function that is the composition of p.h. functions is itself p.h.
|
| 61 |
+
|
| 62 |
+
We study classification problems with $c$ classes and the cross-entropy loss. We use $f$ to denote a neural network function except for the softmax layer. Cross-entropy loss is defined as $\ell ( \mathbf { z } , \mathbf { y } ) \triangleq$ $- \mathbf { y } ^ { T } ( \mathbf { z } - \mathsf { l o g s u m e x p } ( \mathbf { z } ) )$ where $\mathbf { y }$ is the one-hot label vector, $\mathbf { z } \triangleq f ( \mathbf { x } ) \in \mathbb { R } ^ { c }$ is the logits where $z _ { i }$ denotes its $i$ -th element, and $\begin{array} { r } { \mathsf { l o g s u m e x p } ( \mathbf { z } ) \triangleq \log \left( \sum _ { i \in [ c ] } \exp ( z _ { i } ) \right) } \end{array}$ . Consider a minibatch of training examples $\mathcal { D } _ { M } = \{ ( \mathbf { x } ^ { ( m ) } , \mathbf { y } ^ { ( m ) } ) \} _ { m = 1 } ^ { M }$ and the average cross-entropy loss $\ell _ { \mathrm { a v g } } ( { \mathcal D } _ { M } ) \triangleq$ $\begin{array} { r } { \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \ell ( f ( \mathbf { x } ^ { ( m ) } ) , \mathbf { y } ^ { ( m ) } ) } \end{array}$ , where we use $( m )$ to index quantities referring to the $m$ -th example. $\| \cdot \|$ denotes any valid norm. We only make the following assumptions about the network $f$ :
|
| 63 |
+
|
| 64 |
+
1. $f$ is a sequential composition of network blocks $\{ f _ { i } \} _ { i = 1 } ^ { L }$ , i.e. $f ( \mathbf { x } _ { 0 } ) = f _ { L } ( f _ { L - 1 } ( . . . f _ { 1 } ( \mathbf { x } _ { 0 } ) ) )$ , each of which is composed of p.h. functions. 2. Weight elements in the FC layer are i.i.d. sampled from a zero-mean symmetric distribution.
|
| 65 |
+
|
| 66 |
+
These assumptions hold at initialization if we remove all the normalization layers in a residual network with ReLU nonlinearity, assuming all the biases are initialized at 0.
|
| 67 |
+
|
| 68 |
+
Our results are summarized in the following two theorems, whose proofs are listed in the appendix: Theorem 1. Denote the input to the $i$ -th block by $\mathbf { x } _ { i - 1 }$ . With Assumption $^ { l }$ , we have
|
| 69 |
+
|
| 70 |
+
$$
|
| 71 |
+
\left\| \frac { \partial \ell } { \partial \mathbf { x } _ { i - 1 } } \right\| \geq \frac { \ell ( \mathbf { z } , \mathbf { y } ) - H ( \mathbf { p } ) } { \left\| \mathbf { x } _ { i - 1 } \right\| } ,
|
| 72 |
+
$$
|
| 73 |
+
|
| 74 |
+
where $\mathbf { p }$ is the softmax probabilities and $H$ denotes the Shannon entropy.
|
| 75 |
+
|
| 76 |
+
Since $H ( \mathbf { p } )$ is upper bounded by $\log ( c )$ and $\| \mathbf { x } _ { i - 1 } \|$ is small in the lower blocks, blowup in the loss will cause large gradient norm with respect to the lower block input. Our second theorem proves a lower bound on the gradient norm of a p.h. set in a network.
|
| 77 |
+
|
| 78 |
+
Theorem 2. With Assumption $^ { l }$ , we have
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\left\| \frac { \partial \ell _ { \mathrm { a v g } } } { \partial \theta _ { p h } } \right\| \geq \frac { 1 } { M \| \theta _ { p h } \| } \sum _ { m = 1 } ^ { M } \ell ( \mathbf { z } ^ { ( m ) } , \mathbf { y } ^ { ( m ) } ) - H ( \mathbf { p } ^ { ( m ) } ) \triangleq G ( \theta _ { p h } ) .
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
Furthermore, with Assumptions $I$ and 2, we have
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\mathbb { E } G ( \theta _ { p h } ) \geq \frac { \mathbb { E } [ \operatorname* { m a x } _ { i \in [ c ] } z _ { i } ] - \log ( c ) } { \| \theta _ { p h } \| } .
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
It remains to identify such p.h. sets in a neural network. In Figure 2 we provide three examples of p.h. sets in a ResNet without normalization. Theorem 2 suggests that these layers would suffer from the exploding gradient problem, if the logits $\mathbf { z }$ blow up at initialization, which unfortunately would occur in a ResNet without normalization if initialized in a traditional way. This motivates us to introduce a new initialization in the next section.
|
| 91 |
+
|
| 92 |
+

|
| 93 |
+
Figure 2: Examples of p.h. sets in a ResNet without normalization: (1) the first convolution layer before max pooling; (2) the fully connected layer before softmax; (3) the union of a spatial downsampling layer in the backbone and a convolution layer in its corresponding residual branch.
|
| 94 |
+
|
| 95 |
+
# 3 FIXUP: UPDATE A RESIDUAL NETWORK $\Theta ( \eta )$ PER SGD STEP
|
| 96 |
+
|
| 97 |
+
Our analysis in the previous section points out the failure mode of standard initializations for training deep residual network: the gradient norm of certain layers is in expectation lower bounded by a quantity that increases indefinitely with the network depth. However, escaping this failure mode does not necessarily lead us to successful training — after all, it is the whole network as a function that we care about, rather than a layer or a network block. In this section, we propose a top-down design of a new initialization that ensures proper update scale to the network function, by simply rescaling a standard initialization. To start, we denote the learning rate by $\eta$ and set our goal:
|
| 98 |
+
|
| 99 |
+
$f ( \mathbf { x } ; \theta )$ is updated by $\Theta ( \eta )$ per SGD step after initialization as $\eta 0$ . That is, $\| \Delta f ( \mathbf { x } ) \| = \Theta ( \eta )$ where $\begin{array} { r } { \Delta f ( \mathbf x ) \triangleq f ( \mathbf x ; \theta - \eta \frac { \partial } { \partial \theta } \ell ( f ( \mathbf x ) , \mathbf y ) ) - f ( \mathbf x ; \theta ) . } \end{array}$
|
| 100 |
+
|
| 101 |
+
Put another way, our goal is to design an initialization such that SGD updates to the network function are in the right scale and independent of the depth.
|
| 102 |
+
|
| 103 |
+
We define the Shortcut as the shortest path from input to output in a residual network. The Shortcut is typically a shallow network with a few trainable layers.1 We assume the Shortcut is initialized using a standard method, and focus on the initialization of the residual branches.
|
| 104 |
+
|
| 105 |
+
Residual branches update the network in sync. To start, we first make an important observation that the SGD update to each residual branch changes the network output in highly correlated directions. This implies that if a residual network has $L$ residual branches, then an SGD step to each residual branch should change the network output by $\Theta ( \eta / L )$ on average to achieve an overall $\Theta ( \eta )$ update. We defer the formal statement and its proof until Appendix B.1.
|
| 106 |
+
|
| 107 |
+
Study of a scalar branch. Next we study how to initialize a residual branch with $m$ layers so that its SGD update changes the network output by $\Theta ( \eta / L )$ . We assume $m$ is a small positive integer (e.g., 2 or 3). As we are only concerned about the scale of the update, it is sufficiently instructive to study the scalar case, i.e., $\begin{array} { r } { F ( x ) = ( \prod _ { i = 1 } ^ { m } a _ { i } ) x } \end{array}$ where $a _ { 1 } , \dots , a _ { m } , x \in \mathbb { R } ^ { + }$ . For example, the standard initialization methods typically initialize each layer so that the output (after nonlinear activation) preserves the input variance, which can be modeled as setting $\forall i \in [ m ] , a _ { i } = 1$ . In turn, setting $a _ { i }$ to a positive number other than 1 corresponds to rescaling the i-th layer by $a _ { i }$ .
|
| 108 |
+
|
| 109 |
+
Through deriving the constraints for $F ( x )$ to make $\Theta ( \eta / L )$ updates, we will also discover how to rescale the weight layers of a standard initialization as desired. In particular, we show the SGD update to $F ( x )$ is $\Theta ( \eta / L )$ if and only $i f$ the initialization satisfies the following constraint:
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\left( \prod _ { i \in [ m ] \setminus \{ j \} } a _ { i } \right) x = \Theta \left( { \frac { 1 } { \sqrt { L } } } \right) , \quad { \mathrm { w h e r e } } \quad j \in \arg \operatorname* { m i n } a _ { k }
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
We defer the derivation until Appendix B.2.
|
| 116 |
+
|
| 117 |
+
Equation (5) suggests new methods to initialize a residual branch through rescaling the standard initialization of i-th layer in a residual branch by its corresponding scalar $a _ { i }$ . For example, we could set $\forall i \in [ m ] , a _ { i } = L ^ { - { \frac { 1 } { 2 m - 2 } } }$ . Alternatively, we could start the residual branch as a zero function by setting $a _ { m } = 0$ and $\forall i \in [ m - 1 ] , a _ { i } = L ^ { - { \frac { 1 } { 2 m - 2 } } }$ . In the second option, the residual branch does not need to “unlearn” its potentially bad random initial state, which can be beneficial for learning. Therefore, we use the latter option in our experiments, unless otherwise specified.
|
| 118 |
+
|
| 119 |
+
The effects of biases and multipliers. With proper rescaling of the weights in all the residual branches, a residual network is supposed to be updated by $\Theta ( \eta )$ per SGD step — our goal is achieved. However, in order to match the training performance of a corresponding network with normalization, there are two more things to consider: biases and multipliers.
|
| 120 |
+
|
| 121 |
+
Using biases in the linear and convolution layers is a common practice. In normalization methods, bias and scale parameters are typically used to restore the representation power after normalization.2 Intuitively, because the preferred input/output mean of a weight layer may be different from the preferred output/input mean of an activation layer, it also helps to insert bias terms in a residual network without normalization. Empirically, we find that inserting just one scalar bias before each weight layer and nonlinear activation layer significantly improves the training performance.
|
| 122 |
+
|
| 123 |
+
Multipliers scale the output of a residual branch, similar to the scale parameters in batch normalization. They have an interesting effect on the learning dynamics of weight layers in the same branch. Specifically, as the stochastic gradient of a layer is typically almost orthogonal to its weight, learning rate decay tends to cause the weight norm equilibrium to shrink when combined with L2 weight decay (van Laarhoven, 2017). In a branch with multipliers, this in turn causes the growth of the multipliers, increasing the effective learning rate of other layers. In particular, we observe that inserting just one scalar multiplier per residual branch mimics the weight norm dynamics of a network with normalization, and spares us the search of a new learning rate schedule.
|
| 124 |
+
|
| 125 |
+
Put together, we propose the following method to train residual networks without normalization:
|
| 126 |
+
|
| 127 |
+
Fixup initialization (or: How to train a deep residual network without normalization)
|
| 128 |
+
|
| 129 |
+
1. Initialize the classification layer and the last layer of each residual branch to 0.
|
| 130 |
+
2. Initialize every other layer using a standard method (e.g., He et al. (2015)), and scale only the weight layers inside residual branches by $L ^ { - } { \frac { 1 } { 2 m - 2 } }$ .
|
| 131 |
+
3. Add a scalar multiplier (initialized at 1) in every branch and a scalar bias (initialized at 0) before each convolution, linear, and element-wise activation layer.
|
| 132 |
+
|
| 133 |
+
It is important to note that Rule 2 of Fixup is the essential part as predicted by Equation (5). Indeed, we observe that using Rule 2 alone is sufficient and necessary for training extremely deep residual networks. On the other hand, Rule 1 and Rule 3 make further improvements for training so as to match the performance of a residual network with normalization layers, as we explain in the above text.3 We find ablation experiments confirm our claims (see Appendix C.1).
|
| 134 |
+
|
| 135 |
+
Our initialization and network design is consistent with recent theoretical work Hardt & Ma (2016); Li et al. (2018), which, in much more simplified settings such as linearized residual nets and quadratic neural nets, propose that small initialization tend to stabilize optimization and help generalizaiton. However, our approach suggests that more delicate control of the scale of the initialization is beneficial.4
|
| 136 |
+
|
| 137 |
+
# 4 EXPERIMENTS
|
| 138 |
+
|
| 139 |
+
# 4.1 TRAINING AT INCREASING DEPTH
|
| 140 |
+
|
| 141 |
+
One of the key advatanges of BatchNorm is that it leads to fast training even for very deep models (Ioffe & Szegedy, 2015). Here we will determine if we can match this desirable property by relying only on proper initialization. We propose to evaluate how each method affects training very deep nets by measuring the test accuracy after the first epoch as we increase depth. In particular, we use the wide residual network (WRN) architecture with width 1 and the default weight decay $5 \mathrm { e } { - 4 }$ (Zagoruyko & Komodakis, 2016). We specifically use the default learning rate of 0.1 because the ability to use high learning rates is considered to be important to the success of BatchNorm. We compare Fixup against three baseline methods — (1) rescale the output of each residual block by $\scriptstyle { \frac { 1 } { \sqrt { 2 } } }$ (Balduzzi et al., 2017), (2) post-process an orthogonal initialization such that the output variance of each residual block is close to 1 (Layer-sequential unit-variance orthogonal initialization, or LSUV) (Mishkin & Matas, 2015), (3) batch normalization (Ioffe & Szegedy, 2015). We use the default batch size of 128 up to 1000 layers, with a batch size of 64 for 10,000 layers. We limit our budget of epochs to 1 due to the computational strain of evaluating models with up to 10,000 layers.
|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
Figure 3: Depth of residual networks versus test accuracy at the first epoch for various methods on CIFAR-10 with the default BatchNorm learning rate. We observe that Fixup is able to train very deep networks with the same learning rate as batch normalization. (Higher is better.)
|
| 145 |
+
|
| 146 |
+
Figure 3 shows the test accuracy at the first epoch as depth increases. Observe that Fixup matches the performance of BatchNorm at the first epoch, even with 10,000 layers. LSUV and $\\\bar { \sqrt { { ^ 1 \mathord { \left/ { \vphantom { ^ { 1 2 } } } \right. \kern - delimiterspace } 2 } } }$ -scaling are not able to train with the same learning rate as BatchNorm past 100 layers.
|
| 147 |
+
|
| 148 |
+
# 4.2 IMAGE CLASSIFICATION
|
| 149 |
+
|
| 150 |
+
In this section, we evaluate the ability of Fixup to replace batch normalization in image classification applications. On the CIFAR-10 dataset, we first test on ResNet-110 (He et al., 2016) with default hyper-parameters; results are shown in Table 1. Fixup obtains $7 \%$ relative improvement in test error compared with standard initialization; however, we note a substantial difference in the difficulty of training. While network with Fixup is trained with the same learning rate and converge as fast as network with batch normalization, we fail to train a Xavier initialized ResNet-110 with $0 . 1 \mathbf { x }$ maximal learning rate.5 The test error gap in Table 1 is likely due to the regularization effect of BatchNorm rather than difficulty in optimization; when we train Fixup networks with better regularization, the test error gap disappears and we obtain state-of-the-art results on CIFAR-10 and SVHN without normalization layers (see Appendix C.2).
|
| 151 |
+
|
| 152 |
+
Table 1: Results on CIFAR-10 with ResNet-110 (mean/median of 5 runs; lower is better).
|
| 153 |
+
|
| 154 |
+
<table><tr><td>Dataset</td><td>ResNet-110</td><td>Normalization</td><td>Large n</td><td>Test Error (%)</td></tr><tr><td rowspan="3">CIFAR-10</td><td>w/ BatchNorm (He et al., 2016)</td><td>√</td><td>√</td><td>6.61</td></tr><tr><td>w/ Xavier Init (Shang et al., 2017)</td><td>X</td><td>×</td><td>7.78</td></tr><tr><td>w/ Fixup-init</td><td>X</td><td></td><td>7.24</td></tr></table>
|
| 155 |
+
|
| 156 |
+
On the ImageNet dataset, we benchmark Fixup with the ResNet-50 and ResNet-101 architectures (He et al., 2016), trained for 100 epochs and 200 epochs respectively. Similar to our finding on the CIFAR-10 dataset, we observe that (1) training with Fixup is fast and stable with the default hyperparameters, (2) Fixup alone significantly improves the test error of standard initialization, and (3) there is a large test error gap between Fixup and BatchNorm. Further inspection reveals that Fixup initialized models obtain significantly lower training error compared with BatchNorm models (see Appendix C.3), i.e., Fixup suffers from overfitting. We therefore apply stronger regularization to the Fixup models using Mixup (Zhang et al., 2017). We find it is beneficial to reduce the learning rate of the scalar multiplier and bias by 10x when additional large regularization is used. Best Mixup coefficients are found through cross-validation: they are 0.2, 0.1 and 0.7 for BatchNorm, GroupNorm (Wu & He, 2018) and Fixup respectively. We present the results in Table 2, noting that with better regularization, the performance of Fixup is on par with GroupNorm.
|
| 157 |
+
|
| 158 |
+
Table 2: ImageNet test results using the ResNet architecture. (Lower is better.)
|
| 159 |
+
|
| 160 |
+
<table><tr><td>Model</td><td>Method</td><td>Normalization</td><td>Test Error (%)</td></tr><tr><td rowspan="5">ResNet-50</td><td>BatchNorm (Goyal et al., 2017)</td><td rowspan="4">√</td><td>23.6</td></tr><tr><td>BatchNorm + Mixup (Zhang et al.,2017)</td><td>23.3</td></tr><tr><td>GroupNorm + Mixup</td><td>23.9</td></tr><tr><td>Xavier Init (Shang et al.,2017)</td><td>31.5</td></tr><tr><td>Fixup-init</td><td rowspan="3">X</td><td>27.6</td></tr><tr><td>Fixup-init + Mixup</td><td>24.0</td></tr><tr><td>BatchNorm (Zhang et al., 2017)</td><td>22.0</td></tr><tr><td rowspan="3">ResNet-101</td><td>BatchNorm + Mixup (Zhang et al., 2017)</td><td rowspan="3">√</td><td>20.8</td></tr><tr><td>GroupNorm + Mixup</td><td>21.4</td></tr><tr><td>Fixup-init + Mixup X</td><td>21.4</td></tr></table>
|
| 161 |
+
|
| 162 |
+
# 4.3 MACHINE TRANSLATION
|
| 163 |
+
|
| 164 |
+
To demonstrate the generality of Fixup, we also apply it to replace layer normalization (Ba et al., 2016) in Transformer (Vaswani et al., 2017), a state-of-the-art neural network for machine translation. Specifically, we use the fairseq library (Gehring et al., 2017) and follow the Fixup template in Section 3 to modify the baseline model. We evaluate on two standard machine translation datasets, IWSLT German-English (de-en) and WMT English-German (en-de) following the setup of Ott et al. (2018). For the IWSLT de-en dataset, we cross-validate the dropout probability from $\{ 0 . 3 , 0 . 4 , 0 . 5 , 0 . 6 \}$ and find 0.5 to be optimal for both Fixup and the LayerNorm baseline. For the WMT’16 en-de dataset, we use dropout probability 0.4. All models are trained for $2 0 0 \mathrm { k }$ updates.
|
| 165 |
+
|
| 166 |
+
It was reported (Chen et al., 2018) that “Layer normalization is most critical to stabilize the training process... removing layer normalization results in unstable training runs”. However we find training with Fixup to be very stable and as fast as the baseline model. Results are shown in Table 3. Surprisingly, we find the models do not suffer from overfitting when LayerNorm is replaced by Fixup, thanks to the strong regularization effect of dropout. Instead, Fixup matches or supersedes the state-of-the-art results using Transformer model on both datasets.
|
| 167 |
+
|
| 168 |
+
Table 3: Comparing Fixup vs. LayerNorm for machine translation tasks. (Higher is better.)
|
| 169 |
+
|
| 170 |
+
<table><tr><td>Dataset</td><td>Model</td><td>Normalization</td><td>BLEU</td></tr><tr><td rowspan="2">IWSLT DE-EN</td><td>(Deng et al., 2018) LayerNorm</td><td>√</td><td>33.1 34.2</td></tr><tr><td>Fixup-init</td><td>X</td><td>34.5</td></tr><tr><td rowspan="3">WMT EN-DE</td><td>(Vaswani et al., 2017)</td><td></td><td>28.4</td></tr><tr><td>LayerNorm (Ott et al., 2018)</td><td>√</td><td>29.3</td></tr><tr><td>Fixup-init</td><td>×</td><td>29.3</td></tr></table>
|
| 171 |
+
|
| 172 |
+
# 5 RELATED WORK
|
| 173 |
+
|
| 174 |
+
Normalization methods. Normalization methods have enabled training very deep residual networks, and are currently an essential building block of the most successful deep learning architectures. All normalization methods for training neural networks explicitly normalize (i.e. standardize) some component (activations or weights) through dividing activations or weights by some real number computed from its statistics and/or subtracting some real number activation statistics (typically the mean) from the activations.6 In contrast, Fixup does not compute statistics (mean, variance or norm) at initialization or during any phase of training, hence is not a normalization method.
|
| 175 |
+
|
| 176 |
+
Theoretical analysis of deep networks. Training very deep neural networks is an important theoretical problem. Early works study the propagation of variance in the forward and backward pass for different activation functions (Glorot & Bengio, 2010; He et al., 2015).
|
| 177 |
+
|
| 178 |
+
Recently, the study of dynamical isometry (Saxe et al., 2013) provides a more detailed characterization of the forward and backward signal propogation at initialization (Pennington et al., 2017; Hanin, 2018), enabling training 10,000-layer CNNs from scratch (Xiao et al., 2018). For residual networks, activation scale (Hanin & Rolnick, 2018), gradient variance (Balduzzi et al., 2017) and dynamical isometry property (Yang & Schoenholz, 2017) have been studied. Our analysis in Section 2 leads to the similar conclusion as previous work that the standard initialization for residual networks is problematic. However, our use of positive homogeneity for lower bounding the gradient norm of a neural network is novel, and applies to a broad class of neural network architectures (e.g., ResNet, DenseNet) and initialization methods (e.g., Xavier, LSUV) with simple assumptions and proof.
|
| 179 |
+
|
| 180 |
+
Hardt & Ma (2016) analyze the optimization landscape (loss surface) of linearized residual nets in the neighborhood around the zero initialization where all the critical points are proved to be global minima. Yang & Schoenholz (2017) study the effect of the initialization of residual nets to the test performance and pointed out Xavier or He initialization scheme is not optimal. In this paper, we give a concrete recipe for the initialization scheme with which we can train deep residual networks without batch normalization successfully.
|
| 181 |
+
|
| 182 |
+
Understanding batch normalization. Despite its popularity in practice, batch normalization has not been well understood. Ioffe & Szegedy (2015) attributed its success to “reducing internal covariate shift”, whereas Santurkar et al. (2018) argued that its effect may be “smoothing loss surface”. Our analysis in Section 2 corroborates the latter idea of Santurkar et al. (2018) by showing that standard initialization leads to very steep loss surface at initialization. Moreover, we empirically showed in Section 3 that steep loss surface may be alleviated for residual networks by using smaller initialization than the standard ones such as Xavier or He’s initialization in residual branches. van Laarhoven (2017); Hoffer et al. (2018) studied the effect of (batch) normalization and weight decay on the effective learning rate. Their results inspire us to include a multiplier in each residual branch.
|
| 183 |
+
|
| 184 |
+
ResNet initialization in practice. Gehring et al. (2017); Balduzzi et al. (2017) proposed to address the initialization problem of residual nets by using the recurrence $\mathbf { x } _ { l } = \sqrt { 1 / _ { 2 } } ( \mathbf { x } _ { l - 1 } + F _ { l } ( \mathbf { x } _ { l - 1 } ) )$ . Mishkin & Matas (2015) proposed a data-dependent initialization to mimic the effect of batch normalization in the first forward pass. While both methods limit the scale of activation and gradient, they would fail to train stably at the maximal learning rate for very deep residual networks, since they fail to consider the accumulation of highly correlated updates contributed by different residual branches to the network function (Appendix B.1). Srivastava et al. (2015); Hardt & Ma (2016); Goyal et al. (2017); Kingma & Dhariwal (2018) found that initializing the residual branches at (or close to) zero helped optimization. Our results support their observation in general, but Equation (5) suggests additional subtleties when choosing a good initialization scheme.
|
| 185 |
+
|
| 186 |
+
# 6 CONCLUSION
|
| 187 |
+
|
| 188 |
+
In this work, we study how to train a deep residual network reliably without normalization. Our theory in Section 2 suggests that the exploding gradient problem at initialization in a positively homogeneous network such as ResNet is directly linked to the blowup of logits. In Section 3 we develop Fixup initialization to ensure the whole network as well as each residual branch gets updates of proper scale, based on a top-down analysis. Extensive experiments on real world datasets demonstrate that Fixup matches normalization techniques in training deep residual networks, and achieves state-of-the-art test performance with proper regularization.
|
| 189 |
+
|
| 190 |
+
Our work opens up new possibilities for both theory and applications. Can we analyze the training dynamics of Fixup, which may potentially be simpler than analyzing models with batch normalization is? Could we apply or extend the initialization scheme to other applications of deep learning? It would also be very interesting to understand the regularization benefits of various normalization methods, and to develop better regularizers to further improve the test performance of Fixup.
|
| 191 |
+
|
| 192 |
+
# ACKNOWLEDGMENTS
|
| 193 |
+
|
| 194 |
+
The authors would like to thank Yuxin Wu, Kaiming He, Aleksander Madry and the anonymous reviewers for their helpful feedback.
|
| 195 |
+
|
| 196 |
+
# REFERENCES
|
| 197 |
+
|
| 198 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 199 |
+
|
| 200 |
+
David Balduzzi, Marcus Frean, Lennox Leary, JP Lewis, Kurt Wan-Duo Ma, and Brian McWilliams. The shattered gradients problem: If resnets are the answer, then what is the question? arXiv preprint arXiv:1702.08591, 2017.
|
| 201 |
+
|
| 202 |
+
Mia Xu Chen, Orhan Firat, Ankur Bapna, Melvin Johnson, Wolfgang Macherey, George Foster, Llion Jones, Niki Parmar, Mike Schuster, Zhifeng Chen, et al. The best of both worlds: Combining recent advances in neural machine translation. arXiv preprint arXiv:1804.09849, 2018.
|
| 203 |
+
|
| 204 |
+
Yuntian Deng, Yoon Kim, Justin Chiu, Demi Guo, and Alexander M Rush. Latent alignment and variational attention. Thirty-second Conference on Neural Information Processing Systems (NIPS), 2018.
|
| 205 |
+
|
| 206 |
+
Terrance DeVries and Graham W Taylor. Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552, 2017.
|
| 207 |
+
|
| 208 |
+
Jonas Gehring, Michael Auli, David Grangier, Denis Yarats, and Yann N Dauphin. Convolutional Sequence to Sequence Learning. In Proc. of ICML, 2017.
|
| 209 |
+
|
| 210 |
+
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, pp. 249–256, 2010.
|
| 211 |
+
|
| 212 |
+
Priya Goyal, Piotr Dollar, Ross Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, An-´ drew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch sgd: training imagenet in 1 hour. arXiv preprint arXiv:1706.02677, 2017.
|
| 213 |
+
|
| 214 |
+
Benjamin Graham. Fractional max-pooling. arXiv preprint arXiv:1412.6071, 2014.
|
| 215 |
+
|
| 216 |
+
Boris Hanin. Which neural net architectures give rise to exploding and vanishing gradients? arXiv preprint arXiv:1801.03744, 2018.
|
| 217 |
+
|
| 218 |
+
Boris Hanin and David Rolnick. How to start training: The effect of initialization and architecture. arXiv preprint arXiv:1803.01719, 2018.
|
| 219 |
+
|
| 220 |
+
Moritz Hardt and Tengyu Ma. Identity matters in deep learning. arXiv preprint arXiv:1611.04231, 2016.
|
| 221 |
+
|
| 222 |
+
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, pp. 1026–1034, 2015.
|
| 223 |
+
|
| 224 |
+
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.
|
| 225 |
+
|
| 226 |
+
David J Heeger. Normalization of cell responses in cat striate cortex. Visual neuroscience, 9(2): 181–197, 1992.
|
| 227 |
+
|
| 228 |
+
Elad Hoffer, Ron Banner, Itay Golan, and Daniel Soudry. Norm matters: efficient and accurate normalization schemes in deep networks. arXiv preprint arXiv:1803.01814, 2018.
|
| 229 |
+
|
| 230 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 231 |
+
|
| 232 |
+
Diederik P Kingma and Prafulla Dhariwal. Glow: Generative flow with invertible 1x1 convolutions. arXiv preprint arXiv:1807.03039, 2018.
|
| 233 |
+
|
| 234 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012.
|
| 235 |
+
|
| 236 |
+
Chen-Yu Lee, Patrick W Gallagher, and Zhuowen Tu. Generalizing pooling functions in convolutional neural networks: Mixed, gated, and tree. In Artificial Intelligence and Statistics, pp. 464–472, 2016.
|
| 237 |
+
|
| 238 |
+
Yuanzhi Li, Tengyu Ma, and Hongyang Zhang. Algorithmic regularization in over-parameterized matrix recovery. Conference on Learning Theory (COLT), 2018.
|
| 239 |
+
|
| 240 |
+
Siwei Lyu and Eero P Simoncelli. Nonlinear image representation using divisive normalization. In Computer Vision and Pattern Recognition, 2008. CVPR 2008. IEEE Conference on, pp. 1–8. IEEE, 2008.
|
| 241 |
+
|
| 242 |
+
Dmytro Mishkin and Jiri Matas. All you need is a good init. arXiv preprint arXiv:1511.06422, 2015.
|
| 243 |
+
|
| 244 |
+
Myle Ott, Sergey Edunov, David Grangier, and Michael Auli. Scaling neural machine translation. arXiv preprint arXiv:1806.00187, 2018.
|
| 245 |
+
|
| 246 |
+
Jeffrey Pennington, Samuel Schoenholz, and Surya Ganguli. Resurrecting the sigmoid in deep learning through dynamical isometry: theory and practice. In Advances in neural information processing systems, pp. 4785–4795, 2017.
|
| 247 |
+
|
| 248 |
+
Nicolas Pinto, David D Cox, and James J DiCarlo. Why is real-world visual object recognition hard? PLoS computational biology, 4(1):e27, 2008.
|
| 249 |
+
|
| 250 |
+
Tim Salimans and Diederik P Kingma. Weight normalization: A simple reparameterization to accelerate training of deep neural networks. In Advances in Neural Information Processing Systems, pp. 901–909, 2016.
|
| 251 |
+
|
| 252 |
+
Shibani Santurkar, Dimitris Tsipras, Andrew Ilyas, and Aleksander Madry. How does batch normalization help optimization?(no, it is not about internal covariate shift). arXiv preprint arXiv:1805.11604, 2018.
|
| 253 |
+
|
| 254 |
+
Andrew M Saxe, James L McClelland, and Surya Ganguli. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. arXiv preprint arXiv:1312.6120, 2013.
|
| 255 |
+
|
| 256 |
+
Wenling Shang, Justin Chiu, and Kihyuk Sohn. Exploring normalization in deep residual networks with concatenated rectified linear units. In AAAI, pp. 1509–1516, 2017.
|
| 257 |
+
Rupesh Kumar Srivastava, Klaus Greff, and Jurgen Schmidhuber. Highway networks. ¨ arXiv preprint arXiv:1505.00387, 2015.
|
| 258 |
+
Dmitry Ulyanov, Andrea Vedaldi, and Victor S. Lempitsky. Instance normalization: The missing ingredient for fast stylization. CoRR, abs/1607.08022, 2016.
|
| 259 |
+
Twan van Laarhoven. L2 regularization versus batch and weight normalization. arXiv preprint arXiv:1706.05350, 2017.
|
| 260 |
+
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.
|
| 261 |
+
Yuxin Wu and Kaiming He. Group normalization. In The European Conference on Computer Vision (ECCV), September 2018.
|
| 262 |
+
Lechao Xiao, Yasaman Bahri, Jascha Sohl-Dickstein, Samuel S Schoenholz, and Jeffrey Pennington. Dynamical isometry and a mean field theory of cnns: How to train 10,000-layer vanilla convolutional neural networks. arXiv preprint arXiv:1806.05393, 2018.
|
| 263 |
+
Yoshihiro Yamada, Masakazu Iwamura, and Koichi Kise. Shakedrop regularization. arXiv preprint arXiv:1802.02375, 2018.
|
| 264 |
+
Ge Yang and Samuel Schoenholz. Mean field residual networks: On the edge of chaos. In Advances in neural information processing systems, pp. 7103–7114, 2017.
|
| 265 |
+
Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. arXiv preprint arXiv:1605.07146, 2016.
|
| 266 |
+
Hongyi Zhang, Moustapha Cisse, Yann N Dauphin, and David Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017.
|
| 267 |
+
Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In Computer Vision (ICCV), 2017 IEEE International Conference on, 2017.
|
| 268 |
+
|
| 269 |
+
# A PROOFS FOR SECTION 2
|
| 270 |
+
|
| 271 |
+
# A.1 GRADIENT NORM LOWER BOUND FOR THE INPUT TO A NETWORK BLOCK
|
| 272 |
+
|
| 273 |
+
Proof of Theorem $^ { l }$ . We use $f _ { i \to j }$ to denote the composition $f _ { j } \circ f _ { j - 1 } \circ \cdots \circ f _ { i }$ , so that $\mathbf { z } =$ $f _ { i \to L } ( \mathbf { x } _ { i - 1 } )$ for all $i \in [ L ]$ . Note that $\mathbf { z }$ is p.h. with respect to the input of each network block, i.e. $f _ { i \to L } ( ( 1 + \epsilon ) \mathbf { x } _ { i - 1 } ) = ( 1 + \epsilon ) f _ { i \to L } ( \mathbf { x } _ { i - 1 } )$ for $\epsilon > - 1$ . This allows us to compute the gradient of the cross-entropy loss with respect to the scaling factor $\epsilon$ at $\epsilon = 0$ as
|
| 274 |
+
|
| 275 |
+
$$
|
| 276 |
+
\left. { \frac { \partial } { \partial \epsilon } } \ell ( f _ { i \to L } ( ( 1 + \epsilon ) { \bf x } _ { i - 1 } ) , { \bf y } ) \right| _ { \epsilon = 0 } = { \frac { \partial \ell } { \partial { \bf z } } } { \frac { \partial f _ { i \to L } } { \partial \epsilon } } = - { \bf y } ^ { T } { \bf z } + { \bf p } ^ { T } { \bf z } = \ell ( { \bf z } , { \bf y } ) - H ( { \bf p } )
|
| 277 |
+
$$
|
| 278 |
+
|
| 279 |
+
Since the gradient $L _ { 2 }$ norm $\| \partial \ell / \partial { \bf x } _ { i - 1 } \|$ must be greater than the directional derivative $\begin{array} { r } { \frac { \partial } { \partial t } \ell ( f _ { i L } ( \mathbf x _ { i - 1 } + t \frac { \mathbf x _ { i - 1 } } { \parallel \mathbf x _ { i - 1 } \parallel } ) , \mathbf y ) } \end{array}$ k, defining $\epsilon = { t } / { | | { \bf x } _ { i - 1 } | | }$ we have
|
| 280 |
+
|
| 281 |
+
$$
|
| 282 |
+
\| \frac { \partial \ell } { \partial \mathbf { x } _ { i - 1 } } \| \geq \frac { \partial } { \partial \epsilon } \ell ( f _ { i L } ( \mathbf { x } _ { i - 1 } + \epsilon \mathbf { x } _ { i - 1 } ) , \mathbf { y } ) \frac { \partial \epsilon } { \partial t } = \frac { \ell ( \mathbf { z } , \mathbf { y } ) - H ( \mathbf { p } ) } { \| \mathbf { x } _ { i - 1 } \| } .
|
| 283 |
+
$$
|
| 284 |
+
|
| 285 |
+
Proof of Theorem 2. The proof idea is similar. Recall that if $\theta _ { p h }$ is a p.h. set, then $\bar { f } ^ { ( m ) } ( \theta _ { p h } )$ , $f ( \mathbf { x } ^ { ( m ) } ; \theta \setminus \theta _ { p h } , \theta _ { p h } )$ is a p.h. function. We therefore have
|
| 286 |
+
|
| 287 |
+
$$
|
| 288 |
+
\frac { \partial } { \partial \epsilon } \ell _ { \mathrm { a v g } } ( \mathcal { D } _ { M } ; ( 1 + \epsilon ) \theta _ { p h } ) \bigg | _ { \epsilon = 0 } = \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \frac { \partial \ell } { \partial \mathbf { z } ^ { ( m ) } } \frac { \partial \bar { f } ^ { ( m ) } } { \partial \epsilon } = \frac { 1 } { M } \sum _ { m = 1 } ^ { M } \ell ( \mathbf { z } ^ { ( m ) } , \mathbf { y } ^ { ( m ) } ) - H ( \mathbf { p } ^ { ( m ) } )
|
| 289 |
+
$$
|
| 290 |
+
|
| 291 |
+
hence we again invoke the directional derivative argument to show
|
| 292 |
+
|
| 293 |
+
$$
|
| 294 |
+
\left\| \frac { \partial \ell _ { \mathrm { a v g } } } { \partial \theta _ { p h } } \right\| \geq \frac { 1 } { M \| \theta _ { p h } \| } \sum _ { m = 1 } ^ { M } \ell ( \mathbf { z } ^ { ( m ) } , \mathbf { y } ^ { ( m ) } ) - H ( \mathbf { p } ^ { ( m ) } ) \triangleq G ( \theta _ { p h } ) .
|
| 295 |
+
$$
|
| 296 |
+
|
| 297 |
+
In order to estimate the scale of this lower bound, recall the FC layer weights are i.i.d. sampled from a symmetric, mean-zero distribution, therefore $\mathbf { z }$ has a symmetric probability density function with mean 0. We hence have
|
| 298 |
+
|
| 299 |
+
$$
|
| 300 |
+
\begin{array} { r } { \mathbb { E } \ell ( \mathbf { z } , \mathbf { y } ) = \mathbb { E } [ - \mathbf { y } ^ { T } ( \mathbf { z } - \mathrm { { \mathrm { 1 o g ~ s u m e x p } } } ( \mathbf { z } ) ) ] \geq \mathbb { E } [ \mathbf { y } ^ { T } ( \operatorname* { m a x } _ { i \in [ c ] } z _ { i } - \mathbf { z } ) ] = \mathbb { E } [ \operatorname* { m a x } _ { i \in [ c ] } z _ { i } ] } \end{array}
|
| 301 |
+
$$
|
| 302 |
+
|
| 303 |
+
where the inequality uses the fact that $\mathrm { l o g s u m e } \mathbf { x } \mathbf { p } ( \mathbf { z } ) \geq \mathrm { m a x } _ { i \in [ c ] } z _ { i } ,$ ; the last equality is due to $\mathbf { y }$ and $\mathbf { z }$ being independent at initialization and $\mathbb { E } \mathbf { z } = \mathbf { 0 }$ . Using the trivial bound $\mathbb { E } H ( \mathbf { p } ) \leq \log ( c )$ , we get
|
| 304 |
+
|
| 305 |
+
$$
|
| 306 |
+
\mathbb { E } G ( \theta _ { p h } ) \geq \frac { \mathbb { E } [ \operatorname* { m a x } _ { i \in [ c ] } z _ { i } ] - \log ( c ) } { \| \theta _ { p h } \| }
|
| 307 |
+
$$
|
| 308 |
+
|
| 309 |
+
which shows that the gradient norm of a p.h. set is of the order $\Omega ( \mathbb { E } [ \operatorname* { m a x } _ { i \in [ c ] } z _ { i } ] )$ at initialization.
|
| 310 |
+
|
| 311 |
+
# B PROOFS FOR SECTION 3
|
| 312 |
+
|
| 313 |
+
# B.1 RESIDUAL BRANCHES UPDATE THE NETWORK IN SYNC
|
| 314 |
+
|
| 315 |
+
A common theme in previous analysis of residual networks is the scale of activation and gradient (Balduzzi et al., 2017; Yang & Schoenholz, 2017; Hanin & Rolnick, 2018). However, it is more important to consider the scale of actual change to the network function made by a (stochastic) gradient descent step. If the updates to different layers cancel out each other, the network would be stable as a whole despite drastic changes in different layers; if, on the other hand, the updates to different layers align with each other, the whole network may incur a drastic change in one step, even if each layer only changes a tiny amount. We now provide analysis showing that the latter scenario more accurately describes what happens in reality at initialization.
|
| 316 |
+
|
| 317 |
+
For our result in this section, we make the following assumptions:
|
| 318 |
+
|
| 319 |
+
• $f$ is a sequential composition of network blocks $\{ f _ { i } \} _ { i = 1 } ^ { L }$ , i.e. $f ( \mathbf { x } _ { 0 } ) = f _ { L } ( f _ { L - 1 } ( . . . f _ { 1 } ( \mathbf { x } _ { 0 } ) ) )$ , consisting of fully-connected weight layers, ReLU activation functions and residual branches. • $f _ { L }$ is a fully-connected layer with weights i.i.d. sampled from a zero-mean distribution. • There is no bias parameter in $f$ .
|
| 320 |
+
|
| 321 |
+
For $l < L$ , let ${ \bf x } _ { l - 1 }$ be the input to $f _ { l }$ and $F _ { l } ( \mathbf { x } _ { l - 1 } )$ be a branch in $f _ { l }$ with $m _ { l }$ layers. Without loss of generality, we study the following specific form of network architecture:
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
\begin{array} { r l } & { F _ { l } ( \mathbf { x } _ { l - 1 } ) \ = \ \overbrace { ( \mathrm { R e L U o } W _ { l } ^ { ( m _ { l } ) } \circ \cdot \cdot \cdot \circ \mathrm { R e L U } \circ W _ { l } ^ { ( 1 ) } ) } ^ { m _ { l } \mathrm { \normalfont \ R e L U } } ) ( \mathbf { x } _ { l - 1 } ) , } \\ & { f _ { l } ( \mathbf { x } _ { l - 1 } ) \ = \ \mathbf { x } _ { l - 1 } + F _ { l } ( \mathbf { x } _ { l - 1 } ) . } \end{array}
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
For the last block we denote $m _ { L } = 1$ and $f _ { L } ( \mathbf { x } _ { L - 1 } ) = F _ { L } ( \mathbf { x } _ { L - 1 } ) = W _ { L } ^ { ( 1 ) } \mathbf { x } _ { L - 1 } .$
|
| 328 |
+
|
| 329 |
+
Furthermore, we always choose 0 as the gradient of ReLU when its input is 0. As such, with input $\mathbf { x }$ , the output and gradient of $\scriptstyle \mathrm { R e L U } ( \mathbf { x } )$ can be simply written as $D _ { \mathbb { 1 } [ { \mathbf x } > 0 ] } { \mathbf x }$ , where $D _ { \mathbb { 1 } [ { \bf x } > 0 ] }$ is a diagonal matrix with diagonal entries corresponding to $\mathbb { 1 } [ \mathbf { x } > 0 ]$ . Denote the preactivation of the $i$ -th layer
|
| 330 |
+
|
| 331 |
+
(i.e. the input to the $i$ -th ReLU) in the $l$ -th block by $\mathbf { x } _ { l } ^ { ( i ) }$ . We define the following terms to simplify our presentation:
|
| 332 |
+
|
| 333 |
+
$$
|
| 334 |
+
\begin{array} { r l } & { F _ { l } ^ { ( i - ) } \triangleq D _ { \mathbb { 1 } [ { \mathbf x } _ { l } ^ { ( i - 1 ) } > 0 ] } W _ { l } ^ { ( i - 1 ) } \cdot \cdot \cdot D _ { \mathbb { 1 } [ { \mathbf x } _ { l } ^ { ( 1 ) } > 0 ] } W _ { l } ^ { ( 1 ) } \mathbf x _ { l - 1 } , \quad l < L , i \in [ m _ { l } ] } \\ & { F _ { l } ^ { ( i + ) } \triangleq D _ { \mathbb { 1 } [ { \mathbf x } _ { l } ^ { ( m _ { l } ) } > 0 ] } W _ { l } ^ { ( m _ { l } ) } \cdot \cdot \cdot D _ { \mathbb { 1 } [ { \mathbf x } _ { l } ^ { ( i ) } > 0 ] } , \quad l < L , i \in [ m _ { l } ] } \\ & { F _ { L } ^ { ( 1 - ) } \triangleq \mathbf x _ { L - 1 } } \\ & { F _ { L } ^ { ( 1 + ) } \triangleq I } \end{array}
|
| 335 |
+
$$
|
| 336 |
+
|
| 337 |
+
We have the following result on the gradient update to $f$ :
|
| 338 |
+
|
| 339 |
+
Theorem 3. With the above assumptions, suppose we update the network parameters by $\Delta \theta =$ $\begin{array} { r } { - \eta \frac { \partial } { \partial \theta } \ell ( f ( \mathbf { x } _ { 0 } ; \theta ) , \mathbf { y } ) } \end{array}$ , then the update to network output $\Delta f ( \mathbf { x } _ { 0 } ) \triangleq f ( \mathbf { x } _ { 0 } ; \theta + \Delta \theta ) - f ( \mathbf { x } _ { 0 } ; \theta )$ is
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
\Delta f ( \mathbf { x } _ { 0 } ) = - \eta \sum _ { l = 1 } ^ { L } \left[ \sum _ { i = 1 } ^ { m _ { l } } \overbrace { \left\| F _ { l } ^ { ( i - ) } \right\| ^ { 2 } \left( \frac { \partial f } { \partial \mathbf { x } _ { l } } \right) ^ { T } F _ { l } ^ { ( i + ) } \left( F _ { l } ^ { ( i + ) } \right) ^ { T } \left( \frac { \partial f } { \partial \mathbf { x } _ { l } } \right) } ^ { \triangleq \mathcal { I } _ { l } ^ { i } } \right] \frac { \partial \ell } { \partial \mathbf { z } } + O ( \eta ^ { 2 } ) ,
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
where $\mathbf { z } \triangleq f ( \mathbf { x } _ { 0 } ) \in \mathbb { R } ^ { c }$ is the logits.
|
| 346 |
+
|
| 347 |
+
Let us discuss the implecation of this result before delving into the proof. As each $J _ { l } ^ { i }$ is a $c \times c$ real symmetric positive semi-definite matrix, the trace norm of each $J _ { l } ^ { i }$ equals its trace. Similarly, the trace norm of $\begin{array} { r } { J \triangleq \sum _ { l } \sum _ { i } J _ { l } ^ { i } } \end{array}$ equals the trace of the sum of all $J _ { l } ^ { i }$ as well, which scales linearly with the number of residual branches $L$ . Since the output $\mathbf { z }$ has no (or little) correlation with the target $\mathbf { y }$ at the start of training, $\textstyle { \frac { \partial \ell } { \partial \mathbf { z } } }$ is a vector of some random direction. It then follows that the expected update scale is proportional to the trace norm of $J$ , which is proportional to $L$ as well as the average trace of $J _ { l } ^ { i }$ . Simply put, to allow the whole network be updated by $\Theta ( \eta )$ per step independent of depth, we need to ensure each residual branch contributes only a $\Theta ( \eta / L )$ update on average.
|
| 348 |
+
|
| 349 |
+
Proof. The first insight to prove our result is to note that conditioning on a specific input $\mathbf { x } _ { \mathrm { 0 } }$ , we can replace each ReLU activation layer by a diagonal matrix and does not change the forward and backward pass. (In fact, this is valid even after we apply a gradient descent update, as long as the learning rate $\eta > 0$ is sufficiently small so that all positive preactivation remains positive. This observation will be essential for our later analysis.) We thus have the gradient w.r.t. the $i$ -th weight layer in the $l$ -th block is
|
| 350 |
+
|
| 351 |
+
$$
|
| 352 |
+
\frac { \partial \ell } { \partial \mathrm { V e c } ( W _ { l } ^ { ( i ) } ) } = \frac { \partial \mathbf { x } _ { l } } { \partial \mathrm { V e c } ( W _ { l } ^ { ( i ) } ) } \cdot \frac { \partial f } { \partial \mathbf { x } _ { l } } \cdot \frac { \partial \ell } { \partial \mathbf { z } } = \left( F _ { l } ^ { ( i - ) } \otimes I _ { l } ^ { ( i ) } \right) \left( F _ { l } ^ { ( i + ) } \right) ^ { T } \frac { \partial f } { \partial \mathbf { x } _ { l } } \cdot \frac { \partial \ell } { \partial \mathbf { z } } .
|
| 353 |
+
$$
|
| 354 |
+
|
| 355 |
+
where $\otimes$ denotes the Kronecker product. The second insight is to note that with our assumptions, a network block and its gradient w.r.t. its input have the following relation:
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
f _ { l } ( \mathbf { x } _ { l - 1 } ) = \frac { \partial f _ { l } } { \partial \mathbf { x } _ { l - 1 } } \cdot \mathbf { x } _ { l - 1 } .
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
We then plug in Equation (13) to the gradient update $\begin{array} { r } { \Delta \theta = - \eta \frac { \partial } { \partial \theta } \ell ( f ( \mathbf { x } _ { 0 } ; \theta ) , \mathbf { y } ) } \end{array}$ , and recalculate the forward pass $f ( \mathbf { x } _ { 0 } ; \theta + \Delta \theta )$ . The theorem follows by applying Equation (14) and a first-order Taylor series expansion in a small neighborhood of $\eta = 0$ where $f ( \mathbf { x } _ { 0 } ; \theta + \Delta \theta )$ is smooth w.r.t. $\eta$ . □
|
| 362 |
+
|
| 363 |
+
# B.2 WHAT SCALAR BRANCH HAS $\Theta ( \eta / L )$ UPDATES?
|
| 364 |
+
|
| 365 |
+
For this section, we focus on the proper initialization of a scalar branch $\begin{array} { r } { F ( x ) = ( \prod _ { i = 1 } ^ { m } a _ { i } ) x } \end{array}$ . We have the following result:
|
| 366 |
+
|
| 367 |
+
Theorem 4. Assuming $\forall i , a _ { i } \geq 0 , x = \Theta ( 1 )$ and $\frac { \partial \ell } { \partial F ( x ) } = \Theta ( 1 )$ , then $\begin{array} { r } { \Delta F ( x ) \triangleq F ( x ; \theta - \eta \frac { \partial \ell } { \partial \theta } ) - } \end{array}$ $F ( x ; \theta )$ is $\Theta ( \eta / L )$ if and only if
|
| 368 |
+
|
| 369 |
+
$$
|
| 370 |
+
\left( \prod _ { k \in [ m ] \setminus \{ j \} } a _ { k } \right) x = \Theta \left( { \frac { 1 } { \sqrt { L } } } \right) , \quad w h e r e \quad j \in \arg \operatorname* { m i n } a _ { k }
|
| 371 |
+
$$
|
| 372 |
+
|
| 373 |
+
Proof. We start by calculating the gradient of each parameter:
|
| 374 |
+
|
| 375 |
+
$$
|
| 376 |
+
{ \frac { \partial \ell } { \partial a _ { i } } } = { \frac { \partial \ell } { \partial F } } \left( \prod _ { k \in [ m ] \backslash \{ i \} } a _ { k } \right) x
|
| 377 |
+
$$
|
| 378 |
+
|
| 379 |
+
and a first-order approximation of $\Delta F ( x )$ :
|
| 380 |
+
|
| 381 |
+
$$
|
| 382 |
+
\Delta F ( x ) = - \eta \frac { \partial \ell } { \partial F ( x ) } \left( F ( x ) \right) ^ { 2 } \sum _ { i = 1 } ^ { m } \frac { 1 } { a _ { i } ^ { 2 } }
|
| 383 |
+
$$
|
| 384 |
+
|
| 385 |
+
where we conveniently abuse some notations by defining
|
| 386 |
+
|
| 387 |
+
$$
|
| 388 |
+
F ( x ) { \frac { 1 } { a _ { i } } } \triangleq \left( \prod _ { k \in [ m ] \backslash \{ i \} } a _ { k } \right) x , \quad { \mathrm { i f ~ } } a _ { i } = 0 .
|
| 389 |
+
$$
|
| 390 |
+
|
| 391 |
+
$\textstyle \sum _ { i = 1 } ^ { m } { \frac { 1 } { a _ { i } ^ { 2 } } }$ as $M$ and $\operatorname* { m i n } _ { k } a _ { k }$ as $A$ , we have
|
| 392 |
+
|
| 393 |
+
$$
|
| 394 |
+
( F ( x ) ) ^ { 2 } \cdot { \frac { 1 } { A ^ { 2 } } } \leq ( F ( x ) ) ^ { 2 } M \leq ( F ( x ) ) ^ { 2 } \cdot { \frac { m } { A ^ { 2 } } }
|
| 395 |
+
$$
|
| 396 |
+
|
| 397 |
+
and therefore by rearranging Equation (17) and letting $\Delta F ( x ) = \Theta ( \eta / L )$ we get
|
| 398 |
+
|
| 399 |
+
$$
|
| 400 |
+
( F ( x ) ) ^ { 2 } \cdot { \frac { 1 } { A ^ { 2 } } } = \Theta \left( { \frac { \Delta F ( x ) } { \eta _ { \overline { { { \partial F ( x ) } } } } } } \right) = \Theta \left( { \frac { 1 } { L } } \right)
|
| 401 |
+
$$
|
| 402 |
+
|
| 403 |
+
i.e. $F ( x ) / A = \Theta ( 1 / \sqrt { L } )$ . Hence the “only if” part is proved. For the “if” part, we apply Equation (19) to Equation (17) and observe that by Equation (15)
|
| 404 |
+
|
| 405 |
+
$$
|
| 406 |
+
\Delta F ( x ) = \Theta \left( \eta ( F ( x ) ) ^ { 2 } \cdot \frac { 1 } { A ^ { 2 } } \right) = \Theta \left( \frac { \eta } { L } \right)
|
| 407 |
+
$$
|
| 408 |
+
|
| 409 |
+
The result of this theorem provides useful guidance on how to rescale the standard initialization to achieve the desired update scale for the network function.
|
| 410 |
+
|
| 411 |
+
# C ADDITIONAL EXPERIMENTS
|
| 412 |
+
|
| 413 |
+
# C.1 ABLATION STUDIES OF FIXUP
|
| 414 |
+
|
| 415 |
+
In this section we present the training curves of different architecture designs and initialization schemes. Specifically, we compare the training accuracy of batch normalization, Fixup, as well as a few ablated options: (1) removing the bias parameters in the network; (2) use $0 . 1 \mathbf { x }$ the suggested initialization scale and no bias parameters; (3) use $1 0 \mathrm { x }$ the suggested initialization scale and no bias parameters; and (4) remove all the residual branches. The results are shown in Figure 4. We see that initializing the residual branch layers at a smaller scale (or all zero) slows down learning, whereas training fails when initializing them at a larger scale; we also see the clear benefit of adding bias parameters in the network.
|
| 416 |
+
|
| 417 |
+
# C.2 CIFAR AND SVHN WITH BETTER REGULARIZATION
|
| 418 |
+
|
| 419 |
+
We perform additional experiments to validate our hypothesis that the gap in test error between Fixup and batch normalization is primarily due to overfitting. To combat overfitting, we use Mixup (Zhang et al., 2017) and Cutout (DeVries & Taylor, 2017) with default hyperparameters as additional regularization. On the CIFAR-10 dataset, we perform experiments with WideResNet-40-10 and on SVHN we use WideResNet-16-12 (Zagoruyko & Komodakis, 2016), all with the default hyperparameters. We observe in Table 4 that models trained with Fixup and strong regularization are competitive with state-of-the-art methods on CIFAR-10 and SVHN, as well as our baseline with batch normalization.
|
| 420 |
+
|
| 421 |
+

|
| 422 |
+
Figure 4: Minibatch training accuracy of ResNet-110 on CIFAR-10 dataset with different configurations in the first 3 epochs. We use minibatch size of 128 and smooth the curves using 10-step moving average.
|
| 423 |
+
|
| 424 |
+
Table 4: Additional results on CIFAR-10, SVHN datasets.
|
| 425 |
+
|
| 426 |
+
<table><tr><td>Dataset</td><td>Model</td><td>Normalization</td><td>Test Error (%)</td></tr><tr><td rowspan="4">CIFAR-10</td><td>(Zagoruyko & Komodakis, 2016) (Yamada et al., 2018)</td><td rowspan="4">Yes</td><td>3.8 2.3</td></tr><tr><td>BatchNorm + Mixup + Cutout</td><td>2.5</td></tr><tr><td></td><td></td></tr><tr><td>(Graham,2014) Fixup-init + Mixup + Cutout</td><td>3.5 2.3</td></tr><tr><td rowspan="4">SVHN</td><td>(Zagoruyko & Komodakis, 2016)</td><td rowspan="4">Yes</td><td>1.5</td></tr><tr><td>(DeVries& Taylor, 2017)</td><td>1.3</td></tr><tr><td>BatchNorm + Mixup + Cutout</td><td>1.4</td></tr><tr><td>(Lee et al., 2016)</td><td>1.7</td></tr></table>
|
| 427 |
+
|
| 428 |
+

|
| 429 |
+
Figure 5 shows that without additional regularization Fixup fits the training set very well, but overfits significantly. We see in Figure 6 that Fixup is competitive with networks trained with normalization when the Mixup regularizer is used.
|
| 430 |
+
|
| 431 |
+

|
| 432 |
+
Figure 5: Training and test errors on ImageNet using ResNet-50 without additional regularization. We observe that Fixup is able to better fit the training data and that leads to overfitting - more regularization is needed. Results of BatchNorm and GroupNorm reproduced from (Wu & He, 2018).
|
| 433 |
+
Figure 6: Test error of ResNet-50 on ImageNet with Mixup (Zhang et al., 2017). Fixup closely matches the final results yielded by the use of GroupNorm, without any normalization.
|
| 434 |
+
|
| 435 |
+
D ADDITIONAL REFERENCES: A BRIEF HISTORY OF NORMALIZATION METHODS
|
| 436 |
+
|
| 437 |
+
The first use of normalization in neural networks appears in the modeling of biological visual system and dates back at least to Heeger (1992) in neuroscience and to Pinto et al. (2008); Lyu & Simoncelli (2008) in computer vision, where each neuron output is divided by the sum (or norm) of all of the outputs, a module called divisive normalization. Recent popular normalization methods, such as local response normalization (Krizhevsky et al., 2012), batch normalization (Ioffe & Szegedy, 2015) and layer normalization (Ba et al., 2016) mostly follow this tradition of dividing the neuron activations by their certain summary statistics, often also with the activation mean subtracted. An exception is weight normalization (Salimans & Kingma, 2016), which instead divides the weight parameters by their statistics, specifically the weight norm; weight normalization also adopts the idea of activation normalization for weight initialization. The recently proposed actnorm (Kingma & Dhariwal, 2018) removes the normalization of weight parameters, but still use activation normalization to initialize the affine transformation layers.
|
md/train/HJV1zP5xg/HJV1zP5xg.md
ADDED
|
@@ -0,0 +1,385 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DIVERSE BEAM SEARCH: DECODING DIVERSE SOLUTIONS FROM NEURAL SEQUENCE MODELS
|
| 2 |
+
|
| 3 |
+
Ashwin K Vijayakumar1, Michael Cogswell1, Ramprasaath R. Selvaraju1, Qing Sun1
|
| 4 |
+
Stefan Lee1, David Crandall2 & Dhruv Batra1
|
| 5 |
+
|
| 6 |
+
{ashwinkv,cogswell,ram21,sunqing,steflee}@vt.edu djcran@indiana.edu, dbatra@vt.edu
|
| 7 |
+
|
| 8 |
+
1 Department of Electrical and Computer Engineering, Virginia Tech, Blacksburg, VA, USA
|
| 9 |
+
|
| 10 |
+
2 School of Informatics and Computing Indiana University, Bloomington, IN, USA
|
| 11 |
+
|
| 12 |
+
# ABSTRACT
|
| 13 |
+
|
| 14 |
+
Neural sequence models are widely used to model time-series data. Equally ubiquitous is the usage of beam search (BS) as an approximate inference algorithm to decode output sequences from these models. BS explores the search space in a greedy left-right fashion retaining only the top $B$ candidates. This tends to result in sequences that differ only slightly from each other. Producing lists of nearly identical sequences is not only computationally wasteful but also typically fails to capture the inherent ambiguity of complex AI tasks. To overcome this problem, we propose Diverse Beam Search (DBS), an alternative to BS that decodes a list of diverse outputs by optimizing a diversity-augmented objective. We observe that our method not only improved diversity but also finds better top 1 solutions by controlling for the exploration and exploitation of the search space. Moreover, these gains are achieved with minimal computational or memory overhead compared to beam search. To demonstrate the broad applicability of our method, we present results on image captioning, machine translation, conversation and visual question generation using both standard quantitative metrics and qualitative human studies. We find that our method consistently outperforms BS and previously proposed techniques for diverse decoding from neural sequence models.
|
| 15 |
+
|
| 16 |
+
# 1 INTRODUCTION
|
| 17 |
+
|
| 18 |
+
In the last few years, Recurrent Neural Networks (RNNs), Long Short-Term Memory networks (LSTMs) or more generally, neural sequence models have become the standard choice for modeling time-series data for a wide range of applications including speech recognition (Graves et al., 2013), machine translation (Bahdanau et al., 2014), conversation modeling (Vinyals & Le, 2015), image and video captioning (Vinyals et al., 2015; Venugopalan et al., 2015), and visual question answering (Antol et al., 2015). RNN based sequence generation architectures model the conditional probability, $\operatorname* { P r } ( \mathbf { y } | \mathbf { x } )$ of an output sequence $\mathbf { y } = ( y _ { 1 } , \dots , y _ { T } )$ given an input $\mathbf { x }$ (possibly also a sequence); where the output tokens $y _ { t }$ are from a finite vocabulary, $\nu$ .
|
| 19 |
+
|
| 20 |
+
Inference in RNNs. Maximum a Posteriori (MAP) inference for RNNs is the task of finding the most likely output sequence given the input. Since the number of possible sequences grows as $| \mathcal { V } | ^ { T }$ , exact inference is NP-hard – so, approximate inference algorithms like beam search (BS) are commonly employed. BS is a heuristic graph-search algorithm that maintains the $B$ top-scoring partial sequences expanded in a greedy left-to-right fashion. Fig. 1 shows a sample BS search tree.
|
| 21 |
+
|
| 22 |
+
Lack of Diversity in BS. Despite the widespread usage of BS, it has long been understood that solutions decoded by BS are generic and lacking in diversity (Finkel et al., 2006; Gimpel et al.,
|
| 23 |
+
|
| 24 |
+

|
| 25 |
+
Single engine train rolling down the tracks. A locomotive drives along the tracks amongst trees and bushes. An engine is coming down the train track. A steam locomotive is blowing steam. An old fashion train with steam coming out of its pipe. A black and red train moving down a train track.
|
| 26 |
+
Figure 1: Comparing image captioning outputs decoded by BS (top) and our method, Diverse Beam Search (middle) – we notice that BS captions are near-duplicates with similar shared paths in the search tree and minor variations in the end. In contrast, DBS captions are significantly diverse and similar to the variability in human-generated ground truth captions (bottom).
|
| 27 |
+
|
| 28 |
+
2013; Li et al., 2015; Li & Jurafsky, 2016). Comparing the human (bottom) and BS (top) generated captions shown in Fig. 1 demonstrates this deficiency. While this behavior of BS is disadvantageous for many reasons, we highlight the three most crucial ones here:
|
| 29 |
+
|
| 30 |
+
i) The production of near-identical beams make BS a computationally wasteful algorithm, with essentially the same computation being repeated for no significant gain in performance.
|
| 31 |
+
ii) Due to loss-evaluation mismatch (i.e. improvements in posterior-probabilities not necessarily corresponding to improvements in task-specific metrics), it is common practice to deliberately throttle BS to become a poorer optimization algorithm by using reduced beam widths (Vinyals et al., 2015; Karpathy & Fei-Fei, 2015; Ferraro et al., 2016). This treatment of an optimization algorithm as a hyperparameter is not only intellectually dissatisfying but also has a significant practical side-effect – it leads to the decoding of largely bland, generic, and “safe” outputs, e.g. always saying “I don’t know” in conversation models (Kannan et al., 2016).
|
| 32 |
+
iii) Most importantly, lack of diversity in the decoded solutions is fundamentally crippling in AI problems with significant ambiguity – e.g. there are multiple ways of describing an image or responding in a conversation that are “correct” and it is important to capture this ambiguity by finding several diverse plausible hypotheses.
|
| 33 |
+
|
| 34 |
+
Overview and Contributions. To address these shortcomings, we propose Diverse Beam Search $( D B S ) - \mathbf { a }$ general framework to decode a set of diverse sequences that can be used as an alternative to BS. At a high level, DBS decodes diverse lists by dividing the given beam budget into groups and enforcing diversity between groups of beams. Drawing from recent work in the probabilistic graphical models literature on Diverse M-Best (DivMBest) MAP inference (Batra et al., 2012; Prasad et al., 2014; Kirillov et al., 2015), we optimize an objective that consists of two terms – the sequence likelihood under the model and a dissimilarity term that encourages beams across groups to differ. This diversity-augmented model score is optimized in a doubly greedy manner – greedily optimizing along both time (like BS) and groups (like DivMBest).
|
| 35 |
+
|
| 36 |
+
Our primary technical contribution is Diverse Beam Search, a doubly greedy approximate inference algorithm to decode diverse sequences from neural sequence models. We report results on image captioning, machine translation, conversations and visual question generation to demonstrate the broad applicability of DBS. Results show that DBS produces consistent improvements on both task-specific oracle and other diversity-related metrics while maintaining run-time and memory requirements similar to BS. We also evaluate human preferences between image captions generated by BS or DBS. Further experiments show that DBS is robust over a wide range of its parameter values and is capable of encoding various notions of diversity through different forms of the diversty term.
|
| 37 |
+
|
| 38 |
+
Overall, our algorithm is simple to implement and consistently outperforms BS in a wide range of domains without sacrificing efficiency. Our implementation is publicly available at https: //github.com/ashwinkalyan/dbs. Additionally, we provide an interactive demonstration of DBS for image captioning at http://dbs.cloudcv.org.
|
| 39 |
+
|
| 40 |
+
# 2 PRELIMINARIES: DECODING RNNS WITH BEAM SEARCH
|
| 41 |
+
|
| 42 |
+
We begin with a refresher on BS, before describing our generalization, Diverse Beam Search. For notational convenience, let $[ n ]$ denote the set of natural numbers from 1 to $n$ and let $\mathbf { v } _ { [ n ] } =$ $[ v _ { 1 } , \ldots , v _ { n } ] ^ { \intercal }$ index the first $n$ elements of a vector $\mathbf { v } \in \mathbb { R } ^ { m }$ .
|
| 43 |
+
|
| 44 |
+
The Decoding Problem. RNNs are trained to estimate the likelihood of sequences of tokens from a finite dictionary $\nu$ given an input $\mathbf { x }$ . The RNN updates its internal state and estimates the conditional probability distribution over the next output given the input and all previous output tokens. We denote the logarithm of this conditional probability distribution over all tokens at time $t$ as $\theta ( y _ { t } ) =$ $\log \operatorname* { P r } ( y _ { t } | y _ { t - 1 } , \dots , y _ { 1 } , \mathbf { x } )$ . To avoid notational clutter, we index $\theta ( \cdot )$ with a single variable $y _ { t }$ , but it should be clear that it depends on all previous outputs, $\mathbf { y } _ { [ t - 1 ] }$ . We write the log probability of a partial solution (i.e. the sum of log probabilities of all tokens decoded so far) as $\Theta ( \mathbf { y } _ { [ t ] } ) =$ $\textstyle \sum _ { \tau \in [ t ] } \theta ( y _ { \tau } )$ . The decoding problem is then the task of finding a sequence y that maximizes $\Theta ( \mathbf { y } )$ .
|
| 45 |
+
|
| 46 |
+
As each output is conditioned on all the previous outputs, decoding the optimal length- $\mathcal { T }$ sequence in this setting can be viewed as MAP inference on a $T$ -order Markov chain with nodes corresponding to output tokens at each time step. Not only does the size of the largest factor in such a graph grow as $| \nu | ^ { \star }$ , but computing these factors also requires repetitively evaluating the sequence model. Thus, approximate algorithms are employed and the most prevalent method is beam search (BS).
|
| 47 |
+
|
| 48 |
+
Beam search is a heuristic search algorithm which stores the top $B$ highest scoring partial candidates at each time step; where $B$ is known as the beam width. Let us denote the set of $B$ solutions held by BS at the start of time $t$ as $Y _ { [ t - 1 ] } = \{ \mathbf { y } _ { 1 , [ t - 1 ] } , \dotsc , \mathbf { y } _ { B , [ t - 1 ] } \}$ . At each time step, BS considers all possible single token extensions of these beams given by the set $\mathscr { V } _ { t } = Y _ { [ t - 1 ] } \times \mathscr { V }$ and retains the $B$ highest scoring extensions. More formally, at each step the beams are updated as
|
| 49 |
+
|
| 50 |
+
$$
|
| 51 |
+
Y _ { [ t ] } = \operatorname * { a r g m a x } _ { \substack { \mathbf { y } _ { 1 , [ t ] } , \ldots , \mathbf { y } _ { B , [ t ] } \in \mathcal { V } _ { t } } } \sum _ { b \in [ B ] } \Theta ( \mathbf { y } _ { b , [ t ] } ) \ \ldots t . \ \mathbf { y } _ { i , [ t ] } \neq \mathbf { y } _ { j , [ t ] } \ \forall i \neq j .
|
| 52 |
+
$$
|
| 53 |
+
|
| 54 |
+
The above objective can be trivially maximized by sorting all $B \times | \mathcal { V } |$ members of $\mathcal { V } _ { t }$ by their log probabilities and selecting the top $B$ . This process is repeated until time $T$ and the most likely sequence is selected by ranking the $B$ complete beams according to their log probabilities.
|
| 55 |
+
|
| 56 |
+
While this method allows for multiple sequences to be explored in parallel, most completions tend to stem from a single highly valued beam – resulting in outputs that are often only minor perturbations of a single sequence (and typically only towards the end of the sequences).
|
| 57 |
+
|
| 58 |
+
# 3 DIVERSE BEAM SEARCH: FORMULATION AND ALGORITHM
|
| 59 |
+
|
| 60 |
+
To overcome this, we augment the objective in Eq. 1 with a dissimilarity term $\Delta ( Y _ { [ t ] } )$ that measures the diversity between candidate sequences, assigning a penalty $\Delta ( Y _ { [ t ] } ) [ c ]$ to each possible sequence completion $c \in \mathcal V$ . Jointly optimizing this augmented objective for all $B$ candidates at each time step is intractable as the number of possible solutions grows with $| \gamma | ^ { B }$ (easily $1 0 ^ { 6 0 }$ for typical language modeling settings). To avoid this, we opt for a greedy procedure that divides the beam budget $B$ into $G$ groups and promotes diversity between these groups. The approximation is doubly greedy – across both time and groups – so $\Delta ( Y _ { [ t ] } )$ is constant with respect to other groups and we can sequentially optimize each group using regular BS. We now explain the specifics of our approach.
|
| 61 |
+
|
| 62 |
+
Diverse Beam Search. As joint optimization is intractable, we form $G$ smaller groups of beams and optimize them sequentially. Consider a partition of the set of beams $Y _ { [ t ] }$ into $G$ smaller sets $Y _ { [ t ] } ^ { g } , g { \in } [ G ]$ of $B ^ { \prime } = B / G$ beams each (we pick $G$ to divide $B$ ). In the example shown in Fig. 2, $B = 6$ beams are divided into $G = 3$ differently colored groups containing $B ^ { \prime } = 2$ beams each.
|
| 63 |
+
|
| 64 |
+
Considering diversity only between groups, reduces the search space at each time step; however, inference remains intractable. To enforce diversity efficiently, we consider a greedy strategy that steps each group forward in time sequentially while considering the others fixed. Each group can then evaluate the diversity term with respect to the fixed extensions of previous groups, returning the search space to $B ^ { \prime } \times | \mathcal { V } |$ . In the snapshot shown in Fig. 2, the third group is being stepped forward at time step $t = 4$ and the previous groups have already been completed. With this staggered beamfront, the diversity term of the third group can be computed using these completions. Here we use hamming diversity, which adds diversity penalty -1 for each appearance of a possible extension word at the same time step in a previous group – ‘birds’, ‘the’, and ‘an’ in the example – and 0 to all other possible completions. We discuss other forms for the diversity function in Section 5.1.
|
| 65 |
+
|
| 66 |
+

|
| 67 |
+
Figure 2: Diverse beam search operates left-to-right through time and top to bottom through groups. Diversity between groups is combined with joint log probabilities, allowing continuations to be found efficiently. The resulting outputs are more diverse than for standard approaches.
|
| 68 |
+
|
| 69 |
+
As we optimize each group with the previous groups fixed, extending group $g$ at time $t$ amounts to a standard BS using dissimilarity augmented log probabilities and can be written as:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\begin{array} { r l } { Y _ { [ t ] } ^ { g } } & { = \underset { \mathbf { y } _ { 1 , [ t ] } ^ { g } \dots \mathbf { y } _ { B ^ { \prime } , [ t ] } ^ { g } \in \mathcal { Y } _ { t } ^ { g } } { \mathrm { a r g m a x } } \quad \quad \displaystyle \sum _ { b \in [ B ^ { \prime } ] } \Theta \left( \mathbf { y } _ { b , [ t ] } ^ { g } \right) + \lambda \Delta \left( \underset { h = 1 } { \bigcup ^ { g - 1 } } Y _ { [ t ] } ^ { h } \right) [ y _ { b , t } ^ { g } ] , } \\ & { \quad \quad s . t . \lambda \geq 0 , \mathbf { y } _ { i , [ t ] } ^ { g } \neq \mathbf { y } _ { j , [ t ] } ^ { g } \forall i \neq j } \end{array}
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $\lambda$ is scalar controlling the strength of the diversity term. The full procedure to obtain diverse sequences using our method, Diverse Beam Search (DBS), is presented in Algorithm 1. It consists of two main steps for each group at each time step –
|
| 76 |
+
|
| 77 |
+
1) augmenting the log probabilities of each possible extension with the diversity term computed from previously advanced groups (Algorithm 1, Line 5) and,
|
| 78 |
+
2) running one step of a smaller BS with $B ^ { \prime }$ beams using the augmented log probabilities to extend the current group (Algorithm 1, Line 6).
|
| 79 |
+
|
| 80 |
+
Note that the first group $( g = 1 )$ ) is not ‘conditioned’ on other groups during optimization, so our method is guaranteed to perform at least as well as a beam search of size $B ^ { \prime }$ .
|
| 81 |
+
|
| 82 |
+
# Algorithm 1: Diverse Beam Search
|
| 83 |
+
|
| 84 |
+
1 Perform a diverse beam search with $G$ groups using a beam width of $B$
|
| 85 |
+
2 for $t = 1$ , . . . $T$ do
|
| 86 |
+
// perform one step of beam search for first group without diversity
|
| 87 |
+
3 $\begin{array} { r } { Y _ { [ t ] } ^ { 1 } \operatorname { a r g m a x } _ { ( \mathbf { y } _ { 1 , [ t ] } ^ { 1 } , \dots , \mathbf { y } _ { B ^ { \prime } , [ t ] } ^ { 1 } ) } \sum _ { b \in [ B ^ { \prime } ] } \Theta ( \mathbf { y } _ { b , [ t ] } ^ { 1 } ) } \end{array}$
|
| 88 |
+
4 for $g = 2$ , . . . $G$ do
|
| 89 |
+
5 $\begin{array} { r } { \Theta ( \mathbf { y } _ { b , [ t ] } ^ { g } ) \Theta ( \mathbf { y } _ { b , [ t ] } ^ { g } ) + \lambda \Delta ( \bigcup _ { h = 1 } ^ { g - 1 } Y _ { [ t ] } ^ { h } ) [ y _ { b , t } ^ { g } ] \quad \ b \in [ B ^ { \prime } ] , \mathbf { y } _ { b , [ t ] } ^ { g } \in \mathcal { Y } _ { t } ^ { g } : } \end{array}$ and $\lambda > 0$
|
| 90 |
+
6 $Y _ { [ t ] } ^ { g } \overset { \cdot } { } \operatorname { a r g m a x } _ { ( \mathbf { y } _ { 1 , [ t ] } ^ { g } , \ldots , \mathbf { y } _ { B ^ { \prime } , [ t ] } ^ { g } ) } \sum _ { b \in [ B ^ { \prime } ] } \Theta ( \mathbf { y } _ { b , [ t ] } ^ { g } )$ r thes.t. $\mathbf { y } _ { i , [ t ] } \neq \mathbf { y } _ { j , [ t ] } \forall i \neq j$
|
| 91 |
+
|
| 92 |
+
7 Return set of B solutions, $\begin{array} { r } { Y _ { [ T ] } = \bigcup _ { g = 1 } ^ { G } Y _ { [ T ] } ^ { g } } \end{array}$
|
| 93 |
+
|
| 94 |
+
# 4 RELATED WORK
|
| 95 |
+
|
| 96 |
+
Diverse M-Best Lists. The task of generating diverse structured outputs from probabilistic models has been studied extensively (Park & Ramanan, 2011; Batra et al., 2012; Kirillov et al., 2015; Prasad et al., 2014). Batra et al. (2012) formalized this task for Markov Random Fields as the DivMBest problem and presented a greedy approach which solves for outputs iteratively, conditioning on previous solutions to induce diversity. Kirillov et al. (2015) show how these solutions can be found jointly (non-greedily) for certain kinds of energy functions. The techniques developed by Kirillov are not directly applicable to decoding from RNNs, which do not satisfy the assumptions made.
|
| 97 |
+
|
| 98 |
+
Most related to our proposed approach is the work of Gimpel et al. (2013), who applied DivMBest to machine translation using beam search as a black-box inference algorithm. Specifically, in this approach, DivMBest knows nothing about the inner-workings of BS and simply makes $B$ sequential calls to BS to generate $B$ diverse solutions. This approach is extremely wasteful because BS is called $B$ times, run from scratch every time, and even though each call to BS produces $B$ solutions, only one solution is kept by DivMBest. In contrast, DBS avoids these shortcomings by integrating diversity within BS such that no beams are discarded. By running multiple beam searches in parallel and at staggered time offsets, we obtain large time savings making our method comparable to $a$ single run of classical BS. One potential disadvantage of our method w.r.t. Gimpel et al. (2013) is that sentence-level diversity metrics cannot be incorporated in DBS since no group is complete when diversity is encouraged. However, as observed empirically by us and Li et al. (2015), initial words tend to disproportionally impact the diversity of the resultant sequences – suggesting that later words may not be important for diverse inference.
|
| 99 |
+
|
| 100 |
+
Diverse Decoding for RNNs. Efforts have been made by Li et al. (2015) and Li & Jurafsky (2016) to produce diverse decodings from recurrent models for conversation modeling and machine translation. Both of these works propose new heuristics for creating diverse M-Best lists and employ mutual information to re-rank lists of sequences. The latter achieves a goal separate from ours, which is simply to re-rank diverse lists.
|
| 101 |
+
|
| 102 |
+
Li & Jurafsky (2016) proposes a BS diversification heuristic that discourages beams from sharing common roots, implicitly resulting in diverse lists. Introducing diversity through a modified objective (as in DBS) rather than via a procedural heuristic provides easier generalization to incorporate different notions of diversity and control the exploration-exploitation trade-off as detailed in Section 5.1. Furthermore, we find that DBS outperforms the method of Li & Jurafsky (2016).
|
| 103 |
+
|
| 104 |
+
Li et al. (2015) introduced a novel decoding objective that maximizes mutual information between inputs and predicted outputs to penalize generic sequences. This operates on a principle orthogonal and complementary to DBS and Li & Jurafsky (2016). It works by penalizing utterances that are generally more frequent (diversity independent of input) rather than penalizing utterances that are similar to other utterances produced for the same input (diversity conditioned on input). Furthermore, the input-independent approach requires training a new language model for the target language while DBS just requires a diversity function $\Delta$ . Combination of these complementary techniques is left as interesting future work.
|
| 105 |
+
|
| 106 |
+
In other recent work, Wu et al. (2016) modify the beam search objective by introducing lengthnormalization to favor longer sequences and a coverage penalty that favors sequences that account for the complete input sequence. While the coverage term does not generalize to all neural sequence models, the length-normalization term can be implemented by modifying the joint-log-probability of each sequence. Although the goal of this method is not to produce diverse lists and hence not directly comparable, it is a complementary technique that can be used in conjunction with our diverse decoding method.
|
| 107 |
+
|
| 108 |
+
# 5 EXPERIMENTS
|
| 109 |
+
|
| 110 |
+
In this section, we evaluate our approach on image captioning, machine translation, conversation and visual question generation tasks to demonstrate both its effectiveness against baselines and its general applicability to any inference currently supported by beam search. We also analyze the effects of DBS parameters, explore human preferences for diversity, and discuss diversity’s importance in explaining complex images. We first explain the baselines and evaluations used in this paper.
|
| 111 |
+
|
| 112 |
+
Baselines & Metrics. Apart from classical beam search, we compare DBS with the diverse decoding method proposed in Li & Jurafsky (2016). We also compare against two other complementary decoding techniques proposed in Li et al. (2015) and Wu et al. (2016). Note that these two techniques are not directly comparable with DBS since the goal is not to produce diverse lists. We now provide a brief description of the comparisons mentioned:
|
| 113 |
+
|
| 114 |
+
- Li & Jurafsky (2016): modify BS by introducing an intra-sibling rank. For each partial solution, the set of $| \nu |$ beam extensions are sorted and assigned intra-sibling ranks $k \in \ [ | \nu | ]$ in order of decreasing log probabilities, $\theta _ { t } ( y _ { t } )$ . The log probability of an extension is then reduced in proportion to its rank, and continuations are re-sorted under these modified log probabilities to select the top $B$ ‘diverse’ beam extensions.
|
| 115 |
+
|
| 116 |
+
- Li et al. (2015): train an additional unconditioned target sequence model $U ( \mathbf { y } )$ and perform BS decoding on an augmented objective $P ( \mathbf { y } | x ) - \lambda U ( \mathbf { y } )$ , penalizing input-independent decodings.
|
| 117 |
+
|
| 118 |
+
- $\mathrm { { W u } }$ et al. (2016) modify the beam-search objective by introducing length-normalization that favors longer sequences. The joint log-probability of completed sequences is divided by a factor, $( 5 + | \mathbf { y } | ) ^ { \alpha } / ( 5 + 1 ) ^ { \alpha }$ , where $\alpha \in [ 0 , 1 ]$ .
|
| 119 |
+
|
| 120 |
+
We compare to our own implementations of these methods as none are publicly available. Both Li & Jurafsky (2016) and Li et al. (2015) develop and use re-rankers to pick a single solution from the generated lists. Since we are interested in evaluating the quality of the generated lists and in isolating the gains due to diverse decoding, we do not implement any re-rankers, simply sorting by log-probability.
|
| 121 |
+
|
| 122 |
+
We evaluate the performance of the generated lists using the following two metrics:
|
| 123 |
+
|
| 124 |
+
- Oracle Accuracy: Oracle or top $k$ accuracy w.r.t. some task-specific metric, such as BLEU (Papineni et al., 2002) or SPICE (Anderson et al., 2016), is the maximum value of the metric achieved over a list of $k$ potential solutions. Oracle accuracy is an upper bound on the performance of any re-ranking strategy and thus measures the maximum potential of a set of outputs. - Diversity Statistics: We count the number of distinct n-grams present in the list of generated outputs. Similar to Li et al. (2015), we divide these counts by the total number of words generated to bias against long sentences.
|
| 125 |
+
|
| 126 |
+
Simultaneous improvements in both metrics indicate that output sequences have increased diversity without sacrificing fluency and correctness with respect to target tasks.
|
| 127 |
+
|
| 128 |
+
5.1 SENSITIVITY ANALYSIS AND EFFECT OF DIVERSITY FUNCTIONS
|
| 129 |
+
|
| 130 |
+
Here we discuss the impact of the number of groups, strength of diversity , and various forms of diversity for language models. Note that the parameters of DBS (and other baselines) were tuned on a held-out validation set for each experiment. The supplement provides further discussion and experimental details.
|
| 131 |
+
|
| 132 |
+
Number of Groups $\mathbf { \Pi } ( \mathbf { G } )$ . Setting $G { = } B$ allows for the maximum exploration of the search space, while setting $G { = } 1$ reduces DBS to BS, resulting in increased exploitation of the search-space around the 1-best decoding. Empirically, we find that maximum exploration correlates with improved oracle accuracy and hence use $G { = } B$ to report results unless mentioned otherwise. See the supplement for a comparison and more details.
|
| 133 |
+
|
| 134 |
+
Diversity Strength $( \lambda )$ . The diversity strength $\lambda$ specifies the trade-off between the model score and diversity terms. As expected, we find that a higher value of $\lambda$ produces a more diverse list; however, very large values of $\lambda$ can overpower model score and result in grammatically incorrect outputs. We set $\lambda$ via grid search over a range of values to maximize oracle accuracies achieved on the validation set. We find a wide range of $\lambda$ values (0.2 to 0.8) work well for most tasks and datasets.
|
| 135 |
+
|
| 136 |
+
Choice of Diversity Function $( \Delta )$ . In Section 3, we defined $\Delta ( \cdot )$ as a function over a set of partial solutions that outputs a vector of dissimilarity scores for all possible beam completions. Assuming that each of the previous groups influences the completion of the current group independently, we can simplify $\Delta ( \bar { \bigcup } _ { h = 1 } ^ { g - 1 } Y _ { [ t ] } ^ { h } )$ as the sum of each group’s contributions as $\bar { \sum _ { h = 1 } ^ { g - 1 } \Delta ( Y _ { [ t ] } ^ { h } ) }$ . In Section 3, we illustrated a simple hamming diversity of this form that penalizes selection of tokens proportionally to the number of time it was used in previous groups. However, this factorized diversity term can take various forms in our model – with hamming diversity being the simplest. For language models, we study the effect of using cumulative (i.e. considering all past time steps), n-gram and neural embedding based diversity functions. Each of these forms encode differing notions of diversity and result in DBS outperforming BS. We find simple hamming distance to be effective and report results based on this diversity measure unless otherwise specified. More details about these forms of the diversity term are provided in the supplementary.
|
| 137 |
+
|
| 138 |
+
# 5.2 IMAGE CAPTIONING
|
| 139 |
+
|
| 140 |
+
Dataset and Models. We evaluate on two datasets – COCO (Lin et al., 2014) and PASCAL-50S (Vedantam et al., 2015). We use the public splits as in Karpathy & Fei-Fei (2015) for COCO. PASCAL-50S is used only for testing (with 200 held out images used to tune hyperparameters). We train a captioning model (Vinyals et al., 2015) using the neuraltalk21 code repository.
|
| 141 |
+
|
| 142 |
+
Results. Table 1 shows Oracle (top $k$ ) SPICE for different values of $k$ . DBS consistently outperforms BS and Li & Jurafsky (2016) on both datasets. We observe that gains on PASCAL-50S are more pronounced $7 . 1 4 \%$ and $4 . 6 5 \%$ SPICE $\textcircled{ a} 2 0$ improvements over BS and Li & Jurafsky (2016)) than COCO. This suggests diverse predictions are especially advantageous when there is a mismatch between training and testing sets, implying DBS may be better suited for real-world applications.
|
| 143 |
+
|
| 144 |
+
Table 1 also shows the number of distinct n-grams produced by different techniques. Our method produces significantly more distinct n-grams (almost $300 \%$ increase in the number of 4-grams produced) as compared to BS. We also note that our method tends to produce slightly longer captions compared on average. Moreover, on the PASCAL-50S test split we observe that DBS finds more likely top-1 solutions on average – DBS obtains an average maximum log probability of -6.53 opposed to -6.91 found by BS of the same beam width. This empirical evidence suggests that using DBS as a replacement to BS may lead to lower inference approximation error.
|
| 145 |
+
|
| 146 |
+
Table 1: Oracle accuracy and distinct n-grams on COCO and PASCAL-50S datasets for image captioning at $B = 2 0$ . While we report SPICE, we observe similar trends in other metrics (reported in supplement).
|
| 147 |
+
|
| 148 |
+
<table><tr><td rowspan="2">Dataset</td><td rowspan="2">Method</td><td colspan="4">Oracle Accuracy (SPICE)</td><td colspan="4">Diversity Statistics</td></tr><tr><td>@1</td><td>@5</td><td>@10</td><td>@20</td><td>distinct-1</td><td>distinct-2</td><td>distinct-3</td><td>distinct-4</td></tr><tr><td rowspan="5">PASCAL-50S</td><td>Beam Search</td><td>4.933</td><td>7.046</td><td>7.949</td><td>8.747</td><td>0.12</td><td>0.57</td><td>1.35</td><td>2.50</td></tr><tr><td>Li & Jurafsky (2016)</td><td>5.083</td><td>7.248</td><td>8.096</td><td>8.917</td><td>0.15</td><td>0.97</td><td>2.43</td><td>5.31</td></tr><tr><td>DBS</td><td>5.357</td><td>7.357</td><td>8.269</td><td>9.293</td><td>0.18</td><td>1.26</td><td>3.67</td><td>7.33</td></tr><tr><td>Wu et al. (2016)</td><td>5.301</td><td>7.322</td><td>8.236</td><td>8.832</td><td>0.16</td><td>1.10</td><td>3.16</td><td>6.45</td></tr><tr><td>Li et al. (2015)</td><td>5.129</td><td>7.175</td><td>8.168</td><td>8.560</td><td>0.13</td><td>1.15</td><td>3.58</td><td>8.42</td></tr><tr><td rowspan="5">COCO</td><td>Beam Search</td><td>16.278</td><td>22.962</td><td>25.145</td><td>27.343</td><td>0.40</td><td>1.51</td><td>3.25</td><td>5.67</td></tr><tr><td>Li & Jurafsky (2016)</td><td>16.351</td><td>22.715</td><td>25.234</td><td>27.591</td><td>0.54</td><td>2.40</td><td>5.69</td><td>8.94</td></tr><tr><td>DBS</td><td>16.783</td><td>23.081</td><td>26.088</td><td>28.096</td><td>0.56</td><td>2.96</td><td>7.38</td><td>13.44</td></tr><tr><td>Wu et al. (2016)</td><td>16.642</td><td>22.643</td><td>25.437</td><td>27.783</td><td>0.54</td><td>2.42</td><td>6.01</td><td>7.08</td></tr><tr><td>Li et al. (2015)</td><td>16.749</td><td>23.271</td><td>26.104</td><td>27.946</td><td>0.42</td><td>1.37</td><td>3.46</td><td>6.10</td></tr></table>
|
| 149 |
+
|
| 150 |
+
Human Studies. To evaluate human preference between captions generated by DBS and BS, we perform a human study via Amazon Mechanical Turk using all 1000 images of PASCAL-50S. For each image, both DBS and standard BS captions are shown to 5 different users. They are then asked – “Which of the two robots understands the image better?” In this forced-choice test, DBS captions were preferred over BS $60 \%$ of the time by human annotators.
|
| 151 |
+
|
| 152 |
+
Is diversity always needed? While these results show that diverse outputs are important for systems that interact with users, is diversity always beneficial? While images with many objects (e.g., a park or a living room) can be described in multiple ways, the same is not true when there are few objects (e.g., a close up of a cat or a selfie). This notion is studied by Ionescu et al. (2016), which defines a “difficulty score”: the human response time for solving a visual search task. On the PASCAL50S dataset, we observe a positive correlation $\zeta \rho = 0 . 7 3 )$ between difficulty scores and humans preferring DBS to BS. Moreover, while DBS is generally preferred by humans for ‘difficult’ images, both are about equally preferred on ‘easier’ images. Details are provided in the supplement.
|
| 153 |
+
|
| 154 |
+
# 5.3 MACHINE TRANSLATION
|
| 155 |
+
|
| 156 |
+
We use the WMT’14 dataset containing $4 . 5 { \mathrm { M } }$ sentences to train our machine translation models. We train stacking LSTM models as detailed in Luong et al. (2015), consisting of 4 layers and 1024- dimensional hidden states. While decoding sentences, we employ the same strategy to replace UNK tokens. We train our models using the publicly available seq2seq-attn2 code repository. We report results on news-test-2013 and news-test-2014 and use the news-test-2012 to tune the parameters of DBS. We use sentence level BLEU scores to compute oracle metrics and report distinct $\mathbf { n }$ -grams similar to image captioning. Results are shown in Table 2 and we again find that DBS consistently outperforms all baselines.
|
| 157 |
+
|
| 158 |
+
Table 2: Quantitative results on English-German translation on the newstest-2013 and newstest-2014 datasets combined (at $B = 2 0$ ).
|
| 159 |
+
|
| 160 |
+
<table><tr><td rowspan="2">Method</td><td colspan="4">Oracle Accuracy (BLEU-4)</td><td colspan="4">Diversity Statistics</td></tr><tr><td>@1</td><td>@5</td><td>@10</td><td>@20</td><td>distinct-1</td><td>distinct-2</td><td>distinct-3</td><td>distinct-4</td></tr><tr><td>Beam Search</td><td>20.5</td><td>22.4</td><td>23.8</td><td>24.2</td><td>0.04</td><td>0.75</td><td>2.10</td><td>3.23</td></tr><tr><td>Li & Jurafsky (2016)</td><td>20.7</td><td>22.6</td><td>24.0</td><td>24.3</td><td>0.04</td><td>0.81</td><td>2.92</td><td>4.61</td></tr><tr><td>DBS</td><td>20.8</td><td>22.9</td><td>24.4</td><td>24.8</td><td>0.06</td><td>0.95</td><td>3.67</td><td>5.54</td></tr><tr><td>Wu et al. (2016)</td><td>20.6</td><td>22.6</td><td>24.3</td><td>24.6</td><td>0.05</td><td>0.88</td><td>2.83</td><td>4.50</td></tr><tr><td>Li et al. (2015)</td><td>20.7</td><td>23.1</td><td>24.4</td><td>24.6</td><td>0.04</td><td>0.86</td><td>2.76</td><td>4.31</td></tr></table>
|
| 161 |
+
|
| 162 |
+
# 5.4 DIALOG GENERATION
|
| 163 |
+
|
| 164 |
+
Dialog generation is a task that is inherently diverse as there are multiple valid ways to respond to a statement. We train a seq2seq model consisting of LSTMs as in Vinyals & Le (2015) on the Cornell Movie Dialogs Corpus (Danescu-Niculescu-Mizil & Lee, 2011) using the neuralconvo3 repository. The training dataset consists of 222,182 conversational exchanges between movie characters. Since automatic evaluation of dialog generation responses is an open research problem with existing metrics being poorly correlated with human judgement (Liu et al., 2016), we show qualitative results to demonstrate the effectiveness of DBS. Table 3 compares BS and DBS at $\scriptstyle \mathrm { B } = 3$ .
|
| 165 |
+
|
| 166 |
+
Table 3: Qualitative examples of dialog generation comparing best-first search, BS and DBS
|
| 167 |
+
|
| 168 |
+
<table><tr><td>Prompt</td><td>Beam Search</td><td>Diverse Beam Search</td></tr><tr><td rowspan="2">Why do you want to be the president?</td><td>I don't know. I don't know...</td><td>I don't know.</td></tr><tr><td>I don't know,but Iam the best</td><td>Because you know! Because,I have another life.</td></tr><tr><td rowspan="2">It's such a beautiful day!</td><td>I know!</td><td>I know.</td></tr><tr><td>It's true.</td><td>Well...</td></tr><tr><td rowspan="2">What's your name?</td><td>Yeah. Jacob.</td><td>That's not true,honey.</td></tr><tr><td>Berger, my man. Berger, Thomas.</td><td>Jacob. Berger,darling</td></tr></table>
|
| 169 |
+
|
| 170 |
+
# 5.5 VISUAL QUESTION GENERATION
|
| 171 |
+
|
| 172 |
+
We also report results on Visual Question Generation (VQG) (Mostafazadeh et al., 2016), where a model is trained to produce questions about an image. Generating visually focused questions is interesting because it requires reasoning about multiple problems that are central to vision – e.g., object attributes, relationships between objects, and natural language. Furthermore, many questions could make sense for one image, so it is important that lists of generated questions be diverse.
|
| 173 |
+
|
| 174 |
+
We use the VQA dataset (Antol et al., 2015) to train a model similar to image captioning architectures. Instead of captions, the training set now consists of 3 questions per image. Similar to previous results, using beam search to sample outputs results in similarly worded questions (see Fig. 3) and DBS brings out new details captured by the model. Counting the number of types of questions generated (as defined by Antol et al. (2015)) allows us to measure this diversity. We observe that the number of question types generated per image increases from 2.3 for BS to 3.7 for DBS (at $B = 6$ ).
|
| 175 |
+
|
| 176 |
+
# 6 CONCLUSION
|
| 177 |
+
|
| 178 |
+
Beam search is widely a used approximate inference algorithm for decoding sequences from neural sequence models; however, it suffers from a lack of diversity. Producing multiple highly similar and generic outputs is not only wasteful in terms of computation but also detrimental for tasks with
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
|
| 182 |
+
Figure 3: Qualitative results on Visual Question Generation. DBS generates questions that are non-generic and belong to different question types.
|
| 183 |
+
|
| 184 |
+
inherent ambiguity like many involving language. In this work, we modify Beam Search with a diversity-augmented sequence decoding objective to produce Diverse Beam Search. We develop a ‘doubly greedy’ approximate algorithm to minimize this objective and produce diverse sequence decodings. Our method consistently outperforms beam search and other baselines across all our experiments without extra computation or task-specific overhead. DBS is task-agnostic and can be applied to any case where BS is used, which we demonstrate in multiple domains. Our implementation available at https://github.com/ashwinkalyan/dbs.
|
| 185 |
+
|
| 186 |
+
# REFERENCES
|
| 187 |
+
|
| 188 |
+
Peter Anderson, Basura Fernando, Mark Johnson, and Stephen Gould. Spice: Semantic propositional image caption evaluation. In Proceedings of European Conference on Computer Vision (ECCV), 2016. 6
|
| 189 |
+
Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C Lawrence Zitnick, and Devi Parikh. VQA: Visual question answering. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2425–2433, 2015. 1, 8
|
| 190 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. Proceedings of the International Conference on Learning Representations (ICLR), 2014. 1
|
| 191 |
+
Dhruv Batra, Payman Yadollahpour, Abner Guzman-Rivera, and Gregory Shakhnarovich. Diverse M-Best Solutions in Markov Random Fields. In Proceedings of European Conference on Computer Vision (ECCV), 2012. 2, 4
|
| 192 |
+
Cristian Danescu-Niculescu-Mizil and Lillian Lee. Chameleons in imagined conversations: A new approach to understanding coordination of linguistic style in dialogs. In Proceedings of the Workshop on Cognitive Modeling and Computational Linguistics, ACL 2011, 2011. 8
|
| 193 |
+
Francis Ferraro, Ishan Mostafazadeh, Nasrinand Misra, Aishwarya Agrawal, Jacob Devlin, Ross Girshick, Xiadong He, Pushmeet Kohli, Dhruv Batra, and C Lawrence Zitnick. Visual storytelling. Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics – Human Language Technologies (NAACL HLT), 2016. 2
|
| 194 |
+
Jenny Rose Finkel, Christopher D Manning, and Andrew Y Ng. Solving the problem of cascading errors: Approximate bayesian inference for linguistic annotation pipelines. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP), pp. 618–626, 2006. 1
|
| 195 |
+
K. Gimpel, D. Batra, C. Dyer, and G. Shakhnarovich. A systematic exploration of diversity in machine translation. In Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP), 2013. 1, 5, 12
|
| 196 |
+
Alex Graves, Abdel-rahman Mohamed, and Geoffrey E. Hinton. Speech recognition with deep recurrent neural networks. abs/1303.5778, 2013. 1
|
| 197 |
+
|
| 198 |
+
Radu Tudor Ionescu, Bogdan Alexe, Marius Leordeanu, Marius Popescu, Dim Papadopoulos, and Vittorio Ferrari. How hard can it be? Estimating the difficulty of visual search in an image. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016. 7
|
| 199 |
+
|
| 200 |
+
Anjuli Kannan, Karol Kurach, Sujith Ravi, Tobias Kaufmann, Andrew Tomkins, Balint Miklos, Greg Corrado, László Lukács, Marina Ganea, Peter Young, et al. Smart reply: Automated reeponse suggestion for email. In Proceedings of the ACM SIGKDD Conference on Knowledge Discovery and Data Mining (KDD), 2016. 2
|
| 201 |
+
|
| 202 |
+
Andrej Karpathy and Li Fei-Fei. Deep visual-semantic alignments for generating image descriptions. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015. 2, 7
|
| 203 |
+
|
| 204 |
+
Alexander Kirillov, Bogdan Savchynskyy, Dmitrij Schlesinger, Dmitry Vetrov, and Carsten Rother. Inferring m-best diverse labelings in a single one. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015. 2, 4
|
| 205 |
+
|
| 206 |
+
Jiwei Li and Dan Jurafsky. Mutual information and diverse decoding improve neural machine translation. arXiv preprint arXiv:1601.00372, 2016. 2, 5, 6, 7, 8, 13, 14
|
| 207 |
+
|
| 208 |
+
Jiwei Li, Michel Galley, Chris Brockett, Jianfeng Gao, and Bill Dolan. A diversity-promoting objective function for neural conversation models. Proceedings of the Conference of the North American Chapter of the Association for Computational Linguistics – Human Language Technologies (NAACL HLT), 2015. 2, 5, 6, 7, 8, 13, 14
|
| 209 |
+
|
| 210 |
+
Tsung-Yi Lin, Michael Maire, Serge Belongie, James Hays, Pietro Perona, Deva Ramanan, Piotr Dollar, and C. Lawrence Zitnick. Microsoft COCO: Common objects in context, 2014. 7
|
| 211 |
+
|
| 212 |
+
Chia-Wei Liu, Ryan Lowe, Iulian Vlad Serban, Michael Noseworthy, Laurent Charlin, and Joelle Pineau. How NOT to evaluate your dialogue system: An empirical study of unsupervised evaluation metrics for dialogue response generation. 2016. URL http://arxiv.org/abs/1603. 08023. 8
|
| 213 |
+
|
| 214 |
+
Minh-Thang Luong, Hieu Pham, and Christopher D Manning. Effective approaches to attentionbased neural machine translation. arXiv preprint arXiv:1508.04025, 2015. 7
|
| 215 |
+
|
| 216 |
+
Tomas Mikolov, Ilya Sutskever, Kai Chen, Greg S. Corrado, and Jeff Dean. Distributed representations of words and phrases and their compositionality. In Advances in Neural Information Processing Systems (NIPS), 2013. 12
|
| 217 |
+
|
| 218 |
+
Nasrin Mostafazadeh, Ishan Misra, Jacob Devlin, Margaret Mitchell, Xiaodong He, and Lucy Vanderwende. Generating natural questions about an image. Proceedings of the Annual Meeting on Association for Computational Linguistics (ACL), 2016. 8
|
| 219 |
+
|
| 220 |
+
Kishore Papineni, Salim Roukos, Todd Ward, and Wei-Jing Zhu. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the Annual Meeting on Association for Computational Linguistics (ACL), 2002. 6
|
| 221 |
+
|
| 222 |
+
Dennis Park and Deva Ramanan. N-best maximal decoders for part models. In Proceedings of IEEE International Conference on Computer Vision (ICCV), 2011. 4
|
| 223 |
+
|
| 224 |
+
Adarsh Prasad, Stefanie Jegelka, and Dhruv Batra. Submodular meets structured: Finding diverse subsets in exponentially-large structured item sets. In Advances in Neural Information Processing Systems (NIPS), 2014. 2, 4
|
| 225 |
+
|
| 226 |
+
Ramakrishna Vedantam, C Lawrence Zitnick, and Devi Parikh. Cider: Consensus-based image description evaluation. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015. 7
|
| 227 |
+
|
| 228 |
+
Subhashini Venugopalan, Marcus Rohrbach, Jeffrey Donahue, Raymond Mooney, Trevor Darrell, and Kate Saenko. Sequence to sequence-video to text. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pp. 4534–4542, 2015. 1
|
| 229 |
+
|
| 230 |
+
Oriol Vinyals and Quoc Le. A neural conversational model. arXiv preprint arXiv:1506.05869, 2015. 1, 8
|
| 231 |
+
|
| 232 |
+
Oriol Vinyals, Alexander Toshev, Samy Bengio, and Dumitru Erhan. Show and tell: A neural image caption generator. In Proceedings of IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2015. 1, 2, 7
|
| 233 |
+
|
| 234 |
+
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144, 2016. 5, 6, 7, 8, 13, 14
|
| 235 |
+
|
| 236 |
+
# APPENDIX
|
| 237 |
+
|
| 238 |
+
SENSIVITY STUDIES
|
| 239 |
+
|
| 240 |
+
Number of Groups. Fig. 4 presents snapshots of the transition from BS to DBS at $B = 6$ and $G = \{ 1 , 3 , 6 \}$ . As beam width moves from 1 to $G$ , the exploration of the method increases resulting in more diverse lists.
|
| 241 |
+
|
| 242 |
+

|
| 243 |
+
|
| 244 |
+
Figure 4: Effect of increasing the number of groups $G$ . The beams that belong to the same group are colored similarly. Recall that diversity is only enforced across groups such that $G = 1$ corresponds to classical BS.
|
| 245 |
+
|
| 246 |
+
Diversity Strength. As noted in Section 5.1, our method is robust to a wide range of values of the diversity strength $( \lambda )$ . Fig. 5a shows a grid search of $\lambda$ for image-captioning on the PASCAL-50S dataset.
|
| 247 |
+
|
| 248 |
+
Choice of Diversity Function. The diversity function can take various forms ranging from simple hamming diversity to neural embedding based diversity. We discuss some forms for language modelling below:
|
| 249 |
+
|
| 250 |
+
- Hamming Diversity. This form penalizes the selection of tokens used in previous groups proportional to the number of times it was selected before.
|
| 251 |
+
- Cumulative Diversity. Once two sequences have diverged sufficiently, it seems unnecessary and perhaps harmful to restrict that they cannot use the same words at the same time. To encode this ‘backing-off’ of the diversity penalty we introduce cumulative diversity which keeps a count of identical words used at every time step, indicative of overall dissimilarity. Specifically, $\begin{array} { r } { \Delta ( Y _ { [ t ] } ^ { h } ) [ y _ { [ t ] } ^ { g } ] = \exp \{ - \big ( \sum _ { \tau \in t } \sum _ { b \in B ^ { \prime } } I \big [ y _ { b , \tau } ^ { h } \neq y _ { b , \tau } ^ { g } ] \big ) / \Gamma \} } \end{array}$ where $\Gamma$ is a temperature parameter controlling the strength of the cumulative diversity term and $I [ \cdot ]$ is the indicator function.
|
| 252 |
+
- $n$ -gram Diversity. The current group is penalized for producing the same n-grams as previous groups, regardless of alignment in time – similar to Gimpel et al. (2013). This is proportional to the number of times each $\mathbf { n }$ -gram in a candidate occurred in previous groups. Unlike hamming diversity, n-grams capture higher order structures in the sequences.
|
| 253 |
+
- Neural-embedding Diversity. While all the previous diversity functions discussed above perform exact matches, neural embeddings such as word2vec (Mikolov et al., 2013) can penalize semantically similar words like synonyms. This is incorporated in each of the previous diversity functions by replacing the hamming similarity with a soft version obtained by computing the cosine similarity between word2vec representations. When using with n-gram diversity, the representation of the n-gram is obtained by summing the vectors of the constituent words.
|
| 254 |
+
|
| 255 |
+
Each of these various forms encode different notions of diversity. Hamming diversity ensures different words are used at different times, but can be circumvented by small changes in sequence alignment. While n-gram diversity captures higher order statistics, it ignores sentence alignment. Neural-embedding based encodings can be seen as a semantic blurring of either the hamming or n-gram metrics, with word2vec representation similarity propagating diversity penalties not only to exact matches but also to close synonyms. Fig. 5b shows the oracle performace of various forms of the diversity function described in Section 5.1. We find that using any of the above functions help outperform BS in the tasks we examine; hamming diversity achieves the best oracle performance despite its simplicity.
|
| 256 |
+
|
| 257 |
+
# IMAGE CAPTIONING EVALUATION
|
| 258 |
+
|
| 259 |
+
While we report oracle SPICE values in the paper, our method consistently outperforms baselines and classical BS on other standard metrics such as CIDEr (Table 4), METEOR (Table 5) and ROUGE (Table 6). We provide these additional results in this section.
|
| 260 |
+
|
| 261 |
+

|
| 262 |
+
Figure 5: Fig. 5a shows the results of a grid search of the diversity strength $( \lambda )$ parameter of DBS on the validation split of PASCAL 50S dataset. We observe that it is robust for a wide range of values. Fig. 5b compares the performance of multiple forms for the diversity function $( \Delta )$ . While naïve diversity performs the best, other forms are comparable while being better than BS.
|
| 263 |
+
|
| 264 |
+
Table 4: CIDEr Oracle accuracy on COCO and PASCAL-50S datasets for image captioning at $B = 2 0$ .
|
| 265 |
+
|
| 266 |
+
<table><tr><td>Dataset</td><td>Method</td><td colspan="4">Oracle Accuracy (CIDEr)</td></tr><tr><td></td><td></td><td>@1</td><td>@5</td><td>@10</td><td>@20</td></tr><tr><td rowspan="5">PASCAL-50S</td><td>Beam Search</td><td>53.79</td><td>83.94</td><td>96.70</td><td>107.63</td></tr><tr><td>Li & Jurafsky (2016)</td><td>54.61</td><td>85.21</td><td>99.80</td><td>110.64</td></tr><tr><td>DBS</td><td>57.82</td><td>89.38</td><td>103.75</td><td>113.43</td></tr><tr><td>Wu et al. (2016)</td><td>47.77</td><td>72.12</td><td>84.64</td><td>105.66</td></tr><tr><td>Li et al. (2015)</td><td>49.80</td><td>81.35</td><td>96.87</td><td>107.37</td></tr><tr><td rowspan="5">COCO</td><td>Beam Search</td><td>87.27</td><td>121.74</td><td>133.46</td><td>140.98</td></tr><tr><td>Li & Jurafsky (2016)</td><td>91.42</td><td>111.33</td><td>116.94</td><td>119.14</td></tr><tr><td>DBS</td><td>86.88</td><td>123.38</td><td>135.68</td><td>142.88</td></tr><tr><td>Wu et al. (2016)</td><td>87.54</td><td>122.06</td><td>133.21</td><td>139.43</td></tr><tr><td>Li et al. (2015)</td><td>88.18</td><td>124.20</td><td>138.65</td><td>150.06</td></tr></table>
|
| 267 |
+
|
| 268 |
+
Table 5: METEOR Oracle accuracy on COCO and PASCAL-50S datasets for image captioning at $B = 2 0$
|
| 269 |
+
|
| 270 |
+
<table><tr><td>Dataset</td><td>Method</td><td colspan="4">Oracle Accuracy (METEOR)</td></tr><tr><td></td><td></td><td>@1</td><td>@5</td><td>@10</td><td>@20</td></tr><tr><td rowspan="4">PASCAL-50S</td><td>Beam Search</td><td>12.24</td><td>16.74</td><td>19.14</td><td>21.22</td></tr><tr><td>Li & Jurafsky (2016)</td><td>13.52</td><td>17.65</td><td>19.91</td><td>21.76</td></tr><tr><td>DBS</td><td>13.71</td><td>18.45</td><td>20.67</td><td>22.83</td></tr><tr><td>Wu et al. (2016)</td><td>13.34</td><td>17.20</td><td>18.98</td><td>21.13</td></tr><tr><td rowspan="5">COCO</td><td>Li et al. (2015)</td><td>13.04</td><td>17.92</td><td>19.73</td><td>22.32</td></tr><tr><td>Beam Search</td><td>24.81</td><td>28.56</td><td>30.59</td><td>31.87</td></tr><tr><td>Li & Jurafsky (2016)</td><td>24.88</td><td>29.10</td><td>31.44</td><td>33.56</td></tr><tr><td>DBS</td><td>25.04</td><td>29.67</td><td>33.25</td><td>35.42</td></tr><tr><td>Wu et al. (2016)</td><td>24.82</td><td>28.92</td><td>31.53</td><td>34.14</td></tr><tr><td></td><td>Li et al. (2015)</td><td>24.93</td><td>30.11</td><td>32.34</td><td>34.88</td></tr></table>
|
| 271 |
+
|
| 272 |
+
Modified SPICE evaluation. To measure both the quality and the diversity of the generated captions, we compute SPICE-score by comparing the graph union of all the generated hypotheses with the ground truth scene graph. This measure rewards all the relevant relations decoded as against oracle accuracy that compares to relevant relations present only in the top-scoring caption. We observe that DBS outperforms both baselines under this measure with a score of 18.345 as against a score of 16.988 (beam search) and 17.452 (Li & Jurafsky, 2016).
|
| 273 |
+
|
| 274 |
+
Table 6: ROUGE Oracle accuracy on COCO and PASCAL-50S datasets for image captioning at $B = 2 0$
|
| 275 |
+
|
| 276 |
+
<table><tr><td>Dataset</td><td>Method</td><td colspan="4">Oracle Accuracy (ROUGE-L)</td></tr><tr><td></td><td></td><td>@1</td><td>@5</td><td>@10</td><td>@20</td></tr><tr><td rowspan="4">PASCAL-50S</td><td>Beam Search</td><td>45.23</td><td>56.12</td><td>59.61</td><td>62.04</td></tr><tr><td>Li & Jurafsky (2016)</td><td>46.21</td><td>56.17</td><td>60.15</td><td>62.95</td></tr><tr><td>DBS</td><td>46.24</td><td>56.90</td><td>60.35</td><td>63.02</td></tr><tr><td>Wu et al. (2016)</td><td>43.73</td><td>52.29</td><td>56.49</td><td>61.65</td></tr><tr><td rowspan="5">COCO</td><td>Li et al. (2015)</td><td>44.12</td><td>54.67</td><td>57.34</td><td>60.11</td></tr><tr><td>Beam Search</td><td>52.46</td><td>58.43</td><td>62.56</td><td>65.14</td></tr><tr><td>Li & Jurafsky (2016)</td><td>52.87</td><td>59.89 60.89</td><td>63.45</td><td>65.42</td></tr><tr><td>DBS</td><td>53.04</td><td></td><td>64.24</td><td>67.72</td></tr><tr><td>Wu et al. (2016) Li et al. (2015)</td><td>52.13 53.10</td><td>58.26 59.32</td><td>62.89 63.04</td><td>65.77 66.19</td></tr></table>
|
| 277 |
+
|
| 278 |
+
# HUMAN STUDIES
|
| 279 |
+
|
| 280 |
+
For image-captioning, we conduct a human preference study between BS and DBS captions as explained in Section 5. A screen shot of the interface used to collect human preferences for captions generated using DBS and BS is presented in Fig. 6. The lists were shuffled to guard the task from being gamed by a turker.
|
| 281 |
+
|
| 282 |
+
Table 7: Frequency table for image difficulty and human preference for DBS captions on PASCAL50S dataset
|
| 283 |
+
|
| 284 |
+
<table><tr><td>difficulty score bin range</td><td>#images</td><td>% images DBS was preffered</td></tr><tr><td>≤μ-σ</td><td>481</td><td>50.51%</td></tr><tr><td>[μ-σ,μ+σ]</td><td>409</td><td>69.92%</td></tr><tr><td>≥μ+σ</td><td>110</td><td>83.63%</td></tr></table>
|
| 285 |
+
|
| 286 |
+
As mentioned in Section 5, we observe that difficulty score of an image and human preference for DBS captions are positively correlated. The dataset contains more images that are less difficulty and so, we analyze the correlation by dividing the data into three bins. For each bin, we report the $\%$ of images for which DBS captions were preferred after a majority vote (i.e. at least 3/5 turkers voted in favor of DBS) in Table 7. At low difficulty scores consisting mostly of iconic images – one might expect that BS would be preferred more often than chance. However, mismatch between the statistics of the training and testing data results in a better performance of DBS. Some examples for this case are provided in Fig. 7. More general qualitative examples are provided in Fig. 8.
|
| 287 |
+
|
| 288 |
+
# DISCUSSION
|
| 289 |
+
|
| 290 |
+
Are longer sentences better? Many recent works propose a scoring or a ranking objective that depends on the sequence length. These favor longer sequences, reasoning that they tend to have more details and resulting in improved accuracies. We measure the correlation between length of a sequence and its accuracy (here, SPICE) and observe insignificant correlation between SPICE and sequence length. On the PASCAL-50S dataset, we find that BS and DBS have are negatively correlated ${ \mathrm { \Delta } } \rho = - 0 . 0 0 3$ and $\rho = - 0 . 0 1 5$ respectively), while (Li & Jurafsky, 2016) is correlated positively $\zeta = 0 . 0 0 2 )$ . Length is not correlated with performance in this case.
|
| 291 |
+
|
| 292 |
+
Efficient utilization of beam budget. In this experiment, we emperically show that DBS makes efficient use of the beam budget in exploring the search space for better solutions. Fig. 9 shows the variation of oracle SPICE $( \ @ \mathbf { B } )$ with the beam size. At really high beam widths, all decoding techniques achieve similar oracle accuracies. However, diverse decoding techniques like DBS achieve the same oracle at much lower beam widths. Hence, DBS not only produces sequence lists that are significantly different but also efficiently utilizes the beam budget to decode better solutions.
|
| 293 |
+
|
| 294 |
+
# Instructions
|
| 295 |
+
|
| 296 |
+
# Which of the two robots understands the image better?
|
| 297 |
+
|
| 298 |
+
Two robots are shown an image.They both make 5 guesses each for describing the image with a single sentence.
|
| 299 |
+
|
| 300 |
+
Which robot do you think is more intellgent or uman-like displaying a better understanding of the image?
|
| 301 |
+
|
| 302 |
+

|
| 303 |
+
Note: Select the radio button above the set of captions that you pick.
|
| 304 |
+
Figure 6: Screen-shot of the interface used to perform human studies
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
|
| 308 |
+
# Beam Search
|
| 309 |
+
|
| 310 |
+
A man riding a motorcycle on a dirt road A man riding a motorcycle on a beach A man riding a motorcycle on the side of a road A man riding a bike on a dirt road A man riding a motorcycle on the side of the road A man riding a motorcycle on the side of a beach
|
| 311 |
+
|
| 312 |
+
# Diverse Beam Search
|
| 313 |
+
|
| 314 |
+
A man riding a motorcycle on a beach
|
| 315 |
+
A man riding abike on a dirt road
|
| 316 |
+
A man riding a bike on a dirt road
|
| 317 |
+
A man on a motorcycle is flying a kite
|
| 318 |
+
A person on a skateboard riding on the side of a road
|
| 319 |
+
A person on a bicycle with a helmet on on the ground
|
| 320 |
+
|
| 321 |
+
Difficulty Score : 2.8308
|
| 322 |
+
|
| 323 |
+

|
| 324 |
+
Difficulty Score :2.9287
|
| 325 |
+
|
| 326 |
+
# Beam Search
|
| 327 |
+
|
| 328 |
+
A black bear standing in a grassy field A black bear standing in a field of grass A black bear is standing in the grass A black bear is standing in a field A black bear standing in the grass next to a tree A black bear standing in the grass near a fence
|
| 329 |
+
|
| 330 |
+
# Diverse Beam Search
|
| 331 |
+
|
| 332 |
+
# A black dog is standing in the grass A black dog is standing in the grass
|
| 333 |
+
|
| 334 |
+
A black bear walking through a grassy field A black bear walking ina field of grass A black and white dog is standing in the grass A black bear standing in the grass near a fence
|
| 335 |
+
|
| 336 |
+
Difficulty Score :2.8999
|
| 337 |
+
|
| 338 |
+
# Beam Search
|
| 339 |
+
|
| 340 |
+
A close up of a bowl of broccoli A close up of a plate of broccoli A close up of a broccoli plant on a table Aclose up of a bowl of broccoli on a table A close up of a broccoli plant in a garden A close up of a plate of broccoli and cauliflower
|
| 341 |
+
|
| 342 |
+

|
| 343 |
+
Figure 7: For images with low difficulty score, BS captions are preferred to DBS – as show in the first figure. However, we observe that DBS captions perform better when there is a mismatch between the statistics of the testing and training sets. Interesting captions are colored in blue for readability.
|
| 344 |
+
|
| 345 |
+
# Diverse Beam Search
|
| 346 |
+
|
| 347 |
+
Aclose up of a bowl of broccoli Aclose up of a plate of broccoli and broccoli A green plant with a green plant in it A green plant with a bunch of green leaves A white plate topped with broccoli and a plant A small green plant with a green plant in it
|
| 348 |
+
|
| 349 |
+

|
| 350 |
+
Difficulty Score : 5.4382
|
| 351 |
+
|
| 352 |
+
# Beam Search
|
| 353 |
+
|
| 354 |
+
A group of people sitting at a table with laptops A group of people sitting at a table A couple of people that are sitting at a table A group of people sitting around a table with laptops A group of people sitting at a table in front of laptops A group of people sitting at a table with a laptop
|
| 355 |
+
|
| 356 |
+
# Diverse Beam Search
|
| 357 |
+
|
| 358 |
+
A group of people sitting at a table with laptops A group of people sitting at a table with laptops A group of people sitting around a table with laptops A group of people are sitting at a table Two people sitting at a table with laptops Three people are siting at a table with laptops
|
| 359 |
+
|
| 360 |
+

|
| 361 |
+
Difficulty Score : 4.1815
|
| 362 |
+
|
| 363 |
+
# Beam Search
|
| 364 |
+
|
| 365 |
+
A woman sitting in front of a laptop computer A woman sitting at a table with a laptop A woman sitting at a table with a laptop computer A woman is working on a laptop computer A woman siting at a desk with a laptop computer A woman is sitting at a table with a laptop
|
| 366 |
+
|
| 367 |
+
# Diverse Beam Search
|
| 368 |
+
|
| 369 |
+
A woman sitting at a table with a laptop computer A woman is working on a laptop computer A woman is sitting at a table with a laptop A man sitting at a desk with a laptop computer A woman in a kitchen with a laptop computer A man is sitting at a table with a laptop and a computer
|
| 370 |
+
|
| 371 |
+

|
| 372 |
+
Difficulty Score : 3.8146
|
| 373 |
+
|
| 374 |
+
# Beam Search
|
| 375 |
+
|
| 376 |
+
A wooden table topped with plates of food A table with plates of food on it A wooden table topped with plates and bowls of food A table that hasa bunch of plates on it A wooden table topped with plates of food and glasses A wooden table topped with plates of food and cups
|
| 377 |
+
|
| 378 |
+
# Diverse Beam Search
|
| 379 |
+
|
| 380 |
+
A table with a plate of food and a glass of wine A table with a plate of food and a glass A table with plates of food and a glass of wine A dining table with a plate of food and a glass of wine A table with a bowl of food and a bowl of soup on it A dining room table with a plate of food and a glass of wine on it
|
| 381 |
+
|
| 382 |
+
Figure 8: For images with a high difficulty score, captions produced by DBS are preferred to BS. Interesting captions are colored in blue for readability.
|
| 383 |
+
|
| 384 |
+

|
| 385 |
+
Figure 9: As the number of beams increases, all decoding methods tend to achieve about the same oracle accuracy. However, diverse decoding techniques like DBS utilize the beam budget efficiently achieving higher oracle accuracies at much lower beam budgets.
|
md/train/HJewiCVFPB/HJewiCVFPB.md
ADDED
|
@@ -0,0 +1,408 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GRADIENT SURGERY FOR MULTI-TASK LEARNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
While deep learning and deep reinforcement learning systems have demonstrated impressive results in domains such as image classification, game playing, and robotic control, data efficiency remains a major challenge, particularly as these algorithms learn individual tasks from scratch. Multi-task learning has emerged as a promising approach for sharing structure across multiple tasks to enable more efficient learning. However, the multi-task setting presents a number of optimization challenges, making it difficult to realize large efficiency gains compared to learning tasks independently. The reasons why multi-task learning is so challenging compared to single task learning are not fully understood. Motivated by the insight that gradient interference causes optimization challenges, we develop a simple and general approach for avoiding interference between gradients from different tasks, by altering the gradients through a technique we refer to as “gradient surgery”. We propose a form of gradient surgery that projects the gradient of a task onto the normal plane of the gradient of any other task that has a conflicting gradient. On a series of challenging multi-task supervised and multi-task reinforcement learning problems, we find that this approach leads to substantial gains in efficiency and performance. Further, it can be effectively combined with previously-proposed multi-task architectures for enhanced performance in a model-agnostic way.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
While deep learning and deep reinforcement learning (RL) have shown considerable promise in enabling systems to perform complex tasks, the data requirements of current methods make it difficult to learn a breadth of capabilities particularly when all tasks are learned individually from scratch. A natural approach to such multi-task learning problems is to train a single network on all tasks jointly, with the aim of discovering shared structure across the tasks in a way that achieves greater efficiency and performance than solving the tasks individually. However, learning multiple tasks all at once results in a difficult optimization problem, sometimes leading to worse overall performance and data efficiency compared to learning tasks individually (Parisotto et al., 2015; Rusu et al., 2016a). These optimization challenges are so prevalent that multiple multi-task RL algorithms have considered using independent training as a subroutine of the algorithm before distilling the independent models into a multi-tasking model (Levine et al., 2016; Parisotto et al., 2015; Rusu et al., 2016a; Ghosh et al., 2017; Teh et al., 2017), producing a multi-task model but losing out on the efficiency gains over independent training. If we could tackle the optimization challenges of multi-task learning effectively, we may be able to actually realize the hypothesized benefits of multi-task learning without the cost in final performance.
|
| 12 |
+
|
| 13 |
+
While there has been a significant amount of research in multi-task learning (Caruana, 1997; Ruder, 2017), the optimization challenges are not well understood. Prior work has described varying learning speeds of different tasks (Chen et al., 2017) and plateaus in the optimization landscape (Schaul et al., 2019) as potential causes, while a range of other works have focused on the model architecture (Misra et al., 2016b; Liu et al., 2018). In this work, we instead hypothesize that the central optimization issue in multi-task learning arises from gradients from different tasks conflicting with one another. In particular, we define two gradients to be conflicting if they point away from one another (i.e., have a negative cosine similarity). As a concrete example, consider the 2D optimization landscapes of two task objectives shown in Figure 1. The optimization landscape of each task consists of a deep valley, as has been characterized of neural network optimization landscapes in the past (Goodfellow et al., 2014). When considering the combined optimization landscape for multiple tasks, SGD produces gradients that struggle to efficiently find the optimum. This occurs due to a gradient thrashing phenomenon, where the gradient of one task destabilizes optimization in the valley. We can observe this in Figure 1(d) when the optimization reaches the deep valley of task 1, but is prevented from traversing the valley to an optimum. In Section 6.2, we find experimentally that this thrashing phenomenon also occurs in a neural network multi-task learning problem.
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Visualization of PCGrad’s effect on a 2D multi-task optimization problem. (a) A multi-task objective landscape. (b) & (c) Contour plots of the individual task objectives that comprise the multi-task objective. (d) Trajectory of gradient updates on the multi-task objective using the Adam optimizer. The gradient vectors of the two tasks at the end of the trajectory are indicated by blue and red arrows, where the relative lengths are on a log scale.(e) Trajectory of gradient updates on the multi-task objective using Adam with PCGrad. For (d) and (e), the optimization trajectory goes from black to yellow.
|
| 17 |
+
|
| 18 |
+
The core contribution of this work is a method for mitigating gradient interference by altering the gradients directly, i.e. by performing “gradient surgery”. If two gradients are conflicting, we alter the gradients by projecting each onto the normal plane of the other, preventing the interfering components of the gradient from being applied to the network. We refer to this particular form of gradient surgery as projecting conflicting gradients (PCGrad). PCGrad is model-agnostic, requiring only a single modification to the application of gradients. Hence, it is easy to apply to a range of problem settings, including multi-task supervised learning and multi-task reinforcement learning, and can also be readily combined with other multi-task learning approaches, such as those that modify the architecture. We evaluate PCGrad on multi-task CIFAR classification, multi-objective scene understanding, a challenging multi-task RL domain, and goal-conditioned RL. Across the board, we find PCGrad leads to significant improvements in terms of data efficiency, optimization speed, and final performance compared to prior approaches. Further, on multi-task supervised learning tasks, PCGrad can be successfully combined with prior state-of-the-art methods for multi-task learning for even greater performance.
|
| 19 |
+
|
| 20 |
+
# 2 PRELIMINARIES
|
| 21 |
+
|
| 22 |
+
The goal of multi-task learning is to find parameters $\theta$ of a model $f _ { \theta }$ that achieve high average performance across all the training tasks drawn from a distribution of tasks $p ( \tau )$ . More formally, we aim to solve the problem: $\operatorname* { m i n } _ { \theta } \mathbb { E } _ { \mathcal { T } _ { i } \sim p ( \mathcal { T } ) } \left[ \mathcal { L } _ { i } ( f _ { \theta } ) \right]$ , where $\mathcal { L } _ { i }$ is a loss function for the $i$ -th task $\mathcal { T } _ { i }$ that we want to minimize. To obtain a model that solves a specific task from the task distribution $p ( \mathcal { T } )$ , we define a task-conditioned model $f _ { \boldsymbol { \theta } } ( \boldsymbol { y } | \boldsymbol { x } , z _ { i } )$ , with input $x$ , output $y$ , and encoding $z _ { i }$ for task $\mathcal { T } _ { i }$ , which could be provided as a one-hot vector or in any other form.
|
| 23 |
+
|
| 24 |
+
# 3 MULTI-TASK LEARNING VIA GRADIENT SURGERY
|
| 25 |
+
|
| 26 |
+
While the multi-task problem can in principle be solved by simply applying a standard single-task algorithm with a suitable task identifier provided to the model or a simple multi-head or multi-output model, a number of prior works (Parisotto et al., 2015; Rusu et al., 2016a; Sener & Koltun, 2018) have found this learning problem to be difficult, especially in the reinforcement learning setting. We hypothesize that one of the main challenges of multi-task learning can be characterized by conflicting and thrashing gradients, and find that this can significantly impede learning progress, especially when combined with iterative data collection. We identify possible causes for this problem and propose a simple and general approach to mitigate it.
|
| 27 |
+
|
| 28 |
+
# 3.1 THRASHING GRADIENTS IN MULTI-TASK OPTIMIZATION LANDSCAPES
|
| 29 |
+
|
| 30 |
+
We hypothesize that a key optimization issue in multi-task learning arises when gradients from multiple tasks are in conflict with one another, i.e. when gradients point away from one another. More specifically, we hypothesize that such conflict may lead to gradient thrashing. Concretely, gradient thrashing refers to the phenomenon where a large gradient for one task changes the parameter vectors in a way that substantially decreases performance on another task. Since worse performance typically leads to larger gradients, this results in alternating gradient directions, where, at the next iteration, the second task will have large gradients that dominate and reduce performance on the former task. This issue can be particularly pronounced for neural network optimization, since neural network loss landscapes are known to resemble long narrow valleys (Goodfellow et al., 2014), where the gradient perpendicular to the direction of the valley will be small.
|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
Figure 2: Visual depiction of conflicting gradients and PCGrad. In (a), we see that tasks A and B have conflicting gradient directions, which can lead to destructive interference and unstable learning. In (b), we illustrate the PCGrad algorithm in cases where gradients are conflicting. PCGrad projects the gradient of task A onto the normal vector of task B’s gradient. In (c), we show that tasks with non-conflicting gradients are not altered under PCGrad, thereby keeping tasks with constructive interference.
|
| 34 |
+
|
| 35 |
+
We aim to study this hypothesis through two toy examples. First, consider the two-dimensional optimization landscape illustrated in Fig. 1a, where the landscape for each task objective corresponds to a deep and curved valley (Fig. 1b and 1c). The optima of this multi-task objective correspond to where the two valleys meet. More details on the optimization landscape are in Appendix B. We observe that the gradient thrashing hypothesis is consistent with what we observe when running Adam (Kingma & Ba, 2014) on this landscape in Fig. 1d, where we observe that Adam does not traverse one valley towards the other, preventing it from reaching an optimum.
|
| 36 |
+
|
| 37 |
+
We also aim to detect if a similar phenomenon occurs in multi-task learning with a neural network with thousands of parameters on a toy regression problem. To measure the extent of gradient thrashing, we plot the cosine similarity between the gradients of two tasks throughout the beginning of learning in Fig. 4 (left). We indeed observe a significant level of gradient thrashing at every iteration, where the cosine similarity varies between $- 0 . 7 5$ and 0.75 at a very high frequency.
|
| 38 |
+
|
| 39 |
+
Motivated by these observations, we develop an algorithm that aims to alleviate the optimization challenges caused by gradient thrashing by preventing such gradient conflict between tasks.
|
| 40 |
+
|
| 41 |
+
# 3.2 PCGRAD: PROJECTING CONFLICTING GRADIENTS
|
| 42 |
+
|
| 43 |
+
We aim to prevent gradient thrashing by directly altering the gradients themselves, i.e. through “gradient surgery.” To be maximally effective and maximally applicable, we must perform surgery in a way that still allows for positive interactions between the task gradients and does not introduce any assumptions on the form of the model.
|
| 44 |
+
|
| 45 |
+
We start by first detecting whether two gradients are in conflict, by measuring whether they point away from one another. More concretely, we characterize two tasks as conflicting for the current parameter setting if they yield a negative cosine similarity between their respective gradients. The goal of PCGrad is to modify the gradients for each task so as to minimize negative conflict with other task gradients, which will in turn mitigate gradient thrashing.
|
| 46 |
+
|
| 47 |
+
To deconflict gradients during optimization, PCGrad adopts a simple procedure: if the gradients between two tasks are in conflict, i.e. their cosine similarity is negative, we project the gradient from one task onto the normal plane of the gradient of the other task. This amounts to removing the conflicting component of the gradient for the task, thereby reducing the amount of destructive gradient interference between tasks. A pictorial description of this idea is shown in Fig. 2. Suppose the gradient for task $\mathcal { T } _ { i }$ is $\mathbf { g } _ { i }$ , and the gradient for task $\tau _ { j }$ is $\mathbf { g } _ { j }$ . PCGrad proceeds as follows: (1) First, it determines whether $\mathbf { g } _ { i }$ conflicts with ${ \bf { g } } _ { j }$ by computing the cosine similarity between vectors $\mathbf { g } _ { i }$ and $\mathbf { g } _ { j }$ , where negative values indicate conflicting gradients. (2) If the cosine similarity is negative, we replace $\mathbf { g } _ { i }$ by its projection onto the normal plane of $\mathbf { g } _ { j }$ : $\begin{array} { r } { \mathbf { g } _ { i } = \mathbf { g } _ { i } - \frac { \mathbf { g } _ { i } \cdot \mathbf { g } _ { j } } { \| \mathbf { g } _ { j } \| ^ { 2 } } \mathbf { g } _ { j } } \end{array}$ gi·gjkgjk2 gj . If the gradients are not in conflict, i.e. cosine similarity is non-negative, the original gradient $\mathbf { g } _ { i }$ remains unaltered. (3) PCGrad repeats this process across all of the other tasks sampled in random order from the current
|
| 48 |
+
|
| 49 |
+
# Algorithm 1 PCGrad Update Rule
|
| 50 |
+
|
| 51 |
+
Require: Current model parameters $\theta$
|
| 52 |
+
1: Sample mini-batch of tasks $B = \{ \mathcal { T } _ { k } \} \sim p ( \mathcal { T } )$
|
| 53 |
+
2: for $\bar { \mathcal { T } } _ { i } \sim \mathcal { B }$ in sequence do
|
| 54 |
+
3: Compute gradient ${ \bf g } _ { i }$ of $\mathcal { T } _ { i }$ as $\mathbf { g } _ { i } = \nabla _ { \theta } \mathcal { L } _ { i } ( f _ { \theta } )$
|
| 55 |
+
4: for ${ \tau _ { j } } \stackrel { \mathrm { u n i f o r m l y } } { \sim } { B }$ in random order do
|
| 56 |
+
5: Compute gradient $\mathbf { g } _ { j }$ of task $\mathcal { T } _ { j }$ as $\mathbf { g } _ { j } = \nabla _ { \theta } \mathcal { L } _ { j } ( f _ { \theta } )$
|
| 57 |
+
6: Compute cosine similarity between $\mathbf { g } _ { i }$ as $\mathbf { g } _ { j }$ as $\begin{array} { r } { \cos ( \phi _ { i j } ) = \frac { \mathbf { g } _ { i } \cdot \mathbf { g } _ { j } } { \| \mathbf { g } _ { i } \| \| \mathbf { g } _ { j } \| } } \end{array}$ .
|
| 58 |
+
7: 8: if $\begin{array} { r l } & { \cos ( \phi _ { i j } ) < 0 \mathrm { t h e n } } \\ & { \mathrm { S e t } \mathbf { g } _ { i } = \mathbf { g } _ { i } - \frac { \mathbf { g } _ { i } \cdot \mathbf { g } _ { j } } { \| \mathbf { g } _ { j } \| ^ { 2 } } \mathbf { g } _ { j } } \end{array}$ // Subtract the projection of ${ \bf g } _ { i }$ onto $\mathbf { g } _ { j }$
|
| 59 |
+
9: end if
|
| 60 |
+
10: end for
|
| 61 |
+
11: Store $\mathbf { g } _ { i } ^ { \mathrm { p r o j } } = \mathbf { g } _ { i }$
|
| 62 |
+
12: end for
|
| 63 |
+
13: return update $\begin{array} { r } { \Delta \theta = \sum _ { i } \mathbf { g } _ { i } ^ { \mathrm { p r o j } } } \end{array}$
|
| 64 |
+
|
| 65 |
+
batch $\mathcal { T } _ { j } \ \forall \ j \ \neq i$ , resulting in the gradient ${ \bf g } _ { i } ^ { \mathrm { p r o j } }$ that is applied for task $\mathcal { T } _ { i }$ . We perform the same procedure for all tasks in the batch to obtain their respective gradients. The full update procedure is described in Algorithm 1 and a discussion on using a random task order is included in Appendix D.
|
| 66 |
+
|
| 67 |
+
This procedure, while simple to implement, ensures that the gradients that we apply for each task per batch interfere minimally with the other tasks in the batch, mitigating the thrashing gradient problem, producing a variant on standard first-order gradient descent in the multi-objective setting. In practice, the PCGrad gradient surgery method can be combined with any gradient-based optimizer, including commonly used methods such as SGD with momentum and Adam (Kingma & Ba, 2014), by simply passing the computed update to the respective optimizer instead of the original gradient. Our experimental results verify the hypothesis that this procedure reduces the problem of thrashing gradients, and find that, as a result, learning progress is substantially improved.
|
| 68 |
+
|
| 69 |
+
Finally, we analyze the convergence of this procedure in Theorem 1 in the two-task setting, to ensure that the procedure is sensible under the standard assumptions in optimization.
|
| 70 |
+
|
| 71 |
+
Theorem 1. Consider two task loss functions $\mathcal { L } _ { 1 } : \mathbb { R } ^ { n } \mathbb { R }$ and $\mathcal { L } _ { 2 } : \mathbb { R } ^ { n } \mathbb { R }$ which are convex and differentiable. For all $\theta \in \mathbb { R } ^ { n }$ , let $\begin{array} { r } { \mathcal { L } ( \boldsymbol { \theta } ) = \mathcal { L } _ { 1 } ( \boldsymbol { \theta } ) + \mathcal { L } _ { 2 } ( \boldsymbol { \theta } ) , } \end{array}$ , i.e. $\mathcal { L }$ is a multi-task objective. Let $\phi$ be the angle between $\nabla { \mathcal { L } } _ { 1 } ( \theta )$ and $\nabla { \mathcal { L } } _ { 2 } ( \theta )$ . Suppose $\mathcal { L }$ is differentiable and that its gradient is Lipschitz continuous with constant $L > 0$ , i.e. we have $| | \nabla \mathcal { L } ( \bar { \theta _ { 1 } } ) - \nabla \mathcal { L } ( \theta _ { 2 } ) | | _ { 2 } \leq L | | \theta _ { 1 } - \theta _ { 2 } | | _ { 2 } f o r$ any $\theta _ { 1 } , \theta _ { 2 }$ . Then, the PCGrad update rule with step size $\begin{array} { r } { t \le \frac { 1 } { L } } \end{array}$ will converge to either $( l )$ a location in the optimization landscape where $\cos ( \phi ) = - 1$ or (2) the optimal value $\mathcal { L } ( \theta ^ { \ast } )$ .
|
| 72 |
+
|
| 73 |
+
Proof. See Appendix A.
|
| 74 |
+
|
| 75 |
+
Theorem 1 states that application of the PCGrad update in the two-task setting with a convex and Lipschitz multi-task loss function $\mathcal { L }$ leads to convergence to either the minimizer of $\mathcal { L }$ or a potentially sub-optimal objective value. A sub-optimal solution occurs when the cosine similarity between the gradients of the two tasks is $- 1$ , i.e. the gradients directly conflict, leading to zero gradient after applying PCGrad. However, in practice, since we are using SGD, which is a noisy estimate of the true batch gradients, the cosine similarity between the gradients of two tasks in a minibatch is unlikely to be $- 1$ , thus avoiding this scenario.
|
| 76 |
+
|
| 77 |
+
# 4 THE PRACTICAL OPERATIONS OF PCGRAD
|
| 78 |
+
|
| 79 |
+
We apply PCGrad to both supervised learning and reinforcement learning problem settings with multiple tasks or goals. In this section, we discuss the practical instantiations of PCGrad in those settings. Further implementation details are included in Section 6.
|
| 80 |
+
|
| 81 |
+
# 4.1 MULTI-TASK SUPERVISED LEARNING
|
| 82 |
+
|
| 83 |
+
In multi-task supervised learning, each task $\mathcal { T } _ { i } \sim p ( \mathcal { T } )$ has a corresponding training dataset $\mathcal { D } _ { i }$ consisting of $N _ { i }$ labeled training examples, i.e. $\mathcal { D } _ { i } = \{ ( x , y ) _ { n } \} _ { n = 1 } ^ { N _ { i } }$ . The objective for each task in this supervised setting is then defined as $\mathcal { L } _ { i } ( f _ { \theta } ) = \mathbb { E } _ { ( x , y ) \sim \mathcal { D } _ { i } } \left[ - \log f _ { \theta } ( y \vert x , z _ { i } ) \right]$ , where $z _ { i }$ is a one-hot encoding of task $\mathcal { T } _ { i }$ .
|
| 84 |
+
|
| 85 |
+
At each training step, we randomly sample a batch of data points $\boldsymbol { B }$ from the whole dataset $\textstyle \bigcup _ { i } { \mathcal { D } } _ { i }$ and then group the sampled data with the same task encoding into small batches denoted as $B _ { i }$ for each $\mathcal { T } _ { i }$ represented in $\boldsymbol { B }$ . We denote the set of tasks appearing in $\boldsymbol { B }$ as $B _ { T }$ . After sampling, we precompute the gradient of each task in $B _ { T }$ as
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\begin{array} { r } { \nabla _ { \theta } \mathcal { L } _ { i } ( f _ { \theta } ) = \mathbb { E } _ { ( { x } , { y } ) \sim \mathcal { B } _ { i } } \left[ - \nabla _ { \theta } \log f _ { \theta } ( { y } | { x } , { z } _ { i } ) \right] . } \end{array}
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
Given the set of precomputed gradients $\nabla _ { \theta } \mathcal { L } _ { i } ( f _ { \theta } )$ , we also precompute the cosine similarity between all pairs of the gradients in the set. Using the pre-computed gradients and their similarities, we can obtain the PCGrad update by following Algorithm 1, without re-computing task gradients nor backpropagating into the network.
|
| 92 |
+
|
| 93 |
+
Since the PCGrad procedure is only modifying the gradients of shared parameters in the optimization step, it is model-agnostic and can be readily applied to any architecture designed for supervised multi-task learning. In Section 6, we combine PCGrad with two state-of-the-art architectures for multi-task learning, which leads to noticeable improvement over their original performance.
|
| 94 |
+
|
| 95 |
+
# 4.2 MULTI-TASK AND GOAL-CONDITIONED REINFORCEMENT LEARNING
|
| 96 |
+
|
| 97 |
+
For multi-task reinforcement learning, PCGrad can be readily applied to policy gradient methods by directly updating the computed policy gradient of each task, following Algorithm 1, analogous to the supervised learning setting. For actor-critic algorithms, it is also straightforward to apply PCGrad: we simply replace the task gradients for both the actor and the critic by their gradients computed via PCGrad. Hence, PCGrad can be readily incorporated into a variety of model-free RL algorithms. When applying PCGrad to goal-conditioned RL, we represent $p ( \mathcal T )$ as a distribution of goals and let $z _ { i }$ be the encoding of a goal. Similar to the multi-task supervised learning setting discussed above, PCGrad may be combined with various architectures designed for multi-task and goal-conditioned RL (Fernando et al., 2017; Devin et al., 2016), where PCGrad operates on the gradients of shared parameters, leaving task-specific parameters untouched.
|
| 98 |
+
|
| 99 |
+
In our experiments, we apply PCGrad to the soft actor-critic (SAC) algorithm (Haarnoja et al., 2018), a recently proposed off-policy actor-critic algorithm that has shown significant gains in sample efficiency and asymptotic performance across many different domains. In SAC, we employ a $\mathrm { Q } \mathrm { - }$ learning style gradient to compute the gradient of the Q-function network, $Q _ { \phi } ( s , a , z _ { i } )$ , often known as the critic, and a reparameterization-style gradient to compute the gradient of the policy network $\pi _ { \boldsymbol { \theta } } ( a | s , z _ { i } )$ , often known as the actor. For sampling, we instantiate a set of replay buffers $\{ \mathcal { D } _ { i } \} _ { \mathcal { T } _ { i } \sim p ( \mathcal { T } ) }$ . Training and data collection are alternated throughout training. During a data collection step, we run the policy $\pi _ { \theta }$ on all the tasks $\mathcal { T } _ { i } \sim p ( \mathcal { T } )$ to collect an equal number of paths for each task and store the paths of each task $\mathcal { T } _ { i }$ into the corresponding replay buffer $\mathcal { D } _ { i }$ . At each training step, we sample an equal amount of data from each replay buffer $\mathcal { D } _ { i }$ to form a stratified batch. For each task $\mathcal { T } _ { i } \sim p ( \mathcal { T } )$ , the parameters of the critic $\theta$ are optimized to minimize the soft Bellman residual:
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\begin{array} { r l } & { J _ { Q } ^ { ( i ) } ( \phi ) = \mathbb { E } _ { ( s _ { t } , a _ { t } , z _ { i } ) \sim \mathcal { D } _ { i } } \left[ Q _ { \phi } ( s _ { t } , a _ { t } , z _ { i } ) - ( r ( s _ { t } , a _ { t } , z _ { i } ) + \gamma V _ { \bar { \phi } } ( s _ { t + 1 } , z _ { i } ) ) \right] , } \\ & { V _ { \bar { \phi } } ( s _ { t + 1 } , z _ { i } ) = \mathbb { E } _ { a _ { t + 1 } \sim \pi _ { \theta } } \left[ Q _ { \bar { \phi } } ( s _ { t + 1 } , a _ { t + 1 } , z _ { i } ) - \alpha \log \pi _ { \theta } ( a _ { t + 1 } | s _ { t + 1 } , z _ { i } ) \right] , } \end{array}
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
where $\gamma$ is the discount factor, $\bar { \phi }$ are the delayed parameters, and $\alpha$ is a learnable temperature that automatically adjusts the weight of the entropy term. For each task $\mathcal { T } _ { i } \sim p ( \mathcal { T } )$ , the parameters of the policy $\pi _ { \theta }$ are trained to minimize the following objective
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
J _ { \pi } ^ { ( i ) } ( \theta ) = \mathbb { E } _ { s _ { t } \sim \mathcal { D } _ { i } } \left[ \mathbb { E } _ { a _ { t } \sim \pi _ { \theta } ( a _ { t } \mid s _ { t } , z _ { i } ) ) } \left[ \alpha \log \pi _ { \theta } ( a _ { t } \mid s _ { t } , z _ { i } ) - Q _ { \phi } ( { s _ { t } , a _ { t } , z _ { i } } ) \right] \right] .
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
We compute $\nabla _ { \phi } J _ { Q } ^ { ( i ) } ( \phi )$ and $\nabla _ { \theta } J _ { \pi } ^ { ( i ) } ( \theta )$ for all $\begin{array} { r } { \mathcal { T } _ { i } \sim p ( \mathcal { T } ) } \end{array}$ and apply PCGrad to both following Algorithm 1.
|
| 112 |
+
|
| 113 |
+
In the context of SAC specifically, we further study how the temperature $\alpha$ should be adjusted. If we use a single learnable temperature for adjusting entropy of the multi-task policy $\pi _ { \boldsymbol { \theta } } ( a | s , z _ { i } )$ , SAC may stop exploring once all easier tasks are solved, leading to poor performance on tasks that are harder or require more exploration. To address this issue, we propose to learn the temperature on a per-task basis, i.e. using a parametrized model to represent $\alpha _ { \psi } ( z _ { i } )$ (which we abbreviate as PA for per-task alpha). This allows the method to control the entropy of $\dot { \pi } _ { \boldsymbol { \theta } } ( a | s , z _ { i } )$ per-task. We optimize the parameters of $\alpha _ { \psi } ( z _ { i } )$ using the same constrained optimization framework as in Haarnoja et al. (2018).
|
| 114 |
+
|
| 115 |
+
# 5 RELATED WORK
|
| 116 |
+
|
| 117 |
+
Algorithms for multi-task learning typically consider how to train a single model that can solve a variety of different tasks (Caruana, 1997; Bakker & Heskes, 2003; Ruder, 2017). The multi-task formulation has been applied to many different settings, including supervised learning (Zhang et al., 2014; Long & Wang, 2015; Yang & Hospedales, 2016; Sener & Koltun, 2018; Zamir et al., 2018) and reinforcement-learning (Espeholt et al., 2018; Wilson et al., 2007), as well as many different domains, such as vision (Bilen & Vedaldi, 2016; Misra et al., 2016a; Kokkinos, 2017; Liu et al., 2018; Zamir et al., 2018), language (Collobert & Weston, 2008; Dong et al., 2015; McCann et al., 2018; Radford et al., 2019) and robotics (Riedmiller et al., 2018; Wulfmeier et al., 2019; Hausman et al., 2018). While multi-task learning has the promise of accelerating acquisition of large task repertoires, in practice it presents a challenging optimization problem, which has been tackled in several ways in prior work.
|
| 118 |
+
|
| 119 |
+
A number of architectural solutions have been proposed to the multi-task learning problem based on multiple modules or paths (Fernando et al., 2017; Devin et al., 2016; Misra et al., 2016b; Rusu et al., 2016b; Rosenbaum et al., 2018; Vandenhende et al., 2019; Rosenbaum et al., 2018), or using attention-based architectures (Liu et al., 2018; Maninis et al., 2019). Our work is agnostic to the model architecture and can be combined with prior architectural approaches in a complementary fashion. A different set of multi-task learning approaches aim to decompose the problem into multiple local problems, often corresponding to each task, that are significantly easier to learn, akin to divide and conquer algorithms (Levine et al., 2016; Rusu et al., 2016a; Parisotto et al., 2015; Teh et al., 2017; Ghosh et al., 2017; Czarnecki et al., 2019). Eventually, the local models are combined into a single, multi-task policy using different distillation techniques (outlined in (Hinton et al., 2015; Czarnecki et al., 2019)). In contrast to these methods, we propose a simple and cogent scheme for multi-task learning that allows us to learn the tasks simultaneously using a single, shared model without the need for network distillation.
|
| 120 |
+
|
| 121 |
+
Similarly to our work, a number of prior approaches have observed the difficulty of optimization in the multi-task learning setting (Hessel et al., 2019; Chen et al., 2018; Kendall et al., 2018b; Schaul et al., 2019). Our work, in contrast to many of these optimization schemes, suggests that the challenge in multi-task learning may be attributed to the problem of gradient thrashing, which we address directly by introducing a simple and practical algorithm that de-conflicts gradients from different tasks. Prior work (Sener & Koltun, 2018) alternatively proposes a gradient-based multi-objective optimization problem for multi-task learning to address the problem of optimizing possibly conflicting objectives. As noted in Alg 2 in (Sener & Koltun, 2018), it learns a constant scaling factor for per-task gradient to avoid conflicting, while our method corrects both the scaling factor and the direction of per-task gradient, which can more effectively deconflict gradients. Prior work has also used the cosine similarity between gradients to define when an auxiliary task might be useful for single-task learning (Du et al., 2018). We similarly use cosine similarity between gradients to determine if the gradients between a pair of tasks are in conflict. Unlike Du et al. (2018), we use this measure of gradient conflict as a part of gradient surgery in the context of multi-task learning applications.
|
| 122 |
+
|
| 123 |
+
A number of works in continual learning have studied how to make gradient updates that do not adversely affect other tasks by projecting the gradients into a space that do not conflict with previous tasks (Lopez-Paz & Ranzato, 2017; Chaudhry et al., 2018). Those methods focus on the continual learning setting, and either need to solve for the gradient projections using quadratic programming (Lopez-Paz & Ranzato, 2017), or only projecting the gradient onto the normal plane of the average of the gradients of past tasks (Chaudhry et al., 2018). In contrast, our work focuses on multi-task learning, does not require solving any QP, and iteratively projects the gradients of each task onto the normal plane of the gradients of each of the other tasks instead of averaging. Finally, our method is distinct from and solves a different problem than the projected gradient method (Calamai & More, 1987), which is an approach for constrained optimization that projects gradients onto the ´ constraint manifold.
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
Figure 3: We show visualization of 50 tasks used in MT50 from Meta-World (Yu et al., 2019), which we use for our multi-task RL experiments. MT10 is a subset of the total 50 tasks, which includes reach, push, pick & place, open drawer, close drawer, open door, press button top, open window, close window, and insert peg inside.
|
| 127 |
+
|
| 128 |
+
# 6 EXPERIMENTS
|
| 129 |
+
|
| 130 |
+
The goal of our experiments is to study the following questions: (1) Are conflicting gradients a major factor in making optimization for multi-task learning challenging? (2) Does PCGrad make the optimization problems easier for various multi-task learning problems including supervised, reinforcement, and goal-conditioned reinforcement learning settings across different task families? (3) Can PCGrad be combined with other multi-task learning approaches to further improve performance?
|
| 131 |
+
|
| 132 |
+
# 6.1 EXPERIMENTAL SETUP
|
| 133 |
+
|
| 134 |
+
To evaluate our method experimentally, we consider both a multi-task supervised learning and a multi-task reinforcement learning problem setup. For supervised learning, we first consider the MultiMNIST dataset (Sener & Koltun, 2018), which contains two tasks: classifying the digit on the top left and on the bottom right in an overlaid image. Beyond digit classification, we also use the CIFAR-100 dataset (Krizhevsky et al., 2009) where each of the 20 label superclasses are treated as distinct tasks, following Rosenbaum et al. (2018). We also conduct experiments on the NYUv2 dataset (Silberman et al., 2012), which consists of RGB-D indoor scene images. Following Liu et al. (2018), we evaluate our method on 3 tasks: 13-class semantic segmentation, depth estimation, and surface normal prediction. In the case of multi-task reinforcement learning, we evaluate our algorithm on the recently proposed Meta-World benchmark (Yu et al., 2019). This benchmark includes a variety of simulated robotic manipulation tasks contained in a shared, table-top environment with a simulated Sawyer arm (visualized as the ”Push” environment in Fig. 3). In particular, we use the multi-task benchmarks MT10 and MT50, which consists of the 10 tasks and 50 tasks respectively depicted in Fig. 3 that require diverse strategies to solve them, which makes them difficult to optimize jointly with a single policy. Note that MT10 is a subset of MT50. To evaluate goal-conditioned RL scenarios, we consider goal-conditioned robotic pushing with a Sawyer robot. This domain is representative of challenges in learning goal-conditioned policies over a wide distribution of goals. For details on the experimental set-up and model architectures see Appendix E.
|
| 135 |
+
|
| 136 |
+
# 6.2 ANALYSIS OF CONFLICTING GRADIENTS
|
| 137 |
+
|
| 138 |
+
To answer question (1), we consider a simple regression problem, where each task is regressing the input to the output of a sine function. The amplitude and the phase of each task are varied. We construct 10 tasks with the amplitude uniformly sampled from the range [0, 5] and the phase uniformly sampled from the range $[ 0 , \pi ]$ . The input is also uniformly sampled from the range $[ 0 , 5 ]$ and is concatenated with the one-hot task encoding. For training, we use a 3-layer fully-connected neural network with 100 hidden units.
|
| 139 |
+
|
| 140 |
+

|
| 141 |
+
Figure 4: An analysis of the gradients during the first 1000 updates of training, on a toy 10-task sinusoid regression problem. Left: The cosine similarity between the gradients of 2 of the 10 tasks (selected arbitrarily, and fixed throughout this plot). We observe a substantial amount of thrashing with standard Adam training, while Adam with PCGrad reduces the thrashing and leads to more closely aligned updates. Right: Adam with PCGrad improves performance compared to standard Adam.
|
| 142 |
+
|
| 143 |
+
We compare the performance of the network trained with Adam and the network trained with Adam with PCGrad-modified gradients while plotting the cosine similarity between a pair of tasks during training as shown in Figure 4. The plot on the left in Figure 4 demonstrates that the cosine similarity of Adam gradients between a pair of tasks has high variance, which leads to the gradient thrashing problem, while the cosine similarity of the gradient projected by PCGrad yields positive values diminishing the conflicting-gradients problem. As shown in the plot on the right in Figure 4, Adam with PCGrad leads to faster learning over Adam, which implies that gradient thrashing is indeed a problem in multi-task optimization and reducing it can result in considerable performance boost.
|
| 144 |
+
|
| 145 |
+
# 6.3 MULTI-TASK AND MULTI-OBJECTIVE SUPERVISED LEARNING WITH PCGRAD
|
| 146 |
+
|
| 147 |
+
To answer question (3), we perform experiments on three standard multi-task supervised learning datasets: MultiMNIST, multi-task CIFAR-100 and NYUv2. We include the results on MultiMNIST in Appendix C.
|
| 148 |
+
|
| 149 |
+
For CIFAR-100, we follow (Rosenbaum et al., 2018) to treat 20 coarse labels in the dataset as distinct tasks and create a dataset with 20 tasks and 2500 training instances as well as 500 test instances per task. We combine PCGrad with a powerful multi-task learning architecture, routing networks (Rosenbaum et al., 2018; 2019), by simply projecting gradients of the shared parameters in routing networks. As shown in Table 1, applying PCGrad to a single network achieves $71 \%$ classification accuracy, which outperforms most of the prior methods such as independent training and cross-stitch (Misra et al., 2016b). Though routing networks achieve better performance than PCGrad on its own, PCGrad is complementary to routing networks and combining PCGrad with routing networks leads to a $2 . 8 \%$ absolute improvement in test accuracy averaged over 3 runs.
|
| 150 |
+
|
| 151 |
+
We also combine PCGrad with another state-of-art multi-task learning algorithm, MTAN (Liu et al., 2018), and evaluate the performance on a more challenging indoor scene dataset, NYUv2, which contains 3 tasks as described in Section 6.1. We compare MTAN with PCGrad to a list of methods mentioned in Section 6.1, where each method is trained with three different weighting schemes as in (Liu et al., 2018), equal weighting, weight uncertainty (Kendall et al., 2018a), and DWA (Liu et al., 2018). We only run MTAN with PCGrad with weight uncertainty as we find weight uncertainty as the most effective scheme for training MTAN. The results comparing Cross-Stitch, MTAN and MTAN $^ +$ PCGrad are presented in Table 2 while the full comparison can be found in Table 4 in the Appendix E.3. MTAN with PCGrad is able to achieve the best scores in 8 out of the 9 categories where there are 3 categories per task.
|
| 152 |
+
|
| 153 |
+
Our multi-task supervised learning results demonstrate that PCGrad can be seamlessly combined with state-of-art multi-task learning architectures and further improve their results on established supervised multi-task learning benchmarks.
|
| 154 |
+
|
| 155 |
+
# 6.4 MULTI-TASK REINFORCEMENT LEARNING
|
| 156 |
+
|
| 157 |
+
To answer question (2), we test all methods on 10 and 50 manipulation tasks respectively shown in Figure 3. At each data collection step, we collect 600 samples for each task, and at each training step,
|
| 158 |
+
|
| 159 |
+
<table><tr><td></td><td>% accuracy</td></tr><tr><td>task specific-1-fc (Rosenbaum et al., 2018)</td><td>42</td></tr><tr><td>task specific-all-fc (Rosenbaum et al., 2018)</td><td>49</td></tr><tr><td>cross stitch-all-fc (Misra et al.,2016b) routing-all-fc + WPL (Rosenbaum et al.,2019)</td><td>53</td></tr><tr><td>independent</td><td>74.7</td></tr><tr><td>PCGrad (ours)</td><td>67.7</td></tr><tr><td></td><td>71</td></tr><tr><td>routing-all-fc + WPL + PCGrad (ours)</td><td>[77.5</td></tr></table>
|
| 160 |
+
|
| 161 |
+
Table 1: CIFAR-100 multi-task results. We apply PCGrad to the routing networks and achieve a significant improvement in classfication accuracy.
|
| 162 |
+
|
| 163 |
+
<table><tr><td rowspan="2">#P.</td><td rowspan="2">Architecture</td><td rowspan="2">Weighting</td><td colspan="2">Segmentation</td><td colspan="2">Depth</td><td colspan="5">Surface Normal</td></tr><tr><td>(Higher Better) mIoU</td><td>Pix Acc</td><td>(Lower Better) Abs Err</td><td>Rel Err</td><td>Angle Distance (Lower Better) Mean1</td><td>Median</td><td>11.25</td><td>Within t° (Higher Better) 22.5</td><td>30</td></tr><tr><td rowspan="4">~3</td><td rowspan="2">Cros-Stitch+</td><td>Equal Weights</td><td>14.71</td><td>50.23</td><td>0.6481</td><td>0.2871</td><td>33.56</td><td>28.58</td><td>20.08</td><td>40.54</td><td>51.97</td></tr><tr><td>Uncert.Weights*</td><td>15.69</td><td>52.60</td><td>0.6277</td><td>0.2702</td><td>32.69</td><td>27.26</td><td>21.63</td><td>42.84</td><td>54.45</td></tr><tr><td rowspan="2"></td><td>DWA†,T=2</td><td>16.11</td><td>53.19</td><td>0.5922</td><td>0.2611</td><td>32.34</td><td>26.91</td><td>21.81</td><td>43.14</td><td>54.92</td></tr><tr><td>Equal Weights</td><td>17.72</td><td>55.32</td><td>0.5906</td><td>0.2577</td><td>31.44</td><td>25.37</td><td>23.17</td><td>45.65</td><td>57.48</td></tr><tr><td rowspan="2">1.77</td><td rowspan="2">MTANt</td><td>Uncert.Weights*</td><td>17.67</td><td>55.61</td><td>0.5927</td><td>0.2592</td><td>31.25</td><td>25.57</td><td>22.99</td><td>45.83</td><td>57.67</td></tr><tr><td>DWA+,T=2</td><td>17.15</td><td>54.97</td><td>0.5956</td><td>0.2569</td><td>31.60</td><td>25.46</td><td>22.48</td><td>44.86</td><td>57.24</td></tr><tr><td></td><td></td><td>1.77MTAN++ PCGrad (ours)Uncert.Weights*</td><td>20.17</td><td>56.65</td><td>0.5904</td><td>0.2467</td><td>30.01</td><td>24.83</td><td>22.28</td><td>46.12</td><td>58.77</td></tr></table>
|
| 164 |
+
|
| 165 |
+
Table 2: We present the results on three tasks on the NYUv2 dataset: 13-class semantic segmentation, depth estimation, and surface normal prediction results. #P shows the total number of network parameters. We highlight the best performing combination of multi-task architecture and weighting in bold. The top validation scores for each task are annotated with boxes. The symbols indicate prior methods: ∗: (Kendall et al., 2018a), †: (Liu et al., 2018), ‡: (Misra et al., 2016b). Performance of other methods as reported in (Liu et al., 2018).
|
| 166 |
+
|
| 167 |
+

|
| 168 |
+
Figure 5: Learning curve on MT10, MT50 and goal-conditioned pushing. PCGrad outperforms the other methods in the three settings in terms of both success rates / average distance to the goal and data efficiency.
|
| 169 |
+
|
| 170 |
+
we sample 128 datapoints per task from corresponding replay buffers. The results are shown in the two plots on the left in Figure 5. We measure success according to the metrics used in the Meta-World benchmark where the reported the success rates are averaged across tasks. For all methods, we apply PA as discussed in Section 4 to learn a separate alpha term per task as the task encoding in MT10 and MT50 is just a one-hot encoding. PCGrad combined with SAC learns all tasks with the best data efficiency and successfully solves all of the 10 tasks in MT10 and about $70 \%$ of the 50 tasks in MT50. Training a single SAC policy and a multi-head policy turns out to be unable to acquire half of the skills in both MT10 and MT50, suggesting that eliminating gradient interference across tasks can significantly boost performance of multi-task RL. Training independent SAC agents is able to eventually solve all tasks in MT10 and $70 \%$ of the tasks in MT50, but requires about 2 millions and 15 millions more samples than PCGrad with SAC in MT10 and MT50 respectively, implying that applying PCGrad can result in leveraging shared structure among tasks that expedites multi-task learning.
|
| 171 |
+
|
| 172 |
+
As noted by $\mathrm { Y u }$ et al. (2019), these tasks involve fairly distinct behavior motions, which makes learning all of them with a single policy challenging as demonstrated by poor baseline performance. The ability to learn these tasks together opens the door for a number of interesting extensions to meta-learning, goal conditioned RL and generalization to novel task families. We present the results of PCGrad on goal-conditioned RL in the following subsection.
|
| 173 |
+
|
| 174 |
+
We also provide an ablation study on the importance of correcting the gradient direction and scaling the gradient magnitudes in PCGrad. We construct two variants of PCGrad: (1) only applying the gradient direction corrected with PCGrad while keeping the gradient magnitude unchanged and (2) only applying the gradient magnitude computed by PCGrad while keeping the gradient direction unchanged. As shown in the plot on the left in Figure 6, both variants perform worse than PCGrad and the variant where we only vary the gradient magnitudes is much worse than PCGrad. We also compare PCGrad to a prior method GradNorm (Chen et al., 2018), which scales the magnitude of gradients of all the tasks. As shown in the plot on the right in Figure 6, PCGrad significantly outperforms GradNorm. We also notice that the variant of PCGrad where only the gradient magnitudes change gets comparable results to GradNorm, which suggests that its important to modify both the gradient directions and magnitudes to eliminate interference and achieve good multi-task learning results.
|
| 175 |
+
|
| 176 |
+

|
| 177 |
+
Figure 6: Ablation study on only using the magnitude and the direction of the gradients modified by PCGrad (left) and comparison between PCGrad and GradNorm (Chen et al., 2018) (right). PCGrad outperforms both ablations and GradNorm with a large margin, indicating the importance of modifying both the gradient directions and magnitudes in multi-task learning.
|
| 178 |
+
|
| 179 |
+
# 6.5 GOAL-CONDITIONED REINFORCEMENT LEARNING
|
| 180 |
+
|
| 181 |
+
For our goal-conditioned RL evaluation, we use the robot-pushing environment described in Sec. 6.1 where the goals are represented as the concatenations of the initial positions of the puck to be pushed and the its goal location, both of which are uniformly sampled (details in Appendix E.2). We also apply PA as discussed in Section 4 to predict the temperature for entropy term given the goal. We summarize the results in the plot on the right in Figure 5. PCGrad with SAC and PA achieves the best performance in terms of average distance to the goal position, while PCGrad with SAC improves over the baseline and a vanilla SAC agent is struggling to successfully accomplish the task. This suggests that PCGrad is able to ease the RL optimization problem also when the task distribution is continuous.
|
| 182 |
+
|
| 183 |
+
# 7 CONCLUSION
|
| 184 |
+
|
| 185 |
+
In this work, we identified one of the major challenges in multi-task optimization: conflicting gradients across tasks. We proposed a simple algorithm (PCGrad) to mitigate the challenge of conflicting gradients via “gradient surgery”. PCGrad provides a simple way to project gradients to be orthogonal in a multi-task setting, which substantially improves optimization performance, since the task gradients are prevented from negating each other. We provide some simple didactic examples and analysis of how this procedure works in simple settings, and subsequently show significant improvement in optimization for a variety of multi-task supervised learning and reinforcement learning problems. We show that, once some of the optimization challenges of multi-task learning are alleviated by PCGrad, we can obtain the hypothesized benefits in efficiency and asymptotic performance that are believed to be possible in multi-task settings.
|
| 186 |
+
|
| 187 |
+
While we studied multi-task supervised learning and multi-task reinforcement learning in this work, we suspect the problem of conflicting gradients to be prevalent in a range of other settings and applications, such as meta-learning, continual learning, multi-goal imitation learning (Codevilla et al., 2018), and multi-task problems in natural language processing applications (McCann et al., 2018). Due to its simplicity and model-agnostic nature, we expect that applying PCGrad in these domains to be a promising avenue for future investigation. Further, the general idea of gradient surgery may be an important ingredient for alleviating a broader class of optimization challenges in deep learning, such as the challenges in the stability challenges in two-player games (Roth et al., 2017) and multi-agent optimizations (Nedic & Ozdaglar, 2009). We believe this work to be a step towards simple yet general techniques for addressing some of these challenges.
|
| 188 |
+
|
| 189 |
+
# REFERENCES
|
| 190 |
+
|
| 191 |
+
Vijay Badrinarayanan, Alex Kendall, and Roberto Cipolla. Segnet: A deep convolutional encoderdecoder architecture for image segmentation. IEEE transactions on pattern analysis and machine intelligence, 39(12):2481–2495, 2017.
|
| 192 |
+
|
| 193 |
+
Bart Bakker and Tom Heskes. Task clustering and gating for bayesian multitask learning. J. Mach. Learn. Res., 2003.
|
| 194 |
+
|
| 195 |
+
Hakan Bilen and Andrea Vedaldi. Integrated perception with recurrent multi-task neural networks. In Advances in neural information processing systems, pp. 235–243, 2016.
|
| 196 |
+
|
| 197 |
+
Stephen Boyd and Lieven Vandenberghe. Convex optimization. Cambridge university press, 2004.
|
| 198 |
+
|
| 199 |
+
Paul H Calamai and Jorge J More. Projected gradient methods for linearly constrained problems. ´ Mathematical programming, 39(1):93–116, 1987.
|
| 200 |
+
|
| 201 |
+
Rich Caruana. Multitask learning. Machine Learning, 1997.
|
| 202 |
+
|
| 203 |
+
Arslan Chaudhry, Marc’Aurelio Ranzato, Marcus Rohrbach, and Mohamed Elhoseiny. Efficient lifelong learning with a-gem. arXiv preprint arXiv:1812.00420, 2018.
|
| 204 |
+
|
| 205 |
+
Zhao Chen, Vijay Badrinarayanan, Chen-Yu Lee, and Andrew Rabinovich. Gradnorm: Gradient normalization for adaptive loss balancing in deep multitask networks. arXiv preprint arXiv:1711.02257, 2017.
|
| 206 |
+
|
| 207 |
+
Zhao Chen, Vijay Badrinarayanan, Chen-Yu Lee, and Andrew Rabinovich. Gradnorm: Gradient normalization for adaptive loss balancing in deep multitask networks. In Proceedings of the International Conference on Machine Learning, 2018.
|
| 208 |
+
|
| 209 |
+
Felipe Codevilla, Matthias Miiller, Antonio Lopez, Vladlen Koltun, and Alexey Dosovitskiy. End-to- ´ end driving via conditional imitation learning. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pp. 1–9. IEEE, 2018.
|
| 210 |
+
|
| 211 |
+
Ronan Collobert and Jason Weston. A unified architecture for natural language processing: Deep neural networks with multitask learning. In Proceedings of the 25th international conference on Machine learning, pp. 160–167. ACM, 2008.
|
| 212 |
+
|
| 213 |
+
Wojciech M. Czarnecki, Razvan Pascanu, Simon Osindero, Siddhant M. Jayakumar, Grzegorz Swirszcz, and Max Jaderberg. Distilling policy distillation. In The 22nd International Conference on Artificial Intelligence and Statistics, AISTATS, 2019.
|
| 214 |
+
|
| 215 |
+
Coline Devin, Abhishek Gupta, Trevor Darrell, Pieter Abbeel, and Sergey Levine. Learning modular neural network policies for multi-task and multi-robot transfer. CoRR, abs/1609.07088, 2016.
|
| 216 |
+
|
| 217 |
+
Daxiang Dong, Hua Wu, Wei He, Dianhai Yu, and Haifeng Wang. Multi-task learning for multiple language translation. In Proceedings of the 53rd Annual Meeting of the Association for Computational Linguistics and the 7th International Joint Conference on Natural Language Processing (Volume 1: Long Papers), pp. 1723–1732, 2015.
|
| 218 |
+
|
| 219 |
+
Yunshu Du, Wojciech M. Czarnecki, Siddhant M. Jayakumar, Razvan Pascanu, and Balaji Lakshminarayanan. Adapting auxiliary losses using gradient similarity. CoRR, abs/1812.02224, 2018.
|
| 220 |
+
|
| 221 |
+
Lasse Espeholt, Hubert Soyer, Remi Munos, Karen Simonyan, Volodymyr Mnih, Tom Ward, Yotam ´ Doron, Vlad Firoiu, Tim Harley, Iain Dunning, Shane Legg, and Koray Kavukcuoglu. IMPALA: scalable distributed deep-rl with importance weighted actor-learner architectures. In Proceedings of the 35th International Conference on Machine Learning, 2018.
|
| 222 |
+
|
| 223 |
+
Chrisantha Fernando, Dylan Banarse, Charles Blundell, Yori Zwols, David Ha, Andrei A. Rusu, Alexander Pritzel, and Daan Wierstra. Pathnet: Evolution channels gradient descent in super neural networks. CoRR, abs/1701.08734, 2017. URL http://arxiv.org/abs/1701.08734.
|
| 224 |
+
|
| 225 |
+
Dibya Ghosh, Avi Singh, Aravind Rajeswaran, Vikash Kumar, and Sergey Levine. Divide-andconquer reinforcement learning. CoRR, abs/1711.09874, 2017.
|
| 226 |
+
|
| 227 |
+
Ian J Goodfellow, Oriol Vinyals, and Andrew M Saxe. Qualitatively characterizing neural network optimization problems. arXiv preprint arXiv:1412.6544, 2014.
|
| 228 |
+
|
| 229 |
+
Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. International Conference on Machine Learning, 2018.
|
| 230 |
+
|
| 231 |
+
Karol Hausman, Jost Tobias Springenberg, Ziyu Wang, Nicolas Heess, and Martin Riedmiller. Learning an embedding space for transferable robot skills. 2018.
|
| 232 |
+
|
| 233 |
+
Matteo Hessel, Hubert Soyer, Lasse Espeholt, Wojciech Czarnecki, Simon Schmitt, and Hado van Hasselt. Multi-task deep reinforcement learning with popart. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pp. 3796–3803, 2019.
|
| 234 |
+
|
| 235 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 236 |
+
|
| 237 |
+
Alex Kendall, Yarin Gal, and Roberto Cipolla. Multi-task learning using uncertainty to weigh losses for scene geometry and semantics. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7482–7491, 2018a.
|
| 238 |
+
|
| 239 |
+
Alex Kendall, Yarin Gal, and Roberto Cipolla. Multi-task learning using uncertainty to weigh losses for scene geometry and semantics. In CVPR, 2018b.
|
| 240 |
+
|
| 241 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 242 |
+
|
| 243 |
+
Iasonas Kokkinos. Ubernet: Training a universal convolutional neural network for low-, mid-, and high-level vision using diverse datasets and limited memory. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 6129–6138, 2017.
|
| 244 |
+
|
| 245 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 246 |
+
|
| 247 |
+
Sergey Levine, Chelsea Finn, Trevor Darrell, and Pieter Abbeel. End-to-end training of deep visuomotor policies. The Journal of Machine Learning Research, 17(1):1334–1373, 2016.
|
| 248 |
+
|
| 249 |
+
Shikun Liu, Edward Johns, and Andrew J. Davison. End-to-end multi-task learning with attention. CoRR, abs/1803.10704, 2018.
|
| 250 |
+
|
| 251 |
+
Mingsheng Long and Jianmin Wang. Learning multiple tasks with deep relationship networks. arXiv preprint arXiv:1506.02117, 2, 2015.
|
| 252 |
+
|
| 253 |
+
David Lopez-Paz and Marc’Aurelio Ranzato. Gradient episodic memory for continual learning. In Advances in Neural Information Processing Systems, pp. 6467–6476, 2017.
|
| 254 |
+
|
| 255 |
+
Kevis-Kokitsi Maninis, Ilija Radosavovic, and Iasonas Kokkinos. Attentive single-tasking of multiple tasks. CoRR, abs/1904.08918, 2019.
|
| 256 |
+
|
| 257 |
+
Bryan McCann, Nitish Shirish Keskar, Caiming Xiong, and Richard Socher. The natural language decathlon: Multitask learning as question answering. arXiv preprint arXiv:1806.08730, 2018.
|
| 258 |
+
|
| 259 |
+
Ishan Misra, Abhinav Shrivastava, Abhinav Gupta, and Martial Hebert. Cross-stitch networks for multi-task learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3994–4003, 2016a.
|
| 260 |
+
|
| 261 |
+
Ishan Misra, Abhinav Shrivastava, Abhinav Gupta, and Martial Hebert. Cross-stitch networks for multi-task learning. In Conference on Computer Vision and Pattern Recognition, CVPR, 2016b.
|
| 262 |
+
|
| 263 |
+
Angelia Nedic and Asuman Ozdaglar. Distributed subgradient methods for multi-agent optimization. IEEE Transactions on Automatic Control, 54(1):48, 2009.
|
| 264 |
+
|
| 265 |
+
Emilio Parisotto, Jimmy Lei Ba, and Ruslan Salakhutdinov. Actor-mimic: Deep multitask and transfer reinforcement learning. arXiv preprint arXiv:1511.06342, 2015.
|
| 266 |
+
|
| 267 |
+
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. OpenAI Blog, 1(8), 2019.
|
| 268 |
+
|
| 269 |
+
Martin Riedmiller, Roland Hafner, Thomas Lampe, Michael Neunert, Jonas Degrave, Tom Van de Wiele, Volodymyr Mnih, Nicolas Heess, and Jost Tobias Springenberg. Learning by playingsolving sparse reward tasks from scratch. arXiv preprint arXiv:1802.10567, 2018.
|
| 270 |
+
|
| 271 |
+
Clemens Rosenbaum, Tim Klinger, and Matthew Riemer. Routing networks: Adaptive selection of non-linear functions for multi-task learning. International Conference on Learning Representations (ICLR), 2018.
|
| 272 |
+
|
| 273 |
+
Clemens Rosenbaum, Ignacio Cases, Matthew Riemer, and Tim Klinger. Routing networks and the challenges of modular and compositional computation. arXiv preprint arXiv:1904.12774, 2019.
|
| 274 |
+
|
| 275 |
+
Kevin Roth, Aurelien Lucchi, Sebastian Nowozin, and Thomas Hofmann. Stabilizing training of generative adversarial networks through regularization. In Advances in neural information processing systems, pp. 2018–2028, 2017.
|
| 276 |
+
|
| 277 |
+
Sebastian Ruder. An overview of multi-task learning in deep neural networks. arXiv preprint arXiv:1706.05098, 2017.
|
| 278 |
+
|
| 279 |
+
Andrei A. Rusu, Sergio Gomez Colmenarejo, C¸ aglar Gul¨ c¸ehre, Guillaume Desjardins, James Kirkpatrick, Razvan Pascanu, Volodymyr Mnih, Koray Kavukcuoglu, and Raia Hadsell. Policy distillation. In 4th International Conference on Learning Representations, ICLR, 2016a.
|
| 280 |
+
|
| 281 |
+
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, 2016b.
|
| 282 |
+
|
| 283 |
+
Tom Schaul, Diana Borsa, Joseph Modayil, and Razvan Pascanu. Ray interference: a source of plateaus in deep reinforcement learning. arXiv preprint arXiv:1904.11455, 2019.
|
| 284 |
+
|
| 285 |
+
Ozan Sener and Vladlen Koltun. Multi-task learning as multi-objective optimization. In Advances in Neural Information Processing Systems, 2018.
|
| 286 |
+
|
| 287 |
+
Nathan Silberman, Derek Hoiem, Pushmeet Kohli, and Rob Fergus. Indoor segmentation and support inference from rgbd images. In European Conference on Computer Vision, pp. 746–760. Springer, 2012.
|
| 288 |
+
|
| 289 |
+
Yee Teh, Victor Bapst, Wojciech M Czarnecki, John Quan, James Kirkpatrick, Raia Hadsell, Nicolas Heess, and Razvan Pascanu. Distral: Robust multitask reinforcement learning. In Advances in Neural Information Processing Systems, pp. 4496–4506, 2017.
|
| 290 |
+
|
| 291 |
+
Simon Vandenhende, Bert De Brabandere, and Luc Van Gool. Branched multi-task networks: Deciding what layers to share. CoRR, abs/1904.02920, 2019.
|
| 292 |
+
|
| 293 |
+
Aaron Wilson, Alan Fern, Soumya Ray, and Prasad Tadepalli. Multi-task reinforcement learning: a hierarchical bayesian approach. In Proceedings of the 24th international conference on Machine learning, pp. 1015–1022. ACM, 2007.
|
| 294 |
+
|
| 295 |
+
Markus Wulfmeier, Abbas Abdolmaleki, Roland Hafner, Jost Tobias Springenberg, Michael Neunert, Tim Hertweck, Thomas Lampe, Noah Siegel, Nicolas Heess, and Martin Riedmiller. Regularized hierarchical policies for compositional transfer in robotics. arXiv preprint arXiv:1906.11228, 2019.
|
| 296 |
+
|
| 297 |
+
Yongxin Yang and Timothy M Hospedales. Trace norm regularised deep multi-task learning. arXiv preprint arXiv:1606.04038, 2016.
|
| 298 |
+
|
| 299 |
+
Tianhe Yu, Deirdre Quillen, Zhanpeng He, Ryan Julian, Karol Hausman, Chelsea Finn, and Sergey Levine. Meta-world: A benchmark and evaluation for multi-task and meta-reinforcement learning. arXiv preprint arXiv:1910.10897, 2019.
|
| 300 |
+
|
| 301 |
+
Amir R Zamir, Alexander Sax, William Shen, Leonidas J Guibas, Jitendra Malik, and Silvio Savarese. Taskonomy: Disentangling task transfer learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3712–3722, 2018.
|
| 302 |
+
|
| 303 |
+
Zhanpeng Zhang, Ping Luo, Chen Change Loy, and Xiaoou Tang. Facial landmark detection by deep multi-task learning. In European conference on computer vision, pp. 94–108. Springer, 2014.
|
| 304 |
+
|
| 305 |
+
# A PROOF OF THEOREM 1
|
| 306 |
+
|
| 307 |
+
Proof. We will use the shorthand $| | \cdot | |$ to denote the $L _ { 2 }$ -norm and $\nabla { \mathcal { L } } = \nabla _ { \theta } { \mathcal { L } }$ , where $\theta$ is the parameter vector. Let $\mathbf { g _ { 1 } } = \nabla \mathcal { L } _ { 1 }$ , $\mathbf { g _ { 2 } } = \nabla \mathcal { L } _ { 2 }$ , and $\phi$ be the angle between $\bf { g _ { 1 } }$ and $\mathbf { g _ { 2 } }$ .
|
| 308 |
+
|
| 309 |
+
At each PCGrad update, we have two cases: $c o s ( \phi ) \geq 0$ or $\cos ( \phi < 0 )$ .
|
| 310 |
+
|
| 311 |
+
If $\cos ( \phi ) \geq 0$ , then we apply the standard gradient descent update using $\begin{array} { r } { t \leq \frac { 1 } { L } } \end{array}$ , which leads to a strict decrease in the objective function value ${ \mathcal { L } } ( \phi )$ unless $\nabla \mathcal { L } ( \phi ) = 0$ , which occurs only when $\theta = \theta ^ { * }$ (Boyd & Vandenberghe, 2004).
|
| 312 |
+
|
| 313 |
+
In the case that $\cos ( \phi ) < 0$ , we proceed as follows:
|
| 314 |
+
|
| 315 |
+
Our assumption that $\nabla \mathcal { L }$ is Lipschitz continuous with constant $L$ implies that $\nabla ^ { 2 } { \mathcal { L } } ( \theta ) - L I$ is a negative semidefinite matrix. Using this fact, we can perform a quadratic expansion of $\mathcal { L }$ around $\mathcal { L } ( \boldsymbol { \theta } )$ and obtain the following inequality:
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
\begin{array} { l } { \displaystyle \mathcal { L } ( { \boldsymbol { \theta } } ^ { + } ) \leq \mathcal { L } ( { \boldsymbol { \theta } } ) + \nabla \mathcal { L } ( { \boldsymbol { \theta } } ) ^ { T } ( { \boldsymbol { \theta } } ^ { + } - { \boldsymbol { \theta } } ) + \frac { 1 } { 2 } \nabla ^ { 2 } \mathcal { L } ( { \boldsymbol { \theta } } ) \vert \vert { \boldsymbol { \theta } } ^ { + } - { \boldsymbol { \theta } } \vert \vert ^ { 2 } } \\ { \leq \mathcal { L } ( { \boldsymbol { \theta } } ) + \nabla \mathcal { L } ( { \boldsymbol { \theta } } ) ^ { T } ( { \boldsymbol { \theta } } ^ { + } - { \boldsymbol { \theta } } ) + \frac { 1 } { 2 } L \vert \vert { \boldsymbol { \theta } } ^ { + } - { \boldsymbol { \theta } } \vert \vert ^ { 2 } } \end{array}
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
Now, we can plug in the PCGrad update by letting θ+ = θ − t(∇L(θ) − g1·g2||g1||2 g1 − | g1·g2|g2||2 g2). We then get:
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
\begin{array} { r l } & { \mathcal { L } ( \boldsymbol { \theta } ^ { + } ) \leq \mathcal { L } ( \boldsymbol { \theta } ) + t ( \nabla \mathcal { L } ( \boldsymbol { \theta } ) ) ^ { T } ( - \nabla \mathcal { L } ( \boldsymbol { \theta } ) + \frac { \mathbf { g _ { 1 } } \cdot \mathbf { g _ { 2 } } } { | | \mathbf { g _ { 1 } } | | ^ { 2 } } \mathbf { g _ { 1 } } + \frac { \mathbf { g _ { 1 } } \cdot \mathbf { g _ { 2 } } } { | | \mathbf { g _ { 2 } } | | ^ { 2 } } \mathbf { g _ { 2 } } ) } \\ & { \qquad + \frac { 1 } { 2 } L t ^ { 2 } | | \nabla \mathcal { L } ( \boldsymbol { \theta } ) - \frac { \mathbf { g _ { 1 } } \cdot \mathbf { g _ { 2 } } } { | | \mathbf { g _ { 1 } } | | ^ { 2 } } \mathbf { g _ { 1 } } - \frac { \mathbf { g _ { 1 } } \cdot \mathbf { g _ { 2 } } } { | | \mathbf { g _ { 2 } } | | ^ { 2 } } \mathbf { g _ { 2 } } | | ^ { 2 } } \end{array}
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
$$
|
| 328 |
+
\begin{array} { l } { = \displaystyle \mathcal { L } ( \boldsymbol { \theta } ) + t ( - | | \mathbf { g _ { 1 } } | | ^ { 2 } - | | \mathbf { g _ { 2 } } | | ^ { 2 } + 2 \mathbf { g _ { 1 } } \cdot \mathbf { g _ { 2 } } + \frac { ( \mathbf { g _ { 1 } } \cdot \mathbf { g _ { 2 } } ) ^ { 2 } } { | | \mathbf { g _ { 1 } } | | ^ { 2 } } + \frac { ( \mathbf { g _ { 1 } } \cdot \mathbf { g _ { 2 } } ) ^ { 2 } } { | | \mathbf { g _ { 2 } } | | ^ { 2 } } ) } \\ { + \displaystyle \frac { 1 } { 2 } L t ^ { 2 } | | \mathbf { g _ { 1 } } + \mathbf { g _ { 2 } } - \frac { \mathbf { g _ { 1 } } \cdot \mathbf { g _ { 2 } } } { | | \mathbf { g _ { 1 } } | | ^ { 2 } } \mathbf { g _ { 1 } } - \frac { \mathbf { g _ { 1 } } \cdot \mathbf { g _ { 2 } } } { | | \mathbf { g _ { 2 } } | | ^ { 2 } } \mathbf { g _ { 2 } } | | ^ { 2 } } \end{array}
|
| 329 |
+
$$
|
| 330 |
+
|
| 331 |
+
(Expanding further and re-arranging terms)
|
| 332 |
+
|
| 333 |
+
$$
|
| 334 |
+
{ \begin{array} { l } { = { \mathcal { L } } ( \theta ) - ( t - { \frac { 1 } { 2 } } L t ^ { 2 } ) ( | | \mathbf { g _ { 1 } } | | ^ { 2 } + | | \mathbf { g _ { 2 } } | | ^ { 2 } - { \frac { \left( \mathbf { g _ { 1 } } \cdot \mathbf { g _ { 2 } } \right) } { | | \mathbf { g _ { 1 } } | | ^ { 2 } } } - { \frac { \left( \mathbf { g _ { 1 } } \cdot \mathbf { g _ { 2 } } \right) } { | | \mathbf { g _ { 2 } } | | ^ { 2 } } } ) } \\ { = { \mathcal { L } } t ^ { 2 } ( \mathbf { g _ { 1 } } \cdot \mathbf { g _ { 2 } } - { \frac { \left( \mathbf { g _ { 1 } } \cdot \mathbf { g _ { 2 } } \right) ^ { 2 } } { | | \mathbf { g _ { 1 } } | | ^ { 2 } | | \mathbf { g _ { 2 } } | | ^ { 2 } } } \mathbf { g _ { 1 } } \cdot \mathbf { g _ { 2 } } ) } \end{array} }
|
| 335 |
+
$$
|
| 336 |
+
|
| 337 |
+
(Using the identity $\cos ( \phi ) = { \frac { \mathbf { g _ { 1 } } \cdot \mathbf { g _ { 2 } } } { | | \mathbf { g _ { 1 } } | | | | \mathbf { g _ { 2 } } | | } } )$
|
| 338 |
+
|
| 339 |
+
$$
|
| 340 |
+
\begin{array} { l } { { \displaystyle = \mathcal { L } ( \theta ) - ( t - \frac { 1 } { 2 } L t ^ { 2 } ) [ ( 1 - \cos ^ { 2 } ( \phi ) ) | | { \bf g _ { 1 } } | ] ^ { 2 } + ( 1 - \cos ^ { 2 } ( \phi ) ) | | { \bf g _ { 2 } } | | ^ { 2 } } \} } \\ { { \displaystyle - \left. L t ^ { 2 } ( 1 - \cos ^ { 2 } ( \phi ) ) | | { \bf g _ { 1 } } | | | { \bf g _ { 2 } } | | \cos ( \phi ) \right. } } \end{array}
|
| 341 |
+
$$
|
| 342 |
+
|
| 343 |
+
(Note that $\cos ( \phi ) < 0$ so the final term is non-negative)
|
| 344 |
+
|
| 345 |
+
Using $\begin{array} { r } { t \le \frac { 1 } { L } } \end{array}$ , we know that $\begin{array} { r } { - ( 1 - \frac 1 2 L t ) = \frac 1 2 L t - 1 \le \frac 1 2 L ( 1 / L ) - 1 = \frac { - 1 } { 2 } } \end{array}$ and $L t ^ { 2 } \leq t$
|
| 346 |
+
|
| 347 |
+
Plugging this into the last expression above, we can conclude the following:
|
| 348 |
+
|
| 349 |
+
$$
|
| 350 |
+
\begin{array} { l } { \displaystyle \mathcal { L } ( \boldsymbol { \theta } ^ { + } ) \leq \mathcal { L } ( \boldsymbol { \theta } ) - \frac { 1 } { 2 } t [ ( 1 - \cos ^ { 2 } ( \boldsymbol { \phi } ) ) | | \mathbf { g } _ { 1 } | ] ^ { 2 } + ( 1 - \cos ^ { 2 } ( \boldsymbol { \phi } ) ) | | \mathbf { g } _ { 2 } | ] ^ { 2 } ] } \\ { \displaystyle - t ( 1 - \cos ^ { 2 } ( \boldsymbol { \phi } ) ) | | \mathbf { g } _ { 1 } | | | | \mathbf { g } _ { 2 } | | \cos ( \boldsymbol { \phi } ) } \\ { \displaystyle = \mathcal { L } ( \boldsymbol { \theta } ) - \frac { 1 } { 2 } t ( 1 - \cos ^ { 2 } ( \boldsymbol { \phi } ) ) | | | \mathbf { g } _ { 1 } | | ^ { 2 } + 2 | | \mathbf { g } _ { 1 } | | | | \mathbf { g } _ { 2 } | | \cos ( \boldsymbol { \phi } ) + | | \mathbf { g } _ { 2 } | | ^ { 2 } ] } \\ { \displaystyle = \mathcal { L } ( \boldsymbol { \theta } ) - \frac { 1 } { 2 } t ( 1 - \cos ^ { 2 } ( \boldsymbol { \phi } ) ) [ | | \mathbf { g } _ { 1 } | | ^ { 2 } + 2 \mathbf { g } _ { 1 } \cdot \mathbf { g } _ { 2 } + | | \mathbf { g } _ { 2 } | | ^ { 2 } ] } \\ { \displaystyle = \mathcal { L } ( \boldsymbol { \theta } ) - \frac { 1 } { 2 } t ( 1 - \cos ^ { 2 } ( \boldsymbol { \phi } ) ) | | \mathbf { g } _ { 1 } + \mathbf { g } _ { 2 } | | ^ { 2 } } \\ { \displaystyle = \mathcal { L } ( \boldsymbol { \theta } ) - \frac { 1 } { 2 } t ( 1 - \cos ^ { 2 } ( \boldsymbol { \phi } ) ) | | \nabla \mathcal { L } ( \boldsymbol { \theta } ) | | ^ { 2 } } \end{array}
|
| 351 |
+
$$
|
| 352 |
+
|
| 353 |
+
If $\cos ( \phi ) > - 1$ , then $\begin{array} { r l } { { \frac { 1 } { 2 } t ( 1 - \cos ^ { 2 } ( \phi ) ) \| \nabla \mathcal { L } ( \theta ) \| ^ { 2 } } } \end{array}$ will always be positive unless $\nabla { \mathcal { L } } ( \theta ) = 0$ . This inequality implies that the objective function value strictly decreases with each iteration where $\cos ( \phi ) > - 1$ .
|
| 354 |
+
|
| 355 |
+
Hence repeatedly applying PCGrad process can either reach the optimal value ${ \mathcal { L } } ( \theta ) = { \mathcal { L } } ( \theta ^ { * } )$ or $\cos ( \phi ) = - 1$ , in which case $\begin{array} { r } { \frac { 1 } { 2 } t ( 1 - \bar { \cos ^ { 2 } ( \phi ) } ) \| \nabla \mathcal { L } ( \theta ) \| ^ { 2 } = 0 , } \end{array}$ . Note that this result only holds when we choose $t$ to be small enough, i.e. $\begin{array} { r } { t \le \frac { 1 } { L } } \end{array}$ .
|
| 356 |
+
|
| 357 |
+
# B 2D OPTIMIZATION LANDSCAPE DETAILS
|
| 358 |
+
|
| 359 |
+
To produce the 2D optimization visualizations in Figure 1, we used a parameter vector $\theta = \left[ \theta _ { 1 } , \theta _ { 2 } \right] \in$ $\mathbb { R } ^ { 2 }$ and the following task loss functions:
|
| 360 |
+
|
| 361 |
+
$$
|
| 362 |
+
\begin{array} { r l } & { \mathcal { L } _ { 1 } ( \theta ) = 2 0 \log ( \operatorname* { m a x } ( | . 5 \theta _ { 1 } + \operatorname { t a n h } ( \theta _ { 2 } ) | , 0 . 0 0 0 0 0 5 ) ) } \\ & { \mathcal { L } _ { 2 } ( \theta ) = 2 5 \log ( \operatorname* { m a x } ( | . 5 \theta _ { 1 } - \operatorname { t a n h } ( \theta _ { 2 } ) + 2 | , 0 . 0 0 0 0 0 5 ) ) } \end{array}
|
| 363 |
+
$$
|
| 364 |
+
|
| 365 |
+
The multi-task objective is $\mathcal { L } ( \theta ) = \mathcal { L } _ { 1 } ( \theta ) + \mathcal { L } _ { 2 } ( \theta )$ . We initialized $\theta = [ 0 . 5 , - 3 ]$ and performed 500,000 gradient updates to minimize $\mathcal { L }$ using the Adam optimizer with learning rate 0.001. We compared using Adam for each update to using Adam in conjunction with the PCGrad method presented in Section 3.2.
|
| 366 |
+
|
| 367 |
+
# C EXPERIMENTAL RESULTS ON MULTIMNIST
|
| 368 |
+
|
| 369 |
+
Following the same set-up in Sener & Koltun (2018), for each image, we sample a different one uniformly at random. Then we put one of the image on the top left and the other one on the bottom right. The two tasks in the multi-task learning problem are to classify the digits on the top left (task-L) and bottom right (task-R) respectively. We construct such $6 0 \mathrm { K }$ examples. We combine PCGrad with the same backbone architecture used in (Sener & Koltun, 2018) and compare its performance to Sener & Koltun (2018) by running the open-sourced code provided in (Sener & Koltun, 2018). As shown in Table 3, our method results $0 . 1 3 \%$ and $0 . 5 5 \%$ improvement over Sener & Koltun (2018) in left and right digit accuracy respectively.
|
| 370 |
+
|
| 371 |
+
<table><tr><td></td><td>left digit</td><td>right digit</td></tr><tr><td>Sener & Koltun (2018)</td><td>96.45</td><td>94.95</td></tr><tr><td>PCGrad (ours)</td><td>96.58</td><td>95.50</td></tr></table>
|
| 372 |
+
|
| 373 |
+
Table 3: MultiMNIST results. PCGrad achieves improvements over Sener & Koltun (2018) in both left and right digit classfication accuracy.
|
| 374 |
+
|
| 375 |
+
# D ABLATION STUDY ON THE TASK ORDER
|
| 376 |
+
|
| 377 |
+
As stated on line 4 in Algorithm 1, we sample the tasks from the batch and randomly shuffle the order of the tasks before performing the update steps in PCGrad. With random shuffling, we make
|
| 378 |
+
|
| 379 |
+
PCGrad symmetric w.r.t. the task order in expectation. In Figure 7, we observe that PCGrad with a random task order achieves better performance between PCGrad with a fixed task order in the setting of MT50 where the number of tasks is large and the conflicting gradient phenomenon is much more likely to happen.
|
| 380 |
+
|
| 381 |
+

|
| 382 |
+
Figure 7: Ablation study on using a fixed task order during PCGrad. PCGrad with a random task order does significantly better PCGrad with a fixed task order in MT50 benchmark.
|
| 383 |
+
|
| 384 |
+
# E EXPERIMENT DETAILS
|
| 385 |
+
|
| 386 |
+
E.1 DETAILED EXPERIMENT SET-UP
|
| 387 |
+
|
| 388 |
+
For our CIFAR-100 multi-task experiment, we adopt the architecture used in Rosenbaum et al. (2019), which is a convolutional neural network that consists of 3 convolutional layers with $1 6 0 3 \times 3$ filters each layer and 2 fully connected layers with 320 hidden units. As for experiments on the NYUv2 dataset, we follow Liu et al. (2018) to use SegNet (Badrinarayanan et al., 2017) as the backbone architecture.
|
| 389 |
+
|
| 390 |
+
Our reinforcement learning experiments all use the SAC (Haarnoja et al., 2018) algorithm as the base algorithm, where the actor and the critic are represented as 6-layer fully-connected feedforward neural networks for all methods. The numbers of hidden units of each layer of the neural networks are 160, 300 and 200 for MT10, MT50 and goal-conditioned RL respectively.
|
| 391 |
+
|
| 392 |
+
We use five algorithms as baselines in the CIFAR-100 multi-task experiment: task specific-1-fc (Rosenbaum et al., 2018): a convolutional neural network shared across tasks except that each task has a separate last fully-connected layer, task specific-1-fc (Rosenbaum et al., 2018) : all the convolutional layers shared across tasks with separate fully-connected layers for each task, cross stitch-all-fc (Misra et al., 2016b): one convolutional neural network per task along with cross-stitch units to share features across tasks, routing-all-fc ${ \bf \Pi } _ { \bf { \Pi } } + { \bf W } { \bf P } { \bf L }$ (Rosenbaum et al., 2019): a network that employs a trainable router trained with multi-agent RL algorithm (WPL) to select trainable functions for each task, independent: training separate neural networks for each task.
|
| 393 |
+
|
| 394 |
+
For comparisons on the NYUv2 dataset, we consider 5 baselines: Single Task, One Task: the vanilla SegNet used for single-task training, Single Task, STAN (Liu et al., 2018): the single-task version of MTAN as mentioned below, Multi-Task, Split, Wide / Deep (Liu et al., 2018): the standard SegNet shared for all three tasks except that each task has a separate last layer for final task-specific prediction with two variants Wide and Deep specified in Liu et al. (2018), Multi-Task Dense: a shared network followed by separate task-specific networks, Multi-Task Cross-Stitch (Misra et al., 2016b): similar to the baseline used in CIFAR-100 experiment but with SegNet as the backbone, MTAN (Liu et al., 2018): a shared network with a soft-attention module for each task.
|
| 395 |
+
|
| 396 |
+
On the multi-task and goal-conditioned RL domain, we apply PCGrad to the vanilla SAC algorithm with task encoding as part of the input to the actor and the critic as described in Section 4 and compare our method to the vanilla SAC without PCGrad and training actors and critics for each task individually (Independent).
|
| 397 |
+
|
| 398 |
+
# E.2 GOAL-CONDITIONED EXPERIMENT DETAILS
|
| 399 |
+
|
| 400 |
+
We use the pushing environment from the Meta-World benchmark (Yu et al., 2019) as shown in Figure 3. In this environment, the table spans from $[ - 0 . 4 , 0 . 2 ]$ to [0.4, 1.0] in the 2D space. To construct the goals, we sample the intial positions of the puck from the range $[ - 0 . 2 , 0 . 6 ]$ to [0.2, 0.7] on the table and the goal positions from the range $[ - 0 . 2 , 0 . 8 5 ]$ to $[ 0 . 2 , 0 . 9 5 ]$ on the table. The goal is represented as a concatenation of the initial puck position and the goal position. Since in the goal-conditioned setting, the task distribution is continuous, we sample a minibatch of 9 goals and 128 samples per goal at each training iteration and also sample 600 samples per goal in the minibatch at each data collection step.
|
| 401 |
+
|
| 402 |
+
# E.3 FULL NYUV2 RESULTS
|
| 403 |
+
|
| 404 |
+
We provide the full comparison on the NYUv2 dataset in Table 4.
|
| 405 |
+
|
| 406 |
+
<table><tr><td rowspan="2">Type</td><td rowspan="2">#P.</td><td rowspan="2">Architecture Weighting</td><td colspan="2">Segmentation</td><td colspan="2">Depth</td><td colspan="5">Surface Normal</td></tr><tr><td colspan="2">mIoU Pix Acc Abs Err Rel Err</td><td colspan="2">(Higher Better) (Lower Better)</td><td colspan="2">Angle Distance (Lower Better) Mean Median</td><td colspan="2">Within t (Higher Better) 11.2522.5</td></tr><tr><td rowspan="2">Single Task</td><td>3 One Task</td><td></td><td></td><td>15.10 51.54</td><td></td><td>0.7508 0.3266</td><td>531.76</td><td>25.51</td><td></td><td>22.12 45.33</td><td>30 57.13</td></tr><tr><td>4.56 STANt</td><td>n.a. n.a.</td><td>15.73</td><td>52.89</td><td>0.6935</td><td>0.2891</td><td>32.09</td><td>26.32</td><td>21.49</td><td>44.38</td><td>56.51</td></tr><tr><td rowspan="9">Multi Task</td><td rowspan="3">1.75 Split, Wide</td><td>Equal Weights</td><td>15.89</td><td>51.19</td><td>0.6494</td><td>0.2804</td><td>33.69</td><td>28.91</td><td>18.54</td><td>39.91</td><td>52.02</td></tr><tr><td>Uncert.Weights*</td><td>15.86</td><td>51.12</td><td>0.6040</td><td>0.2570</td><td>32.33</td><td>26.62</td><td>21.68</td><td>43.59</td><td>55.36</td></tr><tr><td>DWA+,T=2</td><td>16.92</td><td>53.72</td><td>0.6125</td><td>0.2546</td><td>32.34</td><td>27.10</td><td>20.69</td><td>42.73</td><td>54.74</td></tr><tr><td rowspan="3">2Split, Deep</td><td>Equal Weights</td><td>13.03</td><td>41.47</td><td>0.7836</td><td>0.3326</td><td>38.28</td><td>36.55</td><td>9.50</td><td>27.11</td><td>39.63</td></tr><tr><td>Uncert.Weights*</td><td>14.53</td><td>43.69</td><td>0.7705</td><td>0.3340</td><td>35.14</td><td>32.13</td><td>14.69</td><td>34.52</td><td>46.94</td></tr><tr><td>DWA+,T= 2</td><td>13.63</td><td>44.41</td><td>0.7581</td><td>0.3227</td><td>36.41</td><td>34.12</td><td>12.82</td><td>31.12</td><td>43.48</td></tr><tr><td rowspan="3">4.95 Dense</td><td>Equal Weights</td><td>16.06</td><td>52.73</td><td>0.6488</td><td>0.2871</td><td>33.58</td><td>28.01</td><td>20.07</td><td>41.50</td><td>53.35</td></tr><tr><td>Uncert.Weights*</td><td>16.48</td><td>54.40</td><td>0.6282</td><td>0.2761</td><td>31.68</td><td>25.68</td><td>21.73</td><td>44.58</td><td>56.65</td></tr><tr><td>DWAt,T = 2</td><td>16.15</td><td>54.35</td><td>0.6059</td><td>0.2593</td><td>32.44</td><td>27.40</td><td>20.53</td><td>42.76</td><td>54.27</td></tr><tr><td rowspan="3">≈3 Cross-Stitcht</td><td>Equal Weights</td><td>14.71 15.69</td><td>50.23</td><td>0.6481</td><td>0.2871</td><td>33.56</td><td>28.58</td><td></td><td>20.08 40.54</td><td></td><td>51.97</td></tr><tr><td></td><td>Uncert. Weights*</td><td>52.60</td><td>0.6277</td><td>0.2702</td><td>32.69</td><td></td><td>27.26</td><td>21.63 21.81</td><td>42.84</td><td>54.45 54.92</td></tr><tr><td>DWA+,T= 2</td><td>16.11</td><td>53.19</td><td>0.5922</td><td>0.2611</td><td>32.34</td><td>26.91</td><td></td><td>43.14</td><td></td></tr><tr><td rowspan="3">1.77 MTANt</td><td></td><td>Equal Weights 17.72</td><td>55.32</td><td>0.5906</td><td>0.2577</td><td></td><td>31.44</td><td>25.37</td><td>23.17</td><td>45.65</td><td>57.48</td></tr><tr><td>Uncert.Weights*</td><td>17.67</td><td>55.61</td><td>0.5927</td><td>0.2592</td><td>31.25</td><td></td><td>25.57</td><td>22.99</td><td>45.83</td><td>57.67</td></tr><tr><td>DWAt,T=2</td><td>17.15</td><td>54.97</td><td>0.5956</td><td>0.2569</td><td>31.60</td><td>25.46</td><td></td><td>22.48 44.86</td><td></td><td>57.24</td></tr></table>
|
| 407 |
+
|
| 408 |
+
Table 4: We present the full results on three tasks on the NYUv2 dataset: 13-class semantic segmentation, depth estimation, and surface normal prediction results. #P shows the total number of network parameters. We highlight the best performing combination of multi-task architecture and weighting in bold. The top validation scores for each task are annotated with boxes. The symbols indicate prior methods: ∗: (Kendall et al., 2018a), †: (Liu et al., 2018), $^ \ddag$ : (Misra et al., 2016b). Performance of other methods taken from (Liu et al., 2018).
|
md/train/HJlSmC4FPS/HJlSmC4FPS.md
ADDED
|
@@ -0,0 +1,310 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ROBUST AND INTERPRETABLE BLIND IMAGE DENOISING VIA BIAS-FREE CONVOLUTIONAL NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Sreyas Mohan∗ Center for Data Science New York University sm7582@nyu.edu
|
| 4 |
+
|
| 5 |
+
Zahra Kadkhodaie∗ Center for Data Science New York University zk388@nyu.edu
|
| 6 |
+
|
| 7 |
+
# Carlos Fernandez-Granda
|
| 8 |
+
|
| 9 |
+
Eero P. Simoncelli
|
| 10 |
+
Center for Neural Science, and
|
| 11 |
+
Howard Hughes Medical Institute
|
| 12 |
+
New York University
|
| 13 |
+
eero.simoncelli@nyu.edu
|
| 14 |
+
|
| 15 |
+
Center for Data Science, and Courant Inst. of Mathematical Sciences New York University cfgranda@cims.nyu.edu
|
| 16 |
+
|
| 17 |
+
# ABSTRACT
|
| 18 |
+
|
| 19 |
+
We study the generalization properties of deep convolutional neural networks for image denoising in the presence of varying noise levels. We provide extensive empirical evidence that current state-of-the-art architectures systematically overfit to the noise levels in the training set, performing very poorly at new noise levels. We show that strong generalization can be achieved through a simple architectural modification: removing all additive constants. The resulting "bias-free" networks attain state-of-the-art performance over a broad range of noise levels, even when trained over a narrow range. They are also locally linear, which enables direct analysis with linear-algebraic tools. We show that the denoising map can be visualized locally as a filter that adapts to both image structure and noise level. In addition, our analysis reveals that deep networks implicitly perform a projection onto an adaptively-selected low-dimensional subspace, with dimensionality inversely proportional to noise level, that captures features of natural images.
|
| 20 |
+
|
| 21 |
+
# 1 INTRODUCTION AND CONTRIBUTIONS
|
| 22 |
+
|
| 23 |
+
The problem of denoising consists of recovering a signal from measurements corrupted by noise, and is a canonical application of statistical estimation that has been studied since the 1950’s. Achieving high-quality denoising results requires (at least implicitly) quantifying and exploiting the differences between signals and noise. In the case of photographic images, the denoising problem is both an important application, as well as a useful test-bed for our understanding of natural images. In the past decade, convolutional neural networks (LeCun et al., 2015) have achieved state-of-the-art results in image denoising (Zhang et al., 2017; Chen & Pock, 2017). Despite their success, these solutions are mysterious: we lack both intuition and formal understanding of the mechanisms they implement. Network architecture and functional units are often borrowed from the image-recognition literature, and it is unclear which of these aspects contributes to, or limits, the denoising performance. The goal of this work is advance our understanding of deep-learning models for denoising. Our contributions are twofold: First, we study the generalization capabilities of deep-learning models across different noise levels. Second, we provide novel tools for analyzing the mechanisms implemented by neural networks to denoise natural images.
|
| 24 |
+
|
| 25 |
+
An important advantage of deep-learning techniques over traditional methodology is that a single neural network can be trained to perform denoising at a wide range of noise levels. Currently, this is achieved by simulating the whole range of noise levels during training (Zhang et al., 2017). Here, we show that this is not necessary. Neural networks can be made to generalize automatically across noise levels through a simple modification in the architecture: removing all additive constants. We find this holds for a variety of network architectures proposed in previous literature. We provide extensive empirical evidence that the main state-of-the-art denoising architectures systematically overfit to the noise levels in the training set, and that this is due to the presence of a net bias. Suppressing this bias makes it possible to attain state-of-the-art performance while training over a very limited range of noise levels.
|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
Figure 1: First-order analysis of the residual of a denoising convolutional neural network as a function of noise level. The plots show the norms of the residual and the net bias averaged over $1 0 0 \ : 2 0 \times 2 0$ natural-image patches for networks trained over different training ranges. The range of noises used for training is highlighted in blue. (a) When the network is trained over the full range of noise levels $( \sigma \in [ 0 , 1 \bar { 0 } 0 ] )$ the net bias is small, growing slightly as the noise increases. (b-c) When the network is trained over the a smaller range ( ${ \bf \sigma } _ { \sigma } \in [ 0 , 5 5 ]$ and $\sigma \in [ 0 , 3 0 ] )$ , the net bias grows explosively for noise levels beyond the training range. This coincides with a dramatic drop in performance, reflected in the difference between the magnitudes of the residual and the true noise. The CNN used for this example is DnCNN (Zhang et al., 2017); using alternative architectures yields similar results as shown in Figure 8.
|
| 29 |
+
|
| 30 |
+
The data-driven mechanisms implemented by deep neural networks to perform denoising are almost completely unknown. It is unclear what priors are being learned by the models, and how they are affected by the choice of architecture and training strategies. Here, we provide novel linear-algebraic tools to visualize and interpret these strategies through a local analysis of the Jacobian of the denoising map. The analysis reveals locally adaptive properties of the learned models, akin to existing nonlinear filtering algorithms. In addition, we show that the deep networks implicitly perform a projection onto an adaptively-selected low-dimensional subspace capturing features of natural images.
|
| 31 |
+
|
| 32 |
+
# 2 RELATED WORK
|
| 33 |
+
|
| 34 |
+
The classical solution to the denoising problem is the Wiener filter (Wiener, 1950), which assumes a translation-invariant Gaussian signal model. The main limitation of Wiener filtering is that it over-smoothes, eliminating fine-scale details and textures. Modern filtering approaches address this issue by adapting the filters to the local structure of the noisy image (e.g. Tomasi & Manduchi (1998); Milanfar (2012)). Here we show that neural networks implement such strategies implicitly, learning them directly from the data.
|
| 35 |
+
|
| 36 |
+
In the 1990’s powerful denoising techniques were developed based on multi-scale ("wavelet") transforms. These transforms map natural images to a domain where they have sparser representations. This makes it possible to perform denoising by applying nonlinear thresholding operations in order to discard components that are small relative to the noise level (Donoho & Johnstone, 1995; Simoncelli & Adelson, 1996; Chang et al., 2000). From a linear-algebraic perspective, these algorithms operate by projecting the noisy input onto a lower-dimensional subspace that contains plausible signal content. The projection eliminates the orthogonal complement of the subspace, which mostly contains noise. This general methodology laid the foundations for the state-of-the-art models in the 2000’s (e.g. (Dabov et al., 2006)), some of which added a data-driven perspective, learning sparsifying transforms (Elad & Aharon, 2006), and nonlinear shrinkage functions (Hel-Or & Shaked, 2008; Raphan & Simoncelli, 2008), directly from natural images. Here, we show that deep-learning models learn similar priors in the form of local linear subspaces capturing image features.
|
| 37 |
+
|
| 38 |
+

|
| 39 |
+
Figure 2: Denoising of an example natural image by a CNN and its bias-free counterpart (BF-CNN), both trained over noise levels in the range $\sigma \in [ 0 , 1 0 ]$ (image intensities are in the range [0, 255]). The CNN performs poorly at high noise levels $\sigma = 9 0$ , far beyond the training range), whereas BF-CNN performs at state-of-the-art levels. The CNN used for this example is DnCNN (Zhang et al., 2017); using alternative architectures yields similar results (see Section 5).
|
| 40 |
+
|
| 41 |
+
In the past decade, purely data-driven models based on convolutional neural networks (LeCun et al., 2015) have come to dominate all previous methods in terms of performance. These models consist of cascades of convolutional filters, and rectifying nonlinearities, which are capable of representing a diverse and powerful set of functions. Training such architectures to minimize mean square error over large databases of noisy natural-image patches achieves current state-of-the-art results (Zhang et al., 2017; Huang et al., 2017; Ronneberger et al., 2015; Zhang et al., 2018a).
|
| 42 |
+
|
| 43 |
+
# 3 NETWORK BIAS IMPAIRS GENERALIZATION
|
| 44 |
+
|
| 45 |
+
We assume a measurement model in which images are corrupted by additive noise: $y = x + n$ , where $\boldsymbol { x } \in \mathbb { R } ^ { N }$ is the original image, containing $N$ pixels, $n$ is an image of i.i.d. samples of Gaussian noise with variance $\sigma ^ { 2 }$ , and $y$ is the noisy observation. The denoising problem consists of finding a function $f : \mathbb { R } ^ { N } \to \mathbb { R } ^ { N }$ , that provides a good estimate of the original image, $x$ . Commonly, one minimizes the mean squared error : $\begin{array} { r } { f = \arg \operatorname* { m i n } _ { g } E | | x - g ( y ) | | ^ { 2 } } \end{array}$ , where the expectation is taken over some distribution over images, $x$ , as well as over the distribution of noise realizations. In deep learning, the denoising function $g$ is parameterized by the weights of the network, so the optimization is over these parameters. If the noise standard deviation, $\sigma$ , is unknown, the expectation must also be taken over a distribution of $\sigma$ . This problem is often called blind denoising in the literature. In this work, we study the generalization performance of CNNs across noise levels $\sigma$ , i.e. when they are tested on noise levels not included in the training set.
|
| 46 |
+
|
| 47 |
+
Feedforward neural networks with rectified linear units (ReLUs) are piecewise affine: for a given activation pattern of the ReLUs, the effect of the network on the input is a cascade of linear transformations (convolutional or fully connected layers, $W _ { k }$ ), additive constants $( b _ { k } )$ , and pointwise multiplications by a binary mask corresponding to the fixed activation pattern $( R )$ . Since each of these is affine, the entire cascade implements a single affine transformation. For a fixed noisy input image $\boldsymbol { y } \in \mathbb { R } ^ { N }$ with $N$ pixels, the function $f : \mathbb { R } ^ { N } \xrightarrow [ ] { } \mathbb { R } ^ { N }$ computed by a denoising neural network may be written
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
f ( y ) = W _ { L } R ( W _ { L - 1 } . . . . R ( W _ { 1 } y + b _ { 1 } ) + . . . b _ { L - 1 } ) + b _ { L } = A _ { y } y + b _ { y } ,
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
where $A _ { y } \in \mathbb R ^ { N \times N }$ is the Jacobian of $f ( \cdot )$ evaluated at input $y$ , and $b _ { y } \in \mathbb { R } ^ { N }$ represents the net bias. The subscripts on $A _ { y }$ and $b _ { y }$ serve as a reminder that both depend on the ReLU activation patterns, which in turn depend on the input vector $y$ .
|
| 54 |
+
|
| 55 |
+
Based on equation 1 we can perform a first-order decomposition of the error or residual of the neural network for a specific input: $\dot { y } - f ( y ) = ( I - A _ { y } ) y - b _ { y }$ . Figure 1 shows the magnitude of the residual and the constant, which is equal to the net bias $b _ { y }$ , for a range of noise levels. Over the training range, the net bias is small, implying that the linear term is responsible for most of the denoising (see Figures 9 and 10 for a visualization of both components). However, when the network is evaluated at noise levels outside of the training range, the norm of the bias increases dramatically, and the residual is significantly smaller than the noise, suggesting a form of overfitting. Indeed, network performance generalizes very poorly to noise levels outside the training range. This is illustrated for an example image in Figure 2, and demonstrated through extensive experiments in Section 5.
|
| 56 |
+
|
| 57 |
+

|
| 58 |
+
Figure 3: Comparison of the performance of a CNN and a BF-CNN with the same architecture for the experimental design described in Section 5. The performance is quantified by the PSNR of the denoised image as a function of the input PSNR. Both networks are trained over a fixed ranges of noise levels indicated by a blue background. In all cases, the performance of BF-CNN generalizes robustly beyond the training range, while that of the CNN degrades significantly. The CNN used for this example is DnCNN (Zhang et al., 2017); using alternative architectures yields similar results (see Figures 11 and 12).
|
| 59 |
+
|
| 60 |
+
# 4 PROPOSED METHODOLOGY: BIAS-FREE NETWORKS
|
| 61 |
+
|
| 62 |
+
Section 3 shows that CNNs overfit to the noise levels present in the training set, and that this is associated with wild fluctuations of the net bias $b _ { y }$ . This suggests that the overfitting might be ameliorated by removing additive (bias) terms from every stage of the network, resulting in a biasfree CNN (BF-CNN). Note that bias terms are also removed from the batch-normalization used during training. This simple change in the architecture has an interesting consequence. If the CNN has ReLU activations the denoising map is locally homogeneous, and consequently invariant to scaling: rescaling the input by a constant value simply rescales the output by the same amount, just as it would for a linear system.
|
| 63 |
+
|
| 64 |
+
Lemma 1. Let $f _ { \mathrm { B F } } : \mathbb { R } ^ { N } \to \mathbb { R } ^ { N }$ be a feedforward neural network with ReLU activation functions and no additive constant terms in any layer. For any input $y \in \mathbb R$ and any nonnegative constant $\alpha$ ,
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
f _ { \mathrm { B F } } ( \alpha y ) = \alpha f _ { \mathrm { B F } } ( y ) .
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
Proof. We can write the action of a bias-free neural network with $L$ layers in terms of the weight matrix $W _ { i }$ , $1 \leq i \leq L$ , of each layer and a rectifying operator $\mathcal { R }$ , which sets to zero any negative entries in its input. Multiplying by a nonnegative constant does not change the sign of the entries of a vector, so for any $z$ with the right dimension and any $\alpha > 0$ $\mathcal { R } ( \alpha z ) = \bar { \alpha } \mathcal { R } ( z )$ , which implies
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
f _ { \mathrm { B F } } ( \alpha y ) = W _ { L } \mathcal { R } ( W _ { L - 1 } \cdot \cdot \cdot \mathcal { R } ( W _ { 1 } \alpha y ) ) = \alpha W _ { L } \mathcal { R } ( W _ { L - 1 } \cdot \cdot \cdot \mathcal { R } ( W _ { 1 } y ) ) = \alpha f _ { \mathrm { B F } } ( y ) .
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
Note that networks with nonzero net bias are not scaling invariant because scaling the input may change the activation pattern of the ReLUs. Scaling invariance is intuitively desireable for a denoising method operating on natural images; a rescaled image is still an image. Note that Lemma 1 holds for networks with skip connections where the feature maps are concatenated or added, because both of these operations are linear.
|
| 77 |
+
|
| 78 |
+
In the following sections we demonstrate that removing all additive terms in CNN architectures has two important consequences: (1) the networks gain the ability to generalize to noise levels not encountered during training (as illustrated by Figure 2 the improvement is striking), and (2) the denoising mechanism can be analyzed locally via linear-algebraic tools that reveal intriguing ties to more traditional denoising methodology such as nonlinear filtering and sparsity-based techniques.
|
| 79 |
+
|
| 80 |
+

|
| 81 |
+
Figure 4: Visualization of the linear weighting functions (rows of $A _ { y }$ in equation 4) of a BF-CNN for three example pixels of an input image, and three levels of noise. The images in the three rightmost columns show the weighting functions used to compute each of the indicated pixels (red squares). All weighting functions sum to one, and thus compute a local average (note that some weights are negative, indicated in red). Their shapes vary substantially, and are adapted to the underlying image content. As the noise level $\sigma$ increases, the spatial extent of the weight functions increases in order to average out the noise, while respecting boundaries between different regions in the image, which results in dramatically different functions for each pixel. The CNN used for this example is DnCNN (Zhang et al., 2017); using alternative architectures yields similar results (see Figure 13).
|
| 82 |
+
|
| 83 |
+
# 5 BIAS-FREE NETWORKS GENERALIZE ACROSS NOISE LEVELS
|
| 84 |
+
|
| 85 |
+
In order to evaluate the effect of removing the net bias in denoising CNNs, we compare several state-ofthe-art architectures to their bias-free counterparts, which are exactly the same except for the absence of any additive constants within the networks (note that this includes the batch-normalization additive parameter). These architectures include popular features of existing neural-network techniques in image processing: recurrence, multiscale filters, and skip connections. More specifically, we examine the following models (see Section A for additional details):
|
| 86 |
+
|
| 87 |
+
• DnCNN (Zhang et al., 2017): A feedforward CNN with 20 convolutional layers, each consisting of $3 \times 3$ filters, 64 channels, batch normalization (Ioffe & Szegedy, 2015), a ReLU nonlinearity, and a skip connection from the initial layer to the final layer. Recurrent CNN: A recurrent architecture inspired by Zhang et al. (2018a) where the basic module is a CNN with 5 layers, $3 \times 3$ filters and 64 channels in the intermediate layers. The order of the recurrence is 4.
|
| 88 |
+
• UNet (Ronneberger et al., 2015): A multiscale architecture with 9 convolutional layers and skip connections between the different scales.
|
| 89 |
+
• Simplified DenseNet: CNN with skip connections inspired by the DenseNet architecture (Huang et al., 2017; Zhang et al., 2018b).
|
| 90 |
+
|
| 91 |
+
We train each network to denoise images corrupted by i.i.d. Gaussian noise over a range of standard deviations (the training range of the network). We then evaluate the network for noise levels that are both within and beyond the training range. Our experiments are carried out on $1 8 0 \times 1 8 0$ natural images from the Berkeley Segmentation Dataset (Martin et al., 2001) to be consistent with previous results (Schmidt & Roth, 2014; Chen & Pock, 2017; Zhang et al., 2017). Additional details about the dataset and training procedure are provided in Section B.
|
| 92 |
+
|
| 93 |
+

|
| 94 |
+
Figure 5: Analysis of the SVD of the Jacobian of a BF-CNN for ten natural images, corrupted by noise of standard deviation $\sigma = 5 0$ . (a) Singular value distributions. For all images, a large proportion of the values are near zero, indicating (approximately) a projection onto a subspace (the signal subspace). (b) Histogram of dot products (cosine of angle) between the left and right singular vectors that lie within the signal subspaces. (c) Effective dimensionality of the signal subspaces (computed as sum of squared singular values) as a function of noise level. For comparison, the total dimensionality of the space is 1600 ( $4 0 \times 4 0$ pixels). Average dimensionality (red curve) falls approximately as the inverse of $\sigma$ (dashed curve). The CNN used for this example is DnCNN (Zhang et al., 2017); using alternative architectures yields similar results (see Figure 17).
|
| 95 |
+
|
| 96 |
+
Figures 3, 11 and 12 show our results. For a wide range of different training ranges, and for all architectures, we observe the same phenomenon: the performance of CNNs is good over the training range, but degrades dramatically at new noise levels; in stark contrast, the corresponding BF-CNNs provide strong denoising performance over noise levels outside the training range. This holds for both PSNR and the more perceptually-meaningful Structural Similarity Index (Wang et al., 2004) (see Figure 12). Figure 2 shows an example image, demonstrating visually the striking difference in generalization performance between a CNN and its corresponding BF-CNN. Our results provide strong evidence that removing net bias in CNN architectures results in effective generalization to noise levels out of the training range.
|
| 97 |
+
|
| 98 |
+
# 6 REVEALING THE DENOISING MECHANISMS LEARNED BY BF-CNNS
|
| 99 |
+
|
| 100 |
+
In this section we perform a local analysis of BF-CNN networks, which reveals the underlying denoising mechanisms learned from the data. A bias-free network is strictly linear, and its net action can be expressed as
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
f _ { \mathrm { B F } } ( y ) = W _ { L } R ( W _ { L - 1 } . . . R ( W _ { 1 } y ) ) = A _ { y } y ,
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where $A _ { y }$ is the Jacobian of $f _ { \mathrm { B F } } ( \cdot )$ evaluated at $y$ . The Jacobian at a fixed input provides a local characterization of the denoising map. In order to study the map we perform a linear-algebraic analysis of the Jacobian. Our approach is similar in spirit to visualization approaches– proposed in the context of image classification– that differentiate neural-network functions with respect to their input (e.g. Simonyan et al. (2013); Montavon et al. (2017)).
|
| 107 |
+
|
| 108 |
+
# 6.1 NONLINEAR ADAPTIVE FILTERING
|
| 109 |
+
|
| 110 |
+
The linear representation of the denoising map given by equation 4 implies that the ith pixel of the output image is computed as an inner product between the $i$ th row of $A _ { y }$ , denoted $a _ { y } ( i )$ , and the input image:
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
f _ { \mathrm { B F } } ( y ) ( i ) = \sum _ { j = 1 } ^ { N } A _ { y } ( i , j ) y ( j ) = a _ { y } ( i ) ^ { T } y .
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 6: Visualization of left singular vectors of the Jacobian of a BF-CNN, evaluated on two different images (top and bottom rows), corrupted by noise with standard deviation $\sigma = 5 0$ . The left column shows original (clean) images. The next three columns show singular vectors corresponding to non-negligible singular values. The vectors capture features from the clean image. The last three columns on the right show singular vectors corresponding to singular values that are almost equal to zero. These vectors are noisy and unstructured. The CNN used for this example is DnCNN (Zhang et al., 2017); using alternative architectures yields similar results (see Figure 16).
|
| 118 |
+
|
| 119 |
+
The vectors $a _ { y } ( i )$ can be interpreted as adaptive filters that produce an estimate of the denoised pixel via a weighted average of noisy pixels. Examination of these filters reveals their diversity, and their relationship to the underlying image content: they are adapted to the local features of the noisy image, averaging over homogeneous regions of the image without blurring across edges. This is shown for two separate examples and a range of noise levels in Figures 4, 13, 14 and 15 for the architectures described in Section 5. We observe that the equivalent filters of all architectures adapt to image structure.
|
| 120 |
+
|
| 121 |
+
Classical Wiener filtering (Wiener, 1950) denoises images by computing a local average dependent on the noise level. As the noise level increases, the averaging is carried out over a larger region. As illustrated by Figures 4, 13, 14 and 15, the equivalent filters of BF-CNNs also display this behavior. The crucial difference is that the filters are adaptive. The BF-CNNs learn such filters implicitly from the data, in the spirit of modern nonlinear spatially-varying filtering techniques designed to preserve fine-scale details such as edges (e.g. Tomasi & Manduchi (1998), see also Milanfar (2012) for a comprehensive review, and Choi et al. (2018) for a recent learning-based approach).
|
| 122 |
+
|
| 123 |
+
# 6.2 PROJECTION ONTO ADAPTIVE LOW-DIMENSIONAL SUBSPACES
|
| 124 |
+
|
| 125 |
+
The local linear structure of a BF-CNN facilitates analysis of its functional capabilities via the singular value decomposition (SVD). For a given input $y$ , we compute the SVD of the Jacobian matrix: $\begin{array} { r } { A _ { y } = U S V ^ { T } } \end{array}$ , with $U$ and $V$ orthogonal matrices, and $S$ a diagonal matrix. We can decompose the effect of the network on its input in terms of the left singular vectors $\{ U _ { 1 } , U _ { 2 } \ldots , U _ { N } \}$ (columns of $U _ { . }$ ), the singular values $\lbrace s _ { 1 } , s _ { 2 } \ldots , s _ { N } \rbrace$ (diagonal elements of $S$ ), and the right singular vectors $\{ V _ { 1 } , V _ { 2 } , \ldots V _ { N } \}$ (columns of $V$ ):
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
f _ { \mathrm { B F } } ( y ) = A _ { y } y = U S V ^ { T } y = \sum _ { i = 1 } ^ { N } s _ { i } ( V _ { i } ^ { T } y ) U _ { i } .
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
The output is a linear combination of the left singular vectors, each weighted by the projection of the input onto the corresponding right singular vector, and scaled by the corresponding singular value.
|
| 132 |
+
|
| 133 |
+
Analyzing the SVD of a BF-CNN on a set of ten natural images reveals that most singular values are very close to zero (Figure 5a). The network is thus discarding all but a very low-dimensional portion of the input image. We also observe that the left and right singular vectors corresponding to the singular values with non-negligible amplitudes are approximately the same (Figure 5b). This means that the Jacobian is (approximately) symmetric, and we can interpret the action of the network as projecting the noisy signal onto a low-dimensional subspace, as is done in wavelet thresholding schemes. This is confirmed by visualizing the singular vectors as images (Figure 6). The singular vectors corresponding to non-negligible singular values are seen to capture features of the input image; those corresponding to near-zero singular values are unstructured. The BF-CNN therefore implements an approximate projection onto an adaptive signal subspace that preserves image structure, while suppressing the noise.
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 7: Signal subspace properties. Left: Signal subspace, computed from Jacobian of a BF-CNN evaluated at a particular noise level, contains the clean image. Specifically, the fraction of squared $\ell _ { 2 }$ norm preserved by projection onto the subspace is nearly one as $\sigma$ grows from 10 to 100 (relative to the image pixels, which lie in the range [0, 255]). Results are averaged over 50 example clean images. Right: Signal subspaces at different noise levels are nested. The subspace axes for a higher noise level lie largely within the subspace obtained for the lowest noise level $\sigma = 1 0$ ), as measured by the sum of squares of their projected norms. Results are shown for 10 example clean images.
|
| 137 |
+
|
| 138 |
+
We can define an "effective dimensionality" of the signal subspace as $d : = \textstyle \sum _ { i = 1 } ^ { N } s _ { i } ^ { 2 }$ , the amount of variance captured by applying the linear map to an $N$ -dimensional Gaussian noise vector with variance $\sigma ^ { 2 }$ , normalized by the noise variance. The remaining variance equals
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
E _ { n } | | A _ { y } n | | ^ { 2 } = E _ { n } | | U _ { y } S _ { y } V _ { y } ^ { T } n | | ^ { 2 } = E _ { n } | | S _ { y } n | | ^ { 2 } = E _ { n } \sum _ { i = 1 } ^ { N } s _ { i } ^ { 2 } n _ { i } ^ { 2 } = \sum _ { i = 1 } ^ { N } s _ { i } ^ { 2 } E _ { n } ( n _ { i } ^ { 2 } ) \approx \sigma ^ { 2 } \sum _ { i = 1 } ^ { N } s _ { i } ^ { 2 } ,
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
$E _ { n }$ $n$ $\begin{array} { r } { d = E _ { n } \| \boldsymbol { A } _ { y } n \| ^ { 2 } / \sigma ^ { 2 } = \sum _ { i = 1 } ^ { N } s _ { i } ^ { 2 } . } \end{array}$
|
| 145 |
+
|
| 146 |
+
When we examine the preserved signal subspace, we find that the clean image lies almost completely within it. For inputs of the form $y : = x + n$ (where $x$ is the clean image and $n$ the noise), we find that the subspace spanned by the singular vectors up to dimension $d$ contains $x$ almost entirely, in the sense that projecting $x$ onto the subspace preserves most of its energy. This holds for the whole range of noise levels over which the network is trained (Figure 7).
|
| 147 |
+
|
| 148 |
+
We also find that for any given clean image, the effective dimensionality of the signal subspace $( d )$ decreases systematically with noise level (Figure 5c). At lower noise levels the network detects a richer set of image features, and constructs a larger signal subspace to capture and preserve them. Empirically, we found that (on average) $d$ is approximately proportional to $\frac { 1 } { \sigma }$ (see dashed line in Figure 5c). These signal subspaces are nested: the subspaces corresponding to lower noise levels contain more than $9 5 \%$ of the subspace axes corresponding to higher noise levels (Figure 7).
|
| 149 |
+
|
| 150 |
+
Finally, we note that this behavior of the signal subspace dimensionality, combined with the fact that it contains the clean image, explains the observed denoising performance across different noise levels (Figure 3). Specifically, if we assume $d \approx \alpha / \sigma$ , the mean squared error is proportional to $\sigma$ :
|
| 151 |
+
|
| 152 |
+
$$
|
| 153 |
+
\begin{array} { r l } & { \mathrm { M S E } = E _ { n } \vert \vert A _ { y } ( x + n ) - x \vert \vert ^ { 2 } } \\ & { ~ \approx E _ { n } \vert \vert A _ { y } n \vert \vert ^ { 2 } } \\ & { ~ \approx \sigma ^ { 2 } d } \\ & { ~ \approx \alpha \sigma } \end{array}
|
| 154 |
+
$$
|
| 155 |
+
|
| 156 |
+
Note that this result runs contrary to the intuitive expectation that MSE should be proportional to the noise variance, which would be the case if the denoiser operated by projecting onto a fixed subspace. The scaling of MSE with the square root of the noise variance implies that the PSNR of the denoised image should be a linear function of the input PSNR, with a slope of $1 / 2$ , consistent with the empirical results shown in Figure 3. Note that this behavior holds even when the networks are trained only on modest levels of noise (e.g., $\sigma \in [ 0 , 1 0 ] \rangle$ .
|
| 157 |
+
|
| 158 |
+
# 7 DISCUSSION
|
| 159 |
+
|
| 160 |
+
In this work, we show that removing constant terms from CNN architectures ensures strong generalization across noise levels, and also provides interpretability of the denoising method via linear-algebra techniques. We provide insights into the relationship between bias and generalization through a set of observations. Theoretically, we argue that if the denoising network operates by projecting the noisy observation onto a linear space of “clean” images, then that space should include all rescalings of those images, and thus, the origin. This property can be guaranteed by eliminating bias from the network. Empirically, in networks that allow bias, the net bias of the trained network is quite small within the training range. However, outside the training range the net bias grows dramatically resulting in poor performance, which suggests that the bias may be the cause of the failure to generalize. In addition, when we remove bias from the architecture, we preserve performance within the training range, but achieve near-perfect generalization, even to noise levels more than $1 0 \mathrm { x }$ those in the training range. These observations do not fully elucidate how our network achieves its remarkable generalization- only that bias prevents that generalization, and its removal allows it.
|
| 161 |
+
|
| 162 |
+
It is of interest to examine whether bias removal can facilitate generalization in noise distributions beyond Gaussian, as well as other image-processing tasks, such as image restoration and image compression. We have trained bias-free networks on uniform noise and found that they generalize outside the training range. In fact, bias-free networks trained for Gaussian noise generalize well when tested on uniform noise (Figures 18 and 19). In addition, we have applied our methodology to image restoration (simultaneous deblurring and denoising). Preliminary results indicate that bias-free networks generalize across noise levels for a fixed blur level, whereas networks with bias do not (Figure 20). An interesting question for future research is whether it is possible to achieve generalization across blur levels. Our initial results indicate that removing bias is not sufficient to achieve this.
|
| 163 |
+
|
| 164 |
+
Finally, our linear-algebraic analysis uncovers interesting aspects of the denoising map, but these interpretations are very local: small changes in the input image change the activation patterns of the network, resulting in a change in the corresponding linear mapping. Extending the analysis to reveal global characteristics of the neural-network functionality is a challenging direction for future research.
|
| 165 |
+
|
| 166 |
+
# ACKNOWLEDGEMENTS
|
| 167 |
+
|
| 168 |
+
This work was partially supported by the Howard Hughes Medical Institute (HHMI).
|
| 169 |
+
|
| 170 |
+
# REFERENCES
|
| 171 |
+
|
| 172 |
+
S Grace Chang, Bin Yu, and Martin Vetterli. Adaptive wavelet thresholding for image denoising and compression. IEEE Trans. Image Processing, 9(9):1532–1546, 2000.
|
| 173 |
+
|
| 174 |
+
Yunjin Chen and Thomas Pock. Trainable nonlinear reaction diffusion: A flexible framework for fast and effective image restoration. IEEE Trans. Patt. Analysis and Machine Intelligence, 39(6): 1256–1272, 2017.
|
| 175 |
+
|
| 176 |
+
Sungjoon Choi, John Isidoro, Pascal Getreuer, and Peyman Milanfar. Fast, trainable, multiscale denoising. In 2018 25th IEEE International Conference on Image Processing (ICIP), pp. 963–967. IEEE, 2018.
|
| 177 |
+
|
| 178 |
+
Kostadin Dabov, Alessandro Foi, Vladimir Katkovnik, and Karen Egiazarian. Image denoising with block-matching and 3d filtering. In Image Processing: Algorithms and Systems, Neural Networks, and Machine Learning, volume 6064, pp. 606414. International Society for Optics and Photonics, 2006.
|
| 179 |
+
|
| 180 |
+
D Donoho and I Johnstone. Adapting to unknown smoothness via wavelet shrinkage. J American Stat Assoc, 90(432), December 1995.
|
| 181 |
+
|
| 182 |
+
Michael Elad and Michal Aharon. Image denoising via sparse and redundant representations over learned dictionaries. IEEE Trans. on Image processing, 15(12):3736–3745, 2006.
|
| 183 |
+
|
| 184 |
+
Y Hel-Or and D Shaked. A discriminative approach for wavelet denoising. IEEE Trans. Image Processing, 2008.
|
| 185 |
+
|
| 186 |
+
Gao Huang, Zhuang Liu, Laurens Van Der Maaten, and Kilian Q Weinberger. Densely connected convolutional networks. In Proc. IEEE Conf. Computer Vision and Pattern Recognition, pp. 4700–4708, 2017.
|
| 187 |
+
|
| 188 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 189 |
+
|
| 190 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 191 |
+
|
| 192 |
+
Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. nature, 521(7553):436, 2015.
|
| 193 |
+
|
| 194 |
+
D. Martin, C. Fowlkes, D. Tal, and J. Malik. A database of human segmented natural images and its application to evaluating segmentation algorithms and measuring ecological statistics. In Proc. 8th Int’l Conf. Computer Vision, volume 2, pp. 416–423, July 2001.
|
| 195 |
+
|
| 196 |
+
Peyman Milanfar. A tour of modern image filtering: New insights and methods, both practical and theoretical. IEEE signal processing magazine, 30(1):106–128, 2012.
|
| 197 |
+
|
| 198 |
+
Grégoire Montavon, Sebastian Lapuschkin, Alexander Binder, Wojciech Samek, and Klaus-Robert Müller. Explaining nonlinear classification decisions with deep taylor decomposition. Pattern Rec., 65:211–222, 2017.
|
| 199 |
+
|
| 200 |
+
M Raphan and E P Simoncelli. Optimal denoising in redundant representations. IEEE Trans Image Processing, 17(8):1342–1352, Aug 2008. doi: 10.1109/TIP.2008.925392.
|
| 201 |
+
|
| 202 |
+
Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computerassisted intervention, pp. 234–241. Springer, 2015.
|
| 203 |
+
|
| 204 |
+
Uwe Schmidt and Stefan Roth. Shrinkage fields for effective image restoration. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2774–2781, 2014.
|
| 205 |
+
|
| 206 |
+
E P Simoncelli and E H Adelson. Noise removal via Bayesian wavelet coring. In Proc 3rd IEEE Int’l Conf on Image Proc, volume I, pp. 379–382, Lausanne, Sep 16-19 1996. IEEE Sig Proc Society. doi: 10.1109/ICIP.1996.559512.
|
| 207 |
+
|
| 208 |
+
Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. arXiv preprint arXiv:1312.6034, 2013.
|
| 209 |
+
|
| 210 |
+
Carlo Tomasi and Roberto Manduchi. Bilateral filtering for gray and color images. In ICCV, volume 98, 1998.
|
| 211 |
+
|
| 212 |
+
Zhou Wang, Alan C Bovik, Hamid R Sheikh, Eero P Simoncelli, et al. Image quality assessment: from error visibility to structural similarity. IEEE Trans. Image Processing, 13(4):600–612, 2004.
|
| 213 |
+
|
| 214 |
+
Norbert Wiener. Extrapolation, interpolation, and smoothing of stationary time series: with engineering applications. Technology Press, 1950.
|
| 215 |
+
|
| 216 |
+
Kai Zhang, Wangmeng Zuo, Yunjin Chen, Deyu Meng, and Lei Zhang. Beyond a gaussian denoiser: Residual learning of deep CNN for image denoising. IEEE Trans. Image Processing, 26(7): 3142–3155, 2017.
|
| 217 |
+
|
| 218 |
+
Xiaoshuai Zhang, Yiping Lu, Jiaying Liu, and Bin Dong. Dynamically unfolding recurrent restorer: A moving endpoint control method for image restoration. arXiv preprint arXiv:1805.07709, 2018a.
|
| 219 |
+
|
| 220 |
+
Yulun Zhang, Yapeng Tian, Yu Kong, Bineng Zhong, and Yun Fu. Residual dense network for image restoration. CoRR, abs/1812.10477, 2018b. URL http://arxiv.org/abs/1812.10477.
|
| 221 |
+
|
| 222 |
+
# A DESCRIPTION OF DENOISING ARCHITECTURES
|
| 223 |
+
|
| 224 |
+
In this section we describe the denoising architectures used for our computational experiments in more detail.
|
| 225 |
+
|
| 226 |
+
# A.1 DNCNN
|
| 227 |
+
|
| 228 |
+
We implement BF-DnCNN based on the architecture of the Denoising CNN (DnCNN) (Zhang et al., 2017). DnCNN consists of 20 convolutional layers, each consisting of $3 \times 3$ filters and 64 channels, batch normalization (Ioffe & Szegedy, 2015), and a ReLU nonlinearity. It has a skip connection from the initial layer to the final layer, which has no nonlinear units. To construct a bias-free DnCNN (BF-DnCNN) we remove all sources of additive bias, including the mean parameter of the batch-normalization in every layer (note however that the scaling parameter is preserved).
|
| 229 |
+
|
| 230 |
+
# A.2 RECURRENT CNN
|
| 231 |
+
|
| 232 |
+
Inspired by Zhang et al. (2018a), we consider a recurrent framework that produces a denoised image estimate of the form $\hat { x } _ { t } = f ( \hat { x } _ { t - 1 } , y _ { \mathrm { n o i s y } } )$ , at time $t$ where $f$ is a neural network. We use a 5-layer fully convolutional network with $3 \times 3$ filters in all layers and 64 channels in each intermediate layer to implement $f$ . We initialize the denoised estimate as the noisy image, i.e ${ \hat { x } } _ { 0 } : = y _ { \mathrm { n o i s y } }$ . For the version of the network with net bias, we add trainable additive constants to every filter in all but the last layer. During training, we run the recurrence for a maximum of $T$ times, sampling $T$ uniformly at random from $\{ 1 , 2 , 3 , 4 \}$ for each mini-batch. At test time we fix $T = 4$ .
|
| 233 |
+
|
| 234 |
+
# A.3 UNET
|
| 235 |
+
|
| 236 |
+
Our UNet model (Ronneberger et al., 2015) has the following layers:
|
| 237 |
+
|
| 238 |
+
1. conv1 - Takes in input image and maps to 32 channels with $5 \times 5$ convolutional kernels.
|
| 239 |
+
2. conv2 - Input: 32 channels. Output: 32 channels. $3 \times 3$ convolutional kernels.
|
| 240 |
+
3. conv3 - Input: 32 channels. Output: 64 channels. $3 \times 3$ convolutional kernels with stride 2.
|
| 241 |
+
4. conv4- Input: 64 channels. Output: 64 channels. $3 \times 3$ convolutional kernels.
|
| 242 |
+
5. conv5- Input: 64 channels. Output: 64 channels. $3 \times 3$ convolutional kernels with dilation factor of 2.
|
| 243 |
+
6. conv6- Input: 64 channels. Output: 64 channels. $3 \times 3$ convolutional kernels with dilation factor of 4.
|
| 244 |
+
7. conv7- Transpose Convolution layer. Input: 64 channels. Output: 64 channels. $4 \times 4$ filters with stride 2.
|
| 245 |
+
8. conv8- Input: 96 channels. Output: 64 channels. $3 \times 3$ convolutional kernels. The input to this layer is the concatenation of the outputs of layer conv7 and conv2.
|
| 246 |
+
9. conv9- Input: 32 channels. Output: 1 channels. $5 \times 5$ convolutional kernels.
|
| 247 |
+
|
| 248 |
+
The structure is the same as in Zhang et al. (2018a), but without recurrence. For the version with bias, we add trainable additive constants to all the layers other than conv9. This configuration of UNet assumes even width and height, so we remove one row or column from images in with odd height or width.
|
| 249 |
+
|
| 250 |
+
# A.4 SIMPLIFIED DENSENET
|
| 251 |
+
|
| 252 |
+
Our simplified version of the DenseNet architecture (Huang et al., 2017) has 4 blocks in total. Each block is a fully convolutional 5-layer CNN with $3 \times 3$ filters and 64 channels in the intermediate layers with ReLU nonlinearity. The first three blocks have an output layer with 64 channels while the last block has an output layer with only one channel. The output of the $i ^ { t h }$ block is concatenated with the input noisy image and then fed to the $( i + 1 ) ^ { t h }$ block, so the last three blocks have 65 input channels. In the version of the network with bias, we add trainable additive parameters to all the layers except for the last layer in the final block.
|
| 253 |
+
|
| 254 |
+
# B DATASETS AND TRAINING PROCEDURE
|
| 255 |
+
|
| 256 |
+
Our experiments are carried out on $1 8 0 \times 1 8 0$ natural images from the Berkeley Segmentation Dataset (Martin et al., 2001). We use a training set of 400 images. The training set is augmented via downsampling, random flips, and random rotations of patches in these images (Zhang et al., 2017). A test set containing 68 images is used for evaluation. We train the DnCNN and it’s bias free model on patches of size $5 0 \times 5 0$ , which yields a total of 541,600 clean training patches. For the remaining architectures, we use patches of size $1 2 8 \times 1 2 8$ for a total of 22,400 training patches.
|
| 257 |
+
|
| 258 |
+
We train DnCNN and its bias-free counterpart using the Adam Optimizer (Kingma & Ba, 2014) over 70 epochs with an initial learning rate of $\mathrm { 1 0 ^ { - 3 } }$ and a decay factor of 0.5 at the $\mathbf { \bar { 5 } 0 } ^ { t h }$ and $6 0 ^ { t h }$ epochs, with no early stopping. We train the other models using the Adam optimizer with an initial learning rate of $1 0 ^ { - 3 }$ and train for 50 epochs with a learning rate schedule which decreases by a factor of 0.25 if the validation PSNR decreases from one epoch to the next. We use early stopping and select the model with the best validation PSNR.
|
| 259 |
+
|
| 260 |
+
# C ADDITIONAL RESULTS
|
| 261 |
+
|
| 262 |
+
In this section we report additional results of our computational experiments:
|
| 263 |
+
|
| 264 |
+
• Figure 8 shows the first-order analysis of the residual of the different architectures described in Section A, except for DnCNN which is shown in Figure 1.
|
| 265 |
+
• Figures 9 and 10 visualize the linear and net bias terms in the first-order decomposition of an example image at different noise levels.
|
| 266 |
+
• Figure 11 shows the PSNR results for the experiments described in Section 5.
|
| 267 |
+
• Figure 12 shows the SSIM results for the experiments described in Section 5.
|
| 268 |
+
• Figures 13, 14 and 15 show the equivalent filters at several pixels of two example images for different architectures (see Section 6.1).
|
| 269 |
+
• Figure 16 shows the singular vectors of the Jacobian of different BF-CNNs (see Section 6.2). Figure 17 shows the singular values of the Jacobian of different BF-CNNs (see Section 6.2).
|
| 270 |
+
Figure 18 and 19 shows that networks trained on noise samples drawn from Gaussian distribution with 0 mean generalizes to noise drawn from uniform distribution with 0 mean during test time. Experiments follow the procedure described in Section 5 except that the networks are evaluated on a different noise distribution during the test time.
|
| 271 |
+
Figure 20 shows the application of BF-CNN and CNN to the task of image restoration, where the image is corrupted with both noise and blur at the same time. We show that BF-CNNs can generalize outside the training range for noise levels for a fixed blur level, but do not outperform CNN when generalizing to unseen blur levels.
|
| 272 |
+
|
| 273 |
+

|
| 274 |
+
Figure 8: First-order analysis of the residual of Recurrent-CNN (Section A.2), UNet (Section A.3) and DenseNet (Section A.4) as a function of noise level. The plots show the magnitudes of the residual and the net bias averaged over 68 images in Set68 test set of Berkeley Segmentation Dataset (Martin et al., 2001) for networks trained over different training ranges. The range of noises used for training is highlighted in gray. (left) When the network is trained over the full range of noise levels $\mathit { \sigma } _ { \mathcal { \sigma } } \in [ 0 , 1 0 0 ] $ ) the net bias is small, growing slightly as the noise increases. (middle and right) When the network is trained over the a smaller range $( \sigma \in [ 0 , 5 5 ]$ and $\sigma \in [ 0 , 3 0 ] )$ , the net bias grows explosively for noise levels outside the training range. This coincides with the dramatic drop in performance due to overfitting, reflected in the difference between the residual and the true noise.
|
| 275 |
+
|
| 276 |
+

|
| 277 |
+
Figure 9: Visualization of the decomposition of output of DnCNN trained for noise range [0, 55] into linear part and net bias. The noise level $\sigma = 7 0$ (highlighted by $^ *$ ) is outside the training range. Over the training range, the net bias is small, and the linear part is responsible for most of the denoising effort. However, when the network is evaluated out of the training range, the contribution of the bias increases dramatically, which coincides with a significant drop in denoising performance.
|
| 278 |
+
|
| 279 |
+

|
| 280 |
+
Figure 10: Visualization of the decomposition of output of Recurrent-CNN (Section A.2, UNet (Section A.3) and DenseNet (Section A.4) trained for noise range [0, 55] into linear part and net bias. The noise level $\sigma = 9 0$ (highlighted by $^ *$ ) is outside the training range. Over the training range, the net bias is small, and the linear part is responsible for most of the denoising effort. However, when the network is evaluated out of the training range, the contribution of the bias increases dramatically, which coincides with a significant drop in denoising performance.
|
| 281 |
+
|
| 282 |
+

|
| 283 |
+
Figure 11: Comparisons of architectures with (red curves) and without (blue curves) a net bias for the experimental design described in Section 5. The performance is quantified by the PSNR of the denoised image as a function of the input PSNR of the noisy image. All the architectures with bias perform poorly out of their training range, whereas the bias-free versions all achieve excellent generalization across noise levels. (a) Deep Convolutional Neural Network, DnCNN (Zhang et al., 2017). (b) Recurrent architecture inspired by DURR (Zhang et al., 2018a). (c) Multiscale architecture inspired by the UNet (Ronneberger et al., 2015). (d) Architecture with multiple skip connections inspired by the DenseNet (Huang et al., 2017).
|
| 284 |
+
|
| 285 |
+

|
| 286 |
+
Figure 12: Comparisons of architectures with (red curves) and without (blue curves) a net bias for the experimental design described in Section 5. The performance is quantified by the SSIM of the denoised image as a function of the input SSIM of the noisy image. All the architectures with bias perform poorly out of their training range, whereas the bias-free versions all achieve excellent generalization across noise levels. (a) Deep Convolutional Neural Network, DnCNN (Zhang et al., 2017). (b) Recurrent architecture inspired by DURR (Zhang et al., 2018a). (c) Multiscale architecture inspired by the UNet (Ronneberger et al., 2015). (d) Architecture with multiple skip connections inspired by the DenseNet (Huang et al., 2017).
|
| 287 |
+
|
| 288 |
+

|
| 289 |
+
Figure 13: Visualization of the linear weighting functions (rows of $A _ { y }$ ) of Bias-Free Recurrent-CNN (top 2 rows) (Section A.2), Bias-Free UNet (next 2 rows) (Section A.3) and Bias-Free DenseNet (bottom 2 rows) (Section A.4) for three example pixels of a noisy input image (left). The next image is the denoised output. The three images on the right show the linear weighting functions corresponding to each of the indicated pixels (red squares). All weighting functions sum to one, and thus compute a local average (although some weights are negative, indicated in red). Their shapes vary substantially, and are adapted to the underlying image content. Each row corresponds to a noisy input with increasing $\sigma$ and the filters adapt by averaging over a larger region.
|
| 290 |
+
|
| 291 |
+

|
| 292 |
+
Figure 14: Visualization of the linear weighting functions (rows of $A _ { y . }$ ) of a BF-DnCNN for three example pixels of a noisy input image (left). The next image is the denoised output. The three images on the right show the linear weighting functions corresponding to each of the indicated pixels (red squares). All weighting functions sum to one, and thus compute a local average (although some weights are negative, indicated in red). Their shapes vary substantially, and are adapted to the underlying image content. Each row corresponds to a noisy input with increasing $\sigma$ and the filters adapt by averaging over a larger region.
|
| 293 |
+
|
| 294 |
+

|
| 295 |
+
Figure 15: Visualization of the linear weighting functions (rows of $A _ { y }$ ) of Bias-Free Recurrent-CNN (top 2 rows) (Section A.2), Bias-Free UNet (next 2 rows) (Section A.3) and Bias-Free DenseNet (bottom 2 rows) (Section A.4) for three example pixels of a noisy input image (left). The next image is the denoised output. The three images on the right show the linear weighting functions corresponding to each of the indicated pixels (red squares). All weighting functions sum to one, and thus compute a local average (although some weights are negative, indicated in red). Their shapes vary substantially, and are adapted to the underlying image content. Each row corresponds to a noisy input with increasing $\sigma$ and the filters adapt by averaging over a larger region.
|
| 296 |
+
|
| 297 |
+

|
| 298 |
+
Figure 16: Visualization of left singular vectors of the Jacobian of a BF Recurrent CNN (top 2 rows), BF UNet (next 2 rows) and BF DenseNet (bottom 2 rows) evaluated on three different images, corrupted by noise with standard deviation $\sigma = 2 5$ . The left column shows original (clean) images. The next three columns show singular vectors corresponding to non-negligible singular values. The vectors capture features from the clean image. The last three columns on the right show singular vectors corresponding to singular values that are almost equal to zero. These vectors are noisy and unstructured.
|
| 299 |
+
|
| 300 |
+

|
| 301 |
+
Figure 17: Analysis of the SVD of the Jacobian of BF-CNN for ten natural images, corrupted by noise of standard deviation $\sigma = 5 0$ . For all images, a large proportion of the singular values are near zero, indicating (approximately) a projection onto a subspace (the signal subspace). (a) Recurrent architecture inspired by DURR (Zhang et al., 2018a). (b) Multiscale architecture inspired by the UNet (Ronneberger et al., 2015). (c) Architecture with multiple skip connections inspired by the DenseNet (Huang et al., 2017).
|
| 302 |
+
|
| 303 |
+

|
| 304 |
+
Figure 18: Comparison of the performance of a CNN and a BF-CNN with the same architecture for the experimental design described in Section 5. The networks are trained using i.i.d. Gaussian noise but evaluated on noise drawn i.i.d. from a uniform distribution with mean 0. The performance is quantified by the PSNR of the denoised image as a function of the input PSNR of the noisy image. All the architectures with bias perform poorly out of their training range, whereas the bias-free versions all achieve excellent generalization across noise levels, i.e. they are able to generalize across the two different noise distributions. The CNN used for this example is DnCNN (Zhang et al., 2017); using alternative architectures yields similar results (see Figures 19).
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
Figure 19: Comparisons of architectures with (red curves) and without (blue curves) a net bias for the experimental design described in Section 5. The networks are trained using i.i.d. Gaussian noise but evaluated on noise drawn i.i.d. from a uniform distribution with mean 0. The performance is quantified by the PSNR of the denoised image as a function of the input PSNR of the noisy image. All the architectures with bias perform poorly out of their training range, whereas the bias-free versions all achieve excellent generalization across noise levels, i.e. they are able to generalize across the two different noise distributions. (a) Deep Convolutional Neural Network, DnCNN (Zhang et al., 2017). (b) Recurrent architecture inspired by DURR (Zhang et al., 2018a). (c) Multiscale architecture inspired by the UNet (Ronneberger et al., 2015). (d) Architecture with multiple skip connections inspired by the DenseNet (Huang et al., 2017).
|
| 308 |
+
|
| 309 |
+

|
| 310 |
+
Figure 20: Comparison of the performance of DnCNN and a corresponding BF-CNN for image restoration. Training is carried out on data corrupted with Gaussian noise $\sigma _ { \mathrm { n o i s e } } \in [ 0 , 5 5 ]$ and Gaussian blur $\sigma _ { \mathrm { b l u r } } \in [ 0 , 4 ]$ . Performance is measured on test data for inside and outside the training ranges. Left: The difference in performance measured in $\Delta \mathrm { P S N R } = \mathrm { P S N R } _ { \mathrm { B F - C N N } } - \mathrm { P S N R } _ { \mathrm { D n C N N } }$ . The training region is illustrated by the rectangular boundary. Bias-free network generalizes across noise levels for each fixed blur levels, whereas DnCNN does not. However, BF-CNN does not generalize across blur levels. Right: A horizontal slice of the left plot for a fixed blur level of $\sigma _ { \mathrm { { b l u r } } } = 2 $ . BF-CNN generalizes robustly beyond the training range, while the performance of DnCNN degrades significantly.
|
md/train/HJrDIpiee/HJrDIpiee.md
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# INVESTIGATING RECURRENCE AND ELIGIBILITY TRACES IN DEEP Q-NETWORKS
|
| 2 |
+
|
| 3 |
+
Jean Harb, Doina Precup
|
| 4 |
+
School of Computer Science
|
| 5 |
+
McGill University
|
| 6 |
+
Montreal, QC, Canada
|
| 7 |
+
{jharb,dprecup}@cs.mcgill.ca
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Eligibility traces in reinforcement learning are used as a bias-variance trade-off and can often speed up training time by propagating knowledge back over timesteps in a single update. We investigate the use of eligibility traces in combination with recurrent networks in the Atari domain. We illustrate the benefits of both recurrent nets and eligibility traces in some Atari games, and highlight also the importance of the optimization used in the training.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Deep reinforcement learning has had many practical successes in game playing (Mnih et al. (2015),Silver et al. (2016)) and robotics (Levine & Abbeel (2014)). Our interest is in further exploring these algorithms in the context of environments with sparse rewards and partial observability. To this end, we investigate the use of two methods that are known to mitigate these problems: recurrent networks, which provide a form of memory summarizing past experiences, and eligibility traces, which allow information to propagate over multiple time steps. Eligibility traces have been shown empirically to provide faster learning (Sutton & Barto (2017), in preparation) but their use with deep RL has been limited so far (van Seijen & Sutton (2014), Hausknecht & Stone (2015)). We provide experiments in the Atari domain showing that eligibility traces boost the performance of Deep RL. We also demonstrate a surprisingly strong effect of the optimization method on the performance of the recurrent networks.
|
| 16 |
+
|
| 17 |
+
The paper is structured as follows. In Sec. 2 we provide background and notation needed for the paper. Sec. 3 describes the algorithms we use. In sec. 4 we present and discuss our experimental results. In Sec. 5 we conclude and present avenues for future work.
|
| 18 |
+
|
| 19 |
+
# 2 BACKGROUND
|
| 20 |
+
|
| 21 |
+
A Markov Decision Process (MDP) consists of a tuple $\langle S , \mathcal { A } , r , \mathcal { P } , \gamma \rangle$ , where $s$ is the set of states, $\mathcal { A }$ is the set of actions, $r : S \times \mathcal { A } \mapsto \mathbb { R }$ is the reward function, $\mathcal { P } ( s ^ { \prime } | s , a )$ is the transition function (giving the next state distribution, conditioned on the current state and action), and $\gamma \in [ 0 , 1 )$ is the discount factor. Reinforcement learning (RL) (Sutton $\&$ Barto, 1998) is a framework for solving unknown MDPs, which means finding a good (or optimal) way of behaving, also called a policy. RL works by obtaining transitions from the envithat maximizes the expected return, given by $\mathbb { E } \left[ \sum _ { t = 0 } ^ { \infty } \gamma ^ { t } r _ { t } \right]$ ing them, in order to compute a policy.
|
| 22 |
+
|
| 23 |
+
The state-value function for a policy $\pi : { \mathcal { S } } \times { \mathcal { A } } \to [ 0 , 1 ] , V ^ { \pi } ( s )$ , is defined as the expected return obtained by starting at state $s$ and picking actions according to $\pi$ . State-action values $Q ( s , a )$ are similar to state values, but conditioned also on the initial action $a$ . A policy can be derived from the $Q$ values by picking always the action with the best estimated value at any state.
|
| 24 |
+
|
| 25 |
+
Monte Carlo (MC) and Temporal Difference (TD) are two standard methods for updating the value function from data. In MC, an entire trajectory’s return is used as the target value of the current
|
| 26 |
+
|
| 27 |
+
state.
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
\mathrm { M C } \mathrm { \ e r r o r } = \sum _ { i = 0 } ^ { \infty } \gamma ^ { i } r _ { t + i } - V ( s _ { t } )
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
In TD, the estimate of the next state’s value is used to correct the current state’s estimate:
|
| 34 |
+
|
| 35 |
+
$$
|
| 36 |
+
\mathrm { T D } \mathrm { e r r o r } = r _ { t } + \gamma V ( s _ { t + 1 } ) - V ( s _ { t } )
|
| 37 |
+
$$
|
| 38 |
+
|
| 39 |
+
Q-learning is an RL algorithm that allows an agent to learn by imagining that it will take the best possible action in the following step:
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\mathrm { T D } \mathrm { e r r o r } = r _ { t } + \gamma \operatorname* { m a x } _ { a ^ { \prime } } Q ( s _ { t + 1 } , a ^ { \prime } ) - Q ( s _ { t } , a _ { t } )
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
This is an instance of off-policy learning, in which the agent gathers data with an exploratory policy, which randomizes the choice of action, but updates its estimates by constructing targets according to a differnet policy (in this case, the policy that is greedy with respect to the current value estimates.
|
| 46 |
+
|
| 47 |
+
# 2.1 ELIGIBILITY TRACES
|
| 48 |
+
|
| 49 |
+
Eligibility traces are a fundamental reinforcement learning mechanism which allows a trade-off between TD and MC. MC methods suffer from high variance, as many trajectories can be taken from any given state and stochasticity is often present in the MDP. TD suffers from high bias, as it updates values based on its own estimates.
|
| 50 |
+
|
| 51 |
+
Using eligibility traces allows one to design algorithms that cover the middle-ground between MC and TD. The central notion for these are $n$ -step returns, which provide a way of calculating the target by using the value estimate for the state which occurs $n$ steps in the future (compared to the current state):
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
R _ { t } ^ { \left( n \right) } = \sum _ { i = 0 } ^ { n - 1 } \gamma ^ { i } r _ { t + i } + \gamma ^ { n } V ( s _ { t + n } ) .
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
When $n$ is 1, the results is the TD target, and taking $n \to \infty$ yields the MC target.
|
| 58 |
+
|
| 59 |
+
Eligibility traces use a geometric weighting of these $n$ -step returns, where the weight of the $k$ -step return is $\lambda$ times the weight of the $k - 1$ -step return. Using a $\lambda = 0$ reduces to using TD, as all $n$ -steps for $n > 1$ have a weight of 0. One of the appealing effects of using eligibility traces is that a single update allows states many steps behind a reward signal to receive credit. This propagates knowledge back at a faster rate, allowing for accelerated learning. Especially in environments where rewards are sparse and/or delayed, eligibility traces can help assign credit to past states and actions. Without traces, seeing a sparse reward will only propagate the value back by one step, which in turn needs to be sampled to send the value back a second step, and so on.
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
R _ { t } ^ { \lambda } = ( 1 - \lambda ) \sum _ { i = 0 } ^ { \infty } \lambda ^ { i } R _ { t } ^ { ( i ) } = ( 1 - \lambda ) \sum _ { i = 1 } ^ { \infty } \lambda ^ { i - 1 } \sum _ { j = 0 } ^ { i - 1 } \gamma ^ { j } r _ { j } + \gamma ^ { i + 1 } V ( s _ { t + i } )
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
This way of viewing eligibility traces is called the forward view, as states are looking ahead at the rewards received in the future. The forward view is rarely used, as it requires a state to wait for the future to unfold before calculating an update, and requires memory to store the experience. There is an equivalent view called the backward view, which allows us to calculate updates for every previous state as we take a single action. This requires no memory and lets us perform updates without having to wait for the future. However, this view has had limited success in the neural network setting as it requires using a trace on each neuron of the network, which tend to be dense and heavily used at each step resulting in noisy signals. For this reason, eligibility traces aren’t heavily used when using deep learning, despite their potential benefits.
|
| 66 |
+
|
| 67 |
+
# 2.1.1 Q(λ)
|
| 68 |
+
|
| 69 |
+
$\mathbf { Q } ( \lambda )$ is a variant of Q-learning where eligibility traces are used to calculate the TD error. As mentioned previously, the backwards view of traces is traditionally used.
|
| 70 |
+
|
| 71 |
+
A few versions of $\mathbf { Q } ( \lambda )$ exist, but the most used one is Watkins’s $\mathbf { Q } ( \lambda )$ . As Q-learning is off-policy, the sequence of actions used in the past trajectory used to calculate the trace might be different from the actions that the current policy might take. In that case, one should not be using the trajectory past the point where actions differ. To handle such a case, Watkins’s $\mathbf { Q } ( \lambda )$ sets the trace to 0 if the action that the current policy would select is different from the one used in the past.
|
| 72 |
+
|
| 73 |
+
# 2.2 DEEP Q-NETWORKS
|
| 74 |
+
|
| 75 |
+
Mnih et al. (2015) introduced deep Q-networks (DQN), one of the first successful reinforcement learning algorithms that use deep learning for function approximation in a way general enough which is applicable to a variety of environments. Applying it to a set of Atari games, they used a convolutional neural network (CNN) which took as input the last four frames of the game, and output Q-values for each possible action.
|
| 76 |
+
|
| 77 |
+
Equation 6 shows the DQN cost function, where we are optimizing the $\theta$ parameters. The $\theta ^ { - }$ parameters represent frozen Q-value weights which are update at a chosen frequency.
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\mathcal { L } ( s _ { t } , a _ { t } | \theta ) = ( r _ { t } + \gamma \operatorname* { m a x } _ { a ^ { \prime } } Q ( s _ { t + 1 } , a ^ { \prime } | \theta ^ { - } ) - Q ( s _ { t } , a _ { t } | \theta ) ) ^ { 2 }
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
# 2.2.1 DEEP RECURRENT Q-NETWORKS
|
| 84 |
+
|
| 85 |
+
As introduced in Hausknecht & Stone (2015), deep recurrent Q-networks (DRQN) are a modification on DQN, where single frames are passed through a CNN, which generates a feature vector that is then fed to an RNN which finally outputs Q-values. This architecture gives the agent a memory, allowing it to learn long-term temporal effects and handle partial observability, which is the case in many environments. The authors showed that randomly blanking out frames was difficult to overcome for DQN, but that DRQN learned to handle without issue.
|
| 86 |
+
|
| 87 |
+
To train DRQN, they proposed two variants of experience replay. The first was to sample entire trajectories and run the RNN from end to end. However this is very computationally demanding as some trajectories can be over 10000 steps long. The second alternative was to sample subtrajectories instead of single transitions. This is required as the RNN needs to fill its hidden state and to allow it to understand the temporal aspect of the data.
|
| 88 |
+
|
| 89 |
+
# 2.3 OPTIMIZERS
|
| 90 |
+
|
| 91 |
+
Stochastic gradient descent (SGD) is generally the algorithm used to optimize neural networks. However, some information is lost during the process as past gradients might signal that a weight drastically needs to change, or that it is oscillating, requiring a decrease in learning rate. Adaptive SGD algorithms have been built to use this information.
|
| 92 |
+
|
| 93 |
+
RMSprop (Tieleman & Hinton (2012)), uses a geometric averaging over gradients squared, and divides the current gradient by its square root. To perform RMSprop, first we calculate the averaging as $g = \beta g + ( 1 - \bar { \beta } ) \nabla { \theta } ^ { 2 }$ and then update the parameters $\begin{array} { r } { \theta \gets \dot { \theta } + \alpha \frac { \nabla \theta } { \sqrt { g + \epsilon } } } \end{array}$ .
|
| 94 |
+
|
| 95 |
+
DQN (Graves (2013)) introduced a variant of RMSprop where the gradient is instead divided by the standard deviation of the running average. First we calculate the running averages $m = \beta m + ( 1 -$ $\beta ) \nabla \theta$ and $g = \beta g + ( 1 - \beta ) \nabla \theta ^ { 2 }$ , and then update the parameters using $\begin{array} { r } { \theta \theta + \alpha \frac { \nabla \theta } { \sqrt { g - m ^ { 2 } + \epsilon } } } \end{array}$ . In the rest of the paper, when mentioning RMSprop, we’ll be referring to this version.
|
| 96 |
+
|
| 97 |
+
Finally, Kingma & Ba (2014) introduced Adam, which is essentially RMSprop coupled with Nesterov momentum, along with the running averages being corrected for bias. We have a term for the rate of momentum of each of the running averages. To calculate the update with Adam, we start with the updating the averages $m = \beta _ { 1 } m + ( 1 - \beta _ { 1 } ) \nabla \theta$ , $v = \beta _ { 2 } v + ( 1 - \dot { \beta } _ { 2 } ) \nabla \theta ^ { 2 }$ , the correct their biases $\hat { m } = m / ( 1 - \beta _ { 1 } ^ { t } )$ , $\hat { v } = v / ( 1 - \beta _ { 2 } ^ { t } )$ and finally calculate the gradient update $\begin{array} { r } { \theta \theta + \alpha \frac { \hat { m } } { \sqrt { \hat { v } + \epsilon } } } \end{array}$ .
|
| 98 |
+
|
| 99 |
+

|
| 100 |
+
Figure 1: This graph illustrates how a sample from experience replay is used in training. We use a number of frames to fill the hidden state of the RNN. Then, for the states used for training, we have the RNN output the Q-values. Finally, we calculate each $n$ -step return and weight them according to $\lambda$ , where the arrows represent the forward view of each trace. All states are passed though the CNN before entering the RNN.
|
| 101 |
+
|
| 102 |
+
# 3 EXPERIMENTAL SETUP
|
| 103 |
+
|
| 104 |
+
As explained, the forward view of eligibility traces can be useful, but is computationally demanding in terms of memory and time. One must store all transitions and apply the neural network to each state in the trajectory. By using DRQN, experience replay is already part of the algorithm, which removes the memory requirement of the traces. Then, by training on sub-trajectories of data, the states must be run through the RNN with all state values as the output, which eliminates the computational cost. Finally, all that’s left to use eligibility traces is simply to calculate the weighted sum of the targets, which is very cheap to do.
|
| 105 |
+
|
| 106 |
+
In this section we analyze the use of eligibility traces when training DRQN and try both RMSprop and Adam as optimizers. We only tested the algorithms on fully observable games as to compare the learning capacities without the unfair advantage of having a memory, as would be the case on partially observable environments.
|
| 107 |
+
|
| 108 |
+
# 3.1 ARCHITECTURE
|
| 109 |
+
|
| 110 |
+
We tested the algorithms on two Atari 2600 games, part of the Arcade Learning Environment (Bellemare et al. (2012)), Pong and Tennis. The architecture used is similar to the one used in Hausknecht & Stone (2015). The frames are converted to gray-scale and re-sized to $8 4 \mathrm { x } 8 4$ . These are then fed to a CNN with the first layer being $3 2 8 \mathrm { x } 8$ filters and a stride of 4, followed by $6 4 4 \mathrm { x } 4$ filters with a stride of 2, then by $6 4 3 \mathrm { x } 3 $ filters with a stride of 1. The output of the CNN is then flattened before being fed to a single dense layer of 512 output neurons, which is finally fed to an LSTM (Hochreiter & Schmidhuber (1997)) with 512 cells. We then have a last linear layer that takes the output of the recurrent layer to output the Q-values. All layers before the LSTM are activated using rectified linear units (ReLU).
|
| 111 |
+
|
| 112 |
+
As mentioned in subsection 2.2.1, we also altered experience replay to sample sub-trajectories. We use backprop through time (BPTT) to train the RNN, but only train on a sub-trajectory of experience. In runtime, the RNN will have had a large sequence of inputs in its hidden state, which can be problematic if always trained with an empty hidden state. Like in Lample & Singh Chaplot (2016), we therefore sample a slightly longer length of trajectory and use the first $m$ states to fill the hidden state. In our experiments, we selected trajectory lengths of 32, where the first 10 states are used as filler and the remaining 22 are used for the traces and TD costs. We used a batch size of 4.
|
| 113 |
+
|
| 114 |
+
All experiments using eligibility traces use $\lambda = 0 . 8$ . Furthermore, we use Watkins’s $\mathbf { Q } ( \lambda )$ . To limit computation costs of using traces, we cut the trace off once it becomes too small. In our experiments, we choose the limit of 0.01, which allows the traces to affect 21 states ahead (when $\lambda = 0 . 8$ ). We calculate the trace for every state in the trajectory, except for a few in the beginning, use to fill in the hidden state of the RNN.
|
| 115 |
+
|
| 116 |
+
When using RMSprop, we used a momentum of 0.95, an epsilon of 0.01 and a learning rate of 0.00025. When using Adam, we used a momentum of gradients of 0.9, a momentum of squared gradients of 0.999, an epsilon of 0.001 and a learning rate of 0.00025.
|
| 117 |
+
|
| 118 |
+
Testing phases are consistent across all models, with the score being the average over each game played during 125000 frames. We also use an $\epsilon$ of 0.05 for action selection.
|
| 119 |
+
|
| 120 |
+
<table><tr><td>Choose k as number of trace steps and m as RNN-filler steps Initialize weights 0, experience replay D 01←θ s↑s0 repeat Initialize RNN hidden state to 0.</td><td></td></tr><tr><td>repeat</td><td>Choose a according to ∈-greedy policy on Q(s,al0)</td></tr><tr><td>Take action a in s, observe s', r</td><td></td></tr><tr><td>Store s,α,r,s'in Experience Replay</td><td></td></tr><tr><td> Sample 4 sub-trajectories of m + k sequential transitions (s,a,r,s') from D</td><td></td></tr><tr><td>r y=</td><td></td></tr><tr><td>r+γmaxQ(s',a|θ-) otherwise a</td><td>s’is terminal,</td></tr><tr><td>foreach transition sampled do</td><td></td></tr><tr><td>入 at = arg maxa(st,a|0), 入t=</td><td></td></tr><tr><td>10 otherwise</td><td></td></tr><tr><td>end for l from O to k -1 do</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td>end</td><td></td></tr><tr><td>Perform gradient descent on</td><td>a(R-Q(s,a|θ))²</td></tr><tr><td>Every 10000 steps 0-←0</td><td>80</td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td>s↑s`</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td>until s'is terminal</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td>until training complete</td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr><tr><td></td><td></td></tr></table>
|
| 121 |
+
|
| 122 |
+
Algorithm 1: Deep Recurrent Q-Networks with forward view eligibility traces on Atari. The eligibility traces are calculated using the $n$ -step return function $R _ { t } ^ { ( n ) }$ for time-step $t$ was described in section 2.1.
|
| 123 |
+
|
| 124 |
+
# 4 EXPERIMENTAL RESULTS
|
| 125 |
+
|
| 126 |
+
We describe experiments in two Atari games: Pong and Tennis. We chose Pong because it permits quick experimentation, and Tennis because it is one of the games that has proven difficult in all published results on Atari.
|
| 127 |
+
|
| 128 |
+
# 4.1 PONG
|
| 129 |
+
|
| 130 |
+
First, we tested an RNN model both with $\lambda = 0$ and $\lambda = 0 . 8$ , trained with RMSprop. Figure 2 shows that the model without a trace $\lambda = 0$ ) learned at the same rate as DQN, while the model with traces $\lambda = 0 . 8$ ) learned substantially faster and with more stability, without exhibiting any epochs with depressed performance. This is probably due to the eligibility traces propagating rewards back by many steps in a single update. In Pong, when the agent hits the ball, it must wait several time-steps before the ball gets either to or past the opponent. Once this happens, the agent must assign the credit of the event back to the time when it hit the ball, and not to the actions performed after the ball had already left. The traces clearly help send this signal back faster.
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 2: Test scores on Pong by training models with RMSprop vs Adam.
|
| 134 |
+
|
| 135 |
+
We then tested the same models but using Adam as the optimizer instead of RMSprop. All models learn much faster with this setting. However, the model with no trace gains significantly more than the model with the trace. Our current intuition is that some hyper-parameters, such as the frozen network’s update frequency, are limiting the rate at which the model can learn. Note also that the DQN model also learns faster with Adam as the optimizer, but remains quite unstable, in comparison with the recurrent net models.
|
| 136 |
+
|
| 137 |
+
Finally, the results in Table 1 show that both using eligibility traces and Adam provide performance improvements. While training with RMSProp, the model with traces gets to near optimal performance more than twice as quickly as the other models. With Adam, the model learns to be optimal in just 6 epochs.
|
| 138 |
+
|
| 139 |
+
<table><tr><td></td><td>RMSprop</td><td>Adam</td></tr><tr><td>DQN</td><td>23</td><td>12</td></tr><tr><td>RNN入=0 RNN 入= 0.8</td><td>28 10</td><td>8 6</td></tr></table>
|
| 140 |
+
|
| 141 |
+
Table 1: Number of epochs before getting to 18 points in Pong. We chose 18 points as the threshold because it represents a near-optimal strategy. Testing is performed with a $5 \%$ $\epsilon$ -greedy policy, stopping the agent from having a perfect score.
|
| 142 |
+
|
| 143 |
+
# 4.2 TENNIS
|
| 144 |
+
|
| 145 |
+
The second Atari 2600 game we tested was Tennis. A match consists of only one set, which is won by the player who is the first to win 6 ”games” (as in regular tennis). The score ranges from 24 to -24, given as the difference between the number of balls won by the two players.
|
| 146 |
+
|
| 147 |
+
As in Pong, we first tried an RNN trained with RMSprop and the standard learning rate of 0.00025, both with and without eligibility traces (using again $\lambda = 0 . 8$ and $\lambda = 0$ ). Figure 3 shows that both RNN models learned to get optimal scores after about 50 epochs. This is in contrast with DQN, which never seems to be able to pass the 0 threshold, with large fluctuations ranging from -24 to 0. After visually inspecting the games played in the testing phase, we noticed that the DQN agent gets stuck in a loop, where it exchanges the ball with the opponent until the timer runs out. In such a case, the agent minimizes the number of points scored against, but never learns to beat the opponent. The score fluctuations depend on how few points the agent allows before entering the loop. We suspect that the agent gets stuck in this policy because the reward for trying to defeat the opponent is delayed, waiting for the ball to reach the opponent and get past it. Furthermore, the experiences of getting a point are relatively sparse. Together, it makes it difficult to propagate the reward back to the action of hitting the ball correctly.
|
| 148 |
+
|
| 149 |
+
We also notice that both the RNN with and without eligibility traces manage to learn a near-optimal policy without getting stuck in the bad policy. The RNN has the capacity of sending the signal back to past states with BPTT, allowing it to do credit assignment implicitly, which might explain their ability to escape the bad policy. Remarkably, this is the only algorithm that succeeds in getting near-optimal scores on Tennis, out of all variants of DQN (Mnih et al. (2015), Munos et al. (2016), Wang et al. (2015), Mnih et al. (2016), Schaul et al. (2015)), which tend to get stuck in the policy of delaying. The model without traces learned at a faster pace than the one with traces, arriving to a score of 20 in 45 epochs as opposed to 62 for its counterpart. It’s possible that the updates for model with traces were smaller, due to the weighting of target values, indirectly leading to a lower learning rate. We also trained the models with RMSprop and a higher learning rate of 0.001. This led to the model with traces getting to 20 points in just 27 epochs, while the model without traces lost its ability to get optimal scores and never passed the 0 threshold.
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 3: Test scores on Tennis comparing RMSprop and Adam.
|
| 153 |
+
|
| 154 |
+
Table 2: Number of epochs before getting to 20 points in Tennis. N/A represents the inability to reach such a level.
|
| 155 |
+
|
| 156 |
+
<table><tr><td></td><td>RMSprop lr=0.00025</td><td>RMSprop lr=0.001</td><td>Adam lr=0.00025</td></tr><tr><td>DQN</td><td>N/A</td><td>N/A</td><td>N/A</td></tr><tr><td>RNN入=0</td><td>45</td><td>N/A</td><td>19</td></tr><tr><td>RNN 入= 0.8</td><td>62</td><td>27</td><td>13</td></tr></table>
|
| 157 |
+
|
| 158 |
+
We then tried using Adam as the optimizer, with the original learning rate of 0.00025. Both RNN models learned substantially faster than with RMSprop, with the RNN with traces getting to nearoptimal performance in just 13 epochs. With Adam, the gradient for the positive TD is stored in the momentum part of the equation for quite some time. Once in momentum, the gradient is part of many updates, which makes it enough to overtake the safe strategy. We also notice that the model with traces was much more stable than its counterpart. The model without traces fell back to the policy of delaying the game on two occasions, after having learned to beat the opponent. Finally, we trained DQN with Adam, but the model acted the same way as DQN trained with RMSprop.
|
| 159 |
+
|
| 160 |
+
# 5 DISCUSSION AND CONCLUSION
|
| 161 |
+
|
| 162 |
+
In this paper, we analyzed the effects of using eligibility traces and different optimization functions. We showed that eligibility traces can improve and stabilize learning and using Adam can strongly accelerate learning.
|
| 163 |
+
|
| 164 |
+
As shown in the Pong results, the model using eligibility traces didn’t gain much performance from using Adam. One possible cause is the frozen network. While it has a stabilizing effect in DQN, by stopping policies from drastically changing from a single update, it also stops newly learned values from being propagated back. Double DQN seems to partially go around this issue, allowing the policy of the next state to change, while keeping the values frozen. In future experiments, we must consider eliminating or increasing the frozen network’s update frequency. It would also be interesting to reduce the size of experience replay, as with increased learning speed, old observations can become too off-policy and barely be used in eligibility traces.
|
| 165 |
+
|
| 166 |
+
# REFERENCES
|
| 167 |
+
|
| 168 |
+
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, 2012.
|
| 169 |
+
Alex Graves. Generating sequences with recurrent neural networks. arXiv preprint arXiv:1308.0850, 2013.
|
| 170 |
+
Matthew Hausknecht and Peter Stone. Deep recurrent q-learning for partially observable mdps. arXiv preprint arXiv:1507.06527, 2015.
|
| 171 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 172 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 173 |
+
Guillaume Lample and Devendra Singh Chaplot. Playing fps games with deep reinforcement learning. arXiv preprint arXiv:1609.05521, 2016.
|
| 174 |
+
Sergey Levine and Pieter Abbeel. Learning neural network policies with guided policy search under unknown dynamics. In Advances in Neural Information Processing Systems, pp. 1071–1079, 2014.
|
| 175 |
+
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–533, 2015.
|
| 176 |
+
Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy P Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. arXiv preprint arXiv:1602.01783, 2016.
|
| 177 |
+
Remi Munos, Tom Stepleton, Anna Harutyunyan, and Marc G Bellemare. Safe and efficient off- ´ policy reinforcement learning. arXiv preprint arXiv:1606.02647, 2016.
|
| 178 |
+
Tom Schaul, John Quan, Ioannis Antonoglou, and David Silver. Prioritized experience replay. arXiv preprint arXiv:1511.05952, 2015.
|
| 179 |
+
David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the game of go with deep neural networks and tree search. Nature, 529(7587):484–489, 2016.
|
| 180 |
+
Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction, volume 1. MIT press Cambridge, 1998.
|
| 181 |
+
Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction, In Preparation. MIT press Cambridge, 2017.
|
| 182 |
+
Tijmen Tieleman and Geoffrey Hinton. Lecture 6.5-rmsprop: Divide the gradient by a running average of its recent magnitude. COURSERA: Neural Networks for Machine Learning, 4(2), 2012.
|
| 183 |
+
Harm van Seijen and Rich Sutton. True online td (lambda). In Proceedings of The 31st International Conference on Machine Learning, pp. 692–700, 2014.
|
| 184 |
+
Ziyu Wang, Nando de Freitas, and Marc Lanctot. Dueling network architectures for deep reinforcement learning. arXiv preprint arXiv:1511.06581, 2015.
|
md/train/HkCjNI5ex/HkCjNI5ex.md
ADDED
|
@@ -0,0 +1,275 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# REGULARIZING NEURAL NETWORKS BY PENALIZING CONFIDENT OUTPUT DISTRIBUTIONS
|
| 2 |
+
|
| 3 |
+
Gabriel Pereyra ∗ † Google Brain pereyra@google.com
|
| 4 |
+
|
| 5 |
+
George Tucker ∗ † Google Brain gjt@google.com
|
| 6 |
+
|
| 7 |
+
Jan Chorowski
|
| 8 |
+
Google Brain
|
| 9 |
+
chorowski@google.com
|
| 10 |
+
Łukasz Kaiser
|
| 11 |
+
Google Brain
|
| 12 |
+
lukaszkaiser@google.com
|
| 13 |
+
|
| 14 |
+
Geoffrey Hinton University of Toronto & Google Brain geoffhinton@google.com
|
| 15 |
+
|
| 16 |
+
# ABSTRACT
|
| 17 |
+
|
| 18 |
+
We systematically explore regularizing neural networks by penalizing low entropy output distributions. We show that penalizing low entropy output distributions, which has been shown to improve exploration in reinforcement learning, acts as a strong regularizer in supervised learning. Furthermore, we connect a maximum entropy based confidence penalty to label smoothing through the direction of the KL divergence. We exhaustively evaluate the proposed confidence penalty and label smoothing on 6 common benchmarks: image classification (MNIST and Cifar-10), language modeling (Penn Treebank), machine translation (WMT’14 English-to-German), and speech recognition (TIMIT and WSJ). We find that both label smoothing and the confidence penalty improve state-of-the-art models across benchmarks without modifying existing hyperparameters, suggesting the wide applicability of these regularizers.
|
| 19 |
+
|
| 20 |
+
# 1 INTRODUCTION
|
| 21 |
+
|
| 22 |
+
Large neural networks with millions of parameters achieve strong performance on image classification (Szegedy et al., 2015a), machine translation (Wu et al., 2016), language modeling (Jozefowicz et al., 2016), and speech recognition (Graves et al., 2013). However, despite using large datasets, neural networks are still prone to overfitting. Numerous techniques have been proposed to prevent overfitting, including early stopping, L1/L2 regularization (weight decay), dropout (Srivastava et al., 2014), and batch normalization (Ioffe & Szegedy, 2015). These techniques, along with most other forms of regularization, act on the hidden activations or weights of a neural network. Alternatively, regularizing the output distribution of large, deep neural networks has largely been unexplored.
|
| 23 |
+
|
| 24 |
+
To motivate output regularizers, we can view the knowledge of a model as the conditional distribution it produces over outputs given an input (Hinton et al., 2015) as opposed to the learned values of its parameters. Given this functional view of knowledge, the probabilities assigned to class labels that are incorrect (according to the training data) are part of the knowledge of the network. For example, when shown an image of a BMW, a network that assigns a probability of $1 0 ^ { - 3 }$ to “Audi” and $1 \bar { 0 } ^ { - 9 }$ to “carrot” is clearly better than a network that assigns $1 0 ^ { - 9 }$ to “Audi” and $1 0 ^ { - 3 }$ to carrot, all else being equal. One reason it is better is that the probabilities assigned to incorrect classes are an indication of how the network generalizes. Distillation (Hinton et al., 2015; Bucilu et al., 2006) exploits this fact by explicitly training a small network to assign the same probabilities to incorrect classes as a large network or ensemble of networks that generalizes well. Further, by operating on the output distribution that has a natural scale rather than on internal weights, whose significance depends on the values of the other weights, output regularization has the property that it is invariant to the parameterization of the underlying neural network.
|
| 25 |
+
|
| 26 |
+
In this paper, we systematically evaluated two output regularizers: a maximum entropy based confidence penalty and label smoothing (uniform and unigram) for large, deep neural networks on 6 common benchmarks: image classification (MNIST and Cifar-10), language modeling (Penn Treebank), machine translation (WMT’14 English-to-German), and speech recognition (TIMIT and WSJ). We find that both label smoothing and the confidence penalty improve state-of-the-art models across benchmarks without modifying existing hyperparameters.
|
| 27 |
+
|
| 28 |
+
# 2 RELATED WORK
|
| 29 |
+
|
| 30 |
+
The maximum entropy principle (Jaynes, 1957) has a long history with deep connections to many areas of machine learning including unsupervised learning, supervised learning, and reinforcement learning. In supervised learning, we can search for the model with maximum entropy subject to constraints on empirical statistics, which naturally gives rise to maximum likelihood in log-linear models (see (Berger et al., 1996) for a review). Deterministic annealing Rose (1998) is a general approach for optimization that is widely applicable, avoids local minima, and can minimize discrete objectives, and it can be derived from the maximum entropy principle. Closely related to our work, Miller et al. (1996) apply deterministic annealing to train multilayer perceptrons, where an entropy based regularizer is introduced and slowly annealed. However, their focus is avoiding poor initialization and local minima, and while they find that deterministic annealing helps, the improvement diminishes quickly as the number of hidden units exceeds eight.
|
| 31 |
+
|
| 32 |
+
In reinforcement learning, encouraging the policy to have an output distribution with high entropy has been used to improve exploration (Williams & Peng, 1991). This prevents the policy from converging early and leads to improved performance (Mnih et al., 2016). Penalizing low entropy has also been used when combining reinforcement learning and supervised learning to train a neural speech recognition model to learn when to emit tokens (Luo et al., 2016). When learning to emit, the entropy of the emission policy was added to the training objective and was annealed throughout training. Indeed, in recent work on reward augmented maximum likelihood (Norouzi et al., 2016), this entropy augmented reinforcement learning objective played a direct role in linking maximum likelihood and reinforcement learning objectives.
|
| 33 |
+
|
| 34 |
+
Penalizing the entropy of a network’s output distribution has not been evaluated for large deep neural networks in supervised learning, but a closely related idea, label smoothing regularization, has been shown to improve generalization (Szegedy et al., 2015b). Label smoothing regularization estimates the marginalized effect of label-dropout during training, reducing overfitting by preventing a network from assigning full probability to each training example and maintaining a reasonable ratio between the logits of the incorrect classes. Simply adding label noise has also been shown to be effective at regularizing neural networks (Xie et al., 2016). Instead of smoothing the labels with a uniform distribution, as in label smoothing, we can smooth the labels with a teacher model (Hinton et al., 2015) or the model’s own distribution (Reed et al., 2014). Distillation and self-distillation both regularize a network by incorporating information about the ratios between incorrect classes.
|
| 35 |
+
|
| 36 |
+
Virtual adversarial training (VAT) (Miyato et al., 2015) is another promising smoothing regularizer. However, we did not compare to VAT because it has multiple hyperparameters and the approximated gradient of the local distributional smoothness can be computed with no more than three pairs of forward and back propagations, which is significantly more computation in grid-searching and training than the other approaches we compared to.
|
| 37 |
+
|
| 38 |
+
# 3 DIRECTLY PENALIZING CONFIDENCE
|
| 39 |
+
|
| 40 |
+
Confident predictions correspond to output distributions that have low entropy. A network is overconfident when it places all probability on a single class in the training set, which is often a symptom of overfitting (Szegedy et al., 2015b). The confidence penalty constitutes a regularization term that prevents these peaked distributions, leading to better generalization.
|
| 41 |
+
|
| 42 |
+
A neural network produces a conditional distribution $p _ { \theta } ( \pmb { y } | \pmb { x } )$ over classes $\textbf { { y } }$ given an input $_ { \textbf { \em x } }$ through a softmax function. The entropy of this conditional distribution is given by
|
| 43 |
+
|
| 44 |
+

|
| 45 |
+
Figure 1: Distribution of the magnitude of softmax probabilities on the MNIST validation set. A fully-connected, 2-layer, 1024-unit neural network was trained with dropout (left), label smoothing (center), and the confidence penalty (right). Dropout leads to a softmax distribution where probabilities are either 0 or 1. By contrast, both label smoothing and the confidence penalty lead to smoother output distributions, which results in better generalization.
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
H ( p _ { \theta } ( \pmb { y } | \pmb { x } ) ) = - \sum _ { i } p _ { \theta } ( \pmb { y } _ { i } | \pmb { x } ) \log ( p _ { \theta } ( \pmb { y } _ { i } | \pmb { x } ) ) .
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
To penalize confident output distributions, we add the negative entropy to the negative log-likelihood during training
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
\mathcal { L } ( \theta ) = - \sum \log p _ { \theta } ( \pmb { y } | \pmb { x } ) - \beta H ( p _ { \theta } ( \pmb { y } | \pmb { x } ) ) ,
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
where $\beta$ controls the strength of the confidence penalty. Notably, the gradient of the entropy term with respect to the logits is simple to compute. Denoting the ith logit by $z _ { i }$ , then
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\frac { \partial H ( p _ { \theta } ) } { \partial z _ { i } } = p _ { \theta } ( \pmb { y } _ { i } | \pmb { x } ) \left( - \log p _ { \theta } ( \pmb { y } _ { i } | \pmb { x } ) - H ( p _ { \theta } ) \right) ,
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
which is the weighted deviation from the mean.
|
| 64 |
+
|
| 65 |
+
# 3.1 ANNEALING AND THRESHOLDING THE CONFIDENCE PENALTY
|
| 66 |
+
|
| 67 |
+
In reinforcement learning, penalizing low entropy distributions prevents a policy network from converging early and encourages exploration. However, in supervised learning, we typically want quick convergence, while preventing overfitting near the end of training, suggesting a confidence penalty that is weak at the beginning of training and strong near convergence. A simple way to achieve this is to anneal the confidence penalty.
|
| 68 |
+
|
| 69 |
+
Another way to strengthen the confidence penalty as training progresses is to only penalize output distributions when they are below a certain entropy threshold. We can achieve this by adding a hinge loss to the confidence penalty, leading to an objective of the form
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\mathcal { L } ( \theta ) = - \sum \log p _ { \theta } ( \pmb { y } | \pmb { x } ) - \beta \operatorname* { m a x } ( 0 , \Gamma - H ( p _ { \theta } ( \pmb { y } | \pmb { x } ) ) ,
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $\Gamma$ is the entropy threshold below which we begin applying the confidence penalty.
|
| 76 |
+
|
| 77 |
+
Initial experiments suggest that thresholding the confidence penalty leads to faster convergence at the cost of introducing an extra hyper-parameter. For the majority of our experiments, we were able to achieve comparable performance without using the thresholded version. For the sake of simplicity, we focus on the single hyper-parameter version in our experiments.
|
| 78 |
+
|
| 79 |
+
# 3.2 CONNECTION TO LABEL SMOOTHING
|
| 80 |
+
|
| 81 |
+
Label smoothing estimates the marginalized effect of label noise during training. When the prior label distribution is uniform, label smoothing is equivalent to adding the KL divergence between the uniform distribution $u$ and the network’s predicted distribution $p _ { \theta }$ to the negative log-likelihood
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\mathcal { L } ( \theta ) = - \sum \log p _ { \theta } ( \pmb { y } | \pmb { x } ) - D _ { K L } ( \boldsymbol { u } | | p _ { \theta } ( \pmb { y } | \pmb { x } ) ) .
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
By reversing the direction of the KL divergence, $D _ { K L } ( p _ { \boldsymbol { \theta } } ( \pmb { y } | \pmb { x } ) \| \boldsymbol { u } )$ , we recover the confidence penalty. This interpretation suggests further confidence regularizers that use alternative target distributions instead of the uniform distribution. We leave the exploration of these regularizers to future work.
|
| 88 |
+
|
| 89 |
+
# 4 EXPERIMENTS
|
| 90 |
+
|
| 91 |
+
We evaluated the confidence penalty and label smoothing on MNIST and CIFAR-10 for image classification, Penn Treebank for language modeling, WMT’14 English-to-German for machine translation, and TIMIT and WSJ for speech recognition. All models were implemented using TensorFlow (Abadi et al., 2016) and trained on NVIDIA Tesla K40 or K80 GPUs.
|
| 92 |
+
|
| 93 |
+
# 4.1 IMAGE CLASSIFICATION
|
| 94 |
+
|
| 95 |
+
# 4.1.1 MNIST
|
| 96 |
+
|
| 97 |
+
As a preliminary experiment, we evaluated the approaches on the standard MNIST digit recognition task. We used the standard split into 60k training images and 10k testing images. We use the last 10k images of the training set as a held-out validation set for hyper-parameter tuning and then retrained the models on the entire dataset with the best configuration.
|
| 98 |
+
|
| 99 |
+
We trained fully-connected, ReLu activation neural networks with 1024 units per layer and two hidden layers. Weights were initialized from a normal distribution with standard deviation 0.01. Models were optimized with stochastic gradient descent with a constant learning rate 0.05 (except for dropout where we set the learning rate to 0.001).
|
| 100 |
+
|
| 101 |
+
For label smoothing, we varied the smoothing parameter in the range [0.05, 0.1, 0.2, 0.3, 0.4, 0.5], and found 0.1 to work best for both methods. For the confidence penalty, we varied the weight values over [0.1, 0.3, 0.5, 1.0, 2.0, 4.0, 8.0] and found a confidence penalty weight of 1.0 to work best.
|
| 102 |
+
|
| 103 |
+
We also plotted the norm of the gradient as training progressed in Figure 2. We observed that label smoothing and confidence penalty had smaller gradient norms and converged more quickly than models regularized with dropout. If the output distributions is peaked on a misclassified example, the model receives a large gradient. This may explain why the regularized models have smaller gradient norms.
|
| 104 |
+
|
| 105 |
+
Table 1: Test error $( \% )$ for permutation-invariant MNIST.
|
| 106 |
+
|
| 107 |
+
<table><tr><td>Model</td><td>Layers</td><td>Size</td><td>Test</td></tr><tr><td>Wan et al. (2013) - Unregularized</td><td>2</td><td>800</td><td>1.40%</td></tr><tr><td>Srivastava et al. (2014) - Dropout</td><td>3</td><td>1024</td><td>1.25%</td></tr><tr><td>Wan et al. (2013) - DropConnect</td><td>2</td><td>800</td><td>1.20%</td></tr><tr><td>Srivastava et al. (2014) - MaxNorm + Dropout</td><td>2</td><td>8192</td><td>0.95%</td></tr><tr><td>Dropout</td><td>2</td><td>1024</td><td>1.28 ± 0.06%</td></tr><tr><td>Label Smoothing</td><td>2</td><td>1024</td><td>1.23 ± 0.06%</td></tr><tr><td>Confidence Penalty</td><td>2</td><td>1024</td><td>1.17 ± 0.06%</td></tr></table>
|
| 108 |
+
|
| 109 |
+
# 4.1.2 CIFAR-10
|
| 110 |
+
|
| 111 |
+
CIFAR-10 is an image classification dataset consisting of $3 2 \mathbf { x } 3 2 \mathbf { x } 3$ RGB images of 10 classes. The dataset is split into $5 0 \mathrm { k }$ training images and $1 0 \mathrm { k }$ testing images. We use the last $5 \mathrm { k }$ images of the training set as a held-out validation set for hyper-parameter tuning, as is common practice.
|
| 112 |
+
|
| 113 |
+
For our experiments, we used a densely connected convolutional neural network, which represents the current state-of-the-art on CIFAR-10 (Huang et al., 2016a). We use the small configuration from (Huang et al., 2016a), which consists of 40-layers, with a growth rate of 12. All models were trained for 300 epochs, with a batch-size of 50 and a learning rate 0.1. The learning rate was reduced by a factor of 10 at 150 and 225 epochs. We present results for training without data-augmentation. We found that the confidence penalty did not lead to improved performance when training with data augmentation, however neither did other regularization techniques, including dropout.
|
| 114 |
+
|
| 115 |
+
For our final test scores, we trained on the entire training set. For label smoothing, we tried smoothing parameter values of [0.05, 0.1, 0.2, 0.3, 0.4, 0.5], and found 0.1 to work best. For the confidence penalty, we performed a grid search over confidence penalty weight values of [0.1, 0.25, 0.5, 1.0, 1.5] and found a confidence penalty weight of 0.1 to work best.
|
| 116 |
+
|
| 117 |
+
Table 2: Test error $\%$ ) on Cifar-10 without data augmentation.
|
| 118 |
+
|
| 119 |
+
<table><tr><td>Model</td><td>Layers</td><td>Parameters</td><td>Test</td></tr><tr><td>He et al. (2015) - Residual CNN</td><td>110</td><td>1.7M</td><td>13.63%</td></tr><tr><td>Huang et al. (2016b) - Stochastic Depth Residual CNN</td><td>110</td><td>1.7M</td><td>11.66%</td></tr><tr><td>Larsson et al. (2016) - Fractal CNN</td><td>21</td><td>38.6M</td><td>10.18%</td></tr><tr><td>Larsson et al. (2016) - Fractal CNN (Dropout)</td><td>21</td><td>38.6M</td><td>7.33%</td></tr><tr><td>Huang et al. (2O16a) - Densely Connected CNN</td><td>40</td><td>1.0M</td><td>7.00%</td></tr><tr><td>Huang et al. (2O16a) - Densely Connected CNN</td><td>100</td><td>7.0M</td><td>5.77%</td></tr><tr><td>Densely Connected CNN (Dropout)</td><td>40</td><td>1.0M</td><td>7.04%</td></tr><tr><td>Densely Connected CNN (Dropout + Label Smoothing)</td><td>40</td><td>1.0M</td><td>6.89%</td></tr><tr><td>Densely Connected CNN (Dropout + Confidence Penalty)</td><td>40</td><td>1.0M</td><td>6.77%</td></tr></table>
|
| 120 |
+
|
| 121 |
+
# 4.2 LANGUAGE MODELING
|
| 122 |
+
|
| 123 |
+
For language modeling, we found that confidence penalty significantly outperforms label noise and label smoothing. We performed word-level language modeling experiments using the Penn Treebank dataset (PTB) (Marcus et al., 1993). We used the hyper-parameter settings from the large configuration in (Zaremba et al., 2014). Briefly, we used a 2-layer, 1500-unit LSTM, with $65 \%$ dropout applied on all non-recurrent connections. We trained using stochastic gradient descent for 55 epochs, decaying the learning rate by 1.15 after 14 epochs, and clipped the norm of the gradients when they were larger than 10.
|
| 124 |
+
|
| 125 |
+
For label noise and label smoothing, we performed a grid search over noise and smoothing values of [0.05, 0.1, 0.15, 0.2, 0.3, 0.4, 0.5]. For label noise, we found 0.1 to work best. For label smoothing, we found 0.1 to work best. For the confidence penalty, we performed a grid search over confidence penalty weight values of [0.1, 0.5, 1.0, 2.0, 3.0]. We found a confidence penalty weight of 2.0 to work best, which led to an improvement of 3.7 perplexity points over the baseline.
|
| 126 |
+
|
| 127 |
+
For reference, we also include results of the existing state-of-the-art models for the word-level language modeling task on PTB. Variational dropout (Gal, 2015) applies a fixed dropout mask (stochastic for each sample) at each time-step, instead of resampling at each time-step as in traditional dropout. Note, that we do not include the variational dropout results that use Monte Carlo (MC) model averaging, which achieves lower perplexity on the test set but requires 1000 model evaluations, which are then averaged. Recurrent highway networks (Zilly et al., 2016) currently represent the state-of-the-art performance on PTB.
|
| 128 |
+
|
| 129 |
+
Table 3: Validation and test perplexity for word-level Penn Treebank.
|
| 130 |
+
|
| 131 |
+
<table><tr><td>Model</td><td>Parameters</td><td>Validation</td><td>Test</td></tr><tr><td>Zaremba et al. (2014) - Regularized LSTM Gal (2015) - Variational LSTM</td><td>66M</td><td>82.2</td><td>78.4</td></tr><tr><td>Press& Wolf(2016) - TiedVariationalLSTM</td><td>66M</td><td>77.9</td><td>75.2</td></tr><tr><td></td><td>51M</td><td>79.6</td><td>75.0</td></tr><tr><td>Merity et al. (2016) - Pointer Sentinel LSTM</td><td>21M</td><td>72.4</td><td>70.9</td></tr><tr><td>Zilly et al. (2016) - Variational RHN</td><td>32M</td><td>71.2</td><td>68.5</td></tr><tr><td>Zilly et al. (2016) - Tied Variational RHN</td><td>24M</td><td>68.1</td><td>66.0</td></tr><tr><td>Regularized LSTM (label noise)</td><td>66M</td><td>79.7</td><td>77.7</td></tr><tr><td>Regularized LSTM (label smoothing)</td><td>66M</td><td>78.9</td><td>76.6</td></tr><tr><td>Regularized LSTM (unigram smoothing)</td><td>66M</td><td>79.1</td><td>76.3</td></tr><tr><td>Regularized LSTM (confidence penalty)</td><td>66M</td><td>77.8</td><td>74.7</td></tr></table>
|
| 132 |
+
|
| 133 |
+
# 4.3 MACHINE TRANSLATION
|
| 134 |
+
|
| 135 |
+
For machine translation, we evaluated the confidence penalty on the WMT’14 English-to-German translation task using Google’s production-level translation system Wu et al. (2016). The training set consists of 5M sentence pairs, and we used newstest2012 and newtests2013 for validation and newstest2014 for testing. We report tokenized BLEU scores as computed by the multi-bleu.perl script from the Moses translation machine translation package.
|
| 136 |
+
|
| 137 |
+
Our model was an 8-layer sequence-to-sequence model with attention (Bahdanau et al., 2014). The first encoder was a bidirectional LSTM, the remaining encoder and decoder layers were unidirectional LSTMs, and the attention network was a single layer feed-forward network. Each layer had 512 units (compared to 1024 in (Wu et al., 2016)). The model was trained using 12 replicas running concurrently with asynchronous updates. Dropout of $30 \%$ was applied as described in (Zaremba et al., 2014). Optimization used a mix of Adam and SGD with gradient clipping. Unlike (Wu et al., 2016), we did not use reinforcement learning to fine-tune our model. We used a beam size of 12 during decoding. For more details, see (Wu et al., 2016).
|
| 138 |
+
|
| 139 |
+
For label smoothing, we performed a grid search over values $[ 0 . 0 5 , 0 . 1 , 0 . 2 , 0 . 3 , 0 . 4 , 0 . 5 ]$ and found 0.1 to work best for both uniform and unigram smoothing. For the confidence penalty, we searched over values of [0.5, 2.5, 4.5] and found a value of 2.5 to work best . For machine translation, we found label smoothing slightly outperformed confidence penalty. When applied without dropout, both lead to an improvement of just over 1 BLEU point (dropout leads to an improvement of just over 2 BLEU points). However, when combined with dropout, the effect of both regularizers was diminished.
|
| 140 |
+
|
| 141 |
+
<table><tr><td>Model</td><td>Parameters</td><td>Validation</td><td>Test</td></tr><tr><td>Buck et al. (2014) - PBMT</td><td></td><td></td><td>20.7</td></tr><tr><td>Cho et al. (2015) - RNNSearch</td><td></td><td></td><td>16.9</td></tr><tr><td>Zhou et al. (2016) - Deep-Att</td><td></td><td></td><td>20.6</td></tr><tr><td>Luong et al. (2015) - P-Attention</td><td>164M</td><td></td><td>20.9</td></tr><tr><td>Wu et al. (2016) - WPM-16K</td><td>167M</td><td></td><td>24.4</td></tr><tr><td>Wu et al. (2016) - WPM-32K</td><td>278M</td><td></td><td>24.6</td></tr><tr><td>WPM-32K (without dropout)</td><td>94M</td><td>22.33</td><td>21.24</td></tr><tr><td>WPM-32K (label smoothing)</td><td>94M</td><td>23.85</td><td>22.42</td></tr><tr><td>WPM-32K (confidence penalty)</td><td>94M</td><td>23.25</td><td>22.52</td></tr><tr><td>WPM-32K (dropout)</td><td>94M</td><td>24.1 ±0.1</td><td>23.41 ± 0.04</td></tr><tr><td>WPM-32K (dropout + label smoothing)</td><td>94M</td><td>24.3 ± 0.1</td><td>23.52 ±0.03</td></tr><tr><td>WPM-32K (dropout + unigram smoothing)</td><td>94M</td><td>24.3 ± 0.1</td><td>23.57 ± 0.02</td></tr><tr><td>WPM-32K (dropout + confidence penalty)</td><td>94M</td><td>24.3 ± 0.1</td><td>23.4 ± 0.1</td></tr></table>
|
| 142 |
+
|
| 143 |
+
Table 4: Validation and test BLEU for WMT’14 English-to-German. For the last four model configurations, we report the mean and standard error of the mean (SEM) over 5 random initializations.
|
| 144 |
+
|
| 145 |
+
# 4.4 SPEECH RECOGNITION
|
| 146 |
+
|
| 147 |
+
# 4.4.1 TIMIT
|
| 148 |
+
|
| 149 |
+
In the TIMIT corpus, the training set consists of 3512 utterances, the validation set consists of 184 utterances and the test set consists of 192 utterances. All 61 phonemes were used during training and decoding, and during scoring, these 61 phonemes were reduced to 39 to compute the phoneme error rate (PER).
|
| 150 |
+
|
| 151 |
+
As our base model, we used a sequence-to-sequence model with attention. The encoder consisted of 3 bidirectional LSTM layers, the decoder consisted of a single unidirectional LSTM layer, and the attention network consisted of a single layer feed-forward network. All layers consisted of 256 units. Dropout of $15 \%$ was applied as described in Zaremba et al. (2014). We trained the model with asynchronous SGD with 5 replicas. We used a batch size of 32, a learning rate of 0.01, and momentum of 0.9. Gradients were clipped at 5.0. For more details, see Norouzi et al. (2016).
|
| 152 |
+
|
| 153 |
+
For label smoothing, we performed a grid search over values [0.05, 0.1, 0.15, 0.2, 0.3, 0.4, 0.5, 0.6, 0.8] and found 0.2 to work best. For the confidence penalty, we performed a grid search over values of $[ 0 . 1 2 5 , 0 . 2 5 , 0 . 5 , 1 . 0 , 2 . 0 , 4 . 0 , 8 . 0 ]$ and found a value of 1.0 to work best. Label smoothing led to an absolute improvement over the dropout baseline of $1 . 6 \%$ , while the confidence penalty led to an absolute improvement of $1 . 2 \%$ .
|
| 154 |
+
|
| 155 |
+
Table 5: Validation and test phoneme error rates (PER) for TIMIT. We report the mean and SEM over 5 random initializations.
|
| 156 |
+
|
| 157 |
+
<table><tr><td>Model</td><td>Parameters</td><td>Validation</td><td>Test</td></tr><tr><td>Mohamed et al. (2012) - DNN-HMM</td><td></td><td>1</td><td>20.7</td></tr><tr><td>Norouzi et al. (2016) - RML</td><td>6.5M</td><td>18.0</td><td>19.9</td></tr><tr><td>Graves et al. (2006) - CTC</td><td>6.8M</td><td>-</td><td>18.4</td></tr><tr><td>Graves et al. (2013) - RNN Transducer</td><td>4.3M</td><td>1</td><td>17.7</td></tr><tr><td>T6th (2014) - CNN</td><td>1</td><td>13.9</td><td>16.7</td></tr><tr><td>Dropout</td><td>6.5M</td><td>21.0 ±0.1</td><td>23.2 ± 0.4</td></tr><tr><td>Dropout + Label Smoothing</td><td>6.5M</td><td>19.3 ± 0.1</td><td>21.6 ± 0.2</td></tr><tr><td>Dropout + Confidence Penalty</td><td>6.5M</td><td>19.9 ± 0.2</td><td>22.0± 0.4</td></tr></table>
|
| 158 |
+
|
| 159 |
+
# 4.4.2 WALL STREET JOURNAL
|
| 160 |
+
|
| 161 |
+
For the WSJ corpus we used attention-based sequence-to-sequence networks that directly predicted characters. We used the SI284 subset for training, DEV93 for validation, and EVAL92 for testing. We used 240-dimensional vectors consisting of 80-bin filterbank features augmented with their deltas and delta-deltas with per-speaker normalized mean and variances computed with Kaldi Povey et al. (2011). We did not use text-only data or separate language models during decoding.
|
| 162 |
+
|
| 163 |
+
Network architecture details were as follows. The encoder of the network consisted of 4 bidirectional LSTM layers each having 256 units, interleaved with 3 time-subsampling layers, configured to drop every second frame (Bahdanau et al., 2016; Chan et al., 2015). The decoder used a single LSTM layer with 256 units. The attention vectors were computed with a single layer feedforward network having 64 hidden units and the convolutional filters as described in Chorowski et al. (2015). Weights were initialized from a uniform distribution $[ - 0 . 0 7 5 , 0 . 0 7 5 ]$ . All models used weight decay of $1 \bar { 0 ^ { - 6 } }$ , additive Gaussian weight noise with standard deviation 0.075, applied after 20K steps, and were trained for 650K steps. We used the ADAM optimizer asynchronously over 8 GPUs. We used a learning rate of $1 0 ^ { - 3 }$ , which was reduced to $1 0 ^ { - 4 }$ after $4 0 0 \mathrm { K }$ and $1 0 ^ { - 5 }$ after 500K steps.
|
| 164 |
+
|
| 165 |
+
We tested three methods of increasing the entropy of outputs: the confidence penalty and two variants of label smoothing: uniform and unigram. All resulted in improved Word Error Rates (WER), however the unigram smoothing resulted in the greatest WER reduction, and we found it to be least sensitive to its hyperparameter (the smoothing value). Furthermore, uniform smoothing and confidence penalty required masking network outputs corresponding to tokens that never appeared as labels, such as the start-of-sequence token.
|
| 166 |
+
|
| 167 |
+
Table 6 compares the performance of the regularized networks with several recent results. We observe that the benefits of label smoothing (WER reduction from 14.2 to 11) improve over the recently proposed Latent Sequence Decompositions (LSD) method (Chan et al., 2016) which reduces the WER from 14.7 to 12.9 by extending the space of output tokens to dynamically chosen character n-grams.
|
| 168 |
+
|
| 169 |
+
Table 6: Validation and test word error rates (WER) for WSJ. For Baseline, Uniform Label Smoothing and Confidence Penalty we report the average over two runs. For the best setting (Unigram Label Smoothing), we report the average over 6 runs together with the standard deviation.
|
| 170 |
+
|
| 171 |
+
<table><tr><td>Model</td><td>Parameters</td><td>Validation</td><td>Test</td></tr><tr><td>Graves & Jaitly (2014) - CTC</td><td>26.5M</td><td></td><td>27.3</td></tr><tr><td>Bahdanau et al. (2016) - seq2seq Chan et al. (2016) - Baseline</td><td>5.7M</td><td></td><td>18.6</td></tr><tr><td>Chan et al. (2016) - LSD</td><td>5.1M</td><td></td><td>14.7</td></tr><tr><td></td><td>5.9M</td><td>1</td><td>12.9</td></tr><tr><td>Baseline</td><td>6.6M</td><td>17.9</td><td>14.2</td></tr><tr><td>Uniform Label Smoothing</td><td>6.6M</td><td>14.7</td><td>11.3</td></tr><tr><td>Unigram Label Smoothing</td><td>6.6M</td><td>14.0 ± 0.25</td><td>11.0± 0.35</td></tr><tr><td>Confidence Penalty</td><td>6.6M</td><td>17.2</td><td>12.7</td></tr></table>
|
| 172 |
+
|
| 173 |
+
# 5 CONCLUSION
|
| 174 |
+
|
| 175 |
+
Motivated by recent successes of output regularizers (Szegedy et al., 2015b; Xie et al., 2016), we conduct a systematic evaluation of two output regularizers: the confidence penalty and label smoothing. We show that this form of regularization, which has been shown to improve exploration in reinforcement learning, also acts as a strong regularizer in supervised learning. We find that both the confidence penalty and label smoothing improve a wide range of state-of-the-art models, without the need to modify hyper-parameters.
|
| 176 |
+
|
| 177 |
+
# ACKNOWLEDGMENTS
|
| 178 |
+
|
| 179 |
+
We would like to thank Sergey Ioffe, Alex Alemi and Navdeep Jaitly for helpful discussions. We would also like to thank Prajit Ramachandran, Barret Zoph, Mohammad Norouzi, and Yonghui Wu for technical help with the various models used in our experiments. We thank the anonymous reviewers for insightful comments.
|
| 180 |
+
|
| 181 |
+
# REFERENCES
|
| 182 |
+
|
| 183 |
+
Martın Abadi, Ashish Agarwal, Paul Barham, Eugene Brevdo, Zhifeng Chen, Craig Citro, Greg S Corrado, Andy Davis, Jeffrey Dean, Matthieu Devin, et al. Tensorflow: Large-scale machine learning on heterogeneous distributed systems. arXiv preprint arXiv:1603.04467, 2016.
|
| 184 |
+
D. Bahdanau, J. Chorowski, D. Serdyuk, P. Brakel, and Y. Bengio. End-to-end attention-based large vocabulary speech recognition. In 2016 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 4945–4949, March 2016. doi: 10.1109/ICASSP.2016.7472618.
|
| 185 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
|
| 186 |
+
Adam L Berger, Vincent J Della Pietra, and Stephen A Della Pietra. A maximum entropy approach to natural language processing. Computational linguistics, 22(1):39–71, 1996.
|
| 187 |
+
Cristian Bucilu, Rich Caruana, and Alexandru Niculescu-Mizil. Model compression. In Proceedings of the 12th ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 535–541. ACM, 2006.
|
| 188 |
+
Christian Buck, Kenneth Heafield, and Bas Van Ooyen. N-gram counts and language models from the common crawl. In LREC, volume 2, pp. 4. Citeseer, 2014.
|
| 189 |
+
|
| 190 |
+
William Chan, Navdeep Jaitly, Quoc V Le, and Oriol Vinyals. Listen, attend and spell. arXiv preprint arXiv:1508.01211, 2015.
|
| 191 |
+
|
| 192 |
+
William Chan, Yu Zhang, Quoc Le, and Navdeep Jaitly. Latent sequence decompositions. arXiv preprint arXiv:1610.03035, 2016.
|
| 193 |
+
|
| 194 |
+
Sebastien Jean Kyunghyun Cho, Roland Memisevic, and Yoshua Bengio. On using very large target ´ vocabulary for neural machine translation. 2015.
|
| 195 |
+
|
| 196 |
+
Jan K Chorowski, Dzmitry Bahdanau, Dmitriy Serdyuk, Kyunghyun Cho, and Yoshua Bengio. Attention-based models for speech recognition. In Advances in Neural Information Processing Systems, pp. 577–585, 2015.
|
| 197 |
+
|
| 198 |
+
Yarin Gal. A theoretically grounded application of dropout in recurrent neural networks. arXiv preprint arXiv:1512.05287, 2015.
|
| 199 |
+
|
| 200 |
+
Alex Graves and Navdeep Jaitly. Towards end-to-end speech recognition with recurrent neural networks. In ICML, volume 14, pp. 1764–1772, 2014.
|
| 201 |
+
|
| 202 |
+
Alex Graves, Santiago Fernandez, Faustino Gomez, and J ´ urgen Schmidhuber. Connectionist tem- ¨ poral classification: labelling unsegmented sequence data with recurrent neural networks. In Proceedings of the 23rd international conference on Machine learning, pp. 369–376. ACM, 2006.
|
| 203 |
+
|
| 204 |
+
Alex Graves, Abdel-rahman Mohamed, and Geoffrey Hinton. Speech recognition with deep recurrent neural networks. In 2013 IEEE international conference on acoustics, speech and signal processing, pp. 6645–6649. IEEE, 2013.
|
| 205 |
+
|
| 206 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. arXiv preprint arXiv:1512.03385, 2015.
|
| 207 |
+
|
| 208 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 209 |
+
|
| 210 |
+
Gao Huang, Zhuang Liu, and Kilian Q Weinberger. Densely connected convolutional networks. arXiv preprint arXiv:1608.06993, 2016a.
|
| 211 |
+
|
| 212 |
+
Gao Huang, Yu Sun, Zhuang Liu, Daniel Sedra, and Kilian Weinberger. Deep networks with stochastic depth. arXiv preprint arXiv:1603.09382, 2016b.
|
| 213 |
+
|
| 214 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 215 |
+
|
| 216 |
+
Edwin T Jaynes. Information theory and statistical mechanics. Physical review, 106(4):620, 1957.
|
| 217 |
+
|
| 218 |
+
Rafal Jozefowicz, Oriol Vinyals, Mike Schuster, Noam Shazeer, and Yonghui Wu. Exploring the limits of language modeling. arXiv preprint arXiv:1602.02410, 2016.
|
| 219 |
+
|
| 220 |
+
Gustav Larsson, Michael Maire, and Gregory Shakhnarovich. Fractalnet: Ultra-deep neural networks without residuals. arXiv preprint arXiv:1605.07648, 2016.
|
| 221 |
+
|
| 222 |
+
Yuping Luo, Chung-Cheng Chiu, Navdeep Jaitly, and Ilya Sutskever. Learning online alignments with continuous rewards policy gradient. arXiv preprint arXiv:1608.01281, 2016.
|
| 223 |
+
|
| 224 |
+
Minh-Thang Luong, Hieu Pham, and Christopher D Manning. Effective approaches to attentionbased neural machine translation. arXiv preprint arXiv:1508.04025, 2015.
|
| 225 |
+
|
| 226 |
+
Mitchell P Marcus, Mary Ann Marcinkiewicz, and Beatrice Santorini. Building a large annotated corpus of english: The penn treebank. Computational linguistics, 19(2):313–330, 1993.
|
| 227 |
+
|
| 228 |
+
Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. arXiv preprint arXiv:1609.07843, 2016.
|
| 229 |
+
|
| 230 |
+
David Miller, Ajit V Rao, Kenneth Rose, and Allen Gersho. A global optimization technique for statistical classifier design. IEEE Transactions on Signal Processing, 44(12):3108–3122, 1996.
|
| 231 |
+
|
| 232 |
+
Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, Ken Nakae, and Shin Ishii. Distributional smoothing by virtual adversarial examples. arXiv preprint arXiv:1507.00677, 2015.
|
| 233 |
+
|
| 234 |
+
Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy P Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. arXiv preprint arXiv:1602.01783, 2016.
|
| 235 |
+
|
| 236 |
+
Abdel-rahman Mohamed, George E Dahl, and Geoffrey Hinton. Acoustic modeling using deep belief networks. IEEE Transactions on Audio, Speech, and Language Processing, 20(1):14–22, 2012.
|
| 237 |
+
|
| 238 |
+
Mohammad Norouzi, Dale Schuurmans, Samy Bengio, Zhifeng Chen, Navdeep Jaitly, Mike Schuster, and Yonghui Wu. Reward augmented maximum likelihood for neural structured prediction. In Advances in Neural Information Processing Systems, 2016.
|
| 239 |
+
|
| 240 |
+
Daniel Povey, Arnab Ghoshal, Gilles Boulianne, Lukas Burget, Ondrej Glembek, Nagendra Goel, Mirko Hannemann, Petr Motlicek, Yanmin Qian, Petr Schwarz, Jan Silovsky, Georg Stemmer, and Karel Vesely. The kaldi speech recognition toolkit. In IEEE 2011 Workshop on Automatic Speech Recognition and Understanding. IEEE Signal Processing Society, December 2011. IEEE Catalog No.: CFP11SRW-USB.
|
| 241 |
+
|
| 242 |
+
Ofir Press and Lior Wolf. Using the output embedding to improve language models. arXiv preprint arXiv:1608.05859, 2016.
|
| 243 |
+
|
| 244 |
+
Scott Reed, Honglak Lee, Dragomir Anguelov, Christian Szegedy, Dumitru Erhan, and Andrew Rabinovich. Training deep neural networks on noisy labels with bootstrapping. arXiv preprint arXiv:1412.6596, 2014.
|
| 245 |
+
|
| 246 |
+
Kenneth Rose. Deterministic annealing for clustering, compression, classification, regression, and related optimization problems. Proceedings of the IEEE, 86(11):2210–2239, 1998.
|
| 247 |
+
|
| 248 |
+
Nitish Srivastava, Geoffrey E Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. Journal of Machine Learning Research, 15(1):1929–1958, 2014.
|
| 249 |
+
|
| 250 |
+
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1–9, 2015a.
|
| 251 |
+
|
| 252 |
+
Christian Szegedy, Vincent Vanhoucke, Sergey Ioffe, Jonathon Shlens, and Zbigniew Wojna. Rethinking the inception architecture for computer vision. arXiv preprint arXiv:1512.00567, 2015b.
|
| 253 |
+
|
| 254 |
+
Laszl ´ o T´ oth. Combining time-and frequency-domain convolution in convolutional neural network- ´ based phone recognition. In 2014 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 190–194. IEEE, 2014.
|
| 255 |
+
|
| 256 |
+
Li Wan, Matthew Zeiler, Sixin Zhang, Yann L Cun, and Rob Fergus. Regularization of neural networks using dropconnect. In Proceedings of the 30th International Conference on Machine Learning (ICML-13), pp. 1058–1066, 2013.
|
| 257 |
+
|
| 258 |
+
Ronald J Williams and Jing Peng. Function optimization using connectionist reinforcement learning algorithms. Connection Science, 3(3):241–268, 1991.
|
| 259 |
+
|
| 260 |
+
Yonghui Wu, Mike Schuster, Zhifeng Chen, Quoc V Le, Mohammad Norouzi, Wolfgang Macherey, Maxim Krikun, Yuan Cao, Qin Gao, Klaus Macherey, et al. Google’s neural machine translation system: Bridging the gap between human and machine translation. arXiv preprint arXiv:1609.08144, 2016.
|
| 261 |
+
|
| 262 |
+
Lingxi Xie, Jingdong Wang, Zhen Wei, Meng Wang, and Qi Tian. Disturblabel: Regularizing cnn on the loss layer. arXiv preprint arXiv:1605.00055, 2016.
|
| 263 |
+
|
| 264 |
+
Wojciech Zaremba, Ilya Sutskever, and Oriol Vinyals. Recurrent neural network regularization. arXiv preprint arXiv:1409.2329, 2014.
|
| 265 |
+
|
| 266 |
+
Jie Zhou, Ying Cao, Xuguang Wang, Peng Li, and Wei Xu. Deep recurrent models with fast-forward connections for neural machine translation. arXiv preprint arXiv:1606.04199, 2016.
|
| 267 |
+
|
| 268 |
+
Julian Georg Zilly, Rupesh Kumar Srivastava, Jan Koutn´ık, and Jurgen Schmidhuber. Recurrent ¨ highway networks. arXiv preprint arXiv:1607.03474, 2016.
|
| 269 |
+
|
| 270 |
+
# APPENDIX
|
| 271 |
+
|
| 272 |
+
# 6 GRADIENT NORMS
|
| 273 |
+
|
| 274 |
+

|
| 275 |
+
Figure 2: Norm of the gradient as training proceeds on the MNIST dataset. We plot the norm of the gradient while training with confidence penalty, dropout, label smoothing, and without regularization. We use early stopping on the validation set, which explains the difference in training steps between methods. Both confidence penalty and label smoothing result in smaller gradient norm.
|
md/train/HkgeGeBYDB/HkgeGeBYDB.md
ADDED
|
@@ -0,0 +1,327 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RAPP: NOVELTY DETECTION WITH RECONSTRUCTION ALONG PROJECTION PATHWAY
|
| 2 |
+
|
| 3 |
+
Ki Hyun Kim, Sangwoo Shim, Yongsub Lim, Jongseob Jeon,
|
| 4 |
+
Jeongwoo Choi, Byungchan Kim, Andre S. Yoon
|
| 5 |
+
MakinaRocks
|
| 6 |
+
{khkim, sangwoo, yongsub, jongseob.jeon}@makinarocks.ai
|
| 7 |
+
{jeongwoo, kbc8894, andre}@makinarocks.ai
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
We propose RAPP, a new methodology for novelty detection by utilizing hidden space activation values obtained from a deep autoencoder. Precisely, RAPP compares input and its autoencoder reconstruction not only in the input space but also in the hidden spaces. We show that if we feed a reconstructed input to the same autoencoder again, its activated values in a hidden space are equivalent to the corresponding reconstruction in that hidden space given the original input. We devise two metrics aggregating those hidden activated values to quantify the novelty of the input. Through extensive experiments using diverse datasets, we validate that RAPP improves novelty detection performances of autoencoder-based approaches. Besides, we show that RAPP outperforms recent novelty detection methods evaluated on popular benchmarks.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
How can we characterize novelty when only normality information is given? Novelty detection is the mechanism to decide whether a data sample is an outlier with respect to the training data. This mechanism is especially useful in situations where a proportion of detection targets is inherently small. Examples are fraudulent transaction detection (Pawar et al., 2014; Porwal & Mukund, 2018), intrusion detection (Lee, 2017; Aoudi et al., 2018), video surveillance (Ravanbakhsh et al., 2017; Xu et al., 2015b), medical diagnosis (Schlegl et al., 2017; Baur et al., 2018) and equipment failure detection (Kuzin & Borovicka, 2016; Zhao et al., 2017; Beghi et al., 2014). Recently, deep autoencoders and their variants have shown outstanding performances in finding compact representations from complex data, and the reconstruction error has been chosen as a popular metric for detecting novelty (An & Cho, 2015; Vasilev et al., 2018). However, this approach has a limitation of measuring reconstruction quality only in an input space, which does not fully utilize hierarchical representations in hidden spaces identified by the deep autoencoder.
|
| 16 |
+
|
| 17 |
+
In this paper, we propose RAPP, a new method of detecting novelty samples exploiting hidden activation values in addition to the input values and their autoencoder reconstruction values. While ordinary reconstruction-based methods carry out novelty detection by comparing differences between input data before the input layer and reconstructed data at the output layer, RAPP extends these comparisons to hidden spaces. We first collect a set of hidden activation values by feeding the original input to the autoencoder. Subsequently, we feed the autoencoder reconstructed input to the autoencoder to calculate another set of activation values in the hidden layers. This procedure does not need additional training of the autoencoder. In turn, we quantify the novelty of the input by aggregating these two sets of hidden activation values. To this end, we devise two metrics. The first metric measures the total amount of reconstruction errors in input and hidden spaces. The second metric normalizes the reconstruction errors before summing up. Note that RAPP falls back to the ordinary reconstruction-based method if we only aggregate input values before the input layer and the reconstructed values at the output layer.
|
| 18 |
+
|
| 19 |
+
Also, we explain the motivations that facilitated the development of RAPP. We show that activation values in a hidden space obtained by feeding a reconstructed input to the autoencoder are equivalent to the corresponding reconstruction in that hidden space for the original input. We refer the latter quantity as a hidden reconstruction of the input. Note that this is a natural extension of the reconstruction to the hidden space. Unfortunately, we cannot directly compute the hidden reconstruction as in the computation of the ordinary reconstruction because the autoencoder does not impose any correspondence between encoding-decoding pairs of hidden layers during the training. Nevertheless, we show that it can be computed by feeding a reconstructed input to the autoencoder again. Consequently, RAPP incorporates hidden reconstruction errors as well as the ordinary reconstruction error in detecting novelty.
|
| 20 |
+
|
| 21 |
+
With extensive experiments, we demonstrate using diverse datasets that our method effectively improves autoencoder-based novelty detection methods. In addition, we show by evaluating on popular benchmark datasets that RAPP outperforms competing methods recently developed.
|
| 22 |
+
|
| 23 |
+
Our contributions are summarized as follows.
|
| 24 |
+
|
| 25 |
+
• We propose a new novelty detection method by utilizing hidden activation values of an input and its autoencoder reconstruction, and provide aggregation functions for them to quantify novelty of the input. We provide motivation that RAPP extends the reconstruction concept in the input space into the hidden spaces. Precisely, we show that hidden activation values of a reconstructed input are equivalent to the corresponding hidden reconstruction of the original input. We demonstrate that RAPP improves autoencoder-based novelty detection methods in diverse datasets. Moreover, we validate that RAPP outperforms recent novelty detection methods on popular benchmark datasets.
|
| 26 |
+
|
| 27 |
+
# 2 RELATED WORK
|
| 28 |
+
|
| 29 |
+
Various novelty detection methods with deep neural networks rely on the reconstruction error (Sakurada & Yairi, 2014; Hoffmann, 2007; An & Cho, 2015), because discriminative learning schemes are not suitable for highly class-imbalanced data which is common in practice. Unsupervised and semi-supervised learning approaches handle such imbalance by focusing on the characterization of normality and detecting samples out of the normality.
|
| 30 |
+
|
| 31 |
+
Variational Autoencoders (VAE) (Kingma & Welling, 2014) were reported to outperform vanilla autoencoders for novelty detection based on reconstruction error (An & Cho, 2015). To carry out the novelty detection outlined in this approach, an autoencoder needs to be trained only with normal data. The autoencoder encodes the training data, which comprises of only normal data in this case, into a lower-dimensional space and decodes them to the input space. To test novelty, an input value is fed to the autoencoder to produce a reconstructed value and calculate the distance between the input and reconstructed values. This distance is the reconstruction error. A higher reconstruction error means that the input value cannot be encoded onto the lower-dimensional space that represents normal data. Therefore, the input value can be marked as a novelty if its reconstruction error exceeds a certain threshold.
|
| 32 |
+
|
| 33 |
+
Instead of autoencoders, Generative Adversarial Networks (GAN) have been also suggested to model a distribution of normal data (Sabokrou et al., 2018; Schlegl et al., 2017). Despite the same purpose of discovering a simpler, lower-dimensional representation, the training criterion for GAN is focusing on the quality of data generation rather than the reconstruction quality of training data. Recently, several pieces of research have combined autoencoders and adversarial learning to meet both criteria in dimension reduction and data generation (Haloui et al., 2018; Pidhorskyi et al., 2018; Zenati et al., 2018). One limitation of these methods based on the ordinary reconstruction error is that they do not exploit all the information available along the projection pathway of deep autoencoders. We will explain how to leverage this information for novelty detection in the next section.
|
| 34 |
+
|
| 35 |
+
From the viewpoint of the diversity and ratio of the normal data in novelty detection, there are two cases available. The first case is when a small fraction of classes are normal. This case has been studied in a one-class classification context, and usually evaluated by organizing training data into a collection of samples belonging to a small number of normal classes (Ruff et al., 2018; Perera & Patel, 2018; Sabokrou et al., 2018; Golan & El-Yaniv, 2018). The second case is when a majority of classes are assigned as normal (An & Cho, 2015; Schlegl et al., 2017; Haloui et al., 2018; Zenati et al., 2018). In this case, normal data is more diverse, and the training data is consist of samples of a relatively large number of normal classes: e.g., nine digits of MNIST. One setup does not dominate the other, but depending on applications, either can be more suitable than the other. Different methods may perform differently in both cases. In this paper, we evaluate RAPP and other competing methods with experiments in both setups.
|
| 36 |
+
|
| 37 |
+
# 3 PROPOSED METHOD: RAPP
|
| 38 |
+
|
| 39 |
+
In this section, we describe the proposed novelty detection method RAPP based on an autoencoder. The main idea is to compare hidden activations of an input and its hidden reconstructions along the projection pathway of the autoencoder. To be precise, we project the input and its autoencoder reconstruction onto the hidden spaces to obtain pairs of activation values, and aggregate them to quantify the novelty of the input. For the aggregation, we present two metrics to measure the total amount of difference within each pair.
|
| 40 |
+
|
| 41 |
+
# 3.1 RECONSTRUCTION BASED NOVELTY DETECTION
|
| 42 |
+
|
| 43 |
+
An autoencoder $A$ is a neural network consisting of an encoder $g$ and a decoder $f$ , responsible for dimension reduction and its inverse mapping to the original input space, respectively: i.e. $A = f \circ g$ . For the purpose, training the autoencoder aims to minimize difference between its input $x$ and output $A ( x )$ . The space that the encoder $g$ constitutes is called the latent space, and provides more concise representation for data than the input space.
|
| 44 |
+
|
| 45 |
+
Due to this unsupervised representation learning property, the autoencoder has been widely used for novelty detection. Specifically, training an autoencoder on normal data samples, novelty of a test sample $x$ is measured by the following reconstruction error $\epsilon$ :
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\epsilon = \| x - A ( x ) \| _ { 2 } .
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
The test sample $x$ is more likely to be novel as the error $\epsilon ( x )$ becomes larger, because it means that $x$ is farther from the manifold that the autoencoder describes.
|
| 52 |
+
|
| 53 |
+
Although this approach has shown promising results in novelty detection, the reconstruction error alone does not fully exploit information provided by a trained autoencoder especially when its architecture is deep. In other words, hierarchical information identified by the deep architecture is being ignored. This is rather unfortunate because hierarchical representation learning is one of the most successfully proven capabilities of deep neural networks.
|
| 54 |
+
|
| 55 |
+
To fully leverage that capability, below we will describe the way to exploit hidden spaces to capture the difference between normal and novel samples in more detail.
|
| 56 |
+
|
| 57 |
+
# 3.2 RECONSTRUCTION ERROR IN HIDDEN SPACES
|
| 58 |
+
|
| 59 |
+
Let $A = f \circ g$ be a trained autoencoder where $g$ and $f$ are an encoder and a decoder, and $\ell$ be the number of hidden layers of $g$ . Namely, $g = g _ { \ell } \circ \cdots \circ g _ { 1 }$ . We define partial computation of $g$ as follows:
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
g _ { : i } = g _ { i } \circ \cdots \circ g _ { 1 } ,
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
Let $x$ be an input vector, and $\hat { x }$ be its reconstruction by $A$ : i.e., ${ \hat { x } } = A ( x )$ . In addition to comparing $x$ and $\hat { x }$ in the input space, as the ordinary approach does, we examine them in hidden spaces along a projection pathway of $A$ . More precisely, feeding $x$ and $\hat { x }$ into $A$ , we obtain pairs $( h _ { i } , \hat { h } _ { i } )$ of their hidden representations where
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\begin{array} { l } { { h _ { i } ( x ) = g _ { : i } ( x ) , } } \\ { { \hat { h } _ { i } ( x ) = g _ { : i } ( \hat { x } ) = g _ { : i } ( A ( x ) ) . } } \end{array}
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
Figure 1a illustrates the procedure of computing $h _ { i }$ and $\hat { h } _ { i }$ . As a result, novelty of the sample $x$ is quantified by aggregating $H ( x ) = \{ ( h _ { i } ( x ) , \hat { h } _ { i } ( x ) ) : 1 \leq i \leq \ell \}$ .
|
| 72 |
+
|
| 73 |
+
The overall procedure of RAPP is summarized in Algorithm 1. To clearly state the required variables to construct $H$ , we write the algorithm with the for loop in Lines 3–5, but in practice, all of them
|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
Figure 1: (a) Computation of $h _ { i } ( x )$ and $\hat { h } _ { i } ( x )$ . The reconstruction $\hat { x }$ is fed to the same autoencoder that produced itself. (b) Motivation of RAPP. The quantity that RAPP computes, the hidden activation of the reconstruction input, is equivalent to the hidden reconstruction of the input. If $\tilde { f } = f$ , computing $\hat { h } _ { 2 } ^ { \prime } ( x ) = \hat { h } _ { 2 } ( x )$ does not require explicitly evaluating $\tilde { f } _ { i }$ but only $g _ { i }$ and $f = { \tilde { f } }$ .
|
| 77 |
+
|
| 78 |
+
Algorithm 1: RAPP to compute a novelty score.
|
| 79 |
+
|
| 80 |
+
Input : Sample $x$ , trained autoencoder $A = f \circ g$ , the number of layers $\ell$ , and aggregation $s$ . Output: Novelty score $S$ . 1 ${ \hat { x } } = A ( x )$ . 2 $H = \varnothing$ . 3 foreach $i$ in 1 to $\ell$ do 4 $H = H \cup \{ ( g _ { : i } ( x ) , g _ { : i } ( \hat { x } ) ) \}$ . 5 end 6 $S = s ( H )$ .
|
| 81 |
+
|
| 82 |
+
can be computed by feed-forwarding one time each of $x$ and $\hat { x }$ to $g$ . Note that RAPP is indeed a generalization of the ordinary reconstruction method with defining $g _ { 0 }$ as the identity function and $s _ { o r d }$ as follows.
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
s _ { o r d } ( H ( x ) ) = \| h _ { 0 } ( x ) - \hat { h } _ { 0 } ( x ) \| _ { 2 } ^ { 2 } ,
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
where $h _ { 0 } ( x ) = g _ { 0 } ( x ) = x$ and $\hat { h } _ { 0 } ( x ) = g _ { 0 } ( \hat { x } ) = \hat { x } .$
|
| 89 |
+
|
| 90 |
+
In this paper, we provide two metrics $s _ { S A P }$ and $s N A P$ which more extensively utilize $H$ than $s _ { o r d }$ . Those are especially suited when no prior knowledge exists for the selection of layers to derive a novelty metric, which commonly happens when modeling with deep neural networks. Note that, however, more elaborate metrics can be designed if we have knowledge on or can characterize the spaces.
|
| 91 |
+
|
| 92 |
+
# 3.2.1 SIMPLE AGGREGATION ALONG PATHWAY (SAP)
|
| 93 |
+
|
| 94 |
+
This is the most straightforward metric that one can define on $H$ . For a data sample $x$ , SAP is defined by summing the square of Euclidean distances for all pairs in $H$ :
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
s _ { S A P } ( x ) = \sum _ { i = 0 } ^ { \ell } \| h _ { i } ( x ) - \hat { h } _ { i } ( x ) \| _ { 2 } ^ { 2 } = \| \mathbf { h } ( x ) - \hat { \mathbf { h } } ( x ) \| _ { 2 } ^ { 2 } ,
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where $\mathbf { h } ( x )$ and $\hat { \mathbf { h } } ( x )$ are the concatenations of $[ h _ { 0 } ( x ) , \cdot \cdot \cdot , h _ { \ell } ( x ) ]$ and $[ \hat { h } _ { 0 } ( x ) ; \cdot \cdot \cdot ; \hat { h } _ { \ell } ( x ) ]$ , respectively.
|
| 101 |
+
|
| 102 |
+
# 3.2.2 NORMALIZED AGGREGATION ALONG PATHWAY (NAP)
|
| 103 |
+
|
| 104 |
+
Although SAP is intuitive, it does not consider properties of hidden spaces; distance distributions of pairs in $H$ may be different depending on the individual hidden spaces. For instance, the magnitude of distances can depend on layers, or there may exist correlated neurons even across layers which are unintentionally emphasized in SAP. To capture clearer patterns, we propose to normalize the distances via two steps: orthogonalization and scaling.
|
| 105 |
+
|
| 106 |
+
Let ${ \bf d } ( x ) = { \bf h } ( x ) - \hat { { \bf h } } ( x )$ ; given a training set $X$ , let $\mathbf { D }$ be a matrix whose $i$ -th row corresponds to $\mathbf { d } ( x _ { i } )$ for $x _ { i } \in X$ , and $\bar { \bf D }$ be the column-wise centered matrix of $\mathbf { D }$ . For the normalization, we compute $\bar { \mathbf { D } } = U \Sigma V ^ { \top }$ , SVD of $\bar { \bf D }$ , to obtain its singular values $\Sigma$ and right singular vectors $V$ . For a given data sample $x$ , we define $s N A P$ as follows:
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
s _ { N A P } ( \boldsymbol { x } ) = \| \left( \mathbf { d } ( \boldsymbol { x } ) - \mu _ { \boldsymbol { X } } \right) ^ { \top } \boldsymbol { V } \boldsymbol { \Sigma } ^ { - 1 } \| _ { 2 } ^ { 2 } ,
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
where $\mu _ { X }$ is the column-wise mean of $D$ , and $\mathbf { d } ( x )$ is expressed as a column vector. Note that $s N A P$ is equal to the Mahalanobis distance with the covariance matrix $V \Sigma \Sigma V ^ { \top }$ . Although SVD computation time is quadratic in the number of columns of the target matrix, we observe that its impact is relatively small in practical setups. See Appendix A for more details.
|
| 113 |
+
|
| 114 |
+
# 4 MOTIVATION OF RAPP
|
| 115 |
+
|
| 116 |
+
One natural question in using the ordinary reconstruction method is as follows: why do we investigate only the input space? Or, why do we not use information in hidden spaces? While the reconstruction error in the input space is extensively employed, any similar concept does not exist in hidden spaces. One reason is that the corresponding encoding and decoding layers are not guaranteed to express the same space: e.g. permuted dimensions. This is because the autoencoder objective does not have any term involving activations from intermediate hidden layers. As a result, $f _ { \ell : i + 1 } ( g ( x ) )$ cannot be considered a reconstruction of $g _ { : i } ( x )$ , except for $i = 0$ with which they become the ordinary reconstruction of and input to an autoencoder, respectively.
|
| 117 |
+
|
| 118 |
+
Nevertheless, in this section, we will show that there is an indirect way to compute the hidden reconstruction. Precisely, we will show that $\hat { h } _ { i } ( x ) = g _ { : i } ( A ( x ) )$ is indeed equivalent to a reconstruction of $g _ { : i } ( x )$ . The overall mechanism is depicted in Figure 1b.
|
| 119 |
+
|
| 120 |
+
# 4.1 COMPUTATION OF HIDDEN RECONSTRUCTION
|
| 121 |
+
|
| 122 |
+
Let $A = f \circ g$ be a trained autoencoder, and $M _ { 0 } = \{ A ( x ) : x \in \mathbb { R } ^ { n } \}$ be the low dimensional manifold that $A$ describes (Pidhorskyi et al., 2018): i.e.,
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
\forall x \in M _ { 0 } , x = A ( x ) .
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
Defining $M _ { i } = \{ g _ { : i } ( x ) : x \in M _ { 0 } \}$ , which is the low dimensional image of $M _ { 0 }$ defined by $g _ { : i } , g$ and $f$ restricted on $M _ { 0 }$ and $M _ { \ell }$ , respectively, are inverse functions of each other.
|
| 129 |
+
|
| 130 |
+
Quantifying Hidden Reconstruction We first assume that there exists a decoder $\tilde { f } = \tilde { f } _ { 1 } \circ \cdots \circ \tilde { f } _ { \ell }$ such that
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\begin{array} { r l } & { \forall x \in M _ { \ell } , \ \tilde { f } ( x ) = f ( x ) , } \\ & { \forall a \in M _ { i } , \ a = ( g _ { i } \circ \tilde { f } _ { i } ) ( a ) . } \end{array}
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
The second condition makes $\tilde { f } _ { \ell : i + 1 }$ a proper decoder corresponding to $g _ { i + 1 } .$ , and thus, $\tilde { f }$ enables to define the $i$ -th hidden reconstruction $\hat { h } _ { i } ^ { \prime } ( x )$ as follows:
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\hat { h } _ { i } ^ { \prime } ( x ) = ( \tilde { f } _ { \ell : i + 1 } \circ g _ { i + 1 : } ) ( h _ { i } ( x ) ) .
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
Finally, we conclude that $\hat { h } _ { i } ^ { \prime } ( x )$ is equal to $\hat { h } _ { i } ( x )$ for $x \in M _ { 0 }$ as follows.
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
\begin{array} { r l } & { \hat { h } _ { i } ^ { \prime } ( x ) = ( \tilde { f } _ { \ell : i + 1 } \circ g _ { i + 1 : } ) ( h _ { i } ( x ) ) = ( \tilde { f } _ { \ell : i + 1 } \circ g ) ( x ) } \\ & { \qquad = ( g _ { : i } \circ \tilde { f } \circ g ) ( x ) } \\ & { \qquad = ( g _ { : i } \circ A ) ( x ) = h _ { i } ( \hat { x } ) = \hat { h } _ { i } ( x ) . } \end{array}
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
where we do not need $\tilde { f } _ { i }$ for computing $\hat { h } _ { i } ^ { \prime } ( x )$ , but only $g _ { i }$ and $f$ . Note that for $x \in M _ { 0 }$ already on the manifold, its $i$ -th hidden reconstruction $\hat { h } _ { i } ^ { \prime } ( x )$ becomes equal to its corresponding hidden input $h _ { i } ( x ) = \hat { h } _ { i } ( x )$ for every $1 \leq i \leq \ell$ : i.e. $h _ { i } ( x ) = \hat { h } _ { i } ^ { \prime } ( x )$ as $x = A ( x )$ . For $x \notin M _ { 0 }$ , its hidden reconstruction $\hat { h } _ { i } ^ { \prime } ( x )$ will differ from the input $h _ { i } ( x )$ .
|
| 149 |
+
|
| 150 |
+
Table 1: Description of datasets used in our evaluation.
|
| 151 |
+
|
| 152 |
+
<table><tr><td>Name</td><td># Samples</td><td>#Features</td><td># Class</td><td>Domain</td><td>Novelty Target</td></tr><tr><td>MI-F</td><td>25,286</td><td>58</td><td>2</td><td>CNC milling</td><td>Machine not completed</td></tr><tr><td>MI-V</td><td>23,125</td><td>58</td><td></td><td>CNC milling</td><td>Workpiece out-of-spec</td></tr><tr><td>EOPT</td><td>90.515</td><td>20</td><td></td><td>Storage system</td><td>System failures</td></tr><tr><td>NASA</td><td>4,687</td><td>33</td><td></td><td>Astronomy</td><td>Hazardous asteroids</td></tr><tr><td>RARM</td><td>20.221</td><td>6</td><td>22227</td><td>Robotics</td><td>Malfunctions</td></tr><tr><td>STL</td><td>1,941</td><td>27</td><td></td><td>Steel</td><td>Surface defects</td></tr><tr><td>OTTO</td><td>61,878</td><td>93</td><td>9</td><td>E-commerce</td><td>Types of products</td></tr><tr><td>SNSR</td><td>58,509</td><td>48</td><td>11</td><td>Electric Currents</td><td>Defective conditions</td></tr><tr><td>MNIST</td><td>70,000</td><td>784</td><td>10</td><td>Hand written digits</td><td>Digits</td></tr><tr><td>F-MNIST</td><td>70,000</td><td>784</td><td>10</td><td>Fashion articles</td><td>Articles</td></tr></table>
|
| 153 |
+
|
| 154 |
+
Existence of $\tilde { f }$ Since $x = A ( x )$ for $x \in M _ { 0 }$ , $g _ { i }$ and $f _ { i }$ are one-to-one functions from $M _ { i - 1 }$ and $M _ { i }$ , respectively. Let us define $\tilde { f } _ { i } = g _ { i } ^ { - 1 }$ for $M _ { i }$ ; then it also holds $\tilde { f } = g ^ { - 1 }$ for $M _ { \ell }$ . This implies $x = ( { \tilde { f } } \circ g ) ( x )$ for $x \in M _ { 0 }$ , and consequently, $\tilde { f } = f$ on $M _ { \ell }$ . This definition of $\tilde { f } _ { i }$ satisfies the two conditions above, and as discussed, we are able to compute hidden reconstructions given an input $x$ , through computing the $i$ -th hidden activation of the reconstructed input: i.e. $\hat { h } _ { i } ^ { \prime } ( x ) = ( g _ { : i } \circ A ) ( x ) =$ $\hat { h } _ { i } ( x )$ .
|
| 155 |
+
|
| 156 |
+
Existence of $\tilde { f }$ with Neural Networks Given $g _ { i }$ , if the symmetric architecture for $\tilde { f } _ { i }$ is used, we may not be able to learn $\tilde { f _ { i } } = g _ { i } ^ { - 1 }$ . Neural networks are, however, highly flexible frameworks in which we can deal with models of arbitrary function forms by adjusting network architecture. This property enables us to design a layer capable of representing $\bar { \tilde { f } _ { i } }$ . For instance, even if $\tilde { f } _ { i }$ is too complicated to be represented with a single fully connected layer, we can still approximate $\tilde { f } _ { i }$ by stacking multiple layers. Hence, given $g _ { i }$ , $\tilde { f } _ { i }$ can be represented by neural networks.
|
| 157 |
+
|
| 158 |
+
# 5 EVALUATION
|
| 159 |
+
|
| 160 |
+
In this section, we evaluate RAPP in comparison to existing methods. To this end, we tested the methods on several benchmarks and diverse datasets collected from Kaggle and the UCI repository which are suitable for evaluating novelty detection methods.
|
| 161 |
+
|
| 162 |
+
# 5.1 DATASETS AND PROBLEM SETUPS
|
| 163 |
+
|
| 164 |
+
The datasets from Kaggle and the UCI repository are chosen from problem sets of anomaly detection and multi-class classification, summarized in Table 1. We note that MI-F and MI-V share the same feature matrix, but are considered to be different datasets because their labels normal and abnormal are assigned by different columns: i.e. machine completed and pass visual inspection, respectively. We use these datasets to compare RAPP with standard autoencoder-based methods described in Section 5.2.
|
| 165 |
+
|
| 166 |
+
To compare RAPP with novelty detection methods in recent literatures, we also use popular benchmark datasets for evaluating deep learning techniques: MNIST (LeCun & Cortes, 2010) and FMNIST (Xiao et al., 2017). For theses datasets, we do not take pre-split training and test sets, but instead merge them for post-processing.
|
| 167 |
+
|
| 168 |
+
Novelty detection detects novel patterns by focusing on deviations from model-learned normal patterns. Thus, training sets contain only normal samples and test sets contain both normal and anomaly samples in our evaluation setups. Precisely, if a dataset contains an anomaly label, we assign all samples with that label to the test set for detection. If a dataset does not have any anomaly labels, we consider the following two setups.
|
| 169 |
+
|
| 170 |
+
• Multimodal Normality: A single class is chosen to be the novelty class and the remaining classes are assigned as the normal class. This setup is repeated to produce sub-datasets with all possible novelty assignments. For instance, MNIST results in a set of datasets with 10 different novelty classes.
|
| 171 |
+
|
| 172 |
+
• Unimodal Normality: In contrast to the multimodal normality setup, we take one class for normality, and the others for novelty. For instance, MNIST results in a set of datasets with 10 different normal classes.
|
| 173 |
+
|
| 174 |
+
We applied these two setups to STL, OTTO, SNSR, MNIST, and F-MNIST datasets.
|
| 175 |
+
|
| 176 |
+
# 5.2 COMPARISON METHOD
|
| 177 |
+
|
| 178 |
+
We compare RAPP and the other methods using Area Under Receiver Operating Characteristic (AUROC). Note that we do not employ thresholding-based metrics such as $F 1$ score because access to abnormal samples is only allowed in testing time. Hence, we focus on the separability of models for novelty with AUROC.
|
| 179 |
+
|
| 180 |
+
For the datasets in Table 1, we compare the effectiveness of the reconstruction error, SAP and NAP for three models: Autoencoder (AE), Variational Autoencoder (VAE), Adversarial Autoencoder (AAE) (Makhzani et al., 2016). For the benchmark datasets, recent approaches including OCNN (Chalapathy et al., 2018), GPND (Pidhorskyi et al., 2018), DSVDD (Ruff et al., 2018) and GT (Golan & El-Yaniv, 2018) are available. To obtain the performances of the existing approaches, we downloaded their codes and applied against our problem setups.
|
| 181 |
+
|
| 182 |
+
For MNIST and F-MNIST, we create test sets of novelty ratios $3 5 \%$ for the multimodal setup and $50 \%$ for the unimodal setup, where novelty samples in the test sets are randomly selected from given novelty classes. For the other datasets, we take all samples in given novelty classes to create test sets. Note that the expectation value of AUROC is invariant to the novelty ratio.
|
| 183 |
+
|
| 184 |
+
# 5.3 IMPLEMENTATION DETAILS
|
| 185 |
+
|
| 186 |
+
We use symmetric architecture with fully-connected layers for the three base models, AE, VAE, and AAE. Each encoder and decoder has 10 layers with different bottleneck size. For the Kaggle and UCI datasets, we carry out PCA for each dataset first. The minimum number of principal components that explain at least $90 \%$ of the variance is selected as the bottleneck size of the autoencoders. We set bottleneck size to 20 for benchmark datasets. Leaky-ReLU (Xu et al., 2015a) activation and batch normalization (Ioffe & Szegedy, 2015) layers are appended to all layers except the last layer.
|
| 187 |
+
|
| 188 |
+
We train AE, VAE and AAE with Adam optimizer (Kingma & Ba, 2015), and select the model with the lowest validation loss as the best model. For training stability of VAE, 10 Monte Carlo samples were averaged in the reparamterization trick (Kingma & Welling, 2014) to obtain reconstruction from the decoder. In the calculation of SAP and NAP, we excluded reconstructions in the input space for MNIST and F-MNIST.
|
| 189 |
+
|
| 190 |
+
# 5.4 RESULTS
|
| 191 |
+
|
| 192 |
+
Each AUROC score is obtained by averaging AUROC scores from multiple trials to reduce the random errors in training neural networks: 5 trials for MNIST and F-MNIST, and 20 trials for the other datasets. More results are provided in Appendix: standard deviations in Appendix B, comparison to baselines other than autoencoder variants C, and the effect of varying hidden layers involved in RAPP computation in Appendix D.
|
| 193 |
+
|
| 194 |
+
# 5.4.1 COMPARISON WITH BASELINES
|
| 195 |
+
|
| 196 |
+
Table 2 summarizes the result of our performance evaluation; the best score for each model is in bold, and the best score for each dataset with an underline. Since STL, OTTO, SNSR, MNIST, and F-MNIST do not have anomaly labels, their scores are averaged over all possible anomaly class assignments. For instance, the AUROC value for OTTO in the unimodal normality setup is the average of 9 AUROC values with different novelty class assignments.
|
| 197 |
+
|
| 198 |
+
In Table 2, RAPP shows the highest AUROC scores for most of the cases. If we examine the performance for each dataset, RAPP achieves the best for 10 cases out of 15 (see the underlines).
|
| 199 |
+
|
| 200 |
+
Table 2: AUROC of RAPP and the baselines.
|
| 201 |
+
|
| 202 |
+
<table><tr><td rowspan="2">Dataset</td><td colspan="3">AE</td><td colspan="3">VAE</td><td colspan="3">AAE</td></tr><tr><td>Recon</td><td>SAP</td><td>NAP</td><td>Recon</td><td>SAP</td><td>NAP</td><td>Recon</td><td>SAP</td><td>NAP</td></tr><tr><td colspan="10">Multimodal Normality</td></tr><tr><td>STL</td><td>0.723</td><td>0.703</td><td>0.711</td><td>0.700</td><td>0.675</td><td>0.711</td><td>0.726</td><td>0.711</td><td>0.724</td></tr><tr><td>OTTO</td><td>0.617</td><td>0.616</td><td>0.665</td><td>0.630</td><td>0.631</td><td>0.649</td><td>0.617</td><td>0.618</td><td>0.665</td></tr><tr><td>SNSR</td><td>0.613</td><td>0.611</td><td>0.614</td><td>0.608</td><td>0.620</td><td>0.658</td><td>0.612</td><td>0.608</td><td>0.609</td></tr><tr><td>MNIST</td><td>0.825</td><td>0.881</td><td>0.899</td><td>0.900</td><td>0.965</td><td>0.965</td><td>0.847</td><td>0.911</td><td>0.929</td></tr><tr><td>F-MNIST</td><td>0.712</td><td>0.725</td><td>0.734</td><td>0.725</td><td>0.728</td><td>0.755</td><td>0.721</td><td>0.710</td><td>0.727</td></tr><tr><td colspan="10">Unimodal Normality</td></tr><tr><td>MI-F</td><td>0.607</td><td>0.670</td><td>0.705</td><td>0.591</td><td>0.572</td><td>0.678</td><td>0.632</td><td>0.692</td><td>0.704</td></tr><tr><td>MI-V</td><td>0.897</td><td>0.898</td><td>0.907</td><td>0.845</td><td>0.833</td><td>0.903</td><td>0.895</td><td>0.891</td><td>0.904</td></tr><tr><td>EOPT</td><td>0.610</td><td>0.607</td><td>0.625</td><td>0.675</td><td>0.634</td><td>0.596</td><td>0.606</td><td>0.603</td><td>0.634</td></tr><tr><td>NASA</td><td>0.719</td><td>0.702</td><td>0.692</td><td>0.738</td><td>0.714</td><td>0.719</td><td>0.712</td><td>0.695</td><td>0.688</td></tr><tr><td>RARM</td><td>0.687</td><td>0.674</td><td>0.686</td><td>0.587</td><td>0.565</td><td>0.648</td><td>0.664</td><td>0.675</td><td>0.675</td></tr><tr><td>STL</td><td>0.870</td><td>0.856</td><td>0.830</td><td>0.850</td><td>0.824</td><td>0.792</td><td>0.875</td><td>0.861</td><td>0.830</td></tr><tr><td>OTTO</td><td>0.829</td><td>0.829</td><td>0.832</td><td>0.831</td><td>0.835</td><td>0.833</td><td>0.828</td><td>0.828</td><td>0.831</td></tr><tr><td>SNSR</td><td>0.979</td><td>0.982</td><td>0.990</td><td>0.975</td><td>0.979</td><td>0.964</td><td>0.979</td><td>0.983</td><td>0.991</td></tr><tr><td>MNIST</td><td>0.972</td><td>0.980</td><td>0.979</td><td>0.980</td><td>0.987</td><td>0.989</td><td>0.972</td><td>0.966</td><td>0.977</td></tr><tr><td>F-MNIST</td><td>0.924</td><td>0.928</td><td>0.933</td><td>0.926</td><td>0.926</td><td>0.942</td><td>0.922</td><td>0.905</td><td>0.928</td></tr></table>
|
| 203 |
+
|
| 204 |
+
Table 3: AUROC on benchmark datasets.
|
| 205 |
+
|
| 206 |
+
<table><tr><td>Dataset</td><td>OCNN</td><td>GPND</td><td>DSVDD</td><td>GT</td><td>NAPAE</td><td>NAPVAE</td><td>NAPAAE</td></tr><tr><td colspan="8">Multimodal Normality (Novelty] Ratio: 35%)</td></tr><tr><td>MNIST F-MNIST</td><td>0.600 0.609</td><td>0.501 0.691</td><td>0.622 0.610</td><td>0.893 0.725</td><td>0.899 0.734</td><td>0.965 0.755</td><td>0.929 0.727</td></tr><tr><td colspan="8">Unimodal Normality (Novelty ] Ratio: 50%)</td></tr><tr><td>MNIST</td><td>0.927</td><td>0.971</td><td>0.922</td><td>0.974</td><td>0.979</td><td>0.989</td><td>0.977</td></tr><tr><td>F-MNIST</td><td>0.915</td><td>0.917</td><td>0.923</td><td>0.935</td><td>0.933</td><td>0.942</td><td>0.928</td></tr></table>
|
| 207 |
+
|
| 208 |
+
# 5.4.2 COMPARISON WITH COMPETITORS
|
| 209 |
+
|
| 210 |
+
Table 3 summarizes the comparison of RAPP to recent novelty detection methods. As in Table 2, AUROC values are calculated by averaging results from 10 cases with different anomaly class assignments for both datasets.
|
| 211 |
+
|
| 212 |
+
Except for the unimodal F-MNIST setup, NAP outperforms all competing methods regardless of base model choice. Notably, NAP combined with VAE always shows the best performance, which is even higher than that of GT relying on image-specific data transformations for all cases.
|
| 213 |
+
|
| 214 |
+
# 6 CONCLUSION
|
| 215 |
+
|
| 216 |
+
In this paper, we propose a novelty detection method which utilizes hidden reconstructions along a projection pathway of deep autoencoders. To this end, we extend the concept of reconstruction in the input space to hidden spaces found by an autoencoder and present a tractable way to compute the hidden reconstructions, which requires neither modifying nor retraining the autoencoder. Our experimental results show that the proposed method outperforms other competing methods in terms of AUROC for diverse datasets including popular benchmarks.
|
| 217 |
+
|
| 218 |
+
# REFERENCES
|
| 219 |
+
|
| 220 |
+
Jinwon An and Sungzoon Cho. Variational autoencoder based anomaly detection using reconstruction probability. SNUDM-TR, Mar 2015.
|
| 221 |
+
|
| 222 |
+
Wissam Aoudi, Mikel Iturbe, and Magnus Almgren. Truth will out: Departure-based processlevel detection of stealthy attacks on control systems. In Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security. ACM, 2018.
|
| 223 |
+
|
| 224 |
+
Christoph Baur, Benedikt Wiestler, Shadi Albarqouni, and Nassir Navab. Deep autoencoding models for unsupervised anomaly segmentation in brain mr images. MICCAI, 2018.
|
| 225 |
+
|
| 226 |
+
Alessandro Beghi, Luca Cecchinato, C Corazzol, Mirco Rampazzo, F Simmini, and Gian Antonio Susto. A one-class svm based tool for machine learning novelty detection in hvac chiller systems. IFAC Proceedings Volumes (IFAC-PapersOnline), 19:1953–1958, 2014.
|
| 227 |
+
|
| 228 |
+
Raghavendra Chalapathy, Aditya Krishna Menon, and Sanjay Chawla. Anomaly detection using one-class neural networks. arXiv preprint arXiv:1802.06360, 2018.
|
| 229 |
+
|
| 230 |
+
EOPT. https://www.kaggle.com/init-owl/high-storage-system-data-for-energy-optimization.
|
| 231 |
+
|
| 232 |
+
F-MNIST. https://github.com/zalandoresearch/fashion-mnist.
|
| 233 |
+
|
| 234 |
+
Izhak Golan and Ran El-Yaniv. Deep anomaly detection using geometric transformations. NIPS, 2018.
|
| 235 |
+
|
| 236 |
+
Ilyass Haloui, Jayant Sen Gupta, and Vincent Feuillard. Anomaly detection with Wasserstein GAN. arXiv e-prints, art. arXiv:1812.02463, Dec 2018.
|
| 237 |
+
|
| 238 |
+
Heiko Hoffmann. Kernel pca for novelty detection. Pattern recognition, 40(3):863–874, 2007.
|
| 239 |
+
|
| 240 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, volume 37, pp. 448–456, 2015.
|
| 241 |
+
|
| 242 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
|
| 243 |
+
|
| 244 |
+
Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In ICLR, 2014.
|
| 245 |
+
|
| 246 |
+
Tomas Kuzin and Tom ´ as Borovicka. Early failure detection for predictive maintenance of sensor ´ parts. In ITAT, 2016.
|
| 247 |
+
|
| 248 |
+
Yann LeCun and Corinna Cortes. MNIST handwritten digit database. 2010. URL http://yann. lecun.com/exdb/mnist/.
|
| 249 |
+
|
| 250 |
+
D. Lee. Anomaly detection in multivariate non-stationary time series for automatic dbms diagnosis. In ICMLA, 2017.
|
| 251 |
+
|
| 252 |
+
Alireza Makhzani, Jonathon Shlens, Navdeep Jaitly, and Ian Goodfellow. Adversarial autoencoders. In International Conference on Learning Representations, 2016. URL http://arxiv.org/ abs/1511.05644.
|
| 253 |
+
|
| 254 |
+
MI. https://www.kaggle.com/shasun/tool-wear-detection-in-cnc-mill.
|
| 255 |
+
|
| 256 |
+
MNIST. http://yann.lecun.com/exdb/mnist/.
|
| 257 |
+
|
| 258 |
+
NASA. https://www.kaggle.com/shrutimehta/nasa-asteroids-classification.
|
| 259 |
+
|
| 260 |
+
OTTO. https://www.kaggle.com/c/otto-group-product-classification-challenge.
|
| 261 |
+
|
| 262 |
+
Anuradha Vijay Pawar, Prakash N. Kalavadekar, and Ms. Swapnali N. Tambe. A survey on outlier detection techniques for credit card fraud detection. IOSR Journal of Computer Engineering, 16: 44–48, 2014.
|
| 263 |
+
|
| 264 |
+
Pramuditha Perera and Vishal M. Patel. Learning deep features for one-class classification. CoRR, abs/1801.05365, 2018.
|
| 265 |
+
|
| 266 |
+
Stanislav Pidhorskyi, Ranya Almohsen, and Gianfranco Doretto. Generative probabilistic novelty detection with adversarial autoencoders. In NeurIPS, pp. 6823–6834, 2018.
|
| 267 |
+
|
| 268 |
+
Utkarsh Porwal and Smruthi Mukund. Credit card fraud detection in e-commerce: An outlier detection approach. CoRR, abs/1811.02196, 2018.
|
| 269 |
+
|
| 270 |
+
RARM. https://github.com/narayave/mh5 anomaly detector.
|
| 271 |
+
|
| 272 |
+
M. Ravanbakhsh, M. Nabi, E. Sangineto, L. Marcenaro, C. Regazzoni, and N. Sebe. Abnormal event detection in videos using generative adversarial nets. In 2017 IEEE International Conference on Image Processing (ICIP), 2017.
|
| 273 |
+
|
| 274 |
+
Lukas Ruff, Robert Vandermeulen, Nico Goernitz, Lucas Deecke, Shoaib Ahmed Siddiqui, Alexander Binder, Emmanuel Muller, and Marius Kloft. Deep one-class classification. In ¨ ICML, 2018.
|
| 275 |
+
|
| 276 |
+
Mohammad Sabokrou, Mohammad Khalooei, Mahmood Fathy, and Ehsan Adeli. Adversarially learned one-class classifier for novelty detection. In CVPR, pp. 3379–3388, 2018.
|
| 277 |
+
|
| 278 |
+
Mayu Sakurada and Takehisa Yairi. Anomaly detection using autoencoders with nonlinear dimensionality reduction. In MLSDA, 2014.
|
| 279 |
+
|
| 280 |
+
Thomas Schlegl, Philipp Seebock, Sebastian M. Waldstein, Ursula Schmidt-Erfurth, and Georg ¨ Langs. Unsupervised anomaly detection with generative adversarial networks to guide marker discovery. In IPMI, 2017.
|
| 281 |
+
|
| 282 |
+
SNSR. https://archive.ics.uci.edu/ml/datasets/dataset+for+sensorless+drive+diagnosis.
|
| 283 |
+
|
| 284 |
+
STL. https://www.kaggle.com/uciml/faulty-steel-plates.
|
| 285 |
+
|
| 286 |
+
Aleksei Vasilev, Vladimir Golkov, Marc Meissner, Ilona Lipp, Eleonora Sgarlata, Valentina Tomassini, Derek K. Jones, and Daniel Cremers. q-Space Novelty Detection with Variational Autoencoders. arXiv, Jun 2018.
|
| 287 |
+
|
| 288 |
+
Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. CoRR, abs/1708.07747, 2017. URL http://arxiv.org/ abs/1708.07747.
|
| 289 |
+
|
| 290 |
+
Bing Xu, Naiyan Wang, Tianqi Chen, and Mu Li. Empirical evaluation of rectified activations in convolutional network. arXiv, abs/1505.00853, 2015a.
|
| 291 |
+
|
| 292 |
+
Dan Xu, Elisa Ricci, Yan Yan, Jingkuan Song, and Nicu Sebe. Learning deep representations of appearance and motion for anomalous event detection. In BMVC, 2015b.
|
| 293 |
+
|
| 294 |
+
Houssam Zenati, Chuan Sheng Foo, Bruno Lecouat, Gaurav Manek, and Vijay Ramaseshan Chandrasekhar. Efficient GAN-based anomaly detection. arXiv, abs/1802.06222, 2018.
|
| 295 |
+
|
| 296 |
+
Pushe Zhao, Masaru Kurihara, Junichi Tanaka, Tojiro Noda, Shigeyoshi Chikuma, and Tadashi Suzuki. Advanced correlation-based anomaly detection method for predictive maintenance. In ICPHM, 2017.
|
| 297 |
+
|
| 298 |
+
# A SVD COMPUTATION TIME
|
| 299 |
+
|
| 300 |
+
We compare running times of training an autoencoder and computing SVD for NAP. We choose two packages for the SVD computation: Pytorch SVD and fbpca provided in https://fbpca. readthedocs.io/en/latest/.
|
| 301 |
+
|
| 302 |
+
Since the time complexity of SVD is linear in the number of data samples1, we mainly focus on the performance of SVD with varying the number of columns of the input matrix that SVD is applied. To obtain variable sizes of the columns, we vary the depth and bottleneck size of autoencoders.
|
| 303 |
+
|
| 304 |
+
The result is shown below. Notably, Pytorch SVD utilizing GPU is at least $4 7 \mathbf { x }$ faster than training neural networks. Even, fbpca running only on CPU achieves at least $2 . 4 \mathbf { x }$ speedup.
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
The detailed setups to obtain the matrices for the experiment are given in the table below:
|
| 308 |
+
|
| 309 |
+
<table><tr><td rowspan="2"></td><td colspan="2">MNIST</td><td colspan="2">OTTO</td><td colspan="2">SNSR</td></tr><tr><td>Depth</td><td>Bottleneck Size</td><td>Depth</td><td>Bottleneck Size</td><td>Depth</td><td>Bottleneck Size</td></tr><tr><td>1</td><td>20</td><td>100</td><td>20</td><td>40</td><td>20</td><td>90</td></tr><tr><td>2</td><td>18</td><td>100</td><td>18</td><td>40</td><td>18</td><td>90</td></tr><tr><td>3</td><td>16</td><td>100</td><td>16</td><td>40</td><td>16</td><td>90</td></tr><tr><td>4</td><td>14</td><td>100</td><td>14</td><td>40</td><td>14</td><td>90</td></tr><tr><td>5</td><td>12</td><td>100</td><td>12</td><td>40</td><td>12</td><td>90</td></tr><tr><td>6</td><td>10</td><td>100</td><td>10</td><td>40</td><td>10</td><td>90</td></tr><tr><td>7</td><td>8</td><td>100</td><td>8</td><td>40</td><td>8</td><td>90</td></tr><tr><td>8</td><td>6</td><td>100</td><td>6</td><td>40</td><td>6</td><td>90</td></tr><tr><td>9</td><td>4</td><td>100</td><td>4</td><td>40</td><td>4</td><td>90</td></tr><tr><td>10</td><td>2</td><td>100</td><td>2</td><td>40</td><td>2</td><td>90</td></tr><tr><td>11</td><td>2</td><td>80</td><td>222</td><td>30</td><td>2</td><td>70</td></tr><tr><td>12</td><td>2</td><td>60</td><td></td><td>20</td><td>2</td><td>50</td></tr><tr><td>13</td><td>2</td><td>40</td><td></td><td>10</td><td>2</td><td>30</td></tr><tr><td>14</td><td>2</td><td>20</td><td></td><td></td><td>2</td><td>10</td></tr></table>
|
| 310 |
+
|
| 311 |
+
# B STANDARD DEVIATIONS OF EXPERIMENTAL RESULTS
|
| 312 |
+
|
| 313 |
+
We provide the standard deviations of the result in Table 2. Given a dataset and a setup, multimodal or unimodal, AUROC values are first averaged over multiple cases with different novelty class assignments; then, the standard deviations are calculated for those averaged values over multiple trials. The number of cases and the number of trials depend on datasets, and we refer to Section 5 for more details.
|
| 314 |
+
|
| 315 |
+
<table><tr><td rowspan="2"></td><td colspan="3">AE</td><td colspan="3">VAE</td><td colspan="3">AAE</td></tr><tr><td>Dataset Recon</td><td>SAP</td><td>NAP</td><td>Recon</td><td>SAP</td><td>NAP</td><td>Recon</td><td>SAP</td><td>NAP</td></tr><tr><td colspan="10">Multimodal Normality</td></tr><tr><td>STL</td><td>0.723 (0.005)</td><td>0.703 (0.007)</td><td>0.711 (0.006)</td><td>0.700 (0.012)</td><td>0.675 (0.018)</td><td>0.711 (0.012)</td><td>0.726 (0.009)</td><td>0.711 (0.011)</td><td>0.724 (0.016)</td></tr><tr><td>OTTO</td><td>0.617 (0.002)</td><td>0.616 (0.001)</td><td>0.665 (0.004)</td><td>0.630 (0.003)</td><td>0.631 (0.005)</td><td>0.649 (0.003)</td><td>0.617 (0.001)</td><td>0.618 (0.003)</td><td>0.665 (0.004)</td></tr><tr><td>SNSR</td><td>0.613 (0.002)</td><td>0.611 (0.003)</td><td>0.614 (0.004)</td><td>0.608 (0.001)</td><td>0.620 (0.002)</td><td>0.658 (0.003)</td><td>0.612 (0.005)</td><td>0.608 (0.005)</td><td>0.609 (0.005)</td></tr><tr><td>MNIST</td><td>0.825 (0.001)</td><td>0.881 (0.007)</td><td>0.899 (0.008)</td><td>0.900 (0.004)</td><td>0.965 (0.005)</td><td>0.965 (0.003)</td><td>0.847 (0.005)</td><td>0.911 (0.006)</td><td>0.929 (0.005)</td></tr><tr><td>F-MNIST</td><td>0.712 (0.001)</td><td>0.725 (0.004)</td><td>0.734 (0.004)</td><td>0.725 (0.003)</td><td>0.728 (0.002)</td><td>0.755 (0.006)</td><td>0.721 (0.001)</td><td>0.710 (0.005)</td><td>0.727 (0.005)</td></tr><tr><td colspan="10">Unimodal Normality</td></tr><tr><td>MI-F</td><td>0.607 (0.023)</td><td>0.670 (0.041)</td><td>0.705 (0.018)</td><td>0.591 (0.013)</td><td>0.572 (0.019)</td><td>0.678 (0.047)</td><td>0.632 (0.028)</td><td>0.692 (0.042)</td><td>0.704 (0.024)</td></tr><tr><td>MI-V</td><td>0.897 (0.010)</td><td>0.898 (0.005)</td><td>0.907 (0.005)</td><td>0.845 (0.021)</td><td>0.833 (0.032)</td><td>0.903 (0.010)</td><td>0.895 (0.005)</td><td>0.891 (0.006)</td><td>0.904 (0.005)</td></tr><tr><td>EOPT</td><td>0.610 (0.015)</td><td>0.607 (0.014)</td><td>0.625 (0.008)</td><td>0.675 (0.017)</td><td>0.634 (0.007)</td><td>0.596 (0.002)</td><td>0.606 (0.011)</td><td>0.603 (0.013)</td><td>0.634 (0.010)</td></tr><tr><td>NASA</td><td>0.719 (0.009)</td><td>0.702 (0.015)</td><td>0.692 (0.016)</td><td>0.738 (0.009)</td><td>0.714 (0.015)</td><td>0.719 (0.009)</td><td>0.712 (0.016)</td><td>0.695 (0.027)</td><td>0.688 (0.024)</td></tr><tr><td>RARM</td><td>0.687 (0.038)</td><td>0.674 (0.031)</td><td>0.686 (0.030)</td><td>0.587 (0.021)</td><td>0.565 (0.029)</td><td>0.648 (0.022)</td><td>0.664 (0.015)</td><td>0.675 (0.023)</td><td>0.675 (0.040)</td></tr><tr><td>STL</td><td>0.870 (0.007)</td><td>0.856 (0.007)</td><td>0.830 (0.007)</td><td>0.850 (0.006)</td><td>0.824 (0.003)</td><td>0.792 (0.034)</td><td>0.875 (0.003)</td><td>0.861 (0.004)</td><td>0.830 (0.008)</td></tr><tr><td>OTTO</td><td>0.829 (0.001)</td><td>0.829 (0.001)</td><td>0.832 (0.001)</td><td>0.831 (0.002)</td><td>0.835 (0.003)</td><td>0.833 (0.004)</td><td>0.828 (0.002)</td><td>0.828 (0.001)</td><td>0.831 (0.002)</td></tr><tr><td>SNSR</td><td>0.979 (0.001)</td><td>0.982 (0.001)</td><td>0.990 (0.001)</td><td>0.975 (0.003)</td><td>0.979 (0.002)</td><td>0.964 (0.043)</td><td>0.979 (0.001)</td><td>0.983 (0.002)</td><td>0.997 (0.001)</td></tr><tr><td>MNIST</td><td>0.972 (0.001)</td><td>0.980 (0.001)</td><td>0.979 (0.000)</td><td>0.980 (0.002)</td><td>0.987 (0.002)</td><td>0.989 (0.001)</td><td>0.972 (0.001)</td><td>0.966 (0.004)</td><td>0.977 (0.001)</td></tr><tr><td>F-MNIST</td><td>0.924 (0.002)</td><td>0.928 (0.002)</td><td>0.933 (0.002)</td><td>0.926 (0.001)</td><td>0.926 (0.001)</td><td>0.942 (0.000)</td><td>0.922 (0.001)</td><td>0.905 (0.002)</td><td>0.928 (0.002)</td></tr></table>
|
| 316 |
+
|
| 317 |
+
# C COMPARING RAPP TO BASELINES OTHER THAN NEURAL NETWORKS
|
| 318 |
+
|
| 319 |
+
The table below shows the result of comparing RAPP and baselines not based on neural networks. Note that the baselines are run with hyperparameters or hyperparameter search spaces provided in Ruff et al. (2018), while NAP is not further tuned.
|
| 320 |
+
|
| 321 |
+
<table><tr><td>Dataset</td><td>OCSVM</td><td>ISOF</td><td>PCA</td><td>kPCA</td><td>NAPAE</td><td>NAPvAE</td><td>NAPAAE</td></tr><tr><td colspan="8">Multimodal Normality</td></tr><tr><td>STL</td><td>0.608</td><td>0.635</td><td>0.700</td><td>0.693</td><td>0.711</td><td>0.711</td><td>0.724</td></tr><tr><td>OTTO</td><td>0.628</td><td>0.548</td><td>0.572</td><td>0.644</td><td>0.665</td><td>0.649</td><td>0.665</td></tr><tr><td>SNSR</td><td>0.524</td><td>0.526</td><td>0.536</td><td>0.580</td><td>0.614</td><td>0.658</td><td>0.606</td></tr><tr><td>MNIST F-MNIST</td><td>0.566 0.571</td><td>0.562 0.650</td><td>0.698 0.670</td><td>0.701 0.676</td><td>0.899 0.734</td><td>0.965 0.755</td><td>0.929 0.727</td></tr><tr><td colspan="8">Unimodal Normality</td></tr><tr><td>MI-F</td><td>0.777</td><td>0.826</td><td>0.546</td><td>0.838</td><td>0.705</td><td>0.678</td><td>0.704</td></tr><tr><td>MI-V</td><td>0.840</td><td>0.839</td><td>0.874</td><td>0.888</td><td>0.907</td><td>0.903</td><td>0.904</td></tr><tr><td>EOPT</td><td>0.597</td><td>0.595</td><td>0.552</td><td>0.693</td><td>0.625</td><td>0.596</td><td>0.634</td></tr><tr><td>NASA</td><td>0.573</td><td>0.664</td><td>0.765</td><td>0.699</td><td>0.692</td><td>0.719</td><td>0.688</td></tr><tr><td>RARM</td><td>0.749</td><td>0.752</td><td>0.587</td><td>0.734</td><td>0.734</td><td>0.648</td><td>0.675</td></tr><tr><td>STL</td><td>0.879</td><td>0.871</td><td>0.883</td><td>0.880</td><td>0.880</td><td>0.792</td><td>0.830</td></tr><tr><td>OTTO</td><td>0.821</td><td>0.699</td><td>0.799</td><td>0.823</td><td>0.823</td><td>0.833</td><td>0.831</td></tr><tr><td>SNSR</td><td>0.959</td><td>0.893</td><td>0.894</td><td>0.970</td><td>0.970</td><td>0.964</td><td></td></tr><tr><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td>0.991</td></tr><tr><td>MNIST</td><td>0.894</td><td>0.919</td><td>0.903</td><td>0.906</td><td>0.979</td><td>0.989</td><td>0.977</td></tr><tr><td>F-MNIST</td><td>0.884</td><td>0.854</td><td>0.950</td><td>0.943</td><td>0.933</td><td>0.942</td><td>0.928</td></tr></table>
|
| 322 |
+
|
| 323 |
+
# D NAP PERFORMANCE OVER INCREASING INVOLVED HIDDEN LAYERS
|
| 324 |
+
|
| 325 |
+
We investigate the performance of NAP while increasing the number of hidden layers involved in the NAP computation. Specifically, we consider two ways for the increment: 1) adding hidden layers one by one from the input layer (forward addition), and 2) adding hidden layers one by one from the bottleneck layer (backward addition). Experimental results on three datasets are shown below. For most cases, more hidden layers tend to result in higher performance. The values are obtained from one trial without averaging results from multiple trials.
|
| 326 |
+
|
| 327 |
+

|
md/train/Hkxr1nCcFm/Hkxr1nCcFm.md
ADDED
|
@@ -0,0 +1,474 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AN INVESTIGATION OF MODEL-FREE PLANNING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
The field of reinforcement learning (RL) is facing increasingly challenging domains with combinatorial complexity. For an RL agent to address these challenges, it is essential that it can plan effectively. Prior work has typically utilized an explicit model of the environment, combined with a specific planning algorithm (such as tree search). More recently, a new family of methods have been proposed that learn how to plan, by providing the structure for planning via an inductive bias in the function approximator (such as a tree structured neural network), trained end-to-end by a model-free RL algorithm. In this paper, we go even further, and demonstrate empirically that an entirely model-free approach, without special structure beyond standard neural network components such as convolutional networks and LSTMs, can learn to exhibit many of the hallmarks that we would typically associate with a model-based planner. We measure our agent’s effectiveness at planning in terms of its ability to generalize across a combinatorial and irreversible state space, its data efficiency, and its ability to utilize additional thinking time. We find that our agent has the characteristics that one might expect to find in a planning algorithm. Furthermore, it exceeds the state-ofthe-art in challenging combinatorial domains such as Sokoban and outperforms other model-free approaches that utilize strong inductive biases toward planning.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
One of the aspirations of artificial intelligence is a cognitive agent that can adaptively and dynamically form plans to achieve its goal. Traditionally, this role has been filled by model-based RL approaches, which first learn an explicit model of the environment’s system dynamics or rules, and then apply a planning algorithm (such as tree search) to the learned model. But model-based approaches have been challenging to scale with learned models in complex environments.
|
| 12 |
+
|
| 13 |
+
More recently, a variety of approaches have been proposed that learn to plan implicitly, solely by model-free training. These model-free planning agents utilize a special neural architecture that mirrors the structure of a particular planning algorithm. For example the neural network may be designed to represent search trees (Farquhar et al., 2017; Oh et al., 2017; Guez et al., 2018), forward simulations (Racanière et al., 2017; Silver et al., 2016), or dynamic programming (Tamar et al., 2016). The main idea is that, given the appropriate inductive bias for planning, the function approximator can learn to leverage these structures to learn its own planning algorithm. This kind of algorithmic function approximation may be more flexible than an explicit model-based approach, allowing the agent to customize the nature of planning to the specific environment.
|
| 14 |
+
|
| 15 |
+
In this paper we explore the hypothesis that planning may occur implicitly, even when the function approximator has no special inductive bias toward planning. Previous work (Pang & Werbos, 1998; Wang et al., 2018) have supported the idea that model-based behavior could be learned with general recurrent architectures, with planning computation amortized over multiple discrete steps (Schmidhuber, 1990), but comprehensive demonstrations of its effectiveness are still missing. Inspired by the successes of deep learning and the universality of neural representations, our main idea is simply to furnish a neural network with a high capacity and flexible representation, rather than mirror any particular planning structure. Given such flexibility, the network can in principle learn its own algorithm for approximate planning. Specifically, we utilize a family of neural networks based on a widely used function approximation architecture: the stacked convolutional LSTMs (ConvLSTM by Xingjian et al. (2015)).
|
| 16 |
+
|
| 17 |
+
It is perhaps surprising that a purely model-free reinforcement learning approach can be so successful in domains that would appear to necessitate explicit planning. This raises a natural question: what is planning? Can a model-free RL agent truly be considered to be planning, without any explicit model of the environment, and without any explicit simulation of that model? In this paper we take a behaviourist approach. Here, planning will rather be considered to be a measurable property of the agent’s interactions. In particular, we consider three key properties that an agent equipped with planning should exhibit.
|
| 18 |
+
|
| 19 |
+
First, an effective planning algorithm should be able to generalize to different situations. The intuition here is that a simple function approximator cannot predict accurately across a combinatorial space of possibilities (for example the value of all chess positions), but a planning algorithm can perform a local search to dynamically compute predictions (for example by tree search). We measure this property using procedural environments (such as random gridworlds, Sokoban (Racanière et al., 2017), Boxworld (Zambaldi et al., 2018)) with a massively combinatorial space of possible layouts. We find that our model-free planning agent achieves state-of-the-art performance, and significantly outperforms more specialized model-free planning architectures. We also investigate extrapolation to a harder class of problems beyond those in the training set, and again find that our architecture performs effectively – especially with larger network sizes.
|
| 20 |
+
|
| 21 |
+
Second, a planning agent should be able to learn efficiently from relatively small amounts of data. Model-based RL is frequently motivated by the intuition that a model (for example the rules of chess) can often be learned more efficiently than direct predictions (for example the value of all chess positions). We measure this property by training our model-free planner on small data-sets, and find that our model-free planning agent still performs well and generalizes effectively to a heldout test set.
|
| 22 |
+
|
| 23 |
+
Third, an effective planning algorithm should be able to make good use of additional thinking time. Put simply, the more the algorithm thinks, the better its performance should be. This property is likely to be especially important in domains with irreversible consequences to wrong decisions (e.g. death or dead-ends). We measure this property in Sokoban by adding additional thinking time at the start of an episode, and find that our model-free planning agent solves considerably more problems.
|
| 24 |
+
|
| 25 |
+
Together, our results suggest that a model-free agent, without planning-inspired network structure, can learn to exhibit many of the behavioural characteristics of planning. The architecture presented in this paper serves to illustrate this point, and shows the surprising power of one simple approach. We hope our findings broaden the search for more general architectures that can tackle an even wider range of domains.
|
| 26 |
+
|
| 27 |
+
# 2 METHODS
|
| 28 |
+
|
| 29 |
+
We first motivate and describe the main network architecture we use in this paper. Then we briefly explain our training setup. More details can be found in Appendix C.
|
| 30 |
+
|
| 31 |
+
# 2.1 MODEL ARCHITECTURES
|
| 32 |
+
|
| 33 |
+
We desire models that can represent and learn powerful but unspecified planning procedures. Rather than encode strong inductive biases toward particular planning algorithms, we choose high-capacity neural network architectures that are capable of representing a very rich class of functions. As in many works in deep RL, we make use of convolutional neural networks (known to exploit the spatial structure inherent in visual domains) and LSTMs (known to be effective in sequential problems). Aside from these weak but common inductive biases, we keep our architecture as general and flexible as possible, and trust in standard model-free reinforcement learning algorithms to discover the functionality of planning.
|
| 34 |
+
|
| 35 |
+
# 2.1.1 BASIC ARCHITECTURE
|
| 36 |
+
|
| 37 |
+
The basic element of the architecture is a ConvLSTM (Xingjian et al., 2015) – a neural network similar to an LSTM but with a 3D hidden state and convolutional operations. A recurrent network $f _ { \theta }$ stacks together ConvLSTM modules. For a stack depth of $D$ , the state $s$ contains all the cell states $c _ { d }$ and outputs $h _ { d }$ of each module $d$ : $s = ( c _ { 1 } , \hdots , c _ { D } , h _ { 1 } , \hdots , h _ { D } )$ . The module weights $\theta = ( \theta _ { 1 } , \ldots , \theta _ { D } )$ are not shared along the stack. Given a previous state and an input tensor $i$ , the next state is computed as $s ^ { \prime } = f _ { \boldsymbol { \theta } } ( s , i ) \bar { }$ . The network $f _ { \theta }$ is then repeated $N$ times within each timestep (i.e., multiple internal ticks per real time-step). If $s _ { t - 1 }$ is the state at the end of the previous time-step, we obtain the new state given the input $i _ { t }$ as:
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
Figure 1: Illustration of the agent’s network architecture. This diagram shows DRC(2,3) for two time steps. Square boxes denote ConvLSTM modules and the rectangle box represents an MLP. Boxes with the same color share parameters.
|
| 41 |
+
|
| 42 |
+
$$
|
| 43 |
+
s _ { t } = g _ { \theta } ( s _ { t - 1 } , i _ { t } ) = \underbrace { f _ { \theta } \big ( f _ { \theta } \big ( \ldots \mathit { f _ { \theta } } ( s _ { t - 1 } , i _ { t } ) , \ldots , i _ { t } \big ) , i _ { t } \big ) } _ { \mathit { N \ i m e s } }
|
| 44 |
+
$$
|
| 45 |
+
|
| 46 |
+
The elements of $s _ { t }$ all preserve the spatial dimensions of the input $i _ { t }$ . The final output $o _ { t }$ of the recurrent network for a single time-step is $h _ { D }$ , the hidden state of the deepest ConvLSTM module after $_ \mathrm { N }$ ticks, obtained from $s _ { t }$ . We describe the ConvLSTM itself and alternative choices for memory modules in Appendix C.
|
| 47 |
+
|
| 48 |
+
The rest of the network is rather generic. An encoder network $e$ composed of convolutional layers processes the input observation $x _ { t }$ into a $H \times W \times C$ tensor $i _ { t }$ — given as input to the recurrent module $g$ . The encoded input $i _ { t }$ is also combined with $o _ { t }$ through a skip-connection to produce the final network output. The network output is then flattend and an action distribution $\pi$ and a state-value $V$ are computed via a fully-connected MLP. The diagram in Fig 1 illustrates the full network.
|
| 49 |
+
|
| 50 |
+
From here on, we refer to this architecture as Deep Repeated ConvLSTM (DRC) network architecture, and sometimes followed explicitly by the value of $D$ and $N$ (e.g., DRC(3, 2) has depth $D = 3$ and $N = 2$ repeats).
|
| 51 |
+
|
| 52 |
+
# 2.1.2 ADDITIONAL DETAILS
|
| 53 |
+
|
| 54 |
+
Less essential design choices in the architectures are described here. Ablation studies show that these are not crucial, but do marginally improve performance (see Appendix F).
|
| 55 |
+
|
| 56 |
+
Encoded observation skip-connection The encoded observation $i _ { t }$ is provided as an input to all ConvLSTM modules in the stack.
|
| 57 |
+
|
| 58 |
+
Top-down skip connection As described above, the flow of information in the network only goes up (and right through time). To allow for more general computation we add feedback connection from the last layer at one time step to the first layer of the next step.
|
| 59 |
+
|
| 60 |
+
Pool-and-inject To allow information to propagate faster in the spatial dimensions than the size of the convolutional kernel within the ConvLSTM stack, it is useful to provide a pooled version of the module’s last output $h$ as an additional input on lateral connections. We use both max and mean pooling. Each pooling operation applies pooling spatially for each channel dimension, followed by a linear transform, and then tiles the result back into a 2D tensor. This is operation is related to the pool-and-inject method introduced by Racanière et al. (2017) and to Squeeze-and-Excitation blocks (Hu et al., 2017).
|
| 61 |
+
|
| 62 |
+
Padding The convolutional operator is translation invariant. To help it understand where the edge of the input image is, we append a feature map to the input of the convolutional operators that has ones on the boundary and zeros inside.
|
| 63 |
+
|
| 64 |
+
# 2.2 TRAINING
|
| 65 |
+
|
| 66 |
+
We used a distributed framework to train an RL agent using the IMPALA V-trace actor-critic algorithm (Espeholt et al., 2018). While we found this training regime to help for training heavier networks, we also ran experiments which demonstrate that the DRC architecture can be trained effectively with A3C (Mnih et al., 2016). More details on the setup can be found in Appendix D.2.
|
| 67 |
+
|
| 68 |
+
# 3 PLANNING DOMAINS
|
| 69 |
+
|
| 70 |
+
Our domains are formally specified as RL problems, where agents must learn via reward feedback obtained by interacting with the environment (Sutton et al., 1998). We focus on combinatorial domains for which episodes are procedurally generated. In these domains each episode is instantiated in a pseudorandom configuration, so solving an episode typically requires some form of reasoning. Most of the environments are fully-observable and have simple 2D visual features. The domains are illustrated and explained in Appendix A. In addition to the planning domains listed below, we also run control experiments on a set of Atari 2600 games (Bellemare et al., 2013).
|
| 71 |
+
|
| 72 |
+
Gridworld A simple navigation domain following (Tamar et al., 2016), consisting of a grid filled with obstacles. The agent, goal, and obstacles are randomly placed for each episode.
|
| 73 |
+
|
| 74 |
+
Sokoban A difficult puzzle domain requiring an agent to push a set of boxes onto goal locations (Botea et al., 2003; Racanière et al., 2017). Irreversible wrong moves can make the puzzle unsolvable. We describe how we generate a large number of levels (for the fixed problem size $1 0 \mathrm { x } 1 0$ with 4 boxes) at multiple difficulty levels in Appendix B, and then each split into a training and test set. We are releasing these levels in the standard Sokoban format1. Unless otherwise specified, we ran experiments with the easier unfiltered set of levels.
|
| 75 |
+
|
| 76 |
+
Boxworld Introduced in (Zambaldi et al., 2018), the aim is to reach a goal target by collecting coloured keys and opening colour-matched boxes until a target is reached. The agent can see the keys (i.e., their colours) locked within boxes; thus, it must carefully plan the sequence of boxes that should be opened so that it can collect the keys that will lead to the target. Keys can only be used once, so opening an incorrect box can lead the agent down a dead-end path from which it cannot recover.
|
| 77 |
+
|
| 78 |
+
MiniPacman (Racanière et al., 2017). The player explores a maze that contains food while being chased by ghosts. The aim of the player is to collect all the rewarding food. There are also a few power pills which allow the player to attack ghosts (for a brief duration) and earn a large reward. See Appendix A.2 for more details.
|
| 79 |
+
|
| 80 |
+
# 4 RESULTS
|
| 81 |
+
|
| 82 |
+
We first examine the performance of our model and other approaches across domains. Then we report results aimed at understanding how elements of our architecture contribute to observed performance. Finally, we study evidence of iterative computation in Section 4.2 and generalization in Section 4.3.
|
| 83 |
+
|
| 84 |
+
# 4.1 COMPARISONS
|
| 85 |
+
|
| 86 |
+
In general, across all domains listed in Section 3, the DRC architecture performed very well with only modest tuning of hyper-parameters (see Appendix D). The DRC(3,3) variant was almost always the best in terms both of data efficiency (early learning) and asymptotic performance.
|
| 87 |
+
|
| 88 |
+
Gridworld: Many methods efficiently learn the Gridworld domain, especially for small grid sizes. We found that for larger grid sizes the DRC architecture learns more efficiently than a vanilla Convolutional Neural Network (CNN) architecture of similar weight and computational capacity. We also tested Value Iteration Networks (VIN) (Tamar et al., 2016), which are specially designed to deal with this kind of problem (i.e. local transitions in a fully-observable 2D state space). We found that VIN, which has many fewer parameters and a well-matched inductive bias, starts improving faster than other methods. It outperformed the CNN and even the DRC during early-stage training, but the DRC reached better final accuracy (see Table 1a and Figure 14a in the Appendix).
|
| 89 |
+
|
| 90 |
+
<table><tr><td>Model</td><td>% solved at le6 steps</td><td>% solved at le7 steps</td></tr><tr><td>DRC(3, 3)</td><td>30</td><td>99</td></tr><tr><td>VIN</td><td>80</td><td>97</td></tr><tr><td>CNN</td><td>3</td><td>90</td></tr></table>
|
| 91 |
+
|
| 92 |
+
<table><tr><td>Model</td><td>% solved at 2e7 steps</td><td>% solved at le9 steps</td></tr><tr><td>DRC(3,3) ResNet CNN</td><td>80 14 25</td><td>99 96 92</td></tr><tr><td>I2A (unroll=15)</td><td>21</td><td>83</td></tr><tr><td>1D LSTM(3,3)</td><td>5</td><td>74</td></tr><tr><td>ATreeC</td><td>1</td><td>57</td></tr><tr><td>VIN</td><td>12</td><td>56</td></tr><tr><td colspan="3">(b)</td></tr></table>
|
| 93 |
+
|
| 94 |
+
Sokoban: In Sokoban, we demonstrate state-of-the-art results versus prior work which targeted similar box-pushing puzzle domains (ATreeC (Farquhar et al., 2017), I2A (Racanière et al., 2017)) and other generic networks (LSTM (Hochreiter & Schmidhuber, 1997), ResNet (He et al., 2016), CNNs). We also test VIN on Sokoban, adapting the original approach to our state space by adding an input encoder to the model and an attention module at the output to deal with the imperfect state-action mappings. Table 1b compares the results for different architectures at the end of training. Only $1 \%$ of test levels remain unsolved by DRC(3,3) after 1e9 steps, with the second-best architecture (a large ResNet) failing four times as often.
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
Table 1: (a) Performance comparison in Gridworld, size $3 2 \mathrm { x } 3 2 $ , after 10M environment steps. VIN (Tamar et al., 2016) and experimental setup detailed in Appendix. (b) Comparison of test performance on (unfiltered) Sokoban levels for various methods. I2A (Racanière et al., 2017) results are re-rerun within our framework. ATreeC (Farquhar et al., 2017) results are detailed in Appendix. MCTSnets (Guez et al., 2018) also considered the same Sokoban domain but in an expert imitation setting (achieving $84 \%$ solved levels).
|
| 98 |
+
Figure 2: Examples of Sokoban levels from the (a) unfiltered, (b) medium test sets, and from the (c) hard set. Our best model is able to solve all three levels.
|
| 99 |
+
|
| 100 |
+
Boxworld: On this domain several methods obtain near-perfect final performance. Still, the DRC model learned faster than published methods, achieving ${ \approx } 8 0 \%$ success after 2e8 steps. In comparison, the best ResNet achieved ${ \approx } 5 0 \%$ by this point. The relational method of Zambaldi et al. (2018) can learn this task well but only solved ${ < } 1 0 \%$ of levels after 2e8 steps.
|
| 101 |
+
|
| 102 |
+
Atari 2600 To test the capacity of the DRC model to deal with richer sensory data, we also examined its performance on five planning-focussed Atari games (Bellemare et al., 2013). We obtained stateof-the-art scores on three of five games, and competitive scores on the other two (see Appendix E.2 and Figure 10 for details).
|
| 103 |
+
|
| 104 |
+

|
| 105 |
+
Figure 3: a) Learning curves for various configurations of DRC in Sokoban-Unfiltered. b) Comparison with other network architectures tuned for Sokoban. Results are on test-set levels.
|
| 106 |
+
|
| 107 |
+
# 4.1.1 INFLUENCE OF NETWORK ARCHITECTURE
|
| 108 |
+
|
| 109 |
+
We studied the influence of stacking and repeating the ConvLSTM modules in the DRC architecture, controlled by the parameters $D$ (stack length) and $N$ (number of repeats) as described in Section 2.1. These degrees of freedom allow our networks to compute its output using shared, iterative, computation with $N > 1$ , as well as computations at different levels of representation and more capacity with $D > 1$ . We found that the DRC(3,3) (i.e, $D = 3 , N = 3 )$ worked robustly across all of the tested domain. We compared this to using the same number of modules stacked without repeats (DRC(9,1)) or only repeated without stacking (DRC(1,9)). In addition, we also look at the same smaller capacity versions $D = 2 , N = 2$ and $D = 1 , N = 1$ (which reduces to a standard ConvLSTM). Figure 3a shows the results on Sokoban for the different network configurations. In general, the versions with more capacity performed better. When trading-off stacking and repeating (with total of 9 modules), we observed that only repeating without stacking was not as effective (this has the same number of parameters as the DRC(1,1) version), and only stacking was slower to train in the early phase but obtained a similar final performance.
|
| 110 |
+
|
| 111 |
+
We also confirmed that DRC(3,3) performed better than DRC(1,1) in Boxworld, MiniPacman, and Gridworld (see Figure 15a in Appendix).
|
| 112 |
+
|
| 113 |
+
On harder Sokoban levels (Medium-difficulty dataset), we trained the DRC(3,3) and the larger capacity DRC(9,1) configurations and found that, even though DRC(9,1) was slower to learn at first, it ended up reaching a better score than DRC(3,3) $94 \%$ versus $9 1 . 5 \%$ after 1e9 steps). See Fig 9 in appendix. We tested the resulting DRC(9,1) agent on the hardest Sokoban setting (Hard-difficulty), and found that it solved $80 \%$ of levels in less than 48 minutes. In comparison, running a powerful tree search algorithm, Levin Tree Search (Orseau et al., 2018), with a DRC(1,1) as policy prior solves $94 \%$ , but in 10 hours.
|
| 114 |
+
|
| 115 |
+
In principle, deep feedforward models should support iterative procedures within a single time-step and perhaps match the performance of our recurrent networks (Jastrzebski et al., 2017). In practice, deep ResNets performed poorly versus our recurrent models (see Figure 3b), and are in any case incapable of caching implicit iterative planning steps over time steps. Finally, we note that recurrence by itself was also not enough: replacing the ConvLSTM modules with flat 1-D LSTMs performed poorly (see Figure 3b).
|
| 116 |
+
|
| 117 |
+

|
| 118 |
+
Figure 4: Forcing extra computation steps after training improves the performance of DRC on Sokoban-Medium set (5 networks, each tested on the same 5000 levels). Steps are performed by overriding the policy with no-op actions at the start of an episode.
|
| 119 |
+
|
| 120 |
+

|
| 121 |
+
Figure 5: Comparison of DRC(3,3) (Top, Large network) and DRC(1,1) (Bottom, Small network) when trained with RL on various train set sizes (subsets of the Sokoban-unfiltered training set). Left column shows the performance on levels from the corresponding train set, right column shows the performance on the test set (the same set across these experiments).
|
| 122 |
+
|
| 123 |
+
Across experiments and domains, our results suggests that both the network capacity and the iterative aspect of a model drives the agent’s performance.
|
| 124 |
+
|
| 125 |
+
# 4.2 ITERATIVE COMPUTATION
|
| 126 |
+
|
| 127 |
+
One desirable property for planning mechanisms is that their performance can scale with additional computation without seeing new data. Although RNNs (and more recently ResNets) can in principle learn a function that can be iterated to obtain a result (Graves, 2016; Jastrzebski et al., 2017; Greff et al., 2016), it is not clear whether the networks trained in our RL domains learn to amortize computation over time in this way. To test this, we took trained networks in Sokoban (unfiltered) and tested post hoc their ability to improve their results with additional steps. To do so we introduced ‘no-op’ actions at the start of each episode – up to 10 extra steps. We observed clear performance improvements on Medium difficulty levels of up to $5 \%$ for DRC networks (see Figure 4). We did not find such improvements for the simpler fully-connected LSTM architecture. This suggests that the networks have learned a scaleable strategy for the task which is computed and refined through a series of identical steps, thereby exhibiting one of the essential properties of a planning algorithm.
|
| 128 |
+
|
| 129 |
+
# 4.3 GENERALIZATION
|
| 130 |
+
|
| 131 |
+
In combinatorial domains generalization is a central issue. Given limited exposure to configurations in an environment, how well can a model perform on unseen scenarios? In the supervised setting, large flexible networks are capable of over-fitting. Thus, one concern when using high-capacity networks is that they may over-fit to the task, for example by memorizing, rather than learning a strategy that can generalize to novel situations. Recent empirical work in SL (Supervised Learning) has shown that the generalization of large networks is not well understood (Zhang et al., 2016; Arpit et al., 2017). Generalization in RL is even less well studied, though recent work by (Zhang et al., 2018a;b) has begun to explore the effect of training data diversity.
|
| 132 |
+
|
| 133 |
+
We explored two main axes in the space of generalization. We varied both the diversity of the environments as well as the size of our models. We trained the DRC architecture in various data regimes, by restricting the number of unique Sokoban levels — during the training, similar to SL, the training algorithm iterates on those limited levels many times. We either train on a Large $( 9 0 0 \mathrm { k }$ levels), Medium (10k) or Small (1k) set. For each dataset size, we compared a larger version of the network, DRC(3,3), to a smaller version DRC(1,1) 2. Results are shown in Figure 5.
|
| 134 |
+
|
| 135 |
+
In all cases, the larger DRC(3,3) network generalized better than its smaller counterpart, both in absolute terms and in terms of generalization gap. In particular, in the Medium regime, the generalization $\mathrm { g a p } ^ { 3 }$ is $6 . 4 8 2 \%$ for DRC(3,3) versus $3 3 . 3 9 8 \%$ for DRC(1, 1). Figure 6a shows the results when tested after training on both unfiltered and Medium test sets. We performed an analogous experiment in the Boxworld environment and observed remarkably similar results (see Appendix Fig 12).
|
| 136 |
+
|
| 137 |
+
Looking across these domains and experiments there are two findings that are of particular note. First, unlike analog SL experiments, reducing the number of training levels does not necessarily improve performance on the train set. Networks trained on 1k levels perform worse in terms of fraction of level solved. We believe this is due to the exploration problem in low-diversity regime: With more levels, the training agent faces a natural curriculum to help it progress toward harder levels. Another view of this is that larger networks can overfit the training levels, but only if they experience success on these levels at some point. While local minima for the loss in SL are not practically an issue, local minima in policy space can be problematic.
|
| 138 |
+
|
| 139 |
+
From a classic optimization perspective, a surprising finding is that the larger networks in our experiment (both Sokoban & Boxworld) suffer less from over-fitting in the low-data regime than their smaller counterparts (see Figure 6). However, this is in line with recent findings Zhang et al. (2016) in SL that the generalization of a model is driven by the architecture and nature of the data, rather than simply as a results of the network capacity and size of the dataset. Indeed, we also trained the same networks in a purely supervised fashion through imitation learning of an expert policy.4 We observed a similar result when comparing the classification accuracy of the networks on the test set, with the DRC(3,3) better able to generalize — even though both networks had similar training errors on small datasets.
|
| 140 |
+
|
| 141 |
+
# Extrapolation
|
| 142 |
+
|
| 143 |
+
Another facet of generality in the strategy found by the DRC network is how it performs outside the training distribution. In Sokoban, we tested the DRC(3,3) and DRC(1,1) networks on levels with a larger number of boxes than those seen in the training set. Figure 13a shows that DRC was able to extrapolate with little loss in performance to up to 7 boxes (for a a fixed grid size). The performance degradation for DRC(3,3) on 7 boxes was $3 . 5 \%$ and $1 8 . 5 \%$ for DRC(1,1). In comparison, the results from Racanière et al. (2017) report a loss of $34 \%$ when extrapolating to 7 boxes in the same setup.
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
Figure 6: (a) Generalization results from a trained model on different training set size (Large, Medium and Small) for Sokoban. Left figure shows results on the unfiltered test set, right figure shows results on the medium test set. (b) Similar generalization results for trained models in Boxworld.
|
| 147 |
+
|
| 148 |
+
# 5 DISCUSSION
|
| 149 |
+
|
| 150 |
+
We aspire to endow agents with the capacity to plan effectively in combinatorial domains where simple memorization of strategies is not feasible. An overarching question is regarding the nature of planning itself. Can the computations necessary for planning be learned solely using model-free RL, and this can be achieved by a general-purpose neural network with weak inductive biases? Or is it necessary to have dedicated planning machinery — either explicitly encoding existing planning algorithms, or implicitly mirroring their structure? In this paper, we studied a variety of different neural architectures trained using model-free RL in procedural planning tasks with combinatorial and irreversible state spaces. Our results suggest that general-purpose, high-capacity neural networks based on recurrent convolutional structure, are particularly efficient at learning to plan. This approach yielded state-of-the-art results on several domains – outperforming all of the specialized planning architectures that we tested. Our generalization and scaling analyses, together with the procedural nature of the studied domains, suggests that these networks learn an algorithm for approximate planning that is tailored to the domain. The algorithmic function approximator appears to compute its plan dynamically, amortised over many steps, and hence additional thinking time can boost its performance.
|
| 151 |
+
|
| 152 |
+
Recent work in the context of supervised learning is pushing us to rethink how large neural network models generalize (Zhang et al., 2016; Arpit et al., 2017). Our results further demonstrate the mismatch between traditional views on generalisation and model size. The surprising efficacy of our planning agent, when trained on a small number of scenarios across a combinatorial state space, suggests that any new theory must take into account the algorithmic function approximation capabilities of the model rather than simplistic measures of its complexity. Ultimately, we desire even more generality and scalability from our agents, and it remains to be seen whether model-free planning will be effective in reinforcement learning environments of real-world complexity.
|
| 153 |
+
|
| 154 |
+
# REFERENCES
|
| 155 |
+
|
| 156 |
+
Devansh Arpit, Stanisław Jastrz˛ebski, Nicolas Ballas, David Krueger, Emmanuel Bengio, Maxinder S Kanwal, Tegan Maharaj, Asja Fischer, Aaron Courville, Yoshua Bengio, et al. A closer look at memorization in deep networks. arXiv preprint arXiv:1706.05394, 2017.
|
| 157 |
+
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.
|
| 158 |
+
Adi Botea, Martin Müller, and Jonathan Schaeffer. Using abstraction for planning in sokoban. In Computers and Games, volume 2883, pp. 360, 2003.
|
| 159 |
+
Lasse Espeholt, Hubert Soyer, Remi Munos, Karen Simonyan, Volodymir Mnih, Tom Ward, Yotam Doron, Vlad Firoiu, Tim Harley, Iain Dunning, et al. Impala: Scalable distributed deep-rl with importance weighted actor-learner architectures. arXiv preprint arXiv:1802.01561, 2018.
|
| 160 |
+
Gregory Farquhar, Tim Rocktäschel, Maximilian Igl, and Shimon Whiteson. Treeqn and atreec: Differentiable tree planning for deep reinforcement learning. In ICLR, 2017.
|
| 161 |
+
Alex Graves. Adaptive computation time for recurrent neural networks. arXiv preprint arXiv:1603.08983, 2016.
|
| 162 |
+
Klaus Greff, Rupesh K Srivastava, and Jürgen Schmidhuber. Highway and residual networks learn unrolled iterative estimation. arXiv preprint arXiv:1612.07771, 2016.
|
| 163 |
+
Arthur Guez, Théophane Weber, Ioannis Antonoglou, Karen Simonyan, Oriol Vinyals, Daan Wierstra, Rémi Munos, and David Silver. Learning to search with mctsnets. arXiv preprint arXiv:1802.04697, 2018.
|
| 164 |
+
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.
|
| 165 |
+
|
| 166 |
+
Sepp Hochreiter and Jürgen Schmidhuber. Long short-term memory. Neural computation, 9(8): 1735–1780, 1997.
|
| 167 |
+
|
| 168 |
+
Dan Horgan, John Quan, David Budden, Gabriel Barth-Maron, Matteo Hessel, Hado Van Hasselt, and David Silver. Distributed prioritized experience replay. arXiv preprint arXiv:1803.00933, 2018.
|
| 169 |
+
|
| 170 |
+
Jie Hu, Li Shen, and Gang Sun. Squeeze-and-excitation networks. arXiv preprint arXiv:1709.01507, 7, 2017.
|
| 171 |
+
|
| 172 |
+
Stanisław Jastrzebski, Devansh Arpit, Nicolas Ballas, Vikas Verma, Tong Che, and Yoshua Bengio. Residual connections encourage iterative inference. arXiv preprint arXiv:1710.04773, 2017.
|
| 173 |
+
|
| 174 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 175 |
+
|
| 176 |
+
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.
|
| 177 |
+
|
| 178 |
+
Volodymyr Mnih, Adria Puigdomenech Badia, Mehdi Mirza, Alex Graves, Timothy Lillicrap, Tim Harley, David Silver, and Koray Kavukcuoglu. Asynchronous methods for deep reinforcement learning. In International conference on machine learning, pp. 1928–1937, 2016.
|
| 179 |
+
|
| 180 |
+
Junhyuk Oh, Satinder Singh, and Honglak Lee. Value prediction network. In Advances in Neural Information Processing Systems, pp. 6118–6128, 2017.
|
| 181 |
+
|
| 182 |
+
Laurent Orseau, Levi Lelis, Tor Lattimore, and Theophane Weber. Single-agent policy tree search with guarantees. In Advances in Neural Information Processing Systems, 2018.
|
| 183 |
+
|
| 184 |
+
Xiaozhong Pang and P Werbos. Neural network design for j function approximation in dynamic programming. arXiv preprint adap-org/9806001, 1998.
|
| 185 |
+
|
| 186 |
+
Sébastien Racanière, Théophane Weber, David Reichert, Lars Buesing, Arthur Guez, Danilo Jimenez Rezende, Adrià Puigdomènech Badia, Oriol Vinyals, Nicolas Heess, Yujia Li, et al. Imagination-augmented agents for deep reinforcement learning. In Advances in Neural Information Processing Systems, pp. 5690–5701, 2017.
|
| 187 |
+
|
| 188 |
+
Jürgen Schmidhuber. Making the world differentiable: On using self-supervised fully recurrent neural networks for dynamic reinforcement learning and planning in non-stationary environments. 1990.
|
| 189 |
+
|
| 190 |
+
David Silver, Hado van Hasselt, Matteo Hessel, Tom Schaul, Arthur Guez, Tim Harley, Gabriel Dulac-Arnold, David Reichert, Neil Rabinowitz, Andre Barreto, et al. The predictron: End-toend learning and planning. arXiv preprint arXiv:1612.08810, 2016.
|
| 191 |
+
|
| 192 |
+
Richard S Sutton, Andrew G Barto, et al. Reinforcement learning: An introduction. 1998.
|
| 193 |
+
|
| 194 |
+
Aviv Tamar, Yi Wu, Garrett Thomas, Sergey Levine, and Pieter Abbeel. Value iteration networks. In Advances in Neural Information Processing Systems, pp. 2154–2162, 2016.
|
| 195 |
+
|
| 196 |
+
Jane X Wang, Zeb Kurth-Nelson, Dharshan Kumaran, Dhruva Tirumala, Hubert Soyer, Joel Z Leibo, Demis Hassabis, and Matthew Botvinick. Prefrontal cortex as a meta-reinforcement learning system. Nature neuroscience, 21(6):860, 2018.
|
| 197 |
+
|
| 198 |
+
SHI Xingjian, Zhourong Chen, Hao Wang, Dit-Yan Yeung, Wai-Kin Wong, and Wang-chun Woo. Convolutional lstm network: A machine learning approach for precipitation nowcasting. In Advances in neural information processing systems, pp. 802–810, 2015.
|
| 199 |
+
|
| 200 |
+
Vinicius Zambaldi, David Raposo, Adam Santoro, Victor Bapst, Yujia Li, Igor Babuschkin, Karl Tuyls, David Reichert, Timothy Lillicrap, Edward Lockhart, et al. Relational deep reinforcement learning. arXiv preprint arXiv:1806.01830, 2018.
|
| 201 |
+
|
| 202 |
+
Amy Zhang, Nicolas Ballas, and Joelle Pineau. A dissection of overfitting and generalization in continuous reinforcement learning. arXiv preprint arXiv:1806.07937, 2018a.
|
| 203 |
+
|
| 204 |
+
Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016.
|
| 205 |
+
|
| 206 |
+
Chiyuan Zhang, Oriol Vinyals, Remi Munos, and Samy Bengio. A study on overfitting in deep reinforcement learning. arXiv preprint arXiv:1804.06893, 2018b.
|
| 207 |
+
|
| 208 |
+
# APPENDIX
|
| 209 |
+
|
| 210 |
+
The appendix is organized as follows: we first describe the five environments we used in this paper. We then provide details about the dataset generation process used for Sokoban dataset that we are releasing. Next, we describe the DRC architecture, various choices of memory type, and all the implementation details. We also list the parameters and experimental setup for our DRC all our models. We then present some extended experiments and extension of our generalization analysis, followed by ablation experiments for DRC and finally we compare the DRC against various baseline agents (VIN, ATreeC, and ResNet).
|
| 211 |
+
|
| 212 |
+
A DOMAINS
|
| 213 |
+
|
| 214 |
+

|
| 215 |
+
Figure 7: Sample observations for each of the planning environments at the beginning of an episode.
|
| 216 |
+
|
| 217 |
+
# A.1 SOKOBAN
|
| 218 |
+
|
| 219 |
+
We follow the reward structure in Racanière et al. (2017), with a reward of 10 for completing a level, 1 for getting a box on a target, and -1 for removing a box from a target, in addition to a cost per time-step of -0.01. Each episode is capped at 120 frames. We use a sprite-based representation of the state as input. Each sprite is an (8, 8, 3)-shaped RGB image.
|
| 220 |
+
|
| 221 |
+
Dataset generation is described in Appendix B. Unless otherwise noted, we have used the levels from the unfiltered dataset in experiments.
|
| 222 |
+
|
| 223 |
+
# A.2 MINIPACMAN
|
| 224 |
+
|
| 225 |
+

|
| 226 |
+
Figure 8: (a) Food in dark blue offers a reward of 1. After it is eaten, the food disappears, leaving a black space. Power pills in light blue offer a reward of 2. The player is in green, and ghosts in red. An episode ends when the player is eaten by a ghost. When the player has eaten all the food, the episode continues but the level is reset with power pills and ghosts placed at random positions. (b) When the player eats a power pill, ghosts turn yellow and become edible, with a larger reward or 5 for the player. They then progressively return to red (via orange), at which point they are once again dangerous for the player.
|
| 227 |
+
|
| 228 |
+
MiniPacman is a simplified version of the popular game Pac-Man. The first, deterministic version, was introduced in (Racanière et al., 2017). Here we use a stochastic version, where at every time-step, each ghost moves with a probability of 0.95. This simulates, in a gridworld, the fact that ghosts move slower than the player. An implementation of this game is available under the name Pill Eater at https://github.com/vasiloglou/mltrain-nips-2017/tree/ master/sebastien_racaniere, where 5 different reward structures (or modes) are available.
|
| 229 |
+
|
| 230 |
+
# A.3 BOXWORLD
|
| 231 |
+
|
| 232 |
+
In all our experiments we use branch length of 3 and maximum solution length of 4 . Each episode is capped at 120 frames. Unlike Sokoban, Boxworld levels are generated by the game engine. Unlike Sokoban we do not used sprite-based images; the environment state is provided as a (14, 14, 3) tensor.
|
| 233 |
+
|
| 234 |
+
# A.4 ATARI
|
| 235 |
+
|
| 236 |
+
We use the standard Atari setup of Mnih et al. (2015) with up to 30 no-ops at random, episodes capped at 30 mins, an action repeat of 4, and the full set of 18 actions. We made little effort to tune the hyperparameters for Atari; only the encoder size was increased. See Appendix E.2 for details about the experiments, and Figure 10 for the learning curves.
|
| 237 |
+
|
| 238 |
+
# A.5 GRIDWORLD
|
| 239 |
+
|
| 240 |
+
We generate $3 2 \mathrm { x } 3 2 $ -shaped levels by sampling a number of obstacles between 12 and 24. Each obstacle is a square, with side in [2, 10]. These obstacles may overlap. The player and goal are placed on random different empty squares. We use rejection sampling to ensure the player can reach the goal. Episodes terminate when reaching a goal or when stepping on an obstacle, with a reward of 1 and -1 respectively. There is a small negative reward of -0.01 at each step otherwise.
|
| 241 |
+
|
| 242 |
+
# B DATASET GENERATION DETAILS
|
| 243 |
+
|
| 244 |
+
The unfiltered Sokoban levels are generated by the procedure described in Racanière et al. (2017). Simple hashing is used to avoid repeats. To generate medium levels, we trained a DRC(1,1) policy whose LSTM state is reset at every time step. It achieves around $9 5 \%$ of level solved on the easy set. Then, we generate medium difficulty levels by rejection sampling: we sample levels using the procedure from Racanière et al. (2017), and accept a level if the policy cannot solve it after 10 attempts. The levels are not subsampled from the easy levels dataset but from fresh generation instead, so overlap between easy and medium is minimal (though there are 120 levels in common in the easy and medium datasets). To generate hard levels, we train a DRC(3,3) policy on a mixture of easy and medium levels, until it reached a performance level of around $85 \%$ . We then select the first 3332 levels of a separate medium dataset which are not solved by that policy after 10 attempts (so there is no overlap between hard and medium sets).
|
| 245 |
+
|
| 246 |
+
<table><tr><td rowspan=1 colspan=1>Unfiltered</td><td rowspan=1 colspan=1>Medium</td><td rowspan=1 colspan=1>Hard</td></tr><tr><td rowspan=1 colspan=1>99%</td><td rowspan=1 colspan=1>95%</td><td rowspan=1 colspan=1>80%</td></tr></table>
|
| 247 |
+
|
| 248 |
+
Table 2: Best results obtained on the test set for the different difficulty levels across RL agents within $^ { 2 \mathrm { e 9 } }$ steps of training (averaged across 5 independent runs).
|
| 249 |
+
|
| 250 |
+
# C MODEL
|
| 251 |
+
|
| 252 |
+
We denoted $g _ { \theta } ( s _ { t - 1 } , i _ { t } ) = f _ { \theta } ( f _ { \theta } ( \dots f _ { \theta } ( s _ { t - 1 } , i _ { t } ) , \dots , i _ { t } ) , i _ { t } )$ as the computation at a full time-step of the DRC(D, N) architecture. Here $\theta = ( \theta _ { 1 } , \ldots , \theta _ { D } )$ are the parameters of $D$ stacked memory modules, and $i _ { t } = e ( x _ { t } )$ is the agent’s encoded observation.
|
| 253 |
+
|
| 254 |
+
Let $s _ { t - 1 } ^ { 1 } , \ldots , s _ { t - 1 } ^ { N }$ be the state of the $D$ stacked memory modules at the $N$ ticks at time-step $t - 1$ Each $\boldsymbol { s } _ { t - 1 } ^ { \bar { n } } = ( c _ { 1 } ^ { n } , \ldots , c _ { d } ^ { n } , h _ { 1 } ^ { n } , \ldots , h _ { d } ^ { n } )$ . We then have the "repeat" recurrence below:
|
| 255 |
+
|
| 256 |
+
Table 3: Number of levels in each subset of the dataset and number of overlaps between them.
|
| 257 |
+
|
| 258 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Unfiltered train</td><td rowspan=1 colspan=1>Unfiltered test</td><td rowspan=1 colspan=1>Medium train</td><td rowspan=1 colspan=1>Medium test</td><td rowspan=1 colspan=1>hard</td></tr><tr><td rowspan=1 colspan=1>Unfiltered train</td><td rowspan=1 colspan=1>900,000</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>119</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>0</td></tr><tr><td rowspan=1 colspan=1>Unfiltered test</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>100,000</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>0</td></tr><tr><td rowspan=1 colspan=1>Medium train</td><td rowspan=1 colspan=1>119</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>450,000</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td></tr><tr><td rowspan=1 colspan=1>Medium test</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>50,000</td><td rowspan=1 colspan=1>0</td></tr><tr><td rowspan=1 colspan=1>Hard</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>0</td><td rowspan=1 colspan=1>3332</td></tr></table>
|
| 259 |
+
|
| 260 |
+
$$
|
| 261 |
+
\begin{array} { r l } & { s _ { t - 1 } ^ { 1 } = f _ { \theta } \big ( s _ { t - 1 } , i _ { t } \big ) } \\ & { s _ { t - 1 } ^ { n } = f _ { \theta } \big ( s _ { t - 1 } ^ { n - 1 } , i _ { t } \big ) \mathrm { f o r } 1 < n \leq N } \\ & { \quad s _ { t } = s _ { t - 1 } ^ { N } } \end{array}
|
| 262 |
+
$$
|
| 263 |
+
|
| 264 |
+
We can now describe the computation within a single tick, i.e., outputs $c _ { d } ^ { n }$ and $h _ { d } ^ { n }$ at $d = 1 , \ldots , D$ for a fixed $n$ . This is the "stack" recurrence:
|
| 265 |
+
|
| 266 |
+
$$
|
| 267 |
+
c _ { d } ^ { n } , h _ { d } ^ { n } = \mathrm { M e m o r y M o d u l e } _ { \theta _ { d } } ( i _ { t } , c _ { d } ^ { n - 1 } , h _ { d } ^ { n - 1 } , h _ { d - 1 } ^ { n } )
|
| 268 |
+
$$
|
| 269 |
+
|
| 270 |
+
Note that the encoded observation $i _ { t }$ is fed as an input not only at all ticks $1 , \ldots , \Nu$ , but also at all depths $1 , \ldots , \mathrm { D }$ of the memory stack. (The latter is described in Section 2.1.2 but not depicted in Figure 1 for clarity.)
|
| 271 |
+
|
| 272 |
+
Generally each memory module is a ConvLSTM parameterized by $\theta _ { d }$ at location (d, n) of the DRC grid. But we describe alternative choices of memory module in Appendix C.2.
|
| 273 |
+
|
| 274 |
+
# C.1 ADDITIONAL DETAILS/IMPROVEMENTS
|
| 275 |
+
|
| 276 |
+
# C.1.1 TOP-DOWN SKIP CONNECTION
|
| 277 |
+
|
| 278 |
+
As described in the stack recurrence, we feed the hidden state of each memory module as an input $h _ { d - 1 } ^ { n }$ to the next module in the stack. But this input is only available for modules at depth $d > 1$ . Instead of setting $h _ { 0 } ^ { n } = \mathbf { 0 }$ , we use a top-down skip connection i.e. $h _ { 0 } ^ { n } = h _ { { D } } ^ { n - 1 }$ . We will explore the role of this skip-connection in Appendix F.
|
| 279 |
+
|
| 280 |
+
# C.1.2 POOL-AND-INJECT
|
| 281 |
+
|
| 282 |
+
The pool operation aggregates hidden states across their spatial dimensions to give vectors $\boldsymbol { m } _ { 1 } ^ { n } , \dots , \boldsymbol { m } _ { { D } } ^ { n }$ . We project these through a linear layer each (weights $W _ { p _ { 1 } } , \dotsc , W _ { p _ { D } } )$ , and then tile them over space to obtain summary tensors $p _ { 1 } ^ { n } , \ldots , p _ { D } ^ { n }$ . These have the same shapes as the original hidden states, and can be injected as additional inputs to the memory modules at the next tick.
|
| 283 |
+
|
| 284 |
+
$$
|
| 285 |
+
\begin{array} { r } { m _ { d } ^ { n } : = [ \operatorname* { m a x } _ { H , W } ( h _ { d } ^ { n } ) , \operatorname* { m e a n } _ { H , W } ( h _ { d } ^ { n } ) ] ^ { T } } \\ { p _ { d } ^ { n } : = \mathrm { T i l e } _ { H , W } ( W _ { p _ { d } } m _ { d } ^ { n } ) \qquad } \end{array}
|
| 286 |
+
$$
|
| 287 |
+
|
| 288 |
+
Finally, $p _ { d } ^ { n - 1 }$ is provided as an additional input at location $^ \mathrm { ( d , n ) }$ of the DRC, and equation $\textrm { C }$ becomes:
|
| 289 |
+
|
| 290 |
+
$$
|
| 291 |
+
\begin{array} { r } { c _ { d } ^ { n } , h _ { d } ^ { n } = \mathbf { M e m o r y M o d u l e } _ { \theta _ { d } } ( i _ { t } , c _ { d } ^ { n - 1 } , h _ { d } ^ { n - 1 } , h _ { d - 1 } ^ { n } , { p } _ { d } ^ { n - 1 } ) } \end{array}
|
| 292 |
+
$$
|
| 293 |
+
|
| 294 |
+
# C.2 MEMORY MODULES
|
| 295 |
+
|
| 296 |
+
# C.2.1 CONVLSTM
|
| 297 |
+
|
| 298 |
+
$$
|
| 299 |
+
c _ { d } ^ { n } , h _ { d } ^ { n } = \mathrm { C o n v L S T M } _ { \theta _ { d } } ( i _ { t } , c _ { d } ^ { n - 1 } , h _ { d } ^ { n - 1 } , h _ { d - 1 } ^ { n } )
|
| 300 |
+
$$
|
| 301 |
+
|
| 302 |
+
For all $d > 1$ :
|
| 303 |
+
|
| 304 |
+
$$
|
| 305 |
+
\begin{array} { c } { { f _ { d } ^ { n } = \sigma ( W _ { f i } * i _ { t } + W _ { f h _ { 1 } } * h _ { d - 1 } ^ { n } + W _ { f h _ { 2 } } * h _ { d } ^ { n - 1 } + b _ { f } ) } } \\ { { \ } } \\ { { i _ { d } ^ { n } = \sigma ( W _ { i i } * i _ { t } + W _ { i h _ { 1 } } * h _ { d - 1 } ^ { n } + W _ { i h _ { 2 } } * h _ { d } ^ { n - 1 } + b _ { i } ) } } \\ { { \ o _ { d } ^ { n } = \sigma ( W _ { o i } * i _ { t } + W _ { o h _ { 1 } } * h _ { d - 1 } ^ { n } + W _ { o h _ { 2 } } * h _ { d } ^ { n - 1 } + b _ { o } ) } } \\ { { \ } } \\ { { c _ { d } ^ { n } = f _ { d } ^ { n } \odot c _ { d } ^ { n - 1 } + i _ { d } ^ { n } \odot \mathrm { t a n h } ( W _ { c i } * i _ { t } + W _ { c h _ { 1 } } * h _ { d - 1 } ^ { n } + W _ { c h _ { 2 } } * h _ { d } ^ { n - 1 } + b _ { c } ) } } \\ { { h _ { d } ^ { n } = o _ { d } ^ { n } \odot \mathrm { t a n h } ( c _ { d } ^ { n } ) } } \end{array}
|
| 306 |
+
$$
|
| 307 |
+
|
| 308 |
+
For $d = 1$ , we use the top-down skip connection $h _ { D } ^ { n - 1 }$ in place of $h _ { d - 1 } ^ { n }$ as described above.
|
| 309 |
+
|
| 310 |
+
Here $^ *$ denotes the convolution operator, and $\odot$ denotes point-wise multiplication. Note that $\theta _ { d } = $ $( W _ { f . } , W _ { i . } , W _ { o . } , W _ { c . } , b _ { f } , b _ { i } , b _ { o } , b _ { c } ) _ { d }$ parameterizes the computation of the forget gate, input gate, output gate, and new cell state. $i _ { d } ^ { n }$ and $o _ { d } ^ { n }$ should not be confused with the encoded input $i _ { t }$ or the final output $o _ { t }$ of the entire network.
|
| 311 |
+
|
| 312 |
+
# C.2.2 GATEDCONVRNN
|
| 313 |
+
|
| 314 |
+
This is a simpler module with no cell state.
|
| 315 |
+
|
| 316 |
+
$$
|
| 317 |
+
h _ { d } ^ { n } = \mathrm { G a t e d C o n v R N N } _ { \theta _ { d } } ( i _ { t } , h _ { d } ^ { n - 1 } , h _ { d - 1 } ^ { n } )
|
| 318 |
+
$$
|
| 319 |
+
|
| 320 |
+
For all $d > 1$ :
|
| 321 |
+
|
| 322 |
+
$$
|
| 323 |
+
\begin{array} { c } { { o _ { d } ^ { n } = \sigma ( W _ { o i } * i _ { t } + W _ { o h _ { 1 } } * h _ { d - 1 } ^ { n } + W _ { o h _ { 2 } } * h _ { d } ^ { n - 1 } + b _ { o } ) } } \\ { { { } } } \\ { { h _ { d } ^ { n } = o _ { d } ^ { n } \odot \operatorname { t a n h } ( W _ { h i } * i _ { t } + W _ { h h _ { 1 } } * h _ { d - 1 } ^ { n } + W _ { h h _ { 2 } } * h _ { d } ^ { n - 1 } + b _ { h } ) } } \end{array}
|
| 324 |
+
$$
|
| 325 |
+
|
| 326 |
+
$\theta _ { d } = ( W _ { o . } , W _ { h . } , b _ { o } , b _ { h } ) _ { d }$ has half as many parameters as in the case of the ConvLSTM.
|
| 327 |
+
|
| 328 |
+
# C.2.3 SIMPLECONVRNN
|
| 329 |
+
|
| 330 |
+
This is a classic RNN without gating.
|
| 331 |
+
|
| 332 |
+
$$
|
| 333 |
+
h _ { d } ^ { n } = \operatorname { t a n h } ( W _ { h i } * i _ { t } + W _ { h h _ { 1 } } * h _ { d - 1 } ^ { n } + W _ { h h _ { 2 } } * h _ { d } ^ { n - 1 } + b _ { h } )
|
| 334 |
+
$$
|
| 335 |
+
|
| 336 |
+
$\theta _ { d } = ( W _ { h . } , b _ { h } ) _ { d }$ has half as many parameters as the GatedConvRNN, and only a quarter as the ConvLSTM.
|
| 337 |
+
|
| 338 |
+
We will explore the difference between these memory types in Appendix F. Otherwise, we use the ConvLSTM for all experiments.
|
| 339 |
+
|
| 340 |
+
# D HYPER-PARAMETERS
|
| 341 |
+
|
| 342 |
+
We tuned our hyper-parameters for the DRC models on Sokoban and used the same settings for all other domains. We only changed the encoder network architectures to accommodate the specific observation format of each domain.
|
| 343 |
+
|
| 344 |
+
# D.1 NETWORK PARAMETERS
|
| 345 |
+
|
| 346 |
+
All activation functions are ReLU unless otherwise specified.
|
| 347 |
+
|
| 348 |
+
# Observation size
|
| 349 |
+
|
| 350 |
+
• Sokoban: (80, 80, 3) • Boxworld: (14, 14, 3) • MiniPacman: (15, 19, 3) • Atari: (210, 160, 3)
|
| 351 |
+
|
| 352 |
+
Encoder network is a multilayer CNN with following parameters for each domain:
|
| 353 |
+
|
| 354 |
+
• Sokoban: number of channels: (32, 32), kernel size: (8, 4), strides: (4, 2) • BoxWorld: number of channels: (32, 32), kernel size: (3, 2), strides: (1, 1) • Mini-Pacman: number of channels: (32, 32), kernel size: (3, 3), strides: (1, 1) • Gridworld: number of channels: (64, 64, 32), kernel size: (3, 3, 2), strides: (1, 1, 2) • Atari: number of channels: (16, 32, 64, 128, 64, 32), kernel size: (8, 4, 4, 3, 3, 3), strides: (4, 2, 2, 1, 1, 1)
|
| 355 |
+
|
| 356 |
+
DRC(D, N): all ConvLSTM modules use one convolution with 128 output channels, a kernel size of 3 and stride of 1. All cell states and hidden states have 32 channels.
|
| 357 |
+
|
| 358 |
+
1D LSTM(D, N): all LSTM modules have hidden size 200.
|
| 359 |
+
|
| 360 |
+
Policy: single hidden layer MLP with 256 units.
|
| 361 |
+
|
| 362 |
+
Total number of parameters for all our models are shown in Figure 4.
|
| 363 |
+
|
| 364 |
+
Table 4: Number of parameters for various models
|
| 365 |
+
|
| 366 |
+
<table><tr><td rowspan=1 colspan=1>Model</td><td rowspan=1 colspan=1>Number of parameters</td></tr><tr><td rowspan=1 colspan=1>DRC(3,3)</td><td rowspan=1 colspan=1>2,023,174</td></tr><tr><td rowspan=1 colspan=1>DRC(1,1)</td><td rowspan=1 colspan=1>1,746,054</td></tr><tr><td rowspan=1 colspan=1>1D LSTM (3,3)</td><td rowspan=1 colspan=1>2,151,790</td></tr><tr><td rowspan=1 colspan=1>CNN</td><td rowspan=1 colspan=1>2,089,222</td></tr><tr><td rowspan=1 colspan=1>ResNet for Sokoban</td><td rowspan=1 colspan=1>52,584,982</td></tr><tr><td rowspan=1 colspan=1>ResNet for Boxworld</td><td rowspan=1 colspan=1>3,814,197</td></tr><tr><td rowspan=1 colspan=1>ResNet forMiniPacman</td><td rowspan=1 colspan=1>2,490,902</td></tr><tr><td rowspan=1 colspan=1>I2A</td><td rowspan=1 colspan=1>7,781,269</td></tr><tr><td rowspan=1 colspan=1>VIN</td><td rowspan=1 colspan=1>61,224</td></tr><tr><td rowspan=1 colspan=1>ATreeC</td><td rowspan=1 colspan=1>3,269,063</td></tr></table>
|
| 367 |
+
|
| 368 |
+
# D.2 RL TRAINING SETUP
|
| 369 |
+
|
| 370 |
+
We use the V-trace actor-critic algorithm described by Espeholt et al. (2018), with 4 GPUs for each learner and 200 actors generating trajectories. We reduce variance and improve stability by using $\lambda$ -returns targets $\lambda = 0 . 9 7$ ) and a smaller discount factor $( \gamma = 0 . 9 7 $ ). This marginally reduces the maximum performance observed, but increases the stability and average performance across runs, allowing better comparisons. For all experiments, we use a BPTT (Backpropagation Through Time) unroll of length 20 and a batch size of 32. We use the Adam optimizer (Kingma & Ba, 2014). The learning rate is initialized to 4e-4 and is annealed to 0 over $1 . 5 { \mathrm { e 9 } }$ environment steps with polynomial annealing. The other Adam optimizer parameters are $\beta _ { 1 } = 0 . 9 , \beta _ { 2 } = 0 . 9 9 9 , \epsilon = 1 \mathrm { e } { - 4 } .$ . The entropy and baseline loss weights are set to 0.01 and 0.5 respectively. We also apply a $\textstyle { \mathcal { L } } ^ { 2 }$ norm cost with a weight of 1e-3 on the logits, and a $\mathcal { L } ^ { 2 }$ regularization cost with a weight of 1e-5 to the linear layers that compute the baseline value and logits.
|
| 371 |
+
|
| 372 |
+

|
| 373 |
+
Figure 9: Learning curves in Sokoban for DRC architectures tested on the medium-difficulty test set. The dashed curve shows DRC(3,3) trained on the easier unfiltered dataset. The solid curves show DRC(3,3) and DRC(9,1) trained directly on the medium-difficulty train set.
|
| 374 |
+
|
| 375 |
+
# E EXTRA EXPERIMENTS
|
| 376 |
+
|
| 377 |
+
# E.1 SOKOBAN
|
| 378 |
+
|
| 379 |
+
Figure 9 shows learning curve when different DRC architectures have been trained on the medium set as opposed to unfiltered set in the main text.
|
| 380 |
+
|
| 381 |
+
# E.2 ATARI
|
| 382 |
+
|
| 383 |
+
We train DRC(3,3) and DRC(1,1) on five Atari 2600 games: Alien, Asteroid, Breakout, Ms. PacMan, and Up’n Down. We picked these for their planning focus. Figure 10 shows learning curves comparing DRC(3,3) against DRC(1,1) and ApeX-DQN (Horgan et al., 2018) on the above games. We improve on ApeX-DQN on three out of five games.
|
| 384 |
+
|
| 385 |
+
Our scores generally improve with more training. For example, if we let the DRC(3,3) run for longer, it reaches scores above 75000 in Ms. Pacman.
|
| 386 |
+
|
| 387 |
+
# F EXTRA ABLATION STUDIES
|
| 388 |
+
|
| 389 |
+
In Figure 11, we compare the Sokoban test-set performance of our baseline DRC(3,3) agent against various ablated versions. These results justify our choice of the ConvLSTM memory module and the architectural improvements described in Section 2.1.2.
|
| 390 |
+
|
| 391 |
+
# F.1 MEMORY TYPE
|
| 392 |
+
|
| 393 |
+
The ConvLSTM is the top-performing memory module among those we tested. The Gated ConvRNN module comes out very close with half as many parameters. We surmise that the gap between these two types could be larger for other domains.
|
| 394 |
+
|
| 395 |
+
The Simple ConvRNN suffers from instability and high variance as expected, asserting that some gating is essential for the DRC’s performance.
|
| 396 |
+
|
| 397 |
+
# F.2 ADDITIONAL IMPROVEMENTS
|
| 398 |
+
|
| 399 |
+
Without pool-and-inject, the network learns significantly slower at early stages but nevertheless converges to the same performance as the baseline. The vision shortcut seems to have little influence on the baseline model. This is likely because we already feed the encoded observation to every (d,n)-location of the DRC grid (see Appendix C). Without the top-down skip connection, the model exhibits larger performance variance and also slightly lower final performance. On the whole, none of these are critical to the model’s performance.
|
| 400 |
+
|
| 401 |
+

|
| 402 |
+
Figure 10: Learning curves comparing the DRC(3,3) and DRC(1,1) network configurations in 5 Atari 2600 games. Results are averaged over two independent runs. We also provide ApeX-DQN (no-op regime) results from Horgan et al. (2018) as a reference.
|
| 403 |
+
|
| 404 |
+

|
| 405 |
+
Figure 11: Ablation studies on the performance of our baseline DRC(3,3) agent on Sokoban. All curves show test-set performance. a) We replace the ConvLSTM for simpler memory modules. b) We remove our extra implementation details, namely pool-and-inject, the vision shortcut, and the top-down skip connection, from the model.
|
| 406 |
+
|
| 407 |
+
# G GENERALIZATION
|
| 408 |
+
|
| 409 |
+
For generalization experiments in Boxworld we generate levels online for each level-set size using seeds. Large approximately corresponds to 22k levels, medium to 5k, and small to 800. But at each iteration it’s guaranteed that same levels are generated. Figure 12 shows results of similar experiment as Figure 5 but for BoxWorld domain.
|
| 410 |
+
|
| 411 |
+
Figure 13a shows the extrapolation results on Sokoban when a model that is trained with 4 boxes is tested on levels with larger number of boxes. Performance degradation for DRC(3,3) is very minimal and the models is still able to perform with performance of above $90 \%$ even on the levels with 7 boxes, whereas the performance on for DRC(1,1) drops to under $80 \%$ .
|
| 412 |
+
|
| 413 |
+
Figure 13b shows the generalization gap for Sokoban. Generalization gap is computed by the difference of performance (ratio of the levels solved) between train set and test set. The gap increase substantially more for DRC(1,1) compared to DRC(3,3) as the training set size decreases.
|
| 414 |
+
|
| 415 |
+

|
| 416 |
+
Figure 12: Generalization performance on BoxWorld when model is trained on different dataset sizes
|
| 417 |
+
|
| 418 |
+

|
| 419 |
+
Figure 13: (a) Extrapolation to larger number of boxes than those seen in training. The model was trained on 4 boxes. (b) Generalization gap computed as the difference between performance (in $\%$ of level solved) on train set against test set. Smaller bars correspond to better generalization.
|
| 420 |
+
|
| 421 |
+
# H BASELINE ARCHITECTURES AND EXPERIMENTS
|
| 422 |
+
|
| 423 |
+
# H.1 VALUE ITERATION NETWORKS
|
| 424 |
+
|
| 425 |
+
Our implementation of VIN closely follows (Tamar et al., 2016). This includes using knowledge of the player position in the mechanism for attention over the q-values produced by the VIN module in the case of Gridworld.
|
| 426 |
+
|
| 427 |
+
For Sokoban, which provides pixel observations, we feed an encoded frame $I$ to the VIN module. The convolutional encoder is identical to that used by our DRC models (see Appendix D.1). We also couldn’t use the player position directly; instead we use a learned soft attention mask $A =$ $\sigma ( W _ { a t t e n t i o n } * I )$ over the 2D state space, and sum over the attended values $A \odot \bar { Q _ { a } }$ to obtain an attention-modulated value per abstract action $a$ .
|
| 428 |
+
|
| 429 |
+
We introduce an additional choice of update rule in our experiments. The original algorithm sets $\bar { Q _ { a } } ^ { \prime } = W _ { t r a n s i t i o n } ^ { a } * [ \bar { R } : \bar { V } ]$ atte t ch value iteration. We also try the following alternative: t ’:’ denotes concatenation along the feature dimension $\bar { Q _ { a } } ^ { \prime } =$ $R + \gamma ( W _ { t r a n s i t i o n } ^ { a } * V )$ $\ ' _ { \ast } \ '$ $\gamma$
|
| 430 |
+
factor. In both cases, $\bar { R } = W _ { r e w a r d } * I$ and $\bar { V } = \operatorname* { m a x } _ { a } \bar { Q _ { a } }$ . Although these equations denote a single convolutional operation in the computation of $\bar { Q _ { a } }$ , $\bar { R }$ , and the attention map A, in practice we use two convolutional layers in each case with a relu activation in between.
|
| 431 |
+
|
| 432 |
+
We performed parameter sweeps over the choice of update rules (including $\gamma$ ), learning rate initial value, value iteration depth, number of abstract actions, and intermediate reward channels. The annealing schedule for the learning rate was the same as described in Appendix D.2. In total we had 64 parameter combinations for Gridworld, and 102 for Sokoban. We show the average of the top five performing runs from each sweep in Figures 14a and 14b.
|
| 433 |
+
|
| 434 |
+

|
| 435 |
+
Figure 14: Performance curves comparing DRC(3,3) against baseline architectures on (a) Gridworld $( 3 2 \mathrm { x } 3 2 )$ and (b) Sokoban. The Sokoban curves show the test-set performance. For VIN we average the top five performing curves from the parameter sweep on each domain. For the other architectures we follow the approach described in Appendix I, averaging not the top five curves but five independent replicas for fixed hyperparameters.
|
| 436 |
+
|
| 437 |
+
# H.2 ATREEC
|
| 438 |
+
|
| 439 |
+
We implement and use the actor-critic formulation of (Farquhar et al., 2017). We feed it similarly encoded observations from Sokoban as in our DRC and VIN setups. This is flattened and passed through a fully connected layer before the tree planning and backup steps. We do not use any auxiliary losses for reward or state grounding.
|
| 440 |
+
|
| 441 |
+
We swept over the learning rate initial value, tree depth (2 or 3), embedding size (128, 512), choice of value aggregation (max or softmax), and TD-lambda (0.8, 0.9). We average the top five bestperforming runs from the sweep in Figure 14b.
|
| 442 |
+
|
| 443 |
+

|
| 444 |
+
Figure 15: Performance curves comparing DRC(3,3) and DRC(1,1) against the best ResNet architectures we found for (a) MiniPacman and (b) Boxworld. DRC(3,3) reaches nearly $100 \%$ on Boxworld at 1e9 steps.
|
| 445 |
+
|
| 446 |
+
# H.3 RESNET
|
| 447 |
+
|
| 448 |
+
We experiment with different ResNet architectures for each domain and choose one that performs best.
|
| 449 |
+
|
| 450 |
+
Sokoban Each layer was constructed by one CNN layer that could be potentially used for downsampling using the stride parameter, and two residual blocks on top which consisted of one CNN layer. We used 9 of the described layers with (32, 32, 64, 64, 64, 64, 64, 64, 64) channels, (8, 4, 4, 4, 4, 4, 4, 4, 4) kernel shapes and (4, 2, 1, 1, 1, 1, 1, 1, 1) strides for the down-sampling CNN. And the output flattened and passed to 1 hidden layer MLP with 256 units, before computing the policy and baseline.
|
| 451 |
+
|
| 452 |
+
Boxworld We had a three layer CNN with (16, 32, 64) channels, kernel shape of 2 and stride of 1. And on top of that 8 ResNet blocks. Each blocks was consisted of the 2 layer CNN with 64 channels, kernel shape of 3 and stride 1. And the output flattened and passed to 1 hidden layer MLP with 256 units, before computing the policy and baseline.
|
| 453 |
+
|
| 454 |
+
MiniPacman We used the same model architecture as the one used for Boxworld with only difference being the initial CNN layer channels were (16, 32, 32) and ResNet blocks had 32 channels.
|
| 455 |
+
|
| 456 |
+
Figures 15a and 15b compare the ResNets above against DRC(3,3) and DRC(1,1) on MiniPacman and Boxworld.
|
| 457 |
+
|
| 458 |
+
# H.4 CNN
|
| 459 |
+
|
| 460 |
+
The CNN network we use is similar to the encoder network for DRC with more layers. It has (32, 32, 64, 64, 64, 64, 64, 64, 64) channels, (8, 4, 4, 4, 4, 4, 4, 4, 4) kernel sizes and strides of (4, 2, 1, 1, 1, 1, 1, 1, 1).
|
| 461 |
+
|
| 462 |
+
# H.5 I2A
|
| 463 |
+
|
| 464 |
+
We use the I2A implementation available at https://github.com/vasiloglou/ mltrain-nips-2017/tree/master/sebastien_racaniere with the following modifications:
|
| 465 |
+
|
| 466 |
+
• We replace the FrameProcessing class with a 3-layer CNN with kernel sizes $( 8 , 3 , 3 )$ , strides $( 8 , 1 , 1 )$ and channels (32, 64, 64); the output of the last convolution is then flattened and passed through a linear layer with 512 outputs. • The model-free path passed to the I2A class was a FrameProcessing as describe above. • The RolloutPolicy is a 2-layer CNN with kernel sizes $( 8 , 1 )$ , strides $( 8 , 1 )$ and channels (16, 16); the output of the last convolution is flattened and passed through an MLP with one hidden layer of size 128, and output size 5 (the number of actions in Sokoban).
|
| 467 |
+
|
| 468 |
+
• The environment model is similar to the one used in Racanière et al. (2017). It consists of a deterministic model that given a frame and one-hot encoded action, outputs a predicted next frame and reward. The input frame is first reduced in size using a convolutional layer with kernel size 8, stride 8 and 32 channels. The action is then combined with the output of this layer using pool-and-inject (see (Racanière et al., 2017)). This is followed by 2 size preserving residual blocks with convolutions of shape 3. The output of the last residual block is then passed to two separate networks to predict frame and reward. The frame prediction head uses a convolution layer with shape 3, stride 1, followed by a deconvolution with stride 8, kernel shape 8 and 3 channels. The reward prediction head uses a convolution layer with shape 3, stride 1, followed by a linear layer with output size 3. We predict rewards binned in 3 categories (less than $- 1$ , between $[ - 1 , 1 ]$ and greater than 1), reducing it to a classification problem. Racanière et al. (2017).
|
| 469 |
+
|
| 470 |
+
The agent was trained with the V-trace actor-critic algorithm described by Espeholt et al. (2018). Unlike in Racanière et al. (2017), the environment model was not pre-trained. Instead it was trained online, using the same data that was used to train the RL loss.
|
| 471 |
+
|
| 472 |
+
# I DETAILS ABOUT FIGURES
|
| 473 |
+
|
| 474 |
+
Unless otherwise noted, each curve is the average of five independent runs (with identical parameters). We also show a $9 5 \%$ confidence interval (using a shaded area) around each averaged curve. Before independent runs are averaged, we smoothen them with a window size of 5 million steps. Steps in RL learning curves refer to the total number of environment steps seen by the actors.
|
md/train/Hy6GHpkCW/Hy6GHpkCW.md
ADDED
|
@@ -0,0 +1,367 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A NEURAL REPRESENTATION OF SKETCH DRAWINGS
|
| 2 |
+
|
| 3 |
+
David Ha
|
| 4 |
+
Google Brain
|
| 5 |
+
hadavid@google.com
|
| 6 |
+
Douglas Eck
|
| 7 |
+
Google Brain
|
| 8 |
+
deck@google.com
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
We present sketch-rnn, a recurrent neural network (RNN) able to construct stroke-based drawings of common objects. The model is trained on a dataset of human-drawn images representing many different classes. We outline a framework for conditional and unconditional sketch generation, and describe new robust training methods for generating coherent sketch drawings in a vector format.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
Recently, there have been major advancements in generative modelling of images using neural networks as a generative tool. Generative Adversarial Networks (GANs) (Goodfellow, 2016), Variational Inference (VI) (Kingma & Welling, 2013), and Autoregressive (AR) (Reed et al., 2017) models have become popular tools in this fast growing area. Most of the work thus far has been targeted towards modelling low resolution, pixel images. Humans, however, do not understand the world as a grid of pixels, but rather develop abstract concepts to represent what we see. From a young age, we develop the ability to communicate what we see by drawing on paper with a pencil or crayon. In this way we learn to express a sequential, vector representation of an image as a short sequence of strokes. In this paper we investigate an alternative to traditional pixel image modelling approaches, and propose a generative model for vector images.
|
| 17 |
+
|
| 18 |
+

|
| 19 |
+
Figure 1: Latent space interpolation of various vector images produced by our model (left). Interpolation of two different Kanji characters (亀 書) as sequence of strokes (right)
|
| 20 |
+
|
| 21 |
+
Our goal is to train machines to draw and generalize abstract concepts in a manner similar to humans. In this work, as a first step towards this goal, we train our model on a dataset of hand-drawn sketches, each represented as a sequence of motor actions controlling a pen: which direction to move, when to lift the pen up, and when to stop drawing. In doing so, we created a model that potentially has many applications, from assisting the creative process of an artist, to helping teach students how to draw.
|
| 22 |
+
|
| 23 |
+
This paper makes the following contributions: We outline a framework for both unconditional and conditional generation of vector images composed of a sequence of lines. Our recurrent neural network-based generative model is capable of producing sketches of common objects in a vector format. We develop a training procedure unique to vector images to make the training more robust. In the conditional generation model, we explore the latent space developed by the model to represent a vector image. We also discuss creative applications of our methodology. We make available a dataset of 50 million hand drawn vector images to encourage further development of generative modelling for vector images, and also release an implementation of our model as an open source project.1
|
| 24 |
+
|
| 25 |
+
# 2 RELATED WORK
|
| 26 |
+
|
| 27 |
+
There is a long history of work related to algorithms that mimic painters. One such work is Portrait Drawing by Paul the Robot (Tresset & Fol Leymarie, 2013; Xie et al., 2012), where an underlying algorithm controlling a mechanical robot arm sketches lines on a canvas with a programmable artistic style to mimic a given digitized portrait of a person. Reinforcement Learning based-approaches (Xie et al., 2012) have been developed to discover a set of paint brush strokes that can best represent a given input photograph. These prior works generally attempt to mimic digitized photographs, rather than develop generative models of vector images.
|
| 28 |
+
|
| 29 |
+
Neural Network-based approaches have been developed for generative models of images, although the majority of neural network-related research on image generation deal with pixel images (Goodfellow, 2016; Isola et al., 2016; Kaae Sønderby et al., 2016; Kingma et al., 2016; Reed et al., 2017; White, 2016). There has been relatively little work done on vector image generation using neural networks. An earlier work (Simhon & Dudek, 2004) makes use of Hidden Markov Models to synthesize lines and curves of a human sketch. More recent work (Graves, 2013) on handwriting generation with Recurrent Neural Networks laid the groundwork for utilizing Mixture Density Networks (Bishop, 1994) to generate continuous data points. Recent works of this approach attempted to generate vectorized Kanji characters (Ha, 2015; Zhang et al., 2016) by modelling Chinese characters as a sequence of pen stroke actions.
|
| 30 |
+
|
| 31 |
+
The approach outlined in this work allows one to explore the latent space representation of vector images. For instance, we can use our model to interpolate between two Kanji characters in Figure 1 by first encoding the characters, represented as a sequence of strokes, into a latent space of embedding vectors. Previous work (Bowman et al., 2015) outlined a methodology to combine Sequence-toSequence models with a Variational Autoencoder to model natural English sentences in latent vector space. A related work (Lake et al., 2015), utilizes probabilistic program induction, rather than neural networks, to perform one-shot modelling of the Omniglot dataset containing images of symbols.
|
| 32 |
+
|
| 33 |
+
One of the factors limiting research development in the space of generative vector drawings is the lack of publicly available datasets. Previously, the Sketch dataset (Eitz et al., 2012), consisting of 20K vector sketches, was used to explore feature extraction techniques. A subsequent work, the Sketchy dataset (Sangkloy et al., 2016), provided 70K vector sketches along with corresponding pixel images for various classes. This allowed for a larger-scale exploration of human sketches. ShadowDraw (Lee et al., 2011) is an interactive system that predicts what a finished drawing looks like based on a set of incomplete brush strokes from the user while the sketch is being drawn. ShadowDraw used a dataset of 30K raster images combined with extracted vectorized features. In this work, we use a much larger dataset of 50 million vector sketches that is made publicly available.
|
| 34 |
+
|
| 35 |
+
# 3 METHODOLOGY
|
| 36 |
+
|
| 37 |
+
# 3.1 DATASET
|
| 38 |
+
|
| 39 |
+
We constructed QuickDraw, a dataset of 50 million vector drawings obtained from Quick, Draw! (Jongejan et al., 2016), an online game where the players are asked to draw objects belonging to a particular object class in less than 20 seconds. QuickDraw consists of hundreds of classes of common objects. Each class of QuickDraw is a dataset of 70K training samples, in addition to 2.5K validation and 2.5K test samples.
|
| 40 |
+
|
| 41 |
+
We use a data format that represents a sketch as a set of pen stroke actions. This representation is an extension of the format used in (Graves, 2013). Our format extends the binary pen stroke event into a multi-state event. In this data format, the initial coordinate of the drawing is located at the origin.
|
| 42 |
+
|
| 43 |
+
A sketch is a list of points, and each point is a vector consisting of 5 elements: $( \Delta x , \Delta y , p _ { 1 } , p _ { 2 } , p _ { 3 } )$ . The first two elements are the offset distance in the $\mathbf { X }$ and y directions of the pen from the previous point. The last 3 elements represents a binary one-hot vector of 3 possible states. The first pen state, $p _ { 1 }$ , indicates that the pen is currently touching the paper, and that a line will be drawn connecting the next point with the current point. The second pen state, $p _ { 2 }$ , indicates that the pen will be lifted from the paper after the current point, and that no line will be drawn next. The final pen state, $p _ { 3 }$ , indicates that the drawing has ended, and subsequent points, including the current point, will not be rendered.
|
| 44 |
+
|
| 45 |
+
# 3.2 SKETCH-RNN
|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
Figure 2: Schematic diagram of sketch-rnn.
|
| 49 |
+
|
| 50 |
+
Our model is a Sequence-to-Sequence Variational Autoencoder (VAE), similar to the architecture described in (Bowman et al., 2015; Kingma & Welling, 2013). Our encoder is a bidirectional RNN (Schuster et al., 1997) that takes in a sketch as an input, and outputs a latent vector of size $N _ { z }$ . Specifically, we feed the sketch sequence, $S$ , and also the same sketch sequence in reverse order, $S _ { \mathrm { r e v e r s e } }$ , into the two encoding RNNs of the bidirectional RNN, to obtain two final hidden states:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
h _ { \right. } = { \mathrm { e n c o d e } } _ { \right. } ( S ) , \ h _ { \left. } = { \mathrm { e n c o d e } } _ { \left. } ( S _ { \mathrm { r e v e r s e } } ) , \ h = [ \ h _ { \right. } \ ; \ h _ { \left. } ] .
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
We take this final concatenated hidden state, $h$ , and project it into two vectors $\mu$ and $\hat { \sigma }$ , each of size $N _ { z }$ , using a fully connected layer. We convert $\hat { \sigma }$ into a non-negative standard deviation parameter $\sigma$ using an exponential operation. We use $\mu$ and $\sigma$ , along with $\mathcal { N } ( 0 , I )$ , a vector of IID Gaussian variables of size $N _ { z }$ , to construct a random vector, $z \in \mathbb { R } ^ { { N _ { z } } }$ , as in the approach for a VAE:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\mu = W _ { \mu } h + b _ { \mu } , \hat { \sigma } = W _ { \sigma } h + b _ { \sigma } , \sigma = \exp \Big ( \frac { \hat { \sigma } } { 2 } \Big ) , z = \mu + \sigma \odot \mathcal { N } ( 0 , I ) .
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
Under this encoding scheme, the latent vector $z$ is not a deterministic output for a given input sketch, but a random vector conditioned on the input sketch.
|
| 63 |
+
|
| 64 |
+
Our decoder is an autoregressive RNN that samples output sketches conditional on a given latent vector $z$ . The initial hidden states $h _ { 0 }$ , and optional cell states $c _ { 0 }$ (if applicable) of the decoder RNN is the output of a single layer network: $[ \ : h _ { 0 } ; \ : \overline { { { c _ { 0 } } } } \ : ] = \operatorname { t a n h } ( W _ { z } z + b _ { z } ) \ :$
|
| 65 |
+
|
| 66 |
+
At each step $i$ of the decoder RNN, we feed the previous point, $S _ { i - 1 }$ and the latent vector $z$ in as a concatenated input $x _ { i }$ , where $S _ { 0 }$ is defined as $( 0 , 0 , 1 , 0 , 0 )$ . The output at each time step are the parameters for a probability distribution of the next data point $S _ { i }$ . In Equation 3, we model $( \Delta x , \Delta y )$ as a Gaussian mixture model (GMM) with $M$ normal distributions as in (Bishop, 1994; Graves, 2013), and $( q _ { 1 } , q _ { 2 } , q _ { 3 } )$ as a categorical distribution to model the ground truth data $\left( p _ { 1 } , p _ { 2 } , p _ { 3 } \right)$ , where $( q _ { 1 } + q _ { 2 } + q _ { 3 } = 1 )$ as done in (Ha, 2015) and (Zhang et al., 2016). Unlike (Graves, 2013), our generated sequence is conditioned from a latent code $z$ sampled from our encoder, which is trained end-to-end alongside the decoder.
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
p ( \Delta x , \Delta y ) = \sum _ { j = 1 } ^ { M } { \Pi _ { j } \ N } ( \Delta x , \Delta y \mid \mu _ { x , j } , \mu _ { y , j } , \sigma _ { x , j } , \sigma _ { y , j } , \rho _ { x y , j } ) , \mathrm { ~ w h e r e ~ } \sum _ { j = 1 } ^ { M } { \Pi _ { j } } = 1 \mathrm { ~ a n d ~ } ( \mathrm { R e } ( \Delta x , \Delta y ) )
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
$\mathcal N ( x , y | \mu _ { x } , \mu _ { y } , \sigma _ { x } , \sigma _ { y } , \rho _ { x y } )$ is the probability distribution function for a bivariate normal distribution. Each of the $M$ bivariate normal distributions consist of five parameters: $( \mu _ { x } , \mu _ { y } , \sigma _ { x } , \sigma _ { y } , \rho _ { x y } )$ , where $\mu _ { x }$ and $\mu _ { y }$ are the means, $\sigma _ { x }$ and $\sigma _ { y }$ are the standard deviations, and $\rho _ { x y }$ is the correlation parameter of each bivariate normal distribution. An additional vector $\Pi$ of length $M$ , also a categorical distribution, are the mixture weights of the Gaussian mixture model. Hence the size of the output vector $y$ is $5 M + M + 3$ , which includes the 3 logits needed to generate $( q _ { 1 } , q _ { 2 } , q _ { 3 } )$ .
|
| 73 |
+
|
| 74 |
+
The next hidden state of the RNN, generated with its forward operation, projects into the output vector $y _ { i }$ using a fully-connected layer:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\begin{array} { r } { x _ { i } = \left[ S _ { i - 1 } ~ ; ~ z \right] , ~ \left[ h _ { i } ~ ; ~ c _ { i } ~ \right] = ~ \mathtt { f o r w a r d } ( x _ { i } , ~ \left[ h _ { i - 1 } ~ ; ~ c _ { i - 1 } \right] ) , ~ y _ { i } = W _ { y } h _ { i } + b _ { y } , ~ y _ { i } \in \mathbb { R } ^ { 6 M + 3 } . } \end{array}
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
The vector $y _ { i }$ is broken down into the parameters of the probability distribution of the next data point: $\big [ \left( \hat { \Pi } \mu _ { x } \mu _ { y } \hat { \sigma } _ { x } \hat { \sigma } _ { y } \hat { \rho } _ { x y } \right) _ { 1 } \left( \hat { \Pi } \mu _ { x } \mu _ { y } \hat { \sigma } _ { x } \hat { \sigma } _ { y } \hat { \rho } _ { x y } \right) _ { 2 } \ldots \left( \hat { \Pi } \mu _ { x } \mu _ { y } \hat { \sigma } _ { x } \hat { \sigma } _ { y } \hat { \rho } _ { x y } \right) _ { M } \left( \hat { q } _ { 1 } \hat { q } _ { 2 } \hat { q } _ { 3 } \right) \big ] = y _ { i } .$ (5) As in (Graves, 2013), we apply exp and tanh operations to ensure the standard deviation values are non-negative, and that the correlation value is between $^ { - 1 }$ and 1:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
\sigma _ { x } = \exp ( \hat { \sigma } _ { x } ) , \ \sigma _ { y } = \exp ( \hat { \sigma } _ { y } ) , \ \rho _ { x y } = \operatorname { t a n h } ( \hat { \rho } _ { x y } ) .
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
The probabilities for the categorical distributions are calculated using the outputs as logit value
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
q _ { k } = \frac { \exp ( \hat { q } _ { k } ) } { \sum _ { j = 1 } ^ { 3 } \exp ( \hat { q } _ { j } ) } , k \in \{ 1 , ~ 2 , ~ 3 \} , ~ \Pi _ { k } = \frac { \exp ( \hat { \Pi } _ { k } ) } { \sum _ { j = 1 } ^ { M } \exp ( \hat { \Pi } _ { j } ) } , k \in \{ 1 , ~ \ldots , ~ { \cal M } \} .
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
A key challenge is to train our model to know when to stop drawing. Because the probabilities of the three pen stroke events are highly unbalanced, the model becomes more difficult to train. The probability of a $p _ { 1 }$ event is much higher than $p _ { 2 }$ , and the $p _ { 3 }$ event will only happen once per drawing. The approach developed in (Ha, 2015) and later followed by (Zhang et al., 2016) was to use different weightings for each pen event when calculating the losses, such as a hand-tuned weighting of $( 1 , 1 0 , 1 0 0 )$ . We find this inelegant approach to be inadequate for our dataset of diverse images.
|
| 93 |
+
|
| 94 |
+
We develop a simpler, more robust approach that works well for a broad class of sketch drawing data. In our approach, all sequences are generated to a length of $N _ { \mathrm { m a x } }$ where $N _ { \mathrm { m a x } }$ is the length of the longest sketch in our training dataset. In principle $N _ { \mathrm { m a x } }$ can be considered a hyper parameter. As the length of $S$ is usually shorter than $N _ { \mathrm { m a x } }$ , we set $S _ { i }$ to be $( 0 , 0 , 0 , 0 , 1 )$ for $i > N _ { s }$ . We discuss the training in detail in the next section.
|
| 95 |
+
|
| 96 |
+
After training, we can sample sketches from our model. During the sampling process, we generate the parameters for both GMM and categorical distributions at each time step, and sample an outcome $S _ { i } ^ { \prime }$ for that time step. Unlike the training process, we feed the sampled outcome $S _ { i } ^ { \prime }$ as input for the next time step. We continue to sample until $p _ { 3 } = 1$ , or when we have reached $i = N _ { \operatorname* { m a x } }$ . Like the encoder, the sampled output is not deterministic, but a random sequence, conditioned on the input latent vector $z$ . We can control the level of randomness we would like our samples to have during the sampling process by introducing a temperature parameter $\tau$ :
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\hat { q } _ { k } \to \frac { \hat { q } _ { k } } { \tau } , \hat { \Pi } _ { k } \to \frac { \hat { \Pi } _ { k } } { \tau } , \sigma _ { x } ^ { 2 } \to \sigma _ { x } ^ { 2 } \tau , \sigma _ { y } ^ { 2 } \to \sigma _ { y } ^ { 2 } \tau .
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
We can scale the softmax parameters of the categorial distribution and also the $\sigma$ parameters of the bivariate normal distribution by a temperature parameter $\tau$ , to control the level of randomness in our samples. $\tau$ is typically set between 0 and 1. In the limiting case as $\tau 0$ , our model becomes deterministic and samples will consist of the most likely point in the probability density function. Figure 3 illustrates of effect of sampling sketches with various temperature parameters.
|
| 103 |
+
|
| 104 |
+
# 3.3 UNCONDITIONAL GENERATION
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
Figure 3: Unconditional generation of firetrucks, yoga poses, gardens and owls with varying $\tau$
|
| 108 |
+
|
| 109 |
+
As a special case, we can also train our model to generate sketches unconditionally, where we only train the decoder RNN module, without any input or latent vectors. By removing the encoder, the decoder RNN as a standalone model is an autoregressive model without latent variables. In this use case, the initial hidden states and cell states of the decoder RNN are initialized to zero. The inputs $x _ { i }$ of the decoder RNN at each time step is only $S _ { i - 1 }$ or $S _ { i - 1 } ^ { \prime }$ , as we do not need to concatenate a latent vector $z$ . In Figure 3, we sample various sketch images generated unconditionally by varying the temperature parameter from $\tau = 0 . 2$ at the top in blue, to $\tau = 0 . 9$ at the bottom in red.
|
| 110 |
+
|
| 111 |
+
# 3.4 TRAINING
|
| 112 |
+
|
| 113 |
+
Our training procedure follows the approach of the Variational Autoencoder (Kingma & Welling, 2013), where the loss function is the sum of two terms: the Reconstruction Loss, $L _ { R }$ , and the Kullback-Leibler Divergence Loss, $L _ { K L }$ . We train our model to optimize this two-part loss function. The Reconstruction loss term, described in Equation 9, maximizes the log-likehood of the generated probability distribution to explain the training data $S$ . We can calculate this reconstruction loss, $L _ { R }$ , using the generated parameters of the pdf and the training data $S$ . $L _ { R }$ is composed of the sum of the log loss of the offset terms $( \Delta x , \Delta y )$ , $L _ { s }$ , and the log loss of the pen state terms $( p _ { 1 } , p _ { 2 } , p _ { 3 } ) , L _ { p }$ :
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\begin{array} { l } { { { \cal L } _ { s } = \displaystyle - \frac { 1 } { N _ { \mathrm { m a x } } } \sum _ { i = 1 } ^ { N _ { s } } \log \Big ( \sum _ { j = 1 } ^ { M } \Pi _ { j , i } \mathscr { N } ( \Delta x _ { i } , \Delta y _ { i } \mid \mu _ { x , j , i } , \mu _ { y , j , i } , \sigma _ { x , j , i } , \sigma _ { y , j , i } , \rho _ { x y , j , i } ) \Big ) } } \\ { { { \cal L } _ { p } = \displaystyle - \frac { 1 } { N _ { \mathrm { m a x } } } \sum _ { i = 1 } ^ { N _ { \mathrm { m a x } } } \sum _ { k = 1 } ^ { 3 } p _ { k , i } \log ( q _ { k , i } ) , \ L _ { R } = L _ { s } + L _ { p } . } } \end{array}
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
Note that we discard the pdf parameters modelling the $( \Delta x , \Delta y )$ points beyond $N _ { s }$ when calculating $L _ { s }$ , while $L _ { p }$ is calculated using all of the pdf parameters modelling the $\left( p _ { 1 } , p _ { 2 } , p _ { 3 } \right)$ points until $N _ { \mathrm { m a x } }$ . Both terms are normalized by the total sequence length $N _ { \mathrm { m a x } }$ . We found this methodology of loss calculation to be more robust and allows the model to easily learn when it should stop drawing, unlike the earlier mentioned method of assigning importance weightings to $p _ { 1 } , p _ { 2 }$ , and $p _ { 3 }$ .
|
| 120 |
+
|
| 121 |
+
The Kullback-Leibler (KL) divergence loss term measures the difference between the distribution of our latent vector $z$ , to that of an IID Gaussian vector with zero mean and unit variance. Optimizing for this loss term allows us to minimize this difference. We use the result in (Kingma $\&$ Welling, 2013), and calculate the KL loss term, $L _ { K L }$ , normalized by number of dimensions $N _ { z }$ of $z$ :
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
L _ { K L } = - \frac { 1 } { 2 N _ { z } } \Big ( 1 + \hat { \sigma } - \mu ^ { 2 } - \exp ( \hat { \sigma } ) \Big ) .
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
The loss function in Equation 11 is a weighted sum of both the $L _ { R }$ and $L _ { K L }$ loss terms:
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
L o s s = L _ { R } + w _ { K L } L _ { K L } .
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
There is a tradeoff between optimizing for one term over the other. As $w _ { K L } 0$ , our model approaches a pure autoencoder, sacrificing the ability to enforce a prior over our latent space while obtaining better reconstruction loss metrics. Note that for unconditional generation, where our model is the standalone decoder, there will be no $L _ { K L }$ term as we only optimize for $L _ { R }$ .
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 4: Tradeoff between $L _ { R }$ and $L _ { K L }$ , for two models trained on single class datasets (left). Validation Loss Graph for models trained on the Yoga dataset using various $w _ { K L }$ (right
|
| 137 |
+
|
| 138 |
+
Figure 4 illustrates the tradeoff between different settings of $w _ { K L }$ and the resulting $L _ { R }$ and $L _ { K L }$ metrics on the test set, along with the $L _ { R }$ metric on a standalone decoder RNN for comparison. As the unconditional model does not receive any prior information about the entire sketch it needs to generate, the $L _ { R }$ metric for the standalone decoder model serves as an upper bound for various conditional models using a latent vector.
|
| 139 |
+
|
| 140 |
+
# 4 EXPERIMENTS
|
| 141 |
+
|
| 142 |
+
We conduct several experiments with sketch-rnn for both conditional and unconditional vector image generation. We train sketch-rnn on various QuickDraw classes using various settings for $w _ { K L }$ and record the breakdown of losses. To experiment with a diverse set of classes with varying complexities, we select the cat, pig, face, firetruck, garden, owl, mosquito and yoga class. We also experiment on multi-class datasets by concatenating different classes together to form (cat, pig) and (crab, face, pig, rabbit). The results for test set evaluation on various datasets are displayed in Table 1.
|
| 143 |
+
|
| 144 |
+
The sketch-rnn model treats the RNN cell as an abstract component. In our experiments, we use Long Short-Term Memory (LSTM) (Hochreiter & Schmidhuber, 1997) as the encoder RNN. For the decoder RNN, we use HyperLSTM, as this type of RNN cell excels at sequence generation tasks (Ha et al., 2017). The ability for HyperLSTM to spontaneously augment its own weights enables it to adapt to many different regimes in a large diverse dataset. Please see the Appendix for more details.
|
| 145 |
+
|
| 146 |
+
<table><tr><td>Dataset</td><td>WKL</td><td>= 1.00</td><td></td><td>WKL = 0.50</td><td>WKL</td><td>= 0.25</td><td>Decoder Only</td></tr><tr><td></td><td>LR</td><td>LKL</td><td>LR</td><td>LKL</td><td>LR</td><td>LKL</td><td>LR</td></tr><tr><td>cat</td><td>-0.98</td><td>0.29</td><td>-1.33</td><td>0.70</td><td>-1.46</td><td>1.01</td><td>-0.57</td></tr><tr><td>pig</td><td>-1.14</td><td>0.22</td><td>-1.37</td><td>0.49</td><td>-1.52</td><td>0.80</td><td>-0.82</td></tr><tr><td>cat, pig</td><td>-1.02</td><td>0.22</td><td>-1.24</td><td>0.49</td><td>-1.50</td><td>0.98</td><td>-0.75</td></tr><tr><td>crab,face,pig,rabbit</td><td>-0.91</td><td>0.22</td><td>-1.04</td><td>0.40</td><td>-1.47</td><td>1.17</td><td>-0.67</td></tr><tr><td>face</td><td>-1.13</td><td>0.27</td><td>-1.55</td><td>0.71</td><td>-1.90</td><td>1.44</td><td>-0.73</td></tr><tr><td>firetruck</td><td>-1.24</td><td>0.22</td><td>-1.26</td><td>0.24</td><td>-1.78</td><td>1.10</td><td>-0.90</td></tr><tr><td>garden</td><td>-0.79</td><td>0.20</td><td>-0.81</td><td>0.25</td><td>-0.99</td><td>0.54</td><td>-0.62</td></tr><tr><td>owl</td><td>-0.93</td><td>0.20</td><td>-1.03</td><td>0.34</td><td>-1.29</td><td>0.77</td><td>-0.66</td></tr><tr><td>mosquito</td><td>-0.67</td><td>0.30</td><td>-1.02</td><td>0.66</td><td>-1.41</td><td>1.54</td><td>-0.34</td></tr><tr><td>yoga</td><td>-0.80</td><td>0.24</td><td>-1.07</td><td>0.55</td><td>-1.51</td><td>1.33</td><td>-0.48</td></tr></table>
|
| 147 |
+
|
| 148 |
+
Table 1: Loss figures $L _ { R }$ and $L _ { K L }$ ) for various $w _ { K L }$ settings.
|
| 149 |
+
|
| 150 |
+
The relative loss numbers are consistent with our expectations. We see that the reconstruction loss term $L _ { R }$ decreases as we relax the $w _ { K L }$ parameter controlling the weight for the KL loss term, and meanwhile the KL loss term $L _ { R }$ increases as a result. The $L _ { R }$ for the conditional model is strictly less than the unconditional, standalone decoder model. In Figure 4 (right), we plot validation-set loss graphs for on the yoga class for models with various $w _ { K L }$ settings. As $L _ { R }$ decreases, the $L _ { K L }$ term tends to increase due to the tradeoff between $L _ { R }$ and $L _ { K L }$ .
|
| 151 |
+
|
| 152 |
+
# 4.1 CONDITIONAL RECONSTRUCTION
|
| 153 |
+
|
| 154 |
+
We qualitatively assess the reconstructed sketch $S ^ { \prime }$ given an input sketch $S$ . In Figure 5 (left), we sample several reconstructions at various levels of temperature $\tau$ using a model trained on the single cat class, starting at 0.01 on the left and linearly increasing to 1.0 on the right. The reconstructed cat sketches have similar properties as the input image, and occasionally add or remove details such as a whisker, a mouth, a nose, or the orientation of the tail.
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 5: Conditional generation of cats (left) and pigs (right).
|
| 158 |
+
|
| 159 |
+
When presented with a non-standard image of a cat, such as a cat’s face with three eyes, the reconstructed cat only has two eyes. If we input a sketch from another image class, such a toothbrush, the model seemingly generate sketches with similar orientation and properties as the toothbrush input image, but with some cat-like features such as cat ears, whiskers or feet. We perform a similar experiment with a model trained on the pig class, as shown in Figure 5 (right).
|
| 160 |
+
|
| 161 |
+
# 4.2 LATENT SPACE INTERPOLATION
|
| 162 |
+
|
| 163 |
+
By interpolating between latent vectors, we can visualize how one image morphs into another image by visualizing the reconstructions of the interpolations. As we enforce a Gaussian prior on the latent space, we expect fewer gaps in the space between two encoded latent vectors. We expect a model trained using a higher $w _ { K L }$ setting to produce images that are closer to the data manifold given a spherically interpolated (White, 2016) latent vector $z$ , compared to another model trained with a lower wKL.
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 6: Latent space interpolation between cat and pig using with various $w _ { K L }$ settings (left). Sketch Drawing Analogies (right).
|
| 167 |
+
|
| 168 |
+
To demonstrate this, we train several models using various $w _ { K L }$ , on a dataset consisting of both cat and pigs, and we encode two distinct images from the test set - a cat face and a full pig. Figure 6 (left) shows the reconstructed images from the interpolated latent vectors between the two original images. As expected, models trained with higher $w _ { K L }$ produce more coherent interpolated images.
|
| 169 |
+
|
| 170 |
+
# 4.3 SKETCH DRAWING ANALOGIES
|
| 171 |
+
|
| 172 |
+
The interpolation example in Figure 6 (left) suggests that the latent vector $z$ encode conceptual features of a sketch. Can we use these features to augment other sketches without such features – for example, adding a body to a cat’s head? Indeed, we find that sketch drawing analogies are possible for models trained with low $L _ { K L }$ numbers. Given the smoothness of the latent space, where any interpolated vector between two latent vectors results in a coherent sketch, we can perform vector arithmetic on the latent vectors encoded from different sketches and explore how the model organizes the latent space to represent different concepts in the manifold of generated sketches.
|
| 173 |
+
|
| 174 |
+
For example, as shown in Figure 6 (right), we can subtract the latent vector of an encoded pig head from the latent vector of a full pig, to arrive at a vector that represents a body. Adding this difference to the latent vector of a cat head results in a full cat (i.e. cat head $^ +$ body $=$ full cat). We repeat the experiment to remove the body of a full pig. These drawing analogies allow us to explore how the model organizes its latent space to represent different concepts in the manifold of generated sketches.
|
| 175 |
+
|
| 176 |
+

|
| 177 |
+
4.4 PREDICTING DIFFERENT ENDINGS OF INCOMPLETE SKETCHES
|
| 178 |
+
|
| 179 |
+
Figure 7: sketch-rnn predicting possible endings of various incomplete sketches (the red lines).
|
| 180 |
+
|
| 181 |
+
We can use sketch-rnn to finish an incomplete sketch. By using the decoder RNN as a standalone model, we can generate a sketch that is conditioned on the previous points. We use the decoder RNN to first encode an incomplete sketch into a hidden state $h$ . Afterwards, we generate the remaining points of the sketch using $h$ as the initial hidden state. We show results in Figure 7 using decoder-only models trained on individual classes, and sample completions by setting $\tau = 0 . 8$ .
|
| 182 |
+
|
| 183 |
+
# 5 APPLICATIONS AND FUTURE WORK
|
| 184 |
+
|
| 185 |
+
We believe sketch-rnn will enable many creative applications. Even the decoder-only model trained on various classes can assist the creative process of an artist by suggesting many possible ways of finishing a sketch, helping artists expand their imagination. In the conditional model, exploring the latent space between different objects can potentially enable artists to find interesting intersections and relationships between different drawings. Even in the simplest use, pattern designers can apply sketch-rnn to generate a large number of similar, but unique designs for textile or wallpaper prints.
|
| 186 |
+
|
| 187 |
+
As we saw earlier in Section 4.1, a model trained to draw pigs can be made to draw pig-like trucks if given an input sketch of a truck. We can extend this result to applications that might help creative designers come up with abstract designs that can resonate more with their target audience. For instance, in Figure 8 (right), we feed sketches of four different chairs into our cat-drawing model to produce four “chair-like cats”. We can even interpolate between the four images to explore the latent space of chair-like cats, and select from a large grid of generated designs.
|
| 188 |
+
|
| 189 |
+

|
| 190 |
+
Figure 8: Generating similar, but unique sketches based on a single human sketch in the box (left). Latent space of generated cats conditioned on sketch drawings of chairs (right).
|
| 191 |
+
|
| 192 |
+
A model trained on higher quality sketches may find its way into educational applications that can help teach students how to draw. Even with the simple sketches in QuickDraw, the authors of this work have become much more proficient at drawing animals, insects, and various sea creatures after conducting these experiments. A related application is to encode a crude, poorly sketched drawing and generate more aesthetically looking reproductions by using a model trained with a high $w _ { K L }$ setting and sampling with a low temperature $\tau$ to produce a more coherent version of the drawing. In the future, we can also investigate augmenting the latent vector in the direction that maximizes the aesthetics of the drawing by incorporating user-rating data into the training process.
|
| 193 |
+
|
| 194 |
+
Combining hybrid variations of sequence-generation models with unsupervised, cross-domain pixel image generation models, such as Image-to-Image models (Dong et al., 2017; Kim et al., 2017; Liu et al., 2017), is another exciting direction that we can explore. We can already combine this model with supervised, cross-domain models such as Pix2Pix (Isola et al., 2016), to occasionally generate photo realistic cat images from generated sketches of cats. The opposite direction of converting a photograph of a cat into an unrealistic, but similar looking sketch of a cat composed of a minimal number of lines seems to be a more interesting problem.
|
| 195 |
+
|
| 196 |
+
# 6 CONCLUSION
|
| 197 |
+
|
| 198 |
+
In this work, we develop a methodology to model sketch drawings using recurrent neural networks. sketch-rnn is able to generate possible ways to finish an existing, but unfinished sketch drawing. Our model can also encode existing sketches into a latent vector, and generate similar looking sketches conditioned on the latent space. We demonstrate what it means to interpolate between two different sketches by interpolating between its latent space, and also show that we can manipulate attributes of a sketch by augmenting the latent space. We demonstrate the importance of enforcing a prior distribution on the latent vector for coherent vector image generation during interpolation. By making available a large dataset of sketch drawings, we hope to encourage further research and development in the area of generative vector image modelling.
|
| 199 |
+
|
| 200 |
+
# 7 ACKNOWLEDGEMENTS
|
| 201 |
+
|
| 202 |
+
We thank Ian Johnson, Jonas Jongejan, Martin Wattenberg, Mike Schuster, Thomas Deselaers, Ben Poole, Kyle Kastner, Junyoung Chung and Kyle McDonald for their help with this project. This work was done as part of the Google Brain Residency program (g.co/brainresidency).
|
| 203 |
+
|
| 204 |
+
# REFERENCES
|
| 205 |
+
|
| 206 |
+
Jimmy L. Ba, Jamie R. Kiros, and Geoffrey E. Hinton. Layer normalization. NIPS, 2016.
|
| 207 |
+
|
| 208 |
+
Christopher M. Bishop. Mixture density networks. Technical Report, 1994. URL http:// publications.aston.ac.uk/373/.
|
| 209 |
+
|
| 210 |
+
Samuel R. Bowman, Luke Vilnis, Oriol Vinyals, Andrew M. Dai, Rafal Józefowicz, and Samy Bengio. Generating Sentences from a Continuous Space. CoRR, abs/1511.06349, 2015. URL http://arxiv.org/abs/1511.06349.
|
| 211 |
+
|
| 212 |
+
H. Dong, P. Neekhara, C. Wu, and Y. Guo. Unsupervised Image-to-Image Translation with Generative Adversarial Networks. ArXiv e-prints, January 2017.
|
| 213 |
+
|
| 214 |
+
David H. Douglas and Thomas K. Peucker. Algorithms for the reduction of the number of points required to represent a digitized line or its caricature. Cartographica: The International Journal for Geographic Information and Geovisualization, 10(2):112–122, October 1973. doi: 10.3138/fm57-6770-u75u-7727. URL http://dx.doi.org/10.3138/ fm57-6770-u75u-7727.
|
| 215 |
+
|
| 216 |
+
Mathias Eitz, James Hays, and Marc Alexa. How Do Humans Sketch Objects? ACM Trans. Graph. (Proc. SIGGRAPH), 31(4):44:1–44:10, 2012.
|
| 217 |
+
|
| 218 |
+
I. Goodfellow. NIPS 2016 Tutorial: Generative Adversarial Networks. ArXiv e-prints, December 2016.
|
| 219 |
+
|
| 220 |
+
Alex Graves. Generating sequences with recurrent neural networks. arXiv:1308.0850, 2013.
|
| 221 |
+
|
| 222 |
+
David Ha. Recurrent Net Dreams Up Fake Chinese Characters in Vector Format with TensorFlow, 2015.
|
| 223 |
+
|
| 224 |
+
David Ha, Andrew M. Dai, and Quoc V. Le. HyperNetworks. In ICLR, 2017.
|
| 225 |
+
|
| 226 |
+
Sepp Hochreiter and Juergen Schmidhuber. Long short-term memory. Neural Computation, 1997.
|
| 227 |
+
|
| 228 |
+
P. Isola, J.-Y. Zhu, T. Zhou, and A. A. Efros. Image-to-Image Translation with Conditional Adversarial Networks. ArXiv e-prints, November 2016.
|
| 229 |
+
|
| 230 |
+
Jonas Jongejan, Henry Rowley, Takashi Kawashima, Jongmin Kim, and Nick Fox-Gieg. The Quick, Draw! - A.I. Experiment. https://quickdraw.withgoogle.com/, 2016. URL https: //quickdraw.withgoogle.com/.
|
| 231 |
+
|
| 232 |
+
C. Kaae Sønderby, T. Raiko, L. Maaløe, S. Kaae Sønderby, and O. Winther. Ladder Variational Autoencoders. ArXiv e-prints, February 2016.
|
| 233 |
+
|
| 234 |
+
T. Kim, M. Cha, H. Kim, J. Lee, and J. Kim. Learning to Discover Cross-Domain Relations with Generative Adversarial Networks. ArXiv e-prints, March 2017.
|
| 235 |
+
|
| 236 |
+
D. P Kingma and M. Welling. Auto-Encoding Variational Bayes. ArXiv e-prints, December 2013.
|
| 237 |
+
|
| 238 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
|
| 239 |
+
|
| 240 |
+
Diederik P. Kingma, Tim Salimans, and Max Welling. Improving variational inference with inverse autoregressive flow. CoRR, abs/1606.04934, 2016. URL http://arxiv.org/abs/1606. 04934.
|
| 241 |
+
|
| 242 |
+
Brenden M. Lake, Ruslan Salakhutdinov, and Joshua B. Tenenbaum. Human-level concept learning through probabilistic program induction. Science, 350(6266):1332–1338, December 2015. ISSN 1095-9203. doi: 10.1126/science.aab3050. URL http://dx.doi.org/10.1126/ science.aab3050.
|
| 243 |
+
|
| 244 |
+
Yong Jae Lee, C. Lawrence Zitnick, and Michael F. Cohen. Shadowdraw: Real-time user guidance for freehand drawing. In ACM SIGGRAPH 2011 Papers, SIGGRAPH ’11, pp. 27:1–27:10, New York, NY, USA, 2011. ACM. ISBN 978-1-4503-0943-1. doi: 10.1145/1964921.1964922. URL http://doi.acm.org/10.1145/1964921.1964922.
|
| 245 |
+
|
| 246 |
+
M.-Y. Liu, T. Breuel, and J. Kautz. Unsupervised Image-to-Image Translation Networks. ArXiv e-prints, March 2017.
|
| 247 |
+
|
| 248 |
+
S. Reed, A. van den Oord, N. Kalchbrenner, S. Gómez Colmenarejo, Z. Wang, D. Belov, and N. de Freitas. Parallel Multiscale Autoregressive Density Estimation. ArXiv e-prints, March 2017.
|
| 249 |
+
|
| 250 |
+
Patsorn Sangkloy, Nathan Burnell, Cusuh Ham, and James Hays. The Sketchy Database: Learning to Retrieve Badly Drawn Bunnies. ACM Trans. Graph., 35(4):119:1–119:12, July 2016. ISSN 0730- 0301. doi: 10.1145/2897824.2925954. URL http://doi.acm.org/10.1145/2897824. 2925954.
|
| 251 |
+
|
| 252 |
+
Mike Schuster, Kuldip K. Paliwal, and A. General. Bidirectional recurrent neural networks. IEEE Transactions on Signal Processing, 1997.
|
| 253 |
+
|
| 254 |
+
Saul Simhon and Gregory Dudek. Sketch interpretation and refinement using statistical models. In Proceedings of the Fifteenth Eurographics Conference on Rendering Techniques, EGSR’04, pp. 23– 32, Aire-la-Ville, Switzerland, Switzerland, 2004. Eurographics Association. ISBN 3-905673-12- 6. doi: 10.2312/EGWR/EGSR04/023-032. URL http://dx.doi.org/10.2312/EGWR/ EGSR04/023-032.
|
| 255 |
+
|
| 256 |
+
Patrick Tresset and Frederic Fol Leymarie. Portrait drawing by paul the robot. Comput. Graph., 37(5):348–363, August 2013. ISSN 0097-8493. doi: 10.1016/j.cag.2013.01.012. URL http: //dx.doi.org/10.1016/j.cag.2013.01.012.
|
| 257 |
+
|
| 258 |
+
T. White. Sampling Generative Networks. ArXiv e-prints, September 2016.
|
| 259 |
+
|
| 260 |
+
Ning Xie, Hirotaka Hachiya, and Masashi Sugiyama. Artist agent: A reinforcement learning approach to automatic stroke generation in oriental ink painting. In ICML. icml.cc / Omnipress, 2012. URL http://dblp.uni-trier.de/db/conf/icml/icml2012.html#XieHS12.
|
| 261 |
+
|
| 262 |
+
Xu-Yao Zhang, Fei Yin, Yan-Ming Zhang, Cheng-Lin Liu, and Yoshua Bengio. Drawing and Recognizing Chinese Characters with Recurrent Neural Network. CoRR, abs/1606.06539, 2016. URL http://arxiv.org/abs/1606.06539.
|
| 263 |
+
|
| 264 |
+
# A APPENDIX
|
| 265 |
+
|
| 266 |
+
# A.1 DATASET DETAILS
|
| 267 |
+
|
| 268 |
+

|
| 269 |
+
Figure 9: Example sketch drawings from QuickDraw dataset.
|
| 270 |
+
|
| 271 |
+
The data from QuickDraw (Jongejan et al., 2016) expands daily, and every so often new classes are added to the game. As such, the QuickDraw dataset now consists of hundreds of classes, from 75 classes initially, in Table 2. In total, there are $\sim 5 0$ million sketches in the released dataset, although for the purpose of constructing an organized dataset for research purposes, we have limited the number of sketches in each class.
|
| 272 |
+
|
| 273 |
+
<table><tr><td rowspan=1 colspan=1>alarm clock</td><td rowspan=1 colspan=1>ambulance</td><td rowspan=1 colspan=1>angel</td><td rowspan=1 colspan=1>ant</td><td rowspan=1 colspan=1>barn</td></tr><tr><td rowspan=1 colspan=1>basket</td><td rowspan=1 colspan=1>bee</td><td rowspan=1 colspan=1>bicycle</td><td rowspan=1 colspan=1>book</td><td rowspan=1 colspan=1>bridge</td></tr><tr><td rowspan=1 colspan=1>bulldozer</td><td rowspan=1 colspan=1>bus</td><td rowspan=1 colspan=1>butterfly</td><td rowspan=1 colspan=1>cactus</td><td rowspan=1 colspan=1>castle</td></tr><tr><td rowspan=1 colspan=1>cat</td><td rowspan=1 colspan=1>chair</td><td rowspan=1 colspan=1>couch</td><td rowspan=1 colspan=1>crab</td><td rowspan=1 colspan=1>cruise ship</td></tr><tr><td rowspan=1 colspan=1>dolphin</td><td rowspan=1 colspan=1>duck</td><td rowspan=1 colspan=1>elephant</td><td rowspan=1 colspan=1>eye</td><td rowspan=1 colspan=1>face</td></tr><tr><td rowspan=1 colspan=1>fan</td><td rowspan=1 colspan=1>fire hydrant</td><td rowspan=1 colspan=1>firetruck</td><td rowspan=1 colspan=1>flamingo</td><td rowspan=1 colspan=1>flower</td></tr><tr><td rowspan=1 colspan=1>garden</td><td rowspan=1 colspan=1>hand</td><td rowspan=1 colspan=1>hedgehog</td><td rowspan=1 colspan=1>helicopter</td><td rowspan=1 colspan=1>kangaroo</td></tr><tr><td rowspan=1 colspan=1>key</td><td rowspan=1 colspan=1>lighthouse</td><td rowspan=1 colspan=1>lion</td><td rowspan=1 colspan=1>map</td><td rowspan=1 colspan=1>mermaid</td></tr><tr><td rowspan=1 colspan=1>octopus</td><td rowspan=1 colspan=1>owl</td><td rowspan=1 colspan=1>paintbrush</td><td rowspan=1 colspan=1>palm tree</td><td rowspan=1 colspan=1>parrot</td></tr><tr><td rowspan=1 colspan=1>passport</td><td rowspan=1 colspan=1>peas</td><td rowspan=1 colspan=1>penguin</td><td rowspan=1 colspan=1>pig</td><td rowspan=1 colspan=1>pineapple</td></tr><tr><td rowspan=1 colspan=1>postcard</td><td rowspan=1 colspan=1>power outlet</td><td rowspan=1 colspan=1>rabbit</td><td rowspan=1 colspan=1>radio</td><td rowspan=1 colspan=1>rain</td></tr><tr><td rowspan=1 colspan=1>rhinoceros</td><td rowspan=1 colspan=1>roller coaster</td><td rowspan=1 colspan=1>sandwich</td><td rowspan=1 colspan=1>scorpion</td><td rowspan=1 colspan=1>sea turtle</td></tr><tr><td rowspan=1 colspan=1>sheep</td><td rowspan=1 colspan=1>skull</td><td rowspan=1 colspan=1>snail</td><td rowspan=1 colspan=1>snowflake</td><td rowspan=1 colspan=1>speedboat</td></tr><tr><td rowspan=1 colspan=1>spider</td><td rowspan=1 colspan=1>strawberry</td><td rowspan=1 colspan=1>swan</td><td rowspan=1 colspan=1>swing set</td><td rowspan=1 colspan=1>tennis racquet</td></tr><tr><td rowspan=1 colspan=1>the mona lisa</td><td rowspan=1 colspan=1>toothbrush</td><td rowspan=1 colspan=1>truck</td><td rowspan=1 colspan=1>whale</td><td rowspan=1 colspan=1>windmill</td></tr></table>
|
| 274 |
+
|
| 275 |
+
Table 2: Initial 75 QuickDraw classes used for this work.
|
| 276 |
+
|
| 277 |
+
Each class consists of 70K training samples and 2.5K validation and test samples. Stroke simplification using the Ramer–Douglas–Peucker algorithm (Douglas & Peucker, 1973) with a parameter of $\epsilon = 2 . 0$ has been applied to simplify the lines. The data was originally recorded in pixel-dimensions, so we normalized the offsets $( \Delta x , \Delta y )$ using a single scaling factor. This scaling factor was calculated to adjust the offsets in the training set to have a standard deviation of 1. For simplicity, we do not normalize the offsets $( \Delta x , \Delta y )$ to have zero mean, since the means are already relatively small. Figure 10 shows a training example before normalization of $( \Delta x , \Delta y )$ data columns.
|
| 278 |
+
|
| 279 |
+

|
| 280 |
+
Figure 10: A sample sketch, as a sequence of $( \Delta x , \Delta y , p _ { 1 } , p _ { 2 } , p _ { 3 } )$ points and in rendered form. In the rendered sketch, the line color corresponds to the sequential stroke ordering.
|
| 281 |
+
|
| 282 |
+
# A.2 TRAINING DETAILS
|
| 283 |
+
|
| 284 |
+
As a recap from the main text, we defined the Reconstruction loss term $L _ { R }$ as:
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
\begin{array} { l } { { \displaystyle { \cal L } _ { s } = - \frac { 1 } { N _ { \mathrm { m a x } } } \sum _ { i = 1 } ^ { N _ { s } } \log \Big ( \sum _ { j = 1 } ^ { M } \Pi _ { j , i } \mathcal { N } ( \Delta x _ { i } , \Delta y _ { i } \mid \mu _ { x , j , i } , \mu _ { y , j , i } , \sigma _ { x , j , i } , \sigma _ { y , j , i } , \rho _ { x y , j , i } ) \Big ) } } \\ { { \displaystyle { \cal L } _ { p } = - \frac { 1 } { N _ { \mathrm { m a x } } } \sum _ { i = 1 } ^ { N _ { \mathrm { m a x } } } \sum _ { k = 1 } ^ { 3 } p _ { k , i } \log ( q _ { k , i } ) } } \\ { { \displaystyle { \cal L } _ { R } = { \cal L } _ { s } + { \cal L } _ { p } . } } \end{array}
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
We also defined the KL loss term $L _ { K L }$ as:
|
| 291 |
+
|
| 292 |
+
$$
|
| 293 |
+
L _ { K L } = - \frac { 1 } { 2 N _ { z } } \Big ( 1 + \hat { \sigma } - \mu ^ { 2 } - \exp ( \hat { \sigma } ) \Big ) .
|
| 294 |
+
$$
|
| 295 |
+
|
| 296 |
+
The loss function in Equation 14 is a weighted sum of both the $L _ { R }$ and $L _ { K L }$ loss terms:
|
| 297 |
+
|
| 298 |
+
$$
|
| 299 |
+
L o s s = L _ { R } + w _ { K L } L _ { K L } .
|
| 300 |
+
$$
|
| 301 |
+
|
| 302 |
+
While the loss function in Equation 14 can be used during training, we find that annealing the KL term in the loss function (Equation 15) produced better results. This modification is only used for model training, and the original loss function in Equation 14 is still used to evaluate validation and test sets, and for early stopping.
|
| 303 |
+
|
| 304 |
+
$$
|
| 305 |
+
\begin{array} { c } { \eta _ { s t e p } = 1 - ( 1 - \eta _ { m i n } ) R ^ { s t e p } } \\ { L o s s _ { t r a i n } = L _ { R } + w _ { K L } \eta _ { s t e p } \operatorname* { m a x } ( L _ { K L } , K L _ { m i n } ) } \end{array}
|
| 306 |
+
$$
|
| 307 |
+
|
| 308 |
+
We find that annealing the KL loss term generally results in better losses. Annealing the $L _ { K L }$ term in the loss function directs the optimizer to first focus more on the reconstruction term in Equation 12, which is the more difficult loss term of the model to optimize for, before having to deal with optimizing for the KL loss term in Equation 13, a far simpler expression in comparison. This approach has been used in (Bowman et al., 2015; Kaae Sønderby et al., 2016; Kingma et al., 2016). Our annealing term $\eta _ { s t e p }$ starts at $\eta _ { m i n }$ (typically 0 or 0.01) at training step 0, and converges to 1 for large training steps. $R$ is a term close to, but less than 1.
|
| 309 |
+
|
| 310 |
+
If the distribution of $z$ is close enough to $\mathcal { N } ( 0 , I )$ , we can sample sketches from the decoder using randomly sampled $z$ from $\mathcal { N } ( 0 , I )$ as the input. In practice, we find that going from a larger $L _ { K L }$ value $\left( L _ { K L } > 1 . 0 \right)$ ) to a smaller $L _ { K L }$ value of 0.3 generally results in a substantial increase in the quality of sampled images using randomly sampled $z \sim \mathcal { N } ( 0 , I )$ . However, going from $L _ { K L } = 0 . 3$ to $L _ { K L }$ values closer to zero does not lead to any further noticeable improvements. Hence we find it useful to put a floor on $L _ { K L }$ in the loss function by enforcing $\operatorname* { m a x } ( L _ { K L } , K L _ { m i n } )$ in Equation 15.
|
| 311 |
+
|
| 312 |
+
The $K L _ { m i n }$ term inside the max operator is typically set to a small value such as 0.10 to 0.50. This term will encourage the optimizer to put less focus on optimizing for the KL loss term $L _ { K L }$ once it is low enough, so we can obtain better metrics for the reconstruction loss term $L _ { R }$ . This approach is similar to the approach described in (Kingma et al., 2016) as free bits, where they apply the max operator separately inside each dimension of the latent vector $z$ .
|
| 313 |
+
|
| 314 |
+
# A.3 MODEL CONFIGURATION
|
| 315 |
+
|
| 316 |
+
Our encoder and decoder RNNs consist of 512 and 2048 nodes respectively. In our model, we use $M = 2 0$ mixture components for the decoder RNN. The latent vector $z$ has $N _ { z } = 1 2 8$ dimensions. We apply Layer Normalization (Ba et al., 2016) to our model, and during training apply recurrent dropout [9] with a keep probability of $90 \%$ . We train the model with batch sizes of 100 samples, using Adam (Kingma & Ba, 2015) with a learning rate of 0.0001 and gradient clipping of 1.0. All models are trained with $K L _ { m i n } = 0 . 2 0 , R = 0 . 9 9 9 9 9$ . During training, we perform simple data augmentation by multiplying the offset columns $( \Delta x , \Delta y )$ by two IID random factors chosen uniformly between 0.90 and 1.10. Unless mentioned otherwise, all experiments are conducted with $w _ { K L } = 1 . 0 0$ .
|
| 317 |
+
|
| 318 |
+
# A.4 MODEL LIMITATIONS
|
| 319 |
+
|
| 320 |
+
Although sketch-rnn can model a large variety of sketch drawings, there are several limitations in the current approach we wish to highlight. For most single-class datasets, sketch-rnn is capable of modelling sketches up to around 300 data points. The model becomes increasingly difficult to train beyond this length. For our dataset, we applied the Ramer–Douglas–Peucker algorithm (Douglas & Peucker, 1973) to simplify the strokes of the sketch data to less than 200 data points while still keeping most of the important visual information of each sketch.
|
| 321 |
+
|
| 322 |
+

|
| 323 |
+
Figure 11: Unconditional generated sketches of frogs, cats, and crabs at $\tau = 0 . 8$
|
| 324 |
+
|
| 325 |
+
For more complicated classes of images, such as mermaids or lobsters, the reconstruction loss metrics are not as good compared to simpler classes such as ants, faces or firetrucks. The models trained on these more challenging image classes tend to draw smoother, more circular line segments that do not resemble individual sketches, but rather resemble an averaging of many sketches in the training set. We can see some of this artifact in the frog class, in Figure 11. This smoothness may be analogous to the blurriness effect produced by a Variational Autoencoder (Kingma & Welling, 2013) that is trained on pixel images. Depending on the use case of the model, smooth circular lines can be viewed as aesthetically pleasing and a desirable property.
|
| 326 |
+
|
| 327 |
+

|
| 328 |
+
Figure 12: Unconditional generations from model trained on 75 classes (left), and from model trained on crab, face, pig and rabbit classes (right).
|
| 329 |
+
|
| 330 |
+
While both conditional and unconditional models are capable of training on datasets consisting of several classes, such as (cat, pig), and (crab, face, pig, rabbit), sketch-rnn is ineffective at modelling a large number of classes simultaneously. In Figure 12, we sample sketches using an unconditional model trained on 75 classes, and a model trained on 4 classes. The samples generated from the 75-class model are incoherent, with individual sketches displaying features from multiple classes. The four-class unconditional model usually generates samples of a single class, but occasionally also combines features from multiple classes. In the future, we will explore incorporating class information outside of the latent space to handle the modelling of a large number of classes simultaneously.
|
| 331 |
+
|
| 332 |
+
# A.5 MULTI-SKETCH DRAWING INTERPOLATION
|
| 333 |
+
|
| 334 |
+

|
| 335 |
+
Figure 13: Example of conditional generated sketches with single class models. Latent space interpolation from left to right, and then top to bottom.
|
| 336 |
+
|
| 337 |
+
In addition to interpolating between two sketches, like in Figure13, we can also visualize the interpolation between four sketches in latent space to gain further insight from the model. In this section we show more examples conditionally generated with sketch-rnn. We take four generated images, place them on four corners of a grid, and populate the rest of the grid using the interpolation of the latent vectors at the corners. Figure 14 shows two examples of this four-way interpolation, using models trained on both (cat, pig) classes, and face class. All samples generated with $\tau = 0 . 1$ .
|
| 338 |
+
|
| 339 |
+

|
| 340 |
+
Figure 14: Example input sketches and sketch-rnn generated reproductions (Top). Latent space interpolation between the four reproduced sketches (Bottom).
|
| 341 |
+
|
| 342 |
+
The left most figure of Figure 15 visualizes the interpolation between a full pig, a rabbit’s head, a crab, and a face, using a model trained on these four classes. In certain parts of the space between a crab and a face is a rabbit’s head, and we see that the ears of the rabbit becomes the crab’s claws. Applying the model on the yoga class, it is interesting to see how one yoga position slowly transitions to another via a set of interpolated yoga positions generated by the model. For visual effect, we also interpolate between four distinct colors, and color each sketch using a unique interpolated color.
|
| 343 |
+
|
| 344 |
+

|
| 345 |
+
Figure 15: Interpolation of (pig, rabbit, crab and face), yoga poses, mosquitoes and mermaids. We also interpolate between four distinct colors for visual effect.
|
| 346 |
+
|
| 347 |
+
We also construct latent space interpolation examples for the mosquito class and the mermaid class, in the last two grids Figure 15. We see that the model can interpolate between concepts such as style of wings, leg counts, and orientation. In Figure 16 below, we show more interpolation examples of other classes from the dataset.
|
| 348 |
+
|
| 349 |
+

|
| 350 |
+
Figure 16: Latent space interpolation between four generated gardens, owls, cats, and firetrucks.
|
| 351 |
+
|
| 352 |
+
A.6 WHICH LOSS CONTROLS IMAGE COHERENCY?
|
| 353 |
+
|
| 354 |
+
We would like to question the relative importance of the reconstruction loss term $L _ { R }$ , relative to the KL loss term $L _ { K L }$ , when our goal is to produce higher quality image reconstructions. While our reconstruction loss term $L _ { R }$ optimizes for the log-likelihood of the set of strokes that make up a sketch, this metric alone does not give us any guarantee that a model with a lower $L _ { R }$ number will produce higher quality reconstructions compared to a model with a higher $L _ { R }$ number.
|
| 355 |
+
|
| 356 |
+
For example, imagine a simple sketch of an face, $\circledddot$ , where most of the data points of $S$ are be used to represent the head, and only a minority of points represent facial features such as the eyes and mouth. It is possible to reconstruct the face with incoherent facial features, and yet still score a lower $L _ { R }$ number compared to another reconstruction with a coherent and similar face, if the edges around the incoherent face are generated more precisely.
|
| 357 |
+
|
| 358 |
+
In Figure 17, we compare the reconstructed images generated using models trained with various $w _ { K L }$ settings. In the first three examples from the left, we train our model on a dataset consisting of four image classes (crab, face, pig, rabbit). We deliberately sketch input drawings that contain features of two classes, such as a rabbit with a pig mouth and pig tail, a person with animal ears, and a rabbit with crab claws. We see that the model trained using higher $w _ { K L }$ weights, tend to generate sketches with features of a single class that look more coherent, despite having lower $L _ { K L }$ numbers. For instance, the model with $w _ { K L } = 1 . 0 0$ omit pig features, animal ears, and crab claws from its reconstructions. In contrast, the model with $w _ { K L } = 0 . 2 5$ , with higher $L _ { K L }$ , but lower $L _ { R }$ numbers tries to keep both inconsistent features, while generating sketches that look less coherent.
|
| 359 |
+
|
| 360 |
+
In the last three examples in Figure 17, we repeat the experiment on models trained on single-class images, and see similar results even when we deliberately choose input samples from the test set with noisier lines.
|
| 361 |
+
|
| 362 |
+
If we look at the interpolations produced in the latent space interpolation examples from Section 4.2 in the main text, models with better KL loss terms also generate more meaningful reconstructions from the interpolated space between two latent vectors. This suggests the latent vector for models with lower $L _ { K L }$ control more meaningful parts of the drawings, such as controlling whether the sketch is an animal head only or a full animal with a body, or whether to draw a cat head or a pig head. Altering such latent vectors can allow us to directly manipulate these animal features. Conversely, altering the latent codes of models with higher $L _ { K L }$ results in scattered movement of individual line segments, rather than alterations of meaningful conceptual features of the animal.
|
| 363 |
+
|
| 364 |
+
This result is consistent with incoherent reconstructions seen in Figure 17. With a lower $L _ { K L }$ , the model is likely to generate coherent images given any random $z$ . Even with a non-standard, or noisy, input image, the model will still encode a $z$ that produces coherent images. For models with lower $L _ { K L }$ numbers, the encoded latent vectors contain conceptual features belonging to the input image, while for models with higher $L _ { K L }$ numbers, the latent vectors merely encode information about specific line segments. This observation suggests that when using sketch-rnn on a new dataset, we should first try different $w _ { K L }$ settings to evaluate the tradeoff between $L _ { R }$ and $L _ { K L }$ , and then choose a setting for $w _ { K L }$ (and $K L _ { m i n . }$ ) that best suit our requirements.
|
| 365 |
+
|
| 366 |
+

|
| 367 |
+
Figure 17: Reconstructions of sketch drawings using models with various $w _ { K L }$ settings.
|
md/train/HyzMyhCcK7/HyzMyhCcK7.md
ADDED
|
@@ -0,0 +1,578 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PROXQUANT: QUANTIZED NEURAL NETWORKS VIAPROXIMAL OPERATORS
|
| 2 |
+
|
| 3 |
+
Yu Bai Stanford University yub@stanford.edu
|
| 4 |
+
|
| 5 |
+
Yu-Xiang Wang
|
| 6 |
+
UC Santa-Barbara
|
| 7 |
+
yuxiangw@cs.ucsb.edu
|
| 8 |
+
Edo Liberty
|
| 9 |
+
Amazon AI
|
| 10 |
+
libertye@amazon.com
|
| 11 |
+
|
| 12 |
+
# ABSTRACT
|
| 13 |
+
|
| 14 |
+
To make deep neural networks feasible in resource-constrained environments (such as mobile devices), it is beneficial to quantize models by using low-precision weights. One common technique for quantizing neural networks is the straightthrough gradient method, which enables back-propagation through the quantization mapping. Despite its empirical success, little is understood about why the straight-through gradient method works.
|
| 15 |
+
|
| 16 |
+
Building upon a novel observation that the straight-through gradient method is in fact identical to Nesterov’s dual-averaging algorithm on a quantization constrained optimization problem, we propose a more principled alternative approach, called PROXQUANT, that formulates quantized network training as a regularized learning problem instead and optimizes it via the prox-gradient method. PROXQUANT does back-propagation on the underlying full-precision vector and applies an efficient prox-operator in between stochastic gradient steps to encourage quantizedness. For quantizing ResNets and LSTMs, PROXQUANT outperforms state-of-the-art results on binary quantization and is on par with state-of-the-art on multi-bit quantization. We further perform theoretical analyses showing that PROXQUANT converges to stationary points under mild smoothness assumptions, whereas variants such as lazy prox-gradient method can fail to converge in the same setting.
|
| 17 |
+
|
| 18 |
+
# 1 INTRODUCTION
|
| 19 |
+
|
| 20 |
+
Deep neural networks (DNNs) have achieved impressive results in various machine learning tasks (Goodfellow et al., 2016). High-performance DNNs typically have over tens of layers and millions of parameters, resulting in a high memory usage and a high computational cost at inference time. However, these networks are often desired in environments with limited memory and computational power (such as mobile devices), in which case we would like to compress the network into a smaller, faster network with comparable performance.
|
| 21 |
+
|
| 22 |
+
A popular way of achieving such compression is through quantization – training networks with lowprecision weights and/or activation functions. In a quantized neural network, each weight and/or activation can be representable in $k$ bits, with a possible codebook of negligible additional size compared to the network itself. For example, in a binary neural network $k = 1 ,$ ), the weights are restricted to be in $\{ \pm 1 \}$ . Compared with a 32-bit single precision float, a quantized net reduces the memory usage to $k / 3 2$ of a full-precision net with the same architecture (Han et al., 2015; Courbariaux et al., 2015; Rastegari et al., 2016; Hubara et al., 2017; Zhou et al., 2016; Zhu et al., 2016). In addition, the structuredness of the quantized weight matrix can often enable faster matrixvector product, thereby also accelerating inference (Hubara et al., 2017; Han et al., 2016).
|
| 23 |
+
|
| 24 |
+
Typically, training a quantized network involves (1) the design of a quantizer q that maps a full-precision parameter to a $k$ -bit quantized parameter, and (2) the straight-through gradient method (Courbariaux et al., 2015) that enables back-propagation from the quantized parameter back onto the original full-precision parameter, which is critical to the success of quantized network training. With quantizer q, an iterate of the straight-through gradient method (see Figure 1a) proceeds as $\theta _ { t + 1 } = \theta _ { t } - \eta _ { t } \widetilde { \nabla } L ( \theta ) | _ { \theta = \mathsf { q } ( \theta _ { t } ) }$ , and $\mathsf { q } ( { \widehat { \theta } } )$ (for the converged $\widehat { \theta }$ ) is taken as the output model. For training binary networks, choosing $\mathsf { q } ( \cdot ) = \mathrm { s i g n } ( \cdot )$ gives the BinaryConnect method (Courbariaux et al., 2015).
|
| 25 |
+
|
| 26 |
+
Though appealingly simple and empirically effective, it is information-theoretically rather mysterious why the straight-through gradient method works well, at least in the binary case: while the goal is to find a parameter $\theta \in \{ \pm 1 \} ^ { d }$ with low loss, the algorithm only has access to stochastic gradients at $\{ \pm 1 \} ^ { d }$ . As this is a discrete set, a priori, gradients in this set do not necessarily contain any information about the function values. Indeed, a simple one-dimensional example (Figure 1b) shows that BinaryConnect fails to find the minimizer of fairly simple convex Lipschitz functions in $\{ \pm 1 \}$ , due to a lack of gradient information in between.
|
| 27 |
+
|
| 28 |
+

|
| 29 |
+
Figure 1: (a) Comparison of the straight-through gradient method and our PROXQUANT method. The straightthrough method computes the gradient at the quantized vector and performs the update at the original real vector; PROXQUANT performs a gradient update at the current real vector followed by a prox step which encourages quantizedness. (b) A two-function toy failure case for BinaryConnect. The two functions are $f _ { 1 } ( x ) = | x ^ { \prime } + 0 . 5 | - 0 . 5$ (blue) and $f _ { - 1 } ( x ) = | x - 0 . 5 | - 0 . 5$ (orange). The derivatives of $f _ { 1 }$ and $f _ { - 1 }$ coincide at $\{ - 1 , 1 \}$ , so any algorithm that only uses this information will have identical behaviors on these two functions. However, the minimizers in $\{ \pm 1 \}$ are $x _ { 1 } ^ { \star } = - 1$ and $x _ { - 1 } ^ { \star } = 1$ , so the algorithm must fail on one of them.
|
| 30 |
+
|
| 31 |
+
In this paper, we formulate the problem of model quantization as a regularized learning problem and propose to solve it with a proximal gradient method. Our contributions are summarized as follows.
|
| 32 |
+
|
| 33 |
+
• We present a unified framework for defining regularization functionals that encourage binary, ternary, and multi-bit quantized parameters, through penalizing the distance to quantized sets (see Section 3.1). For binary quantization, the resulting regularizer is a $W$ -shaped non-smooth regularizer, which shrinks parameters towards either $- 1$ or 1 in the same way that the $L _ { 1 }$ norm regularization shrinks parameters towards 0. We propose training quantized networks using PROXQUANT (Algorithm 1) — a stochastic proximal gradient method with a homotopy scheme. Compared with the straightthrough gradient method, PROXQUANT has access to additional gradient information at non-quantized points, which avoids the problem in Figure 1b and its homotopy scheme prevents potential overshoot early in the training (Section 3.2). We demonstrate the effectiveness and flexibility of PROXQUANT through systematic experiments on (1) image classification with ResNets (Section 4.1); (2) language modeling with LSTMs (Section 4.2). The PROXQUANT method outperforms the state-of-the-art results on binary quantization and is comparable with the state-of-the-art on ternary and multi-bit quantization. We perform a systematic theoretical study of quantization algorithms, showing that our PROXQUANT (standard prox-gradient method) converges to stataionary points under mild smoothness assumptions (Section 5.1), where as lazy prox-gradient method such as BinaryRelax (Yin et al., 2018) fails to converge in general (Section 5.2). Further, we show that
|
| 34 |
+
|
| 35 |
+
BinaryConnect has a very stringent condition to converge to any fixed point (Section 5.3), which we verify through a sign change experiment (Appendix C).
|
| 36 |
+
|
| 37 |
+
# 1.1 PRIOR WORK
|
| 38 |
+
|
| 39 |
+
Methodologies Han et al. (2015) propose Deep Compression, which compresses a DNN via sparsification, nearest-neighbor clustering, and Huffman coding. This architecture is then made into a specially designed hardware for efficient inference (Han et al., 2016). In a parallel line of work, Courbariaux et al. (2015) propose BinaryConnect that enables the training of binary neural networks, and Li & Liu (2016); Zhu et al. (2016) extend this method into ternary quantization. Training and inference on quantized nets can be made more efficient by also quantizing the activation (Hubara et al., 2017; Rastegari et al., 2016; Zhou et al., 2016), and such networks have achieved impressive performance on large-scale tasks such as ImageNet classification (Rastegari et al., 2016; Zhu et al., 2016) and object detection (Yin et al., 2016). In the NLP land, quantized language models have been successfully trained using alternating multi-bit quantization (Xu et al., 2018).
|
| 40 |
+
|
| 41 |
+
Theories Li et al. (2017) prove the convergence rate of stochastic rounding and BinaryConnect on convex problems and demonstrate the advantage of BinaryConnect over stochastic rounding on non-convex problems. Anderson & Berg (2017) demonstrate the effectiveness of binary networks through the observation that the angles between high-dimensional vectors are approximately preserved when binarized, and thus high-quality feature extraction with binary weights is possible. Ding et al. (2018) show a universal approximation theorem for quantized ReLU networks.
|
| 42 |
+
|
| 43 |
+
Principled methods Sun & Sun (2018) perform model quantization through a Wasserstein regularization term and minimize via the adversarial representation, similar as in Wasserstein GANs (Arjovsky et al., 2017). Their method has the potential of generalizing to other generic requirements on the parameter, but might be hard to tune due to the instability of the inner maximization problem.
|
| 44 |
+
|
| 45 |
+
Prior to our work, a couple of proximal or regularization based quantization algorithms were proposed as alternatives to the straight-through gradient method, which we now briefly review and compare with. (Yin et al., 2018) propose BinaryRelax, which corresponds to a lazy proximal gradient descent. (Hou et al., 2017; Hou & Kwok, 2018) propose a proximal Newton method with a diagonal approximate Hessian. Carreira-Perpinan (2017); Carreira-Perpin ´ an & Idelbayev (2017) ´ formulate quantized network training as a constrained optimization problem and propose to solve them via augmented Lagrangian methods. Our algorithm is different with all the aformentioned work in using the non-lazy and “soft” proximal gradient descent with a choice of either $\ell _ { 1 }$ or $\ell _ { 2 }$ regularization, whose advantage over lazy prox-gradient methods is demonstrated both theoretically (Section 5) and experimentally (Section 4.1 and Appendix C).
|
| 46 |
+
|
| 47 |
+
# 2 PRELIMINARIES
|
| 48 |
+
|
| 49 |
+
The optimization difficulty of training quantized models is that they involve a discrete parameter space and hence efficient local-search methods are often prohibitive. For example, the problem of training a binary neural network is to minimize $L ( \theta )$ for $\theta \in \{ \pm 1 \} ^ { d }$ . Projected SGD on this set will not move unless with an unreasonably large stepsize (Li et al., 2017), whereas greedy nearestneighbor search requires $d$ forward passes which is intractable for neural networks where $d$ is on the order of millions. Alternatively, quantized training can also be cast as minimizing $L ( { \mathfrak { q } } ( \theta ) )$ for $\theta \in \mathbb { R } ^ { d }$ and an appropriate quantizer q that maps a real vector to a nearby quantized vector, but $\theta \mapsto { \mathsf { q } } ( \theta )$ is often non-differentiable and piecewise constant (such as the binary case $\begin{array} { r } { \mathsf { q } ( \cdot ) = \mathrm { s i g n } ( \cdot ) \dag } \end{array}$ , and thus back-propagation through q does not work.
|
| 50 |
+
|
| 51 |
+
# 2.1 THE STRAIGHT-THROUGH GRADIENT METHOD
|
| 52 |
+
|
| 53 |
+
The pioneering work of BinaryConnect (Courbariaux et al., 2015) proposes to solve this problem via the straight-through gradient method, that is, propagate the gradient with respect to ${ \mathfrak { q } } ( \theta )$ unaltered to $\theta$ , i.e. to let $\begin{array} { r } { \frac { \partial L } { \partial \theta } : = \frac { \partial L } { \partial { \mathsf { q } } ( \theta ) } } \end{array}$ . One iterate of the straight-through gradient method (with the SGD optimizer) is
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\theta _ { t + 1 } = \theta _ { t } - \eta _ { t } \widetilde \nabla L ( \theta ) | _ { \theta = \mathsf { q } ( \theta _ { t } ) } .
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
This enables the real vector $\theta$ to move in the entire Euclidean space, and taking ${ \mathfrak { q } } ( \theta )$ at the end of training gives a valid quantized model. Such a customized back-propagation rule yields good empirical performance in training quantized nets and has thus become a standard practice (Courbariaux et al., 2015; Zhu et al., 2016; Xu et al., 2018). However, as we have discussed, it is information theoretically unclear how the straight-through method works, and it does fail on very simple convex Lipschitz functions (Figure 1b).
|
| 60 |
+
|
| 61 |
+
# 2.2 STRAIGHT-THROUGH GRADIENT AS LAZY PROJECTION
|
| 62 |
+
|
| 63 |
+
Our first observation is that the straight-through gradient method is equivalent to a dual-averaging method, or a lazy projected SGD (Xiao, 2010). In the binary case, we wish to minimize $L ( \theta )$ over $\mathcal { Q } = \left\{ \pm 1 \right\} ^ { d }$ , and the lazy projected SGD proceeds as
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\begin{array} { r } { \left\{ \begin{array} { l l } { \widetilde { \theta } _ { t } = \operatorname { P r o j } _ { \mathcal { Q } } ( \theta _ { t } ) = \operatorname { s i g n } ( \theta _ { t } ) = \mathsf { q } ( \theta _ { t } ) , } \\ { \theta _ { t + 1 } = \theta _ { t } - \eta _ { t } \widetilde { \nabla } L ( \widetilde { \theta } _ { t } ) . } \end{array} \right. } \end{array}
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
Written compactly, this is $\theta _ { t + 1 } = \theta _ { t } - \eta _ { t } \widetilde \nabla L ( \theta ) | _ { \theta = \mathsf { q } ( \theta _ { t } ) }$ , which is exactly the straight-through gradient method: take the gradient at the quantized vector and perform the update on the original real vector.
|
| 70 |
+
|
| 71 |
+
# 2.3 PROJECTION AS A LIMITING PROXIMAL OPERATOR
|
| 72 |
+
|
| 73 |
+
We take a broader point of view that a projection is also a limiting proximal operator with a suitable regularizer, to allow more generality and to motivate our proposed algorithm. Given any set $\mathcal { Q }$ , one could identify a regularizer $R : \mathbb { R } ^ { d } \mathbb { R } _ { \geq 0 }$ such that the following hold:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
R ( \theta ) = 0 , \ \forall \theta \in \mathcal { Q } \mathrm { a n d } R ( \theta ) > 0 , \ \forall \theta \notin \mathcal { Q } .
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
In the case $\mathcal { Q } = \left\{ \pm 1 \right\} ^ { d }$ for example, one could take
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
R ( \theta ) = R _ { \mathrm { b i n } } ( \theta ) = \sum _ { j = 1 } ^ { d } \operatorname* { m i n } { \{ | \theta _ { j } - 1 | , | \theta _ { j } + 1 | \} } .
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
The proximal operator (or prox operator) (Parikh & Boyd, 2014) with respect to $R$ and strength $\lambda > 0$ is
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\mathrm { p r o x } _ { \lambda R } ( \theta ) : = \underset { \widetilde { \theta } \in \mathbb { R } ^ { d } } { \arg \operatorname* { m i n } } \left. \frac { 1 } { 2 } \left\| \widetilde { \theta } - \theta \right\| _ { 2 } ^ { 2 } + \lambda R ( \widetilde { \theta } ) \right. .
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
In the limiting case $\lambda = \infty$ , the argmin has to satisfy $R ( \theta ) = 0$ , i.e. $\theta \in \mathcal { Q }$ , and the prox operator is to minimize $\left\| \theta - \theta _ { 0 } \right\| _ { 2 } ^ { 2 }$ over $\theta \in \mathcal { Q }$ , which is the Euclidean projection onto $\mathcal { Q }$ . Hence, projection is also a prox operator with $\lambda = \infty$ , and the straight-through gradient estimate is equivalent to a lazy proximal gradient descent with and $\lambda = \infty$ .
|
| 92 |
+
|
| 93 |
+
While the prox operator with $\lambda = \infty$ correponds to “hard” projection onto the discrete set $\mathcal { Q }$ , when $\lambda < \infty$ it becomes a “soft” projection that moves towards $\mathcal { Q }$ . Compared with the hard projection, a finite $\lambda$ is less aggressive and has the potential advantage of avoiding overshoot early in training. Further, as the prox operator does not strictly enforce quantizedness, it is in principle able to query the gradients at every point in the space, and therefore has access to more information than the straight-through gradient method.
|
| 94 |
+
|
| 95 |
+
# 3 QUANTIZED NET TRAINING VIA REGULARIZED LEARNING
|
| 96 |
+
|
| 97 |
+
We propose the PROXQUANT algorithm, which adds a quantization-inducing regularizer onto the loss and optimizes via the (non-lazy) prox-gradient method with a finite $\lambda$ . The prototypical version of PROXQUANT is described in Algorithm 1.
|
| 98 |
+
|
| 99 |
+
Require: Regularizer $R$ that induces desired quantizedness, initialization $\theta _ { 0 }$ , learning rates $\{ \eta _ { t } \} _ { t \ge 0 }$ , regularization strengths $\{ \lambda _ { t } \} _ { t \ge 0 }$
|
| 100 |
+
|
| 101 |
+
while not converged do
|
| 102 |
+
|
| 103 |
+
Perform the prox-gradient step
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\begin{array} { r } { \theta _ { t + 1 } = \operatorname { p r o x } _ { \eta _ { t } \lambda _ { t } R } \left( \theta _ { t } - \eta _ { t } \widetilde { \nabla } L ( \theta _ { t } ) \right) . } \end{array}
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
The inner SGD step in eq. (4) can be replaced by any preferred stochastic optimization method such as Momentum SGD or Adam (Kingma & Ba, 2014).
|
| 110 |
+
|
| 111 |
+
end while
|
| 112 |
+
|
| 113 |
+
Compared to usual full-precision training, PROXQUANT only adds a prox step after each stochastic gradient step, hence can be implemented straightforwardly upon existing full-precision training. As the prox step does not need to know how the gradient step is performed, our method adapts to other stochastic optimizers as well such as Adam.
|
| 114 |
+
|
| 115 |
+
In the remainder of this section, we define a flexible class of quantization-inducing regularizers through “distance to the quantized set”, derive efficient algorithms of their corresponding prox operator, and propose a homotopy method for choosing the regularization strengths. Our regularization perspective subsumes most existing algorithms for model-quantization (e.g.,(Courbariaux et al., 2015; Han et al., 2015; Xu et al., 2018)) as limits of certain regularizers with strength $\lambda \to \infty$ . Our proposed method can be viewed as a principled generalization of these methods to $\lambda < \infty$ with a non-lazy prox operator.
|
| 116 |
+
|
| 117 |
+
# 3.1 REGULARIZATION FOR MODEL QUANTIZATION
|
| 118 |
+
|
| 119 |
+
Let $\mathcal { Q } \subset \mathbb { R } ^ { d }$ be a set of quantized parameter vectors. An ideal regularizer for quantization would be to vanish on $\mathcal { Q }$ and reflect some type of distance to $\mathcal { Q }$ when $\theta \not \in \mathcal { Q }$ . To achieve this, we propose $L _ { 1 }$ and $L _ { 2 }$ regularizers of the form
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
R ( \theta ) = \operatorname* { i n f } _ { \theta _ { 0 } \in \mathcal { Q } } \ \left\| \theta - \theta _ { 0 } \right\| _ { 1 } \ \mathrm { o r } \ R ( \theta ) = \operatorname* { i n f } _ { \theta _ { 0 } \in \mathcal { Q } } \ \left\| \theta - \theta _ { 0 } \right\| _ { 2 } ^ { 2 } .
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
This is a highly flexible framework for designing regularizers, as one could specify any $\mathcal { Q }$ and choose between $L _ { 1 }$ and $L _ { 2 }$ . Specifically, $\mathcal { Q }$ encodes certain desired quantization structure. By appropriately choosing $\mathcal { Q }$ , we can specify which part of the parameter vector to quantize1, the number of bits to quantize to, whether we allow adaptively-chosen quantization levels and so on. The choice between $\{ L _ { 1 } , L _ { 2 } \}$ will encourage $\{$ “hard”,“soft”} quantization respectively, similar as in standard regularized learning (Tibshirani, 1996).
|
| 126 |
+
|
| 127 |
+
In the following, we present a few examples of regularizers under our framework eq. (5) which induce binary weights, ternary weights and multi-bit quantization. We will also derive efficient algorithms (or approximation heuristics) for solving the prox operators corresponding to these regularizers, which generalize the projection operators used in the straight-through gradient algorithms.
|
| 128 |
+
|
| 129 |
+
Binary neural nets In a binary neural net, the entries of $\theta$ are in $\{ \pm 1 \}$ . A natural choice would be taking $\mathcal { Q } = \{ - 1 , 1 \} ^ { d }$ . The resulting $L _ { 1 }$ regularizer is
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
\begin{array} { l } { { \displaystyle R ( \theta ) = \operatorname* { i n f } _ { \theta _ { 0 } \in \{ \pm 1 \} ^ { d } } \| \theta - \theta _ { 0 } \| _ { 1 } = \sum _ { j = 1 } ^ { d } \operatorname* { i n f } _ { [ \theta _ { 0 } ] _ { j } \in \{ \pm 1 \} } | \theta _ { j } - [ \theta _ { 0 } ] _ { j } | } } \\ { { \displaystyle = \sum _ { j = 1 } ^ { d } \operatorname* { m i n } \left\{ | \theta _ { j } - 1 | , | \theta _ { j } + 1 | \right\} = \| \theta - \mathrm { s i g n } ( \theta ) \| _ { 1 } . } } \end{array}
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
This is exactly the binary regularizer $R _ { \mathrm { b i n } }$ that we discussed earlier in eq. (3). Figure 2 plots the W-shaped one-dimensional component of $R _ { \mathrm { b i n } }$ from which we see its effect for inducing $\{ \pm 1 \}$ quantization in analog to $L _ { 1 }$ regularization for inducing exact sparsity.
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
Figure 2: W-shaped regularizer for binary quantization.
|
| 139 |
+
|
| 140 |
+
The prox operator with respect to $R _ { \mathrm { b i n } }$ , despite being a non-convex optimization problem, admits a simple analytical solution:
|
| 141 |
+
|
| 142 |
+
$$
|
| 143 |
+
\begin{array} { r l } & { \mathrm { p r o x } _ { \lambda R _ { \mathrm { b i n } } } ( \theta ) = \mathrm { S o f t T h r e s h o l d } ( \theta , \mathrm { s i g n } ( \theta ) , \lambda ) } \\ & { \qquad = \mathrm { s i g n } ( \theta ) + \mathrm { s i g n } ( \theta - \mathrm { s i g n } ( \theta ) ) \odot [ | \theta - \mathrm { s i g n } ( \theta ) | - \lambda ] _ { + } . } \end{array}
|
| 144 |
+
$$
|
| 145 |
+
|
| 146 |
+
We note that the choice of the $L _ { 1 }$ version is not unique: the squared $L _ { 2 }$ version works as well, whose prox operator is given by $( \theta +$ $\lambda \operatorname { s i g n } ( \theta ) ) / ( 1 + \lambda )$ . See Appendix A.1 for the derivation of these prox operators and the definition of the soft thresholding operator.
|
| 147 |
+
|
| 148 |
+
Multi-bit quantization with adaptive levels. Following $( \mathrm { X u }$ et al., 2018), we consider $k$ -bit quantized parameters with a structured adaptively-chosen set of quantization levels, which translates
|
| 149 |
+
|
| 150 |
+
into
|
| 151 |
+
|
| 152 |
+
$$
|
| 153 |
+
\mathcal { Q } = \left\{ \sum _ { i = 1 } ^ { k } \alpha _ { i } b _ { i } : \left\{ \alpha _ { 1 } , \dots , \alpha _ { k } \right\} \subset \mathbb { R } , b _ { i } \in \left\{ \pm 1 \right\} ^ { d } \right\} = \Big \{ \theta _ { 0 } = B \alpha : \alpha \in \mathbb { R } ^ { k } , \ B \in \left\{ \pm 1 \right\} ^ { d \times k } \Big \} .
|
| 154 |
+
$$
|
| 155 |
+
|
| 156 |
+
The squared $L _ { 2 }$ regularizer for this structure is
|
| 157 |
+
|
| 158 |
+
$$
|
| 159 |
+
R _ { k - \mathrm { b i t } } ( \theta ) = \operatorname* { i n f } _ { \alpha \in \mathbb { R } ^ { k } , B \in \{ \pm 1 \} ^ { d \times k } } \left\| \theta - B \alpha \right\| _ { 2 } ^ { 2 } ,
|
| 160 |
+
$$
|
| 161 |
+
|
| 162 |
+
which is also the alternating minimization objective in ( $\mathrm { \Delta X u }$ et al., 2018).
|
| 163 |
+
|
| 164 |
+
We now derive the prox operator for the regularizer eq. (9). For any $\theta$ , we have
|
| 165 |
+
|
| 166 |
+
$$
|
| 167 |
+
\begin{array} { r l } & { \mathrm { p r o x } _ { \lambda R _ { k - \mathrm { b i t } } } ( \theta ) = \underset { \widetilde { \theta } } { \arg \operatorname* { m i n } } \left\{ \frac { 1 } { 2 } \left\| \widetilde { \theta } - \theta \right\| _ { 2 } ^ { 2 } + \lambda \underset { \alpha \in \mathbb { R } ^ { k } , B \in \{ \pm 1 \} ^ { d \times k } } { \operatorname* { i n f } } \left\| \widetilde { \theta } - B \alpha \right\| _ { 2 } ^ { 2 } \right\} } \\ & { = \underset { \widetilde { \theta } } { \arg \operatorname* { m i n } } \underset { \alpha \in \mathbb { R } ^ { k } , B \in \{ \pm 1 \} ^ { d \times k } } { \operatorname* { i n f } } \left\{ \frac { 1 } { 2 } \left\| \widetilde { \theta } - \theta \right\| _ { 2 } ^ { 2 } + \lambda \left\| \widetilde { \theta } - B \alpha \right\| _ { 2 } ^ { 2 } \right\} . } \end{array}
|
| 168 |
+
$$
|
| 169 |
+
|
| 170 |
+
This is a joint minimization problem in $( \widetilde { \theta } , B , \alpha )$ , and we adopt an alternating minimization schedule to solve it:
|
| 171 |
+
|
| 172 |
+
(1) Minimize over θe given (B, α), which has a closed-form solution θe = θ+2λBα . (2) Minimize over $( B , \alpha )$ given $\widetilde { \theta }$ , which does not depend on $\theta _ { 0 }$ , and can be done via calling the alternating quantizer of ( $\mathrm { { X u } }$ et al., 2018): $B \alpha = { \mathfrak { q } } _ { \mathrm { a l t } } ( { \widetilde { \theta } } )$ .
|
| 173 |
+
|
| 174 |
+
Together, the prox operator generalizes the alternating minimization procedure in $\mathrm { { X u } }$ et al., 2018), as $\lambda$ governs a trade-off between quantization and closeness to $\theta$ . To see that this is a strict generalization, note that for any $\lambda$ the solution of eq. (10) will be an interpolation between the input $\theta$ and its Euclidean projection to $\mathcal { Q }$ . As $\lambda \to + \infty$ , the prox operator collapses to the projection.
|
| 175 |
+
|
| 176 |
+
Ternary quantization Ternary quantization is a variant of 2-bit quantization, in which weights are constrained to be in $\{ - \alpha , 0 , \beta \}$ for real values $\alpha , \beta > 0$ . We defer the derivation of the ternary prox operator into Appendix A.2.
|
| 177 |
+
|
| 178 |
+
# 3.2 HOMOTOPY METHOD FOR REGULARIZATION STRENGTH
|
| 179 |
+
|
| 180 |
+
Recall that the larger $\lambda _ { t }$ is, the more aggressive $\theta _ { t + 1 }$ will move towards the quantized set. An ideal choice would be to (1) force the net to be exactly quantized upon convergence, and (2) not be too aggressive such that the quantized net at convergence is sub-optimal.
|
| 181 |
+
|
| 182 |
+
We let $\lambda _ { t }$ be a linearly increasing sequence, i.e. $\lambda _ { t } : = \lambda \cdot t$ for some hyper-parameter $\lambda > 0$ which we term as the regularization rate. With this choice, the stochastic gradient steps will start off close to full-precision training and gradually move towards exact quantizedness, hence the name “homotopy method”. The parameter $\lambda$ can be tuned by minimizing the validation loss, and controls the aggressiveness of falling onto the quantization constraint. There is nothing special about the linear increasing scheme, but it is simple enough and works well as we shall see in the experiments.
|
| 183 |
+
|
| 184 |
+
# 4 EXPERIMENTS
|
| 185 |
+
|
| 186 |
+
We evaluate the performance of PROXQUANT on two tasks: image classification with ResNets, and language modeling with LSTMs. On both tasks, we show that the default straight-through gradient method is not the only choice, and our PROXQUANT can achieve the same and often better results.
|
| 187 |
+
|
| 188 |
+
# 4.1 IMAGE CLASSIFICATION ON CIFAR-10
|
| 189 |
+
|
| 190 |
+
Problem setup We perform image classification on the CIFAR-10 dataset, which contains 50000 training images and 10000 test images of size $3 2 \mathrm { x } 3 2 $ . We apply a commonly used data augmentation strategy (pad by 4 pixels on each side, randomly crop to 32x32, do a horizontal flip with probability 0.5, and normalize). Our models are ResNets (He et al., 2016) of depth 20, 32, 44, and 56 with weights quantized to binary or ternary.
|
| 191 |
+
|
| 192 |
+
Method We use PROXQUANT with regularizer eq. (3) in the binary case and eqs. (15) and (16) in the ternary case, which we respectively denote as PQ-B and PQ-T. We use the homotopy method $\lambda _ { t } = \lambda \cdot t$ with $\lambda = 1 0 ^ { - 4 }$ as the regularization strength and Adam with constant learning rate 0.01 as the optimizer.
|
| 193 |
+
|
| 194 |
+
We compare with BinaryConnect (BC) for binary nets and Trained Ternary Quantization (TTQ) (Zhu et al., 2016) for ternary nets. For BinaryConnect, we train with the recommended Adam optimizer with learning rate decay (Courbariaux et al., 2015) (initial learning rate 0.01, multiply by 0.1 at epoch 81 and 122), which we find leads to the best result for BinaryConnect. For TTQ we compare with the reported results in (Zhu et al., 2016).
|
| 195 |
+
|
| 196 |
+
For binary quantization, both BC and our PROXQUANT are initialized at the same pre-trained fullprecision nets (warm-start) and trained for 300 epochs for fair comparison. For both methods, we perform a hard quantization $\theta \mapsto { \mathsf { q } } ( \theta )$ at epoch 200 and keeps training till the 300-th epoch to stabilize the BatchNorm layers. We compare in addition the performance drop relative to full precision nets of BinaryConnect, BinaryRelax (Yin et al., 2018), and our PROXQUANT.
|
| 197 |
+
|
| 198 |
+
Result The top-1 classification errors for binary quantization are reported in Table 1. Our PROXQUANT consistently yields better results than BinaryConnect. The performance drop of PROXQUANT relative to full-precision nets is about $1 \%$ , better than BinaryConnect by $0 . 2 \%$ on average and significantly better than the reported result of BinaryRelax.
|
| 199 |
+
|
| 200 |
+
Results and additional details for ternary quantization are deferred to Appendix B.1.
|
| 201 |
+
|
| 202 |
+
Table 1: Top-1 classification error of binarized ResNets on CIFAR-10. Performance is reported in mean(std) over 4 runs, as well as the (absolute) performance drop of over full-precision nets.
|
| 203 |
+
|
| 204 |
+
<table><tr><td colspan="2"></td><td colspan="2">Classification error</td><td colspan="3">Performance drop over FP net</td></tr><tr><td>Model (Bits)</td><td>FP (32)</td><td>BC (1)</td><td>PQ-B (ours) (1)</td><td>BC (1)</td><td>BinaryRelax (1)</td><td>PQ-B (ours)</td></tr><tr><td>ResNet-20</td><td>8.06</td><td>9.54 (0.03)</td><td>9.35 (0.13)</td><td>+1.48</td><td>+4.84</td><td>(1) +1.29</td></tr><tr><td>ResNet-32</td><td>7.25</td><td>8.61 (0.27)</td><td>8.53 (0.15)</td><td>+1.36</td><td>+2.75</td><td>+1.28</td></tr><tr><td>ResNet-44</td><td>6.96</td><td>8.23 (0.23)</td><td>7.95 (0.05)</td><td>+1.27</td><td>1</td><td>+0.99</td></tr><tr><td>ResNet-56</td><td>6.54</td><td>7.97 (0.22)</td><td>7.70 (0.06)</td><td>+1.43</td><td>-</td><td>+1.16</td></tr></table>
|
| 205 |
+
|
| 206 |
+
# 4.2 LANGUAGE MODELING WITH LSTMS
|
| 207 |
+
|
| 208 |
+
Problem setup We perform language modeling with LSTMs Hochreiter & Schmidhuber (1997) on the Penn Treebank (PTB) dataset (Marcus et al., 1993), which contains 929K training tokens, 73K validation tokens, and 82K test tokens. Our model is a standard one-hidden-layer LSTM with embedding dimension 300 and hidden dimension 300. We train quantized LSTMs with the encoder, transition matrix, and the decoder quantized to $k$ -bits for $k \in \{ 1 , 2 , 3 \}$ . The quantization is performed in a row-wise fashion, so that each row of the matrix has its own codebook $\mathbf { \bar { \{ } } \alpha _ { 1 } , \ldots , \alpha _ { k } \}$ .
|
| 209 |
+
|
| 210 |
+
Method We compare our multi-bit PROXQUANT (eq. (10)) to the state-of-the-art alternating minimization algorithm with straight-through gradients (Xu et al., 2018). Training is initialized at a pre-trained full-precision LSTM. We use the SGD optimizer with initial learning rate 20.0 and decay by a factor of 1.2 when the validation error does not improve over an epoch. We train for 80 epochs with batch size 20, BPTT 30, dropout with probability 0.5, and clip the gradient norms to 0.25. The regularization rate $\lambda$ is tuned by finding the best performance on the validation set. In addition to multi-bit quantization, we also report the results for binary LSTMs (weights in $\{ \pm 1 \} )$ , comparing BinaryConnect and our PROXQUANT-Binary, where both learning rates are tuned on an exponential grid $\{ 2 . 5 , 5 , 1 0 , 2 0 , 4 0 \}$ .
|
| 211 |
+
|
| 212 |
+
Result We report the perplexity-per-word (PPW, lower is better) in Table 2. The performance of PROXQUANT is comparable with the Straight-through gradient method. On Binary LSTMs, PROXQUANT-Binary beats BinaryConnect by a large margin. These results demonstrate that PROXQUANT offers a powerful alternative for training recurrent networks.
|
| 213 |
+
|
| 214 |
+
Table 2: PPW of quantized LSTM on Penn Treebank.
|
| 215 |
+
|
| 216 |
+
<table><tr><td rowspan=1 colspan=1>Method /Number of Bits</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>FP (32)</td></tr><tr><td rowspan=1 colspan=1>BinaryConnect</td><td rowspan=1 colspan=1>372.2</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>二</td><td rowspan=4 colspan=1>88.5</td></tr><tr><td rowspan=1 colspan=1>PROXQUANT-Binary (ours)</td><td rowspan=1 colspan=1>288.5</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>1</td></tr><tr><td rowspan=1 colspan=1>ALT Straight-through2</td><td rowspan=1 colspan=1>104.7</td><td rowspan=1 colspan=1>90.2</td><td rowspan=1 colspan=1>86.1</td></tr><tr><td rowspan=1 colspan=1>ALT-PROXQUANT (ours)</td><td rowspan=1 colspan=1>106.2</td><td rowspan=1 colspan=1>90.0</td><td rowspan=1 colspan=1>87.2</td></tr></table>
|
| 217 |
+
|
| 218 |
+
# 5 THEORETICAL ANALYSIS
|
| 219 |
+
|
| 220 |
+
In this section, we perform a theoretical study on the convergence of quantization algorithms. We show in Section 5.1 that our PROXQUANT algorithm (i.e. non-lazy prox-gradient method) converges under mild smoothness assumptions on the problem. In Section 5.2, we provide a simple example showing that the lazy prox-gradient method fails to converge under the same set of assumptions. In Section 5.3, we show that BinaryConnect has a very stringent condition for converging to a fixed point. Our theory demonstrates the superiority of our proposed PROXQUANT over lazy proxgradient type algorithms such as BinaryConnect and BinaryRelax (Yin et al., 2018). All missing proofs are deferred to Appendix D.
|
| 221 |
+
|
| 222 |
+
Prox-gradient algorithms (both lazy and non-lazy) with a fixed $\lambda$ aim to solve the problem
|
| 223 |
+
|
| 224 |
+
$$
|
| 225 |
+
{ \underset { \theta \in \mathbb { R } ^ { d } } { \operatorname* { m i n i m i z e } } } L ( \theta ) + \lambda R ( \theta ) ,
|
| 226 |
+
$$
|
| 227 |
+
|
| 228 |
+
and BinaryConnect can be seen as the limiting case of the above with $\lambda = \infty$ (cf. Section 2.2).
|
| 229 |
+
|
| 230 |
+
5.1 A CONVERGENCE THEOREM FOR PROXQUANT
|
| 231 |
+
|
| 232 |
+
We consider PROXQUANT with batch gradient and constant regularization strength $\lambda _ { t } \equiv \lambda$ :
|
| 233 |
+
|
| 234 |
+
$$
|
| 235 |
+
\begin{array} { r } { \theta _ { t + 1 } = \mathrm { p r o x } _ { \eta _ { t } \lambda R } \big ( \theta _ { t } - \eta _ { t } \nabla L ( \theta _ { t } ) \big ) . } \end{array}
|
| 236 |
+
$$
|
| 237 |
+
|
| 238 |
+
Theorem 5.1 (Convergence of ProxQuant). Assume that the loss $L$ is $\beta$ -smooth (i.e. has $\beta$ -Lipschitz gradients) and the regularizer $R$ is differentiable. Let $F _ { \lambda } ( \theta ) = L ( \theta ) + \lambda R ( \theta )$ be the composite objective and assume that it is bounded below by $F _ { \star }$ . Running ProxQuant with batch gradient $\nabla L$ , constant stepsize $\begin{array} { r } { \eta _ { t } \equiv \eta = \frac { 1 } { 2 \beta } } \end{array}$ and $\lambda _ { t } \equiv \lambda$ for $T$ steps, we have the convergence guarantee
|
| 239 |
+
|
| 240 |
+
$$
|
| 241 |
+
\| \nabla F _ { \boldsymbol { \lambda } } ( \theta _ { T _ { \mathrm { b e s t } } } ) \| _ { 2 } ^ { 2 } \le \frac { C \beta ( F _ { \boldsymbol { \lambda } } ( \theta _ { 0 } ) - F _ { \star } ) } { T } \mathrm { w h e r e } T _ { \mathrm { b e s t } } = \underset { 1 \le t \le T } { \arg \operatorname* { m i n } } \| \theta _ { t } - \theta _ { t - 1 } \| _ { 2 } ,
|
| 242 |
+
$$
|
| 243 |
+
|
| 244 |
+
where $C > 0$ is a universal constant.
|
| 245 |
+
|
| 246 |
+
Remark 5.1. The convergence guarantee requires both the loss and the regularizer to be smooth. Smoothness of the loss can be satisfied if we use a smooth activation function (such as tanh). For the regularizer, the quantization-inducing regularizers defined in Section 3.1 (such as the W-shaped regularizer) are non-differentiable. However, we can use a smoothed version of them that is differentiable and point-wise arbitrarily close to $R$ , which will satisfy the assumptions of Theorem 5.1. The proof of Theorem 5.1 is deferred to Appendix $D . I$ .
|
| 247 |
+
|
| 248 |
+
# 5.2 NON-CONVERGENCE OF LAZY PROX-GRADIENT
|
| 249 |
+
|
| 250 |
+
The lazy prox-gradient algorithm (e.g. BinaryRelax (Yin et al., 2018)) for solving problem eq. (11) is a variant where the gradients are taken at proximal points but accumulated at the original sequence:
|
| 251 |
+
|
| 252 |
+
$$
|
| 253 |
+
\theta _ { t + 1 } = \theta _ { t } - \eta _ { t } \nabla L \big ( \mathrm { p r o x } _ { \lambda R } \big ( \theta _ { t } \big ) \big ) .
|
| 254 |
+
$$
|
| 255 |
+
|
| 256 |
+
Convergence of the lazy prox-gradient algorithm eq. (13) is only known to hold for convex problems (Xiao, 2010); on smooth non-convex problems it generally does not converge even in an ergodic sense. We provide a concrete example that satisfies the assumptions in Theorem 5.1 (so that PROXQUANT converges ergodically) but lazy prox-gradient does not converge.
|
| 257 |
+
|
| 258 |
+
Theorem 5.2 (Non-convergence of lazy prox-gradient). There exists $L$ and $R$ satisfying the assumptions of Theorem 5.1 such that for any constant stepsize $\begin{array} { r } { \eta _ { t } \equiv \eta \le \frac { 1 } { 2 \beta } } \end{array}$ , there exists some specific initialization $\theta _ { 0 }$ on which the lazy prox-gradient algorithm eq. (13) oscillates between two non-stataionry points and hence does not converge in the ergodic sense of eq. (12).
|
| 259 |
+
|
| 260 |
+
Remark 5.2. Our construction is a fairly simple example in one-dimension and not very adversarial: $L ( \theta ) = { \textstyle { \frac { 1 } { 2 } } } \theta ^ { 2 }$ and $R$ is a smoothed W-shaped regularizer. See Appendix D.2 for the details.
|
| 261 |
+
|
| 262 |
+
# 5.3 CONVERGENCE CHARACTERIZATION FOR BINARYCONNECT
|
| 263 |
+
|
| 264 |
+
For BinaryConnect, the concept of stataionry points is no longer sensible (as the target points $\{ \pm 1 \} ^ { d }$ are isolated and hence every point is stationary). Here, we consider the alternative definition of convergence as converging to a fixed point and show that BinaryConnect has a very stringent convergence condition.
|
| 265 |
+
|
| 266 |
+
Consider the BinaryConnect method with batch gradients:
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
s _ { t } = \mathrm { s i g n } ( \theta _ { t } ) , \theta _ { t + 1 } = \theta _ { t } - \eta _ { t } \nabla L ( s _ { t } ) .
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+
Definition 5.1 (Fixed point and convergence). We say that $s \in \{ \pm 1 \} ^ { d }$ is a fixed point of the BinaryConnect algorithm, if $\dot { \boldsymbol { s } } _ { 0 } = \boldsymbol { s }$ in eq. (14) implies that $s _ { t } = s$ for all $t = 1 , 2 , \ldots$ . We say that the BinaryConnect algorithm converges if there exists $t < \infty$ such that $s _ { t }$ is a fixed point.
|
| 273 |
+
|
| 274 |
+
Theorem 5.3. Assume that the learning rates satisfy $\textstyle \sum _ { t = 0 } ^ { \infty } \eta _ { t } = \infty$ , then $s \in \{ \pm 1 \} ^ { d }$ is a fixed point for BinaryConnect eq. (14) if and only if $\mathrm { s i g n } ( \nabla L ( s ) [ i ] ) = - s [ i ]$ for all $i \in [ d ]$ such that $\nabla L ( \theta ) [ i ] \neq 0$ . Such a point may not exist, in which case BinaryConnect does not converge for any initialization $\theta _ { 0 } \in \mathbb { R } ^ { d }$ .
|
| 275 |
+
|
| 276 |
+
Remark 5.3. Theorem 5.3 is in appearingly a stark contrast with the convergence result for BinaryConnect in ( $L i$ et al., 2017) in the convex case, whose bound involves a an additive error $O ( \Delta )$ that does not vanish over iterations, where $\Delta$ is the grid size for quantization. Hence, their result is only useful when $\Delta$ is small. In contrast, we consider the original BinaryConnect with $\Delta = 1$ , in which case the error makes $L i$ et al. (2017)’s bound vacuous. The proof of Theorem 5.3 is deferred to Appendix D.3.
|
| 277 |
+
|
| 278 |
+
Experimental evidence We have already seen that such a fixed point $s$ might not exist in the toy example in Figure 1b. In Appendix C, we perform a sign change experiment on CIFAR-10, showing that BinaryConnect indeed fails to converge to a fixed sign pattern, corroborating Theorem 5.3.
|
| 279 |
+
|
| 280 |
+
# 6 CONCLUSION
|
| 281 |
+
|
| 282 |
+
In this paper, we propose and experiment with the PROXQUANT method for training quantized networks. Our results demonstrate that PROXQUANT offers a powerful alternative to the straightthrough gradient method and has theoretically better convergence properties. For future work, it would be of interest to propose alternative regularizers for ternary and multi-bit PROXQUANT and experiment with our method on larger tasks.
|
| 283 |
+
|
| 284 |
+
# ACKNOWLEDGEMENT
|
| 285 |
+
|
| 286 |
+
We thank Tong He, Yifei Ma, Zachary Lipton, and John Duchi for their valuable feedback. We thank Chen Xu and Zhouchen Lin for the insightful discussion on multi-bit quantization and sharing the implementation of (Xu et al., 2018) with us. We thank Ju Sun for sharing the draft of (Sun & Sun, 2018) and the inspiring discussions on adversarial regularization for quantization. The majority of this work was performed when YB and YW were at Amazon AI.
|
| 287 |
+
|
| 288 |
+
# REFERENCES
|
| 289 |
+
|
| 290 |
+
Alexander G Anderson and Cory P Berg. The high-dimensional geometry of binary neural networks. arXiv preprint arXiv:1705.07199, 2017.
|
| 291 |
+
|
| 292 |
+
Martin Arjovsky, Soumith Chintala, and Leon Bottou. Wasserstein gan. ´ arXiv preprint arXiv:1701.07875, 2017.
|
| 293 |
+
|
| 294 |
+
Miguel A Carreira-Perpinan. Model compression as constrained optimization, with application to´ neural nets. part i: General framework. arXiv preprint arXiv:1707.01209, 2017.
|
| 295 |
+
|
| 296 |
+
Miguel A Carreira-Perpinan and Yerlan Idelbayev. Model compression as constrained optimization, ´ with application to neural nets. part ii: Quantization. arXiv preprint arXiv:1707.04319, 2017.
|
| 297 |
+
|
| 298 |
+
Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. BinaryConnect: Training deep neural networks with binary weights during propagations. In Advances in neural information processing systems, pp. 3123–3131, 2015.
|
| 299 |
+
|
| 300 |
+
Yukun Ding, Jinglan Liu, and Yiyu Shi. On the universal approximability of quantized relu neural networks. arXiv preprint arXiv:1802.03646, 2018.
|
| 301 |
+
|
| 302 |
+
Ian Goodfellow, Yoshua Bengio, Aaron Courville, and Yoshua Bengio. Deep learning, volume 1. MIT press Cambridge, 2016.
|
| 303 |
+
|
| 304 |
+
Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015.
|
| 305 |
+
|
| 306 |
+
Song Han, Xingyu Liu, Huizi Mao, Jing Pu, Ardavan Pedram, Mark A Horowitz, and William J Dally. EIE: Efficient inference engine on compressed deep neural network. In Computer Architecture (ISCA), 2016 ACM/IEEE 43rd Annual International Symposium on, pp. 243–254. IEEE, 2016.
|
| 307 |
+
|
| 308 |
+
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.
|
| 309 |
+
|
| 310 |
+
Sepp Hochreiter and Jurgen Schmidhuber. Long short-term memory. ¨ Neural computation, 9(8): 1735–1780, 1997.
|
| 311 |
+
|
| 312 |
+
Lu Hou and James T. Kwok. Loss-aware weight quantization of deep networks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum? id $=$ BkrSv0lA-.
|
| 313 |
+
|
| 314 |
+
Lu Hou, Quanming Yao, and James T Kwok. Loss-aware binarization of deep networks. In International Conference on Learning Representations, 2017. URL https://openreview.net/ forum?id $_ { \cdot } =$ S1oWlN9ll.
|
| 315 |
+
|
| 316 |
+
Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Quantized neural networks: Training neural networks with low precision weights and activations. Journal of Machine Learning Research, 18:187–1, 2017.
|
| 317 |
+
|
| 318 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 319 |
+
|
| 320 |
+
Fengfu Li and Bin Liu. Ternary weight networks. arXiv preprint arXiv:1605.04711, 2016.
|
| 321 |
+
|
| 322 |
+
Hao Li, Soham De, Zheng Xu, Christoph Studer, Hanan Samet, and Tom Goldstein. Training quantized nets: A deeper understanding. In Advances in Neural Information Processing Systems, pp. 5811–5821, 2017.
|
| 323 |
+
|
| 324 |
+
Mitchell P Marcus, Mary Ann Marcinkiewicz, and Beatrice Santorini. Building a large annotated corpus of english: The penn treebank. Computational linguistics, 19(2):313–330, 1993.
|
| 325 |
+
|
| 326 |
+
Neal Parikh and Stephen Boyd. Proximal algorithms. Foundations and Trends $\textsuperscript { \textregistered }$ in Optimization, 1 (3):127–239, 2014.
|
| 327 |
+
|
| 328 |
+
Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. Xnor-net: Imagenet classification using binary convolutional neural networks. In European Conference on Computer Vision, pp. 525–542. Springer, 2016.
|
| 329 |
+
|
| 330 |
+
Ju Sun and Xiaoxia Sun. Adversarial probabilistic regularization. Unpublished draft, 2018.
|
| 331 |
+
|
| 332 |
+
Robert Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society. Series B (Methodological), pp. 267–288, 1996.
|
| 333 |
+
|
| 334 |
+
Lin Xiao. Dual averaging methods for regularized stochastic learning and online optimization. Journal of Machine Learning Research, 11(Oct):2543–2596, 2010.
|
| 335 |
+
|
| 336 |
+
Chen Xu, Jianqiang Yao, Zhouchen Lin, Wenwu Ou, Yuanbin Cao, Zhirong Wang, and Hongbin Zha. Alternating multi-bit quantization for recurrent neural networks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $=$ S19dR9x0b.
|
| 337 |
+
|
| 338 |
+
Penghang Yin, Shuai Zhang, Yingyong Qi, and Jack Xin. Quantization and training of low bit-width convolutional neural networks for object detection. arXiv preprint arXiv:1612.06052, 2016.
|
| 339 |
+
|
| 340 |
+
Penghang Yin, Shuai Zhang, Jiancheng Lyu, Stanley Osher, Yingyong Qi, and Jack Xin. Binaryrelax: A relaxation approach for training deep neural networks with quantized weights. arXiv preprint arXiv:1801.06313, 2018.
|
| 341 |
+
|
| 342 |
+
Shuchang Zhou, Yuxin Wu, Zekun Ni, Xinyu Zhou, He Wen, and Yuheng Zou. Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv preprint arXiv:1606.06160, 2016.
|
| 343 |
+
|
| 344 |
+
Chenzhuo Zhu, Song Han, Huizi Mao, and William J Dally. Trained ternary quantization. arXiv preprint arXiv:1612.01064, 2016.
|
| 345 |
+
|
| 346 |
+
# A ADDITIONAL RESULTS ON REGULARIZATION
|
| 347 |
+
|
| 348 |
+
A.1 PROX OPERATORS FOR BINARY NETS
|
| 349 |
+
|
| 350 |
+
Here we derive the prox operators for the binary regularizer eq. (6) and its squared $L _ { 2 }$ variant. Recall that
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
R _ { \mathrm { b i n } } ( \theta ) = \sum _ { j = 1 } ^ { d } \operatorname* { m i n } \big \{ | \theta _ { j } - 1 | , | \theta _ { j } + 1 | \big \} .
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
By definition of the prox operator, we have for any $\theta \in \mathbb { R } ^ { d }$ that
|
| 357 |
+
|
| 358 |
+
$$
|
| 359 |
+
\begin{array} { r l } & { \mathrm { p r o x } _ { \lambda R _ { \mathrm { b i n } } } ( \theta ) = \underset { \widetilde { \theta } \in \mathbb { R } ^ { d } } { \arg \operatorname* { m i n } } \left\{ \frac { 1 } { 2 } \left\| \widetilde { \theta } - \theta \right\| _ { 2 } ^ { 2 } + \lambda \underset { j = 1 } { \overset { d } { \sum } } \operatorname* { m i n } \left\{ | \widetilde { \theta } _ { j } - 1 | , | \widetilde { \theta } _ { j } + 1 | \right\} \right\} } \\ & { = \underset { \widetilde { \theta } \in \mathbb { R } ^ { d } } { \arg \operatorname* { m i n } } \left\{ \underset { j = 1 } { \overset { d } { \sum } } \frac { 1 } { 2 } ( \widetilde { \theta } _ { j } - \theta _ { j } ) ^ { 2 } + \lambda \operatorname* { m i n } \left\{ | \widetilde { \theta } _ { j } - 1 | , | \widetilde { \theta } _ { j } + 1 | \right\} \right\} . } \end{array}
|
| 360 |
+
$$
|
| 361 |
+
|
| 362 |
+
This minimization problem is coordinate-wise separable. For each $\widetilde { \theta } _ { j }$ , the penalty term remains the same upon flipping the sign, but the quadratic term is smaller when $\mathrm { s i g n } ( \widetilde { \theta } _ { j } ) = \mathrm { s i g n } ( \theta _ { j } )$ . Hence, the solution $\theta ^ { \star }$ to the prox satisfies that $\mathrm { s i g n } ( \theta _ { j } ^ { \star } ) = \mathrm { s i g n } ( \theta _ { j } )$ , and the absolute value satisfies
|
| 363 |
+
|
| 364 |
+
$$
|
| 365 |
+
\theta _ { j } ^ { \star } | = \operatorname * { a r g m i n } _ { t \geq 0 } \left\{ \frac { 1 } { 2 } ( t - | \theta _ { j } | ) ^ { 2 } + \lambda | t - 1 | \right\} = { \mathsf { S o f f i r h r e s h o l d } } ( | \theta _ { j } | , 1 , \lambda ) = 1 + \mathrm { s i g n } ( | \theta _ { j } | - 1 ) [ | \theta _ { j } | - 1 | - 1 ] .
|
| 366 |
+
$$
|
| 367 |
+
|
| 368 |
+
Multiplying by $\mathrm { s i g n } ( \theta _ { j } ^ { \star } ) = \mathrm { s i g n } ( \theta _ { j } )$ , we have
|
| 369 |
+
|
| 370 |
+
$$
|
| 371 |
+
\theta _ { j } ^ { \star } = \mathsf { S o f t T h r e s h o l d } ( \theta _ { j } , \mathrm { s i g n } ( \theta _ { j } ) , \lambda ) ,
|
| 372 |
+
$$
|
| 373 |
+
|
| 374 |
+
which gives eq. (7).
|
| 375 |
+
|
| 376 |
+
For the squared $L _ { 2 }$ version, by a similar argument, the corresponding regularizer is
|
| 377 |
+
|
| 378 |
+
$$
|
| 379 |
+
R _ { \mathrm { b i n } } ( \theta ) = \sum _ { j = 1 } ^ { d } \operatorname* { m i n } \big \{ ( \theta _ { j } - 1 ) ^ { 2 } , ( \theta _ { j } + 1 ) ^ { 2 } \big \} .
|
| 380 |
+
$$
|
| 381 |
+
|
| 382 |
+
For this regularizer we have
|
| 383 |
+
|
| 384 |
+
$$
|
| 385 |
+
\operatorname { p r o x } _ { \lambda R _ { \mathrm { b i n } } } ( \theta ) = \underset { \widetilde { \theta } \in \mathbb { R } ^ { d } } { \arg \operatorname* { m i n } } \left\{ \sum _ { j = 1 } ^ { d } \frac { 1 } { 2 } ( \widetilde { \theta } _ { j } - \theta _ { j } ) ^ { 2 } + \lambda \operatorname* { m i n } \left\{ ( \widetilde { \theta } _ { j } - 1 ) ^ { 2 } , ( \widetilde { \theta } _ { j } + 1 ) ^ { 2 } \right\} \right\} .
|
| 386 |
+
$$
|
| 387 |
+
|
| 388 |
+
Using the same argument as in the $L _ { 1 }$ case, the solution $\theta ^ { \star }$ satisfies $\mathrm { s i g n } ( \theta _ { j } ^ { \star } ) = \mathrm { s i g n } ( \theta _ { j } )$ , and
|
| 389 |
+
|
| 390 |
+
$$
|
| 391 |
+
| \theta _ { j } ^ { \star } | = \operatorname * { a r g m i n } _ { t \geq 0 } \left\{ { \frac { 1 } { 2 } } ( t - | \theta _ { j } | ) ^ { 2 } + \lambda ( t - 1 ) ^ { 2 } \right\} = { \frac { | \theta _ { j } | + \lambda } { 1 + \lambda } } .
|
| 392 |
+
$$
|
| 393 |
+
|
| 394 |
+
Multiplying by $\mathrm { s i g n } ( \theta _ { j } ^ { \star } ) = \mathrm { s i g n } ( \theta _ { j } )$ gives
|
| 395 |
+
|
| 396 |
+
$$
|
| 397 |
+
\theta _ { j } ^ { \star } = \frac { \theta _ { j } + \lambda \mathrm { s i g n } ( \theta _ { j } ) } { 1 + \lambda } ,
|
| 398 |
+
$$
|
| 399 |
+
|
| 400 |
+
or, in vector form, $\theta ^ { \star } = ( \theta + \lambda \operatorname { s i g n } ( \theta ) ) / ( 1 + \lambda )$ .
|
| 401 |
+
|
| 402 |
+
# A.2 PROX OPERATOR FOR TERNARY QUANTIZATION
|
| 403 |
+
|
| 404 |
+
For ternary quantization, we use an approximate version of the alternating prox operator eq. (10): compute $\widetilde { \theta } = \mathrm { p r o x } _ { \lambda R } ( \theta )$ by initializing at $\widetilde { \theta } = \theta$ and repeating
|
| 405 |
+
|
| 406 |
+
$$
|
| 407 |
+
\widehat { \theta } = { \mathsf { q } } ( \widetilde { \theta } ) \mathrm { a n d } \widetilde { \theta } = \frac { \theta + 2 \lambda \widehat { \theta } } { 1 + 2 \lambda } ,
|
| 408 |
+
$$
|
| 409 |
+
|
| 410 |
+
where $\mathsf { q }$ is the ternary quantizer defined as
|
| 411 |
+
|
| 412 |
+
$$
|
| 413 |
+
\mathsf { q } ( \theta ) = \theta ^ { + } \mathbf { 1 } \{ \theta \geq \Delta \} + \theta ^ { - } \mathbf { 1 } \{ \theta \leq - \Delta \} , \Delta = \frac { 0 . 7 } { d } \| \theta \| _ { 1 } , \theta ^ { + } = \overline { { \theta | _ { i : \theta _ { i } \geq \Delta } } } , \theta ^ { - } = \overline { { \theta | _ { i : \theta _ { i } \leq - \Delta } } } .
|
| 414 |
+
$$
|
| 415 |
+
|
| 416 |
+
This is a straightforward extension of the TWN quantizer (Li & Liu, 2016) that allows different levels for positives and negatives. We find that two rounds of alternating computation in eq. (15) achieves a good performance, which we use in our experiments.
|
| 417 |
+
|
| 418 |
+
# B ADDITIONAL EXPERIMENTAL RESULTS
|
| 419 |
+
|
| 420 |
+
# B.1 TERNARY QUANTIZATION FOR CIFAR-10
|
| 421 |
+
|
| 422 |
+
Our models are ResNets of depth 20, 32, and 44. Ternarized training is initialized at pre-trained full-precision nets. We perform a hard quantization $\theta \mapsto { \mathsf { q } } ( \theta )$ at epoch 400 and keeps training till the600-th epoch to stabilize the BatchNorm layers.
|
| 423 |
+
|
| 424 |
+
Table 3: Top-1 classification error of ternarized ResNets on CIFAR-10. Performance is reported in mean(std) over 4 runs, where for PQ-T we report in addition the best of 4 (Bo4).
|
| 425 |
+
|
| 426 |
+
<table><tr><td>Model (Bits)</td><td>FP (32)</td><td>TTQ (2)</td><td>PQ-T (ours) (2)</td><td>PQ-T (ours, Bo4) (2)</td></tr><tr><td>ResNet-20</td><td>8.06</td><td>8.87</td><td>8.40 (0.13)</td><td>8.22</td></tr><tr><td>ResNet-32</td><td>7.25</td><td>7.63</td><td>7.65 (0.15)</td><td>7.53</td></tr><tr><td>ResNet-44</td><td>6.96</td><td>7.02</td><td>7.05 (0.08)</td><td>6.98</td></tr></table>
|
| 427 |
+
|
| 428 |
+
Result The top-1 classification errors for ternary quantization are reported in Table 3. Our results are comparable with the reported results of TTQ,3 and the best performance of our method over 4 runs (from the same initialization) is slightly better than TTQ.
|
| 429 |
+
|
| 430 |
+
# C SIGN CHANGE EXPERIMENT
|
| 431 |
+
|
| 432 |
+
We experimentally compare the training dynamics of PROXQUANT-Binary and BinaryConnect through the sign change metric. The sign change metric between any $\theta _ { 1 }$ and $\theta _ { 2 }$ is the proportion of their different signs, i.e. the (rescaled) Hamming distance:
|
| 433 |
+
|
| 434 |
+
$$
|
| 435 |
+
\mathsf { S i g n C h a n g e } ( \theta _ { 1 } , \theta _ { 2 } ) = \frac { \| \mathrm { s i g n } ( \theta _ { 1 } ) - \mathrm { s i g n } ( \theta _ { 2 } ) \| _ { 1 } } { 2 d } \in [ 0 , 1 ] .
|
| 436 |
+
$$
|
| 437 |
+
|
| 438 |
+
In $\mathbb { R } ^ { d }$ , the space of all full-precision parameters, the sign change is a natural distance metric that represents the closeness of the binarization of two parameters.
|
| 439 |
+
|
| 440 |
+

|
| 441 |
+
Figure 3: SignChange $( \theta _ { 0 } , \theta _ { t } )$ against $t$ (epoch) for BinaryConnect and PROXQUANT, over 4 runs starting from the same full-precision ResNet-20. PROXQUANT has significantly lower sign changes than BinaryConnect while converging to better models. (a) The first conv layer of size $\bar { 1 6 } \times 3 \times 3 \times 3$ ; (b) The last conv layer of size $6 4 \times 6 4 \times 3 \times 3$ ; (c) The fully connected layer of size $6 4 \times 1 0$ ; (d) The validation top-1 error of the binarized nets (with moving average smoothing).
|
| 442 |
+
|
| 443 |
+
Recall in our CIFAR-10 experiments (Section 4.1), for both BinaryConnect and PROXQUANT, we initialize at a good full-precision net $\theta _ { 0 }$ and stop at a converged binary network $\widehat { \theta } \in \{ \pm 1 \} ^ { d }$ . We are interested in SignChange $( \theta _ { 0 } , \theta _ { t } )$ along the training path, as well as SignChange $( \theta _ { 0 } , { \widehat { \theta } } )$ , i.e. the distance of the final output model to the initialization.
|
| 444 |
+
|
| 445 |
+
Our finding is that PROXQUANT produces binary nets with both lower sign changes and higher performances, compared with BinaryConnect. Put differently, around the warm start, there is a good binary net nearby which can be found by PROXQUANT but not BinaryConnect, suggesting that BinaryConnect, and in general the straight-through gradient method, suffers from higher optimization instability than PROXQUANT. This finding is consistent in all layers, across different warm starts, and across differnent runs from each same warm start (see Figure 3 and Table 4 in Appendix C.1). This result here is also consistent with Theorem 5.3: the signs in BinaryConnect never stop changing until we manually freeze the signs at epoch 400.
|
| 446 |
+
|
| 447 |
+
# C.1 RAW DATA FOR SIGN CHANGE EXPERIMENT
|
| 448 |
+
|
| 449 |
+
Table 4: Performances and sign changes on ResNet-20 in mean(std) over 3 full-precision initializations and 4 runs per (initialization x method). Sign changes are computed over all quantized parameters in the net.
|
| 450 |
+
|
| 451 |
+
<table><tr><td rowspan=1 colspan=1>Initialization</td><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>Top-1 Error(%)</td><td rowspan=1 colspan=1>Sign change</td></tr><tr><td rowspan=2 colspan=1>FP-Net 1(8.06)</td><td rowspan=1 colspan=1>BC</td><td rowspan=1 colspan=1>9.489(0.223)</td><td rowspan=1 colspan=1>0.3833(0.006)</td></tr><tr><td rowspan=1 colspan=1>PQ-B</td><td rowspan=1 colspan=1>9.146(0.212)</td><td rowspan=1 colspan=1>0.276(0.020)</td></tr><tr><td rowspan=2 colspan=1>FP-Net 2(8.31)</td><td rowspan=1 colspan=1>BC</td><td rowspan=1 colspan=1>9.745(0.422)</td><td rowspan=1 colspan=1>0.381(0.004)</td></tr><tr><td rowspan=1 colspan=1>PQ-B</td><td rowspan=1 colspan=1>9.444(0.067)</td><td rowspan=1 colspan=1>0.288(0.002)</td></tr><tr><td rowspan=2 colspan=1>FP-Net 3(7.73)</td><td rowspan=1 colspan=1>BC</td><td rowspan=1 colspan=1>9.383(0.211)</td><td rowspan=1 colspan=1>0.359(0.001)</td></tr><tr><td rowspan=1 colspan=1>PQ-B</td><td rowspan=1 colspan=1>9.084(0.241)</td><td rowspan=1 colspan=1>0.275(0.001)</td></tr></table>
|
| 452 |
+
|
| 453 |
+
Table 5: Performances and sign changes on ResNet-20 in raw data over 3 full-precision initializations and 4 runs per (initialization x method). Sign changes are computed over all quantized parameters in the net.
|
| 454 |
+
|
| 455 |
+
<table><tr><td rowspan=1 colspan=1>Initialization</td><td rowspan=1 colspan=1>Method</td><td rowspan=1 colspan=1>Top-1 Error(%)</td><td rowspan=1 colspan=1>Sign change</td></tr><tr><td rowspan=2 colspan=1>FP-Net 1(8.06)</td><td rowspan=1 colspan=1>BC</td><td rowspan=1 colspan=1>9.664,9.430, 9.198,9.663</td><td rowspan=1 colspan=1>0.386,0.377, 0.390,0.381</td></tr><tr><td rowspan=1 colspan=1>PQ-B</td><td rowspan=1 colspan=1>9.058, 8.901, 9.388,9.237</td><td rowspan=1 colspan=1>0.288,0.247, 0.284,0.285</td></tr><tr><td rowspan=2 colspan=1>FP-Net 2(8.31)</td><td rowspan=1 colspan=1>BC</td><td rowspan=1 colspan=1>9.456,9.530,,9.623,10.370</td><td rowspan=1 colspan=1>0.376,0.379,0.382,0.386</td></tr><tr><td rowspan=1 colspan=1>PQ-B</td><td rowspan=1 colspan=1>9.522,9.474,9.410,9.370</td><td rowspan=1 colspan=1>0.291,0.287,0.289,0.287</td></tr><tr><td rowspan=2 colspan=1>FP-Net 3(7.73)</td><td rowspan=1 colspan=1>BC</td><td rowspan=1 colspan=1>9.107, 9.558, 9.538,9.328</td><td rowspan=1 colspan=1>0.360,0.357,0.359,0.360</td></tr><tr><td rowspan=1 colspan=1>PQ-B</td><td rowspan=1 colspan=1>9.284,8.866, 9.301, 8.884</td><td rowspan=1 colspan=1>0.275,,0.276, 0.276, 0.275</td></tr></table>
|
| 456 |
+
|
| 457 |
+
# D PROOFS OF THEORETICAL RESULTS
|
| 458 |
+
|
| 459 |
+
# D.1 PROOF OF THEOREM 5.1
|
| 460 |
+
|
| 461 |
+
Recall that a function $f : { \mathbb { R } ^ { d } } \to { \mathbb { R } }$ is said to be $\beta$ -smooth if it is differentiable and $\nabla f$ is $\beta$ -Lipschitz: for all $x , y \in \mathbb { R } ^ { d }$ we have
|
| 462 |
+
|
| 463 |
+
$$
|
| 464 |
+
\begin{array} { r } { \| \nabla f ( x ) - \nabla f ( y ) \| _ { 2 } \leq \beta \| x - y \| _ { 2 } . } \end{array}
|
| 465 |
+
$$
|
| 466 |
+
|
| 467 |
+
For any $\beta$ -smooth function, it satisfies the bound
|
| 468 |
+
|
| 469 |
+
$$
|
| 470 |
+
f ( \boldsymbol { y } ) \leq f ( \boldsymbol { x } ) + \left. \nabla f ( \boldsymbol { x } ) , \boldsymbol { y } - \boldsymbol { x } \right. + \frac { \beta } { 2 } \left. \boldsymbol { x } - \boldsymbol { y } \right. _ { 2 } ^ { 2 } \mathrm { f o r } \mathrm { a l l } \boldsymbol { x } , \boldsymbol { y } \in \mathbb { R } ^ { d } .
|
| 471 |
+
$$
|
| 472 |
+
|
| 473 |
+
Convergence results like Theorem 5.1 are standard in the literature of proximal algorithms, where we have convergence to stataionarity without convexity on either $L$ or $R$ but assuming smoothness. For completeness we provide a proof below. Note that though the convergence is ergodic, the best index $T _ { \mathrm { b e s t } }$ can be obtained in practice via monitoring the proximity $\lVert { \boldsymbol { \theta } } _ { t } - { \boldsymbol { \theta } } _ { t - 1 } \rVert _ { 2 }$ .
|
| 474 |
+
|
| 475 |
+
# Proof of Theorem 5.1 Recall the ProxQuant iterate
|
| 476 |
+
|
| 477 |
+
$$
|
| 478 |
+
\theta _ { t + 1 } = \underset { \theta \in \mathbb { R } ^ { d } } { \arg \operatorname* { m i n } } \left\{ L ( \theta _ { t } ) + \langle \theta - \theta _ { t } , \nabla L ( \theta _ { t } ) \rangle + \frac { 1 } { 2 \eta } \left. \theta - \theta _ { t } \right. _ { 2 } ^ { 2 } + \lambda R ( \theta ) \right\} .
|
| 479 |
+
$$
|
| 480 |
+
|
| 481 |
+
By the fact that $\theta _ { t + 1 }$ minimizes the above objective and applying the smoothness of $L$ , we get that
|
| 482 |
+
|
| 483 |
+
$$
|
| 484 |
+
\begin{array} { l } { \displaystyle { F _ { \lambda } ( { \boldsymbol { \theta } } _ { t } ) = L ( { \boldsymbol { \theta } } _ { t } ) + \lambda R ( { \boldsymbol { \theta } } _ { t } ) \geq L ( { \boldsymbol { \theta } } _ { t } ) + \langle { \boldsymbol { \theta } } _ { t + 1 } - { \boldsymbol { \theta } } _ { t } , \nabla L ( { \boldsymbol { \theta } } _ { t } ) \rangle + \frac { 1 } { 2 \eta } \left\| { \boldsymbol { \theta } } _ { t + 1 } - { \boldsymbol { \theta } } _ { t } \right\| _ { 2 } ^ { 2 } + \lambda R ( { \boldsymbol { \theta } } _ { t + 1 } ) } } \\ { \displaystyle \geq L ( { \boldsymbol { \theta } } _ { t + 1 } ) + \left( \frac { 1 } { 2 \eta } - \frac { \beta } { 2 } \right) \left\| { \boldsymbol { \theta } } _ { t + 1 } - { \boldsymbol { \theta } } _ { t } \right\| _ { 2 } ^ { 2 } + \lambda R ( { \boldsymbol { \theta } } _ { t + 1 } ) = { F _ { \lambda } } ( { \boldsymbol { \theta } } _ { t + 1 } ) + \frac { \beta } { 2 } \left\| { \boldsymbol { \theta } } _ { t + 1 } - { \boldsymbol { \theta } } _ { t } \right\| _ { 2 } ^ { 2 } . } \end{array}
|
| 485 |
+
$$
|
| 486 |
+
|
| 487 |
+
Telescoping the above bound for $t = 0 , \ldots , T - 1$ , we get that
|
| 488 |
+
|
| 489 |
+
$$
|
| 490 |
+
\sum _ { t = 0 } ^ { T - 1 } \| \theta _ { t + 1 } - \theta _ { t } \| _ { 2 } ^ { 2 } \leq \frac { 2 ( F _ { \lambda } ( \theta _ { 0 } ) - F _ { \lambda } ( \theta _ { T } ) ) } { \beta } \leq \frac { 2 ( F _ { \lambda } ( \theta _ { 0 } ) - F _ { \star } ) } { \beta } .
|
| 491 |
+
$$
|
| 492 |
+
|
| 493 |
+
Therefore we have the proximity guarantee
|
| 494 |
+
|
| 495 |
+
$$
|
| 496 |
+
\operatorname* { m i n } _ { 0 \leq t \leq T - 1 } \| \theta _ { t + 1 } - \theta _ { t } \| _ { 2 } ^ { 2 } \leq \frac { 2 ( F _ { \lambda } ( \theta _ { 0 } ) - F _ { \star } ) } { \beta T } .
|
| 497 |
+
$$
|
| 498 |
+
|
| 499 |
+
We now turn this into a stationarity guarantee. The first-order optimality condition for $\theta _ { t + 1 }$ gives
|
| 500 |
+
|
| 501 |
+
$$
|
| 502 |
+
\nabla L ( \theta _ { t } ) + \frac { 1 } { \eta } ( \theta _ { t + 1 } - \theta _ { t } ) + \lambda \nabla R ( \theta _ { t + 1 } ) = 0 .
|
| 503 |
+
$$
|
| 504 |
+
|
| 505 |
+
Combining the above equality and the smoothness of $L$ , we get
|
| 506 |
+
|
| 507 |
+
$$
|
| 508 |
+
\begin{array} { l } { \displaystyle \| \nabla F _ { \lambda } ( \theta _ { t + 1 } ) \| _ { 2 } = \| \nabla L ( \theta _ { t + 1 } ) + \lambda \nabla R ( \theta _ { t + 1 } ) \| _ { 2 } = \left\| \frac { 1 } { \eta } ( \theta _ { t } - \theta _ { t + 1 } ) + \nabla L ( \theta _ { t + 1 } ) - \nabla L ( \theta _ { t } ) \right\| _ { 2 } } \\ { \displaystyle \le \left( \frac { 1 } { \eta } + \beta \right) \| \theta _ { t + 1 } - \theta _ { t } \| _ { 2 } = 3 \beta \| \theta _ { t + 1 } - \theta _ { t } \| _ { 2 } . } \end{array}
|
| 509 |
+
$$
|
| 510 |
+
|
| 511 |
+
Choosing $t = T _ { \mathrm { b e s t } } - 1$ and applying the proximity guarantee eq. (17), we get
|
| 512 |
+
|
| 513 |
+
$$
|
| 514 |
+
| \nabla F _ { \lambda } ( \theta _ { T _ { \mathrm { b e s t } } } ) \| _ { 2 } ^ { 2 } \leq 9 \beta ^ { 2 } \left\| \theta _ { T _ { \mathrm { b e s t } } } - \theta _ { T _ { \mathrm { b e s t } } - 1 } \right\| _ { 2 } ^ { 2 } = 9 \beta ^ { 2 } \operatorname* { m i n } _ { 0 \leq t \leq T - 1 } \left\| \theta _ { t + 1 } - \theta _ { t } \right\| _ { 2 } ^ { 2 } \leq \frac { 1 8 \beta ( F _ { \lambda } ( \theta _ { 0 } ) - F _ { \star } ) } { T } .
|
| 515 |
+
$$
|
| 516 |
+
|
| 517 |
+
This is the desired bound.
|
| 518 |
+
|
| 519 |
+
# D.2 PROOF OF THEOREM 5.2
|
| 520 |
+
|
| 521 |
+
Let our loss function $L : \mathbb { R } \mathbb { R }$ be the quadratic $L ( \theta ) = { \textstyle { \frac { 1 } { 2 } } } \theta ^ { 2 }$ (so that $L$ is $\beta$ -smooth with $\beta = 1$ ). Let the regularizer $R : \mathbb { R } \overset { \vartriangle } { \Rightarrow } \mathbb { R }$ be a smoothed version of the W-shaped regularizer in eq. (3), defined as (for $\epsilon \in ( 0 , 1 / 2 ]$ being the smoothing radius)
|
| 522 |
+
|
| 523 |
+
$$
|
| 524 |
+
R ( \theta ) = \left\{ \begin{array} { l l } { \displaystyle - \frac { 1 } { 2 \epsilon } \theta ^ { 2 } + 1 - \epsilon , \quad } & { \quad \theta \in [ 0 , \epsilon ) } \\ { \displaystyle - \theta + 1 - \frac { \epsilon } { 2 } , \quad } & { \quad \theta \in [ \epsilon , 1 - \epsilon ) } \\ { \displaystyle \frac { 1 } { 2 \epsilon } ( \theta - 1 ) ^ { 2 } , \quad } & { \quad \theta \in [ 1 - \epsilon , 1 + \epsilon ) } \\ { \displaystyle \theta - 1 - \frac { \epsilon } { 2 } , \quad } & { \quad \theta \in [ 1 + \epsilon , \infty ) } \end{array} \right.
|
| 525 |
+
$$
|
| 526 |
+
|
| 527 |
+

|
| 528 |
+
Figure 4
|
| 529 |
+
|
| 530 |
+
and $R ( - \theta ) = R ( \theta )$ for the negative part. See Figure 4 for an illustration of the loss $L$ and the regularizer $R$ (with $\epsilon = 0 . 2$ ).
|
| 531 |
+
|
| 532 |
+
It is straightforward to see that $R$ is piecewise quadratic and differentiable on $\mathbb { R }$ by computing the derivatives at $\epsilon$ and $1 \pm \epsilon$ . Further, by elementary calculus, we can evaluate the prox operator in closed form: for all $\lambda \geq 1$ , we have
|
| 533 |
+
|
| 534 |
+
$$
|
| 535 |
+
\operatorname { p r o x } _ { \lambda R } ( \theta ) = { \frac { \epsilon \theta + \lambda \operatorname { s i g n } ( \theta ) } { \epsilon + \lambda \operatorname { s i g n } ( \theta ) } } \operatorname { f o r } \mathrm { a l l } | \theta | \leq 1 .
|
| 536 |
+
$$
|
| 537 |
+
|
| 538 |
+
Now, suppose we run the lazy prox-gradient method with constant stepsize $\begin{array} { r } { \eta _ { t } \equiv \eta \le \frac { 1 } { 2 \beta } = \frac { 1 } { 2 } } \end{array}$ . For the specific initialization
|
| 539 |
+
|
| 540 |
+
$$
|
| 541 |
+
\theta _ { 0 } = \frac { \eta \lambda } { 2 \lambda + ( 2 - \eta ) \epsilon } \in ( 0 , 1 ) ,
|
| 542 |
+
$$
|
| 543 |
+
|
| 544 |
+
we have the equality $\begin{array} { r } { \mathrm { p r o x } _ { \lambda R } ( \theta _ { 0 } ) = \frac { 2 } { \eta } \theta _ { 0 } } \end{array}$ and therefore the next lazy prox-gradient iterate is
|
| 545 |
+
|
| 546 |
+
$$
|
| 547 |
+
\theta _ { 1 } = \theta _ { 0 } - \eta \nabla L ( \mathrm { p r o x } _ { \lambda R } ( \theta _ { 0 } ) ) = \theta _ { 0 } - \eta \nabla L \left( \frac { 2 } { \eta } \theta _ { 0 } \right) = \theta _ { 0 } - \eta \cdot \frac { 2 } { \eta } \theta _ { 0 } = - \theta _ { 0 } .
|
| 548 |
+
$$
|
| 549 |
+
|
| 550 |
+
As both $R$ and $L$ are even functions, a symmetric argument holds for $\theta _ { 1 }$ from which we get $\theta _ { 2 } =$ $- \theta _ { 1 } = \theta _ { 0 }$ . Therefore the lazy prox-gradient method ends up oscillating between two points:
|
| 551 |
+
|
| 552 |
+
$$
|
| 553 |
+
\begin{array} { r } { \theta _ { t } = ( - 1 ) ^ { t } \theta _ { 0 } . } \end{array}
|
| 554 |
+
$$
|
| 555 |
+
|
| 556 |
+
On the other hand, it is straightforward to check that the only stationary points of $L ( \theta ) + \lambda R ( \theta )$ are 0 and $\pm \frac { \lambda } { \epsilon + \lambda }$ , all not equal to $\pm \theta _ { 0 }$ . Therefore the sequence $\{ \theta _ { t } \} _ { t \ge 0 }$ does not have a subsequence with vanishing gradient and thus does not approach stationarity in the ergodic sense. □
|
| 557 |
+
|
| 558 |
+
# D.3 PROOF OF THEOREM 5.3
|
| 559 |
+
|
| 560 |
+
We start with the $\ " \Rightarrow \ "$ direction. If $s$ is a fixed point, then by definition there exists $\theta _ { 0 } \in \mathbb { R } ^ { d }$ such that $\theta _ { t } = \theta$ for all $t = 0 , 1 , 2 , \ldots$ By the iterates eq. (14)
|
| 561 |
+
|
| 562 |
+
$$
|
| 563 |
+
\theta _ { T } = \theta _ { 0 } - \sum _ { t = 0 } ^ { T } \eta _ { t } \nabla L ( s _ { t } ) .
|
| 564 |
+
$$
|
| 565 |
+
|
| 566 |
+
Take signs on both sides and apply $s _ { t } = s$ for all $t$ on both sides, we get that
|
| 567 |
+
|
| 568 |
+
$$
|
| 569 |
+
s = s _ { T } = \mathrm { s i g n } ( \theta _ { T } ) = \mathrm { s i g n } \left( \theta _ { 0 } - \nabla L ( s ) \sum _ { t = 0 } ^ { T } \eta _ { t } \right)
|
| 570 |
+
$$
|
| 571 |
+
|
| 572 |
+
Take the limit $T \to \infty$ and apply the assumption that $\textstyle \sum _ { t } \eta _ { t } = \infty$ , we get that for all $i \in [ d ]$ such that $[ \nabla L ( \theta ) ] _ { i } \neq 0$ ,
|
| 573 |
+
|
| 574 |
+
$$
|
| 575 |
+
\boldsymbol s [ i ] = \operatorname* { l i m } _ { T \infty } \mathrm { s i g n } ( \theta _ { 0 } - \boldsymbol \nabla L ( \boldsymbol s ) \sum _ { t = 0 } ^ { T } \eta _ { t } ) [ i ] = - \mathrm { s i g n } ( \boldsymbol \nabla L ( \boldsymbol s ) ) [ i ] .
|
| 576 |
+
$$
|
| 577 |
+
|
| 578 |
+
Now we prove the $" \Leftarrow 2 ^ { , 3 }$ direction. If $\theta$ obeys that $\mathrm { s i g n } ( \nabla L ( s ) [ i ] ) = - s [ i ]$ for all $i \in [ d ]$ such that $\nabla L ( s ) [ i ] \ \neq \ 0$ , then if we take any $\theta _ { 0 }$ such that $\mathrm { s i g n } ( \theta _ { 0 } ) = s .$ , $\theta _ { t }$ will move in a straight line towards the direction of $- \nabla L ( s )$ , which does not change the sign of $h _ { 0 }$ . In other words, $s _ { t } = \mathrm { s i g n } ( \theta _ { t } ) = \mathrm { s i g n } ( \theta _ { 0 } ) = s$ for all $t = 0 , 1 , 2 , \ldots$ Therefore, by definition, $s$ is a fixed point.
|
md/train/IXexLXymbZ9/IXexLXymbZ9.md
ADDED
|
@@ -0,0 +1,516 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# VICReg: Variance-Invariance-Covariance Regularization for Self-Supervised Learning
|
| 2 |
+
|
| 3 |
+
Anonymous Author(s)
|
| 4 |
+
Affiliation
|
| 5 |
+
Address
|
| 6 |
+
email
|
| 7 |
+
|
| 8 |
+
# Abstract
|
| 9 |
+
|
| 10 |
+
Recent self-supervised methods for image representation learning maximize the agreement between embedding vectors produced by encoders fed with different views of the same image. The main challenge is to prevent a collapse in which the encoders produce constant or non-informative vectors. We introduce VICReg (Variance-Invariance-Covariance Regularization), a method that explicitly avoids the collapse problem with two regularizations terms applied to both embeddings separately: (1) a term that maintains the variance of each embedding dimension above a threshold, (2) a term that decorrelates each pair of variables. Unlike most other approaches to the same problem, VICReg does not require techniques such as: weight sharing between the branches, batch normalization, feature-wise normalization, output quantization, stop gradient, memory banks, etc., and achieves results on par with the state of the art on several downstream tasks. In addition, we show that our variance regularization term stabilizes the training of other methods and leads to performance improvements.
|
| 11 |
+
|
| 12 |
+
# 15 1 Introduction
|
| 13 |
+
|
| 14 |
+
16 Self-supervised representation learning has made significant progress over the last years, almost
|
| 15 |
+
17 reaching the performance of supervised baselines on many downstream tasks [1, 2, 3, 4, 5, 6, 7, 8, 9].
|
| 16 |
+
18 Several recent approaches rely on a joint embedding architecture in which two networks are trained to
|
| 17 |
+
19 produce similar embeddings for different views of the same image. A popular instance is the Siamese
|
| 18 |
+
20 network architecture [10], where the two networks share the same weights. The main challenge with
|
| 19 |
+
21 joint embedding architectures is to prevent a collapse in which the two branches ignore the inputs and
|
| 20 |
+
22 produce identical output vectors. There are two main approaches to preventing collapse: contrastive
|
| 21 |
+
23 methods and information maximization methods. Contrastive methods [3, 11, 12] use a loss that
|
| 22 |
+
24 explicitly pushes the embeddings of dissimilar images away from each other. They often require a
|
| 23 |
+
25 mining procedure to search for offending dissimilar samples from a memory bank [3] or from the
|
| 24 |
+
26 current batch [12]. Contrastive methods tend to be costly, require large batch sizes or memory banks,
|
| 25 |
+
27 and do not seem to scale well with the dimension of the embedding. Quantization-based approaches
|
| 26 |
+
28 [5, 13] force the embeddings of different samples to belong to different clusters on the unit sphere.
|
| 27 |
+
29 Collapse is prevented by ensuring that the assignment of samples to clusters is as uniform as possible.
|
| 28 |
+
30 A similarity term encourages the cluster assignment score vectors from the two branches to be
|
| 29 |
+
31 similar. More recently, a few methods have appeared that do not rely on contrastive samples or vector
|
| 30 |
+
32 quantization, yet produce high-quality representations, for example BYOL [6] and SimSiam [7].
|
| 31 |
+
33 They exploit several tricks: batch-wise or feature-wise normalization, a "momentum encoder" in
|
| 32 |
+
34 which the parameter vector of one branch is a low-pass-filtered version of the parameter vector of the
|
| 33 |
+
35 other branch [6, 14], or a stop-gradient operation in one of the branches [7]. The dynamics of learning
|
| 34 |
+
36 in these methods, and how they avoid collapse, is not fully understood, although theoretical and
|
| 35 |
+
37 empirical studies point to the crucial importance of batch-wise or feature-wise normalization [14, 15].
|
| 36 |
+
38 Finally, an alternative class of collapse prevention methods relies on maximizing the information
|
| 37 |
+
39 content of the embedding [9, 16]. These methods prevent informational collapse by decorrelating
|
| 38 |
+
40 every pair of variables of the embedding vectors. This indirectly maximizes the information content
|
| 39 |
+
41 of the embedding vectors. The Barlow Twins method drives the normalized cross-correlation matrix
|
| 40 |
+
42 of the two embeddings towards the identity [9], while the Whitening-MSE method whitens and
|
| 41 |
+
43 spreads out the embedding vectors on the unit sphere [16].
|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
Figure 1: VICReg: joint embedding architecture with variance, invariance and covariance regularization. Given a batch of images $I$ , two batches of different views $X$ and $X ^ { \prime }$ are produced and are then encoded into representations $Y$ and $Y ^ { \prime }$ . The representations are fed to an expander producing the embeddings $Z$ and $Z ^ { \prime }$ . The distance between two embeddings from the same image is minimized, the variance of each embedding variable over a batch is maintained above a threshold, and the covariance between pairs of embedding variables over a batch are attracted to zero, decorrelating the variables from each other. Although the two branches do not require identical architectures nor share weights, in most of our experiments, they are Siamese with shared weights: the encoders are ResNet-50 backbones with output dimension 2048. The expanders have 3 fully-connected layers of size 8192.
|
| 45 |
+
|
| 46 |
+
# 44 2 VICReg: intuition
|
| 47 |
+
|
| 48 |
+
45 We introduce VICReg (Variance-Invariance-Covariance Regularization), a self-supervised method for
|
| 49 |
+
46 training joint embedding architectures based on the principle of preserving the information content of
|
| 50 |
+
47 the embeddings. The basic idea is to use a loss function with three terms:
|
| 51 |
+
|
| 52 |
+
• Invariance: the mean square distance between the embedding vectors.
|
| 53 |
+
• Variance: a hinge loss to maintain the standard deviation (over a batch) of each variable of the embedding above a given threshold. This term forces the embedding vectors of samples within a batch to be different.
|
| 54 |
+
Covariance: a term that attracts the covariances (over a batch) between every pair of (centered) embedding variables towards zero. This term decorrelates the variables of each embedding and prevents an informational collapse in which the variables would vary together or be highly correlated.
|
| 55 |
+
|
| 56 |
+
56 Variance and Covariance terms are applied to both branches of the architecture separately, thereby
|
| 57 |
+
57 preserving the information content of each embedding at a certain level and preventing informational
|
| 58 |
+
58 collapse independently for the two branches. The main contribution of this paper is the Variance
|
| 59 |
+
59 preservation term, which explicitly prevents a collapse due to a shrinkage of the embedding vectors
|
| 60 |
+
60 towards zero. The Covariance criterion is borrowed from the Barlow Twins method and prevents
|
| 61 |
+
61 informational collapse due to redundancy between the embedding variables [9]. VICReg is more
|
| 62 |
+
62 generally applicable than most of the aforementioned methods because of fewer constraints on the
|
| 63 |
+
63 architecture. In particular, VICReg:
|
| 64 |
+
|
| 65 |
+
• does not require that the weights of the two branches be shared, not that the architectures be identical, nor that the inputs be of the same nature;
|
| 66 |
+
• does not require a memory bank, nor contrastive samples, nor a large batch size;
|
| 67 |
+
• does not require batch-wise nor feature-wise normalization; and
|
| 68 |
+
• does not require vector quantization nor a predictor module.
|
| 69 |
+
|
| 70 |
+
69 Other methods require asymmetric stop gradient operations, as in SimSiam [7], weight sharing
|
| 71 |
+
70 between the two branches as in classical Siamese nets, or weight sharing through exponential moving
|
| 72 |
+
71 average dampening with stop gradient in one branch, as in BYOL and MoCo [3, 6, 17], large batches
|
| 73 |
+
72 of contrastive samples, as in SimCLR [12], or batch-wise and/or feature-wise normalization [5, 6, 7,
|
| 74 |
+
73 9, 16]. One of the most interesting feature of VICReg is the fact that the two branches are not required
|
| 75 |
+
74 to share the same parameters, architecture, or input modality. This opens the door to the use of
|
| 76 |
+
75 non-contrastive self-supervised joint-embedding for multi-modal signals, such as video and audio. We
|
| 77 |
+
76 demonstrate the effectiveness of the proposed approach by evaluating the representations learned with
|
| 78 |
+
77 VICReg on several downstream image recognition tasks including linear head and semi-supervised
|
| 79 |
+
78 evaluation protocols for image classification on ImageNet [18], and other classification, detection
|
| 80 |
+
79 and instance segmentation tasks. Furthermore, we show that incorporating variance preservation
|
| 81 |
+
80 into other self-supervised joint-embedding methods yields better training stability and performance
|
| 82 |
+
81 improvement on downstream tasks. More generally, we show that VICReg is an explicit and effective,
|
| 83 |
+
82 yet simple method for preventing collapse in self-supervised joint-embedding learning.
|
| 84 |
+
|
| 85 |
+
# 83 3 Related work
|
| 86 |
+
|
| 87 |
+
84 Contrastive learning. In contrastive SSL methods applied to joint embedding architectures, the
|
| 88 |
+
85 output embeddings for a sample and its distorted version are brought close to each other, while
|
| 89 |
+
86 other samples and their distortions are pushed away. The method is most often applied to Siamese
|
| 90 |
+
87 architectures in which the two branches have identical architectures and share weights [2, 3, 10, 11,
|
| 91 |
+
88 12, 17, 19, 20, 21, 22, 23]. Many authors use the InfoNCE loss [22] in which the repulsive force
|
| 92 |
+
89 is larger for contrastive samples that are closer to the reference. While these methods yield good
|
| 93 |
+
90 performance, they require large amounts of contrastive pairs in order to work well. These contrastive
|
| 94 |
+
91 pairs can be sampled from a memory bank as in MoCo [3], or given by the current batch of data as in
|
| 95 |
+
92 SimCLR [12], with a significant memory footprint. This downside of contrastive methods motivates
|
| 96 |
+
93 a search for alternatives.
|
| 97 |
+
94 Clustering methods. Instead of viewing each sample as its own class, clustering-based methods
|
| 98 |
+
95 group them into clusters based on some similarity measure [5, 13, 24, 25, 26, 27, 28, 29, 30, 31].
|
| 99 |
+
96 DeepCluster [13] uses $k$ -means assignments of representations from previous iterations as pseudo
|
| 100 |
+
97 labels for the new representations, which requires an expensive clustering phase done asynchronously,
|
| 101 |
+
98 and makes the method hard to scale up. SwAV [5] mitigates this issue by learning the clusters online
|
| 102 |
+
99 while maintaining a balanced partition of the assignments through the Sinkhorn-Knopp transform [32].
|
| 103 |
+
100 These clustering approaches can be viewed as contrastive learning at the level of clusters which still
|
| 104 |
+
101 requires a lot of negative comparisons to work well.
|
| 105 |
+
102 Distillation methods. Recent proposals such as BYOL, SimSiam, OBoW and variants [6, 7, 8, 14,
|
| 106 |
+
103 33] have shown that collapse can be avoided by using architectural tricks inspired by knowledge
|
| 107 |
+
104 distillation [34]. These methods train a student network to predict the representations of a teacher
|
| 108 |
+
105 network, for which the weights are a running average of the student network’s weights [6], or
|
| 109 |
+
106 are shared with the student network, but no gradient is back-propagated through the teacher [7].
|
| 110 |
+
107 These methods are effective, but there is no clear understanding of how t but suffer from a lack of
|
| 111 |
+
108 explainability regarding the way collapsing solutions are avoided. Alternatively, the images can be
|
| 112 |
+
109 represented as bags of word over a dictionary of visual features, which effectively prevents collapse.
|
| 113 |
+
110 In [33] and [8] the dictionary is obtained by off-line or on-line clustering. By contrast, our method
|
| 114 |
+
111 explicitly prevents collapse in the two branches independently, which removes the requirement for
|
| 115 |
+
112 shared weights and identical architecture, opening the door to the application of joint-embedding
|
| 116 |
+
113 SSL to multi-modal signals.
|
| 117 |
+
114 Information maximization methods. A principle to prevent collapse is to maximize the information
|
| 118 |
+
115 content of the embeddings. Two such methods were recently proposed: W-MSE [16] and Barlow
|
| 119 |
+
116 Twins [9]. In W-MSE, an extra module transforms the embeddings into the eigenspace of their
|
| 120 |
+
117 covariance matrix (whitening or Karhunen-Loève transform), and forces the vectors thereby obtained
|
| 121 |
+
118 to be uniformly distributed on the unit sphere. In Barlow Twins, a loss term attempts to make the
|
| 122 |
+
119 normalized cross-correlation matrix of the embedding vectors from the two branches to be close to
|
| 123 |
+
120 the identity. Both methods attempt to produce embedding variables that are decorrelated from each
|
| 124 |
+
121 other, thus preventing an informational collapse in which the variables carry redundant information.
|
| 125 |
+
122 Because all variables are normalized over a batch, there is no incentive for them to shrink nor expand.
|
| 126 |
+
123 This seems to sufficient to prevent collapse. Our method borrows the decorrelation mechanism of
|
| 127 |
+
124 Barlow Twins. But it includes an explicit variance-preservation term for each variable of the two
|
| 128 |
+
125 embeddings and thus does not require any normalization.
|
| 129 |
+
127 VICReg follows recent trends in self-supervised learning [5, 6, 7, 9, 12] and is based on a joint
|
| 130 |
+
128 embedding architecture. Contrary to many previous approaches, our architecture may be completely
|
| 131 |
+
129 symmetric or completely asymmetric with no shared structure or parameters between the two branches.
|
| 132 |
+
130 In most of our experiments, we use a Siamese net architecture in which the two branches are identical
|
| 133 |
+
131 and share weights. Each branch consists of an encoder $f _ { \theta }$ that outputs the representations (used for
|
| 134 |
+
132 downstream tasks), followed by an expander $h _ { \phi }$ that maps the representations into an embedding
|
| 135 |
+
133 space where the loss function will be computed. The role of the expander is twofold: (1) eliminate
|
| 136 |
+
134 the information by which the two representations differ, (2) expand the dimension in a non-linear
|
| 137 |
+
135 fashion so that decorrelating the embedding variables will reduce the dependencies (not just the
|
| 138 |
+
136 correlations) between the variables of the representation vector. The loss function uses a term $s$ that
|
| 139 |
+
137 learns invariance to data transformations and is regularized with a variance term $v$ that prevents norm
|
| 140 |
+
138 collapse and a covariance term $c$ that prevents informational collapse by decorrelating the different
|
| 141 |
+
139 dimensions of the vectors. After pretraining, the expander is discarded and the representations of the
|
| 142 |
+
140 encoder are used for downstream tasks.
|
| 143 |
+
|
| 144 |
+
# 141 4.1 Method
|
| 145 |
+
|
| 146 |
+
142 Given an image $i$ sampled from a dataset $\mathcal { D }$ , two transformations $t$ and $t ^ { \prime }$ are sampled from a
|
| 147 |
+
143 distribution $\tau$ to produce two different views $x = t ( i )$ and $x ^ { \prime } = t ^ { \prime } ( i )$ of $i$ . These transformations
|
| 148 |
+
144 are random crops of the image, followed by color distortions. The distribution $\tau$ is described in
|
| 149 |
+
145 Appendix C. The views $x$ and $x ^ { \prime }$ are first encoded by $f _ { \theta }$ into their representations $y = f _ { \boldsymbol { \theta } } ( \boldsymbol { x } )$ and
|
| 150 |
+
146 $y ^ { \prime } \stackrel { \cdot } { = } f _ { \theta } ( x ^ { \prime } )$ , which are then mapped by the expander $h _ { \phi }$ onto the embeddings $z = h _ { \phi } ( y )$ and
|
| 151 |
+
147 $\bar { z } ^ { \prime } = \bar { h _ { \phi } } ( \dot { y } ^ { \prime } )$ . The loss is computed at the embedding level on $z$ and $z ^ { \prime }$ .
|
| 152 |
+
148 We describe here the variance, invariance and covariance terms that compose our loss function. The
|
| 153 |
+
149 images are processed in batches, and we denote $Z = [ z _ { 1 } , \dots , z _ { n } ]$ and $Z ^ { \prime } = [ z _ { 1 } ^ { \prime } , \dots , z _ { n } ^ { \prime } ]$ the two
|
| 154 |
+
150 batches composed of $n$ vectors of dimension $d$ , of embeddings coming out of the two branches of
|
| 155 |
+
151 the siamese architecture. We denote by $z ^ { j }$ the vector composed of each value at dimension $j$ in
|
| 156 |
+
152 all vectors in $Z$ . We define the variance regularization term $v$ as a hinge function on the standard
|
| 157 |
+
153 deviation of the embeddings along the batch dimension:
|
| 158 |
+
|
| 159 |
+
$$
|
| 160 |
+
v ( Z ) = \frac { 1 } { d } \sum _ { j = 1 } ^ { d } \operatorname* { m a x } ( 0 , \gamma - S ( z ^ { j } , \epsilon ) ) ,
|
| 161 |
+
$$
|
| 162 |
+
|
| 163 |
+
154 where $S$ is the regularized standard deviation defined by:
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
S ( x , \epsilon ) = \sqrt { \mathrm { V a r } ( x ) + \epsilon } ,
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
155 $\gamma$ is a constant target value for the standard deviation, fixed to 1 in our experiments, $\epsilon$ is a small
|
| 170 |
+
156 scalar preventing numerical instabilities. This criterion encourages the variance inside the current
|
| 171 |
+
157 batch to be equal to $\gamma$ along each dimension, preventing collapse with all the inputs mapped on the
|
| 172 |
+
158 same vector. Using the standard deviation and not directly the variance is crucial. Indeed, if we take
|
| 173 |
+
159 $S ( x ) = \mathrm { V a r } ( x )$ in the hinge function, the gradient of $S$ with respect to $x$ becomes close to 0 when $x$
|
| 174 |
+
160 is close to $\bar { x }$ . In this case, the gradient of $v$ also becomes close to 0 and the embeddings collapse. We
|
| 175 |
+
161 define the covariance matrix of $Z$ as:
|
| 176 |
+
|
| 177 |
+
$$
|
| 178 |
+
C ( Z ) = \frac { 1 } { n - 1 } \sum _ { i = 1 } ^ { n } ( z _ { i } - \bar { z } ) ( z _ { i } - \bar { z } ) ^ { T } , \mathrm { w h e r e } \bar { z } = \frac { 1 } { n } \sum _ { i = 1 } ^ { n } z _ { i } .
|
| 179 |
+
$$
|
| 180 |
+
|
| 181 |
+
162 Inspired by Barlow Twins [9], we can then define the covariance regularization term $c$ as the sum of
|
| 182 |
+
163 the squared off-diagonal coefficients of $C ( Z )$ , with a factor $1 / d$ that scales the criterion as a function
|
| 183 |
+
164 of the dimension:
|
| 184 |
+
|
| 185 |
+
$$
|
| 186 |
+
c ( Z ) = \frac { 1 } { d } \sum _ { i \neq j } [ C ( Z ) ] _ { i , j } ^ { 2 } .
|
| 187 |
+
$$
|
| 188 |
+
|
| 189 |
+
165 This term encourages the off-diagonal coefficients of $C ( Z )$ to be close to 0, decorrelating the different
|
| 190 |
+
166 dimensions of the embeddings and preventing them from encoding similar information. Decorrelation
|
| 191 |
+
167 at the embedding level ultimately has a decorrelation effect at the representation level, which is a
|
| 192 |
+
168 non trivial phenomenon that we study in Appendix D. We finally define the invariance criterion $s$
|
| 193 |
+
|
| 194 |
+
between 169 $Z$ and $Z ^ { \prime }$ as the mean-squared euclidean distance between each pair of vectors, without any 170 normalization:
|
| 195 |
+
|
| 196 |
+
$$
|
| 197 |
+
s ( Z , Z ^ { \prime } ) = \frac { 1 } { n } \sum _ { i } \| z _ { i } - z _ { i } ^ { \prime } \| _ { 2 } ^ { 2 } .
|
| 198 |
+
$$
|
| 199 |
+
|
| 200 |
+
171 The overall loss function is a weighted average of the invariance, variance and covariance terms:
|
| 201 |
+
|
| 202 |
+
$$
|
| 203 |
+
\ell ( Z , Z ^ { \prime } ) = \lambda s ( Z , Z ^ { \prime } ) + \mu [ v ( Z ) + v ( Z ^ { \prime } ) ] + \nu [ c ( Z ) + c ( Z ^ { \prime } ) ] ,
|
| 204 |
+
$$
|
| 205 |
+
|
| 206 |
+
172 where $\lambda , \mu$ and $\nu$ are hyper-parameters controlling the importance of each term in the loss. In our
|
| 207 |
+
173 experiments, we set $\nu = 1$ and perform a grid search on the values of $\lambda$ and $\mu$ with the base condition
|
| 208 |
+
174 $\lambda \overset { = } { = } \mu > 1$ . The overall objective function taken on all images over an unlabelled dataset $\mathcal { D }$ is given
|
| 209 |
+
175 by:
|
| 210 |
+
|
| 211 |
+
$$
|
| 212 |
+
\mathcal { L } = \sum _ { I \in \mathcal { D } } \sum _ { t , t ^ { \prime } \sim \mathcal { T } } \ell ( Z ^ { I } , Z ^ { \prime I } ) ,
|
| 213 |
+
$$
|
| 214 |
+
|
| 215 |
+
where 76 $Z ^ { I }$ and $Z ^ { \prime I }$ are the batches of embeddings corresponding to the batch of images $I$ transformed by 7 $t$ and $t ^ { \prime }$ . The objective is minimized for several epochs, over the encoder parameters $\theta$ and 8 expander parameters $\phi$ . We illustrate the architecture and loss function of VICReg in Figure 1.
|
| 216 |
+
|
| 217 |
+
# 4.2 Implementation details
|
| 218 |
+
|
| 219 |
+
181 Implementation details for pretraining with VI
|
| 220 |
+
182 CReg on the 1000-classes ImagetNet1 dataset
|
| 221 |
+
183 without labels are as follows. Coefficients $\lambda$ and
|
| 222 |
+
184 $\mu$ are 25 and $\nu$ is 1 in Eq. (6), and $\epsilon$ is 0.0001
|
| 223 |
+
185 in Eq. (1). The encoder network $f _ { \theta }$ is a stan
|
| 224 |
+
186 dard ResNet-50 backbone [35] with 2048 output
|
| 225 |
+
187 units. The expander $h _ { \phi }$ is composed of two
|
| 226 |
+
188 fully-connected layers with batch normalization
|
| 227 |
+
189 (BN) [36] and ReLU, and a third linear layer.
|
| 228 |
+
190 The sizes of all 3 layers were set to 8192. As
|
| 229 |
+
191 with Barlow Twins, performance improves when
|
| 230 |
+
192 the size of the expander layers is larger than the
|
| 231 |
+
193 dimension of the representation. The impact
|
| 232 |
+
194 of the expander dimension on performance is
|
| 233 |
+
195 studied in Appendix D. The training protocol fol
|
| 234 |
+
196 lows those of BYOL and Barlow Twins: LARS
|
| 235 |
+
197 optimizer [37, 38] run for 1000 epochs with a
|
| 236 |
+
|
| 237 |
+
# Algorithm 1: VICReg pseudocode.
|
| 238 |
+
|
| 239 |
+

|
| 240 |
+
|
| 241 |
+
weight decay of $1 \bar { 0 } ^ { - 6 }$ and a learning rate $l r = b a t c h \_ s i z e / 2 5 6 \times b a s e \_ l r$ , where batch_size is set to 2048 by default and base_lr is a base learning rate set to 0.2. The learning rate follows a cosine decay schedule [39], starting from 0 with 10 warmup epochs and with final value of 0.002.
|
| 242 |
+
|
| 243 |
+
# 5 Results
|
| 244 |
+
|
| 245 |
+
In this section, we evaluate the representations obtained after self-supervised pretraining of a ResNet50 [35] backbone with VICReg during 1000 epochs, on the training set of ImageNet, using the training protocol described in section 4.
|
| 246 |
+
|
| 247 |
+
# 5.1 Evaluation on ImageNet
|
| 248 |
+
|
| 249 |
+
Following the ImageNet [18] linear evaluation protocol, we train a linear classifier on top of the frozen representations of the ResNet-50 backbone pretrained with VICReg. We also evaluate the performance of the backbone when fine-tuned with a linear classifier on a subset of ImageNet’s training set using $1 \%$ or $10 \%$ of the labels, using the split of [12]. We give implementation details about the optimization procedure for these tasks in Appendix C. We have applied the training procedure described in section 4 with three different random initialization. The numbers reported in Table 1 for VICReg are the mean scores, and we have observed that the difference between worse and best run is lower than $0 . 1 \%$ accuracy for linear classification, which shows that VICReg is a
|
| 250 |
+
|
| 251 |
+
Table 1: Evaluation on ImageNet. Evaluation of the representations obtained with a ResNet-50 backbone pretrained with VICReg on: (1) linear classification on top of the frozen representations from ImageNet; (2) semi-supervised classification on top of the fine-tuned representations from $1 \%$ and $1 \%$ of ImageNet samples. We report Top-1 and Top-5 accuracies (in $\%$ ). Top-3 best self-supervised methods are underlined.
|
| 252 |
+
|
| 253 |
+
<table><tr><td rowspan="3">Method</td><td colspan="2">Linear Classification</td><td colspan="4">Semi-supervised Classification</td></tr><tr><td rowspan="2">Top-1</td><td rowspan="2">Top-5</td><td colspan="2">Top-1</td><td colspan="2">Top-5</td></tr><tr><td>1%</td><td>10%</td><td>1%</td><td>10%</td></tr><tr><td>Supervised</td><td>76.5</td><td></td><td>25.4</td><td>56.4</td><td>48.4</td><td>80.4</td></tr><tr><td>MoCo [3]</td><td>60.6</td><td></td><td>=</td><td>=</td><td>=</td><td></td></tr><tr><td>PIRL [2]</td><td>63.6</td><td></td><td></td><td></td><td>57.2</td><td>83.8</td></tr><tr><td>CPC v2 [40]</td><td>63.8</td><td></td><td></td><td></td><td>-</td><td>=</td></tr><tr><td>CMC[41]</td><td>66.2</td><td>=</td><td>=</td><td>=</td><td>=</td><td>=</td></tr><tr><td>SimCLR[12]</td><td>69.3</td><td>89.0</td><td>48.3</td><td>65.6</td><td>75.5</td><td>87.8</td></tr><tr><td>MoCo v2 [17]</td><td>71.1</td><td>-</td><td></td><td>1</td><td>-</td><td>=</td></tr><tr><td>SimSiam[7]</td><td>71.3</td><td>-</td><td></td><td>=</td><td>=</td><td>=</td></tr><tr><td>SwAV[5]</td><td>71.8</td><td>1</td><td></td><td></td><td></td><td></td></tr><tr><td>InfoMin Aug [4]</td><td>73.0</td><td>91.1</td><td></td><td></td><td>=</td><td></td></tr><tr><td>OBoW[8]</td><td>73.8</td><td></td><td></td><td>=</td><td>82.9</td><td>90.7</td></tr><tr><td>BYOL [6]</td><td>74.3</td><td>91.6</td><td>53.2</td><td>68.8</td><td>78.4</td><td>89.0</td></tr><tr><td>SwAV (w/ multi-crop) [5]</td><td>75.3</td><td>1</td><td>53.9</td><td>70.2</td><td>78.5</td><td>89.9</td></tr><tr><td>Barlow Twins [9]</td><td>73.2</td><td>91.0</td><td>55.0</td><td>69.7</td><td>79.2</td><td>89.3</td></tr><tr><td>VICReg (ours)</td><td>73.2</td><td>91.1</td><td>54.8</td><td>69.5</td><td>79.4</td><td>89.5</td></tr></table>
|
| 254 |
+
|
| 255 |
+
214 very stable algorithm. Lack of time has prevented us from doing the same for the semi-supervised
|
| 256 |
+
215 classification experiments, and the experiments of section 5.2 and 6, but we expect similar conclusion
|
| 257 |
+
216 to hold. We compare in Table 1 our results on both tasks against other methods on the validation
|
| 258 |
+
217 set of ImageNet. The performance of VICReg is on par with the state of the art without using the
|
| 259 |
+
218 negative pairs of SimCLR, the clusters of SwAV, the bag-of-words representations of OBoW, or
|
| 260 |
+
219 any asymmetric networks architectural tricks such as the momentum encoder of BYOL and the
|
| 261 |
+
220 stop-gradient operation of SimSiam. The performance is comparable to that of Barlow Twins, which
|
| 262 |
+
221 shows that VICReg’s more explicit way of constraining the variance and comparing views has
|
| 263 |
+
222 the same power than maximizing cross-correlations between pairs of twin dimensions. The main
|
| 264 |
+
223 advantage of VICReg is the modularity of its objective function and the potential applicability to
|
| 265 |
+
224 multi-modal setups.
|
| 266 |
+
|
| 267 |
+
# 5.2 Transfer to other downstream tasks
|
| 268 |
+
|
| 269 |
+
Following the setup from [2], we train a linear classifier on top of the frozen representations learnt by our pretrained ResNet-50 backbone on a variety of different datasets: the Places205 [42] scene classification dataset, the VOC07 [43] multi-label image classification dataset and the iNaturalist2018 [44] fine-grained image classification dataset2. We then evaluate the quality of the representations by transferring to other vision tasks including $\mathrm { \ V O C { 0 7 + 1 2 } }$ [43] object detection using Faster R-CNN [45] with a R50-C4 backbone, and COCO [46] instance segmentation using Mask-R-CNN [47] with a R50-FPN backbone. We give implementation details in Appendix C. We report the performance in Table 2, VICReg performs on par with most concurrent methods, and better than Barlow Twins, across all classification tasks, but is slightly behind the top-3 on detection tasks. This could be explained by the fact that VICReg learns representations that are more invariant to transformation, but eliminates more low-level information about the images than the other methods.
|
| 270 |
+
|
| 271 |
+
# 6 Ablation study
|
| 272 |
+
|
| 273 |
+
In this section we study how the different components of our method contribute to its performance, as well as how they interact with components from other self-supervised methods. All reported
|
| 274 |
+
|
| 275 |
+
Table 2: Transfer learning on downstream tasks. Evaluation of the representations from a ResNet50 backbone pretrained with VICReg on: (1) linear classification tasks on top of frozen representations, we report Top-1 accuracy (in $\%$ ) for Places205 [42] and iNat18 [44], and mAP for VOC07 [43]; (2) object detection with fine-tunning, we report $\mathrm { { A P } _ { 5 0 } }$ for $\mathrm { \Delta V O C 0 7 } { + } 1 2$ using Faster R-CNN with C4 backbone [45]; (3) object detection and instance segmentation, we report AP for COCO [46] using Mask R-CNN with FPN backbone [47]. We use $\dagger$ to denote the experiments run by us. Top-3 best self-supervised methods are underlined.
|
| 276 |
+
|
| 277 |
+
<table><tr><td></td><td colspan="3">Linear Classification</td><td colspan="3">Object Detection</td></tr><tr><td>Method</td><td>Places205</td><td>VOC07</td><td>iNat18</td><td>VOC07+12</td><td>COCO det COCO seg</td><td></td></tr><tr><td>Supervised</td><td>53.2</td><td>87.5</td><td>46.7</td><td>81.3</td><td>39.0</td><td>35.4</td></tr><tr><td>MoCo [3]</td><td>46.9</td><td>79.8</td><td>31.5</td><td></td><td>1</td><td>=</td></tr><tr><td>PIRL [2]</td><td>49.8</td><td>81.1</td><td>34.1</td><td></td><td>=</td><td>1</td></tr><tr><td>SimCLR[12]</td><td>52.5</td><td>85.5</td><td>37.2</td><td>=</td><td>1</td><td>1</td></tr><tr><td>MoCo v2[17]</td><td>51.8</td><td>86.4</td><td>38.6</td><td>82.5</td><td>39.8</td><td>36.1</td></tr><tr><td>SimSiam[7]</td><td>1</td><td>=</td><td>=</td><td>82.4</td><td>=</td><td>=</td></tr><tr><td>BYOL[6]</td><td>54.0</td><td>86.6</td><td>47.6</td><td>1</td><td>40.4t</td><td>37.0t</td></tr><tr><td>SwAV (w/ multi-crop) [5]</td><td>56.7</td><td>88.9</td><td>48.6</td><td>82.6</td><td>41.6</td><td>37.8</td></tr><tr><td>OBoW[8]</td><td>56.8</td><td>89.3</td><td>1</td><td>82.9</td><td>1</td><td>1</td></tr><tr><td>Barlow Twins [6]</td><td>54.1</td><td>86.2</td><td>46.5</td><td>82.6</td><td>40.0t</td><td>36.7†</td></tr><tr><td>VICReg (ours)</td><td>54.3</td><td>86.6</td><td>47.0</td><td>82.4</td><td>39.4</td><td>36.4</td></tr></table>
|
| 278 |
+
|
| 279 |
+
240 results are obtained on the linear evaluation protocol using a ResNet-50 backbone and 100 epochs of
|
| 280 |
+
241 pretraining, which gives results consistent with those obtained with 1000 epochs of pretraining. The
|
| 281 |
+
242 optimization setting used for each experiment is described in Appendix C.
|
| 282 |
+
243 Asymmetric networks. We study the impact of different components used in asymmetric architec
|
| 283 |
+
244 tures and the effects of adding variance and covariance regularization, in terms of performance and
|
| 284 |
+
245 training stability. Starting from a simple symmetric architecture with an encoder and an expander
|
| 285 |
+
246 without batch normalization, which correspond to VICReg without batch normalization in the ex
|
| 286 |
+
247 pander, we progressively add batch normalization in the inner layers of the expander, a predictor,
|
| 287 |
+
248 a stop-gradient operation and a momentum encoder. We use the training protocol and architecture
|
| 288 |
+
249 of SimSiam [7] when a stop-gradient is used and the training protocol and architecture of BYOL
|
| 289 |
+
250 [6] when a momentum encoder is used. The predictor as used in SimSiam and BYOL is a learnable
|
| 290 |
+
251 module $g _ { \psi }$ that predicts the embedding of a view given the embedding of the other view of the same
|
| 291 |
+
252 image. If $z$ and $z ^ { \prime }$ are the embeddings of two views of an image, then $p = g _ { \psi } ( z )$ and $p ^ { \prime } = g _ { \psi } ( z ^ { \prime } )$
|
| 292 |
+
253 are the predictions of each view. The invariance loss function of Eq. (5) is now computed between a
|
| 293 |
+
254 batch of embeddings $Z = [ z _ { 1 } , \ldots , z _ { n } ]$ and the corresponding batch of predictions $\bar { P } = [ p _ { 1 } ^ { \prime } , \ldots , p _ { n } ^ { \prime } ]$ ,
|
| 294 |
+
255 then symmetrized:
|
| 295 |
+
|
| 296 |
+
$$
|
| 297 |
+
s ( Z , Z ^ { \prime } , P , P ^ { \prime } ) = \frac { 1 } { 2 n } \sum _ { i } D ( z _ { i } - p _ { i } ^ { \prime } ) + \frac { 1 } { 2 n } \sum _ { i } D ( z _ { i } ^ { \prime } - p _ { i } ) ,
|
| 298 |
+
$$
|
| 299 |
+
|
| 300 |
+
256 where $D$ is a distance function that depends on the method used. BYOL uses the mean square error
|
| 301 |
+
257 between $l _ { 2 }$ -normalized vectors, SimSiam uses the negative cosine similarity loss and VICReg uses
|
| 302 |
+
258 the mean square error without $l _ { 2 }$ -normalization. The variance and covariance terms are regularizing
|
| 303 |
+
259 the output $Z$ and $Z ^ { \prime }$ of the expander, which we empirically found to work better than regularizing
|
| 304 |
+
260 the output of the predictor. We compare different settings in Table 3, based on the default data
|
| 305 |
+
261 augmentation, optimization and architecture settings of the original BYOL, SimSiam and VICReg
|
| 306 |
+
262 methods. In all settings, the absence of BN indicates that BN is also removed in the predictor when
|
| 307 |
+
263 one is used.
|
| 308 |
+
264 We analyse first the impact of variance regularization (VR) in the different settings. When using VR,
|
| 309 |
+
265 adding a predictor (PR) to VICReg does not lead to a significant change of the performance, which
|
| 310 |
+
266 indicates that PR is redundant with VR. In comparison, without VR, the representations collapse, and
|
| 311 |
+
267 both stop-gradient (SG) and PR are necessary. Batch normalization in the inner layers of the expander
|
| 312 |
+
268 (BN) in VICReg leads to a $1 . 0 \%$ increase in the performance, which is not a big improvement
|
| 313 |
+
269 considering that SG and PR without BN is performing very poorly at $3 5 . 1 \%$ .
|
| 314 |
+
270 Finally, incorporating VR with SG or ME further improves the performance by small margins of
|
| 315 |
+
271 respectively $0 . 2 \%$ and $0 . 9 \%$ , which might be explained by the fact that these architectural tricks that
|
| 316 |
+
272 prevent collapse are not perfectly maintaining the variance of the representations, i.e. very slow
|
| 317 |
+
273 collapse is happening with these methods. We explain this intuition by studying the evolution of the
|
| 318 |
+
274 standard deviation of the representations during pretraining for BYOL and SimSiam in Appendix D.
|
| 319 |
+
275 We then analyse the impact of adding additional covariance regularization (CR) in the different
|
| 320 |
+
276 settings, along with variance regularization. We found that optimization with SG and CR is hard,
|
| 321 |
+
277 even if our analysis of the average correlation coefficient of the representations during pretraining
|
| 322 |
+
278 in Appendix D shows that both fulfill the same objective. The performance of BYOL and SimSiam
|
| 323 |
+
279 slightly drops compared to VR only, except when PR is removed, where SG becomes useless.
|
| 324 |
+
280 BN is still useful and improves the performance by $1 . 3 \%$ . Finally with CR, PR does not harm
|
| 325 |
+
281 the performance and even improves it by a very small margin. VICReg+PR with 1000 epochs of
|
| 326 |
+
282 pretraining exactly matches the score of VICReg ( $7 3 . 2 \%$ on linear classification).
|
| 327 |
+
283 Weight sharing. Contrary to most self-supervised learn
|
| 328 |
+
284 ing approaches based on Siamese architectures, VICReg
|
| 329 |
+
285 has several unique properties: (1) weights do not need to
|
| 330 |
+
286 be shared between the branches, each branch’s weights are
|
| 331 |
+
287 updated independently of the other branch’s weights; (2)
|
| 332 |
+
288 the branches are regularized independently, the variance
|
| 333 |
+
289 and covariance terms are computed on each branch indi
|
| 334 |
+
290 vidually; (3) no predictor is necessary unlike with methods
|
| 335 |
+
291 where one branch predicts outputs of the other branch. Ta
|
| 336 |
+
292 ble 4 shows results on ImageNet using the standard linear
|
| 337 |
+
293 protocol for situations where the weights of the encoder
|
| 338 |
+
294 and the expander are shared or not. In all settings, there
|
| 339 |
+
295 is no collapse and the performance is competitive. The
|
| 340 |
+
296 slight drop in accuracy without sharing is likely due to the
|
| 341 |
+
297 increased number of parameters. Importantly, the ability
|
| 342 |
+
298 of VICReg to function with different parameters, ar
|
| 343 |
+
|
| 344 |
+
Table 3: Effect of incorporating variance and covariance regularization in different methods. Top-1 ImageNet accuracy with the linear evaluation protocol after 100 pretraining epochs. For all methods, pretraining follows the architecture, the optimization and the data augmentation protocol of the original method using our reimplementation. ME: Momentum Encoder. SG: stop-gradient. PR: predictor. BN: Batch normalization layers after input and inner linear layers in the expander. No Reg: No additional regularization. Var Reg: Variance regularization. Var/Cov Reg: Variance and Covariance regularization. Unmodified original setups are marked by a $\dagger$ .
|
| 345 |
+
|
| 346 |
+
<table><tr><td>Method</td><td>ME</td><td>SG</td><td>PR</td><td>BN</td><td>No Reg</td><td>Var Reg</td><td>Var/Cov Reg</td></tr><tr><td>BYOL</td><td>√</td><td><</td><td>√</td><td>√</td><td>69.3t</td><td>70.2</td><td>69.5</td></tr><tr><td>SimSiam</td><td></td><td><v></td><td></td><td>√</td><td>67.9†</td><td>68.1</td><td>67.6</td></tr><tr><td>SimSiam</td><td></td><td></td><td>·</td><td></td><td>35.1</td><td>67.3</td><td>67.1</td></tr><tr><td>SimSiam</td><td></td><td></td><td></td><td></td><td>collapse</td><td>56.8</td><td>66.1</td></tr><tr><td>VICReg</td><td></td><td></td><td></td><td></td><td>collapse</td><td>56.2</td><td>67.3</td></tr><tr><td>VICReg</td><td></td><td></td><td>?</td><td>√</td><td>collapse</td><td>57.1</td><td>68.7</td></tr><tr><td>VICReg</td><td></td><td></td><td></td><td>√</td><td>collapse</td><td>57.5</td><td>68.6†</td></tr><tr><td>VICReg</td><td></td><td></td><td></td><td></td><td>collapse</td><td>56.5</td><td>67.4</td></tr></table>
|
| 347 |
+
|
| 348 |
+
Table 4: Impact of sharing weights or not between branches. Top-1 accuracy on linear classification with 100 pretraining epochs. In all settings, the encoder and expander of both branches share the same architecture, but either share weights $( \checkmark )$ , or have different weights in the two branches.
|
| 349 |
+
|
| 350 |
+
<table><tr><td>Encoder</td><td>Expander</td><td>Top-1</td></tr><tr><td></td><td></td><td>66.5</td></tr><tr><td></td><td>√</td><td>67.3</td></tr><tr><td>?</td><td></td><td>67.8</td></tr><tr><td></td><td>√</td><td>68.6</td></tr></table>
|
| 351 |
+
|
| 352 |
+
99 chitectures, and input modalities for the branches widens the applicability to joint-embedding 0 SSL to many applications, including multi-modal signals.
|
| 353 |
+
|
| 354 |
+
Loss function coefficients. Table 5 reports the performance for various values of the loss term coefficients in Eq. (6). Without variance regularization the representations immediately collapse to a single vector and the covariance term, which has no repulsive effect preventing collapse, has no impact. The invariance term is absolutely necessary and without it the network can not learn any good representations. By simply using the invariance term and variance regularization, which is a very simple baseline, VICReg still reaches an accuracy of $5 7 . 5 \%$ . These results show that variance and covariance regularizations have complementary effects.
|
| 355 |
+
|
| 356 |
+
Table 5: Impact of variance-covariance regularization. Inv: a invariance loss is used, $\lambda > 0$ , Var: variance regularization, $\mu > 0$ , Cov: covariance regularization, $\nu > 0$ , in Eq. (6).
|
| 357 |
+
|
| 358 |
+
<table><tr><td>Method</td><td>入</td><td>μ</td><td>V</td><td>Top-1</td></tr><tr><td>Inv</td><td>1</td><td>0</td><td>0</td><td>collapse</td></tr><tr><td>Inv + Cov</td><td>25</td><td>0</td><td>1</td><td>collapse</td></tr><tr><td>Inv + Cov</td><td>0</td><td>25</td><td>1</td><td>collapse</td></tr><tr><td>Inv +Var</td><td>1</td><td>1</td><td>0</td><td>57.5</td></tr><tr><td>Inv + Var + Cov (VICReg)</td><td>25</td><td>25</td><td>1</td><td>68.6</td></tr></table>
|
| 359 |
+
|
| 360 |
+
Table 6: Impact of normalization. Std: variables are centered and divided by their standard deviation over the batch. This is applied or not to the embedding and the expander hidden layers. $l _ { 2 }$ : the embedding vectors are $l _ { 2 }$ -normalized.
|
| 361 |
+
|
| 362 |
+
<table><tr><td>Expander</td><td>Embedding</td><td>Top-1</td></tr><tr><td>Std</td><td>None</td><td>68.6</td></tr><tr><td>Std</td><td>Std</td><td>68.4</td></tr><tr><td>None</td><td>None</td><td>67.4</td></tr><tr><td>None</td><td>Std</td><td>67.2</td></tr><tr><td>Std</td><td>l2</td><td>65.1</td></tr></table>
|
| 363 |
+
|
| 364 |
+
308 Normalizations. VICReg is the first self-supervised method for joint-embedding architectures
|
| 365 |
+
309 we are aware of that does not require normalization. Contrary to SimSiam, W-MSE, SwAV and
|
| 366 |
+
310 BYOL, and others, the embedding vectors are not projected on the unit sphere. Contrary to Barlow
|
| 367 |
+
311 Twins, they are not standardized (equivalent to batch normalization without the adaptive parameters).
|
| 368 |
+
312 Table 6 shows that the best settings do not involve any normalization of the embeddings, whether it
|
| 369 |
+
313 is batch-wise or feature-wise (as in $l _ { 2 }$ normalization). Whenever the embeddings are standardized
|
| 370 |
+
314 (lines 3 and 5 in the table) the covariance matrix of Eq. (3) becomes the normalized auto-correlation
|
| 371 |
+
315 matrix with coefficients between $^ { - 1 }$ and 1. This hurts the accuracy by $1 . 1 \%$ . We observe that when
|
| 372 |
+
316 unconstrained, the coefficients in the covariance matrix take values in a wider range, which seems to
|
| 373 |
+
317 facilitate the training process. Standardization is still an important component that helps stabilize
|
| 374 |
+
318 the training when used in the hidden layers of the expander, and the performance drops by $1 . 2 \%$
|
| 375 |
+
319 when it is removed. Projecting the embeddings on the unit sphere implicitly constrains their standard
|
| 376 |
+
320 deviation along the batch dimension to be $1 / { \sqrt { d } }$ , where $d$ is the dimension of the vectors. We change
|
| 377 |
+
321 the invariance term of Eq. (5) to be the mean square error between $l _ { 2 }$ -normalized vectors, and the
|
| 378 |
+
322 target $\gamma$ in the variance term of Eq. (1) is set to $1 / { \sqrt { d } }$ instead of 1, forcing the standard deviation
|
| 379 |
+
323 to get closer to $1 / { \sqrt { d } }$ , and the vectors to be spread out on the unit sphere. This puts a lot more
|
| 380 |
+
324 constraints on the network and the performance drops by $3 . 5 \%$ .
|
| 381 |
+
|
| 382 |
+
# 7 Discussion
|
| 383 |
+
|
| 384 |
+
We introduced VICReg, a simple approach to self-supervised learning based on a triple objective: learning invariance to different views with a invariance term, avoiding collapse of the representations with a variance preservation term, and maximizing the information content of the representation with a covariance regularization term. VICReg achieves results on par with the state of the art on many downstream tasks, but is not subject to the same limitations as most other methods, particularly because it does not require the embedding branches to be identical or even similar.
|
| 385 |
+
|
| 386 |
+
Limitations. The time and memory costs of VICReg are dominated by the computation of the covariance matrix for each processed batch, which is quadratic in the dimension of the embeddings. Our experimental analysis, which corroborates the analysis of [9], shows that increasing the dimension of the embeddings significantly improves performance. Future work will explore how this quadratic bottleneck can be overcome by different approximation techniques, as well as completely new information maximization approaches based on higher-order statistics, and whether large expander networks are required.
|
| 387 |
+
|
| 388 |
+
339 SwAV [5] introduced multi-crop, a data-augmentation protocol where more than two views are
|
| 389 |
+
340 produced for each image, which improves considerably the performance on downstream tasks. Using
|
| 390 |
+
341 multi-crop with VICReg did not yield any performance improvement and showed signs of overfitting.
|
| 391 |
+
342 More generally, multi-crop does not seem to help VICReg, Barlow Twins [9], SimSiam [7] nor BYOL
|
| 392 |
+
343 [6], but yields performance improvements with SwAV [5], SimCLR [12] and MoCo [3], which might
|
| 393 |
+
344 be related to the fact that these methods are contrastive.
|
| 394 |
+
|
| 395 |
+
Broader impact. This work increases the domain of applicability of self-supervised learning, and may improve the performance on tasks for which labeled data is scarce, visual or otherwise, such as healthcare, environmental protection, material science, and the understanding and translation of rare languages. Using the method described here is not likely to mitigate the usual issues with machine-learning systems due to biases in the data or the model architecture.
|
| 396 |
+
|
| 397 |
+
information across views,” in NeurIPS, 2019. 1 g y g
|
| 398 |
+
[2] I. Misra and L. v. d. Maaten, “Self-supervised learning of pretext-invariant representations,” in CVPR, 2020. 1, 3, 6, 7, 16
|
| 399 |
+
[3] K. He, H. Fan, Y. Wu, S. Xie, and R. Girshick, “Momentum contrast for unsupervised visual representation learning,” in CVPR, 2020. 1, 3, 6, 7, 9, 16
|
| 400 |
+
[4] Y. Tian, C. Sun, B. Poole, D. Krishnan, C. Schmid, and P. Isola, “What makes for good views for contrastive learning,” in NeurIPS, 2020. 1, 6
|
| 401 |
+
[5] M. Caron, I. Misra, J. Mairal, P. Goyal, P. Bojanowski, and A. Joulin, “Unsupervised learning of visual features by contrasting cluster assignments,” in NeurIPS, 2020. 1, 3, 4, 6, 7, 9, 14, 15, 16, 17, 18
|
| 402 |
+
[6] J.-B. Grill, F. Strub, F. Altché, C. Tallec, P. H. Richemond, E. Buchatskaya, C. Doersch, B. A. Pires, Z. D. Guo, M. G. Azar, B. Piot, K. Kavukcuoglu, R. Munos, and M. Valko, “Bootstrap your own latent: A new approach to self-supervised learning,” in NeurIPS, 2020. 1, 3, 4, 6, 7, 9, 14, 15, 16, 17, 18
|
| 403 |
+
[7] X. Chen and K. He, “Exploring simple siamese representation learning,” in CVPR, 2020. 1, 2, 3, 4, 6, 7, 9, 14, 15, 17, 18
|
| 404 |
+
[8] S. Gidaris, A. Bursuc, G. Puy, N. Komodakis, M. Cord, and P. Pérez, “Online bag-of-visualwords generation for unsupervised representation learning,” in CVPR, 2021. 1, 3, 6, 7
|
| 405 |
+
[9] J. Zbontar, L. Jing, I. Misra, Y. LeCun, and S. Deny, “Barlow twins: Self-supervised learning via redundancy reduction,” arXiv preprint arxiv:2103.03230, 2021. 1, 2, 3, 4, 6, 9, 14, 15, 16, 17, 18
|
| 406 |
+
[10] J. Bromley, I. Guyon, Y. LeCun, E. Sackinger, and R. Shah, “Signature verification using a “siamese” time delay neural network,” in NeurIPS, 1994. 1, 3
|
| 407 |
+
[11] R. D. Hjelm, A. Fedorov, S. Lavoie-Marchildon, K. Grewal, A. Trischler, and Y. Bengio, “Learning deep representations by mutual information estimation and maximization,” in ICLR, 2019. 1, 3
|
| 408 |
+
[12] T. Chen, S. Kornblith, M. Norouzi, and G. E. Hinton, “A simple framework for contrastive learning of visual representations,” 2020. 1, 3, 4, 5, 6, 7, 9, 14, 15, 17, 18
|
| 409 |
+
[13] M. Caron, P. Bojanowski, A. Joulin, and M. Douze, “Deep clustering for unsupervised learning,” in ECCV, 2018. 1, 3
|
| 410 |
+
[14] P. H. Richemond, J.-B. Grill, F. Altché, C. Tallec, F. Strub, A. Brock, S. Smith, S. De, R. Pascanu, B. Piot, and M. Valko, “Byol works even without batch statistics,” arXiv preprint arXiv:2010.10241, 2020. 1, 3
|
| 411 |
+
[15] Y. Tian, X. Chen, and S. Ganguli, “Understanding self-supervised learning dynamics without contrastive pairs,” arXiv preprint arXiv:2102.06810, 2021. 1
|
| 412 |
+
[16] A. Ermolov, A. Siarohin, E. Sangineto, and N. Sebe, “Whitening for self-supervised representation learning,” 2021. 1, 2, 3, 14
|
| 413 |
+
[17] X. Chen, H. Fan, R. Girshick, and K. He, “Improved baselines with momentum contrastive learning,” arXiv preprint arXiv:2003.04297, 2020. 3, 6, 7
|
| 414 |
+
[18] J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei, “Imagenet: A large-scale hierarchical image database,” 2009. 3, 5
|
| 415 |
+
[19] R. Hadsell, S. Chopra, and Y. LeCun, “Dimensionality reduction by learning an invariant mapping,” in CVPR, 2006. 3
|
| 416 |
+
[20] M. Ye, X. Zhang, P. C. Yuen, and S.-F. Chang, “Unsupervised embedding learning via invariant and spreading instance feature,” in CVPR, 2019. 3
|
| 417 |
+
[21] Z. Wu, Y. Xiong, S. Yu, , and D. Lin, “Unsupervised feature learning via non-parametric instance discrimination,” in CVPR, 2018. 3, 17, 18
|
| 418 |
+
[22] A. van den Oord, Y. Li, and O. Vinyals, “Representation learning with contrastive predictive coding,” arXiv preprint arXiv:1807.03748, 2018. 3
|
| 419 |
+
[23] T. Chen, S. Kornblith, K. Swersky, M. Norouzi, and G. Hinton, “Big self-supervised models are strong semi-supervised learners,” in NeurIPS, 2020. 3
|
| 420 |
+
|
| 421 |
+
403 [24] M. A. Bautista, A. Sanakoyeu, E. Sutter, and B. Ommer, “Cliquecnn: Deep unsupervised
|
| 422 |
+
404 exemplar learning,” in NeurIPS, 2016. 3
|
| 423 |
+
405 [25] J. Yang, D. Parikh, and D. Batra, “Joint unsupervised learning of deep representations and
|
| 424 |
+
406 image clusters,” in CVPR, 2016. 3
|
| 425 |
+
407 [26] J. Xie, R. Girshick, and A. Farhadi, “Unsupervised deep embedding for clustering analysis,” in
|
| 426 |
+
408 ICML, 2016. 3
|
| 427 |
+
409 [27] J. Huang, Q. D. andShaogang Gong, and X. Zhu, “Unsupervised deep learning by neighbour
|
| 428 |
+
410 hood discovery,” in ICML, 2019. 3
|
| 429 |
+
411 [28] C. Zhuang, A. L. Zhai, and D. Yamins, “Local aggregation for unsupervised learning of visual
|
| 430 |
+
412 embeddings,” in ICCV, 2019. 3, 17, 18
|
| 431 |
+
413 [29] M. Caron, P. Bojanowski, J. Mairal, and A. Joulin, “Unsupervised pre-training of image features
|
| 432 |
+
414 on non-curated data,” in ICCV, 2019. 3
|
| 433 |
+
415 [30] Y. M. Asano, C. Rupprecht, and A. Vedaldi, “Self-labelling via simultaneous clustering and
|
| 434 |
+
416 representation learning,” in ICLR, 2020. 3
|
| 435 |
+
417 [31] X. Yan, I. Misra, A. Gupta, D. Ghadiyaram, and D. Mahajan, “Clusterfit: Improving generaliza
|
| 436 |
+
418 tion of visual representations,” in CVPR, 2020. 3
|
| 437 |
+
419 [32] M. Cuturi, “Sinkhorn distances: Lightspeed computation of optimal transport,” in NeurIPS,
|
| 438 |
+
420 2013. 3
|
| 439 |
+
421 [33] S. Gidaris, A. Bursuc, N. Komodakis, P. Pérez, and M. Cord, “Learning representations by
|
| 440 |
+
422 predicting bags of visual words,” in CVPR, 2020. 3
|
| 441 |
+
423 [34] G. Hinton, O. Vinyals, and J. Dean, “Distilling the knowledge in a neural network,” in NIPS
|
| 442 |
+
424 Deep Learning and Representation Learning Workshop, 2015. 3
|
| 443 |
+
425 [35] K. He, X. Zhang, S. Ren, and J. Sun, “Deep residual learning for image recognition,” in CVPR,
|
| 444 |
+
426 2016. 5, 15
|
| 445 |
+
427 [36] S. Ioffe and C. Szegedy, “Batch normalization: Accelerating deep network training by reducing
|
| 446 |
+
428 internal covariate shift,” in ICML, 2015. 5, 15
|
| 447 |
+
429 [37] Y. You, I. Gitman, and B. Ginsburg, “Large batch training of convolutional networks,” arXiv
|
| 448 |
+
430 preprint arXiv:1708.03888, 2017. 5, 15, 17
|
| 449 |
+
431 [38] P. Goyal, P. Dollár, R. Girshick, P. Noordhuis, L. Wesolowski, A. Kyrola, A. Tulloch, Y. Jia,
|
| 450 |
+
432 and K. He, “Accurate, large minibatch sgd: Training imagenet in 1 hour,” arXiv preprint
|
| 451 |
+
433 arXiv:1706.02677, 2017. 5, 15
|
| 452 |
+
434 [39] I. Loshchilov and F. Hutter, “Sgdr: stochastic gradient descent with warm restarts,” in ICLR,
|
| 453 |
+
435 2017. 5, 15
|
| 454 |
+
436 [40] O. J. Hénaff, A. Srinivas, J. D. Fauw, A. Razavi, C. Doersch, S. M. A. Eslami, and A. van den
|
| 455 |
+
437 Oord, “Data-efficient image recognition with contrastive predictive coding,” in ICML, 2019. 6
|
| 456 |
+
438 [41] Y. Tian, D. Krishnan, , and P. Isola, “Contrastive multiview coding,” arXiv preprint
|
| 457 |
+
439 arXiv:1906.05849v4, 2019. 6
|
| 458 |
+
440 [42] B. Zhou, A. Lapedriza, J. Xiao, A. Torralba, and A. Oliva, “Learning deep features for scene
|
| 459 |
+
441 recognition using places database,” in NeurIPS, 2014. 6, 7, 16
|
| 460 |
+
442 [43] M. Everingham, L. V. Gool, J. W. Christopher K. I. Williams, and A. Zisserman, “The pascal
|
| 461 |
+
443 visual object classes (voc) challenge,” IJCV, 2010. 6, 7, 16
|
| 462 |
+
444 [44] G. V. Horn, O. M. Aodha, Y. Song, Y. Cui, C. Sun, A. Shepard, H. Adam, P. Perona, and
|
| 463 |
+
445 S. Belongie, “The inaturalist species classification and detection dataset,” in CVPR, 2018. 6, 7,
|
| 464 |
+
446 16
|
| 465 |
+
447 [45] S. Ren, K. He, R. Girshick, and J. Sun, “Faster r-cnn: Towards real-time object detection with
|
| 466 |
+
448 region proposal networks,” in NeurIPS, 2015. 6, 7
|
| 467 |
+
449 [46] T.-Y. Lin, M. Maire, S. Belongie, L. Bourdev, R. Girshick, J. Hays, P. Perona, D. Ramanan,
|
| 468 |
+
450 C. L. Zitnick, and P. Dollár, “Microsoft coco: Common objects in context,” in ECCV, 2014. 6, 7
|
| 469 |
+
451 [47] K. He, G. Gkioxari, P. Dollár, and R. Girshick, “Mask r-cnn,” in ICCV, 2017. 6, 7
|
| 470 |
+
452 [48] V. Nair and G. E. Hinton, “Rectified linear units improve restricted boltzmann machines,” in
|
| 471 |
+
453 ICML, 2010. 15
|
| 472 |
+
454 [49] P. Goyal, Q. Duval, J. Reizenstein, M. Leavitt, M. Xu, B. Lefaudeux, M. Singh, V. Reis,
|
| 473 |
+
455 M. Caron, P. Bojanowski, A. Joulin, and I. Misra, “Vissl.” https://github.com/
|
| 474 |
+
456 facebookresearch/vissl, 2021. 16
|
| 475 |
+
457 [50] Y. Wu, A. Kirillov, F. Massa, W.-Y. Lo, and R. Girshick, “Detectron2.” https://github.
|
| 476 |
+
458 com/facebookresearch/detectron2, 2019. 16
|
| 477 |
+
459 [51] R.-E. Fan, K.-W. Chang, C.-J. Hsieh, X.-R. Wang, and C.-J. Lin, “Liblinear: A library for large
|
| 478 |
+
460 linear classification,” JMLR, 2008. 16
|
| 479 |
+
461 [52] S. Zagoruyko and N. Komodakis, “Wide residual networks,” arXiv preprint arXiv:1605.07146,
|
| 480 |
+
462 2016. 17
|
| 481 |
+
463 [53] S. Xie, R. Girshick, P. Dollár, Z. Tu, and K. He, “Aggregated residual transformations for deep
|
| 482 |
+
464 neural networks,” in CVPR, 2017. 17
|
| 483 |
+
465 [54] J. Li, P. Zhou, C. Xiong, and S. C. Hoi, “Prototypical contrastive learning of unsupervised
|
| 484 |
+
466 representations,” in ICLR, 2021. 18
|
| 485 |
+
|
| 486 |
+
1. For all authors...
|
| 487 |
+
|
| 488 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 489 |
+
(b) Did you describe the limitations of your work? [Yes] See Section 7.
|
| 490 |
+
(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 7.
|
| 491 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 492 |
+
|
| 493 |
+
2. If you are including theoretical results...
|
| 494 |
+
|
| 495 |
+
(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]
|
| 496 |
+
|
| 497 |
+
3. If you ran experiments...
|
| 498 |
+
|
| 499 |
+
(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 zip archive in supplementary material.
|
| 500 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] For all experiments, training details are included in Section 4.2 and Appendix C.
|
| 501 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] We discuss running multiple seeds in Section 5.1.
|
| 502 |
+
(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 E.
|
| 503 |
+
|
| 504 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 505 |
+
|
| 506 |
+
(a) If your work uses existing assets, did you cite the creators? [Yes]
|
| 507 |
+
(b) Did you mention the license of the assets? [Yes] See footnotes on pages 5 and 6.
|
| 508 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] Code associated to the main results in the paper.
|
| 509 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A] All used dataset are opensource.
|
| 510 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] All used datasets are publicly available and have been widely used in the research community for many years.
|
| 511 |
+
|
| 512 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 513 |
+
|
| 514 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 515 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 516 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/LwEQnp6CYev/LwEQnp6CYev.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/MXmmuhJYPdU/MXmmuhJYPdU.md
ADDED
|
@@ -0,0 +1,249 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Uncertainty-Driven Loss for Single Image Super-Resolution
|
| 2 |
+
|
| 3 |
+
Qian $\mathbf { N i n g ^ { 1 } }$ , Weisheng $\mathbf { D o n g } ^ { 1 }$ ∗, Xin Li2, Jinjian $\mathbf { W } \mathbf { u } ^ { 1 }$ , Guangming Shi1 1School of Artificial Intelligence, Xidian University, Xi’an 710071, China 2Lane Dep. of CSEE, West Virginia University, Morgantown WV 26506, USA ningqian@stu.xidian.edu.cn, {wsdong,jinjian.wu}@mail.xidian.edu.cn xin.li@mail.wvu.edu, gmshi@xidian.edu.cn
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
In low-level vision such as single image super-resolution (SISR), traditional MSE or $\mathcal { L } _ { 1 }$ loss function treats every pixel equally with the assumption that the importance of all pixels is the same. However, it has been long recognized that texture and edge areas carry more important visual information than smooth areas in photographic images. How to achieve such spatial adaptation in a principled manner has been an open problem in both traditional model-based and modern learning-based approaches toward SISR. In this paper, we propose a new adaptive weighted loss for SISR to train deep networks focusing on challenging situations such as textured and edge pixels with high uncertainty. Specifically, we introduce variance estimation characterizing the uncertainty on a pixel-by-pixel basis into SISR solutions so the targeted pixels in a high-resolution image (mean) and their corresponding uncertainty (variance) can be learned simultaneously. Moreover, uncertainty estimation allows us to leverage conventional wisdom such as sparsity prior for regularizing SISR solutions. Ultimately, pixels with large certainty (e.g., texture and edge pixels) will be prioritized for SISR according to their importance to visual quality. For the first time, we demonstrate that such uncertainty-driven loss can achieve better results than $M S E$ or $\mathcal { L } _ { 1 }$ loss for a wide range of network architectures. Experimental results on three popular SISR networks show that our proposed uncertainty-driven loss has achieved better PSNR performance than traditional loss functions without any increased computation during testing. The code is available at https://see.xidian.edu.cn/faculty/wsdong/Projects/UDL-SR.htm
|
| 8 |
+
|
| 9 |
+
# 1 Introduction
|
| 10 |
+
|
| 11 |
+
Single image super-resolution (SISR) aims at reconstructing high-resolution (HR) images from their corresponding degraded low-resolution (LR) images. Since the publication of super-resolution with convolutional neural network (SRCNN) [1], there has been a flurry of works on deep learning-based approaches toward SISR - e.g., EDSR [2], DPDNN [3], RCAN [4], SAN [5], and MoG-DUN [6]. The unifying theme along this line of research appears to be that deeper, bigger, and more complex networks can achieve improved SISR performance by facilitating the reconstruction of high-frequency details such as textures and edges in photographic images. Such improvement has been achieved by novel network architectures (e.g., skip connections [2]), new attention mechanism (e.g., residue channel attention [4]), and closed-loop supervision [7]. Surprisingly, most of these existing methods have adopted $M S E$ or $\mathcal { L } _ { 1 }$ loss to optimize the parameters of networks.
|
| 12 |
+
|
| 13 |
+
The commonly used practice, such as $M S E$ or $\mathcal { L } _ { 1 }$ loss, treats every pixel equally regardless of whether the pixel is in texture/edge regions or smooth areas. The optimality of such non-adaptive loss function has been questioned in the literature of SISR calling for the proposition of perceptual loss function (e.g., [9]). From a Bayesian perspective, the assumption underlying the $M S E$ or $\bar { \mathcal { L } } _ { 1 }$ loss is that each pixel obeys the independent and identically distribution with the same variance. Taking $\mathcal { L } _ { 1 }$ loss as an example, the likelihood of all pixels in an image can be formulated as
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Illustration of the difference (d) between HR image (b) and SR image (c) reconstructed by EDSR network [2] on dataset Set14 [8]. The image reconstructed by EDSR network is shown in (c) and (d) shows the absolute difference between the HR image and SR image. Best viewed in color.
|
| 17 |
+
|
| 18 |
+
$$
|
| 19 |
+
p ( \pmb { x } \mid \pmb { y } , \pmb { W } ) = \prod _ { l = 1 } ^ { M } c \exp ( - \frac { \vert \vert \pmb { x } ^ { ( l ) } - \pmb { f } ^ { ( W ) } ( \pmb { y } ^ { ( l ) } ) \vert \vert _ { 1 } } { \sigma } ) ,
|
| 20 |
+
$$
|
| 21 |
+
|
| 22 |
+
where $_ { \textbf { \em x } }$ and $\textbf { { y } }$ denote the pair of HR and LR image, $f ^ { ( W ) } ( \cdot )$ denotes an arbitrary SISR network parameterized by $W$ , and $c , \sigma$ denote spatially invariant constants. However, such assumption of stationarity or spatial invariance of image prior model is invalid for photographic images in the real world. For instance, if one compares the ground-truth (HR image) and the SR image reconstructed by EDSR [2] as shown in Fig. 1 (c), it can be observed that texture areas (e.g., hair of baboon) are not restored as good as smooth areas (e.g., nose of baboon). Fig. 1 (d) depicts the absolute difference between the HR image and reconstructed SR image, from which we can observe spatial variation of the difference map. Such observation implies that the uncertainty of texture and edge areas as characterized by the variance is much larger than that in smooth areas. How to address such uncertainty-driven loss for SISR sets up the stage for this paper.
|
| 23 |
+
|
| 24 |
+
In this paper, we propose a new adaptive weighted loss (uncertainty-driven loss) for SISR by assigning texture and edge areas with higher weights during the training process. Unlike previous work of perceptual loss [9] focusing on characterizing content and style consistency, we target at explicitly estimating the variance field underlying the unknown HR image in the first step, which can be exploited as an auxiliary signal for guiding the SISR solution in the second step. A direct consequence of our two-step learning approach is that it delivers not only higher visual quality but also improved objective performance such as PSNR and SSIM. Moreover, uncertainty estimation perspective allows us to easily incorporate existing models such as Jefferey’s prior [10, 11] into the proposed SISR solution. It follows that the network training boils down to two sequential steps in which the variance map is estimated from the first step and serves as the attention signal for the second step. The main technical contributions are summarized as follows.
|
| 25 |
+
|
| 26 |
+
• Uncertainty modeling and estimation. We propose to cast SISR into a Bayesian estimation framework under which SR image (mean) and uncertainty (variance) are derived simultaneously. Unlike previous works in which pixels with large uncertainty are attenuated for high-level vision tasks, we advocate to prioritize them for low-level vision tasks such as SISR.
|
| 27 |
+
Uncertainty-driven loss (UDL). The estimation of variance map facilitates the training of SISR network by dividing it into two steps. In the first step, an estimating sparsity uncertainty (ESU) loss function was derived from the classical Jeffrey’s prior to estimate the variance map. In the second step, the estimated variance map serves as the guidance signal leading to adaptive weighted loss named uncertainty-driven loss ${ \mathcal { L } } _ { \mathrm { U D L } }$ .
|
| 28 |
+
Universality of UDL. The proposed uncertainty loss can easily be employed in any existing SISR network to improve performance and do not increase any additional computation cost during testing.
|
| 29 |
+
• Experimental results on three different baseline networks show that our proposed uncertaintydriven loss has achieved better PSNR performance than traditional $M S E$ or $\mathcal { L } _ { 1 }$ loss.
|
| 30 |
+
|
| 31 |
+
# 2 Related Work
|
| 32 |
+
|
| 33 |
+
# 2.1 Uncertainty in Deep Learning
|
| 34 |
+
|
| 35 |
+
Many works [12–14] have introduced uncertainty into the regression with input-dependent noises problems, and studied the nature and behavior of uncertainty for a long time. More recently, modeling uncertainty in deep learning have improved the performance and robustness of deep networks in many computer vision tasks [15–17] such as image classification [18], image segmentation [15, 16], and face recognition [17, 19]. The uncertainty in deep learning can be roughly divided into two categories [20]. Epistemic/model uncertainty describes how much the model is uncertain about its predictions. Another type is aleatoric/data uncertainty which refers to noise inherent in observation data. In [15], they presented a Bayesian deep learning framework combining aleatoric uncertainty with epistemic uncertainty for per-pixel semantic segmentation and depth regression tasks. Chang et al.[17] investigated the data uncertainty with estimated mean and variance in face recognition. Those uncertainty-based loss function proposed by those works [15–17] can be summarized as
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\mathcal { L } = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \frac { | | \pmb { x } _ { i } - \pmb { f } ( \pmb { y } _ { i } ) | | _ { 2 } } { 2 \sigma _ { i } ^ { 2 } } + \frac { 1 } { 2 } \ln \sigma _ { i } ^ { 2 } ,
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
where $f ( \pmb { y } _ { i } )$ and $\sigma _ { i } ^ { 2 }$ denote the learned mean and variance respectively. Using above loss function indeed improved their robustness to noisy data. In those tasks, the pixels with high uncertainty were regarded as unreliable pixels which would bear loss attenuation. On the contrary, in SISR tasks, the pixels with high uncertainty (e.g., complex texture or edge areas) should be prioritized since those regions visually more important than pixels in smooth areas. That can explain why applying above loss into SISR directly leads performance decline.
|
| 42 |
+
|
| 43 |
+
# 2.2 Modeling Uncertainty for SISR
|
| 44 |
+
|
| 45 |
+
To the best of our knowledge, only two works [21, 22] have studied the behavior of uncertainty for SISR in the open literature. [22] used batch-normalization uncertainty to analyze SISR uncertainty, improving the robustness of the network against adversarial attack. The most recent advance related to our work is Gradient Rescaling Attention Model (GRAM) [21], which analyses the effect of aleatoric/data uncertainty on SISR reconstruction. By decreasing the loss attenuation of large variance pixels, GRAM achieves better results than applying above uncertainty loss into SISR directly. However, GRAM [21] loss remains attenuated when the variance of pixels is high, which contradicts the intuition of prioritizing texture and edge pixels. Thus, GRAM [21] is still inferior to baseline methods since the proposed method fails to prioritize the pixels of large variance. Different from GRAM, we propose a novel uncertainty-driven loss (UDL) to enforce the network concentrating more on the pixels with large variance aiming at better reconstruction of texture and edge regions. By quantifying the uncertainty in SISR under deep Bayesian framework, our proposed method has achieved better results than baseline methods.
|
| 46 |
+
|
| 47 |
+
# 3 Methodology
|
| 48 |
+
|
| 49 |
+
Unlike traditional $M S E$ or $\mathcal { L } _ { 1 }$ loss treating every pixel equally, the proposed new adaptive weighted loss for SISR aims at prioritizing texture and edge pixels that are visually more important than pixels in smooth areas. Toward this objective, we first introduce an approach of estimating intermediate results of SR image (mean) and uncertainty (variance) simultaneously in SISR. Then, with Jeffrey’s prior term, a regularized approach of estimating sparse uncertainty is proposed for more accurate uncertainty estimation. An important new insight brought by this paper is that unlike high-level vision tasks where pixels with large uncertainty are assigned lower weights to attenuate their impact $I I 5 J ,$ one should prioritize these pixels in low-level vision tasks such as SISR. Such observation implies that the attenuation of weighting coefficients in loss function needs to be properly translated into the attention mechanism given the specific vision problem as the context.
|
| 50 |
+
|
| 51 |
+
In previous study [15], it has been shown that explicitly representing aleatoric uncertainty can lead to performance and robustness improvement to noise data in high-level vision tasks such as image segmentation. Such improvement can be explained away by attenuating the weights of pixels with large uncertainty. However, attenuation has to go the opposite direction in low-level vision tasks such as SISR - i.e., larger weights should be assigned to the pixels with high uncertainty (e.g., texture and edge pixels) because they are visually more important than pixels in smooth regions. It should be noted that existing work such as gradient rescaling strategy in GRAM [21] fails to recognize such difference and does not prioritize pixels with high uncertainty. In this paper, we propose a new adaptive weighted loss named uncertainty-driven loss (UDL) for properly turning attenuation into attention for SISR.
|
| 52 |
+
|
| 53 |
+

|
| 54 |
+
Figure 2: The overview of training SISR network with proposed ${ \mathcal { L } } _ { \mathrm { U D L } }$ loss. The whole training process can divided into two steps; the first step estimates the uncertainty $\pmb \theta$ precisely and the second step generates the final mean value $f ( \boldsymbol { y } )$ . In step1 shown in (a), the mean value $f ( \boldsymbol { y } )$ and variance $\pmb \theta$ are pretrained by $\mathcal { L } _ { \mathrm { E S U } }$ loss. During step2, as shown in (b), the mean value $f ( y )$ network is trained by ${ \mathcal { L } } _ { \mathrm { U D L } }$ loss, while the network of inferring variance $\pmb \theta$ is fixed. Note that the mean value $f ( \boldsymbol { y } )$ network of step2 starts training from the pretrained network of step1. The Nearest Upsampling denotes interpolation operator.
|
| 55 |
+
|
| 56 |
+
# 3.1 Estimating Uncertainty (EU) in SISR.
|
| 57 |
+
|
| 58 |
+
As discussed in [15], there are two classes of uncertainty in Bayesian modeling: aleatoric uncertainty capturing noise inherent in observation data and epistemic uncertainty accounting for uncertainty of model about its predictions. We opt to study the former (aleatoric uncertainty) and explore its application into SISR by designing new uncertainty-driven loss (UDL) functions in this paper. In order to better quantify aleatoric uncertainty in SISR, we use ${ \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 { } \Psi \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \Psi \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \mathbf { } \Psi \mathbf { } \mathbf { } \mathbf { } \Psi \mathbf { } \mathbf { } \mathbf { } \mathbf { } \Psi \mathbf { } \mathbf { } \mathbf \Psi \Psi \mathbf { } \mathbf { } \Psi \mathbf { } \mathbf \Psi \Psi \mathbf { } \mathbf { } \Psi \mathbf \Psi \Psi \mathbf { } \mathbf \Psi \Psi \Psi \mathbf { } \mathbf \Psi \Psi \Psi \mathbf { } \mathbf \Psi \Psi \Psi \mathbf { }$ to denote the low-resolution (LR) image and the corresponding high-resolution (HR) image respectively. Let $f ( \cdot )$ denotes an arbitrary SISR network and the aleatoric uncertainty can be denoted by an additive term $\theta _ { i }$ . This way, the overall observation model can be formulated as
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\pmb { x } _ { i } = f ( \pmb { y } _ { i } ) + \epsilon \pmb { \theta } _ { i } ,
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where $\epsilon$ represents the Laplace distribution with zero-mean and unit-variance. Existing deep-learning based SISR methods target at training a network to learn the SR image (mean) $f ( \pmb { y } _ { i } )$ only. To more accurately characterize aleatoric uncertainty for SISR, we propose to estimate not only the SR image (mean) $\dot { f } ( \pmb { y } _ { i } )$ but also the uncertainty (variance) $\theta _ { i }$ simultaneously.
|
| 65 |
+
|
| 66 |
+
For a given LR image $\mathbf { \nabla } _ { \mathbf { \psi } _ { 3 } } \psi _ { i }$ and corresponding HR image $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ , a Laplace distribution 2 is assumed for characterizing the likelihood function by
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
p ( \pmb { x } _ { i } , \pmb { \theta } _ { i } | \pmb { y } _ { i } ) = \frac { 1 } { 2 \pmb { \theta } _ { i } } \exp ( - \frac { | | \pmb { x } _ { i } - \pmb { f } ( \pmb { y } _ { i } ) | | _ { 1 } } { \pmb { \theta } _ { i } } ) ,
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
where $f ( \pmb { y } _ { i } )$ and $\theta _ { i }$ denote the SR image (mean) and the uncertainty (variance) which are learned by deep neural networks (DNNs) respectively. Then, the log likelihood can be formulated as follows,
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\ln p ( { \pmb x } _ { i } , \pmb \theta _ { i } | { \pmb y } _ { i } ) = - \frac { | | { \pmb x } _ { i } - f ( { \pmb y } _ { i } ) | | _ { 1 } } { \pmb \theta _ { i } } - \ln \pmb \theta _ { i } - \ln 2
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+

|
| 79 |
+
Figure 3: SISR visual quality comparisons of EDSR-S [2] with different loss function on ‘Img_005’ from Set5 [23] (bicubic-downsampling $\times 4 )$ ). Best viewed in color.
|
| 80 |
+
|
| 81 |
+
For numerical stability, we train the networks to estimate log variance $\begin{array} { r } { s _ { i } = \ln \theta _ { i } } \end{array}$ as shown in Fig. 2 (a). At last, the maximum likelihood estimation of (5) can be reformulated as the minimization of following loss function for estimating uncertainty (EU) in SISR.
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\mathcal { L } _ { E U } = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \exp ( - s _ { i } ) \vert \vert \pmb { x } _ { i } - f ( \pmb { y } _ { i } ) \vert \vert _ { 1 } + s _ { i }
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
Jeffrey’s Prior for Estimating Sparse Uncertainty (ESU) in SISR. The loss function $\mathcal { L } _ { \mathrm { E U } }$ includes two terms; the first one is associated with fidelity term and the second one prevents the network from predicting infinite uncertainty for all pixels. Those two terms reach equilibrium but there is no prior that imposed on the uncertainty estimation. Therefore, based on the observation that the uncertainty is sparse in view of the whole image as shown in Fig. 2, we propose to impose Jeffrey’s prior [10] $\begin{array} { r } { p ( \dot { \boldsymbol { w } } ) \propto \frac { 1 } { w } } \end{array}$ on uncertainty $\theta _ { i }$ , which can be expressed as
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\nu ( x _ { i } , \theta _ { i } | y _ { i } ) = p ( x _ { i } | y _ { i } , \theta _ { i } ) p ( \theta _ { i } ) \propto \frac { 1 } { 2 \theta _ { i } } \exp ( - \frac { \left| | x _ { i } - f ( y _ { i } ) | \right| _ { 1 } } { \theta _ { i } } ) \frac { 1 } { \theta _ { i } } = \frac { 1 } { 2 \theta _ { i } ^ { 2 } } \exp ( - \frac { \left| | x _ { i } - f ( y _ { i } ) | \right| _ { 1 } } { \theta _ { i } } )
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
Then the log likelihood and loss function can be separately formulated as follows,
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\ln p ( \pmb { x } _ { i } | \pmb { y } _ { i } ) = - \frac { | | \pmb { x } _ { i } - \pmb { f } ( \pmb { y } _ { i } ) | | _ { 1 } } { \pmb { \theta } _ { i } } - 2 \ln \pmb { \theta } _ { i } - \ln 2
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\mathcal { L } _ { E S U } = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \exp ( - s _ { i } ) | | x _ { i } - f ( \pmb { y } _ { i } ) | | _ { 1 } + 2 s _ { i }
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
The limitations of $\mathcal { L } _ { \bf E U }$ and ${ \mathcal { L } } _ { \mathbf { E S U } }$ loss. Applying $\mathcal { L } _ { \mathrm { E U } }$ and $\mathcal { L } _ { \mathrm { E S U } }$ loss leads to more accurate estimation of uncertainty (variance field), but counter-intuitively, they do not directly improve the performance of SISR. We have conducted experiments comparing those three different loss functions to verify the above claim. As shown in Tab. 1, the average PSNR and SSIM results of $\mathcal { L } _ { \mathrm { E S U } }$ and $\mathcal { L } _ { \mathrm { E U } }$ are notably lower than the original results. The reason behind this observation is that both ${ \mathcal { L } } _ { \mathrm { E U } }$ and $\mathcal { L } _ { \mathrm { E S U } }$ loss functions have incorporated the variance term $( \pmb \theta _ { i } )$ into the divisor of the absolution difference term. Consequently, a pixel with a large variance will be penalized after the division and has less impact on the overall loss function. Note that such attenuation of pixels with large uncertainty is preferred for high-level vision tasks, as demonstrated in previous works [15–17] on image classification [18], image segmentation [15, 16], and face recognition [17, 19].
|
| 104 |
+
|
| 105 |
+
Low-level vision tasks such as SISR are much different. As shown in Fig. 1, pixels with large uncertainty carry visually important information such as textured and edges. They need to be prioritized (opposite to attenuation) and given larger instead of smaller weights. To verify such claim, we have presented a simple example comparing the visual results between $\mathcal { L } _ { \mathrm { E U } }$ and $\mathcal { L } _ { \mathrm { E S U } }$ as shown in Fig. 3. It can be seen that the uncertainty captured by $\mathcal { L } _ { \mathrm { E S U } }$ loss is better than $\mathcal { L } _ { \mathrm { E U } }$ loss. The improvement of $\mathcal { L } _ { \mathrm { E S U } }$ in Eq. (9) over $\mathcal { L } _ { \mathrm { E U } }$ in Eq. (6) is attributed to the prioritization of pixels with large uncertainty ( $\boldsymbol { s } _ { i }$ values). Fig. 3 (f) clearly demonstrate superiority of exploiting the sparsity constraint with the uncertainty estimation.
|
| 106 |
+
|
| 107 |
+
Table 1: Average PSNR and SSIM results for BI degradation on five datasets for investigating three different loss. The best performance is shown in bold. We record the results in $1 . 2 \times 1 0 ^ { \overline { { 5 } } }$ iterations.
|
| 108 |
+
|
| 109 |
+
<table><tr><td rowspan="2">Base Model</td><td rowspan="2">Scale</td><td rowspan="2">Loss</td><td colspan="2">Set5[23]</td><td colspan="2">Set14 [8]</td><td colspan="2">BSD100[24]</td><td colspan="2">Urban100 [25]</td><td colspan="2">Manga109 [26]</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 rowspan="3">EDSR-S[2]</td><td rowspan="3">×4</td><td>Original</td><td>30.93</td><td>0.8740</td><td>27.80</td><td>0.7627</td><td>27.05</td><td>0.7190</td><td>24.71</td><td>0.7351</td><td>28.14</td><td>0.8693</td></tr><tr><td>LEU</td><td>30.19</td><td>0.8627</td><td>27.29</td><td>0.7538</td><td>26.78</td><td>0.7120</td><td>24.21</td><td>0.7179</td><td>26.78</td><td>0.8481</td></tr><tr><td>LESU</td><td>30.31</td><td>0.8637</td><td>27.39</td><td>0.7543</td><td>26.83</td><td>0.7124</td><td>24.27</td><td>0.7192</td><td>26.92</td><td>0.8496</td></tr></table>
|
| 110 |
+
|
| 111 |
+
# 3.2 Uncertainty-Driven Loss (UDL) for SISR
|
| 112 |
+
|
| 113 |
+
Improvement of $\mathcal { L } _ { \mathrm { E S U } }$ over $\mathcal { L } _ { \mathrm { E U } }$ inspired us to go one step further. To better prioritize pixels with large uncertainty, we propose a new adaptive weighted loss named uncertainty-driven loss (UDL) for SISR. Unlike $\mathcal { L } _ { \mathrm { E S U } }$ loss putting a larger weight to the second term than $\mathcal { L } _ { \mathrm { E U } }$ , we suggest that the first term can also be modified to directly associate the aleatoric/data uncertainty of $f ( \pmb { y } _ { i } )$ . That is, instead of using $e x p ( - s _ { i } )$ to attenuate the importance of pixels with large uncertainty, we need to use a monotonically increasing function to prioritize them. Linear scaling would be a natural option, which leads to the following loss function
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\mathcal { L } _ { U D L } = \frac { 1 } { N } \sum _ { i = 1 } ^ { N } \hat { s _ { i } } | | \pmb { x } _ { i } - f ( \pmb { y } _ { i } ) | | _ { 1 } ,
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
where ${ \hat { s } } _ { i } = s _ { i } - \operatorname* { m i n } ( s _ { i } )$ is a non-negative linear scaling function. To prevent uncertainty value from degenerating into zeros, the result of uncertainty estimation network in the first step will be passed to the second step as the attention signal $\displaystyle s = \ln \theta$ ), as shown in Fig. 2. By leveraging the log variance to represent the challenging and cumbersome pixels with higher uncertainty, we propose a new weighted loss named uncertainty-driven loss ${ \mathcal { L } } _ { \mathrm { U D L } }$ . In ${ \mathcal { L } } _ { \mathrm { U D L } }$ loss, texture and edge pixels with higher uncertainty tend to have larger weights than those in smooth regions. In summary, the uncertainty estimation $\pmb \theta$ serves as the bridge connecting two steps: it is the output of the first step; but passed on to the second step as the guidance required for calculating ${ \mathcal { L } } _ { \mathrm { U D L } }$ loss.
|
| 120 |
+
|
| 121 |
+
# 3.3 Two-step Training of Dual Networks
|
| 122 |
+
|
| 123 |
+
As shown in Fig. 2, the whole training process can be divided into two steps; the first step estimates the uncertainty $\pmb { \theta }$ precisely and the second step generates the final mean value $f ( \boldsymbol { y } )$ with the aid from the estimated uncertainty $\pmb \theta$ from step1. More specifically, the mean value $f ( y )$ and variance $\theta$ are pre-trained by $\mathcal { L } _ { \mathrm { E S U } }$ loss during step1 as shown in Fig. 2 (a). After the uncertainty has been estimated, the mean value $f ( \boldsymbol { y } )$ network is trained by ${ \mathcal { L } } _ { \mathrm { U D L } }$ loss with variance $\theta$ as shown in Fig. 2 (b), while the network of inferring variance $\pmb { \theta }$ is fixed.
|
| 124 |
+
|
| 125 |
+
Note that the mean value $f ( \boldsymbol { y } )$ network of step2 starts training from the pre-trained network of step1. Such partial parameter sharing is a salient property of our proposed dual networks with parallel symmetric attention [27]. In theory, we can extend the two-step training into multiple-step training by alternating between the estimation of uncertainty (variance $\pmb \theta$ ) and mean value $f ( \boldsymbol { y } )$ . Conceptually, an improved estimation of unknown HR image can leads to an improved estimation of aleatoric uncertainty and vice versa. This line of reasoning will lead to the pursuit of a deep equilibrium model [28] for SISR; but it is beyond the scope of this paper.
|
| 126 |
+
|
| 127 |
+
# 3.4 Discussions: Why UDL Outperforms GRAM?
|
| 128 |
+
|
| 129 |
+
To the best of our knowledge, only one work GRAM [21] has studied data uncertainty in SISR, which is the most related to our work. We will discuss connections and differences between proposed UDL and GRAM [21] here. First, both GRAM [21] and our work has found out that applying the traditional uncertainty loss designed for high-level computer vision tasks into SISR task directly results in performance decline. For high-level computer vision tasks, the pixels with higher uncertainty indicates less confidence in final inference, which needs loss attenuation. However, for SISR tasks, the pixels with higher uncertainty (e.g., texture and edge pixels) should be prioritized with larger weights because they are visually more important than pixels in smooth regions. To solve this problem, GRAM [21] proposes to use uncertainty to generate an attention mask that decreases loss attenuation. However, GRAM [21] loss still is attenuated when the variance of pixels is high. Thus, GRAM [21] is still inferior to baseline method since it still does not prioritize pixels with high uncertainty.
|
| 130 |
+
|
| 131 |
+
Different from GRAM, we propose an uncertainty-driven loss to assign the pixels with high variance more weight to prioritize them. Besides, modeling uncertainty under Bayesian framework allows us to leverage sparsity prior for a more precise estimation of uncertainty. Ultimately, our proposed method consists of those two technical contributions that achieve better results than baseline methods and outperform GRAM.
|
| 132 |
+
|
| 133 |
+
# 4 Experiments
|
| 134 |
+
|
| 135 |
+
# 4.1 Experimental Settings
|
| 136 |
+
|
| 137 |
+
Datasets and Metrics. 800 high-quality (2K resolution) images from the DIV2K dataset [29] have been used for training. Following EDSR [2], five standard benchmark datasets: Set5 [23], Set14 [8], BSD100[24], Urban100 [25], Manga109 [26] are used for testing. Performance evaluation in terms of of PSNR and SSIM [30] metrics is conducted on the luminance (Y) channel only.
|
| 138 |
+
|
| 139 |
+
Training Setting. We randomly select 16 RGB LR patches sized by $4 8 \times 4 8$ as the inputs. The image patches are randomly rotated by $9 0 ^ { \circ }$ , $1 8 0 ^ { \circ }$ , $2 7 0 ^ { \circ }$ and flipped horizontally. The ADAM algorithm [31] with $\beta _ { 1 } = 0 . 9 , \beta _ { 2 } = 0 . 9 9 9$ , $\epsilon \overset { \cdot } { = } 1 0 ^ { - 8 }$ is adopted to optimize the network. The initial learning rate is $1 0 ^ { - 4 }$ and decreases by half for every $2 \times 1 0 ^ { 5 }$ minibatch updates.
|
| 140 |
+
|
| 141 |
+
Degradation models. To demonstrate the effectiveness of our proposed uncertainty-driven loss in varying degradation scenarios, we have designed the following experiments with two different degradation models. Let BI denotes bicubic downsampling. The second one is BD which uses Gaussian blur followed by nearest downsampling to generate LR images. Specifically, we apply $1 1 \times 1 1$ sized Gaussian kernel with a standard deviation 1.6 for blurring in our experiments.
|
| 142 |
+
|
| 143 |
+
SISR Networks. We choose three different networks to verify the effectiveness of proposed ${ \mathcal { L } } _ { \mathrm { U D L } }$ loss. The first one is EDSR-S or called baseline network in [2]. EDSR-S [2] mainly consists of 16 Resblock with 64 channels, having $1 . 5 M$ parameters. The second one is DPDNN[3] where denoiser network is U-net under model-guided framework. The last one is a big network EDSR[2], consisting of 32 Resblock with 256 channels, having $4 3 M$ parameters. The analysis of training cost can be found in our supplementary material.
|
| 144 |
+
|
| 145 |
+
# 4.2 Ablation Study
|
| 146 |
+
|
| 147 |
+
Table 2: Average PSNR and SSIM results for BI degradation on five datasets for investigating three different loss. The best performance is shown in bold. We record the results in $4 \times 1 0 ^ { 5 }$ iterations.
|
| 148 |
+
|
| 149 |
+
<table><tr><td rowspan="2">Base Model</td><td rowspan="2">Scale</td><td rowspan="2">Loss</td><td colspan="2">Set5[23]</td><td colspan="2">Set14[8]</td><td colspan="2">BSD100 [24]</td><td colspan="2">Urban100[25]</td><td colspan="2">Manga109 [26]</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 rowspan="3">EDSR-S[2]</td><td rowspan="3">×4</td><td>Original</td><td>31.61</td><td>0.8862</td><td>28.22</td><td>0.7721</td><td>27.30</td><td>0.7271</td><td>25.25</td><td>0.7575</td><td>29.31</td><td>0.8907</td></tr><tr><td>LEU+LUDL</td><td>31.83</td><td>0.8895</td><td>28.33</td><td>0.7754</td><td>27.37</td><td>0.7297</td><td>25.49</td><td>0.7665</td><td>29.70</td><td>0.8959</td></tr><tr><td>LESU+LUDL</td><td>31.90</td><td>0.8897</td><td>28.37</td><td>0.7755</td><td>27.40</td><td>0.7301</td><td>25.54</td><td>0.7671</td><td>29.77</td><td>0.8967</td></tr></table>
|
| 150 |
+
|
| 151 |
+
To further verify the effectiveness of sparse uncertainty estimation at step1, we have conducted an ablation study to compare the final PSNR/SSIM results of ${ \mathcal { L } } _ { \mathrm { U D L } }$ with $\mathcal { L } _ { \mathrm { E U } }$ or with $\mathcal { L } _ { \mathrm { E S U } }$ at step1. In our ablation study, we have used $\times 4$ bicubic down-sampling degradation on five frequently-used benchmark datasets with EDSR-S backbone[2]. As shown in Tab. 2, both ${ \mathcal { L } } _ { \mathrm { E U } } { + } { \mathcal { L } } _ { \mathrm { U D L } }$ and ${ \mathcal { L } } _ { \mathrm { E S U } } { + } { \mathcal { L } } _ { \mathrm { U D L } }$ loss have achieved better performance than original loss. Besides, ${ \mathcal { L } } _ { \mathrm { E S U } } { + } { \mathcal { L } } _ { \mathrm { U D L } }$ loss obtains better results than $\mathcal { L } _ { \mathrm { E U } } { + } \mathcal { L } _ { \mathrm { U D L } }$ due to more accurate uncertainty estimation as shown in Fig. 3 (e) and (f).
|
| 152 |
+
|
| 153 |
+
# 4.3 Analysis of Different Weighted Loss
|
| 154 |
+
|
| 155 |
+
There are many different weighted loss guided by different weight maps, such as Error_map, Gradient_map which can also reveal the challenging pixels. We have conducted experiments with a weighted loss function where the weight is a pixel-wise gradient or Error_map. The PSNR results of five benchmark datasets for investigating the influence of different weighted loss functions can be summarized in Tab. 3.
|
| 156 |
+
|
| 157 |
+
The $H R$ _gradient_map and $L R$ _gradien_map denote calculating gradient map from high-resolution (ground truth) images and low-resolution images respectively. The calculation of gradient can be formulated as
|
| 158 |
+
|
| 159 |
+
$$
|
| 160 |
+
\begin{array} { r } { V ( i , j ) = I ( i + 1 , j ) - I ( i , j ) , H ( i , j ) = I ( i , j + 1 ) - I ( i , j ) , G ( i , j ) = | | ( V ( i , j ) , H ( i , j ) | | _ { 2 } , } \end{array}
|
| 161 |
+
$$
|
| 162 |
+
|
| 163 |
+
Table 3: Average PSNR and $\Delta$ PSNR results with BI degradation on five datasets for investigating the influence of different weighted loss functions. The best performance is shown in bold.
|
| 164 |
+
|
| 165 |
+
<table><tr><td rowspan=1 colspan=1>Weighted loss</td><td rowspan=1 colspan=1>Set5</td><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=1>Set14</td><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=1>BSD100</td><td rowspan=1 colspan=1>△</td><td rowspan=1 colspan=1>Urban100</td><td rowspan=1 colspan=1>△</td><td rowspan=1 colspan=1>Manga109</td><td rowspan=1 colspan=1>△</td></tr><tr><td rowspan=1 colspan=1>Baseline</td><td rowspan=1 colspan=1>31.61</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>28.22</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>27.30</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>25.25</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>29.31</td><td rowspan=1 colspan=1>0.00</td></tr><tr><td rowspan=1 colspan=1>Uncertainty(Ours)</td><td rowspan=1 colspan=1>31.90</td><td rowspan=1 colspan=1>0.29个</td><td rowspan=1 colspan=1>28.37</td><td rowspan=1 colspan=1>0.15个</td><td rowspan=1 colspan=1>27.40</td><td rowspan=1 colspan=1>0.10个</td><td rowspan=1 colspan=1>25.54</td><td rowspan=1 colspan=1>0.29个</td><td rowspan=1 colspan=1>29.77</td><td rowspan=1 colspan=1>0.46个</td></tr><tr><td rowspan=1 colspan=1>Error_map</td><td rowspan=1 colspan=1>31.77</td><td rowspan=1 colspan=1>0.16个</td><td rowspan=1 colspan=1>28.30</td><td rowspan=1 colspan=1>0.08个</td><td rowspan=1 colspan=1>27.35</td><td rowspan=1 colspan=1>0.05个</td><td rowspan=1 colspan=1>25.40</td><td rowspan=1 colspan=1>0.15个</td><td rowspan=1 colspan=1>29.57</td><td rowspan=1 colspan=1>0.26个</td></tr><tr><td rowspan=1 colspan=1>HR_gradient_map</td><td rowspan=1 colspan=1>31.68</td><td rowspan=1 colspan=1>0.07个</td><td rowspan=1 colspan=1>28.27</td><td rowspan=1 colspan=1>0.05个</td><td rowspan=1 colspan=1>27.35</td><td rowspan=1 colspan=1>0.05个</td><td rowspan=1 colspan=1>25.42</td><td rowspan=1 colspan=1>0.17个</td><td rowspan=1 colspan=1>29.45</td><td rowspan=1 colspan=1>0.14个</td></tr><tr><td rowspan=1 colspan=1>LR_gradient_map</td><td rowspan=1 colspan=1>31.69</td><td rowspan=1 colspan=1>0.08个</td><td rowspan=1 colspan=1>28.29</td><td rowspan=1 colspan=1>0.07个</td><td rowspan=1 colspan=1>27.35</td><td rowspan=1 colspan=1>0.05个</td><td rowspan=1 colspan=1>25.38</td><td rowspan=1 colspan=1>0.13个</td><td rowspan=1 colspan=1>29.50</td><td rowspan=1 colspan=1>0.19个</td></tr></table>
|
| 166 |
+
|
| 167 |
+
where $I$ denotes pixels value and $i , j$ denotes position of pixels. Note that we adjust the scaling functions of Error_map, HR_gradient_map and LR_gradient_map to get the best performance.
|
| 168 |
+
|
| 169 |
+
From the Tab. 3, one can be observed that other weighted loss functions can indeed improve the PSNR results, but only to certain degrees. Comparing four different weight maps, our proposed uncertainty weighted loss function can bring the biggest improvement. Although the Error_map can represent the variance of a single pixel, the Error_map lacks semantic information or local information to capture a more precise estimation of variance comparing uncertainty. With regard to the gradient map of HR or LR images, those gradient maps only well match the edges of images and have a certain correlation to variance. Comparing the visual results of Error_map, HR_gradient_map and $L R$ _gradient_map with uncertainty map, those maps only detect edges of images and fail reflecting complex texture details which are important to final reconstruction performance. Therefore, uncertainty-weighted loss can is still valuable for achieving the best performance among other weighted maps.
|
| 170 |
+
|
| 171 |
+
# 4.4 Analysis of Different Scaling Functions
|
| 172 |
+
|
| 173 |
+
We have conducted experiments with several various monotonically increasing functions (including linear and non-linear) and the results can be summarized in Tab. 4.
|
| 174 |
+
|
| 175 |
+
Table 4: Average PSNR and $\Delta$ PSNR results with BI degradation on five datasets for investigating the influence of different scaling functions. The best performance are shown in bold.
|
| 176 |
+
|
| 177 |
+
<table><tr><td rowspan=1 colspan=1>Scaling functions</td><td rowspan=1 colspan=1>Set5</td><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=1>Set14</td><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=1>BSD100</td><td rowspan=1 colspan=1>△</td><td rowspan=1 colspan=1>Urban100</td><td rowspan=1 colspan=1>A</td><td rowspan=1 colspan=1>Manga109</td><td rowspan=1 colspan=1>A</td></tr><tr><td rowspan=1 colspan=1>Baseline</td><td rowspan=1 colspan=1>31.61</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>28.22</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>27.30</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>25.25</td><td rowspan=1 colspan=1>0.00</td><td rowspan=1 colspan=1>29.31</td><td rowspan=1 colspan=1>0.00</td></tr><tr><td rowspan=1 colspan=1>s-min(s)</td><td rowspan=1 colspan=1>31.90</td><td rowspan=1 colspan=1>0.29个</td><td rowspan=1 colspan=1>28.37</td><td rowspan=1 colspan=1>0.15个</td><td rowspan=1 colspan=1>27.40</td><td rowspan=1 colspan=1>0.10个</td><td rowspan=1 colspan=1>25.54</td><td rowspan=1 colspan=1>0.29个</td><td rowspan=1 colspan=1>29.77</td><td rowspan=1 colspan=1>0.46个</td></tr><tr><td rowspan=1 colspan=1>exp(s)</td><td rowspan=1 colspan=1>31.80</td><td rowspan=1 colspan=1>0.19个</td><td rowspan=1 colspan=1>28.34</td><td rowspan=1 colspan=1>0.12个</td><td rowspan=1 colspan=1>27.40</td><td rowspan=1 colspan=1>0.10个</td><td rowspan=1 colspan=1>25.53</td><td rowspan=1 colspan=1>0.28个</td><td rowspan=1 colspan=1>29.66</td><td rowspan=1 colspan=1>0.35个</td></tr><tr><td rowspan=1 colspan=1>e.xp(s)(1/2)</td><td rowspan=1 colspan=1>31.86</td><td rowspan=1 colspan=1>0.25个</td><td rowspan=1 colspan=1>28.36</td><td rowspan=1 colspan=1>0.14↑</td><td rowspan=1 colspan=1>27.41</td><td rowspan=1 colspan=1>0.11个</td><td rowspan=1 colspan=1>25.55</td><td rowspan=1 colspan=1>0.30↑</td><td rowspan=1 colspan=1>29.71</td><td rowspan=1 colspan=1>0.40↑</td></tr><tr><td rowspan=1 colspan=1>log(s)-min(log(s))</td><td rowspan=1 colspan=1>31.89</td><td rowspan=1 colspan=1>0.28个</td><td rowspan=1 colspan=1>28.39</td><td rowspan=1 colspan=1>0.17个</td><td rowspan=1 colspan=1>27.42</td><td rowspan=1 colspan=1>0.12个</td><td rowspan=1 colspan=1>25.57</td><td rowspan=1 colspan=1>0.32个</td><td rowspan=1 colspan=1>29.74</td><td rowspan=1 colspan=1>0.43个</td></tr></table>
|
| 178 |
+
|
| 179 |
+
The best and second-best performances are shown in bold. Overall, four various monotonically increasing functions have achieved better results than the baseline method. The best two scaling functions are linear scaling and log scaling with a slight difference as shown in the above table. Since the linear scaling function achieves a comparable performance with low computational cost, we advocate this choice in this paper.
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 4: SISR visual quality comparisons of EDSR-S [2] with different loss function on ‘Img_004’ and $\mathrm { \hbar } ^ { 4 } \mathrm { I m g \_ 0 1 } 6 ^ { , }$ from Urban100 [25] (bicubic-downsampling $\times 4 _ { , }$ ). Best viewed in color.
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 5: SISR visual quality comparisons of DPDNN [3] with different loss function on ‘Img_095 from BSD100 [24] (bicubic-downsampling $\times 4 _ { , }$ ). Best viewed in color.
|
| 186 |
+
|
| 187 |
+
Table 5: Average PSNR and SSIM results for BI degradation on five benchmark datasets. The best performance is shown in bold. Note that ${ \mathcal { L } } _ { \mathrm { U D L } }$ -Ours denotes adopting $\mathcal { L } _ { \mathrm { E S U } }$ at step1 and ${ \mathcal { L } } _ { \mathrm { U D L } }$ at step2 for simplicity.
|
| 188 |
+
|
| 189 |
+
<table><tr><td rowspan=2 colspan=1>Base Model</td><td rowspan=2 colspan=1>Scale</td><td rowspan=2 colspan=1>Loss</td><td rowspan=1 colspan=2>Set5[23]</td><td rowspan=1 colspan=1>Set]</td><td rowspan=1 colspan=1>4[8]</td><td rowspan=1 colspan=2>BSD100 [24]</td><td rowspan=1 colspan=1>Urban</td><td rowspan=1 colspan=1>00[25]</td><td rowspan=1 colspan=1>Manga</td><td rowspan=1 colspan=1>109[26]</td></tr><tr><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td></tr><tr><td rowspan=1 colspan=1>EDSR-S [2]</td><td rowspan=1 colspan=1>×2</td><td rowspan=1 colspan=1>OriginalGRAM [21]LUDL-Ours</td><td rowspan=1 colspan=1>37.6637.4837.95</td><td rowspan=1 colspan=1>0.85940.95890.9604</td><td rowspan=1 colspan=1>33.2232.9933.50</td><td rowspan=1 colspan=1>0.91460.91260.9165</td><td rowspan=1 colspan=1>31.9531.7632.13</td><td rowspan=1 colspan=1>0.89690.89460.8991</td><td rowspan=1 colspan=1>30.7130.1131.54</td><td rowspan=1 colspan=1>0.92050.91340.9304</td><td rowspan=1 colspan=1>37.7937.3838.38</td><td rowspan=1 colspan=1>0.97520.97390.9767</td></tr><tr><td rowspan=1 colspan=1>DPDNN [3]</td><td rowspan=1 colspan=1>×2</td><td rowspan=1 colspan=1>OriginalGRAM [21]LUDL-Ours</td><td rowspan=1 colspan=1>37.7537.7438.00</td><td rowspan=1 colspan=1>0.96000.95970.9605</td><td rowspan=1 colspan=1>33.3033.2733.63</td><td rowspan=1 colspan=1>0.91500.91480.9176</td><td rowspan=1 colspan=1>32.0931.9832.16</td><td rowspan=1 colspan=1>0.89900.89730.8995</td><td rowspan=1 colspan=1>31.5030.9731.72</td><td rowspan=1 colspan=1>0.92200.92380.9331</td><td rowspan=1 colspan=1>-38.1438.55</td><td rowspan=1 colspan=1>-0.97580.9769</td></tr><tr><td rowspan=1 colspan=1>EDSR [2]</td><td rowspan=1 colspan=1>×2</td><td rowspan=1 colspan=1>OriginalGRAM [21]LUDL-Ours</td><td rowspan=1 colspan=1>38.1137.8738.29</td><td rowspan=1 colspan=1>0.96020.96040.9615</td><td rowspan=1 colspan=1>33.9233.4334.14</td><td rowspan=1 colspan=1>0.91950.91640.9236</td><td rowspan=1 colspan=1>32.3232.0832.40</td><td rowspan=1 colspan=1>0.90130.89900.9027</td><td rowspan=1 colspan=1>32.9331.4632.99</td><td rowspan=1 colspan=1>0.93510.93010.9446</td><td rowspan=1 colspan=1>39.1037.9139.53</td><td rowspan=1 colspan=1>0.97730.97650.9787</td></tr><tr><td rowspan=1 colspan=1>EDSR-S [2]</td><td rowspan=1 colspan=1>×3</td><td rowspan=1 colspan=1>OriginalGRAM [21]LUDL-Ours</td><td rowspan=1 colspan=1>33.9033.2734.15</td><td rowspan=1 colspan=1>0.92310.91780.9251</td><td rowspan=1 colspan=1>29.9529.6030.15</td><td rowspan=1 colspan=1>0.83520.82980.8388</td><td rowspan=1 colspan=1>28.8528.6028.99</td><td rowspan=1 colspan=1>0.79960.79360.8021</td><td rowspan=1 colspan=1>27.3026.5227.72</td><td rowspan=1 colspan=1>0.83440.81420.8430</td><td rowspan=1 colspan=1>32.5231.1432.97</td><td rowspan=1 colspan=1>0.93690.92580.9406</td></tr><tr><td rowspan=1 colspan=1>DPDNN [3]</td><td rowspan=1 colspan=1>×3</td><td rowspan=1 colspan=1>OriginalGRAM[21]LUDL-Ours</td><td rowspan=1 colspan=1>33.9333.9234.30</td><td rowspan=1 colspan=1>0.92400.92410.9267</td><td rowspan=1 colspan=1>30.0230.0030.31</td><td rowspan=1 colspan=1>0.83600.83620.8419</td><td rowspan=1 colspan=1>29.0028.8629.10</td><td rowspan=1 colspan=1>0.80100.80000.8047</td><td rowspan=1 colspan=1>27.6127.3728.02</td><td rowspan=1 colspan=1>0.84200.83530.8505</td><td rowspan=1 colspan=1>132.4133.27</td><td rowspan=1 colspan=1>10.93730.9435</td></tr><tr><td rowspan=1 colspan=1>EDSR [2]</td><td rowspan=1 colspan=1>×3</td><td rowspan=1 colspan=1>OriginalGRAM [21]LUDL-Ours</td><td rowspan=1 colspan=1>34.6534.3434.83</td><td rowspan=1 colspan=1>0.92800.92700.9312</td><td rowspan=1 colspan=1>30.5230.2830.69</td><td rowspan=1 colspan=1>0.84620.84120.8497</td><td rowspan=1 colspan=1>29.2529.0729.28</td><td rowspan=1 colspan=1>0.80930.80440.8109</td><td rowspan=1 colspan=1>28.8027.9828.99</td><td rowspan=1 colspan=1>0.86530.87890.8697</td><td rowspan=1 colspan=1>34.1733.3234.63</td><td rowspan=1 colspan=1>0.94760.94320.9502</td></tr><tr><td rowspan=1 colspan=1>EDSR-S [2]</td><td rowspan=1 colspan=1>×4</td><td rowspan=1 colspan=1>OriginalGRAM [21]LUDL-Ours</td><td rowspan=1 colspan=1>31.6131.0831.90</td><td rowspan=1 colspan=1>0.88620.87870.8897</td><td rowspan=1 colspan=1>28.2227.8928.37</td><td rowspan=1 colspan=1>0.77210.76700.7755</td><td rowspan=1 colspan=1>27.3027.1227.40</td><td rowspan=1 colspan=1>0.72710.72290.7301</td><td rowspan=1 colspan=1>25.2524.8125.54</td><td rowspan=1 colspan=1>0.75750.74290.7671</td><td rowspan=1 colspan=1>29.3128.1829.77</td><td rowspan=1 colspan=1>0.89070.87620.8967</td></tr><tr><td rowspan=1 colspan=1>DPDNN [3]</td><td rowspan=1 colspan=1>×4</td><td rowspan=1 colspan=1>OriginalGRAM [21]LUDL-Ours</td><td rowspan=1 colspan=1>31.7231.8932.20</td><td rowspan=1 colspan=1>0.88900.89130.8944</td><td rowspan=1 colspan=1>28.2828.3728.60</td><td rowspan=1 colspan=1>0.77300.77720.7819</td><td rowspan=1 colspan=1>27.4427.4127.56</td><td rowspan=1 colspan=1>0.72900.73140.7356</td><td rowspan=1 colspan=1>25.5325.6326.09</td><td rowspan=1 colspan=1>0.76800.77080.7862</td><td rowspan=1 colspan=1>-29.7030.38</td><td rowspan=1 colspan=1>-0.90030.9082</td></tr><tr><td rowspan=1 colspan=1>EDSR [2]</td><td rowspan=1 colspan=1>×4</td><td rowspan=1 colspan=1>OriginalGRAM [21]LUDL-Ours</td><td rowspan=1 colspan=1>32.4632.3232.59</td><td rowspan=1 colspan=1>0.89680.89710.8998</td><td rowspan=1 colspan=1>28.8028.7328.87</td><td rowspan=1 colspan=1>0.78760.78580.7889</td><td rowspan=1 colspan=1>27.7127.6627.78</td><td rowspan=1 colspan=1>0.74200.73950.7431</td><td rowspan=1 colspan=1>26.6426.3526.75</td><td rowspan=1 colspan=1>0.80330.79550.8054</td><td rowspan=1 colspan=1>31.0230.7331.24</td><td rowspan=1 colspan=1>0.91480.91250.9167</td></tr></table>
|
| 190 |
+
|
| 191 |
+
# 4.5 Results with BI Degradation Model
|
| 192 |
+
|
| 193 |
+
For bicubic downsampling (BI), we have compared proposed ${ \mathcal { L } } _ { \mathrm { U D L } }$ loss function with GRAM [21] and original loss functions such as $M S E$ or $\mathcal { L } _ { 1 }$ on three different SISR networks. The average PSNR and SSIM results in Tab. 5 are cited from corresponding papers or retrained from officially released code. It is easy to see that our proposed ${ \mathcal { L } } _ { \mathrm { U D L } }$ loss function is superior to GRAM [21] and original loss functions such as $M S E$ or $\mathcal { L } _ { 1 }$ in terms of PSNR and SSIM values. Note that the improvements achieved by our proposed method do not bring any additional computation cost during testing time. Comparing EDSR-S ( $. 5 M$ parameters) with EDSR ( $4 3 M$ parameters), our proposed ${ \mathcal { L } } _ { \mathrm { U D L } }$ can bring lightweight networks with more greater performance improvements than big ones. The visual image comparison results are reported in Fig. 4 and Fig. 5. As shown in Fig. 4, our proposed ${ \mathcal { L } } _ { \mathrm { U D L } }$ has recovered with fewer visible artifacts (e.g., the circular pattern of the roof and the lines on the glassy surface) than original loss and GRAM [21]. Fig. 4 (f) depicts the uncertainty learned by our ${ \mathcal { L } } _ { \mathrm { U D L } }$ , revealing the challenging pixels with poor reconstruction performance. From Fig. 5, vertical center-line of window has been recover more clear with precisely estimated uncertainty shown in (e) and (f), while DPDNN and DPDNN-GRAM [21] failed to discern shown in (c) and (d) respectively. More visual comparisons can be found in supplementary material.
|
| 194 |
+
|
| 195 |
+
Table 6: Average PSNR and SSIM results for BD degradation on five benchmark datasets. The best performance is shown in bold. Note that ${ \mathcal { L } } _ { \mathrm { U D L } }$ -Ours denotes adopting $\mathcal { L } _ { \mathrm { E S U } }$ at step1 and ${ \mathcal { L } } _ { \mathrm { U D L } }$ at step2 for simplicity.
|
| 196 |
+
|
| 197 |
+
<table><tr><td rowspan=2 colspan=1>Base Model</td><td rowspan=2 colspan=1>Scale</td><td rowspan=2 colspan=1>Loss</td><td rowspan=1 colspan=2>Set5[23]</td><td rowspan=1 colspan=2>Set14 [8]</td><td rowspan=1 colspan=3>BSD100 [24]</td><td rowspan=1 colspan=1>Urban</td><td rowspan=1 colspan=1>00[25]</td><td rowspan=1 colspan=1>Manga</td><td rowspan=1 colspan=1>09[26]</td></tr><tr><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=2>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td><td rowspan=1 colspan=1>PSNR</td><td rowspan=1 colspan=1>SSIM</td></tr><tr><td rowspan=1 colspan=1>EDSR-S [2]</td><td rowspan=1 colspan=1>×4</td><td rowspan=1 colspan=1>OriginalGRAM [21]LUDL-Ours</td><td rowspan=1 colspan=1>31.7030.9831.97</td><td rowspan=1 colspan=1>0.89030.87910.8927</td><td rowspan=1 colspan=1>28.3727.8528.45</td><td rowspan=1 colspan=1>0.77780.76670.7793</td><td rowspan=1 colspan=2>27.3727.0527.41</td><td rowspan=1 colspan=1>0.73200.72250.7321</td><td rowspan=1 colspan=1>25.7724.7925.95</td><td rowspan=1 colspan=1>0.77890.74520.7842</td><td rowspan=1 colspan=1>29.8328.1230.18</td><td rowspan=1 colspan=1>0.90140.87730.9053</td></tr><tr><td rowspan=2 colspan=1>DPDNN [3]</td><td rowspan=2 colspan=1>×4</td><td rowspan=2 colspan=1>OriginalGRAM [21]LUDL-Ours</td><td rowspan=2 colspan=1>31.8631.7532.03</td><td rowspan=2 colspan=1>0.89230.89130.8949</td><td rowspan=2 colspan=1>28.3828.3328.60</td><td rowspan=2 colspan=1>0.77800.77650.7828</td><td rowspan=2 colspan=2>27.3627.3227.48</td><td rowspan=1 colspan=1>0.73110.7302</td><td rowspan=1 colspan=1>25.8225.62</td><td rowspan=1 colspan=1>0.78120.7739</td><td rowspan=1 colspan=1>29.7729.55</td><td rowspan=2 colspan=1>0.90330.90030.9097</td></tr><tr><td rowspan=1 colspan=1>27.48</td><td rowspan=1 colspan=1>0.7355</td><td rowspan=1 colspan=1>26.21</td><td rowspan=1 colspan=1>0.7931</td><td rowspan=1 colspan=1>30.35</td></tr><tr><td rowspan=5 colspan=1>EDSR [2]</td><td rowspan=5 colspan=1>×4</td><td rowspan=5 colspan=1>OriginalGRAM [21]LUDL-Ours</td><td rowspan=5 colspan=1>32.1732.1332.37</td><td rowspan=5 colspan=1>0.89750.89630.8986</td><td rowspan=5 colspan=1>28.6528.5727.74</td><td rowspan=1 colspan=1>0.7856</td><td rowspan=4 colspan=2>27.5927.49</td><td rowspan=1 colspan=1>0.7400</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td rowspan=3 colspan=1>0.7362</td><td></td><td></td><td></td><td></td></tr><tr><td></td><td rowspan=2 colspan=1>26.5626.19</td><td rowspan=2 colspan=1>0.80430.7916</td><td rowspan=2 colspan=1>30.6630.48</td><td rowspan=3 colspan=1>0.91340.90970.9149</td></tr><tr><td rowspan=1 colspan=1>0.7822</td></tr><tr><td rowspan=1 colspan=1>0.7867</td><td rowspan=1 colspan=2>27.62</td><td rowspan=1 colspan=1>0.7407</td><td rowspan=1 colspan=1>26.65</td><td rowspan=1 colspan=1>0.8065</td><td rowspan=1 colspan=1>30.81</td></tr></table>
|
| 198 |
+
|
| 199 |
+
# 4.6 Results with BD Degradation Model
|
| 200 |
+
|
| 201 |
+
For blur downsampling (BD), we have compared proposed ${ \mathcal { L } } _ { \mathrm { U D L } }$ loss function with GRAM [21] and original loss functions such as $M S E$ or $\mathcal { L } _ { 1 }$ on three different baseline networks. The average PSNR and SSIM results in Tab. 6 are retrained from officially released code. It is easy to see that our propose ${ \mathcal { L } } _ { \mathrm { U D L } }$ loss function is superior to GRAM [21] and original loss functions such as $M S E$ or $\mathcal { L } _ { 1 }$ in terms of PSNR and SSIM values. The visual image comparison results of BD degradation are reported in Fig. 6 and Fig. 7. Note that the BD degradation involves Gaussian blur, increasing difficulty in recovering structure patterns. From Fig. 6, we can see that our SR result (Fig. 6 (e)) of $\mathrm { \nabla ^ { \cdot } I m g \ 1 0 9 ^ { \cdot } }$ is the closest to that of the ground-truth. In another challenging image $\mathbf { \dot { \tau } } ^ { \mathrm { \prime } } \mathbf { I m g 0 7 8 } ^ { \prime }$ from Urban100 [25]), our method can recover much more reliable textured details as shown in Fig. 7 (e); while all other methods have severe aliasing artifacts (i.e., distorted tile patterns). The visual quality improvement achieved by ${ \mathcal { L } } _ { \mathrm { U D L } }$ is mainly due to the fact that our proposed method makes full use of the captured uncertainty to train deep networks focusing on the challenging pixels with high uncertainty. More visual comparisons can be found in our supplementary material.
|
| 202 |
+
|
| 203 |
+

|
| 204 |
+
Figure 6: SISR visual quality comparisons of DPDNN [3] with different loss function on ‘Img_109 from Manga109 [26] (blur-downsampling $\times 4 _ { , }$ ). Best viewed in color.
|
| 205 |
+
|
| 206 |
+

|
| 207 |
+
Figure 7: SISR visual quality comparisons of EDSR [2] with different loss function on ‘Img_078’ from Urban100 [25] (blur-downsampling $\times 4 _ { , }$ ). Best viewed in color.
|
| 208 |
+
|
| 209 |
+
# 5 Conclusion
|
| 210 |
+
|
| 211 |
+
In this paper, we propose a new adaptive weighted loss ${ \mathcal { L } } _ { \mathrm { U D L } }$ for SISR to train SISR networks focusing on challenging pixels with high uncertainty (e.g., textured and edge pixels). Specifically, variance estimation is introduced into SISR so that the high-resolution images (mean) and their corresponding uncertainty (variance) can be learned simultaneously. Moreover, modeling uncertainty under Bayesian framework allows us to leverage sparsity prior for a more precise estimation of uncertainty. Ultimately, pixels with large certainty (e.g., texture and edge pixels) will be prioritized for SISR according to their importance to visual quality. For the first time, we demonstrate that such uncertainty-driven loss can achieve better results than $M S E$ or $\mathcal { L } _ { 1 }$ loss. Experimental results on three popular SISR networks show that our proposed uncertainty-driven loss has achieved better PSNR performance than traditional loss functions without any increased computation during testing.
|
| 212 |
+
|
| 213 |
+
# Acknowledgement
|
| 214 |
+
|
| 215 |
+
This work was supported in part by the National Key R&D Program of China under Grant 2018AAA0101400 and the Natural Science Foundation of China under Grant 61991451, Grant 61632019, Grant 61621005, and Grant 61836008. Xin Li’s work is partially supported by the NSF under grants IIS-1951504 and OAC-1940855, the DoJ/NIJ under grant NIJ 2018-75-CX-0032, and the WV Higher Education Policy Commission Grant (HEPC.dsr.18.5).
|
| 216 |
+
|
| 217 |
+
# References
|
| 218 |
+
|
| 219 |
+
[1] 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.
|
| 220 |
+
[2] Bee Lim, Sanghyun Son, Heewon Kim, Seungjun Nah, and Kyoung Mu Lee. Enhanced deep residual networks for single image super-resolution. In 2017 IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pages 1132–1140, 2017.
|
| 221 |
+
[3] Weisheng Dong, Peiyao Wang, Wotao Yin, Guangming Shi, Fangfang Wu, and Xiaotong Lu. Denoising prior driven deep neural network for image restoration. IEEE Transactions on Pattern Analysis and Machine Intelligence, 41(10):2305–2318, 2019.
|
| 222 |
+
[4] Yulun Zhang, Kunpeng Li, Kai Li, Lichen Wang, Bineng Zhong, and Yun Fu. Image super-resolution using very deep residual channel attention networks. In Proceedings of the European Conference on Computer Vision (ECCV), pages 286–301, 2018.
|
| 223 |
+
[5] Tao Dai, Jianrui Cai, Yongbing Zhang, Shu-Tao Xia, and Lei Zhang. Second-order attention network for single image super-resolution. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 11065–11074, 2019.
|
| 224 |
+
[6] Qian Ning, Weisheng Dong, Guangming Shi, Leida Li, and Xin Li. Accurate and lightweight image super-resolution with model-guided deep unfolding network. IEEE Journal of Selected Topics in Signal Processing, 15(2):240–252, 2021. doi: 10.1109/JSTSP.2020.3037516.
|
| 225 |
+
[7] Yong Guo, Jian Chen, Jingdong Wang, Qi Chen, Jiezhang Cao, Zeshuai Deng, Yanwu Xu, and Mingkui Tan. Closed-loop matters: Dual regression networks for single image super-resolution. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5407–5416, 2020.
|
| 226 |
+
[8] Roman Zeyde, Michael Elad, and Matan Protter. On single image scale-up using sparse-representations. In Proceedings of the 7th international conference on Curves and Surfaces, pages 711–730, 2010.
|
| 227 |
+
[9] 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.
|
| 228 |
+
[10] Mario AT Figueiredo. Adaptive sparseness using jeffreys prior. In NIPS, pages 697–704, 2001.
|
| 229 |
+
[11] Qian Ning, Weisheng Dong, Fangfang Wu, Jinjian Wu, Jie Lin, and Guangming Shi. Spatial-temporal gaussian scale mixture modeling for foreground estimation. Proceedings of the AAAI Conference on Artificial Intelligence, 34(07):11791–11798, Apr. 2020. doi: 10.1609/aaai.v34i07.6851. URL https: //ojs.aaai.org/index.php/AAAI/article/view/6851.
|
| 230 |
+
[12] Paul W Goldberg, Christopher KI Williams, and Christopher M Bishop. Regression with input-dependent noise: A gaussian process treatment. Advances in neural information processing systems, 10:493–499, 1997.
|
| 231 |
+
[13] WA Wright. Bayesian approach to neural-network modeling with input uncertainty. IEEE Transactions on Neural Networks, 10(6):1261–1270, 1999.
|
| 232 |
+
[14] Christopher M Bishop and Cazhaow S Qazaz. Regression with input-dependent noise: A bayesian treatment. Advances in neural information processing systems, pages 347–353, 1997.
|
| 233 |
+
[15] Alex Kendall and Yarin Gal. What uncertainties do we need in bayesian deep learning for computer vision? In I. Guyon, U. V. 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. URL https://proceedings.neurips.cc/paper/2017/file/ 2650d6089a6d640c5e85b2b88265dc2b-Paper.pdf.
|
| 234 |
+
[16] Vijay Badrinarayanan, Alex Kendall, and Roberto Cipolla. Segnet: A deep convolutional encoder-decoder architecture for image segmentation. IEEE transactions on pattern analysis and machine intelligence, 39 (12):2481–2495, 2017.
|
| 235 |
+
[17] Jie Chang, Zhonghao Lan, Changmao Cheng, and Yichen Wei. Data uncertainty learning in face recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5710– 5719, 2020.
|
| 236 |
+
[18] Yingjie Gu, Zhong Jin, and Steve C Chiu. Active learning combining uncertainty and diversity for multi-class image classification. IET Computer Vision, 9(3):400–407, 2015.
|
| 237 |
+
[19] Yichun Shi and Anil K Jain. Probabilistic face embeddings. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 6902–6911, 2019.
|
| 238 |
+
[20] Armen Der Kiureghian and Ove Ditlevsen. Aleatory or epistemic? does it matter? Structural safety, 31(2): 105–112, 2009.
|
| 239 |
+
[21] Changwoo Lee and Ki-Seok Chung. Gram: Gradient rescaling attention model for data uncertainty estimation in single image super resolution. In 2019 18th IEEE International Conference On Machine Learning And Applications (ICMLA), pages 8–13. IEEE, 2019.
|
| 240 |
+
[22] Aupendu Kar and Prabir Kumar Biswas. Fast bayesian uncertainty estimation and reduction of batch normalized single image super-resolution network. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 4957��4966, June 2021.
|
| 241 |
+
[23] Marco Bevilacqua, Aline Roumy, Christine Guillemot, and Marie Line Alberi-Morel. Low-complexity single-image super-resolution based on nonnegative neighbor embedding. In British Machine Vision Conference 2012, pages 1–10, 2012.
|
| 242 |
+
[24] D. Martin, C. Fowlkes, D. Tal, and J. Malik. A database of human segmented natural images and its application to evaluating segmentation algorithms and measuring ecological statistics. In Proceedings Eighth IEEE International Conference on Computer Vision. ICCV 2001, volume 2, pages 416–423, 2001.
|
| 243 |
+
[25] Jia-Bin Huang, Abhishek Singh, and Narendra Ahuja. Single image super-resolution from transformed self-exemplars. In 2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 5197–5206, 2015.
|
| 244 |
+
[26] Yusuke Matsui, Kota Ito, Yuji Aramaki, Azuma Fujimoto, Toru Ogawa, Toshihiko Yamasaki, and Kiyoharu Aizawa. Sketch-based manga retrieval using manga109 dataset. Multimedia Tools and Applications, 76 (20):21811–21838, 2017.
|
| 245 |
+
[27] Yingqian Wang, Xinyi Ying, Longguang Wang, Jungang Yang, Wei An, and Yulan Guo. Symmetric parallax attention for stereo image super-resolution. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR) Workshops, pages 766–775, June 2021.
|
| 246 |
+
[28] Davis Gilton, Gregory Ongie, and Rebecca Willett. Deep equilibrium architectures for inverse problems in imaging. arXiv preprint arXiv:2102.07944, 2021.
|
| 247 |
+
[29] Radu Timofte, Eirikur Agustsson, Luc Van Gool, Ming-Hsuan Yang, and Lei Zhang. Ntire 2017 challenge on single image super-resolution: Methods and results. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition Workshops, pages 114–125, 2017.
|
| 248 |
+
[30] Zhou Wang, A.C. Bovik, H.R. Sheikh, and E.P. Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE Transactions on Image Processing, 13(4):600–612, 2004.
|
| 249 |
+
[31] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR (Poster), 2015. URL http://arxiv.org/abs/1412.6980.
|
md/train/MuSYkd1hxRP/MuSYkd1hxRP.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/N1i6BJzouX4/N1i6BJzouX4.md
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Rectifying the Shortcut Learning of Background for Few-Shot Learning
|
| 2 |
+
|
| 3 |
+
Xu Luo1, Longhui Wei2, Liangjian Wen1, Jinrong Yang4, Lingxi Xie3, Zenglin $\mathbf { \bar { X } u } ^ { 6 , 7 * }$ , Qi $\mathbf { T i a n ^ { 5 * } }$
|
| 4 |
+
|
| 5 |
+
1University of Electronic Science and Technology of China
|
| 6 |
+
2University of Science and Technology of China 3Tsinghua University
|
| 7 |
+
4Huazhong University of Science and Technology 5Xidian University
|
| 8 |
+
6Harbin Institute of Technology Shenzhen 7Pengcheng Laboratory
|
| 9 |
+
Frank.Luox@outlook.com,{weilh2568,zenglin}@gmail.com
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
The category gap between training and evaluation has been characterised as one of the main obstacles to the success of Few-Shot Learning (FSL). In this paper, we for the first time empirically identify image background, common in realistic images, as a shortcut knowledge helpful for in-class classification but ungeneralizable beyond training categories in FSL. A novel framework, COSOC, is designed to tackle this problem by extracting foreground objects in images at both training and evaluation without any extra supervision. Extensive experiments carried on inductive FSL tasks demonstrate the effectiveness of our approaches.
|
| 14 |
+
|
| 15 |
+
# 1 Introduction
|
| 16 |
+
|
| 17 |
+
Through observing a few samples at a glance, humans can accurately identify brand-new objects. This advantage comes from years of experiences accumulated by the human vision system. Inspired by such learning capabilities, Few-Shot Learning (FSL) is developed to tackle the problem of learning from limited data [24, 53]. At training, FSL models absorb knowledge from a large-scale dataset; later at evaluation, the learned knowledge is leveraged to solve a series of downstream classification tasks, each of which contains very few support (training) images from brand-new categories.
|
| 18 |
+
|
| 19 |
+
The category gap between training and evaluation has been considered as one of the core issues in FSL [10]. Intuitively, the prior knowledge of old categories learned at training may not be applicable to novel ones. [62] consider solving this problem from a causal perspective. Their backdoor adjustment method, however, adjusts the prior knowledge in a black-box manner and cannot tell which specific prior knowledge is harmful and should be suppressed.
|
| 20 |
+
|
| 21 |
+
In this paper, we identify image background as one specific harmful source knowledge for FSL. Empirical studies in [56] suggest that there exists spurious correlations between background and category of images (e.g., birds usually stand on branches, and shells often lie on the beaches; see Fig. 1), which serves as a shortcut knowledge for modern CNN-based vision systems to learn. It is further revealed that background knowledge has positive impact on the performance of in-class classification tasks. As illustrated in the simple example of Fig. 1, images from the same category are more likely to share similar background, making it possible for background knowledge to generalize from training to testing in common classification tasks. For FSL, however, the category gap produces brand-new foreground, background and their combinations at evaluation. The correlations learned at training thus may not be able to generalize and would probably mislead the predictions. We take empirical investigations on the role of image foreground and background in FSL, revealing how image background drastically affects the learning and evaluation of FSL in a negative way.
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: An illustrative example that demonstrates why background information is useful for regular classification but harmful for few-shot learning.
|
| 25 |
+
|
| 26 |
+
Since the background is harmful, it would be good if we could force the model to concentrate on foreground objects at both training and evaluation, but this is not easy since we do not have any prior knowledge of the entity and position of the foreground objects in images. When humans are going to recognize foreground objects of images from the same class, they usually look for a shared local pattern that appears in the majority of images, and recognize patches with this pattern as foreground. This inspires us to design a novel framework, COSOC, to extract foreground of images for both training and evaluation of FSL by seeking shared patterns among images. The approach does not depend on any additional fine-grained supervisions such as bounding boxes or pixel-level labelings.
|
| 27 |
+
|
| 28 |
+
The procedure of foreground extraction of images in the training set is implemented before training. The corresponding algorithm, named Clustering-based Object Seeker (COS), first pre-trains a feature extractor on the training set using contrative learning, which has an outstanding performance, shown empirically in a later section, on the task of discriminating between ground-truth foreground objects. The feature extractor then maps random crops of images—candidates of foreground objects—into a well-shaped feature space. This is followed by runing a clustering algorithm on all of the features of the same class, imitating the procedure of seeking shared local patterns inspired by human behavior. Each cropped patch is then assigned a foreground score according to its distance to the nearest cluster centroid, for determining a sampling probability of that patch in the later formal training of FSL models. For evaluation, we develop Shared Object Concentrator (SOC), an algorithm that applies iterative feature matching within the support set, looking for one crop per image at one time that is most likely to be foreground. The sorted averaging features of obtained crops are further leveraged to match crops of query images so that foreground crops have higher matching scores. A weighted sum of matching scores are finally calculated as classification logits of each query sample. Compared to other potential foreground extracting algorithms such as saliency-based methods, our COS and SOC algorithms have additional capability of capturing shared, inter-image information, performing better in complicated, multi-object scenery. Our methods also have flexibility of dynamically assigning beliefs (probabilities) to all candidate foreground objects, relieving the risk of overconfidence.
|
| 29 |
+
|
| 30 |
+
Our contributions can be summarized as follows. i) By conducting empirical studies on the role of image foreground and background in FSL, we reveal that image background serves as a source of shortcut knowledge which harms the evaluation performance. ii) To solve this problem, we propose COSOC, a framework combining COS and SOC, which can draw the model’s attention to image foreground at both training and evaluation. iii) Extensive experiments for non-transductive FSL tasks demonstrate the effectiveness of our method.
|
| 31 |
+
|
| 32 |
+
# 2 Related Works
|
| 33 |
+
|
| 34 |
+
Few-shot Image Classification. Plenty of previous work tackled few-shot learning in meta-learning framework [18, 50], where a model learns experience about how to solve few-shot learning tasks by tackling pseudo few-shot classification tasks constructed from the training set. Existing methods that ultilize meta-learning can be generally divided into three groups: (1) Optimization-based methods learn the experience of how to optimize the model given few training samples. This kind of methods either meta-learn a good model initialization point [12, 45, 39, 70, 20] or the whole optimization process [40, 58, 34, 27] or both [3, 36]. (2) Hallucination-based methods [16, 54, 46, 67, 25, 9, 26, 37] learn to augment similar support samples in few-shot tasks, thus can greatly alleviate the low-shot problem. (3) Metric-based methods [53, 48, 49, 61, 59] learn to map images into a metric feature space and classify query images by computing feature distances to support images. Among them, several recent works [19, 63, 57, 10] intended to seek correspondence between images either by attention or meta-filter, in order to obtain a more reasonable similarity measure. Our SOC algorithm in one-shot setting is in spirit similar to these methods, in that we both apply pair-wise feature alignment between support and query images, implicitly removing backgrounds that are more likely to be dissimilar across images. SOC differs in multi-shot setting, where potentially useful shared inter-image information in support set exists and can be captured by our SOC algorithm.
|
| 35 |
+
|
| 36 |
+
The Influence of Background. A body of prior work studied the impact of image background on learning-based vision systems from different perspectives. [52] showed initial evidence of the existence of background correlations and how it influences the predictions of vision models. [64, 43] analyzed background dependence for object detection. Another relevant work [4] utilized camera traps for investigating how performance drops when adapting classifiers to unseen cameras with novel backgrounds. They explore the effect of class-independent background (i.e., background changes from training to testing while categories remain the same) on classification performance. Although the problem is also concerned with image background, no shortcut learning of background exists under this setting. This is because under each training camera trap, the classifier must distinguish different categories with background fixed, causing the background knowledge being not useful for predictions of training images. Instead, the learning signal during training pushes the classifier towards ignoring each specific background. The difficulties under this setting lie in the domain shift challenge—the classifier is confident to handle previously existing backgrounds, but lost in novel backgrounds. More recently, [56] systematically explore the role of image background in modern deep-learning-based vision systems through well-designed experiments. The results give clear evidence on the existence of background correlations and identify it as a positive shortcut knowledge for models to learn. Our results, on the contrary, identify background correlations as a negative knowledge in the context of few-shot learning.
|
| 37 |
+
|
| 38 |
+
Contrastive Learning. Recent success on contrastive learning of visual representations has greatly promoted the development of unsupervised learning [6, 17, 15, 5]. The promising performance of contrastive learning relies on the instance-level discrimination loss which maximizes agreement between transformed views of the same image and minimizes agreement between transformed views of different images. Recently there have been some attempts [30, 13, 10, 33, 35, 31] at integrating contrastive learning into the framework of FSL. Although achieving good results, these work struggle to have an in-depth understanding of why contrastive learning has positive effects on FSL. Our work takes a step forward, revealing the advantages of contrastive learning over supervised FSL models in identifying core objects of images.
|
| 39 |
+
|
| 40 |
+
# 3 Empirical Investigation
|
| 41 |
+
|
| 42 |
+
Problem Definition. Few-shot learning consists of a training set $\mathcal { D } _ { B }$ and an evaluation set $\mathcal { D } _ { v }$ which share no overlapping classes. $\mathcal { D } _ { B }$ contains a large amount of labeled data and is usually used at first to train a backbone network $f _ { \theta } ( \cdot )$ . After training, a set of $N$ -way $K$ -shot classification tasks $\mathcal { T } = \{ ( \boldsymbol { S } _ { \tau } , \boldsymbol { \mathcal { Q } } _ { \tau } ) \} _ { \tau = 1 } ^ { N _ { T } }$ are constructed, each by first sampling $N$ classes in $D _ { v }$ and then sampling $K$ and $M$ images from each class to constitute $S _ { \tau }$ and $\mathcal { Q } _ { \tau }$ , respectively. In each task $\tau$ , given the learned backbone fθ(·) and a small support set Sτ = {(xτk,n, yτk,n)}K,Nk,n=1 consisting of $K$ images $x _ { k , n } ^ { \tau }$ and corresponding labels $y _ { k , n } ^ { \tau }$ from each of $N$ classes, a few-shot classification algorithm is designed to classify $M N$ images from the query set $\mathcal { Q } _ { \tau } = \{ ( x _ { m n } ^ { \tau } ) \} _ { m , n = 1 } ^ { M , N }$ .
|
| 43 |
+
|
| 44 |
+
Preparation. To investigate the role of background and foreground in FSL, we need ground-truth image foreground for comparison. However, it is time-consuming to label the whole dataset. Thus we select only a subset $\mathcal { D } _ { \mathrm { n e w } } = ( \mathcal { D } _ { B } , \mathcal { D } _ { v } )$ of miniImageNet [53] and crop each image manually according to the largest rectangular bounding box that contains the foreground object. We denote the uncropped version of the subset as ( $\mathcal { D } _ { B }$ -Ori, $\mathcal { D } _ { v }$ -Ori), and the cropped foreground version as $( \mathcal { D } _ { B } \mathrm { - F G } , \mathbf { \bar { \mathcal { D } } } _ { v } \mathbf { - F G }$ ). Two well-known FSL baselines are selected in our empirical studies: Cosine
|
| 45 |
+
|
| 46 |
+

|
| 47 |
+
Figure 2: 5-way 5-shot FSL performance on different variants of training and evaluation datasets detailed in Sec. 3. (a) Empirical exploration of image foreground and background in FSL using two models: PN and CC. (b) Comparison between CC and Exemplar trained on the full training set of miniImageNet and evaluated on $\mathcal { D } _ { v }$ -Ori and $\mathcal { D } _ { v }$ -FG.
|
| 48 |
+
|
| 49 |
+
Classifier (CC) [14] and Prototypical Networks (PN) [48]. See Appendix A for details of constructing $\mathcal { D } _ { \mathrm { n e w } }$ and a formal introdcution of CC and PN.
|
| 50 |
+
|
| 51 |
+
# 3.1 The Role of Foreground and Background in Few-Shot Image Classification
|
| 52 |
+
|
| 53 |
+
Fig. 2(a) shows the average of 5-way 5-shot classification accuracy obtained by training CC and PN on $\mathcal { D } _ { B }$ -Ori and $\mathcal { D } _ { B }$ -FG, and evaluating on $\mathcal { D } _ { v }$ -Ori and $\mathcal { D } _ { v }$ -FG, respectively. See Appendix F for additional 5-way 1-shot experiments.
|
| 54 |
+
|
| 55 |
+
Category gap disables generalization of background knowledge. It can be first noticed that, under any condition, the performance is consistently and significantly improved if background is removed at the evaluation stage (switch from $\mathcal { D } _ { v }$ -Ori to $\mathcal { D } _ { v }$ -FG). The result implies that background at the evaluation stage in FSL is harmful. This is the opposite of that reported in [56] which shows background helps improve on the performance of traditional classification task, where no category gap exists between training and evaluation. Thus we can infer that the class/distribution gap in FSL disables generalization of background knowledge and degrades performance.
|
| 56 |
+
|
| 57 |
+
Removing background at training prevents shortcut learning. When only foreground is given at evaluation $\mathcal { D } _ { v }$ -FG), the models trained with only foreground ( $\mathcal { D } _ { B }$ -FG) perform much better than those trained with original images $( \mathcal { D } _ { B } \mathrm { - O r i } )$ . This indicates that models trained with original images may not pay enough attention to the foreground object that really matters for classification. Background information at training serves as a shortcut for models to learn and cannot generalize to brand-new classes. In contrast, models trained with only foreground "learn to compare" different objects—a desirable ability for reliable generalization to downstream few-shot learning tasks with out-of-domain classes.
|
| 58 |
+
|
| 59 |
+
Training with background helps models to handle complex scenes. When evaluating on $\mathcal { D } _ { v }$ -Ori, the models trained with original dataset $\mathcal { D } _ { B }$ -Ori are slightly better than those with foreground dataset $\mathcal { D } _ { B }$ -FG. We attribute this to a sort of domain shift: models trained with $\mathcal { D } _ { B }$ -FG never meet images with complex background and do not know how to handle it. In Appendix D.1 we further verify the assertion by showing evaluation accuracy of each class under the above two training situations. Note that since we apply random crop augmentation at training, domain shift does not exist if the models are instead trained on $\mathcal { D } _ { B }$ -Ori and evaluated on $\mathcal { D } _ { v }$ -FG.
|
| 60 |
+
|
| 61 |
+
Simple fusion sampling combines advantages of both sides. One may wish to cut off shortcut learning of background while maintaining adaptability of model to complex scenes. A simple solution may be fusion sampling: given an image as input, choose its foreground version with probability $p$ , and its original version with probability $1 - p$ . We simply set $p$ equal to 0.5. We denote the dataset using this sampling strategy as $\mathcal { D } _ { B }$ -Fuse. As observed in Fig. 2(a), models trained this way indeed combine advantages of both sides: achieving relatively good performance on both $\mathcal { D } _ { v }$ -Ori and $\mathcal { D } _ { v }$ -FG. In Appendix C, we compare the training curves of PN trained on three versions of datasets to further investigate the effectiveness of fusion sampling.
|
| 62 |
+
|
| 63 |
+
The above analysis provides new inspiration for how to improve FSL further: (1) Fusion sampling of foreground and original images could be applied to training. (2) Since background information disturbs evaluation, it is needed to focus on foreground objects or assign image patches, that are more likely to be foreground, a larger weight for classification. Therefore, a foreground object identification mechanism is required at both training (for fusion sampling) and evaluation.
|
| 64 |
+
|
| 65 |
+
# 3.2 Contrastive Learning is Good at Identifying Objects
|
| 66 |
+
|
| 67 |
+
In this subsection, we reveal the potential of contrastive learning in identifying foreground objects, which we will use later for foreground extraction. Given one transformed view of one image, contrastive learning tends to distinguish another transformed view of that same image from thousands of views of other images. A more detailed introduction of contrastive learning is given in Appendix B. The two augmented views of the same image always cover the same object, but probably with different parts, sizes and color. To discriminate two augmented patches from thousands of other image patches, the model has to learn to identify the key discriminative information of the object under varying environment. In this manner, semantic relations among crops of images are explicitly modeled, thereby clustering semantically similar contents automatically. The features of different images are pushed away, while those of similar objects in different images are pulled closer. Thus it is reasonable to speculate that contrastive learning may enable models with better identification of centered foreground object.
|
| 68 |
+
|
| 69 |
+
To verify this, we train CC and contrastive learning models on the whole training set of miniImageNet $\mathcal { D } _ { B }$ -Full) and compare their accuracy on $\mathcal { D } _ { v }$ -Ori and $\mathcal { D } _ { v }$ -FG. The contrastive learning method we use is Exemplar [68], a modified version of MoCo [17]. Fig 2(b) shows that, while the evaluation accuracy of Exemplar on $\mathcal { D } _ { v }$ -Ori is slightly worse than that of CC, Exemplar performs much better when only foreground of images are given at evaluation, affirming that contrastive learning indeed has a better discriminative ability of single centered object. In Appendix D.2, we provide a more in-depth analysis of why contrastive learning has such properties and infer that the shape bias and viewpoint invariance may play an important role.
|
| 70 |
+
|
| 71 |
+
# 4 Rectifying the Shortcut Learning of Background
|
| 72 |
+
|
| 73 |
+
Given the analysis in the previous section, we wish to focus more on image foreground both at training and evaluation. Inspired by how humans recognise foreground objects, we propose COSOC, a framework ultilizing contrastive learning to draw the model’s attention to the foreground objects of images.
|
| 74 |
+
|
| 75 |
+
# 4.1 Clustering-based Object Seeker (COS) with Fusion Sampling for Training
|
| 76 |
+
|
| 77 |
+
Since contrastive learning is good at discriminating foreground objects, we utilize it to extract foreground objects before training. The first step is to pre-train a backbone $f _ { \theta } ( \cdot )$ on the training set $\mathcal { D } _ { B }$ using Exemplar [68]. Then a clustering-based algorithm is used to extract "objects" identified by the pre-trained model. The basic idea is that features of foreground objects in images within one class extracted by contrastive learalgorithm; see a simple example in ng models are similar, therig. 3. All images within the $i$ by can be i-th class in $\mathcal { D } _ { B }$ ified via a form a set $\{ \mathbf { x } _ { n } ^ { i } \} _ { n = 1 } ^ { N }$ $i$
|
| 78 |
+
objects in one class is detailed as follows:
|
| 79 |
+
|
| 80 |
+
1) For each image ${ \bf x } _ { n }$ , we randomly crop it $L$ times to obtain $L$ image patches $\{ \mathbf { p } _ { n , m } \} _ { m = 1 } ^ { L }$ . Each image patch $\mathbf { p } _ { n , m }$ is then passed through the pre-trained model $f _ { \theta }$ and we get a normalized feature vector vn,m $\begin{array} { r } { \mathbf { v } _ { n , m } = \frac { f _ { \theta } ( \mathbf { p } _ { n , m } ) } { | | f _ { \theta } ( \mathbf { p } _ { n , m } ) | | _ { 2 } } \in \mathbb { R } ^ { d } } \end{array}$ .
|
| 81 |
+
|
| 82 |
+
2) We run a clustering algorithm $\mathcal { A }$ on all features vectors of the class and obtain $H$ clusters $\{ \mathbf { z } _ { j } \} _ { j = 1 } ^ { H } = \mathcal { A } ( \{ \mathbf { v } _ { n , m } \} _ { n , m = 1 } ^ { \bar { N } , L ^ { - } } )$ , where $\mathbf { z } _ { j }$ is the feature centroid of the $j$ -th cluster.
|
| 83 |
+
|
| 84 |
+
3) We say an image ${ \bf x } _ { n } \in { \bf z } _ { j }$ , if there exists $k \in [ L ]$ s.t. ${ \bf v } _ { n , k } \in { \bf z } _ { j }$ , where $[ L ] = \{ 1 , 2 , \dots , L \}$ . Let $\begin{array} { r } { l ( \mathbf { z } _ { j } ) = \frac { \# \{ \mathbf { x } | \mathbf { x } \in \mathbf { z } _ { j } \} } { N } } \end{array}$ be the proportion of images in the class that belong to $\mathbf { z } _ { j }$ . If $l ( \mathbf { z } _ { j } )$ is small, then the cluster $\mathbf { z } _ { j }$ is not representative for the whole class and is possibly background. Thus we remove all the cluremaining ers cl $\mathbf { z }$ witters $l ( \mathbf { z } ) < \gamma$ , where represe $\gamma$ is a threshold that controls the generality of clusters. The “objects” of the class that we are looking for. $h$ $\{ \mathbf { z } _ { j } \} _ { j = \alpha _ { 1 } } ^ { \alpha _ { h } }$
|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
Figure 3: Simplified schematic illustration of COS algorithm. We show how we obtain foreground objects from three exemplified images. The value under each crop denotes its foreground score.
|
| 88 |
+
|
| 89 |
+
4) The foreground score of image patch $p _ { n , m }$ is defined as $\begin{array} { r } { s _ { n , m } = 1 - \operatorname* { m i n } _ { j \in [ h ] } | | \mathbf { v } _ { n , m } - \mathbf { z } _ { \alpha _ { j } } | | _ { 2 } / \eta } \end{array}$ , where $\eta \ : = \ : \operatorname* { m a x } _ { n , m } \operatorname* { m i n } _ { j \in [ h _ { c } ] } | | \mathbf { v } _ { n , m } - \mathbf { z } _ { \alpha _ { j } } | | _ { 2 }$ is used to normalize the score into $[ 0 , 1 ]$ . Then top- $\mathbf { \nabla } \cdot \mathbf { k }$ scores of each image xn are obtained as {sn,m}βkm=β1 $\{ s _ { n , m } \} _ { m = \beta _ { 1 } } ^ { \beta _ { k } } = \operatorname { T o p k } ( s _ { n , m } )$ . The corresponding patches {pn,m} km=β1 are seen as possible crops of the foreground object in image ${ \bf x } _ { n }$ , and the foreground scores {sn,m}βkm=β as the confidence. We then use it as prior knowledge to rectify the shortcut learning of background for FSL models.
|
| 90 |
+
|
| 91 |
+
The training strategy resembles fusion sampling introduced before. For an image ${ \bf x } _ { n }$ , the probability that we choose the original version is $1 - \operatorname* { m a x } _ { i \in [ k ] } s _ { n , \beta _ { i } }$ , and the probability of choosing $\mathbf { p } _ { n , \beta _ { j } }$ from top- $\mathbf { \nabla } \cdot \mathbf { k }$ patches is $\big ( s _ { n , \beta _ { j } } / \sum _ { i \in [ k ] } s _ { n , \beta _ { i } } \big ) \cdot \operatorname* { m a x } _ { i \in [ k ] } s _ { n , \beta _ { i } }$ . Then we adjust the chosen image patch and make sure that the least area proportion to the original image keeps as a constant. We use this strategy to train a backbone $f _ { \theta } ( \cdot )$ using a FSL algorithm.
|
| 92 |
+
|
| 93 |
+
# 4.2 Few-shot Evaluation with Shared Object Concentrator (SOC)
|
| 94 |
+
|
| 95 |
+
As discussed before, if the foreground crop of the image is used at evaluation, the performance of FSL model will be boosted by a large margin, serving as an upper bound of the model performance. To approach this upper bound, we propose SOC algorithm to capture foreground objects by seeking shared contents among support images of the same class and query images.
|
| 96 |
+
|
| 97 |
+

|
| 98 |
+
Figure 4: The overall pipeline of step 1 in SOC. Points in one color represent features of crops from one image. The red points are $\omega _ { 1 } , \omega _ { 2 }$ and $\omega _ { 3 }$ .
|
| 99 |
+
|
| 100 |
+
Step 1: Shared Content Searching within Each Class. For each image $\mathbf { x } _ { k }$ within one class $c$ from support set $S _ { \tau }$ , we randomly crop it $V$ times and obtain corresponding candidates $\{ \mathbf { p } _ { k , n } \} _ { n = 1 , . . , V }$ . Each patch $\mathbf { p } _ { k , n }$ is individually sent to the learned backbone $f _ { \theta }$ to obtain a normalized feature vector ${ \mathbf v } _ { k , n }$ . Thus we have totally $K \times V$ feature vectors within a class $c$ Our goal is to obtain a feature vector $\omega _ { 1 }$ that
|
| 101 |
+
|
| 102 |
+
contains maximal shared information of all images in class $c$ . Ideally, $\omega _ { 1 }$ represents the centroid o the most similar $K$ image patches, each from one image, which can be formulated as
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\begin{array} { r l } & { \displaystyle \boldsymbol { \omega } _ { 1 } = \frac { 1 } { K } \sum _ { k = 1 } ^ { K } \mathbf { v } _ { k , \lambda _ { o p t } ( k ) } , } \\ & { \lambda _ { o p t } = \arg \operatorname* { m a x } _ { 1 \leq i < j \leq K } \cos ( \mathbf { v } _ { i , \lambda ( i ) } , \mathbf { v } _ { j , \lambda ( j ) } ) , } \\ & { \quad \quad \lambda { \in } [ K ] ^ { [ V ] } \mathbf { 1 } _ { 1 \leq i < j \leq K } } \end{array}
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
where $\cos ( \cdot , \cdot )$ denotes cosine similarity and $[ K ] ^ { [ V ] }$ denotes the set of functions that take $[ K ]$ as domain and $[ V ]$ as range. While $\lambda _ { o p t }$ can be obtained by enumerating all possible combinations of image patches, the computation complexity of this brute-force method is $\mathcal { O } ( V ^ { K } )$ , which is computation prohibitive when $V$ or $K$ is large. Thus when the computation is not affordable, we turn to use a simplified method that leverages iterative optimization. Instead of seeking for the closest image patches, we directly optimize $\omega _ { 1 }$ so that the sum of minimum distance to patches of each image is minimized, i.e.,
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\omega _ { 1 } = \underset { \omega \in \mathcal { R } ^ { d } } { \arg \operatorname* { m a x } } \sum _ { k = 1 } ^ { K } \underset { n } { \operatorname* { m a x } } [ \cos ( \omega , \mathbf { v } _ { k , n } ) ] ,
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
which can be achieved by iterative optimization algorithms. We apply SGD in our experiments. After optimization, we remove the patch of each image that is most similar to $\omega _ { 1 }$ , and obtain $K \times ( V - 1 )$ feature vectors. Then we repeatedly implement the above optimization process until no features are left, as shown in Fig. 4. We eventually obtain $V$ sorted feature vectors $\{ \omega _ { n } \} _ { n = 1 } ^ { V }$ , which we use to represent the class $c$ . As for the case where shot $K = 1$ , there is no shared inter-image information inside class, so similar to the handling in PN and DeepEMD [63] , we just skip step 1 and use the original $V$ feature vectors.
|
| 115 |
+
|
| 116 |
+
Step 2: Feature Matching for Concentrating on Foreground Object of Query Images. Once the foreground class representations are identified, the next step is to use them to implicitly concentrate on foreground of query images by feature matching. For each image $\mathbf { x }$ in the query set $\mathcal { Q } _ { \tau }$ , we also randomly crop it for $V$ times and obtain $V$ candidate features $\{ \mu _ { n } \} _ { n = 1 } ^ { V }$ . For each class $c$ , we have $V$ sorted representative feature vectors $\{ \omega _ { n } \} _ { n = 1 } ^ { V }$ obtained in step 1. We then match the most similar patches between query features and class features, i.e.,
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
s _ { 1 } = \operatorname* { m a x } _ { 1 \leq i , j \leq V } [ \alpha ^ { j - 1 } \mathrm { c o s } ( \pmb { \mu } _ { i } , \pmb { \omega } _ { j } ) ] ,
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
where $\alpha \leq 1$ is an importance factor. Thus the weight $\alpha ^ { j - 1 }$ decreases exponentially in index $n - 1$ , indicating a decreased belief of each vector representing foreground. Similarly, the two matched class features are removed and the above process repeats until no features left. Finally, the score of $c$ is obtained as a weighted sum of all similarities, i.e., $\begin{array} { r } { S _ { c } = \sum _ { n = 1 } ^ { V } \beta ^ { n - 1 } s _ { n } } \end{array}$ , where $\beta \leq 1$ $\mathbf { x }$ w.r.t. is another importance factor controlling the belief of each crop being foreground objects. In this way, features matched earlier—thus more likely to be foreground—will have higher contributions to the score. The predicted class of $\mathbf { x }$ is the one with the highest score.
|
| 123 |
+
|
| 124 |
+
# 5 Experiments
|
| 125 |
+
|
| 126 |
+
# 5.1 Experiment Setup
|
| 127 |
+
|
| 128 |
+
Dataset. We adopt two benchmark datasets which are the most representative in few-shot learning. The first is miniImageNet [53], a small subset of ILSVRC-12 [44] that contains 600 images within each of the 100 categories. The categories are split into 64, 16, 20 classes for training, validation and evaluation, respectively. The second dataset, tieredImageNet [41], is a much larger subset of ILSVRC12 and is more challenging. It is constructed by choosing 34 super-classes with 608 categories. The super-classes are split into 20, 6, 8 super-classes which ensures separation between training and evaluation categories. The final dataset contains 351, 97, 160 classes for training, validation and evaluation, respectively. On both datasets, the input image size is $8 4 \times 8 4$ for fair comparison.
|
| 129 |
+
|
| 130 |
+
Evaluation Protocols. We follow the 5-way 5-shot (1-shot) FSL evaluation setting. Specifically, 2000 tasks, each contains 15 testing images and 5 (1) training images per class, are randomly sampled from the evaluation set $\mathcal { D } _ { v }$ and the average classification accuracy is computed. This is repeated 5 times and the mean of the average accuracy with $9 5 \%$ confidence intervals is reported.
|
| 131 |
+
|
| 132 |
+
Implementation Details. The backbone we use throughout the article is ResNet-12, which is widely used in few-shot learning. We use Pytorch [38] to implement all our experiments on two NVIDIA 1080Ti GPUs. We train the model using SGD with cosine learning rate schedule without restart to reduce the number of hyperparameters (Which epochs to decay the learning rate). The initial learning rate for training Exemplar is 0.1, and for CC is 0.005. The batch size for Exemplar, CC are 256 and 128, respectively. For miniImageNet, we train Exemplar for 150k iterations, and train CC for $^ \mathrm { 6 k }$ iterations. For tieredImageNet, we train Exemplar for approximately $9 0 0 \mathrm { k }$ iterations, and train CC for $1 2 0 \mathrm { k }$ iterations. We choose $\mathbf { k }$ -means [32] as the clustering algorithm for COS. The threshold $\gamma$ is set to 0.5, and top 3 out of 30 features are chosen per image at the training stage. At the evaluation stage, we crop each image 7 times. The importance factors $\alpha$ and $\beta$ are both set to 0.8.
|
| 133 |
+
|
| 134 |
+
Table 1: Ablative study on miniImageNet. All models are trained on the full training set of miniImageNet. Since the aim of SOC algorithm is to find foreground objects, it is unnecessary to evaluate SOC on the foreground dataset $\mathcal { D } _ { v }$ -FG. FT means finetuning from Exemplar used in COS.
|
| 135 |
+
|
| 136 |
+
<table><tr><td rowspan="2">CC</td><td rowspan="2">FT</td><td rowspan="2">COS</td><td rowspan="2">SOC</td><td colspan="2">Du-Ori</td><td colspan="2">Du-FG</td></tr><tr><td>1-shot</td><td>5-shot</td><td>1-shot</td><td>5-shot</td></tr><tr><td>√</td><td></td><td></td><td></td><td>62.67 ± 0.32</td><td>80.22 ± 0.24</td><td>66.69 ± 0.32</td><td>82.86 ± 0.19</td></tr><tr><td>√</td><td></td><td>√</td><td></td><td>64.76 ± 0.13</td><td>81.18 ± 0.21</td><td>71.13 ± 0.36</td><td>86.21 ± 0.15</td></tr><tr><td>卜</td><td>√</td><td>√</td><td></td><td>65.05 ± 0.06</td><td>81.16 ± 0.17</td><td>71.36 ± 0.30</td><td>86.20 ± 0.14</td></tr><tr><td>厂</td><td></td><td></td><td>√</td><td>64.41 ± 0.22</td><td>81.54 ± 0.28</td><td></td><td>=</td></tr><tr><td></td><td></td><td>√</td><td>√</td><td>69.29 ± 0.12</td><td>84.94 ± 0.28</td><td>-</td><td>-</td></tr></table>
|
| 137 |
+
|
| 138 |
+
Table 2: Comparisons with baselines of foreground extractors using saliency detection algorithms on miniImageNet. For fair comparison, all models in the right column at evaluation use multi-cropping. GT means evaluating with ground truth foreground.
|
| 139 |
+
|
| 140 |
+
<table><tr><td colspan="3">Used for training</td><td colspan="3">Used forevaluation</td></tr><tr><td>Method</td><td>1-shot</td><td>5-shot</td><td>Method</td><td>1-shot</td><td>5-shot</td></tr><tr><td>CC</td><td>62.67 ± 0.32</td><td>80.22 ± 0.24</td><td>COS</td><td>67.23 ± 0.35</td><td>82.79 ± 0.31</td></tr><tr><td>CC+RBD</td><td>63.24 ± 0.41</td><td>80.45 ± 0.37</td><td>COS+RBD</td><td>67.03 ± 0.52</td><td>82.57 ± 0.27</td></tr><tr><td>CC+MBD</td><td>61.50 ± 0.31</td><td>79.12 ± 0.32</td><td>COS+MBD</td><td>62.98 ± 0.45</td><td>79.56 ± 0.38</td></tr><tr><td>CC+FT</td><td>62.71 ± 0.11</td><td>80.06 ± 0.08</td><td>COS+FT</td><td>64.74 ± 0.28</td><td>80.74 ± 0.13</td></tr><tr><td>CC+COS</td><td>64.76 ± 0.13</td><td>81.18 ± 0.21</td><td>COSOC</td><td>69.28 ± 0.49</td><td>85.16 ± 0.42</td></tr><tr><td>1</td><td>1</td><td>=</td><td>COS+GT</td><td>72.71 ± 0.57</td><td>87.43 ± 0.36</td></tr></table>
|
| 141 |
+
|
| 142 |
+
# 5.2 Model Analysis
|
| 143 |
+
|
| 144 |
+
In this subsection, we show the effectiveness of each component of our method. Tab. 1 shows the ablation study conducted on miniImageNet.
|
| 145 |
+
|
| 146 |
+
On the effect of finetuning. Since a feature extractor is pre-trained using contrastive learning in COS, it may help accelerate convergence if we directly finetune from the pre-trained model instead of training from scratch. As shown in line 2-3 in Tab. 1, fintuning gives no improvement on the performance over training from scratch. Thus we adopt finetuning mainly for speeding up convergence $5 \times$ faster).
|
| 147 |
+
|
| 148 |
+
Effectiveness of COS Algorithm. As observed in Tab. 1, When COS is applied on CC, the performance is improved on both versions of datasets. In Fig. 5, we show the curves of training and validation error of CC during training with and without COS. Both models are trained from scratch and validated on the full miniImageNet. We observe that CC sinks into overfitting: the training accuracy drops to zero, and validation accuracy stops improving before
|
| 149 |
+
|
| 150 |
+

|
| 151 |
+
Figure 5: Comparison of training and validation curves between CC with and without COS.
|
| 152 |
+
|
| 153 |
+
the end of the training. Meanwhile, the COS algorithm helps slow down convergence and prevent training accuracy from reaching zero. This makes validation accuracy comparable at first but higher at the end. Our COS algorithm weakens the “background shortcut” for learning, draws model’s attention on foreground objects, and improves upon generalization.
|
| 154 |
+
|
| 155 |
+
Effectiveness of SOC Algorithm. The result in Tab. 1 shows that the SOC algorithm is the key to maximally exploit the potential of good object-discrimination ability. The performance even approaches the upper bound performance obtained by evaluating the model on the ground-truth foreground $\mathcal { D } _ { v }$ -FG. One potential unfairness in our SOC algorithm may lie in the use of multicropping, which could possibly lead to performance improvement for other approaches as well. We ablate this concern in Appendix G, as well as in the comparisons to other methods in the later subsections.
|
| 156 |
+
|
| 157 |
+
Table 3: Comparisons with state-of-the-art models on miniImageNet and tieredImageNet. The average inductive 5-way few-shot classification accuracies with 95 confidence interval are reported. \* indicates methods evaluated using multi-cropping.
|
| 158 |
+
|
| 159 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">backbone</td><td colspan="2">miniImageNet</td><td colspan="2">tieredImageNet</td></tr><tr><td>1-shot</td><td>5-shot</td><td>1-shot</td><td>5-shot</td></tr><tr><td>MetaOptNet [22]</td><td>ResNet-12</td><td>62.64 ±0.82</td><td>78.63 ±0.46</td><td>65.99 ± 0.72</td><td>81.56± 0.53</td></tr><tr><td>DC[28]</td><td>ResNet-12</td><td>62.53 ± 0.19</td><td>79.77 ± 0.19</td><td>=</td><td>1</td></tr><tr><td>CTM[25]</td><td>ResNet-18</td><td>64.12 ± 0.82</td><td>80.51 ± 0.13</td><td>68.41 ± 0.39</td><td>84.28 ± 1.73</td></tr><tr><td>CAM[19]</td><td>ResNet-12</td><td>63.85 ± 0.48</td><td>79.44 ± 0.34</td><td>69.89 ± 0.51</td><td>84.23 ± 0.37</td></tr><tr><td>AFHN[26]</td><td>ResNet-18</td><td>62.38 ± 0.72</td><td>78.16 ± 0.56</td><td>=</td><td>1</td></tr><tr><td>DSN [47]</td><td>ResNet-12</td><td>62.64 ± 0.66</td><td>78.83 ± 0.45</td><td>66.22 ± 0.75</td><td>82.79 ± 0.48</td></tr><tr><td>AM3+TRAML[23]</td><td>ResNet-12</td><td>67.10 ± 0.52</td><td>79.54 ± 0.60</td><td></td><td>=</td></tr><tr><td>Net-Cosine [29]</td><td>ResNet-12</td><td>63.85 ± 0.81</td><td>81.57 ± 0.56</td><td></td><td>=</td></tr><tr><td>CA [2]</td><td>WRN-28-10</td><td>65.92 ± 0.60</td><td>82.85 ± 0.55</td><td>74.40 ± 0.68</td><td>86.61 ± 0.59</td></tr><tr><td>MABAS [21]</td><td>ResNet-12</td><td>65.08 ± 0.86</td><td>82.70 ± 0.54</td><td></td><td></td></tr><tr><td>ConsNet [59]</td><td>ResNet-12</td><td>64.89 ±0.23</td><td>79.95 ± 0.17</td><td></td><td>=</td></tr><tr><td>IEPT[66]</td><td>ResNet-12</td><td>67.05 ± 0.44</td><td>82.90 ±0.30</td><td>72.24 ± 0.50</td><td>86.73 ± 0.34</td></tr><tr><td>MELR[11]</td><td>ResNet-12</td><td>67.40 ± 0.43</td><td>83.40 ±0.28</td><td>72.14 ± 0.51</td><td>87.01 ±0.35</td></tr><tr><td>IER-Distill [42]</td><td>ResNet-12</td><td>67.28 ± 0.80</td><td>84.78 ± 0.52</td><td>72.21 ± 0.90</td><td>87.08 ± 0.58</td></tr><tr><td>LDAMF [57]</td><td>ResNet-12</td><td>67.76 ± 0.46</td><td>82.71 ± 0.31</td><td>71.89 ± 0.52</td><td>85.96 ± 0.35</td></tr><tr><td>FRN [55]</td><td>ResNet-12</td><td>66.45 ± 0.19</td><td>82.83 ± 0.13</td><td>72.06 ± 0.22</td><td>86.89 ± 0.14</td></tr><tr><td>Baseline*[7]</td><td>ResNet-12</td><td>63.83 ± 0.67</td><td>81.38 ± 0.41</td><td></td><td></td></tr><tr><td>DeepEMD* [63]</td><td>ResNet-12</td><td>67.63 ± 0.46</td><td>83.47 ± 0.61</td><td>74.29 ± 0.32</td><td>86.98 ± 0.60</td></tr><tr><td>RFS-Distill* [51]</td><td>ResNet-12</td><td>65.02 ± 0.44</td><td>82.04 ± 0.38</td><td>71.52 ± 0.69</td><td>86.03 ± 0.49</td></tr><tr><td>FEAT*[60]</td><td>ResNet-12</td><td>68.03 ±0.38</td><td>82.99 ± 0.31</td><td></td><td>=</td></tr><tr><td>Meta-baseline* [8]</td><td>ResNet-12</td><td>65.31 ± 0.51</td><td>81.26 ± 0.23</td><td>68.62 ± 0.27</td><td>83.74 ±0.18</td></tr><tr><td>COSOC* (ours)</td><td>ResNet-12</td><td>69.28 ± 0.49</td><td>85.16 ± 0.42</td><td>73.57 ± 0.43</td><td>87.57 ± 0.10</td></tr></table>
|
| 160 |
+
|
| 161 |
+
Note that if we apply only the SOC algorithm on CC, the performance degrades. This indicates that COS and SOC are both necessary: COS provides the discrimination ability of foreground objects and SOC leverages it to maximally boost the performance.
|
| 162 |
+
|
| 163 |
+
# 5.3 Comparison to Saliency-based Foreground Extractors
|
| 164 |
+
|
| 165 |
+
There could be other possible ways of extracting foreground objects. A simple yet possibly strong baseline could be running saliency detection to extract the most salient region in an image, followed by cropping to obtain patches without background. We consider comparing with three classical unsupervised saliency methods—RBD [69], FT [1] and MBD [65]. The cropping threshold is specially tuned. For training, fusion sampling with probability 0.5 is used for unsupervised saliency methods. For evaluation, We replace the original images with crops obtained by unsupervised saliency methods directly for classification. Tab. 2 displays the comparisons of performance using different foreground extraction methods applied at training or evaluation. For fair comparison, all methods are trained from scratch, and all compared baselines are evaluated with multi-cropping (i.e. using the average of features obtained from multiple crops for classification)and tested on the same backbone (COS trained).
|
| 166 |
+
|
| 167 |
+
The results show that: (1) Our method performs consistently much better than the listed unsupervised saliency methods. (2) The performance of different unsupervised saliency methods varies. While RBD gives a small improvement, MBD and FT have negative effect on the performance. The performance severely depends on the effectiveness of unsupervised saliency methods, and is very sensitive to the cropping threshold. Intuitively speaking, saliency detection methods focus on noticeable objects in the image, and might fail when there is another irrelevant salient object in the image (e.g., a man is walking a dog. Dog is the label, but the man is of high saliency). On the contrary, our method focuses on shared objects across images in the same class, thereby avoiding this problem. In addition, our COS algorithm has the ability to dynamically assign foreground scores to different patches, which reduces the risk of overconfidence. One of our main contributions is paving a new way towards improving FSL by rectifying shortcut learning of background, which can be implemented using any effective methods. Given the upper bound with ground truth foreground, we believe there is room to improve and there can be other more effective approaches in the future.
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
Figure 6: Examples of objects obtained with COS from the training set of miniImageNet. The first row shows the original images;the second row shows the picked patch with the highest foreground score.
|
| 171 |
+
|
| 172 |
+

|
| 173 |
+
Figure 7: Visualization examples of the SOC algorithm. The first row displays 5 images that belong to dalmatian and guitar classes respectively from evaluation set of miniImageNet. The second row shows image patches that are picked up from the first round of SOC algorithm. Our method succesfully puts focus on the shared contents/foreground.
|
| 174 |
+
|
| 175 |
+
# 5.4 Comparison to State-of-the-Arts
|
| 176 |
+
|
| 177 |
+
Tab. 3 presents 5-way 1-shot and 5-shot classification results on miniImageNet and tieredImageNet. We compare with state-of-the-art few-shot learning methods. For fair comparison, we reimplement some methods, and evaluate them with multi-cropping. See Appendix G for a detailed study on the influence of multi-cropping. Our method achieves state-of-the-art performance under all settings except for 1-shot task on tieredImageNet, on which the performance of our method is slightly worse than CA, which uses WRN-28-10, a deeper backbone, as the feature extractor.
|
| 178 |
+
|
| 179 |
+
# 5.5 Visualization
|
| 180 |
+
|
| 181 |
+
Fig. 6 and 7 display visualization examples of the COS and SOC algorithms. See more examples in Appendix H. Thanks to the well-designed mechanism of capturing shared inter-image information, the COS and SOC algorithms are capable of locating foreground patches embodied in complicated, multi-object scenery.
|
| 182 |
+
|
| 183 |
+
# 6 Conclusion
|
| 184 |
+
|
| 185 |
+
Few-shot image classification benefits from increasingly more complex network and algorithm design, but little attention has been focused on image itself. In this paper, we reveal that image background serves as a source of harmful knowledge that few-shot learning models easily absorb in. This problem is tackled by our COSOC framework that can draw the model’s attention to image foreground at both training and evaluation. Our method is only one possible solution, and future work may include exploring the potential of unsupervised segmentation or detection algorithms which may be a more reliable alternative of random cropping, or looking for a completely different but better algorithm customized for foreground extraction.
|
| 186 |
+
|
| 187 |
+
# Acknowledgments and Disclosure of Funding
|
| 188 |
+
|
| 189 |
+
Special thanks to Qi Yong, who gives indispensable support on the spirit of this paper. We also thank Junran Peng for his help and fruitful discussions. This paper was partially supported by the National Key Research and Development Program of China (No. 2018AAA0100204), and a key program of fundamental research from Shenzhen Science and Technology Innovation Commission (No. JCYJ20200109113403826).
|
| 190 |
+
|
| 191 |
+
# References
|
| 192 |
+
|
| 193 |
+
salient region detection. In CVPR, 2009.
|
| 194 |
+
[2] Arman Afrasiyabi, Jean-François Lalonde, and Christian Gagné. Associative alignment for few-shot image classification. In ECCV, 2020.
|
| 195 |
+
[3] Sungyong Baik, Myungsub Choi, Janghoon Choi, Heewon Kim, and Kyoung Mu Lee. Meta-learning with adaptive hyperparameters. In NIPS, 2020.
|
| 196 |
+
[4] Sara Beery, Grant Van Horn, and Pietro Perona. Recognition in terra incognita. In ECCV, 2018.
|
| 197 |
+
[5] Mathilde Caron, Ishan Misra, Julien Mairal, Priya Goyal, Piotr Bojanowski, and Armand Joulin. Unsupervised learning of visual features by contrasting cluster assignments. In NIPS, 2020.
|
| 198 |
+
[6] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey E. Hinton. A simple framework for contrastive learning of visual representations. In ICML, 2020. [7] Wei-Yu Chen, Yen-Cheng Liu, Zsolt Kira, Yu-Chiang Frank Wang, and Jia-Bin Huang. A closer look at few-shot classification. In ICLR, 2019.
|
| 199 |
+
[8] Yinbo Chen, Zhuang Liu, Huijuan Xu, Trevor Darrell, and Xiaolong Wang. Meta-baseline: exploring simple meta-learning for few-shot learning. In ICCV, 2021.
|
| 200 |
+
[9] Zitian Chen, Yanwei Fu, Yu-Xiong Wang, Lin Ma, Wei Liu, and Martial Hebert. Image deformation meta-networks for one-shot learning. In CVPR, 2019.
|
| 201 |
+
[10] Carl Doersch, Ankush Gupta, and Andrew Zisserman. Crosstransformers: spatially-aware few-shot transfer. In NIPS, 2020.
|
| 202 |
+
[11] Nanyi Fei, Zhiwu Lu, Tao Xiang, and Songfang Huang. MELR: meta-learning via modeling episode-level relationships for few-shot learning. In ICLR, 2021.
|
| 203 |
+
[12] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In ICML, 2017.
|
| 204 |
+
[13] Yizhao Gao, Nanyi Fei, Guangzhen Liu, Zhiwu Lu, and Tao Xiang. Contrastive prototype learning with augmented embeddings for few-shot learning. In UAI, 2021.
|
| 205 |
+
[14] Spyros Gidaris and Nikos Komodakis. Dynamic few-shot visual learning without forgetting. In CVPR, 2018.
|
| 206 |
+
[15] Jean-Bastien Grill, Florian Strub, Florent Altché, Corentin Tallec, Pierre H. Richemond, Elena Buchatskaya, Carl Doersch, Bernardo Ávila Pires, Zhaohan Guo, Mohammad Gheshlaghi Azar, Bilal Piot, Koray Kavukcuoglu, Rémi Munos, and Michal Valko. Bootstrap your own latent - A new approach to selfsupervised learning. In NIPS, 2020.
|
| 207 |
+
[16] Bharath Hariharan and Ross B. Girshick. Low-shot visual recognition by shrinking and hallucinating features. In ICCV, 2017.
|
| 208 |
+
[17] Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross B. Girshick. Momentum contrast for unsupervised visual representation learning. In CVPR, 2020.
|
| 209 |
+
[18] Timothy Hospedales, Antreas Antoniou, Paul Micaelli, and Amos Storkey. Meta-learning in neural networks: A survey. In TPAMI, 2021.
|
| 210 |
+
[19] Ruibing Hou, Hong Chang, Bingpeng Ma, Shiguang Shan, and Xilin Chen. Cross attention network for few-shot classification. In NIPS, 2019.
|
| 211 |
+
[20] Muhammad Abdullah Jamal and Guo-Jun Qi. Task agnostic meta-learning for few-shot learning. In CVPR, 2019.
|
| 212 |
+
[21] Jaekyeom Kim, Hyoungseok Kim, and Gunhee Kim. Model-agnostic boundary-adversarial sampling for test-time generalization in few-shot learning. In ECCV, 2020.
|
| 213 |
+
[22] Kwonjoon Lee, Subhransu Maji, Avinash Ravichandran, and Stefano Soatto. Meta-learning with differentiable convex optimization. In CVPR, 2019.
|
| 214 |
+
[23] Aoxue Li, Weiran Huang, Xu Lan, Jiashi Feng, Zhenguo Li, and Liwei Wang. Boosting few-shot learning with adaptive margin loss. In CVPR, 2020.
|
| 215 |
+
[24] Fei-Fei Li, Robert Fergus, and Pietro Perona. One-shot learning of object categories. In TPAMI, 2006.
|
| 216 |
+
[25] Hongyang Li, David Eigen, Samuel Dodge, Matthew Zeiler, and Xiaogang Wang. Finding task-relevant features for few-shot learning by category traversal. In CVPR, 2019.
|
| 217 |
+
[26] Kai Li, Yulun Zhang, Kunpeng Li, and Yun Fu. Adversarial feature hallucination networks for few-shot learning. In CVPR, 2020.
|
| 218 |
+
[27] Zhenguo Li, Fengwei Zhou, Fei Chen, and Hang Li. Meta-sgd: Learning to learn quickly for few-shot learning. arXiv preprint arXiv:1707.09835, 2017.
|
| 219 |
+
[28] Yann Lifchitz, Yannis Avrithis, Sylvaine Picard, and Andrei Bursuc. Dense classification and implanting for few-shot learning. In CVPR, 2019.
|
| 220 |
+
[29] Bin Liu, Yue Cao, Yutong Lin, Qi Li, Zheng Zhang, Mingsheng Long, and Han Hu. Negative margin matters: Understanding margin in few-shot classification. In ECCV, 2020.
|
| 221 |
+
[30] Chen Liu, Yanwei Fu, Chengming Xu, Siqian Yang, and Jilin Li. Learning a few-shot embedding model with contrastive learning. In AAAI, 2021.
|
| 222 |
+
[31] Xu Luo, Yuxuan Chen, Liangjian Wen, Lili Pan, and Zenglin Xu. Boosting few-shot classification with view-learnable contrastive learning. In ICME, 2021.
|
| 223 |
+
[32] James MacQueen et al. Some methods for classification and analysis of multivariate observations. In Proceedings of the fifth Berkeley symposium on mathematical statistics and probability, 1967.
|
| 224 |
+
[33] Orchid Majumder, Avinash Ravichandran, Subhransu Maji, Marzia Polito, Rahul Bhotika, and Stefano Soatto. Revisiting contrastive learning for few-shot classification. arXiv preprint arXiv:2101.11058, 2021.
|
| 225 |
+
[34] Tsendsuren Munkhdalai and Hong Yu. Meta networks. In ICLR, 2017.
|
| 226 |
+
[35] Yassine Ouali, Céline Hudelot, and Myriam Tami. Spatial contrastive learning for few-shot classification. In ECML/PKDD, 2021.
|
| 227 |
+
[36] Eunbyung Park and Junier B. Oliva. Meta-curvature. In NIPS, 2019.
|
| 228 |
+
[37] Seong-Jin Park, Seungju Han, Ji-Won Baek, Insoo Kim, Juhwan Song, Haebeom Lee, Jae-Joon Han, and Sung Ju Hwang. Meta variance transfer: Learning to augment from the others. In ICML, 2020.
|
| 229 |
+
[38] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Köpf, 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 NIPS, 2019.
|
| 230 |
+
[39] Aravind Rajeswaran, Chelsea Finn, Sham M. Kakade, and Sergey Levine. Meta-learning with implicit gradients. In NIPS, 2019.
|
| 231 |
+
[40] Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In ICLR, 2017.
|
| 232 |
+
[41] Mengye Ren, Eleni Triantafillou, Sachin Ravi, Jake Snell, Kevin Swersky, Joshua B. Tenenbaum, Hugo Larochelle, and Richard S. Zemel. Meta-learning for semi-supervised few-shot classification. In ICLR, 2018.
|
| 233 |
+
[42] Mamshad Nayeem Rizve, Salman Khan, Fahad Shahbaz Khan, and Mubarak Shah. Exploring complementary strengths of invariant and equivariant representations for few-shot learning. In CVPR, 2021.
|
| 234 |
+
[43] Amir Rosenfeld, Richard S. Zemel, and John K. Tsotsos. The elephant in the room. arXiv preprint arXiv:1808.03305, 2018.
|
| 235 |
+
[44] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael S. Bernstein, Alexander C. Berg, and Fei-Fei Li. Imagenet large scale visual recognition challenge. In IJCV, 2015.
|
| 236 |
+
[45] Andrei A. Rusu, Dushyant Rao, Jakub Sygnowski, Oriol Vinyals, Razvan Pascanu, Simon Osindero, and Raia Hadsell. Meta-learning with latent embedding optimization. In ICLR, 2019.
|
| 237 |
+
[46] Eli Schwartz, Leonid Karlinsky, Joseph Shtok, Sivan Harary, Mattias Marder, Abhishek Kumar, Rogério Schmidt Feris, Raja Giryes, and Alexander M. Bronstein. Delta-encoder: an effective sample synthesis method for few-shot object recognition. In NIPS, 2018.
|
| 238 |
+
[47] Christian Simon, Piotr Koniusz, Richard Nock, and Mehrtash Harandi. Adaptive subspaces for few-shot learning. In CVPR, 2020.
|
| 239 |
+
[48] Jake Snell, Kevin Swersky, and Richard S. Zemel. Prototypical networks for few-shot learning. In NIPS, 2017.
|
| 240 |
+
[49] Flood Sung, Yongxin Yang, Li Zhang, Tao Xiang, Philip H. S. Torr, and Timothy M. Hospedales. Learning to compare: Relation network for few-shot learning. In CVPR, 2018.
|
| 241 |
+
[50] Sebastian Thrun and Lorien Y. Pratt. Learning to learn: Introduction and overview. In Learning to Learn, 1998.
|
| 242 |
+
[51] Yonglong Tian, Yue Wang, Dilip Krishnan, Joshua B. Tenenbaum, and Phillip Isola. Rethinking few-shot image classification: A good embedding is all you need? In ECCV, 2020.
|
| 243 |
+
[52] Antonio Torralba. Contextual priming for object detection. IJCV, 2003.
|
| 244 |
+
[53] Oriol Vinyals, Charles Blundell, Tim Lillicrap, Koray Kavukcuoglu, and Daan Wierstra. Matching networks for one shot learning. In NIPS, 2016.
|
| 245 |
+
[54] Yu-Xiong Wang, Ross B. Girshick, Martial Hebert, and Bharath Hariharan. Low-shot learning from imaginary data. In CVPR, 2018.
|
| 246 |
+
[55] Davis Wertheimer, Luming Tang, and Bharath Hariharan. Few-shot classification with feature map reconstruction networks. In CVPR, 2021.
|
| 247 |
+
[56] Kai Xiao, Logan Engstrom, Andrew Ilyas, and Aleksander Madry. Noise or signal: The role of image backgrounds in object recognition. In ICLR, 2021.
|
| 248 |
+
[57] Chengming Xu, Chen Liu, Li Zhang, Chengjie Wang, Jilin Li, Feiyue Huang, Xiangyang Xue, and Yanwei Fu. Learning dynamic alignment via meta-filter for few-shot learning. In CVPR, 2021.
|
| 249 |
+
[58] Jin Xu, Jean-Francois Ton, Hyunjik Kim, Adam R. Kosiorek, and Yee Whye Teh. Metafun: Meta-learning with iterative functional updates. In ICML, 2020.
|
| 250 |
+
[59] Weijian Xu, yifan xu, Huaijin Wang, and Zhuowen Tu. Attentional constellation nets for few-shot learning. In ICLR, 2021.
|
| 251 |
+
[60] Han-Jia Ye, Hexiang Hu, De-Chuan Zhan, and Fei Sha. Few-shot learning via embedding adaptation with set-to-set functions. In CVPR, 2020.
|
| 252 |
+
[61] Sung Whan Yoon, Jun Seo, and Jaekyun Moon. Tapnet: Neural network augmented with task-adaptive projection for few-shot learning. In ICML, 2019.
|
| 253 |
+
[62] Zhongqi Yue, Hanwang Zhang, Qianru Sun, and Xian-Sheng Hua. Interventional few-shot learning. In NIPS, 2020.
|
| 254 |
+
[63] Chi Zhang, Yujun Cai, Guosheng Lin, and Chunhua Shen. Deepemd: Few-shot image classification with differentiable earth mover’s distance and structured classifiers. In CVPR, 2020.
|
| 255 |
+
[64] Jianguo Zhang, Marcin Marszalek, Svetlana Lazebnik, and Cordelia Schmid. Local features and kernels for classification of texture and object categories: A comprehensive study. IJCV, 2007.
|
| 256 |
+
[65] Jianming Zhang, Stan Sclaroff, Zhe L. Lin, Xiaohui Shen, Brian L. Price, and Radomír Mech. Minimum barrier salient object detection at 80 FPS. In ICCV, 2015.
|
| 257 |
+
[66] Manli Zhang, Jianhong Zhang, Zhiwu Lu, Tao Xiang, Mingyu Ding, and Songfang Huang. IEPT: instancelevel and episode-level pretext tasks for few-shot learning. In ICLR, 2021.
|
| 258 |
+
[67] Ruixiang Zhang, Tong Che, Zoubin Ghahramani, Yoshua Bengio, and Yangqiu Song. Metagan: An adversarial approach to few-shot learning. In NIPS, 2018.
|
| 259 |
+
[68] Nanxuan Zhao, Zhirong Wu, Rynson WH Lau, and Stephen Lin. What makes instance discrimination good for transfer learning? In ICLR, 2021.
|
| 260 |
+
[69] Wangjiang Zhu, Shuang Liang, Yichen Wei, and Jian Sun. Saliency optimization from robust background detection. In CVPR, 2014.
|
| 261 |
+
[70] Luisa M. Zintgraf, Kyriacos Shiarlis, Vitaly Kurin, Katja Hofmann, and Shimon Whiteson. Fast context adaptation via meta-learning. In ICML, 2019.
|
md/train/OGg9XnKxFAH/OGg9XnKxFAH.md
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TRAINING INDEPENDENT SUBNETWORKS FOR ROBUST PREDICTION
|
| 2 |
+
|
| 3 |
+
Rodolphe Jenatton Google Research rjenatton@google.com
|
| 4 |
+
|
| 5 |
+
Marton Havasi∗ Department of Engineering University of Cambridge mh740@cam.ac.uk
|
| 6 |
+
|
| 7 |
+
Stanislav Fort Stanford University sfort1@stanford.edu
|
| 8 |
+
|
| 9 |
+
Jasper Snoek Google Research jsnoek@google.com
|
| 10 |
+
|
| 11 |
+
Jeremiah Zhe Liu Google Research & Harvard University jereliu@google.com
|
| 12 |
+
|
| 13 |
+
Balaji Lakshminarayanan Google Research balajiln@google.com
|
| 14 |
+
|
| 15 |
+
Andrew M. Dai Google Research adai@google.com
|
| 16 |
+
|
| 17 |
+
Dustin Tran
|
| 18 |
+
Google Research
|
| 19 |
+
trandustin@google.com
|
| 20 |
+
|
| 21 |
+
# ABSTRACT
|
| 22 |
+
|
| 23 |
+
Recent approaches to efficiently ensemble neural networks have shown that strong robustness and uncertainty performance can be achieved with a negligible gain in parameters over the original network. However, these methods still require multiple forward passes for prediction, leading to a significant computational cost. In this work, we show a surprising result: the benefits of using multiple predictions can be achieved ‘for free’ under a single model’s forward pass. In particular, we show that, using a multi-input multi-output (MIMO) configuration, one can utilize a single model’s capacity to train multiple subnetworks that independently learn the task at hand. By ensembling the predictions made by the subnetworks, we improve model robustness without increasing compute. We observe a significant improvement in negative log-likelihood, accuracy, and calibration error on CIFAR10, CIFAR100, ImageNet, and their out-of-distribution variants compared to previous methods.
|
| 24 |
+
|
| 25 |
+
# 1 INTRODUCTION
|
| 26 |
+
|
| 27 |
+
Uncertainty estimation and out-of-distribution robustness are critical problems in machine learning. In medical applications, a confident misprediction may be a misdiagnosis that is not referred to a physician as during decision-making with a “human-in-the-loop.” This can have disastrous consequences, and the problem is particularly challenging as patient data deviates significantly from the training set such as in demographics, disease types, epidemics, and hospital locations (Dusenberry et al., 2020b; Filos et al., 2019).
|
| 28 |
+
|
| 29 |
+
Using a distribution over neural networks is a popular solution stemming from classic Bayesian and ensemble learning literature (Hansen & Salamon, 1990; Neal, 1996), and recent advances such as BatchEnsemble and extensions thereof achieve strong uncertainty and robustness performance (Wen et al., 2020; Dusenberry et al., 2020a; Wenzel et al., 2020). These methods demonstrate that significant gains can be had with negligible additional parameters compared to the original model. However, these methods still require multiple (typically, 4-10) forward passes for prediction, leading to a significant runtime cost. In this work, we show a surprising result: the benefits of using multiple predictions can be achieved “for free” under a single model’s forward pass.
|
| 30 |
+
|
| 31 |
+
The insight we build on comes from sparsity. Neural networks are heavily overparameterized models. The lottery ticket hypothesis (Frankle & Carbin, 2018) and other works on model pruning (Molchanov et al., 2016; Zhu & Gupta, 2017) show that one can prune away $70 \%$ of the connections in a neural network without adversely affecting performance. The remaining sparse subnetwork, called the winning ticket, retains its predictive accuracy. This suggests that a neural network has sufficient capacity to fit 3-4 independent subnetworks simultaneously. We show that, using a multi-input multioutput (MIMO) configuration, we can concurrently train multiple independent subnetworks within one network. These subnetworks co-habit the network without explicit separation. The advantage of doing this is that at test time, we can evaluate all of the subnetworks at the same time, leveraging the benefits of ensembles in a single forward pass.
|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
Figure 1: In the multi-input multi-output (MIMO) configuration, the network takes $M = 3$ inputs and gives $M$ outputs. The hidden layers remain unchanged. The black connections are shared by all subnetworks, while the colored connections are for individual subnetworks. (a) During training, the inputs are independently sampled from the training set and the outputs are trained to classify their corresponding inputs. (b) During testing, the same input is repeated $M$ times and the outputs are averaged in an ensemble to obtain the final prediction.
|
| 35 |
+
|
| 36 |
+
Our proposed MIMO configuration only requires two changes to a neural network architecture. First, replace the input layer: instead of taking a single datapoint as input, take $M$ datapoints as inputs, where $M$ is the desired number of ensemble members. Second, replace the output layer: instead of a single head, use $M$ heads that make $M$ predictions based on the last hidden layer. During training, the inputs are sampled independently from the training set and each of the $M$ heads is trained to predict its matching input (Figure 1a). Since, the features derived from the other inputs are not useful for predicting the matching input, the heads learn to ignore the other inputs and make their predictions independently. At test time, the same input is repeated $M$ times. That is, the heads make $M$ independent predictions on the same input, forming an ensemble for a single robust prediction that can be computed in a single forward pass (Figure 1b).
|
| 37 |
+
|
| 38 |
+
The core component of an ensemble’s robustness such as in Deep Ensembles is the diversity of its ensemble members (Fort et al., 2019). While it is possible that a single network makes a confident misprediction, it is less likely that multiple independently trained networks make the same mistake. Our model operates on the same principle. By realizing multiple independent winning lottery tickets, we are reducing the impact of one of them making a confident misprediction. For this method to be effective, it is essential that the subnetworks make independent predictions. We empirically show that the subnetworks use disjoint parts of the network and that the functions they represent have the same diversity as the diversity between independently trained neural networks.
|
| 39 |
+
|
| 40 |
+
# Summary of contributions.
|
| 41 |
+
|
| 42 |
+
1. We propose a multi-input multi-output (MIMO) configuration to network architectures, enabling multiple independent predictions in a single forward pass “for free.” Ensembling these predictions significantly improves uncertainty estimation and robustness with minor changes to the number of parameters and compute cost.
|
| 43 |
+
2. We analyze the diversity of the individual members and show that they are as diverse as independently trained neural networks.
|
| 44 |
+
3. We demonstrate that when adjusting for wall-clock time, MIMO networks achieve new state-ofthe-art on CIFAR10, CIFAR100, ImageNet, and their out-of-distribution variants.
|
| 45 |
+
|
| 46 |
+
# 2 MULTI-INPUT MULTI-OUTPUT NETWORKS
|
| 47 |
+
|
| 48 |
+
The MIMO model is applicable in a supervised classification or regression setting. Denote the set of training examples $\mathbb { X } = \{ ( \pmb { x } ^ { ( n ) } , \pmb { y } ^ { ( n ) } ) \} _ { n = 1 } ^ { N }$ where $\pmb { x } ^ { ( n ) }$ is the $n ^ { t h }$ datapoint with the corresponding label $\pmb { y } ^ { ( n ) }$ and $N$ is the size of the training set. In the usual setting, for an input $_ { \textbf { \em x } }$ , the output of the neural network $\hat { \mathbf { y } }$ is a probability distribution $p _ { \theta } ( \hat { \mathbf { y } } | \boldsymbol { x } )$ ,1 which captures the uncertainty in the predictions of the network. The network parameters $\theta$ are trained using stochastic gradient descent (SGD) to minimize the loss $L ( \theta )$ on the training set, where the loss usually includes the negative log-likelihood and a regularization term $R$ (such as the L2 regularization): $L ( \theta ) =$ $\mathbb { E } ( \mathbf { x } , \mathbf { y } ) \mathrm { { \dot { e } x } } [ - \log { \bar { p _ { \theta } } ( \mathbf { y } | \mathbf { x } ) } ] + R ( \theta )$ .
|
| 49 |
+
|
| 50 |
+

|
| 51 |
+
Figure 2: Illustration of MIMO applied to a synthetic regression problem. (left) Example of MIMO learning $M = 3$ diverse predictors. As $M$ increases, predicting with MIMO comes with a higher bias but a smaller variance (two middle panels respectively). Despite the slight increase in bias, the decrease in variance translates into an improved generalization performance (right).
|
| 52 |
+
|
| 53 |
+
In the MIMO configuration, the network takes $M$ inputs and returns $M$ outputs (Figure 1), where each output is a prediction for the corresponding input. This requires two small changes to the architecture. At the input layer, the $M$ inputs $\mathbf { \bar { \{ x } } _ { 1 } , \dots , \mathbf { x } _ { M } \}$ are concatenated before the first hidden layer is applied and at the output layer, the network gives $M$ predictive distributions $\left\{ p _ { \boldsymbol \theta } ( \mathbf { y } _ { 1 } | \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { M } ) , \ldots , p _ { \boldsymbol \theta } ( \mathbf { y } _ { M } | \mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { M } ) \right\}$ correspondingly. Having $M$ input and $M$ outputs require additional model parameters. The additional weights used in the MIMO configuration account for just a $0 . 0 3 \%$ increase in the total number of parameters and $0 . 0 1 \%$ increase in floating-point operations (FLOPs).2
|
| 54 |
+
|
| 55 |
+
The network is trained similarly to a traditional neural network, with a few key modifications to account for the $M$ inputs and $M$ outputs (Figure 1a). During training, the inputs $\mathbf { x } _ { 1 } , \ldots , \mathbf { x } _ { M }$ are sampled independently from the training set. The loss is the sum of the negative log-likelihoods of the predictions and the regularization term:
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
L _ { M } ( \theta ) = \underset { ( \mathbf { x } _ { 1 } , \mathbf { y } _ { 1 } ) \in \mathbb { X } } { \mathbb { E } } \left[ \sum _ { m = 1 } ^ { M } - \log p _ { \theta } ( \pmb { y _ { m } } | \pmb { x } _ { 1 } , \dots , \pmb { x _ { M } } ) \right] + R ( \theta ) ,
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
which is optimized using stochastic gradient descent. Note that the sum of the log-likelihoods is equal to the log-likelihood of the joint distribution $\begin{array} { r l } { \sum _ { m = 1 } ^ { M } \log p _ { \boldsymbol \theta } ( \pmb y _ { m } | \pmb x _ { 1 } , \dots , \pmb x _ { M } ) } & { = } \end{array}$ $\log p _ { \boldsymbol { \theta } } ( \pmb { y } _ { 1 } , \dots , \pmb { y } _ { M } | \pmb { x } _ { 1 } , \dots , \pmb { x } _ { M } )$ since the input-output pairs are independent. Hence a second interpretation of MIMO is that it is simply training a traditional neural network over $M$ -tuples of independently sampled datapoints.
|
| 62 |
+
|
| 63 |
+
At evaluation time, the network is used to make a prediction on a previously unseen input $\mathbf { x } ^ { \prime }$ . The input $\mathbf { x } ^ { \prime }$ is tiled $M$ times, so $\pmb { x } _ { 1 } = . . . = \pmb { x } _ { M } = \pmb { x } ^ { \prime }$ (Figure 1b). Since all of the inputs are $\mathbf { x } ^ { \prime }$ , each of the outputs independently approximate the predictive distribution $p _ { \boldsymbol \theta } ( \mathbf { y } _ { m } | \mathbf { x } ^ { \prime } , \ldots , \mathbf { x } ^ { \prime } ) \approx p ( \mathbf { y } ^ { \prime } | \mathbf { x } ^ { \prime } )$ (for $m = 1 \ldots M )$ . As an ensembl combined output $\begin{array} { r } { p _ { \boldsymbol { \theta } } ( \mathbf { y } ^ { \prime } | \mathbf { x } ^ { \prime } ) = \frac { 1 } { M } \sum _ { m = 1 } ^ { M } p _ { \boldsymbol { \theta } } ( \mathbf { y } _ { m } | \mathbf { x } ^ { \prime } , \dots , \mathbf { x } ^ { \prime } ) } \end{array}$ e predictive performance,.
|
| 64 |
+
|
| 65 |
+
Unlike Bayesian methods requiring multiple weight samples, or even parameter-efficient methods like BatchEnsemble, MIMO’s advantage is that all of the ensemble members can be calculated in a single forward pass. As a result, MIMO’s wall-clock time is almost equivalent to a standard neural network.
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
Figure 3: Accuracy landscape and function space landscape comparison of individual subnetworks for MIMO (top row) and the naive multiheaded architecture (bottom row). (left): The test accuracy in the weight space section containing $M = 3$ trained subnetworks and the origin. For the MIMO architecture, the individual subnetworks converge to three distinct low-loss basins, while naive multihead leads to the same mode. (middleleft to right): The blue, red and green panels show the disagreement between the three trained subnetworks for the same section of the weight space. For the MIMO architecture, the subnetworks often disagree, while for the naive multihead architecture they are all essentially equivalent.
|
| 69 |
+
|
| 70 |
+
# 2.1 ILLUSTRATION OF MIMO ON A SYNTHETIC REGRESSION EXAMPLE
|
| 71 |
+
|
| 72 |
+
Before applying MIMO to large-scale vision models, we first illustrate its behavior on a simple one-dimensional regression problem. We consider the noisy function from Blundell et al. (2015) (see Figure 2, left), with a training and test set of $N = 6 4$ and 3000 observations respectively. We train a multilayer perceptron with two hidden-layers, composed of (32, 128) units and ReLU activations. 3
|
| 73 |
+
|
| 74 |
+
For different ensemble sizes $M \in \{ 1 , \ldots , 5 \}$ , we evaluate the resulting models in terms of expected mean squared error $\mathcal { E } _ { M }$ . If we denote by $\hat { f } _ { M }$ the regressor with $M$ ensemble members learned over $\mathbb { X }$ , we recall that $\mathcal { E } _ { M } = \mathbb { E } ( \pmb { x } ^ { \prime } , \pmb { y } ^ { \prime } ) \in \mathbb { X } _ { \mathrm { t e s t } } [ \mathbb { E } \pmb { \mathbb { X } } [ ( \hat { f } _ { M } ( \pmb { x } ^ { \prime } , \dots , \pmb { x } ^ { \prime } ) - \pmb { y } ^ { \prime } ) ^ { 2 } ] ]$ , where $\mathbb { E } \mathbb { x } [ \cdot ]$ denotes the expectation over training sets of size $N$ . We make two main observations.
|
| 75 |
+
|
| 76 |
+
First, in the example of $M = 3$ in Figure 2 (left), we can see that MIMO can learn a diverse set of predictors. Second, the diverse predictors obtained by MIMO translate into improved performance, as seen in Figure 2 (right). Moreover, in the regression setting, we can decompose ${ \mathcal { E } } _ { M }$ into its (squared) bias and variance components (Sec. 2.5 in Hastie et al. (2009)). More formally, we have
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\mathcal { E } _ { M } = \underbrace { \mathbb { E } } _ { ( \mathbf { x } ^ { \prime } , y ^ { \prime } ) \in \mathrm { X } _ { \mathrm { e x t } } } \left[ ( \widetilde { f } _ { M } ( \mathbf { x } ^ { \prime } , \dots , \mathbf { x } ^ { \prime } ) - y ^ { \prime } ) ^ { 2 } \right] + \underbrace { \mathbb { E } } _ { ( \mathbf { x } ^ { \prime } , y ^ { \prime } ) \in \mathbb { X } _ { \mathrm { e x t } } } \left[ \mathbb { E } \left[ ( \widetilde { f } _ { M } ( \mathbf { x } ^ { \prime } , \dots , \mathbf { x } ^ { \prime } ) - \hat { f } _ { M } ( \mathbf { x } ^ { \prime } , \dots , \mathbf { x } ^ { \prime } ) ) ^ { 2 } \right] \right]
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
where $\bar { f } _ { M } = \mathbb { E } _ { \mathbb { X } } [ \hat { f } _ { M } ]$ . The bias-variance decomposition nicely captures the strength of MIMO. While learning a neural network over $M$ -tuples induces a slight bias compared to a standard model with $M = 1$ , i.e. the individual members perform slightly worse (Figure 2, middle-left), this is compensated by the diverse predictions of the ensemble members that lead to lower variance (Figure 2, middle-right). MIMO yields an improvement when the model has sufficient capacity to fit $M > 1$ diverse, well-performing ensemble members.
|
| 83 |
+
|
| 84 |
+
<table><tr><td></td><td>Ddisagreement</td><td>DKL</td></tr><tr><td>Naivemultihead</td><td>0.000</td><td>0.000</td></tr><tr><td>TreeNet</td><td>0.010</td><td>0.010</td></tr><tr><td>BatchEnsemble</td><td>0.014</td><td>0.020</td></tr><tr><td>MIMO</td><td>0.032</td><td>0.086</td></tr><tr><td>Deep Ensemble</td><td>0.032</td><td>0.086</td></tr></table>
|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
Figure 4: Analyzing the subnetworks on the CIFAR10 dataset. (left): Histogram of the conditional variances of the pre-activations w.r.t. each input $M = 2$ , ResNet28-10). (middle-left): Scatter plot of the conditional variances of the pre-activations w.r.t. each input. Almost all the pre-activations only have variance with respect to one of the inputs: the subnetwork they that are part of $M = 3$ , ResNet28-10). (middle-right): Training trajectories of the subnetworks. The subnetworks converge to different local optima $M = 3$ , SmallCNN). (right): Diversity of the members $( \mathcal { D } _ { D } )$ in different efficient ensemble models (ResNet 28-10).
|
| 88 |
+
|
| 89 |
+
# 3 UNDERSTANDING THE SUBNETWORKS
|
| 90 |
+
|
| 91 |
+
The mapping of each input-output pair in a MIMO configuration is referred to as a subnetwork. In this section, we show that the subnetworks converge to distinct local optima and they functionally behave as independently trained neural networks.
|
| 92 |
+
|
| 93 |
+
# 3.1 LOSS-LANDSCAPE ANALYSIS
|
| 94 |
+
|
| 95 |
+
Using multiple inputs is the key to training diverse subnetworks. The subnetworks learn independently, since features derived from each input are only useful for the corresponding output. In contrast, in a naive multiheaded architecture, where the input is shared, but the model has separate $M$ outputs, the outputs rely on the same features for prediction, which leads to very low diversity.
|
| 96 |
+
|
| 97 |
+
To showcase this, we replicate a study from Fort et al. (2019). We look at the SmallCNN model (3 convolutional layers with 16, 32, 32 filters respectively) trained on CIFAR-10, and linearly interpolate between the three subnetworks in weight space. In the case of MIMO, we interpolate the input and output layers, since the body of the network is shared, and for the naive multiheaded model, we only interpolate the output layers, since the input and the body of the network is shared. Analogously to Deep Ensembles, the subnetworks trained using MIMO converge to disconnected modes in weight space due to differences in initialization, while in the case of the naive multiheaded model, the subnetworks end up in the same mode (Figure 3, left). Figure 3 (right) shows the disagreement i.e. the probability that the subnetworks disagree on the predicted class. MIMO’s disconnected modes yield diverse predictions, while the predictions of the naive multiheaded model are highly correlated.
|
| 98 |
+
|
| 99 |
+
# 3.2 FUNCTION SPACE ANALYSIS
|
| 100 |
+
|
| 101 |
+
We visualize the training trajectories of the subnetworks in MIMO in function space (similarly to Fort et al. (2019)). As we train the SmallCNN architecture ( $M = 3$ ), we periodically save the predictions on the test set. Once training is finished, we plot the t-SNE projection (Maaten & Hinton, 2008) of the predictions. We observe that the trajectories converge to distinct local optima (Figure 4).
|
| 102 |
+
|
| 103 |
+
For a quantitative measurement of diversity in large scale networks, we look at the average pairwise similarity of the subnetwork’s predictions at test time, and compare against other efficient ensemble methods. The average pairwise similarity is
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\mathcal { D } _ { D } = \mathbb { E } \left[ D \left( p _ { \theta } ( \mathbf { y } _ { 1 } | \mathbf { x } , \mathbf { x } \ldots \mathbf { x } ) , p _ { \theta } ( \mathbf { y } _ { 2 } | \mathbf { x } , \mathbf { x } \ldots \ldots \mathbf { x } ) \right) \right] ,
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
where $D$ is a distance metric between predictive distributions and $( \mathbf { x } , \mathbf { y } ) \in \mathbb { X }$ . We consider two distance metrics. Disagreement: whether the predicted classes agree, $D _ { \mathrm { d i s a g r e e m e n t } } ( P _ { 1 } , P _ { 2 } ) \ =$ $\begin{array} { r c l } { \operatorname { I } ( \arg \operatorname* { m a x } _ { \hat { y } } P _ { 1 } ( \hat { y } ) } & { = } & { \arg \operatorname* { m a x } _ { \hat { y } } P _ { 2 } ( \hat { y } ) ) } \end{array}$ and Kullback–Leibler divergence: $\begin{array} { r l } { D _ { \mathrm { K L } } ( P _ { 1 } , P _ { 2 } ) } & { { } = } \end{array}$ $\mathbb { E } _ { P _ { 1 } } \left[ \log P _ { 1 } ( y ) - \log P _ { 2 } ( y ) \right]$ . When the ensemble members give the same prediction at all test points, both their disagreement and KL divergence are 0.
|
| 110 |
+
|
| 111 |
+
The first efficient ensemble approach we compare against is the aforementioned naive multiheaded model, where the input and the body of the neural network is shared by the ensemble members, but each member has its own output layer. Next, TreeNet (Lee et al., 2015), where the input and the first two residual groups are shared, but the final residual group and the output layer are trained separately for each member. Finally, BatchEnsemble (Wen et al., 2020), where the members share network parameters up to a rank-1 perturbation, which changes information flow through the full network.
|
| 112 |
+
|
| 113 |
+

|
| 114 |
+
Figure 5: The performance of the subnetworks and the ensemble of the subnetworks as the number of subnetworks $( M )$ varies. $M = 1$ is equivalent to a standard neural network (ResNet-28-10).
|
| 115 |
+
|
| 116 |
+
We find that the naive multiheaded model fails to induce diversity: the predictions of its subnetworks are nearly identical on all test points as shown in Figure 4 (right). TreeNet and BatchEnsemble have more diversity, although there is still significant correlation in the predictions. MIMO has better diversity than prior efficient ensemble approaches and it matches the diversity of independently trained neural networks.
|
| 117 |
+
|
| 118 |
+
These results allow us to pinpoint the source of robustness: The robustness of MIMO comes from ensembling the diverse predictions made by the subnetworks, thus MIMO faithfully replicates the behaviour of a Deep Ensemble within one network.
|
| 119 |
+
|
| 120 |
+
# 3.3 SEPARATION OF THE SUBNETWORKS
|
| 121 |
+
|
| 122 |
+
To show that the subnetworks utilize separate parts of the network, we look at the activations and measure how they react to changes in each of the $M$ inputs. Namely, we calculate the conditional variance of each pre-activation in the network with respect to each individual input. For input $\mathbf { x } _ { 1 }$ :
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
\mathrm { 7 a r } ( a _ { i } | \mathbf { x } _ { 2 } ) = \underset { \mathbf { x } _ { 2 } } { \mathbb { E } } [ \mathrm { V a r } ( a _ { i } ( \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } ) ] \quad ( M = 2 ) , \ \mathrm { a n d } \ \mathrm { V a r } ( a _ { i } | \mathbf { x } _ { 2 } , \mathbf { x } _ { 3 } ) = \underset { \mathbf { x } _ { 2 } , \mathbf { x } _ { 3 } } { \mathbb { E } } [ \mathrm { V a r } ( a _ { i } ( \mathbf { x } _ { 1 } , \mathbf { x } _ { 2 } , \mathbf { x } _ { 3 } ) ] \quad ( M = 3 )
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
where $a _ { i }$ is the value of $i$ -th pre-activation in the function of the $M$ inputs. For reference, there are 8190 pre-activations in a ResNet28-10. We can estimate the conditional variance by fixing $\mathbf { x } _ { 1 }$ and calculating the variance of $a _ { i }$ w.r.t. $\mathbf { x } _ { 2 } \in \mathbb { X }$ (when $M = 2$ , $\mathbf { x } _ { 2 } , \mathbf { x } _ { 3 } \in \mathbb { X }$ when $M = 3$ ) and finally averaging over the possible values $\mathbf { x } _ { 1 } \in \mathbb { X }$ . The conditional variance is analogously defined for $\mathbf { x } _ { 2 } , \ldots , \mathbf { x } _ { M }$ . If the conditional variance of an activation is non-zero w.r.t. an input, that means that the activation changes as the input changes and therefore we consider it part of the subnetwork corresponding to the input. If the subnetworks are independent within the network, we expect that the conditional variance of each activation is non-zero w.r.t. one of the inputs, the subnetwork to which it belongs, and close-to zero w.r.t. all the other inputs.
|
| 129 |
+
|
| 130 |
+
When we plot the conditional variances, this is exactly what we see. In Figure 4 (left), we see the histogram of the pre-activations in the network. Each point has two corresponding values: the conditional variance w.r.t. the two inputs. As we can see, all activations have non-zero conditional variance w.r.t. one of the inputs and close-to zero w.r.t. the other. Figure 4 (middle-left) shows the scatterplot of the activations for $M = 3$ . We see that, similarly to $M = 2$ , almost all activations have non-zero conditional variance w.r.t. one of the inputs and close-to zero conditional variance w.r.t. the others. Since almost all activations are part of exactly one of the subnetworks, which we can identify by calculating the conditional variances, we conclude that the subnetworks separate within the network. This implies an extension to Frankle & Carbin (2018): the subnetworks realize separate winning lottery tickets within a single network instance.
|
| 131 |
+
|
| 132 |
+
# 3.4 THE OPTIMAL NUMBER OF SUBNETWORKS
|
| 133 |
+
|
| 134 |
+
A natural question that arises is the ideal number of subnetworks $M$ to fit in a network. Too few subnetworks do not fully leverage the benefits of ensembling, while having too many quickly reaches the network capacity, hurting their individual performances. Ideally, we are looking to fit as many subnetworks as possible without significantly impacting their individual performances.
|
| 135 |
+
|
| 136 |
+
Figure 5 shows the performance of both the individual subnetworks and the ensemble as $M$ varies. $M = 1$ is equivalent to a traditionally trained network i.e. the performance of the subnetwork matches the performance of the ensemble since there is only one subnetwork. As $M$ grows, we can see that the performance of the subnetworks slowly declines as they utilize more and more of the network capacity. The performance of the ensemble, however, peaks between $M = 2$ and $M = 4$ , where the benefits of ensembling outweigh the slight decrease in performance of the individual subnetworks. Interestingly, the accuracy peaks earlier than the log-likelihood, which suggests that ensembling is more beneficial for the latter.
|
| 137 |
+
|
| 138 |
+

|
| 139 |
+
Figure 6: (a) Performance of MIMO $M = 2$ ) as a function of $\rho$ on ImageNet. At $\rho = 0$ , the subnetworks are independent and they are limited by the network capacity. With $\rho > 0$ , the subnetworks are able to share features and better utilize the network capacity. Wide ResNet has $2 \times$ more filters. (b) Repeating examples in the same batch improves convergence and yields a slight boost in performance.
|
| 140 |
+
|
| 141 |
+
In Appendix C, we further illustrate how MIMO exploits the capacity of the network. In particular, we study the performance of MIMO when the regularization increases (both in terms of L1 and L2 regularization), i.e. when the capacity of the network is increasingly constrained. In agreement with our hypothesis that MIMO better utilizes capacity, we observe that its performance degrades more quickly as the regularization intensifies. Moreover, the larger $M$ , the stronger the effect. Interestingly, for the L1 regularization, we can relate the performance of MIMO with the sparsity of the network, strengthening the connection to Frankle & Carbin (2018).
|
| 142 |
+
|
| 143 |
+
# 3.5 INPUT AND BATCH REPETITION
|
| 144 |
+
|
| 145 |
+
MIMO works well by simply adding the multi-input and multi-output configuration to an existing baseline, and varying only one additional hyperparameter (Section 3.4’s number of subnetworks $M$ ). We found two additional hyperparameters can further improve performance, and they can be important when the network capacity is limited.
|
| 146 |
+
|
| 147 |
+
Input repetition Selecting independent examples for the multi-input configuration during training forces the subnetworks not to share any features. This is beneficial when the network has sufficient capacity, but when the network has limited excess capacity, we found that relaxing independence is beneficial. For example, ResNet50 on ImageNet (He et al., 2016) does not have sufficient capacity to support two independent subnetworks $M = 2$ ) in MIMO configuration.
|
| 148 |
+
|
| 149 |
+
Our proposed solution is to relax independence between the inputs. Instead of independently sampling $\mathbf { x } _ { 1 }$ and $\mathbf { x } _ { 2 }$ from the training set during training, they share the same value with probability $\rho$ . That is, $\mathbf { x } _ { 1 }$ is sampled from the training set and $\mathbf { x } _ { 2 }$ is set to be equal to $\mathbf { x } _ { 1 }$ with probability $\rho$ or sampled from the training set with probability $1 - \rho$ . Note that this does not affect the marginal distributions of $\mathbf { x } _ { 1 }$ and $\mathbf { x } _ { 2 }$ , it merely introduces a correlation in their joint distribution.
|
| 150 |
+
|
| 151 |
+
Figure 6a shows the performance as $\rho$ varies. At $\rho = 0$ , the subnetworks are independent but their performance is limited by the network capacity. As $\rho$ grows, the subnetworks share increasingly more features, which improves their performance. However, as $\rho$ approaches 1, the subnetworks become highly correlated and the benefit of ensembling is lost. Unlike ResNet50, Wide ResNet50 has more capacity and benefits less from input repetition (roughly $78 \text{‰}$ vs $7 4 \mathrm { - } 7 7 \%$ ).
|
| 152 |
+
|
| 153 |
+
Batch repetition For stochastic models, most notably MC dropout and variational Bayesian neural nets, drawing multiple approximate posterior samples for each example during training can improve performance as it reduces gradient noise w.r.t. the network’s model uncertainty, e.g., Dusenberry et al. (2020a). We achieve a similar effect by repeating examples in the minibatch: this forms a new minibatch size of, e.g., $5 1 2 \cdot 5$ (batch size and number of batch repetitions respectively). Like the choice of batch size which determines the number of unique examples in the SGD step (Shallue et al., 2018), varying the number of repetitions has an implicit regularization effect. Figure 6b shows performance over the number of batch repetitions, where each batch repetition setting indicates a box plot over a sweep of 12 settings of batch size, learning rate, and ensemble size. Higher repetitions typically yield a slight boost.
|
| 154 |
+
|
| 155 |
+
# 4 BENCHMARKS
|
| 156 |
+
|
| 157 |
+
We described and analyzed MIMO. In this section, we compare MIMO on benchmarks building on Uncertainty Baselines.4 This framework allows us to benchmark the performance and to compare against high-quality, well-optimized implementations of baseline methods (see framework for further baselines than ones highlighted here). We looked at three model/dataset combinations: ResNet28- 10/CIFAR10, ResNet28-10/CIFAR100, and ResNet50/ImageNet. MIMO’s code is open-sourced. 5
|
| 158 |
+
|
| 159 |
+
Baselines Our baselines include the reference implementations of a deterministic deep neural network (trained with SGD), MC-Dropout, BatchEnsemble, and ensemble models, as well as two related models, Naive multihead and TreeNet. Thin networks use half the number of convolutional filters while wide models use double. See Appendix B for the details on the hyperparameters.
|
| 160 |
+
|
| 161 |
+
Metrics To measure robustness, we look at accuracy, negative log-likelihood (NLL), and expected calibration error (ECE) on the IID test set as well as a corrupted test set where the test images are perturbed (e.g. added blur, compression artifacts, frost effects) (Hendrycks & Dietterich, 2019). Appendix D includes ImageNet results for 5 additional out-of-distribution datasets. To measure computational cost, we look at how long it takes to evaluate the model on a TPUv2 core, measured in ms per example.
|
| 162 |
+
|
| 163 |
+
Table 1: ResNet28-10/CIFAR10: The best single forward pass results are highlighted in bold
|
| 164 |
+
|
| 165 |
+
<table><tr><td>Name</td><td>Accuracy (↑)</td><td>NLL (↓)</td><td>ECE (↓)</td><td>cAcc (↑)</td><td>cNLL (↓)</td><td>cECE (↓)</td><td>Prediction time (↓)</td><td>#Forward passes (↓)</td></tr><tr><td>Deterministic</td><td>96</td><td>0.159</td><td>0.023</td><td>76.1</td><td>1.050</td><td>0.153</td><td>0.632</td><td>1</td></tr><tr><td>Dropout</td><td>95.9</td><td>0.160</td><td>0.024</td><td>68.8</td><td>1.270</td><td>0.166</td><td>0.656</td><td>1</td></tr><tr><td>Naive mutlihead (M= 3)</td><td>95.9</td><td>0.161</td><td>0.022</td><td>76.6</td><td>0.969</td><td>0.144</td><td>0.636</td><td>1</td></tr><tr><td>MIMO (M= 3)(This work)</td><td>96.4</td><td>0.123</td><td>0.010</td><td>76.6</td><td>0.927</td><td>0.112</td><td>0.639</td><td>1</td></tr><tr><td>TreeNet (M= 3)</td><td>95.9</td><td>0.158</td><td>0.018</td><td>75.5</td><td>0.969</td><td>0.137</td><td>0.961</td><td>1.5</td></tr><tr><td>BatchEnsemble (M=4)</td><td>96.2</td><td>0.143</td><td>0.021</td><td>77.5</td><td>1.020</td><td>0.129</td><td>2.552</td><td>4</td></tr><tr><td>Thin Ensemble (M=4)</td><td>96.3</td><td>0.115</td><td>0.008</td><td>77.2</td><td>0.840</td><td>0.089</td><td>0.823</td><td>4</td></tr><tr><td>Ensemble (M=4)</td><td>96.6</td><td>0.114</td><td>0.010</td><td>77.9</td><td>0.810</td><td>0.087</td><td>2.536</td><td>4</td></tr></table>
|
| 166 |
+
|
| 167 |
+
<table><tr><td>Name</td><td>Accuracy (↑)</td><td>NLL (↓)</td><td>ECE (↓)</td><td>cAcc (↑)</td><td>cNLL (↓)</td><td>cECE (↓)</td><td>Prediction time (↓)</td><td>#Forward passes (↓)</td></tr><tr><td>Deterministic</td><td>79.8</td><td>0.875</td><td>0.086</td><td>51.4</td><td>2.700</td><td>0.239</td><td>0.632</td><td>1</td></tr><tr><td>Monte Carlo Dropout</td><td>79.6</td><td>0.830</td><td>0.050</td><td>42.6</td><td>2.900</td><td>0.202</td><td>0.656</td><td>1</td></tr><tr><td>Naive mutlihead (M= 3)</td><td>79.5</td><td>0.834</td><td>0.048</td><td>52.1</td><td>2.339</td><td>0.156</td><td>0.636</td><td>1</td></tr><tr><td>MIMO (M= 3)(This work)</td><td>82.0</td><td>0.690</td><td>0.022</td><td>53.7</td><td>2.284</td><td>0.129</td><td>0.639</td><td>1</td></tr><tr><td>TreeNet (M= 3)</td><td>80.8</td><td>0.777</td><td>0.047</td><td>53.5</td><td>2.295</td><td>0.176</td><td>0.961</td><td>1.5</td></tr><tr><td>BatchEnsemble (M= 4)</td><td>81.5</td><td>0.740</td><td>0.056</td><td>54.1</td><td>2.490</td><td>0.191</td><td>2.552</td><td>4</td></tr><tr><td>Thin Ensemble (M= 4)</td><td>81.5</td><td>0.694</td><td>0.017</td><td>53.7</td><td>2.190</td><td>0.111</td><td>0.823</td><td>4</td></tr><tr><td>Ensemble (M=4)</td><td>82.7</td><td>0.666</td><td>0.021</td><td>54.1</td><td>2.270</td><td>0.138</td><td>2.536</td><td>4</td></tr></table>
|
| 168 |
+
|
| 169 |
+
Table 2: ResNet28-10/CIFAR100: The best single forward pass results are highlighted in bold.
|
| 170 |
+
|
| 171 |
+
<table><tr><td>Name</td><td>Accuracy (↑)</td><td>NLL (↓)</td><td>ECE(↓)</td><td>cAcc (↑)</td><td>cNLL (↓)</td><td>cECE(↓)</td><td>Prediction time (↓)</td><td>#Forward passes (↓)</td></tr><tr><td>Deterministic</td><td>76.100</td><td>0.943</td><td>0.039</td><td>40.500</td><td>3.200</td><td>0.105</td><td>0.640</td><td>1</td></tr><tr><td>Naive mutlihead (M = 3)</td><td>76.611</td><td>0.929</td><td>0.043</td><td>40.616</td><td>3.250</td><td>0.122</td><td>0.638</td><td>1</td></tr><tr><td>MIMO (M=2)(p=0.6)(This work)</td><td>77.500</td><td>0.887</td><td>0.037</td><td>43.300</td><td>3.030</td><td>0.106</td><td>0.635</td><td>1</td></tr><tr><td>TreeNet(M=2)</td><td>78.139</td><td>0.852</td><td>0.017</td><td>42.420</td><td>3.052</td><td>0.073</td><td>0.848</td><td>1.5</td></tr><tr><td>BatchEnsemble (M =4)</td><td>76.700</td><td>0.944</td><td>0.049</td><td>41.800</td><td>3.180</td><td>0.110</td><td>2.592</td><td>4</td></tr><tr><td>Ensemble (M=4)</td><td>77.500</td><td>0.877</td><td>0.031</td><td>42.100</td><td>2.990</td><td>0.051</td><td>2.624</td><td>4</td></tr><tr><td>WideDeterministic</td><td>77.885</td><td>0.938</td><td>0.072</td><td>45.000</td><td>3.100</td><td>0.150</td><td>1.674</td><td>1</td></tr><tr><td>Wide MIMO (M=2)(p= 0.6)(This work)</td><td>79.300</td><td>0.843</td><td>0.061</td><td>45.791</td><td>3.048</td><td>0.147</td><td>1.706</td><td>1</td></tr></table>
|
| 172 |
+
|
| 173 |
+
Table 3: ResNet50/ImageNet: The best single forward pass results are highlighted in bold.
|
| 174 |
+
|
| 175 |
+
The metrics show that MIMO significantly outperforms other single forward pass methods on all three benchmarks. It approaches the robustness of a Deep Ensemble, without increasing the computational costs.
|
| 176 |
+
|
| 177 |
+
# 5 RELATED WORK
|
| 178 |
+
|
| 179 |
+
Multi-headed networks have been previously studied by Lee et al. (2015); Osband et al. (2016); Tran et al. (2020). In this approach to efficient ensembles, the input and part of the network are shared by the members while the final few layers and the outputs are separate. The advantage of the approach is that the computational cost is reduced compared to typical ensembles, since many layers are shared, but the ensemble diversity (and resulting performance) is quite lacking. MIMO’s multi-input configuration makes a significant impact as each ensemble member may take different paths throughout the full network. Further, MIMO has lower computational cost than multi-headed approaches, since all of the layers except the first and last are shared.
|
| 180 |
+
|
| 181 |
+
Related efficient ensemble approaches include BatchEnsemble, Rank-1 BNNs, and hyper batch ensembles (Wen et al., 2020; Dusenberry et al., 2020a; Wenzel et al., 2020). In these methods, most of the model parameters are shared among the members, which reduces the memory requirement of the model, but the evaluation cost still requires multiple forward passes. Interestingly, like MIMO, these methods also apply a multi-input multi-output configuration, treating an ensemble of networks as a single bigger network; however, MIMO still outperforms BatchEnsemble. We believe important insights such as Section 3.5’s input independence may also improve these methods.
|
| 182 |
+
|
| 183 |
+
Finally, there are simple heuristics which also retain efficient compute such as data augmentation, temperature scaling, label smoothing, contrastive training. These methods are orthogonal to MIMO and they can provide a performance boost, without increasing the computational cost.
|
| 184 |
+
|
| 185 |
+
# 6 CONCLUSIONS
|
| 186 |
+
|
| 187 |
+
We propose MIMO, a novel approach for training multiple independent subnetworks within a network. We show that the subnetworks separate within the model and that they behave as independently trained neural networks. The key benefits of MIMO are its simplicity, since it does not require significant modifications to the network architecture and it has few hyperparameters, and also its computational efficiency, since it can be evaluated in a single forward pass. Our empirical results confirm that MIMO improves performance and robustness with minor changes to the number of parameters and the compute cost.
|
| 188 |
+
|
| 189 |
+
# ACKNOWLEDGEMENTS
|
| 190 |
+
|
| 191 |
+
Marton Havasi is funded by EPSRC. We thank Ellen Jiang for helping with writing.
|
| 192 |
+
|
| 193 |
+
# REFERENCES
|
| 194 |
+
|
| 195 |
+
Charles Blundell, Julien Cornebise, Koray Kavukcuoglu, and Daan Wierstra. Weight uncertainty in neural networks. In Proceedings of the 32nd International Conference on International Conference on Machine Learning-Volume 37, pp. 1613–1622, 2015.
|
| 196 |
+
|
| 197 |
+
Michael W Dusenberry, Ghassen Jerfel, Yeming Wen, Yi-an Ma, Jasper Snoek, Katherine Heller, Balaji Lakshminarayanan, and Dustin Tran. Efficient and scalable Bayesian neural nets with rank-1 factors. In ICML, 2020a.
|
| 198 |
+
|
| 199 |
+
Michael W Dusenberry, Dustin Tran, Edward Choi, Jonas Kemp, Jeremy Nixon, Ghassen Jerfel, Katherine Heller, and Andrew M Dai. Analyzing the role of model uncertainty for electronic health records. In Proceedings of the ACM Conference on Health, Inference, and Learning, pp. 204–213, 2020b.
|
| 200 |
+
|
| 201 |
+
Angelos Filos, Sebastian Farquhar, Aidan N Gomez, Tim GJ Rudner, Zachary Kenton, Lewis Smith, Milad Alizadeh, Arnoud de Kroon, and Yarin Gal. A systematic comparison of Bayesian deep learning robustness in diabetic retinopathy tasks. arXiv preprint arXiv:1912.10481, 2019.
|
| 202 |
+
|
| 203 |
+
Stanislav Fort, Huiyi Hu, and Balaji Lakshminarayanan. Deep ensembles: A loss landscape perspective. arXiv preprint arXiv:1912.02757, 2019.
|
| 204 |
+
|
| 205 |
+
Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. arXiv preprint arXiv:1803.03635, 2018.
|
| 206 |
+
|
| 207 |
+
Lars Kai Hansen and Peter Salamon. Neural network ensembles. IEEE transactions on pattern analysis and machine intelligence, 12(10):993–1001, 1990.
|
| 208 |
+
|
| 209 |
+
Trevor Hastie, Robert Tibshirani, and Jerome Friedman. The elements of statistical learning: data mining, inference, and prediction. Springer Science & Business Media, 2009.
|
| 210 |
+
|
| 211 |
+
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.
|
| 212 |
+
|
| 213 |
+
Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. In ICLR, 2019.
|
| 214 |
+
|
| 215 |
+
Stefan Lee, Senthil Purushwalkam, Michael Cogswell, David Crandall, and Dhruv Batra. Why M heads are better than one: Training a diverse ensemble of deep networks. arXiv preprint arXiv:1511.06314, 2015.
|
| 216 |
+
|
| 217 |
+
Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-SNE. Journal of machine learning research, 9(Nov):2579–2605, 2008.
|
| 218 |
+
|
| 219 |
+
Pavlo Molchanov, Stephen Tyree, Tero Karras, Timo Aila, and Jan Kautz. Pruning convolutional neural networks for resource efficient inference. arXiv preprint arXiv:1611.06440, 2016.
|
| 220 |
+
|
| 221 |
+
Radford M. Neal. Bayesian Learning for Neural Networks. Springer-Verlag New York, Inc., 1996.
|
| 222 |
+
|
| 223 |
+
Ian Osband, Charles Blundell, Alexander Pritzel, and Benjamin Van Roy. Deep exploration via bootstrapped DQN. In NeurIPS, 2016.
|
| 224 |
+
|
| 225 |
+
Christopher J Shallue, Jaehoon Lee, Joseph Antognini, Jascha Sohl-Dickstein, Roy Frostig, and George E Dahl. Measuring the effects of data parallelism on neural network training. arXiv preprint arXiv:1811.03600, 2018.
|
| 226 |
+
|
| 227 |
+
Linh Tran, Bastiaan S Veeling, Kevin Roth, Jakub Swiatkowski, Joshua V Dillon, Jasper Snoek, Stephan Mandt, Tim Salimans, Sebastian Nowozin, and Rodolphe Jenatton. Hydra: Preserving ensemble diversity for model distillation. arXiv preprint arXiv:2001.04694, 2020.
|
| 228 |
+
|
| 229 |
+
Yeming Wen, Dustin Tran, and Jimmy Ba. BatchEnsemble: an alternative approach to efficient ensemble and lifelong learning. In International Conference on Learning Representations, 2020.
|
| 230 |
+
|
| 231 |
+
Florian Wenzel, Jasper Snoek, Dustin Tran, and Rodolphe Jenatton. Hyperparameter ensembles for robustness and uncertainty quantification. In Neural Information Processing Systems, 2020.
|
| 232 |
+
|
| 233 |
+
Michael Zhu and Suyog Gupta. To prune, or not to prune: exploring the efficacy of pruning for model compression. arXiv preprint arXiv:1710.01878, 2017.
|
| 234 |
+
|
| 235 |
+
A PSEUDOCODE
|
| 236 |
+
|
| 237 |
+
# $\overline { { \mathbf { A l g o r i t h m 1 T r a i n ( \mathbb { X } ) } } }$
|
| 238 |
+
|
| 239 |
+
<table><tr><td colspan="2">1:for t=1...Niter do</td></tr><tr><td>2:</td><td>(x1:M,Y1:M) ~ U(X)</td></tr><tr><td>3:</td><td>Pe(yi|x1:M)...Pe(ym|x1:m) ← MIMO(x1:M)</td></tr><tr><td>4:</td><td></td></tr><tr><td>5:</td><td>0←0-∈VLM(0)</td></tr><tr><td colspan="2">6: end for</td></tr></table>
|
| 240 |
+
|
| 241 |
+
. is the learning rate.
|
| 242 |
+
|
| 243 |
+
# Algorithm 2 Evaluate(x0)
|
| 244 |
+
|
| 245 |
+
# B HYPERPARAMETERS
|
| 246 |
+
|
| 247 |
+
For the ResNet28-10/CIFAR models, we use a batch-size of 512, a decaying learning rate of 0.1 (decay rate 0.1) and L2 regularization 2e-4. The Deterministic, Dropout and Ensemble models are trained for 200 epochs while BatchEnsemble, Naive multihead and TreeNet are trained for 250 epochs.
|
| 248 |
+
|
| 249 |
+
For the ResNet50/ImageNet models, we use a batch-size of 4096 and a decaying learning rate of 0.1 (decay rate 0.1) and L2 regularization 1e-4. The Deterministic, Dropout and Ensemble models are trained for 90 epochs, the BatchEnsemble model is trained for 135 epochs and Naive multihead and TreeNet are trained for 150 epochs.
|
| 250 |
+
|
| 251 |
+
Regarding model specific hyperparameters, Dropout uses a $10 \%$ dropout rate and a single forward pass at evaluation time. Both Ensemble and BatchEnsemble models use $M = 4$ members, since this provides most of the benefits of ensembling without significantly increasing the computational costs. The TreeNet architecture
|
| 252 |
+
|
| 253 |
+
MIMO For MIMO, we use the hyperparameters of the baseline implementations wherever possible. For the ResNet28-10/CIFAR models, we use a batch-size of 512 with decaying learning rate of 0.1 (decay rate 0.1), L2 regularization 3e-4, 250 training epochs, and a batch repetition of 4. For the ResNet50/ImageNet models, we use a batch-size of 4096 with decaying learning rate of 0.1 (decay rate 0.1), L2 regularization 1e-4, 150 training epochs, and batch repetition of 2. This makes the training cost of MIMO comparable to that of BatchEnsemble and Ensemble models. For the ResNet28-10/CIFAR experiments, we use $M = 3$ subnetworks because it performs well in both accuracy and log-likelihood. For ResNet50/ImageNet the model has lower capacity so we used $M = 2$ with $\rho = 0 . 6$ .
|
| 254 |
+
|
| 255 |
+
# C MIMO BETTER EXPLOITS THE NETWORK CAPACITY: PERFORMANCE VERSUS REGULARIZATION STRENGTH
|
| 256 |
+
|
| 257 |
+
In this section, we further illustrate how MIMO better exploits the capacity of the network, through the lens of its sensitivity to regularization.
|
| 258 |
+
|
| 259 |
+
Our experimental protocol is guided by the following rationale
|
| 260 |
+
|
| 261 |
+
• Regularization controls the capacity of the network: the higher the regularization, the more constrained the capacity.
|
| 262 |
+
MIMO makes better use of the capacity of the network: the more ensemble members, the more capacity is exploited.
|
| 263 |
+
• As a result, MIMO should be more sensitive to the constraining of the capacity of the network. And the more ensemble members (i.e., the larger $M$ ), the stronger the effect should be.
|
| 264 |
+
|
| 265 |
+
We consider the ResNet28-10/CIFAR10 and ResNet28-10/CIFAR100 settings used in the main paper where we additionally vary the L1 (respectively L2) regularization while keeping the other L2 (respectively L1) term equal to zero. We display in Figures 7-8 the accuracy and log-likelihood over those regularization paths (averaged over three repetitions of the experiments).
|
| 266 |
+
|
| 267 |
+

|
| 268 |
+
Figure 7: Accuracy and log-likelihood versus varying L1 regularization for $\mathrm { R e s N e t } 2 8 – 1 0$ on CIFAR10 (top row) and CIFAR100 (bottom row). Since MIMO better exploits the capacity of the network, its performance is more sensitive to the constraining of the capacity as the regularization increases. The larger the ensemble size, the stronger the effect.
|
| 269 |
+
|
| 270 |
+
As previously hypothesised, we observe that MIMO is indeed more sensitive to the constraining of the capacity of the network as the regularization increases. Moreover, the larger the ensemble size, the stronger the effect. In the case of the L1 regularization, we can show how the accuracy and log-likelihood evolve with respect to the sparsity of the network6. We report those results in Figure 9 where we can observe the same phenomenon.
|
| 271 |
+
|
| 272 |
+
# D ADDITIONAL IMAGENET OOD RESULTS
|
| 273 |
+
|
| 274 |
+
In the following table, we evaluate trained ResNet-50 models on 7 datasets. ImageNet, ImageNet-C, ImageNet-A, and ImageNetV2 each display three metrics: negative log-likelihood, accuracy, and expected calibration error respectively. ImageNet-C further includes mCE (mean corruption error) in parentheses. ImageNet-Vid-Robust, YTTB-Robust, and ObjectNet use their own pre-defined stability metrics.
|
| 275 |
+
|
| 276 |
+
These experiments were expensive to run, so we were only able to obtain them for a smaller set of methods. We find these results are consistent with the main text’s benchmarks, showing MIMO consistently outperforms methods not only on corrupted images, but also across distribution shifts.
|
| 277 |
+
|
| 278 |
+
<table><tr><td>Name</td><td>ImageNet</td><td>ImageNet-C</td><td>ImageNet-A</td></tr><tr><td>Deterministic</td><td>0.939/76.2%/0.032</td><td>3.21/40.5%/0.103 (75.4%)</td><td>8.09/ 0.7% /0.425</td></tr><tr><td>MIMO (M= 2,ρ = 0.6) Wide MIMO (M=2,ρ = 0.6)</td><td>0.887 / 77.5% /0.037 0.843 /79.3% /0.061</td><td>3.03 /43.3% / 0.106 (71.7%) 3.1/45.0% /0.150 (69.6%)</td><td>7.76 /1.4% /0.432 7.52 /3.3% /0.46</td></tr><tr><td>Name</td><td>ImageNetV2</td><td></td><td>YTTB-Robust ObjectNet</td></tr><tr><td>Deterministic</td><td>1.58 / 64.4% / 0.074</td><td>ImageNet-Vid-Robust 29.9%</td><td>21.7%</td></tr><tr><td></td><td>1.51/ 65.7% / 0.084</td><td></td><td>25.9%</td></tr><tr><td>MIMO (M=2,𝜌= 0.6)</td><td></td><td>31.8%</td><td>22.2% 28.1%</td></tr><tr><td>Wide MIMO (M= 2,p= 0.6)</td><td>1.49 / 67.9% / 0.109</td><td>35.3%</td><td>22.9% 29.5%</td></tr></table>
|
| 279 |
+
|
| 280 |
+
Table 4: ResNet50/ImageNet & ImageNet OOD: The best single forward pass results are highlighted in bold.
|
| 281 |
+
|
| 282 |
+

|
| 283 |
+
Figure 8: Accuracy and log-likelihood versus varying L2 regularization for $\mathrm { R e s N e t } 2 8 – 1 0$ on CIFAR10 (top row) and CIFAR100 (bottom row). Since MIMO better exploits the capacity of the network, its performance is more sensitive to the constraining of the capacity as the regularization increases. The larger the ensemble size, the stronger the effect.
|
| 284 |
+
|
| 285 |
+

|
| 286 |
+
Figure 9: Accuracy and log-likelihood versus varying sparsity of a $\mathrm { R e s N e t } 2 8 – 1 0$ on CIFAR10 (top row) and CIFAR100 (bottom row). Since MIMO better exploits the capacity of the network, its performance is more sensitive to the sparsification of the network (as induced by an increasing L1 regularization). The larger the ensemble size, the stronger the effect.
|
md/train/QjINdYOfq0b/QjINdYOfq0b.md
ADDED
|
@@ -0,0 +1,390 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ABS: AUTOMATIC BIT SHARING FOR MODEL COMPRESSION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We present Automatic Bit Sharing (ABS) to automatically search for optimal model compression configurations (e.g., pruning ratio and bitwidth). Unlike previous works that consider model pruning and quantization separately, we seek to optimize them jointly. To deal with the resultant large designing space, we propose a novel super-bit model, a single-path method, to encode all candidate compression configurations, rather than maintaining separate paths for each configuration. Specifically, we first propose a novel decomposition of quantization that encapsulates all the candidate bitwidths in the search space. Starting from a low bitwidth, we sequentially consider higher bitwidths by recursively adding reassignment offsets. We then introduce learnable binary gates to encode the choice of bitwidth, including filter-wise 0-bit for pruning. By jointly training the binary gates in conjunction with network parameters, the compression configurations of each layer can be automatically determined. Our ABS brings two benefits for model compression: 1) It avoids the combinatorially large design space, with a reduced number of trainable parameters and search costs. 2) It also averts directly fitting an extremely low bit quantizer to the data, hence greatly reducing the optimization difficulty due to the non-differentiable quantization. Experiments on CIFAR-100 and ImageNet show that our methods achieve significant computational cost reduction while preserving promising performance.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Deep neural networks (DNNs) have achieved great success in many challenging computer vision tasks, including image classification (Krizhevsky et al., 2012; He et al., 2016) and object detection (Lin et al., 2017a;b). However, a deep model usually has a large number of parameters and consumes huge amounts of computational resources, which remains great obstacles for many applications, especially on resource-limited devices with limited memory and computational resources, such as smartphones. To reduce the number of parameters and computational overhead, many methods (He et al., 2019; Zhou et al., 2016) have been proposed to conduct model compression by removing the redundancy while maintaining the performance.
|
| 12 |
+
|
| 13 |
+
In the last decades, we have witnessed a lot of model compression methods, such as network pruning (He et al., 2017; 2019) and quantization (Zhou et al., 2016; Hubara et al., 2016). Specifically, network pruning reduces the model size and computational costs by removing redundant modules while network quantization maps the full-precision values to low-precision ones. It has been shown that sequentially perform network pruning and quantization is able to get a compressed network with small model size and lower computational overhead (Han et al., 2016). However, performing pruning and quantization in a separate step may lead to sub-optimal results. For example, the best quantization strategy for the uncompressed network is not necessarily the optimal one after network pruning. Therefore, we need to consider performing pruning and quantization simultaneously.
|
| 14 |
+
|
| 15 |
+
Recently, many attempts have been made to automatically determine the compression configurations of each layer (i.e., pruning ratios, and/or bitwidths), either based on reinforcement learning (RL) (Wang et al., 2019), evolutionary search (ES) (Wang et al., 2020), Bayesian optimization (BO) (Tung & Mori, 2018) or differentiable methods (Wu et al., 2018; Dong & Yang, 2019). In particular, previous differentiable methods formulate model compression as a differentiable searching problem to explore the search space using gradient-based optimization. As shown in Figure 1(a), each candidate operation is maintained as a separate path, which leads to a huge number of trainable parameters and high computational overhead when the search space becomes combinatorially large. Moreover, due to the non-differentiable quantizer and pruning process, the optimization of heavily compressed candidate networks can be more challenging than that in the conventional search problem.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
Figure 1: Multi-path v.s. single-path compression scheme. (a) Multi-path search scheme (Wu et al., 2018): represents each candidate configuration as a separate path and formulates the compression problem as a path selection problem, which gives rise to huge numbers of trainable parameters and high computational overhead when the search space becomes combinatorially large. Here, $z _ { k }$ is the $k$ -bit quantized version of $z$ and $\alpha _ { k } ^ { q }$ is the architecture parameters corresponding to the path of $k$ -bit quantization. (b) Single-path search scheme (Ours): represents each candidate configuration as a subset of a “super-bit” and formulates the compression problem as a subset selection problem, which greatly reduces the computational costs and optimization difficulty from the discontinuity of quantization. Here, the super-bit denotes the highest bitwidth in the search space, $g _ { k } ^ { q }$ is a binary gate that controls the decision of bitwidth, and $\epsilon _ { k }$ is the re-assignment offset (quantized residual error).
|
| 19 |
+
|
| 20 |
+
In this paper, we propose a simple yet effective model compression method named Automatic Bit Sharing (ABS) to reduce the search cost and ease the optimization for the compressed candidates. Inspired by recent single-path neural architecture search (NAS) methods (Stamoulis et al., 2019; Guo et al., 2020), the proposed ABS introduces a novel single-path super-bit to encode all effective bitwidths in the search space instead of formulating each candidate operation as a separate path, as shown in Figure 1(b). Specifically, we build upon the observation that the quantized values of a high bitwidth can share the ones of low bitwidths under some conditions. Therefore, we are able to decompose the quantized representation into the sum of the lowest bit quantization and a series of re-assignment offsets. We then introduce learnable binary gates to encode the choice of bitwidth, including filter-wise 0-bit for pruning. By jointly training the binary gates and network parameters, the compression ratio of each layer can be automatically determined. The proposed scheme has several advantages. First, we only need to solve the search problem as finding which subset of the super-bit to use for each layer’s weights and activations rather than selecting from different paths. Second, we enforce the candidate bitwidths to share the common quantized values. Hence, we are able to optimize them jointly instead of separately, which greatly reduces the optimization difficulty from the discontinuity of discretization.
|
| 21 |
+
|
| 22 |
+
Our main contributions are summarized as follows:
|
| 23 |
+
|
| 24 |
+
• We devise a novel super-bit scheme that encapsulates multiple compression configurations in a unified single-path framework. Relying on the super-bit scheme, we further introduce learnable binary gates to determine the optimal bitwidths (including filter-wise 0-bit for
|
| 25 |
+
pruning). The proposed ABS casts the search problem as subset selection problem, hence significantly reducing the search cost.
|
| 26 |
+
• We formulate the quantized representation as a gated combination of the lowest bitwidth quantization and a series of re-assignment offsets, in which we explicitly share the quantized values between different bitwidths. In this way, we enable the candidate operations to learn jointly rather than separately, hence greatly easing the optimization, especially in the non-differentiable quantization scenario.
|
| 27 |
+
|
| 28 |
+
• We evaluate our ABS on CIFAR-100 and ImageNet over various network architectures. Extensive experiments show that the proposed method achieves the state-of-the-art performance. For example, on ImageNet, our ABS compressed MobileNetV2 achieves $2 8 . 5 \times$ Bit-Operation (BOP) reduction with only $0 . 2 \%$ performance drop on the Top-1 accuracy.
|
| 29 |
+
|
| 30 |
+
# 2 RELATED WORK
|
| 31 |
+
|
| 32 |
+
Network quantization. Network quantization represents the weights, activations and even gradients in low-precision to yield compact DNNs. With low-precision integers or power-of-two representations, the heavy matrix multiplications can be replaced by efficient bitwise operations, leading to much faster test-time inference and lower power consumption. To improve the quantization performance, current methods either focus on designing accurate quantizers by fitting the quantizer to the data (Jung et al., 2019; Zhang et al., 2018; Choi et al., 2018; Cai et al., 2017), or seek to approximate the gradients due to the non-differentiable discretization (Ding et al., 2019; Louizos et al., 2019; Zhuang et al., 2020). Moreover, most previous works assign the same bitwidth for all layers (Zhou et al., 2016; Zhuang et al., 2018a; 2019; Jung et al., 2019; Jin et al., 2019; Li et al., 2020; Esser et al., 2020). Though attractive for simplicity, setting a uniform precision places no guarantee on optimizing network performance since different layers have different redundancy and arithmetic intensity. Therefore, several studies proposed mixed-precision quantization (Wang et al., 2019; Dong et al., 2019; Wu et al., 2018; Uhlich et al., 2020) to set different bitwidths according to the redundancy of each layer. In this paper, based on the proposed quantization decomposition, we devise an approach that can effectively learn appropriate bitwidths for each layer through gradient-based optimization.
|
| 33 |
+
|
| 34 |
+
NAS and pruning. Neural architecture search (NAS) aims to automatically design efficient architectures with low model size and computational costs, either based on reinforcement learning (Pham et al., 2018; Guo et al., 2019), evolutionary search (Real et al., 2019) or gradient-based methods (Liu et al., 2019a). In particular, gradient-based NAS has gained increased popularity, where the search space can be divided into the multi-path design (Liu et al., 2019a; Cai et al., 2019) and single-path formulation (Stamoulis et al., 2019; Guo et al., 2020), depending on whether adding each operation as a separate path or not. While prevailing NAS methods optimize the network topology, the focus of this paper is to search optimal compression ratios for a given architecture. Moreover, network pruning can be treated as fine-grained NAS, which aims at removing redundant modules to accelerate the run-time inference speed, giving rise to methods based on unstructured weight pruning (Han et al., 2016; Guo et al., 2016) or structured channel pruning (He et al., 2017; Zhuang et al., 2018b; Luo et al., 2017). Based on channel pruning, our paper further takes quantization into consideration to generate more compact networks.
|
| 35 |
+
|
| 36 |
+
AutoML for model compression. Recently, much effort has been put into automatically determining either the optimal pruning rate (Tung & Mori, 2018; Dong & Yang, 2019; He et al., 2018), or the bitwidth (Lou et al., 2019; Cai & Vasconcelos, 2020) of each layer via hyper-parameter search, without relying on heuristics. In particular, HAQ (Wang et al., 2019) employs reinforcement learning to search bitwidth strategies with the hardware accelerator’s feedback. Meta-pruning (Liu et al., 2019b) uses meta-learning to generate the weight parameters of the pruned networks and then adopts an evolutionary search algorithm to find the layer-wise sparsity for channel pruning. More recently, several studies (Wu et al., 2018; Cai & Vasconcelos, 2020) have focused on using differentiable schemes via gradient-based optimization.
|
| 37 |
+
|
| 38 |
+
Closely related methods. To further improve the compression ratio, several methods propose to jointly optimize pruning and quantization strategies. In particular, some works only support weight quantization (Tung & Mori, 2018; Ye et al., 2019) or use fine-grained pruning (Yang et al., 2020). However, the resultant networks cannot be implemented efficiently on edge devices. Recently, several methods (Wu et al., 2018; Wang et al., 2020; Ying et al., 2020) have been proposed to consider filter pruning, weight quantization, and activation quantization jointly. In contrast to these methods, we carefully design the compression search space by sharing the quantized values between different candidate configurations, which significantly reduces the search cost and eases the optimization. Compared with those methods that share the similarities of using quantized residual errors (Chen et al., 2010; Gong et al., 2014; Li et al., 2017b; van Baalen et al., 2020), our proposed method recursively uses quantized residual errors to decompose a quantized representation as a set of candidate bitwidths and parameterize the selection of optimal bitwidth via binary gates.
|
| 39 |
+
|
| 40 |
+
Our proposed ABS and Bayesian Bits (van Baalen et al., 2020) are developed concurrently that share a similar idea of quantization decomposition. Critically, our ABS differs from Bayesian Bits in several aspects: 1) The quantization decomposition in our methods can be extended to non-powerof-two bit widths (i.e., $b _ { 1 }$ can be set to arbitrary appropriate integer values), which is a general case of the one in Bayesian Bits. 2) The optimization problems are different. Specifically, we formulate model compression as a single-path subset selection problem while Bayesian Bits casts the optimization of the binary gates to a variational inference problem that requires more relaxations and hyperparameters. 3) Our compressed models with less or comparable BOPs outperform those of Bayesian Bits by a large margin on ImageNet (See Table 2).
|
| 41 |
+
|
| 42 |
+
# 3 PROPOSED METHOD
|
| 43 |
+
|
| 44 |
+
# 3.1 PRELIMINARY: NORMALIZATION AND QUANTIZATION FUNCTION
|
| 45 |
+
|
| 46 |
+
Without loss of generality, given a convolutional layer, let $x$ and $w$ be the activations of the last layer and its weight parameters, respectively. First, for convenience, following (Choi et al., 2018; Bai et al., 2019), we can normalize $x$ and $w$ into scale [0, 1] by $T _ { x }$ and $T _ { w }$ , respectively:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\begin{array} { l } { \displaystyle { z _ { x } = T _ { x } ( x ) = \mathrm { c l i p } \left( \frac { x } { v _ { x } } , 0 , 1 \right) , } } \\ { \displaystyle { z _ { w } = T _ { w } ( w ) = \frac { 1 } { 2 } \left( \mathrm { c l i p } \left( \frac { w } { v _ { w } } , - 1 , 1 \right) + 1 \right) , } } \end{array}
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where the function $\mathrm { c l i p } \left( v , v _ { \mathrm { l o w } } , v _ { \mathrm { u p } } \right) = \mathrm { m i n } ( \mathrm { m a x } ( v , v _ { \mathrm { l o w } } ) , v _ { \mathrm { u p } } )$ clips any number $v$ into the range $[ v _ { \mathrm { l o w } } , v _ { \mathrm { u p } } ]$ , and $v _ { x }$ and $v _ { w }$ are trainable quantization intervals which indicate the range of weights and activations to be quantized. Then, we can apply the following function to quantize the normalized activations and parameters, namely $z _ { x } \in [ 0 , 1 ]$ and $z _ { w } \in [ 0 , 1 ]$ , to discretized ones:
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
D ( z , s ) = s \cdot { \mathrm { r o u n d } } \left( { \frac { z } { s } } \right) ,
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where round $( \cdot )$ returns the nearest integer of a given value and $s$ denotes the normalized step size. Typically, for $k$ -bit quantization, the normalized step size $s$ can be computed by
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
s = { \frac { 1 } { 2 ^ { k } - 1 } } .
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
After doing the $k$ -bit quantization, we shall have $2 ^ { k } - 1$ quantized values. Specifically, we obtain the quantization $Q ( w )$ and $Q ( x )$ by
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\begin{array} { r l } & { Q ( w ) = { \cal T } _ { w } ^ { - 1 } ( D ( z _ { w } , s ) ) = v _ { w } \cdot ( 2 \cdot D ( z _ { w } , s ) - 1 ) , } \\ & { ~ Q ( x ) = { \cal T } _ { x } ^ { - 1 } ( D ( z _ { x } , s ) ) = v _ { x } \cdot D ( z _ { x } , s ) , } \end{array}
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $T _ { w } ^ { - 1 }$ and $T _ { x } ^ { - 1 }$ denote the inverse functions of $T _ { w }$ and $T _ { x }$ , respectively.
|
| 71 |
+
|
| 72 |
+
# 3.2 BIT SHARING DECOMPOSITION
|
| 73 |
+
|
| 74 |
+
Previous methods consider different compression configurations as different paths and reformulate model compression as a path selection problem, which gives rise to a huge number of trainable parameters and high computational costs. In this paper, we seek to conduct filter pruning and quantization simultaneously by solving the following problem:
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
\begin{array} { r } { \underset { \mathbf { W } , \alpha ^ { p } , \alpha ^ { q } } { \operatorname* { m i n } } \mathcal { L } \left( \mathbf { W } , \alpha ^ { p } , \alpha ^ { q } \right) , } \end{array}
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
where $\mathcal { L } ( \cdot )$ denotes some losses, and $\mathbf { W }$ is the parameters of the network. $\alpha ^ { p }$ and $\alpha ^ { q }$ are the pruning and quantization configurations, respectively. As shown in Eq. (7), we propose to encode all compression configurations in a single-path super-bit model (See Figure 1(b)). In the following, we first introduce the bit sharing decomposition and then describe how to learn for compression.
|
| 81 |
+
|
| 82 |
+
To illustrate the bit sharing decomposition, we begin with an example of 2-bit quantization for $z \in \{ z _ { x } , z _ { w } \}$ . Specifically, we consider using the following equation to quantize $z$ to 2-bit:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
z _ { 2 } = D ( z , s _ { 2 } ) , \quad s _ { 2 } = \frac { 1 } { 2 ^ { 2 } - 1 } ,
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
where $z _ { 2 }$ and $s _ { 2 }$ are the quantized value and the step size of 2-bit quantization, respectively. Due to the large step size, the residual error $z - z _ { 2 } \in [ - s _ { 2 } / 2 , s _ { 2 } / 2 ]$ may be big and result in a significant performance drop. To reduce the residual error, an intuitive way is to use a smaller step size, which indicates that we quantize $z$ to a higher bitwidth. Since the step size $s _ { 4 } = 1 / ( 2 ^ { 4 } - 1 )$ in 4-bit quantization is a divisor of the step size $s _ { 2 }$ in 2-bit quantization, the quantized values of 2-bit quantization are among the ones of 4-bit quantization. In fact, based on 2-bit quantization, the 4-bit counterpart introduces additional unshared quantized values. In particular, if $z _ { 2 }$ has zero residual error, then 4-bit quantization maps $z$ to the shared quantized values (i.e., $z _ { 2 }$ ). In contrast, if $z _ { 2 }$ is with non-zero residual error, 4-bit quantization is likely to map $z$ to the unshared quantized values. In this case, 4-bit quantization can be regarded as performing quantized value re-assignment based on $z _ { 2 }$ . Such a re-assignment process can be formulated as follows:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
z _ { 4 } = z _ { 2 } + \epsilon _ { 4 } ,
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where $z _ { 4 }$ is the 4-bit quantized value and $\epsilon _ { 4 }$ is the re-assignment offset based on $z _ { 2 }$ . To ensure that the results of re-assignment fall into the unshared quantized values, the re-assignment offset $\epsilon _ { 4 }$ must be an integer multiplying of the 4-bit step size $s _ { 4 }$ . Formally, $\epsilon _ { 4 }$ can be computed by performing 4-bit quantization on the residual error of $z _ { 2 }$ :
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\epsilon _ { 4 } = D ( z - z _ { 2 } , s _ { 4 } ) , ~ s _ { 4 } = \frac { s _ { 2 } } { 2 ^ { 2 } + 1 } = \frac { 1 } { 2 ^ { 4 } - 1 } .
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
Therefore, according to Eq. (9), a 4-bit quantized value can be decomposed into the 2-bit representation and its re-assignment offset. Similarly, an 8-bit quantized value can also be decomposed into the 4-bit representation and its corresponding re-assignment offset. In this way, we can generalize the idea of decomposition to arbitrary effective bitwidths as follows.
|
| 101 |
+
|
| 102 |
+
Definition 1 (Quantization decomposition) Let $z \in [ 0 , 1 ]$ be a normalized full-precision input, $\big \{ b _ { 1 } , . . . , b _ { K } \big \}$ be a sequence of candidate bitwidths, and $b _ { 1 } ~ < ~ b _ { 2 } , . . . , < ~ b _ { K - 1 } < b _ { K }$ . We use the following quantized $\widehat { z }$ to approximate $z$ :
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
{ \widehat { z } } = z _ { b _ { 1 } } + \sum _ { j = 2 } ^ { K } \epsilon _ { b _ { j } } , \quad { \mathrm { w h e r e ~ } } \epsilon _ { b _ { j } } = D ( z - z _ { b _ { j - 1 } } , s _ { b _ { j } } ) , \quad s _ { b _ { j } } = { \frac { s _ { b _ { j - 1 } } } { 2 ^ { b _ { j - 1 } } + 1 } } = { \frac { 1 } { 2 ^ { b _ { j } } - 1 } } .
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
In other words, the quantized approximation $\widehat { z }$ can be decomposed into the sum of the lowest bit bquantization and a series of recursive re-assignment offsets. In Definition (1), to enable quantized value re-assignment, we need to constrain that $s _ { b _ { j - 1 } }$ is divisible by $s _ { b _ { j } }$ , which requires the bitwidths $b _ { j } ( j > 1 )$ to satisfy the following relation:
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
b _ { j } = 2 ^ { j - 1 } \cdot b _ { 1 } .
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
In fact, the bitwidth $b _ { 1 }$ can be set to arbitrary appropriate integer values (e.g., 1, 2, 3, etc.). To get a hardware-friendly compressed network1, we set $b _ { 1 }$ to 2, which ensures that all the decomposition bitwidths are power-of-two. Moreover, since 8-bit quantization achieves lossless performance compared with the full-precision counterpart (Zhou et al., 2016), we only consider those candidate bitwidths that are not greater than 8-bit. In other words, we constrain the value of $j$ to [1, 3].
|
| 115 |
+
|
| 116 |
+
Remark 1 The proposed bit sharing decomposition has several advantages. First, the proposed method only needs to maintain a small number of trainable parameters, which greatly reduces the computational costs during search. Second, we are able to directly extract a low-precision representation from its higher precision, which allows optimizing different bitwidths jointly and ease the discontinuous optimization due to quantization.
|
| 117 |
+
|
| 118 |
+
# 3.3 LEARNING FOR COMPRESSION
|
| 119 |
+
|
| 120 |
+
Note that different layers have different levels of redundancy, which indicates that different layers may choose different subsets of the quantized values. To learn the quantized approximation for each layer, we introduce a layer-wise binary quantization gate $g _ { b _ { j } } ^ { q } \in \{ 0 , 1 \}$ on each of the re-assignment offsets in Eq. (11) to encode the choice of the quantization bitwidth, which can be formulated as
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\begin{array} { c } { g _ { b _ { j } } ^ { q } = \mathbb { 1 } \left( | | z - z _ { b _ { j - 1 } } | | - \alpha _ { b _ { j } } ^ { q } > 0 \right) , } \\ { \widehat { z } = z _ { b _ { 1 } } + g _ { b _ { 2 } } ^ { q } \big ( \epsilon _ { b _ { 2 } } + \cdot \cdot \cdot + g _ { b _ { K - 1 } } ^ { q } \big ( \epsilon _ { b _ { K - 1 } } + g _ { b _ { K } } ^ { q } \epsilon _ { b _ { K } } \big ) \big ) , } \end{array}
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
where $\mathbb { 1 } ( \cdot )$ is the indicator function and $\alpha _ { b _ { j } } ^ { q }$ is a layer-wise threshold that controls the choice of bitwidth. Specifically, if the quantization error $\left| \left| z \textrm { -- } z _ { b _ { j - 1 } } \right| \right|$ is greater than the threshold $\alpha _ { b _ { j } } ^ { q }$ , we activate the corresponding quantization gate to increase the bitwidth so that the residual error can be reduced, and vice versa.
|
| 127 |
+
|
| 128 |
+
Note that from Eq. (13), we can consider the filter pruning as 0-bit filter-wise quantization. To avoid the prohibitively large filter-wise search space, we propose to divide the filters into groups based on indexes and consider the group-wise sparsity instead. To be specific, we introduce a binary gate $g _ { c } ^ { p }$ for each group to encode the choice of pruning, which can be formulated as follows:
|
| 129 |
+
|
| 130 |
+
$$
|
| 131 |
+
\begin{array} { c } { g _ { c } ^ { p } = \mathbb { 1 } ( | | w _ { c } | | - \alpha ^ { p } > 0 ) , } \\ { \widehat { z } _ { c } = g _ { c } ^ { p } \cdot \big ( z _ { c , b _ { 1 } } + g _ { b _ { 2 } } ^ { q } \big ( \epsilon _ { c , b _ { 2 } } + \cdot \cdot \cdot + g _ { b _ { K - 1 } } ^ { q } ( \epsilon _ { c , b _ { K - 1 } } + g _ { b _ { K } } ^ { q } \epsilon _ { c , b _ { K } } ) \big ) \big ) , } \end{array}
|
| 132 |
+
$$
|
| 133 |
+
|
| 134 |
+
where $\widehat { z } _ { c }$ is the $c$ -th group of quantized filters and $\epsilon _ { c , b _ { j } }$ is the corresponding re-assignment offset by bquantizing the residual error $z _ { c } - z _ { c , b _ { j - 1 } }$ . Here, $\alpha ^ { p }$ is a layer-wise threshold for filter pruning. Following PFEC (Li et al., 2017a), we use $\ell _ { 1 }$ -norm to evaluate the importance of the filter. Specifically, if a group of filters is important, the corresponding pruning gate will be activated and vice versa.
|
| 135 |
+
|
| 136 |
+
Note that both quantization and pruning have their corresponding thresholds. Instead of manually setting the thresholds, we propose to learn them via gradient descent. However, the indicator function in Eq. (13) is non-differentiable. To address this, we use straight-through estimator (STE) (Bengio et al., 2013; Zhou et al., 2016) to approximate the gradient of the indicator function $\mathbb { 1 } ( \cdot )$ using the gradient of the sigmoid function $\sigma ( \cdot )$ , which can be formulated as:
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\frac { \partial g } { \partial \alpha } = \frac { \partial \mathbb { 1 } \left( A - \alpha \right) } { \partial \alpha } \approx \frac { \partial \sigma \left( A - \alpha \right) } { \partial \alpha } = - \sigma \left( A - \alpha \right) \left( 1 - \sigma ( A - \alpha ) \right) ,
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
where $g$ is the output of a binary gate, $\alpha \in \{ \alpha ^ { p } , \alpha ^ { q } \}$ is the corresponding threshold and $A$ denotes some specific metrics (i.e., $\ell _ { 1 }$ -norm of the filter or the quantization error). By jointly training the binary gates and the network parameters, the pruning ratio and bitwidth of each layer can be automatically determined. However, the gradient approximation of the binary gate inevitably introduces noisy signals, which can be even more severe when we quantize both weights and activations. Thus, we propose to train the binary gates of weights and activations in an alternative manner. Specifically, when training the binary gates of weights, we fix the binary gates of activations, and vice versa.
|
| 143 |
+
|
| 144 |
+
Search Space for Model Compression. Given an uncompressed network with $L$ layers, we use $C _ { l }$ to denote the number of filters at the $l$ -th layer. To obtain the compressed model, we first divide the filters of each layer into groups and then search for the optimal bitwidths for the considered layer. Let $B$ be the number of filters in a group. For any layer $l$ , there would be $\displaystyle \left\lfloor \frac { C _ { l } } { B } \right\rfloor$ groups in total. Since we quantize both weights and activations, given $K$ candidate bitwidths, there are $K ^ { 2 }$ different quantization configurations for each layer. Thus, for the whole network with $L$ layers, the size of the search space $\Omega$ can be computed by
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
\left| \Omega \right| = \prod _ { l = 1 } ^ { L } \left( K ^ { 2 } \times \left\lfloor \frac { C _ { l } } { B } \right\rfloor \right) .
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
Eq. (16) indicates that the search space is large enough to cover the potentially good configurations.
|
| 151 |
+
|
| 152 |
+
Training Objective. To design a hardware-efficient network, the objective function in Eq. (7) should reflect both the accuracy of the compressed network and its computational costs. Following (Cai et al., 2019), we train the network and architecture by minimizing following loss function:
|
| 153 |
+
|
| 154 |
+
$$
|
| 155 |
+
{ \mathcal { L } } ( \mathbf { W } , \alpha ^ { p } , \alpha ^ { q } ) = { \mathcal { L } } _ { c e } ( \mathbf { W } , \alpha ^ { p } , \alpha ^ { q } ) + \lambda \log R ( \mathbf { W } , \alpha ^ { p } , \alpha ^ { q } ) ,
|
| 156 |
+
$$
|
| 157 |
+
|
| 158 |
+
where $\mathcal { L } _ { c e } ( \cdot )$ is the cross-entropy loss, $R ( \cdot )$ is the computational costs of the network and $\lambda$ is a balancing hyper-parameter. Following single-path NAS (Stamoulis et al., 2019), we use a similar formulation of computational costs to preserve the differentiability of the objective function. The details of the differentiable computational loss can be found in Appendix B. Once the training is finished, we can obtain the compressed network by selecting those filters and bitwidths with activated binary gates. Then, we fine-tune the compressed network to compensate the accuracy loss.
|
| 159 |
+
|
| 160 |
+
Table 1: Comparisons of different methods on CIFAR-100. “W” and “A” represent the average quantization bitwidth of the weights and activations, respectively.
|
| 161 |
+
|
| 162 |
+
<table><tr><td>Network</td><td>Method</td><td>BOPs (M)</td><td>BOP comp.ratio</td><td>WIA</td><td>Top-1 Acc. (%)</td><td>Top-5 Acc. (%)</td></tr><tr><td rowspan="7">ResNet-20</td><td>Full-precision</td><td>41798.6</td><td>1.0</td><td>32.0/32.0</td><td>67.5</td><td>90.8</td></tr><tr><td>4-bit precision</td><td>674.6</td><td>62.0</td><td>4.0/4.0</td><td>67.8±0.3</td><td>90.4±0.2</td></tr><tr><td>DQ</td><td>1180.0</td><td>35.4</td><td>5.3/6.1</td><td>67.7±0.6</td><td>90.4±0.5</td></tr><tr><td>HAQ</td><td>653.4</td><td>64.0</td><td>3.7/4.2</td><td>67.7±0.1</td><td>90.4±0.3</td></tr><tr><td>DNAS</td><td>660.0</td><td>62.9</td><td>4.6/3.8</td><td>67.8±0.3</td><td>90.4±0.2</td></tr><tr><td>ABS-P(Ours)</td><td>28586.5</td><td>1.5</td><td>32.0/32.0</td><td>67.9±0.1</td><td>90.7±0.2</td></tr><tr><td>ABS-Q(Ours) ABS (Ours)</td><td>649.5</td><td>64.4</td><td>4.4/4.2</td><td>68.1±0.1</td><td>90.5±0.0</td></tr><tr><td></td><td>630.6</td><td></td><td>66.3</td><td>4.4/4.2</td><td>68.1±0.3</td><td>90.6±0.2</td></tr><tr><td rowspan="7">ResNet-56</td><td>Full-precision</td><td>128771.7</td><td>1.0</td><td>32.0/32.0</td><td>71.7</td><td>92.2</td></tr><tr><td>4-bit precision</td><td>2033.6</td><td>63.3</td><td>4.0/4.0</td><td>70.9±0.3</td><td>91.2±0.4</td></tr><tr><td>DQ</td><td>2222.9</td><td>57.9</td><td>3.8 /4.6</td><td>70.7±0.2</td><td>91.4±0.4</td></tr><tr><td>HAQ</td><td>2014.9</td><td>63.9</td><td>3.3/4.9</td><td>71.2±0.1</td><td>91.1±0.2</td></tr><tr><td>DNAS</td><td>2035.7</td><td>65.3</td><td>5.3/3.2</td><td>71.2±0.2</td><td>91.3±0.3</td></tr><tr><td>ABS-P(Ours)</td><td>87021.6</td><td>1.5</td><td>32.0/32.0</td><td>71.5±0.1</td><td>91.8±0.2</td></tr><tr><td>ABS-Q(Ours)</td><td>1970.7</td><td>65.3</td><td>4.1/4.0</td><td>71.5±0.2</td><td>91.5±0.2</td></tr><tr><td></td><td>ABS (Ours)</td><td>1918.8</td><td>67.1</td><td>4.2/4.1</td><td>71.6±0.1</td><td>91.8±0.4</td></tr></table>
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 2: Results of different compressed networks with different BOPs and memory footprints. We use different methods to compress ResNet-56 and report the results on CIFAR-100.
|
| 166 |
+
|
| 167 |
+
# 4 EXPERIMENTS
|
| 168 |
+
|
| 169 |
+
Compared methods. To investigate the effectiveness of the proposed method, we consider the following methods for comparisons: ABS: our proposed method with joint pruning and quantization; ABS-Q: ABS with quantization only; ABS-P: ABS with pruning only; and several state-ofthe-art model compression methods including HAQ (Wang et al., 2019), DQ (Uhlich et al., 2020), DJPQ (Ying et al., 2020), Bayesian Bits (van Baalen et al., 2020) and DNAS (Wu et al., 2018). We measure the performance of different methods in terms of the Top-1 and Top-5 accuracy. Following (Guo et al., 2020; Ying et al., 2020), we measure the computational costs by the Bit-Operation (BOP) count. The BOP compression ratio is defined as the ratio between the total BOPs of the uncompressed and compressed models. We can also measure the computational costs with the total weights and activations memory footprints following DQ (Uhlich et al., 2020). Moreover, following (Stamoulis et al., 2019; Liu et al., 2019a), we use the search cost to measure the time of finding an optimal compressed model.
|
| 170 |
+
|
| 171 |
+
Implementation details. Following HAQ (Wang et al., 2019), we quantize all the layers, in which the first and the last layers are quantized to 8-bit. Following ThiNet (Luo et al., 2017), we only conduct filter pruning for the first layer in the residual block. For ResNet-20 and ResNet-56 on CIFAR-100 (Krizhevsky et al., 2009), we set $B$ to 4. For ResNet-18 and MobileNetV2 on ImageNet (Russakovsky et al., 2015), $B$ is set to 16 and 8, respectively. We first train the full-precision models and then use the pretrained weights to initialize the compressed models. Following (Li et al., 2020; Esser et al., 2020), we introduce weight normalization during training. We use SGD with nesterov (Nesterov, 1983) for optimization, with a momentum of 0.9. For CIFAR-100, we use the same data augmentation as in (He et al., 2016), including translation and horizontal flipping. For ImageNet, images are resized to $2 5 6 \times 2 5 6$ , and then a $2 2 4 \times 2 2 4$ patch is randomly cropped from an image or its horizontal flip for training. For testing, a $2 2 4 \times 2 2 4$ center cropped is chosen. We first train the uncompressed network for 30 epochs on CIFAR-100 and 10 epochs on ImageNet.
|
| 172 |
+
|
| 173 |
+
Table 2: Comparisons on ImageNet. “\*” denotes that we get the results from the figures in (van Baalen et al., 2020) and “–” denotes that the results are not reported. Moreover, “W” and “A” represent the average quantization bitwidth of the weights and activations, respectively.
|
| 174 |
+
|
| 175 |
+
<table><tr><td>Network</td><td>Method</td><td>BOPs (G)</td><td>BOP comp. ratio</td><td>W/A</td><td>Top-1 Acc. (%)</td><td>Top-5 Acc. (%)</td></tr><tr><td rowspan="8">ResNet-18</td><td>Full-precision</td><td>1857.6</td><td>1.0</td><td>32.0/32.0</td><td>70.7</td><td>89.8</td></tr><tr><td>4-bit precision</td><td>34.7</td><td>53.5</td><td>4.0/4.0</td><td>71.0</td><td>89.8</td></tr><tr><td>DQ</td><td>40.7</td><td>40.6</td><td>1/1</td><td>68.5</td><td>1</td></tr><tr><td>DJPQ</td><td>35.5</td><td>52.3</td><td>-/1</td><td>69.1</td><td></td></tr><tr><td>HAQ</td><td>34.7</td><td>53.5</td><td>4.0/4.0</td><td>70.2</td><td>89.5</td></tr><tr><td>Bayesian Bits*</td><td>35.9</td><td>51.7</td><td>1/1</td><td>69.5</td><td></td></tr><tr><td>ABS-Q(Ours)</td><td>33.1</td><td>56.1</td><td>4.5/3.8</td><td>70.9</td><td>89.7</td></tr><tr><td>ABS (Ours)</td><td>32.3</td><td>57.5</td><td>4.6/4.2</td><td>70.8</td><td>89.6</td></tr><tr><td rowspan="6">MobileNetV2</td><td>Full-precision</td><td>308.0</td><td>1.0</td><td>32.0/32.0</td><td>71.9</td><td>90.3</td></tr><tr><td>6-bit precision</td><td>11.2</td><td>27.5</td><td>6.0/6.0</td><td>71.8</td><td>90.3</td></tr><tr><td>DQ</td><td>19.6</td><td>1.9</td><td>6.8/8.0</td><td>70.4</td><td>89.7</td></tr><tr><td>HAQ</td><td>10.8</td><td>28.5</td><td>5.61/6.27</td><td>71.2</td><td>90.0</td></tr><tr><td>Bayesian Bits *</td><td>10.8</td><td>28.5</td><td>-/1</td><td>70.9</td><td>一</td></tr><tr><td>ABS-Q(Ours)</td><td>10.9</td><td>28.3</td><td>6.8/6.8</td><td>71.8</td><td>90.4</td></tr><tr><td></td><td>ABS (Ours)</td><td>10.8</td><td>28.5</td><td>6.1/7.1</td><td>71.7</td><td>90.3</td></tr></table>
|
| 176 |
+
|
| 177 |
+
The learning rate is set to 0.001. We then fine-tune the searched compressed network to recover the performance drop. On CIFAR-100, we train the searched network for 200 epochs with a mini-batch size of 128. The learning rate is initialized to 0.1 and is divided by 10 at 80-th and 120-th epochs. Experiments on CIFAR-100 are repeated for 5 times and we report the mean and standard deviation. For ResNet-18 on ImageNet, we finetune the searched network for 90 epochs with a mini-batch size of 256. For MobileNetV2 on ImageNet, we fine-tune for 150 epochs. For all models on ImageNet, the learning rate starts at 0.01 and decays with cosine annealing (Loshchilov & Hutter, 2017).
|
| 178 |
+
|
| 179 |
+
# 4.1 MAIN RESULTS
|
| 180 |
+
|
| 181 |
+
We apply the proposed methods to compress ResNet-20, ResNet-56 on CIFAR-100 and ResNet18, MobileNetV2 on ImageNet. We compare the performance of different methods in Table 1 and Table 2. We also show the results of the compressed ResNet-56 with different BOPs and memory footprints in Figure 2. From the results, we can see that 4-bit quantized networks achieve lossless performance. Also, 6-bit MobileNetV2 only leads to a $0 . 1 \%$ performance drop on the Top-1 Accuracy. Compared with fixed-precision quantization, mixed-precision methods are able to reduce the BOPs while preserving the performance. Critically, our proposed ABS-Q outperforms the stateof-the-arts baselines with less computational costs. Specifically, ABS-Q compressed ResNet-18 outperforms the one compressed by HAQ with more BOPs reduction. More critically, our proposed ABS achieves significant improvement in terms of BOPs and memory footprints. For example, in Figure 2(a), our ABS compressed ResNet-56 model yields much fewer BOPs (395.25 vs. 536.24) but achieves comparable performance compared with the fixed-precision counterpart. Moreover, by combing pruning and quantization, ABS achieves nearly lossless performance while further reducing the computational costs of ABS-Q. For example, ABS compressed ResNet-18 reduces the BOPs by $5 7 . 5 \times$ while still outperforming the full-precision network by $0 . 1 \%$ in terms of the Top-1 accuracy on ImageNet.
|
| 182 |
+
|
| 183 |
+
# 4.2 FURTHER STUDIES
|
| 184 |
+
|
| 185 |
+
Effect of the bit-sharing scheme. To investigate the effect of the bit-sharing scheme, we apply our methods to quantize ResNet-20 and ResNet-56 with and without the bit sharing scheme on CIFAR100. We report the testing accuracy and BOPs in Table 3. We also present the search costs and consumed GPU memory measured on a GPU device (NVIDIA TITAN $\mathrm { X p }$ ). It can be seen from the results that the method with the bit sharing scheme consistently outperforms the ones without the bit sharing scheme while significantly reducing the search costs and GPU memory.
|
| 186 |
+
|
| 187 |
+
Effect of the one-stage compression. To investigate the effect of the one-stage compression scheme (perform pruning and quantization jointly), we extend ABS to two-stage optimization, where we sequentially do filter pruning and quantization, denoted as ABS- $\mathbf { \partial } \cdot \mathbf { P } { } \mathbf { A } \mathbf { B } \mathbf { S } { - } \mathbf { Q }$ . The results are shown in Table 4. Compared with the two-stage counterpart, ABS achieves better performance with less computational costs, which shows the superiority of the one-stage optimization. For example, ABS compressed ResNet-56 outperforms the counterpart by $0 . 4 \%$ on the Top-1 accuracy with less computational overhead.
|
| 188 |
+
|
| 189 |
+
Table 3: Effect of the bit-sharing scheme. We report the testing accuracy, BOPs, and search costs on CIFAR-100. The search costs are measured on a GPU device (NVIDIA TITAN Xp).
|
| 190 |
+
|
| 191 |
+
<table><tr><td>Network</td><td>Method</td><td>Top-1 Acc.</td><td>Top-5 Acc.</td><td>BOPs (M)</td><td>Search Cost (GPU hours)</td><td>GPUMemory (GB)</td></tr><tr><td rowspan="2">ResNet-20</td><td> w/o bit sharing</td><td>67.8±0.1</td><td>90.5±0.2</td><td>664.2</td><td>2.8</td><td>4.4</td></tr><tr><td>w/bit sharing</td><td>68.1±0.1</td><td>90.5±0.0</td><td>649.5</td><td>0.8</td><td>1.5</td></tr><tr><td rowspan="2">ResNet-56</td><td>w/o bit sharing</td><td>71.3±0.3</td><td>91.4±0.4</td><td>2001.1</td><td>8.7</td><td>10.9</td></tr><tr><td>w/ bit sharing</td><td>71.5±0.2</td><td>91.5±0.2</td><td>1970.7</td><td>1.9</td><td>3.0</td></tr></table>
|
| 192 |
+
|
| 193 |
+
Table 4: Effect of the one-stage compression. We report the results of ResNet-56 on CIFAR-100.
|
| 194 |
+
|
| 195 |
+
<table><tr><td>Network</td><td>Method</td><td>Top-1 Acc.</td><td>Top-5 Acc.</td><td>BOPs (M)</td></tr><tr><td rowspan="2">ResNet-56</td><td>ABS-P→ABS-Q</td><td>70.4±0.1</td><td>90.8±0.2</td><td>1077.7</td></tr><tr><td>ABS</td><td>70.8±0.4</td><td>91.2±0.1</td><td>1042.5</td></tr></table>
|
| 196 |
+
|
| 197 |
+
Effect of the alternative training scheme. To investigate the effect of the alternative training scheme introduced in Section 3.3, we apply our method to compress ResNet-56 using a joint training scheme and an alternative training scheme on CIFAR-100. Here, the joint training scheme denotes that we train the binary gates of weights and activations jointly. From the results of Table 5, the model trained with the alternative scheme achieves better performance than the joint one, which demonstrates the effectiveness of the alternative training scheme.
|
| 198 |
+
|
| 199 |
+
Table 5: Effect of the alternative training scheme. We report the results of ResNet-56 on CIFAR-100.
|
| 200 |
+
|
| 201 |
+
<table><tr><td>Network</td><td>Method</td><td>Top-1 Acc.</td><td>Top-5 Acc.</td><td>BOPs (M)</td></tr><tr><td rowspan="2">ResNet-56</td><td>Joint</td><td>71.3±0.2</td><td>91.6±0.3</td><td>1942.4</td></tr><tr><td>Alternative</td><td>71.6±0.1</td><td>91.8±0.4</td><td>1918.8</td></tr></table>
|
| 202 |
+
|
| 203 |
+
Resource-constrained compression. To demonstrate the effectiveness of our ABS on hardware devices, we further apply our methods to compress MobileNetV2 under the resource constraints on the BitFusion architecture (Sharma et al., 2018). Instead of using BOPs, we use the latency and energy on a simulator of the BitFusion to measure the computational costs. We report the results in Table 6. Compared with fixed-precision quantization, ABS achieves better performance with lower latency and energy. Specifically, ABS compressed MobileNetV2 with much lower latency and energy even outperforms 6-bit MobileNetV2 by $0 . 2 \%$ in the Top-1 accuracy.
|
| 204 |
+
|
| 205 |
+
Table 6: Resource-constrained compression on BitFusion. We evaluate the proposed ABS under the latency- and energy-constrained and report the Top-1 and Top-5 accuracy on ImageNet.
|
| 206 |
+
|
| 207 |
+
<table><tr><td rowspan="2">Network</td><td rowspan="2">Method</td><td colspan="3">Latency-constrained</td><td colspan="3">Energy-constrained</td></tr><tr><td>Acc.-1 (%)</td><td>Acc.-5 (%)</td><td>Latency (ms)</td><td>Acc.-1 (%)</td><td>Acc.-5 (%)</td><td>Energy (mJ)</td></tr><tr><td rowspan="2">MobileNetV2</td><td>6-bit precision</td><td>71.8</td><td>90.3</td><td>24.9</td><td>71.8</td><td>90.3</td><td>32.8</td></tr><tr><td>ABS (Ours)</td><td>72.0</td><td>90.4</td><td>17.2</td><td>72.0</td><td>90.3</td><td>26.3</td></tr></table>
|
| 208 |
+
|
| 209 |
+
# 5 CONCLUSION AND FUTURE WORK
|
| 210 |
+
|
| 211 |
+
In this paper, we have proposed a novel model compression method called Automatically Bit Sharing (ABS). Specifically, our ABS is based on the observation that quantized values of a high bitwidth share the ones of lower bitwidths under some constraints. We therefore have proposed the decomposition of quantization that encapsulates all candidate bitwidths. Starting from a low bitwidth in the search space, we sequentially increase the effective bitwidth by recursively adding re-assignment offsets. Based on this, we have further introduced learnable binary gates to encode the choice of different compression policies. By training the binary gates, the optimal compression ratio of each layer can be automatically determined. Experiments on CIFAR-100 and ImageNet have shown that our methods are able to achieve significant cost reduction while preserving the performance. In the future, we plan to work on a joint search for architecture, pruning, and quantization to find a compact model with better performance.
|
| 212 |
+
|
| 213 |
+
# REFERENCES
|
| 214 |
+
|
| 215 |
+
Yu Bai, Yu-Xiang Wang, and Edo Liberty. Proxquant: Quantized neural networks via proximal operators. In Proc. Int. Conf. Learn. Repren., 2019.
|
| 216 |
+
|
| 217 |
+
Yoshua Bengio, Nicholas Leonard, and Aaron Courville. Estimating or propagating gradients ´ through stochastic neurons for conditional computation. arXiv preprint arXiv:1308.3432, 2013.
|
| 218 |
+
|
| 219 |
+
Yash Bhalgat, Jinwon Lee, Markus Nagel, Tijmen Blankevoort, and Nojun Kwak. Lsq $^ +$ : Improving low-bit quantization through learnable offsets and better initialization. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2020.
|
| 220 |
+
|
| 221 |
+
Han Cai, Ligeng Zhu, and Song Han. ProxylessNAS: Direct neural architecture search on target task and hardware. In Proc. Int. Conf. Learn. Repren., 2019.
|
| 222 |
+
|
| 223 |
+
Zhaowei Cai and Nuno Vasconcelos. Rethinking differentiable search for mixed-precision neural networks. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2020.
|
| 224 |
+
|
| 225 |
+
Zhaowei Cai, Xiaodong He, Jian Sun, and Nuno Vasconcelos. Deep learning with low precision by half-wave gaussian quantization. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2017.
|
| 226 |
+
|
| 227 |
+
Yongjian Chen, Tao Guan, and Cheng Wang. Approximate nearest neighbor search by residual vector quantization. Sensors, 10(12):11259–11273, 2010.
|
| 228 |
+
|
| 229 |
+
Jungwook Choi, Zhuo Wang, Swagath Venkataramani, Pierce I-Jen Chuang, Vijayalakshmi Srinivasan, and Kailash Gopalakrishnan. Pact: Parameterized clipping activation for quantized neural networks. arXiv preprint arXiv:1805.06085, 2018.
|
| 230 |
+
|
| 231 |
+
Ruizhou Ding, Ting-Wu Chin, Zeye Liu, and Diana Marculescu. Regularizing activation distribution for training binarized deep networks. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2019.
|
| 232 |
+
|
| 233 |
+
Xuanyi Dong and Yi Yang. Network pruning via transformable architecture search. In Proc. Adv. Neural Inf. Process. Syst., 2019.
|
| 234 |
+
|
| 235 |
+
Zhen Dong, Zhewei Yao, Amir Gholami, Michael W Mahoney, and Kurt Keutzer. Hawq: Hessian aware quantization of neural networks with mixed-precision. In Proc. IEEE Int. Conf. Comp. Vis., 2019.
|
| 236 |
+
|
| 237 |
+
Steven K. Esser, Jeffrey L. McKinstry, Deepika Bablani, Rathinakumar Appuswamy, and Dharmendra S. Modha. Learned step size quantization. In Proc. Int. Conf. Learn. Repren., 2020.
|
| 238 |
+
|
| 239 |
+
Yunchao Gong, Liu Liu, Ming Yang, and Lubomir Bourdev. Compressing deep convolutional networks using vector quantization. arXiv preprint arXiv:1412.6115, 2014.
|
| 240 |
+
|
| 241 |
+
Yiwen Guo, Anbang Yao, and Yurong Chen. Dynamic network surgery for efficient dnns. In Proc. Adv. Neural Inf. Process. Syst., 2016.
|
| 242 |
+
|
| 243 |
+
Yong Guo, Yin Zheng, Mingkui Tan, Qi Chen, Jian Chen, Peilin Zhao, and Junzhou Huang. Nat: Neural architecture transformer for accurate and compact architectures. In Proc. Adv. Neural Inf. Process. Syst., 2019.
|
| 244 |
+
|
| 245 |
+
Zichao Guo, Xiangyu Zhang, Haoyuan Mu, Wen Heng, Zechun Liu, Yichen Wei, and Jian Sun. Single path one-shot neural architecture search with uniform sampling. In Proc. Eur. Conf. Comp. Vis., 2020.
|
| 246 |
+
|
| 247 |
+
Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. In Proc. Int. Conf. Learn. Repren., 2016.
|
| 248 |
+
|
| 249 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2016.
|
| 250 |
+
|
| 251 |
+
Yang He, Ping Liu, Ziwei Wang, Zhilan Hu, and Yi Yang. Filter pruning via geometric median for deep convolutional neural networks acceleration. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2019.
|
| 252 |
+
|
| 253 |
+
Yihui He, Xiangyu Zhang, and Jian Sun. Channel pruning for accelerating very deep neural networks. In Proc. IEEE Int. Conf. Comp. Vis., 2017.
|
| 254 |
+
|
| 255 |
+
Yihui He, Ji Lin, Zhijian Liu, Hanrui Wang, Li-Jia Li, and Song Han. Amc: Automl for model compression and acceleration on mobile devices. In Proc. Eur. Conf. Comp. Vis., 2018.
|
| 256 |
+
|
| 257 |
+
Itay Hubara, Matthieu Courbariaux, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized neural networks. In Proc. Adv. Neural Inf. Process. Syst., 2016.
|
| 258 |
+
|
| 259 |
+
Qing Jin, Linjie Yang, and Zhenyu Liao. Towards efficient training for neural network quantization. arXiv preprint arXiv:1912.10207, 2019.
|
| 260 |
+
|
| 261 |
+
Sangil Jung, Changyong Son, Seohyung Lee, Jinwoo Son, Jae-Joon Han, Youngjun Kwak, Sung Ju Hwang, and Changkyu Choi. Learning to quantize deep networks by optimizing quantization intervals with task loss. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2019.
|
| 262 |
+
|
| 263 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
|
| 264 |
+
|
| 265 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Proc. Adv. Neural Inf. Process. Syst., 2012.
|
| 266 |
+
|
| 267 |
+
Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. In Proc. Int. Conf. Learn. Repren., 2017a.
|
| 268 |
+
|
| 269 |
+
Yuhang Li, Xin Dong, and Wei Wang. Additive powers-of-two quantization: An efficient nonuniform discretization for neural networks. In Proc. Int. Conf. Learn. Repren., 2020.
|
| 270 |
+
|
| 271 |
+
Zefan Li, Bingbing Ni, Wenjun Zhang, Xiaokang Yang, and Wen Gao. Performance guaranteed network acceleration via high-order residual quantization. In Proc. IEEE Int. Conf. Comp. Vis., 2017b.
|
| 272 |
+
|
| 273 |
+
Tsung-Yi Lin, Piotr Dollar, Ross Girshick, Kaiming He, Bharath Hariharan, and Serge Belongie. ´ Feature pyramid networks for object detection. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2017a.
|
| 274 |
+
|
| 275 |
+
Tsung-Yi Lin, Priya Goyal, Ross Girshick, Kaiming He, and Piotr Dollar. Focal loss for dense object ´ detection. In Proc. IEEE Int. Conf. Comp. Vis., 2017b.
|
| 276 |
+
|
| 277 |
+
Hanxiao Liu, Karen Simonyan, and Yiming Yang. DARTS: Differentiable architecture search. In Proc. Int. Conf. Learn. Repren., 2019a.
|
| 278 |
+
|
| 279 |
+
Zechun Liu, Haoyuan Mu, Xiangyu Zhang, Zichao Guo, Xin Yang, Kwang-Ting Cheng, and Jian Sun. Metapruning: Meta learning for automatic neural network channel pruning. In Proc. IEEE Int. Conf. Comp. Vis., 2019b.
|
| 280 |
+
|
| 281 |
+
Ilya Loshchilov and Frank Hutter. SGDR: stochastic gradient descent with warm restarts. In Proc. Int. Conf. Learn. Repren., 2017.
|
| 282 |
+
|
| 283 |
+
Qian Lou, Lantao Liu, Minje Kim, and Lei Jiang. Autoqb: Automl for network quantization and binarization on mobile devices. arXiv preprint arXiv:1902.05690, 2019.
|
| 284 |
+
|
| 285 |
+
Christos Louizos, Matthias Reisser, Tijmen Blankevoort, Efstratios Gavves, and Max Welling. Relaxed quantization for discretized neural networks. In Proc. Int. Conf. Learn. Repren., 2019.
|
| 286 |
+
|
| 287 |
+
Jian-Hao Luo, Jianxin Wu, and Weiyao Lin. Thinet: A filter level pruning method for deep neural network compression. In Proc. IEEE Int. Conf. Comp. Vis., 2017.
|
| 288 |
+
|
| 289 |
+
Yurii E Nesterov. A method for solving the convex programming problem with convergence rate o $( 1 / \mathrm { k } ^ { \cdot } 2 )$ . In Proceedings of the USSR Academy of Sciences, volume 269, pp. 543–547, 1983.
|
| 290 |
+
|
| 291 |
+
Hieu Pham, Melody Guan, Barret Zoph, Quoc Le, and Jeff Dean. Efficient neural architecture search via parameter sharing. In Proc. Int. Conf. Mach. Learn., 2018.
|
| 292 |
+
|
| 293 |
+
Esteban Real, Alok Aggarwal, Yanping Huang, and Quoc V Le. Regularized evolution for image classifier architecture search. In Proc. AAAI Conf. on Arti. Intel., 2019.
|
| 294 |
+
|
| 295 |
+
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. Int. J. Comp. Vis., 115(3):211–252, 2015.
|
| 296 |
+
|
| 297 |
+
Hardik Sharma, Jongse Park, Naveen Suda, Liangzhen Lai, Benson Chau, Vikas Chandra, and Hadi Esmaeilzadeh. Bit fusion: Bit-level dynamically composable architecture for accelerating deep neural network. In International Symposium on Computer Architecture, pp. 764–775. IEEE, 2018.
|
| 298 |
+
|
| 299 |
+
Dimitrios Stamoulis, Ruizhou Ding, Di Wang, Dimitrios Lymberopoulos, Bodhi Priyantha, Jie Liu, and Diana Marculescu. Single-path nas: Designing hardware-efficient convnets in less than 4 hours. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pp. 481–497, 2019.
|
| 300 |
+
|
| 301 |
+
Frederick Tung and Greg Mori. Clip-q: Deep network compression learning by in-parallel pruningquantization. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., pp. 7873–7882, 2018.
|
| 302 |
+
|
| 303 |
+
Stefan Uhlich, Lukas Mauch, Fabien Cardinaux, Kazuki Yoshiyama, Javier Alonso Garcia, Stephen Tiedemann, Thomas Kemp, and Akira Nakamura. Mixed precision dnns: All you need is a good parametrization. In Proc. Int. Conf. Learn. Repren., 2020.
|
| 304 |
+
|
| 305 |
+
Mart van Baalen, Christos Louizos, Markus Nagel, Rana Ali Amjad, Ying Wang, Tijmen Blankevoort, and Max Welling. Bayesian bits: Unifying quantization and pruning. In Proc. Adv. Neural Inf. Process. Syst., 2020.
|
| 306 |
+
|
| 307 |
+
Kuan Wang, Zhijian Liu, Yujun Lin, Ji Lin, and Song Han. Haq: Hardware-aware automated quantization with mixed precision. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2019.
|
| 308 |
+
|
| 309 |
+
Tianzhe Wang, Kuan Wang, Han Cai, Ji Lin, Zhijian Liu, Hanrui Wang, Yujun Lin, and Song Han. Apq: Joint search for network architecture, pruning and quantization policy. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2020.
|
| 310 |
+
|
| 311 |
+
Bichen Wu, Yanghan Wang, Peizhao Zhang, Yuandong Tian, Peter Vajda, and Kurt Keutzer. Mixed precision quantization of convnets via differentiable neural architecture search. arXiv preprint arXiv:1812.00090, 2018.
|
| 312 |
+
|
| 313 |
+
Haichuan Yang, Shupeng Gui, Yuhao Zhu, and Ji Liu. Automatic neural network compression by sparsity-quantization joint learning: A constrained optimization-based approach. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2020.
|
| 314 |
+
|
| 315 |
+
Shaokai Ye, Tianyun Zhang, Kaiqi Zhang, Jiayu Li, Jiaming Xie, Yun Liang, Sijia Liu, Xue Lin, and Yanzhi Wang. A unified framework of dnn weight pruning and weight clustering/quantization using admm. In Proc. AAAI Conf. on Arti. Intel., 2019.
|
| 316 |
+
|
| 317 |
+
Wang Ying, Lu Yadong, and Blankevoort Tijmen. Differentiable joint pruning and quantization for hardware efficiency. In Proc. Eur. Conf. Comp. Vis., 2020.
|
| 318 |
+
|
| 319 |
+
Dongqing Zhang, Jiaolong Yang, Dongqiangzi Ye, and Gang Hua. Lq-nets: Learned quantization for highly accurate and compact deep neural networks. In Proc. Eur. Conf. Comp. Vis., 2018.
|
| 320 |
+
|
| 321 |
+
Shuchang Zhou, Yuxin Wu, Zekun Ni, Xinyu Zhou, He Wen, and Yuheng Zou. Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv preprint arXiv:1606.06160, 2016.
|
| 322 |
+
|
| 323 |
+
Bohan Zhuang, Chunhua Shen, Mingkui Tan, Lingqiao Liu, and Ian Reid. Towards effective lowbitwidth convolutional neural networks. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2018a.
|
| 324 |
+
|
| 325 |
+
Bohan Zhuang, Chunhua Shen, Mingkui Tan, Lingqiao Liu, and Ian Reid. Structured binary neural networks for accurate image classification and semantic segmentation. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2019.
|
| 326 |
+
|
| 327 |
+
Bohan Zhuang, Lingqiao Liu, Mingkui Tan, Chunhua Shen, and Ian Reid. Training quantized neural networks with a full-precision auxiliary module. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., 2020.
|
| 328 |
+
|
| 329 |
+
Zhuangwei Zhuang, Mingkui Tan, Bohan Zhuang, Jing Liu, Yong Guo, Qingyao Wu, Junzhou Huang, and Jinhui Zhu. Discrimination-aware channel pruning for deep neural networks. In Proc. Adv. Neural Inf. Process. Syst., 2018b.
|
| 330 |
+
|
| 331 |
+
# Appendix for ABS: Automatic Bit Sharing for Model Compression
|
| 332 |
+
|
| 333 |
+
A HARDWARE-FRIENDLY DECOMPOSITION
|
| 334 |
+
|
| 335 |
+
As mentioned in Sec. 3.2, $b _ { 1 }$ can be set to arbitrary appropriate integer values (e.g., 1, 2, 3, etc.). By default, we set $b _ { 1 } = 2$ for better hardware utilization. On general purpose computing devices (e.g., CPU, GPU), byte (8 bits) is the lowest data type for operations. Other data types and ALU registers are all composed with multiple bytes in width. By setting $b _ { 1 } = 2$ , 2-bit/ 4-bit/ 8-bit quantization values can be packed into byte (or short, int, long) data type without bit wasting. Otherwise, if $b _ { 1 } = 1$ or $b _ { 1 } = 3$ , it is inevitable to have wasted bits when packing mixed-precision quantized tensors on general purpose devices. For example, one 32-bit int data type can be used to store ten 3-bit quantized values with 2 bits wasted. One might argue that these 2 bits can be leveraged with the next group of 3-bit data, but it will result in irregular memory access patterns, which will degrade the hardware utilization more seriously. Moreover, 8-bit quantization has been demonstrated to own similar performance with the full precision counterparts for many networks. Therefore, there is no need to consider a bitwidth larger than 8.
|
| 336 |
+
|
| 337 |
+
# B FORMULATION OF DIFFERENTIABLE COMPUTATIONAL LOSS
|
| 338 |
+
|
| 339 |
+
In this section, we introduce the differentiable computational loss mentioned in Section 3.3. Unlike the cross-entropy loss in Eq. (17), the computational costs $R ( \mathbf { W } , \alpha ^ { p } , \alpha ^ { q } )$ is non-differentiable. To solve this issue, we model the computational costs as a function of binary gates as:
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
R ( \mathbf { W } , \alpha ^ { p } , \alpha ^ { q } ) = \sum _ { c = 1 } ^ { G } g _ { c } ^ { p } \left( R _ { x _ { c , b _ { 1 } } } + g _ { b _ { 2 } } ^ { q } \left( R _ { x _ { c , b _ { 2 } } } - R _ { x _ { c , b _ { 1 } } } + \cdot \cdot + \cdot + g _ { b _ { K } } ^ { q } \left( R _ { x _ { c , b _ { K } } } - R _ { x _ { c , b _ { K - 1 } } } \right) \right) \right) ,
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
where Rxc,b is the computational cost for the $c$ -th group of filters with $b _ { j }$ -bit quantization and $G$ is the number of groups in total.
|
| 346 |
+
|
| 347 |
+
# C QUANTIZATION CONFIGURATIONS
|
| 348 |
+
|
| 349 |
+
All the methods in Tables 1 and 2 use layer-wise and symmetric quantization schemes and the compared methods strictly follow the quantization configurations in their original papers. Specifically, for DQ (Uhlich et al., 2020), we parameterize the fixed-point quantizer using case U3 with $\theta = [ d , q _ { \mathrm { m a x } } ]$ . We initialize the weights using a pre-trained model. The initial step size is set to $d = \bar { 2 } ^ { \lfloor \log _ { 2 } ( \operatorname* { m a x } ( | \mathbf { W } | ) / ( 2 ^ { b - 1 } - 1 ) \rfloor }$ for weights and $2 ^ { - 3 }$ for activations. The remaining quantization parameters are set such that the initial bitwidth is 4-bit. For HAQ (Wang et al., 2019), we first truncate the weights and activations into the range of $[ - v _ { w } , v _ { w } ]$ and $[ 0 , v _ { x } ]$ , respectively. We then perform linear quantization for both weights and activations. To find more proper $v _ { w }$ and $v _ { x }$ , we minimize the KL-divergence between the original weight distribution W and the quantized weight distribution $Q ( \mathbf { W } )$ . For DNAS (Wu et al., 2018), we follow DoReFa-Net (Zhou et al., 2016) to quantize weights and follow PACT (Choi et al., 2018) to quantize activations. We initialize the learnable upper bound to 1. For DJPQ (Ying et al., 2020) and Bayesian Bits (van Baalen et al., 2020), we directly get the results from original papers. For other methods in Tables 1 and 2, we use the quantization function introduced in Section 3.1. The trainable quantization intervals $v _ { x }$ and $v _ { w }$ are initialized to 1.
|
| 350 |
+
|
| 351 |
+
# D SEARCH COST COMPARISONS
|
| 352 |
+
|
| 353 |
+
To evaluate the efficiency of the proposed ABS, we compare the search cost of different methods and report the results in Table 7. From the results, the search costs of the proposed ABS is much smaller than the state-of-the-art methods. Moreover, compared with ABS-Q, ABS only introduces a small amount of computational overhead, which demonstrates the efficiency of the proposed methods.
|
| 354 |
+
|
| 355 |
+
Table 7: Comparisons of the search costs on CIFAR-100. The search costs are measured on a GPU device (NVIDIA TITAN Xp).
|
| 356 |
+
|
| 357 |
+
<table><tr><td>Network</td><td>Method</td><td>Search Cost (GPU hours)</td></tr><tr><td rowspan="3">ResNet-20</td><td>HAQ DQ</td><td>5.8 3.0</td></tr><tr><td>DNAS</td><td>2.8</td></tr><tr><td>ABS-Q (Ours) ABS-P (Ours) ABS (Ours)</td><td>0.8 0.2</td></tr></table>
|
| 358 |
+
|
| 359 |
+
Table 8: Comparisons of different methods w.r.t. memory footprints. We compress ResNet-56 using different methods and report the results on CIFAR-100.
|
| 360 |
+
|
| 361 |
+
<table><tr><td>Method</td><td>Memory footprints(KB)</td><td>M.f. comp. ratio</td><td>Top-1 Acc. (%)</td><td>Top-5 Acc. (%)</td></tr><tr><td>Full-precision</td><td>5653.4</td><td>1.0</td><td>71.7</td><td>92.2</td></tr><tr><td>4-bit precision</td><td>711.7</td><td>7.9</td><td>70.9±0.3</td><td>91.2±0.4</td></tr><tr><td>DNAS</td><td>708.9</td><td>8.0</td><td>71.5±0.2</td><td>91.3±0.1</td></tr><tr><td>HAQ</td><td>700.0</td><td>8.1</td><td>71.3±0.1</td><td>91.1±0.1</td></tr><tr><td>ABS-Q (Ours)</td><td>674.5</td><td>8.4</td><td>71.5±0.2</td><td>91.6±0.2</td></tr><tr><td>ABS (Ours)</td><td>657.3</td><td>8.6</td><td>71.6±0.1</td><td>91.8±0.4</td></tr></table>
|
| 362 |
+
|
| 363 |
+
Table 9: Comparisons of different methods with MobileNetV3 on CIFAR-100.
|
| 364 |
+
|
| 365 |
+
<table><tr><td>Method</td><td>BOPs (M)</td><td>BOP comp.ratio</td><td>Top-1 Acc. (%)</td><td>Top-5 Acc. (%)</td></tr><tr><td>Full-precision</td><td>68170.1</td><td>1.0</td><td>76.1</td><td>93.9</td></tr><tr><td>6-bit precision</td><td>2412.6</td><td>28.3</td><td>76.1±0.0</td><td>93.7±0.0</td></tr><tr><td>DQ</td><td>2136.3</td><td>31.9</td><td>75.9±0.1</td><td>93.7±0.1</td></tr><tr><td>HAQ</td><td>2191.7</td><td>31.1</td><td>76.1±0.1</td><td>93.5±0.0</td></tr><tr><td>DNAS</td><td>2051.9</td><td>33.2</td><td>76.1±0.1</td><td>93.7±0.1</td></tr><tr><td>ABS-P(Ours)</td><td>59465.8</td><td>1.1</td><td>76.0±0.0</td><td>93.5±0.0</td></tr><tr><td>ABS-Q(Ours)</td><td>2021.9</td><td>33.7</td><td>76.1±0.1</td><td>93.7±0.1</td></tr><tr><td>ABS (Ours)</td><td>2006.6</td><td>34.0</td><td>76.1±0.1</td><td>93.7±0.1</td></tr></table>
|
| 366 |
+
|
| 367 |
+
# E MORE RESULTS ON MEMORY FOOTPRINTS
|
| 368 |
+
|
| 369 |
+
To further demonstrate the effectiveness of the proposed ABS, we replace BOPs with total weights and activations memory footprints (Uhlich et al., 2020). We apply different methods to compress ResNet-56 and report the results in Table 8. From the results, ABS compressed ResNet-56 outperforms other methods with fewer memory footprints. These results show the effectiveness of our proposed ABS in terms of memory footprints reduction.
|
| 370 |
+
|
| 371 |
+
# F DETAILED STRUCTURE OF THE COMPRESSED NETWORK
|
| 372 |
+
|
| 373 |
+
We illustrate the pruning rate and bitwidth of each layer’s weights and activations of the compressed ResNet-18 and MobileNetV2 in Figure 3 and Figure 4, respectively. From the results, we observe that our ABS assigns more bitwidths to the weights in the downsampling convolutional layer in ResNet-18 and depthwise convolutional layer in MobileNetV2. Intuitively, this is because the number of parameters of these layers is much smaller than other layers. Moreover, our ABS inclines to prune more filters in the shallower layers, which can significantly reduce the number of parameters and computational overhead. Finally, we also observe that the correlation between the bitwidth and pruning rate is as follows. If a layer is set to a high pruning rate, our ABS tends to select a higher bitwidth to compensate for the performance drop. In contrast, if a layer is with a low pruning rate, our ABS tends to select a lower bitwidth to reduce the model size and computational costs.
|
| 374 |
+
|
| 375 |
+
# G MORE RESULTS ON MOBILENETV3
|
| 376 |
+
|
| 377 |
+
To evaluate the proposed ABS on the lightweight model, we apply our methods to MobileNetV3 on CIFAR-100. Following $\mathrm { L S Q + }$ (Bhalgat et al., 2020), we introduce a learnable offset to handle the negative activations in hard-swish. We show the results in Table 9. From the results of MobileNetV3, our proposed ABS still outperforms the compared methods, which demonstrates its effectiveness.
|
| 378 |
+
|
| 379 |
+

|
| 380 |
+
(a) Bitwidth configuration of the compressed ResNet-18.
|
| 381 |
+
|
| 382 |
+

|
| 383 |
+
Figure 3: Detailed configurations of the compressed ResNet-18.
|
| 384 |
+
|
| 385 |
+
(b) Pruning rate configuration of the compressed ResNet-18. The pruning rate is defined as the ratio between #pruned weights of the compressed models and #weights of the uncompressed models.
|
| 386 |
+
|
| 387 |
+

|
| 388 |
+
Figure 4: Detailed configurations of the compressed MobileNetV2.
|
| 389 |
+
|
| 390 |
+
(b) Pruning rate configuration of the compressed MobileNetV2. The pruning rate is defined as the ratio between #pruned weights of the compressed models and #weights of the uncompressed models.
|
md/train/S1GkToR5tm/S1GkToR5tm.md
ADDED
|
@@ -0,0 +1,307 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DISCRIMINATOR REJECTION SAMPLING
|
| 2 |
+
|
| 3 |
+
Samaneh Azadi∗ UC Berkeley
|
| 4 |
+
|
| 5 |
+
Catherine Olsson Google Brain
|
| 6 |
+
|
| 7 |
+
Trevor Darrell UC Berkeley
|
| 8 |
+
|
| 9 |
+
Ian Goodfellow Google Brain
|
| 10 |
+
|
| 11 |
+
Augustus Odena Google Brain
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
We propose a rejection sampling scheme using the discriminator of a GAN to approximately correct errors in the GAN generator distribution. We show that under quite strict assumptions, this will allow us to recover the data distribution exactly. We then examine where those strict assumptions break down and design a practical algorithm—called Discriminator Rejection Sampling (DRS)—that can be used on real data-sets. Finally, we demonstrate the efficacy of DRS on a mixture of Gaussians and on the state of the art SAGAN model. On ImageNet, we train an improved baseline that increases the best published Inception Score from 52.52 to 62.36 and reduces the Frechet Inception Distance from 18.65 to 14.79. We then use ´ DRS to further improve on this baseline, improving the Inception Score to 76.08 and the FID to 13.75.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
Generative Adversarial Networks (GANs) (Goodfellow et al., 2014) are a powerful tool for image synthesis. They have also been applied successfully to semi-supervised and unsupervised learning (Springenberg, 2015; Odena, 2016; Kumar et al., 2017), image editing (Yu et al., 2018; Ledig et al., 2017), and image style transfer (Zhu et al., 2017; Isola et al., 2017; Yi et al., 2017; Azadi et al., 2018). Informally, the GAN training procedure pits two neural networks against each other, a generator and a discriminator. The discriminator is trained to distinguish between samples from the target distribution and samples from the generator. The generator is trained to fool the discriminator into thinking its outputs are real. The GAN training procedure is thus a two-player differentiable game, and the game dynamics are largely what distinguishes the study of GANs from the study of other generative models. These game dynamics have well-known and heavily studied stability issues. Addressing these issues is an active area of research (Mao et al., 2017; Arjovsky et al., 2017; Gulrajani et al., 2017; Odena et al., 2018; Li et al., 2017).
|
| 20 |
+
|
| 21 |
+
However, we are interested in studying something different: Instead of trying to improve the training procedure, we (temporarily) accept its flaws and attempt to improve the quality of trained generators by post-processing their samples using information from the trained discriminator. It’s well known that (under certain very strict assumptions) the equilibrium of this training procedure is reached when sampling from the generator is identical to sampling from the target distribution and the discriminator always outputs $1 / 2$ . However, these assumptions don’t hold in practice. In particular, GANs as presently trained don’t learn to reproduce the target distribution (Arora & Zhang, 2017). Moreover, trained GAN discriminators aren’t just identically $1 / 2$ — they can even be used to perform chess-type skill ratings of other trained generators (Olsson et al., 2018).
|
| 22 |
+
|
| 23 |
+
We ask if the information retained in the weights of the discriminator at the end of the training procedure can be used to “improve” the generator. At face value, this might seem unlikely. After all, if there is useful information left in the discriminator, why doesn’t it find its way into the generator via the training procedure? Further reflection reveals that there are many possible reasons. First, the assumptions made in various analyses of the training procedure surely don’t hold in practice (e.g. the discriminator and generator have finite capacity and are optimized in parameter space rather than density-space). Second, due to the concrete realization of the discriminator and the generator as neural networks, it may be that it is harder for the generator to model a given distribution than it is for the discriminator to tell that this distribution is not being modeled precisely. Finally, we may simply not train GANs long enough in practice for computational reasons.
|
| 24 |
+
|
| 25 |
+
In this paper, we focus on using the discriminator as part of a probabilistic rejection sampling scheme. In particular, this paper makes the following contributions:
|
| 26 |
+
|
| 27 |
+
• We propose a rejection sampling scheme using the GAN discriminator to approximately correct errors in the GAN generator distribution. We show that under quite strict assumptions, this scheme allows us to recover the data distribution exactly.
|
| 28 |
+
• We then examine where those strict assumptions break down and design a practical algorithm – called DRS – that takes this into account.
|
| 29 |
+
• We conduct experiments demonstrating the effectiveness of DRS. First, as a baseline, we train an improved version of the Self-Attention GAN, improving its performance from the best published Inception Score of 52.52 up to 62.36, and from a Frechet Inception ´ Distance of 18.65 down to 14.79. We then show that DRS yields further improvement over this baseline, increasing the Inception Score to 76.08 and decreasing the Frechet Inception ´ Distance to 13.75.
|
| 30 |
+
|
| 31 |
+
# 2 BACKGROUND
|
| 32 |
+
|
| 33 |
+
# 2.1 GENERATIVE ADVERSARIAL NETWORKS
|
| 34 |
+
|
| 35 |
+
A generative adversarial network (GAN) (Goodfellow et al., 2014) consists of two separate neural networks — a generator, and a discriminator — trained in tandem. The generator $G$ takes as input a sample from the prior $z \in Z \sim p _ { z }$ and produces a sample $G ( z ) \in X$ . The discriminator takes an observation $x \in X$ as input and produces a probability $D ( x )$ that the observation is real. The observation is sampled either according to the density $p _ { d }$ (the data generating distribution) or $p _ { g }$ (the implicit density given by the generator and the prior). Using the standard non-saturating variant, the discriminator and generator are then trained using the following loss functions:
|
| 36 |
+
|
| 37 |
+
$$
|
| 38 |
+
\begin{array} { l l l } { { L _ { D } } } & { { = } } & { { - \mathbb { E } _ { x \sim p _ { \mathrm { d a t a } } } [ \log D ( x ) ] - \mathbb { E } _ { z \sim p _ { z } } [ 1 - \log D ( G ( z ) ) ] } } \\ { { L _ { G } } } & { { = } } & { { - \mathbb { E } _ { z \sim p _ { z } } [ \log D ( G ( z ) ) ] } } \end{array}
|
| 39 |
+
$$
|
| 40 |
+
|
| 41 |
+
2.2 EVALUATION METRICS: INCEPTION SCORE (IS) AND FRECHET ´ INCEPTION DISTANCE (FID)
|
| 42 |
+
|
| 43 |
+
The two most popular techniques for evaluating GANs on image synthesis tasks are the Inception Score and the Frechet Inception Distance. The Inception Score (Salimans et al., 2016) is given by ´ $\exp ( \mathbb { E } _ { x } \mathrm { K L } ( p ( y | x ) | | p ( y ) ) )$ , where $p ( y | x )$ is the output of a pre-trained Inception classifier (Szegedy et al., 2014). This measures the ability of the GAN to generate samples that the pre-trained classifier confidently assigns to a particular class, and also the ability of the GAN to generate samples from all classes. The Frechet Inception Distance (FID) (Heusel et al., 2017), is computed by passing samples ´ through an Inception network to yield “semantic embeddings”, after which the Frechet distance is ´ computed between Gaussians with moments given by these embeddings.
|
| 44 |
+
|
| 45 |
+
# 2.3 SELF-ATTENTION GAN
|
| 46 |
+
|
| 47 |
+
We use a Self-Attention GAN (SAGAN) (Zhang et al., 2018) in our experiments. We do so because SAGAN is considered state of the art on the ImageNet conditional-image-synthesis task (in which images are synthesized conditioned on class identity). SAGAN differs from a vanilla GAN in the following ways: First, it uses large residual networks (He et al., 2016) instead of normal convolutional layers. Second, it uses spectral normalization (Miyato et al., 2018) in the generator and the discriminator and a much lower learning rate for the generator than is conventional (Heusel et al., 2017). Third, SAGAN makes use of self-attention layers (Wang et al.), in order to better model long range dependencies in natural images. Finally, this whole model is trained using a special hinge version of the adversarial loss (Lim & Ye, 2017; Miyato & Koyama, 2018; Tran et al., 2017):
|
| 48 |
+
|
| 49 |
+

|
| 50 |
+
Figure 1: Left: For a uniform proposal distribution and Gaussian target distribution, the blue points are the result of rejection sampling and the red points are the result of naively throwing out samples for which the density ratio $( p _ { d } ( x ) / p _ { g } ( x ) )$ is below a threshold. The naive method underrepresents the density of the tails. Right: the DRS algorithm. KeepTraining continues training using early stopping on the validation set. BurnIn computes a large number of density ratios to estimate their maximum. $\widetilde { D } ^ { * }$ is the logit of $D ^ { * }$ . $\hat { F }$ is as in Equation 8. $\bar { M }$ is an empirical estimate of the true maximum $M$ .
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\begin{array} { r c l } { L _ { D } } & { = } & { - \mathbb { E } _ { ( x , y ) \sim p _ { \mathrm { d a u a } } } [ \operatorname* { m i n } ( 0 , - 1 + D ( x , y ) ) ] - \mathbb { E } _ { z \sim p _ { z } , y \sim p _ { \mathrm { d a u a } } } [ \operatorname* { m i n } ( 0 , - 1 - D ( G ( z ) , y ) ) ] } \\ { L _ { G } } & { = } & { - \mathbb { E } _ { z \sim p _ { z } , y \sim p _ { \mathrm { d a u a } } } [ D ( G ( z ) , y ) ) ] } \end{array}
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
# 2.4 REJECTION SAMPLING
|
| 57 |
+
|
| 58 |
+
Rejection sampling is a method for sampling from a target distribution $p _ { d } ( x )$ which may be hard to sample from directly. Samples are instead drawn from a proposal distribution $\dot { p } _ { g } ( x )$ , which is easier to sample from, and which is chosen such that there exists a finite value $M$ such that $M p _ { g } ( x ) > p _ { d } ( x )$ for $\forall x \in \mathrm { d o m a i n } ( p _ { d } ( x ) )$ . A given sample $y$ drawn from $p _ { g }$ is kept with acceptance probability $p _ { d } ( y ) / M p _ { g } ( y )$ , and rejected otherwise. See the blue points in Figure 1 (Left) for a visualization. Ideally, $p _ { g } ( x )$ should be close to $p _ { d } ( x )$ , otherwise many samples will be rejected, reducing the efficiency of the algorithm (MacKay, 2003).
|
| 59 |
+
|
| 60 |
+
In Section 3, we explain how to apply this rejection sampling algorithm to the GAN framework: in brief, we draw samples from the trained generator, $p _ { g } ( x )$ , and then reject some of those samples using the discriminator to attain a closer approximation to the true data distribution, $p _ { d } ( x )$ . An independent rejection sampling approach was proposed by Grover et al. (2018) in the latent space of variational autoencoders for improving samples from the variational posterior.
|
| 61 |
+
|
| 62 |
+
# 3 REJECTION SAMPLING FOR GANS
|
| 63 |
+
|
| 64 |
+
In this section we introduce our proposed rejection sampling scheme for GANs (which we call Discriminator Rejection Sampling, or DRS). We’ll first derive an idealized version of the algorithm that will rely on assumptions that don’t necessarily hold in realistic settings. We’ll then discuss the various ways in which these assumptions might break down. Finally, we’ll describe the modifications we made to the idealized version in order to overcome these challenges.
|
| 65 |
+
|
| 66 |
+
# 3.1 REJECTION SAMPLING FOR GANS: THE IDEALIZED VERSION
|
| 67 |
+
|
| 68 |
+
Suppose that we have a GAN and our generator has been trained to the point that $p _ { g }$ and $p _ { d }$ have the same support. That is, for all $x \in X$ , $p _ { g } ( x ) \neq 0$ if and only if $p _ { d } ( x ) \neq \bar { 0 }$ . If desired, we can make $p _ { d }$ and $p _ { g }$ have support everywhere in $X$ if we add low-variance Gaussian noise to the observations. Now further suppose that we have some way to compute $p _ { d } ( x ) / p _ { g } ( x )$ . Then, if $M = \operatorname* { m a x } _ { x } p _ { d } ( x ) / p _ { g } ( x )$ , then $M \bar { p _ { g } } ( x ) > p _ { d } ( x )$ for all $x$ , so we can perform rejection sampling with $p _ { g }$ as the proposal distribution and $p _ { d }$ as the target distribution as long as we can evaluate the quantity $p _ { d } ( x ) / M p _ { g } ( x ) ^ { 1 }$ . In this case, we can exactly sample from $p _ { d }$ (Casella et al., 2004), though we may have to reject many samples to do so.
|
| 69 |
+
|
| 70 |
+
But how can we evaluate $p _ { d } ( x ) / M p _ { g } ( x ) !$ $p _ { g }$ is defined only implicitly. One thing we can do is to borrow an analysis from the original GAN paper (Goodfellow et al., 2014), which assumes that we can optimize the discriminator in the space of density functions rather than via changing its parameters. If we make this assumption, as well as the assumption that the discriminator is defined by a sigmoid applied to some function of $x$ and trained with a cross-entropy loss, then by Proposition 1 of that paper, we have that, for any fixed generator and in particular for the generator $G$ that we have when we stop training, training the discriminator to completely minimize its own loss yields
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
D ^ { * } ( x ) = \frac { p _ { d } ( x ) } { p _ { d } ( x ) + p _ { g } ( x ) }
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
We will discuss the validity of these assumptions later, but for now consider that this allows us to solve for $p _ { d } ( x ) / p _ { g } ( x )$ as follows: As noted above, we can assume the discriminator is defined as:
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
D ( x ) = \sigma ( x ) = \frac { 1 } { 1 + e ^ { - \widetilde { D } ( x ) } } ,
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
where $D ( x )$ is the final discriminator output after the sigmoid, and $\widetilde D ( \boldsymbol x )$ is the logit. Thus,
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\begin{array} { r } { D ^ { * } ( x ) = \cfrac { 1 } { 1 + e ^ { - \tilde { D } ^ { * } ( x ) } } = \cfrac { p _ { d } ( x ) } { p _ { d } ( x ) + p _ { g } ( x ) } } \\ { 1 + e ^ { - \tilde { D } ^ { * } ( x ) } = \cfrac { p _ { d } ( x ) + p _ { g } ( x ) } { p _ { d } ( x ) } } \\ { p _ { d } ( x ) + p _ { d } ( x ) e ^ { - \tilde { D } ^ { * } ( x ) } = p _ { d } ( x ) + p _ { g } ( x ) } \\ { p _ { d } ( x ) e ^ { - \tilde { D } ^ { * } ( x ) } = p _ { g } ( x ) } \\ { \cfrac { p _ { d } ( x ) } { p _ { g } ( x ) } = e ^ { \tilde { D } ^ { * } ( x ) } } \end{array}
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
Now suppose one last thing, which is that we can tractably compute $M = \operatorname* { m a x } _ { x } p _ { d } ( x ) / p _ { g } ( x )$ . We would find that $M = p _ { d } ( x ^ { * } ) / p _ { g } ( x ^ { * } ) = e ^ { \widetilde { D } ^ { * } ( x ^ { * } ) }$ for some (not necessarily unique) $x ^ { * }$ . Given all these assumptions, we can now perform rejection sampling as promised. If we define $\widetilde { D } _ { M } ^ { * } : = \widetilde { D } ^ { * } ( x ^ { * } )$ , then for any input $x$ , the acceptance probability $p _ { d } ( x ) / M p _ { g } ( x )$ can be written as $e ^ { \widetilde { D } ^ { \ast } ( x ) - \widetilde { D } _ { M } ^ { \ast } } \in [ 0 , 1 ]$ . To decide whether to keep any particular example, we can just draw a random number $\psi$ uniformly from $[ 0 , 1 ]$ and accept the sample if $\psi < e ^ { \widetilde { D } ^ { * } ( x ) - \widetilde { D } _ { M } ^ { * } }$ .
|
| 89 |
+
|
| 90 |
+
# 3.2 DISCRIMINATOR REJECTION SAMPLING: THE PRACTICAL SCHEME
|
| 91 |
+
|
| 92 |
+
As we hinted at, the above analysis has a number of practical issues. In particular:
|
| 93 |
+
|
| 94 |
+
1. Since we can’t actually perform optimization over density functions, we can’t actually compute $D ^ { * }$ . Thus, our acceptance probability won’t necessarily be proportional to $p _ { d } ( x ) \dot { / } p _ { g } ( x )$ .
|
| 95 |
+
2. At least on large datasets, it’s quite obvious that the supports of $p _ { g }$ and $p _ { d }$ are not the same. If the support of $p _ { g }$ and $p _ { d }$ has a low volume intersection, we may not even want to compute $D ^ { * }$ , because then $p _ { d } ( x ) / p _ { g } ( x )$ would just evaluate to 0 most places.
|
| 96 |
+
3. The analysis yielding the formula for $D ^ { * }$ also assumes that we can draw infinite samples from $p _ { d }$ , which is not true in practice. If we actually optimized $D$ all the way given a finite data-set, it would give nonzero results on a set of measure 0.
|
| 97 |
+
|
| 98 |
+
4. In general it won’t be tractable to compute $M$
|
| 99 |
+
|
| 100 |
+
5. Rejection sampling is known to have too low an acceptance probability when the target distribution is high dimensional (MacKay, 2003).
|
| 101 |
+
|
| 102 |
+
This section describes the Discriminator Rejection Sampling (DRS) procedure, which is an adjustment of the idealized procedure, meant to address the above issues.
|
| 103 |
+
|
| 104 |
+
On the difficulty of actually computing $D ^ { * }$ : Given that items 2 and 3 suggest we may not want to compute $D ^ { * }$ exactly, we should perhaps not be too concerned with item 1, which suggests that we can’t. The best argument we can make that it is OK to approximate $D ^ { * }$ is that doing so seems to be successful empirically. We speculate that training a regularized $D$ with SGD gives a final result that is further from $D ^ { * }$ but perhaps is less over-fit to the finite sample from $p _ { d }$ used for training. We also hypothesize that the $D$ we end up with will distinguish between “good” and “bad” samples, even if those samples would both have zero density under the true $p _ { d }$ . We qualitatively evaluate this hypothesis in Figures 4 and 5. We suspect that more could be done theoretically to quantify the effect of this approximation, but we leave this to future work.
|
| 105 |
+
|
| 106 |
+
On the difficulty of actually computing $M$ : It’s nontrivial to compute $M$ , at the very least because we can’t compute $D ^ { * }$ . In practice, we get around this issue by estimating $M$ from samples. We first run an estimation phase, in which 10,000 samples are used to estimate $\widetilde { D } _ { M } ^ { * }$ . We then use this estimate in the sampling phase. Throughout the sampling phase we update our estimate of $\widetilde { D } _ { M } ^ { * }$ if a larger value is found. It’s true that this will result in slight overestimates of the acceptance probability for samples that were processed before a new maximum was found, but we choose not to worry about this too much, since we don’t find that we have to increase the maximum very often in the sampling phase, and the increase is very small when it does happen.
|
| 107 |
+
|
| 108 |
+
Dealing with acceptance probabilities that are too low: Item 5 suggests that we may end up with acceptance probabilities that are too low to be useful when performing this technique on realistic data-sets. If $\widetilde { D } _ { M } ^ { * }$ is very large, the acceptance probability $e ^ { \widetilde { D } ^ { * } ( x ) - \widetilde { D } _ { M } ^ { * } }$ will be close to zero, and almost all samples will be rejected, which is undesirable. One simple way to avoid this problem is to compute some $F ( x )$ such that the acceptance probability can be written as follows:
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\frac { 1 } { 1 + e ^ { - F ( x ) } } = e ^ { \widetilde { D } ^ { * } ( x ) - \widetilde { D } _ { M } ^ { * } }
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
If we solve for $F ( x )$ in the above equation we can then perform the following rearrangement:
|
| 115 |
+
|
| 116 |
+
$$
|
| 117 |
+
\begin{array} { l c l } { { { \cal F } ( x ) } } & { { = } } & { { \widetilde D ^ { * } ( x ) - \log ( e ^ { \widetilde D _ { M } ^ { * } } - e ^ { \widetilde D ^ { * } ( x ) } ) } } \\ { { } } & { { = } } & { \displaystyle { \widetilde D ^ { * } ( x ) - \log ( \frac { e ^ { \widetilde D _ { M } ^ { * } } } { e ^ { \widetilde D _ { M } ^ { * } } } e ^ { \widetilde D _ { M } ^ { * } } - \frac { e ^ { \widetilde D _ { M } ^ { * } } } { e ^ { \widetilde D _ { M } ^ { * } } } e ^ { \widetilde D ^ { * } ( x ) } ) } } \\ { { } } & { { = } } & { { \displaystyle { \widetilde D ^ { * } ( x ) - \widetilde D _ { M } ^ { * } - \log ( 1 - e ^ { \widetilde D ^ { * } ( x ) - \widetilde D _ { M } ^ { * } } ) } } } \end{array}
|
| 118 |
+
$$
|
| 119 |
+
|
| 120 |
+
In practice, we instead compute
|
| 121 |
+
|
| 122 |
+
$$
|
| 123 |
+
\begin{array} { r c l } { { \hat { F } ( x ) } } & { { = } } & { { \widetilde { D } ^ { * } ( x ) - \widetilde { D } _ { M } ^ { * } - \log ( 1 - e ^ { \widetilde { D } ^ { * } ( x ) - \widetilde { D } _ { M } ^ { * } - \epsilon } ) - \gamma } } \end{array}
|
| 124 |
+
$$
|
| 125 |
+
|
| 126 |
+
where $\epsilon$ is a small constant added for numerical stability and $\gamma$ is a hyperparameter modulating overall acceptance probability. For very positive $\gamma$ , all samples will be rejected. For very negative $\gamma$ , all samples will be accepted. See Figure 2 for an analysis of the effect of adding $\gamma$ . A summary of our proposed algorithm is presented in Figure 1 (Right).
|
| 127 |
+
|
| 128 |
+
# 4 EXPERIMENTS
|
| 129 |
+
|
| 130 |
+
In this section we justify the modifications made to the idealized algorithm. We do this by conducting two experiments in which we show that (according to popular measures of how well a GAN has
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 2: (A) Histogram of the sigmoid inputs, $\hat { F } ( x )$ (left plot), and acceptance probabilities, $\sigma ( \hat { F } ( x ) )$ (center plot), on 20K fake samples before (purple) and after (green) adding the constant $\gamma$ to all $F ( x )$ . Before adding gamma, $9 8 . 9 \%$ of the samples had an acceptance probability $< 1 \mathrm { e } { - } 4$ . (B) Histogram of $\operatorname* { m a x } _ { j } p ( y _ { j } | x _ { i } )$ from a pre-trained Inception network where $p ( y _ { j } | x _ { i } )$ is the predicted probability of sample $x _ { i }$ belonging to the $y _ { j }$ category (from 1, 000 ImageNet categories). The green bars correspond to 25, 000 accepted samples and the red bars correspond to 25, 000 rejected samples. The rejected images are less recognizable as belonging to a distinct class.
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
Figure 3: Real samples from 25 2D-Gaussian Distributions (left) as well as fake samples generated from a trained GAN model without (middle) and with DRS (right). Results are computed as an average over five models randomly initialized and trained independently.
|
| 137 |
+
|
| 138 |
+
learned the target distribution) Discriminator Rejection Sampling yields improvements for actual GANs. We start with a toy example that yields insight into how DRS can help, after which we demonstrate DRS on the ImageNet dataset (Russakovsky et al., 2015).
|
| 139 |
+
|
| 140 |
+
# 4.1 MIXTURE OF 25 GAUSSIANS
|
| 141 |
+
|
| 142 |
+
We investigate the impact of DRS on a low-dimensional synthetic data set consisting of a mixture of twenty-five 2D isotropic Gaussian distributions (each with standard deviation of 0.05) arranged in a grid (Dumoulin et al., 2016; Srivastava et al., 2017; Lin et al., 2017). We train a GAN model where the generator and discriminator are neural networks with four fully connected layers with ReLu activations. The prior is a 2D Gaussian with mean of 0 and standard deviation of 1 and the GAN is trained using the standard loss function. We generate 10,000 samples from the generator with and without DRS. The target distribution and both sets of generated samples are depicted in Figure 3. Here, we have set $\gamma$ dynamically for each batch, to the $9 5 ^ { \mathrm { t h } }$ percentile of $\hat { F } ( x )$ for all $x$ in the batch.
|
| 143 |
+
|
| 144 |
+
To measure performance, we assign each generated sample to its closest mixture component. As in Srivastava et al. (2017), we define a sample as “high quality” if it is within four standard deviations of its assigned mixture component. As shown in Table 1, DRS increases the fraction of high-quality samples from $7 0 \%$ to $9 0 \%$ . As in Dumoulin et al. (2016) and Srivastava et al. (2017) we call a mode “recovered” if at least one high-quality sample was assigned to it. Table 1 shows that DRS does not reduce the number of recovered modes – that is, it does not trade off quality for mode coverage. It does reduce the standard deviation of the high-quality samples slightly, but this is a good thing in this case (since the standard deviation of the target Gaussian distribution is 0.05). It also confirms that DRS does not accept samples only near the center of each Gaussian but near the tails as well.
|
| 145 |
+
|
| 146 |
+
Table 1: Results with and without DRS on 10,000 generated samples from a model of a 2D grid of Gaussian components.
|
| 147 |
+
|
| 148 |
+
<table><tr><td></td><td># of recovered modes</td><td>%“high quality”</td><td>std of “high quality” samples</td></tr><tr><td>Without DRS</td><td>24.8± 0.4</td><td>70±9</td><td>0.11 ± 0.01</td></tr><tr><td>With DRS</td><td>24.8±0.4</td><td>90±2</td><td>0.10 ± 0.01</td></tr></table>
|
| 149 |
+
|
| 150 |
+
Table 2: Results with and without DRS on 50K ImageNet samples. Low FID and high IS are better.
|
| 151 |
+
|
| 152 |
+
<table><tr><td colspan="3">SAGAN</td><td colspan="2">Improved-SAGAN</td></tr><tr><td></td><td>IS</td><td>FID</td><td>IS</td><td>FID</td></tr><tr><td>Without DRS</td><td>52.34 ± 0.45</td><td>18.21 ± 0.14</td><td>62.36 ± 0.35</td><td>14.79 ± 0.06</td></tr><tr><td>With DRS</td><td>61.44 ± 0.09</td><td>17.14 ± 0.09</td><td>76.08 ± 0.30</td><td>13.57 ± 0.13</td></tr></table>
|
| 153 |
+
|
| 154 |
+
# 4.2 IMAGENET DATASET
|
| 155 |
+
|
| 156 |
+
Since it is presently the state-of-the-art model on the conditional ImageNet synthesis task, we have reimplemented the Self-Attention GAN (Zhang et al., 2018) as a baseline. After reproducing the results reported by Zhang et al. (2018) (with the learning rate of $1 e ^ { - 4 }$ ), we fine-tuned a trained SAGAN with a much lower learning rate $( 1 e ^ { - 7 } )$ for both generator and discriminator. This improved both the Inception Score and FID significantly as can be seen in the Improved-SAGAN column in Table 2. Plots of Inception score and FID during training are given in Figure 5(A).
|
| 157 |
+
|
| 158 |
+
Since SAGAN uses a hinge loss and DRS requires a sigmoid output, we added a fully-connected layer “on top of” the trained discriminator and trained it to distinguish real images from fake ones using the binary cross-entropy loss. We trained this extra layer with 10,000 generated samples from the model and 10,000 examples from ImageNet.
|
| 159 |
+
|
| 160 |
+
We then generated 50,000 samples from normal SAGAN and Improved SAGAN with and without DRS, repeating the sampling process 4 times. We set $\gamma$ dynamically to the $8 0 ^ { \mathrm { t h } }$ percentile of the $F ( x )$ values in each batch. The averages of Inception Score and FID over these four trials are presented in Table 2. Both scores were substantially improved for both models, indicating that DRS can indeed be useful in realistic settings involving large data-sets and sophisticated GAN variants.
|
| 161 |
+
|
| 162 |
+
Qualitative Analysis of ImageNet results: From a pool of 50,000 samples, we visualize the “best” and the “worst” 100 samples based on their acceptance probabilities. Figure 4 shows that the subjective visual quality of samples with high acceptance probability is considerably better. Figure 2(B) also shows that the accepted images are on average more recognizable as belonging to a distinct class.
|
| 163 |
+
|
| 164 |
+
We also study the behavior of the discriminator in another way. We choose an ImageNet category randomly, then generate samples from that category until we have found two images $G ( z _ { 1 } ) , G ( z _ { 2 } )$ such that $G ( z _ { 1 } )$ appears visually realistic and $G ( z _ { 2 } )$ appears visually unrealistic. Here, $z _ { 1 }$ and $z _ { 2 }$ are the input latent vectors. We then generate many images by interpolating in latent space between the two images according to $z = \alpha z _ { 1 } + ( 1 - \alpha ) z _ { 2 }$ with $\alpha \in \{ 0 , 0 . 1 , 0 . 2 , \ldots , 1 \}$ . In Figure 5, the first and last columns correspond with $\alpha = 1$ and $\alpha = 0$ , respectively. The color bar in the figure represents the acceptance probability assigned to each sample. In general, acceptance probabilities decrease from left to right. There is no reason to expect a priori that the acceptance probability should decrease monotonically as a function of the interpolated $z$ , so it says something interesting about the discriminator that most rows basically follow this pattern.
|
| 165 |
+
|
| 166 |
+
# 5 CONCLUSION
|
| 167 |
+
|
| 168 |
+
We have proposed a rejection sampling scheme using the GAN discriminator to approximately correct errors in the GAN generator distribution. We’ve shown that under strict assumptions, we can recover the data distribution exactly. We’ve also examined where those assumptions break down and designed a practical algorithm (Discriminator Rejection Sampling) to address that. Finally, we have demonstrated the efficacy of this algorithm on a mixture of Gaussians and on the state-of-the-art SAGAN model.
|
| 169 |
+
|
| 170 |
+

|
| 171 |
+
Figure 4: Synthesized images with the highest (left) and lowest (right) acceptance probability scores.
|
| 172 |
+
|
| 173 |
+

|
| 174 |
+
Figure 5: (A) Inception Score and FID during ImageNet training, computed on 50,000 samples. (B) Each row shows images synthesized by interpolating in latent space. The color bar above each row represents the acceptance probabilities for each sample: red for high and white for low. Subjective visual quality of samples with high acceptance probability is considerably better: objects are more coherent and more recognizable as belonging to a specific class. There are fewer indistinct textures, and fewer scenes without recognizable objects.
|
| 175 |
+
|
| 176 |
+
Opportunities for future work include the following:
|
| 177 |
+
|
| 178 |
+
• There’s no reason that our scheme can only be applied to GAN generators. It seems worth investigating whether rejection sampling can improve e.g. VAE decoders. This seems like it might help, because VAEs may have trouble with “spreading mass around” too much. In one ideal case, the critic used for rejection sampling would be a human. Can we use better proxies for the human visual system to improve rejection sampling’s effect on image synthesis models?
|
| 179 |
+
|
| 180 |
+
• It would be interesting to theoretically characterize the efficacy of rejection sampling under the breakdown-of-assumptions that we have described earlier. For instance, if one can’t recover $D ^ { * }$ but can train some other critic that has bounded divergence from $D ^ { * }$ , how does the efficacy depend on this bound?
|
| 181 |
+
|
| 182 |
+
# REFERENCES
|
| 183 |
+
|
| 184 |
+
M. Arjovsky, S. Chintala, and L. Bottou. Wasserstein GAN. ArXiv e-prints, January 2017.
|
| 185 |
+
|
| 186 |
+
Sanjeev Arora and Yi Zhang. Do gans actually learn the distribution? an empirical study. CoRR, abs/1706.08224, 2017. URL http://arxiv.org/abs/1706.08224.
|
| 187 |
+
|
| 188 |
+
Samaneh Azadi, Matthew Fisher, Vladimir Kim, Zhaowen Wang, Eli Shechtman, and Trevor Darrell. Multi-content gan for few-shot font style transfer. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, volume 11, pp. 13, 2018.
|
| 189 |
+
|
| 190 |
+
George Casella, Christian P Robert, Martin T Wells, et al. Generalized accept-reject sampling schemes. In A Festschrift for Herman Rubin, pp. 342–347. Institute of Mathematical Statistics, 2004.
|
| 191 |
+
|
| 192 |
+
V. Dumoulin, I. Belghazi, B. Poole, A. Lamb, M. Arjovsky, O. Mastropietro, and A. Courville. Adversarially Learned Inference. ArXiv e-prints, June 2016.
|
| 193 |
+
|
| 194 |
+
I. J. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative Adversarial Networks. ArXiv e-prints, June 2014.
|
| 195 |
+
|
| 196 |
+
Aditya Grover, Ramki Gummadi, Miguel Lazaro-Gredilla, Dale Schuurmans, and Stefano Ermon. Variational rejection sampling. In Proceedings of the Twenty-First International Conference on Artificial Intelligence and Statistics, volume 84 of Proceedings of Machine Learning Research, 2018.
|
| 197 |
+
|
| 198 |
+
Ishaan Gulrajani, Faruk Ahmed, Mart´ın Arjovsky, Vincent Dumoulin, and Aaron C. Courville. Improved training of wasserstein gans. CoRR, abs/1704.00028, 2017. URL http://arxiv. org/abs/1704.00028.
|
| 199 |
+
|
| 200 |
+
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.
|
| 201 |
+
|
| 202 |
+
M. Heusel, H. Ramsauer, T. Unterthiner, B. Nessler, and S. Hochreiter. GANs Trained by a Two Time-Scale Update Rule Converge to a Local Nash Equilibrium. ArXiv e-prints, June 2017.
|
| 203 |
+
|
| 204 |
+
Phillip Isola, Jun-Yan Zhu, Tinghui Zhou, and Alexei A Efros. Image-to-image translation with conditional adversarial networks. arXiv preprint, 2017.
|
| 205 |
+
|
| 206 |
+
A. Kumar, P. Sattigeri, and P. T. Fletcher. Improved Semi-supervised Learning with GANs using Manifold Invariances. ArXiv e-prints, May 2017.
|
| 207 |
+
|
| 208 |
+
Christian Ledig, Lucas Theis, Ferenc Huszar, Jose Caballero, Andrew Cunningham, Alejandro ´ Acosta, Andrew P Aitken, Alykhan Tejani, Johannes Totz, Zehan Wang, et al. Photo-realistic single image super-resolution using a generative adversarial network. In CVPR, volume 2, pp. 4, 2017.
|
| 209 |
+
|
| 210 |
+
Chun-Liang Li, Wei-Cheng Chang, Yu Cheng, Yiming Yang, and Barnabas P ´ oczos. Mmd gan: ´ Towards deeper understanding of moment matching network. In Advances in Neural Information Processing Systems, pp. 2203–2213, 2017.
|
| 211 |
+
|
| 212 |
+
Jae Hyun Lim and Jong Chul Ye. Geometric gan. arXiv preprint arXiv:1705.02894, 2017.
|
| 213 |
+
|
| 214 |
+
Zinan Lin, Ashish Khetan, Giulia Fanti, and Sewoong Oh. Pacgan: The power of two samples in generative adversarial networks. arXiv preprint arXiv:1712.04086, 2017.
|
| 215 |
+
|
| 216 |
+
David JC MacKay. Information theory, inference and learning algorithms. Cambridge university press, 2003.
|
| 217 |
+
|
| 218 |
+
Xudong Mao, Qing Li, Haoran Xie, Raymond YK Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative adversarial networks. In Computer Vision (ICCV), 2017 IEEE International Conference on, pp. 2813–2821. IEEE, 2017.
|
| 219 |
+
|
| 220 |
+
T. Miyato and M. Koyama. cGANs with Projection Discriminator. ArXiv e-prints, February 2018.
|
| 221 |
+
|
| 222 |
+
Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum?id $\mathbf { \Psi } = \mathbf { \dot { \Psi } }$ B1QRgziT-.
|
| 223 |
+
|
| 224 |
+
A. Odena. Semi-Supervised Learning with Generative Adversarial Networks. ArXiv e-prints, June 2016.
|
| 225 |
+
|
| 226 |
+
A. Odena, J. Buckman, C. Olsson, T. B. Brown, C. Olah, C. Raffel, and I. Goodfellow. Is Generator Conditioning Causally Related to GAN Performance? ArXiv e-prints, February 2018.
|
| 227 |
+
|
| 228 |
+
C. Olsson, S. Bhupatiraju, T. Brown, A. Odena, and I. Goodfellow. Skill Rating for Generative Models. ArXiv e-prints, August 2018.
|
| 229 |
+
|
| 230 |
+
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. International Journal of Computer Vision (IJCV), 115 (3):211–252, 2015. doi: 10.1007/s11263-015-0816-y.
|
| 231 |
+
|
| 232 |
+
T. Salimans, I. Goodfellow, W. Zaremba, V. Cheung, A. Radford, and X. Chen. Improved Techniques for Training GANs. ArXiv e-prints, June 2016.
|
| 233 |
+
|
| 234 |
+
J. T. Springenberg. Unsupervised and Semi-supervised Learning with Categorical Generative Adversarial Networks. ArXiv e-prints, November 2015.
|
| 235 |
+
|
| 236 |
+
Akash Srivastava, Lazar Valkoz, Chris Russell, Michael U Gutmann, and Charles Sutton. Veegan: Reducing mode collapse in gans using implicit variational learning. In Advances in Neural Information Processing Systems, pp. 3308–3318, 2017.
|
| 237 |
+
|
| 238 |
+
Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott E. Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. CoRR, abs/1409.4842, 2014. URL http://arxiv.org/abs/1409.4842.
|
| 239 |
+
|
| 240 |
+
D. Tran, R. Ranganath, and D. M. Blei. Hierarchical Implicit Models and Likelihood-Free Variational Inference. ArXiv e-prints, February 2017.
|
| 241 |
+
|
| 242 |
+
Xiaolong Wang, Ross Girshick, Abhinav Gupta, and Kaiming He. Non-local neural networks.
|
| 243 |
+
|
| 244 |
+
Zili Yi, Hao (Richard) Zhang, Ping Tan, and Minglun Gong. Dualgan: Unsupervised dual learning for image-to-image translation. In ICCV, pp. 2868–2876, 2017.
|
| 245 |
+
|
| 246 |
+
Jiahui Yu, Zhe Lin, Jimei Yang, Xiaohui Shen, Xin Lu, and Thomas S Huang. Generative image inpainting with contextual attention. arXiv preprint, 2018.
|
| 247 |
+
|
| 248 |
+
Han Zhang, Ian Goodfellow, Dimitris Metaxas, and Augustus Odena. Self-attention generative adversarial networks. arXiv preprint arXiv:1805.08318, 2018.
|
| 249 |
+
|
| 250 |
+
J.-Y. Zhu, T. Park, P. Isola, and A. A. Efros. Unpaired Image-to-Image Translation using CycleConsistent Adversarial Networks. ArXiv e-prints, March 2017.
|
| 251 |
+
|
| 252 |
+
# APPENDIX
|
| 253 |
+
|
| 254 |
+
# A ABLATION STUDY
|
| 255 |
+
|
| 256 |
+
We have evaluated four different rejection sampling schemes on the mixture-of-Gaussians dataset, represented in Figure 6:
|
| 257 |
+
|
| 258 |
+
1. Always reject samples falling below a hard threshold and DO NOT train the Discriminator to “convergence”.
|
| 259 |
+
2. Always reject samples falling below a hard threshold and train the Discriminator to convergence.
|
| 260 |
+
3. Use probabilistic sampling as in eq 8 and DO NOT train the Discriminator to convergence.
|
| 261 |
+
4. Our original DRS algorithm, in which we use probabilistic sampling and train the Discriminator to convergence.
|
| 262 |
+
|
| 263 |
+
In (1) and (2), we were careful to set the hard threshold so that the actual acceptance rate was the same as in (3) and (4). Broadly speaking, (4) performs best, (3) performs OK but yields less good samples than (4), (2) yields the same number of good samples as (3), but completely fails to sample from 5 of the 25 modes. (1) actually yields the most good samples for the modes it hits, but it only hits 4 modes!
|
| 264 |
+
|
| 265 |
+
These results show that both continuing to train $D$ so that it can approximate $D ^ { * }$ and performing sampling as in (8), which we have already motivated theoretically, is helpful in practice. For each method, we provide the number of samples within 1, 2, 3 and 4 standard deviations and the number of modes hit in Table 3. For reference, we also compute these statistics for the ground truth distribution and the unfiltered samples from GAN.
|
| 266 |
+
|
| 267 |
+
Table 3: Ablation study on 10,000 generated samples from a 2D grid of Gaussian components. The third to sixth columns represent $\%$ of high-quality samples within $x$ standard deviations. “No FT” stands for the discriminator not being trained to convergence.
|
| 268 |
+
|
| 269 |
+
<table><tr><td></td><td># of recovered modes</td><td>%in “1 std”</td><td>%in “2 std”</td><td>%in “3 std”</td><td>%in “4 std”</td></tr><tr><td>Ground Truth</td><td>25</td><td>39.3</td><td>86.6</td><td>98.9</td><td>99.9</td></tr><tr><td>Vanilla GAN</td><td>25</td><td>27.3</td><td>53.1</td><td>66.2</td><td>75.6</td></tr><tr><td>Threshold (No FT)</td><td>4</td><td>38.5</td><td>92.6</td><td>99.4</td><td>99.8</td></tr><tr><td>Threshold</td><td>20</td><td>34.8</td><td>70.2</td><td>83.6</td><td>89.3</td></tr><tr><td>DRS (No FT)</td><td>25</td><td>31.5</td><td>60.2</td><td>73.6</td><td>81.2</td></tr><tr><td>DRS</td><td>25</td><td>35.3</td><td>65.8</td><td>81.8</td><td>89.8</td></tr></table>
|
| 270 |
+
|
| 271 |
+
In addition, we represent Inception score as a function of acceptance rate in Figure 7-left. Different acceptance rates are achieved by changing $\gamma$ from the $0 ^ { \mathrm { t h } }$ percentile of $F ( x )$ (acceptance rate $=$ $1 0 0 \%$ ) to its $9 0 ^ { \mathrm { t h } }$ percentile (acceptance rate $= 1 4 \%$ ). Decreasing the acceptance rate filters more non-realistic samples and increases the final Inception score. After an specific rate, rejecting more samples does not gain any benefit in collecting a better pool of samples.
|
| 272 |
+
|
| 273 |
+
Moreover, Figure 7-right shows the correlation between the acceptance probabilities that DRS assigns to the synthesized samples and the recognizability of those samples from the view-point of a pre-trained Inception network. The latter is measured by computing $\mathbf { \bar { m a x } } _ { j } p ( y _ { j } | x _ { i } )$ which is the probability of sample $x _ { i }$ belonging to the category $y _ { j }$ from the 1,000 ImageNet classes. As expected, there is a large mass of the recognizable images accepted with high acceptance probabilities on the top right corner. The small mass of images which cannot be easily classified into one of the 1,000 categories while having high acceptance probability scores (the top left corner of the graph) can be due to the non-optimal GAN discriminator in practice. Therefore, we expect that improving the discriminator performance boosts the final inception score even more substantially.
|
| 274 |
+
|
| 275 |
+

|
| 276 |
+
Figure 6: Different models generating 10,000 samples from a 2D grid of Gaussian components.“No FT” stands for the discriminator not being trained to convergence.
|
| 277 |
+
|
| 278 |
+

|
| 279 |
+
Figure 7: Inception Score versus the rate of accepting samples on average (left), and the acceptance probability assigned to each sample $x _ { i }$ by DRS versus the maximum probability of belonging to one of the 1K categories based on a pre-trained Inception network, $\mathrm { m a x } _ { j } \bar { p } ( y _ { j } | x _ { i } ) \bar { ( r i g h t ) }$ .
|
| 280 |
+
|
| 281 |
+
# B NEAREST NEIGHBORS FROM IMAGENET
|
| 282 |
+
|
| 283 |
+
To confirm that our Discriminator Rejection Sampling is not duplicating the training samples, we show the nearest neighbor of a few visually-realistic generated samples in the ImageNet training data in Figures 8-15. The nearest neighbors are found based on their fc7 features from the pre-trained VGG16 model.
|
| 284 |
+
|
| 285 |
+

|
| 286 |
+
Figure 8: Nearest neighbors of the top left generated image in ImageNet training set in terms of VGG16 fc7 features
|
| 287 |
+
|
| 288 |
+

|
| 289 |
+
Figure 9: Nearest neighbors of the top left generated image in ImageNet training set in terms of VGG16 fc7 features
|
| 290 |
+
|
| 291 |
+

|
| 292 |
+
Figure 10: Nearest neighbors of the top left generated image in ImageNet training set in terms of VGG16 fc7 features
|
| 293 |
+
|
| 294 |
+

|
| 295 |
+
Figure 11: Nearest neighbors of the top left generated image in ImageNet training set in terms of VGG16 fc7 features
|
| 296 |
+
|
| 297 |
+

|
| 298 |
+
Figure 12: Nearest neighbors of the top left generated image in ImageNet training set in terms of VGG16 fc7 features
|
| 299 |
+
|
| 300 |
+

|
| 301 |
+
Figure 13: Nearest neighbors of the top left generated image in ImageNet training set in terms of VGG16 fc7 features
|
| 302 |
+
|
| 303 |
+

|
| 304 |
+
Figure 14: Nearest neighbors of the top left generated image in ImageNet training set in terms of VGG16 fc7 features
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
Figure 15: Nearest neighbors of the top left generated image in ImageNet training set in terms of VGG16 fc7 features
|
md/train/SJCscQcge/SJCscQcge.md
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SIMPLE BLACK-BOX ADVERSARIAL PERTURBATIONS FOR DEEP NETWORKS
|
| 2 |
+
|
| 3 |
+
Nina Narodytska Shiva Kasiviswanathan Samsung Research America Mountain View, CA 94043, USA {n.narodytska,kasivisw}@gmail.com
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Deep neural networks are powerful and popular learning models that achieve stateof-the-art pattern recognition performance on many computer vision, speech, and language processing tasks. However, these networks have also been shown susceptible to carefully crafted adversarial perturbations which force misclassification of the inputs. Adversarial examples enable adversaries to subvert the expected system behavior leading to undesired consequences and could pose a security risk when these systems are deployed in the real world.
|
| 8 |
+
|
| 9 |
+
In this work, we focus on deep convolutional neural networks and demonstrate that adversaries can easily craft adversarial examples even without any internal knowledge of the target network. Our attacks treat the network as an oracle (blackbox) and only assume that the output of the network can be observed on the probed inputs. Our first attack is based on a simple idea of adding perturbation to a randomly selected single pixel or a small set of them. We then improve the effectiveness of this attack by carefully constructing a small set of pixels to perturb by using the idea of greedy local-search. Our proposed attacks also naturally extend to a stronger notion of misclassification. Our extensive experimental results illustrate that even these elementary attacks can reveal a deep neural network’s vulnerabilities. The simplicity and effectiveness of our proposed schemes mean that they could serve as a litmus test for designing robust networks.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Convolutional neural networks (CNNs) are among the most popular techniques employed for computer vision tasks, including but not limited to image recognition, localization, video tracking, and image and video segmentation (Goodfellow et al., 2016). Though these deep networks have exhibited good performances for these tasks, they have recently been shown to be particularly susceptible to adversarial perturbations to the input images (Szegedy et al., 2014; Goodfellow et al., 2015; MoosaviDezfooli et al., 2016; Papernot et al., 2016c;b; Kurakin et al., 2016; Grosse et al., 2016; Zagoruyko, 2016b). Vulnerability of these networks to adversarial attacks can lead to undesirable consequences in many practical applications using them. For example, adversarial attacks can be used to subvert fraud detection, malware detection, or mislead autonomous navigation systems (Papernot et al., 2016c; Grosse et al., 2016). Further strengthening these results is a recent observation by Kurakin et al. (2016) who showed that a significant fraction of adversarial images crafted using the original network are misclassified even when fed to the classifier through a physical world system (such as a camera).
|
| 14 |
+
|
| 15 |
+
In this paper, we investigate the problem of robustness of state-of-the-art convolutional neural networks (CNNs) to simple black-box adversarial attacks. The rough goal of adversarial attacks is as follows: Given an image $I$ that is correctly classified by a machine learning system (say, a CNN), is it possible to construct a transformation of $I$ (say, by adding a small perturbation to some or all the pixels) that now leads to misclassification by the system. Since large perturbations can trivially lead to misclassification, the attacks seek to limit the amount of perturbation applied under some chosen metric. More often than not, in these attacks, the modification done to the image is so subtle that the changes are imperceptible to a human eye. Our proposed attacks also share this property, in addition to being practical and simplistic, thus highlighting a worrying aspect about lack of robustness prevalent in these modern vision techniques.
|
| 16 |
+
|
| 17 |
+
There are two main research directions in the literature on adversarial attacks based on different assumptions about the adversarial knowledge of the target network. The first line of work assumes that the adversary has detailed knowledge of the network architecture and the parameters resulting from training (or access to the labeled training set) (Szegedy et al., 2014; Goodfellow et al., 2015; Moosavi-Dezfooli et al., 2016; Papernot et al., 2016c). Using this information, an adversary constructs a perturbation for a given image. The most effective methods are gradient-based: a small perturbation is constructed based on the gradients of the loss function w.r.t. the input image and a target label. Often, adding this small perturbation to the original image leads to a misclassification. In the second line of work an adversary has restricted knowledge about the network from being able to only observe the network’s output on some probed inputs (Papernot et al., 2016b). Our work falls into this category. While this black-box model is a much more realistic and applicable threat model, it is also more challenging because it considers weak adversaries without knowledge of the network architecture, parameters, or training data. Interestingly, our results suggest that this level of access and a small number of queries provide sufficient information to construct an adversarial image.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Table 1: The top row shows the original images and the bottom row shows the perturbed images. The misclassification is as follows: (a) a stingray misclassified as a sea lion, (b) an ostrich misclassified as a goose, (c) a jay misclassified as a junco, and (d) a water ouzel misclassified as a redshank.
|
| 21 |
+
|
| 22 |
+
As we operate in a black-box setting, we use a gradient-free approach to adversarial image generation. Papernot et al. (2016b) were the first to discuss a black-box attack against deep learning systems. Their attack crucially relies on the observation that there is a transferability (generalization) property in adversarial examples, i.e., adversarial examples form one model transfers to another. Our proposed attacks on the other hand is much more simple and direct, does not require this transferability property, and hence is more effective in constructing adversarial images, in addition to having some other computational advantages. We demonstrate that our method is capable of constructing adversarial images for several network architectures trained on different datasets. In particular in this paper, we consider the CIFAR10, MNIST, SVHN, STL10, and ImageNet1000 datasets, and two popular network architectures, Network-in-Network (Lin et al., 2014) and VGG (Simonyan & Zisserman, 2014). In Table 1, we show four images from the ImageNet1000 dataset. The original images are in the upper row. The bottom row shows the corresponding perturbed images produced by our algorithm which are misclassified by a VGG CNN-S network (Chatfield et al., 2014a).
|
| 23 |
+
|
| 24 |
+
Our Contributions. In this work, we present simple and effective black-box adversarial attacks on deep convolutional neural networks. We make the following main contributions in this paper.
|
| 25 |
+
|
| 26 |
+
(1) The first question we investigate is the influence of perturbing a single pixel on the prediction. To do so, we devise a simple scheme, based on randomly selecting a single pixel and applying a strong perturbation to it. Somewhat surprisingly, we noticed that a few trails of this random experiment is already quite enough in generating adversarial images for low resolution image sets. In fact, in many cases, for misclassification, the amount of perturbation needed to be applied to the selected pixel is also quite small. For high-resolution images, a similar phenomena holds, except our scheme now picks a random set of around 50 pixels. These simple experiments show the ease of generating adversarial images for modern deep CNNs without knowledge of either the network architecture or its parameters. There is however one shortcoming in these approaches in that the perturbed image might have pixel values that are outside some expected range.
|
| 27 |
+
|
| 28 |
+
(2) We overcome this above shortcoming by showing that lower perturbation suffices if we carefully select the pixels for perturbation. The approach is based the idea of greedy local search, an iterative search procedure, where in each round a local neighborhood is used to refine the current image and in process minimizing the probability of the network assigning high confidence scores to the true class label. Again while the algorithm is quite simple, it is rather effective in generating adversarial images with quite small perturbations. We also show an interesting connection between the pixels chosen for perturbation by our approach and the saliency map of an image, as defined by Simonyan et al. (2014), that ranks pixels based on their influence on the output score. In effect our approach identifies pixels with high saliency scores but without explicitly using any gradient information (as needed in the definition of saliency map (Simonyan et al., 2014)). Intuitively, in each round, our local-search based approach computes an implicit approximation to the gradient of the current image by understanding the influence of a few pixels on the output, which is then used to update the current image.
|
| 29 |
+
|
| 30 |
+
(3) We perform extensive experimental evaluations, and show that our local-search based approach reliably generates adversarial examples with little perturbation (even when compared to a recent elegant adversarial attack proposed by Goodfellow et al. (2015) which needs perfect knowledge of the network). Another feature of our attack is that, by design, our approach only perturbs a very small fraction of the pixels during the adversarial image generation process (e.g., on the ImageNet1000 dataset we on average perturb only about $0 . 5 \%$ of the pixels per image). Most previous attacks require the ability to perturb all the pixels in the image.
|
| 31 |
+
|
| 32 |
+
(4) Our approaches naturally extend to a stronger notion of misclassification (that we refer to as $k$ -misclassification), where the goal is to ensure that the true label of the image does not even appear in the top- $k$ predictions of the network (obtained by sorting the confidence score vector). This notion especially captures the fact that many modern systems (e.g., ImageNet competition entrants) are evaluated based on top- $k$ predictions. To the best of our knowledge, these are the first adversarial attacks on deep neural networks achieving $k$ -misclassification.
|
| 33 |
+
|
| 34 |
+
# 2 RELATED WORK
|
| 35 |
+
|
| 36 |
+
Starting with the seminal paper by Szegedy et al. (2014), which showed that the state-of-the-art neural networks are vulnerable to adversarial attacks, there has been significant attention focused on this problem. The research has led to investigation of different adversarial threat models and scenarios (Papernot et al., 2016c;b; Grosse et al., 2016; Kurakin et al., 2016; Fawzi et al., 2016), computationally efficient attacks (Goodfellow et al., 2015), perturbation efficient attacks (MoosaviDezfooli et al., 2016), etc.
|
| 37 |
+
|
| 38 |
+
Szegedy et al. (2014) used a box-constrained L-BFGS technique to generate adversarial examples. They also showed a transferability (or generalization) property for adversarial examples, in that adversarial examples generated for one network might also be misclassified by a related network with possibly different hyper-parameters (number of layers, initial weights, etc.). However, the need for a solving a series of costly penalized optimization problems makes this technique computationally expensive for generating adversarial examples. This issue was fixed by Goodfellow et al. (2015) who motivated by the underlying linearity of the components used to build a network proposed an elegant scheme based on adding perturbation proportional to sign of the network’s cost function gradient. Recently, Moosavi-Dezfooli et al. (2016) used an iterative linearization procedure to generate adversarial examples with lesser perturbation. Another recent attack proposed by Papernot et al. (2016c) uses a notion of adversarial saliency maps (based on the saliency maps introduced by (Simonyan et al., 2014)) to select the most sensitive input components for perturbation. This attack has been adapted by Grosse et al. (2016) for generating adversarial samples for neural networks used as malware classifiers. However, all these above described attacks require perfect knowledge of the target network’s architecture and parameters which limits their applicability to strong adversaries with the capability of gaining insider knowledge of the target system.
|
| 39 |
+
|
| 40 |
+
Our focus in this paper is the setting of black-box attacks, where we assume that an adversary has only the ability to use the network as an oracle. The adversary can obtain output from supplied inputs, and use the observed input-output relationship to craft adversarial images.1 In the context of deep neural networks, a black-box attack was first proposed by Papernot et al. (2016b) with the motivation of constructing an attack on a remotely hosted system.2 Their general idea is to first approximate the target network by querying it for output labels, which is used to train a substitute network, which is then used to craft adversarial examples for the original network. The success of the attack crucially depends on the transferability property to hold between the original and the substitute network. Our black-box attack is more direct, and completely avoids the transferability assumption, making it far more applicable. We also avoid the overhead of gathering data and training a substitute network. Additionally, our techniques can be adapted to a stronger notion of misclassification.
|
| 41 |
+
|
| 42 |
+
A complementary line of work has focused on building defenses against adversarial attacks. Although designing defenses is beyond scope of this paper, it is possible that adapting the previous suggested defense solutions such as Jacobian-based regularization (Gu & Rigazio, 2015) and distillation (Papernot et al., 2016d) can reduce the efficacy of our proposed attacks. Moreover, the recently proposed technique of differentially private training (Abadi et al., 2016) can also prove beneficial here.
|
| 43 |
+
|
| 44 |
+
The study of adversarial instability have led to development of solutions that seeks to improve training to in return increase the robustness and classification performance of the network. In some case, adding adversarial examples to the training (adversarial training) set can act like a regularizer (Szegedy et al., 2014; Goodfellow et al., 2015; Moosavi-Dezfooli et al., 2016). The phenomenon of adversarial instability has also been theoretically investigated for certain families of classifiers under various models of (semi) random noise (Fawzi et al., 2015; 2016). However, as we discuss later, due to peculiar nature of adversarial images generated by our approaches, a simple adversarial training is only mildly effective in preventing future similar adversarial attacks.
|
| 45 |
+
|
| 46 |
+
The security of machine learning in settings distinct from deep neural networks is also an area of active research with various known attacks under different threat models. We refer the reader to a recent survey by McDaniel et al. (2016) and references therein.
|
| 47 |
+
|
| 48 |
+
# 3 PRELIMINARIES
|
| 49 |
+
|
| 50 |
+
Notation and Normalization. We denote by $[ n ]$ the set $\{ 1 , \ldots , n \}$ . The dataset of images is partitioned into train and test (or validation) subsets. An element of a dataset is a pair $( I , c ( I ) )$ for an image $I$ and a ground truth label $c ( I )$ of this image. We assume that the class labels are drawn from the set $\{ 1 , \ldots , C \}$ , i.e., we have a set of $C \in \mathbb { N }$ possible labels. We assume that images have $\ell$ channels (in experiments we use the RGB format) and are of width $w \in \mathbb { N }$ and height $h \in \mathbb { N }$ . We say that $( b , x , y )$ is a coordinate of an image for channel $b$ and location $( x , y )$ , and $( \star , x , y )$ is a pixel of an image where $( \star , x , y )$ represents all the $\ell$ coordinates corresponding to different channels at location $( x , { \bar { y } } )$ . $I ( b , x , y ) \in \mathbb { R }$ is the value of $I$ at the $( b , x , y )$ coordinate, and similarly $I ( \star , x , y ) \in \mathbb { R } ^ { \ell }$ represents the vector of values of $I$ at the $( \star , x , y )$ pixel.
|
| 51 |
+
|
| 52 |
+
It is a common practice to normalize the image before passing it to the network. A normalized image has the same dimension as the original image, but differs in the coordinate values. In this work we treat the normalization procedure as an external procedure and assume that all images are normalized. As we always work with normalized images, in the following, a reference to image means a normalized input image. We denote by LB and UB two constants such that all the coordinates of all the normalized images fall in the range [LB, UB]. Generally, $\mathrm { L B } < 0$ and $\mathrm { U B > 0 }$ . We denote by $\mathbb { I } \subset \mathbb { R } ^ { \ell \times w \times h }$ the space of all (valid) images which satisfy the following property: for every $I \in \mathbb { I }$ , for all coordinates $( \bar { b , \boldsymbol { x } } , \boldsymbol { y } ) \in [ \ell ] \times [ w ] \times [ \bar { h ] } , I ( b , \boldsymbol { x } , \boldsymbol { y } ) \in [ \mathrm { \bar { L } B , U B } ] .$ .
|
| 53 |
+
|
| 54 |
+
We denote by NN a trained neural network (trained on some set of training images). NN takes an image $I$ as an input and outputs a vector $\mathbf { N N } ( I ) = ( o _ { 1 } , \dots , o _ { C } )$ , where $o _ { j }$ denotes the probability as determined by NN that image $I$ belongs to class $j$ . We denote $\pi ( \mathrm { N N } ( I ) , k )$ a function that returns a set of indices that are the top- $k$ predictions (ranked by decreasing probability scores with ties broken arbitrarily) of the network NN. For example, if $\mathbf { N N } ( I ) = ( 0 . 2 5 , 0 . 1 , 0 . 2 , 0 . 4 5 )$ , then $\pi ( \operatorname { N N } ( I ) , 1 ) = \{ 4 \}$ (corresponding to the location of the entry 0.45). Similarly, $\pi ( { \mathrm { N N } } ( I ) , 2 ) =$ $\{ 4 , 1 \}$ , $\pi ( \mathbf { N N } ( I ) , 3 ) = \{ 4 , 1 , 3 \}$ , etc.
|
| 55 |
+
|
| 56 |
+
Adversarial Goal. Before we define the goal of black-box adversarial attacks, we define misclassification for a NN. In this paper, we use a stronger notion of misclassification, which we refer to as $k$ -misclassification for $k \in \mathbb N$ .
|
| 57 |
+
|
| 58 |
+
Definition 1 ( $k$ -misclassification) A neural network NN $k$ -misclassifies an image $I$ with true label $c ( I )$ iff the output $\mathrm { N N } ( I )$ of the network satisfies $c ( I ) \not \in \pi ( { \mathrm { N N } } ( I ) , k )$ .
|
| 59 |
+
|
| 60 |
+
In other words, $k$ -misclassification means that the network ranks the true label below at least $k$ other labels. Traditionally the literature on adversarial attacks have only considered the case where $k = 1$ . Note that an adversary that achieves a $k$ -misclassification for $k > 1$ is a stronger adversary than one achieving an 1-misclassification ( $k$ -misclassification implies $k ^ { \prime }$ -misclassification for all $1 \overset { \cdot } { \leq } k ^ { \prime } \leq k ,$ ). If $k = 1$ , we simply say that NN misclassifies the image.
|
| 61 |
+
|
| 62 |
+
In our setting, an adversary ADV is a function that takes in image $I$ as input and whose output is another image $\mathrm { A D V } ( I )$ (with same number of coordinates as $I$ ). We define an adversarial image as one that fools a network into $k$ -misclassification.
|
| 63 |
+
|
| 64 |
+
Definition 2 (Adversarial Image) Given access to an image $I$ , we say that an $\mathrm { A D V } ( I )$ is a $k$ - adversarial image (resp. adversarial image) if $c ( I ) \in \pi ( \mathrm { N N } ( I ) , k )$ and $c ( I ) \notin \pi ( \mathbf { N N } ( \mathbf { A D V } ( I ) ) , k )$ (resp. $c ( I ) \in \pi ( \mathrm { N N } ( I ) , 1 )$ and $c ( I ) \notin \pi ( \mathbf { N N } ( \mathbf { A D V } ( I ) ) , 1 ) .$ ).
|
| 65 |
+
|
| 66 |
+
The goal of adversarial attacks is to design this function ADV that succeeds in fooling the network for a large set of images. Ideally, we would like to achieve this misclassification3 by adding only some small perturbation (under some metric) to the image. The presence of adversarial images shows that there exist small perturbations in input that produce large perturbations at the output of the last layer.
|
| 67 |
+
|
| 68 |
+
Adversarial threat models can be divided into two broad classes.4 The first class of models roughly assumes that the adversary has a total knowledge of the network architecture and the parameters resulting from training (or access to the labeled training set). The second class of threat models, as considered in this paper, make no assumptions about the adversary having access to the network architecture, network parameters, or the training set. In this case, the adversary has only a black-box (oracle) access to the network, in that it can query the network NN on an image $I$ and observe the output $\mathrm { N N } ( I )$ . In our experimental section (Section 6), we also consider a slight weakening of this black-box model where the adversary has only the ability to use a proxy of the network NN as an oracle.
|
| 69 |
+
|
| 70 |
+
A black-box threat model in the context of deep neural networks was first considered by Papernot et al. (2016b). There is however one subtle difference between the threat model considered here and that considered by Papernot et al. (2016b) in what the adversary can access as an output. While the adversary presented in (Papernot et al., 2016b) requires access to the class label assigned by the network which is the same level of access needed by our simple randomized adversary (presented in Section 4), our local-search adversary (presented in Section 5) requires access to $o _ { c ( I ) }$ (the probability assigned to the true label $c ( I )$ by the network on input $I$ ) and the $\pi$ vector (for checking whether $k$ -misclassification has been achieved). Our adversarial approaches does not require access to the complete probability vector $( \mathrm { N N } ( I ) )$ . Also as pointed out earlier, compared to (Papernot et al., 2016b), our approach is more direct (needs no transferability assumption), requires no retraining, and can be adapted to achieve $k$ -misclassification rather than just 1-misclassification.
|
| 71 |
+
|
| 72 |
+
# 4 BLACK-BOX GENERATION: A FIRST ATTEMPT
|
| 73 |
+
|
| 74 |
+
In this section, we present a simple black-box adversary that operates by perturbing a single pixel (or a small set of pixels) selected at random. In the next section, we build upon this idea to construct an adversary that achieves better success by making adaptive choices.
|
| 75 |
+
|
| 76 |
+
Power of One Pixel. Starting point of our investigation is to understand the influence of a single pixel in an adversarial setting. Most existing adversarial attacks operate by applying the same perturbation on each individual pixel while minimizing the overall perturbation (Szegedy et al., 2014; Goodfellow et al., 2015; Moosavi-Dezfooli et al., 2016), while recent research have yielded attacks that perturb only a fraction of the pixels (Papernot et al., 2016c;b; Grosse et al., 2016). However, in all these cases, no explicit restriction is placed on the number of pixels that can be perturbed. Therefore, it is natural to ask: whether it is possible to force the network to misclassify an image by modifying a single pixel? If so, how strong should this perturbation be? We run several experiments to shed light on these questions. For simplicity, in this section, we focus the case of 1-misclassification, even though all discussions easily extend to the case of $k$ -misclassification for $k > 1$ . We begin with a useful definition.
|
| 77 |
+
|
| 78 |
+
Definition 3 (Critical Pixel) 5 Given a trained neural network NN and an image $I$ , a pixel $( \star , x , y )$ in $I$ is a critical pixel if a perturbation of this pixel generates an image that is misclassified by the network NN. In other words, $( \star , x , y )$ is a critical pixel in $I$ if there exists another neighboring image $I _ { p }$ which differs from $I$ only in values at the pixel location $( x , y )$ such that $c ( I ) \notin \pi ( \mathbf { N N } ( I _ { p } ) , 1 )$ .
|
| 79 |
+
|
| 80 |
+
The image $I _ { p }$ can be generated in multiple ways, here we consider a class of sign-preserving perturbation functions defined as follows. Let $\mathtt { P E R T } ( I , p , x , y )$ be a function that takes as input an image $I$ , a perturbation parameter $p \in \mathbb { R }$ , and a location $( x , y )$ , and outputs an image $I _ { p } ^ { ( x , y ) } \in$ $\mathbb { R } ^ { \ell \times w \times h }$ , defined as:
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
I _ { p } ^ { ( x , y ) } ( b , u , v ) \stackrel { \mathrm { \tiny ~ d e f n } } { = } \left\{ { \begin{array} { l l } { { \scriptstyle I ( b , u , v ) } } & { { \mathrm { i f ~ } } x \neq u { \mathrm { ~ o r ~ } } y \neq v } \\ { { p \times \mathrm { s i g n } } ( I ( b , u , v ) ) } & { { \mathrm { o t h e r w i s e } } } \end{array} } \right.
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
In other words, the image $I _ { p } ^ { ( x , y ) } = \mathtt { P E R T } ( I , p , x , y )$ has same values as image $I$ at all pixels except the pixel $( \star , x , y )$ . The value of the image $I _ { p } ^ { ( x , y ) }$ at pixel $( \star , x , y )$ is just $p \times \mathrm { s i g n } ( I ( \star , x , y ) )$ . Note that unlike some of the previous adversarial attacks (Szegedy et al., 2014; Goodfellow et al., 2015; Moosavi-Dezfooli et al., 2016; Papernot et al., 2016c; Grosse et al., 2016), our threat model does not assume access to the true network gradient factors, hence the construction of the perturbed image has to be oblivious to the network parameters.
|
| 87 |
+
|
| 88 |
+
In the following, we say a pixel $( \star , x , y )$ in image $I$ is critical iff $c ( I ) \notin \pi ( \mathbf { N N } ( I _ { p } ^ { ( x , y ) } ) , 1 )$
|
| 89 |
+
|
| 90 |
+
Critical Pixels are Common. Our first experiment is to investigate existence of critical pixels in the considered dataset of images. To do so, we perform a simple procedure that picks a location $( x , y )$ in the image $I$ and applies the PERT function to this pixel to obtain a perturbed image $I _ { p } ^ { ( x , y ) }$ . Then the perturbed image is run through the trained network, and we check whether it was misclassified or not. If the perturbed image $I _ { p } ^ { ( x , y ) }$ is misclassified then we have identified a critical pixel. While we can exhaustively repeat this procedure for all pixels in an image, for computational efficiency we instead perform it only on a fraction of randomly chosen pixels, and our results somewhat surprisingly suggest that in many cases this is sufficient to generate an adversarial image. Algorithm RANDADV presents the pseudo-code for this experiment. Algorithm RANDADV, selects $U$ random pixels (with replacement) and performs checks whether the pixel is critical or not. The algorithm output is an unbiased estimate for the fraction of critical pixels in the input image $I$ . Note that the algorithm can fail in generating an adversarial image (i.e., in finding any critical pixel for an image). The following definition will be useful for our ensuing discussion.
|
| 91 |
+
|
| 92 |
+
Definition 4 (Good Image) We say that an image $I$ with true label $c ( I )$ is good for a network NN iff $c ( I ) \in \pi ( N N ( I ) , 1 )$ (i.e., NN predicts $c ( I )$ as the most likely label for $I$ ).
|
| 93 |
+
|
| 94 |
+
Our first observation is that sometimes even small perturbation to a pixel can be sufficient to obtain an adversarial image. Table 2 shows two images and their adversarial counterparts, with $p = 1$ . Often, original and adversarial images are indistinguishable to the human eye, but sometimes the critical pixel is visible (Table 2).
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
Table 2: The row contains original images followed by misclassified images where only one pixel (pointed using a black arrow) was perturbed with perturbation parameter $p = 1$ . After perturbation, in the first case (images (a) and (b)) an automobile gets misclassified as a truck, and in the second case (images (c) and (d)) a cat gets misclassified as a dog.
|
| 98 |
+
|
| 99 |
+
We also tried to understand the effect of larger perturbation parameter values. We set $U$ to half the number of pixels in each image. After usual training of the neural network using the training set (see Section 6 for more details about training), we ran Algorithm RANDADV on 1000 randomly drawn images from the test set of the corresponding dataset. In our experiments, we varied perturbation parameter in the range $\{ 1 , 5 , 1 0 , 1 0 0 \}$ . Before we consider our results, we note some of the perturbation values that we use to construct the adversarial image might construct images that are not in the original image space.6 However, these results are still somewhat surprising, because even though we allow large (even out-of-range) perturbation, it is applied to exactly one pixel in the image, and it appears that it suffices to even pick the pixel at random.
|
| 100 |
+
|
| 101 |
+
Figures 1 and 2 show results for 4 datasets (more details about the datasets and the networks are presented in Section 6). On the $\mathbf { X }$ -axis we show the perturbation parameter $p$ . In Figure 1, the y-axis represents the output of Algorithm RANDADV averaged over good images for the network.7 The first observation that we can make is that the critical pixels are common, and in fact, as $p$ grows the fraction of critical pixels increases. For example, in CIFAR10, with $p = 1 0 0$ , almost $80 \%$ (on average) of the pixels randomly selected are critical. In Figure 2, the y-axis represents the fraction of successful adversarial images generated by Algorithm RANDADV, i.e., fraction of inputs where Algorithm RANDADV is successful in finding at least one critical pixel. Again we notice that as $p$ grows it gets easier for Algorithm RANDADV to construct an adversarial image.
|
| 102 |
+
|
| 103 |
+
# Algorithm 1 RANDADV (NN)
|
| 104 |
+
|
| 105 |
+
1: Input: Image $I$ with true label $c ( I ) \in \{ 1 , \ldots , C \}$ , perturbation factor $p \in \mathbb R$ , and a budget $U \in \mathbb { N }$ on the
|
| 106 |
+
number of trials
|
| 107 |
+
2: Output: A randomized estimate on the fraction of critical pixels in the input image $I$
|
| 108 |
+
3: $i = 1$ , critical $= 0$
|
| 109 |
+
4: while $i \leq U$ do
|
| 110 |
+
5: randomly pick a pixel $( \star , x , y )$
|
| 111 |
+
6: compute a perturbed image I(x,y)p = $I _ { p } ^ { ( x , y ) } = \mathtt { P E R T } ( I , p , x , y )$
|
| 112 |
+
7: if $c ( I ) \notin \pi ( \mathbf { N N } ( I _ { p } ^ { ( x , y ) } ) , 1 )$ then
|
| 113 |
+
8: critical critical $+ 1$
|
| 114 |
+
9: end if
|
| 115 |
+
10: $i \gets i + 1$
|
| 116 |
+
11: end while
|
| 117 |
+
12: {The algorithm succeeds in generating an adversarial image if it finds at least one critical pixel}
|
| 118 |
+
13: return $\frac { \mathrm { \bar { c r i t i c a l } } } { U }$
|
| 119 |
+
|
| 120 |
+
Another observation is that for the MNIST and STL10 datasets, Algorithm RANDADV succeeds in finding fewer critical pixels as compared to SVHN and CIFAR10 datasets. We give the following explanation for this observation. The majority of pixels in an MNIST image belong to the background, hence, these pixels are less likely to be critical. On the other hand, STL10 contains high resolution images, $9 6 \times 9 6$ , where perhaps a single pixel has less of an impact on the output prediction. The latter observation motivated us to generalize the notion of a critical pixel to a critical set.
|
| 121 |
+
|
| 122 |
+

|
| 123 |
+
Figure 1: Output of Algorithm RANDADV (averaged over good images). The results are for two networks: a) Network-in-Network and b) VGG. The perturbation parameter $p$ is varied from $\{ 1 , 5 , 1 0 , 1 0 0 \}$ .
|
| 124 |
+
|
| 125 |
+

|
| 126 |
+
Figure 2: Fraction of images where Algorithm RANDADV succeeds in finding at least one critical pixel. Again we only start with only good images.
|
| 127 |
+
|
| 128 |
+
Definition 5 (Critical Set) Given a trained neural network NN and an image I, a critical set of I is a set of pixels $\textstyle \bigcup _ { ( x , y ) } \{ ( \star , x , y ) \}$ in $I$ such that a perturbation of these pixels generates an image that is misclassified by the network NN.
|
| 129 |
+
|
| 130 |
+
The general goal will be to find critical sets of small size in an image. With this notion of critical set, we considered constructing adversarial images on the high-resolution ImageNet1000 dataset. We can modify the definition of $I _ { p } ^ { ( x , y ) }$ (from (1)) where instead of a single pixel we perturb all the pixels in a set. Similarly, we can devise a simple extension to Algorithm RANDADV to operate with a set of pixels and to output an unbiased estimate for the fraction of critical sets of some fixed size (50 in our case) in the input image.8 Note that a set size of 50 pixels is still a tiny fraction of all the pixels in a standard (center) crop of size $2 2 4 \times 2 2 4$ , namely just $0 . 0 9 \%$ . We use a larger perturbation parameter $p$ than before, and set $( U )$ the budget on the number of trials on an image as 5000. Figure 3 shows our results. Overall, we note that we can draw similar conclusions as before, i.e., increasing the perturbation parameter creates more critical sets making them easier to find and relatively small perturbations are sufficient to construct adversarial images.
|
| 131 |
+
|
| 132 |
+
# 5 BLACK-BOX GENERATION: A GREEDY APPROACH
|
| 133 |
+
|
| 134 |
+
The results from Section 4 show that most images have critical pixels such that modifying these pixels significantly leads to a failure of NN to classify the image correctly. However, one shortcoming of Algorithm RANDADV was that to build adversarial images, we sometimes had to apply a large perturbation to a single pixel (or a small set of pixels). Hence, there might exist a pixel (or a set of pixels) in the adversarial image whose coordinate value could lie outside the valid range [LB, UB]. To overcome this issue, we need to redesign the search procedure to generate adversarial images that still belong to the original image space I (defined in Section 3). Here a brute-force approach is generally not feasible because of computational reasons, especially in high-resolution images. Hence, we need to develop an efficient heuristic procedure to find the right small set of pixels to be perturbed. Our solution presented in this section is based on performing a greedy local search over the image space.
|
| 135 |
+
|
| 136 |
+

|
| 137 |
+
Figure 3: Experiments in Figures 1 and 2 for the high-resolution ImageNet1000 dataset. The results are again for good images from a set of 1000 randomly selected images. We use a slightly modified version of Algorithm RANDADV that perturbs a set of 50 pixels.
|
| 138 |
+
|
| 139 |
+
We consider the general $k$ -misclassification problem (Definition 1) where an adversarial attack ensures that the true label does not appear in the top- $k$ predictions of the network. We utilize a local-search procedure, which is an incomplete search procedure that is widely used for solving combinatorial problems appearing in diverse domains such as graph clustering, scheduling, logistics, and verification (Lenstra, 1997). For a general optimization problem it works as follows. Consider an objective function $f ( \mathbf { z } ) : \mathbb { R } ^ { n } \to \mathbb { R }$ where the goal is to minimize $f ( \mathbf { z } )$ . The local-search procedure works in rounds, where each round consists of two steps. Let $\mathbf { z } _ { i - 1 }$ be the solution iterate after round $i - 1$ . Consider round $i$ . The first step is to select a small subset of points $Z = \{ \hat { \mathbf { z } } _ { 1 } , \hdots , \hat { \mathbf { z } } _ { n } \}$ , a so called local neighborhood, and evaluate $f ( \hat { \mathbf { z } } _ { j } )$ for every $\hat { \mathbf { z } } _ { j } \in Z$ . Usually, the set $Z$ consist of points that are close to current $\mathbf { z } _ { i - 1 }$ for some measure of distance which is domain specific. The second step selects a new solution $\mathbf { z } _ { i }$ taking into account the previous solution $\mathbf { z } _ { i - 1 }$ and the points in $Z$ . Hence, $\mathbf { z } _ { i } = g ( f ( \mathbf { z } _ { i - 1 } ) , f ( \hat { \mathbf { z } } _ { 1 } ) , \hdots , f ( \hat { \mathbf { z } } _ { n } ) )$ , where $g$ is some pre-defined transformation function.
|
| 140 |
+
|
| 141 |
+
We adapt this general procedure to search critical sets efficiently as explained below. Our optimization problem will try to minimize the probability that the network determines an perturbed image has the class label of the original image, and by using a local-search procedure we generate perturbed images which differ from the original image in only few pixels. Intuitively, in each round, our local-search procedure computes an implicit approximation to the gradient of the current image by understanding the influence of a few pixels on the output, which is then used to update the current image.
|
| 142 |
+
|
| 143 |
+
(a) First, we need to define the cost function $f$ . Let $I$ be the image (with true label $c ( I ) ,$ ) whose adversarial image we want to generate for a target neural network NN. For some input image $\hat { I }$ , we use the objective function $f _ { c ( I ) } ( \hat { I } )$ which equals the probability assigned by the network NN that the input image $\hat { I }$ belongs to class $c ( I )$ . More formally,
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
f _ { c ( I ) } ( \hat { I } ) = o _ { c ( I ) } \mathrm { w h e r e } \mathrm { N N } ( \hat { I } ) = ( o _ { 1 } , \dots , o _ { C } ) ,
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+
with $o _ { j }$ denoting the probability as determined by NN that image $\hat { I }$ belongs to class $j$ . Our local-search procedure aims to minimize this function.
|
| 150 |
+
|
| 151 |
+
(b) Second, we consider how to form a neighborhood set of images. As mentioned above, the localsearch procedure operates in rounds. Let $\hat { I } _ { i - 1 }$ be the image after round $i - 1$ . Our neighborhood will consist of images that are different in one pixel from the image $\hat { I } _ { i - 1 }$ . In other words, if we measure the distance between $\hat { I } _ { i - 1 }$ and any image in the neighborhood as the number of perturbed pixels, then this distance is the same (equal to one) for all of them. Therefore, we can define the neighborhood in terms of a set of pixel locations. Let $( P _ { X } , P _ { Y } ) _ { i }$ be a set of pixel locations. For the first round $( P _ { X } , P _ { Y } ) _ { 0 }$ is randomly generated. At each subsequent round, it is formed based on a set of pixel locations which were perturbed in the previous round. Let $( P _ { X } ^ { * } , P _ { Y } ^ { * } ) _ { i - 1 }$ denote the pixel locations that were perturbed in round $i - 1$ (formally defined below). Then
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
( P _ { X } , P _ { Y } ) _ { i } = \bigcup _ { \{ ( a , b ) \in ( P _ { X } ^ { * } , P _ { Y } ^ { * } ) _ { i - 1 } \} } \bigcup _ { \{ x \in [ a - d , a + d ] , y \in [ b - d , b + d ] \} } ( x , y ) ,
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
where $d$ is a parameter. In other words, we consider pixels that were perturbed in the previous round, and for each such pixel we consider all pixels in a small square with the side length $2 d$ centered at that pixel. This defines the neighborhood considered in round $i$ .
|
| 158 |
+
|
| 159 |
+
(c) Third, we describe the transformation function $g$ of a set of pixel locations. The function $g$ takes as input an image $\hat { I }$ , a set of pixel locations $( P _ { X } , P _ { Y } )$ , a parameter $t$ that defines how many pixels will be perturbed by $g$ , and two perturbation parameters $p$ and $r$ . In round $i$ of the local-search procedure, the function $g ( \hat { I } _ { i - 1 } , ( P _ { X } , P _ { Y } ) _ { i - 1 } , t , p , r )$ outputs a new image, such that exactly $t$ pixels of $\hat { I } _ { i - 1 }$ are perturbed, and an auxiliary set of pixel locations $( P _ { X } ^ { * } , P _ { Y } ^ { * } ) _ { i }$ to record which $t$ pixels where perturbed at this round, so we have $( \hat { I } _ { i } , ( P _ { X } ^ { * } , P _ { Y } ^ { * } ) _ { i } ) = g ( \hat { I } _ { i - 1 } , ( P _ { X } , P _ { Y } ) _ { i - 1 } , t , p , r )$ . Next we describe transformations that $g$ performs in round $i$ . As the first step, $g$ constructs a set of perturbed images based on $( P _ { X } , P _ { Y } ) _ { i - 1 }$ :
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
\mathcal { T } = \bigcup _ { ( x , y ) \in ( P _ { X } , P _ { Y } ) _ { i - 1 } } \{ \operatorname { P E R T } ( \hat { I } _ { i - 1 } , p , ( x , y ) ) \} ,
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
where PERT is the perturbation function defined through (1). Then it computes the score of each image in $\mathcal { T }$ as
|
| 166 |
+
|
| 167 |
+
$$
|
| 168 |
+
\forall \tilde { I } \in \mathcal { T } : \mathrm { s c o r e } ( \tilde { I } ) = f _ { c ( I ) } ( \tilde { I } ) ,
|
| 169 |
+
$$
|
| 170 |
+
|
| 171 |
+
and it sorts (in decreasing order) images in $\mathcal { T }$ based on the above score function to construct sorted $( \mathcal { T } )$ . Pixels whose perturbation lead to a larger decrease of $f$ are more likely useful in constructing an adversarial candidate. From sorted $( \mathcal { T } )$ , it records a set of pixel locations $( P _ { X } ^ { * } , P _ { Y } ^ { * } ) _ { i }$ based on the first $t$ elements of sorted $( \mathcal { T } )$ , where the parameter $t$ regulates the number of pixels perturbed in each round. Formally,
|
| 172 |
+
|
| 173 |
+
$$
|
| 174 |
+
( P _ { X } ^ { * } , P _ { Y } ^ { * } ) _ { i } = \{ ( x , y ) : { \mathrm { P E R T } } ( { \hat { I } } _ { i - 1 } , p , ( x , y ) ) \in { \mathrm { s o r t e d } } ( { \mathcal { T } } ) [ 1 : t ] \} ,
|
| 175 |
+
$$
|
| 176 |
+
|
| 177 |
+
where sorted $\left( \mathcal { T } \right) \left[ 1 : t \right]$ represents the first $t$ sorted images in sorted $( \mathcal { T } )$ . Finally, $\hat { I } _ { i }$ is constructed from $\hat { I } _ { i - 1 }$ by perturbing each pixel in location $( x , y ) \in ( P _ { X } ^ { * } , P _ { Y } ^ { * } ) _ { i }$ with a perturbation value $r$ . The perturbation is performed in a cyclic way (as explained in Algorithm CYCLIC) so that we make sure that all coordinate values in $\hat { I } _ { i }$ are within the valid bounds of LB and UB. Note that at the end of every round $i$ , $\hat { I } _ { i }$ is a valid image from the image space $\mathbb { I }$ .
|
| 178 |
+
|
| 179 |
+
We want to point out that the function $g$ uses two perturbation parameters, $p$ and $r$ . The value of $r$ is kept small in the range [0, 2]. On the other hand, we do not put any explicit restrictions on the value of $p$ . The best choice of $p$ will be one that facilitates the identification of the “best” pixels to perturb in each round. In our experiments, we adjust the value of $p$ automatically during the search. We defer this discussion to the experimental section.
|
| 180 |
+
|
| 181 |
+
Algorithm LOCSEARCHADV shows the complete pseudocode of our local-search procedure. At the high level, the algorithm takes an image as input, and in each round, finds some pixel locations to perturb using the above defined objective function and then applies the above defined transformation function to these selected pixels to construct a new (perturbed) image. It terminates if it succeeds to push the true label below the $k$ th place in the confidence score vector at any round. Otherwise, it proceeds to the next round (for a maximum of $R$ rounds). Note that the number of pixels in an image perturbed by Algorithm LOCSEARCHADV is at most $t \times R$ and in practice (see Tables 4, 5,and 6 in Section 6) it is much less. In round $i$ , we query the network at most the number of times as the number of pixels in $( P _ { X } , P _ { Y } ) _ { i }$ which after the first round is at most $2 d \times 2 d \times t$ (again in practice this is much less because of the overlaps in the neighborhood squares).
|
| 182 |
+
|
| 183 |
+
In Section 6, we demonstrate the efficacy of Algorithm LOCSEARCHADV in constructing adversarial images. We first highlight an interesting connection between the pixels perturbed and their influences measured by a notion of called saliency map.
|
| 184 |
+
|
| 185 |
+
A Relation to Saliency Maps. Simonyan et al. (2014) introduced the notion of saliency map as a way to rank pixels of the original images w.r.t. their influence on the output of the network. The intuition is that influential pixels in the saliency map are more likely to be important pixels that represent objects and, for example, can be used for weakly supervised object localization. Formally, let $\mathrm { N } \mathrm { \bar { N } } _ { c ( I ) } ( I )$ denote the probability assigned to true class $c ( I )$ by the network NN on input $I \in \mathbb { R } ^ { \ell \times \mathbf { \bar { w } } \times h }$ . Let $\dot { W _ { c ( I ) } } \in R ^ { \ell \times w \times h }$ denote the derivative of $\mathrm { N N } _ { c ( I ) }$ with respect to the input evaluated at image $I$ .
|
| 186 |
+
|
| 187 |
+
<table><tr><td>Algorithm 2 CYCLIC (r,b,x,y)</td></tr><tr><td>Assumptions:Perturbation parameter r ∈ [O,2] and LB≤O≤UB</td></tr><tr><td>Output:Perturbed image value at the coordinate (b,x,y) which lies in the range [LB,UB]</td></tr><tr><td>if rI(b,x,y)<LB then return rI(b,x,y)+(UB-LB)</td></tr><tr><td>else if rI(b,x,y)>UB then</td></tr><tr><td>return rI(b,x,y)-(UB-LB)</td></tr><tr><td>else</td></tr><tr><td>return rI(b,x,y)</td></tr></table>
|
| 188 |
+
|
| 189 |
+
# Algorithm 3 LOCSEARCHADV (NN)
|
| 190 |
+
|
| 191 |
+
Input: Image $I$ with true label $c ( I ) \in \{ 1 , \ldots , C \}$ , two perturbation parameters $p \in \mathbb R$ and $r \in [ 0 , 2 ]$ , and four other parameters: the half side length of the neighborhood square $d \in \mathbb { N }$ , the number of pixels perturbed at each round $t \in \mathbb { N }$ , the threshold $k \in \mathbb N$ for $k$ -misclassification, and an upper bound on the number of rounds $R \in \mathbb N$ .
|
| 192 |
+
|
| 193 |
+
Output: Success/Failure depending on whether the algorithm finds an adversarial image or not
|
| 194 |
+
$\hat { I } _ { 0 } = I , i = 1$
|
| 195 |
+
Pick $1 0 \%$ of pixel locations from $I$ at random to form $( P _ { X } , P _ { Y } ) _ { 0 }$
|
| 196 |
+
while $i \leq R$ do {Computing the function $g$ using the neighborhood} $\begin{array} { r } { \mathcal { T } \bigcup _ { ( x , y ) \in ( P _ { X } , P _ { Y } ) _ { i - 1 } } \{ \mathrm { P E R T } \big ( \hat { I } _ { i - 1 } , p , x , y ) \} } \end{array}$ Compute $\mathrm { s c o r e } ( \tilde { I } ) = f _ { c ( I ) } ( \tilde { I } )$ for each $\tilde { I } \in \mathcal { I }$ (where $f _ { c ( I ) } ( \tilde { I } ) = o _ { c ( I ) }$ with $\mathbf { N N } ( \tilde { I } ) = ( o _ { 1 } , \dots , o _ { C } ) )$ sorted $( { \mathcal { T } } ) \gets$ images in $\mathcal { T }$ sorted by descending order of score $( P _ { X } ^ { * } , P _ { Y } ^ { * } ) _ { i } \gets \{ ( x , y ) : \operatorname { P E R T } ( \hat { I } _ { i - 1 } , p , x , y ) \in \operatorname { s o r t e d } ( \mathcal { D } ) [ 1 : t ] \}$ (with ties broken arbitrarily) {Generation of the perturbed image $\hat { I } _ { i }$ } for $( x , y ) \in ( P _ { X } ^ { * } , \bar { P } _ { Y } ^ { * } ) _ { i }$ and each channel $^ { b }$ do $\hat { I } _ { i } ( b , x , y ) \mathrm { C Y C l }$ LIC $( r , b , x , y )$ end for {Check whether the perturbed image $\hat { I } _ { i }$ is an adversarial image} if $c ( I ) \notin \pi ( \mathbf { N N } ( \hat { I } _ { i } ) , \bar { k } )$ then return Success end if {Update a neighborhood of pixel locations for the next round} $\begin{array} { r } { ( \hat { P _ { X } } , P _ { Y } ) _ { i } \longleftarrow \bigcup _ { \{ ( a , b ) \in ( P _ { X } ^ { * } , P _ { Y } ^ { * } ) _ { i - 1 } \} } \bigcup _ { \{ x \in [ a - d , a + d ] , y \in [ b - d , b + d ] \} } ( x , y ) } \end{array}$ i ← i + 1
|
| 197 |
+
end while
|
| 198 |
+
return Failure
|
| 199 |
+
|
| 200 |
+
The saliency map of $I$ is the matrix $M \in \mathbb { R } ^ { w \times h }$ such that $\begin{array} { r } { M _ { i , j } = \operatorname* { m a x } _ { b \in [ \ell ] } \ | W _ { c ( I ) } ( b , x , y ) | } \end{array}$ , where $W _ { c ( I ) } ( b , x , y )$ is the element of $W _ { c ( I ) }$ corresponding to channel $b$ and location $( x , y )$ . Pixels with higher scores are considered more influential. In subsequent works, this notion has been extended to adversarial saliency maps that can be useful in generating adversarial perturbations (Papernot et al., 2016c).
|
| 201 |
+
|
| 202 |
+
Computing the exact saliency scores for an image requires complete access to the network NN, which we do not assume. However, a natural hypothesis is that the pixels selected by Algorithm LOCSEARCHADV for perturbation are related to pixels with large saliency scores. We use the ImageNet1000 dataset to test this hypothesis. In Figure 3, we present some qualitative results. As can be seen from the pictures, the pixels perturbed by Algorithm LOCSEARCHADV appear correlated with pixels with high saliency scores. Quantitatively, we observed that the pixels that occupy top- $10 \%$ of the saliency map, on average contain more than $23 \%$ of the pixels chosen by Algorithm LOCSEARCHADV for perturbation (and this overlap only grows when we consider a bigger chunk of pixels picked by their saliency scores). Note that this is correlation is not though a random occurrence. For an image $I$ , let $S _ { I }$ denote the set of pixels in $I$ that rank among the top- $10 \%$ in the saliency map. If we pick a random set of around 200 pixels (this is on average number of pixels perturbed per image by Algorithm LOCSEARCHADV perturbs, see Table 5), we expect only about $10 \%$ t o them to intersect with $S _ { I }$ and standard tail bounds show that the probability that at least $23 \%$ of the pixels of this random set intersects with $S _ { I }$ is extremely small.9 Therefore, it appears that Algorithm LOCSEARCHADV rediscovers part of the high salient score pixels but without explicitly computing the gradients.
|
| 203 |
+
|
| 204 |
+
# 6 EXPERIMENTAL EVALUATION
|
| 205 |
+
|
| 206 |
+
We start by describing our experimental setup. We used Caffe and Torch machine learning frameworks to train the networks. All algorithms to generate adversarial images were implemented in Lua within Torch 7. All experiments were performed on a cluster of GPUs using a single GPU for each run.
|
| 207 |
+
|
| 208 |
+
Datasets. We use 5 popular datasets: MNIST (handwritten digits recognition dataset), CIFAR10 (objects recognition dataset), SVHN (digits recognition dataset), STL10 (objects recognition dataset), and ImageNet1000 (objects recognition dataset).
|
| 209 |
+
|
| 210 |
+
Models. We trained Network-in-Network (Lin et al., 2014) and VGG (Simonyan & Zisserman, 2014) for MNIST, CIFAR, SVHN, STL10, with minor adjustments for the corresponding image sizes. Network-in-Network is a building block of the commonly used GoogLeNet architecture that has demonstrated very good performance on medium size datasets, e.g. CIFAR10 (Zagoruyko, 2015). VGG is another powerful network that proved to be useful in many applications beyond image classification, like object localization (Ren et al., 2015). We trained each model in two variants: with and without batch normalization (Ioffe & Szegedy, 2015). Batch normalization was placed before a ReLU layer in all networks. For the ImageNet1000 dataset, we used pre-trained VGG models from (Chatfield et al., 2014b) (we did not train them from scratch due to limited resources). All Caffe VGG models were converted to Torch models using the loadcaffe package (Zagoruyko, 2016a). These models use different normalization procedures which we reproduced for each model based on provided descriptions. Tables 4 and 5 (the second column ERRTOP-1) show the top-1 (base) error for all datasets and models that we considered. The results are comparable with the known state-of-the-art results on these datasets (Benenson, 2016).
|
| 211 |
+
|
| 212 |
+
Related Techniques. There are quite a few approaches for generating adversarial images (as discussed in Section 2). Most of these approaches require access to the network architecture and its parameter values (Szegedy et al., 2014; Goodfellow et al., 2015; Moosavi-Dezfooli et al., 2016; Papernot et al., 2016c).10 The general idea behind these attacks is based on the evaluating the network’s sensitivity to the input components in order to determine a perturbation that achieves the adversarial misclassification goal. Among these approaches, the attack approach (known as the “fast-gradient sign method”) suggested by Goodfellow et al. (2015) stands out for being able to efficiently generate adversarial images. Here we compare the performance of our local-search based attack against this fast-gradient sign method.11
|
| 213 |
+
|
| 214 |
+

|
| 215 |
+
Table 3: Results on ImageNet1000 using VGG CNN-S (Caffe) network (Chatfield et al., 2014a). Columns from left to right: the original image, top 150 pixels chosen according to their saliency scores (in white), the absolute difference between the perturbed image and the true image (the pixels that are perturbed appear in white), and the perturbed image. Adversarial misclassification (rows from top to bottom): a ruffed grouse misclassified as a frilled lizard, an artichoke misclassified as a sleeping bag, a bubble misclassified as a fountain, and a hare misclassified as a cheetah.
|
| 216 |
+
|
| 217 |
+
For completeness, we now briefly explain the fast-gradient sign method of Goodfellow et al. (2015). Given an image $I _ { 0 }$ , a label $a \in \{ 1 , \ldots , C \}$ , and a network NN, the fast-gradient sign method perturbs $I _ { 0 }$ using the following update rule: $I _ { 0 } ^ { \mathrm { p e r t } } = I _ { 0 } + \epsilon \cdot \mathrm { s i g n } ( \nabla _ { I = I _ { 0 } } \mathrm { L o s s } ( \mathbf { N N } ( I ) , a ) )$ where $\operatorname { s i g n } ( \nabla _ { I = I _ { 0 } } \operatorname { L o s s } ( \mathbf { N N } ( I ) , a ) )$ is the sign of the network’s cost function gradient (here $\mathrm { L o s s } ( \mathbf { N N } ( I ) , a )$ denotes the loss function of the network NN given input $I$ and class $a$ ). We vary $a$ over all possible labels in the dataset and choose the best result where this procedure is successful in generating an adversarial image. Without general guidelines for setting $\epsilon$ , we experimented with several values of $\epsilon$ starting from 0.07 and increasing this number. We found that the value $\epsilon = 0 . 2 ^ { 1 2 }$ was the smallest value where the fast-gradient sign method started to yield competitive performance compared to our algorithm. Smaller values of $\epsilon$ leads to generation of fewer adversarial images, e.g., at $\epsilon = 0 . 1$ , the percentage of generated adversarial images is reduced by around $10 \%$ as compared to the value at $\epsilon = 0 . 2$ for the CIFAR10 dataset on the Network-in-Network model. Larger values of $\epsilon$ tends to generate more adversarial images, but this comes at the cost of an increase in the perturbation. As we discuss later, our local-search based approach yields better results than the fast-gradient sign method in both the volume of adversarial images generated and the amount of perturbation applied. Another important point to remember is that unlike the fast-gradient sign method, our approach is based on a weaker and more realistic assumption on the adversarial power, making our attacks more widely applicable.
|
| 218 |
+
|
| 219 |
+
Implementing Algorithm LOCSEARCHADV. For each image $I$ , we ran Algorithm LOCSEARCHADV for at most 150 rounds, perturbing 5 pixels at each round, and use squares of side length 10 to form the neighborhood (i.e., $R = 1 5 0 , t = 5 , d = 5 )$ . With this setting of parameters, we perturb a maximum of $t \times R = 7 5 0$ pixels in an image. The perturbation parameter $p$ was adaptively adjusted during the search. This helps in faster determination of the most helpful pixels in generating the adversarial image. Let $I$ be the original image. For some round $i$ of the algorithm, define $\bar { o } _ { c ( I ) } = \arg _ { ( x , y ) } \{ o _ { c ( I ) } : ( x , y ) \in ( P _ { X } ^ { * } , P _ { Y } ^ { * } ) _ { i - 1 } \} .$ , where ${ { O } _ { c ( I ) } }$ is the probability assigned to class label $c ( I )$ in $\mathrm { N N } \big ( \mathrm { P E R T } \big ( \hat { I } _ { i - 1 } , p , x , y \big ) \big )$ (here $\bar { o } _ { c ( I ) }$ provides an approximation of the average confidence of the network NN in predicting the true label over perturbed images). At each round, we increase the value of $p$ if $\bar { o } _ { c ( I ) }$ is close to one and decrease $p$ if $\bar { o } _ { c ( I ) }$ is low, e.g., below 0.3. For Algorithm CYCLIC, we set $r = 3 / 2$ . To avoid perturbing the most sensitive pixels frequently, we make sure that if a pixel is perturbed in a round then we exclude it from consideration for the next 30 rounds.
|
| 220 |
+
|
| 221 |
+
Experimental Observations. For ease of comparison with the fast-gradient sign method (Goodfellow et al., 2015), we set $k = 1$ and focus on achieving 1-misclassification. Tables 4 and 5 show the results of our experiments on the test sets. The first column shows the dataset name. The second column (ERRTOP-1) presents the top-1 misclassification rate on the corresponding test dataset without any perturbation (base error). ERRTOP-1(ADV) is the top-1 misclassification rate where each original image in the test set was replaced with an generated perturbed image (using either our approach or the fast-gradient sign method (Goodfellow et al., 2015) which is denoted as FGSM).13
|
| 222 |
+
|
| 223 |
+
In the following, we say an adversarial generation technique ADV, given an input image $I$ , succeeds in generating an adversarial image $\mathrm { A D V } ( I )$ for a network NN iff $c ( I ) \in \pi ( \mathrm { N N } ( I ) , 1 )$ and $c ( I ) \notin$ $\pi ( \bar { \mathrm { N N } } ( \mathrm { A D V } ( I ) ) , 1 )$ . The CONF column shows the average confidence over all successful adversarial images for the corresponding technique. The PTB column shows the average (absolute) perturbation added per coordinate in cases of successful adversarial generation. More formally, let $\tau$ denote the test set and $\tau _ { \mathrm { A D V } } \subseteq \tau$ denote the set of images in $\tau$ on which ADV is successful. Then,
|
| 224 |
+
|
| 225 |
+
$$
|
| 226 |
+
\mathsf { P T B } = \frac { 1 } { | \mathcal T _ { \mathrm { A D V } } | } \sum _ { I \in \mathcal T _ { \mathrm { A D V } } } \frac { 1 } { \ell \times w \times h } \sum _ { b , x , y } | I ( b , x , y ) - \mathrm { A D V } ( I ) ( b , x , y ) | ,
|
| 227 |
+
$$
|
| 228 |
+
|
| 229 |
+
where $I \in \mathbb { R } ^ { \ell \times w \times h }$ is the original image and $\mathrm { A D V } ( I ) \in \mathbb { R } ^ { \ell \times w \times h }$ is the corresponding adversarial image. Note that the inner summation is measuring the $L _ { 1 }$ -distance between $I$ and $\mathrm { A D V } ( I )$ . The #PTBPIXELS column shows the average percentage of perturbed pixels in the successful adversarial images. Similarly, TIME column shows the average time (in seconds) to generate a successful adversarial image. Finally, the last column indicates the type of network architecture.
|
| 230 |
+
|
| 231 |
+
As is quite evident from these results, Algorithm LOCSEARCHADV is more effective than the fastgradient sign method in generating adversarial images, even without having access to the network architecture and its parameter values. The difference is quite prominent for networks trained with batch normalization as here we noticed that the fast-gradient sign method has difficulties producing adversarial images.14 Another advantage with our approach is that it modifies a very tiny fraction of pixels as compared to all the pixels perturbed by the fast-gradient sign method, and also in many cases with far less average perturbation. Putting these points together demonstrates that
|
| 232 |
+
|
| 233 |
+
Algorithm LOCSEARCHADV is successful in generating more adversarial images than the fastgradient sign method, while modifying far fewer pixels and adding less noise per image. On the other side, the fast-gradient sign method takes lesser time in the generation process and generally seems to produce higher confidence scores for the adversarial (misclassified) images.
|
| 234 |
+
|
| 235 |
+
Table 5 shows the results for several variants of VGG network trained on the ImageNet1000 dataset. These networks do not have batch normalization layers (Chatfield et al., 2014b; Zagoruyko, 2016a). We set $\epsilon = 1$ for the fast-gradient sign method as a different pre-processing technique was used for this network (we converted these networks from pre-trained Caffe models). Results are similar to that observed on the smaller datasets. In most cases, our proposed local-search based approach is more successful in generating adversarial images while on average perturbing less than $0 . 5 5 \%$ of the pixels.
|
| 236 |
+
|
| 237 |
+
Case of Larger $k$ ’s. We now consider achieving $k$ -misclassification for $k \geq 1$ using Algorithm LOCSEARCHADV. In Table 6, we present the results as we change the goal from 1- misclassification to 4-misclassification on the CIFAR10 dataset. We use the same parameters as before for Algorithm LOCSEARCHADV. As one would expect, as we increase the value of $k$ , the effectiveness of the attack decreases, perturbation and time needed increases. But overall our local-search procedure is still able to generate a large fraction of adversarial images at even $k = 4$ with a small perturbation and computation time, meaning that these images will fool even a system that is evaluated on a top-4 classification criteria. We are not aware of a straightforward extension of the fast-gradient sign method (Goodfellow et al., 2015) to achieve $k$ -misclassification.
|
| 238 |
+
|
| 239 |
+
Even Weaker Adversarial Models. We also consider a weaker model where the adversary does not even have a black-box (oracle) access to the network (NN) of interest, and has to rely on a black-box access to somewhat of a “similar” (proxy) network as NN. For example, the adversary might want to evade a spam filter A, but might have to develop adversarial images by utilizing the output of a spam filter B, which might share properties similar to A.
|
| 240 |
+
|
| 241 |
+
We trained several modifications of Network-in-Network model for the CIFAR10 dataset, varying the initial value of the learning rate, the size of filters, and the number of layers in the network. We observed that between $2 5 \%$ to $43 \%$ of adversarial images generated by Algorithm LOCSEARCHADV using the original network were also adversarial for these modified networks (at $k = 1$ ). The transferability of adversarial images that we observe here has also been observed with other attacks too (Szegedy et al., 2014; Goodfellow et al., 2015; Papernot et al., 2016b;a) and demonstrates the wider applicability of all these attacks.
|
| 242 |
+
|
| 243 |
+
# 7 CONCLUSION
|
| 244 |
+
|
| 245 |
+
We investigate the inherent vulnerabilities in modern CNNs to practical black-box adversarial attacks. We present approaches that can efficiently locate a small set of pixels, without using any gradient information, which when perturbed lead to misclassification by a deep neural network. Our extensive experimental results, somewhat surprisingly, demonstrates the effectiveness of our simple approaches in generating adversarial examples.
|
| 246 |
+
|
| 247 |
+
Defenses against these attacks is an interesting research direction. However, we note that here that by limiting the perturbation to some pixels (being localized) the adversarial images generated by our local-search based approach do not represent the distribution of the original data. This means for these adversarial images, the use of adversarial training (or fine-tuning), a technique of training (or fine-tuning) networks on adversarial images to build more robust classifiers, is not very effective. In fact, even with adversarial training we noticed that the networks ability to resist new local-search based adversarial attack improves only marginally (on average between $1 - 2 \%$ ). On the other hand, we suspect that one possible counter-measure to these localized adversarial attacks could be based on performing a careful analysis of the oracle queries to thwart the attempts to generate an adversarial image.
|
| 248 |
+
|
| 249 |
+
Finally, we believe that our local-search approach can also be used for attacks against other machine learning systems and can serve as an useful tool in measuring the robustness of these systems.
|
| 250 |
+
|
| 251 |
+
Table 4: Results for four datasets: CIFAR10, STL10, SVHN, and MNIST. The entries denote by denoted by “– ” are the cases where the fast-gradient sign method fails to produce any adversarial image in our experimental setup.
|
| 252 |
+
|
| 253 |
+
<table><tr><td>Dataset</td><td>ERRTOP-1</td><td>ERRTOP-1(ADV)</td><td>CONF</td><td>PTB</td><td>#PTBPIXELS (%)</td><td>TIME (in sec)</td><td>Technique</td><td>Network</td></tr><tr><td colspan="3">NNs trained with batch normalization</td><td colspan="3"></td><td></td><td></td><td></td></tr><tr><td>CIFAR10</td><td rowspan="2">11.65</td><td>97.63</td><td rowspan="2">0.47 0.55</td><td rowspan="2">0.04 0.20</td><td rowspan="2">3.75</td><td rowspan="2">0.68</td><td rowspan="2">LOCSEARCHADV (Ours)</td><td rowspan="2">NinN</td></tr><tr><td>CIFAR10</td><td>70.69</td></tr><tr><td></td><td rowspan="2">11.62</td><td>97.51</td><td>0.74</td><td></td><td>100.00</td><td>0.01</td><td>FGSM(Goodfellow et al., 2015)</td><td>NinN</td></tr><tr><td>CIFAR10</td><td></td><td></td><td>0.04</td><td>3.16</td><td>0.78</td><td>LOCSEARCHADV (Ours)</td><td>VGG</td></tr><tr><td>CIFAR10</td><td rowspan="2"></td><td>11.62</td><td>1</td><td>1</td><td>1</td><td>1</td><td>FGSM(Goodfellow et al.,2015)</td><td>VGG</td></tr><tr><td>STL10</td><td>58.17</td><td>0.42</td><td>0.02</td><td>1.20</td><td>7.15</td><td>LOCSEARCHADV (Ours)</td><td>NinN</td></tr><tr><td>STL10</td><td rowspan="2">29.81</td><td>54.85</td><td>0.53</td><td>0.20</td><td>100.00</td><td>0.03</td><td>FGSM(Goodfellow et al.,2015)</td><td>NinN</td></tr><tr><td>STL10</td><td>65.76</td><td>0.47</td><td>0.02</td><td>1.11</td><td>13.90</td><td>LOCSEARCHADV (Ours)</td><td>VGG</td></tr><tr><td>STL10</td><td rowspan="2">26.50</td><td rowspan="2">26.50</td><td rowspan="2">二</td><td rowspan="2">1 0.05</td><td rowspan="2">二</td><td rowspan="2">二</td><td rowspan="2">FGSM(Goodfellow et al., 2015)</td><td rowspan="2">VGG</td></tr><tr><td></td></tr><tr><td>SVHN SVHN</td><td rowspan="2">9.71</td><td rowspan="2">97.06 48.62</td><td rowspan="2">0.47 0.49</td><td rowspan="2">0.20</td><td rowspan="2">4.51 100.00</td><td rowspan="2">1.02 0.02</td><td rowspan="2">LOCSEARCHADV (Ours) FGSM(Goodfellow et al.,2015)</td><td rowspan="2">NinN NinN</td></tr><tr><td></td></tr><tr><td>SVHN</td><td rowspan="2"></td><td rowspan="2">81.10</td><td rowspan="2">0.66</td><td rowspan="2">0.07 1</td><td rowspan="2">5.43</td><td rowspan="2">2.15</td><td rowspan="2">LOCSEARCHADV (Ours)</td><td rowspan="2">VGG VGG</td></tr><tr><td>4.77</td></tr><tr><td>SVHN</td><td rowspan="2"></td><td rowspan="2"></td><td>4.77</td><td rowspan="2">1 0.54 0.20</td><td rowspan="2">1 2.24</td><td rowspan="2">1 0.64</td><td rowspan="2">FGSM(Goodfellow et al.,2015)</td><td rowspan="2">NinN</td></tr><tr><td>MNIST</td><td>91.42</td></tr><tr><td>MNIST</td><td rowspan="2">0.33</td><td rowspan="2"></td><td>1.65</td><td>0.58</td><td>0.20</td><td>100.00</td><td>0.02</td><td>LOCSEARCHADV (Ours) FGSM (Goodfellow et al., 2015)</td></tr><tr><td></td><td>93.48</td><td>0.63</td><td>0.21 2.20</td><td>0.64</td><td>LOCSEARCHADV(Ours)</td><td>NinN VGG</td></tr><tr><td>MNIST MNIST</td><td rowspan="2">0.44</td><td rowspan="2">0.44</td><td rowspan="2">1</td><td rowspan="2">1</td><td rowspan="2">1 NNs trained without batch normalization</td><td rowspan="2">1</td><td rowspan="2">FGSM(Goodfellow et al., 2015)</td><td rowspan="2">VGG</td></tr><tr><td colspan="8"></td></tr><tr><td></td><td>97.89</td><td>16.54</td><td></td><td>0.72</td><td>0.04</td><td>3.24</td><td>0.58</td><td>LOCSEARCHADV (Ours)</td><td>NinN</td></tr><tr><td>CIFAR10 CIFAR10</td><td rowspan="2"></td><td rowspan="2">93.67</td><td rowspan="2">0.93</td><td rowspan="2">0.20</td><td rowspan="2"></td><td rowspan="2">100.00</td><td rowspan="2">0.02</td><td rowspan="2">FGSM(Goodfellow et al., 2015)</td><td rowspan="2">NinN</td></tr><tr><td></td></tr><tr><td>CIFAR10</td><td rowspan="2">19.79</td><td rowspan="2"></td><td>97.98</td><td>0.77</td><td>0.04</td><td>2.99</td><td>0.72</td><td>LOCSEARCHADV (Ours)</td><td>VGG</td></tr><tr><td></td><td>90.93</td><td>0.90</td><td>0.20</td><td>100.00</td><td>0.04</td><td>FGSM(Goodfellow et al.,015)</td><td>VGG</td></tr><tr><td>CIFAR10</td><td rowspan="2">35.47</td><td rowspan="2"></td><td></td><td></td><td>0.02</td><td>1.17</td><td>6.42</td><td>LOCSEARCHADV (Ours)</td><td></td></tr><tr><td>STL10</td><td>52.65</td><td>0.56 0.94</td><td>0.20</td><td></td><td>0.04</td><td></td><td>NinN</td></tr><tr><td>STL10</td><td rowspan="2">43.91</td><td rowspan="2"></td><td>87.16</td><td>0.52</td><td>0.01</td><td>100.00</td><td></td><td>FGSM(Goodfellow et al.,2015)</td><td>NinN</td></tr><tr><td>STL10</td><td>59.38</td><td>0.93</td><td>0.20</td><td>1.09 100.00</td><td>19.65 0.10</td><td>LOCSEARCHADV (Ours) FGSM(Goodfellow et al., 2015)</td><td>VGG VGG</td></tr><tr><td>STL10</td><td rowspan="2">SVHN 6.15</td><td rowspan="2">73.97</td><td>91.36 92.31</td><td>0.68</td><td>0.05</td></table>
|
| 254 |
+
|
| 255 |
+
Table 5: Results for the ImageNet1000 dataset using a center crop of size $2 2 4 \times 2 2 4$ for each image.
|
| 256 |
+
|
| 257 |
+
<table><tr><td rowspan="2">Dataset</td><td rowspan="2">ERRTOP-1</td><td rowspan="2">ERRTOP-1(ADV)</td><td rowspan="2">CONF</td><td rowspan="2">PTB</td><td rowspan="2">#PTBPIXELS (%)</td><td rowspan="2">TIME (in sec)</td><td rowspan="2">Technique</td><td rowspan="2">Network</td></tr><tr><td></td></tr><tr><td>ImageNet1000</td><td rowspan="2">58.27</td><td>93.59</td><td>0.29</td><td>0.29</td><td>0.43</td><td>12.72</td><td>LOCSEARCHADV (Ours)</td><td>VGG CNN-S (Caffe)</td></tr><tr><td>ImageNet1000</td><td>85.51</td><td>0.49</td><td>1.00</td><td>100.00</td><td>4.74</td><td>FGSM(Goodfellow et al.,2015)</td><td>VGG CNN-S (Caffe)</td></tr><tr><td>ImageNet1000</td><td rowspan="2">58.96</td><td>91.36</td><td>0.28</td><td>0.29</td><td>0.40</td><td>10.01</td><td>LOCSEARCHADV (Ours)</td><td>VGG CNN-M (Caffe)</td></tr><tr><td>ImageNet1000</td><td>87.85</td><td>0.48</td><td>1.00</td><td>100.00</td><td>4.36</td><td>FGSM(Goodfellow etal.,015)</td><td>VGG CNN-M (Caffe)</td></tr><tr><td>ImageNet1000</td><td rowspan="2">58.80</td><td>92.82</td><td>0.29</td><td>0.30</td><td>0.41</td><td>11.09</td><td>LOCSEARCHADV (Ours)</td><td>VGG CNN-M 2048 (Caffe)</td></tr><tr><td>ImageNet1000</td><td>88.43</td><td>0.52</td><td>1.00</td><td>100.00</td><td>4.42</td><td>FGSM(Goodfellow et al.,2015)</td><td>VGG CNN-M 2048 (Caffe)</td></tr><tr><td>ImageNet1000</td><td rowspan="2">46.40</td><td>72.07</td><td>0.30</td><td>0.54</td><td>0.55</td><td>73.64</td><td>LOCSEARCHADV (Ours)</td><td>VGG ILSVRC 19 (Caffe)</td></tr><tr><td>ImageNet1000</td><td>85.05</td><td>0.52</td><td>1.00</td><td>100.00</td><td>23.94</td><td>FGSM(Goodfellow et al., 2015)</td><td>VGG ILSVRC 19 (Caffe)</td></tr></table>
|
| 258 |
+
|
| 259 |
+
<table><tr><td rowspan="2">Dataset</td><td rowspan="2">k</td><td rowspan="2">ERRTOP-k</td><td rowspan="2">ERRTOP-k(ADV)</td><td rowspan="2">CONF</td><td rowspan="2">PTB</td><td rowspan="2">#PTBPIXELS (%)</td><td rowspan="2">TIME (in sec)</td><td rowspan="2">Network</td></tr><tr><td></td></tr><tr><td>CIFAR10</td><td></td><td>16.54</td><td>97.89</td><td>0.72</td><td>0.04</td><td>3.24</td><td>0.58</td><td>NinN</td></tr><tr><td>CIFAR10</td><td></td><td>6.88</td><td>76.65</td><td>0.88</td><td>0.07</td><td>5.50</td><td>1.02</td><td>NinN</td></tr><tr><td>CIFAR10</td><td>1234</td><td>3.58</td><td>59.02</td><td>0.90</td><td>0.08</td><td>7.09</td><td>1.85</td><td>NinN</td></tr><tr><td>CIFAR10</td><td></td><td>1.84</td><td>48.89</td><td>0.90</td><td>0.09</td><td>7.63</td><td>2.12</td><td>NinN</td></tr></table>
|
| 260 |
+
|
| 261 |
+
Table 6: Effect of increasing $k$ on the performance of Algorithm LOCSEARCHADV (without batch normalization).
|
| 262 |
+
|
| 263 |
+
# ACKNOWLEDGMENTS
|
| 264 |
+
|
| 265 |
+
The authors would like to thank Hamid Maei for helpful initial discussions.
|
| 266 |
+
|
| 267 |
+
# REFERENCES
|
| 268 |
+
|
| 269 |
+
Martín Abadi, Andy Chu, Ian Goodfellow, H Brendan McMahan, Ilya Mironov, Kunal Talwar, and Li Zhang. Deep learning with differential privacy. In ACM CCS, 2016.
|
| 270 |
+
|
| 271 |
+
R. Benenson. What is the class of this image ? http://rodrigob.github.io/are_we_ there_yet/build/classification_datasets_results.html, 2016.
|
| 272 |
+
|
| 273 |
+
Eli Biham and Adi Shamir. Differential cryptanalysis of des-like cryptosystems. Journal of CRYPTOLOGY, 4(1):3–72, 1991.
|
| 274 |
+
|
| 275 |
+
K. Chatfield, K. Simonyan, A. Vedaldi, and A. Zisserman. Caffe model description: VGG_CNN_S. https://gist.github.com/ksimonyan/fd8800eeb36e276cd6f9, 2014a.
|
| 276 |
+
|
| 277 |
+
Ken Chatfield, Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Return of the devil in the details: Delving deep into convolutional nets. In BMVC, 2014b.
|
| 278 |
+
|
| 279 |
+
Alhussein Fawzi, Omar Fawzi, and Pascal Frossard. Analysis of classifiers’ robustness to adversarial perturbations. CoRR, abs/1502.02590, 2015.
|
| 280 |
+
|
| 281 |
+
Alhussein Fawzi, Seyed-Mohsen Moosavi-Dezfooli, and Pascal Frossard. Robustness of classifiers: from adversarial to random noise. arXiv preprint arXiv:1608.08967, 2016.
|
| 282 |
+
|
| 283 |
+
Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep learning. Book in preparation for MIT Press, 2016. URL http://www.deeplearningbook.org.
|
| 284 |
+
|
| 285 |
+
Ian J Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In ICLR, 2015.
|
| 286 |
+
|
| 287 |
+
Kathrin Grosse, Nicolas Papernot, Praveen Manoharan, Michael Backes, and Patrick McDaniel. Adversarial perturbations against deep neural networks for malware classification. arXiv preprint arXiv:1606.04435, 2016.
|
| 288 |
+
|
| 289 |
+
Shixiang Gu and Luca Rigazio. Towards deep neural network architectures robust to adversarial examples. In ICLR Workshop, 2015.
|
| 290 |
+
|
| 291 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, pp. 448–456, 2015.
|
| 292 |
+
|
| 293 |
+
Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016.
|
| 294 |
+
|
| 295 |
+
Jan Karel Lenstra. Local search in combinatorial optimization. Princeton University Press, 1997.
|
| 296 |
+
|
| 297 |
+
Min Lin, Qiang Chen, and Shuicheng Yan. Network in network. In ICLR, 2014.
|
| 298 |
+
|
| 299 |
+
Patrick McDaniel, Nicolas Papernot, and Z. Berkay Celik. Machine learning in adversarial settings. IEEE Security & Privacy, 14(3):68–72, 2016.
|
| 300 |
+
|
| 301 |
+
Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, and Pascal Frossard. Deepfool: a simple and accurate method to fool deep neural networks. In CVPR, 2016.
|
| 302 |
+
|
| 303 |
+
Nicolas Papernot, Patrick McDaniel, and Ian Goodfellow. Transferability in machine learning: from phenomena to black-box attacks using adversarial samples. arXiv preprint arXiv:1605.07277, 2016a.
|
| 304 |
+
|
| 305 |
+
Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z Berkay Celik, and Ananthram Swami. Practical black-box attacks against deep learning systems using adversarial examples. arXiv preprint arXiv:1602.02697, 2016b.
|
| 306 |
+
|
| 307 |
+
Nicolas Papernot, Patrick McDaniel, Somesh Jha, Matt Fredrikson, Z. Berkay Celik, and Ananthram Swami. The limitations of deep learning in adversarial settings. In 2016 IEEE European Symposium on Security and Privacy (EuroS&P), pp. 372–387. IEEE, 2016c.
|
| 308 |
+
|
| 309 |
+
Nicolas Papernot, Patrick McDaniel, Xi Wu, Somesh Jha, and Ananthram Swami. Distillation as a defense to adversarial perturbations against deep neural networks. In IEEE Symposium on Security and Privacy, 2016d.
|
| 310 |
+
|
| 311 |
+
Shaoqing Ren, Kaiming He, Ross B. Girshick, and Jian Sun. Faster R-CNN: towards real-time object detection with region proposal networks. In NIPS, pp. 91–99, 2015.
|
| 312 |
+
|
| 313 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 314 |
+
|
| 315 |
+
Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. In ICLR Workshop, 2014.
|
| 316 |
+
|
| 317 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In ICLR, 2014.
|
| 318 |
+
|
| 319 |
+
S. Zagoruyko. Cifar-10 in torch. http://torch.ch/blog/2015/07/30/cifar.html, 2015.
|
| 320 |
+
|
| 321 |
+
S. Zagoruyko. Loadcaffe. https://github.com/szagoruyko/loadcaffe, 2016a.
|
| 322 |
+
|
| 323 |
+
S. Zagoruyko. Are deep learning algorithms easily hackable? http://coxlab.github.io/ ostrichinator, 2016b.
|
md/train/SJICXeWAb/SJICXeWAb.md
ADDED
|
@@ -0,0 +1,311 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEPTH SEPARATION AND WEIGHT-WIDTH TRADE-OFFSFOR SIGMOIDAL NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Some recent work has shown separation between the expressive power of depth-2 and depth-3 neural networks. These separation results are shown by constructing functions and input distributions, so that the function is well-approximable by a depth-3 neural network of polynomial size but it cannot be well-approximated under the chosen input distribution by any depth-2 neural network of polynomial size. These results are not robust and require carefully chosen functions as well as input distributions.
|
| 8 |
+
|
| 9 |
+
We show a similar separation between the expressive power of depth-2 and depth3 sigmoidal neural networks over a large class of input distributions, as long as the weights are polynomially bounded. While doing so, we also show that depth2 sigmoidal neural networks with small width and small weights can be wellapproximated by low-degree multivariate polynomials.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Understanding the remarkable success of deep neural networks in many domains is an important problem at present (e.g., LeCun et al. (2015)). This problem has many facets such as understanding generalization, expressive power, optimization algorithms in deep learning. In this paper, we focus on the question of understanding the expressive power of neural networks. In other words, we study what functions can and cannot be represented and approximated by neural networks of bounded size, depth, width and weights.
|
| 14 |
+
|
| 15 |
+
The early results on the expressive power of neural networks showed that the depth-2 neural networks are universal approximators; that is to say, with only mild restrictions on the activation functions or neurons, the depth-2 neural networks are powerful enough to uniformly approximate arbitrary continuous functions on bounded domains in $\mathbb { R } ^ { d }$ , e.g., Cybenko (1989); Hornik et al. (1989); Barron (1994). However, the bounds that they provide on the size or width of these neural networks are quite general, and therefore, weak. Understanding what functions can be represented or wellapproximated by neural networks with bounded parameters is a general direction in the study of expressive power of neural networks. Here the parameters could mean the number of neurons, the width of hidden layers, the depth, and the magnitude of its weights etc.
|
| 16 |
+
|
| 17 |
+
Natural signals (images, speech etc.) tend to be representable as compositional hierarchies LeCun et al. (2015), and deeper networks can be thought of as representing deeper hierarchies. The power of depth has been a subject of investigation in deep learning, e.g., He et al. (2016). We are interested in understanding the effect of depth on the expressive power. In particular, one may ask whether having more depth allows representation of more functions if the size bound remains the same.
|
| 18 |
+
|
| 19 |
+
Eldan & Shamir (2016) show a separation between depth-2 and depth-3 neural networks. More precisely, they exhibit a function $\dot { g } : \mathbb { R } ^ { d } \mathbb { R }$ and a probability distribution $\mu$ on $\mathbb { R } ^ { d }$ such that $g$ is bounded and supported on a ball of radius $O ( { \sqrt { d } } )$ and expressible by a depth-3 network of size polynomially bounded in $d$ . But any depth-2 network approximating $g$ in $L _ { 2 }$ -norm (or squared error) within a small constant under the distribution $\mu$ must be of size exponentially large in $d$ . Their separation works for all reasonable activation functions including ReLUs (Rectified Linear Units) and sigmoids. The function and the input distribution in Eldan & Shamir (2016) are carefully constructed and their proof techniques seem to crucially rely on the specifics of these constructions. Building upon this result, Safran $\&$ Shamir (2017) show that while the indicator function of the
|
| 20 |
+
|
| 21 |
+
$L _ { 2 }$ -ball can be well-approximated by depth-3 networks of polynomial size, any good approximation to it by depth-2 networks must require exponential size. Here, the notion of approximation in the lower bound is the same as in Eldan & Shamir (2016) and a carefully constructed distribution that is arguably not quite natural.
|
| 22 |
+
|
| 23 |
+
Daniely (2017) (see also Martens et al. (2013)) also gave a separation between depth-2 and depth-3 networks by exhibiting a function $g : \mathbb { S } ^ { d - 1 } \times \mathbb { S } ^ { d - \bar { 1 } } \to R$ which can be well-approximated by a depth-3 ReLU neural network of polynomially bounded size and weights but cannot be approximated by any depth-2 (sigmoid, ReLU or more general) neural network of polynomial size with (exponentially) bounded weights. This separation holds under uniform distribution on $\mathbb { S } ^ { d - 1 } \times \mathbb { S } ^ { d - 1 }$ , which is more natural than the previous distributions. However, the proof technique crucially uses harmonic analysis on the unit sphere, and does not seems robust or applicable to other distributions.
|
| 24 |
+
|
| 25 |
+
Telgarsky (2016) shows a separation between depth- $\cdot 2 k ^ { 3 } + 8$ and depth- $k$ ReLU neural networks, for any positive integer $k$ , when the input is uniformly distributed over $[ - 1 , 1 ] ^ { d }$ . Liang & Srikant (2017) (see also Safran & Shamir (2017); Yarotsky (2016)) show that there are univariate functions on a bounded interval such that neural networks of constant depth require size at least $\Omega \left( \mathrm { p o l y } ( 1 / \epsilon ) \right)$ ) for a uniform $\epsilon$ -approximation over the interval, whereas deep networks (the depth can depend on $\epsilon$ ) can have size ${ \cal O } \left( \mathrm { p o l y l o g } ( 1 / \epsilon ) \right)$ .
|
| 26 |
+
|
| 27 |
+
The above separation results all fit the following template: certain carefully constructed functions can be well approximated by deep networks, but are hard to approximate by shallow networks using a notion of error that uses a carefully defined distribution. (Only Liang & Srikant (2017) is distribution-independent as it deals with uniform approximation everywhere in the domain). Thus these results do not tell us the extent to which deeper networks are more expressive than the shallow ones. We would like to understand whether there are large classes of functions and distributions that witness the separation between deep and shallow networks. An answer to this question is also more likely to shed light on practical applications of neural networks. Shamir (2016); Shalev-Shwartz et al. (2017); Song et al. (2017) show that even functions computed by a depth-2 neural network of polynomial size can be hard to learn using gradient descent type of algorithms for a wide class of distributions. These results address questions about learnability rather than the expressive power of deep neural networks.
|
| 28 |
+
|
| 29 |
+
Hanin (2017) shows that piecewise affine functions on $[ 0 , 1 ] ^ { d }$ with $N$ pieces can be exactly represented by a width $( d + 3 )$ network of depth at most $N$ . Lower bound of $\Omega ( ( N + d - 1 ) / ( d + 1 ) )$ on the depth is proven for functions of the above type when the network has width at most $( d + 1 )$ and very closely approximates the function.
|
| 30 |
+
|
| 31 |
+
Our depth separation results apply to neural networks with bounds on the magnitudes of the weights. While we would prefer to prove our results without any weight restrictions, we now argue that small weights are natural. In training neural networks, often weights are not allowed to be too large to avoid overfitting. Weight decay is a commonly used regularization heuristic in deep learning to control the weights. Early stopping can also achieve this effect. Another motivation to keep the weights low is to keep the Lipschitz constant of the function computed by the network (w.r.t. changes in the input, while keeping the network parameters fixed) small. Goodfellow et al. (2016) contains many of these references. One of the surprising discoveries about neural networks has been the existence of adversarial examples (Szegedy et al. (2013)). These are examples obtained by adding a tiny perturbation to input from class so that the resulting input is misclassified by the network. The perturbations are imperceptible to humans. Existence of such examples for a network suggests that the Lipschitz constant of the network is high as noted in Szegedy et al. (2013). This lead them to suggest regularizing training of neural nets by penalizing high Lipschitz constant to improve the generalization error and, in particular, eliminate adversarial examples. This is carried out in Cisse et al. (2017), who find a way to control the Lipschitz constant by enforcing an orthonormality´ constraint on the weight matrices along with other tricks. They report better resilience to adversarial examples. On the other hand, Neyshabur et al. (2017) suggest that Lipschitz constant cannot tell the full story about generalization.
|
| 32 |
+
|
| 33 |
+
# 2 OUR RESULTS
|
| 34 |
+
|
| 35 |
+
We exhibit a simple function (derived from Daniely (2017)) over the unit ball $\mathbb { B } ^ { d }$ in $d$ -dimensions can be well-approximated by a depth-3 sigmoidal neural network with size and weights polynomially bounded in $d$ . However, its any reasonable approximation using a depth-2 sigmoidal neural network with polynomially bounded weights must have size exponentially large in $d$ .
|
| 36 |
+
|
| 37 |
+
Our separation is robust and works for a general class of input distributions, as long as their density is at least $1 / \mathrm { p o l y } ( d )$ on some small ball of radius $1 / \mathrm { p o l y } ( \bar { d } )$ in $\mathbb { B } ^ { d }$ . The function we use can also be replaced by many other functions that are polynomially-Lipschitz but not close to any low-degree polynomial.
|
| 38 |
+
|
| 39 |
+
As a by-product of our argument, we also show that constant-depth sigmoidal neural networks are well-approximated by low-degree multivariate polynomials (with a degree bound that allows the depth separation mentioned above).
|
| 40 |
+
|
| 41 |
+
# 3 POLYNOMIAL APPROXIMATIONS TO SIGMOIDAL NEURAL NETWORKS
|
| 42 |
+
|
| 43 |
+
In this section, we show that a sigmoid neuron can be well-approximated by a low-degree polynomial. As a corollary, we show that depth-2 (and in genenral, small-depth) sigmoidal neural networks can be well-approximated by low-degree multivariate polynomials. The main idea is to use Chebyshev polynomial approximation as in Shalev-Shwartz et al. (2011), which closely approximates the minimax polynomial (or the polynomial that has the smallest maximum deviation) to a given function. For the simplicity of presentation and arguments, we drop the bias term $b$ in the activation function $\sigma ( \langle { \bf w } , { \bf x } \rangle { } ^ { - } + b )$ . This is without loss of generality, as explained at the end of the last section.
|
| 44 |
+
|
| 45 |
+
# 3.1 POLYNOMIAL APPROXIMATION TO A SIGMOID NEURON
|
| 46 |
+
|
| 47 |
+
The activation function of a sigmoid neuron $\sigma : \mathbb { R } \mathbb { R }$ is defined as
|
| 48 |
+
|
| 49 |
+
$$
|
| 50 |
+
\sigma ( t ) = \frac { 1 } { 1 + \exp ( - t ) } .
|
| 51 |
+
$$
|
| 52 |
+
|
| 53 |
+
Chebyshev polynomials of the first kind $\{ T _ { j } ( t ) \} _ { j \geq 0 }$ are defined recursively as $T _ { 0 } ( t ) = 1$ , $T _ { 1 } ( t ) = t$ , and $\dot { T } _ { j + 1 } ( t ) = 2 t \cdot T _ { j } ( t ) - T _ { j - 1 } ( t )$ . They form an orthonormal basis of polynomials over $[ - 1 , 1 ]$ with respect to the density $\textstyle \sum _ { j = 0 } ^ { \infty } c _ { j } T _ { j } ( t )$ over $[ - 1 , 1 ]$ is g iven b y $1 / \sqrt { 1 - t ^ { 2 } }$ . The coefficient $c _ { j }$ in the Chebyshev expansion of $\sigma ( w t ) =$
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
c _ { j } = \frac { 1 + { \bf 1 } ( j > 0 ) } { \pi } \int _ { - 1 } ^ { 1 } \frac { \sigma ( w t ) T _ { j } ( t ) } { \sqrt { 1 - t ^ { 2 } } } d t .
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
Proposition 1 (see Lemma B.1 in Shalev-Shwartz et al. (2011)) bounds the magnitude of coefficients $c _ { j }$ in the Chebyshev expansion of $\begin{array} { r } { \sigma ( w t ) = \sum _ { j = 0 } ^ { \infty } c _ { j } T _ { j } ( t ) } \end{array}$ .
|
| 60 |
+
|
| 61 |
+
Proposition 1. For any $j > 1$ , the coefficient $c _ { j }$ in the Chebyshev expansion of a sigmoid neuron $\sigma ( w t )$ is bounded by
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
| c _ { j } | \le \left( \frac { 4 } { | w | } + \frac { 2 } { \pi } \right) \left( 1 + \frac { \pi } { | w | } \right) ^ { - j } .
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
Proposition 1 implies low-degree polynomial approximation to sigmoid neurons as follows. This observation appeared in Shalev-Shwartz et al. (2011) (see equation (B.7) in their paper). For completeness, we give the proof in Appendix A.
|
| 68 |
+
|
| 69 |
+
Proposition 2. Given any $w ~ \in ~ \mathbb { R }$ with $| w | \ \leq \ B$ , there exists a polynomial $p$ of degree ${ \cal O } \left( B \log \left( B / \epsilon \right) \right)$ such that $| \sigma ( w t ) - p ( t ) | \leq \dot { \epsilon } ,$ for all $t \in [ - 1 , 1 ]$ .
|
| 70 |
+
|
| 71 |
+
We use this $O \left( \log ( 1 / \epsilon ) \right)$ dependence in the above bound crucially in some of our results, e.g., a weaker version of Daniely’s separation result for depth-2 and depth-3 neural networks. Notice that this logarithmic dependence does not hold for a ReLU neuron; it is $O ( 1 / \epsilon )$ instead.
|
| 72 |
+
|
| 73 |
+
A depth-2 sigmoidal neural network on input $t \in [ - 1 , 1 ]$ computes a linear combination of sigmoidal neurons $\sigma ( w _ { 1 } t ) , \sigma ( w _ { 2 } t ) , \ldots , \sigma ( w _ { n } \bar { t } )$ , for $w _ { 1 } , w _ { 2 } , \ldots , w _ { n } \in \mathbb { R }$ , and computes a function $f : [ - 1 , 1 ] \to \mathbb { R }$ given by
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
f ( t ) = \sum _ { i = 1 } ^ { n } a _ { i } \sigma ( w _ { i } t )
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
Here are a few propositions on polynomial approximations to small-depth neural networks. For completeness, their proofs are included in Appendix A.
|
| 80 |
+
|
| 81 |
+
Proposition 3 shows that a depth-2 sigmoidal neural network of bounded weights and width is close to a low-degree polynomial.
|
| 82 |
+
|
| 83 |
+
Proposition 3. Let $f : [ - 1 , 1 ] \to \mathbb { R }$ be a function computed by a depth-2 sigmoidal neural network of width n and weights bounded by $B$ . Then $f$ is $\delta$ -approximated (in $L _ { \infty }$ -norm) over $[ - 1 , 1 ]$ by $a$ polynomial of degree $O \left( B \log \left( n B ^ { 2 } / \delta \right) \right)$ .
|
| 84 |
+
|
| 85 |
+
Now consider a depth-2 sigmoidal neural network on input $\textbf { x } \in \mathbb { B } ^ { d }$ , where $\mathbb { B } ^ { d } = \{ \mathbf { x } \in \mathbb { R } ^ { d } \quad :$ $\| \mathbf { x } \| \leq 1 \}$ . It is given by a linear combination of sigmoidal activations applied to linear functions $\left. \mathbf { w } _ { 1 } , \mathbf { x } \right. , \left. \mathbf { w } _ { 2 } , \mathbf { x } \right. , \ldots , \left. \mathbf { w } _ { n } , \mathbf { x } \right.$ (or affine functions when we have biases), for $\mathbf { w } _ { 1 } , \mathbf { w } _ { 2 } , \ldots , \mathbf { w } _ { n } \in \mathbb { R } ^ { d }$ and it computes a function $F : \mathbb { B } ^ { d } \mathbb { R }$ given by
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
F ( \mathbf { x } ) = \sum _ { i = 1 } ^ { n } a _ { i } \sigma ( \left. \mathbf { w } _ { i } , \mathbf { x } \right. )
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
Proposition 4 below is a multivariate version of Proposition 3.
|
| 92 |
+
|
| 93 |
+
Proposition 4. Let $F : \mathbb { B } ^ { d } \mathbb { R }$ be a function computed by a depth-2 sigmoidal neural network with width $n$ and bounded weights, that is, $| a _ { i } | \le B$ and $\left\| \mathbf { w } _ { i } \right\| \leq B$ , for $1 \leq i \leq n$ . Then $F$ is $\delta$ - approximated (in $L _ { \infty }$ -norm) over $\mathbb { B } ^ { d }$ by a polynomial of degree $O \left( B \log \left( n B ^ { 2 } / \delta \right) \right)$ in $d$ variables given by the coordinates $\mathbf { x } = \left( x _ { 1 } , x _ { 2 } , \ldots , x _ { d } \right)$ .
|
| 94 |
+
|
| 95 |
+
Note that its proof crucially uses the fact that Proposition 2 guarantees a low-degree polynomial that approximates a sigmoid neuron everywhere in $[ - 1 , 1 ]$ .
|
| 96 |
+
|
| 97 |
+
A depth- $k$ sigmoidal neural network can be thought of as a composition – a depth-2 sigmoidal neural network on top, whose each input variable is a sigmoid applied to a depth- $\left( k - 2 \right)$ sigmoidal neural network. In other words, it computes a function $\bar { F } : \mathbb { B } ^ { d } \overset { \cdot \cdot } { } \mathbb { R }$ given by
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
F ( \mathbf { x } ) = \sum _ { i = 1 } ^ { n } a _ { i } \sigma \left( \left. \mathbf { w } _ { i } , \mathbf { y } \right. \right) ,
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where $\mathbf { y } = ( y _ { 1 } , y _ { 2 } , \dots y _ { m } )$ has each coordinate $y _ { j } = \sigma ( F _ { j } ( \mathbf { x } ) )$ , for $1 \leq j \leq m$ , such that each $F _ { i } : \mathbb { B } ^ { d } \mathbb { R }$ is a function computed by a depth- $\left( k - 2 \right)$ sigmoidal neural network.
|
| 104 |
+
|
| 105 |
+
Now we show an interesting consequence, namely, any constant-depth sigmoidal neural network with polynomial width and polynomially bounded weights can be well-approximated by a lowdegree multivariate polynomial. The bounds presented in Proposition 5 are not optimal but the qualitative statement is interesting in contrast with the depth separation result. The growth of the degree of polynomial approximation is dependent on the widths of hidden layers and it is also the subtle reason why a depth separation result is still possible (when the weights are bounded).
|
| 106 |
+
|
| 107 |
+
Proposition 5. Let $F : \mathbb { B } ^ { d } \mathbb { R }$ be a function computed by a depth- $k$ sigmoidal neural network of width at most $n$ in each layer and weights bounded by $B$ , then $F ( \mathbf { x } )$ can be $\delta$ -approximated (in $L _ { \infty }$ -norm) over $\mathbb { B } ^ { d }$ by a $d$ -variate polynomial of degree $O \left( ( n B ) ^ { k } \log ^ { k } { ( n B / \delta ) } \right)$ in each coordinate variable of $\mathbf { x } = \left( x _ { 1 } , x _ { 2 } , \ldots , x _ { d } \right)$ .
|
| 108 |
+
|
| 109 |
+
Note that when $n$ and $B$ are polynomial in $d$ and the depth $k$ is constant, then this low-degree polynomial approximation also has degree polynomial in $d$ .
|
| 110 |
+
|
| 111 |
+
# 4 $L _ { \infty }$ -SEPARATION OF DEPTH-2 VS. DEPTH-3 SEPARATION FOR GENERAL INPUT DISTRIBUTIONS
|
| 112 |
+
|
| 113 |
+
Daniely shows that if $g : [ - 1 , 1 ] \to \mathbb { R }$ cannot be approximated by a polynomial of degree $O ( d ^ { 2 } )$ , then $\mathring { G ^ { \cdot } } \mathbb { S } ^ { d - 1 } \times \mathbb { S } ^ { d - 1 } \mathring { \mathbb { R } }$ defined as $G ( \mathbf { x } , \mathbf { y } ) = \bar { g ( \mathbf { \langle x , y \rangle } ) }$ cannot be approximated by any depth2 neural network of polynomial size and (exponentially) bounded weights. Daniely shows this lower bound for a general neuron or activation function that includes sigmoids and ReLUs. Daniely then uses $G ( \mathbf { x } , \mathbf { y } ) { \overset { \cdot } { = } } \ g ( \langle \mathbf { x } , \mathbf { y } \rangle ) = \sin ( \pi d ^ { 3 } \left. \mathbf { x } , \mathbf { y } \right. )$ which, on the other hand, is approximable by a depth-3 ReLU neural network with polynomial size and polynomially bounded weights. This gives a separation between depth-2 and depth-3 ReLU neural networks w.r.t. uniform distribution over $\mathbb { S } ^ { d - 1 } \times \mathbb { S } ^ { d - 1 }$ . Daniely’s proof uses harmonic analysis on the unit sphere, and requires the uniform distribution on $\mathbb { S } ^ { d - 1 } \dot { \times } \mathbb { S } ^ { \dot { d } - 1 }$ in a crucial way.
|
| 114 |
+
|
| 115 |
+
We show a simple proof of separation between depth-2 and depth-3 sigmoidal neural networks that compute functions $\mathbf { \dot { \boldsymbol { F } } } : \mathbb { B } ^ { d } \to \mathbf { \dot { \mathbb { R } } }$ . Our proof works for a large class of distributions on $\mathbb { B } ^ { d }$ but requires the weights to be polynomially bounded.
|
| 116 |
+
|
| 117 |
+
The following lemma appears in Debao (1993). Assumption 1 in Eldan & Shamir (2016) and their version of this lemma for ReLU networks was used by Daniely (2017) in the proof of separation between the expressive power of depth-2 and depth-3 ReLU networks.
|
| 118 |
+
|
| 119 |
+
Lemma 6. Let $f : [ - 1 , 1 ] \to \mathbb { R }$ be any $L$ -Lipschitz function. Then there exists a function $g :$ $[ - 1 , 1 ] \to \mathbb { R }$ computed by a depth-2 sigmoidal neural network such that
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
g ( t ) = f ( 0 ) + \sum _ { i = 1 } ^ { n } a _ { i } \sigma ( w _ { i } t + b _ { i } ) ,
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
the width $n$ as well as the weights are bounded by poly $( L , 1 / \epsilon )$ , and $| f ( t ) - g ( t ) | \leq \epsilon ,$ for all $t \in [ - 1 , 1 ]$ .
|
| 126 |
+
|
| 127 |
+
Now we are ready to show the separation between depth-2 and depth-3 sigmoidal neural networks. The main idea, similar to Daniely (2017), is to exhibit a function that is Lipschitz but far from any low-degree polynomial. The Lipschitz property helps in showing that our function can be wellapproximated by a depth-3 neural network of small size and small weights. However, being far from any low-degree polynomial, it cannot be approximated by any depth-2 neural network.
|
| 128 |
+
|
| 129 |
+
Theorem 7. Consider the function $G : \mathbb { B } ^ { d } \mathbb { R }$ given by $G ( \mathbf { x } ) = \sin ( \pi d ^ { 5 } \left\| \mathbf { x } \right\| ^ { 2 } )$ . Then $G$ can be $\delta$ -approximated (in $L _ { \infty }$ -norm) by a depth-3 sigmoidal neural network of width and weights polynomially bounded in $d$ . However, any function $\bar { F } : \mathbb { B } ^ { d } \mathbb { R }$ computed by a depth-2 sigmoidal neural network with weights $O ( d ^ { 2 } )$ cannot $\delta$ -approximate $G$ even when its width $n$ is $2 ^ { O ( d ) }$ .
|
| 130 |
+
|
| 131 |
+
By modifying the function to $G ( \mathbf { x } ) = \sin ( \pi N \left\| \mathbf { x } \right\| ^ { 2 } )$ , this lower bound with $L _ { \infty }$ -norm holds for any distribution over $\mathbf { \mathbb { B } } ^ { d }$ whose support contains a radial line segment of length at least $1 / p o l y ( d )$ , by making $N = p o l y ( d )$ , for a large enough polynomial.
|
| 132 |
+
|
| 133 |
+
Remark: Given any distribution $\mu$ over $\mathbb { B } ^ { d }$ whose probability density is at least $1 / p o l y ( d )$ on some small ball of radius $1 / p o l y ( d )$ , the lower bound or inapproximability by any depth-2 sigmoidal neural network can be made to work with $L _ { 2 }$ -norm (squared error), for a large enough $N = p o l y ( d )$ .
|
| 134 |
+
|
| 135 |
+
Proof. First, we will show that $G ( \mathbf { x } )$ can be well-approximated by a depth-3 sigmoidal neural network of polynomial size and weights. The idea is similar to Daniely’s construction for ReLU networks in Daniely (2017). By Lemma 6, there exists a function $f \ \stackrel { \cdot } { : } \ [ - 1 , 1 ] \ \ \mathbb { R }$ computed by a depth-2 sigmoidal neural network of size and weights bounded by $\mathrm { p o l y } ( d , 1 / \epsilon )$ such that $\left| t ^ { 2 } - f ( t ) \right| \le \epsilon / 1 0 d ^ { 6 }$ , for all $t \in [ - 1 , 1 ]$ . Thus, we can compute $x _ { i } ^ { 2 }$ for each coordinate of $\mathbf { x }$ and add them up to get an $\epsilon$ -approximation to $\left\| \mathbf { x } \right\| ^ { 2 }$ over $\mathbb { B } ^ { d }$ . That is, there exists a function $S : \mathbb { B } ^ { d } \mathbb { R }$ computed by a depth-2 sigmoidal neural network of size and weights bounded by poly $( d , 1 / \epsilon )$ such that $\left| S ( x ) - \left\| \mathbf { x } \right\| ^ { 2 } \right| \leq \epsilon / 1 0 d ^ { 5 }$ , for all $\mathbf { x } \in \mathbb { B } ^ { d }$ . Again, by Lemma 6, we can approximate $\sin ( \pi d ^ { 3 } t )$ over [0, 1] using $f : [ - 1 , 1 ] \to \mathbb { R }$ computed by another depth-2 sigmoidal neural network with size and weights bounded by $\mathrm { p o l y } ( d , 1 / \epsilon )$ such that $\left| \sin ( \pi d ^ { 3 } t ) - f ( t ) \right| \le \epsilon / 2$ , for all $t \in [ 0 , 1 ]$ . Note that the composition of these two depth-2 neural networks $f ( N ( \mathbf { x } ) )$ gives a depth-3 neural network as the output of the hidden layer of the bottom network can be fed into the top network as inputs.
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
\begin{array} { r l } & { \left| G ( \mathbf { x } ) - f ( S ( \mathbf { x } ) ) \right| = \left| \sin ( \pi d ^ { 5 } \left\| \mathbf { x } \right\| ^ { 2 } ) - f ( S ( \mathbf { x } ) ) \right| } \\ & { \qquad \leq \left| \sin ( \pi d ^ { 5 } \left\| \mathbf { x } \right\| ^ { 2 } ) - f ( \left\| \mathbf { x } \right\| ^ { 2 } ) \right| + \left| f ( \left\| \mathbf { x } \right\| ^ { 2 } ) - f ( S ( \mathbf { x } ) ) \right| } \\ & { \qquad \leq \epsilon / 2 + 4 d ^ { 5 } \left| \left\| \mathbf { x } \right\| ^ { 2 } - S ( \mathbf { x } ) \right| } \end{array}
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\leq \epsilon / 2 + 4 d ^ { 5 } \cdot \epsilon / 1 0 d ^ { 5 } \leq \epsilon .
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
Now we will show the lower bound. Consider any function $F : \mathbb { B } ^ { d } \mathbb { R }$ computed by a depth-2 sigmoidal neural network whose weights are bounded by $B \ = \ O ( d ^ { 2 } )$ and width is $n$ . Proposition 4 shows that there exists a $d$ -variate polynomial $P ( \mathbf { x } )$ of degree $O \left( B \log ( n B ^ { 2 } / \delta ) \right) ~ =$ $O \left( d ^ { 2 } \log ( n / \delta ) + d ^ { 2 } \log d \right)$ in each variable such that $| F ( \mathbf { x } ) - P ( \mathbf { x } ) | \leq \delta$ , for all $\mathbf { x } \in \mathbb { B } ^ { d }$ . Let $\mu$ be any measure on $\mathbb { B } ^ { d }$ whose support contains some radial line segment of length at least $1 / \mathrm { p o l y } ( d )$ in $\mathbb { B } ^ { \bar { d } }$ . In other words, there exists a unit vector $\mathbf { u }$ such that the support of $\mu$ intersects the radial set $\{ \mathbf { x } ~ \in ~ \mathbb { B } ^ { d } \quad : \quad \mathbf { x } ~ = ~ t \mathbf { u } $ , for some $t \in [ - 1 , 1 ] \}$ in some line segment of length at least $1 / \mathrm { p o l y } ( d )$ . Then $P ( t \mathbf { u } )$ is a univariate polynomial of degree $O ( d ^ { 3 } \log ( \bar { n } / \delta ) + d ^ { 3 } \log \bar { d } )$ that $\delta$ - approximates $F ( t \mathbf { u } )$ , for all $t \in [ - 1 , 1 ]$ . By Lemma 8, using $\dot { D } = O \big ( d ^ { 3 } \log ( n / \delta ) + d ^ { 3 } \log d \big )$ , $l = 1 / \mathrm { p o l y } ( d )$ and $N = d ^ { 5 } / l$ , we get that if $n = 2 ^ { O ( d ) }$ , then there exists a $t _ { 0 } ~ \in ~ [ - 1 , 1 ]$ such that $\left| \sin ( \pi N t _ { 0 } ^ { 2 } ) - P ( t \mathbf { u } ) \right| \geq 1$ . Therefore, by triangle inequality, $\left| \sin ( \pi N \left\| t _ { 0 } \mathbf { u } \right\| ^ { 2 } ) - F ( t _ { 0 } \mathbf { u } ) \right| \geq$ $\left| \sin ( \pi N t _ { 0 } ^ { 2 } ) - P ( t _ { 0 } { \mathbf u } ) \right| - | P ( t _ { 0 } { \mathbf u } ) - F ( t _ { 0 } { \mathbf u } ) | \ge 1 - \delta > \delta _ { }$ , for $\delta < 1 / 2$ . This means that $G ( \mathbf { x } )$ cannot be well-approximated by any $F ( \mathbf { x } )$ computed by a depth-2 neural network with polynomially bounded weights even when it has width $2 ^ { O ( d ) }$ . □
|
| 146 |
+
|
| 147 |
+
Now we show that the candidate function proposed by Daniely $g ( t ) = \sin ( \pi N t )$ , for large enough $N$ , is far from any low-degree polynomial w.r.t. any measure $\mu$ on $[ - 1 , 1 ]$ with a reasonable support.
|
| 148 |
+
|
| 149 |
+
Lemma 8. Let $p$ be any polynomial of degree $D$ and $\mu$ be any measure on $[ - 1 , 1 ]$ whose support contains an interval of length at least $l$ . Then, for $N$ large enough to satisfy $N l > D + 3$ , there exists $t _ { 0 } \in [ - 1 , 1 ]$ such that $\mu ( t _ { 0 } ) > 0$ and $| \mathrm { s i n } ( \pi N t _ { 0 } ) - p ( t _ { 0 } ) | > 1 .$ . In other words, $\sin ( \pi N t )$ is 1-far (in $L _ { \infty }$ -norm) from any polynomial of degree $D$ over interval $[ - 1 , 1 ]$ with measure $\mu$ .
|
| 150 |
+
|
| 151 |
+
Proof. Let $\mu ( t ) > 0$ for some interval $[ a , a + l ] \subseteq [ - 1 , 1 ]$ . Consider $S = \{ t \in [ a , a + l ] \colon t =$ $- 1 + ( i + 1 / 2 ) / N$ , for some integer $i \}$ . Then $S$ contains at least $N l - 2$ points where $\sin ( \pi N t )$ alternates as $\pm 1$ . Any polynomial $p$ of degree $D$ cannot match the sign of $\sin ( \pi N t )$ on all the points in $S$ . Otherwise, by intermediate value theorem, $p$ must have at least $N l - 3$ roots between the points of $S$ , which means $D \geq N l - 3$ , a contradiction. Thus, there exists $t _ { 0 } \in S$ such that $p ( t _ { 0 } )$ and $\sin ( \pi N t _ { 0 } )$ have opposite signs. Since $\sin ( \pi N t ) = \pm 1$ , for any $t \in S$ , the sign mismatch implies $| \mathrm { s i n } ( \pi N t _ { 0 } ) - p ( t _ { 0 } ) | > 1$ . □
|
| 152 |
+
|
| 153 |
+
An important remark on biases: Even though we handled the case of sigmoid neurons without biases, the proof technique carries over to the sigmoid neurons with biases $\bar { \boldsymbol { \sigma } } ( \left. \mathbf { w } , \mathbf { x } \right. + b )$ . The idea is to consider a new $( d + 1 )$ -dimensional input $\mathbf { x } _ { \mathrm { n e w } } = \left( \mathbf { x } , x _ { d + 1 } \right) = \left( x _ { 1 } , x _ { 2 } , \ldots , x _ { d + 1 } \right)$ with $x _ { d + 1 } = 1$ , and consider the new weight vector $\mathbf { w } _ { \mathrm { n e w } } = ( \mathbf { w } , b )$ . Thus, $\left. \mathbf { w } _ { \mathrm { n e w } } , \mathbf { x } _ { \mathrm { n e w } } \right. = \left. \mathbf { w } , \mathbf { x } \right. + b$ . The new input lies on a $d$ -dimensional hyperplane slice of $\mathbb { B } ^ { d + 1 }$ , so we need to look at the restriction of the input distribution $\mu$ to this slice. Most of the ideas in our proofs generalize without any technical modifications. We defer the details to the full version.
|
| 154 |
+
|
| 155 |
+
# 5 $L _ { 2 }$ -SEPARATION OF DEPTH-2 VS. DEPTH-3 SEPARATION FOR GENERAL INPUT DISTRIBUTIONS
|
| 156 |
+
|
| 157 |
+
In this section we show lower bounds under the $L _ { 2 }$ -norm. The theorem below gives a technical condition on the class of densities $\mu$ on $\mathbb { B } ^ { d }$ for which our lower bound holds. Let’s give an example to illustrate that the condition on density is reasonable: Let $K \subset \mathbb { B } ^ { d }$ be a convex set such that every point in $K$ is at least $r$ away from the boundary of $\mathbb { B } ^ { d }$ (where $r = 1 / \mathrm { p o l y } ( d )$ is a parameter). Further assume that (1) the probability mass of $K$ is at least a constant and (2) for every point in $K$ the probability density is within a constant factor of the uniform density on $K$ . Then our lower bound applies to $\mu$ .
|
| 158 |
+
|
| 159 |
+
Theorem 9. Consider the function $G : \mathbb { B } ^ { d } \mathbb { R }$ given by $G ( \mathbf { x } ) = \sin ( \pi N \left\| \mathbf { x } \right\| ^ { 2 } )$ . Let $\mu$ be any probability density over $\mathbb { B } ^ { \dot { d } }$ such that there exists a subset $C \subseteq \mathbb { B } ^ { d }$ satisfying the following two conditions:
|
| 160 |
+
|
| 161 |
+
• The $r$ -interior of $C$ defined as $C ^ { \prime } = \{ \mathbf { x } \in C ~ : ~ \mathbb { B } ( \mathbf { x } , r ) \subseteq C \}$ contains at least $\gamma$ fraction of the total probability mass for some $\gamma > 0$ , i.e., $\begin{array} { r } { \int _ { C ^ { \prime } } \mu ( \mathbf { x } ) d \mathbf { x } \geq \gamma } \end{array}$ . • For any affine line $\ell$ , the induced probability density on every segment of length at least $r$ in the intersection $\ell \cap C$ is $( \alpha , \beta )$ -uniform, i.e., it is at least $\alpha$ times and at most $\beta$ times the uniform density on that segment.
|
| 162 |
+
|
| 163 |
+
Let $F : \mathbb { B } ^ { d } \mathbb { R }$ be any function computed by a depth-2 sigmoidal neural network with weights bounded by $B$ and width $n$ . Then for any $0 < \delta \ll \alpha \gamma / 3 \beta$ and $N \gg ( B / r ^ { 2 } ) \log ( n B ^ { 2 } / \delta )$ , the function $F$ cannot $\delta$ -approximate $G$ on $\mathbb { B } ^ { d }$ under $L _ { 2 }$ -norm (squared error) under the probability density $\mu$ .
|
| 164 |
+
|
| 165 |
+
In particular, if $\alpha , \beta , \gamma$ are constants, $B = p o l y ( d )$ , $n = 2 ^ { d }$ , and $r = 1 / p o l y ( d )$ , then it suffices to choose $N = p o l y ( d )$ for a sufficiently large degree polynomial.
|
| 166 |
+
|
| 167 |
+
Proof. We show a lower bound on $L _ { 2 }$ -error of approximating $G ( \mathbf { x } )$ with any multivariate polynomial $P : \mathbb { B } ^ { d } \mathbb { R }$ of degree $D$ under the distribution given by $\mu$ on $\mathbb { B } ^ { d }$ . For any fixed unit vector $\mathbf { v }$ , consider $\mathbf { u } \in \mathbb { B } ^ { d - 1 }$ orthogonal to $\mathbf { v }$ and let $\ell _ { \mathbf { u } }$ be the affine line going through $\mathbf { u }$ and parallel to the direction $\mathbf { v }$ given by $\ell _ { \mathbf { u } } = \{ \mathbf { x } = \mathbf { u } + t \mathbf { v } ~ : ~ t \in \mathbb { R } \}$ .
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
\begin{array} { r l } { { \int ( G ( \mathbf { x } ) - P ( \mathbf { x } ) ) ^ { 2 } \mu ( \mathbf { x } ) d \mathbf { x } } } \\ & { \ \stackrel { \mathrm { B } ^ { d } } { \geq } } \\ & { \ \geq \int ( G ( \mathbf { x } ) - P ( \mathbf { x } ) ) ^ { 2 } \mu ( \mathbf { x } ) d \mathbf { x } } \\ & { \ = \displaystyle \int \int \int ( G ( \mathbf { u } + t \mathbf { v } ) - P ( \mathbf { u } + t \mathbf { v } ) ) ^ { 2 } \mu ( \mathbf { u } + t \mathbf { v } ) \mathbb { I } _ { C } ( \mathbf { u } , t ) d t d \mathbf { u } } \end{array}
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
$$
|
| 174 |
+
\geq \int _ { \mathbb { R } ^ { d - 1 } } \int _ { \mathbb { R } } \left( G ( \mathbf { u } + t \mathbf { v } ) - P ( \mathbf { u } + t \mathbf { v } ) \right) ^ { 2 } \mu ( \mathbf { u } + t \mathbf { v } ) \mathbb { I } _ { \tilde { C } } ( \mathbf { u } , t ) d t d \mathbf { u }
|
| 175 |
+
$$
|
| 176 |
+
|
| 177 |
+
$$
|
| 178 |
+
\begin{array} { r l } & { = \frac { \int _ { \mathbb { R } ^ { d - 1 } } \int _ { \mathbb { R } } \big ( G ( \mathbf { u } + t \mathbf { v } ) - P ( \mathbf { u } + t \mathbf { v } ) \big ) ^ { 2 } \mu ( \mathbf { u } + t \mathbf { v } ) \mathbb { I } _ { \boldsymbol { \bar { C } } } ( \mathbf { u } , t ) \ d t d \mathbf { u } } { \int _ { \mathbb { R } ^ { d - 1 } } \int _ { \mathbb { R } } \mu ( \mathbf { u } + t \mathbf { v } ) \mathbb { I } _ { \boldsymbol { \bar { C } } } ( \mathbf { u } , t ) \ d t d \mathbf { u } } \cdot \displaystyle \int _ { \mathbb { R } ^ { d - 1 } } \int _ { \mathbb { R } } \mu ( \mathbf { u } + t \mathbf { v } ) \mathbb { I } _ { \boldsymbol { \bar { C } } } ( \mathbf { u } , t ) \ d t d \mathbf { u } } \\ & { = \frac { \int _ { \mathbb { R } ^ { d - 1 } } \int _ { \mathbb { R } } \big ( G \big ( \mathbf { u } + t \mathbf { v } \big ) - P \big ( \mathbf { u } + t \mathbf { v } \big ) \big ) ^ { 2 } \mu ( \mathbf { u } + t \mathbf { v } ) \mathbb { I } _ { \boldsymbol { \bar { C } } } ( \mathbf { u } , t ) \ d t d \mathbf { u } } { \int _ { \mathbb { R } ^ { d - 1 } } \int _ { \mathbb { R } } \mu ( \mathbf { u } + t \mathbf { v } ) \int _ { \mathbb { \bar { C } } } ( \mathbf { u } , t ) \ d t d \mathbf { u } } \cdot \displaystyle \int _ { \boldsymbol { C } ^ { \prime } } \mu ( \mathbf { x } ) d \mathbf { x } } \end{array}
|
| 179 |
+
$$
|
| 180 |
+
|
| 181 |
+
$$
|
| 182 |
+
\begin{array} { r l } & { \displaystyle \geq \operatorname* { m i n } _ { { \bf u } \in { \mathbb { R } } ^ { d - 1 } } \frac { \int _ { { \mathbb { R } } } \left( { \cal G } ( { \bf u } + t { \bf v } ) - P ( { \bf u } + t { \bf v } ) \right) ^ { 2 } \mu ( { \bf u } + t { \bf v } ) \mathbb { I } _ { { \widetilde { \cal C } } } ( { \bf u } , t ) d t } { \int _ { { \mathbb { R } } } \mu ( { \bf u } + t { \bf v } ) \mathbb { I } _ { { \widetilde { \cal C } } } ( { \bf u } , t ) d t } \cdot \displaystyle \int _ { { \cal C } ^ { \prime } } \mu ( { \bf x } ) d { \bf x } } \\ & { \displaystyle \geq \operatorname* { m i n } _ { { \bf u } \in { \mathbb { R } } ^ { d - 1 } } \frac { \alpha } { \beta } \cdot \frac { \int _ { { \mathbb { R } } } \left( { \cal G } ( { \bf u } + t { \bf v } ) - P ( { \bf u } + t { \bf v } ) \right) ^ { 2 } \mathbb { I } _ { { \widetilde { \cal C } } } ( { \bf u } , t ) d t } { \int _ { { \mathbb { R } } } \mathbb { I } _ { { \widetilde { \cal C } } } ( { \bf u } , t ) d t } \cdot \displaystyle \int _ { { \cal C } ^ { \prime } } \mu ( { \bf x } ) d { \bf x } } \end{array}
|
| 183 |
+
$$
|
| 184 |
+
|
| 185 |
+
because for any line $\ell$ , the distribution induced by $\mu ( \mathbf { x } )$ along any line segment of length at least $r$ in the intersection $\ell \cap C$ is $( \alpha , \beta )$ -uniform, for any line $\ell$ $\geq { \frac { \alpha } { \beta } } \cdot { \frac { \gamma } { 3 } } .$
|
| 186 |
+
|
| 187 |
+
The last inequality is using the condition $\begin{array} { r } { \int _ { C ^ { \prime } } \mu ( \mathbf { x } ) d \mathbf { x } \geq \gamma } \end{array}$ given in Theorem 9 and an adaptation of the following idea from Lemma 5 of Daniely (2017). For any fixed $\mathbf { u }$ and $\mathbf { v }$ , $G ( \mathbf { u } + t \mathbf { v } ) =$ $\sin ( \pi N ( \left. \lvert \mathbf { u } \right. \rvert ^ { 2 } + t ^ { 2 } ) )$ and $P ( \mathbf { u } + t \mathbf { v } )$ is a polynomial of degree at most $D$ in $t$ . The function $\sin ( \pi N ( \left. \lvert \mathbf { u } \right. \rvert ^ { 2 } + t ^ { 2 } ) )$ alternates its sign as $\left\| \mathbf { u } \right\| ^ { 2 } + t ^ { 2 }$ takes values that are successive integer multiples of $1 / N$ . Consider $\acute { s } = t ^ { 2 } \in [ 0 , 1 ]$ and divide $[ 0 , 1 ]$ into $N$ disjoint segments using integer grid of step size $1 / N$ . For any polynomial $p ( s )$ of degree at most $D$ and any interval $I \subseteq [ 0 , 1 ]$ of length $r \gg D / N$ , there exists at least $N r - D - 2$ segments of length $1 / N$ each on which $\sin ( \pi N s )$ and $p ( s )$ do not change signs and have opposite signs. Now using $( \sin ( \pi N s ) - p ( s ) ) ^ { 2 } \ge \sin ^ { 2 } ( \pi N s ) \nonumber$ , integrating we get that $\begin{array} { r } { \int _ { I } ( \sin ( \pi N s ) - p ( s ) ) ^ { 2 } \bar { d s } \ge r / 2 } \end{array}$ . Extending this proof to $t$ instead of $s = t ^ { 2 }$ , using $\sin ^ { 2 } ( \pi N t ^ { 2 } ) t \leq \sin ^ { 2 } ( \pi N t )$ for all $t \in [ 0 , 1 ]$ , and incorporating the shift $\pi N \left. \mathbf { u } \right. ^ { 2 }$ , we can similarly show that $\begin{array} { r } { \int _ { I } \sin ^ { 2 } ( \pi N ( \left\| \mathbf { u } \right\| ^ { 2 } + t ^ { 2 } ) ) - P ( \mathbf { u } + t \mathbf { v } ) ) ^ { 2 } d t \ge r / 3 } \end{array}$ . Summing up over multiple such intervals gives the final inequality. □
|
| 188 |
+
|
| 189 |
+
The $L _ { 2 }$ separation between depth-2 and depth-3 neural networks under probability density $\mu$ now follows by taking a small enough $\delta$ , and combining the following ingredients (i) Proposition 4 says that any depth-2 sigmoid neural networks of width $n = 2 ^ { d }$ and weights bounded by $B = { \mathfrak { p o l y } } ( d )$ can be $\delta$ -approximated in $L _ { \infty }$ (and hence, also $L _ { 2 }$ ) by a multivariate polynomials of degree $D = O ( B \mathbf { \bar { l o g } } ( n B ^ { 2 } / \delta ) ) = \mathrm { p o l y } ( d )$ , (ii) proof of Theorem 7 (initial part) says that $G ( \mathbf { x } )$ can be $\delta$ -approximated in $L _ { \infty }$ (and hence, also $L _ { 2 }$ ) by a depth-3 sigmoid neural network of width and size $\mathfrak { p o l y } ( d )$ , but (iii) Theorem 9 says that, for $N = { \mathrm { p o l y } } ( d )$ of large enough degree, $G ( \mathbf { x } )$ cannot be $3 \delta$ -approximated in $L _ { 2 }$ by any multivariate polynomial of degree $D$ , and (iv) triangle inequality.
|
| 190 |
+
|
| 191 |
+
# REFERENCES
|
| 192 |
+
|
| 193 |
+
Andrew R. Barron. Approximation and estimation bounds for artificial neural networks. Machine Learning, 14(1):115–133, Jan 1994. ISSN 1573-0565. doi: 10.1007/BF00993164. URL https: //doi.org/10.1007/BF00993164.
|
| 194 |
+
|
| 195 |
+
Moustapha Cisse, Piotr Bojanowski, Edouard Grave, Yann Dauphin, and Nicolas Usunier. Parseval ´ networks: Improving robustness to adversarial examples. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, pp. 854–863, 2017. URL http://proceedings.mlr.press/v70/cisse17a.html.
|
| 196 |
+
|
| 197 |
+
G. Cybenko. Approximation by superpositions of a sigmoidal function. Mathematics of Control, Signals and Systems, 2(4):303–314, Dec 1989. ISSN 1435-568X. doi: 10.1007/BF02551274. URL https://doi.org/10.1007/BF02551274.
|
| 198 |
+
|
| 199 |
+
Amit Daniely. Depth separation for neural networks. In Proceedings of the 30th Conference on Learning Theory, COLT 2017, Amsterdam, The Netherlands, 7-10 July 2017, pp. 690–696, 2017. URL http://proceedings.mlr.press/v65/daniely17a.html.
|
| 200 |
+
|
| 201 |
+
Chen Debao. Degree of approximation by superpositions of a sigmoidal function. Approximation Theory and its Applications, 9(3):17–28, Sep 1993. ISSN 1573-8175. doi: 10.1007/BF02836480. URL https://doi.org/10.1007/BF02836480.
|
| 202 |
+
|
| 203 |
+
Ronen Eldan and Ohad Shamir. The power of depth for feedforward neural networks. In Proceedings of the 29th Conference on Learning Theory, COLT 2016, New York, USA, June 23-26, 2016, pp. 907–940, 2016. URL http://jmlr.org/proceedings/papers/v49/eldan16. html.
|
| 204 |
+
|
| 205 |
+
Ian Goodfellow, Yoshua Bengio, and Aaron Courville. Deep Learning. MIT Press, 2016. http: //www.deeplearningbook.org.
|
| 206 |
+
|
| 207 |
+
Boris Hanin. Universal function approximation by deep neural nets with bounded width and relu activations. CoRR, abs/1708.02691, 2017. URL http://arxiv.org/abs/1708.02691.
|
| 208 |
+
|
| 209 |
+
Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In 2016 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2016, Las Vegas, NV, USA, June 27-30, 2016, pp. 770–778, 2016. doi: 10.1109/CVPR.2016.90. URL https://doi.org/10.1109/CVPR.2016.90.
|
| 210 |
+
|
| 211 |
+
Kurt Hornik, Maxwell Stinchcombe, and Halbert White. Multilayer feedforward networks are universal approximators. Neural Networks, 2(5):359 – 366, 1989. ISSN 0893-6080. doi: https://doi.org/10.1016/0893-6080(89)90020-8. URL http://www.sciencedirect. com/science/article/pii/0893608089900208.
|
| 212 |
+
|
| 213 |
+
Yann LeCun, Yoshua Bengio, and Geoffrey E. Hinton. Deep learning. Nature, 521(7553):436–444, 2015. doi: 10.1038/nature14539. URL https://doi.org/10.1038/nature14539.
|
| 214 |
+
|
| 215 |
+
Shiyu Liang and R. Srikant. Why deep neural networks for function approximation? In ICLR, 2017.
|
| 216 |
+
|
| 217 |
+
James Martens, Arkadev Chattopadhya, Toni Pitassi, and Richard Zemel. On the representational efficiency of restricted boltzmann machines. In C. J. C. Burges, L. Bottou, M. Welling, Z. Ghahramani, and K. Q. Weinberger (eds.), Advances in Neural Information Processing Systems 26, pp. 2877–2885. Curran Associates, Inc., 2013. URL http://papers.nips.cc/paper/ 5020-on-the-representational-efficiency-of-restricted-boltzmann-machines. pdf.
|
| 218 |
+
|
| 219 |
+
Behnam Neyshabur, Srinadh Bhojanapalli, David McAllester, and Nathan Srebro. Exploring generalization in deep learning. CoRR, abs/1706.08947, 2017. URL http://arxiv.org/abs/ 1706.08947.
|
| 220 |
+
|
| 221 |
+
Itay Safran and Ohad Shamir. Depth-width tradeoffs in approximating natural functions with neural networks. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, pp. 2979–2987, 2017. URL http://proceedings.mlr.press/v70/safran17a.html.
|
| 222 |
+
|
| 223 |
+
Shai Shalev-Shwartz, Ohad Shamir, and Karthik Sridharan. Learning kernel-based halfspaces with the 0-1 loss. SIAM J. Comput., 40(6):1623–1646, December 2011. ISSN 0097-5397. doi: 10. 1137/100806126. URL http://dx.doi.org/10.1137/100806126.
|
| 224 |
+
|
| 225 |
+
Shai Shalev-Shwartz, Ohad Shamir, and Shaked Shammah. Failures of gradient-based deep learning. In Proceedings of the 34th International Conference on Machine Learning, ICML 2017, Sydney, NSW, Australia, 6-11 August 2017, pp. 3067–3075, 2017. URL http://proceedings. mlr.press/v70/shalev-shwartz17a.html.
|
| 226 |
+
|
| 227 |
+
Ohad Shamir. Distribution-specific hardness of learning neural networks. CoRR, abs/1609.01037, 2016. URL http://arxiv.org/abs/1609.01037.
|
| 228 |
+
|
| 229 |
+
Le Song, Santosh Vempala, John Wilmes, and Bo Xie. On the complexity of learning neural networks. CoRR, abs/1707.04615, 2017. URL http://arxiv.org/abs/1707.04615.
|
| 230 |
+
|
| 231 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian J. Goodfellow, and Rob Fergus. Intriguing properties of neural networks. CoRR, abs/1312.6199, 2013. URL http://arxiv.org/abs/1312.6199.
|
| 232 |
+
|
| 233 |
+
Matus Telgarsky. benefits of depth in neural networks. In Proceedings of the 29th Conference on Learning Theory, COLT 2016, New York, USA, June 23-26, 2016, pp. 1517–1539, 2016. URL http://jmlr.org/proceedings/papers/v49/telgarsky16.html.
|
| 234 |
+
|
| 235 |
+
Dmitry Yarotsky. Error bounds for approximations with deep relu networks. CoRR, abs/1610.01145, 2016. URL http://arxiv.org/abs/1610.01145.
|
| 236 |
+
|
| 237 |
+
# A PROOFS OF POLYNOMIAL APPROXIMATIONS TO NEURAL NETWORKS
|
| 238 |
+
|
| 239 |
+
# Proof of Proposition 2
|
| 240 |
+
|
| 241 |
+
Proof. Consider the degree- $D$ approximation to $\sigma ( w t )$ given by the first $D$ terms in its Chebyshev expansion. The error of this approximation for any $t \in [ - 1 , 1 ]$ is bounded by
|
| 242 |
+
|
| 243 |
+
$$
|
| 244 |
+
\begin{array} { r l } { { ( \sigma ( w t ) - p ( \ell ) | = | \sum _ { j \geq \ell } \varsigma _ { j } T _ { ( j ) } ( \ell ) | } } \\ & { \leq \sum _ { j \geq 0 } | \varsigma _ { j } | } \\ & { \leq ( \frac { 4 } { | w | } + \frac { 2 } { \pi } ) \sum _ { j > \ell } ( 1 + \frac { \pi } { | w | } ) ^ { - \beta } } \\ & { \leq ( \frac { 4 } { | w | } + \frac { 2 } { \pi } ) ( 1 + \frac { \pi } { | w | } ) ^ { - ( \beta + 1 ) } \sum _ { j = 0 } ^ { \infty } ( 1 + \frac { \pi } { | w | } ) ^ { - \beta } } \\ & { = ( \frac { 4 } { | w | } + \frac { 2 } { \pi } ) ( 1 + \frac { \pi } { | w | } ) ^ { - ( \beta + 1 ) } \cdot \frac { | w | } { \frac { \sqrt { w } } { 2 \pi } ( 1 + \frac { \pi } { | w | } ) ^ { - \beta } } } \\ & { = ( \frac { 4 } { | w | } + \frac { 2 } { \pi } ) ( 1 + \frac { \pi } { | w | } ) ^ { - ( \beta + 1 ) } \cdot \frac { | w | } { \pi } ( 1 + \frac { \pi } { | w | } ) } \\ & { \leq \epsilon _ { * } . } \end{array}
|
| 245 |
+
$$
|
| 246 |
+
|
| 247 |
+
using Proposition 1, $| w | \le B$ , and $D = O \left( B \log \left( B / \epsilon \right) \right)$ .
|
| 248 |
+
|
| 249 |
+
# Proof of Proposition 3
|
| 250 |
+
|
| 251 |
+
Proof. Let $f$ be computed by a depth-2 sigmoidal neural network given by $\begin{array} { r } { f ( t ) = \sum _ { i = 1 } ^ { n } a _ { i } \sigma ( w _ { i } t ) } \end{array}$ Define a parameter $\epsilon \ : = \ : \delta / n B$ . Proposition 2 guarantees polynomial $p _ { 1 } , p _ { 2 } , \ldots , p _ { n }$ of degree $O \left( B \log ( \mathbf { \bar { \boldsymbol { B } } } / \epsilon ) \right)$ such that $| \sigma ( w _ { i } t ) - \bar { p } _ { i } ( t ) | \ \leq \ \epsilon$ , for all $t ~ \in ~ [ - 1 , 1 ]$ . Thus, the polynomial $\begin{array} { r } { p ( t ) = \sum _ { i = 1 } ^ { n } a _ { i } p _ { i } ( t ) } \end{array}$ has degree $O \left( B \log ( B / \epsilon ) \right) = O \left( B \log ( n B ^ { 2 } / \delta ) \right)$ , and for any $t \in [ - 1 , 1 ]$ ,
|
| 252 |
+
|
| 253 |
+
$$
|
| 254 |
+
\begin{array} { r l } { \displaystyle \left. \sum _ { i = 1 } ^ { n } a _ { i } \sigma ( w _ { i } t ) - p ( t ) \right. = \displaystyle \left. \sum _ { i = 1 } ^ { n } a _ { i } \sigma ( w _ { i } t ) - \sum _ { i = 1 } ^ { n } a _ { i } p _ { i } ( t ) \right. } & { } \\ { \displaystyle \leq \sum _ { i = 1 } ^ { n } \lvert a _ { i } \rvert \lvert \sigma ( w _ { i } t ) - p _ { i } ( t ) \rvert } & { } \\ { \displaystyle \leq n B \epsilon } & { } \\ { \displaystyle = \delta } \end{array}
|
| 255 |
+
$$
|
| 256 |
+
|
| 257 |
+
# Proof of Proposition 4
|
| 258 |
+
|
| 259 |
+
Proof. Let $F$ be computed by a depth-2 neural network given by $\begin{array} { r } { F ( \mathbf { x } ) \ = \ \sum _ { i = 1 } ^ { n } { a _ { i } \sigma } ( \left. \mathbf { w } _ { i } , \mathbf { x } \right. ) } \end{array}$ where $| a _ { i } | \le B$ and $\left\| \mathbf { w } _ { i } \right\| \leq B$ , for $1 \leq i \leq n$ . Thus, $\begin{array} { r } { F ( \mathbf { x } ) \ = \ \sum _ { i = 1 } ^ { n } { a _ { i } \sigma ( \left\| \mathbf { w } _ { i } \right\| t _ { i } ) } } \end{array}$ , where $t _ { i } = \left. \mathbf { w } _ { i } / \left\| \mathbf { w } _ { i } \right\| , \mathbf { x } \right. \in [ - 1 , 1 ]$ because $\mathbf { w } _ { i } / \left\| \mathbf { w } _ { i } \right\| \in \mathbb { B } ^ { d }$ , for $1 \leq i \leq n$ , and $\mathbf { x } \in \mathbb { B } ^ { d }$ .
|
| 260 |
+
|
| 261 |
+
Define a parameter $\epsilon \ : = \ : \delta / n B$ . Proposition 2 guarantees polynomial $p _ { 1 } , p _ { 2 } , \ldots , p _ { n }$ of degree $O \left( B \log ( \mathbf { \bar { \boldsymbol { B } } } / \epsilon ) \right)$ such that $| \dot { \sigma } ( \| w _ { i } \| t ) - p _ { i } ( t ) | \ \leq \ \dot { \epsilon }$ , for all $t \in [ - 1 , 1 ]$ . Consider the following polynomial $\begin{array} { r } { P ( \mathbf { x } ) = P ( x _ { 1 } , x _ { 2 } , \ldots , x _ { d } ) = \sum _ { i = 1 } ^ { n } a _ { i } p _ { i } ( \langle \mathbf { w } _ { i } / \left\| \mathbf { w } _ { i } \right\| , \mathbf { x } \rangle ) } \end{array}$ . $P ( \mathbf { x } )$ is a $d$ -variate polynomial of degree $O \left( B \log ( B / \epsilon ) \right) = O \left( B \log ( n B ^ { 2 } / \delta ) \right)$ in each variable $x _ { 1 } , x _ { 2 } , \ldots , x _ { d }$ . For any $\mathbf { x } \in \mathbb { B } ^ { d }$ ,
|
| 262 |
+
|
| 263 |
+
$$
|
| 264 |
+
| F ( \mathbf { x } ) - P ( \mathbf { x } ) | = \left| \sum _ { i = 1 } ^ { n } a _ { i } \sigma ( \langle \mathbf { w } _ { i } , \mathbf { x } \rangle ) - \sum _ { i = 1 } ^ { n } a _ { i } p _ { i } ( \langle \mathbf { w } _ { i } / \| \mathbf { w } _ { i } \| , \mathbf { x } \rangle ) \right|
|
| 265 |
+
$$
|
| 266 |
+
|
| 267 |
+
$$
|
| 268 |
+
\begin{array} { r l } & { \leq \displaystyle \sum _ { i = 1 } ^ { n } a _ { i } \sigma ( \mathbf { w } _ { i } , \mathbf { x } ) - p _ { i } ( \mathbf { w } _ { i } / \mathbf { w } _ { i } , \mathbf { x } ) ) } \\ & { \leq B \displaystyle \sum _ { i = 1 } ^ { n } \sigma ( \mathbf { w } _ { i } t _ { i } ) - p _ { i } ( t _ { i } ) \qquad \mathrm { u s i n g ~ } t _ { i } = \mathbf { w } _ { i } / \mathbf { w } _ { i } , \mathbf { x } ; } \\ & { \leq \epsilon n B \qquad \mathrm { u s i n g ~ } \sigma ( w _ { i } t ) - p _ { i } ( t ) \leq \epsilon , \mathrm { f o r ~ a l l ~ } t \in [ - 1 , 1 ] } \\ & { = \delta . } \end{array}
|
| 269 |
+
$$
|
| 270 |
+
|
| 271 |
+
# Proof of Proposition 5
|
| 272 |
+
|
| 273 |
+
Proof. We prove this by induction on the depth $k$ . By induction hypothesis each $F _ { j } ( \mathbf { x } )$ can be $\epsilon _ { 1 }$ -approximated (in $L _ { \infty }$ -norm) by a $d$ -variate polynomial $Q _ { j } ( \mathbf { x } )$ of degree $O \left( ( n B ) ^ { k - 2 } \log ^ { ( k - 2 ) } ( n B / \epsilon _ { 1 } ) \right)$ in each variable. Thus, $| F _ { j } ( \mathbf { x } ) - Q _ { j } ( \mathbf { x } ) | = \epsilon _ { 1 }$ , for any $\mathbf { x } \in \mathbb { B } ^ { d }$ and $1 \leq j \leq m$ . Because a sigmoid neuron is Lipschitz,
|
| 274 |
+
|
| 275 |
+
$$
|
| 276 |
+
| y _ { j } - \sigma ( Q _ { j } ( \mathbf x ) ) | = | \sigma ( F _ { j } ( \mathbf x ) ) - \sigma ( Q _ { j } ( \mathbf x ) ) | \le | F _ { j } ( \mathbf x ) - Q _ { j } ( \mathbf x ) | \le \epsilon _ { 1 } ,
|
| 277 |
+
$$
|
| 278 |
+
|
| 279 |
+
for any $\mathbf { x } \in \mathbb { B } ^ { d }$ and $1 \leq j \leq m$ .
|
| 280 |
+
|
| 281 |
+
Since $F _ { j } ( \mathbf { x } )$ is the output of a depth- $\left( k - 2 \right)$ sigmoidal neural network of width at most $n$ and weights at most $B$ , we must have $| F _ { j } ( \mathbf { x } ) | \leq n B$ , for all $\mathbf { x } \in \mathbb { B } ^ { d }$ . Thus, $| Q _ { j } ( \mathbf { x } ) | \leq n B + \epsilon _ { 1 } \leq 2 n B$ . By Proposition 2, there exists a polynomial $q ( t )$ of degree at most $O \left( n B \log ( n B / \epsilon _ { 2 } ) \right)$ such that
|
| 282 |
+
|
| 283 |
+
$$
|
| 284 |
+
| \sigma ( Q _ { j } ( \mathbf x ) ) - q ( Q _ { j } ( \mathbf x ) ) | \le \epsilon _ { 2 } ,
|
| 285 |
+
$$
|
| 286 |
+
|
| 287 |
+
for all $\mathbf { x } \in \mathbb { B } ^ { d }$ and $1 \leq j \leq m$ .
|
| 288 |
+
|
| 289 |
+
Consider $\mathbf { q } \in \mathbb { R } ^ { m }$ as $\mathbf { q } = ( q ( Q _ { 1 } ( \mathbf { x } ) ) , q ( Q _ { 2 } ( \mathbf { x } ) ) , \dots , q ( Q _ { m } ( \mathbf { x } ) ) )$ . Then, for any $\mathbf { x } \in \mathbb { B } ^ { d }$ , we have
|
| 290 |
+
|
| 291 |
+
$$
|
| 292 |
+
\begin{array} { r l } & { \left| \left. \mathbf { w } _ { i } , \mathbf { y } \right. - \left. \mathbf { w } _ { i } , \mathbf { q } \right. \right| = \left| \left. \mathbf { w } _ { i } , \mathbf { y } - \mathbf { q } \right. \right| } \\ & { \qquad \leq \left\| \mathbf { w } _ { i } \right\| \left\| \mathbf { y } - \mathbf { q } \right\| } \\ & { \qquad \leq B \left( \displaystyle \sum _ { j = 1 } ^ { m } ( y _ { j } - q ( Q _ { j } ( \mathbf { x } ) ) ) ^ { 2 } \right) ^ { 1 / 2 } } \\ & { \qquad \leq B \sqrt { m } \left( \epsilon _ { 1 } + \epsilon _ { 2 } \right) } \\ & { \qquad \leq B \sqrt { n } \left( \epsilon _ { 1 } + \epsilon _ { 2 } \right) . } \end{array}
|
| 293 |
+
$$
|
| 294 |
+
|
| 295 |
+
Again by Proposition 2, there is a polynomial $p$ of degree at most $O \left( n B \log ( n B / \epsilon ) \right)$ such that $| \sigma ( \langle \mathbf { w } _ { i } , \mathbf { q } \rangle ) - p ( \langle \mathbf { w } _ { i } , \mathbf { q } \rangle ) | \leq \epsilon$ , for all $\dot { \mathbf { x } } \in \mathbb { B } ^ { d }$ and $1 \leq i \leq n$ . This is because $| \langle \mathbf { w } _ { i } , \mathbf { q } \rangle | = O ( n B )$ .
|
| 296 |
+
|
| 297 |
+
Let’s define $\begin{array} { r } { P ( \mathbf { x } ) = \sum _ { i = 1 } ^ { n } a _ { i } p ( \langle \mathbf { w } _ { i } , \mathbf { q } \rangle ) } \end{array}$ . Therefore, for any $\mathbf { x } \in \mathbb { B } ^ { d }$ ,
|
| 298 |
+
|
| 299 |
+
$$
|
| 300 |
+
\begin{array} { l } { \displaystyle | F ( \mathbf x ) - P ( \mathbf x ) | = \left| \displaystyle \sum _ { i = 1 } ^ { n } a _ { i } \sigma \big ( \langle \mathbf w _ { i } , \mathbf y \rangle \big ) - \displaystyle \sum _ { i = 1 } ^ { n } a _ { i } p \big ( \langle \mathbf w _ { i } , \mathbf q \rangle \big ) \right| } \\ { \displaystyle \leq \displaystyle \sum _ { i = 1 } ^ { n } \big | a _ { i } \big | | \sigma \big ( \langle \mathbf w _ { i } , \mathbf y \rangle \big ) - p \big ( \langle \mathbf w _ { i } , \mathbf q \rangle \big ) | } \\ { \displaystyle \leq \displaystyle \sum _ { i = 1 } ^ { n } \big | a _ { i } \big | \big ( | \sigma \big ( \langle \mathbf w _ { i } , \mathbf y \rangle \big ) - \sigma \big ( \langle \mathbf w _ { i } , \mathbf q \rangle \big ) \big | + | \sigma \big ( \langle \mathbf w _ { i } , \mathbf q \rangle \big ) - p \big ( \langle \mathbf w _ { i } , \mathbf q \rangle \big ) \big | \big ) } \\ { \displaystyle \leq \displaystyle \sum _ { i = 1 } ^ { n } a _ { i } \big | \big ( | \langle \mathbf w _ { i } , \mathbf y \rangle - \langle \mathbf w _ { i } , \mathbf q \rangle | + \epsilon \big ) } \\ { \displaystyle \leq n B \big ( B \sqrt { n } ( \epsilon _ { 1 } + \epsilon _ { 2 } ) + \epsilon \big ) } \\ { \displaystyle \leq \delta , } \end{array}
|
| 301 |
+
$$
|
| 302 |
+
|
| 303 |
+
if we use $\epsilon _ { 1 } = \epsilon _ { 2 } = \delta / 3 n ^ { 3 / 2 } B ^ { 2 }$ and $\epsilon = \delta / 3 n B$ .
|
| 304 |
+
|
| 305 |
+
$P ( \mathbf { x } )$ is a $d$ -variate polynomial of degree
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
\deg ( P ) \leq \deg ( p ) \deg ( q ) \cdot \deg ( Q _ { j } ) = O \left( ( n B ) ^ { k } \log ^ { k } \left( n B / \delta \right) \right) ,
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
in each variable.
|
md/train/SK7A5pdrgov/SK7A5pdrgov.md
ADDED
|
@@ -0,0 +1,319 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CAUSALWORLD: A ROBOTIC MANIPULATION BENCHMARK FOR CAUSAL STRUCTURE AND TRANSFER LEARNING
|
| 2 |
+
|
| 3 |
+
Ossama Ahmed,∗1 Frederik Trauble, ¨ ∗2 Anirudh Goyal, 3 Alexander Neitz, 2
|
| 4 |
+
Yoshua Bengio, 3 Bernhard Scholkopf, ¨ 2 Stefan Bauer,†2 Manuel Wuthrich ¨ †2
|
| 5 |
+
|
| 6 |
+
1ETH Zurich, 2Max Planck Institute for Intelligent Systems, 3Mila, University of Montreal
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Despite recent successes of reinforcement learning (RL), it remains a challenge for agents to transfer learned skills to related environments. To facilitate research addressing this problem, we propose CausalWorld, a benchmark for causal structure and transfer learning in a robotic manipulation environment. The environment is a simulation of an open-source robotic platform, hence offering the possibility of sim-to-real transfer. Tasks consist of constructing 3D shapes from a set of blocks - inspired by how children learn to build complex structures. The key strength of CausalWorld is that it provides a combinatorial family of such tasks with common causal structure and underlying factors (including, e.g., robot and object masses, colors, sizes). The user (or the agent) may intervene on all causal variables, which allows for fine-grained control over how similar different tasks (or task distributions) are. One can thus easily define training and evaluation distributions of a desired difficulty level, targeting a specific form of generalization (e.g., only changes in appearance or object mass). Further, this common parametrization facilitates defining curricula by interpolating between an initial and a target task. While users may define their own task distributions, we present eight meaningful distributions as concrete benchmarks, ranging from simple to very challenging, all of which require long-horizon planning as well as precise low-level motor control. Finally, we provide baseline results for a subset of these tasks on distinct training curricula and corresponding evaluation protocols, verifying the feasibility of the tasks in this benchmark.1
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Benchmarks have played a crucial role in advancing entire research fields, for instance computer vision with the introduction of CIFAR-10 and ImageNet (Krizhevsky et al., 2009; 2012). When it comes to the field of reinforcement learning (RL), similar breakthroughs have been achieved in domains such as game playing (Mnih et al., 2013; Silver et al., 2017), learning motor control for high-dimensional simulated robots (Akkaya et al., 2019), multi-agent settings (Baker et al., 2019; Berner et al., 2019) and for studying transfer in the context of meta-learning (Yu et al., 2019). Nevertheless, trained agents often fail to transfer the knowledge about the learned skills from a training environment to a different but related environment sharing part of the underlying structure. This can be attributed to the fact that it is quite common to evaluate an agent on the training environments themselves, which leads to overfitting on these narrowly defined environments (Whiteson et al., 2011), or that algorithms are compared using highly engineered and biased reward functions which may result in learning suboptimal policies with respect to the desired behaviour; this is particularly evident in robotics.
|
| 15 |
+
|
| 16 |
+

|
| 17 |
+
Figure 1: Example of dointerventions on exposed variables in CausalWorld.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 2: Example tasks from the task generators provided in the benchmark. The goal shape is visualized in opaque red and the blocks in blue.
|
| 21 |
+
|
| 22 |
+
In existing benchmarks (Yu et al., 2019; Goyal et al., 2019a; Cobbe et al., 2018; Bellemare et al., 2013; James et al., 2020) the amount of shared causal structure between the different environments is mostly unknown. For instance, in the Atari Arcade Learning environments, it is unclear how to quantify the underlying similarities between different Atari games and we generally do not know to which degree an agent can be expected to generalize.
|
| 23 |
+
|
| 24 |
+
To overcome these limitations, we introduce a novel benchmark in a robotic manipulation environment that we call CausalWorld. It features a diverse set of environments that, in contrast to previous designs, share a large set of parameters and parts of the causal structure. Being able to intervene on these parameters (individually or collectively) permits the experimenter to evaluate agents’ generalization abilities with respect to different types and magnitudes of changes in the environment. These parameters can be varied gradually, which yields a continuum of similar environments. This allows for fine-grained control of training and test distributions and the design of learning curricula.
|
| 25 |
+
|
| 26 |
+
A remarkable skill that humans learn to master early on in their life is building complex structures using spatial-reasoning and dexterous manipulation abilities (Casey et al., 2008; Caldera et al., 1999; Kamii et al., 2004). Playing with toy blocks constitutes a natural environment for children to develop important visual-spatial skills, helping them ‘generalize’ in building complex composition designs from presented or imagined goal structures (Verdine et al., 2017; Nath & Szucs, 2014; De- ¨ war, 2018; Richardson et al., 2014). Inspired by this, CausalWorld is designed to aid in learning and investigating these skills in a simulated robotic manipulation environment corresponding to the open-source TriFinger robot platform from Wuthrich et al. (2020), which can be built in the real ¨ world. Tasks are formulated as building 3D goal shapes using a set of available blocks by manipulating them - as seen in Fig. 1. This yields a diverse familiy of tasks, ranging from relatively simple (e.g. pushing a single object) to extremely hard (e.g. building a complex structure from a large number of objects).
|
| 27 |
+
|
| 28 |
+
CausalWorld improves upon previous benchmarks by exposing a large set of parameters in the causal generative model of the environments, such as weight, shape and appearance of the building blocks and the robot itself. The possibility of intervening on any of these properties at any point in time allows one to set up training curricula or to evaluate an agent’s generalization capability with respect to different parameters. Furthermore, in contrast to previous benchmarks (ChevalierBoisvert et al., 2018; Cobbe et al., 2018), researchers may build their own real-world platform of this simulator at low cost, as detailed in Wuthrich et al. (2020), and transfer their trained policies to ¨ the real world.
|
| 29 |
+
|
| 30 |
+
Table 1: Comparison of Causal World with RLBench (James et al., 2020), MetaWorld (Yu et al., 2019), IKEA (Lee et al., 2019), BabyAI (Chevalier-Boisvert et al., 2018), CoinRun (Cobbe et al., 2018), AtariArcade (Bellemare et al., 2013), MuJoBan etc. (Mirza et al., 2020),
|
| 31 |
+
|
| 32 |
+
<table><tr><td rowspan=1 colspan=1>Benchmark</td><td rowspan=1 colspan=1>do-interventionsinterface</td><td rowspan=1 colspan=1>procedurallygeneratedenviron-ments</td><td rowspan=1 colspan=1>onlinedis-tribution oftasks</td><td rowspan=1 colspan=1>setupcustomcurric-ula</td><td rowspan=1 colspan=1>disentanglegeneral-izationability</td><td rowspan=1 colspan=1>real-worldsimilarity</td><td rowspan=1 colspan=1>open-sourcerobot</td><td rowspan=1 colspan=1>low-levelmotorcontrol</td><td rowspan=1 colspan=1>long-termplan-ning</td><td rowspan=1 colspan=1>unifiedsuccessmetric</td></tr><tr><td rowspan=1 colspan=1>RLBench</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>MetaWorld</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>S</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td></tr><tr><td rowspan=1 colspan=1>IKEA</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</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>MuJoBan</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>1</td><td rowspan=1 colspan=1>专</td><td rowspan=1 colspan=1>√</td></tr><tr><td rowspan=1 colspan=1>BabyAI</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>√</td></tr><tr><td rowspan=1 colspan=1>CoinRun</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>Y</td></tr><tr><td rowspan=1 colspan=1>AtariArcade</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>X</td><td rowspan=1 colspan=1>1x</td><td rowspan=1 colspan=1>√</td></tr><tr><td rowspan=1 colspan=1>CausalWorld</td><td rowspan=1 colspan=1>√</td><td rowspan=1 colspan=1>V</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><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></table>
|
| 33 |
+
|
| 34 |
+
Finally, by releasing this benchmark we hope to facilitate research in causal structure learning, i.e. learning the causal graph (or certain aspects of it) as we operate in a complex real-world environment whose dynamics follow the laws of physics, which induce causal relations between the variables. Changes to the variables we expose can be considered do-interventions on the underlying structural causal model (SCM). Consequently, we believe that this benchmark offers an exciting opportunity to investigate causality and its connection to RL and robotics.
|
| 35 |
+
|
| 36 |
+
Our main contributions can be summarized as follows:
|
| 37 |
+
|
| 38 |
+
• We propose CausalWorld, a new benchmark comprising a parametrized family of robotic manipulation environments for advancing out-of-distribution generalization and causal structure learning in RL.
|
| 39 |
+
• We provide a systematic way of defining curricula and disentangling generalization abilities of RL agents with respect to different changes in the environment, since we allow for dointerventions to be performed on different environment variables (parameters and states) individually.
|
| 40 |
+
• We establish baseline results for some of the available tasks under different learning algorithms, thus verifying the feasibility of the tasks.
|
| 41 |
+
• We show how different learning curricula affect generalization across different axes by reporting some of the in-distribution and out-of-distribution generalization capabilities of the trained agents.
|
| 42 |
+
|
| 43 |
+
# 2 CAUSALWORLD BENCHMARK
|
| 44 |
+
|
| 45 |
+
Here we make the desiderata outlined in the introduction more precise:
|
| 46 |
+
|
| 47 |
+
1. The set of environments should be sufficiently diverse to allow for the design of challenging transfer tasks.
|
| 48 |
+
2. We need to be able to intervene on different properties (e.g. masses, colors) individually, such that we can investigate different types of generalization.
|
| 49 |
+
3. It should be possible to convert any environment to any other environment by gradually changing its properties through interventions; this requirement is important for evaluating different levels of transfer and for defining curricula.
|
| 50 |
+
4. The environments should share some causal structure to allow algorithms to transfer the learned causal knowledge from one environment to another.
|
| 51 |
+
5. There should be a unified measure of success, such that an objective comparison can be made between different learning algorithms.
|
| 52 |
+
6. The benchmark should make it easy for users to define meaningful distributions of environments for training and evaluation. In particular, it should facilitate evaluation of indistribution and out-of-distribution performance.
|
| 53 |
+
7. The simulated benchmark should have a real-world counterpart to allow for sim2real.
|
| 54 |
+
|
| 55 |
+
In light of these desiderata, we propose a setup in which a robot must build goal shapes using a set of available objects. It is worth noting that similar setups were proposed previously in a less realistic setting, e.g. in (Janner et al., 2018; Bapst et al., 2019; McCarthy et al.; Akkaya et al., 2019; Fahlman, 1974; Winston, 1970; Winograd, 1972). Specifically, a task is formulated as follows: given a set of available objects, the agent needs to build a specific goal structure, see Fig. 1 for an example. The vast amount of possible target shapes and environment properties (e.g. mass, shape and appearance of objects and the robot itself) makes this a diverse and challenging setting to evaluate different generalization aspects. CausalWorld is a simulated version (using the Bullet physics engine (Coumans et al., 2013)) of the open-source TriFinger robot platform from Wuthrich et al. (2020). ¨ Each environment is defined by a set of variables such, as gravity, floor friction, stage color, floor color, joint positions, various block parameters (e.g. size, color, mass, position, orientation), link colors, link masses and the goal shape. See Table 3 in the Appendix for a more extensive list of these variables.
|
| 56 |
+
|
| 57 |
+
Desideratum 1 is satisfied since different environment properties and goal shapes give rise to very different tasks, ranging from relatively easy (e.g. re-positioning a single cube) to extremely hard (e.g. building a complex structure). Desideratum 2 is satisfied because we allow for arbitrary interventions on these properties, hence users or agents may change parameters individually or jointly. Desideratum 3 is satisfied because the parameters can be changed gradually. Desideratum 4 is satisfied because all the environments share the causal structure of the robot, and one may also use subsets of environments which share even more causal structure. We satisfy desideratum 5 by defining the measure of success for all environments as the volumetric overlap of the goal shape with available objects. Further, by splitting the set of parameters into a set A, intended for training and in-distribution evaluation, and a set B, intended for out-of-distribution evaluation, we satisfy desideratum 6. Finally, since the TriFinger robot (Wuthrich et al., 2020) can be built in the real-world, we ¨ satisfy desideratum 7. Desideratum 7 and 2 are in partial conflict since sim2real is only possible for the tasks which are constrained to the variables on which the robot can physically act upon.
|
| 58 |
+
|
| 59 |
+
Task generators: To generate meaningful families of similar goal shapes, CausalWorld allows for defining task generators which can generate a variety of different goal shapes in an environment. For instance, one task generator may generate pushing tasks, while another one may generate towerbuilding tasks (see Fig. 2). Each task generator is initialized with a default goal shape from its corresponding family and comes with a sampler to sample new goal shapes from the same family. Additionally, upon construction, one can specify the environments’ initial state and initial goal shape structure when deviating from the default. The maximum episode time to build a given shape is number of blocks $\times 1 0$ seconds. CausalWorld comes with eight pre-defined task generators (see Fig. 2).
|
| 60 |
+
|
| 61 |
+
• Three generators create goal shapes with a single block: Pushing with the goal shape on the floor, Picking having the goal shape defined above the floor and Pick and Place where a fixed obstacle is placed between the initial block and goal pose.
|
| 62 |
+
• Stacking2 involves a goal shape of two stacked blocks, which can also be considered one instance of the Towers generator. The remaining generators use a variable number of blocks to generate much more complex and challenging target shapes, as detailed in the appendix: Towers, Stacked Blocks, Creative Stacked Blocks and General.
|
| 63 |
+
|
| 64 |
+
Given that building new environments using current physics simulators is often tedious, we provide a simple API for users who wish to create task generators for new challenging shape families, which may be added to CausalWorld’s task generators repository.
|
| 65 |
+
|
| 66 |
+
Action and Observation Spaces: The robot can be chosen to operate in either joint position control mode, joint torque control mode, end-effector position control mode, or the delta of each. In any of these cases, the action is 9-dimensional (one per joint). We provide two observation modes: structured and pixel. In the structured mode, the observation vector is constructed using a rule for the ordering of the relevant variables, such as joint positions, joint velocities, block positions, etc. Thus, the size of the observation space depends on the number of blocks, which could potentially change with every new goal sampled, e.g. in Towers, (Creative) Stacked Blocks and General. In contrast, in the pixel mode, the agent receives six RGB images (hence the dimension of the observation is $6 \times 3 \times 1 2 8 \times 1 2 8 )$ , the first three images are rendered from the three cameras mounted around the TriFinger robot, and the last three images specify the goal image of the target shape rendered from the same cameras. Additionally, CausalWorld allows users to set up a fully customized observation space.
|
| 67 |
+
|
| 68 |
+
Rewards: The reward function $r$ is defined as the fractional volumetric overlap of the blocks with the goal shape, which ranges between 0 (no overlap) and 1 (complete overlap). Since this reward\` function is shared across all tasks, an agent that learned $r$ from some training tasks could in principle use it to solve unseen goal structures. There is also the possibility of modifying the reward function to 1) sparsify the reward further by returning a binary reward signal instead, or 2) add a dense reward function in order to introduce inductive biases via domain knowledge and solution guidance. We hope that the considerable complexity and diversity of goal shapes motivate and accelerate the development of algorithms that are not dependent on hand-tuned reward functions.
|
| 69 |
+
|
| 70 |
+

|
| 71 |
+
Figure 3: Key components for generic training and evaluation of RL agents. Left: A learning curriculum which is composed of various intervention actors that decide which variables to intervene on (for a valid intervention, values need to be in the allowed training space (ATS)). Right: Evaluation protocols are shown which may intervene on variables at episode resets or within episodes (for a valid intervention, values need to be in the evaluation space (ES)). Middle: we represent the ATS and ES, where each intervention results in one point in the spaces. As shown ATS and ES may intersect, eg. if the protocols are meant to evaluate in-distribution generalization.
|
| 72 |
+
|
| 73 |
+
Training and evaluation spaces: In this benchmark, a learning setting consists of an allowed training space (ATS) and an evaluation space (ES), both of which are subspaces of the full parameter space. During training, in the simplest setting, parameters are sampled iid from the ATS. However, unlike existing benchmarks, CausalWorld allows in addition for curricula within the ATS as well as settings where the agent itself intervenes on the parameters within an episode (see Fig. 3). Similarly, during evaluation, parameters may be sampled iid from the evaluation space at each episode reset, or there can be interventions within an episode. Moreover, in order to retrieve the setting considered in most RL benchmarks, we could set the ATS and the ES to be identical and intervene only on object and robot states (and keep other environment properties constant) at each episode reset. However, to evaluate out-of-distribution generalization, one should set the two spaces (ATS and ES) to be different; possibly even disjoint. Additionally, to evaluate robustness with respect to a specific parameter (e.g. object mass), one may define the training and evaluation spaces which only differ in that particular parameter. In order to facilitate the definition of appropriate training and evaluation settings, we pre-define two disjoint sets, $\mathbf { A } _ { i }$ and $\mathbf { B } _ { i }$ , for each parameter $i$ . Through this, one can for instance define the training space to be $\mathbf { A } _ { 1 } \times \mathbf { A } _ { 2 } \times \ldots$ and the evaluation space to be $\mathbf { B } _ { 1 } \times \mathbf { B } _ { 2 } \times \ldots$ to assess generalization with respect to all parameters simultaneously. Alternatively, the evaluation space could be defined as ${ \bf A } _ { 1 } \times { \bf A } _ { 2 } \times \ldots \times { \bf B } _ { i } \times { \bf A } _ { i + 1 } \times \ldots$ to assess generalization with respect to parameter $i$ only. Lastly, users may also define their own spaces which could then be integrated into the benchmark to give rise to new learning settings.
|
| 74 |
+
|
| 75 |
+
Intervention actors: To provide a convenient way of specifying learning curricula, we introduce intervention actors. At each time step, such an actor takes all the exposed variables of the environment as inputs and may intervene on them. To encourage modularity, one may combine multiple actors in a learning curriculum. This actor is defined by the episode number to start intervening, the episode number to stop intervening, the timestep within the episode it should intervene and the episode periodicity of interventions. We provide a set of predefined intervention actors, including an actor which samples parameters randomly at each episode reset, which corresponds to domainrandomization. It is also easy to define custom intervention actors, we hope that this facilitates investigation into optimal learning curricula (see Fig. 3).
|
| 76 |
+
|
| 77 |
+
Probing the Causal Structure in RL: The problem setting in RL is usually formulated using the language of Markov Decision Processes (MDPs) or Partially Observable Markov Decision Processes (POMDPs) (Sutton & Barto, 1999), but can be also represented by Structural Causal Models (SCMs), as shown in (Buesing et al., 2018), refer to section E in the Appendix for a detailed explanation. This is achieved by formulating all conditional probability distributions as deterministic functions that take independent noise variables as inputs. These independent noise variables can specify different scenarios while the deterministic functions reflect the causal mechanisms of the system (Scholkopf et al., 2021). Changes in the environment can stem from two different sources: ¨
|
| 78 |
+
|
| 79 |
+
1. The agent may alter the state of the environment (e.g. the position of a block) indirectly, through its actions (e.g. pushing the block by applying appropriate torques at the motors). 2. During the execution of a learning curriculum or an evaluation protocol, we may directly intervene on any variable of the SCM, including all the latent variables of the causal model that are not accessible to the RL agent (such as gravity, object mass or color).
|
| 80 |
+
|
| 81 |
+
(1) is the default type of admissible interventions in RL benchmarks, whereas CausalWorld allows for interventions of type (2) in addition. The idea is that interventions on these latent variables, e.g. during a learning curriculum, will allow the agent to distinguish between spurious correlations that are only present in a particular setting and true causal relations that will hold across all settings (i.e. interventions). If the agent is able to learn such a representation of the underlying SCM structure, we would expect it to perform well even in out-of-distribution scenarios (Scholkopf et al., 2021;¨ Dittadi et al., 2021) because the causal structure remains the same, even when the functional form of certain relations may vary (e.g. when transferring to the real robot). Moreover, we hope that by having access to a broad range of interventions in CausalWorld it will aid the inference of the underlying SCM structure through the different causal discovery methods (see Figure 4 for a subset of the expected SCM to be learned), which in turn addresses the lack of causal discovery benchmarks for real world challenges.
|
| 82 |
+
|
| 83 |
+

|
| 84 |
+
Figure 4: A subset of an SCM represented as a DAG for an environment in CausalWorld with one ??1 ??2 ??3 ??4 block on the floor. Here, we only show a subset of the causal variables affecting the block position at time $_ { \mathrm { t + l } }$ .
|
| 85 |
+
|
| 86 |
+
# 3 RELATED WORK
|
| 87 |
+
|
| 88 |
+
Previous benchmarks for RL mostly focused on the single task learning setting such as OpenAI Gym and DM control suite (Tassa et al., 2018; Brockman et al., 2016). In contrast, a recent line of work, e.g. Meta-World and RLBench (Yu et al., 2019; James et al., 2020), aims at studying multi-task learning as well as meta-learning. Such benchmarks mostly provide non-parametric, hand-designed task variations, it is hence unclear how much structure is shared between them. For instance, it is not clear how different it is to “open a door” compared to “opening a drawer”. To address the ambiguity in the shared structure between the tasks, CausalWorld was designed to allow interventions to be performed on many environment variables giving rise to a large space of tasks with well-defined relations between them, which we believe is a missing key component to address generalization in RL. A detailed comparison between CausalWorld and similar benchmarks is shown in Table 1.
|
| 89 |
+
|
| 90 |
+
Similar parametric formulations of different environments were used in the generalization-for-RL literature, which has played an important role in advancing the field (Packer et al., 2018; Rajeswaran et al., 2017; Pinto et al., 2017; Yu et al., 2017; Henderson et al., 2017a; Dulac-Arnold et al., 2020; Chevalier-Boisvert et al., 2018). In these previous works, variables were mostly changed randomly, as opposed to the full control over the variables provided by CausalWorld.
|
| 91 |
+
|
| 92 |
+
Another important open problem for the RL community is the standardization of the reported learning curves and results. RL methods have been shown to be sensitive to a range of different factors (Henderson et al., 2017b). Thus it is crucial to devise a set of metrics that measure reliability of RL algorithms and ensure their reproducibility. Chan et al. (2019) distinguishes between several evaluation modes like ”evaluation during training” and ”evaluation after learning”. Osband et al. (2019) recently proposed a benchmarking suite that disentangles the ability of an algorithm to deal with different types of challenges. Its main components are: enforcing a specific methodology for an agent’s evaluation beyond the environment definition and isolating core capabilities with targeted ’unit tests’ rather than integrating the general learning ability.
|
| 93 |
+
|
| 94 |
+
Moreover, causality has been historically studied from the perspective of probabilistic and causal reasoning (Pearl, 2009), cognitive psychology (Griffiths & Tenenbaum, 2005), and more recently in the context of machine learning (Goyal et al., 2019b; Scholkopf et al., 2021; Baradel et al., 2019; ¨ Bakhtin et al., 2019). On the contrary, we believe its link to robotics is not yet drawn systematically. To bridge this gap, one of the main motivations of CausalWorld was to facilitate research in causal learning for robotics, such as observational discovery of causal effects in physical reality, counterfactual reasoning, and causal structure learning.
|
| 95 |
+
|
| 96 |
+
# 4 EXPERIMENTS
|
| 97 |
+
|
| 98 |
+
To illustrate the usage of this benchmark and to verify the feasibility of some basic tasks, we evaluate current state-of-the-art model-free (MF-RL) algorithms on a subset of the goal shape families described in Section 2 and depicted in Fig. 2: (a) Pushing, (b) Picking, (c) Pick and Place, and (d) Stacking2. These goal shapes reflect basic skills that are required to solve more complex construction tasks.
|
| 99 |
+
|
| 100 |
+
Setup: The idea here is to investigate how well an agent will perform on different evaluation distributions, depending on the curriculum it has been trained with. We train each method under the following curricula:
|
| 101 |
+
|
| 102 |
+
• Curriculum 0: no environment changes; each episode is initialized from the default task lying in space A - note that here the initial state never changes (i.e. no interventions). • Curriculum 1: goal shape randomization; at the beginning of each episode a new goal shape is sampled from space A (i.e. interventions on goal position and orientation). Curriculum 2: full randomization w.r.t. the task variables5; every episode a simultaneous intervention on all variables is sampled from space A (i.e. can be seen as equivalent to extreme domain randomization in one space).
|
| 103 |
+
|
| 104 |
+
The curriculum will, as expected, affect the generalization capabilities of the trained agents. With CausalWorld’s formulation, these generalization capabilities can easily be disentangled and benchmarked quantitatively, as explained in Section 2. For each of the goal shape families (a, b, c, d from Fig. 2), we train agents under the three described curricula using the following MF-RL algorithms: The original Proximal Policy Optimization (PPO) from Schulman et al. (2017), Soft Actor-Critic (SAC) from Haarnoja et al. (2018) and the Twin Delayed DDPG (TD3) from Fujimoto et al. (2018). We provided these methods with a hand-designed dense reward function as we did not observe any success with the sparse reward only. Each of the mentioned setups is trained for five different random seeds, resulting in 180 trained agents.
|
| 105 |
+
|
| 106 |
+

|
| 107 |
+
Figure 5: Fractional success curves averaged over five random seeds for the tasks and learning algorithms specified above, under three different training curricula: (0) no curriculum, (1) goal position and orientation randomization in space A every episode and (2) a curriculum where we intervene on all variables in space A simultaneously every episode.
|
| 108 |
+
|
| 109 |
+
Training model-free RL methods: We report the training curves averaged over the random seeds in Fig. 5. As can be seen from these fractional success training curves, MF-RL methods are capable of solving the single block goal shapes (pushing, picking, pick and place) seen during training time given enough experience. However, we observe that none of the methods studied here managed to solve stacking two blocks. The score below 0.5 indicates that it only learns to push the lower cube into the goal shape. This shows that multi-object target shapes can become nontrivial quickly and that there is a need for methods making use of the modular structure of object-based environments. To no surprise, the training curriculum has a major effect on learning. For example, methods rarely manage to pick up any significant success signal under extreme domain randomization as in curriculum 2, even after 100 million timesteps. Note that these curves represent the scores under the conditions of the training environments. Next, we will discuss shared evaluation protocols that allow to benchmark and compare agents trained under different conditions.
|
| 110 |
+
|
| 111 |
+
Benchmarking generalization capabilities along various axes: For each of the four goal shape families, we define a set of 12 evaluation protocols that we consider meaningful and representative for benchmarking the different algorithms. In the protocols presented here, we sample the values from a protocol-specific set of variables at the start of each episode while keeping all other variables fixed to their default values. We evaluate each agent on 200 episodes by computing the fractional success score at the last time step of each episode and reporting the mean. These evaluation protocols allow to disentangle generalization abilities, as they show robustness with respect to different types of interventions, see Fig. 6. The following are some of the observations we made for pushing:
|
| 112 |
+
|
| 113 |
+
• Agents that were trained on the default pushing task environment (curriculum 0) do well (as expected) on the default task (P0). Interestingly, we likewise see a generalization capability to initial poses from variable space A (P4). This can be explained by a substantial exploration of the block positions via manipulation during training. In contrast, we see that the agents exhibit weaknesses regarding goal poses (P5), they seem to overfit to their training settings in this case.
|
| 114 |
+
|
| 115 |
+

|
| 116 |
+
Figure 6: Evaluation scores for pushing baselines. Each protocol was evaluated for 200 episodes and each bar is averaged over five models with different random seeds. The variables listed under each protocol are sampled from the specified space at the start of every episode while all other variables remain fixed [bp block pose, bm block mass, bs block size, gp goal pose, ff floor friction].
|
| 117 |
+
|
| 118 |
+
• For agents trained with goal pose randomization (curriculum 1) we see similar results as with curriculum 0, with the difference that agents under this curriculum generalize robustly to different goal poses (P5), as one would expect.
|
| 119 |
+
• Finally, agents that experience extreme domain randomization (curriculum 2) at training time, fail to learn any relevant skill as shown by the flat training curve in Fig. 5. An explanation for this behavior could be that the agent might need more data and optimization steps to handle this much more challenging setting. Another possibility is that it may simply not be possible to find a strategy which simultaneously works for all parameters (note that the agent does not have access to the randomized parameters and hence must be robust to them). This poses an interesting question for future work.
|
| 120 |
+
|
| 121 |
+
As expected, we observe that an agent’s generalization capabilities are related to the experience gathered under its training curriculum. CausalWorld allows us to explore this relationship in a differentiated manner, assessing which curricula lead to which generalization abilities. This will not only help uncover an agent’s shortcomings but may also aid in investigating novel learning curricula and approaches for robustness in RL. Lastly, we note that this benchmark comprises extremely challenging tasks that appear to be out of reach of current model free methods without any additional inductive bias.
|
| 122 |
+
|
| 123 |
+
# 5 CONCLUSION
|
| 124 |
+
|
| 125 |
+
We have introduced a new benchmark - CausalWorld - to facilitate research in causal structure and transfer learning using a simulated environment of an open-source robot, where learned skills could potentially be transferred to the real world. We showed how allowing for interventions on the environment’s properties yields a diverse familiy of tasks with a natural way of defining learning curricula and evaluation protocols that can disentangle different generalization capabilities. A natural extension of our work is to develop new RL algorithms that focuses on out of distribution generalization (whether its a different subspace of the state space or a completely different task).We hope that the flexibility and modularity of CausalWorld will allow researchers to easily define appropriate benchmarks of increasing difficulty as the field progresses, thereby coordinating research efforts towards ever new goals.
|
| 126 |
+
|
| 127 |
+
# 6 ACKNOWLEDGMENTS
|
| 128 |
+
|
| 129 |
+
The authors would like to thank Felix Widmaier, Vaibhav Agrawal and Shruti Joshi for the useful discussions and for the development of the TriFinger robot’s simulator (Joshi et al., 2020), which served as a starting point for the work presented in this paper. AG is also grateful to Alex Lamb and Rosemary Nan Ke for useful discussions. We thank the International Max Planck Research School for Intelligent Systems (IMPRS-IS) for supporting FT.
|
| 130 |
+
|
| 131 |
+
# REFERENCES
|
| 132 |
+
|
| 133 |
+
Ilge Akkaya, Marcin Andrychowicz, Maciek Chociej, Mateusz Litwin, Bob McGrew, Arthur Petron, Alex Paino, Matthias Plappert, Glenn Powell, Raphael Ribas, et al. Solving rubik’s cube with a robot hand. arXiv preprint arXiv:1910.07113, 2019.
|
| 134 |
+
|
| 135 |
+
Safa Alver and Doina Precup. A brief look at generalization in visual meta-reinforcement learning. arXiv preprint arXiv:2006.07262, 2020.
|
| 136 |
+
|
| 137 |
+
Bowen Baker, Ingmar Kanitscheider, Todor Markov, Yi Wu, Glenn Powell, Bob McGrew, and Igor Mordatch. Emergent tool use from multi-agent autocurricula. arXiv preprint arXiv:1909.07528, 2019.
|
| 138 |
+
|
| 139 |
+
Anton Bakhtin, Laurens van der Maaten, Justin Johnson, Laura Gustafson, and Ross Girshick. Phyre: A new benchmark for physical reasoning. In Advances in Neural Information Processing Systems, pp. 5082–5093, 2019.
|
| 140 |
+
|
| 141 |
+
Victor Bapst, Alvaro Sanchez-Gonzalez, Carl Doersch, Kimberly L Stachenfeld, Pushmeet Kohli, Peter W Battaglia, and Jessica B Hamrick. Structured agents for physical construction. arXiv preprint arXiv:1904.03177, 2019.
|
| 142 |
+
|
| 143 |
+
Fabien Baradel, Natalia Neverova, Julien Mille, Greg Mori, and Christian Wolf. Cophy: Counterfactual learning of physical dynamics. arXiv preprint arXiv:1909.12000, 2019.
|
| 144 |
+
|
| 145 |
+
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.
|
| 146 |
+
|
| 147 |
+
Christopher Berner, Greg Brockman, Brooke Chan, Vicki Cheung, Przemysaw Debiak, Christy Dennison, David Farhi, Quirin Fischer, Shariq Hashme, Chris Hesse, et al. Dota 2 with large scale deep reinforcement learning. arXiv preprint arXiv:1912.06680, 2019.
|
| 148 |
+
|
| 149 |
+
Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016.
|
| 150 |
+
|
| 151 |
+
Lars Buesing, Theophane Weber, Yori Zwols, Sebastien Racaniere, Arthur Guez, Jean-Baptiste Lespiau, and Nicolas Heess. Woulda, coulda, shoulda: Counterfactually-guided policy search. arXiv preprint arXiv:1811.06272, 2018.
|
| 152 |
+
|
| 153 |
+
Yvonne M Caldera, Anne McDonald Culp, Marion O’Brien, Rosemarie T Truglio, Mildred Alvarez, and Aletha C Huston. Children’s play preferences, construction play with blocks, and visualspatial skills: Are they related? International Journal of Behavioral Development, 23(4):855– 872, 1999.
|
| 154 |
+
|
| 155 |
+
Beth M Casey, Nicole Andrews, Holly Schindler, Joanne E Kersh, Alexandra Samper, and Juanita Copley. The development of spatial skills through interventions involving block building activities. Cognition and Instruction, 26(3):269–309, 2008.
|
| 156 |
+
|
| 157 |
+
Stephanie CY Chan, Sam Fishman, John Canny, Anoop Korattikara, and Sergio Guadarrama. Measuring the reliability of reinforcement learning algorithms. arXiv preprint arXiv:1912.05663, 2019.
|
| 158 |
+
|
| 159 |
+
Maxime Chevalier-Boisvert, Dzmitry Bahdanau, Salem Lahlou, Lucas Willems, Chitwan Saharia, Thien Huu Nguyen, and Yoshua Bengio. Babyai: A platform to study the sample efficiency of grounded language learning. In International Conference on Learning Representations, 2018.
|
| 160 |
+
|
| 161 |
+
Karl Cobbe, Oleg Klimov, Chris Hesse, Taehoon Kim, and John Schulman. Quantifying generalization in reinforcement learning. arXiv preprint arXiv:1812.02341, 2018.
|
| 162 |
+
|
| 163 |
+
Erwin Coumans et al. Bullet real-time physics simulation. URL http://bulletphysics. org, 2013.
|
| 164 |
+
|
| 165 |
+
Gwen Dewar. The benefits of toy blocks: The science of construction play. Parentig Science, 2018.
|
| 166 |
+
|
| 167 |
+
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. International Conference on Learning Representations (ICLR), 2021.
|
| 168 |
+
|
| 169 |
+
Gabriel Dulac-Arnold, Nir Levine, Daniel J Mankowitz, Jerry Li, Cosmin Paduraru, Sven Gowal, and Todd Hester. An empirical investigation of the challenges of real-world reinforcement learning. arXiv preprint arXiv:2003.11881, 2020.
|
| 170 |
+
|
| 171 |
+
Scott Elliott Fahlman. A planning system for robot construction tasks. Artificial intelligence, 5(1): 1–49, 1974.
|
| 172 |
+
|
| 173 |
+
Scott Fujimoto, Herke van Hoof, and David Meger. Addressing function approximation error in actor-critic methods, 2018.
|
| 174 |
+
|
| 175 |
+
Anirudh Goyal, Riashat Islam, Daniel Strouse, Zafarali Ahmed, Matthew Botvinick, Hugo Larochelle, Yoshua Bengio, and Sergey Levine. Infobot: Transfer and exploration via the information bottleneck. arXiv preprint arXiv:1901.10902, 2019a.
|
| 176 |
+
|
| 177 |
+
Anirudh Goyal, Alex Lamb, Jordan Hoffmann, Shagun Sodhani, Sergey Levine, Yoshua Bengio, and Bernhard Scholkopf. Recurrent independent mechanisms. ¨ arXiv preprint arXiv:1909.10893, 2019b.
|
| 178 |
+
|
| 179 |
+
Thomas L Griffiths and Joshua B Tenenbaum. Structure and strength in causal induction. Cognitive psychology, 51(4):334–384, 2005.
|
| 180 |
+
|
| 181 |
+
Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor, 2018.
|
| 182 |
+
|
| 183 |
+
Peter Henderson, Wei-Di Chang, Florian Shkurti, Johanna Hansen, David Meger, and Gregory Dudek. Benchmark environments for multitask learning in continuous domains. arXiv preprint arXiv:1708.04352, 2017a.
|
| 184 |
+
|
| 185 |
+
Peter Henderson, Riashat Islam, Philip Bachman, Joelle Pineau, Doina Precup, and David Meger. Deep reinforcement learning that matters. arXiv preprint arXiv:1709.06560, 2017b.
|
| 186 |
+
|
| 187 |
+
Stephen James, Zicong Ma, David Rovick Arrojo, and Andrew J Davison. Rlbench: The robot learning benchmark & learning environment. IEEE Robotics and Automation Letters, 5(2):3019– 3026, 2020.
|
| 188 |
+
|
| 189 |
+
Michael Janner, Sergey Levine, William T Freeman, Joshua B Tenenbaum, Chelsea Finn, and Jiajun Wu. Reasoning about physical interactions with object-oriented prediction and planning. arXiv preprint arXiv:1812.10972, 2018.
|
| 190 |
+
|
| 191 |
+
Shruti Joshi, Felix Widmaier, Vaibhav Agrawal, and Manuel Wuthrich. ¨ https://github.com/ open-dynamic-robot-initiative/trifinger_simulation, 2020.
|
| 192 |
+
|
| 193 |
+
Constance Kamii, Yoko Miyakawa, and Yasuhiko Kato. The development of logico-mathematical knowledge in a block-building activity at ages 1–4. Journal of Research in Childhood Education, 19(1):44–57, 2004.
|
| 194 |
+
|
| 195 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
|
| 196 |
+
|
| 197 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012.
|
| 198 |
+
|
| 199 |
+
Youngwoon Lee, Edward S. Hu, Zhengyu Yang, Alex Yin, and Joseph J. Lim. Ikea furniture assembly environment for long-horizon complex manipulation tasks, 2019.
|
| 200 |
+
|
| 201 |
+
Will McCarthy, David Kirsh, and Judith Fan. Learning to build physical structures better over time.
|
| 202 |
+
|
| 203 |
+
Mehdi Mirza, Andrew Jaegle, Jonathan J. Hunt, Arthur Guez, Saran Tunyasuvunakool, Alistair Muldal, Theophane Weber, Peter Karkus, S ´ ebastien Racani ´ ere, Lars Buesing, Timothy Lillicrap, \` and Nicolas Heess. Physically embedded planning problems: New challenges for reinforcement learning, 2020.
|
| 204 |
+
|
| 205 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013.
|
| 206 |
+
|
| 207 |
+
Swiya Nath and Denes Sz ´ ucs. Construction play and cognitive skills associated with the develop- ¨ ment of mathematical abilities in 7-year-old children. Learning and Instruction, 32:73–80, 2014.
|
| 208 |
+
|
| 209 |
+
Ian Osband, Yotam Doron, Matteo Hessel, John Aslanides, Eren Sezener, Andre Saraiva, Katrina McKinney, Tor Lattimore, Csaba Szepezvari, Satinder Singh, et al. Behaviour suite for reinforcement learning. arXiv preprint arXiv:1908.03568, 2019.
|
| 210 |
+
|
| 211 |
+
Charles Packer, Katelyn Gao, Jernej Kos, Philipp Krahenb ¨ uhl, Vladlen Koltun, and Dawn Song. ¨ Assessing generalization in deep reinforcement learning. arXiv preprint arXiv:1810.12282, 2018.
|
| 212 |
+
|
| 213 |
+
Judea Pearl. Causality. Cambridge university press, 2009.
|
| 214 |
+
|
| 215 |
+
Lerrel Pinto, James Davidson, Rahul Sukthankar, and Abhinav Gupta. Robust adversarial reinforcement learning. arXiv preprint arXiv:1703.02702, 2017.
|
| 216 |
+
|
| 217 |
+
Aravind Rajeswaran, Kendall Lowrey, Emanuel V Todorov, and Sham M Kakade. Towards generalization and simplicity in continuous control. In Advances in Neural Information Processing Systems, pp. 6550–6561, 2017.
|
| 218 |
+
|
| 219 |
+
Miles Richardson, Thomas E Hunt, and Cassandra Richardson. Children’s construction task performance and spatial ability: Controlling task complexity and predicting mathematics performance. Perceptual and motor skills, 119(3):741–757, 2014.
|
| 220 |
+
|
| 221 |
+
Bernhard Scholkopf, Francesco Locatello, Stefan Bauer, Nan Rosemary Ke, Nal Kalchbrenner, ¨ Anirudh Goyal, and Yoshua Bengio. Towards causal representation learning. arXiv preprint arXiv:2102.11107, 2021.
|
| 222 |
+
|
| 223 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms, 2017.
|
| 224 |
+
|
| 225 |
+
David Silver, Julian Schrittwieser, Karen Simonyan, Ioannis Antonoglou, Aja Huang, Arthur Guez, Thomas Hubert, Lucas Baker, Matthew Lai, Adrian Bolton, et al. Mastering the game of go without human knowledge. nature, 550(7676):354–359, 2017.
|
| 226 |
+
|
| 227 |
+
Richard S Sutton and Andrew G Barto. Reinforcement learning. Journal of Cognitive Neuroscience, 11(1):126–134, 1999.
|
| 228 |
+
|
| 229 |
+
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.
|
| 230 |
+
|
| 231 |
+
Brian N Verdine, Roberta Michnick Golinkoff, Kathy Hirsh-Pasek, and Nora Newcombe. Links between spatial and mathematical skills across the preschool years. Wiley, 2017.
|
| 232 |
+
|
| 233 |
+
Shimon Whiteson, Brian Tanner, Matthew E Taylor, and Peter Stone. Protecting against evaluation overfitting in empirical reinforcement learning. In 2011 IEEE symposium on adaptive dynamic programming and reinforcement learning (ADPRL), pp. 120–127. IEEE, 2011.
|
| 234 |
+
|
| 235 |
+
Terry Winograd. Understanding natural language. Cognitive psychology, 3(1):1–191, 1972.
|
| 236 |
+
|
| 237 |
+
Patrick H Winston. Learning structural descriptions from examples. 1970.
|
| 238 |
+
|
| 239 |
+
Manuel Wuthrich, Felix Widmaier, Felix Grimminger, Joel Akpo, Shruti Joshi, Vaibhav Agrawal, ¨ Bilal Hammoud, Majid Khadiv, Miroslav Bogdanovic, Vincent Berenz, et al. Trifinger: An opensource robot for learning dexterity. arXiv preprint arXiv:2008.03596, 2020.
|
| 240 |
+
|
| 241 |
+
Tianhe Yu, Deirdre Quillen, Zhanpeng He, Ryan Julian, Karol Hausman, Chelsea Finn, and Sergey Levine. Meta-world: A benchmark and evaluation for multi-task and meta reinforcement learning. arXiv preprint arXiv:1910.10897, 2019.
|
| 242 |
+
|
| 243 |
+
Wenhao Yu, Jie Tan, C Karen Liu, and Greg Turk. Preparing for the unknown: Learning a universal policy with online system identification. arXiv preprint arXiv:1702.02453, 2017.
|
| 244 |
+
|
| 245 |
+
# 7 APPENDIX
|
| 246 |
+
|
| 247 |
+
# A OBSERVATIONS
|
| 248 |
+
|
| 249 |
+
Observations in CausalWorld has two modes, ”structured” and ”pixel”. When using ”pixel” mode, 6 images are returned consisting of the current images rendered from 3 different views on top of the TriFinger platform, showing the current state of the environment, as well as the 3 equivalent goal images rendered from the same points of view, showing the goal shape that the robot have to build by the end of the episode.
|
| 250 |
+
|
| 251 |
+

|
| 252 |
+
Figure 7: Example ”pixel” mode observations returned at each step of the environment.
|
| 253 |
+
|
| 254 |
+

|
| 255 |
+
Figure 8: Structured observation description. For the scene features, all the blocks feature vector are concatenated first. Following that the partial goals feature vector are concatenated in the same order. Lastly, if there is any obstacles/ fixed blocks, their feature vectors are concatenated at the end following the same description as the partial goal features.
|
| 256 |
+
|
| 257 |
+
# B TRIFINGER PLATFORM
|
| 258 |
+
|
| 259 |
+
The robot from (Wuthrich et al., 2020) shown in figure 9 is open-sourced and can be reproduced and ¨ built in any research lab; since its inexpensive (about $\$ 5000$ ), speeding up sim2real research.
|
| 260 |
+
|
| 261 |
+

|
| 262 |
+
Figure 9: The TriFinger platform.
|
| 263 |
+
|
| 264 |
+
# C TASK GENERATORS
|
| 265 |
+
|
| 266 |
+
1. Pushing: task where the goal is to push one block towards a goal position with a specific orientation; restricted to goals on the floor level.
|
| 267 |
+
2. Picking: task where the goal is to pick one block towards a goal height above the center of the arena; restricted to goals above the floor level.
|
| 268 |
+
|
| 269 |
+
3. Pick And Place: task where the arena is divided by a fixed long block and the goal is to pick one block from one side of the arena to a goal position with a variable orientation on the other side of the fixed block.
|
| 270 |
+
|
| 271 |
+
4. Stacking2: task where the goal is to stack two blocks above each other in a specific goal position and orientation.
|
| 272 |
+
|
| 273 |
+
5. Towers: task where the goal is to stack multiple n blocks above each other in a specific goal position and orientation - exactly above each other creating a tower of blocks.
|
| 274 |
+
|
| 275 |
+
6. Stacked Blocks: task where the goal is to stack multiple n blocks above each other in an arbitrary way to create a stable structure. The blocks don’t have to be exactly above each other; making it more challenging than the ordinary towers task since the its harder to come up with a stable structure that covers the goal shape volume.
|
| 276 |
+
|
| 277 |
+
7. Creative Stacked Blocks: exactly the same as the Stacked Blocks task except that the first and last levels of the goal are the only levels shown or ”imposed” and the rest of the structure is not explicitly specified, leaving the rest of the goal shape to the imagination of the agent itself; this is considered the most challenging since its it needs the agent to understand how to build stable structures and imagine what can be filled in the middle to connect the two levels in a stable way.
|
| 278 |
+
|
| 279 |
+
8. General: the goal shape is an arbitrary shape created by initially dropping an arbitrary number of blocks from above the ground and waiting till all blocks come to a rest position where this becomes the goal shape that the agent needs to fill up afterwards.
|
| 280 |
+
|
| 281 |
+
<table><tr><td>Variable</td><td>Sub Variable</td><td>Space A</td><td>Space B [-7,-4]</td></tr><tr><td>gravity[z] floor friction stage friction stage color [rgb] floor color [rgb]</td><td></td><td>[-10,-7] [0.3, 0.6] [0.3,0.6] [0.0,0.5]3 [0.0,0.5]3 [-1.57, -1.2, -3.0]3, [-0.69,0,0]3]</td><td>[0.6, 0.8] [0.6,0.8] [0.5,1]3 [0.5,1]3 [[-0.69,0,0]3,</td></tr><tr><td>block block block</td><td>size color mass</td><td>[0.055, 0.075]3 [0.0,0.5]3 [0.015, 0.045] [0.0,0.5]3</td><td>[1.0, 1.57,3.0]3] [0.075,0.095]3 [0.5,1]3 [0.045, 0.1] [0.5,1]3</td></tr><tr><td>block</td><td>position (cylindrical)</td><td>[[0,-π,h/2],</td><td>[0.11,-π,h/2],</td></tr><tr><td>goal cuboid goal cuboid</td><td>size</td><td>[0.11, π, 0.15]] [0.055,0.075]3</td><td>[0.15, π, 0.3]] [0.075,0.095]3</td></tr></table>
|
| 282 |
+
|
| 283 |
+
Table 2: Description of a subset of the high level variables, exposed in CausalWorld, and their corresponding spaces, $h$ refers to the height of the block.
|
| 284 |
+
|
| 285 |
+
<table><tr><td>Task Generator</td><td>Variable</td><td>Space A</td><td>Space B</td></tr><tr><td>Picking</td><td>goal height</td><td>[0.08, 0.20]</td><td>[0.20,0.25]</td></tr><tr><td>Towers</td><td>tower dims</td><td>[0.08,0.08,0.08], [0.12, 0.12, 0.12]]</td><td>[0.12,0.12,0.12], [0.20,0.20, 0.20]]</td></tr></table>
|
| 286 |
+
|
| 287 |
+
Table 3: Example of task generators’ specific high level variables, exposed in CausalWorld, and their corresponding spaces. For a full list of each task generators’ variables and their corresponding spaces, please refer to the documentation at (https://sites.google.com/view/causal-world/home).
|
| 288 |
+
|
| 289 |
+
<table><tr><td>Task generators</td><td>Dense reward</td></tr><tr><td>Pushing</td><td>-750△t(01,e)-250△t(01,g1)</td></tr><tr><td>Picking</td><td>-750△t(01,e)-250△t(01,z,91,z)-125△t(01,x,y, 91,x,y)-0.005|lut_ ut-1|</td></tr><tr><td>Pick and Place</td><td>-750△t(01,e)-50△t(01,x,y,91,x,y)-250(l0t,z-t|-|ot,1-tl)- 0.005||ut - ut-1|l</td></tr><tr><td>Stacking</td><td>1dt(01,e)>0.02(-750△t(01,e) 250△t(01,g1)) + -9,21)- 10,z-9,z>0125△t(02,x,y,92,x,y))-0.005|lut - vt-i|l</td></tr></table>
|
| 290 |
+
|
| 291 |
+
Table 4: Description of the dense rewards applied in our experiments. The following notation was applied: $v ^ { t } \in \hat { \mathbf { R } ^ { 3 } }$ joint velocities, $e _ { i } ^ { t } \in \mathbf { R } ^ { 3 }$ i-th end-effector positions, $o _ { i } ^ { t } \in \mathbf { R } ^ { 3 }$ i-th block position, ${ \bar { g } } _ { i } ^ { \bar { t } } \in \mathbf { R } ^ { 3 }$ i-th goal block position, $\begin{array} { r } { d ^ { t } \dot { ( } o , e ) = \sum _ { i } | | e _ { i } ^ { t } - o ^ { t } | | } \end{array}$ the distance between end-effectors and the block, $\Delta _ { o , e } ^ { t } = d ^ { t } ( o , e ) - d ^ { t - 1 } ( o , e )$ the distance difference w.r.t. the previous timestep. The target height parameter $t$ for pick and place is 0.15 if block and goal are of different height. Otherwise, $t$ is half the goal height.
|
| 292 |
+
|
| 293 |
+
# D TRAINING DETAILS
|
| 294 |
+
|
| 295 |
+
The experiments were carried out using the stable baselines implementation of PPO, SAC and TD3. We used a 2 layer MLP Policy [256,256] for all the policies. PPO was trained on 20 workers up to 100 million timesteps in parallel and SAC as well as TD3 were trained serially for 10 million timesteps.
|
| 296 |
+
|
| 297 |
+
Table 5: Learning algorithms hyper parameters used in the baselines experiments.
|
| 298 |
+
|
| 299 |
+
<table><tr><td rowspan=1 colspan=6>PPO SAC TD3</td></tr><tr><td rowspan=8 colspan=1>discountbatch sizelearning rateentropy coef.value function coef.gradient clipping (max)n minibatches per updaten training epochs</td><td rowspan=4 colspan=1>0.991200002.5e-40.01</td><td rowspan=1 colspan=1>discount</td><td rowspan=1 colspan=1>0.95</td><td rowspan=1 colspan=1>discount</td><td rowspan=1 colspan=1>0.96</td></tr><tr><td rowspan=1 colspan=1>entropy coeff</td><td rowspan=1 colspan=1>1e-3</td><td rowspan=1 colspan=1>batch size</td><td rowspan=1 colspan=1>128</td></tr><tr><td rowspan=1 colspan=1>batch size</td><td rowspan=1 colspan=1>256</td><td rowspan=1 colspan=1>learning rate</td><td rowspan=3 colspan=1>1e-45000000.02</td></tr><tr><td rowspan=1 colspan=1>learning rate</td><td rowspan=1 colspan=1>1e-4</td><td rowspan=1 colspan=1>buffer size</td></tr><tr><td rowspan=1 colspan=1>0.5</td><td rowspan=1 colspan=1>target entropy</td><td rowspan=1 colspan=1>auto</td><td rowspan=1 colspan=1>tau</td></tr><tr><td rowspan=1 colspan=1>0.5</td><td rowspan=3 colspan=3>buffer size 1000000tau 0.001</td><td rowspan=1 colspan=1>1000000</td></tr><tr><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>tau</td><td rowspan=1 colspan=1>0.001</td><td></td></tr><tr><td rowspan=1 colspan=1>4</td><td></td></tr></table>
|
| 300 |
+
|
| 301 |
+
# radar_plots_automatic_evaluation_causal_world
|
| 302 |
+
|
| 303 |
+

|
| 304 |
+
Figure 10: An example of model selection in CausalWorld by evaluating generalization across the various axes using the previously mentioned protocols. Here we compare two agents trained on different curricula using PPO.
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
Figure 11: Evaluation scores, for pushing, picking, pick and place and stacking2 baselines, from top to bottom respectively. Each protocol was evaluated for 200 episodes and each bar is averaged over five models with different random seeds [bp block pose, bm block mass, bs block size, gp goal pose, ff floor friction].
|
| 308 |
+
|
| 309 |
+
# E CAUSALITY IN REINFORCEMENT LEARNING
|
| 310 |
+
|
| 311 |
+
Definition 1: A partially observable Markov decision processes (POMDP) is defined by the tuple $( S , A , T , R , \Omega , O , \bar { \gamma } , \rho _ { 0 } , \dot { H } )$ with states $s \in S$ , actions $a \in A$ and observations $o \in \Omega$ determined by the state and action of the environment $O ( o | s , a )$ . $T ( s _ { t + 1 } | s _ { t } , a _ { t } )$ is the transition probability distribution function, $R ( s _ { t } , a _ { t } )$ is the reward function, $\gamma$ is the discount factor, $\rho _ { 0 } ( s )$ is the initial state distribution at the beginning of each episode, and $H$ is the time horizon per episode. The objective of RL algorithms is to learn a policy $\pi ( a _ { t } | h _ { t } )$ with history $H _ { t } = ( O _ { 1 } , A _ { 1 } , . . . , A _ { t - 1 } , O _ { t } )$ that maximizes the discounted expected reward $\begin{array} { r } { J ( \pi ) = \mathbb { E } ^ { \pi } \left[ \sum _ { t = 0 } ^ { H } \gamma ^ { t } r _ { t } \right] } \end{array}$ .
|
| 312 |
+
|
| 313 |
+
Definition 2: A structural causal model (SCM) $M$ over $\boldsymbol { X } = ( X _ { 1 } , . . . , X _ { N } )$ is given by a DAG $G$ over nodes $X$ , independent noise RVs $U = ( U _ { 1 } , . . . , U _ { N } )$ with distributions $P _ { U _ { i } }$ and functions $f _ { 1 } , . . . , f _ { N }$ such that $X _ { i } ^ { - } = f _ { i } ( p a _ { i } , U _ { i } )$ , where $p a _ { i } \subset X$ are the parents of $X _ { i }$ in $G$ . An SCM entails a distribution $P$ with density $p$ over $( X , U )$ .
|
| 314 |
+
|
| 315 |
+
Definition 3: An intervention $I$ in an SCM $M$ consists of replacing the RHS $f _ { i } ( p a _ { i } , U _ { i } )$ by $f _ { i } ^ { I } ( p a _ { i } ^ { I } , U _ { i } )$ with $i \subseteq \{ 1 , . . . , N \}$ where $p a _ { i } ^ { I }$ are the parents in a new DAG $G ^ { I }$ . The resulting SCM is denoted with $M ^ { d o ( I ) }$ with distribution $P ^ { d o ( I ) }$ and density $p ^ { d o ( I ) }$ .
|
| 316 |
+
|
| 317 |
+
Representing POMDPs as SCMs: A POMDP can be presented as an SCM $M$ by unrolling the POMDP through time by expressing all conditional distributions, e.g the transition kernel $P _ { S _ { t } + 1 | S _ { t } , A _ { t } }$ , as deterministic functions (which reflects the causal mechanisms of the system) with independent noise variables $U$ , such as $S _ { t + 1 } = f _ { s t } ( S _ { t } , A _ { t } , U _ { s t } )$ . This is always possible using autoregressive formalization as shown in (Buesing et al., 2018). The distribution $P ^ { \pi }$ over trajectories $T$ determined by the SCM, which means running a different policy $\mu$ (instead of $\pi$ ) in the environment is an intervention by itself $I ( \pi \to \mu )$ resulting in model distribution $P ^ { d o ( I ( \pi \mu ) ) }$ . Given the SCM, one can reason about the alternative outcomes of different actions or even different environment properties (such as friction) (known as counterfactual inference) which is not possible if we only model the system as a conditional distribution $P _ { O | A , U _ { c } }$ .
|
| 318 |
+
|
| 319 |
+
Generalizing agents: An agent should generalize well to changes in the environment if it achieves an equal performance after an intervention $I$ is performed on the SCM $M$ resulting in $M ^ { d o ( I ) }$ . This can be accomplished for instance as explained in (Scholkopf et al., 2021), by reusing the learned ¨ causal mechanisms. For example, if an intervention was performed on the colour of one of the available blocks in the environment, it won’t change the underlying causal mechanisms. Thus, this sort of interventions on a non causal variable shouldn’t affect the resulting actions of the agent. Nevertheless, this is often not the case with RL agents trained using visual observations. (Alver & Precup, 2020) showed recently that algorithms which were designed specifically for Meta-RL can display strong overfitting when they are evaluated on challenging visual tasks. On the other hand, if an intervention was performed on a causal variable with respect to a policy $\pi$ , such as the mass of an object, the resulting action sequence will be expected to change for robust control. Additionally, if an intervention is performed on some of the goal variables, the reward function might also change and a robust controller should also be able to react to it accordingly.
|
md/train/SkeuexBtDr/SkeuexBtDr.md
ADDED
|
@@ -0,0 +1,398 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING FROM RULES GENERALIZING LABELED EXEMPLARS
|
| 2 |
+
|
| 3 |
+
Abhijeet Awasthi Sabyasachi Ghosh Rasna Goyal Sunita Sarawagi
|
| 4 |
+
|
| 5 |
+
Department of Computer Science and Engineering
|
| 6 |
+
Indian Instiute of Technology Bombay
|
| 7 |
+
Mumbai, Maharashtra 400076, India
|
| 8 |
+
{awasthi,sghosh,goyalrasna,sunita}@cse.iitb.ac.in
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
In many applications labeled data is not readily available, and needs to be collected via pain-staking human supervision. We propose a rule-exemplar method for collecting human supervision to combine the efficiency of rules with the quality of instance labels. The supervision is coupled such that it is both natural for humans and synergistic for learning. We propose a training algorithm that jointly denoises rules via latent coverage variables, and trains the model through a soft implication loss over the coverage and label variables. The denoised rules and trained model are used jointly for inference. Empirical evaluation on five different tasks shows that (1) our algorithm is more accurate than several existing methods of learning from a mix of clean and noisy supervision, and (2) the coupled rule-exemplar supervision is effective in denoising rules.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
With the ever-increasing reach of machine learning, a common hurdle to new adoptions is the lack of labeled data and the pain-staking process involved in collecting human supervision. Over the years, several strategies have evolved. On the one hand are methods like active learning and crowdconsensus learning that seek to reduce the cost of supervision in the form of per-instance labels. On the other hand is the rich history of rule-based methods (Appelt et al., 1993; Cunningham, 2002) where humans code-up their supervision as labeling rules. There is growing interest in learning from such efficient, albiet noisy, supervision (Ratner et al., 2016; Pal & Balasubramanian, 2018; Bach et al., 2019; Sun et al., 2018; Kang et al., 2018). However, clean task-specific instance labels continue to be critical for reliable results (Goh et al., 2018; Bach et al., 2019) in spite of easy availability of pre-trained models (Sun et al., 2017; Devlin et al., 2018).
|
| 17 |
+
|
| 18 |
+
In this paper we propose a unique blend of cheap coarse-grained supervision in the form of rules and expensive fine-grained supervision in the form of labeled instances. Instead of supervising rules and instance labels independently, we propose that each labeling rule be attached with exemplars of where the rule correctly ’fires’. Thus, the rule can be treated as a noisy generalization of those exemplars. Often rules are coded up only after inspecting data. As a human inspects instances, he labels them, and then generalizes them to rules. Thus, humans provide paired supervision of rules and exemplars demonstrating correct deployment of that rule. We explain further with two illustrative applications. Our examples below are from the text domain because rules have been traditionally used in many NLP tasks, but our learning algorithm is agnostic to how rules are expressed.
|
| 19 |
+
|
| 20 |
+
Sentiment Classification Consider an instance I highly recommend this modest priced cellular phone that a human inspects for a sentiment labeling task. After labeling it as positive, he can easily generalize it to a rule Contains ’highly recommend’ positive label. This rule generalizes to several more instances, thereby eliminating the need of per-instance labeling on those. However, the label assigned by this rule on unseen instances may not be as reliable as the explicit label on this specific exemplar it generalized. For example, it misfires on I would highly recommend this phone if it weren’t for their poor service.
|
| 21 |
+
|
| 22 |
+
Slot-filling Consider a slot-filling task on restaurant reviews over labels like cuisine, location, and time. When an annotator sees an instance like: what chinese restaurants in this city have good reviews?, after labeling token chinese as cuisine, he generalizes it to a rule: (.\*ese|.\*ian|mexican) restaurants (cuisine) restaurants. This rule matches hundreds of instances in the unlabeled set, but could wrongly label a phrase like these restaurants. Our focus in this paper is developing algorithms for training models under such coupled rule-exemplar supervision. Our main challenge is that the labels induced by the rules are more noisy than instance-level supervised labels because humans tend to over generalize (Tessler & Goodman, 2019) as we saw in the illustrations above. Learning with noisy labels with or without additional clean data has been a problem of long-standing interest in ML (Khetan et al., 2018; Zhang & Sabuncu, 2018; Ren et al., 2018b; Veit et al., 2017; Shen & Sanghavi, 2019). However, we seek to design algorithms that better capture rule-specific noise with the help of exemplars around which we have supervision that the rule fired correctly. We associate a latent random variable on whether a rule correctly ’covers’ an instance, and jointly learn the distribution among the label and all cover variables. This way we simultaneously train the classifier with corrected rule-label examples, and restrict over-generalized rules. The denoised rules are used during inference to further boost accuracy of the trained model. In summary our contributions in this paper are as follows:
|
| 23 |
+
|
| 24 |
+
Our contributions (1) We propose the paradigm of supervision in the form of rules generalizing labeled exemplars that is natural in several applications. (2) We design a training method that simultaneously denoises over-generalized rules via latent coverage variables, and trains a classification model with a soft implication loss that we introduce. (3) Through experiments on five tasks spanning question classification, spam detection, sequence labeling, and record classification we show that our proposed paradigm of supervision enables an effective synergy between rule-level and instance-level supervision. (4) We compare our algorithm to several recent frameworks for learning with noisy supervision and constraints, and show much better results with our method.
|
| 25 |
+
|
| 26 |
+
# 2 TRAINING WITH RULES AND EXEMPLARS
|
| 27 |
+
|
| 28 |
+
We first formally describe the problem of learning from rules generalizing examplars on a classification task. Let $\mathcal { X }$ denote the space of instances and $\mathcal { V } = \{ 1 , \ldots , K \}$ denote the space of class labels. Let the set of labeled examples be $L = \left\{ ( \mathbf { x } _ { 1 } , \boldsymbol { \ell } _ { 1 } , \boldsymbol { e } _ { 1 } ) , \dots , ( \mathbf { x } _ { n } , \boldsymbol { \ell } _ { n } , \boldsymbol { e } _ { n } ) \right\}$ where $\mathbf { x } _ { i } \in \mathcal { X }$ is an instance, $\ell _ { i } \in \mathcal { V }$ is its user-provided label, and $e _ { i } \in \{ R _ { 1 } , \ldots , R _ { m } , \emptyset \}$ denotes that $\mathbf { x } _ { i }$ is an exemplar for rule $e _ { i }$ . Some labeled instances may not be generalized to rules and for them $e _ { i } = \emptyset$ . Also, a rule can have more than one exemplar associated with it. Each rule $R _ { j }$ could be a blackbox function $R _ { j } : { \bf x } \mapsto \{ \ell _ { j } , \varpi \}$ that takes as input an instance $\mathbf { x } \in \mathcal { X }$ and assigns it either label $\ell _ { j }$ or no-label. When the ith labeled instance is an exemplar for rule $R _ { j }$ (that is, $e _ { i } = R _ { j } $ ), the label of the instance $\ell _ { i }$ should be $\ell _ { j }$ . Additionally, we have a different set of unlabeled instances $U = \{ \mathbf { x } _ { n + 1 } , \dotsc , \mathbf { x } _ { N } \}$ . The cover set $H _ { j }$ of rule $R _ { j }$ is the set of all instances in $U \cup L$ for which $R _ { j }$ assigns a noisy label $\ell _ { j }$ . An instance may be covered by more than one rule or no rule at all, and the labels provided by these rules may be conflicting. Our goal is to train a classification model $P _ { \theta } ( y | \mathbf { x } )$ using $L$ and $U$ to maximize accuracy on unseen test instances. A baseline solution is to use $R _ { j }$ to noisily label the covered $U$ instances using majority or other consensus method of resolving conflicts. We then train $P _ { \theta } ( y | \mathbf { x } )$ on the noisy labels using existing algorithms for learning from noisy and clean labels (Veit et al., 2017; Ren et al., 2018b). However, we expect to be able to do better by learning the systematic pattern of noise in rules along with the classifier $P _ { \theta } ( y | \mathbf { x } )$ .
|
| 29 |
+
|
| 30 |
+
Our noise model on $R _ { j }$ A basic premise of our learning paradigm is that the noise induced by a rule $R _ { j }$ is due to over-generalizing the exemplar(s) seen when creating the rule. And, there exists a smaller neighborhood closer to the exemplar(s) where the noise is zero. We model this phenomenon by associating a latent Bernoulli random variable $r _ { j i }$ for each instance $\mathbf { x } _ { i }$ in the stated cover set $H _ { j }$ of each rule $R _ { j }$ . When $r _ { j i } = 1$ , rule $R _ { j }$ has not over-generalized on $\mathbf { x } _ { i }$ , and there is no noise in the label $\ell _ { j }$ that $R _ { j }$ assigns to $\mathbf { x } _ { i }$ . When $r _ { j i } = 0$ we flag an over-generalization, and abstain from labeling $\mathbf { x } _ { i }$ as $\ell _ { j }$ suspecting it to be too noisy. We call $r _ { j i } \mathrm { s }$ as the latent coverage variables. We propose to learn the distribution of $r _ { j }$ using another network with parameters $\phi$ that outputs the probability $P _ { j \phi } ( r _ { j } | \mathbf { x } )$ that $r _ { j } = 1$ . We then seek to jointly learn $P _ { \boldsymbol { \theta } } ( y | \mathbf { x } )$ and $P _ { j \phi } ( r _ { j } | \mathbf { x } )$ to model the distribution over the true label $y$ and true coverage $r _ { j }$ for each rule $j$ and each $\mathbf { x }$ in $H _ { j }$ . Thus
|
| 31 |
+
|
| 32 |
+
$P _ { j \phi }$ plays the role of restricting a rule $R _ { j }$ so that $r _ { j }$ is not necessarily 1 for all instances in its cover set $H _ { j }$
|
| 33 |
+
|
| 34 |
+
An example We make our discussion concrete with an example. Figure 1 shows a two-dimensional $\mathcal { X }$ space with labeled points $L$ denoted as red crosses and blue circles, unlabeled points as dots, and the true labels as background color of the region. We show two rule-exemplar pairs: $( \mathbf { x } _ { 1 } , y _ { 1 } =$ red, $R _ { 1 }$ ), $( \mathbf { x } _ { 2 } , y _ { 2 } = \mathsf { b l u e } , R _ { 2 } )$ with bold boundaries. Clearly, both rules $R _ { 1 } , R _ { 2 }$ have over-generalized to the wrong region. If we train a classifier with many examples in $H _ { 1 } \cup H _ { 2 }$ wrongly labeled by rules, then even with a noise tolerant loss function like Zhang &
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
Figure 1: Restricting over-generalized rules
|
| 38 |
+
|
| 39 |
+
Sabuncu (2018), the classifier $P _ { \theta } ( y | \mathbf { x } )$ might be misled. In contrast, what we hope to achieve is to learn the $P _ { j \phi } ( r _ { j } | \mathbf { x } )$ distribution using the limited labeled data and the overlap among the rules such that $\mathrm { P r } ( r _ { j } | { \bf \dot { x } } )$ predicts a value of 0 for examples wrongly covered. Such examples are then excluded from training $P _ { \theta }$ . The dashed boundaries indicate the revised boundaries of $R _ { j } \mathrm { s }$ that we can hope to learn based on consensus on the labeled data and the set of rules. Even after such restriction, $R _ { j } \mathrm { s }$ are useful for training the classifier because of the unlabeled points inside the dashed regions that get added to the labeled set.
|
| 40 |
+
|
| 41 |
+
# 2.1 HOW WE JOINTLY LEARN $P _ { \theta }$ AND $P _ { j \phi }$
|
| 42 |
+
|
| 43 |
+
In general we will be provided with several rules with arbitrary overlap in the set of labeled $L$ and unlabeled examples $U$ that they cover. Intuitively, we want the label distribution $P _ { \theta } ( y | \mathbf { x } )$ to correctly restrict the coverage distribution $P _ { j \phi } ( r _ { j } | \mathbf { x } )$ , which in turn can provide clean labels to instances in $U$ that can be used to train $P _ { \boldsymbol { \theta } } ( y | \mathbf { x } )$ . We have two types of supervision in our setting. First, individually for each of $P _ { \theta } ( y | \mathbf { x } )$ and $P _ { j \phi } ( r _ { j } | \mathbf { x } )$ we have ground truth values of $y$ and $r _ { j }$ for some instances. For the $P _ { \theta } ( y | \mathbf { x } )$ distribution, supervision on $y$ is provided by the human labeled data $L$ , and we use these to define the usual log-likelihood as one term in our training objective:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\operatorname* { m a x } _ { \theta } L L ( \theta ) = \operatorname* { m a x } _ { \theta } \sum _ { ( \mathbf { x } _ { i } , \ell _ { i } ) \in L } \log P _ { \theta } ( \ell _ { i } | \mathbf { x } _ { i } )
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
For learning the distribution $P _ { j \phi } ( r _ { j } | \mathbf { x } )$ over the coverage variables, the only sure-shot labeled data is that $r _ { j i } = 1$ for any $\mathbf { x } _ { i }$ that is an exemplar of rule $R _ { j }$ and $r _ { j i } = 0$ for any $\mathbf { x } _ { i } \in H _ { j }$ whose label $\ell _ { i }$ is different from $\ell _ { j }$ . For other labeled instances $\mathbf { x } _ { i }$ covered with rules $R _ { j }$ with agreeing labels, that is $\ell _ { i } = \ell _ { j }$ we do not strictly require that $r _ { j i } = 1$ . In the example above the corrected dashed red boundary excludes a red labeled point to reduce its noise on other points. However, if the number of labeled exemplars are too few, we regularize the networks towards more rule firings, by adding a noise tolerant $r _ { j i } = 1$ loss on the instances with agreeing labels. We use the generalized cross entropy loss of Zhang & Sabuncu (2018).
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\begin{array} { r } { L L ( \phi ) = \displaystyle \sum _ { ( \mathbf { x } _ { i } , \ell _ { i } , e _ { i } ) \in L } ( \log P _ { e _ { i } \phi } ( r _ { e _ { i } i } = 1 | \mathbf { x } _ { i } ) + \sum _ { j : \mathbf { x } _ { i } \in H _ { j } \wedge \ell _ { i } \neq \ell _ { j } } \log P _ { j \phi } ( r _ { j i } = 0 | \mathbf { x } _ { i } ) } \\ { \displaystyle - \sum _ { j : \mathbf { x } _ { i } \in H _ { j } \wedge \ell _ { i } = \ell _ { j } } \mathrm { G e n e r a l i z e d - X E N T } ( P _ { j \phi } ( r _ { j } | \mathbf { x } _ { i } ) , r _ { j i } = 1 ) ) } \end{array}
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
Note for other instances $\mathbf { x } _ { i }$ in $R _ { j }$ ’s cover $H _ { j }$ , value of $r _ { j i }$ is unknown and latent. The second type of supervision is on the relationship between $r _ { j i }$ and $y _ { i }$ for each $\mathbf { x } _ { i } \in H _ { j }$ . A rule $R _ { j }$ imposes a causal constraint that when $r _ { j i } = 1$ , the label $y _ { i }$ has to be $\ell _ { j }$ .
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
r _ { j i } = 1 \implies y _ { i } = \ell _ { j } \quad \forall \mathbf { x } _ { i } \in H _ { j }
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
We convert this hard constraint into a (log) probability of the constraint being satisfied under the $P _ { \theta } ( y | \mathbf { x } )$ and $P _ { j \phi } ( r _ { j } | \mathbf { x } )$ distributions as:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\log \big ( 1 - P _ { j \phi } ( r _ { j } = 1 | \mathbf { x } ) ( 1 - P _ { \theta } ( \ell _ { j } | \mathbf { x } ) ) \big )
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
Figure 2 shows a surface plot of the above log probability as a function of $P _ { \theta } ( \boldsymbol { \ell } _ { j } | \mathbf { x } )$ (shown as axis $\mathrm { P ( y ) }$ in figure) and $P _ { j \phi } ( r _ { j } ~ = ~ 1 | \mathbf { x } )$ (shown as axis $\mathrm { P ( r ) }$ in figure) for a single rule.
|
| 68 |
+
|
| 69 |
+
Observe that likelihood drops sharply as $P ( r _ { j } | \mathbf { x } )$ is close to 1 but $P ( y = \ell _ { j } | \mathbf { x } )$ is close to zero. For all other values of these probabilities the log-likelihood is flat and close to zero. Specifically, when $P _ { j \phi }$ predicts low values of $r _ { j }$ for a $\mathbf { x }$ , the log-likelihood surface is flat, effectively withdrawing the $( \mathbf { x } , \boldsymbol { \ell } _ { j } )$ supervision from training the classifier $P _ { \theta }$ . Thus maximizing this likelihood provides a soft enforcement of the constraint without unwanted biases. We call this the negative implication loss.
|
| 70 |
+
|
| 71 |
+
We do not need to explicitly model the conflict among rules, that is when an $\mathbf { x } _ { i }$ is covered by two rules $R _ { j }$ and $R _ { k }$ of differing labels $( \ell _ { j } \neq$ $\ell _ { k } )$ , then both $r _ { j i }$ and $r _ { k i }$ cannot be 1. This is
|
| 72 |
+
|
| 73 |
+

|
| 74 |
+
Figure 2: Negative implication loss
|
| 75 |
+
|
| 76 |
+
because the constraint among pairs $( y _ { i } , r _ { j i } )$ and $( y _ { i } , r _ { k i } )$ as stated in Equation 3 subsumes this one.
|
| 77 |
+
|
| 78 |
+
During training we then seek to maximize the log of the above probability along with normal data likelihood terms. Putting the terms in Equations $1 , 2$ and 4 together our final training objective is:
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\underset { \theta , \phi } { \operatorname* { m i n } } - L L ( \theta ) - L L ( \phi ) - \gamma \sum _ { j ; \mathbf { x } \in H _ { j } \cap U } \log ( 1 - P _ { j \phi } ( r _ { j } = 1 | \mathbf { x } ) ( 1 - P _ { \theta } ( \ell _ { j } | \mathbf { x } ) ) )
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
We refer to our training loss as a denoised rule-label implication loss or ImplyLoss for short. The $L L ( \phi )$ term seeks to denoise rule coverage which then influence the $y$ distribution via the implication loss. We explored several other methods of enforcing the constraint among $y$ and $r _ { j }$ in the training of the $P _ { \theta }$ and $P _ { j \phi }$ networks. Our method ImplyLoss consistently performed the best among several methods we tried including the recent posterior regularization (Ganchev et al., 2010; Hu et al., 2016) method of enforcing soft constraints and co-training (Blum & Mitchell, 1998).
|
| 85 |
+
|
| 86 |
+
Network Architecture Our network has three modules. (1) A shared embedding layer that provides the feature representation of the input. When labeled data is scarce, this will typically be a pre-trained layer from a related task. The embedding module is task-specific and is described in the experiment section. (2) A classification network that models $P _ { \boldsymbol { \theta } } ( y | \mathbf { x } )$ with parameters $\theta$ . The embedding of an input $\mathbf { x }$ is passed through multiple non-linear layers with ReLU activation, a last linear layer followed by Softmax to output a distribution over the class labels. (3) A rule network that models $P _ { j \phi } ( r _ { j } = \dot { 1 } | \mathbf { x } )$ whose parameters $\phi$ are shared across all rules. The input to the network is rule-specific and concatenates the embedding of the input instance $\mathbf { x }$ , and a one-hot encoding of the rule id $\because j ^ { \prime }$ . The input is passed through multiple non-linear layers with ReLU activation before passing through a Sigmoid activation which outputs the probability $P _ { j \phi } ( r _ { j } = 1 | \mathbf { x } )$ .
|
| 87 |
+
|
| 88 |
+
Inference During prediction, joint inference over the label $y$ and coverage variables $r _ { j }$ provides slight gains over depending solely on $P _ { \theta } ( y | \mathbf { x } )$ . For any test example $\mathbf { x }$ , consider the set of rules $G$ covering $\mathbf { x }$ such that $P _ { j \phi } ( 1 | \mathbf { x } ) > 0 . 5$ . Probabilities from the label and coverage variables are combined to obtain a score $s ( y )$ for each label $y$ as:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
s ( y | \mathbf x ) = P _ { \theta } ( y | \mathbf x ) + \frac { \sum _ { R _ { j } \in G } \delta ( \ell _ { j } = y ) P _ { j \phi } ( 1 | \mathbf x ) + \delta ( \ell _ { j } \neq y ) P _ { j \phi } ( 0 | \mathbf x ) } { | G | }
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
The above can be viewed as a soft voting over the trained classifier $P _ { \theta }$ and labels provided by rules with uncertain coverage. Because we also learned to denoise rules along with training the classifier, the labels assigned by the rules have higher precision than original rules.
|
| 95 |
+
|
| 96 |
+
# 3 EXPERIMENTS
|
| 97 |
+
|
| 98 |
+
We compare our training algorithms against simple baselines, existing error-tolerant learning algorithms, and existing constraint-based learning in deep networks.
|
| 99 |
+
|
| 100 |
+
We evaluate across five datasets spanning three task types: text classification, sequence labeling, and record classification. We augment the datasets with rules, that we obtained manually in three cases, from pre-existing public sources in one case, and automatically in another. Table 1 presents statistics summarizing the datasets and rules. A brief description of each appears below.
|
| 101 |
+
|
| 102 |
+
<table><tr><td rowspan=1 colspan=1>Dataset</td><td rowspan=1 colspan=1>L</td><td rowspan=1 colspan=1>[U|</td><td rowspan=1 colspan=1>#Rules</td><td rowspan=1 colspan=1>%Cover</td><td rowspan=1 colspan=1>Precision</td><td rowspan=1 colspan=1>%Conflict</td><td rowspan=1 colspan=1>Avg|Hjl</td><td rowspan=1 colspan=1>#RulesPer In-stance</td><td rowspan=1 colspan=1>[Valid]</td><td rowspan=1 colspan=1>[Test]</td></tr><tr><td rowspan=1 colspan=1>Question</td><td rowspan=1 colspan=1>68</td><td rowspan=1 colspan=1>4884</td><td rowspan=1 colspan=1>68</td><td rowspan=1 colspan=1>95</td><td rowspan=1 colspan=1>63.8</td><td rowspan=1 colspan=1>22.5</td><td rowspan=1 colspan=1>124</td><td rowspan=1 colspan=1>1.8</td><td rowspan=1 colspan=1>500</td><td rowspan=1 colspan=1>500</td></tr><tr><td rowspan=1 colspan=1>MIT-R</td><td rowspan=1 colspan=1>1842</td><td rowspan=1 colspan=1>64888</td><td rowspan=1 colspan=1>15</td><td rowspan=1 colspan=1>14</td><td rowspan=1 colspan=1>80.7</td><td rowspan=1 colspan=1>2.5</td><td rowspan=1 colspan=1>634</td><td rowspan=1 colspan=1>1.1</td><td rowspan=1 colspan=1>4091</td><td rowspan=1 colspan=1>14256</td></tr><tr><td rowspan=1 colspan=1>SMS</td><td rowspan=1 colspan=1>69</td><td rowspan=1 colspan=1>4502</td><td rowspan=1 colspan=1>73</td><td rowspan=1 colspan=1>40</td><td rowspan=1 colspan=1>97.3</td><td rowspan=1 colspan=1>0.6</td><td rowspan=1 colspan=1>31</td><td rowspan=1 colspan=1>1.3</td><td rowspan=1 colspan=1>500</td><td rowspan=1 colspan=1>500</td></tr><tr><td rowspan=1 colspan=1>YouTube</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>1586</td><td rowspan=1 colspan=1>10</td><td rowspan=1 colspan=1>87</td><td rowspan=1 colspan=1>78.6</td><td rowspan=1 colspan=1>30.2</td><td rowspan=1 colspan=1>258</td><td rowspan=1 colspan=1>1.9</td><td rowspan=1 colspan=1>120</td><td rowspan=1 colspan=1>250</td></tr><tr><td rowspan=1 colspan=1>Census</td><td rowspan=1 colspan=1>83</td><td rowspan=1 colspan=1>10000</td><td rowspan=1 colspan=1>83</td><td rowspan=1 colspan=1>100</td><td rowspan=1 colspan=1>84.1</td><td rowspan=1 colspan=1>27.5</td><td rowspan=1 colspan=1>540</td><td rowspan=1 colspan=1>4.5</td><td rowspan=1 colspan=1>5561</td><td rowspan=1 colspan=1>16281</td></tr></table>
|
| 103 |
+
|
| 104 |
+
Table 1: Statistics of datasets and their rules. $\%$ Cover is fraction of instances in $U$ covered by at least one rule. Precision refers to micro precision of rules. Conflict denotes the fraction of instances covered by conflicting rules among all the covered instances. Avg $| H _ { j } |$ is average cover size of a rule in $U$ . Rules Per Instance is average number of rules covering an instance in $U$ .
|
| 105 |
+
|
| 106 |
+
Question Classification (Li & Roth, 2002): This is a TREC-6 dataset to classify a question to one of six categories: $\{$ {Abbreviation, Entity, Description, Human, Location, Numeric-value}. The training set has 5452 instances which are split as 68 for $L$ , 500 for validation, and the remaining as $U$ . Each example in $L$ is generalized as a rule represented by a regular expression. E.g. After labeling How do you throw a housewarming party ? as Description we define a rule
|
| 107 |
+
|
| 108 |
+
More rules in Table 4 of supplementary. Although, creating such 68 generalised rules required 90 minutes, the generalizations cover 4637 instances in $U$ , almost two orders of magnitude more instances than in $L !$ On an average each of our rule covered 124 instances $( | H _ { j } |$ column in Table 1). But the precision of labels assigned by rules was only $6 3 . 8 \%$ . $2 2 . 5 \%$ of covered instances had an inter-rule conflict, demonstrating noise in the rule labelings. Accuracy is used as the performance metric.
|
| 109 |
+
|
| 110 |
+
MIT- ${ \bf R } ^ { 1 }$ (Liu et al., 2013): This is a slot-filling task on sentences about restaurant search and the task is to label each token as one of {Location, Hours, Amenity, Price, Cuisine, Dish, Restaurant Name, Rating, Other}. The training data is randomly split into 200 sentences (1842 tokens) as $L$ , 500 sentences (4k tokens) as validation and remaining $6 . 9 \mathrm { k }$ sentences $( 6 4 . 9 \mathrm { k }$ tokens) as $U$ . We manually generalize 15 examples in $L$ . E.g. After inspecting the sentence where can i get the highest rated burger within ten miles and labeling highest rated as Rating, we provide the rule:
|
| 111 |
+
|
| 112 |
+
. ∗ (highly|high|good|top|highest)(rate|rating|rated). $* $ Rating to the matched positions. More examples in Table 7 of supplementary. Although, creating 15 generalizing rules took 45 minutes of annotator effort, the rules covered roughly $9 \mathrm { k }$ tokens in $U$ . F1 metric is used for evaluation on the default test set of $1 4 . 2 \mathrm { k }$ tokens over $1 . 5 \mathrm { k }$ sentences.
|
| 113 |
+
|
| 114 |
+
SMS Spam Classification (Almeida et al., 2011): This dataset contains $5 . 5 \mathrm { k }$ text messages labeled as spam/not-spam, out of which 500 were held out for validation and 500 for testing. We manually generalized 69 exemplars to rules. Remaining examples go in the $U$ set. The rules here check for presence of keywords or phrases in the SMS . $\star$ guaranteed gift . $\star s _ { \mathrm { P } } \mathsf { a m }$ . A rule covers 31 examples on an average and has a precision of $9 7 . 3 \%$ . However, in this case only $40 \%$ of the unlabeled set is covered by a rule. We report F1 here since class is skewed. More examples in Table 5 of supplementary.
|
| 115 |
+
|
| 116 |
+
Youtube Spam Classification (Alberto et al., 2015): Here the task is to classify comments on YouTube videos as Spam or Not-Spam. We obtain this from Snorkel’s Github page2, which provides 10 labeling functions which we use as rules, an unlabeled train set which we use as $U$ , a labeled dev set to guide the creation of their labeling functions which we use as $L$ , and labeled test and validation sets which we use in the same roles. Their labeling functions have a large coverage (258 on average), and a precision of $78 . 6 \%$ .
|
| 117 |
+
|
| 118 |
+
Census Income (Dua & Graff, 2019): This UCI dataset is extracted from the 1994 U.S. census. It lists a total of 13 features of an individual such as age, education level, marital status, country of origin etc. The primary task on it is binary classification - whether a person earns more than $\$ 50\mathrm { K }$ or not. The train data consists of 32563 records. We choose 83 random data points as $L$ , 10k points as $U$ and 5561 points as validation data. For this case we created the rules synthetically as follows: We hold out disjoint 16k random points from the training dataset as a proxy for human knowledge and extract a PART decision list (Frank & Witten, 1998) from it as our set of rules. We retain only those rules which fire on $L$ .
|
| 119 |
+
|
| 120 |
+
<table><tr><td rowspan=2 colspan=1>Methods</td><td rowspan=1 colspan=5>Datasets</td></tr><tr><td rowspan=1 colspan=1>Question(Accuracy)</td><td rowspan=1 colspan=1>MIT-R(F1)</td><td rowspan=1 colspan=1>YouTube(Accuracy)</td><td rowspan=1 colspan=1>SMS(F1)</td><td rowspan=1 colspan=1>Census(Accuracy)</td></tr><tr><td rowspan=1 colspan=1>Majority (No parameters trained)</td><td rowspan=1 colspan=1>60.9 (0.7)</td><td rowspan=1 colspan=1>40.9 (0.1)</td><td rowspan=1 colspan=1>82.2 (0.9)</td><td rowspan=1 colspan=1>48.4 (1.2)</td><td rowspan=1 colspan=1>80.1 (0.1)</td></tr><tr><td rowspan=1 colspan=1>Only-L</td><td rowspan=1 colspan=1>72.9 (0.6)</td><td rowspan=1 colspan=1>73.5 (0.3)</td><td rowspan=1 colspan=1>90.9 (1.8)</td><td rowspan=1 colspan=1>89.0 (1.6)</td><td rowspan=1 colspan=1>79.4 (0.5)</td></tr><tr><td rowspan=1 colspan=1>L+Umaj</td><td rowspan=1 colspan=1>- 1.4 (1.5)</td><td rowspan=1 colspan=1>+0.0 (0.3)</td><td rowspan=1 colspan=1>+0.8 (1.9)</td><td rowspan=1 colspan=1>+ 3.5 (1.2)</td><td rowspan=1 colspan=1>+ 0.9 (0.1)</td></tr><tr><td rowspan=1 colspan=1>Noise-tolerant (Zhang et al., 2018)</td><td rowspan=1 colspan=1>- 0.5 (1.1)</td><td rowspan=1 colspan=1>+ 0.0 (0.2)</td><td rowspan=1 colspan=1>+ 1.7 (1.1)</td><td rowspan=1 colspan=1>+ 2.9 (1.2)</td><td rowspan=1 colspan=1>+ 1.0 (0.2)</td></tr><tr><td rowspan=1 colspan=1>L2R (Ren et al., 2018b)</td><td rowspan=1 colspan=1>+ 0.3 (2.1)</td><td rowspan=1 colspan=1>- 15.4 (1.0)</td><td rowspan=1 colspan=1>+ 2.5 (0.5)</td><td rowspan=1 colspan=1>+ 2.3 (0.8)</td><td rowspan=1 colspan=1>+ 2.9 (0.3)</td></tr><tr><td rowspan=1 colspan=1>L+Usnorkel (Ratner et al.,2016)</td><td rowspan=1 colspan=1>- 0.7 (3.0)</td><td rowspan=1 colspan=1>+ 0.0 (0.2)</td><td rowspan=1 colspan=1>+ 2.7 (0.7)</td><td rowspan=1 colspan=1>+ 3.5 (1.3)</td><td rowspan=1 colspan=1>+ 1.0 (0.4)</td></tr><tr><td rowspan=1 colspan=1>Snorkel-Noise-Tolerant</td><td rowspan=1 colspan=1>- 1.4 (1.6)</td><td rowspan=1 colspan=1>+0.0 (0.3)</td><td rowspan=1 colspan=1>+2.0 (0.7)</td><td rowspan=1 colspan=1>+ 2.7 (1.5)</td><td rowspan=1 colspan=1>+0.2 (0.5)</td></tr><tr><td rowspan=1 colspan=1>Posterior Reg. (Hu et al., 2016)</td><td rowspan=1 colspan=1>- 0.8 (1.0)</td><td rowspan=1 colspan=1>-0.1 (0.4)</td><td rowspan=1 colspan=1>- 2.9 (1.9)</td><td rowspan=1 colspan=1>+ 1.8 (1.5)</td><td rowspan=1 colspan=1>-0.8 (0.5)</td></tr><tr><td rowspan=1 colspan=1>ImplyLoss (Ours)</td><td rowspan=1 colspan=1>+ 11.7 (1.5)</td><td rowspan=1 colspan=1>+ 0.8 (0.3)</td><td rowspan=1 colspan=1>+ 3.2 (1.1)</td><td rowspan=1 colspan=1>+ 4.2 (1.0)</td><td rowspan=1 colspan=1>+ 1.7 (0.2)</td></tr></table>
|
| 121 |
+
|
| 122 |
+
Table 2: Comparison of ImplyLoss (our method) with various methods (described in Section 3.1) on five different datasets. The numbers reported for all methods after the double-line are gains over the baseline (OnlyL) that does not use rules at all. Higher is better. NOTE: Numbers in brackets represent standard deviation of the original accuracy and not of gains.
|
| 123 |
+
|
| 124 |
+
Network Architecture Since our labeled data is small we depend on pre-trained resources. As the embedding layer we use a pretrained ELMO (Peters et al., 2018) network where 1024 dimensional contextual token embeddings serve as representations of tokens in the MIT-R sentences, and their average serve as representation for sentences in Question and SMS dataset. Parameters of the embedding network are held fixed during training. For sentences in the YouTube dataset, we use Snorkel $\mathrm { s } ^ { 2 }$ architecture of a simple bag-of-words feature representation marking the frequent unigrams and bi-grams present in a sentence using a few-hot vector. For the Census dataset categorical features are represented as one hot vectors, while real valued features are simply normalized. For MIT-R, Question and SMS both classification and rule-weight network contain two 512 dimensional hidden layers with ReLU activation. For Census, both the networks contain two 256 dimensional hidden layers with ReLU activation. For YouTube, the classifier network is a simple logistic regression like in Snorkel’s code. The rule network has one 32-dimensional hidden layer with ReLU activation.
|
| 125 |
+
|
| 126 |
+
Each reported number is obtained by averaging over ten random initializations. Whenever a method involved hyper-parameters to weigh the relative contribution of various terms in the objective, we used a validation dataset to tune the value of the hyper-parameter. Hyperparameters used are provided in Section C of supplementary.
|
| 127 |
+
|
| 128 |
+
# 3.1 COMPARISON WITH DIFFERENT METHODS
|
| 129 |
+
|
| 130 |
+
In Table 2 we compare our method with the following alternatives on each of the five datasets:
|
| 131 |
+
|
| 132 |
+
Majority: that predicts via majority vote among the rules that cover an instance. This baseline indicates the stand-alone quality of rules, no network is learned here. Ties are broken arbitrarily for class-balanced datasets or by using a default class. Table 2, shows that the accuracy of majority is quite poor indicating either poor precision or poor coverage of the rule sets.3.
|
| 133 |
+
|
| 134 |
+
Only-L: Here we train the classifier $P _ { \theta } ( y | \mathbf { x } )$ only on the labeled data $L$ using the standard crossentropy loss (Equation 1). Rule generalisations are not utilized at all in this case. We observe in Table 2 that even with the really small labeled set we used for each dataset, the accuracy of a classifier learned with clean labeled data is much higher than noisy majority labels of rules. We consider this method as our baseline and report the gains on remaining methods.
|
| 135 |
+
|
| 136 |
+
$\mathbf { L + U m a j }$ : Next we train the classifier on $L$ along with $U _ { \mathrm { m a j } }$ obtained by labeling instances in $U$ with the majority label among the rules applicable to the instance. Loss corresponding to the examples labeled by rules is weighted as follows:
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\operatorname* { m i n } _ { \theta } \sum _ { ( \mathbf { x } _ { j } , \ell _ { j } ) \in L } - \log P _ { \theta } ( \ell _ { j } | \mathbf { x } _ { j } ) + \gamma \sum _ { ( \mathbf { x } _ { j } , y _ { j } ) \in U _ { \mathrm { m a j } } } - \log P _ { \theta } ( y _ { j } | \mathbf { x } _ { j } )
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
The row corresponding to $_ \mathrm { L + U m a j }$ in Table 2 provides the gains of this method over Only-L. We observe gains with the noisily labeled $U$ in three out of the five cases.
|
| 143 |
+
|
| 144 |
+
Noise-tolerant: Since labels in $U _ { \mathrm { m a j } }$ are noisy, we next use Zhang & Sabuncu (2018)’s noise tolerant generalized cross entropy loss on them with regular cross-entropy loss on the clean $L$ as follows:
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
\operatorname* { m i n } _ { \theta } \sum _ { ( \mathbf { x } _ { j } , \ell _ { j } ) \in L } - \log P _ { \theta } ( \ell _ { j } | \mathbf { x } _ { j } ) + \gamma \sum _ { ( \mathbf { x } _ { j } , y _ { j } ) \in U _ { \operatorname* { m a j } } } \frac { ( 1 - P _ { \theta } ( y _ { j } | \mathbf { x } ) ) ^ { q } } { q }
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
Parameter $q \in [ 0 , 1 ]$ controls the noise tolerance which we tune as a hyper-parameter. We observe that in three cases minimizing the above objective improves beyond $_ \mathrm { L + U m a j }$ validating that noisetolerant loss functions can be useful for learning from noisy labels on $U _ { \mathrm { m a j } }$ .
|
| 151 |
+
|
| 152 |
+
Learning to Reweight (L2R) (Ren et al., 2018b): is a recent method for training with a mix of clean and noisy labeled data. They train the classifier by meta-learning to re-weight the loss on the noisily labelled instances $( U _ { \mathrm { m a j } } )$ with the help of the clean examples $( L )$ . This method provides significant accuracy gains over Only-L in three out the five datasets. However, it fails in the multiclass classification task of slot-filling which has a very high class imbalance and rules of smaller coverage.
|
| 153 |
+
|
| 154 |
+
All the above methods employ no extra parameters to denoise or weight individual rules. We next compare with a number of methods that do.
|
| 155 |
+
|
| 156 |
+
L+Usnorkel: This method replaces Majority-based consensus with Snorkel’s generative model (Ratner et al., 2016) that assigns weights to rules and labels examples in $U$ . Thereafter we use the same approach as in $_ \mathrm { L + U m a j }$ with just Snorkel’s soft-labels instead of Majority on $U$ . We also compare with using noise-tolerant loss on $U$ labeled by Snorkel (Eqn:8) which we call SnorkelNoise-Tolerant. Like previous methods, both of these methods provide improvements over Only-L on three of the five datasets where the rules are less noisy. $\mathrm { L } +$ Usnorkel performs slightly better than Noise-Tolerant on $U _ { \mathrm { m a j } }$ .
|
| 157 |
+
|
| 158 |
+
We next compare with a method that simultaneously learns two sets of networks $P _ { \theta }$ and $P _ { j \phi }$ like ours but with different loss function and training schedule.
|
| 159 |
+
|
| 160 |
+
Posterior Regularization (PR): This method proposed in Hu et al. (2016) also treats rules as softconstraints and has been used for training neural networks for structured outputs. They use Ganchev et al. (2010)’s posterior regularization framework to train the two networks in a teacher-student setup. We adapt the same framework and get a procedure as follows: The student proposes a distribution over $y$ and $r _ { j } \mathbf { s }$ using current $P _ { \theta }$ and $P _ { j \phi }$ , the teacher uses the constraint in Eq 3 to revise the distributions so as to minimize the probability of violations, the student updates parameters $\theta$ and $\phi$ to minimize KL distance with the revised distribution. The detailed formulation appear in the Section A of supplementary. We find that this method is no better than Only- $\mathrm { . L }$ in most of the cases and worse than the noise-tolerant method that does not train extra $\phi$ parameters.
|
| 161 |
+
|
| 162 |
+
ImplyLoss(Ours): Overall our approach of training with denoised rule-label implication loss provides much better accuracy than all the above eight methods and we get consistent gains over Only-L on all datasets. On the Question dataset we get 11.7 points gain over Only-L whereas the best gain by existing method was 0.3. A useful property of our method compared to the PR method above is that the training process is simple and fits into the batch stochastic gradient training template. In contrast, PR requires special alternating computations. We next perform a number of diagnostics experiments to explain the reasons for the superior performance of our method.
|
| 163 |
+
|
| 164 |
+
Diagnostics: Effectiveness of learning true coverage via $P _ { j \phi }$ An important part of our method is the rule-specific denoising learned via the $P _ { j \phi }$ network. In the chart alongside we plot the original precision of rules on the test data, and the precision after suppressing those rule labelings where $P _ { j \phi } ( r _ { j } | \mathbf { x } )$ predicts 0 instead of 1. Observe now that the precision is more than $91 \%$ on all datasets. For the Question dataset, the precision jumped from $64 \%$ t o $98 \%$ . The percentage of labelings suppressed (shown by the dashed line) is higher on datasets with noisier rules (e.g. compare Question and
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 3: Rule-specific denoising by our method.
|
| 168 |
+
|
| 169 |
+
SMS). This shows that $P _ { j \phi }$ is able to denoise rules by capturing the distribution of the latent true coverage variables with the limited $L L ( \phi )$ loss and indirectly via the implication loss.
|
| 170 |
+
|
| 171 |
+
Effect of rule precision Rules in the Census dataset are of higher quality in terms of precision as well as coverage. Superior performance of the L2R method on this dataset motivated us to inspect how well our method performs on the same dataset in the absence of high precision rules. We created four new versions of the rule sets by successively removing high precision rules from the original rule set. We observe that our method performs better than L2R when rules have low precision. Because ImplyLoss denoises rules, it is better able to handle low-precision rules.
|
| 172 |
+
|
| 173 |
+

|
| 174 |
+
Figure 4: Effect of rule precision
|
| 175 |
+
|
| 176 |
+
Role of Exemplars in Rules We next evaluate the importance of the exemplar-rule pairs in learning the $P _ { j \phi }$ and $P _ { \theta }$ networks. The exemplars of a rule give an interesting new form of supervision about an instance where a labeling rule must fire. To evaluate the importance of this supervision, we exclude the $r _ { j } ~ = ~ 1$ likelihood on rule-exemplar pairs from $L L ( \phi )$ , that is, the first term in Equation 2 is dropped. In the table below we see that performance of ImplyLoss usually drops when the exemplar-rule supervision is removed. Interestingly, even after this drop, the performance of ImplyLoss surpasses most of the methods in Table 2 indicating that even without exemplar-rule pairs our training objective is effective in learning from rules and labeled instances.
|
| 177 |
+
|
| 178 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Question</td><td rowspan=1 colspan=1>MIT-R</td><td rowspan=1 colspan=1>SMS</td><td rowspan=1 colspan=1>Census</td></tr><tr><td rowspan=1 colspan=1>rj = 1 for rule-exemplar pairs</td><td rowspan=1 colspan=1>84.5 (1.5)</td><td rowspan=1 colspan=1>73.7 (0.3)</td><td rowspan=1 colspan=1>93.2 (1.0)</td><td rowspan=1 colspan=1>81.0 (0.2)</td></tr><tr><td rowspan=1 colspan=1>No rj =1 for rule-exemplar pairs</td><td rowspan=1 colspan=1>83.8 (0.7)</td><td rowspan=1 colspan=1>73.5 (0.5)</td><td rowspan=1 colspan=1>93.5 (1.2)</td><td rowspan=1 colspan=1>80.8 (0.3)</td></tr></table>
|
| 179 |
+
|
| 180 |
+
Table 3: Effect of removing rule-exemplar supervision from $L L ( \phi )$
|
| 181 |
+
|
| 182 |
+
Effect of increasing labeled data $L$ We increase $L$ while keeping the number of rules fixed on the Question dataset. In the attached plot we see the accuracy of our method (ImplyLoss) against Only-L, $\mathrm { L } +$ Usnorkel and Posterior Reg. We observe the expected trend that the gap between the method narrows as labeled data increases.
|
| 183 |
+
|
| 184 |
+
# 4 RELATED WORK
|
| 185 |
+
|
| 186 |
+
Learning from noisily labeled data has been extensively studied in settings like crowdsourcing. One category of these algorithms
|
| 187 |
+
|
| 188 |
+

|
| 189 |
+
Figure 5: Effect of increasing labeled data
|
| 190 |
+
|
| 191 |
+
upper-bound the loss function to make it robust to noise. These include methods like MAE (Ghosh et al., 2017), Generalized Cross Entropy (CE)(Zhang & Sabuncu, 2018), and Ramp loss (Collobert et al., 2006). Most of these assume that noise is independent of the input given the true label. In our model noise is systematic and instance-dependent.
|
| 192 |
+
|
| 193 |
+
A second category assume that a small clean dataset is available along with noisily labeled data. This is also true in our case, and we compared with a state of the art method in that category Ren et al. (2018b) that chooses a descent direction that aligns with a clean validation set using metalearning. Others in this category include: Shen & Sanghavi (2019)’s method of iteratively selecting examples with smallest loss, and Veit et al. (2017)’s method of learning a separate network to transform noisy labels to cleaned ones which are used to impose a cross-entropy loss on $P _ { \theta } ( y | \mathbf { x } )$ . In contrast, we perform rule-specific cleaning via latent coverage variables and a flexible implication loss which withdraws $y$ supervision when $P _ { j \phi } ( r _ { j i } | \mathbf { x } )$ assumes low values. Another way of relating clean and noisy labels is via an instance-independent confusion matrix learned jointly with the classifier (Khetan et al., 2018; Goldberger & Ben-Reuven, 2016; Han et al., 2018b;a). These works assume that the confusion matrix is instance independent, which does not hold for our case. Tanaka et al. (2018) uses confidence from the classifier to eliminate noise but they need to ensure that the network does not memorize noise. Our learning setup also has the advantage of extracting confidence from a different network. There is growing interest in integrating logical rules with labeled examples for training networks, specifically for structured outputs (Manhaeve et al., 2018; Xu et al., 2018; Fischer et al., 2019; Sun et al., 2018; Ren et al., 2018a). Xu et al. (2018); Fischer et al. (2019) convert rules on output nodes of network, to (almost differentiable) loss functions during training. The primary difference of these methods from ours is that they assume that rules are correct whereas we assume them to be noisy. Accordingly, we simultaneously correct the rules and use them to improve the classifier, whereas they use the rules as-is to train the network outputs.
|
| 194 |
+
|
| 195 |
+
A well-known framework for working with soft rules is posterior regularization (Ganchev et al., 2010) which is used in Hu et al. (2016) to train deep structured output networks while harnessing logic rules. Ratner et al. (2016) works only with noisy rules treating them as black-box labeling functions and assigns a linear weight to each rule based on an agreement objective. Our learning model is more powerful that attempts to learn a non-linear network to restrict rule boundaries rather than just weight their outputs. We presented a comparison with both these approaches in the experimental section, and showed superior performance.
|
| 196 |
+
|
| 197 |
+
To the best of our knowledge, our proposed paradigm of coupled rule-exemplar supervision is novel, and our proposed training algorithm is able to harness them in ways not possible by existing frameworks for learning from rules or noisy supervision.
|
| 198 |
+
|
| 199 |
+
# 5 CONCLUSION
|
| 200 |
+
|
| 201 |
+
We proposed a new rule-exemplar model for collecting human supervision to combine the scalability of top-level rules with the quality of instance-level labels. We show that such supervision is natural since humans typically inspect examples to code rules. Furthermore, such coupled examples provide supervision on correct firing of rules which help to denoise rules. We propose to train the classifier while jointly denoising rules via latent coverage variables imposing a soft-implication constraint on the true label. Empirically on five datasets we show that our training algorithm that performs rule-specific denoising is better than generic noise-tolerant learning. In future we plan to deploy this framework on other applications where human supervision is a scarce resource.
|
| 202 |
+
|
| 203 |
+
Reproducibility Code and Data for the experiments available at https://github.com/awasthiabhijeet/Learning-From-Rules
|
| 204 |
+
|
| 205 |
+
Acknowledgements We thank the anonymous reviewers for their constructive feedback on this work. This research was partly sponsored by a Google India AI/ML Research Award and partly by the IBM AI Horizon Networks - IIT Bombay initiative. Abhijeet is supported by Google PhD Fellowship in Machine Learning.
|
| 206 |
+
|
| 207 |
+
# REFERENCES
|
| 208 |
+
|
| 209 |
+
Tulio C Alberto, Johannes V Lochter, and Tiago A Almeida. Tubespam: Comment spam filtering ´ on youtube. In 2015 IEEE 14th International Conference on Machine Learning and Applications (ICMLA), pp. 138–143. IEEE, 2015.
|
| 210 |
+
|
| 211 |
+
Tiago A Almeida, Jose Mar ´ ´ıa G Hidalgo, and Akebo Yamakami. Contributions to the study of sms spam filtering: new collection and results. In Proceedings of the 11th ACM symposium on Document engineering, pp. 259–262. ACM, 2011.
|
| 212 |
+
|
| 213 |
+
Douglas E. Appelt, Jerry R. Hobbs, John Bear, David J. Israel, and Mabry Tyson. Fastus: A finitestate processor for information extraction from real-world text. In IJCAI, pp. 1172–1178, 1993.
|
| 214 |
+
|
| 215 |
+
Stephen H. Bach, Daniel Rodriguez, Yintao Liu, Chong Luo, Haidong Shao, Cassandra Xia, Souvik Sen, Alexander Ratner, Braden Hancock, Houman Alborzi, Rahul Kuchhal, Christopher Re, and ´ Rob Malkin. Snorkel drybell: A case study in deploying weak supervision at industrial scale. In Proceedings of the 2019 International Conference on Management of Data, SIGMOD Conference 2019, Amsterdam, The Netherlands, June 30 - July 5, 2019., pp. 362–375, 2019.
|
| 216 |
+
|
| 217 |
+
Avrim Blum and Tom Mitchell. Combining labeled and unlabeled data with co-training. In COLT, 1998.
|
| 218 |
+
|
| 219 |
+
R. Collobert, F. Sinz, J. Weston, and L. Bottou. Trading convexity for scalability. In ICML 2006, 2006.
|
| 220 |
+
|
| 221 |
+
Hamish Cunningham. Gate: A framework and graphical development environment for robust nlp tools and applications. In Proc. 40th Annual Meeting of the Association for Computational Linguistics (ACL 2002), pp. 168–175, 2002.
|
| 222 |
+
|
| 223 |
+
Arthur P Dempster, Nan M Laird, and Donald B Rubin. Maximum likelihood from incomplete data via the em algorithm. Journal of the Royal Statistical Society: Series B (Methodological), 39(1): 1–22, 1977.
|
| 224 |
+
|
| 225 |
+
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.
|
| 226 |
+
|
| 227 |
+
Dheeru Dua and Casey Graff. UCI machine learning repository, 2019. URL http://archive.ics.uci. edu/ml.
|
| 228 |
+
|
| 229 |
+
Marc Fischer, Mislav Balunovic, Dana Drachsler-Cohen, Timon Gehr, Ce Zhang, and Martin Vechev. DL2: Training and querying neural networks with logic. In Proceedings of the 36th International Conference on Machine Learning, pp. 1931–1941, 2019.
|
| 230 |
+
|
| 231 |
+
Eibe Frank and Ian H. Witten. Generating accurate rule sets without global optimization. In J. Shavlik (ed.), Fifteenth International Conference on Machine Learning, pp. 144–151. Morgan Kaufmann, 1998.
|
| 232 |
+
|
| 233 |
+
Kuzman Ganchev, Jennifer Gillenwater, Ben Taskar, et al. Posterior regularization for structured latent variable models. Journal of Machine Learning Research, 11(Jul):2001–2049, 2010.
|
| 234 |
+
|
| 235 |
+
Aritra Ghosh, Himanshu Kumar, and PS Sastry. Robust loss functions under label noise for deep neural networks. In Thirty-First AAAI Conference on Artificial Intelligence, 2017.
|
| 236 |
+
|
| 237 |
+
Garrett B. Goh, Charles Siegel, Abhinav Vishnu, and Nathan Hodas. Using rule-based labels for weak supervised learning: A chemnet for transferable chemical property prediction. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD ’18, 2018.
|
| 238 |
+
|
| 239 |
+
Jacob Goldberger and Ehud Ben-Reuven. Training deep neural-networks using a noise adaptation layer. 2016.
|
| 240 |
+
|
| 241 |
+
Bo Han, Jiangchao Yao, Gang Niu, Mingyuan Zhou, Ivor Tsang, Ya Zhang, and Masashi Sugiyama. Masking: A new perspective of noisy supervision. In Advances in Neural Information Processing Systems, pp. 5841–5851, 2018a.
|
| 242 |
+
|
| 243 |
+
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 31, pp. 8536–8546. 2018b.
|
| 244 |
+
|
| 245 |
+
Zhiting Hu, Xuezhe Ma, Zhengzhong Liu, Eduard Hovy, and Eric Xing. Harnessing deep neural networks with logic rules. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), August 2016.
|
| 246 |
+
|
| 247 |
+
Dongyeop Kang, Tushar Khot, Ashish Sabharwal, and Eduard Hovy. Adventure: Adversarial training for textual entailment with knowledge-guided examples. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers). Association for Computational Linguistics, 2018.
|
| 248 |
+
|
| 249 |
+
Ashish Khetan, Zachary C. Lipton, and Anima Anandkumar. Learning from noisy singly-labeled data. In International Conference on Learning Representations, 2018. URL https://openreview. net/forum?id=H1sUHgb0Z.
|
| 250 |
+
|
| 251 |
+
Xin Li and Dan Roth. Learning question classifiers. In Proceedings of the 19th international conference on Computational linguistics-Volume 1, pp. 1–7. Association for Computational Linguistics, 2002.
|
| 252 |
+
|
| 253 |
+
Jingjing Liu, Panupong Pasupat, Yining Wang, Scott Cyphers, and Jim Glass. Query understanding enhanced by hierarchical parsing structures. In 2013 IEEE Workshop on Automatic Speech Recognition and Understanding, pp. 72–77. IEEE, 2013.
|
| 254 |
+
|
| 255 |
+
Robin Manhaeve, Sebastijan Dumancic, Angelika Kimmig, Thomas Demeester, and Luc De Raedt. Deepproblog: Neural probabilistic logic programming. In Advances in Neural Information Processing Systems 31, pp. 3749–3759. 2018.
|
| 256 |
+
|
| 257 |
+
Arghya Pal and Vineeth N. Balasubramanian. Adversarial data programming: Using gans to relax the bottleneck of curated labeled data. In 2018 IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2018, Salt Lake City, UT, USA, June 18-22, 2018, pp. 1556–1565, 2018.
|
| 258 |
+
|
| 259 |
+
Matthew E Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. arXiv preprint arXiv:1802.05365, 2018.
|
| 260 |
+
|
| 261 |
+
Alexander J Ratner, Christopher M De Sa, Sen Wu, Daniel Selsam, and Christopher Re. Data pro- ´ gramming: Creating large training sets, quickly. In Advances in Neural Information Processing Systems 29. 2016.
|
| 262 |
+
|
| 263 |
+
Hongyu Ren, Russell Stewart, Jiaming Song, Volodymyr Kuleshov, and Stefano Ermon. Learning with weak supervision from physics and data-driven constraints. AI Magazine, 39(1):27–38, 2018a.
|
| 264 |
+
|
| 265 |
+
Mengye Ren, Wenyuan Zeng, Bin Yang, and Raquel Urtasun. Learning to reweight examples for robust deep learning. arXiv preprint arXiv:1803.09050, 2018b.
|
| 266 |
+
|
| 267 |
+
Yanyao Shen and Sujay Sanghavi. Learning with bad training data via iterative trimmed loss minimization. In Proceedings of the 36th International Conference on Machine Learning, pp. 5739– 5748, 2019.
|
| 268 |
+
|
| 269 |
+
Chen Sun, Abhinav Shrivastava, Saurabh Singh, and Abhinav Gupta. Revisiting unreasonable effectiveness of data in deep learning era. In IEEE International Conference on Computer Vision, ICCV 2017, Venice, Italy, October 22-29, 2017, pp. 843–852, 2017.
|
| 270 |
+
|
| 271 |
+
Haitian Sun, William W Cohen, and Lidong Bing. Semi-supervised learning with declaratively specified entropy constraints. In Advances in Neural Information Processing Systems 31, pp. 4425–4435. 2018.
|
| 272 |
+
|
| 273 |
+
Daiki Tanaka, Daiki Ikami, Toshihiko Yamasaki, and Kiyoharu Aizawa. Joint optimization framework for learning with noisy labels. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 5552–5560, 2018.
|
| 274 |
+
|
| 275 |
+
Michael Henry Tessler and Noah D. Goodman. The language of generalization. Psychological Review, 126(3):395–436, 2019.
|
| 276 |
+
|
| 277 |
+
Andreas Veit, Neil Alldrin, Gal Chechik, Ivan Krasin, Abhinav Gupta, and Serge Belongie. Learning from noisy large-scale datasets with minimal supervision. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 839–847, 2017.
|
| 278 |
+
|
| 279 |
+
Jingyi Xu, Zilu Zhang, Tal Friedman, Yitao Liang, and Guy Van den Broeck. A semantic loss function for deep learning with symbolic knowledge. In Proceedings of the 35th International Conference on Machine Learning, pp. 5502–5511, 2018.
|
| 280 |
+
|
| 281 |
+
Zhilu Zhang and Mert Sabuncu. Generalized cross entropy loss for training deep neural networks with noisy labels. In Advances in Neural Information Processing Systems 31. 2018.
|
| 282 |
+
|
| 283 |
+
# Supplementary Material: Learning from Rules Generalizing Labeled Exemplars
|
| 284 |
+
|
| 285 |
+
A POSTERIOR REGULARIZATION METHOD
|
| 286 |
+
|
| 287 |
+
We model a joint distribution $Q ( y , r _ { 1 } , \ldots , r _ { n } | \mathbf { x } )$ to capture the interaction among the label random variable $y$ and coverage random variables $r _ { 1 } , \ldots , r _ { n }$ of any instance $\mathbf { x }$ . We use $\mathbf { r }$ to compactly represent $r _ { 1 } , \ldots , r _ { n }$ . Strictly speaking, when a rule $R _ { j }$ does not cover $\mathbf { x }$ , the $r _ { j }$ is not a random variable and its value is pinned to 0 but we use this fixed-tuple notation for clarity. The random variables $r _ { j }$ and $y$ impose a constraint on the joint distribution $Q$ : for a $\mathbf { x } \in H _ { j }$ when $r _ { j } = 1$ , the label $y$ cannot be anything other than $\ell _ { j }$ .
|
| 288 |
+
|
| 289 |
+
$$
|
| 290 |
+
r _ { j } = 1 \implies y = \ell _ { j } \quad \forall \mathbf { x } \in H _ { j }
|
| 291 |
+
$$
|
| 292 |
+
|
| 293 |
+
We can convert this into a soft constraint on the marginals of the distribution $Q$ by stating the probability of $\begin{array} { r } { \sum _ { y \ne \ell _ { j } } Q ( y , r _ { j } = 1 | \mathbf { x } ) } \end{array}$ should be small.
|
| 294 |
+
|
| 295 |
+
$$
|
| 296 |
+
\operatorname* { m i n } _ { Q } \sum _ { j } \sum _ { { \bf x } \in H _ { j } } \sum _ { y \neq \ell _ { j } } Q ( y , r _ { j } = 1 | { \bf x } )
|
| 297 |
+
$$
|
| 298 |
+
|
| 299 |
+
The singleton marginals of $Q$ along the $y$ and $r _ { j }$ variables are tied to the $P _ { \theta }$ and $P _ { j \phi } ( r _ { j } | \mathbf { x } )$ we seek to learn. A network with parameters $\theta$ models the classifier $P _ { \boldsymbol { \theta } } ( y | \mathbf { x } )$ , and a separate network with $\phi$ variables (shared across all rules) learns the $P _ { j \phi } ( r _ { j } | \mathbf { x } )$ distribution. The marginals of joint $Q$ should match these trained marginals and we use a KL term for that:
|
| 300 |
+
|
| 301 |
+
$$
|
| 302 |
+
\operatorname* { m i n } _ { Q , \theta , \phi } \sum _ { \mathbf { x } \in U \cup L } \left( K L ( Q ( y | \mathbf { x } ) ; P _ { \theta } ( y | \mathbf { x } ) ) + \sum _ { j : \mathbf { x } \in H _ { j } } K L ( Q ( r _ { j } | \mathbf { x } ) ; P _ { j \phi } ( r _ { j } | \mathbf { x } ) ) \right)
|
| 303 |
+
$$
|
| 304 |
+
|
| 305 |
+
We call the combined $\mathrm { K L }$ term succinctly as $K L ( Q , P _ { \theta } ) + K L ( Q , P _ { \phi } )$ .
|
| 306 |
+
|
| 307 |
+
Further the $P _ { \theta }$ and $P _ { j \phi }$ distributions should maximize the log-likelihood on their respective labeled data as provided in Equation 1 and Equation 2 respectively.
|
| 308 |
+
|
| 309 |
+
Putting all the above objectives together with hyper-parameters $\alpha > 0 , \ \lambda > 0$ we get our final objective as:
|
| 310 |
+
|
| 311 |
+
$$
|
| 312 |
+
\operatorname* { m i n } _ { Q , \theta , \phi } - \alpha ( L L ( \theta ) + L L ( \phi ) ) + K L ( Q , P _ { \theta } ) + K L ( Q , P _ { \phi } ) + \lambda \sum _ { j } \sum _ { \mathbf { x } \in H _ { j } } \sum _ { y \neq \ell _ { j } } Q ( y , r _ { j } = 1 | \mathbf { x } )
|
| 313 |
+
$$
|
| 314 |
+
|
| 315 |
+
We show in Section A.1 that this gives rise to the solution for $Q$ in terms of $P _ { \theta }$ , $P _ { j \phi }$ and alternately for $P _ { \theta }$ , $P _ { j \phi }$ in terms of $Q$ as follows.
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
Q ( y , \mathbf { r } | \mathbf { x } ) \propto P _ { \theta } ( y | \mathbf { x } ) \prod _ { j : \mathbf { x } \in H _ { j } } P _ { j \phi } ( r _ { j } | \mathbf { x } ) e ^ { - \lambda \delta ( y \neq \ell _ { j } \wedge r _ { j } = 1 ) }
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
where $\delta ( y \neq \ell _ { j } \land r _ { j } = 1 )$ is an indicator function that is 1 when the constraint inside holds, else it is 0. Computing marginals of the above using straight-forward message passing techniques we get:
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
\begin{array} { c c } { { Q ( y | { \bf x } ) \propto P _ { \boldsymbol \theta } ( y | { \bf x } ) \prod _ { j : \bf x \in { \cal H } _ { j } } ( P _ { j \phi } ( 1 | { \bf x } ) e ^ { - \lambda \delta ( y \ne \ell _ { j } ) } + P _ { j \phi } ( 0 | { \bf x } ) ) } } & { { \mathrm { ( 1 ) } } } \\ { { Q ( r _ { k } = 1 | { \bf x } ) \propto P _ { k \phi } ( 1 | { \bf x } ) \sum _ { y } e ^ { - \lambda \delta ( y \ne \ell _ { k } ) } P _ { \boldsymbol \theta } ( y | { \bf x } ) \prod _ { j \ne k , { \bf x } \in { \cal H } _ { j } } ( P _ { j \phi } ( 1 | { \bf x } ) e ^ { - \lambda \delta ( y \ne \ell _ { j } ) } + P _ { j \phi } ( 0 | { \bf x } ) ) } } & { { \mathrm { ( 1 ) } } } \\ { { \prod _ { j \ne k , { \bf x } \in { \cal H } _ { j } } ( P _ { j \phi } ( 1 | { \bf x } ) e ^ { - \lambda \delta ( y \ne \ell _ { j } ) } + P _ { j \phi } ( 0 | { \bf x } ) ) } } & { { \mathrm { ( 1 ) } } } \end{array}
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
Thereafter, we solve for $\theta$ and $\phi$ in terms of a given $Q$ as
|
| 328 |
+
|
| 329 |
+
$$
|
| 330 |
+
\underset { \pmb { \theta } , \phi } { \mathrm { m i n } } - L L ( \theta ) - L L ( \phi ) - \gamma \sum _ { \mathbf { x } _ { i } \in U } \sum _ { y \in \mathcal { Y } } Q ( y | \mathbf { x } _ { i } ) \log P _ { \theta } ( y | \mathbf { x } _ { i } ) + \sum _ { j : \mathbf { x } _ { i } \in H _ { j } } \sum _ { r _ { j } \in \{ 0 , 1 \} } Q ( r _ { j } | \mathbf { x } _ { i } ) \log P _ { j \phi } ( r _ { j } | \mathbf { x } _ { i } )
|
| 331 |
+
$$
|
| 332 |
+
|
| 333 |
+
Here, izatio $\begin{array} { r } { \gamma = \frac { 1 } { \alpha } } \end{array}$ . This gives rise to an alternating optimizatiowork of Ganchev et al. (2010). We initialize algoand thm as in the posterior regular-randomly. Then in a loop, we $\theta$ $\phi$ perform the following two steps alternatively much like the EM algorithm (Dempster et al., 1977).
|
| 334 |
+
|
| 335 |
+
Q Computation step: Here we compute marginals $Q ( y | \mathbf { x } )$ and $Q ( r _ { j } | \mathbf { x } )$ from current $P _ { \theta }$ and $P _ { j \phi }$ using Equations 14 and 15 respectively for each $\mathbf { x }$ in a batch. This computation is straight-forward and does not require any neural optimization. We can interpret the $Q ( y | \mathbf { x } )$ as a small correction of the $P _ { \theta } ( y | \mathbf { x } )$ so as to align better with the constraints imposed by the rules in Equation 3. Likewise $Q ( r _ { j } | \mathbf { x } )$ is an improvement of current $P _ { j \phi } \mathrm { \bf s }$ in the constraint preserving direction. For example, the expected $r _ { j }$ values might be reduced for an instance if its probability of $y$ being $\ell _ { j }$ is small.
|
| 336 |
+
|
| 337 |
+
Parameter update step: We next reoptimize the $\theta$ and $\phi$ parameters to match the corrected $Q$ distribution as shown in Equation 16. This is solved using standard stochastic gradient techniques. The $Q$ terms can just be viewed as weights at this stage which multiply the loss or label likelihood. A pseudocode of our overall training algorithm is described in Algorithm 1.
|
| 338 |
+
|
| 339 |
+
Algorithm 1 Our Joint Training Algorithm using Posterior Regularization
|
| 340 |
+
|
| 341 |
+
Input: $L , U$ Initialize parameters $\theta , \phi$ randomly for a random training batch from $U \cup L$ do Obtain $P _ { \boldsymbol { \theta } } ( y | \mathbf { x } )$ from the classification network. Obtain $P _ { j \phi } ( r _ { j } | \mathbf { x } ) _ { j \in [ n ] }$ from the rule-weight network. Calculate $Q ( y | \mathbf { x } )$ using Eqn 14 and $Q ( r _ { j } | \mathbf { x } ) _ { j \in [ n ] }$ using Eqn 15. Update $\theta$ and $\phi$ by taking a step in the direction to minimize the loss in Eqn 16. end for
|
| 342 |
+
Output: $\theta$ , $\phi$
|
| 343 |
+
|
| 344 |
+
# A.1 PROOF: ALTERNATING SOLUTION FOR OPTIMIZATION OBJECTIVE IN EQN 12
|
| 345 |
+
|
| 346 |
+
Treat each $Q ( y , \mathbf { r } )$ as an optimization variable with the constraint that $\begin{array} { r } { \sum _ { y , \mathbf { r } } Q ( y , \mathbf { r } ) = 1 } \end{array}$ . We express this constraint with a Langrangian multiplier $\eta$ in the objective. Also, define a distribution
|
| 347 |
+
|
| 348 |
+
$$
|
| 349 |
+
P _ { \theta , \phi } ( y , \mathbf { r } | \mathbf { x } ) = P _ { \theta } ( y | \mathbf { x } ) \prod _ { j : \mathbf { x } \in H _ { j } } P _ { j \phi } ( r _ { j } | \mathbf { x } )
|
| 350 |
+
$$
|
| 351 |
+
|
| 352 |
+
It is easy to verify that the KL terms in our objective 12 can be collapsed as $K L ( Q ; P _ { \theta , \phi } )$ . The rewritten objective (call it $F ( Q , \theta , \phi )$ ) is now:
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
\begin{array} { l } { - \alpha \displaystyle ( L L ( \theta ) + L L ( \phi ) ) + \sum _ { \mathbf { x } } K L ( Q ( y , \mathbf { r } | \mathbf { x } ) , P _ { \theta , \phi } ( y , \mathbf { r } | \mathbf { x } ) ) } \\ { + \lambda \displaystyle \sum _ { j } \sum _ { \mathbf { x } \in H _ { j } } \sum _ { y \neq \ell _ { j } } Q ( y , r _ { j } = 1 | \mathbf { x } ) + \eta ( 1 - \displaystyle \sum _ { y , \mathbf { r } } Q ( v , r ) ) } \end{array}
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
Next we solve for $\frac { \partial F } { \partial Q ( y , { \bf r } ) } \ = \ 0$ after expressing the marginals in their expanded forms: e.g. $\begin{array} { r } { Q ( y , r _ { j } | \mathbf { x } ) = \sum _ { r _ { 1 } , \dots , r _ { j - 1 } , r _ { j + 1 } , \dots , r _ { n } } Q ( y , r _ { 1 } , \dots , r _ { n } | \mathbf { x } ) } \end{array}$ . This gives us
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
\begin{array} { r } { \begin{array} { c c } { \displaystyle \frac { \partial F } { \partial Q ( \boldsymbol { y } , \mathbf { r } ) } = } & { \log Q ( \boldsymbol { y } , \mathbf { r } ) - \log P _ { \theta , \phi } ( \boldsymbol { y } , \mathbf { r } | \mathbf { x } ) } \\ & { + \sum _ { j : \mathbf { x } \in H _ { j } } \lambda \delta ( \boldsymbol { y } \ne \ell _ { j } , r _ { j } = 1 ) + \eta + 1 } \end{array} } \end{array}
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
Equating it to zero and substituting for $P _ { \theta , \phi }$ we get the solution for $Q ( y , \mathbf { r } )$ in Equation 13.
|
| 365 |
+
|
| 366 |
+
The proof for the optimal $P _ { \theta }$ and $P _ { j \phi }$ while keeping $Q$ fixed in Equation 17 is easy and we skip here.
|
| 367 |
+
|
| 368 |
+
# B LIST OF RULES
|
| 369 |
+
|
| 370 |
+
We provide a list of rules for each task type.
|
| 371 |
+
|
| 372 |
+
<table><tr><td rowspan=1 colspan=1>Rule</td><td rowspan=1 colspan=1>Example</td><td rowspan=1 colspan=1>Class</td></tr><tr><td rowspan=1 colspan=1>(|^)(where)[^\w]*(\w+){0,1}(was|is)[^\w]*( I\$)</td><td rowspan=1 colspan=1>WhereisTrinidad?</td><td rowspan=1 colspan=1>Location</td></tr><tr><td rowspan=1 colspan=1>(|^)(which|what)[^\w]*(\w+){0,1}(playlgame|movie|book)[^\w]*( I$)</td><td rowspan=1 colspan=1>What book is the follow-upto Future Shock ?</td><td rowspan=1 colspan=1>Entity</td></tr><tr><td rowspan=1 colspan=1>(|^)(what)[^\w]*(\w+){0,1}(part|division|ratiolpercentage)[^\w]*( |$)</td><td rowspan=1 colspan=1>Ofchildrenbetween theages of two and eleven , what percentage watch‘The Simpsons”?</td><td rowspan=1 colspan=1>Numeric</td></tr><tr><td rowspan=1 colspan=1>(|^)(who|who)[^\w]*(\w+){0,1}(found|discovered|made|builtIbuild|invented)[^\w]*( I$)</td><td rowspan=1 colspan=1>Who invented volleyball ?</td><td rowspan=1 colspan=1>Human</td></tr></table>
|
| 373 |
+
|
| 374 |
+
Table 4: Sample rules for TREC Question Classification. Rule fires if the regex matches
|
| 375 |
+
|
| 376 |
+
<table><tr><td rowspan=1 colspan=1>Rule</td><td rowspan=1 colspan=1>Example</td><td rowspan=1 colspan=1>Class</td></tr><tr><td rowspan=1 colspan=1>(|)(free)[\w]*([^\s]+ )*(price)[^\w]*([^\s]+ )*(call)[^\w]*( I$)</td><td rowspan=1 colspan=1>Freevideo camera phoneswithHalf Price line rental for 12 mthsand 500 cross ntwk mins 10O txts.Call MobileUpd8 08001950382 orCall2OptOut/674</td><td rowspan=1 colspan=1>Spam</td></tr><tr><td rowspan=1 colspan=1>(|^)(guranteed)[^\w]*([^\s]+)*(gift\.Igift)[^\w]*(I$)</td><td rowspan=1 colspan=1>Great News! CallFREEFONE08006344447 to claim your guaran-teed äf1000 CASH or äf2000 gift.</td><td rowspan=1 colspan=1>Spam</td></tr><tr><td rowspan=1 colspan=1>(|^)(can't)[^\w]*(\w+){0,1}(talk)[^\w]*( I$)</td><td rowspan=1 colspan=1>sry can't talk on phone, with parents</td><td rowspan=1 colspan=1>NotSpam</td></tr><tr><td rowspan=1 colspan=1>1^)(that's)[\w]*(\w+){O,1}(fine!|fine)[^\w]*( I$)</td><td rowspan=1 colspan=1>Yeah, that's fine! It's af6 to get in,is that ok?</td><td rowspan=1 colspan=1>NotSpam</td></tr></table>
|
| 377 |
+
|
| 378 |
+
Table 5: Sample rules for Spam Classification. Rule fires if the regex matches
|
| 379 |
+
|
| 380 |
+
<table><tr><td rowspan=1 colspan=1>Rules</td><td rowspan=1 colspan=1>Class</td></tr><tr><td rowspan=1 colspan=1>capital-gain > 6849</td><td rowspan=1 colspan=1>>50K</td></tr><tr><td rowspan=1 colspan=1>education-num >12 ANDmarital-status = Never-married ANDnative-country = United-States ANDoccupation= Exec-managerial</td><td rowspan=1 colspan=1>>50K</td></tr><tr><td rowspan=1 colspan=1>marital-status= Separated ANDhours-per-week ≤ 41</td><td rowspan=1 colspan=1>≤50K</td></tr><tr><td rowspan=1 colspan=1>education-num≤12 ANDnative-country = United-States ANDage ≤30</td><td rowspan=1 colspan=1>≤50K</td></tr></table>
|
| 381 |
+
|
| 382 |
+
Table 6: Sample rules for census dataset. Rule fires if all clauses are True
|
| 383 |
+
|
| 384 |
+
<table><tr><td rowspan=1 colspan=1>Rule</td><td rowspan=1 colspan=1>Example</td><td rowspan=1 colspan=1>Class</td></tr><tr><td rowspan=1 colspan=1>(|^)[^\w]*(within|near|next|close|nearbylaround|around)[^\w]*([^\s]+){0,2}(here|city|miles|mile)*[^\w]*( 1$)</td><td rowspan=1 colspan=1>any kid friendly restaurantsaround here</td><td rowspan=1 colspan=1>Location</td></tr><tr><td rowspan=1 colspan=1>WordLists:cuisinela=['italian','american','japanese','spanish','mexican','chinese','vietnamese','vegan']cuisinelb=['bistro','delis']cuisine2=['barbecue','halal','vegetarian','bakery']</td><td rowspan=1 colspan=1>can you find me some chi-nese food</td><td rowspan=1 colspan=1>Cuisine</td></tr><tr><td rowspan=1 colspan=1>([0-9]+|few|under [0-9]+) dollar</td><td rowspan=1 colspan=1>ineed a familyrestaurantwith meals under 1O dollarsand kids eat</td><td rowspan=1 colspan=1>Price</td></tr><tr><td rowspan=1 colspan=1>((high|highlylgood|best|toplwell|highest|zagat)(rate|ratinglrated))l((rated|rate|rating)[0-9]* star)I([0-9]+ star)</td><td rowspan=1 colspan=1>where can i get the highestrated burger within ten miles</td><td rowspan=1 colspan=1>Rating</td></tr><tr><td rowspan=1 colspan=1>((openlopened)(nowllate))l(still (openlopenedlclosed|close))I(((open|closelopened|closed)\w+([\s]- \w* 」\w*\w* ))*[O-9]+(amlpml((alp) m) |hours|hour))</td><td rowspan=1 colspan=1>whereisthe nearest italianrestaurant that is still open</td><td rowspan=1 colspan=1>Hours</td></tr><tr><td rowspan=1 colspan=1>(outdoor|indoorlgrouplromanticlfamilyloutsidelinside|finelwaterfrontloutsidelprivatelbusiness|formal|casual|rooftopl(special occasion))([\s]| \w+| \w+ \w+ )dining</td><td rowspan=1 colspan=1>i want to go to a restaurantwithin 20 miles that got ahigh rating and is consideredfine dining</td><td rowspan=1 colspan=1>Amenity</td></tr><tr><td rowspan=1 colspan=1>[\w+]{0,2}(palace|cafe|barlkitchen|outback|dominoes)</td><td rowspan=1 colspan=1>is passims kitchen open at 2am</td><td rowspan=1 colspan=1>RestaurantName</td></tr><tr><td rowspan=1 colspan=1>winelsandwichlpasta|burgerlperoggis|burritol(chicken tikka masala)lappetizerlpizza|winelcupcakel(onion ring) ltapas</td><td rowspan=1 colspan=1>please find me a pub thatserves burgers</td><td rowspan=1 colspan=1>Dish</td></tr></table>
|
| 385 |
+
|
| 386 |
+
Table 7: Sample rules for MIT-R dataset. Rule fires if the regex matches or sentence contains a word found in the provided word lists.
|
| 387 |
+
|
| 388 |
+
# C HYPERPARAMETERS
|
| 389 |
+
|
| 390 |
+
Across all experiments we use Adam optimizer with default values of $\beta _ { 1 } , \beta _ { 2 }$ , and $\epsilon$ . Dropout of 0.8 (keep probability) was used in the feed forward layers. All the models were trained for a maximum of 100 epochs and early stopping was used based on a validation set. Best model on the validation set was evaluated on the test set. Each experiment was run with 10 random initializations. A list of hyperparameters used in our experiments is provided below.
|
| 391 |
+
|
| 392 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Noise-tolerant</td><td rowspan=1 colspan=1>Snorkel-Noise-Tolerant</td><td rowspan=1 colspan=1>Post. Reg.</td><td rowspan=1 colspan=1>implication</td><td rowspan=1 colspan=1>L+Usnorkel</td><td rowspan=1 colspan=1>L+Umaj</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Que</td><td rowspan=1 colspan=1>Question Classification</td><td rowspan=1 colspan=1>ation</td><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1></td></tr><tr><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>0.001</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.001</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>0.001</td></tr><tr><td rowspan=1 colspan=1>q</td><td rowspan=1 colspan=1>0.9</td><td rowspan=1 colspan=1>0.6</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>lr</td><td rowspan=1 colspan=6>0.0003</td></tr><tr><td rowspan=1 colspan=1>bs</td><td rowspan=1 colspan=6>32 (16 for Only-L)</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=6>MIT-R</td></tr><tr><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>0.001</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.05</td><td rowspan=1 colspan=1>0.01</td></tr><tr><td rowspan=1 colspan=1>q</td><td rowspan=1 colspan=1>0.6</td><td rowspan=1 colspan=1>0.6</td><td rowspan=1 colspan=1>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>lr</td><td rowspan=1 colspan=6>0.0003</td></tr><tr><td rowspan=1 colspan=1>bs</td><td rowspan=1 colspan=6>64 (32 for Only-L)</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=6>YouTube</td></tr><tr><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>0.003</td><td rowspan=1 colspan=1>0.5</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.2</td><td rowspan=1 colspan=1>0.5</td><td rowspan=1 colspan=1>0.003</td></tr><tr><td rowspan=1 colspan=1>q</td><td rowspan=1 colspan=1>0.6</td><td rowspan=1 colspan=1>0.6</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>lr</td><td rowspan=1 colspan=6>0.0003</td></tr><tr><td rowspan=1 colspan=1>bs</td><td rowspan=1 colspan=6>32 (16 for Only-L)</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=6>SMS</td></tr><tr><td rowspan=1 colspan=1>Y</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.001</td><td rowspan=1 colspan=1>0.3</td><td rowspan=1 colspan=1>0.5</td><td rowspan=1 colspan=1>0.1</td></tr><tr><td rowspan=1 colspan=1>q</td><td rowspan=1 colspan=1>0.6</td><td rowspan=1 colspan=1>0.6</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>0.1</td></tr><tr><td rowspan=1 colspan=1>lr</td><td rowspan=1 colspan=6>0.0001</td></tr><tr><td rowspan=1 colspan=1>bs</td><td rowspan=1 colspan=6>32 (16 for Only-L)</td></tr><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=6>Census</td></tr><tr><td rowspan=1 colspan=1>2</td><td rowspan=1 colspan=1>0.5</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.001</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>0.5</td></tr><tr><td rowspan=1 colspan=1>q</td><td rowspan=1 colspan=1>0.1</td><td rowspan=1 colspan=1>0.6</td><td rowspan=1 colspan=1>-</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>二</td><td rowspan=1 colspan=1>0.5</td></tr><tr><td rowspan=1 colspan=1>lr</td><td rowspan=1 colspan=2>0.0001</td><td rowspan=1 colspan=4>0.0003</td></tr><tr><td rowspan=1 colspan=1>bs</td><td rowspan=1 colspan=6>64 (16 for Only-L)</td></tr></table>
|
| 393 |
+
|
| 394 |
+
Table 8: Hyperparameters for various methods and datasets. bs refers to the batch size and $l r$ refers to the learning rate. For Only-L baseline smaller batch size was used considering the smaller size of $L$ set.
|
| 395 |
+
|
| 396 |
+
<table><tr><td rowspan=1 colspan=1></td><td rowspan=1 colspan=1>Question</td><td rowspan=1 colspan=1>MIT-R</td><td rowspan=1 colspan=1>YouTube</td><td rowspan=1 colspan=1>SMS</td><td rowspan=1 colspan=1>Census</td></tr><tr><td rowspan=1 colspan=1>meta_lr</td><td rowspan=1 colspan=1>0.01</td><td rowspan=1 colspan=1>0.0001</td><td rowspan=1 colspan=1>0.001</td><td rowspan=1 colspan=1>0.0001</td><td rowspan=1 colspan=1>0.0001</td></tr><tr><td rowspan=1 colspan=1>lr</td><td rowspan=1 colspan=3>0.0003</td><td rowspan=1 colspan=1>0.0001</td><td rowspan=1 colspan=1>0.0003</td></tr><tr><td rowspan=1 colspan=1>bs</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>64</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>32</td><td rowspan=1 colspan=1>64</td></tr></table>
|
| 397 |
+
|
| 398 |
+
Table 9: Meta-learning rate, learning rate and batch size used for L2R (Ren et al., 2018b) for various datasets
|
md/train/SkxbDsR9Ym/SkxbDsR9Ym.md
ADDED
|
@@ -0,0 +1,531 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RELWALK – A LATENT VARIABLE MODEL APPROACH TO KNOWLEDGE GRAPH EMBEDDING
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Knowledge Graph Embedding (KGE) is the task of jointly learning entity and relation embeddings for a given knowledge graph. Existing methods for learning KGEs can be seen as a two-stage process where (a) entities and relations in the knowledge graph are represented using some linear algebraic structures (embeddings), and (b) a scoring function is defined that evaluates the strength of a relation that holds between two entities using the corresponding relation and entity embeddings. Unfortunately, prior proposals for the scoring functions in the first step have been heuristically motivated, and it is unclear as to how the scoring functions in KGEs relate to the generation process of the underlying knowledge graph. To address this issue, we propose a generative account of the KGE learning task. Specifically, given a knowledge graph represented by a set of relational triples $( h , R , t )$ , where the semantic relation $R$ holds between the two entities $h$ (head) and $t$ (tail), we extend the random walk model (Arora et al., 2016a) of word embeddings to KGE. We derive a theoretical relationship between the joint probability $p ( h , R , t )$ and the embeddings of $h$ , $R$ and $t$ . Moreover, we show that marginal loss minimisation, a popular objective used by much prior work in KGE, follows naturally from the log-likelihood ratio maximisation under the probabilities estimated from the KGEs according to our theoretical relationship. We propose a learning objective motivated by the theoretical analysis to learn KGEs from a given knowledge graph. The KGEs learnt by our proposed method obtain state-of-the-art performance on FB15K237 and WN18RR benchmark datasets, providing empirical evidence in support of the theory.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Knowledge graphs such as Freebase (Bollacker et al., 2008) organise information in the form of graphs, where entities are represented by vertices in the graph and the relation between two entities is represented by the edge that connects the corresponding two vertices. By embedding entities and relations that exist in a knowledge graph in some (possibly lower-dimensional and latent) space we can infer previously unseen relations between entities, thereby expanding a given knowledge graph (Nickel et al., 2016; Yang et al., 2015; Lin et al., 2015; Nickel et al., 2011; Trouillon et al., 2016; Wang et al., 2017; Bordes et al., 2011).
|
| 12 |
+
|
| 13 |
+
Existing KGE methods can be seen as involving two main steps. First, given a knowledge graph represented by a set of relational triples $( h , R , t )$ , where a semantic relation $R$ holds between a head entity $h$ and a tail entity $t$ , entities and relations are represented using some mathematical structures such as vectors, matrices or tensors. Second, a scoring function is proposed that evaluates the relational strength of a triple $( h , R , t )$ and entity and relation embeddings that optimise the defined scoring function are learnt using some optimisation method. Table 1 shows some of the scoring functions proposed in prior work in KGE learning.
|
| 14 |
+
|
| 15 |
+
Despite the wide applications of entity and relation embeddings created via KGE methods, the existing scoring functions are motivated heuristically to capture some geometric requirements of the embedding space. For example, TransE (Bordes et al., 2011) assumes that the entity and relation embeddings co-exist in the same (possibly lower dimensional) vector space and translating (shifting) the head entity embedding by the relation embedding must make it closer to the tail entity embedding, whereas ComplEx (Trouillon et al., 2016) models the asymmetry in relations using the component-wise multi-linear inner-product among entity and relation embeddings. Relational triples extracted from a given knowledge graph are used as positive training instances, whereas pseudo-negative (Bordes et al., 2011) instances are automatically generated by randomly corrupting positive instances. Finally, KGE are learnt such that the prediction loss computed over the positive and negative instances is minimised.
|
| 16 |
+
|
| 17 |
+
Table 1: Score functions proposed in selected prior work on KGE. Entity embeddings $h , t \in \mathbb { R } ^ { d }$ are vectors in all models, except in ComplEx where $\pmb { h } , \pmb { t } \in \mathbb { C } ^ { d }$ . Here, $\pmb { x } _ { \ell _ { 1 / 2 } }$ denotes either $\ell _ { 1 }$ or $\ell _ { 2 }$ norm of the vector $_ { \textbf { \em x } }$ . In ComplEx, $\bar { \mathbf { x } }$ is the elementwise complex conjugate, and $\langle \cdot , \cdot , \cdot \rangle$ denotes the component-wise multi-linear inner-product.
|
| 18 |
+
|
| 19 |
+
<table><tr><td>Model</td><td>Score function f(h, R,t)</td><td>Relation parameters</td></tr><tr><td>Unstructured (Bordes et al., 2011)</td><td>/h-tlle1/2</td><td>none</td></tr><tr><td>Structured embeddings (Bordes et al., 2011)</td><td>|R1h-R2tlle1,2</td><td>R1,R2 ∈Rd×d</td></tr><tr><td>TransE (Bordes et al., 2011)</td><td>|/h +R-tlle1/2</td><td>ReRd</td></tr><tr><td>DistMult (Yang et al., 2015)</td><td>(h,R,t)</td><td>ReRd</td></tr><tr><td>RESCAL (Nickel et al., 2011)</td><td>hRt</td><td>Rdxd</td></tr><tr><td>ComplEx (Trouillon et al., 2016)</td><td>(h,R,t)</td><td>Re Cd</td></tr></table>
|
| 20 |
+
|
| 21 |
+
Despite the good empirical performances of the existing KGE methods, theoretical understanding of KGE methods is comparatively under developed. For example, it is not clear how the heuristically defined KGE objectives relate to the generative process of a knowledge graph. In this paper, we attempt to fill this void by providing a theoretical analysis of KGE. Specifically, in section 2, we propose a generative process where we explain the formation of a relation $R$ between two entities $h$ and $t$ using the corresponding relation and entity embeddings. Following this generative story, we derive a relationship between the probability of $R$ holding between $h$ and $t$ , ${ \bar { p } } ( h , t \mid R )$ , and the embeddings of $R$ , $h$ and $t$ . Interestingly, the derived relationship is not covered by any of the previously proposed heuristically-motivated scoring functions, providing the first-ever KGE method with a provable generative explanation.
|
| 22 |
+
|
| 23 |
+
Next, in section 3, we show that the margin loss, which has been popularly used as a training objective in prior work on KGE, naturally arises as the log-likelihood ratio computed from $p ( h , t \mid { \bar { R } } )$ . Based on this result, we derive a training objective that we subsequently optimise for learning KGEs that satisfy our theoretical relationship. Using standard benchmark datasets proposed in prior work on KGE learning, we evaluate the learnt KGEs on a link prediction task and a triple classification task. Experimental results show that the learnt KGEs obtain state-of-the-art performance on FB15K237 and WN18RR benchmarks, thereby providing empirical evidence to support the theoretical analysis.
|
| 24 |
+
|
| 25 |
+
# 2 RELATIONAL WALK
|
| 26 |
+
|
| 27 |
+
Let us consider a knowledge graph $\mathcal { D }$ where the knowledge is represented by relational triples $( h , R , t ) \in \mathcal { D }$ . Here, $R$ is a relational predicate of two arguments, where $h$ (head) and $t$ (tail) entities respectively filling the first and second arguments. We assume relations to be asymmetric in general. In other words, if $( h , R , t ) \in \mathcal { D }$ then it does not necessarily follow that $( t , \dot { R _ { \ l } } h ) \in \mathcal { D }$ . The goal of KGE is to learn embeddings (representations) for the relations and entities in the knowledge graph such that the entities that participate in similar relations are embedded closely to each other in the entity embedding space, while at the same time relations that hold between similar entities are embedded closely to each other in the relational embedding space. We call the learnt entity and relation embeddings collectively as KGEs. Following prior work on KGE (Bordes et al., 2011; Trouillon et al., 2016; Yang et al., 2015), we assume that entities and relations are embedded in the same vector space, allowing us to perform linear algebraic operations using the embeddings in the same vector space.
|
| 28 |
+
|
| 29 |
+
Let us consider a random walk characterised by a time-dependent knowledge vector $c _ { k }$ , where $k$ is the current time step. The knowledge vector represents the knowledge we have about a particular group of entities and relations that express some facts about the world. For example, the knowledge that we have about people that are employed by companies can be expressed using entities of classes such as people and organisation, using relations such as CEO-of, employed-at, works-for, etc. We assume that entities $h$ and $t$ are represented by time-independent $d$ -dimensional vectors, respectively $h , t \in \mathbb { R } ^ { d }$ .
|
| 30 |
+
|
| 31 |
+
We assume the task of generating a relational triple $( h , R , t )$ in a given knowledge graph to be a two-step process as described next. First, given the current knowledge vector at time $k$ , $\boldsymbol { c } = \boldsymbol { c } _ { k }$ and the relation $R$ , we assume that the probability of an entity $h$ satisfying the first argument of $R$ to be given by (1).
|
| 32 |
+
|
| 33 |
+
$$
|
| 34 |
+
p ( h \mid R , c ) = { \frac { 1 } { Z _ { c } } } \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) .
|
| 35 |
+
$$
|
| 36 |
+
|
| 37 |
+
Here, $\mathbf { R } _ { 1 } \in \mathbb { R } ^ { d \times d }$ is a relation-specific orthogonal matrix that evaluates the appropriateness of $h$ for the first argument of $R$ . For example, if $R$ is the CEO-of relation, we would require a person as the first argument and a company as the second argument of $R$ . However, note that the role of $\mathbf { R } _ { 1 }$ extends beyond simply checking the types of the entities that can fill the first argument of a relation. For our example above, not all people are CEOs and $\mathbf { R } _ { 1 }$ evaluates the likelihood of a person to be selected as the first argument of the CEO-of relation. $Z _ { c }$ is a normalisation coefficient such that $\begin{array} { r } { \sum _ { h \in \mathcal { V } } p ( h \mid R , \pmb { c } ) = \mathrm { i } } \end{array}$ , where the vocabulary $\nu$ is the set of all entities in the knowledge graph.1
|
| 38 |
+
|
| 39 |
+
After generating $h$ , the state of our random walker changes to $\boldsymbol { c } ^ { \prime } = \boldsymbol { c } _ { k + 1 }$ , and we next generate the second argument of $R$ with the probability given by (2).
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
p ( t \mid R , \pmb { c } ^ { \prime } ) = \frac { 1 } { Z _ { c ^ { \prime } } } \exp \left( \pmb { t } ^ { \top } \mathbf { R } _ { 2 } \pmb { c } ^ { \prime } \right) .
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
Here, $\mathbf { R } _ { 2 } \in \mathbb { R } ^ { d \times d }$ is a relation-specific orthogonal matrix that evaluates the appropriateness of $t$ as the second argument of $R$ . $Z _ { c ^ { \prime } }$ is a normalisation coefficient such that $\begin{array} { r } { \sum _ { t \in \mathcal { V } } p ( \bar { t } \mid \bar { R } , { \pmb { c } } ) = 1 } \end{array}$ . Following our previous example of the CEO-of relation, $\mathbf { R } _ { 2 }$ evaluates the likelihood of an organisation to be a company with a CEO position. Importantly, $\mathbf { R } _ { 1 }$ and $\mathbf { R } _ { 2 }$ are representations of the relation $R$ and independent of the entities. Therefore, we consider $\mathbf { R } _ { 1 }$ and $\mathbf { R } _ { 2 }$ ) to collectively represent the embedding of $R$ . Orthogonality of ${ \bf R } _ { 1 } , { \bf R } _ { 2 }$ is a requirement for the mathematical proof and also act as a regularisation constraint to prevent overfitting by restricting the relational embedding space. We first perform our mathematical analysis for relational embeddings represented by orthogonal matrices and discuss later how this requirement can be relaxed.
|
| 46 |
+
|
| 47 |
+
We assume a slow random walk where the knowledge vectors do not change significantly between consecutive time steps $( c _ { k } \approx c _ { k + 1 } )$ ). More specifically, we assume that $\| \pmb { c } _ { k } - \pmb { c } _ { k + 1 } \| \le \epsilon _ { 2 }$ for some small $\epsilon _ { 2 } > 0$ . This is a realistic assumption for generating the two entity arguments in the same relational triple because, if the knowledge vectors were significantly different in the two generation steps, then it is likely that the corresponding relations are also different, which would not be coherent with the above-described generative process. Moreover, we assume that the knowledge vectors are distributed uniformly in the unit sphere and denote the distribution of knowledge vectors by $\mathcal { C }$ .
|
| 48 |
+
|
| 49 |
+
To learn KGEs, we must estimate the probability that $h$ and $t$ satisfy the relation $R$ , $p ( h , t \mid R )$ , which can be obtained by taking the expectation of $p ( h , t \mid R , c , c ^ { \prime } )$ w.r.t. $c , c ^ { \prime } \sim \mathcal { C }$ given by (3).
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\begin{array} { r l } & { p ( h , t \mid R ) = \mathbb { E } _ { c , c ^ { \prime } } \left[ p ( h , t \mid R , c , c ^ { \prime } ) \right] } \\ & { \quad \quad \quad = \mathbb { E } _ { c , c ^ { \prime } } \left[ p ( h \mid R , c ) p ( t \mid R , c ^ { \prime } ) \right] } \\ & { \quad \quad \quad = \mathbb { E } _ { c , c ^ { \prime } } \left[ \frac { \exp \big ( h ^ { \top } \mathbf { R } _ { 1 } c \big ) } { Z _ { c } } \frac { \exp \big ( t ^ { \top } \mathbf { R } _ { 2 } c ^ { \prime } \big ) } { Z _ { c ^ { \prime } } } \right] . } \end{array}
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
Here, partition functions are given by $\begin{array} { r l r } { Z _ { c } } & { { } = } & { \sum _ { h \in \mathcal { V } } \sum _ { c \in \mathcal { C } } \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) } \end{array}$ and $\begin{array} { r l } { Z _ { c ^ { \prime } } } & { { } = } \end{array}$ $\begin{array} { r l } { ~ } & { { } \sum _ { t \in \mathcal { V } } \sum _ { c ^ { \prime } \in \mathcal { C } } \exp \left( t ^ { \top } \mathbf { R } _ { 2 } c ^ { \prime } \right) } \end{array}$ . (4) follows from our two-step generative process where the generation of $h$ and $t$ in each step is independent given the relation and the corresponding knowledge vectors.
|
| 56 |
+
|
| 57 |
+
Computing the expectation in (5) is generally difficult because of the two partition functions $Z _ { c }$ and $Z _ { c ^ { \prime } }$ . However, Lemma 1 shows that the partition functions are narrowly distributed around a constant value for all $c$ (or $c ^ { \prime }$ ) values with high probability.
|
| 58 |
+
|
| 59 |
+
Lemma 1 (Concentration Lemma). If the entity embedding vectors satisfy the Bayesian prior $\mathbf { \nabla } \mathbf { \boldsymbol { v } } = s \hat { \mathbf { \nabla } } $ , where $\hat { v }$ is from the spherical Gaussian distribution, and s is a scalar random variable, which is always bounded by a constant $\kappa$ , then the entire ensemble of entity embeddings satisfies that
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\operatorname* { P r } _ { c \sim \mathcal { C } } [ ( 1 - \epsilon _ { z } ) Z \le Z _ { c } \le ( 1 + \epsilon _ { z } ) Z ] \ge 1 - \delta ,
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
for $\epsilon _ { z } = O ( 1 / \sqrt { n } )$ , and $\delta = \exp ( - \Omega ( \log ^ { 2 } n ) )$ , where $n \geq d$ is the number of words and $Z _ { c }$ is the partition function for $c$ given by $\begin{array} { r } { \sum _ { c \in \mathcal { V } } \exp \left( { \pmb { h } } ^ { \top } { \bf R } _ { 1 } { \pmb { c } } \right) } \end{array}$ .
|
| 66 |
+
|
| 67 |
+
proof: To prove the concentration lemma, we show that the mean $\mathbb { E } _ { h } [ Z _ { c } ]$ of $Z _ { c }$ is concentrated around a constant for all knowledge vectors $^ c$ and its variance is bounded. Recall that
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
Z _ { c } = \sum _ { h \in \mathcal { V } } \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) .
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
If $\mathbf { P }$ is an orthogonal matrix and $_ { \textbf { \em x } }$ is a vector, then $\| \mathbf { P } ^ { \top } \pmb { x } \| _ { 2 } ^ { 2 } = ( \mathbf { P } ^ { \top } \pmb { x } ) ^ { \top } ( \mathbf { P } ^ { \top } \pmb { x } ) = \pmb { x } ^ { \top } \mathbf { P } \mathbf { P } ^ { \top } \pmb { x } = \| \pmb { x } \| _ { 2 } ^ { 2 }$ , because $\mathbf { P } ^ { \top } \mathbf { P } \overset { = } \mathbf { I }$ . Therefore, from (7) and the orthogonality of the relational embeddings, we see that $\mathbf { R } _ { 1 } \boldsymbol { c }$ is a simple rotation of $^ c$ and does not alter the length of $^ c$ . We represent $\boldsymbol { h } = \boldsymbol { s } _ { h } \hat { \boldsymbol { h } }$ , where $s _ { h } = \left\| h \right\|$ and $\hat { h }$ is a unit vector (i.e. $\| \hat { h } \| _ { 2 } = 1 )$ distributed on the spherical Gaussian with zero mean and unit covariance matrix $\mathbf { I } _ { d } \in \mathbb { R } ^ { d \times d }$ . Let $s$ be a random variable that has the same distribution as $s _ { h }$ . Moreover, let us assume that $s$ is upper bounded by a constant $\kappa$ such that $s \leq \kappa$ . From the assumption of the knowledge vector $^ c$ , it is on the unit sphere as well, which is then rotated by $\mathbf { R } _ { 1 }$ .
|
| 74 |
+
|
| 75 |
+
We can write the partition function using the inner-product between two vectors $^ { h }$ and $\mathbf { R } _ { 1 } \boldsymbol { c }$ , $Z _ { c } = $ $\begin{array} { r } { \sum _ { h \in \mathcal { V } } \exp \big ( { h } ^ { \top } ( \dot { \mathbf { R } } _ { 1 } { c } ) \big ) } \end{array}$ . Arora et al. (2016a) showed that (Lemma 2.1 in their paper) the expectation of a partition function of this form can be approximated as follows:
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\begin{array} { r l } & { \mathbb { E } _ { \pmb { c } } [ Z _ { c } ] = n \mathbb { E } _ { \pmb { c } } [ \exp \left( \pmb { h } ^ { \top } \mathbf { R } _ { 1 } \pmb { c } \right) ] } \\ & { \qquad \geq n \mathbb { E } _ { \pmb { c } } [ 1 + \pmb { h } ^ { \top } \mathbf { R } _ { 1 } \pmb { c } ] = n . } \end{array}
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
where $n = | \mathcal { V } |$ is the number of entities in the vocabulary. (8) follows from the expectation of a sum and the independence of $^ { h }$ and $\mathbf { R } _ { 1 }$ from $^ c$ . The inequality of (9) is obtained by applying the Taylor expansion of the exponential series and the final equality is due to the symmetry of the spherical Gaussian. From the law of total expectation, we can write
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\operatorname { \mathbb { E } } _ { c } [ Z _ { c } ] = n \operatorname { \mathbb { E } } _ { c } [ \exp \left( { h ^ { \top } \mathbf { R } _ { 1 } c } \right) ] = n \operatorname { \mathbb { E } } _ { s _ { h } } \left[ \operatorname { \mathbb { E } } _ { x | s _ { h } } \left[ \exp \left( { h ^ { \top } \mathbf { R } _ { 1 } c } \right) \mid s _ { h } \right] \right] .
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
where, $\underline { { x } } = \pmb { h } ^ { \top } \mathbf { R } _ { 1 } \pmb { c }$ . Note that conditioned on $s _ { h } , h$ is a Gaussian random variable with variance $\sigma ^ { 2 } = \acute { s } _ { h } ^ { 2 }$ . Therefore, conditioned on $s _ { h }$ , $x$ is a random variable with variance $\sigma ^ { 2 } = \sigma _ { h } ^ { 2 }$ . Using this distribution, we can evaluate $\mathbb { E } _ { \boldsymbol { x } | \boldsymbol { s } _ { h } } \left[ \exp \left( \pmb { h } ^ { \top } \mathbf { R } _ { 1 } \boldsymbol { c } \right) \right]$ as follows:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
\begin{array} { l } { \displaystyle \mathbb { E } _ { x \mid s _ { h } } \left[ \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) \mid s _ { h } \right] = \int _ { x } \frac { 1 } { \sqrt { 2 \pi \sigma ^ { 2 } } } \exp \left( - \frac { x ^ { 2 } } { 2 \sigma ^ { 2 } } \right) \exp ( x ) d x } \\ { \displaystyle = \int _ { x } \frac { 1 } { \sqrt { 2 \pi \sigma ^ { 2 } } } \exp \left( - \frac { \left( x - \sigma ^ { 2 } \right) ^ { 2 } } { 2 \sigma ^ { 2 } } + \sigma ^ { 2 } / 2 \right) d x } \\ { \displaystyle = \exp ( \sigma ^ { 2 } / 2 ) . } \end{array}
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
Therefore, it follows that
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\operatorname { \mathbb { E } } _ { c } [ Z _ { c } ] = n \operatorname { \mathbb { E } } _ { s _ { h } } [ \exp ( \sigma ^ { 2 } / 2 ) ] = n \operatorname { \mathbb { E } } _ { s _ { h } } [ \exp ( s _ { h } ^ { 2 } / 2 ) ] = n \exp ( s ^ { 2 } / 2 ) ,
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
where $s$ is the variance of the $\ell _ { 2 }$ norms of the entity embeddings. Because the set of entities is given and fixed, both $n$ and $\sigma$ are constants, proving that $\mathbb { E } [ Z _ { c } ]$ does not depend on $c$ .
|
| 100 |
+
|
| 101 |
+
Next, we calculate the variance $\mathbb { V } _ { c } [ Z _ { c } ]$ as follows:
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\begin{array} { r l } & { \mathbb { V } _ { c } [ Z _ { c } ] = \displaystyle \sum _ { h } \mathbb { V } _ { c } [ \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) ] } \\ & { ~ \leq n \mathbb { E } _ { c } \left[ \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) \right] } \\ & { ~ = n \mathbb { E } _ { s _ { h } } \left[ \mathbb { E } _ { x \mid s _ { h } } \left[ \exp \left( 2 h ^ { \top } \mathbf { R } _ { 1 } t \right) \mid s _ { h } \right] \right] . } \end{array}
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
Because $2 h ^ { \top } { \bf R } _ { 1 } t$ is a Gaussian random variable with variance $4 \sigma ^ { 2 } = 4 s _ { h } ^ { 2 }$ from a similar calculation as in (11) we obtain,
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\begin{array} { r } { \mathbb { E } _ { \boldsymbol { x } | s _ { h } } \left[ \exp \left( 2 \boldsymbol { h } ^ { \top } \mathbf { R } _ { 1 } t \right) \mid s _ { h } \right] = \exp ( 2 \sigma ^ { 2 } ) . } \end{array}
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
By substituting (16) in (15) we have that
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\mathbb { V } _ { c } [ Z _ { c } ] \leq n \mathbb { E } _ { s _ { h } } \left[ \exp \left( 2 { \sigma } ^ { 2 } \right) \right] = n \mathbb { E } _ { s _ { h } } \left[ \exp ( 2 s ^ { 2 } ) \right] \leq \Lambda n
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
for $\Lambda = \exp ( 8 \kappa ^ { 2 } )$ a constant bounding $s \leq \kappa$ as stated.
|
| 120 |
+
|
| 121 |
+
From above, we have bounded both the mean and variance of the partition function by constants that are independent of the knowledge vector. Note that neither exp $\left( \hat { h ^ { \mathrm { { T } } } } \mathbf { R } _ { 1 } c \right)$ nor exp $( t ^ { \dagger } { \mathbf { R } } _ { 2 } c ^ { \prime } )$ are subGaussian nor sub-exponential. Therefore, standard concentration bounds derived for sub-Gaussian or sub-exponential random variables cannot be used in our analysis. However, the argument given in Appendix A.1 in Arora et al. (2016b) for a partition function with bounded mean and variance can be directly applied to $Z _ { c }$ in our case, which completes the proof of the concentration lemma. □
|
| 122 |
+
|
| 123 |
+
From the symmetry between $h$ and $t$ , Lemma 1 also applies for the partition function $\begin{array} { r } { \sum _ { t \in \mathcal { V } } \left( { t ^ { { \top } } \mathbf { R } _ { 2 } c ^ { \prime } } \right) } \end{array}$ Under the conditions required to satisfy Lemma 1, the following main theorem of this paper holds:
|
| 124 |
+
|
| 125 |
+
Theorem 1. Suppose that the entity embeddings satisfy (1). Then, we have
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
\log p ( h , t \mid R ) = { \frac { \| \mathbf { R } _ { 1 } ^ { \mathsf { T } } h + \mathbf { R } _ { 2 } ^ { \mathsf { T } } t \| _ { 2 } ^ { 2 } } { 2 d } } - 2 \log Z \pm \epsilon .
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
for $\epsilon = { O } ( 1 / { \sqrt { n } } ) + \widetilde { O } ( 1 / d ) $ , where
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
Z = Z _ { c } = Z _ { c ^ { \prime } } .
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
The complete proof of Theorem 1 is given in Appendix A. Below we briefly sketch the main steps.
|
| 138 |
+
|
| 139 |
+
Proof sketch: Let $F$ be the event that both $c$ and $c ^ { \prime }$ are within $( 1 \pm \epsilon _ { z } ) Z$ . Then, from Lemma 1 and the union bound, event $F$ happens with probability at least $1 - 2 \exp ( - \Omega ( \log ^ { 2 } n ) )$ . The R.H.S. of (5) can be split into two parts $\dot { T } _ { 1 }$ and $T _ { 2 }$ according to whether $F$ happens or not.
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
p ( h , t \mid R ) = \underbrace { \mathbb { E } _ { c , c ^ { \prime } } \left[ \frac { \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) } { Z _ { c } } \frac { \exp \left( h ^ { \top } \mathbf { R } _ { 2 } c ^ { \prime } \right) } { Z _ { c ^ { \prime } } } \mathbf { 1 } _ { F } \right] } _ { = T _ { 1 } } + \underbrace { \mathbb { E } _ { c , c ^ { \prime } } \left[ \frac { \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) } { Z _ { c } } \frac { \exp \left( h ^ { \top } \mathbf { R } _ { 2 } c ^ { \prime } \right) } { Z _ { c ^ { \prime } } } \mathbf { 1 } _ { F } \right] } _ { = T _ { 2 } } .
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
$T _ { 1 }$ can be approximated as given by (21).
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
T _ { 1 } = \frac { 1 \pm \mathcal { O } ( \epsilon _ { z } ) } { Z ^ { 2 } } \mathbb { E } _ { c , c ^ { \prime } } \left[ \exp \left( \pmb { h } ^ { \top } \mathbf { R } _ { 1 } c \right) \exp \left( \pmb { t } ^ { \top } \mathbf { R } _ { 2 } c ^ { \prime } \right) \right]
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
On the other hand, $T _ { 2 }$ can be shown to be a constant, independent of $d$ , given by (22).
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
| T _ { 2 } | = \exp ( - \Omega ( \log ^ { 1 . 8 } n ) )
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
The vocabulary size $n$ of real-world knowledge graphs is typically over $1 0 ^ { 5 }$ , for which $T _ { 2 }$ becomes negligibly small. Therefore, it suffices to consider only $T _ { 1 }$ . Because of the slowness of the random walk we have $c \approx c ^ { \prime }$
|
| 158 |
+
|
| 159 |
+
Using the law of total expectation we can write $T _ { 1 }$ as follows:
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
\begin{array} { l } { { \displaystyle { T _ { 1 } = \frac { 1 \pm \mathcal { O } ( \epsilon _ { z } ) } { Z ^ { 2 } } \mathbb { E } _ { c } \left[ \exp \left( { h ^ { \top } { \bf R } _ { 1 } c } \right) \mathbb { E } _ { c ^ { \prime } \mid c } \left[ \exp \left( { t ^ { \top } { \bf R } _ { 2 } c ^ { \prime } } \right) \right] \right]} } } \\ { { \displaystyle ~ = \frac { 1 \pm \mathcal { O } ( \epsilon _ { z } ) } { Z ^ { 2 } } \mathbb { E } _ { c } \left[ \exp \left( { h ^ { \top } { \bf R } _ { 1 } c } \right) A ( c ) \right] } } \end{array}
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
where $A ( c ) : = \mathbb { E } _ { c ^ { \prime } \mid c } \left[ \exp \left( { t ^ { \top } \mathbf { R } _ { 2 } c ^ { \prime } } \right) \right]$ . Doing some further evaluations we show that
|
| 166 |
+
|
| 167 |
+
$$
|
| 168 |
+
A ( c ) = ( 1 \pm \epsilon _ { 2 } ) \exp \left( t ^ { \top } { \bf R } _ { 2 } c \right)
|
| 169 |
+
$$
|
| 170 |
+
|
| 171 |
+
Plugging (50) back in (23) provides the claim of the theorem.
|
| 172 |
+
|
| 173 |
+
The relationship given by (18) indicates that head and tail entity embeddings are first transformed respectively by $\bar { \mathbf { R } _ { 1 } } ^ { \top }$ and $\mathbf { R } _ { 2 } ^ { \phantom { \dagger } }$ , and the squared $\ell _ { 2 }$ norm of the sum of the transformed vectors is proportional to the probability $p ( h , t \mid R )$ .
|
| 174 |
+
|
| 175 |
+
# 3 LEARNING KNOWLEDGE GRAPH EMBEDDINGS
|
| 176 |
+
|
| 177 |
+
In this section, we derive a training objective from Theorem 1 that we can then optimise to learn KGE. The goal is to empirically validate the theoretical result by evaluating the learnt KGEs. Knowledge graphs represent information about relations between two entities in the form of relational triples. The joint probability $p ( h , R , t )$ given by Theorem 1 is useful for determining whether a relation $R$ exists between two given entities $h$ and $t$ . For example, if we know that with a high probability that $R$ holds between $h$ and $t$ , then we can append $( h , R , t )$ to the knowledge graph. The task of expanding knowledge graphs by predicting missing links between entities or relations is known as the link prediction problem (Trouillon et al., 2016). In particular, if we can automatically append such previously unknown knowledge to the knowledge graph, we can expand the knowledge graph and address the knowledge acquisition bottleneck.
|
| 178 |
+
|
| 179 |
+
To derive a criteria for determining whether a link must be predicted among entities and relations, let us consider a relational triple $( h , R , t ) \in \mathcal { D }$ that exists in a given knowledge graph $\mathcal { D }$ . We call such relational triples as positive triples because from the assumption it is known that $R$ holds between $h$ and $t$ . On the other hand, consider a negative relational triple $( h ^ { \prime } , R , t ^ { \prime } ) \in \mathcal { D }$ formed by, for example, randomly perturbing a positive triple. A popular technique for generating such (pseudo) negative triples is to replace $h$ or $t$ with a randomly selected different instance of the same entity type. As an alternative for random perturbation, Cai and Wang (2018) proposed a method for generating negative instances using adversarial learning. Here, we are not concerned about the actual method used for generating the negative triples but assume a set of negative triples, $\bar { \mathcal D }$ , generated using some method, to be given.
|
| 180 |
+
|
| 181 |
+
Given a positive triple $( h , R , t ) \in \mathcal { D }$ and a negative triple $( h ^ { \prime } , R , t ^ { \prime } ) \in \bar { \mathcal { D } }$ , we would like to learn KGEs such that a higher probability is assigned to $( h , R , t )$ than that assigned to $( h ^ { \prime } , R , t ^ { \prime } )$ . We can formalise this requirement using the likelihood ratio given by (25).
|
| 182 |
+
|
| 183 |
+
$$
|
| 184 |
+
\frac { p ( h , R , t ) } { p ( h ^ { \prime } , R , t ^ { \prime } ) } \geq \eta
|
| 185 |
+
$$
|
| 186 |
+
|
| 187 |
+
Here, $\eta > 1$ is a threshold that determines how higher we would like to set the probabilities for the positive triples compares to that of the negative triples.
|
| 188 |
+
|
| 189 |
+
By taking the logarithm of both sides in (25) we obtain
|
| 190 |
+
|
| 191 |
+
$$
|
| 192 |
+
\begin{array} { c } { \log p ( h , R , t ) - \log p ( h ^ { \prime } , R , t ^ { \prime } ) \geq \log { \eta } } \\ { \log \eta + \log p ( h ^ { \prime } , R , t ^ { \prime } ) - \log p ( h , R , t ) \geq 0 } \end{array}
|
| 193 |
+
$$
|
| 194 |
+
|
| 195 |
+
If a positive triple $( h , R , t )$ is correctly assigned a higher probability than a negative triple $p ( h ^ { \prime } , R , t ^ { \prime } )$ , then the left hand side of (26) will be negative, indicating that there is no loss incurred during this classification task. Therefore, we can re-write (26) to obtain the marginal loss Bordes et al. (2013; 2011), $L ( \mathcal { D } , \bar { \mathcal { D } } )$ , a popular choice as a learning objective in prior work in KGE, as shown in (27).
|
| 196 |
+
|
| 197 |
+
$$
|
| 198 |
+
\begin{array} { r l } & { L ( \mathcal { D } , \bar { \mathcal { D } } ) = \displaystyle \sum _ { ( h , R , t ) \in \mathcal { D } } \operatorname* { m a x } \left( 0 , \log \eta + \log p ( h ^ { \prime } , R , t ^ { \prime } ) - \log p ( h , R , t ) \right) } \\ & { \quad \quad \quad \quad ( h ^ { \prime } , R , t ^ { \prime } ) \in \bar { \mathcal { D } } } \\ & { \quad \quad \quad = \operatorname* { m a x } \left( 0 , 2 d \log \eta + \| \mathbf { R } _ { 1 } ^ { \top } h ^ { \prime } + \mathbf { R } _ { 2 } ^ { \top } t ^ { \prime } \| _ { 2 } ^ { 2 } - \| \mathbf { R } _ { 1 } ^ { \top } h + \mathbf { R } _ { 2 } ^ { \top } t \| _ { 2 } ^ { 2 } \right) } \end{array}
|
| 199 |
+
$$
|
| 200 |
+
|
| 201 |
+
We can assume $2 d \log \eta$ to be the margin for the constraint violation.
|
| 202 |
+
|
| 203 |
+
Theorem 1 requires $\mathbf { R } _ { 1 }$ and ${ \bf R } _ { 2 }$ to be orthogonal. To reflect this requirement, we add two $\ell _ { 2 }$ regularisation terms $\lVert \mathbf { R } _ { 1 } ^ { \top } \mathbf { R } _ { 1 } - \mathbf { I } \rVert _ { 2 } ^ { 2 }$ and $| | \mathbf { R } _ { 2 } ^ { \top } \mathbf { \widetilde { R } } _ { 2 } - \mathbf { I } | | _ { 2 } ^ { 2 }$ respectively with regularisation coefficients $\lambda _ { 1 }$ and $\lambda _ { 2 }$ to the objective function given by (27). In our experiments, we compute the gradients (27) w.r.t. each of the parameters $\mathbf { \Sigma } _ { h , \ t , \ R _ { 1 } }$ and $R _ { 2 }$ and use stochastic gradient descent (SGD) for optimisation. This approach can be easily extended to learn from multiple negative triples as shown in Appendix B.
|
| 204 |
+
|
| 205 |
+
# 4 RELATED WORK
|
| 206 |
+
|
| 207 |
+
At a high-level of abstraction, KGE methods can be seen as differing in their design choices for the following two main problems: (a) how to represent entities and relations, and (b) how to model the interaction between two entities and a relation that holds between them. Next, we briefly discuss prior proposals to those two problems (refer (Wang et al., 2017; Nickel et al., 2015; Nguyen, 2017) for an extended survey on KGE).
|
| 208 |
+
|
| 209 |
+
A popular choice for representing entities is to use vectors, whereas relations have been represented by vectors, matrices or tensors. For example, TransE (Bordes et al., 2011), TransH (Wang et al., 2014), TransD (Ji et al., 2015), TransG (Xiao et al., 2016), TransR (Lin et al., 2015), lppTransD (Yoon et al., 2016), DistMult (Yang et al., 2015), HolE (Nickel et al., 2016) and ComplEx (Trouillon et al., 2016) represent relations by vectors, whereas Structured Embeddings (Bordes et al., 2011), TranSparse (Ji et al., 2016), STransE (Nguyen et al., 2016), RESCAL (Nickel et al., 2011) use matrices and Neural Tensor Network (NTN) (Socher et al., 2013) uses 3D tensors. ComplEx (Trouillon et al., 2016) introduced complex vectors for KGEs to capture the asymmetry in semantic relations. (Ding et al., 2018) obtained state-of-the-art performance for KGE by imposing non-negativity and entailment constraints to ComplEx.
|
| 210 |
+
|
| 211 |
+
Given entity and relation embeddings, a scoring function is defined that evaluates the strength of a relation $R$ between two entities $h$ and $t$ in a triple $( h , R , t )$ . The scoring functions that encode various intuitions have been proposed such as the $\ell _ { 1 }$ or $\ell _ { 2 }$ norms of the vector formed by a translation of the head entity embedding by the relation embedding over the target embedding, or by first performing a projection from the entity embedding space to the relation embedding space (Yoon et al., 2016) As an alternative to using vector norms as scoring functions, DistMult and ComplEx use the component-wise multi-linear dot product.
|
| 212 |
+
|
| 213 |
+
Once a scoring function is defined, KGEs are learnt that assign better scores to relational triples in existing knowledge graphs (positive triples) over triples where the relation does not hold (negative triples) by minimising a loss function such as the logistic loss (RESCAL, DistMult, ComplEx) or marginal loss (TransE, TransH, TransD, TransD). Because knowledge graphs record only positive triples, a popular method to generate pseudo negative triples is to perturb a positive instance by replacing its head or tail entity by an entity selected uniformly at random from the vocabulary of the entities. However, uniformly sampled negative triples are likely to be obvious examples that do not provide much information to the learning process and can be detected by simply checking for the type of the entities in a triple. Cai and Wang (2018) proposed an adversarial learning approach where a generator assigns a probability to each relation triple and negative instances are sampled according to this probability distribution to train a discriminator that discriminates between positive and negative instances. (Xiao et al., 2016) proposed TransG, a generative model based on the Chinese restaurant process, to model multiple relations that exist between a pair of entities. However, their relation embeddings are designed to satisfy vector translation similar to TransE.
|
| 214 |
+
|
| 215 |
+
As an alternative to directly learning embeddings from a graph, several methods (Grover and Leskovec, 2016; Perozzi et al., 2014; Ristoski et al., 2018) have considered the vertices visited during truncated random walks over the graph as pseudo sentences, and have applied popular word embedding learning algorithms such as skip-gram with negative sampling or continuous bag-of-words model (Mikolov et al., 2013) to learn vertex embeddings. However, pseudo sentences generated this way are syntactically very different from sentences in natural languages.
|
| 216 |
+
|
| 217 |
+
On the other hand, our work extends the random walk analysis by Arora et al. (2016a) that derives a useful connection between the joint co-occurrence probability of two words and the $\ell _ { 2 }$ norm of the sum of the corresponding word embeddings. Specifically, they proposed a latent variable model where the words in a corpus are generated by a probabilistic model parametrised by a time-dependent discourse vector that performs a random walk. However, unlike in our work, they do not consider the relations between two co-occurring words in a corpus. Bollegala et al. (2018) extended the model proposed by Arora et al. (2016a) to capture co-occurrences involving more than two words. They defined the co-occurrence of $k$ unique words in a given context as a $k$ -way co-occurrence, where Arora et al. (2016a)’s result could be seen as a special case corersponding to $k = 2$ . Moreover, Bollegala et al. (2018) showed that it is possible to learn word embeddings that capture some types of semantic relations such as antonymy and collocation using 3-way co-occurrences more accurately than using 2-way co-occurrences. However, their model does not explicitly consider the relations between words/entities and uses only a corpus for learning the word embeddings.
|
| 218 |
+
|
| 219 |
+
Table 2: Triple classification.
|
| 220 |
+
|
| 221 |
+
<table><tr><td></td><td colspan="2">Accuracy</td></tr><tr><td>Method</td><td>WN11</td><td>FB13</td></tr><tr><td>SE</td><td>53.0</td><td>75.2</td></tr><tr><td>TransE</td><td>75.9</td><td>81.5</td></tr><tr><td>TransR</td><td>85.9</td><td>82.5</td></tr><tr><td>TransG</td><td>87.4</td><td>87.3</td></tr><tr><td>NTN</td><td>70.4</td><td>87.1</td></tr><tr><td>RelWalk</td><td>75.48</td><td>87.5</td></tr></table>
|
| 222 |
+
|
| 223 |
+
Table 3: Link prediction. Results marked with $[ \star ]$ are taken from Dettmers et al. (2017), $[ \bullet ]$ from Nguyen et al. (2017), [/] from and Cai and Wang (2018). All other results for the baselines are taken from their original papers.
|
| 224 |
+
|
| 225 |
+
<table><tr><td></td><td colspan="5">FB15K237</td><td colspan="5">WN18RR</td></tr><tr><td>Method</td><td>MRR</td><td>MR</td><td>H@1</td><td>H@3</td><td>H@10</td><td>MRR</td><td>MR</td><td>H@1</td><td>H@3</td><td>H@10</td></tr><tr><td>TransE</td><td>0.294</td><td>347</td><td>1</td><td>=</td><td>0.465</td><td>0.226</td><td>3384</td><td>=</td><td>=</td><td>0.50</td></tr><tr><td>TransD</td><td>0.28</td><td>-</td><td>1</td><td>1</td><td>0.453</td><td>1</td><td></td><td>1</td><td>1</td><td>0.43</td></tr><tr><td>DistMult*</td><td>0.241</td><td>254</td><td>0.155</td><td>0.263</td><td>0.419</td><td>0.43</td><td>5110</td><td>0.39</td><td>0.44</td><td>0.49</td></tr><tr><td>ComplEx*</td><td>0.247</td><td>339</td><td>0.158</td><td>0.275</td><td>0.428</td><td>0.44</td><td>5261</td><td>0.41</td><td>0.46</td><td>0.51</td></tr><tr><td>ConvE</td><td>0.316</td><td>246</td><td>0.239</td><td>0.35</td><td>0.491</td><td>0.46</td><td>5277</td><td>0.39</td><td>0.43</td><td>0.48</td></tr><tr><td>RelWalk</td><td>0.329</td><td>105</td><td>0.243</td><td>0.354</td><td>0.502</td><td>0.451</td><td>3232</td><td>0.42</td><td>0.47</td><td>0.51</td></tr></table>
|
| 226 |
+
|
| 227 |
+
# 5 EMPIRICAL VALIDATION
|
| 228 |
+
|
| 229 |
+
To empirically evaluate the theoretical result stated in Theorem 1, we learn KGEs (denoted by RelWalk) by minimising the marginal loss objective derived in section 3. We use the FB15k237, FB13 (subsets of Freebase) and WN11, WN18RR (subsets of WordNet) datasets, which are standard benchmarks for KGE. We use the standard training, validation and test splits as detailed in Table 4. We generate negative triples by replacing a head or a tail entity in a positive triple by a randomly selected different entity and learn KGEs. We train the model until convergence or at most 1000 epochs over the training data where each epoch is divided into $1 0 0 \mathrm { { m i n i } }$ -batches. The best model is selected by early stopping based on the performance of the learnt embeddings on the validation set (evaluated after each 20 epochs). The training details and hyperparameter settings are detailed in Appendix C. RelWalk is implemented in the open-source toolkit OpenKE (Han et al., 2018).2
|
| 230 |
+
|
| 231 |
+
We conduct two evaluation tasks: link prediction (predict the missing head or tail entity in a given triple $( h , R , ? )$ or $( ? , R , t ) )$ ) (Bordes et al., 2011) and triple classification (predict whether a relation $R$ holds between $h$ and $t$ in a given triple $( h , R , t ) )$ (Socher et al., 2013). We evaluate the performance in the link prediction task using mean reciprocal rank (MRR), mean rank (MR (the average of the rank assigned to the original head or tail entity in a corrupted triple) and hits at ranks 1, 3 and 10 $( \mathbf { H } @ \mathbf { 1 } , \mathbf { 3 } , \mathbf { 1 0 } )$ , whereas in the triple classification task we use accuracy (percentage of the correctly classified test triples). We only report scores under the filtered setting Bordes et al. (2013), which removes all triples appeared in training, validating and testing sets from candidate triples before obtaining the rank of the ground truth triple. In link prediction, we consider all entities that appear in the corresponding argument in the entire knowledge graph as candidates.
|
| 232 |
+
|
| 233 |
+
In Tables 2 and 3 we compare the KGEs learnt by RelWalk against prior work using the published results. For link prediction, RelWalk reports SoTA on both WN18RR and FB15K237 in all evaluation measures, except against ConvE in WN18RR measured by MRR. WN18RR excludes triples from WN18 that are simply inverted between train and test partitions (Toutanova and Chen, 2015; Dettmers et al., 2017). RelWalk’s consistently good performance on both versions of this dataset shows that it is considering the global structure in the knowledge graph when learning KGEs. For triple classification, RelWalk reports the best performance on FB13, whereas TransG reports the best performance on
|
| 234 |
+
|
| 235 |
+
WN11. Considering that both TransG and RelWalk are generative models, it would be interesting to further investigate generative approaches for KGE in the future. Overall, the experimental results support our theoretical claim and emphasise the importance of theoretically motivating the scoring function design process.
|
| 236 |
+
|
| 237 |
+
# 6 CONCLUSION
|
| 238 |
+
|
| 239 |
+
We proposed RelWalk, a generative model of KGE and derived a theoretical relationship between the probability of a triple and entity, relation embeddings. We then proposed a learning objective based on the theoretical relationship we derived. Experimental results on a link prediction and a triple classification tasks show that RelWalk obtains strong performances in multiple benchmark datasets.
|
| 240 |
+
|
| 241 |
+
# REFERENCES
|
| 242 |
+
|
| 243 |
+
Sanjeev Arora, Yuanzhi Li, Yingyu Liang, Tengyu Ma, and Andrej Risteski. A latent variable model approach to pmi-based word embeddings. Transactions of Association for Computational Linguistics, 4:385–399, 2016a.
|
| 244 |
+
|
| 245 |
+
Sanjeev Arora, Yuanzhi Li, Yingyu Liang, Tengyu Ma, and Andrej Risteski. Rand-walk: A latent variable model approach to word embeddings. arXiv, 2016b.
|
| 246 |
+
|
| 247 |
+
Kurt Bollacker, Colin Evans, Praveen Paritosh, Tim Sturge, and Jamie Taylor. Freebase: a collaboratively created graph database for structuring human knowledge. In Proc. of SIGMOD, pages 1247 – 1250, 2008.
|
| 248 |
+
|
| 249 |
+
Danushka Bollegala, Yuichi Yoshida, and Ken-ichi Kawarabayashi. Using $k$ -way Co-occurrences for Learning Word Embeddings. In Proc. of AAAI, 2018.
|
| 250 |
+
|
| 251 |
+
Antoine Bordes, Jason Weston, Ronan Collobert, and Yoshua Bengio. Learning structured embeddings of knowledge bases. In Proc. of AAAI, 2011.
|
| 252 |
+
|
| 253 |
+
Antoine Bordes, Nicolas Usunier, Alberto Garcia-Durán, Jason Weston, and Oksana Yakhenko. Translating embeddings for modeling multi-relational data. In Proc. of NIPS, 2013.
|
| 254 |
+
|
| 255 |
+
Liwei Cai and William Yang Wang. Kbgan: Adversarial learning for knowledge graph embeddings. In Proc. of NAACL, pages 1470–1480, 2018.
|
| 256 |
+
|
| 257 |
+
Tim Dettmers, Pasquale Minervini, Pontus Stenetorp, and Sebastian Riedel. Convolutional 2D Knowledge Graph Embeddings, 2017. URL http://arxiv.org/abs/1707.01476.
|
| 258 |
+
|
| 259 |
+
Boyang Ding, Quan Wang, Bin Wang, and Li Guo. Improving knowledge graph embedding using simple constraints. In Proc. of ACL, pages 110–121, 2018.
|
| 260 |
+
|
| 261 |
+
Aditya Grover and Jure Leskovec. node2vec: Scalable feature learning for networks. In Proc. of KDD, 2016.
|
| 262 |
+
|
| 263 |
+
Xu Han, Shulin Cao, Lv Xin, Yankai Lin, Zhiyuan Liu, Maosong Sun, and Juanzi Li. Openke: An open toolkit for knowledge embedding. In Proc. of EMNLP, 2018.
|
| 264 |
+
|
| 265 |
+
Guoliang Ji, Shizhu He, Liheng Xu, Kang Liu, and Jun Zhao. Knowledge graph embedding via dynamic mapping matrix. In Proc. of ACL, pages 687–696, 2015.
|
| 266 |
+
|
| 267 |
+
Guoliang Ji, Kang Liu, Shizhu He, and Jun Zhao. Knowledge graph completion with adaptive sparse transfer matrix. In Proc. of AAAI, pages 985–991, 2016.
|
| 268 |
+
|
| 269 |
+
Yankai Lin, Zhiyuan Liu, Maosong Sun, Yang Liu, and Xuan Zhu. Learning entity and relation embeddings for knowledge graph completion. In Proc. of AAAI, pages 2181–2187, 2015.
|
| 270 |
+
|
| 271 |
+
Tomas Mikolov, Kai Chen, and Jeffrey Dean. Efficient estimation of word representation in vector space. In Proc. of International Conference on Learning Representations, 2013.
|
| 272 |
+
|
| 273 |
+
Dai Quoc Nguyen, Tu Dinh Nguyen, Dat Quoc Nguyen, and Dinh Phung. A novel embedding model for knowledge base completion based on convolutional neural network. arXiv preprint arXiv:1712.02121, 2017.
|
| 274 |
+
|
| 275 |
+
Dat Quoc Nguyen. An overview of embedding models of entities and relationships for knowledge base completion. 03 2017. URL https://arxiv.org/abs/1703.08098.
|
| 276 |
+
|
| 277 |
+
Dat Quoc Nguyen, Kairit Sirts, Lizhen Qu, and Mark Johnson. Stranse: a novel embedding model of entities and relationships in knowledge bases. In Proc. of NAACL-HLT, pages 460–466, 2016.
|
| 278 |
+
|
| 279 |
+
Maximilian Nickel, Volker Tresp, and Hans-Peter Kriegel. A three-way model for collective learning on multi-relational data. In Proc. of ICML, pages 809–816, 2011.
|
| 280 |
+
|
| 281 |
+
Maximilian Nickel, Kevin Murphy, Volker Tresp, and Evgeniy Gabrilovich. A review of relational machine learning for knowledge graphs. Proceedings of the IEEE, 104(1):11–33, 2015.
|
| 282 |
+
|
| 283 |
+
Maximilian Nickel, Lorenzo Rosasco, and Tomaso Poggio. Holographic embeddings of knowledge graphs. In Proc. of AAAI, 2016.
|
| 284 |
+
|
| 285 |
+
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, KDD ’14, pages 701–710, New York, NY, USA, 2014. ACM. ISBN 978-1-4503-2956-9. doi: 10.1145/2623330.2623732. URL http://doi.acm.org/10.1145/ 2623330.2623732.
|
| 286 |
+
|
| 287 |
+
Petar Ristoski, Jessica Rosati, Tommaso Di Noia, Renato De Leone, and Heiko Paulheim. Rdf2vec: Rdf graph embeddings and their applications. Semantic Web, (Preprint):1–32, 2018.
|
| 288 |
+
|
| 289 |
+
Richard Socher, Danqi Chen, Christopher D. Manning, and Andrew Y. Ng. Reasoning with neural tensor networks for knowledge base completion. In Proc. of NIPS, 2013.
|
| 290 |
+
|
| 291 |
+
Kristina Toutanova and Danqi Chen. Observed versus latent features for knowledge base and text inference. In Proc. of 3rd Workshop on Continuous Vector Space Models and their Compositionality, pages 57–66, 2015.
|
| 292 |
+
|
| 293 |
+
Théo Trouillon, Johannes Welbl, Sebastian Riedel, Éric Gaussier, and Guillaume Bouchard. Complex embeddings for simple link prediction. In Proc. of ICML, 2016. URL http://arxiv.org/abs/ 1606.06357.
|
| 294 |
+
|
| 295 |
+
Q. Wang, Z. Mao, B. Wang, and L. Guo. Knowledge graph embedding: A survey of approaches and applications. IEEE Transactions on Knowledge and Data Engineering, 29(12):2724–2743, Dec 2017. ISSN 1041-4347. doi: 10.1109/TKDE.2017.2754499.
|
| 296 |
+
|
| 297 |
+
Zhen Wang, Jianwen Zhang, Jianlin Feng, and Zheng Chen. Knowledge graph embedding by translating on hyperplanes. In Proc. of AAAI, pages 1112 – 1119, 2014.
|
| 298 |
+
|
| 299 |
+
Han Xiao, Minlie Huang, and Xiaoyan Zhu. Transg : A generative model for knowledge graph embedding. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2316–2325, Berlin, Germany, August 2016. Association for Computational Linguistics. URL http://www.aclweb.org/anthology/P16-1219.
|
| 300 |
+
|
| 301 |
+
Bishan Yang, Wen-tau Yih, Xiadong He, Jianfeng Gao, and Li Deng. Embedding entities and relations for learning and inference in knowledge bases. In ICLR, 2015.
|
| 302 |
+
|
| 303 |
+
Hee-Geun Yoon, Hyun-Je Song, Seong-Bae Park, and Se-Young Park. A translation-based knowledge graph embedding preserving logical property of relations. In Proc. of NAACL, pages 907–916, 2016.
|
| 304 |
+
|
| 305 |
+
# APPENDIX
|
| 306 |
+
|
| 307 |
+
# A PROOF OF THEOREM 1
|
| 308 |
+
|
| 309 |
+
Let us consider the probabilistic event that $( 1 - \epsilon _ { z } ) Z \le Z _ { c } \le ( 1 + \epsilon _ { z } ) Z$ to be $F _ { c }$ and $( 1 - \epsilon _ { z } ) Z \le$ $Z _ { c ^ { \prime } } \leq ( 1 + \epsilon _ { z } ) Z$ to be $F _ { c ^ { \prime } }$ . From Lemma 1 we have $\mathrm { P r } _ { c } [ F _ { c } ] \ge 1 - \delta$ . Then from the union bound we have,
|
| 310 |
+
|
| 311 |
+
$$
|
| 312 |
+
\begin{array} { r l } & { \mathrm { P r } [ \bar { F } _ { c } \vee \bar { F } _ { c ^ { \prime } } ] \leq \mathrm { P r } [ \bar { F } _ { c } ] + \mathrm { P r } [ \bar { F } _ { c ^ { \prime } } ] } \\ & { \qquad = 1 - \mathrm { P r } [ F _ { c } ] + 1 - \mathrm { P r } [ F _ { c ^ { \prime } } ] } \\ & { \qquad = 2 \delta . } \end{array}
|
| 313 |
+
$$
|
| 314 |
+
|
| 315 |
+
Moreover, let $F$ be the probabilistic event that both $F _ { c }$ and $F _ { c ^ { \prime } }$ being True. Then from ${ \mathrm { P r } } [ F ] =$ $1 - \operatorname* { P r } [ \bar { F } _ { c } \vee \bar { F } _ { c ^ { \prime } } ]$ we have, $\mathrm { P r } [ F ] \ge 1 - 2 \delta$ . We can decompose the expectation in the R.H.S. in (5) into two terms $T _ { 1 }$ and $T _ { 2 }$ depending on whether respectively $F$ is True or False as follows:
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
\begin{array} { r } { \mathbf { \rho } ( h , t \mid r ) = \underbrace { \mathbb { E } _ { c , c ^ { \prime } } \left[ \frac { \exp \big ( h ^ { \top } \mathbf { R } _ { 1 } c \big ) } { Z _ { c } } \frac { \exp \big ( h ^ { \top } \mathbf { R } _ { 2 } c ^ { \prime } \big ) } { Z _ { c ^ { \prime } } } \mathbf { 1 } _ { F } \right] } _ { = T _ { 1 } } + \underbrace { \mathbb { E } _ { c , c ^ { \prime } } \left[ \frac { \exp \big ( h ^ { \top } \mathbf { R } _ { 1 } c \big ) } { Z _ { c } } \frac { \exp \big ( h ^ { \top } \mathbf { R } _ { 2 } c ^ { \prime } \big ) } { Z _ { c ^ { \prime } } } \mathbf { 1 } _ { \bar { F } } \right] } _ { = T _ { 2 } } . } \end{array}
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
Here, ${ \bf 1 } _ { F }$ and ${ \mathbf { 1 } } _ { \bar { F } }$ are indicator functions given by:
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
\mathbf { 1 } _ { F } = { \left\{ \begin{array} { l l } { 1 } & { { \mathrm { i f ~ } } F { \mathrm { ~ i s ~ T r u e , } } } \\ { 0 } & { { \mathrm { o t h e r w i s e , } } } \end{array} \right. }
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
and
|
| 328 |
+
|
| 329 |
+
$$
|
| 330 |
+
\mathbf { 1 } _ { \bar { F } } = \left\{ \begin{array} { l l } { 0 } & { \mathrm { i f ~ } F \mathrm { ~ i s ~ T r u e , } } \\ { 1 } & { \mathrm { o t h e r w i s e . } } \end{array} \right.
|
| 331 |
+
$$
|
| 332 |
+
|
| 333 |
+
Let us first show that $T _ { 2 }$ is negligibly small.
|
| 334 |
+
|
| 335 |
+
For two real integrable functions $\psi _ { 1 } ( x )$ and $\psi _ { 2 } ( x )$ in $[ a , b ]$ , the Cauchy-Schwarz’s inequality states that
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
\left[ \int _ { a } ^ { b } \psi _ { 1 } ( x ) \psi _ { 2 } ( x ) d x \right] ^ { 2 } \leq \int _ { a } ^ { b } \left[ \psi _ { 1 } ( x ) \right] ^ { 2 } d x \int _ { a } ^ { b } \left[ \psi _ { 2 } ( x ) \right] ^ { 2 } d x .
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
Applying (32) to $T _ { 2 }$ in (29) we have:
|
| 342 |
+
|
| 343 |
+
$$
|
| 344 |
+
\begin{array} { r l } & { \left( \mathbb { E } _ { c , c ^ { \prime } } \left[ \frac { 1 } { Z _ { c } Z _ { c ^ { \prime } } } \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) \exp \left( t ^ { \top } \mathbf { R } _ { 2 } c ^ { \prime } \right) \mathbf { 1 } _ { \bar { F } } \right] \right) ^ { 2 } } \\ & { \leq \left( \mathbb { E } _ { c , c ^ { \prime } } \left[ \frac { 1 } { Z _ { c } ^ { 2 } } \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) ^ { 2 } \mathbf { 1 } _ { \bar { F } } \right] \right) \left( \mathbb { E } _ { c , c ^ { \prime } } \left[ \frac { 1 } { Z _ { c ^ { \prime } } ^ { 2 } } \exp \left( t ^ { \top } \mathbf { R } _ { 2 } c ^ { \prime } \right) ^ { 2 } \mathbf { 1 } _ { \bar { F } } \right] \right) } \\ & { = \left( \mathbb { E } _ { c } \left[ \frac { 1 } { Z _ { c } ^ { 2 } } \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) ^ { 2 } \mathbb { E } _ { c ^ { \prime } \mid c } \left[ \mathbf { 1 } _ { \bar { F } } \right] \right] \right) \left( \mathbb { E } _ { c ^ { \prime } } \left[ \frac { 1 } { Z _ { c ^ { \prime } } ^ { 2 } } \exp \left( t ^ { \top } \mathbf { R } _ { 2 } c ^ { \prime } \right) ^ { 2 } \mathbb { E } _ { c \mid c ^ { \prime } } \left[ \mathbf { 1 } _ { \bar { F } } \right] \right] \right) } \end{array}
|
| 345 |
+
$$
|
| 346 |
+
|
| 347 |
+
Note that $Z _ { c } \geq 1$ because $Z _ { c }$ is the sum of positive numbers and if ${ \pmb h } ^ { \top } { \pmb R } _ { 1 } { \pmb c } \geq 0$ for at least one of the $h \in \mathcal V$ , then the total sum will be greater than 1. Therefore, by dropping $Z _ { c }$ term from the denominator we can further increase the first term in (33) as given by (34).
|
| 348 |
+
|
| 349 |
+
$$
|
| 350 |
+
\mathbb { E } _ { c } \left[ \frac { 1 } { Z _ { c } ^ { 2 } } \exp \left( \pmb { h } ^ { \top } \mathbf { R } _ { 1 } c \right) ^ { 2 } \mathbb { E } _ { c ^ { \prime } \mid c } \left[ \mathbf { 1 } _ { \bar { F } } \right] \right] \le \mathbb { E } _ { c } \left[ \exp \left( \pmb { h } ^ { \top } \mathbf { R } _ { 1 } c \right) ^ { 2 } \mathbb { E } _ { c ^ { \prime } \mid c } \left[ \mathbf { 1 } _ { \bar { F } } \right] \right]
|
| 351 |
+
$$
|
| 352 |
+
|
| 353 |
+
Let us split the expectation on the R.H.S. of (34) into two cases depending on whether ${ \pmb h } ^ { \top } { \pmb R } _ { 1 } { \pmb c } > 0$ or otherwise, indicated respectively by 1(h>R1c>0) and 1(h>R1c≤0).
|
| 354 |
+
|
| 355 |
+
$$
|
| 356 |
+
\begin{array} { r l } & { \mathbb { E } _ { c } \left[ \exp \left( \boldsymbol { h } ^ { \top } \mathbf { R } _ { 1 } c \right) ^ { 2 } \mathbb { E } _ { c ^ { \prime } \mid c } \left[ \mathbf { 1 } _ { \bar { F } } \right] \right] } \\ & { = \mathbb { E } _ { c } \left[ \exp \left( \boldsymbol { h } ^ { \top } \mathbf { R } _ { 1 } c \right) ^ { 2 } \mathbf { 1 } _ { \left( \boldsymbol { h } ^ { \top } \mathbf { R } _ { 1 } c > 0 \right) } \mathbb { E } _ { c ^ { \prime } \mid c } \left[ \mathbf { 1 } _ { \bar { F } } \right] \right] + \mathbb { E } _ { c } \left[ \exp \left( \boldsymbol { h } ^ { \top } \mathbf { R } _ { 1 } c \right) ^ { 2 } \mathbf { 1 } _ { \left( \boldsymbol { h } ^ { \top } \mathbf { R } _ { 1 } c \leq 0 \right) } \mathbb { E } _ { c ^ { \prime } \mid c } \left[ \mathbf { 1 } _ { \bar { F } } \right] \right] } \end{array}
|
| 357 |
+
$$
|
| 358 |
+
|
| 359 |
+
The second term of (35) is upper bounded by
|
| 360 |
+
|
| 361 |
+
$$
|
| 362 |
+
\mathbb { E } _ { c , c ^ { \prime } } \left[ \mathbf { 1 } _ { \bar { F } } \right] \leq \exp \left( - \Omega ( \log ^ { 2 } n ) \right)
|
| 363 |
+
$$
|
| 364 |
+
|
| 365 |
+
The first term of (35) can be bounded as follows:
|
| 366 |
+
|
| 367 |
+
$$
|
| 368 |
+
\begin{array} { r l } & { \mathbb { E } _ { c } \left[ \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) ^ { 2 } \mathbf { 1 } _ { ( h ^ { \top } \mathbf { R } _ { 1 } c > 0 ) } \mathbb { E } _ { c ^ { \prime } \mid c } \left[ \mathbf { 1 } _ { \bar { F } } \right] \right] \leq \mathbb { E } _ { c } \left[ \exp \left( \alpha h ^ { \top } \mathbf { R } _ { 1 } c \right) ^ { 2 } \mathbf { 1 } _ { ( h ^ { \top } \mathbf { R } _ { 1 } c > 0 ) } \mathbb { E } _ { c ^ { \prime } \mid c } \left[ \mathbf { 1 } _ { \bar { F } } \right] \right] } \\ & { \qquad \leq \mathbb { E } _ { c } \left[ \exp \left( \alpha h ^ { \top } \mathbf { R } _ { 1 } c \right) ^ { 2 } \mathbb { E } _ { c ^ { \prime } \mid c } \left[ \mathbf { 1 } _ { \bar { F } } \right] \right] } \end{array}
|
| 369 |
+
$$
|
| 370 |
+
|
| 371 |
+
where $\alpha > 1$ . Therefore, it is sufficient to bound $\mathbb { E } _ { c } \left[ \exp ( \alpha h ^ { \top } \mathbf { R } _ { 1 } c ) ^ { 2 } \mathbb { E } _ { c ^ { \prime } | c } \left[ \mathbf { 1 } _ { \bar { F } } \right] \right]$ when $\left\| h \right\| =$ $\Omega ( { \sqrt { d } } )$ .
|
| 372 |
+
|
| 373 |
+
Let us denote by $z$ the random variable $2 h ^ { \top } { \bf R } _ { 1 } c$ . Moreover, let $r ( z ) = \mathbb { E } _ { c ^ { \prime } | z } [ \mathbf { 1 } _ { \bar { F } } ]$ , which is a function of $z$ between $[ 0 , 1 ]$ . We wish to upper bound $\mathbb { E } _ { c } [ \exp ( z ) r ( z ) ]$ . The worst-case $r ( z )$ can be quantified using a continuous version of Abel’s inequality (proved as Lemma A.4 in Arora et al. (2016b)), we can upper bound $\mathbb { E } _ { c } \left[ \exp ( z ) r ( z ) \right]$ as follows:
|
| 374 |
+
|
| 375 |
+
$$
|
| 376 |
+
\mathbb { E } _ { c } \left[ \exp ( z ) r ( z ) \right] \leq \mathbb { E } \left[ \exp ( z ) \mathbf { 1 } _ { [ t , + \infty ] } ( z ) \right]
|
| 377 |
+
$$
|
| 378 |
+
|
| 379 |
+
where $t$ satisfies that $\begin{array} { r } { \mathbb { E } _ { c } [ \mathbf { 1 } _ { [ t , + \infty ] } ( z ) ] = \operatorname* { P r } [ z \geq t ] = \mathbb { E } _ { c } [ r ( z ) ] \leq \exp ( - \Omega ( \log ^ { 2 } n ) ) } \end{array}$ . Here, $\mathbf { 1 } _ { [ t , + \infty ] } ( z )$ is a function that takes the value 1 when $z \geq t$ and zero elsewhere. Then, we claim $\mathrm { P r } _ { c } [ z \ge t ] \le$ $\exp ( - \Omega ( \log ^ { 2 } n ) )$ implies that $t \geq \Omega ( \log ^ { . 9 } n )$ .
|
| 380 |
+
|
| 381 |
+
If $c$ was distributed as $\mathcal { N } ( 0 , \frac { 1 } { d } \mathbf { I } )$ , this would be a simple tail bound. However, as $c$ is distributed uniformly on the sphere, this requires special care, and the claim follows by applying the tail bound for the spherical distribution given by Lemma A.1 in (Arora et al., 2016a) instead. Finally, applying Corollary A.3 in (Arora et al., 2016a), we have:
|
| 382 |
+
|
| 383 |
+
$$
|
| 384 |
+
\mathbb { E } [ \exp ( z ) r ( z ) ] \leq \mathbb { E } [ \exp ( z ) \mathbf { 1 } _ { [ t , + \infty ] } ( z ) ] = \exp ( - \Omega ( \log ^ { 1 . 8 } n ) )
|
| 385 |
+
$$
|
| 386 |
+
|
| 387 |
+
From a similar argument as above we can obtain the same bound for $c ^ { \prime }$ as well. Therefore, $T _ { 2 }$ in (29) can be upper bounded as follows:
|
| 388 |
+
|
| 389 |
+
$$
|
| 390 |
+
\begin{array} { r l } & { \mathbb { E } _ { c , c ^ { \prime } } \left[ \frac { 1 } { Z _ { c } Z _ { c ^ { \prime } } } \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) \exp \left( t ^ { \top } \mathbf { R } _ { 2 } c ^ { \prime } \right) \mathbf { 1 } _ { \bar { F } } \right] } \\ & { = \left( \mathbb { E } _ { c } \left[ \frac { 1 } { Z _ { c } ^ { 2 } } \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) ^ { 2 } \mathbb { E } _ { c ^ { \prime } \mid c } \left[ \mathbf { 1 } _ { \bar { F } } \right] \right) \right) ^ { 1 / 2 } \left( \mathbb { E } _ { c ^ { \prime } } \left[ \frac { 1 } { Z _ { c ^ { \prime } } ^ { 2 } } \exp \left( t ^ { \top } \mathbf { R } _ { 2 } c ^ { \prime } \right) ^ { 2 } \mathbb { E } _ { c \mid c ^ { \prime } } \left[ \mathbf { 1 } _ { \bar { F } } \right] \right] \right) ^ { 1 / 2 } } \\ & { \leq \exp ( - \Omega ( \log ^ { 1 . 8 } n ) ) } \end{array}
|
| 391 |
+
$$
|
| 392 |
+
|
| 393 |
+
Because $n = | \mathcal { V } |$ , the size of the entity vocabulary, is large (ca. $n > 1 0 ^ { 5 }$ ) in most knowledge graphs, we can ignore the $T _ { 2 }$ term in (29). Combining this with (29) we obtain an upper bound for $p ( h , t \mid R )$ given by (41).
|
| 394 |
+
|
| 395 |
+
$$
|
| 396 |
+
\begin{array} { r l } & { p ( h , t \mid R ) \leq \left( 1 + \epsilon _ { z } \right) ^ { 2 } \frac { 1 } { Z ^ { 2 } } \mathbb { E } _ { c , c ^ { \prime } } \left[ \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) \exp \left( t ^ { \top } \mathbf { R } _ { 2 } c ^ { \prime } \right) \mathbf { 1 } _ { F } \right] + | \mathcal { D } | \exp \left( - \Omega ( \log ^ { 1 . 8 } n ) \right) } \\ & { \phantom { \left( 1 + \epsilon _ { z } \right) ^ { 2 } } = \left( 1 + \epsilon _ { z } \right) ^ { 2 } \frac { 1 } { Z ^ { 2 } } \mathbb { E } _ { c , c ^ { \prime } } \left[ \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) \exp \left( t ^ { \top } \mathbf { R } _ { 2 } c ^ { \prime } \right) \right] + \delta _ { 0 } \phantom { \left( 1 + \epsilon _ { z } \right) ^ { 2 } } ( \mathrm { a v e } ^ { 2 } + \mathrm { b } _ { 0 } ^ { 2 } ) , } \end{array}
|
| 397 |
+
$$
|
| 398 |
+
|
| 399 |
+
where $| \mathcal D |$ is the number of relational tuples $( h , R , t )$ in the KB $\mathcal { D }$ and $\delta _ { 0 } = | \mathcal { D } | \exp ( - \Omega ( \log ^ { 1 . 8 } n ) ) \leq$ $\exp ( - \Omega ( \log ^ { 1 . 8 } n ) )$ by the fact that $Z \le \exp ( 2 \kappa ) n = O ( n )$ , where $\kappa$ is the upper bound on $\mathbf { \Sigma } _ { h } \top \mathbf { R } _ { 1 } c$ and ${ \pmb t } ^ { \top } { \pmb R } _ { 2 } c ^ { \prime }$ , which is regarded as a constant.
|
| 400 |
+
|
| 401 |
+
On the other hand, we can lower bound $p ( h , t \mid R )$ as given by (42).
|
| 402 |
+
|
| 403 |
+
$$
|
| 404 |
+
\begin{array} { r l } & { p ( h , t \mid R ) \ge ( 1 - \epsilon _ { z } ) ^ { 2 } \frac { 1 } { Z ^ { 2 } } \mathbb { E } _ { c , c ^ { \prime } } \left[ \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) \exp \left( t ^ { \top } \mathbf { R } _ { 2 } c ^ { \prime } \right) \mathbf { 1 } _ { F } \right] } \\ & { \qquad \ge ( 1 - \epsilon _ { z } ) ^ { 2 } \frac { 1 } { Z ^ { 2 } } \mathbb { E } _ { c , c ^ { \prime } } \left[ \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) \exp \left( t ^ { \top } \mathbf { R } _ { 2 } c ^ { \prime } \right) \right] - | \mathcal { D } | \exp ( - \Omega ( \log ^ { 1 . 8 } n ) ) } \\ & { \qquad \ge ( 1 - \epsilon _ { z } ) ^ { 2 } \frac { 1 } { Z ^ { 2 } } \mathbb { E } _ { c , c ^ { \prime } } \left[ \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) \exp \left( t ^ { \top } \mathbf { R } _ { 2 } c ^ { \prime } \right) \right] - \delta _ { 0 } } \end{array}
|
| 405 |
+
$$
|
| 406 |
+
|
| 407 |
+
Taking the logarithm of both sides, from (41) and (42), the multiplicative error translates to an additive error given by (43).
|
| 408 |
+
|
| 409 |
+
$$
|
| 410 |
+
\begin{array} { r l r } { \log p ( h , t \mid R ) = \log \left( \mathbb { E } _ { c , c ^ { \prime } } \left[ \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) \exp \left( t ^ { \top } \mathbf { R } _ { 2 } c ^ { \prime } \right) \right] \pm \delta _ { 0 } \right) - 2 \log Z + 2 \log ( 1 \pm \epsilon _ { z } ) } & \\ { = \log \left( \mathbb { E } _ { c } \left[ \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) \mathbb { E } _ { c ^ { \prime } \mid c } \left[ \exp \left( t ^ { \top } \mathbf { R } _ { 2 } c ^ { \prime } \right) \right] \right] \pm \delta _ { 0 } \right) - 2 \log Z + 2 \log ( 1 \pm \epsilon _ { z } ) } & \\ { = \log \left( \mathbb { E } _ { c } \left[ \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) A ( c ) \pm \delta _ { 0 } \right] \right) - 2 \log Z + 2 \log ( 1 \pm \epsilon _ { z } ) } & { ( 4 3 \pi ) } & \end{array}
|
| 411 |
+
$$
|
| 412 |
+
|
| 413 |
+
where $A ( c ) : = \mathbb { E } _ { c ^ { \prime } \mid c } \left[ \exp \left( t ^ { \top } \mathbf { R } _ { 2 } c ^ { \prime } \right) \right]$ .
|
| 414 |
+
|
| 415 |
+
We assumed that $^ c$ and $c ^ { \prime }$ are on the unit sphere and $\mathbf { R } _ { 1 }$ and $\mathbf { R } _ { 2 }$ to be orthogonal matrices. Therefore, $\mathbf { R } _ { 1 } \boldsymbol { c }$ and $\mathbf { R } _ { 2 } { \pmb { c } } ^ { \prime }$ are also on the unit sphere. Moreover, if we let the upper bound of the $\ell _ { 2 }$ norm of the entity embeddings to be $\kappa ^ { \prime } \sqrt { d }$ , then we have $\| h \| \leq \kappa ^ { \prime } \sqrt { d }$ and $\| \pmb { t } \| \leq \kappa ^ { \prime } \sqrt { d }$ . Therefore, we have
|
| 416 |
+
|
| 417 |
+
$$
|
| 418 |
+
\langle R _ { 1 } h , c ^ { \prime } - c \rangle \leq \| h \| \| c - c ^ { \prime } \| \leq \kappa ^ { \prime } \sqrt { d } \| c - c ^ { \prime } \|
|
| 419 |
+
$$
|
| 420 |
+
|
| 421 |
+
Then we can lower bound $A ( c )$ as follows:
|
| 422 |
+
|
| 423 |
+
$$
|
| 424 |
+
\begin{array} { r l } & { A ( c ) = \exp \left( t ^ { \top } \mathbf { R } _ { 2 } c \right) \mathbb { E } _ { c ^ { \prime } \mid c } \left[ \exp \left( t ^ { \top } \mathbf { R } _ { 2 } ( c ^ { \prime } - c ) \right) \right] } \\ & { \qquad \leq \exp \left( t ^ { \top } \mathbf { R } _ { 2 } c \right) \mathbb { E } _ { c ^ { \prime } \mid c } \left[ \exp \left( \kappa ^ { \prime } \sqrt { d } \| c ^ { \prime } - c \| \right) \right] } \\ & { \qquad \leq \left( 1 + \epsilon _ { 2 } \right) \exp \left( t ^ { \top } \mathbf { R } _ { 2 } c \right) } \end{array}
|
| 425 |
+
$$
|
| 426 |
+
|
| 427 |
+
For some $\epsilon _ { 2 } > 0$ . The last inequality holds because
|
| 428 |
+
|
| 429 |
+
$$
|
| 430 |
+
\begin{array} { r l } & { \mathbb { E } _ { c | c ^ { \prime } } \left[ \exp \left( \kappa ^ { \prime } \sqrt { d } \| c ^ { \prime } - c \| \right) \right] = \displaystyle \int \exp \left( \kappa ^ { \prime } \sqrt { d } \| c ^ { \prime } - c \| \right) p ( c ^ { \prime } | c ) d c ^ { \prime } } \\ & { \quad \quad \quad = \underbrace { \exp ( \kappa ^ { \prime } \sqrt { d } ) } _ { \geq 1 } \underbrace { \int \exp ( \| c - c ^ { \prime } \| ) p ( c ^ { \prime } | c ) d c ^ { \prime } } _ { \geq 1 } } \\ & { \quad \quad = 1 + \epsilon _ { 2 } } \end{array}
|
| 431 |
+
$$
|
| 432 |
+
|
| 433 |
+
To obtain a lower bound on $A ( c )$ from the first-order Taylor approximation of $\exp ( x ) \geq 1 + x$ we observe that
|
| 434 |
+
|
| 435 |
+
$$
|
| 436 |
+
\mathbb { E } _ { c | c ^ { \prime } } \left[ \exp \left( \kappa ^ { \prime } \sqrt { d } \| c ^ { \prime } - c \| \right) \right] + \mathbb { E } _ { c | c ^ { \prime } } \left[ \exp \left( - \kappa ^ { \prime } \sqrt { d } \| c ^ { \prime } - c \| \right) \right] \geq 2 .
|
| 437 |
+
$$
|
| 438 |
+
|
| 439 |
+
Therefore, from our model assumptions we have
|
| 440 |
+
|
| 441 |
+
$$
|
| 442 |
+
\begin{array} { r } { \mathbb { E } _ { c | c ^ { \prime } } \left[ \exp \left( - \kappa ^ { \prime } \sqrt { d } \| c ^ { \prime } - c \| \right) \right] \geq 1 - \epsilon _ { 2 } } \end{array}
|
| 443 |
+
$$
|
| 444 |
+
|
| 445 |
+
Hence,
|
| 446 |
+
|
| 447 |
+
$$
|
| 448 |
+
\begin{array} { r l } & { A ( c ) = \exp \left( t ^ { \top } \mathbf { R } _ { 2 } c \right) \mathbb { E } _ { c ^ { \prime } \mid c } \left[ \exp \left( t ^ { \top } \mathbf { R } _ { 2 } ( c ^ { \prime } - c ) \right) \right] } \\ & { \qquad \geq \exp \left( t ^ { \top } \mathbf { R } _ { 2 } c \right) \mathbb { E } _ { c ^ { \prime } \mid c } \left[ \exp \left( - \kappa ^ { \prime } \sqrt { d } \| c ^ { \prime } - c \| \right) \right] } \\ & { \qquad \geq \left( 1 - \epsilon _ { 2 } \right) \exp \left( t ^ { \top } \mathbf { R } _ { 2 } c \right) } \end{array}
|
| 449 |
+
$$
|
| 450 |
+
|
| 451 |
+
Therefore, from (46) and (49) we have
|
| 452 |
+
|
| 453 |
+
$$
|
| 454 |
+
A ( c ) = ( 1 \pm \epsilon _ { 2 } ) \exp \left( t ^ { \top } { \bf R } _ { 2 } c \right)
|
| 455 |
+
$$
|
| 456 |
+
|
| 457 |
+
Plugging $A ( c )$ back in (43) we obtain
|
| 458 |
+
|
| 459 |
+
$$
|
| 460 |
+
\begin{array} { r l } & { \mathrm { o g } p ( h , t \mid R ) = \log \left( \mathbb { E } _ { c } \left[ \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) A ( c ) \pm \delta _ { 0 } \right] \right) - 2 \log Z + 2 \log ( 1 \pm \epsilon _ { z } ) } \\ & { \qquad = \log \left( \mathbb { E } _ { c } \left[ \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) \left( 1 \pm \epsilon _ { 2 } \right) \exp \left( t ^ { \top } \mathbf { R } _ { 2 } c \right) \pm \delta _ { 0 } \right] \right) - 2 \log Z + 2 \log ( 1 \pm \epsilon _ { z } ) } \\ & { \qquad = \log \left( \mathbb { E } _ { c } \left[ \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c \right) \exp \left( t ^ { \top } \mathbf { R } _ { 2 } c \right) \pm \delta _ { 0 } \right] \right) - 2 \log Z + 2 \log ( 1 \pm \epsilon _ { z } ) + \log ( 1 \pm \epsilon _ { 2 } ) } \\ & { \qquad = \log \left( \mathbb { E } _ { c } \left[ \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c + t ^ { \top } \mathbf { R } _ { 2 } c \right) \pm \delta _ { 0 } \right] \right) - 2 \log Z + 2 \log ( 1 \pm \epsilon _ { z } ) + \log ( 1 \pm \epsilon _ { 2 } ) } \\ & { \qquad = \log \left( \mathbb { E } _ { c } \left[ \exp \left( h ^ { \top } \mathbf { R } _ { 1 } c + t ^ { \top } \mathbf { R } _ { 2 } c \right) \pm \delta _ { 0 } \right] \right) - 2 \log Z + 2 \log ( 1 \pm \epsilon _ { z } ) + \log ( 1 \pm \epsilon _ { 2 } ) } \\ & { \qquad = \log \left( \mathbb { E } _ { c } \left[ \exp \left( \mathbf { R } _ { 1 } ^ { \top } h + \mathbf { R } _ { 2 } ^ { \top } t \right) ^ { \top } c \pm \delta _ { 0 } \right] \right) - 2 \log Z + 2 \log ( 1 \pm \epsilon _ { z } ) + \log ( 1 \pm \epsilon _ { 2 } ) } \end{array}
|
| 461 |
+
$$
|
| 462 |
+
|
| 463 |
+
Note that $^ c$ has a uniform distribution over the unit sphere. In this case, from Lemma A.5 in (Arora et al., 2016b), (52) holds approximately.
|
| 464 |
+
|
| 465 |
+
$$
|
| 466 |
+
\mathbb { E } _ { c } \left[ \exp \left( { \mathbf { R } _ { 1 } } ^ { \top } { \pmb { h } } + { \mathbf { R } _ { 2 } } ^ { \top } { \pmb { t } } \right) ^ { \top } { \pmb { c } } \right] = \left( 1 \pm \epsilon _ { 3 } \right) \exp \left( \frac { \| { \mathbf { R } _ { 1 } } ^ { \top } { \pmb { h } } + { \mathbf { R } _ { 2 } } ^ { \top } { \pmb { t } } \| ^ { 2 } } { 2 d } \right)
|
| 467 |
+
$$
|
| 468 |
+
|
| 469 |
+
where $\epsilon _ { 3 } = \tilde { O } ( 1 / d )$ . Plugging (52) in (51) we have that
|
| 470 |
+
|
| 471 |
+
$$
|
| 472 |
+
\log p ( h , t \mid R ) = \frac { \| \mathbf R _ { 1 } ^ { \top } h + \mathbf R _ { 2 } ^ { \top } t \| _ { 2 } ^ { 2 } } { 2 d } + O ( \epsilon _ { z } ) + O ( \epsilon _ { 2 } ) + O ( \epsilon _ { 3 } ) + O ( \delta _ { 0 } ^ { \prime } ) - 2 \log Z
|
| 473 |
+
$$
|
| 474 |
+
|
| 475 |
+
where $\delta _ { 0 } ^ { \prime } = \delta _ { 0 } \cdot \left( { \mathbb E } _ { c } \left[ \exp \left( ( { \mathbf R _ { 1 } } ^ { \top } { \pmb h } + { \mathbf R _ { 2 } } ^ { \top } { \pmb t } ) ^ { \top } { \pmb c } \right) \right] \right) ^ { - 1 } = \exp ( - \Omega ( \log ^ { 1 . 8 } n ) )$ . Therefore, $\delta _ { 0 } ^ { \prime }$ can be ignored. Note that $\epsilon _ { 3 } = \tilde { O } ( 1 / d )$ and $\epsilon _ { z } = { \tilde { O } } ( 1 / { \sqrt { n } } )$ by assumption. Therefore, we obtain that
|
| 476 |
+
|
| 477 |
+
$$
|
| 478 |
+
\log p ( h , t \mid \boldsymbol { R } ) = \frac { \| \mathbf { R } _ { 1 } ^ { \top } \boldsymbol { h } + \mathbf { R } _ { 2 } ^ { \top } \boldsymbol { t } \| _ { 2 } ^ { 2 } } { 2 d } + O ( \epsilon _ { z } ) + O ( \epsilon _ { 2 } ) + \tilde { O } ( 1 / d ) - 2 \log Z
|
| 479 |
+
$$
|
| 480 |
+
|
| 481 |
+
# B LEARNING WITH MULTIPLE NEGATIVE TRIPLES
|
| 482 |
+
|
| 483 |
+
In this section, we show how the margin loss-based learning objective derived in section 3 can be extended to learn from more than one negative triples per each positive triple. This formulation leads to rank-based loss objective used in prior work on KGE. Considering that negative triples are generated via random perturbation, it is important to consider multiple negative triples during training to better estimate the classification boundary.
|
| 484 |
+
|
| 485 |
+
Let us consider that we are given a positive triple, $( h , R , t )$ and a set of $K$ negative triples $\{ ( h _ { k } ^ { \prime } , R , t _ { k } ^ { \prime } ) \} _ { k = 1 } ^ { K }$ . We would like our model to assign a probability, $p ( h , t \mid R )$ , to the positive triple that is higher than that assigned to any of the negative triples. This requirement can be written as (55).
|
| 486 |
+
|
| 487 |
+
$$
|
| 488 |
+
p ( h , t | R ) \geq \operatorname* { m a x } _ { k = 1 , \ldots , K } p ( h _ { k } ^ { \prime } , t _ { k } ^ { \prime } \mid R )
|
| 489 |
+
$$
|
| 490 |
+
|
| 491 |
+
We could further require the ratio between the probability of the positive triple and maximum probability over all negative triples to be greater than a threshold $\eta \geq 1$ to make the requirement of (55) to be tighter.
|
| 492 |
+
|
| 493 |
+
$$
|
| 494 |
+
\frac { p ( h , t \mid R ) } { \underset { k = 1 , \dots , K } { \operatorname* { m a x } } p ( h _ { k } ^ { \prime } , t _ { k } ^ { \prime } \mid R ) } \geq \eta
|
| 495 |
+
$$
|
| 496 |
+
|
| 497 |
+
By taking the logarithm of (56) we obtain
|
| 498 |
+
|
| 499 |
+
$$
|
| 500 |
+
\log p ( h , t \mid R ) - \log \left( \operatorname* { m a x } _ { k = 1 , \ldots , K } p ( h _ { k } ^ { \prime } , t _ { k } ^ { \prime } \mid R ) \right) \geq \log ( \eta )
|
| 501 |
+
$$
|
| 502 |
+
|
| 503 |
+
Therefore, we can define the margin loss for a misclassification as follows:
|
| 504 |
+
|
| 505 |
+
$$
|
| 506 |
+
L \left( ( h , R , t ) , \{ ( h _ { k } ^ { \prime } , R , t _ { k } ^ { \prime } ) \} _ { k = 1 } ^ { K } \right) = \operatorname* { m a x } \left( 0 , \log \left( \operatorname* { m a x } _ { k = 1 , \ldots , K } p ( h _ { k } ^ { \prime } , t _ { k } ^ { \prime } \mid R ) \right) + \log ( \eta ) - \log p ( h , t \mid R ) \right)
|
| 507 |
+
$$
|
| 508 |
+
|
| 509 |
+
However, from the monotonicity of the logarithm we have $\forall x _ { 1 } , x _ { 2 } \ > \ 0$ , if $\log ( x _ { 1 } ) \geq \log ( x _ { 2 } )$ then $x _ { 1 } \geq x _ { 2 }$ . Therefore, the logarithm of the maximum can be replaced by the maximum of the logarithms in (58) as shown in (59).
|
| 510 |
+
|
| 511 |
+
$$
|
| 512 |
+
L \left( ( h , R , t ) , \{ ( h _ { k } ^ { \prime } , R , t _ { k } ^ { \prime } ) \} _ { k = 1 } ^ { K } \right) = \operatorname* { m a x } \left( 0 , \operatorname* { m a x } _ { k = 1 , \ldots , K } \log \left( p ( h _ { k } ^ { \prime } , t _ { k } ^ { \prime } \mid R ) \right) + \log ( \eta ) - \log p ( h , t \mid R ) \right)
|
| 513 |
+
$$
|
| 514 |
+
|
| 515 |
+
By substituting (18) for the probabilities in (59) we obtain the rank-based loss given by (60).
|
| 516 |
+
|
| 517 |
+
$$
|
| 518 |
+
\overset { : } { \underset { ( ( h , R , t ) , } { ( ( h , R , t ) , } \{ ( h _ { k } ^ { \prime } , R , t _ { k } ^ { \prime } ) \} _ { k = 1 } ^ { K } ) } = \operatorname* { m a x } ( 0 , 2 d \log ( \eta ) + \underset { k = 1 , \ldots , K } { \operatorname* { m a x } } \| \mathbf { R } _ { 1 } ^ { \top } h _ { k } ^ { \prime } + \mathbf { R } _ { 2 } ^ { \top } t _ { k } ^ { \prime } \| _ { 2 } ^ { 2 } - \| \mathbf { R } _ { 1 } ^ { \top } h + \mathbf { R } _ { 2 } ^ { \top } t \| _ { 2 } ^ { 2 } )
|
| 519 |
+
$$
|
| 520 |
+
|
| 521 |
+
In practice, we can use $p ( h _ { k } ^ { \prime } , t _ { k } ^ { \prime } \mid { \cal R } )$ to select the negative triple with the highest probability for training with the positive triple.
|
| 522 |
+
|
| 523 |
+
Table 4: Statistics of the datasets
|
| 524 |
+
|
| 525 |
+
<table><tr><td>Dataset</td><td>Relations</td><td>Entities</td><td>Train</td><td>Test</td><td>Validation</td></tr><tr><td>FB15K</td><td>1,345</td><td>14,951</td><td>483,142</td><td>59,071</td><td>50,000</td></tr><tr><td>FB15K237</td><td>237</td><td>14,541</td><td>272,115</td><td>17,535</td><td>20,466</td></tr><tr><td>WN18</td><td>18</td><td>40,943</td><td>141,442</td><td>5,000</td><td>5,000</td></tr><tr><td>WN18RR</td><td>11</td><td>40,943</td><td>86.835</td><td>3,134</td><td>3,034</td></tr><tr><td>WN11</td><td>11</td><td>38,588</td><td>112,581</td><td>10,544</td><td>2,609</td></tr><tr><td>FB13</td><td>13</td><td>75,043</td><td>316,232</td><td>23,733</td><td>5,908</td></tr></table>
|
| 526 |
+
|
| 527 |
+
# C TRAINING DETAILS
|
| 528 |
+
|
| 529 |
+
The statistics of the benchmark datasets are show in Table 4.
|
| 530 |
+
|
| 531 |
+
We selected the initial learning rate $( \alpha )$ for SGD in $\{ 0 . 0 1 , 0 . 0 0 1 \}$ , the regularisation coefficients $( \lambda _ { 1 } , \lambda _ { 2 } )$ for the orthogonality constraints of relation matrices in $\{ 0 , 1 , 1 0 , 1 0 0 \}$ . The number of randomly generated negative triples $n _ { \mathrm { n { e g } } }$ for each positive example is varied in $\{ 1 , 1 0 , 2 0 , 5 0 , 1 0 0 \}$ and $d \in \{ 5 0 , 1 0 0 \}$ . Optimal hyperparameter settings were: $\lambda _ { 1 } = \lambda _ { 2 } = 1 0$ , $n _ { \mathrm { n { e g } } } = 1 0 0$ for all the datasets, $\alpha = 0 . 0 0 1$ for FB15K, FB15K237 and FB13, $\alpha = 0 . 0 1$ for WN18, WN18RR and WN11. For FB15K237 and WN18RR $d = 1 0 0$ was the best, whereas for all other datasets $d = 5 0$ performed best.
|
md/train/TmkN9JmDJx1/TmkN9JmDJx1.md
ADDED
|
@@ -0,0 +1,502 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# THINKING LIKE TRANSFORMERS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
What is the computational model behind a transformer? Where recurrent neural networks have direct parallels in finite state machines, allowing clear discussion and thought around architecture variants or trained models, transformers have no such familiar parallel. In this paper we aim to change that, proposing a computational model for the transformer-encoder in the form of a programming language. We map the basic components of a transformer-encoder – attention and feed-forward computation – into the simple primitives of select, aggregate and zipmap, around which we form a programming language: the Restricted Access Sequence Processing Language (RASP). We show how RASP can be used to program solutions to tasks that could conceivably be learned by a transformer, augmenting it with tools we discover in our work. In particular, we provide RASP programs for histograms, sorting, and even logical inference similar to that of Clark et al. (2020). We further use our model to relate their difficulty in terms of the number of required layers and attention heads. Finally, we see how insights gained from our abstraction might be used to explain phenomena seen in recent works.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
While Yun et al. (2019) show that sufficiently large transformers can approximate any constantlength sequence-to-sequence function, and Hahn (2019) provides theoretical limitations on their ability to compute functions on unbounded input length, neither of these provide insight on how a transformer may achieve a specific task. Orthogonally, Bhattamishra et al. (2020) provide transformer constructions for several counting languages, but this also does not direct us towards a general model.
|
| 12 |
+
|
| 13 |
+
This is in stark contrast to other neural network architectures, which do have clear computational models. For example, convolution networks are seen as as a sequence of filters (Zhang et al., 2018), and finite-state automata and their variants have been extensively used both for extraction from and theoretical analysis of recurrent neural networks (RNNs) (Omlin & Giles, 1996; Weiss et al., 2018; Rabusseau et al., 2018; Merrill et al., 2020), even inspiring new RNN variants (Joulin & Mikolov, 2015).
|
| 14 |
+
|
| 15 |
+
In this work we propose a computational model for the transformer-encoder, in the form of a simple sequence-processing language which we dub RASP(Restricted Access Sequence Processing Language). Much like how automata describe the token-by-token processing behavior of an RNN, our language captures the unique information flow constraints under which a transformer (Vaswani et al., 2017) operates as it processes input sequences.
|
| 16 |
+
|
| 17 |
+
Considering computation problems and their implementation in the RASP language allows us to “think like a transformer” while abstracting away the technical details of a neural network in favor of symbolic programs. A RASP program operates on sequences of values from uniform atomic types, and transforms them by composing a restricted set of sequence processors. One pair of processors is used to select inputs for aggregation, and then aggregate the selected items. Another processor performs arbitrary but local computation over its (localized) input. However, access to the complete sequence is available only through aggregate operations that reduce a stream of numbers to a scalar. The key to performing complex global computations under this model is to compose the aggregations such that they gather the correct information, that can then be locally processed for a final output.
|
| 18 |
+
|
| 19 |
+
Given a RASP program, we can analyze it to infer the minimal number of layers and maximum number of heads that is required to implement it as a transformer. We show several examples of expressive programs written in the RASP language, showing how complex operations can be implemented by a transformer. Thinking in terms of the RASP model also allows us to shed light on recent empirical observation of transformer variants (Press et al., 2020) and find concrete limitations of “efficient transformers” with restricted-attention (Tay et al., 2020).
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: RASP program taking two sequences vals,keys and returning a sequence y sorting the elements of vals according to keys, e.g.: if vals $( \boldsymbol { x } ) \boldsymbol { = } [ \mathsf { a } , \mathsf { b } , \mathsf { c } ]$ and $\mathtt { k e y s ( x ) = [ } 0 , 4 , 2 \mathtt { l }$ , then $y ( x ) = [ a , \mathsf { c } , \mathsf { b } ]$ .
|
| 23 |
+
|
| 24 |
+
# 2 THE RESTRICTED ACCESS SEQUENCE PROCESSING LANGUAGE
|
| 25 |
+
|
| 26 |
+
In this section, we present the the Restricted Access Sequence Processing Language (RASP). RASP assumes a machine composed of several Turing-complete processors, each of which can only run functions taking and returning a fixed number of primitive arguments, and a simple memory accessor that is controlled by these processors. The select, aggregate, and zipmap operations which we present will define and constrain how the processors work together to process an input sequence.
|
| 27 |
+
|
| 28 |
+
We will focus here only on the language itself, leaving the discussion of its exact relation to transformers to Section 3.
|
| 29 |
+
|
| 30 |
+
Overview A RASP program works by manipulating sequences, occasionally with the help of selectors. Sequences contain values of uniform atomic type, such as booleans, integers, floats, or strings. They are functions used for selecting elements from sequences, and are used (together with the appropriate operations) only in the process of creating new sequences. All sequences in RASP are lazily evaluated, meaning that their length and contents are not populated until passed an input.
|
| 31 |
+
|
| 32 |
+
The Base Sequences Every program in RASP begins from the same set of base sequences, and then creates new ones using a small number of core operations. These base sequences are indices, length, and tokens, evaluated on input $x _ { 1 } , x _ { 2 } , . . . , x _ { n }$ as their names suggest: $( 0 , 1 , . . . , n - 1 )$ , $( n , n , . . . , n )$ (of length $n$ ), and $( x _ { 1 } , x _ { 2 } , . . . , x _ { n } )$ , respectively.
|
| 33 |
+
|
| 34 |
+
Combining Sequences Sequences can be combined in an ‘elementwise’ manner, such that the value of the resulting sequence at each position $i$ is a function of the values in the combined sequences at position $i$ (similar to a map operation), or have positions ‘mixed’ in more complicated ways using selectors, which are functions $f : \mathbb { N } \times \mathbb { N } \to \{ \mathrm { T r u e } , \mathrm { F a l s e } \}$ whose sole purpose is to guide the combination of existing sequences into new ones.
|
| 35 |
+
|
| 36 |
+
We present the basic ingredients of RASP using an example. Figure 1 shows a simple RASP function for sorting a sequence of values according to a sequence of keys. It accepts an input sequence vals and uses the base sequence indices, that is available to any RASP program, to compute its output in three operations as follows:
|
| 37 |
+
|
| 38 |
+
1. count_conditioned of Line 2 creates a new sequence that counts for each element of keys the number of “previous items” it has in keys, where the “previous items” are defined to be all items that have a lesser value, or equal value and lower index. Thus, num_prevs creates a sequence of numbers, representing the target sorted position of each item. 2. select of line 7 creates a new selector which will focus each position $i$ on the corresponding position $j$ for which indices[i] is equal to num_prevs ${ \cdot } j ]$ . Effectively, it will direct the elements in each position $j$ towards their target location $i$ .
|
| 39 |
+
|
| 40 |
+
3. Finally, aggregate of line 8 applies select_sorted_val to vals, moving each $i$ -th element of vals to its calculated sorted position num_prevs[i].
|
| 41 |
+
|
| 42 |
+
We now describe the base operations of RASP in-depth, occasionally presenting an example on the hypothetical input sequence $x$ of length $n$ .
|
| 43 |
+
|
| 44 |
+
• zipmap The zipmap operation takes a tuple of sequences and an element-processing function f, and applies f per-index to the values in those sequences to create a new sequence. For a simple example, $y 1 = z :$ ipmap((indices,indices), lambda ${ \mathrm { i } } , { \mathrm { j } } : { \mathrm { i } } + { \mathrm { j } } )$ creates a sequence that always evaluates to $( 0 , 2 , . . . , 2 n - 2 )$ .
|
| 45 |
+
• aggregate The aggregate operation takes a selector s, a sequence $\mathsf { x }$ , and an optional parameter default, and averages subsets of the values of $\mathsf { x }$ into a new sequence y as follows: for every index $i , y [ i ]$ is the average of $\times [ j _ { 0 } ] , \times [ j _ { 1 } ] , \ldots \times [ j _ { k } ]$ , where $j _ { 0 } , j _ { 1 } , . . . , j _ { k }$ are the indices $j \in [ n ]$ for which $\mathsf { s } ( i , j )$ is True. We say $k$ is the focus width of $s$ at $i$ . If $k = 0$ , then $\mathsf { y } [ j _ { 0 } ]$ is assigned the value in default. For example: if $\mathsf { \Omega } _ { \mathsf { S } } ( i , j )$ returns True iff $i$ is odd and $j { = } 0$ , and the value in default is d, then y will evaluate to $( \mathsf { d } , \mathsf { x } [ 0 ] , \mathsf { d } , \mathsf { x } [ 0 ] , \hdots , \mathsf { y } [ n - 1 ] )$ where $\mathsf { y } [ n - 1 ]$ is either d or $\times [ 0 ]$ depending on the parity of $n$ .
|
| 46 |
+
• select The select operation takes two sequences-tuples of lengths $k$ and $l$ , $\mathfrak { m e } { = } ( \mathfrak { m } _ { 1 } , \mathfrak { m } _ { 2 } , \dots { \cdot } , \mathfrak { m } _ { k } )$ and $\mathsf { o t h e r } = ( \mathsf { o t } _ { 1 } , \mathsf { o t } _ { 2 } , \ldots , \mathsf { o t } _ { l } )$ , and a function $\mathsf { f }$ expecting $k + 1$ atomic values and giving boolean output. It composes these to create a selector s as follows: for every two indices $i , j , s ( i , j )$ is the output of $\mathsf { f }$ on the $i$ -th and $j$ -th slice of me and other respectively, i.e., $s ( i , j ) \mathrm { = } \mathsf { f } ( \mathsf { m } _ { 1 } [ i ] , . . . , \mathsf { m } _ { k } [ i ] , \mathsf { o t } _ { 1 } [ j ] . . . \mathsf { o t } _ { l } [ j ] )$ . For a simple example, in $\mathtt { s } =$ select((indices,),(indices,),lambda mi,oti: $m i \% 2 = = 1$ and $\cot \mathtt { i } = = 0 \dot { }$ ), then $\mathfrak { m } _ { 1 } = \mathrm { i }$ ndices, $\mathsf { o t } _ { 1 } \mathsf { = i }$ ndices, and s is the same selector we used for our example in aggregate above.
|
| 47 |
+
count_conditioned This operation takes the same parameters me,other and $\mathsf { f }$ as select, but this time returns a sequence y describing the number of selected influencing positions $j$ for each output position $i$ that $\mathtt { S } \mathtt { = }$ select(me,other,f) would have created. In other words, for each $i$ , $y [ i ] = k$ where $j _ { 1 } , . . . , j _ { k }$ is the set of positions $j$ for which $s ( i , j ) =$ True. For example, $h = 0$ count_conditioned((tokens,),(tokens,),lambda a,b: $\mathsf { a } \mathsf { = } \mathsf { = } \mathsf { b } .$ ) returns an in-place histogram for the tokens in the input sequence: h(“abaa”) $= ( 3 , 1 , 3 , 3 )$ .
|
| 48 |
+
|
| 49 |
+
This concludes the base operations of RASP – all other operations are shortcuts for combinations of the above 4, occasionally with the base sequences.
|
| 50 |
+
|
| 51 |
+
Sugar We implement RASP with a variety of syntactic sugar, presented fully in appendix E. Briefly:
|
| 52 |
+
|
| 53 |
+
1. When applying zipmap to a single sequence, it may be passed directly without using a tuple, e.g.: zipmap(indices,f) is equivalent to zipmap((indices,),f).
|
| 54 |
+
2. zipmap has sugar for most of the binary operators, e.g.: for two sequences $\mathsf { x } , \mathsf { y } .$ , then $x { + } y$ is sugar for zipmap( $( \mathsf { x } , \mathsf { y } )$ ,lambda $1 , b : a + b )$ .
|
| 55 |
+
3. Whenever the focus width of s at some index is $\leq ~ 1$ (“up-to-one selection”), aggregate(s,x,default=d) does not explicitly compute the division. In this case the values of $\mathsf { x }$ do not have to be numbers.
|
| 56 |
+
4. aggregate accepts one additional optional parameter elementwise_function. The full order of parameters is $s , x$ ,elementwise_function,default, and the use of elementwise_function is as follows: aggregate $( \mathsf { s } , \mathsf { x } , \mathsf { f } , \mathsf { d } )$ is equivalent to aggregate(s,zipmap $( \times , \mathsf { f } )$ ,defaul $\therefore d$ ).
|
| 57 |
+
|
| 58 |
+
# 2.1 EXAMPLES
|
| 59 |
+
|
| 60 |
+
We now present some more example RASP programs, by increasing order of complexity.
|
| 61 |
+
|
| 62 |
+
Simple Examples The first and simplest example is to compute an in-place histogram for some sequence vals. This is achieved with a single application of count_conditioned: histogram=count_conditioned(vals,vals,lambda a, $b : a = = b :$ ).
|
| 63 |
+
|
| 64 |
+
1 def by_frequency (vals , default ) :
|
| 65 |
+
2 hist $=$ count_conditioned (vals ,vals , lambda a,b: $a = = b$ )
|
| 66 |
+
3 num_earlier $=$ count_conditioned (
|
| 67 |
+
4 ( indices , vals ) ,( indices , vals ) ,
|
| 68 |
+
5 lambda iq ,vq ,ik ,vk :( $\mathsf { v q } = = \mathsf { \cdot }$ vk) and ( $\mathbf { i k } < \mathbf { i q } )$ ) )
|
| 69 |
+
6 has_earlier $=$ num_earlier > 0
|
| 70 |
+
7 unique_vals $=$ zipmap (( vals , has_earlier ) ,
|
| 71 |
+
8 lambda t,h_e: t if not h_e else default )
|
| 72 |
+
9 masked_hist $=$ hist - ( length $\star$ has_earlier )
|
| 73 |
+
10 return sort ( unique_vals , key $=$ - masked_hist )
|
| 74 |
+
|
| 75 |
+
Figure 2: RASP program sorting the unique elements of a sequence vals by decreasing frequency. Lines 6 and 7 show syntactic sugar for multiple simple zipmap operations, e.g., line 6 can be written has_earlier $=$ zipmap(num_earlier,lambda $\mathsf { n } : \mathsf { n } > 0$ ). This program requires a default atom da of the same type as vals, to put in place of all otherwise-duplicated values in its result. For example, by_frequency(tokens_str,“-”)(“abacca”) will return “acb--”.
|
| 76 |
+
|
| 77 |
+
From Length to Parity While length is provided as a primitive in the language, it can actually be achieved as a composition of the other base operations and sequences. This is done by computing full_ $\hat { \mathsf { s } } =$ select((),(),lambda :True) followed by 1/aggregate(full_s,indices,lambda i:int $\overset { \cdot } { 1 } = = \varnothing )$ ) (the fraction of elements equal to 0 in indices, inverted). From length and that same full_s we can then define count(vals,v), a function taking any sequence vals and value v and returning a new sequence counting the number of appearances of v in vals. The implementation of count is simply length\*aggregate(full_s,vals,lambda $\mathsf { e : e : } = \mathsf { = v }$ ). count in turn enables us to write programs like parity simply as count(tokens,1) $\% 2 = = 0 ^ { 1 }$ .
|
| 78 |
+
|
| 79 |
+
Reverse We can reverse a sequence seq with the help of an up-to-one selector mapping each position to its opposite: flip_s $=$ select(indices, length-1-indices, lambda m,oth: $\scriptstyle { \mathfrak { m } } = = 0$ th). We use flip_s to re-order the tokens of seq: reverse $=$ aggregate(flip_s,seq).
|
| 80 |
+
|
| 81 |
+
Balanced Parentheses For balanced parentheses we use count_conditioned twice, storing in prev_opens and prev_closes the number of previous “(” or “)” (respectively) tokens each position has, including itself. The sequence is balanced if prev_opens-prev_closes has no negative values, and is 0 at position length-1. These two qualities can be easily computed using two final select-aggregate pairs, and then combined with a zipmap.
|
| 82 |
+
|
| 83 |
+
Most Frequent Tokens In fig. 2 we show how RASP can be used to arrange for any input sequence s the most frequent tokens in s, without repetition. The solution has 2 parts: first, we compute the histogram for all the tokens, and mask it such that all but the first of each token is given a negative value. Then, we sort the tokens according to the masked histogram. The solution uses the sort function from Figure 1.
|
| 84 |
+
|
| 85 |
+
1 def count_conditioned (me ,other ,f) :
|
| 86 |
+
2 other $=$ other $^ +$ ( indices ,) # tuple concatenation , indices at end
|
| 87 |
+
3 s_with $\_ 0 =$ select (me ,other , lambda \*a:f ( $\star$ ( a[: -1]) ) or $( \mathsf { a } [ - 1 ] \mathsf { = } = \mathsf { 0 } )$ )
|
| 88 |
+
4 s_just_0 $=$ select (me ,other , lambda \*a:f ( $\star$ ( a[: -1]) ) and $( \mathsf { a } \left[ - 1 \right] \mathsf { = } \mathsf { = } \mathsf { 0 } )$ )
|
| 89 |
+
5 frac $=$ aggregate ( s_with_0 , indices , lambda i: int ( $\scriptstyle { \dot { 1 } } = = 0$ ) )
|
| 90 |
+
6 count_outside_0 $=$ (1/ frac ) -1
|
| 91 |
+
7 count_in_ $\begin{array} { r l } { \mathbf { \nabla } _ { \mathbf { \nabla } } \theta } & { { } = } \end{array}$ aggregate ( s_with_0 ,() ,lambda :1 , defaul $\mathtt { \iota } = \mathtt { 0 }$ )
|
| 92 |
+
8 return count_outside_0 $^ +$ count_in_0
|
| 93 |
+
|
| 94 |
+
Count Conditioned The operation count_conditioned is a powerful part of RASP, appearing in many other programs. Surprisingly, it is realisable as a composition of the other operations (and base sequence indices). Understanding its implementation is interesting for learning how to “truly” think like a transformer, and we present the code in Figure 3. The intuition is as follows: we compute the select whose width we want to calculate twice, once such that it also selects the position 0, and once such that it only selects this position. We then aggregate both these values, broadcasting 1 from position 0 and 0 from everywhere else, and using default value 0. The first aggregate computes for each position the inverse of the number of selected positions (excluding 0) plus one, and the second computes whether that position would also focus on 0. A straightforward zipmaps then gives us the result. To further help the intuition, we present in fig. 4 the computation flow for a histogram calculation, when count_conditioned is implemented as described here.
|
| 95 |
+
|
| 96 |
+

|
| 97 |
+
Figure 4: The computation flow for the sequence histogram(tokens_str) applied to input sequence “hello”, when implemented in terms of select, aggregate, and zipmap.
|
| 98 |
+
|
| 99 |
+
Note Many of the functions provided with RASP can be expressed in terms of count_conditioned – such as count (which counts how many elements in a sequence are equal to a given value) and contains (which checks if count is greater than 0) – but this is not necessarily an optimal implementation with respect to number of heads it uses. The RASPlibrary provides optimal implementations.
|
| 100 |
+
|
| 101 |
+
# 2.2 IMPLEMENTING SYMBOLIC REASONING A LA ROVER
|
| 102 |
+
|
| 103 |
+
How might a transformer implement reasoning, as in Clark et al. (2020)? RASP empowers us to clearly think about such problems, and we sketch a solution direction here. We begin by reformulating the task of Clark et al. to a form that focuses on the core problem, moving away from natural language into more ‘concrete’ domain, and by limiting the type of relations we will consider.
|
| 104 |
+
|
| 105 |
+
In the work of Clark et al., a transformer is presented a sequence of statements and a query Q, and must recognise whether Q is implied by the previous relations or not. For example: $\mathsf { a } 1 \in \mathsf { A } 1$ , ${ \mathsf { b } } \in { \mathsf { A } } 1 \Longrightarrow { \mathsf { b } } \in { \mathsf { A } } 2 .$ , a $1 \in { \mathsf { A } } 2 ?$ evaluates to True, whereas a1 $\not \in \mathsf { A } \mathsf { 1 }$ , a1 $\not \in { \mathsf { A } } 2 ?$ evaluates to False. Different inputs for this task can have different depth: the number of ‘logical hops’ needed to correctly identify whether the query statement is true.
|
| 106 |
+
|
| 107 |
+
Note. The original work accepts this input in natural language, e.g., “Alan is young. [...] If someone is young then...”, and allows statements with more complicated logical form, such as ${ \mathsf { a } } 1 \in { \mathsf { A } } 1 \wedge { \mathsf { a } } 1 \in { \mathsf { A } } 2 \implies { \mathsf { a } } 1 \in { \mathsf { B } }$ . In this section we consider only a simplified and symbolic version, in which the statements are limited to the form of the previous paragraph. We assume the statements are separated by a special token |.
|
| 108 |
+
|
| 109 |
+
We sketch this task in RASP as follows: first, mark each statement ‘block’ in the sequence by its index (as a block), by counting for each token the number of separators before it in the input. Set aside the final block (the query), it is the set of tokens with no separators after them. For each remaining block mark whether it is a relation $\in$ or $\notin )$ or inference $( \mapsto )$ statement. Then, for each relation block, note at the position of the set token the element and whether it is inside or outside, and similarly over the element token note the set. Next, for as many repetitions as the logical depth that the program should cover: share set information between all elements and element information between all sets (including from inference blocks, which initially have none initially empty), and then apply one logical step ‘locally’ at each inference block. Finally, for the query, seek any occurrence of the set token in the sequence, and return whether the element token is listed there in its contents.
|
| 110 |
+
|
| 111 |
+
Generalisation on Inference Depth A similar solution to the one we have proposed would be to make all of these logical inferences backwards from the query, i.e. by propagating backwards the requirements that would be sufficient to answer the query. If a trained transformer implements both of these solutions in parallel (for instance, to increase its robustness), this may explain the generalisation to greater query depth observed by Clark et al..
|
| 112 |
+
|
| 113 |
+
# 3 RELATION TO TRANSFORMERS, AND ANALYSIS
|
| 114 |
+
|
| 115 |
+
We discuss how RASP relates to the real transformer architecture, and how it may also be used to compare transformer variants, or analyse the ‘difficulty’ of a task for transformers.
|
| 116 |
+
|
| 117 |
+
Connection of RASP to Transformers The select and aggregate operations of RASP correspond to the attention-scoring and then pooling of transformer self-attention heads, the zipmap operations correspond to the feed-forward sublayers, and the computed sequences correspond to head or feedforward inputs and outputs. indices and tokens represent the initial input, while length and conditioned_contains are in fact combinations of the other primitives. The persistence of sequences – such that they may be accessed multiple times over the course of a RASP program – is encouraged by the existence of skip connections in the transformer architecture. In appendix A we consolidate these connections, giving a full description of transformers, and showing how any given transformer can be represented in the RASP language (provided a slight generalization of select2).
|
| 118 |
+
|
| 119 |
+
# .1 PREDICTING TRANSFORMER COMPLEXITY WITH RASP
|
| 120 |
+
|
| 121 |
+
The purpose of RASP is to help us reason about the computation process enabled by a transformer. We find that RASP programs lend themselves easily to ‘width’ and ‘depth’ analysis, enabling us to predict the number of heads and layers that a transformer will need to implement the same solution. We discuss this analysis now, and evaluate the predictions it provides in Appendix B.
|
| 122 |
+
|
| 123 |
+
For any given RASP program, we can compute the minimal number of layers required to implement it in a transformer, and upper bound the number of heads this implementation requires.3 This is provided its internal dimensions are wide enough to replicate the given processing functions. This analysis can give us intuition regarding the relative difficulty of different tasks for the transformer architecture, where each algorithm we find for a task gives us an upper bound on the number of layers and heads a transformer needs to solve it.
|
| 124 |
+
|
| 125 |
+
We implement such an analysis and provide a draw_comp_flow function, which automatically positions each attention head using a greedy scheduler, and displays the computation flow accordingly (see fig. 4, and others in the supplementary material).
|
| 126 |
+
|
| 127 |
+
A similar analysis can be done for different "primitive" computations in isolation, giving us intuition on the ‘cost’ of various common computations: how many additional heads and layers each computation adds when applied to a previously computed sequence. For example, our implementation of sort takes 2 layers, and so whenever we apply it to a computed sequence we know it will increase our program’s depth by 2 from that sequence.
|
| 128 |
+
|
| 129 |
+
Algorithm for computing program depth and width As noted, the first 3 base operations of RASP – select, aggregate, and zipmap – have direct parallels in the transformer architecture, and so we may easily analyse the result of any RASP program to see how many layers and heads it would take to realise in an actual transformer. (For length and count_conditioned, we analyse them in terms of their deconstruction to the other operations and sequences.)
|
| 130 |
+
|
| 131 |
+
The first part of the analysis is simple: every sequence and selector is initiated with a “minimum depth” $d$ , reflecting the earliest layer at which it can be computed, and so the minimum number of layers needed to create any given sequence is $d , d$ is computed for each new sequence as follows:
|
| 132 |
+
|
| 133 |
+
1. The base sequences indices and tokens have $d = 0$ , as they are input to the transformer rather than part of its computation.
|
| 134 |
+
2. Any sequence created from a zipmap is given $d$ equal to the maximum $d$ of the inputs to that zipmap, as it can be created immediately after the last of them in the same feed forward computation that concludes it.4
|
| 135 |
+
3. Every selector gets $d$ equal to the maximum $d$ of its creating sequences X plus 1, to reflect the fact that all of them must be calculated before it can even begin (as multi-headed attention happens only once, at the beginning of each layer).
|
| 136 |
+
4. Any selector created from an aggregate has $d$ equal to at least that of its creating selector, and at least one plus those of the input sequences to the aggregate operation (as they must be passed through the attention to create the new sequences).
|
| 137 |
+
|
| 138 |
+
RASP makes it easy to access all sequence and selectors on which an unfinished value is dependent, and allowing us to analyse not only the depth but also the width of a given program. The width of the computation is a reflection of how many (unique) selectors are being used at every layer of the transformer: the number of attention heads needed to mimick that layer in a transformer. We say that a selector $s$ is being used at some layer $l$ if a sequence that is aggregated from $s$ is calculated at $l$ This is because it is possible a selector $s$ may have minimum depth $d$ , but is only or also used at later layers: for instance if the sequences needed for the aggregation operation using $s$ are not yet ready.
|
| 139 |
+
|
| 140 |
+
Similarly, a sequence does not need to be computed at its minimum possible depth, as it is possible it will only be needed much later. Hence there is no one analysis for a given program, and there is room for creating a scheduling algorithm that minimises the maximum width of the transformer, i.e., the maximum of the widths of all layers (useful, as transformers tend to be created with uniform width).
|
| 141 |
+
|
| 142 |
+
# 4 IMPLICATIONS FOR TRANSFORMER VARIANTS
|
| 143 |
+
|
| 144 |
+
# 4.1 RESTRICTED-ATTENTION TRANSFORMERS
|
| 145 |
+
|
| 146 |
+
Multiple works propose restricting the attention mechanism of transformers in order to create more efficient transformers, reducing the time complexity of each layer from ${ \mathrm { O } } ( n ^ { 2 } )$ to $\mathrm { { O } } ( n l o g ( n ) )$ or even ${ \bf O } ( n )$ with respect to the input sequence length $n$ (see Tay et al. (2020) for a survey of such approaches and their complexity). Several of these do so using sparse attention, in which the attention is masked using different patterns to reduce the number of locations that can interact (see for instance (Child et al., 2019; Beltagy et al., 2020; Ainslie et al., 2020; Zaheer et al., 2020; Roy et al., 2020)).
|
| 147 |
+
|
| 148 |
+
Considering these variants of transformers in terms of the RASP language, allows us to reason about the computations they can and cannot perform. In terms of RASP, these variants of transformers all impose restrictions on the selectors, forcing some of the $n ^ { 2 }$ index pairs $( i , j )$ to False.
|
| 149 |
+
|
| 150 |
+
Figure 1 showed how to implement sorting of an input sequence with arbitrary alphabet size, comparison function, and length5. We now prove that RASP variants where the selector is restricted to ${ \bf O } ( n )$ pairs (i.e., transformer variants with sufficiently restricted attention), cannot sort.
|
| 151 |
+
|
| 152 |
+
The computation model of RASP and indeed of all transformer variants allows comparison of values between more than one sequence position only during the select operation, i.e., only while computing the attention distribution Hence, all comparisons necessary for sorting must be applied in select. It follows that whenever select is restricted such that it compares at most ${ \bf O } ( n )$ index pairs per head, no constant number of heads and layers will be sufficient for the model to perform sorting on arbitrary length – as sorting is known to require at least $\mathrm { { O } } ( n l o g ( n ) )$ comparisons.
|
| 153 |
+
|
| 154 |
+
Thus, variants of transformers in which the attention is masked to impose ${ \bf O } ( n )$ complexity require at least $\mathbf { O } ( l o g ( n ) )$ layers to sort. It also follows that they require $\mathbf { O } ( l o g ( n ) )$ layers to implement count_conditioned, as we see in fig. 1 that count_conditioned can be applied to create a sequence (num_prevs) which is sufficient to complete a sorting operation with only ${ \bf O } ( n )$ further operations.
|
| 155 |
+
|
| 156 |
+
# 4.2 SANDWICH TRANSFORMERS
|
| 157 |
+
|
| 158 |
+
Recently, Press et al. (2020) showed that reordering the attention and feed-forward sublayers of a transformer affects its ability to train on language modeling tasks. In particular, they showed that 1. pushing feed-forward sublayers towards the bottom of a transformer weakened it, and 2. pushing attention sublayers to the bottom and feed-forward sublayers to the top strengthened it, provided there was still some interleaving in the middle (making a sandwich transformer).
|
| 159 |
+
|
| 160 |
+
Considering the base operations of RASP helps us understand the observations of Press et al.. In RASP, the feed-forward and attention sublayers are the zipmap and select-aggregate (or gather for short) operations. Any arrangement of the sublayers into a set architecture, from the ‘vanilla’ transformer to the variations considered in (Press et al., 2020), imposes a restriction on the number and order of RASP operations that can be chained in a RASP program. For example, an architecture in which all feed-forward sublayers appear before the attention sublayers imposes that no zipmap operation may be applied to the results of any gather operation.
|
| 161 |
+
|
| 162 |
+
In RASP, there is no value to repeated applications of zipmap before the first gather, as no further information can be generated beyond that already described by indices and tokens. This immediately explains the first observation of Press et al. (2020). Conversely, an architecture beginning with several attention sublayers – i.e., multiple gather operations – will be able to gather a large amount of information into each position early in the computation, if only by simple rules. More complicated gathering rules can be realised by applying zipmaps to the gathered information before generating new selectors6, explaining the interleaved attention/feed-forward middle section present in the discovered architecture.
|
| 163 |
+
|
| 164 |
+
# 5 EXPERIMENTS
|
| 165 |
+
|
| 166 |
+
To evaluate the relevance of the RASP language to transformers in practice, we train transformers on a small set of synthetic tasks and compare their results to the head- and layer- bounds and attention patterns predicted by RASP programs for the same tasks.
|
| 167 |
+
|
| 168 |
+
While no RASP program promises to be a unique solution to the task it solves, several of the trained networks find solutions similar to those predicted by RASP. Among the most striking of these is the transformer trained to compute an in-place histogram, e.g. $\ S \mathrm { a b b d } \mapsto ( 1 , 1 , 2 , 2 , 1 )$ . We considered this task when the input sequences are presented with a beginning-of-sequence (BOS) token §, writing a single-head RASP program for it and training a single-head transformer on it. Visualizing the selection/attention patterns of these two heads (one RASP and one transformer) showed an identical pattern – see Figure 5.
|
| 169 |
+
|
| 170 |
+
We present the single-head RASP program for this task in Figure 6. Its operation is as follows: first, the selector same_and_0 focuses each position $i$ on all positions $j$ containing the same token as $i$ , and also on the position 0. Hence the width of this selector at each position $i \neq 0$ is exactly one plus the value $v _ { i }$ that should be output at $i$ . Aggregating the sequence $( 1 , 0 , 0 , . . . , 0 )$ with this selector (which always includes focus on 0) gives us the value $\begin{array} { r } { \dot { a } _ { i } = \frac { 1 } { v _ { i } + 1 } } \end{array}$ at each location $i$ , from which $v _ { i }$ can then be recovered with a simple zipmap.
|
| 171 |
+
|
| 172 |
+

|
| 173 |
+
Figure 5: The attention (left) and selection (right) patterns of a single-head transformer and singlehead RASP program both trained/written for the task of in-place histograms. We visualise both on the input sequence §jibbiejig. On the y axis, the sequence acts as the query, describing the output locations for which new values must be computed, and on the $\mathbf { X }$ axis it acts as the key, describing the input locations being selected to compute these new values. Specifically, each row in the attention pattern describes the self-attention distribution of this head over the sequence §jibbiejig. The transformer has clearly learned the same pattern as that used by the RASP program.
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
Figure 6: Building the RASP sequence histogram_given_BOS that computes an in-place histogram on the input tokens, under the assumption that the first token is always a special beginning-of-sequence character §. The selector same_and_0 builds on the same intuition as the s_with_0 selector from the implementation of count_conditioned.
|
| 177 |
+
|
| 178 |
+
1 same_and_0 $=$ select ( tokens ,( tokens , indices ) ,
|
| 179 |
+
2 lambda t1 ,t2 ,i:( $\displaystyle \ t 1 = = \ t 2$ ) or ( $\mathrm { i } = = 0 )$ )
|
| 180 |
+
3 inverted_count $=$ aggregate ( same_and_0 , indices ,
|
| 181 |
+
4 lambda i: int( $\mathrm { i } = = 0 \mathrm { i }$ ) )
|
| 182 |
+
5 histogram_given_BOS $=$ (1/ inverted_count ) -1
|
| 183 |
+
|
| 184 |
+
The direct parallel between our program’s only selector and our trained transformer’s attention pattern (Figure 5) suggests that this RASP program describes the exact mechanism that our transformer has discovered.
|
| 185 |
+
|
| 186 |
+
We present further experiments on additional tasks in Appendix B.
|
| 187 |
+
|
| 188 |
+
# 6 CONCLUSIONS
|
| 189 |
+
|
| 190 |
+
We abstract the computation model of the Transformer-encoder into a simple sequence processing language that captures the constraints on information flow in a Transformer. Considering computation problems and their implementation in the RASP language allows us to “think like a transformer” while abstracting away the technical details of a neural network in favor of symbolic programs. Moreover, provided it uses reasonable element-processing functions, we can analyze any RASP program to infer the minimum number of layers and maximum number of heads required to implement it in a transformer. We show several examples of expressive programs written in the RASP language, showing how complex operations can be implemented by a transformer. We train several transformers on these tasks, and find that RASP helps us predict both the correct number of heads and layers to use for these tasks and also the attention patterns that the transformers realise to solve them. Additionally, we use RASP to shed light on an empirical observation over transformer variants made by Press et al. (2020), and find concrete limitations of some “efficient transformers” architectures.
|
| 191 |
+
|
| 192 |
+
# REFERENCES
|
| 193 |
+
|
| 194 |
+
Joshua Ainslie, Santiago Ontañón, Chris Alberti, Philip Pham, Anirudh Ravula, and Sumit Sanghai. ETC: encoding long and structured data in transformers. CoRR, abs/2004.08483, 2020. URL https://arxiv.org/abs/2004.08483.
|
| 195 |
+
|
| 196 |
+
Dzmitry Bahdanau, Kyunghyun Cho, and Yoshua Bengio. Neural machine translation by jointly learning to align and translate. In Yoshua Bengio and Yann LeCun (eds.), 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1409.0473.
|
| 197 |
+
|
| 198 |
+
Iz Beltagy, Matthew E. Peters, and Arman Cohan. Longformer: The long-document transformer. CoRR, abs/2004.05150, 2020. URL https://arxiv.org/abs/2004.05150.
|
| 199 |
+
|
| 200 |
+
Satwik Bhattamishra, Kabir Ahuja, and Navin Goyal. On the ability and limitations of transformers to recognize formal languages, 2020.
|
| 201 |
+
|
| 202 |
+
Rewon Child, Scott Gray, Alec Radford, and Ilya Sutskever. Generating long sequences with sparse transformers. CoRR, abs/1904.10509, 2019. URL http://arxiv.org/abs/1904.10509.
|
| 203 |
+
|
| 204 |
+
Peter Clark, Oyvind Tafjord, and Kyle Richardson. Transformers as soft reasoners over language, 2020.
|
| 205 |
+
|
| 206 |
+
Mostafa Dehghani, Stephan Gouws, Oriol Vinyals, Jakob Uszkoreit, and Lukasz Kaiser. Universal transformers. CoRR, abs/1807.03819, 2018. URL http://arxiv.org/abs/1807.03819.
|
| 207 |
+
|
| 208 |
+
Michael Hahn. Theoretical limitations of self-attention in neural sequence models. CoRR, abs/1906.06755, 2019. URL http://arxiv.org/abs/1906.06755.
|
| 209 |
+
|
| 210 |
+
Kurt Hornik, Maxwell B. Stinchcombe, and Halbert White. Multilayer feedforward networks are universal approximators. Neural Networks, 2(5):359–366, 1989. doi: 10.1016/0893-6080(89) 90020-8. URL https://doi.org/10.1016/0893-6080(89)90020-8.
|
| 211 |
+
|
| 212 |
+
Armand Joulin and Tomas Mikolov. Inferring algorithmic patterns with stack-augmented recurrent nets. In Corinna Cortes, Neil D. Lawrence, Daniel D. Lee, Masashi Sugiyama, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada, pp. 190–198, 2015. URL http://papers.nips.cc/paper/ 5857-inferring-algorithmic-patterns-with-stack-augmented-recurrent-nets.
|
| 213 |
+
|
| 214 |
+
Minh-Thang Luong, Hieu Pham, and Christopher D. Manning. Effective approaches to attentionbased neural machine translation. CoRR, abs/1508.04025, 2015. URL http://arxiv.org/abs/ 1508.04025.
|
| 215 |
+
|
| 216 |
+
William Merrill, Gail Weiss, Yoav Goldberg, Roy Schwartz, Noah A. Smith, and Eran Yahav. A formal hierarchy of RNN architectures. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pp. 443–459, Online, July 2020. Association for Computational Linguistics. doi: 10.18653/v1/2020.acl-main.43. URL https://www.aclweb.org/anthology/ 2020.acl-main.43.
|
| 217 |
+
|
| 218 |
+
Christian W. Omlin and C. Lee Giles. Extraction of rules from discrete-time recurrent neural networks. Neural Networks, 9(1):41–52, 1996. doi: 10.1016/0893-6080(95)00086-0. URL https://doi.org/10.1016/0893-6080(95)00086-0.
|
| 219 |
+
|
| 220 |
+
Ofir Press, Noah A. Smith, and Omer Levy. Improving transformer models by reordering their sublayers. In Dan Jurafsky, Joyce Chai, Natalie Schluter, and Joel R. Tetreault (eds.), Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, ACL 2020, Online, July 5-10, 2020, pp. 2996–3005. Association for Computational Linguistics, 2020. URL https: //www.aclweb.org/anthology/2020.acl-main.270/.
|
| 221 |
+
|
| 222 |
+
Guillaume Rabusseau, Tianyu Li, and Doina Precup. Connecting weighted automata and recurrent neural networks through spectral learning. CoRR, abs/1807.01406, 2018. URL http://arxiv. org/abs/1807.01406.
|
| 223 |
+
|
| 224 |
+
Aurko Roy, Mohammad Saffar, Ashish Vaswani, and David Grangier. Efficient content-based sparse attention with routing transformers, 2020.
|
| 225 |
+
|
| 226 |
+
Yi Tay, Mostafa Dehghani, Dara Bahri, and Donald Metzler. Efficient transformers: A survey, 2020.
|
| 227 |
+
|
| 228 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. CoRR, abs/1706.03762, 2017. URL http://arxiv.org/abs/1706.03762.
|
| 229 |
+
|
| 230 |
+
Jesse Vig and Yonatan Belinkov. Analyzing the structure of attention in a transformer language model. In Proceedings of the 2019 ACL Workshop BlackboxNLP: Analyzing and Interpreting Neural Networks for NLP, pp. 63–76, Florence, Italy, August 2019. Association for Computational Linguistics. doi: 10.18653/v1/W19-4808. URL https://www.aclweb.org/anthology/W19-4808.
|
| 231 |
+
|
| 232 |
+
Gail Weiss, Yoav Goldberg, and Eran Yahav. Extracting automata from recurrent neural networks using queries and counterexamples. In Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholmsmässan, Stockholm, Sweden, July 10-15, 2018, pp. 5244–5253, 2018. URL http://proceedings.mlr.press/v80/weiss18a.html.
|
| 233 |
+
|
| 234 |
+
Chulhee Yun, Srinadh Bhojanapalli, Ankit Singh Rawat, Sashank J. Reddi, and Sanjiv Kumar. Are transformers universal approximators of sequence-to-sequence functions?, 2019.
|
| 235 |
+
|
| 236 |
+
Manzil Zaheer, Guru Guruganesh, Avinava Dubey, Joshua Ainslie, Chris Alberti, Santiago Ontañón, Philip Pham, Anirudh Ravula, Qifan Wang, Li Yang, and Amr Ahmed. Big bird: Transformers for longer sequences. CoRR, abs/2007.14062, 2020. URL https://arxiv.org/abs/2007.14062.
|
| 237 |
+
|
| 238 |
+
Quanshi Zhang, Ying Nian Wu, and Song-Chun Zhu. Interpretable convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), June 2018.
|
| 239 |
+
|
| 240 |
+
# A TRANSFORMERS IN RASP
|
| 241 |
+
|
| 242 |
+
RASP is almost – but not quite – a strict over-approximation of transformer-encoders. In this section, we show how the addition of score, a generalisation of select that may assign non-boolean values to index pairs, makes RASP a strict over-approximation. In particular, we give an explicit translation from any given transformer-encoder to a RASP program, provided the augmentation with score. If the reader prefers to start there, a full description of transformers is given in section D (with notations in the preceding section).
|
| 243 |
+
|
| 244 |
+
We now introduce the score operation, and expand aggregate to receive a scorer:
|
| 245 |
+
|
| 246 |
+
• score Similarly to select, the score operation takes two tuples of sequences $\mathfrak { m } \mathbf { e } { = } ( \mathfrak { m } \mathbb { 1 } , \ldots , \mathfrak { m } \mathbf { k } )$ and other $=$ (ot1,...,otl), and a function f expecting $\mathsf { k } { + } \mathsf { 1 }$ atomic values. This time however, f may return any non-negative float value. It creates from these a scorer similarly to how select creates a selector from its inputs.
|
| 247 |
+
|
| 248 |
+
• aggregate The aggregate operation is expanded such that it may receive either a scorer or a selector where it previously accepted only a selector. When it receives a scorer, each y[i] is assigned the weighted average of all the values of $\mathsf { x }$ , according to the values in the scorer:
|
| 249 |
+
|
| 250 |
+
$$
|
| 251 |
+
\mathsf { y } [ \mathrm { i } ] = \frac { \sum _ { \mathsf { j } \in [ n ] } \mathsf { s } ( \mathrm { i } , \mathrm { j } ) { \cdot } \mathsf { x } [ \mathrm { j } ] } { \sum _ { \mathsf { j } \in [ n ] } \mathsf { s } ( \mathrm { i } , \mathrm { j } ) }
|
| 252 |
+
$$
|
| 253 |
+
|
| 254 |
+
Intuitively, the select operation, and the application of aggregate to a selector, can be seen as the special case of a score-select pair in which the scorer has only given scores of 0 and 1. It does have one difference in that it also allows for a default value which may be used when the total score for some index i is 0. However, this can be seen as sugar: it is not difficult to create a mechanism similar to that of count_conditioned in order to recognize when a selector has width 0, and so avoid the direct use of default in aggregate7. Moreover, if the data is always given with a special beginning-of-sequence (BOS) token, then the default value can simply be loaded from that location whenever no other focus is found.
|
| 255 |
+
|
| 256 |
+
1 def elementwise_part (x,att_y , el_funcs ) :
|
| 257 |
+
2 lA , n2 , ff $=$ el_funcs
|
| 258 |
+
3 def apply_elementwise_parts (xy) :
|
| 259 |
+
4 $\mathrm { ~ \tt ~ { ~ x ~ y ~ } ~ } =$ tovec (xy)
|
| 260 |
+
5 x, att_y $=$ first_half (xy) , second_half (xy)
|
| 261 |
+
6 x1 = x + lA( att_y ) # vector addition
|
| 262 |
+
7 res = x1 $^ +$ ff(n2(x1) )
|
| 263 |
+
8 return totuple ( res )
|
| 264 |
+
9 return zipmap (x+att_y , apply_elementwise_parts )
|
| 265 |
+
10
|
| 266 |
+
11
|
| 267 |
+
12 def layer (x, head_weights ,n1 , el_funcs ) :
|
| 268 |
+
13 multihead_y $=$ ( )
|
| 269 |
+
14 for lq ,lk ,lv in head_weights :
|
| 270 |
+
15 s $=$ score (x,x, lambda xixj :
|
| 271 |
+
16 exp ( scalarprod (
|
| 272 |
+
17 lq(n1( first_half ( xixj ) ) ) ,
|
| 273 |
+
18 lk(n1( second_half ( xixj ) ) ) ) )
|
| 274 |
+
19 head_y $=$ aggregate (s,x,lv)
|
| 275 |
+
20 multihead_y $=$ multihead_y $^ +$ head_y
|
| 276 |
+
21 # $^ +$ here is concatenating tuples of sequences
|
| 277 |
+
22 return elementwise_part (x, multihead_y , el_funcs )
|
| 278 |
+
23
|
| 279 |
+
24 def T_y0 ( layer_funcs ,w,p) :
|
| 280 |
+
25 $\qquad \times \quad =$ zipmap (( indices , tokens ) ,lambda i, $\mathsf { t } : \mathsf { p } \left( \mathrm { i } \right) + \mathsf { w } \left( \mathrm { t } \right) \big )$
|
| 281 |
+
26 for head_weights ,n1 , el_funcs in layer_funcs :
|
| 282 |
+
27 x = layer (x, head_weights ,n1 , el_funcs )
|
| 283 |
+
28 return x # tuple of d float sequences
|
| 284 |
+
|
| 285 |
+
Theorem A.1. Let $\mathcal { T } : ( \mathbb { R } ^ { d } ) ^ { * } \to ( \mathbb { R } ^ { d } ) ^ { * }$ be a transformer and $y _ { 0 } : \Sigma \to ( \mathbb { R } ^ { d } ) ^ { * }$ be an input embedding computed as the sum of a token and positional embedding, $y _ { 0 } ( x ) _ { i } = w ( x _ { i } ) + p ( i )$ . Then the computation of $\mathcal { T } _ { y _ { 0 } } \triangleq y _ { 0 } \circ \mathcal { T }$ can be mimicked in a RASP program that writes the output to $d$ float-sequences and uses exactly $L H$ score and aggregate calls and $( H + 1 ) L + 1$ zipmap calls, where $L$ and $H$ are the number of layers and attention heads in $\tau$ , respectively.
|
| 286 |
+
|
| 287 |
+
Proof Sketch In figure 7 we present code that, given the token and positional embedding $\boldsymbol { w } : \Sigma \to \mathbb { R } ^ { d }$ and $\dot { p } : \mathbb { N } \to \mathbb { R } ^ { d }$ and all the weights of a transformer, recreates that same transformer in RASP. Our code relies on the helper functions tup2vec, vec2tup, first_half and second_half which help convert between the tuples of values given to the processing functions by zipmap and aggregate and the vectors they represent. For simplicity in the presentation, we assume here that the transformer is given as a collection of linear transformations, layer-norms, and feed-forward functions which can be applied to its internal vectors directly.
|
| 288 |
+
|
| 289 |
+
The main routine is $\mathsf { T } \_ \mathsf { y } \boldsymbol { \theta }$ , which applies the initial embedding and stores it in a tuple of $d$ sequences, $\mathsf { x }$ , and then applies each layer to it in turn. This takes $L$ calls to the layer function, each of which computes score-aggregate (with additional zipmap before the aggregate) pair $H$ times to mimic each of the heads, and then calls a zipmap on the concatenation of their result to complete the remaining (elementwise) computations of the layer.
|
| 290 |
+
|
| 291 |
+
Note. Recall that, as noted in $\mathrm { E }$ , when a processing function passed to zipmap returns multiple values, zipmap simply generates that same number of sequences. In particular, at all iterations of the loop in $\mathsf { T } _ { - } \mathsf { y } \mathsf { 0 } , \mathsf { x }$ is a tuple of $d$ sequences where $d$ is the embedding dimension of the given transformer.
|
| 292 |
+
|
| 293 |
+
We see that, when augmented with score, the RASP language naturally composes the components of a given transformer to reconstruct it exactly.
|
| 294 |
+
|
| 295 |
+
Why not have score? The motivation for the omission of score from RASP is cleanliness: it is far easier to think in terms of select as opposed to score, and we have not yet encountered a problem where we used scorers whose values where outside of 0 and 1. In time, as we use the language more and encounter the limitations this choice poses, we may return to score and see what other kind of special cases of it we will benefit from including in RASP.
|
| 296 |
+
|
| 297 |
+
Power of RASP As seen in this section, RASP can (provided this slight generalization of select) represent any transformer. Additionally, we see that it is not arbitrarily overpowered. For example, it does not allow iterating over a sequence of arbitrary length one-by-one to perform some gradual computation (as might be done in RNN or DFA), and in general does not allow arbitrary repetition of operations as other languages might allow. This is because the number of operations in a RASP program is predetermined: RASP programs do not admit loops. This distinction between transformers and RNNs is known, and there is interest in bridging it. For example, the Universal Transformer attempts to introduce loops into transformers, by allowing them to also have a control mechanism that decides whether to repeat a layer during computation (Dehghani et al., 2018).
|
| 298 |
+
|
| 299 |
+
# B EXPERIMENTS
|
| 300 |
+
|
| 301 |
+
For RASP to be useful, it is important to see that RASP programs relate well to actual transformer behavior in practice. In this section, we train transformers on a small set of synthetic tasks for which we can write RASP programs, and see how the these programs relate to our empirical results.
|
| 302 |
+
|
| 303 |
+
We consider the following tasks:
|
| 304 |
+
|
| 305 |
+
1. Count-a: Return the number of $\prime _ { a } \prime$ tokens in a sequence, e.g., aba $\mapsto 2$ .
|
| 306 |
+
2. Histogram: For each token, its number of repetitions in a sequence, presented in-place. For example, aababc $\mapsto ( 3 , 3 , 2 , 3 , 2 , 1 )$ .
|
| 307 |
+
3. Reverse: Reversing a sequence, e.g.: abc $\mapsto$ cba.
|
| 308 |
+
|
| 309 |
+
For Histogram, we also consider a variant with a special beginning-of-sequence (BOS) token §, appearing exactly once at the beginning of each sequence (and nowhere else). For example, §aabc $\mapsto$ $( 1 , 2 , 2 , 1 , 1 )$ .
|
| 310 |
+
|
| 311 |
+
We train transformers for each of these tasks, and test whether our RASP programs accurately predict the minimum number of heads and layers needed to perform them. We also visualise their attention distributions8, and see if they match the selectors used by our programs.
|
| 312 |
+
|
| 313 |
+
We find that several of the RASP programs presented in this paper show similar attention (selector) patterns to those of the trained transformers in practice, suggesting that programming in RASP helps us provide reasonable predictions of transformer behavior. Moreover, we often find that reducing the number of heads and layers in a transformer beyond the number needed in our RASP program for the same task significantly degrades its accuracy. This suggests that the specific programs we have presented in for these tasks are also optimal solutions.
|
| 314 |
+
|
| 315 |
+
Data and Evaluation Unless stated otherwise: for all of the languages, we use the alphabet $\{ \mathsf { a } , \mathsf { b } , \mathsf { c } , \mathsf { d } , \mathsf { e } \}$ with sequences of sizes 1 through 100. These are generated by first choosing the length uniformly from 1 to 100, and then choosing each token uniformly from the alphabet. We use 50, 000 train samples, $1 , 0 0 0$ test samples, and 1, 000 validation samples.
|
| 316 |
+
|
| 317 |
+
For tasks giving a ‘single’ output value – such as Count-a (which gives 1 number) as opposed to Reverse which gives a new sequence – we train the network to return that value in all positions, e.g., ${ \mathsf { a b a } } \mapsto ( 2 , 2 , 2 )$ for Count-a. This makes the visualisation of the attention distributions clearer (as all locations are trying to do something meaningful, as opposed to one), and is also more clearly aligned with the tasks we have described in this work.
|
| 318 |
+
|
| 319 |
+
We measure the accuracy of a transformer on a batch of sequences as the fraction of total predictions it made for those sequences that were correct, e.g. $\textstyle { \frac { x } { 5 } }$ for a batch with total sequence length 5. For the train, set, and validation sets, we report accuracy as the average batch accuracy.
|
| 320 |
+
|
| 321 |
+
Architecture We use the transformer architecture provided with PyTorch 1.7.0, with an additional single linear transformation and softmax at the end to convert to the output classes prediction. Unless stated otherwise, we use small embedding and feed-forward dimensions: 20 and 40, respectively. We vary the number of heads and layers per task.
|
| 322 |
+
|
| 323 |
+
Training Method We train with the ADAM optimizer, sin-cosine positional embedding, and dropout 0.1 in the transformer weights. We use learning rate 0.0003, batch size 50, and PyTorch’s ExponentialLR learning rate scheduler with gamma 0.98 (updated after every epoch). Excluding confirmation of a negative result, we train each network for 20 epochs. If a network hits $1 0 0 \%$ accuracy before then, we stop.
|
| 324 |
+
|
| 325 |
+
Helpful RASP functions In this section we will make frequent use of the full-selector full_s $=$ select((),(),lambda :True) and the function frac_condition(sequences,f), which computes aggregate(full_s,sequences,lambda a:int $( \mathsf { f } ( \star \mathsf { a } ) ) ^ { 9 }$ – the fraction of input positions for which the f is satisfied on the values of sequences. Note that frac_condition requires only 1 layer (after sequences have been computed) with 1 head, and that that head is full_s. Recall also that length is computed: length $^ { = 1 }$ /frac_condition(indices,lambda $\mathbf { i } : \mathbf { i } = = \mathbf { \boldsymbol { \theta } } ,$ ).
|
| 326 |
+
|
| 327 |
+
# B.1 COUNT-a
|
| 328 |
+
|
| 329 |
+
To avoid gradient problems from trying to obtain large numerical values from the transformer (e.g., 8), we encode Count-a as a categorical task. In particular, we create 21 output tokens $\{ \emptyset , 1 , 2 , \dots , 2 \emptyset \}$ , and if there are more than $2 0 \mathsf { a }$ tokens in the sequence we just report 20.
|
| 330 |
+
|
| 331 |
+

|
| 332 |
+
Figure 8: The attention distribution in the only head of a transformer trained on Count-a. The sequence is presented on the y-axis as the queries and on the $\mathbf { X }$ -axis as the keys, i.e., each row is a distribution over the input positions. As predicted by our RASP program (which solves this task using full_s), this distribution is relatively uniform.
|
| 333 |
+
|
| 334 |
+
RASP permits a 1-layer, 1-head program for this task: count_a $=$ lengthfrac_condition( tokens, lambda t: $\tan \tt { a } ^ { \prime \prime } \tt { a } ^ { \prime \prime } .$ ). (length and frac_condition share the selector full_s.) Accordingly, training a transformer with 1 layer and 1 head on Count-a succeeded, reaching test accuracy $9 8 . 9 \%$ on the $2 0 ^ { \mathrm { t h } }$ epoch.
|
| 335 |
+
|
| 336 |
+
The attention pattern of this transformer on the input sequence abbaabcde is shown in Figure 8. While the distribution is not perfectly uniform, it does seem to focus on the entire sequence, as the use of full_s in our RASP program suggests (contrast for example with the attention distribution for Reverse, in Figure 12)10.
|
| 337 |
+
|
| 338 |
+
We stress that this is a different distribution to that which we might intuitively expect for this task – namely, an attention pattern focused solely on instances of a in the sequence – and that RASP has successfully pushed us to predict it!
|
| 339 |
+
|
| 340 |
+
# B.2 HISTOGRAM
|
| 341 |
+
|
| 342 |
+
As with Count-a, we encode histograms as a categorical task. This time we limit the maximum count to 10, i.e., we only use the output tokens $1 , 2 , \ldots , 1 0$ . (0 is irrelevant as it will not appear in an in-place histogram). Unlike most other tasks, for Histograms we use an alphabet of size 10: $\{ \mathsf { a } , \mathsf { b } , \mathsf { \ldots } , \mathsf { j } \}$ . For histograms, we use an input alphabet of size 10: $\{ \mathsf { a } , \mathsf { b } , \mathsf { \ldots } , \mathsf { j } \}$ .
|
| 343 |
+
|
| 344 |
+

|
| 345 |
+
Figure 9: The attention distribution in the single head transformer trained on Histogram. The input sequence abcdeba is presented on the y-axis as the queries and on the $\mathbf { X }$ -axis as the keys, i.e., each row is a distribution over the input positions. This transformer does not have enough heads: despite training for 50 epochs, it has only reached test accuracy $5 5 \%$ , and generates the incorrect output $( 1 , 2 , 1 , 1 , 1 , 2 , 1 )$ for this sequence. Similarly, it does not manage to recreate the selection pattern predicted by our RASP program for this task, which requires 2 heads.
|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
Figure 10: The attention distribution in the 2-head, single-layer transformer trained on Histogram. The input sequence aabbccacde is presented on the y-axis as the queries and on the $\mathbf { X }$ -axis as the keys, i.e., each row is a distribution over the input positions. The distribution is similar, but not identical, to our count_conditioned implementation. In particular, it seems that the tokens d and e are to some extent taking the role of the index 0 in our implementation: the first head has most tokens focus on themselves, d, and e, and the second head has most tokens focus slightly more on d and e than others. d and e themselves seem to behave inversely to the other tokens.
|
| 349 |
+
|
| 350 |
+
We trained one transformer with 1 layer and 2 heads, and another with only 1 layer and 1 head. After 20 epochs, the transformer with 2 heads reached test accuracy $8 9 . 3 \%$ . In contrast, after 50 epochs, the transformer with only 1 head was still at accuracy $5 5 \% !$ ! Increasing its embedding and feed-forward dimensions to 50 and 100 respectively also did not work: a 1-layer 1-head transformer with these dimensions still only reached $7 9 . 3 \%$ test accuracy after 50 epochs, and this after being past $7 7 + \%$ validation accuracy since the $2 7 ^ { \mathrm { t h } }$ epoch.
|
| 351 |
+
|
| 352 |
+
Drawing the attention map for the single-head transformer (Figure 9) did not seem to relate to the selection pattern of count_conditioned at all, unsurprisingly considering that it did not have enough heads. See for example the apparent focus on b by several query positions not containing b, as opposed to our expectations of the count_conditioned focus pattern as shown in Figure 4.
|
| 353 |
+
|
| 354 |
+
For the 2-heads transformer, we draw its attention maps in Figure 10. The solution has some clear parallels with our RASP prediction of histogram selection patterns of count_conditioned, such as most tokens focusing on themselves in the one head and sharing distribution patterns in the other. But we can also easily find differences: in particular, the d and e tokens seem to avoid rather than focus on themselves, and the shared focus of most tokens in the similar-attentions head is not on 0 but on d and e. There is a possibility that in this transformer, d and e are playing a role similar to that which we gave to 0 in our implementation of count_conditioned. We leave a deeper exploration of this to future work.
|
| 355 |
+
|
| 356 |
+
# B.3 HISTOGRAM WITH BOS
|
| 357 |
+
|
| 358 |
+
Recall the implementation of count_conditioned (Figure 3): it calculates the “width" (number of selected locations) of a hypothetical selector s by simulating it along two actual selectors, s_with_0 and s_just_0. s_with_0 is used to calculate for every index the fraction $1 \big / c _ { i } ^ { \prime } { + 1 }$ where $c _ { i } ^ { \prime }$ is the width of s on everything except index 0, and s_just_0 is used to make a final adjustment from $c _ { i } ^ { \prime }$ to the actual width, depending on the focus on 0.
|
| 359 |
+
|
| 360 |
+
If, then, the contents at position 0 are constant across all inputs, then the second selector s_just_0 becomes unnecessary: any information it conveys can be hard-coded into the RASP program (practically, the transformer). It follows that for setups where all input sequences are prepended with a special beginning-of-sequence (BOS) token, count_conditioned can be implemented with only one head, using just the s_with_0 selection pattern.
|
| 361 |
+
|
| 362 |
+

|
| 363 |
+
Figure 11: The attention distribution for a 1-head, 1-layer transformer trained on Histogram with BOS tokens. The input sequence jibbiejig is presented on the y-axis as the queries and on the $\mathbf { X }$ -axis as the keys, i.e., each row is a distribution over the input positions. This transformer appears to have implemented Histogram (with BOS) using exactly the same s_with_0 selection pattern as suggested in our count_conditioned implementation! (The second selection pattern in the count_conditioned implementation, s_just_0, is unnecessary when the value at the 0 index is constant.))
|
| 364 |
+
|
| 365 |
+
We prepend all of the original Histogram inputs with a special BOS token § (and their outputs with 1), and train a new 1-layer, 1-head transformer on the resulting data set. For gamma $= 0 . 9 9$ , the results satisfy our predictions perfectly: the transformer reaches ${ \bar { 9 9 } } . 7 \%$ test accuracy in 20 epochs, and drawing its attention distribution (Figure 11) shows that it follows exactly the pattern of the selector s_with_0! (For gamma $= 0 . 9 8$ the attention distribution was also very similar to that of s_with_0, but the model reached only $8 6 . 4 \%$ test accuracy after 20 epochs.)
|
| 366 |
+
|
| 367 |
+
Discussion of BOS The significance of such ‘non-input’ tokens in transformers has been previously discussed, with different interpretations. For example, Vig & Belinkov (2019) refer to the attention focused on the initial token of a sequence – seemingly when there is nothing else to focus on – as null attention. They report that the null token gathered as much as $9 7 \%$ of the attention of some of their heads, and suggest that this is consistent with these heads being unimportant to the transformer’s overall performance. Conversely, this new result suggests that the null token at the beginning of a sequence is playing an important role in the transformer calculations, and in particular is directly assisting in counting!
|
| 368 |
+
|
| 369 |
+
# B.4 REVERSE
|
| 370 |
+
|
| 371 |
+
In RASP, Reverse is implemented using flip_ $; =$ select(indices,length-1-indices,lambda ${ \bf i } , { \bf j } : { \bf i } = = { \bf j } ;$ ) followed by reverse $\boldsymbol { \underline { { \underline { { \mathbf { \delta \pi } } } } } } ,$ aggregate(flip_s,tokens). This takes two layers of one head each (recall that length itself requires one layer to compute).
|
| 372 |
+
|
| 373 |
+

|
| 374 |
+
Figure 12: The attention distributions in the 2-layer, 1-head (per layer) transformer trained on Reverse. The first layer is on the left and the second on the right. The input sequence abcdeabcde is presented on the y-axis as the queries and on the $\mathbf { X }$ -axis as the keys, i.e., each row is a distribution over the input positions. The attention distribution in the second layer is exactly as predicted by our RASP program (i.e., a hard, ‘reverse-match’ attention). In the first layer however, it seems the transformer has learned a behavior other than uniform attention to compute the length of the sequence (which it needs for the second layer).
|
| 375 |
+
|
| 376 |
+
We train two transformers on Reverse: one with 2 layers and 1 head, and the other with 1 layer and 2 heads, to verify that the separation into 2 layers is indeed necessary. To give room for the index-based selection pattern (i.e., a scoring method that involves comparison of indices and not just tokens), we give the transformers per-head width at least as large as our maximum length. In particular, we use embedding dimension 100 for the 2-layer transformer and 200 for the 1-layer transformer11. We also give them each feed-forward dimension twice their embedding dimension.
|
| 377 |
+
|
| 378 |
+
The 2-layer transformer reaches test accuracy $9 9 . 6 \%$ after 20 epochs. In contrast, and as expected, the single-layer transformer remains trapped at $3 9 . 6 \%$ test accuracy even after 50 epochs. Plotting the attention for the 2-layer transformer (Figure 12) matches some of the predictions of our RASP program: the reverse-matching attention is only computed in the $2 ^ { \mathrm { n d } }$ layer, and computed perfectly at that point. We are inclined to believe the length is being computed at the first layer (as we predict).
|
| 379 |
+
|
| 380 |
+

|
| 381 |
+
Figure 13: The attention distributions in the 1-layer, 1-head transformer trained on Reverse with fixed input length 50, on input sequences of length 45, 50, and 55, in order. The y-axes represent output locations (queries) and the $\mathbf { X }$ -axes input locations (keys), i.e., each row is a distribution over the input positions. As expected, the transformer has learned a constant relation between pairs of input locations, and maintains all of the pairs it can find in each input sequence it gets. For missing pairs, such as $( 0 , 4 9 )$ through (4, 45) in the input of length 45 (left), it struggles to focus its attention.
|
| 382 |
+
|
| 383 |
+
But there are also devitions from our prediction: the attention pattern suggests that the transformer is computing the length using a different mechanism from the one that we have suggested.
|
| 384 |
+
|
| 385 |
+
We now strengthen the claim that the initial layer of the Reverse transformer is computing the sequence length, by showing that when the sequence length is fixed, then a single-layer (and single-head) transformer does succeed on Reverse. We fix the sequence length to 50 and train a 1-layer 1-head transformer on Reverse. This simpler task can be presented in one layer and one head in RASP using the single selector flip50_s=select(indices,49-indices,lambda ${ \mathrm { i } } , { \mathrm { j } } : { \mathrm { i } } = = { \mathrm { j } } { \mathrm { ) } }$ , from which the result is computed reverse $5 0 =$ aggregate(flip50_s,tokens).
|
| 386 |
+
|
| 387 |
+
As expected, the transformer succeeds in its task, reaching $1 0 0 \%$ test accuracy in only 3 epochs. In Figure 13 we illustrate that it has indeed learned a constant $( i , 4 9 - i )$ location pairing, by visualising its attention on sequences slightly longer or shorter than it has been trained on.
|
| 388 |
+
|
| 389 |
+
For completeness, in Figure 14 we show also the attention patterns of the single-layer transformer trained on variable-length Reverse. In keeping with our predictions, it has not managed to learn the reverse-matching attention pattern at all. This is because it needs an additional layer to compute the length before it can create the correct attention pattern.
|
| 390 |
+
|
| 391 |
+

|
| 392 |
+
Figure 14: The attention distributions of the 2 heads in the 1-layer transformer trained on Reverse, as applied to the sequence abcdeabcde. As expected from the RASP program, the transformer is unable to learn the reverse-match attention on any head of its first layer.
|
| 393 |
+
|
| 394 |
+
# C NOTATIONS
|
| 395 |
+
|
| 396 |
+
Basic Notations For every $n \in \mathbb { N }$ , we denote $[ n ] = \{ 1 , . . . , n \}$
|
| 397 |
+
|
| 398 |
+
Matrices For a matrix $\ b { X } \in \mathbb { R } ^ { n \times d }$ , we refer to its $i$ -th row as $X _ { i } \in \mathbb { R } ^ { d }$ , and for a vector $v \in \mathbb { R } ^ { d }$ we refer to its $i$ -th value as $v _ { i } \in \mathbb { R }$ . We additionally refer to $n$ as the length of $X$ and abusively denote $| X | = n$ .
|
| 399 |
+
|
| 400 |
+
For $\ b { X } \in \mathbb { R } ^ { n \times d }$ and $b \in \mathbb { R } ^ { d }$ , we use the shorthand $X + b$ to describe the addition of $b$ to each of the rows of $X$ , i.e.: $( X + b ) _ { i } = X _ { i } + b$ for every $i \in [ n ]$ . For a scalar $\alpha \in \mathbb { R }$ , any operation $X \odot \alpha , \odot \in \{ + , - , \times , \div \}$ is applied elementwise to all the values of $X$ . Matrix multiplication between two matrices $A , B$ is denoted simply $A B$ , and the transpose of a matrix $A$ is denoted $A ^ { T }$ .
|
| 401 |
+
|
| 402 |
+
We occasionally treat input or output sequences $x _ { 1 } , . . . , x _ { n } \in \mathbb { R } ^ { d }$ as matrices $\ b { X } \in \mathbb { R } ^ { n \times d }$ whose rows are the individual input vectors: $X _ { i } = x _ { i }$ . When $n$ may be arbitrary, we will say that $X \in ( \mathbb { R } ^ { d } ) ^ { * }$ .
|
| 403 |
+
|
| 404 |
+
Definition C.1. $A$ linear transformation with input dimension $d$ and output dimension m is a function $l _ { A , b } : ( \mathbb { R } ^ { d } ) ^ { * } \to ( \mathbb { R } ^ { m } ) ^ { * }$ parameterised by a matrix $A \in \mathbb { R } ^ { d \times m }$ and vector $b \in \mathbb { R } ^ { m }$ as follows: $l _ { A , b } ( X ) = X A + b$ for every $X \in ( \mathbb { R } ^ { d } ) ^ { * }$ . $A$ and $b$ are the weights of the transformation.
|
| 405 |
+
|
| 406 |
+
Definition C.2. The softmax function s : $\mathbb { R } ^ { * } \to \mathbb { R } ^ { * }$ is defined: for every $d \in \mathbb { N }$ and $x \in \mathbb { R } ^ { d }$ , $\mathbf { s } ( x ) \in \mathbb { R } ^ { d }$ such that $\begin{array} { r } { \mathrm { s } ( x ) _ { i } = \frac { \bar { e } ^ { x _ { i } } } { \sum _ { j \in [ d ] } e ^ { x _ { j } } } } \end{array}$ = e P xij∈[d] exj for every i ∈ [d]. We also denote by S the row-wise softmax function: for every $n , d \in \mathbb { N }$ and $\dot { X } \in \mathbb { R } ^ { n \times d }$ , $S ( X ) \in \mathbb { R } ^ { n \times d }$ , and ${ \cal { S } } ( X ) _ { i } = \mathrm { s } ( X _ { i } )$ for every $i \in [ n ]$ .
|
| 407 |
+
|
| 408 |
+
We denote by ${ \mathcal { R } } ( X )$ the elementwise application of the ReLU function, $r : x \mapsto \operatorname* { m a x } ( 0 , x )$ , to $X$ .
|
| 409 |
+
|
| 410 |
+
Function Qualities A function $f : A ^ { * } \to B ^ { * }$ is length preserving if it satisfies $| f ( x ) | = | x |$ for any $x \in ( \mathbb { R } ^ { d } ) ^ { * }$ (i.e., for any input sequence $x _ { 1 } , . . . , x _ { n } \in A$ , $f$ returns a sequence $y _ { 1 } , . . . , y _ { n } \in B$ ). If there also exists a function $g : A B$ such that $f ( x ) _ { i } = g ( x _ { i } )$ for any $i \leq | x |$ , then $f$ is elementwise, and we say that $f$ is an elementwise application of $g$ . Note that linear transformations are elementwise.
|
| 411 |
+
|
| 412 |
+
# D TRANSFORMER-ENCODERS
|
| 413 |
+
|
| 414 |
+
At the highest level, a transformer-encoder $T$ (henceforth, a transformer) is a parameterised lengthpreserving function $T : ( \mathbb { R } ^ { d } ) ^ { * } ( \mathbb { R } ^ { d } ) ^ { * }$ composed of multiple layers of length-preserving functions $\dot { \ell } : ( \mathbb { R } ^ { d } ) ^ { * } \to ( \mathbb { R } ^ { d } ) ^ { * }$ , i.e. $f = \ell _ { 1 } \circ \ell _ { 2 } \dots \circ \ell _ { L }$ which we will describe in this section.
|
| 415 |
+
|
| 416 |
+
Generally speaking, a transformer’s layers are not elementwise, and indeed the transformer would not be interesting if they were. However, when we come to look at their components, we see that this quality rests entirely only on their use of attention12.
|
| 417 |
+
|
| 418 |
+
Attention Attention is a function devised to enable ‘recollection’ of previously processed data from a history of arbitrary length (Bahdanau et al., 2015; Luong et al., 2015). Transformers use a variant called scaled dot-product attention to collect data from multiple locations in an input sequence.
|
| 419 |
+
|
| 420 |
+
Definition D.1. Scaled Dot-Product Attention is a function a $: ( \mathbb { R } ^ { d } ) ^ { * } ( \mathbb { R } ^ { m } ) ^ { * }$ parameterised by 3 linear transformations, $l _ { Q } , l _ { K } , l _ { V } : ( \mathbb { R } ^ { d } ) ^ { * } \to ( \mathbb { R } ^ { m } ) ^ { * }$ and defined for every $X \in \mathsf { ( } \mathbb { R } ^ { d } ) ^ { * }$ as follows:
|
| 421 |
+
|
| 422 |
+
$$
|
| 423 |
+
\mathrm { a } ( X ) = \mathcal { S } \bigg ( \frac { l _ { Q } ( X ) l _ { K } ( X ) ^ { T } } { \sqrt { m } } \bigg ) l _ { V } ( X )
|
| 424 |
+
$$
|
| 425 |
+
|
| 426 |
+
Note. The original definition of scaled dot-product attention allows $l _ { Q } , l _ { K }$ , and $l _ { V }$ to have different output dimensions $m$ . In this case, the denominator is $\sqrt { m _ { k } }$ .
|
| 427 |
+
|
| 428 |
+
For convenience, from here on we refer to scaled dot-product attention simply as attention.
|
| 429 |
+
|
| 430 |
+
The attention computation can be broken into 3 stages. First, a pairwise score is calculated for each pair of locations, showing how much the input in location $j$ should influence the output in location $i$ : this is the value $\mathbb { S } _ { i , j }$ in the matrix $\begin{array} { r } { \mathbb { S } = \frac { l _ { Q } ( X ) l _ { K } ( X ) ^ { T } } { \sqrt { m } } } \end{array}$ . Then, each input is processed in-place $( l _ { V } ( X ) )$ to create candidate outputs, and finally the candidate outputs are averaged for each output location $i$ , according to the softmaxed scores $S ( \mathbb { S } ) _ { i }$ for that location. In this sense, attention can be seen as a request to gather into each output information from various locations, where $l _ { Q }$ and $l _ { K }$ work together to select information sources, and $l _ { V }$ encodes the transferred information.
|
| 431 |
+
|
| 432 |
+
Transformer layers often gather information with multiple attention functions, referred to as attention heads, whose results are concatenated back into a single output at the end:
|
| 433 |
+
|
| 434 |
+
Definition D.2. Let $d , H , m \in \mathbb { N }$ be such that $d = H m .$ . $A$ multi-headed attention function with input dimension $d$ and $H$ heads is a function $\mathcal { A } : ( \mathbb { R } ^ { d } ) ^ { * } \to ( \mathbb { R } ^ { d } ) ^ { * }$ parameterised by the weights of $H$ scaled dot-product attention functions $\mathbf { a } _ { 1 } , . . . , \mathbf { a } _ { H }$ as follows: 13 for every $X \in ( \mathbb { R } ^ { \dot { d } } ) ^ { * }$ ,
|
| 435 |
+
|
| 436 |
+
$$
|
| 437 |
+
\begin{array} { r } { \boldsymbol { \mathcal { A } } ( \boldsymbol { X } ) = \mathrm { a _ { 1 } } ( \boldsymbol { X } ) { \cdot } \mathrm { a _ { 2 } } ( \boldsymbol { X } ) { \cdot } . . . { \cdot } \mathrm { a } _ { H } ( \boldsymbol { X } ) } \end{array}
|
| 438 |
+
$$
|
| 439 |
+
|
| 440 |
+
where $\cdot$ denotes row-wise concatenation, i.e. for every $i \in [ | X | ]$ , ${ \mathcal { A } } ( X ) _ { i }$ is the concatenation of $\operatorname { a } _ { 1 } ( X ) _ { i }$ through $\mathrm { a } _ { H } ( X ) _ { i }$ . The functions $\mathbf { a } _ { 1 } , . . . , \mathbf { a } _ { H }$ are referred to as the heads of $\mathcal { A }$ .
|
| 441 |
+
|
| 442 |
+
In addition to attention, transformers use layer-norm and feed-forward components, as follows: Definition D.3. $A$ single-row layer-norm over dimension $d$ is a function $g : \mathbb { R } ^ { d } \mathbb { R } ^ { d }$ parameterised by vectors $a , b \in \mathbb { R } ^ { d }$ and constant $\varepsilon \in \mathbb { R }$ , and defined for every $x \in \mathbb { R } ^ { d }$ and $i \leq d$ as follows:
|
| 443 |
+
|
| 444 |
+
$$
|
| 445 |
+
g ( x ) _ { i } = { \frac { a _ { i } ( x _ { i } - { \bar { x } } ) } { \mathrm { s t d } ( x ) + \varepsilon } } + b _ { i }
|
| 446 |
+
$$
|
| 447 |
+
|
| 448 |
+
where $\begin{array} { r } { \bar { x } = \frac { \sum _ { j \in [ d ] } x _ { j } } { d } } \end{array}$ is the mean of x and $\begin{array} { r } { \mathrm { s t d } ( x ) = \sqrt { \frac { 1 } { d - 1 } \sum _ { i \leq d } ( x _ { i } - \bar { x } ) ^ { 2 } } } \end{array}$ is its standard deviation.
|
| 449 |
+
|
| 450 |
+
A layer-norm over dimension $d$ $, \mathbf { n } : ( \mathbb { R } ^ { d } ) ^ { * } ( \mathbb { R } ^ { d } ) ^ { * }$ , is an elementwise application of a single-row layer-norm of dimension $d$ .
|
| 451 |
+
|
| 452 |
+
The layer-norm’s function is more a reguliser, and indeed, it will not play a part in our abstraction.
|
| 453 |
+
|
| 454 |
+
Definition D.4. $A$ feed-forward function with input dimension d and internal dimension m is an elementwise function $\mathcal { F } : ( \mathbb { R } ^ { d } ) ^ { * } \to ( \mathbb { R } ^ { d } ) ^ { * }$ obtained by composing two linear transformations $L _ { 1 } : ( \mathbb { R } ^ { d } ) ^ { * } \to ( \mathbb { R } ^ { m } ) ^ { * } , L _ { 2 } : ( \mathbb { R } ^ { m } ) ^ { * } \to ( \mathbb { R } ^ { d } ) ^ { * }$ and ReLU, as follows:14 ${ \mathcal { F } } ( X ) \triangleq L _ { 2 } ( { \mathcal { R } } ( L _ { 1 } ( X ) ) )$ .
|
| 455 |
+
|
| 456 |
+
The feed-forward component is elementwise, and the combination of two linear transformations with nonlinear activation provides strong expressive capacity (Hornik et al., 1989).
|
| 457 |
+
|
| 458 |
+
$$
|
| 459 |
+
\begin{array} { r } { X _ { 1 } = X + l _ { A } ( \mathcal { A } ( \mathbf { n } _ { 1 } ( X ) ) ) } \\ { \ell ( X ) = X _ { 1 } + \mathcal { F } ( \mathbf { n } _ { 2 } ( X _ { 1 } ) ) } \end{array}
|
| 460 |
+
$$
|
| 461 |
+
|
| 462 |
+
We refer to the additions in both equations as a ‘skip connection’. Note that the layernorm, feedforward, and skip connection components of the layer are elementwise: were it not for the attention, the entire layer would be elementwise.
|
| 463 |
+
|
| 464 |
+
Finally, we present the full encoder architecture:
|
| 465 |
+
|
| 466 |
+
Definition D.6 (Transformer-Encoder Vaswani et al. (2017)). A transformer-encoder with $L$ layers, $H$ heads, and input and internal dimensions $d , m$ is a length-preserving function $\mathcal { T } : ( \mathbb { R } ^ { d } ) ^ { * } \to ( \dot { \mathbb { R } } ^ { d } ) ^ { * }$ parameterised by the weights of $L$ transformer-encoder layers $\ell _ { 1 } , . . . , \ell _ { L }$ , each with $H$ heads and input and internal dimensions $d , m$ , and defined for every $X \in ( \mathbb { R } ^ { d } ) ^ { * }$ as follows:
|
| 467 |
+
|
| 468 |
+
$$
|
| 469 |
+
\mathcal { T } ( X ) = \ell _ { L } ( . . . \ell _ { 2 } ( \ell _ { 1 } ( X ) ) )
|
| 470 |
+
$$
|
| 471 |
+
|
| 472 |
+
Permutation Invariance of Transformers An interesting trait of the transformer architecture is that it has no inherent positional awareness. Specifically: for any transformer $\mathcal { T } : ( \mathbb { R } ^ { d } ) ^ { * } \to ( \mathbb { R } ^ { d } ) ^ { * }$ , input sequence $\mathbf { x } = x _ { 1 } , x _ { 2 } , . . . , x _ { n } \in \mathbb { R } ^ { d }$ , and permutation $\pi$ , we have ${ \mathcal T } ( \pi ( \mathbf { x } ) ) = \pi ( { \mathcal T } ( \mathbf { x } ) ) ^ { \mathrm { ~ l ~ } }$ 15 .
|
| 473 |
+
|
| 474 |
+
Discrete Input Transformers $\mathcal { T } : ( \mathbb { R } ^ { d } ) ^ { * } \to ( \mathbb { R } ^ { d } ) ^ { * }$ are used to process non-empty sequences over a finite alphabet $\Sigma$ by composing them with a simple length-preserving function, $\mathsf { \bar { y } _ { 0 } : \dot { Z } ^ { + } ( \mathbb { R } ^ { d } ) ^ { * } }$ : ${ \mathcal T } _ { y _ { 0 } } ( x ) \triangleq { \mathcal T } ( y _ { 0 } ( x ) )$ . This $y _ { 0 }$ is in turn composed from a token embedding $\boldsymbol { w } : \Sigma \to \mathbb { R } ^ { d }$ and position embedding $p : \mathbb { N } \to \mathbb { R } ^ { d }$ , which are normally combined using addition: for every $x = x _ { 1 } . . . x _ { n } \in \Sigma ^ { * }$ , $y _ { 0 } ( x _ { 1 } , x _ { 2 } , . . . , x _ { n } ) _ { i } = w ( x _ { i } ) + p ( i ) ^ { 1 6 }$ .
|
| 475 |
+
|
| 476 |
+
From here, whenever we refer to a ‘transformer over (some finite alphabet) $\Sigma ^ { \prime }$ , we mean a transformer paired with an initial embedding $y _ { 0 }$ as described above.
|
| 477 |
+
|
| 478 |
+
# E ADDITIONAL DETAILS ABOUT RASP
|
| 479 |
+
|
| 480 |
+
A note about types in RASP Technically, there is no one ‘tokens’, rather 5 options: tokens_str, tokens_int, tokens_float and tokens_bool cast the input sequence to the corresponding atomic types, and tokens_asis takes the input sequence as-is. For brevity, we refer to all of these as tokens here.
|
| 481 |
+
|
| 482 |
+
RASP Sequences RASP operates exclusively on sequence- and selector-generating functions, which we refer to as sequences and selectors respectively and RASP-functions together. All RASP-functions take as input exactly one non-empty sequence, and when describing them and how RASP manipulates them to create new RASP-functions we will do so in terms of the sequences and selectors that they and their manipulations generate from each input sequence. When it is clear from context, we will simply refer to them as sequences and selectors, and describe them directly in terms of their outputs. For example, if we say that a RASP operation applies $+ 1$ elementwise to each value in a sequence u, we actually mean that it returns a new sequence v such that for every input $x$ and position $0 \leq i < | x |$ , $\mathsf { v } ( x ) [ i ] { = } \mathsf { u } ( x ) [ i ] { + } 1$ .
|
| 483 |
+
|
| 484 |
+
Note In this section we will refer to the $i$ -th value in a sequence s as $\mathsf { s } [ i ]$ , such that $\mathsf { s } [ i ]$ is in one of the atomic types. We stress however that this is only for the discussion, and not a part of the language.
|
| 485 |
+
|
| 486 |
+
Additional operations For brevity in code, the RASP also comes with the following syntactic sugar:
|
| 487 |
+
|
| 488 |
+
• Anywhere that a tuple of sequences is passed into an operation, a single sequence may be passed in as-is as well. For example, $y = z .$ ipmap((indices,),(indices,),lambda a $, b : a + b ) ,$ ) can also be written $y = z \mathrm { i }$ pmap(indices,indices,lambda a, $b : a + b ) ,$ ).
|
| 489 |
+
• The zipmap operation is accessible through a large range of operators, covering its application to all of the base binary and unary operations on the atomic types. For example, the above y can equivalently be defined as y=indices+indices. These operators can also be mixed with constants from the atomic primitives, such that an equal y be obtained using $y = 2 +$ indices.
|
| 490 |
+
• aggregate may receive a tuple of sequences xx instead of a single sequence x. In this case,
|
| 491 |
+
it returns a new tuple (of the same length) of sequences, the result of applying aggregate to each of the sequences in xx. For example, the line a,b $=$ aggregate(s,(x,y)) is equivalent to a,b $=$ aggregate $( s , \mathsf { x } )$ , aggregate(s,y).
|
| 492 |
+
• The processing function passed to zipmap may return more than one value (provided the number of values it returns is constant). In this case, the operation will arrange the output values into the same number of output sequences. For example, y1, $y 2 = 2$ ipmap(x,lambda $\mathsf { v } : \mathsf { v } ^ { + 1 } , \mathsf { v } ^ { + 2 } )$ is equivalent to writing $y 1 = x + 1$ and then $y 2 = x + 2$ .
|
| 493 |
+
• Anywhere that a processing function is expected, if one is not provided, the identity function
|
| 494 |
+
is used17.
|
| 495 |
+
|
| 496 |
+
$l _ { K } ( X ) , l _ { V } ( X )$ , and $l _ { Q } ( X ) _ { i }$ , where the order of the rows of $l _ { K } ( X )$ and $l _ { V } ( X )$ does not matter as long as they remain aligned.
|
| 497 |
+
|
| 498 |
+
16Note that without the position embedding, $y _ { 0 }$ would be elementwise, and so its combination with $\tau$ would be permutation invariant – an undesirable trait for sequence processing.
|
| 499 |
+
|
| 500 |
+
17This is consistent with aggregate allowing you to choose whether to pass a single sequence, or a tuple of sequences and a processing function.
|
| 501 |
+
|
| 502 |
+
• The function select1 which takes only a single tuple of sequences xx and an indexcomputing function $\mathsf { f i }$ , and is syntactic sugar for select(xx,(indices,),lambda $\star a : f \mathrm { i } ( \mathsf { a } [ : - 1 ] ) = = a [ - 1 ] \gamma$ . select1 is guaranteed to return a true select satisfying the "up-to-one" property, i.e., that can be successfully paired in aggregates with an $\mathsf { x }$ that does not contain numbers.
|
md/train/US-TP-xnXI/US-TP-xnXI.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/a-xFK8Ymz5J/a-xFK8Ymz5J.md
ADDED
|
@@ -0,0 +1,457 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DIFFWAVE: A VERSATILE DIFFUSION MODEL FOR AUDIO SYNTHESIS
|
| 2 |
+
|
| 3 |
+
Zhifeng Kong ∗ Computer Science and Engineering, UCSD z4kong@eng.ucsd.edu
|
| 4 |
+
|
| 5 |
+
Wei Ping
|
| 6 |
+
NVIDIA
|
| 7 |
+
wping@nvidia.com
|
| 8 |
+
Jiaji Huang, Kexin Zhao
|
| 9 |
+
Baidu Research
|
| 10 |
+
{huangjiaji,kexinzhao}@baidu.com
|
| 11 |
+
Bryan Catanzaro
|
| 12 |
+
NVIDIA
|
| 13 |
+
bcatanzaro@nvidia.com
|
| 14 |
+
|
| 15 |
+
# ABSTRACT
|
| 16 |
+
|
| 17 |
+
In this work, we propose DiffWave, a versatile diffusion probabilistic model for conditional and unconditional waveform generation. The model is non-autoregressive, and converts the white noise signal into structured waveform through a Markov chain with a constant number of steps at synthesis. It is efficiently trained by optimizing a variant of variational bound on the data likelihood. DiffWave produces high-fidelity audio in different waveform generation tasks, including neural vocoding conditioned on mel spectrogram, class-conditional generation, and unconditional generation. We demonstrate that DiffWave matches a strong WaveNet vocoder in terms of speech quality (MOS: 4.44 versus 4.43), while synthesizing orders of magnitude faster. In particular, it significantly outperforms autoregressive and GAN-based waveform models in the challenging unconditional generation task in terms of audio quality and sample diversity from various automatic and human evaluations.
|
| 18 |
+
|
| 19 |
+
# 1 INTRODUCTION
|
| 20 |
+
|
| 21 |
+
Deep generative models have produced high-fidelity raw audio in speech synthesis and music generation. In previous work, likelihood-based models, including autoregressive models (van den Oord et al., 2016; Kalchbrenner et al., 2018; Mehri et al., 2017) and flow-based models (Prenger et al., 2019; Ping et al., 2020; Kim et al., 2019), have predominated in audio synthesis because of the simple training objective and superior ability of modeling the fine details of waveform in real data. There are other waveform models, which often require auxiliary losses for training, such as flow-based models trained by distillation (van den Oord et al., 2018; Ping et al., 2019), variational auto-encoder (VAE) based model (Peng et al., 2020), and generative adversarial network (GAN) based models (Kumar et al., 2019; Binkowski et al. ´ , 2020; Yamamoto et al., 2020).
|
| 22 |
+
|
| 23 |
+
Most of previous waveform models focus on audio synthesis with informative local conditioner (e.g., mel spectrogram or aligned linguistic features), with only a few exceptions for unconditional generation (Mehri et al., 2017; Donahue et al., 2019). It has been noticed that autoregressive models (e.g., WaveNet) tend to generate made-up word-like sounds (van den Oord et al., 2016), or inferior samples (Donahue et al., 2019) under unconditional settings. This is because very long sequences need to be generated (e.g., 16,000 time-steps for one second speech) without any conditional information.
|
| 24 |
+
|
| 25 |
+
Diffusion probabilistic models (diffusion models for brevity) are a class of promising generative models, which use a Markov chain to gradually convert a simple distribution (e.g., isotropic Gaussian) into complicated data distribution (Sohl-Dickstein et al., 2015; Goyal et al., 2017; Ho et al., 2020). Although the data likelihood is intractable, diffusion models can be efficiently trained by optimizing the variational lower bound (ELBO). Most recently, a certain parameterization has been shown successful in image synthesis (Ho et al., 2020), which is connected with denoising score matching (Song & Ermon, 2019). Diffusion models can use a diffusion (noise-adding) process without learnable parameters to obtain the “whitened” latents from training data. Therefore, no additional neural networks are required for training in contrast to other models (e.g., the encoder in VAE (Kingma & Welling, 2014) or the discriminator in GAN (Goodfellow et al., 2014)). This avoids the challenging “posterior collapse” or “mode collapse” issues stemming from the joint training of two networks, and hence is valuable for high-fidelity audio synthesis.
|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
Figure 1: The diffusion and reverse process in diffusion probabilistic models. The reverse process gradually converts the white noise signal into speech waveform through a Markov chain $p _ { \theta } ( x _ { t - 1 } | x _ { t } )$ .
|
| 29 |
+
|
| 30 |
+
In this work, we propose DiffWave, a versatile diffusion probabilistic model for raw audio synthesis. DiffWave has several advantages over previous work: i) It is non-autoregressive thus can synthesize high-dimensional waveform in parallel. ii) It is flexible as it does not impose any architectural constraints in contrast to flow-based models, which need to keep the bijection between latents and data (e.g., see more analysis in Ping et al. (2020)). This leads to small-footprint neural vocoders that still generate high-fidelity speech. iii) It uses a single ELBO-based training objective without any auxiliary losses (e.g., spectrogram-based losses) for high-fidelity synthesis. iv) It is a versatile model that produces high-quality audio signals for both conditional and unconditional waveform generation.
|
| 31 |
+
|
| 32 |
+
Specifically, we make the following contributions:
|
| 33 |
+
|
| 34 |
+
1. DiffWave uses a feed-forward and bidirectional dilated convolution architecture motivated by WaveNet (van den Oord et al., 2016). It matches the strong WaveNet vocoder in terms of speech quality (MOS: 4.44 vs. 4.43), while synthesizing orders of magnitude faster as it only requires a few sequential steps (e.g., 6) for generating very long waveforms.
|
| 35 |
+
2. Our small DiffWave has 2.64M parameters and synthesizes $2 2 . 0 5 \mathrm { k H z }$ high-fidelity speech (MOS: 4.37) more than $5 \times$ faster than real-time on a V100 GPU without engineered kernels. Although it is still slower than the state-of-the-art flow-based models (Ping et al., 2020; Prenger et al., 2019), it has much smaller footprint. We expect further speed-up by optimizing its inference mechanism in the future.
|
| 36 |
+
3. DiffWave significantly outperforms WaveGAN (Donahue et al., 2019) and WaveNet in the challenging unconditional and class-conditional waveform generation tasks in terms of audio quality and sample diversity measured by several automatic and human evaluations.
|
| 37 |
+
|
| 38 |
+
We organize the rest of the paper as follows. We present the diffusion models in Section 2, and introduce DiffWave architecture in Section 3. Section 4 discusses related work. We report experimental results in Section 5 and conclude the paper in Section 6.
|
| 39 |
+
|
| 40 |
+
# 2 DIFFUSION PROBABILISTIC MODELS
|
| 41 |
+
|
| 42 |
+
We define $q _ { \mathrm { d a t a } } ( x _ { 0 } )$ as the data distribution on $\mathbb { R } ^ { L }$ , where $L$ is the data dimension. Let $\boldsymbol { x } _ { t } \in \mathbb { R } ^ { L }$ for $t = 0 , 1 , \cdots , T$ be a sequence of variables with the same dimension, where $t$ is the index for diffusion steps. Then, a diffusion model of $T$ steps is composed of two processes: the diffusion process, and the reverse process (Sohl-Dickstein et al., 2015). Both of them are illustrated in Figure 1.
|
| 43 |
+
|
| 44 |
+
<table><tr><td>Algorithm1Training</td><td>Algorithm2 Sampling</td></tr><tr><td>for i = 1,2,..,Niter do</td><td>Sample xT ~ Platent = N(O,I)</td></tr><tr><td>Sample xo ~ qdata,∈~ N(O,I),and</td><td>fort=T,T-1,.,1do</td></tr><tr><td>t ~ Uniform({1,··,T})</td><td>Compute μθ(xt,t) and oe(xt,t) using Eq.(5)</td></tr><tr><td>Take gradient step on</td><td>Sample xt-1~pe(xt-1lxt)=</td></tr><tr><td>Vθll∈-∈(√@txo+√1-αt∈,t))l/²</td><td>N(xt-1;μe(xt,t),0θ(xt,t)²I)</td></tr><tr><td>according to Eq. (7)</td><td>end for</td></tr><tr><td>end for</td><td>return xo</td></tr></table>
|
| 45 |
+
|
| 46 |
+
The diffusion process is defined by a fixed Markov chain from data $x _ { 0 }$ to the latent variable $x _ { T }$
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
q ( x _ { 1 } , \cdot \cdot \cdot , x _ { T } | x _ { 0 } ) = \prod _ { t = 1 } ^ { T } q ( x _ { t } | x _ { t - 1 } ) ,
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where each of $q ( x _ { t } | x _ { t - 1 } )$ is fixed to $\mathcal { N } ( x _ { t } ; \sqrt { 1 - \beta _ { t } } x _ { t - 1 } , \beta _ { t } I )$ for a small positive constant $\beta _ { t }$ . The function of $q ( x _ { t } | x _ { t - 1 } )$ is to add small Gaussian noise to the distribution of $x _ { t - 1 }$ . The whole process gradually converts data $x _ { 0 }$ to whitened latents $x _ { T }$ according to a variance schedule $\beta _ { 1 } , \cdots , \beta _ { T }$ . 2
|
| 53 |
+
|
| 54 |
+
The reverse process is defined by a Markov chain from $x _ { T }$ to $x _ { 0 }$ parameterized by $\theta$ :
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
p _ { \mathrm { l a t e n t } } ( x _ { T } ) = { \mathcal { N } } ( 0 , I ) , { \mathrm { a n d } } p _ { \theta } ( x _ { 0 } , \cdots , x _ { T - 1 } | x _ { T } ) = \prod _ { t = 1 } ^ { T } p _ { \theta } ( x _ { t - 1 } | x _ { t } ) ,
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
where $p _ { \mathrm { l a t e n t } } ( x _ { T } )$ is isotropic Gaussian, and the transition probability $p _ { \theta } ( x _ { t - 1 } | x _ { t } )$ is parameterized as $\mathcal { N } ( x _ { t - 1 } ; \mu _ { \theta } ( x _ { t } , t ) , \sigma _ { \theta } ( x _ { t } , t ) ^ { 2 } I )$ with shared parameter $\theta$ . Note that both $\mu _ { \theta }$ and $\sigma _ { \theta }$ take two inputs: the diffusion-step $t \in \mathbb { N }$ , and variable $\boldsymbol { x } _ { t } \in \mathbb { R } ^ { \dot { \boldsymbol { L } } }$ . $\mu _ { \theta }$ outputs an $L$ -dimensional vector as the mean, and $\sigma _ { \theta }$ outputs a real number as the standard deviation. The goal of $p _ { \theta } ( x _ { t - 1 } | x _ { t } )$ is to eliminate the Gaussian noise (i.e. denoise) added in the diffusion process.
|
| 61 |
+
|
| 62 |
+
Sampling: Given the reverse process, the generative procedure is to first sample an $x _ { T } \sim \mathcal { N } ( 0 , I )$ and then sample $x _ { t - 1 } \sim p _ { \theta } ( x _ { t - 1 } | x _ { t } )$ for $t = T , T - 1 , \cdots , 1$ . The output $x _ { 0 }$ is the sampled data.
|
| 63 |
+
|
| 64 |
+
Training: The likelihood $\begin{array} { r } { p _ { \theta } ( x _ { 0 } ) = \int p _ { \theta } ( x _ { 0 } , \cdot \cdot \cdot , x _ { T - 1 } | x _ { T } ) \cdot p _ { \mathrm { l a t e n t } } ( x _ { T } ) \mathrm { \bf d } x _ { 1 : T } } \end{array}$ is intractable to calculate in general. The model is thus trained by maximizing its variational lower bound (ELBO):
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\begin{array} { r l } & { \mathbb { E } _ { q _ { \mathrm { d a t a } } ( x _ { 0 } ) } \log p _ { \theta } ( x _ { 0 } ) = \mathbb { E } _ { q _ { \mathrm { d a t a } } ( x _ { 0 } ) } \log \mathbb { E } _ { q ( x _ { 1 } , \cdots , x _ { T } | x _ { 0 } ) } \Big [ \frac { p _ { \theta } ( x _ { 0 } , \cdots , x _ { T - 1 } | x _ { T } ) \times p _ { \mathrm { l a t e n t } } ( x _ { T } ) } { q ( x _ { 1 } , \cdots , x _ { T } | x _ { 0 } ) } \Big ] } \\ & { \qquad \geq \mathbb { E } _ { q ( x _ { 0 } , \cdots , x _ { T } ) } \log \frac { p _ { \theta } ( x _ { 0 } , \cdots , x _ { T - 1 } | x _ { T } ) \times p _ { \mathrm { l a t e n t } } ( x _ { T } ) } { q ( x _ { 1 } , \cdots , x _ { T } | x _ { 0 } ) } : = \mathrm { E L B O } . } \end{array}
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
Most recently, Ho et al. (2020) showed that under a certain parameterization, the ELBO of the diffusion model can be calculated in closed-form. This accelerates the computation and avoids Monte Carlo estimates, which have high variance. This parameterization is motivated by its connection to denoising score matching with Langevin dynamics (Song & Ermon, 2019; 2020). To introduce this parameterization, we first define some constants based on the variance schedule $\{ \beta _ { t } \} _ { t = 1 } ^ { T }$ in the diffusion process as in Ho et al. (2020):
|
| 71 |
+
|
| 72 |
+
$$
|
| 73 |
+
\alpha _ { t } = 1 - \beta _ { t } , \bar { \alpha } _ { t } = \prod _ { s = 1 } ^ { t } \alpha _ { s } , \tilde { \beta } _ { t } = \frac { 1 - \bar { \alpha } _ { t - 1 } } { 1 - \bar { \alpha } _ { t } } \beta _ { t } \mathrm { f o r } t > 1 \mathrm { a n d } \tilde { \beta } _ { 1 } = \beta _ { 1 } .
|
| 74 |
+
$$
|
| 75 |
+
|
| 76 |
+
Then, the parameterizations of $\mu _ { \theta }$ and $\sigma _ { \theta }$ are defined by
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
\mu _ { \boldsymbol { \theta } } ( x _ { t } , t ) = \frac { 1 } { \sqrt { \alpha _ { t } } } \left( x _ { t } - \frac { \beta _ { t } } { \sqrt { 1 - \bar { \alpha } _ { t } } } \epsilon _ { \boldsymbol { \theta } } ( x _ { t } , t ) \right) , \ \mathrm { a n d } \ \sigma _ { \boldsymbol { \theta } } ( x _ { t } , t ) = \tilde { \beta } _ { t } ^ { \frac { 1 } { 2 } } ,
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
where $\epsilon _ { \theta } : \mathbb { R } ^ { L } \times \mathbb { N } \to \mathbb { R } ^ { L }$ is a neural network also taking $x _ { t }$ and the diffusion-step $t$ as inputs. Note that $\sigma _ { \theta } ( x _ { t } , t )$ is fixed to a constant $\tilde { \beta } _ { t } ^ { \frac { 1 } { 2 } }$ for every step $t$ under this parameterization. In the following proposition, we explicitly provide the closed-form expression of the ELBO.
|
| 83 |
+
|
| 84 |
+

|
| 85 |
+
Figure 2: The network architecture of DiffWave in modeling $\epsilon _ { \theta } : \mathbb { R } ^ { L } \times \mathbb { N } \to \mathbb { R } ^ { L }$ .
|
| 86 |
+
|
| 87 |
+
Proposition 1. (Ho et al., 2020) Suppose a series of fixed schedule $\{ \beta _ { t } \} _ { t = 1 } ^ { T }$ are given. Let $\epsilon \sim$ $\mathcal { N } ( 0 , I )$ and $x _ { 0 } \sim q _ { \mathrm { d a t a } }$ . Then, under the parameterization in Eq. (5), we have
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
- \mathrm { E L B O } = c + \sum _ { t = 1 } ^ { T } \kappa _ { t } \mathbb { E } _ { x _ { 0 } , \epsilon } \| \epsilon - \epsilon _ { \theta } \big ( \sqrt { \bar { \alpha } _ { t } } x _ { 0 } + \sqrt { 1 - \bar { \alpha } _ { t } } \epsilon , t \big ) \| _ { 2 } ^ { 2 }
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
$\kappa _ { t }$ , where $\begin{array} { r } { \kappa _ { t } = \frac { \beta _ { t } } { 2 \alpha _ { t } \left( 1 - \bar { \alpha } _ { t - 1 } \right) } } \end{array}$ for $t > 1$ , and $\begin{array} { r } { \kappa _ { 1 } = \frac { 1 } { 2 \alpha _ { 1 } } } \end{array}$
|
| 94 |
+
|
| 95 |
+
Note that $c$ is irrelevant for optimization purpose. The key idea in the proof is to expand the ELBO into a sum of KL divergences between tractable Gaussian distributions, which have a closed-form expression. We refer the readers to look at Section A in the Appendix for the full proof.
|
| 96 |
+
|
| 97 |
+
In addition, Ho et al. (2020) reported that minimizing the following unweighted variant of the ELBO leads to higher generation quality:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\operatorname* { m i n } _ { \theta } L _ { \mathrm { u n w e i g h t e d } } ( \theta ) = \mathbb { E } _ { x _ { 0 } , \epsilon , t } \| \epsilon - \epsilon _ { \theta } \big ( \sqrt { \bar { \alpha } _ { t } } x _ { 0 } + \sqrt { 1 - \bar { \alpha } _ { t } } \epsilon , \ t \big ) \| _ { 2 } ^ { 2 }
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
where $t$ is uniformly taken from $1 , \cdots , T$ . Therefore, we also use this training objective in this paper.
|
| 104 |
+
We summarize the training and sampling procedures in Algorithm 1 and 2, respectively.
|
| 105 |
+
|
| 106 |
+
Fast sampling: Given a trained model from Algorithm 1, we noticed that the most effective denoising steps at sampling occur near $t = 0$ (see Section IV on demo website). This encourages us to design a fast sampling algorithm with much fewer denoising steps $T _ { \mathrm { i n f e r } }$ (e.g., 6) than $T$ at training (e.g., 200). The key idea is to “collapse” the $T$ -step reverse process into a $T _ { \mathrm { i n f e r } }$ -step process with carefully designed variance schedule. We provide the details in Appendix B.
|
| 107 |
+
|
| 108 |
+
# 3 DIFFWAVE ARCHITECTURE
|
| 109 |
+
|
| 110 |
+
In this section, we present the architecture of DiffWave (see Figure 2 for an illustration). We build the network $\epsilon _ { \theta } : \mathbb { R } ^ { L } \times \mathbf { \bar { N } } \to \mathbb { R } ^ { L }$ in Eq. (5) based on a bidirectional dilated convolution architecture that is different from WaveNet (van den Oord et al., 2016), because there is no autoregressive generation constraint. 3 The similar architecture has been applied for source separation (Rethage et al., 2018; Lluís et al., 2018). The network is non-autoregressive, so generating an audio $x _ { 0 }$ with length $L$ from latents $x _ { T }$ requires $T$ rounds of forward propagation, where $T$ (e.g., 50) is much smaller than the waveform length $L$ . The network is composed of a stack of $N$ residual layers with residual channels
|
| 111 |
+
|
| 112 |
+
$C$ . These layers are grouped into $m$ blocks and each block has $\begin{array} { r } { n = { \frac { N } { m } } } \end{array}$ layers. We use a bidirectional dilated convolution (Bi-DilConv) with kernel size 3 in each layer. The dilation is doubled at each layer within each block, i.e., $[ 1 , 2 , 4 , \cdots , 2 ^ { n - 1 } ]$ . We sum the skip connections from all residual layers as in WaveNet. More details including the tensor shapes are included in Section C in the Appendix.
|
| 113 |
+
|
| 114 |
+
# 3.1 DIFFUSION-STEP EMBEDDING
|
| 115 |
+
|
| 116 |
+
It is important to include the diffusion-step $t$ as part of the input, as the model needs to output different $\epsilon _ { \theta } ( \cdot , t )$ for different $t$ . We use an 128-dimensional encoding vector for each $t$ (Vaswani et al., 2017):
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
t _ { \mathrm { e m b e d d i n g } } = \left[ \sin \left( 1 0 ^ { \frac { 0 \times 4 } { 6 3 } } t \right) , \cdots , \sin \left( 1 0 ^ { \frac { 6 3 \times 4 } { 6 3 } } t \right) , \cos \left( 1 0 ^ { \frac { 0 \times 4 } { 6 3 } } t \right) , \cdots , \cos \left( 1 0 ^ { \frac { 6 3 \times 4 } { 6 3 } } t \right) \right]
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
We then apply three fully connected (FC) layers on the encoding, where the first two FCs share parameters among all residual layers. The last residual-layer-specific FC maps the output of the second FC into a $C$ -dimensional embedding vector. We next broadcast this embedding vector over length and add it to the input of every residual layer.
|
| 123 |
+
|
| 124 |
+
# 3.2 CONDITIONAL GENERATION
|
| 125 |
+
|
| 126 |
+
Local conditioner: In speech synthesis, a neural vocoder can synthesize the waveform conditioned on the aligned linguistic features (van den Oord et al., 2016; Arık et al., 2017b), the mel spectrogram from a text-to-spectrogram model (Ping et al., 2018; Shen et al., 2018), or the hidden states within the text-to-wave architecture (Ping et al., 2019; Donahue et al., 2020). In this work, we test DiffWave as a neural vocoder conditioned on mel spectrogram. We first upsample the mel spectrogram to the same length as waveform through transposed 2-D convolutions. After a layer-specific $\mathbf { C o n v l } \times 1$ mapping its mel-band into $2 C$ channels, the conditioner is added as a bias term for the dilated convolution in each residual layer. The hyperparameters can be found in Section 5.1.
|
| 127 |
+
|
| 128 |
+
Global conditioner: In many generative tasks, the conditional information is given by global discrete labels (e.g., speaker IDs or word IDs). We use shared embeddings with dimension $d _ { \mathrm { l a b e l } } = 1 2 8$ in all experiments. In each residual layer, we apply a layer-specific $\mathrm { C o n v l } \times 1$ to map $d _ { \mathrm { l a b e l } }$ to $2 C$ channels, and add the embedding as a bias term after the dilated convolution in each residual layer.
|
| 129 |
+
|
| 130 |
+
# 3.3 UNCONDITIONAL GENERATION
|
| 131 |
+
|
| 132 |
+
In unconditional generation task, the model needs to generate consistent utterances without conditional information. It is important for the output units of the network to have a receptive field size (denoted as $r$ ) larger than the length $L$ of the utterance. Indeed, we need $r \geq 2 L$ , thus the left and right-most output units have receptive fields covering the whole $L$ -dimensional inputs as illustrated in Figure 4 in Appendix. This posts a challenge for architecture design even with the dilated convolutions.
|
| 133 |
+
|
| 134 |
+
For a stack of dilated convolution layers, the receptive field size of the output is up to: $r =$ $\begin{array} { r } { ( k - 1 ) \sum _ { i } d _ { i } + 1 } \end{array}$ , where $k$ is the kernel size and $d _ { i }$ is the dilation at $i$ -th residual layer. For example, 30-layer dilated convolution has a receptive field size $r = 6 1 3 9$ , with $k = 3$ and dilation cycle $[ 1 , 2 , \cdots , 5 1 2 ]$ . This only amounts to 0.38s of $1 6 \mathrm { k H z }$ audio. We can further increase the number of layers and the size of dilation cycles; however, we found degraded quality with deeper layers and larger dilation cycles. This is particularly true for WaveNet. In fact, previous study (Shen et al., 2018) suggests that even a moderate large receptive field size (e.g., 6139) is not effectively used in WaveNet and it tends to focus on much shorter context (e.g., 500). DiffWave has an advantage in enlarging the receptive fields of output $x _ { 0 }$ : by iterating from $x _ { T }$ to $x _ { 0 }$ in the reverse process, the receptive field size can be increased up to $T \times r$ , which makes DiffWave suitable for unconditional generation.
|
| 135 |
+
|
| 136 |
+
# 4 RELATED WORK
|
| 137 |
+
|
| 138 |
+
In the past years, many neural text-to-speech (TTS) systems have been introduced. An incomplete list includes WaveNet (van den Oord et al., 2016), Deep Voice 1 & 2 & 3 (Arık et al., 2017a;b; Ping et al., 2018), Tacotron 1 & 2 (Wang et al., 2017; Shen et al., 2018), Char2Wav (Sotelo et al., 2017), VoiceLoop (Taigman et al., 2018), Parallel WaveNet (van den Oord et al., 2018), WaveRNN (Kalchbrenner et al., 2018), ClariNet (Ping et al., 2019), ParaNet (Peng et al., 2020), FastSpeech (Ren et al., 2019), GAN-TTS (Binkowski et al.´ , 2020), and Flowtron (Valle et al., 2020). These systems first generate intermediate representations (e.g., aligned linguistic features, mel spectrogram, or hidden representations) conditioned on text, then use a neural vocoder to synthesize the raw waveform.
|
| 139 |
+
|
| 140 |
+
Neural vocoder plays the most important role in the recent success of speech synthesis. Autoregressive models like WaveNet and WaveRNN can generate high-fidelity speech, but in a sequential way of generation. Parallel WaveNet and ClariNet distill parallel flow-based models from WaveNet, thus can synthesize waveform in parallel. In contrast, WaveFlow (Ping et al., 2020), WaveGlow (Prenger et al., 2019) and FloWaveNet (Kim et al., 2019) are trained by maximizing likelihood. There are other waveform models, such as VAE-based models (Peng et al., 2020), GAN-based models (Kumar et al., 2019; Yamamoto et al., 2020; Binkowski et al. ´ , 2020), and neural signal processing models (Wang et al., 2019; Engel et al., 2020; Ai & Ling, 2020). In contrast to likelihood-based models, they often require auxiliary training losses to improve the audio fidelity. The proposed DiffWave is another promising neural vocoder synthesizing the best quality of speech with a single objective function.
|
| 141 |
+
|
| 142 |
+
Unconditional generation of audio in the time domain is a challenging task in general. Likelihoodbased models are forced to learn all possible variations within the dataset without any conditional information, which can be quite difficult with limited model capacity. In practice, these models produce made-up word-like sounds or inferior samples (van den Oord et al., 2016; Donahue et al., 2019). VQ-VAE (van den Oord et al., 2017) circumvents this issue by compressing the waveform into compact latent code, and training an autoregressive model in latent domain. GAN-based models are believed to be suitable for unconditional generation (e.g., Donahue et al., 2019) due to the “mode seeking” behaviour and success in image domain (Brock et al., 2018). Note that unconditional generation of audio in the frequency domain is considered easier, as the spectrogram is much shorter (e.g., $2 0 0 \times$ ) than waveform (Vasquez & Lewis, 2019; Engel et al., 2019; Palkama et al., 2020).
|
| 143 |
+
|
| 144 |
+
In this work, we demonstrate the superior performance of DiffWave in unconditional generation of waveform. In contrast to the exact-likelihood models, DiffWave maximizes a variational lower bound of the likelihood, which can focus on the major variations within the data and alleviate the requirements for model capacity. In contrast to GAN or VAE-based models (Donahue et al., 2019; Peng et al., 2020), it is much easier to train without mode collapse, posterior collapse, or training instability stemming from the joint training of two networks. There is a concurrent work (Chen et al., 2020) that uses diffusion probabilistic models for waveform generation. In contrast to DiffWave, it uses a neural architecture similar to GAN-TTS and focuses on the neural vocoding task only. Our DiffWave vocoder has much fewer parameters than WaveGrad – 2.64M vs. 15M for Base models and 6.91M vs. 23M for Large models. The small memory footprint is preferred in production TTS systems, especially for on-device deployment. In addition, DiffWave requires a smaller batch size (16 vs. 256) and fewer computational resources for training.
|
| 145 |
+
|
| 146 |
+
# 5 EXPERIMENTS
|
| 147 |
+
|
| 148 |
+
We evaluate DiffWave on neural vocoding, unconditional and class-conditional generation tasks.
|
| 149 |
+
|
| 150 |
+
# 5.1 NEURAL VOCODING
|
| 151 |
+
|
| 152 |
+
Data: We use the LJ speech dataset (Ito, 2017) that contains ${ \sim } 2 4$ hours of audio recorded in home environment with a sampling rate of $2 2 . 0 5 \mathrm { k H z }$ . It contains 13,100 utterances from a female speaker.
|
| 153 |
+
|
| 154 |
+
Models: We compare DiffWave with several state-of-the-art neural vocoders, including WaveNet, ClariNet, WaveGlow and WaveFlow. Details of baseline models can be found in the original papers. Their hyperparameters can be found in Table 1. Our DiffWave models have 30 residual layers, kernel size 3, and dilation cycle $[ 1 , 2 , \cdots , 5 1 2 ]$ . We compare DiffWave models with different number of diffusion steps $T \in \{ 2 0 , \dot { 4 } 0 , 5 0 , 2 0 0 \}$ and residual channels $C \in \{ 6 4 , 1 2 8 \}$ . We use linear spaced schedule for $\beta _ { t } \in [ 1 \times 1 0 ^ { - 4 } , 0 . 0 2 ]$ for DiffWave with $T = 2 0 0$ , and $\beta _ { t } \mathbf { \bar { \beta } } \in \left[ 1 \times 1 0 ^ { - 4 } , 0 . 0 5 \right]$ for DiffWave with $T \leq 5 0$ . The reason to increase $\beta _ { t }$ for smaller $T$ is to make $q ( x _ { T } | x _ { 0 } )$ close to $p _ { \mathrm { l a t e n t } }$ In addition, we compare the fast sampling algorithm with smaller $T _ { \mathrm { i n f e r } }$ (see Appendix B), denoted as DiffWave (Fast), with the regular sampling (Algorithm 2). Both of them use the same trained models.
|
| 155 |
+
|
| 156 |
+
Conditioner: We use the 80-band mel spectrogram of the original audio as the conditioner to test these neural vocoders as in previous work (Ping et al., 2019; Prenger et al., 2019; Kim et al., 2019). We set FFT size to 1024, hop size to 256, and window size to 1024. We upsample the mel spectrogram 256 times by applying two layers of transposed 2-D convolution (in time and frequency) interleaved with leaky ReLU $( \alpha = 0 . 4 )$ . For each layer, the upsamling stride in time is 16 and 2-D filter sizes are [32, 3]. After upsampling, we use a layer-specific $\mathrm { C o n v l } \times 1$ to map the $8 0 \mathrm { m e l }$ bands into $2 \times$ residual channels, then add the conditioner as a bias term for the dilated convolution before the gated-tanh nonlinearities in each residual layer.
|
| 157 |
+
|
| 158 |
+
Table 1: The model hyperparameters, model footprint, and 5-scale Mean Opinion Score (MOS) with $9 5 \%$ confidence intervals for WaveNet, ClariNet, WaveFlow, WaveGlow and the proposed DiffWave on the neural vocoding task. $\uparrow$ means the number is the higher the better, and $\downarrow$ means the number is the lower the better.
|
| 159 |
+
|
| 160 |
+
<table><tr><td>Model</td><td>T</td><td>Tinfer</td><td>layers</td><td>res.channels</td><td>#param(↓)</td><td>MOS(↑)</td></tr><tr><td>WaveNet</td><td></td><td></td><td>30</td><td>128</td><td>4.57M</td><td>4.43± 0.10</td></tr><tr><td>ClariNet</td><td></td><td></td><td>60</td><td>64</td><td>2.17M</td><td>4.27 ± 0.09</td></tr><tr><td>WaveGlow</td><td></td><td></td><td>96</td><td>256</td><td>87.88M</td><td>4.33 ± 0.12</td></tr><tr><td>WaveFlow</td><td></td><td></td><td>64</td><td>64</td><td>5.91M</td><td>4.30 ± 0.11</td></tr><tr><td>WaveFlow</td><td></td><td></td><td>64</td><td>128</td><td>22.25M</td><td>4.40 ± 0.07</td></tr><tr><td>DiffWave BASE</td><td>20</td><td>20</td><td>30</td><td>64</td><td>2.64M</td><td>4.31± 0.09</td></tr><tr><td>DiffWave BASE</td><td>40</td><td>40</td><td>30</td><td>64</td><td>2.64M</td><td>4.35 ± 0.10</td></tr><tr><td>DiffWave BASE</td><td>50</td><td>50</td><td>30</td><td>64</td><td>2.64M</td><td>4.38 ± 0.08</td></tr><tr><td>DiffWave LARGE</td><td>200</td><td>200</td><td>30</td><td>128</td><td>6.91M</td><td>4.44 ± 0.07</td></tr><tr><td>DiffWave BASE (Fast)</td><td>50</td><td>6</td><td>30</td><td>64</td><td>2.64M</td><td>4.37±0.07</td></tr><tr><td>DiffWave LARGE (Fast)</td><td>200</td><td>6</td><td>30</td><td>128</td><td>6.91M</td><td>4.42 ± 0.09</td></tr><tr><td>Ground-truth</td><td></td><td></td><td>一</td><td></td><td></td><td>4.52 ± 0.06</td></tr></table>
|
| 161 |
+
|
| 162 |
+
Training: We train DiffWave on 8 Nvidia 2080Ti GPUs using random short audio clips of 16,000 samples from each utterance. We use Adam optimizer (Kingma & Ba, 2015) with a batch size of 16 and learning rate $2 \times 1 0 ^ { - 4 }$ . We train all DiffWave models for 1M steps. For other models, we follow the training setups as in the original papers.
|
| 163 |
+
|
| 164 |
+
Results: We use the crowdMOS tookit (Ribeiro et al., 2011) for speech quality evaluation, where the test utterances from all models were presented to Mechanical Turk workers. We report the 5-scale Mean Opinion Scores (MOS), and model footprints in Table $1 ^ { 4 }$ . Our DiffWave LARGE model with residual channels 128 matches the strong WaveNet vocoder in terms of speech quality (MOS: 4.44 vs. 4.43). The DiffWave BASE with residual channels 64 also generates high quality speech (e.g., MOS: 4.35) even with small number of diffusion steps (e.g., $T = 4 0$ or 20). For synthesis speed, DiffWave BASE $T = 2 0$ ) in FP32 generates audio $2 . 1 \times$ faster than real-time, and DiffWave BASE $T =$ 40) in FP32 is $1 . 1 \times$ faster than real-time on a Nvidia V100 GPU without engineering optimization. Meanwhile, DiffWave $\mathrm { B A S E }$ (Fast) and DiffWave LARGE (Fast) can be $5 . 6 \times$ and $3 . 5 \times$ faster than realtime respectively and still obtain good audio fidelity. In contrast, a WaveNet implementation can be $5 0 0 \times$ slower than real-time at synthesis without engineered kernels. DiffWave is still slower than the state-of-the-art flow-based models (e.g., a 5.91M WaveFlow is $> 4 0 \times$ faster than real-time in FP16), but has smaller footprint and slightly better quality. Because DiffWave does not impose any architectural constraints as in flow-based models, we expect further speed-up by optimizing the architecture and inference mechanism in the future.
|
| 165 |
+
|
| 166 |
+
# 5.2 UNCONDITIONAL GENERATION
|
| 167 |
+
|
| 168 |
+
In this section, we apply DiffWave to an unconditional generation task based on raw waveform only.
|
| 169 |
+
|
| 170 |
+
Data: We use the Speech Commands dataset (Warden, 2018), which contains many spoken words by thousands of speakers under various recording conditions including some very noisy environment. We select the subset that contains spoken digits $( 0 { \sim } 9 )$ , which we call the SC09 dataset. The SC09 dataset contains 31,158 training utterances ( ${ \sim } 8 . 7$ hours in total) by 2,032 speakers, where each audio has length equal to one second under sampling rate 16kHz. Therefore, the data dimension $L$ is 16,000. Note that the SC09 dataset exhibits various variations (e.g., contents, speakers, speech rate, recording conditions); the generative models need to model them without any conditional information.
|
| 171 |
+
|
| 172 |
+
Models: We compare DiffWave with WaveNet and WaveGAN. We also tried to remove the mel conditioner in a state-of-the-art GAN-based neural vocoder (Yamamoto et al., 2020), but found it could not generate intelligible speech in this unconditional task. We use 30 layer-WaveNet models with residual channels 128 (denoted as WaveNet-128) and 256 (denoted as WaveNet-256), respectively. We tried to increase the size of the dilation cycle and the number of layers, but these modifications lead to worse quality. In particular, a large dilation cycle (e.g., up to 2048) leads to unstable training. For WaveGAN, we use their pretrained model on Google Colab. We use a 36-layer DiffWave model with kernel size 3 and dilation cycle $[ 1 , 2 , \cdots , 2 0 4 8 ]$ . We set the number of diffusion steps $T = 2 0 0$ and residual channels $C = 2 5 6$ . We use linear spaced schedule for $\beta _ { t } \in [ 1 \times 1 0 ^ { - 4 } , 0 .$ .02].
|
| 173 |
+
|
| 174 |
+
Table 2: The automatic evaluation metrics (FID, IS, mIS, AM, and $\mathrm { N D B } / K )$ , and 5-scale MOS with $9 5 \%$ confidence intervals for WaveNet, WaveGAN, and DiffWave on the unconditional generation task. $\uparrow$ means the number is the higher the better, and $\downarrow$ means the number is the lower the better.
|
| 175 |
+
|
| 176 |
+
<table><tr><td>Model</td><td>FID(↓)</td><td>IS(↑)</td><td>mIS(↑)</td><td>AM(↓)</td><td>NDB/K(↓)</td><td>MOS(↑)</td></tr><tr><td>WaveNet-128</td><td>3.279</td><td>2.54</td><td>7.6</td><td>1.368</td><td>0.86</td><td>1.34 ± 0.29</td></tr><tr><td>WaveNet-256</td><td>2.947</td><td>2.84</td><td>10.0</td><td>1.260</td><td>0.86</td><td>1.43 ± 0.30</td></tr><tr><td>WaveGAN</td><td>1.349</td><td>4.53</td><td>36.6</td><td>0.796</td><td>0.78</td><td>2.03 ± 0.33</td></tr><tr><td>DiffWave</td><td>1.287</td><td>5.30</td><td>59.4</td><td>0.636</td><td>0.74</td><td>3.39 ± 0.32</td></tr><tr><td>Trainset</td><td>0.000</td><td>8.48</td><td>281.4</td><td>0.164</td><td>0.00</td><td></td></tr><tr><td>Testset</td><td>0.011</td><td>8.47</td><td>275.2</td><td>0.166</td><td>0.10</td><td>3.72 ± 0.28</td></tr></table>
|
| 177 |
+
|
| 178 |
+
Table 3: The automatic evaluation metrics (Accuracy, FID-class, IS, mIS), and 5-scale MOS with $9 5 \%$ confidence intervals for WaveNet and DiffWave on the class-conditional generation task.
|
| 179 |
+
|
| 180 |
+
<table><tr><td>Model</td><td>Accuracy(↑)</td><td>FID-class(↓)</td><td>IS(↑)</td><td>mIS(↑)</td><td>MOS(↑)</td></tr><tr><td>WaveNet-128</td><td>56.20%</td><td>7.876±2.469</td><td>3.29</td><td>15.8</td><td>1.46 ± 0.30</td></tr><tr><td>WaveNet-256</td><td>60.70%</td><td>6.954±2.114</td><td>3.46</td><td>18.9</td><td>1.58 ± 0.36</td></tr><tr><td>DiffWave</td><td>91.20%</td><td>1.113±0.569</td><td>6.63</td><td>117.4</td><td>3.50 ± 0.31</td></tr><tr><td>DiffWave (deep & thin)</td><td>94.00%</td><td>0.932±0.450</td><td>6.92</td><td>133.8</td><td>3.44± 0.36</td></tr><tr><td>Trainset</td><td>99.06%</td><td>0.000±0.000</td><td>8.48</td><td>281.4</td><td></td></tr><tr><td>Testset</td><td>98.76%</td><td>0.044±0.016</td><td>8.47</td><td>275.2</td><td>3.72 ± 0.28</td></tr></table>
|
| 181 |
+
|
| 182 |
+
Training: We train WaveNet and DiffWave on 8 Nvidia 2080Ti GPUs using full utterances. We use Adam optimizer with a batch size of 16. For WaveNet, we set the initial learning rate as $1 \times 1 0 ^ { - 3 }$ and halve the learning rate every 200K iterations. For DiffWave, we fix the learning rate to $2 \times 1 0 ^ { - 4 }$ . We train WaveNet and DiffWave for 1M steps.
|
| 183 |
+
|
| 184 |
+
Evaluation: For human evaluation, we report the 5-scale MOS for speech quality similar to Section 5.1. To automatically evaluate the quality of generated audio samples, we train a ResNeXT classifier (Xie et al., 2017) on the SC09 dataset according to an open repository (Xu & Tuguldur, 2017). The classifier achieves $9 9 . 0 6 \%$ accuracy on the trainset and $9 8 . 7 6 \%$ accuracy on the testset. We use the following evaluation metrics based on the 1024-dimensional feature vector and the 10-dimensional logits from the ResNeXT classifier (see Section D in the Appendix for the detailed definitions):
|
| 185 |
+
|
| 186 |
+
• Fréchet Inception Distance (FID) (Heusel et al., 2017) measures both quality and diversity of generated samples, and favors generators that match moments in the feature space.
|
| 187 |
+
• Inception Score (IS) (Salimans et al., 2016) measures both quality and diversity of generated samples, and favors generated samples that can be clearly determined by the classifier. Modified Inception Score (mIS) (Gurumurthy et al., 2017) measures the within-class diversity of samples in addition to IS.
|
| 188 |
+
AM Score (Zhou et al., 2017) takes into consideration the marginal label distribution of training data compared to IS.
|
| 189 |
+
• Number of Statistically-Different Bins (NDB) (Richardson & Weiss, 2018) measures diversity of generated samples.
|
| 190 |
+
|
| 191 |
+
Results: We randomly generate 1,000 audio samples from each model for evaluation. We report results in Table 2. Our DiffWave model outperforms baseline models under all metrics, including both automatic and human evaluation. Notably, the quality of audio samples generated by DiffWave is much higher than WaveNet and WaveGAN baselines (MOS: 3.39 vs. 1.43 and 2.03). Note that the quality of ground-truth audio exhibits large variations. The automatic evaluation metrics also indicate that DiffWave is better at quality, diversity, and matching marginal label distribution of training data.
|
| 192 |
+
|
| 193 |
+
# 5.3 CLASS-CONDITIONAL GENERATION
|
| 194 |
+
|
| 195 |
+
In this section, we provide the digit labels as the conditioner in DiffWave and compare our model to WaveNet. We omit the comparison with conditional WaveGAN due to its noisy output audio (Lee et al., 2018). For both DiffWave and WaveNet, the label conditioner is added to the model according to Section 3.2. We use the same dataset, model hyperparameters, and training settings as in Section 5.2.
|
| 196 |
+
|
| 197 |
+
Evaluation: We use slightly different automatic evaluation methods in this section because audio samples are generated according to pre-specified discrete labels. The AM score and NDB are removed because they are less meaningful when the prior label distribution of generated data is specified. We keep IS and mIS because IS favors sharp, clear samples and mIS measures within-class diversity. We modify FID to FID-class: for each digit from 0 to 9, we compute FID between the generated audio samples that are pre-specified as this digit and training utterances with the same digit labels, and report the mean and standard deviation of these ten FID scores. We also report classification accuracy based on the ResNeXT classifier used in Section 5.2.
|
| 198 |
+
|
| 199 |
+
Results: We randomly generate 100 audio samples for each digit (0 to 9) from all models for evaluation. We report results in Table 3. Our DiffWave model significantly outperforms WaveNet on all evaluation metrics. It produces superior quality than WaveNet (MOS: 3.50 vs. 1.58), and greatly decreases the gap to ground-truth (the gap between DiffWave and ground-truth is ${ \sim } 1 0 \%$ of the gap between WaveNet and ground-truth). The automatic evaluation metrics indicate that DiffWave is much better at speech clarity $( > 9 1 \%$ accuracy) and within-class diversity (its mIS is $6 \times$ higher than WaveNet). We additionally found a deep and thin version of DiffWave with residual channels $C = 1 2 8$ and 48 residual layers can achieve slightly better accuracy but lower audio quality. One may also compare quality of generated audio samples between conditional and unconditional generation based on IS, mIS, and MOS. For both WaveNet and DiffWave, IS increases by $> 2 0 \%$ , mIS almost doubles, and MOS increases by $\geq 0 . 1 1$ . These results indicate that the digit labels reduces the difficulty of the generative task and helps improving the generation quality of WaveNet and DiffWave.
|
| 200 |
+
|
| 201 |
+
# 5.4 ADDITIONAL RESULTS
|
| 202 |
+
|
| 203 |
+
Zero-shot speech denoising: The unconditional DiffWave model can readily perform speech denoising. The SC09 dataset provides six types of noises for data augmentation in recognition tasks: white noise, pink noise, running tap, exercise bike, dude miaowing, and doing the dishes. These noises are not used during the training phase of our unconditional DiffWave in Section 5.2. We add $10 \%$ of each type of noise to test data, feed these noisy utterances into the reverse process at $t = 2 5$ , and then obtain the outputs $x _ { 0 }$ ’s. The audio samples are in Section $\mathrm { v }$ on the demo website. Note that our model is not trained on a denoising task and has zero knowledge about any noise type other than the white noise added in diffusion process. It indicates DiffWave learns a good prior of raw audio.
|
| 204 |
+
|
| 205 |
+
Interpolation in latent space: We can do interpolation with the digit conditioned DiffWave model in Section 5.3 on the SC09 dataset. The interpolation of voices $x _ { 0 } ^ { a }$ , $\mathbf { \bar { \Phi } } _ { x _ { 0 } ^ { b } }$ between two speakers $a , b$ is done in the latent space at $t = 5 0$ . We first sample $x _ { t } ^ { a } \sim q ( x _ { t } | x _ { 0 } ^ { \tilde { a } } )$ and $x _ { t } ^ { b } \sim q ( x _ { t } | x _ { 0 } ^ { \dot { b } } )$ for the two speakers. We then do linear interpolation between $\boldsymbol { x } _ { t } ^ { a }$ and $\boldsymbol { x } _ { t } ^ { b }$ : $x _ { t } ^ { \lambda } = ( 1 - \lambda ) x _ { t } ^ { a } + \lambda x _ { t } ^ { b }$ for $0 < \lambda < 1$ Finally, we sample $x _ { 0 } ^ { \lambda } \sim p _ { \theta } ( x _ { 0 } ^ { \lambda } | \dot { x } _ { t } ^ { \lambda } )$ . The audio samples are in Section VI on the demo website.
|
| 206 |
+
|
| 207 |
+
# 6 CONCLUSION
|
| 208 |
+
|
| 209 |
+
In this paper, we present DiffWave, a versatile generative model for raw waveform. In the neural vocoding task, it readily models the fine details of waveform conditioned on mel spectrogram and matches the strong autoregressive neural vocoder in terms of speech quality. In unconditional and class-conditional generation tasks, it properly captures the large variations within the data and produces realistic voices and consistent word-level pronunciations. To the best of our knowledge, DiffWave is the first waveform model that exhibits such versatility. DiffWave raises a number of open problems and provides broad opportunities for future research. For example, it would be meaningful to push the model to generate longer utterances, as DiffWave potentially has very large receptive fields. Second, optimizing the inference speed would be beneficial for applying the model in production TTS, because DiffWave is still slower than flow-based models. We found the most effective denoising steps in the reverse process occur near $x _ { 0 }$ , which suggests an even smaller $T$ is possible in DiffWave. In addition, the model parameters $\theta$ are shared across the reverse process, so the persistent kernels that stash the parameters on-chip would largely speed-up inference on GPUs (Diamos et al., 2016).
|
| 210 |
+
|
| 211 |
+
# REFERENCES
|
| 212 |
+
|
| 213 |
+
Yang Ai and Zhen-Hua Ling. A neural vocoder with hierarchical generation of amplitude and phase spectra for statistical parametric speech synthesis. IEEE/ACM Transactions on Audio, Speech, and Language Processing, 28:839–851, 2020.
|
| 214 |
+
|
| 215 |
+
Sercan Ö. Arık, Mike Chrzanowski, Adam Coates, Gregory Diamos, Andrew Gibiansky, Yongguo Kang, Xian Li, John Miller, Jonathan Raiman, Shubho Sengupta, and Mohammad Shoeybi. Deep Voice: Real-time neural text-to-speech. In ICML, 2017a.
|
| 216 |
+
|
| 217 |
+
Sercan Ö. Arık, Gregory Diamos, Andrew Gibiansky, John Miller, Kainan Peng, Wei Ping, Jonathan Raiman, and Yanqi Zhou. Deep Voice 2: Multi-speaker neural text-to-speech. In NIPS, 2017b.
|
| 218 |
+
|
| 219 |
+
Mikołaj Binkowski, Jeff Donahue, Sander Dieleman, Aidan Clark, Erich Elsen, Norman Casagrande, ´ Luis C Cobo, and Karen Simonyan. High fidelity speech synthesis with adversarial networks. In ICLR, 2020.
|
| 220 |
+
|
| 221 |
+
Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. arXiv preprint arXiv:1809.11096, 2018.
|
| 222 |
+
|
| 223 |
+
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.
|
| 224 |
+
|
| 225 |
+
Greg Diamos, Shubho Sengupta, Bryan Catanzaro, Mike Chrzanowski, Adam Coates, Erich Elsen, Jesse Engel, Awni Hannun, and Sanjeev Satheesh. Persistent rnns: Stashing recurrent weights on-chip. In International Conference on Machine Learning, pp. 2024–2033, 2016.
|
| 226 |
+
|
| 227 |
+
Chris Donahue, Julian McAuley, and Miller Puckette. Adversarial audio synthesis. In ICLR, 2019.
|
| 228 |
+
|
| 229 |
+
Jeff Donahue, Sander Dieleman, Mikołaj Binkowski, Erich Elsen, and Karen Simonyan. End-to-end ´ adversarial text-to-speech. arXiv preprint arXiv:2006.03575, 2020.
|
| 230 |
+
|
| 231 |
+
Jesse Engel, Kumar Krishna Agrawal, Shuo Chen, Ishaan Gulrajani, Chris Donahue, and Adam Roberts. Gansynth: Adversarial neural audio synthesis. In ICLR, 2019.
|
| 232 |
+
|
| 233 |
+
Jesse Engel, Lamtharn Hantrakul, Chenjie Gu, and Adam Roberts. Ddsp: Differentiable digital signal processing. arXiv preprint arXiv:2001.04643, 2020.
|
| 234 |
+
|
| 235 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In Advances in neural information processing systems, pp. 2672–2680, 2014.
|
| 236 |
+
|
| 237 |
+
Anirudh Goyal Alias Parth Goyal, Nan Rosemary Ke, Surya Ganguli, and Yoshua Bengio. Variational walkback: Learning a transition operator as a stochastic recurrent net. In Advances in Neural Information Processing Systems, pp. 4392–4402, 2017.
|
| 238 |
+
|
| 239 |
+
Swaminathan Gurumurthy, Ravi Kiran Sarvadevabhatla, and R Venkatesh Babu. Deligan: Generative adversarial networks for diverse and limited data. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 166–174, 2017.
|
| 240 |
+
|
| 241 |
+
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, pp. 6626–6637, 2017.
|
| 242 |
+
|
| 243 |
+
Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. arXiv preprint arXiv:2006.11239, 2020.
|
| 244 |
+
|
| 245 |
+
Keith Ito. The LJ speech dataset. 2017.
|
| 246 |
+
|
| 247 |
+
Nal Kalchbrenner, Erich Elsen, Karen Simonyan, Seb Noury, Norman Casagrande, Edward Lockhart, Florian Stimberg, Aaron van den Oord, Sander Dieleman, and Koray Kavukcuoglu. Efficient neural audio synthesis. In ICML, 2018.
|
| 248 |
+
|
| 249 |
+
Sungwon Kim, Sang-gil Lee, Jongyoon Song, and Sungroh Yoon. FloWaveNet: A generative flow for raw audio. In ICML, 2019.
|
| 250 |
+
|
| 251 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015.
|
| 252 |
+
|
| 253 |
+
Diederik P Kingma and Max Welling. Auto-encoding variational Bayes. In ICLR, 2014.
|
| 254 |
+
|
| 255 |
+
Kundan Kumar, Rithesh Kumar, Thibault de Boissiere, Lucas Gestin, Wei Zhen Teoh, Jose Sotelo, Alexandre de Brébisson, Yoshua Bengio, and Aaron C Courville. Melgan: Generative adversarial networks for conditional waveform synthesis. In Advances in Neural Information Processing Systems, pp. 14881–14892, 2019.
|
| 256 |
+
|
| 257 |
+
Chae Young Lee, Anoop Toffy, Gue Jun Jung, and Woo-Jin Han. Conditional wavegan. arXiv preprint arXiv:1809.10636, 2018.
|
| 258 |
+
|
| 259 |
+
Francesc Lluís, Jordi Pons, and Xavier Serra. End-to-end music source separation: is it possible in the waveform domain? arXiv preprint arXiv:1810.12187, 2018.
|
| 260 |
+
|
| 261 |
+
Soroush Mehri, Kundan Kumar, Ishaan Gulrajani, Rithesh Kumar, Shubham Jain, Jose Sotelo, Aaron Courville, and Yoshua Bengio. SampleRNN: An unconditional end-to-end neural audio generation model. In ICLR, 2017.
|
| 262 |
+
|
| 263 |
+
Kasperi Palkama, Lauri Juvela, and Alexander Ilin. Conditional spoken digit generation with stylegan. In Interspeech, 2020.
|
| 264 |
+
|
| 265 |
+
Kainan Peng, Wei Ping, Zhao Song, and Kexin Zhao. Non-autoregressive neural text-to-speech. In ICML, 2020.
|
| 266 |
+
|
| 267 |
+
Wei Ping, Kainan Peng, Andrew Gibiansky, Sercan O Arik, Ajay Kannan, Sharan Narang, Jonathan Raiman, and John Miller. Deep Voice 3: Scaling text-to-speech with convolutional sequence learning. In ICLR, 2018.
|
| 268 |
+
|
| 269 |
+
Wei Ping, Kainan Peng, and Jitong Chen. ClariNet: Parallel wave generation in end-to-end text-tospeech. In ICLR, 2019.
|
| 270 |
+
|
| 271 |
+
Wei Ping, Kainan Peng, Kexin Zhao, and Zhao Song. WaveFlow: A compact flow-based model for raw audio. In ICML, 2020.
|
| 272 |
+
|
| 273 |
+
Ryan Prenger, Rafael Valle, and Bryan Catanzaro. WaveGlow: A flow-based generative network for speech synthesis. In IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2019.
|
| 274 |
+
|
| 275 |
+
Yi Ren, Yangjun Ruan, Xu Tan, Tao Qin, Sheng Zhao, Zhou Zhao, and Tie-Yan Liu. Fastspeech: Fast, robust and controllable text to speech. arXiv preprint arXiv:1905.09263, 2019.
|
| 276 |
+
|
| 277 |
+
Dario Rethage, Jordi Pons, and Xavier Serra. A wavenet for speech denoising. In 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 5069–5073. IEEE, 2018.
|
| 278 |
+
|
| 279 |
+
Flávio Ribeiro, Dinei Florêncio, Cha Zhang, and Michael Seltzer. CrowdMOS: An approach for crowdsourcing mean opinion score studies. In ICASSP, 2011.
|
| 280 |
+
|
| 281 |
+
Eitan Richardson and Yair Weiss. On gans and gmms. In Advances in Neural Information Processing Systems, pp. 5847–5858, 2018.
|
| 282 |
+
|
| 283 |
+
Tim Salimans, Ian Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. In Advances in neural information processing systems, pp. 2234–2242, 2016.
|
| 284 |
+
|
| 285 |
+
Jonathan Shen, Ruoming Pang, Ron J Weiss, Mike Schuster, Navdeep Jaitly, Zongheng Yang, Zhifeng Chen, Yu Zhang, Yuxuan Wang, RJ Skerry-Ryan, et al. Natural TTS synthesis by conditioning WaveNet on mel spectrogram predictions. In ICASSP, 2018.
|
| 286 |
+
|
| 287 |
+
Jascha Sohl-Dickstein, Eric A Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. arXiv preprint arXiv:1503.03585, 2015.
|
| 288 |
+
|
| 289 |
+
Yang Song and Stefano Ermon. Generative modeling by estimating gradients of the data distribution. In Advances in Neural Information Processing Systems, pp. 11918–11930, 2019.
|
| 290 |
+
|
| 291 |
+
Yang Song and Stefano Ermon. Improved techniques for training score-based generative models. arXiv preprint arXiv:2006.09011, 2020.
|
| 292 |
+
|
| 293 |
+
Jose Sotelo, Soroush Mehri, Kundan Kumar, Joao Felipe Santos, Kyle Kastner, Aaron Courville, and Yoshua Bengio. Char2wav: End-to-end speech synthesis. ICLR workshop, 2017.
|
| 294 |
+
|
| 295 |
+
Yaniv Taigman, Lior Wolf, Adam Polyak, and Eliya Nachmani. VoiceLoop: Voice fitting and synthesis via a phonological loop. In ICLR, 2018.
|
| 296 |
+
|
| 297 |
+
Rafael Valle, Kevin Shih, Ryan Prenger, and Bryan Catanzaro. Flowtron: an autoregressive flow-based generative network for text-to-speech synthesis. arXiv preprint arXiv:2005.05957, 2020.
|
| 298 |
+
|
| 299 |
+
Aaron van den Oord, Sander Dieleman, Heiga Zen, Karen Simonyan, Oriol Vinyals, Alex Graves, Nal Kalchbrenner, Andrew Senior, and Koray Kavukcuoglu. WaveNet: A generative model for raw audio. arXiv preprint arXiv:1609.03499, 2016.
|
| 300 |
+
|
| 301 |
+
Aaron van den Oord, Oriol Vinyals, and Koray Kavukcuoglu. Neural discrete representation learning. In Advances in Neural Information Processing Systems, pp. 6306–6315, 2017.
|
| 302 |
+
|
| 303 |
+
Aaron van den Oord, Yazhe Li, Igor Babuschkin, Karen Simonyan, Oriol Vinyals, Koray Kavukcuoglu, George van den Driessche, Edward Lockhart, Luis C Cobo, Florian Stimberg, et al. Parallel WaveNet: Fast high-fidelity speech synthesis. In ICML, 2018.
|
| 304 |
+
|
| 305 |
+
Sean Vasquez and Mike Lewis. Melnet: A generative model for audio in the frequency domain. arXiv preprint arXiv:1906.01083, 2019.
|
| 306 |
+
|
| 307 |
+
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.
|
| 308 |
+
|
| 309 |
+
Xin Wang, Shinji Takaki, and Junichi Yamagishi. Neural source-filter-based waveform model for statistical parametric speech synthesis. In ICASSP 2019-2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 5916–5920. IEEE, 2019.
|
| 310 |
+
|
| 311 |
+
Yuxuan Wang, RJ Skerry-Ryan, Daisy Stanton, Yonghui Wu, Ron J Weiss, Navdeep Jaitly, Zongheng Yang, Ying Xiao, Zhifeng Chen, Samy Bengio, Quoc Le, Yannis Agiomyrgiannakis, Rob Clark, and Rif A. Saurous. Tacotron: Towards end-to-end speech synthesis. In Interspeech, 2017.
|
| 312 |
+
|
| 313 |
+
Pete Warden. Speech commands: A dataset for limited-vocabulary speech recognition. arXiv preprint arXiv:1804.03209, 2018.
|
| 314 |
+
|
| 315 |
+
Saining Xie, Ross Girshick, Piotr Dollár, Zhuowen Tu, and Kaiming He. Aggregated residual transformations for deep neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1492–1500, 2017.
|
| 316 |
+
|
| 317 |
+
Yuan Xu and Erdene-Ochir Tuguldur. Convolutional neural networks for Google speech commands data set with PyTorch, 2017. https://github.com/tugstugi/ pytorch-speech-commands.
|
| 318 |
+
|
| 319 |
+
Ryuichi Yamamoto, Eunwoo Song, and Jae-Min Kim. Parallel wavegan: A fast waveform generation model based on generative adversarial networks with multi-resolution spectrogram. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 6199–6203. IEEE, 2020.
|
| 320 |
+
|
| 321 |
+
Zhiming Zhou, Han Cai, Shu Rong, Yuxuan Song, Kan Ren, Weinan Zhang, Yong Yu, and Jun Wang. Activation maximization generative adversarial nets. arXiv preprint arXiv:1703.02000, 2017.
|
| 322 |
+
|
| 323 |
+
# A PROOF OF PROPOSITION 1
|
| 324 |
+
|
| 325 |
+
Proof. We expand the ELBO in Eq. (3) into the sum of a sequence of tractable KL divergences below.
|
| 326 |
+
|
| 327 |
+
$$
|
| 328 |
+
\begin{array} { r l } { \mathrm { S L B O = } \mathbb { E } _ { q } \log \frac { p \theta \left( X _ { 0 } , \cdots , \ x _ { T - 1 } \mid x _ { T } \right) } { q \left( x _ { 1 } , \cdots , \ x _ { T } \right) } \times p _ { \mathrm { h e t w a t } } ( x _ { T } ) } \\ { = \mathbb { E } _ { q } \left( \log p _ { \mathrm { l a t e r t } } ( X _ { T } ) - \displaystyle \sum _ { i = 1 } ^ { T } \log \frac { p \theta \left( x _ { \mathrm { r } - 1 } \mid x _ { i } \right) } { q \left( x _ { i } \mid x _ { i } \right) } \right) } \\ { = \mathbb { E } _ { q } \left( \log \bar { p } _ { \mathrm { a t a r t } } ( X _ { T } ) - \log \frac { p \left( x _ { 0 } \mid x _ { 1 } \right) } { q \left( x _ { 1 } \mid x _ { 0 } \right) } - \displaystyle \sum _ { i = 2 } ^ { T } \left( \log \frac { p \theta \left( x _ { t - 1 } \mid x _ { t } \right) } { q \left( x _ { t - 1 } \mid x _ { t } , x _ { 0 } \right) } + \log \frac { q \left( x _ { t - 1 } \mid x _ { 0 } \right) } { q \left( x _ { t } \mid x _ { 0 } \right) } \right) \right) } \\ { = \mathbb { E } _ { q } \left( \log \frac { p _ { \mathrm { h a t e r t } } \left( x _ { T } \right) } { q \left( x _ { T } \mid x _ { 0 } \right) } - \log p \mu \left( x _ { 0 } \mid x _ { 1 } \right) - \displaystyle \sum _ { i = 2 } ^ { T } \log \frac { p \mu \left( x _ { t - 1 } \mid x _ { t } \right) } { q \left( x _ { t - 1 } \mid x _ { t } , x _ { 0 } \right) } \right) } \\ { = - \mathbb { E } _ { q } \left( \log \left( \frac { p _ { \mathrm { h a t e r t } } \left( x _ { T } \right) } { q \left( x _ { T } \mid x _ { 0 } \right) } \right) - \displaystyle \log p \mu \left( x _ { 0 } \mid x _ { T } \right) + \displaystyle \sum _ { i = 2 } ^ { T } \mathrm { K L } \left( q \left( x _ { t - 1 } \mid x _ { t } , x _ { 0 } \right) \right) \log \left( x _ { t - 1 } \mid x _ { t } \right) \right) - \log p \left( x _ { 0 } \mid x _ { 1 } \right) } \end{array}
|
| 329 |
+
$$
|
| 330 |
+
|
| 331 |
+
Before we calculate these terms individually, we first derive $q ( x _ { t } | x _ { 0 } )$ and $q ( x _ { t - 1 } | x _ { t } , x _ { 0 } )$ . Let $\epsilon _ { i }$ ’s be independent standard Gaussian random variables. Then, by definition of $q$ and using the notations of constants introduced in Eq. (4), we have
|
| 332 |
+
|
| 333 |
+
$$
|
| 334 |
+
{ \begin{array} { r l } { x _ { t } } & { = { \sqrt { \alpha _ { t } } } x _ { t - 1 } + { \sqrt { \beta _ { t } } } \epsilon _ { t } } \\ & { = { \sqrt { \alpha _ { t } \alpha _ { t - 1 } } } x _ { t - 2 } + { \sqrt { \alpha _ { t } \beta _ { t - 1 } } } \epsilon _ { t - 1 } + { \sqrt { \beta _ { t } } } \epsilon _ { t } } \\ & { = { \sqrt { \alpha _ { t } \alpha _ { t - 1 } \alpha _ { t - 1 } } } x _ { t - 3 } + { \sqrt { \alpha _ { t } \alpha _ { t - 1 } \beta _ { t - 2 } } } \epsilon _ { t - 2 } + { \sqrt { \alpha _ { t } \beta _ { t - 1 } } } \epsilon _ { t - 1 } + { \sqrt { \beta _ { t } } } \epsilon _ { t } } \\ & { = \cdots } \\ & { = { \sqrt { \tilde { \alpha } _ { t } } } x _ { 0 } + { \sqrt { \alpha _ { t } \alpha _ { t - 1 } \cdot \cdot \cdot \alpha _ { 2 } \beta _ { 1 } } } \epsilon _ { 1 } + \cdots + { \sqrt { \alpha _ { t } \beta _ { t - 1 } } } \epsilon _ { t - 1 } + { \sqrt { \beta _ { t } } } \epsilon _ { t } } \end{array} }
|
| 335 |
+
$$
|
| 336 |
+
|
| 337 |
+
Note that $q ( x _ { t } | x _ { 0 } )$ is still Gaussian, and the mean of $x _ { t }$ is $\sqrt { \bar { \alpha } _ { t } } x _ { 0 }$ , and the variance matrix is $( \alpha _ { t } \alpha _ { t - 1 } \cdot \cdot \cdot \cdot \alpha _ { 2 } \beta _ { 1 } + \cdot \cdot \cdot + \alpha _ { t } \beta _ { t - 1 } + \beta _ { t } ) I = ( 1 - \bar { \alpha } _ { t } ) I .$ Therefore,
|
| 338 |
+
|
| 339 |
+
$$
|
| 340 |
+
q ( x _ { t } | x _ { 0 } ) = \mathcal { N } ( x _ { t } ; \sqrt { \bar { \alpha } _ { t } } x _ { 0 } , ( 1 - \bar { \alpha } _ { t } ) I ) .
|
| 341 |
+
$$
|
| 342 |
+
|
| 343 |
+
It is worth mentioning that,
|
| 344 |
+
|
| 345 |
+
$$
|
| 346 |
+
q ( x _ { T } | x _ { 0 } ) = { \cal N } ( x _ { T } ; \sqrt { \bar { \alpha } _ { T } } x _ { 0 } , ( 1 - \bar { \alpha } _ { T } ) I ) ,
|
| 347 |
+
$$
|
| 348 |
+
|
| 349 |
+
where $\begin{array} { r } { \bar { \alpha } _ { T } = \prod _ { t = 1 } ^ { T } ( 1 - \beta _ { t } ) } \end{array}$ approaches zero with large $T$
|
| 350 |
+
|
| 351 |
+
Next, by Bayes rule and Markov chain property,
|
| 352 |
+
|
| 353 |
+
$$
|
| 354 |
+
\begin{array} { r l } { q ( x _ { t - 1 } | x _ { t } , x _ { 0 } ) } & { = \frac { q ( x _ { t } | x _ { t - 1 } ) q ( x _ { t - 1 } | x _ { 0 } ) } { q ( x _ { t } | x _ { 0 } ) } } \\ & { = \frac { N ( x _ { t } ; \sqrt { \alpha _ { t } } x _ { t - 1 } , \beta _ { t } I ) N ( x _ { t - 1 } ; \sqrt { \alpha _ { t - 1 } } x _ { 0 } , ( 1 - \bar { \alpha } _ { t - 1 } ) I ) } { \sqrt { \alpha _ { t } } \sqrt { \bar { \alpha } _ { t } } x _ { 0 } , ( 1 - \bar { \alpha } _ { t } ) I ) } } \\ & { = ( 2 \pi \beta _ { t } ) ^ { - \frac { d } { 2 } } ( 2 \pi ( 1 - \bar { \alpha } _ { t - 1 } ) ) ^ { - \frac { d } { 2 } } ( 2 \pi ( 1 - \bar { \alpha } _ { t } ) ) ^ { \frac { d } { 2 } } \times } \\ & { \quad \exp \left( - \frac { \| x _ { t } - \sqrt { \alpha _ { t } } x _ { t - 1 } \| ^ { 2 } } { 2 \beta _ { t } } - \frac { \| x _ { t - 1 } - \sqrt { \bar { \alpha } _ { t - 1 } } x _ { 0 } \| ^ { 2 } } { 2 ( 1 - \bar { \alpha } _ { t - 1 } ) } + \frac { \| x _ { t } - \sqrt { \bar { \alpha } _ { t } } x _ { 0 } \| ^ { 2 } } { 2 ( 1 - \bar { \alpha } _ { t } ) } \right) } \\ & { = ( 2 \pi \tilde { \beta } _ { t } ) ^ { - \frac { d } { 2 } } \exp \left( - \frac { 1 } { 2 \tilde { \beta } _ { t } } \left\| x _ { t - 1 } - \frac { \sqrt { \bar { \alpha } _ { t - 1 } } \beta _ { t } } { 1 - \bar { \alpha } _ { t } } x _ { 0 } - \frac { \sqrt { \alpha _ { t } } ( 1 - \bar { \alpha } _ { t - 1 } ) } { 1 - \bar { \alpha } _ { t } } x _ { t } \right\| ^ { 2 } \right) } \end{array}
|
| 355 |
+
$$
|
| 356 |
+
|
| 357 |
+
Therefore,
|
| 358 |
+
|
| 359 |
+
$$
|
| 360 |
+
q ( x _ { t - 1 } | x _ { t } , x _ { 0 } ) = \mathcal { N } ( x _ { t - 1 } ; \frac { \sqrt { \bar { \alpha } _ { t - 1 } } \beta _ { t } } { 1 - \bar { \alpha } _ { t } } x _ { 0 } + \frac { \sqrt { \alpha _ { t } } ( 1 - \bar { \alpha } _ { t - 1 } ) } { 1 - \bar { \alpha } _ { t } } x _ { t } , \tilde { \beta } _ { t } I ) .
|
| 361 |
+
$$
|
| 362 |
+
|
| 363 |
+
Now, we calculate each term of the ELBO expansion in Eq. (9). The first constant term is
|
| 364 |
+
|
| 365 |
+
$$
|
| 366 |
+
\begin{array} { r l } { \mathbb { E } _ { q } \operatorname { K L } \left( q ( x _ { T } | x _ { 0 } ) \| p _ { \mathrm { l a t e n t } } ( x _ { T } ) \right) } & { = \mathbb { E } _ { x _ { 0 } } \mathrm { K L } \left( \mathcal { N } ( \sqrt { \hat { \alpha } _ { T } } x _ { 0 } , ( 1 - \hat { \alpha } _ { T } ) I ) \| \mathcal { N } ( 0 , I ) \right) } \\ & { = \frac { 1 } { 2 } \mathbb { E } _ { x _ { 0 } } \| \sqrt { \hat { \alpha } _ { T } } x _ { 0 } - 0 \| ^ { 2 } + d \left( \log \frac { 1 } { \sqrt { 1 - \hat { \alpha } _ { T } } } + \frac { 1 - \hat { \alpha } _ { T } - 1 } { 2 } \right) } \\ & { = \frac { \hat { \alpha } _ { T } } { 2 } \mathbb { E } _ { x _ { 0 } } \| x _ { 0 } \| ^ { 2 } - \frac { d } { 2 } ( \hat { \alpha } _ { T } + \log ( 1 - \hat { \alpha } _ { T } ) ) } \end{array}
|
| 367 |
+
$$
|
| 368 |
+
|
| 369 |
+
Next, we compute $\mathrm { K L } \left( q ( x _ { t - 1 } | x _ { t } , x _ { 0 } ) \Vert p _ { \theta } ( x _ { t - 1 } | x _ { t } ) \right)$ . Because both $q ( x _ { t - 1 } | x _ { t } , x _ { 0 } )$ and $p _ { \theta } ( x _ { t - 1 } | x _ { t } )$ are Gaussian with the same covariance matrix $\widetilde { \beta } _ { t } I$ , the KL divergence between them is $\frac { 1 } { 2 \tilde { \beta } _ { t } }$ times the squared √ $\ell _ { 2 }$ distance between their means. By the expression of $q ( x _ { t } | x _ { 0 } )$ , we have $x _ { t } = \sqrt { \bar { \alpha } _ { t } } x _ { 0 } +$ $\sqrt { 1 - \bar { \alpha } _ { t } } \epsilon$ . Therefore, we have
|
| 370 |
+
|
| 371 |
+
$$
|
| 372 |
+
\begin{array} { r l } & { \mathbb { E } _ { q } \mathrm { K L } \left( q ( x _ { t - 1 } | x _ { t } , x _ { 0 } ) \| p _ { \theta } ( x _ { t - 1 } | x _ { t } ) \right) } \\ & { = \frac { 1 } { 2 \tilde { \beta } _ { t } } \mathbb { E } _ { \boldsymbol { \alpha } _ { t } } \left\| \frac { \sqrt { \tilde { \alpha } _ { t - 1 } } \tilde { \beta } _ { t } } { 1 - \tilde { \alpha } _ { t } } { \boldsymbol { \beta } _ { 0 } } + \frac { \sqrt { \alpha _ { t } } \left( 1 - \tilde { \alpha } _ { t - 1 } \right) } { 1 - \tilde { \alpha } _ { t } } { \boldsymbol { x } _ { t } } - \frac { 1 } { \sqrt { \alpha _ { t } } } \left( x _ { t } - \frac { \tilde { \beta } _ { t } } { \sqrt { 1 - \tilde { \alpha } _ { t } } } \epsilon _ { \theta } ( x _ { t } , t ) \right) \right\| ^ { 2 } } \\ & { = \frac { 1 } { 2 \tilde { \beta } _ { t } } \mathbb { E } _ { \boldsymbol { \alpha } _ { t } } \epsilon \left\| \frac { \sqrt { \tilde { \alpha } _ { t - 1 } } \tilde { \beta } _ { t } } { 1 - \tilde { \alpha } _ { t } } \cdot \frac { x _ { t } - \sqrt { 1 - \tilde { \alpha } _ { t } } \epsilon } { \sqrt { \tilde { \alpha } _ { t } } } + \frac { \sqrt { \alpha _ { t } } \left( 1 - \tilde { \alpha } _ { t - 1 } \right) } { 1 - \tilde { \alpha } _ { t } } { \boldsymbol { x } _ { t } } - \frac { 1 } { \sqrt { \alpha _ { t } } } \left( x _ { t } - \frac { \tilde { \beta } _ { t } } { \sqrt { 1 - \tilde { \alpha } _ { t } } } \epsilon _ { \theta } ( x _ { t } , t ) \right) \right\| } \\ & { = \frac { 1 } { 2 \tilde { \beta } _ { t } } \cdot \frac { \beta _ { t } ^ { 2 } } { \alpha _ { t } ( 1 - \tilde { \alpha } _ { t } ) } \mathbb { E } _ { \boldsymbol { \alpha } _ { t } } \left\| 0 \cdot x _ { t } + \epsilon - \epsilon _ { \theta } ( x _ { t } , t ) \right\| ^ { 2 } } \\ & = \frac { \beta _ { t } ^ { 2 } } 2 \frac { 1 - \tilde { \alpha } _ { t - 1 } } { \tilde { \alpha } _ { t - 1 } } \beta _ { t } ( 1 \end{array}
|
| 373 |
+
$$
|
| 374 |
+
|
| 375 |
+
Finally, as $x _ { 1 } = \sqrt { \bar { \alpha } _ { 1 } } x _ { 0 } + \sqrt { 1 - \bar { \alpha } _ { 1 } } \epsilon = \sqrt { \alpha _ { 1 } } x _ { 0 } + \sqrt { 1 - \alpha _ { 1 } } \epsilon$ , we have
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
\begin{array} { r l } { \mathbb { E } _ { q } \log p \varrho ( x _ { 0 } | x _ { 1 } ) } & { = \mathbb { E } _ { q } \log \mathcal { N } \left( x _ { 0 } ; \displaystyle \frac { 1 } { \sqrt { \alpha _ { 1 } } } \left( x _ { 1 } - \displaystyle \frac { \beta _ { 1 } } { \sqrt { 1 - \alpha _ { 1 } } } \epsilon _ { \theta } ( x _ { 1 } , 1 ) \right) , \beta _ { 1 } I \right) } \\ & { = \mathbb { E } _ { q } \left( - \displaystyle \frac { d } { 2 } \log 2 \pi \beta _ { 1 } - \displaystyle \frac { 1 } { 2 \beta _ { 1 } } \left\| x _ { 0 } - \displaystyle \frac { 1 } { \sqrt { \alpha _ { 1 } } } \left( x _ { 1 } - \displaystyle \frac { \beta _ { 1 } } { \sqrt { 1 - \alpha _ { 1 } } } \epsilon _ { \theta } ( x _ { 1 } , 1 ) \right) \right\| ^ { 2 } \right) } \\ & { = - \displaystyle \frac { d } { 2 } \log 2 \pi \beta _ { 1 } - \displaystyle \frac { 1 } { 2 \beta _ { 1 } } \mathbb { E } _ { x _ { 0 } , \epsilon } \left\| x _ { 0 } - \displaystyle \frac { 1 } { \sqrt { \alpha _ { 1 } } } \left( \sqrt { \alpha _ { 1 } } x _ { 0 } + \sqrt { 1 - \alpha _ { 1 } } \epsilon - \displaystyle \frac { \beta _ { 1 } } { \sqrt { 1 - \alpha _ { 1 } } } \epsilon _ { \theta } ( x _ { 1 } , 1 ) \right) \right\| } \\ & { = - \displaystyle \frac { d } { 2 } \log 2 \pi \beta _ { 1 } - \displaystyle \frac { 1 } { 2 \beta _ { 1 } } \mathbb { E } _ { x _ { 0 } , \epsilon } \left\| \displaystyle \frac { \sqrt { \beta _ { 1 } } } { \sqrt { \alpha _ { 1 } } } ( \epsilon - \epsilon _ { \theta } ( x _ { 1 } , 1 ) ) \right\| ^ { 2 } } \\ & { = - \displaystyle \frac { d } { 2 } \log 2 \pi \beta _ { 1 } - \displaystyle \frac { 1 } { 2 \alpha _ { 1 } } \mathbb { E } _ { x _ { 0 } , \epsilon } \left\| \epsilon - \epsilon _ { \theta } ( x _ { 1 } , 1 ) \right\| ^ { 2 } } \end{array}
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
The computation of the ELBO is now finished.
|
| 382 |
+
|
| 383 |
+
# B DETAILS OF THE FAST SAMPLING ALGORITHM
|
| 384 |
+
|
| 385 |
+
Let $T _ { \mathrm { i n f e r } } \ll T$ be the number of steps in the reverse process (sampling) and t}Tinfer be the userdefined variance schedule, which can be independent with the training variance schedule $\{ \beta _ { t } \} _ { t = 1 } ^ { T }$ Then, we compute the corresponding constants in the same way as Eq. (4):
|
| 386 |
+
|
| 387 |
+
$$
|
| 388 |
+
\gamma _ { t } = 1 - \eta _ { t } , \bar { \gamma } _ { t } = \prod _ { s = 1 } ^ { t } { \gamma _ { s } } , \tilde { \eta } _ { t } = \frac { 1 - \bar { \gamma } _ { t - 1 } } { 1 - \bar { \gamma } _ { t } } \eta _ { t } \mathrm { f o r } t > 1 \mathrm { a n d } \tilde { \eta } _ { 1 } = \eta _ { 1 } .
|
| 389 |
+
$$
|
| 390 |
+
|
| 391 |
+
As step $s$ during sampling, we need to select an $t$ and use $\epsilon _ { \theta } ( \cdot , t )$ to eliminate noise. This is realized by aligning the noise levels from the user-defined and the training variance schedules. Ideally, we√ √ √ want $\bar { \sqrt { \bar { \alpha } _ { t } } } \stackrel { - } { = } \sqrt { \bar { \gamma } _ { s } }$ . However, since this is not always possible, we interpolate √ √ √ $\sqrt { \bar { \gamma } _ { s } }$ between two consecutive training noise levels $\sqrt { \bar { \alpha } _ { t + 1 } }$ and $\sqrt { \bar { \alpha } _ { t } }$ , if $\sqrt { \bar { \gamma } _ { s } }$ is between them. We therefore obtain the desired aligned diffusion step $t$ , which we denote $t _ { s } ^ { \mathrm { a l i g n } }$ , via the following equation:
|
| 392 |
+
|
| 393 |
+
$$
|
| 394 |
+
t _ { s } ^ { \mathrm { a l i g n } } = t + \frac { \sqrt { \bar { \alpha } _ { t } } - \sqrt { \bar { \gamma } _ { s } } } { \sqrt { \bar { \alpha } _ { t } } - \sqrt { \bar { \alpha } _ { t + 1 } } } \mathrm { i f } \sqrt { \bar { \gamma } _ { s } } \in [ \sqrt { \bar { \alpha } _ { t + 1 } } , \sqrt { \bar { \alpha } _ { t } } ] .
|
| 395 |
+
$$
|
| 396 |
+
|
| 397 |
+
Note that, $t _ { s } ^ { \mathrm { a l i g n } }$ is floating-point number, which is different from the integer diffusion-step at training.
|
| 398 |
+
|
| 399 |
+
Finally, the parameterizations of $\mu _ { \theta }$ and $\sigma _ { \theta }$ are defined in a similar way as Eq. (5):
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
\mu _ { \theta } ^ { \mathrm { f a s t } } ( x _ { s } , s ) = \frac { 1 } { \sqrt { \gamma _ { s } } } \left( x _ { s } - \frac { \eta _ { s } } { \sqrt { 1 - \widetilde { \gamma } _ { s } } } \epsilon _ { \theta } ( x _ { s } , t _ { s } ^ { \mathrm { a l i g n } } ) \right) , ~ \mathrm { a n d } ~ \sigma _ { \theta } ^ { \mathrm { f a s t } } ( x _ { s } , s ) = \widetilde \eta _ { s } ^ { \frac { 1 } { 2 } } .
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
The fast sampling algorithm is summarized in Algorithm 3.
|
| 406 |
+
|
| 407 |
+
# Algorithm 3 Fast Sampling
|
| 408 |
+
|
| 409 |
+
<table><tr><td>Sample XTinfer ~ Platent = N(0,I) for s= Tinfer,Tinfer-1,..,1 do</td><td></td></tr><tr><td>Compute st(s,)andofst(s,)singEq (15) Θ</td><td></td></tr><tr><td>Sples-1~N(st(s,s)(,s</td><td></td></tr><tr><td>end for</td><td></td></tr><tr><td>return xo</td><td></td></tr></table>
|
| 410 |
+
|
| 411 |
+
In neural vocoding task, we use user-defined variance schedules $\{ 0 . 0 0 0 1 , 0 . 0 0 1 , 0 . 0 1 , 0 . 0 5 , 0 . 2 , 0 . 7 \}$ for DiffWave LARGE and $\{ 0 . 0 0 0 1 , 0 . 0 0 1 , 0 . 0 1 , 0 . 0 5 , 0 . 2 , 0 . 5 \}$ for DiffWave BASE in Section 5.1.
|
| 412 |
+
|
| 413 |
+
The fast sampling algorithm is similar to the sampling algorithm in Chen et al. (2020) in the sense of considering the noise levels as a controllable variable during sampling. However, the fast sampling algorithm for DiffWave does not need to modify the training procedure (Algorithm 1), and can just reuse the trained model checkpoint with large $T$ .
|
| 414 |
+
|
| 415 |
+
# C DETAILS OF THE MODEL ARCHITECTURE
|
| 416 |
+
|
| 417 |
+

|
| 418 |
+
Figure 3: The network architecture of DiffWave in modeling $\epsilon _ { \theta } ( x _ { t } , t )$ , including tensor shapes at each stage and activation functions. $B$ is the batch size, $C$ is the number of residual/skip channels of the network, and $L$ is data dimension.
|
| 419 |
+
|
| 420 |
+

|
| 421 |
+
Figure 4: The Receptive fields of the output units within DiffWave network.
|
| 422 |
+
|
| 423 |
+
# D DETAILS OF AUTOMATIC EVALUATION METRICS IN SECTION 5.2 AND 5.3
|
| 424 |
+
|
| 425 |
+
The automatic evaluation metrics used in Section 5.2 and 5.3 are described as follows. Given an input audio $x$ , an 1024-dimensional feature vector (denoted as $\mathcal { F } _ { \mathrm { f e a t u r e } } ( x ) )$ is computed by the ResNeXT $\mathcal { F }$ , and is then transformed to the 10-dimensional multinomial distribution (denoted as $p _ { \mathcal { F } } ( x ) )$ with a fully connected layer and a softmax layer. Let $X _ { \mathrm { t r a i n } }$ be the trainset, $p _ { \mathrm { g e n } }$ be the distribution of generated data, and $X _ { \mathrm { g e n } } \sim p _ { \mathrm { g e n } } ( i . i . d . )$ be the set of generated audio samples. Then, we compute the following automatic evaluation metrics:
|
| 426 |
+
|
| 427 |
+
• Fréchet Inception Distance (FID) (Heusel et al., 2017) computes the Wasserstein-2 distance between Gaussians fitted to $\mathcal { F } _ { \mathrm { f e a t u r e } } ( X _ { \mathrm { t r a i n } } )$ and ${ \mathcal { F } } _ { \mathrm { f e a t u r e } } ( X _ { \mathrm { g e n } } )$ . That is,
|
| 428 |
+
|
| 429 |
+
$$
|
| 430 |
+
\mathrm { F I D } = \Vert \mu _ { g } - \mu _ { t } \Vert ^ { 2 } + \operatorname { T r } \left( \Sigma _ { t } + \Sigma _ { g } - 2 \big ( \Sigma _ { t } \Sigma _ { g } \big ) ^ { \frac { 1 } { 2 } } \right) ,
|
| 431 |
+
$$
|
| 432 |
+
|
| 433 |
+
where $\mu _ { t } , \Sigma _ { t }$ are the mean vector and covariance matrix of $\mathcal { F } _ { \mathrm { f e a t u r e } } ( X _ { \mathrm { t r a i n } } )$ , and where $\mu _ { g } , \Sigma _ { g }$ are the mean vector and covariance matrix of $\mathcal { F } _ { \mathrm { f e a t u r e } } ( X _ { \mathrm { g e n } } )$ .
|
| 434 |
+
|
| 435 |
+
• Inception Score (IS) (Salimans et al., 2016) computes the following:
|
| 436 |
+
|
| 437 |
+
$$
|
| 438 |
+
\begin{array} { r } { \mathrm { I S } = \exp \left( \mathbb { E } _ { \boldsymbol { x } \sim p _ { \mathrm { g e n } } } \mathrm { K L } \left( p _ { \mathcal { F } } ( \boldsymbol { x } ) \| \mathbb { E } _ { \boldsymbol { x } ^ { \prime } \sim p _ { \mathrm { g e n } } } p _ { \mathcal { F } } ( \boldsymbol { x } ^ { \prime } ) \right) \right) , } \end{array}
|
| 439 |
+
$$
|
| 440 |
+
|
| 441 |
+
where $\mathbb { E } _ { x ^ { \prime } \sim p _ { \mathrm { g e n } } } p _ { \mathcal { F } } ( x ^ { \prime } )$ is the marginal label distribution.
|
| 442 |
+
|
| 443 |
+
• Modified Inception Score (mIS) (Gurumurthy et al., 2017) computes the following:
|
| 444 |
+
|
| 445 |
+
$$
|
| 446 |
+
\mathrm { m I S } = \exp \left( \mathbb { E } _ { x , x ^ { \prime } \sim p _ { \mathrm { g e n } } } \mathrm { K L } \left( p _ { \mathcal { F } } ( x ) \| p _ { \mathcal { F } } ( x ^ { \prime } ) \right) \right) .
|
| 447 |
+
$$
|
| 448 |
+
|
| 449 |
+
• AM Score (Zhou et al., 2017) computes the following:
|
| 450 |
+
|
| 451 |
+
$$
|
| 452 |
+
\begin{array} { r } { \mathrm { A M } = \mathrm { K L } \left( \mathbb { E } _ { \boldsymbol { x } ^ { \prime } \sim q _ { \mathrm { d a t a } } } p _ { \mathcal { F } } ( \boldsymbol { x } ^ { \prime } ) \lVert \mathbb { E } _ { \boldsymbol { x } \sim p _ { \mathrm { g e n } } } p _ { \mathcal { F } } ( \boldsymbol { x } ) \right) + \mathbb { E } _ { \boldsymbol { x } \sim p _ { \mathrm { g e n } } } \mathrm { H } ( p _ { \mathcal { F } } ( \boldsymbol { x } ) ) , } \end{array}
|
| 453 |
+
$$
|
| 454 |
+
|
| 455 |
+
where $\mathrm { H } ( \cdot )$ computes the entropy. Compared to IS, AM score takes into consideration the the prior distribution of $p _ { \mathcal { F } } ( X _ { \mathrm { t r a i n } } )$ .
|
| 456 |
+
|
| 457 |
+
• Number of Statistically-Different Bins (NDB) (Richardson & Weiss, 2018): First, $X _ { \mathrm { t r a i n } }$ is clustered into $K$ bins by $K$ -Means in the feature space (where $K = 5 0$ in our evaluation). Next, each sample in $X _ { \mathrm { g e n } }$ is assigned to its nearest bin. Then, NDB is the number of bins that contain statistically different proportion of samples between training samples and generated samples.
|
md/train/e12NDM7wkEY/e12NDM7wkEY.md
ADDED
|
@@ -0,0 +1,351 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CLUSTERING-FRIENDLY REPRESENTATION LEARNING VIA INSTANCE DISCRIMINATION AND FEATURE DECORRELATION
|
| 2 |
+
|
| 3 |
+
Yaling Tao, Kentaro Takagi & Kouta Nakata
|
| 4 |
+
Corporate R&D Center, Toshiba Corporation
|
| 5 |
+
1, Komukai Toshiba-cho, Saiwai-ku, Kawasaki, Kanagawa, Japan
|
| 6 |
+
{yaling1.tao,kentaro1.takagi,kouta.nakata}@toshiba.co.jp
|
| 7 |
+
|
| 8 |
+
# ABSTRACT
|
| 9 |
+
|
| 10 |
+
Clustering is one of the most fundamental tasks in machine learning. Recently, deep clustering has become a major trend in clustering techniques. Representation learning often plays an important role in the effectiveness of deep clustering, and thus can be a principal cause of performance degradation. In this paper, we propose a clustering-friendly representation learning method using instance discrimination and feature decorrelation. Our deep-learning-based representation learning method is motivated by the properties of classical spectral clustering. Instance discrimination learns similarities among data and feature decorrelation removes redundant correlation among features. We utilize an instance discrimination method in which learning individual instance classes leads to learning similarity among instances. Through detailed experiments and examination, we show that the approach can be adapted to learning a latent space for clustering. We design novel softmax-formulated decorrelation constraints for learning. In evaluations of image clustering using CIFAR-10 and ImageNet-10, our method achieves accuracy of $8 1 . 5 \%$ and $9 5 . 4 \%$ , respectively. We also show that the softmax-formulated constraints are compatible with various neural networks.
|
| 11 |
+
|
| 12 |
+
# 1 INTRODUCTION
|
| 13 |
+
|
| 14 |
+
Clustering is one of the most fundamental tasks in machine learning. Recently, deep clustering has become a major trend in clustering techniques. In a fundamental form, autoencoders are used for feature extraction, and classical clustering techniques such as $k$ -means are serially applied to the features. Recent deep clustering techniques integrate learning processes of feature extraction and clustering, yielding high performance for large-scale datasets such as handwritten digits Hu et al. (2017); Shaham et al. (2018); Xie et al. (2016); Tao et al. (2018). However, those methods have fallen short when targets become more complex, as in the case of real-world photograph dataset CIFAR-10 Krizhevsky et al. (2009). Several works report powerful representation learning leads to improvement of clustering performance on complex datasets Chang et al. (2017); Wu et al. (2019). Learning representation is a key challenge to unsupervised clustering.
|
| 15 |
+
|
| 16 |
+
In order to learn representations for clustering, recent works utilize metric learning which automatically learns similarity functions from data Chang et al. (2017); Wu et al. (2019). They assign pseudo-labels or pseudo-graph to unlabeled data by similarity measures in latent space, and learn discriminative representations to cluster data. These works improve clustering performance on real world images such as CIFAR-10 and ImageNet-10, and indicate the impact of representation learning on clustering. Although features from learned similarity function and pseudo-labels work well for clustering, algorithms still seem to be heuristic; we design a novel algorithm which is based on knowledge from established clustering techniques. In this work, we exploit a core idea of spectral clustering which uses eigenvectors derived from similarities.
|
| 17 |
+
|
| 18 |
+
Spectral clustering has been theoretically and experimentally investigated, and known to outperform other traditional clustering methods Von Luxburg (2007). The algorithm involves similarity matrix construction, transformation from similarity matrix to Laplacian, and eigendecomposition. Based on eigenvectors, data points are mapped into a lower dimensional representation which carries information of similarities and is preferable for clustering. We bring this idea of eigenvector representation into deep representation learning.
|
| 19 |
+
|
| 20 |
+
We design the representation learning with two aims: 1) learning similarities among instances; and 2) reducing correlations within features. The first corresponds to Laplacian, and the second corresponds to feature orthogonality constrains in the spectral clustering algorithm. Learning process integrating both is relevant to eigendecomposition of Laplacian matrix in the spectral clustering.
|
| 21 |
+
|
| 22 |
+
For the first aim, we adopt the instance discrimination method presented in Wu et al. (2018), where each unlabeled instance is treated as its own distinct class, and discriminative representations are learned to distinguish between individual instance classes. This numerous-class discriminative learning enables learning partial but important features, such as small foreground objects in natural images. Wu et al. (2018) showed that the representation features retain apparent similarity among images and improve the performance of image classification by the nearest neighbor method. We extend their work to the clustering tasks. We clarify their softmax formulation works like similarity matrix in spectral clustering under the condition that temperature parameter $\tau$ , which was underexplored in $\mathrm { W u }$ et al. (2018), is set to be a larger value .
|
| 23 |
+
|
| 24 |
+
For the second aim, we introduce constraints which have the effect of making latent features orthogonal. Orthogonality is often an essential idea in dimension reduction methods such as principal components analysis, and it is preferable for latent features to be independent to ensure that redundant information is reduced. Orthogonality is also essential to a connection between proposed method and spectral clustering, as stated in Section 3.4. In addition to a simple soft orthogonal constraint, we design a novel softmax-formulated decorrelation constraint. Our softmax constraint is "softer" than the soft orthogonal constraint for learning independent feature spaces, but realizes stable improvement of clustering performance.
|
| 25 |
+
|
| 26 |
+
Finally, we combine instance discrimination and feature decorrelation into learning representation to improve the performance of complex image clustering. For the CIFAR-10 and ImageNet-10 datasets, our method achieves accuracy of $8 1 . 5 \%$ and $9 5 . 4 \%$ , respectively. Our PyTorch Paszke et al. (2019) implementation of IDFD is available at https://github.com/TTN-YKK/Clustering_ friendly_representation_learning.
|
| 27 |
+
|
| 28 |
+
Our main contributions are as follows:
|
| 29 |
+
|
| 30 |
+
• We propose a clustering-friendly representation learning method combining instance discrimination and feature decorrelation based on spectral clustering properties.
|
| 31 |
+
• We adapt deep representation learning by instance discrimination to clustering and clarify the essential properties of the temperature parameter.
|
| 32 |
+
• We design a softmax-formulated orthogonal constraint for learning latent features and realize stable improvement of clustering performance.
|
| 33 |
+
• Our representation learning method achieves performance comparable to state-of-the-art levels for image clustering tasks with simple $k$ -means.
|
| 34 |
+
|
| 35 |
+
# 2 RELATED WORK
|
| 36 |
+
|
| 37 |
+
Deep clustering methods offer state-of-the-art performance in various fields. Most early deep clustering methods, such as Vincent et al. (2010); Tian et al. (2014), are two-stage methods that apply clustering after learning low-dimensional representations of data in a nonlinear latent space. The autoencoder method proposed in Hinton & Salakhutdinov (2006) is one of the most effective methods for learning representations. Recent works have simultaneously performed representation learning and clustering Song et al. (2013); Xie et al. (2016); Yang et al. (2017); Guo et al. (2017); Tao et al. (2018). Several methods based on generative models have also been proposed Jiang et al. (2016); Dilokthanakul et al. (2016). These methods outperform conventional methods, and sometimes offer performance comparable to that of supervised learning for simple datasets. Deep-learning-based unsupervised image clustering is also being developed Chang et al. (2017); Wu et al. (2019); Ji et al. (2019); Gupta et al. (2020); Van Gansbeke et al. (2020).
|
| 38 |
+
|
| 39 |
+
Several approaches focus on learning discriminative representations via deep learning. Bojanowski & Joulin (2017) found a mapping between images on a uniformly discretized target space, and enforced their representations to resemble a distribution of pairwise relationships. Caron et al. (2018) applied pseudo-labels to output as supervision by $k$ -means and then trained a deep neural network. Donahue et al. (2016) proposed bidirectional generative adversarial networks for learning generative models that map simple latent distributions to complex real distributions, in order for generators to capture semantic representations. Hjelm et al. (2018) proposed deep infomax to maximize mutual information between the input and output of an encoder. Wu et al. (2018) was motivated by observations in supervised learning that the probabilities of similar image classes become simultaneously high. They showed that discriminating individual instance classes leads to learning representations that retain similarities among data.
|
| 40 |
+
|
| 41 |
+
IIC Ji et al. (2019) and SCAN Van Gansbeke et al. (2020) are two recent works focusing on image clustering and obtained high performance. IIC Ji et al. (2019) directly learns semantic labels without learning representations based on mutual information between image pairs. SCAN Van Gansbeke et al. (2020) focuses on the clustering phase and largely improved performance based on a given pre-designed representation learning. By contrast, we focus on learning a clusteringfriendly representation space where objects can be simply clustered.
|
| 42 |
+
|
| 43 |
+
Our method exploits the idea of spectral clustering Shi & Malik (2000); Meila & Shi (2001); Von Luxburg (2007); $\mathrm { N g }$ et al. (2002). From one perspective, spectral clustering finds a low dimensional embedding of data in the eigenspace of the Laplacian matrix, which is derived from pairwise similarities between data. By using the embedded representations, we can proceed to cluster the data by the $k$ -means algorithm in the low-dimensional space. Spectral clustering often outperforms earlier algorithms such as $k$ -means once pair similarities are properly calculated. Shaham et al. (2018) incorporated the concept of spectral clustering into deep a neural network structure. Similarities were calculated by learning a Siamese net Shaham & Lederman (2018) where the input positive and negative pairs were constructed according to the Euclidean distance.
|
| 44 |
+
|
| 45 |
+
# 3 PROPOSED METHOD
|
| 46 |
+
|
| 47 |
+
Given an unlabeled dataset $X = \{ x _ { i } \} _ { i = 1 } ^ { n }$ and a predefined number of clusters $k$ , where $x _ { i }$ denotes the ith sample, we perform the clustering task in two phases, namely, representation learning and clustering. This work focuses on the first phase, which aims to learn an embedding function ${ \pmb v } = f _ { \boldsymbol { \theta } } ( { \boldsymbol { x } } )$ mapping data $_ { \textbf { \em x } }$ to representation $\textbf { { v } }$ so that $\textbf { { v } }$ is preferable for clustering. $f _ { \theta }$ is modeled as a deep neural network with parameter $\pmb \theta$ . We use $V = \{ v _ { i } \} _ { i = 1 } ^ { n }$ to denote the whole representation set.
|
| 48 |
+
|
| 49 |
+
# 3.1 INSTANCE DISCRIMINATION
|
| 50 |
+
|
| 51 |
+
We apply the instance discrimination method proposed by $\mathrm { W u }$ et al. (2018) to learn clustering-friendly representations that capture similarity between instances. The objective function is formulated based on the softmax criterion. Each instance is assumed to represent a distinct class. For given data $x _ { 1 } , \ldots , x _ { n }$ , the corresponding representations are $v _ { 1 } , \ldots , v _ { n }$ , and data $x _ { i }$ is classified into the ith class. Accordingly, the weight vector for the $i$ th class can be approximated by a vector ${ \boldsymbol { v } } _ { i }$ . The probability of representation $\textbf { { v } }$ being assigned into the ith class is
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
P ( i | { \pmb v } ) = \frac { \exp ( { \pmb v } _ { i } ^ { T } { \pmb v } / \tau ) } { \sum _ { j = 1 } ^ { n } \exp ( { \pmb v } _ { j } ^ { T } { \pmb v } / \tau ) } ,
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
where ${ \pmb v } _ { j } ^ { T } { \pmb v }$ measures how well $\textbf { { v } }$ matches the $j$ th class, $\tau$ is a temperature parameter that controls the concentration of the distribution Hinton et al. (2015), and $\textbf { { v } }$ is normalized to $| | \pmb { v } | | = 1$ .
|
| 58 |
+
|
| 59 |
+
The objective maximizes the joint probability $\textstyle \prod _ { i = 1 } ^ { n } P _ { \theta } ( i | f _ { \theta } ( x _ { i } ) )$ as
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
L _ { I } = - \sum _ { i = 1 } ^ { n } \log P ( i | f _ { \theta } ( x _ { i } ) ) = - \sum _ { i } ^ { n } \log ( \frac { \exp ( v _ { i } ^ { T } v _ { i } / \tau ) } { \sum _ { j = 1 } ^ { n } \exp ( v _ { j } ^ { T } v _ { i } / \tau ) } ) .
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
Wu et al. (2018) shows that features obtained by minimizing the objective retain similarity between image instances and improve the performance of nearest neighbor classification. For clustering, we note that the parameter $\tau$ , which is underexplored in $\mathrm { W u }$ et al. (2018), has a large impact on clustering performance. The effect of $\tau$ is discussed later and experimental results are shown in 4.2.1.
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
Figure 1: Pipeline of our method.
|
| 69 |
+
|
| 70 |
+
# 3.2 FEATURE DECORRELATION
|
| 71 |
+
|
| 72 |
+
We define a set of latent feature vectors $f$ and use $f _ { l }$ to denote the lth feature vector. Transposition of latent vectors $V$ coincides with $\{ f _ { l } \} _ { l = 1 } ^ { d }$ , where $d$ is the dimensionality of representations.
|
| 73 |
+
|
| 74 |
+
The simple constraint for orthogonal features is,
|
| 75 |
+
|
| 76 |
+
$$
|
| 77 |
+
L _ { F O } = | | V V ^ { T } - I | | ^ { 2 } = \sum _ { l = 1 } ^ { d } \left( ( f _ { l } ^ { T } f _ { l } - 1 ) ^ { 2 } + \sum _ { j = 1 , j \neq l } ^ { n } ( f _ { j } ^ { T } f _ { l } ) ^ { 2 } \right) .
|
| 78 |
+
$$
|
| 79 |
+
|
| 80 |
+
Our novel constraint is based on a softmax formulation of
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
Q ( l | \mathbf { \Delta } f ) = \frac { \exp ( f _ { l } ^ { T } f / \tau _ { 2 } ) } { \sum _ { m = 1 } ^ { d } \exp ( f _ { m } ^ { T } f / \tau _ { 2 } ) } ,
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
$Q ( l | f )$ is analogous to $P ( i | \boldsymbol { v } )$ . $Q ( l | f )$ measures how correlated a feature vector is to itself and how dissimilar it is to others. $\tau _ { 2 }$ is the temperature parameter. We formulate the feature decorrelation constraint as
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
L _ { F } = - \sum _ { l = 1 } ^ { d } \log Q ( l | f ) = \sum _ { l = 1 } ^ { d } \left( - f _ { l } ^ { T } f _ { l } / \tau _ { 2 } + \log \sum _ { j } ^ { d } \exp ( f _ { j } ^ { T } f _ { l } / \tau _ { 2 } ) \right) .
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
Both constrains in Eq. (3) and Eq. (5) aim to construct independent features. Conventionally, it is preferable for features to be independent to ensure that redundant information is reduced, and orthogonality is a common technique. Compare Eq. (3) and Eq. (5), we can see that minimizing $L _ { F }$ and $\mathit { L } _ { \mathit { F O } }$ can result in a similar effect, $f _ { l } ^ { T } f _ { l } \to 1$ and $f _ { j } ^ { T } f _ { l } \stackrel { \cdot } { } - 1$ or $0 ( l \neq j )$ , and both try to decorrelate latent features.
|
| 93 |
+
|
| 94 |
+
Our softmax constraint in Eq. (5) shows practical advantages in flexibility and stability. Eq. (3) is called a soft orthogonal constraint, but is still strict enough to force the features to be orthogonal. If $d$ is larger than underlying structures that are hidden and unknown, all features are forcibly orthogonalized and the resultant features may not be appropriate. Softmax formulation allows off-diagonal elements to be non-zero and alleviates the problem of strict orthogonality.
|
| 95 |
+
|
| 96 |
+
Partial derivatives of $L _ { F }$ and ${ \cal L } _ { F O }$ with respect to $z _ { j l } = f _ { j } ^ { T } f _ { l }$ are calculated as $\begin{array} { r } { \frac { \partial L _ { F } } { \partial z _ { j l } } = - \frac { 1 } { \tau _ { 2 } } \delta _ { j l } + } \end{array}$ $\frac { 1 } { \tau _ { 2 } } \frac { \exp ( z _ { j l } / \tau _ { 2 } ) } { \sum _ { j } ^ { d } \exp ( z _ { j l } / \tau _ { 2 } ) }$ and $\begin{array} { r } { \frac { \partial L _ { F O } } { \partial z _ { j l } } = - 2 \delta _ { j l } + 2 z _ { j l } } \end{array}$ , where $\delta _ { j l }$ is an indicator function. Since the derivatives nearly equal zero due to ranges of partial derivat $z _ { j l } = 1$ $j = l$ case of . The m $j \neq l$ . When onicity $j \neq l$ , thecan $\begin{array} { r } { 0 \le \frac { \partial L _ { F } } { \partial z _ { j l } } \le \frac { 1 } { \tau _ { 2 } } } \end{array}$ ∂LFO∂z ≤ 2 onot of LF lead to more stable convergence. The advantages of $L _ { F }$ are confirmed by experiments in section 4.
|
| 97 |
+
|
| 98 |
+
# 3.3 OBJECTIVE FUNCTION AND LEARNING MODEL
|
| 99 |
+
|
| 100 |
+
Combining instance discrimination and feature decorrelation learning, we formulate our objective function $L _ { I D F D }$ as follows:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
{ \cal L } _ { I D F D } = { \cal L } _ { I } + \alpha { \cal L } _ { F } ,
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
Where $\alpha$ is a weight that balances the contributions of two terms $L _ { I }$ and $L _ { F }$ .
|
| 107 |
+
|
| 108 |
+
Figure 1 shows the learning process for the motif of image clustering. Input images $X$ are converted into feature representations $V$ in a lower $d$ -dimensional latent space, via nonlinear mapping with deep neural networks such as ResNet He et al. (2016). The $d$ -dimensional vectors are simultaneously learned through instance discrimination and feature decorrelation. A clustering method, such as classical $k$ -means clustering, is then used on the learned representations to obtain the clustering results.
|
| 109 |
+
|
| 110 |
+
Optimization can be performed by mini-batch training. To compute the probability $P ( i | \boldsymbol { v } )$ in Eq. (1), $\{ v _ { j } \}$ is needed for all images. Like Wu et al. (2018); Xiao et al. (2017), we maintain a feature memory bank for storing them. For $Q ( l | f )$ in Eq. (4), all $\{ f _ { m } \}$ of $d$ dimensions in the current mini-batch can be obtained, we simply calculate the $Q ( l | f )$ within the mini-batches.
|
| 111 |
+
|
| 112 |
+
We combine $L _ { I }$ and $\mathit { L } _ { \mathit { F O } }$ to formulate an alternative loss ${ \cal L } _ { I D F O }$ in E.q. (7),
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
{ \cal L } _ { I D F O } = { \cal L } _ { I } + \alpha { \cal L } _ { F O } .
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
We refer to representation learning using $L _ { I D F D }$ , ${ \cal L } _ { I D F O }$ , and $L _ { I }$ loss as instance discrimination and feature decorrelation (IDFD), instance discrimination and feature orthogonalization (IDFO), and instance discrimination (ID), respectively.
|
| 119 |
+
|
| 120 |
+
# 3.4 CONNECTION WITH SPECTRAL CLUSTERING
|
| 121 |
+
|
| 122 |
+
We explain the connection between IDFD and spectral clustering. We consider a fully connected graph consisting of all representation points, and the similarity matrix $W$ and degree matrix $D$ can be written as $\bar { W } _ { i j } = \exp ( v _ { i } ^ { T } v _ { j } / \tau )$ and $\begin{array} { r } { D _ { i i } = \sum _ { m } ^ { n } \mathrm { e x p } ( v _ { i } ^ { T } \bar { v } _ { m } / \tau ) } \end{array}$ . The loss function of spectral clustering Shaham et al. (2018) can be reformulated as
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
L _ { S P } = ( T r ) ( f L f ) = \frac { 1 } { 2 } \sum _ { k } \sum _ { i j } ^ { n } w _ { i j } ( f _ { i } ^ { k } - f _ { j } ^ { k } ) ^ { 2 } = \frac { 1 } { 2 } \sum _ { k } \sum _ { i j } ^ { n } \exp \left( \frac { v _ { i } ^ { T } v _ { j } } { \tau } \right) | | v _ { i } - v _ { j } | | ^ { 2 } ,
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
where $L$ is Laplacian matrix, $f$ are feature vectors. Spectral clustering is performed by minimizing $L _ { S P }$ subject to orthogonal condition of $f$ , and when $L _ { S P }$ takes minimum value $f$ become eigenvectors of Laplacian $L$ . According to Section 3.2, minimizing $L _ { F }$ can approximate the orthogonal condition. Under this condition, minimizing $L _ { I }$ can approximate the minimizing $L _ { S P }$ , which is explained as follows.
|
| 129 |
+
|
| 130 |
+
According to Eq.(2), minimizing loss $L _ { I }$ means maximizing $v _ { i } ^ { T } v _ { i }$ and minimizing $v _ { i } ^ { T } v _ { j }$ . When $i = j$ , we have $| | v _ { i } - v _ { j } | | ^ { 2 } = 0$ , $L _ { S P }$ becomes zero. We need consider only the influence on $L _ { S P }$ from minimizing $v _ { i } ^ { T } v _ { j }$ . As $\pmb { v }$ are normalized, $L _ { S P }$ can be rewritten using cosine metric as
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
L _ { S P } = \sum _ { i j } ^ { n } \exp \left( \frac { \cos \theta } { \tau } \right) \sin ^ { 2 } \frac { \theta } { 2 } ,
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
then $\frac { \partial L _ { S P } } { \partial \theta }$ can be calculated as
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\frac { \partial L _ { S P } } { \partial \theta } = \frac { 1 } { \tau } \sin \theta ( \tau - 1 + \cos \theta ) \exp \left( \frac { \cos \theta } { \tau } \right) .
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
According to Eq.(10), we get $\begin{array} { r } { \frac { \partial L _ { S P } } { \partial \theta } \geq 0 } \end{array}$ when $\tau \geq 2$ . This means $L _ { S P }$ monotonically decreases when we minimize $v _ { i } ^ { T } v _ { j }$ . Therefore, the impact from minimizing $v _ { i } ^ { T } v _ { j }$ is good for minimizing $L _ { S P }$ . Even if $\tau$ is a little smaller than 2, because $\tau$ controls the scale of derivatives and the range of $\theta$ where the derivative is negative, large $\tau$ decreases the scale and narrows the range, resulting in a small influence on the total loss. From this viewpoint, the effectiveness of minimizing $L _ { I }$ using large $\tau$ is approximately the same as that of $L _ { S P }$ . By adding feature decorrelation constraints, IDFD becomes analogous to spectral clustering.
|
| 143 |
+
|
| 144 |
+
# 4 EXPERIMENTS
|
| 145 |
+
|
| 146 |
+
We conducted experiments using five datasets: CIFAR-10 Krizhevsky et al. (2009), CIFAR-100 Krizhevsky et al. (2009), STL-10 Coates et al. (2011), ImageNet-10 Deng et al. (2009), and ImageNet-Dog Deng et al. (2009). We adopted ResNet18 He et al. (2016) as the neural network architecture in our main experiments. The same architecture is used for all datasets. Our experimental settings are in accordance with that of Wu et al. (2018). Data augmentation strategies often used on images are also adopted in experiments. Details about datasets and experimental setup are given in Appendix A.
|
| 147 |
+
|
| 148 |
+
For IDFD, the weight $\alpha$ is simply fixed at 1. Orthogonality constraint weights for IDFO were $\alpha = 1 0$ on CIFAR-10 and CIFAR-100, and $\alpha = 0 . 5$ on STL-10 and ImageNet subsets. The weight $\alpha$ was set according to the orders of magnitudes of losses. In the main experiments, we set temperature parameter $\tau = 1$ for IDFO and IDFD, and $\tau _ { 2 } = 2$ for IDFD. In order to fully investigate our work, we also constructed two versions of instance discrimination (ID) that uses only $L _ { I }$ loss, ID(original) with small $\tau = 0 . 0 7$ and ID(tuned) with large $\tau = 1$ .
|
| 149 |
+
|
| 150 |
+
We compared ID(tuned), IDFO, and IDFD with ID(original) and six other competitive methods, clustering with an autoencoder (AE) Hinton & Salakhutdinov (2006), deep embedded clustering (DEC) Xie et al. (2016), deep adaptive image clustering (DAC) Chang et al. (2017), deep comprehensive correlation mining (DCCM) Wu et al. (2019), invariant information clustering (IIC) Ji et al. (2019), and semantic clustering by adopting nearest neighbors (SCAN) Van Gansbeke et al. (2020) .We use three metrics to measure clustering performance: standard clustering accuracy (ACC), normalized mutual information (NMI), and adjusted rand index (ARI). These metrics give values in [0, 1], with higher scores indicating more accurate clustering assignments.
|
| 151 |
+
|
| 152 |
+
# 4.1 MAIN RESULTS
|
| 153 |
+
|
| 154 |
+
Table 1 lists the best performances for each method. The results for the four methods AE, DEC, DAC, and DCCM are cited from Wu et al. (2019), and results for two methods IIC and SCAN are cited from Van Gansbeke et al. (2020). Comparing these results, we conclude that ID(tuned), IDFO, and IDFD, clearly outperform these methods excluding SCAN for all datasets, according to the metrics ACC, NMI, and ARI. For dataset CIFAR-10, ID(tuned), IDFO, and IDFD yielded ACC values of $7 7 . 6 \%$ , $8 2 . 8 \%$ , and $8 1 . 5 \%$ , respectively. For dataset ImageNet-10, ID(tuned), IDFO, and IDFD achieved ACC values of $9 3 . 7 \%$ , $9 4 . 2 \%$ , and $9 5 . 4 \%$ . The high performance is comparable with that of supervised and semi-supervised methods. Gaps between the results of ID(tuned) and those of IDFO and IDFD reflect the effect of the feature constraint term. The performance is improved for all datasets by introducing feature orthogonalization and decorrelation. Impressively, ID(tuned) significantly outperformed ID(original) on all datasets, showing strong impact of temperature parameter. This will be discussed separately in section 4.2.1.
|
| 155 |
+
|
| 156 |
+
In addition, we note that IDFD differs from SCAN in that IDFD focuses on the representation leaning while SCAN focuses on clustering by given a representation learning. Both SCAN and IDFD demonstrate significant improvement on performance compared with other methods. Results of IDFD and SCAN showed effectiveness of efforts on both representation learning and clustering phases of deep clustering.
|
| 157 |
+
|
| 158 |
+
We also examine the learning stability of ID(tuned), IDFO, and IDFD. Figure 2 illustrates the accuracy on CIFAR-10 running each of ID(tuned), IDFO, and IDFD. We can see that both IDFO and IDFD obtained higher peak ACC values than ID(tuned). In particular, IDFD yielded higher performance than ID over the entire learning process. IDFO performed better than the other two methods and obtained the highest ACC value in earlier epochs. However, the ACC widely fluctuated over the learning process and dropped in later epochs. As analyzed in 3.2, our proposed IDFD makes performance higher than ID and more stable than IDFO.
|
| 159 |
+
|
| 160 |
+
Table 1: Clustering results $( \% )$ of various methods on five datasets.
|
| 161 |
+
|
| 162 |
+
<table><tr><td>Dataset</td><td colspan="3">CIFAR-10</td><td colspan="3">CIFAR-100</td><td colspan="3">STL-10</td><td colspan="3">ImageNet-10</td><td colspan="3">ImageNet-Dog</td></tr><tr><td>Metric</td><td>ACC</td><td>NMI</td><td>ARI</td><td>ACC</td><td>NMI</td><td>ARI</td><td>ACC</td><td>NMI</td><td>ARI</td><td>ACC</td><td>NMI</td><td>ARI</td><td>ACC</td><td>NMI</td><td>ARI</td></tr><tr><td>AE</td><td>31.4</td><td>23.9</td><td>16.9</td><td>16.5</td><td>10.0</td><td>4.8</td><td>30.3</td><td>25.0</td><td>16.1</td><td>31.7</td><td>21.0</td><td>15.2</td><td>18.5</td><td>10.4</td><td>7.3</td></tr><tr><td>DEC</td><td>30.1</td><td>25.7</td><td>16.1</td><td>18.5</td><td>13.6</td><td>5.0</td><td>35.9</td><td>27.6</td><td>18.6</td><td>38.1</td><td>28.2</td><td>20.3</td><td>19.5</td><td>12.2</td><td>7.9</td></tr><tr><td>DAC</td><td>52.2</td><td>39.6</td><td>30.6</td><td>23.8</td><td>18.5</td><td>8.8</td><td>47.0</td><td>36.6</td><td>25.7</td><td>52.7</td><td>39.4</td><td>30.2</td><td>27.5</td><td>21.9</td><td>11.1</td></tr><tr><td>DCCM</td><td>62.3</td><td>49.6</td><td>40.8</td><td>32.7</td><td>28.5</td><td>17.3</td><td>48.2</td><td>37.6</td><td>26.2</td><td>71.0</td><td>60.8</td><td>55.5</td><td>38.3</td><td>32.1</td><td>18.2</td></tr><tr><td>ID(original)</td><td>44.0</td><td>30.9</td><td>22.1</td><td>26.7</td><td>22.1</td><td>10.8</td><td>51.4</td><td>36.2</td><td>28.5</td><td>63.2</td><td>47.8</td><td>42.0</td><td>36.5</td><td>24.8</td><td>17.2</td></tr><tr><td>IIC</td><td>61.7</td><td>51.1</td><td>41.1</td><td>25.7</td><td>22.5</td><td>11.7</td><td>59.6</td><td>49.6</td><td>39.7</td><td>1</td><td>-</td><td>:</td><td>:</td><td>-</td><td>-</td></tr><tr><td>SCAN</td><td>88.3</td><td>79.7</td><td>77.2</td><td>50.7</td><td>48.6</td><td>33.3</td><td>80.9</td><td>69.8</td><td>64.6</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>ID(tuned)</td><td>77.6</td><td>68.2</td><td>61.6</td><td>40.9</td><td>39.2</td><td>24.3</td><td>72.6</td><td>64.0</td><td>52.6</td><td>93.7</td><td>86.7</td><td>86.5</td><td>47.6</td><td>47.0</td><td>33.5</td></tr><tr><td>IDFO</td><td>82.8</td><td>71.4</td><td>67.9</td><td>42.5</td><td>43.2</td><td>24.4</td><td>75.6</td><td>63.6</td><td>56.9</td><td>94.2</td><td>87.1</td><td>87.6</td><td>61.2</td><td>57.9</td><td>41.4</td></tr><tr><td>IDFD</td><td>81.5</td><td>71.1</td><td>66.3</td><td>42.5</td><td>42.6</td><td>26.4</td><td>75.6</td><td>64.3</td><td>57.5</td><td>95.4</td><td>89.8</td><td>90.1</td><td>59.1</td><td>54.6</td><td>41.3</td></tr></table>
|
| 163 |
+
|
| 164 |
+
# 4.2 DISCUSSION
|
| 165 |
+
|
| 166 |
+
# 4.2.1 ANALYSIS ON TEMPERATURE PARAMETER
|
| 167 |
+
|
| 168 |
+
Gaps between results of ID(original) and ID(tuned) in Table 1 show strong impact of temperature parameter. We theoretically and intuitively analyze the essential change caused by the temperature parameter in this subsection.
|
| 169 |
+
|
| 170 |
+
First, we consider why instance-level discrimination works and under what conditions. Difference in the performance of ID(original) and ID(tuned) suggests optimal distribution in latent space changes with the magnitude of $\tau$ . According to empirical investigation and theoretical analysis, we find that a large $\tau$ in $L _ { I }$ encourages data points to follow a compact distribution when minimizing the loss, while a small $\tau$ drives them to follow a uniform distribution. This means minimizing $L _ { I }$ with a large $\tau$ can reach a good clustering-friendly solution. This property was explained by demonstrating examples and calculation, details are given in Appendix B.
|
| 171 |
+
|
| 172 |
+
In the definition of $P ( i | \boldsymbol { v } )$ in Eq. (1), when $\tau$ is small, we compute softmax on larger logits, resulting in higher prediction, and obtain a more confident model. From this viewpoint, we can leverage a small $\tau$ to decrease class entanglement if we can learn an accurate class-weight vector. In the general classification problem, since the weight of each class can be learned according to the real labels, it is preferable for models to be more confident. Most works therefore recommend setting a small value, such as $\tau = 0 . 0 7 \mathrm { W u }$ et al. (2018). In clustering, however, instance-level discrimination is used to learn similarity among samples, with only one sample in each class. Because the model is highly confident, each sample tends to be completely independent from each other. Similarity among samples is seemingly encouraged to approach close to zero, even for samples from the same class. This clearly deviates from the original intent of adopting instance-level discrimination to learn sample entanglements under the condition that each sample can be discriminative. A larger $\tau$ than that used for classification is thus needed.
|
| 173 |
+
|
| 174 |
+
More experiments over different temperature settings on ID and IDFD were conducted on CIFAR-10. Figure 3 shows the accuracy of ID for $\tau = \{ 0 . 0 7 , 0 . 2 , 0 . 5 , 0 . 8 , 1 , 2 , 5 , 1 0 \}$ . We calculated the mean and standard deviation of ACC values over the last 500 epochs for each experiment. From the results, we can see that ID can suffer significant performance degradation when $\tau$ is too small or too large. This agrees with our analysis above. We also investigate the impact of $\tau _ { 2 }$ by fixing $\tau = 1$ . Figure 4 shows the accuracy of the IDFD for $\tau _ { 2 } = \{ 0 . 1 , 0 . 5 , \bar { 1 , 2 } , 3 , 4 , 5 , \bar { 1 0 } \}$ . Experimental results show that IDFD is relatively robust to the parameter $\tau _ { 2 }$ and enables stable representation learning.
|
| 175 |
+
|
| 176 |
+
# 4.2.2 REPRESENTATION DISTRIBUTION AND FEATURE BEHAVIOR
|
| 177 |
+
|
| 178 |
+
Figure 5 visualizes the results of representations learned in four experiments: (a) ID(original), (b) ID(tuned), (c) IDFO with $\tau = 1$ and $\alpha = 1 0$ , and (d) IDFD with $\tau = 1$ , $\tau _ { 2 } = 2$ , and $\alpha = 1$ on CIFAR10. 128-dimension representations were embedded into two dimensions by t-SNE (t-distributed stochastic neighbor embedding) Maaten & Hinton (2008). Colors indicate ground truth classes. The distributions for the ID(original) and ID(tuned) again show the significant difference between them. Data distribution when $\tau = 1$ is apparently more clustering-friendly than when $\tau = 0 . 0 7$ . Furthermore, compared with ID(tuned), IDFO and IDFD can separate samples from different classes with certain margins. IDFO tended to construct a patch-like distribution within one class. In contrast, IDFD maintained a tighter connection among samples of the same class and more distinct borders between different classes.
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Figure 2: ACC values over learn-Figure 3: Accuracy of $\mathrm { I D }$ for var-Figure 4: Accuracy of IDFD for ing process. ious $\tau$ settings. various $\tau _ { 2 }$ settings.
|
| 182 |
+
|
| 183 |
+

|
| 184 |
+
Figure 5: Distribution of feature representations on CIFAR-10.
|
| 185 |
+
|
| 186 |
+
Figure 6 shows distribution of feature representations on ImageNet-10 learned by IDFD. We can see that representations of ImageNet-10 are clustering-friendly and even better than that of CIFAR-10. This is consistent with the results in Table 1 evaluated by metrics ACC, NMI, and ARI. In addition to that, we also plot sample images corresponding to points lying near the border between clusters. We can see that these samples are certainly similar in appearance.
|
| 187 |
+
|
| 188 |
+

|
| 189 |
+
Figure 6: Distribution of feature representations on ImageNet-10 learned by IDFD and samples corresponding to points in some areas.
|
| 190 |
+
|
| 191 |
+
We investigate the effects of orthogonal and decorrelation constraints $\mathit { L } _ { \mathit { F O } }$ and $L _ { F }$ . Figure 7 illustrates the feature correlations of ID(tuned), IDFO, and IDFD on dataset CIFAR-10. We see that IDFO clearly decorrelates features and IDFD retains a moderate level of feature correlation between ID and IDFD. Taken together with Figure 2, these results suggest that the softmax formulation of IDFD alleviates the problem of strict orthogonality and enables stable representation learning.
|
| 192 |
+
|
| 193 |
+
# 4.2.3 INVESTIGATION FOR PRACTICAL USE
|
| 194 |
+
|
| 195 |
+
We investigate the dependencies of our method on networks through experiments on other networks: ConvNet Wu et al. (2019), VGG16 Simonyan & Zisserman (2014), and ResNet34 He et al. (2016). Performance was evaluated using the CIFAR-10 dataset. Results listed in Table 2 show that IDFD can work on various networks. IDFD outperforms ID(tuned), and FD term shows more obvious effect on these networks. We also confirm the effect of cooperation between $L _ { I }$ and $L _ { F }$ from the viewpoint of spectral clustering, combinations of AE and $L _ { F }$ were evaluated in terms of clustering performance. We found that AE cannot benefit from $L _ { F }$ as $L _ { I }$ did. This result verified that $L _ { F }$ has a deep relation with $L _ { I }$ , and IDFD is not a simple combination. We also investigate the importance of data augmentation in performance through experiments. Due to the page limit, our extended experiments are given in Appendix C.
|
| 196 |
+
|
| 197 |
+

|
| 198 |
+
Figure 7: Feature correlation matrix on CIFAR-10 with ResNet18
|
| 199 |
+
|
| 200 |
+
Table 2: Clustering results $( \% )$ on various network architectures.
|
| 201 |
+
|
| 202 |
+
<table><tr><td>Network</td><td colspan="3">ConvNet</td><td colspan="3">VGG16</td><td colspan="3">ResNet18</td><td colspan="3">ResNet34</td></tr><tr><td>Metric</td><td>ACC</td><td>NMI</td><td>ARI</td><td>ACC</td><td>NMI</td><td>ARI</td><td>ACC</td><td>NMI</td><td>ARI</td><td>ACC</td><td>NMI</td><td>ARI</td></tr><tr><td>ID(tuned)</td><td>26.8</td><td>15.0</td><td>8.9</td><td>39.3</td><td>31.6</td><td>20.9</td><td>77.6</td><td>68.2</td><td>61.6</td><td>80.2</td><td>71.1</td><td>64.6</td></tr><tr><td>IDFD</td><td>42.0</td><td>32.7</td><td>23.2</td><td>56.8</td><td>46.7</td><td>36.5</td><td>81.5</td><td>71.1</td><td>66.3</td><td>82.7</td><td>73.4</td><td>68.4</td></tr></table>
|
| 203 |
+
|
| 204 |
+
# 5 CONCLUSION
|
| 205 |
+
|
| 206 |
+
We present a clustering-friendly representation learning method combining instance discrimination and feature decorrelation based on spectral clustering properties. Instance discrimination learns similarities among data and feature decorrelation removes redundant correlation among features. We analyzed why instance discrimination works for clustering and clarified the conditions. We designed a softmax-formulated feature decorrelation constraint for learning the latent space to realize stable improvement of clustering performance. We also explained the connection between our method and spectral clustering. The proposed representation learning method achieves accuracies comparable to state-of-the-art values on the CIFAR-10 and ImageNet-10 datasets with simple $k$ -means. We also verified IDFD loss works on multiple neural network structures, and our method is expected to be effective for various kinds of problems.
|
| 207 |
+
|
| 208 |
+
# REFERENCES
|
| 209 |
+
|
| 210 |
+
Piotr Bojanowski and Armand Joulin. Unsupervised learning by predicting noise. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 517–526. JMLR. org, 2017.
|
| 211 |
+
|
| 212 |
+
Mathilde Caron, Piotr Bojanowski, Armand Joulin, and Matthijs Douze. Deep clustering for unsupervised learning of visual features. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 132–149, 2018.
|
| 213 |
+
|
| 214 |
+
Jianlong Chang, Lingfeng Wang, Gaofeng Meng, Shiming Xiang, and Chunhong Pan. Deep adaptive image clustering. In The IEEE International Conference on Computer Vision (ICCV), Oct 2017.
|
| 215 |
+
|
| 216 |
+
Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. arXiv preprint arXiv:2002.05709, 2020.
|
| 217 |
+
|
| 218 |
+
Adam Coates, Andrew Ng, and Honglak Lee. An analysis of single-layer networks in unsupervised feature learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pp. 215–223, 2011.
|
| 219 |
+
|
| 220 |
+
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.
|
| 221 |
+
|
| 222 |
+
Nat Dilokthanakul, Pedro AM Mediano, Marta Garnelo, Matthew CH Lee, Hugh Salimbeni, Kai Arulkumaran, and Murray Shanahan. Deep unsupervised clustering with gaussian mixture variational autoencoders. arXiv preprint arXiv:1611.02648, 2016.
|
| 223 |
+
|
| 224 |
+
Jeff Donahue, Philipp Krähenbühl, and Trevor Darrell. Adversarial feature learning. arXiv preprint arXiv:1605.09782, 2016.
|
| 225 |
+
|
| 226 |
+
Xifeng Guo, Long Gao, Xinwang Liu, and Jianping Yin. Improved deep embedded clustering with local structure preservation. In International Joint Conference on Artificial Intelligence, pp. 1753–1759, 2017.
|
| 227 |
+
|
| 228 |
+
Divam Gupta, Ramachandran Ramjee, Nipun Kwatra, and Muthian Sivathanu. Unsupervised clustering using pseudo-semi-supervised learning. In International Conference on Learning Representations, 2020. URL https://openreview.net/forum?id $=$ rJlnxkSYPS.
|
| 229 |
+
|
| 230 |
+
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.
|
| 231 |
+
|
| 232 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
|
| 233 |
+
|
| 234 |
+
Geoffrey E Hinton and Ruslan R Salakhutdinov. Reducing the dimensionality of data with neural networks. science, 313(5786):504–507, 2006.
|
| 235 |
+
|
| 236 |
+
R Devon Hjelm, Alex Fedorov, Samuel Lavoie-Marchildon, Karan Grewal, Phil Bachman, Adam Trischler, and Yoshua Bengio. Learning deep representations by mutual information estimation and maximization. arXiv preprint arXiv:1808.06670, 2018.
|
| 237 |
+
|
| 238 |
+
Weihua Hu, Takeru Miyato, Seiya Tokui, Eiichi Matsumoto, and Masashi Sugiyama. Learning discrete representations via information maximizing self-augmented training. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1558–1567. JMLR. org, 2017.
|
| 239 |
+
|
| 240 |
+
Xu Ji, João F Henriques, and Andrea Vedaldi. Invariant information clustering for unsupervised image classification and segmentation. In Proceedings of the IEEE International Conference on Computer Vision, pp. 9865–9874, 2019.
|
| 241 |
+
|
| 242 |
+
Zhuxi Jiang, Yin Zheng, Huachun Tan, Bangsheng Tang, and Hanning Zhou. Variational deep embedding: An unsupervised and generative approach to clustering. arXiv preprint arXiv:1611.05148, 2016.
|
| 243 |
+
|
| 244 |
+
Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 245 |
+
|
| 246 |
+
Laurens van der Maaten and Geoffrey Hinton. Visualizing data using t-sne. Journal of machine learning research, 9(Nov):2579–2605, 2008.
|
| 247 |
+
|
| 248 |
+
Marina Meila and Jianbo Shi. Learning segmentation by random walks. In Advances in neural information processing systems, pp. 873–879, 2001.
|
| 249 |
+
|
| 250 |
+
Andrew Y Ng, Michael I Jordan, and Yair Weiss. On spectral clustering: Analysis and an algorithm. In Advances in neural information processing systems, pp. 849–856, 2002.
|
| 251 |
+
|
| 252 |
+
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, highperformance deep learning library. In Advances in Neural Information Processing Systems 32, pp. 8024–8035. Curran Associates, Inc., 2019. URL http://papers.neurips.cc/paper/ 9015-pytorch-an-imperative-style-high-performance-deep-learning-library. pdf.
|
| 253 |
+
|
| 254 |
+
Uri Shaham and Roy R Lederman. Learning by coincidence: Siamese networks and common variable learning. Pattern Recognition, 74:52–63, 2018.
|
| 255 |
+
|
| 256 |
+
Uri Shaham, Kelly Stanton, Henry Li, Boaz Nadler, Ronen Basri, and Yuval Kluger. Spectralnet: Spectral clustering using deep neural networks. arXiv preprint arXiv:1801.01587, 2018.
|
| 257 |
+
|
| 258 |
+
Jianbo Shi and Jitendra Malik. Normalized cuts and image segmentation. IEEE Transactions on pattern analysis and machine intelligence, 22(8):888–905, 2000.
|
| 259 |
+
|
| 260 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 261 |
+
|
| 262 |
+
Chunfeng Song, Feng Liu, Yongzhen Huang, Liang Wang, and Tieniu Tan. Auto-encoder based data clustering. In Iberoamerican Congress on Pattern Recognition, pp. 117–124. Springer, 2013.
|
| 263 |
+
|
| 264 |
+
Yaling Tao, Kentaro Takagi, and Kouta Nakata. Rdec: Integrating regularization into deep embedded clustering for imbalanced datasets. In Asian Conference on Machine Learning, pp. 49–64, 2018.
|
| 265 |
+
|
| 266 |
+
Fei Tian, Bin Gao, Qing Cui, Enhong Chen, and Tie-Yan Liu. Learning deep representations for graph clustering. In Twenty-Eighth AAAI Conference on Artificial Intelligence, 2014.
|
| 267 |
+
|
| 268 |
+
Wouter Van Gansbeke, Simon Vandenhende, Stamatios Georgoulis, Marc Proesmans, and Luc Van Gool. Scan: Learning to classify images without labels. In Proceedings of the European Conference on Computer Vision, 2020.
|
| 269 |
+
|
| 270 |
+
Pascal Vincent, Hugo Larochelle, Isabelle Lajoie, Yoshua Bengio, and Pierre-Antoine Manzagol. Stacked denoising autoencoders: Learning useful representations in a deep network with a local denoising criterion. Journal of machine learning research, 11(Dec):3371–3408, 2010.
|
| 271 |
+
|
| 272 |
+
Ulrike Von Luxburg. A tutorial on spectral clustering. Statistics and computing, 17(4):395–416, 2007.
|
| 273 |
+
|
| 274 |
+
Jianlong Wu, Keyu Long, Fei Wang, Chen Qian, Cheng Li, Zhouchen Lin, and Hongbin Zha. Deep comprehensive correlation mining for image clustering. In Proceedings of the IEEE International Conference on Computer Vision, pp. 8150–8159, 2019.
|
| 275 |
+
|
| 276 |
+
Zhirong Wu, Yuanjun Xiong, Stella X Yu, and Dahua Lin. Unsupervised feature learning via nonparametric instance discrimination. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3733–3742, 2018.
|
| 277 |
+
|
| 278 |
+
Tong Xiao, Shuang Li, Bochao Wang, Liang Lin, and Xiaogang Wang. Joint detection and identification feature learning for person search. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3415–3424, 2017.
|
| 279 |
+
|
| 280 |
+
Junyuan Xie, Ross Girshick, and Ali Farhadi. Unsupervised deep embedding for clustering analysis. In Proceedings of the 33rd International Conference on International Conference on Machine Learning-Volume 48, pp. 478–487, 2016.
|
| 281 |
+
|
| 282 |
+
Bo Yang, Xiao Fu, Nicholas D Sidiropoulos, and Mingyi Hong. Towards k-means-friendly spaces: Simultaneous deep learning and clustering. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3861–3870. JMLR. org, 2017.
|
| 283 |
+
|
| 284 |
+
# APPENDICES
|
| 285 |
+
|
| 286 |
+
# A DATASETS AND EXPERIMENTAL SETUP
|
| 287 |
+
|
| 288 |
+
Five datasets were used to conduct experiments: CIFAR-10 Krizhevsky et al. (2009), CIFAR100 Krizhevsky et al. (2009), STL-10 Coates et al. (2011), ImageNet-10 Deng et al. (2009), and ImageNet-Dog Deng et al. (2009). Table 3 lists the numbers of images, number of clusters, and image sizes of these datasets. Specifically, the training and testing sets of dataset STL-10 were jointly used in our experiments. Images from the three ImageNet subsets were resized to $9 6 \times 9 6 \times 3$ .
|
| 289 |
+
|
| 290 |
+
Table 3: Image datasets used in experiments.
|
| 291 |
+
|
| 292 |
+
<table><tr><td>Dataset</td><td>Images</td><td>Clusters</td><td>Image size</td></tr><tr><td>CIFAR-10 Krizhevsky et al. (2009)</td><td>50,000</td><td>10</td><td>32×32×3</td></tr><tr><td>CIFAR-100 Krizhevsky et al. (2009)</td><td>50,000</td><td>20</td><td>32 × 32×3</td></tr><tr><td>STL-10 Coates et al. (2011)</td><td>13,000</td><td>10</td><td>96× 96×3</td></tr><tr><td>Imagenet-10 Deng et al. (2009)</td><td>13,000</td><td>10</td><td>96 ×96×3</td></tr><tr><td>Imagenet-Dog Deng et al. (2009)</td><td>19,500</td><td>15</td><td>96 ×96×3</td></tr></table>
|
| 293 |
+
|
| 294 |
+
We adopted ResNet He et al. (2016) as the neural network architecture in our main experiments. For simplicity, we used ResNet18, which according to our preliminary experiments yields sufficiently high performance. The same architecture was used for all datasets except the input layer. In accordance with the experimental settings of $\mathrm { { W u } }$ et al. (2018), the dimension of latent feature vectors was set to $d = 1 2 8$ , and a stochastic gradient descent optimizer with momentum $\beta = 0 . 9$ was used. The learning rate $l r$ was initialized to 0.03, then gradually scaled down after the first 600 epochs using a coefficient of 0.1 every 350 epochs. The total number of epochs was set to 2000, and the batch size was set to $B = 1 2 8$ . Orthogonality constraint weights for IDFO were $\alpha = 1 0$ for CIFAR-10 and CIFAR-100 and $\alpha = 0 . 5$ for the STL-10 and ImageNet subsets. The weight for IDFO $\alpha$ was set according to the orders of magnitudes of the two losses $L _ { I }$ and $\mathit { L } _ { \mathit { F O } }$ . For IDFD, the weight $\alpha$ was simply fixed at 1. In the main experiments, we set the default temperature parameter value $\tau = 1$ for ID(tuned), IDFO, and IDFD, and $\tau _ { 2 } = 2$ for IDFD.
|
| 295 |
+
|
| 296 |
+
# B OPTIMAL SOLUTIONS OF CLUSTERING AND INSTANCE DISCRIMINATION
|
| 297 |
+
|
| 298 |
+
In Section 4.2.1, we concluded that minimizing $L _ { I }$ under the condition that $\tau$ is large can reach a clustering-friendly solution. Details about the analysis and calculation was demonstrated by a two-dimensional toy model as follows.
|
| 299 |
+
|
| 300 |
+
Empirically, we observe that visually similar images tend to get similar assignment probabilities. Similar images can thus be projected to close locations in the latent space. This also motivated ID Wu et al. (2018). In the case of ID, similar images $x _ { i }$ and $x _ { j }$ yield respective highest probabilities $p _ { i i }$ and $p _ { j j }$ , and also receive relatively high $p _ { i j }$ and $p _ { j i }$ values. This property can retain over the process of approximation to the optimal solution. Because instance-level discrimination tries to maximally scatter embedded features of instances over the unit sphere Wu et al. (2018), all representations are thus uniformly spread over the latent space with each representation relatively similar to its surroundings, we call this uniform case. We also consider another case that yields an optimal clustering solution where all samples from the same class are compacted to one point and $k$ clusters are uniformly spread over the space. We call this compact case. Figure 8 shows the representation distributions in the two cases. Because we normalize $\pmb { v }$ , two-dimensional representations form a circle.
|
| 301 |
+
|
| 302 |
+
In the uniform case, $n$ representations are uniformly located on a circle with an angular interval of $\theta = 2 \pi / \stackrel { . } { n }$ , and the inner product between two neighboring representations is $\cos \theta$ . Without loss of generality, we can start with an arbitrary point $v _ { i }$ and orderly mark all samples as $v _ { i + j }$ . The cosine similarity between $v _ { i }$ and $v _ { i + j }$ can then be calculated by $v _ { i + j } ^ { T } v _ { i } = \cos j \theta$ . Accordingly, the loss contributed by sample $i$ in the uniform case can be calculated as
|
| 303 |
+
|
| 304 |
+

|
| 305 |
+
Figure 8: Two extreme cases of representation distributions over two-dimensional space. Left: uniform. Right: Figure 9: exp(cos θ/τ ) with differcompact. ent $\tau$ settings.
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
L _ { u n i f o r m } ^ { i } = - \log \frac { \exp ( 1 / \tau ) } { \sum _ { m = 0 } ^ { n - 1 } \exp ( \cos m \theta / \tau ) } = - \log \frac { \frac { 1 } { n } \exp ( 1 / \tau ) } { \frac { 1 } { n } \sum _ { m = 0 } ^ { n - 1 } \exp ( \cos m \theta / \tau ) } .
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
Similarly, in the compact case, $n / k$ data from the same class are exactly compacted to a point and $k$ corresponding points located on a circle at an angular interval of $\theta ^ { \prime } = 2 \pi / k$ . The inner product between an arbitrary start sample $v _ { i }$ and the $j$ -th sample can be calculated as $v _ { i } ^ { T } v _ { i + j } =$ $\cos l \theta ^ { \prime }$ , where $l = j$ mod $n / k$ . The probability of assigning $i$ to the cluster with $j$ becomes $p _ { i j } =$ $\frac { \exp ( \cos \theta ^ { \prime } / \tau ) } { \sum _ { c = 0 } ^ { k - 1 } \frac { n } { k } \exp ( \cos c \theta ^ { \prime } / \tau ) }$ . Accordingly, the loss contributed by sample $i$ in the compact case can be calculated as
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
L _ { c o m p a c t } ^ { i } = - \log \frac { \exp ( 1 / \tau ) } { \sum _ { c = 0 } ^ { k - 1 } \frac { n } { k } \exp ( \cos c \theta ^ { \prime } / \tau ) } = - \log \frac { \frac { 1 } { n } \exp ( 1 / \tau ) } { \frac { 1 } { k } \sum _ { c = 0 } ^ { k - 1 } \exp ( \cos c \theta ^ { \prime } / \tau ) } .
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
Comparing Eq. (11) and (12), we see that the difference between only from the denominator part of the logarithm. These are two dis $L _ { u n i f o r m } ^ { i }$ and s of $L _ { c o m p a c t } ^ { i }$ comesntegral $\int \dot { \exp } ( \cos \theta / \tau ) d \theta$ . Clearly, $L _ { u n i f o r m } ^ { i }$ equals $L _ { c o m p a c t } ^ { i }$ when $k , n + \infty$ . We therefore need to consider only the general case where $n$ is sufficiently large and $k \ll n$ .
|
| 318 |
+
|
| 319 |
+
Figure 9 shows a plot of function values $\exp \bigl ( \frac { \cos \theta } { \tau } \bigr )$ with different $\tau$ settings over the domain $\theta \ \bar { \in } \ [ 0 , 2 \pi ]$ . We can see that the curve becomes flatter as $\tau$ increases. A flat function $f$ means that for an arbitrary $( \theta , \theta ^ { \prime } )$ pair in its domain of definition, we have $f ( \theta ) \approx f ( \theta ^ { \prime } )$ . In this situation even $k \ll n$ , the difference between the summations of these two discrete functions is not large. Accordingly, we can say $L _ { c o m p a c t } ^ { i }$ is approximate to $L _ { u n i f o r m } ^ { i }$ for a large $\tau$ . In other words, minimizing $L _ { I }$ can approach the compact situation where same-class samples assemble and differing samples separate. Learning instance-level discrimination for clustering is therefore reasonable.
|
| 320 |
+
|
| 321 |
+
# C EXTENDED EXPERIMENTS
|
| 322 |
+
|
| 323 |
+
In Section 4.2.3, we have reported some investigations of our method for practical use. Details about several important experiments are supplemented as follows.
|
| 324 |
+
|
| 325 |
+
# C.1 IMPACT OF NETWORK ARCHITECTURE
|
| 326 |
+
|
| 327 |
+
As Table 2 shows, IDFD can be applied to various networks, and the performance gaps between IDFD and ID(turned) on networks like ConvNet Wu et al. (2019) and VGG16 Simonyan & Zisserman (2014) are more significant than on ResNet He et al. (2016). We added the feature correlation matrix of VGG16 in Figure 10. IDFD on VGG16 obtained sparse correlations similar to the case of ResNet18 in Figure 7, while ID on VGG16 obtained denser and stronger correlations than ResNet18, presumably constructing redundant features that degraded clustering. In the case of VGG16, the feature decorrelation term $L _ { F }$ exhibits a larger effect on clustering performance than that of ResNet.
|
| 328 |
+
|
| 329 |
+
Our proposed losses work on all network architectures, and we expect to introduce the losses to various networks that are suitable for individual problems.
|
| 330 |
+
|
| 331 |
+

|
| 332 |
+
Figure 10: Feature correlation matrix learned by VGG16 on CIFAR-10.
|
| 333 |
+
|
| 334 |
+
# C.2 COMBINATION OF AUTOENCODER AND FEATURE DECORRELATION
|
| 335 |
+
|
| 336 |
+
In order to further confirm the cooperation effect of instance discrimination and feature decorrelation from the viewpoint of spectral clustering, a combination of autoencoder and feature decorrelation was evaluated in terms of clustering performance. Autoencoder has been verified by datasets such as handwritten digits to be an effective method for deep clustering. In this experiment, we used ConvNet Wu et al. (2019) for the autoencoder architecture and trained it on the CIFAR-10 dataset. We applied $k$ -means to representations learned from autoencoder only and autoencoder combined with feature decorrelation, which are called AE and AEFD, respectively. According to our experiments, the ACC value of AE was $2 6 . 0 \%$ , and the ACC value of AEFD was $2 2 . 4 \%$ . Compared to the improvement from ID to IDFD (from $2 6 . 8 \%$ to $4 2 . 0 \%$ as shown in Table 2), we see that AE cannot benefit from FD as ID. This result again indicates that FD has a deep relation with ID as we analyzed in Section 3.
|
| 337 |
+
|
| 338 |
+
# C.3 IMPACT OF DATA AUGMENTATION
|
| 339 |
+
|
| 340 |
+
For reproduction of our results and practical use, we note that data augmentation (DA) has strong impact on the performance. DA is known to have impact on image classification and representation learning. Like in Wu et al. (2018), several generic and accepted techniques, such as cropping and grayscale, were used for data augmenting in this work. The details of the augmentation in the original code can be linked to Wu et al. (2018). In order to investigate the impact of DA, we conducted experiments on five datasets with and without DA and compared their clustering results. Table 4 shows the results. We can see that methods without DA suffered significant performance degradations for clustering, as well as for classification Chen et al. (2020). This reminds us not to ignore the effects of DA in practical use.
|
| 341 |
+
|
| 342 |
+
Table 4: Clustering results $( \% )$ with or without data augmentation on five datasets.
|
| 343 |
+
|
| 344 |
+
<table><tr><td>Dataset</td><td colspan="3">CIFAR-10</td><td colspan="3">CIFAR-100</td><td colspan="3">STL-10</td><td colspan="3">ImageNet-10</td><td colspan="3">ImageNet-Dog</td></tr><tr><td>Metric</td><td>ACC</td><td>NMI</td><td>ARI</td><td>ACC</td><td>NMI</td><td>ARI</td><td>ACC</td><td>NMI</td><td>ARI</td><td>ACC</td><td>NMI</td><td>ARI</td><td>ACC</td><td>NMI</td><td>ARI</td></tr><tr><td>ID W/O DA</td><td>18.7</td><td>9.5</td><td>4.1</td><td>14.8</td><td>10.7</td><td>3.2</td><td>19.6</td><td>9.0</td><td>3.7</td><td>23.6</td><td>14.1</td><td>6.2</td><td>12.7</td><td>4.6</td><td>1.9</td></tr><tr><td>IDFD W/O DA</td><td>23.6</td><td>12.1</td><td>6.0</td><td>16.2</td><td>11.6</td><td>4.4</td><td>24.8</td><td>17.6</td><td>8.3</td><td>37.2</td><td>23.8</td><td>15.6</td><td>15.5</td><td>5.5</td><td>2.5</td></tr><tr><td>ID With DA</td><td>76.6</td><td>65.7</td><td>58.3</td><td>36.7</td><td>35.7</td><td>21.9</td><td>57.1</td><td>49.0</td><td>36.8</td><td>85.8</td><td>79.1</td><td>70.5</td><td>29.4</td><td>16.0</td><td>28.5</td></tr><tr><td>IDFD With DA</td><td>81.5</td><td>71.1</td><td>66.3</td><td>42.5</td><td>42.6</td><td>26.4</td><td>75.6</td><td>64.3</td><td>57.5</td><td>95.4</td><td>89.8</td><td>90.1</td><td>59.1</td><td>54.6</td><td>41.3</td></tr></table>
|
| 345 |
+
|
| 346 |
+
To further find out main factors affecting the performance, we also executed experiments by removing each technique used for DA. Take the example of CIFAR-10, techniques used for data augmentation include: ColorJitter, RandomResizedCrop, RandomGrayscale, and RandomHorizontalFlip. All these techniques are generic and easy to be implemented. They have been integrated into general deep learning frameworks such as PyTorch. According to our experimental results as shown in Figure 11, we find that RandomResizedCrop, RandomGrayscale, and ColorJitter have strong effect on image clustering.
|
| 347 |
+
|
| 348 |
+

|
| 349 |
+
Figure 11: Effect of each technique used for DA on CIFAR-10.
|
| 350 |
+
|
| 351 |
+
For practice, we also applied IDFD to our private images produced by manufacturing process. Generic DA like above were used to these images. IDFD showed good performance on these images according to our experiments. This indicates that our method can be simply applied to practical images. For other types of data such as text and time series, corresponding data augmentation techniques are needed to cooperate with our method.
|
md/train/ebS5NUfoMKL/ebS5NUfoMKL.md
ADDED
|
@@ -0,0 +1,357 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# BOOST THEN CONVOLVE: GRADIENT BOOSTING MEETS GRAPH NEURAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Sergei Ivanov
|
| 4 |
+
Criteo AI Lab; Skoltech
|
| 5 |
+
Paris, France
|
| 6 |
+
s.ivanov@criteo.com
|
| 7 |
+
|
| 8 |
+
Liudmila Prokhorenkova Yandex; HSE University; MIPT Moscow, Russia ostroumova-la@yandex-team.ru
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
Graph neural networks (GNNs) are powerful models that have been successful in various graph representation learning tasks. Whereas gradient boosted decision trees (GBDT) often outperform other machine learning methods when faced with heterogeneous tabular data. But what approach should be used for graphs with tabular node features? Previous GNN models have mostly focused on networks with homogeneous sparse features and, as we show, are suboptimal in the heterogeneous setting. In this work, we propose a novel architecture that trains GBDT and GNN jointly to get the best of both worlds: the GBDT model deals with heterogeneous features, while GNN accounts for the graph structure. Our model benefits from endto-end optimization by allowing new trees to fit the gradient updates of GNN. With an extensive experimental comparison to the leading GBDT and GNN models, we demonstrate a significant increase in performance on a variety of graphs with tabular features. The code is available: https://github.com/nd7141/bgnn.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
Graph neural networks (GNNs) have shown great success in learning on graph-structured data with various applications in molecular design (Stokes et al., 2020), computer vision (Casas et al., 2019), combinatorial optimization (Mazyavkina et al., 2020), and recommender systems (Sun et al., 2020). The main driving force for progress is the existence of canonical GNN architecture that efficiently encodes the original input data into expressive representations, thereby achieving high-quality results on new datasets and tasks.
|
| 17 |
+
|
| 18 |
+
Recent research has mostly focused on GNNs with sparse data representing either homogeneous node embeddings (e.g., one-hot encoded graph statistics) or bag-of-words representations. Yet tabular data with detailed information and rich semantics among nodes in the graph are more natural for many situations and abundant in real-world AI (Xiao et al., 2019). For example, in a social network, each person has socio-demographic characteristics (e.g., age, gender, date of graduation), which largely vary in data type, scale, and missing values. GNNs for graphs with tabular data remain unexplored, with gradient boosted decision trees (GBDTs) largely dominating in applications with such heterogeneous data (Bentejac et al., 2020). ´
|
| 19 |
+
|
| 20 |
+
GBDTs are so successful for tabular data because they possess certain properties: (i) they efficiently learn decision space with hyperplane-like boundaries that are common in tabular data; (ii) they are well-suited for working with variables of high cardinality, features with missing values, and of different scale; (iii) they provide qualitative interpretation for decision trees (e.g., by computing decrease in node impurity for every feature) or for ensembles via post-hoc analysis stage (Kaur et al., 2020); (iv) in practical applications, they mostly converge faster even for large amounts of data.
|
| 21 |
+
|
| 22 |
+
In contrast, a crucial feature of GNNs is that they take into account both the neighborhood information of the nodes and the node features to make a prediction, unlike GBDTs that require additional preprocessing analysis to provide the algorithm with graph summary (e.g., through unsupervised graph embeddings (Hu et al., 2020a)). Moreover, it has been shown theoretically that message-passing GNNs can compute any function on its graph input that is computable by a Turing machine, i.e., GNN is known to be the only learning architecture that possesses universality properties on graphs (approximation (Keriven & Peyre, 2019; Maron et al., 2019) and computability (Loukas, 2020)). ´
|
| 23 |
+
|
| 24 |
+
Furthermore, gradient-based learning of neural networks can have numerous advantages over the treebased approach: (i) relational inductive bias imposed in GNNs alleviates the need to manually engineer features that capture the topology of the network (Battaglia et al., 2018); (ii) the end-to-end nature of training neural networks allows multi-stage (Fey et al., 2019) or multi-component (Wang et al., 2020) integration of GNNs in application-dependent solutions; (iii) pretraining representations with graph networks enriches transfer learning for many valuable tasks such as unsupervised domain adaptation (Wu et al., 2020), self-supervised learning (Hu et al., 2020b), and active learning regimes (Satorras & Estrach, 2018).
|
| 25 |
+
|
| 26 |
+
Undoubtedly, there are major benefits in both GBDT and GNN methods. Is it possible to get advantages of both worlds? All previous approaches (Arik & Pfister, 2020; Popov et al., 2019; Badirli et al., 2020) that attempt to combine gradient boosting and neural networks are computationally heavy, do not consider graph-structured data, and suffer from the lack of relational bias imposed in GNN architectures, see Appendix A for a more detailed comparison with related literature. To the best of our knowledge, the current work is the first to explore using GBDT models for graph-structured data.
|
| 27 |
+
|
| 28 |
+
In this paper, we propose a novel learning architecture for graphs with tabular data, BGNN, that combines GBDT’s learning on tabular node features with GNN that refines the predictions utilizing the graph’s topology. This allows BGNN to inherit the advantages of gradient boosting methods (heterogeneous learning and interpretability) and graph networks (representation learning and end-toend training). Overall, our contributions are the following:
|
| 29 |
+
|
| 30 |
+
(1) We design a novel generic architecture that combines GBDT and GNN into a unique pipeline. To the best of our knowledge, this is the first work that systematically studies the application of GBDT to graph-structured data.
|
| 31 |
+
(2) We overcome the challenge of end-to-end training of GBDT by iteratively adding new trees that fit the gradient updates of GNN. This allows us to backpropagate the error signal from the topology of the network to GBDT.
|
| 32 |
+
(3) We perform an extensive evaluation of our approach against strong baselines in node prediction tasks. Our results consistently demonstrate significant performance improvements on heterogeneous node regression and node classification tasks over a variety of real-world graphs with tabular data.
|
| 33 |
+
(4) We show that our approach is also more efficient than the state-of-the-art GNN models due to much faster loss convergence during training. Furthermore, learned representations exhibit discernible structure in the latent space, which further demonstrates the expressivity of our approach.
|
| 34 |
+
|
| 35 |
+
# 2 BACKGROUND
|
| 36 |
+
|
| 37 |
+
Let $G = ( V , E )$ be a graph with nodes having features and target labels. In node prediction tasks (classification or regression), some target labels are known, and the goal is to predict the remaining ones. Throughout the text, by lowercase variables $\mathbf { x } _ { v }$ $w \in V ,$ ) or $\mathbf { x }$ we denote features of individual nodes, and $\mathbf { X }$ represents the matrix of all features for $v \in V$ . Individual target labels are denoted by $y _ { v }$ , while $Y$ is the vector of known labels.
|
| 38 |
+
|
| 39 |
+
Graph Neural Networks (GNNs) use both the network’s connectivity and the node features to learn latent representations for all nodes $v \in V$ . Many popular GNNs use a neighborhood aggregation approach, also called the message-passing mechanism, where the representation of a node $v$ is updated by applying a non-linear aggregation function of $v$ ’s neighbors representation (Fey & Lenssen, 2019). Formally, GNN is a differentiable, permutation-invariant function $g _ { \boldsymbol { \theta } } : ( G , \mathbf { X } ) \mapsto { \widehat { Y } }$ , where $\widehat { Y }$ is the vector of predicted labels. Similar to traditional neural networks, GNNs are composed of multiple layers, each representing a non-linear message-passing function:
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\mathbf { x } _ { v } ^ { t } = \mathbf { C O M B I N E } ^ { t } \left( \mathbf { x } _ { v } ^ { t - 1 } , \mathbf { A G G R E G A T E } ^ { t } \left( \left\{ \left( \mathbf { x } _ { w } ^ { t - 1 } , \mathbf { x } _ { v } ^ { t - 1 } \right) : \left( w , v \right) \in E \right\} \right) \right) ,
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
where $\mathbf { x } _ { v } ^ { t }$ is the representation of node $v$ at layer $t$ , and COMBINEt and AGGREGATEt are (parametric) functions that aggregate representations from the local neighborhood of a node. Then, the GNN mapping $g _ { \theta }$ includes multiple layers of aggregation (1). Parameters of GNN model $\theta$ are optimized with gradient descent by minimizing an empirical loss function ${ \cal L } _ { \mathrm { G N N } } ( Y , g _ { \theta } ( G , { \bf X } ) )$ .
|
| 46 |
+
|
| 47 |
+
Gradient Boosted Decision Trees (GBDT) is a well-known and widely used algorithm that is defined on non-graph tabular data (Friedman, 2001) and is particularly successful for tasks containing heterogeneous features and noisy data.
|
| 48 |
+
|
| 49 |
+
The core idea of gradient boosting is to construct a strong model by iteratively adding weak ones (usually decision trees). Formally, at each iteration $t$ of the gradient boosting algorithm, the model $f ( \mathbf { x } )$ is updated in an additive manner:
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
f ^ { t } ( { \bf { x } } ) = f ^ { t - 1 } ( { \bf { x } } ) + \epsilon h ^ { t } ( { \bf { x } } ) ,
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
where $f ^ { t - 1 }$ is a model constructed at the previous iteration, $h ^ { t }$ is a weak learner that is chosen from some family of functions $\mathcal { H }$ , and $\epsilon$ is a learning rate. The weak learner $h ^ { t } \in \mathcal { H }$ is chosen to approximate the negative gradient of a loss function $L$ w.r.t. the current model’s predictions:
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
h ^ { t } = \underset { h \in \mathcal { H } } { \arg \operatorname* { m i n } } \sum _ { i } \left( - \frac { \partial L ( f ^ { t - 1 } ( \mathbf { x } _ { i } ) , y _ { i } ) } { \partial f ^ { t - 1 } ( \mathbf { x } _ { i } ) } - h ( \mathbf { x } _ { i } ) \right) ^ { 2 } .
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
The gradient w.r.t. the current predictions indicates how one should change these predictions to improve the loss function. Informally, gradient boosting can be thought of as performing gradient descent in functional space.
|
| 62 |
+
|
| 63 |
+
The set of weak learners $\mathcal { H }$ is usually formed by shallow decision trees. Decision trees are built by a recursive partition of the feature space into disjoint regions called leaves. This partition is usually constructed greedily to minimize the loss function (3). Each leaf $R _ { j }$ of the tree is assigned to a value $a _ { j }$ , which estimates the response $y$ in the corresponding region. In our case, $a _ { j }$ is equal to the average negative gradient value in the leaf $R _ { j }$ . To sum up, we can write $\begin{array} { r } { h ( x ) = \sum _ { j } \overset { \cdot } { a } _ { j } 1 _ { \{ x \in R _ { j } \} } } \end{array}$ .
|
| 64 |
+
|
| 65 |
+
# 3 GBDT MEETS GNN
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
Figure 1: Training of BGNN, steps for one epoch are numbered.
|
| 69 |
+
|
| 70 |
+
<table><tr><td>Algorithm1TrainingofBGNN</td></tr><tr><td>Input: Graph G, node features X, targets Y Initialize GBDT targets V= Y for epoch i= 1 to N do # Train k trees of GBDT with eq. (2)-(3) fi← arg min LGBDT(fi(X),)) k fi f←f+fi # Train l steps of GNN on new node features</td></tr></table>
|
| 71 |
+
|
| 72 |
+
Gradient boosting approach is successful for learning on tabular data; however, there are challenges of applying GBDT on graph-structured data: (i) how to propagate relational signal, in addition to node features, to otherwise inherently tabular model; and (ii) how to train it together with GNN in an end-to-end fashion. Indeed, optimizations of GBDT and GNN follow different approaches: the parameters of GNN are optimized via gradient descent, while GBDT is constructed iteratively, and the decision trees remain fixed after being built (decision trees are based on hard splits of the feature space, which makes them non-differentiable).
|
| 73 |
+
|
| 74 |
+
A straightforward approach would be to train the GBDT model only on the node features and then use the obtained predictions, jointly with the original input, as new node features for GNN. In this case, the graph-insensitive predictions of GBDT will further be refined by a graph neural network.
|
| 75 |
+
|
| 76 |
+
This approach (which we call Res-GNN) can already boost the performance of GNN for some tasks. However, in this case, the GBDT model completely ignores the graph structure and may miss descriptive features of the graph, providing inaccurate input data to GNN.
|
| 77 |
+
|
| 78 |
+
In contrast, we propose end-to-end training of GBDT and GNN called BGNN (for Boost-GNN). As before, we first apply GBDT and then GNN, but now we optimize both of them, taking into account the quality of final predictions. The training of BGNN is shown in Figure 1. Recall that one cannot tune already built decision trees due to their discrete structure, so we iteratively update the GBDT model by adding new trees that approximate the GNN loss function.
|
| 79 |
+
|
| 80 |
+
In Algorithm 1, we present the training of BGNN that combines GBDT and GNN for any node-level prediction problem such as semi-supervised node regression or classification. In the first iteration, we build a GBDT model $f ^ { 1 } ( \mathbf { x } )$ with $k$ decision trees by minimizing the loss function $L _ { \mathrm { G B D T } } ( f ^ { 1 } ( \mathbf { x } ) , y )$ (e.g., RMSE for regression or cross-entropy for classification) averaged over the train nodes, following the equations (2)-(3). Using all predictions $f ^ { 1 } ( { \mathbf { X } } )$ , we update the node features to $\mathbf { X } ^ { \prime }$ that we pass to GNN. Possible update functions that we experiment with include concatenation with the original node features and their replacement by $f ^ { 1 } ( { \mathbf { X } } )$ . Next, we train a graph neural network $g _ { \boldsymbol { \theta } }$ on a graph $G$ with node features $\mathbf { X } ^ { \prime }$ by minimizing $L _ { \mathrm { G N N } } ( g _ { \boldsymbol { \theta } } ( G , \mathbf { X } ^ { \prime } ) , Y )$ with $l$ steps of gradient descent.1 Importantly, we optimize both the parameters $\theta$ of GNN and the node features $\mathbf { X } ^ { \prime }$ . Then, we use the difference between the optimized node features $\mathbf { X } _ { n e w } ^ { \prime }$ and the input node features $\mathbf { X } ^ { \prime } = f ^ { 1 } ( \mathbf { X } )$ as the target for the next decision trees built by GBDT. If $l = 1$ , the difference $\mathbf { X } _ { n e w } ^ { \prime } - \mathbf { X } ^ { \prime }$ exactly equals the negative gradient of the loss function w.r.t. the input features $\mathbf { X } ^ { \prime }$ multiplied by the learning rate $\eta$ :
|
| 81 |
+
|
| 82 |
+
$$
|
| 83 |
+
{ \bf { X } } _ { n e w } ^ { \prime } = { \bf { X } } ^ { \prime } - \eta \frac { { \partial { L _ { \mathrm { { G N N } } } } { \left( { { g \theta \left( { G , { \bf { X } } ^ { \prime } } \right) } , Y } \right) } } } { { \partial { \bf { X } } ^ { \prime } } } .
|
| 84 |
+
$$
|
| 85 |
+
|
| 86 |
+
In the second iteration, we train a new GBDT model $f ^ { 2 }$ with the original input features $\mathbf { X }$ but new target labels: $\mathbf { X } _ { n e w } ^ { \prime } - \mathbf { X } ^ { \prime }$ . Intuitively, $f ^ { 2 }$ fits the direction that would improve GNN prediction based on the first predictions $f ^ { 1 } ( { \mathbf { X } } )$ . In other words, GBDT approximates the gradient steps made by GNN for the node features $\mathbf { X } ^ { \prime }$ . This is a regression problem, so here $L _ { \mathrm { G B D T } }$ is the RMSE loss.
|
| 87 |
+
|
| 88 |
+
After $f ^ { 2 }$ is trained, we combine the predictions $f ( \mathbf { X } ) = f ^ { 1 } ( \mathbf { X } ) + f ^ { 2 } ( \mathbf { X } )$ and pass the obtained values $\mathbf { X } ^ { \prime }$ to GNN as node features. GNN model $g _ { \theta }$ again does $l$ steps of backpropagation and passes the new difference $\mathbf { X } _ { n e w } ^ { \prime } - \mathbf { X } ^ { \prime }$ as a target to the next iteration of GBDT. In total, the model is trained for $N$ epochs and outputs a GBDT model $f : \mathbf { X } \mapsto Y$ and GNN model $g _ { \boldsymbol { \theta } } : ( G , \mathbf { X } ) \mapsto Y$ , which can be used for downstream tasks.
|
| 89 |
+
|
| 90 |
+
Intuitively, BGNN model consists of two consecutive blocks, GBDT and GNN, which are trained end-to-end, and therefore can be interpreted from two angles: GBDT as an embedding layer for GNN or GNN as a parametric loss function for GBDT. In the former case, GBDT transforms the original input features $\mathbf { X }$ to new node features $\mathbf { X } ^ { \prime }$ , which are then passed to GNN. In the latter case, one can see BGNN as a standard gradient boosted training where GNN acts as a complex loss function that depends on the graph topology.
|
| 91 |
+
|
| 92 |
+
# 4 EXPERIMENTS
|
| 93 |
+
|
| 94 |
+
We have performed a comparative evaluation of BGNN and Res-GNN against a wide variety of strong baselines and previous approaches on heterogeneous node prediction problems, achieving significant improvement in performance across all of them. This section outlines our experimental setting, the results on node regression and classification problems, and extracted feature representations.
|
| 95 |
+
|
| 96 |
+
In our first experiments, we want to answer two questions:
|
| 97 |
+
|
| 98 |
+
Q1 Does combination of GBDT and GNN lead to better qualitative results in heterogeneous node regression and classification problems?
|
| 99 |
+
Q2 Is the end-to-end training proposed in Algorithm 1 better than a combination of pretrained GBDT with GNN?
|
| 100 |
+
|
| 101 |
+
To answer these questions, we consider several strong baselines among GBDTs, GNNs, and pure neural networks. CatBoost is a recent GBDT implementation (Prokhorenkova et al., 2018) that uses oblivious trees as weak learners. LightGBM is another GBDT model (Ke et al., 2017) that is used extensively in ML competitions. Among GNNs, we tested four state-of-the-art recent models that showed superior performance in node prediction tasks: GAT (Velickovi ˇ c et al., 2018), ´ GCN (Kipf & Welling, 2017), AGNN (Thekumparampil et al., 2018), APPNP (Klicpera et al., 2019). Additionally, we test the performance of fully-connected neural network FCNN and its end-to-end combination with GNNs, FCNN-GNN.
|
| 102 |
+
|
| 103 |
+
We compare these baselines against two proposed approaches: the end-to-end BGNN model and not end-to-end Res-GNN. The BGNN model follows Algorithm 1 and builds each tree approximating the GNN error in the previous iteration. In contrast, Res-GNN first trains a GBDT model on the training set of nodes and then either appends its predictions for all nodes to the original node features or replaces the original features with the GBDT predictions, after which GNN is trained on the updated features, and GNN’s predictions are used to calculate metrics. Hence, Res-GNN is a twostage approach where the training of GBDT is independent of GNN. On the other hand, BGNN trains GBDT and GNN simultaneously in an end-to-end fashion. In most of our experiments, the GNN-component of FCNN-GNN, Res-GNN, and BGNN is based on GAT, while in Section 4.3 we analyze consistency of improvements across different GNN models.
|
| 104 |
+
|
| 105 |
+
We ensure that the comparison is done fairly by training each model until the convergence with a reasonable set of hyperparameters evaluated on the validation set. We run each hyperparameter setting three times and take the average of the results. Furthermore, we have five random splits of the data, and the final number represents the average performance of the model for all five random seeds. More details about hyperparameters can be found in Appendix B.
|
| 106 |
+
|
| 107 |
+
# 4.1 NODE REGRESSION
|
| 108 |
+
|
| 109 |
+
# 4.1.1 DATASETS
|
| 110 |
+
|
| 111 |
+
We utilize five real-world node regression datasets with different properties outlined in Table 1. Four of these datasets are heterogeneous, i.e., the input features are of different types, scales, and meaning. For example, for the VK dataset, the node features are both numerical (e.g., last time seen on the platform) and categorical (e.g., country of living and university). On the other hand, Wiki dataset is homogeneous, i.e., the node features are interdependent and correspond to the bag-ofwords representations of Wikipedia articles. Additional details about the datasets can be found in Appendix C.
|
| 112 |
+
|
| 113 |
+
Table 1: Summary of regression datasets.
|
| 114 |
+
|
| 115 |
+
<table><tr><td></td><td>House</td><td>County</td><td>VK</td><td>Avazu</td><td>Wiki</td></tr><tr><td>Setting</td><td>Heterogeneous</td><td>Heterogeneous</td><td>Heterogeneous</td><td>Heterogeneous</td><td>Homogeneous</td></tr><tr><td>#Nodes</td><td>20640</td><td>3217</td><td>54028</td><td>1297</td><td>5201</td></tr><tr><td>#Edges</td><td>182146</td><td>12684</td><td>213644</td><td>54364</td><td>198493</td></tr><tr><td>#Features/Node</td><td>6</td><td>7</td><td>14</td><td>9</td><td>3148</td></tr><tr><td>Mean Target</td><td>2.06</td><td>5.44</td><td>35.47</td><td>0.08</td><td>27923.86</td></tr><tr><td>Min Target</td><td>0.14</td><td>1.7</td><td>13.48</td><td>0</td><td>16</td></tr><tr><td>Max Target</td><td>5.00</td><td>24.1</td><td>118.39</td><td>1</td><td>849131</td></tr><tr><td>Median Target</td><td>1.79</td><td>5</td><td>33.83</td><td>0</td><td>9225</td></tr></table>
|
| 116 |
+
|
| 117 |
+
# 4.1.2 RESULTS
|
| 118 |
+
|
| 119 |
+
The results of our comparative evaluation for node regression are summarized in Table 2. We report the mean RMSE (with standard deviation) on the test set and the relative gap between RMSE of the GAT model (Velickovi ˇ c et al., 2018) and other methods, i.e., ´ ${ \mathrm { g a p } } = ( r _ { m } - r _ { g n n } ) / r _ { g n n }$ , where $r _ { m }$ and $r _ { g n n }$ are RMSE of that model and of GAT, respectively.
|
| 120 |
+
|
| 121 |
+
Our results demonstrate significant improvement of BGNN over the baselines. In particular, in the heterogeneous case, BGNN achieves $8 \%$ , $14 \%$ , $4 \%$ , and $4 \%$ reduction of the error for House, County, VK, and Avazu datasets, respectively. Res-GNN model that uses a pretrained CatBoost model for the input of GNN also decreases RMSE, although not as much as the end-to-end model
|
| 122 |
+
|
| 123 |
+
Table 2: Summary of our results for node regression. Gap $\%$ is relative difference w.r.t. GAT RMSE (the smaller the better). Top-2 results are highlighted in bold.
|
| 124 |
+
|
| 125 |
+
<table><tr><td colspan="2"></td><td colspan="6">Heterogeneous</td><td colspan="3">Homogeneous</td></tr><tr><td colspan="2"></td><td colspan="2">House</td><td colspan="2">County</td><td colspan="2">VK Gap%</td><td colspan="2">Avazu</td><td colspan="2">Wiki Gap%</td></tr><tr><td>Method</td><td></td><td>RMSE</td><td>Gap%</td><td>RMSE</td><td>Gap %</td><td>RMSE</td><td></td><td>RMSE</td><td>Gap %</td><td>RMSE</td></tr><tr><td>GEPT</td><td>CatBoost LightGBM</td><td>0.63 ± 0.01</td><td>15.3</td><td>1.39 ± 0.07</td><td>-4.32</td><td>7.16 ± 0.20 7.2 ± 0.21</td><td>-0.82 -0.33</td><td>0.1172 ± 0.02</td><td>3.36 46359 ± 4508</td><td>0.97</td></tr><tr><td></td><td></td><td>0.63 ± 0.01</td><td>15.98</td><td>1.4 ± 0.07</td><td>-3.93</td><td></td><td>0.1171 ± 0.02</td><td>3.27</td><td>49915 ± 3643</td><td>8.71</td></tr><tr><td>GAT</td><td></td><td>0.54± 0.01</td><td>0</td><td>1.45 ± 0.06</td><td>0</td><td>7.22 ± 0.19</td><td>0 0.1134 ± 0.01</td><td>0</td><td>45916 ± 4527</td><td>0</td></tr><tr><td>NNO</td><td>GCN</td><td>0.63 ± 0.01</td><td>16.77</td><td>1.48 ± 0.08</td><td>2.06</td><td>7.25 ± 0.19</td><td>0.34 0.1141 ± 0.02</td><td>0.58</td><td>44936 ± 4083</td><td>-2.14</td></tr><tr><td></td><td>AGNN</td><td>0.59 ± 0.01</td><td>8.01</td><td>1.45 ± 0.08</td><td>-0.19 7.26 ± 0.20</td><td>0.54</td><td>0.1134 ± 0.02</td><td>-0.02</td><td>45982 ± 3058</td><td>0.14</td></tr><tr><td>APPNP</td><td></td><td>0.69 ± 0.01</td><td>27.11</td><td>1.5 ± 0.11</td><td>3.39 13.23 ± 0.12</td><td>83.19</td><td>0.1127 ± 0.01</td><td>-0.65</td><td>53426 ± 4159</td><td>16.36</td></tr><tr><td>M</td><td>FCNN</td><td>0.68 ±0.02</td><td>25.49</td><td>1.48 ± 0.07</td><td>1.56</td><td>7.29 ± 0.21</td><td>1.02 0.118 ± 0.02</td><td>4.07</td><td>51662± 2983</td><td>12.51</td></tr><tr><td></td><td>FCNN-GNN</td><td>0.53 ± 0.01</td><td>-2.48</td><td>1.39 ± 0.06</td><td>-4.68</td><td>7.22 ± 0.20</td><td>0.01 0.1114 ± 0.02</td><td>-1.82</td><td>48491± 7889</td><td>5.61</td></tr><tr><td></td><td>Res-GNN</td><td>0.51 ± 0.01</td><td>-6.39</td><td>1.33 ± 0.08</td><td>-8.35</td><td>7.07 ± 0.20 -2.04</td><td>0.1095 ± 0.01</td><td>-3.42</td><td>46747 ± 4639</td><td>1.81</td></tr><tr><td></td><td>BGNN</td><td>0.5 ± 0.01</td><td>-8.15</td><td>1.26 ± 0.08</td><td>-13.67</td><td>6.95 ± 0.21</td><td>-3.8 0.109 ± 0.01</td><td>-3.9</td><td>49222 ± 3743</td><td>7.2</td></tr></table>
|
| 126 |
+
|
| 127 |
+
BGNN. In the homogeneous dataset Wiki, CatBoost and, subsequently, Res-GNN and BGNN are outperformed by the GNN model. Intuitively, when the features are homogeneous, neural network approaches are sufficient to attain the best results. This shows that BGNN leads to better qualitative results and its end-to-end training outperforms other approaches in node prediction tasks for graphs with heterogeneous tabular data.
|
| 128 |
+
|
| 129 |
+
We can also observe that the end-to-end combination FCNN-GNN often leads to better performance than pure GNN. However, its improvement is smaller than for BGNN which uses the advantages of GBDT models. Moreover, CatBoost and LightGBM can be effective on their own, but their performance is not stable across all datasets. Overall, these experiments demonstrate the superiority of BGNN against other strong models.
|
| 130 |
+
|
| 131 |
+
# 4.2 NODE CLASSIFICATION
|
| 132 |
+
|
| 133 |
+
For node classification, we use five datasets with different properties. Due to the lack of publicly available datasets with heterogeneous node features, we adopt the datasets House class and VK class from the regression task by converting the target labels into several discrete classes. We additionally include two sparse node classification datasets SLAP and DBLP coming from heterogeneous information networks (HIN) with nodes having different types. We also include one homogeneous dataset OGB-ArXiv (Hu et al., 2020a). In this dataset, the node features correspond to a 128-dimensional feature vector obtained by averaging the embeddings of words in the title and abstract. Hence, the features are not heterogeneous, and therefore GBDT is not expected to outperform neural network approaches. More details about these datasets can be found in Appendix D.
|
| 134 |
+
|
| 135 |
+
Table 3: Summary of our results for node classification. Gap $\%$ is the relative difference w.r.t. GAT accuracy (the higher the better). Top-2 results are highlighted in bold.
|
| 136 |
+
|
| 137 |
+
<table><tr><td colspan="2"></td><td colspan="6">Heterogeneous</td><td colspan="3">Homogeneous</td></tr><tr><td colspan="2">Method</td><td colspan="2">House_class</td><td colspan="2">VK_class</td><td colspan="2">Slap Acc.</td><td colspan="2">DBLP Acc.</td><td colspan="2">OGB-ArXiv Acc. Gap%</td></tr><tr><td colspan="2">CatBoost</td><td>Acc.</td><td>Gap %</td><td>Acc.</td><td>Gap % -1.26</td><td>0.922 ± 0.01</td><td>Gap % 15.12</td><td></td><td>Gap% -5.42</td><td></td><td>-36.35</td></tr><tr><td colspan="2">GERI</td><td>0.52 ± 0.01 0.55 ± 0.00</td><td>-16.82 -11.98</td><td>0.57± 0.01 0.579 ± 0.01</td><td>0.26</td><td>0.963 ± 0.00</td><td>20.3</td><td>0.759 ± 0.03 0.913 ± 0.01</td><td>13.73</td><td>0.45 0.51</td><td>-26.97</td></tr><tr><td rowspan="4">NNO</td><td>LightGBM</td><td></td><td></td><td></td><td></td><td></td><td></td><td>0.802 ± 0.01</td><td>0</td><td></td><td></td></tr><tr><td>GAT</td><td>0.625 ± 0.00</td><td>0</td><td>0.577 ± 0.00</td><td>0</td><td>0.801 ± 0.01</td><td>0</td><td></td><td></td><td>0.70</td><td>0</td></tr><tr><td>GCN</td><td>0.6±0.00</td><td>-3.98</td><td>0.574± 0.00</td><td>-0.6</td><td>0.878 ± 0.01</td><td>9.72</td><td>0.428 ± 0.04</td><td>-46.6</td><td>-</td><td>-</td></tr><tr><td>AGNN APPNP</td><td>0.614 ± 0.01 0.619 ± 0.00</td><td>-1.73</td><td>0.572 ± 0.00 0.573 ± 0.00</td><td>-0.79 -0.67</td><td>0.892 ± 0.01 0.895 ± 0.01</td><td>11.47 11.79</td><td>0.794 ± 0.01 0.83±0.02</td><td>-1.02 3.47</td><td>=</td><td>-</td></tr><tr><td rowspan="3"></td><td></td><td></td><td>-0.89</td><td></td><td></td><td></td><td></td><td></td><td></td><td>-</td><td>-</td></tr><tr><td>FCNN</td><td>0.534 ± 0.01</td><td>-14.53</td><td>0.567 ± 0.01</td><td>-1.72</td><td>0.759 ±0.04</td><td>-5.24</td><td>0.623 ± 0.02</td><td>-22.3 0.94</td><td>0.50</td><td>-28.91</td></tr><tr><td>FCNN-GNN</td><td>0.64± 0.00</td><td>2.36</td><td>0.589 ± 0.00</td><td>2.13</td><td>0.89 ± 0.01</td><td>11.11</td><td>0.81 ± 0.01</td><td></td><td>0.71</td><td>0.54</td></tr><tr><td rowspan="2"></td><td>Res-GNN</td><td>0.625 ± 0.01</td><td>-0.06</td><td>0.603 ± 0.00</td><td>4.45</td><td>0.905 ± 0.01</td><td>13.06</td><td>0.892 ± 0.01</td><td>11.11</td><td>0.70</td><td>-0.33</td></tr><tr><td>BGNN</td><td>0.682 ± 0.00</td><td>9.18</td><td>0.683 ± 0.00</td><td>18.3</td><td>0.95 ± 0.00</td><td>18.61</td><td>0.889 ± 0.01</td><td>10.77</td><td>0.67</td><td>-4.36</td></tr></table>
|
| 138 |
+
|
| 139 |
+
As can be seen from Table 3, on the datasets with heterogeneous tabular features (House class and VK class), BGNN outperforms other approaches with a significant margin. For example, for the
|
| 140 |
+
|
| 141 |
+
VK class dataset BGNN achieves more than $18 \%$ of relative increase in accuracy. This demonstrates that learned representations of GBDT together with GNN can be equally useful for node classification setting on data with heterogeneous features.
|
| 142 |
+
|
| 143 |
+
The other two datasets, Slap and DBLP, have sparse bag-of-words features that are particularly challenging for the GNN model. On these two datasets, GBDT is the strongest baseline. Moreover, since FCNN outperforms GNN, we conclude that graph structure does not help, hence BGNN is not supposed to beat GBDT. This is indeed the case: the final accuracy of BGNN is slightly worse than that of GBDT.
|
| 144 |
+
|
| 145 |
+
In the homogeneous OGB-ArXiv dataset, FCNN-GNN and GNN achieve the top performance followed by Res-GNN and BGNN models.2 In a nutshell, GBDT does not learn good predictions on the homogeneous input features and therefore reduces the discriminative power of GNN. Both cases, with sparse and with homogeneous features, show that the performance of BGNN is on par or higher than of GNN; however, lacking heterogeneous structure in the data may make the joint training of GBDT and GNN redundant.
|
| 146 |
+
|
| 147 |
+
# 4.3 CONSISTENCY ACROSS DIFFERENT GNN MODELS
|
| 148 |
+
|
| 149 |
+
Seeing that our models perform significantly better than strong baselines on various datasets, we want to test whether the improvement is consistent if different GNN models are used. Thus, we ask:
|
| 150 |
+
|
| 151 |
+
Q3 Do different GNN models benefit from our approach of combination with GBDT?
|
| 152 |
+
|
| 153 |
+
To answer this question, we compare GNN models that include GAT (Velickovi ˇ c et al., 2018), ´ GCN (Kipf & Welling, 2017), AGNN (Thekumparampil et al., 2018), and APPNP (Klicpera et al., 2019). We substitute each of these models to Res-GNN and BGNN and measure the relative change in performance with respect to the original GNN’s performance.
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Figure 2: Relative difference for Res-GNN (yellow, diagonal) and BGNN (red, squared) for different GNN architectures w.r.t. GNN RMSE (the smaller the better).
|
| 157 |
+
|
| 158 |
+
In Figure 2 we report the relative RMSE gap between Res-GNN and BGNN for each of the GNN architectures, i.e., we compute $g a p = ( r _ { m } - r _ { g n n } ) / r _ { g n n }$ , where $r _ { m }$ and $r _ { g n n }$ are RMSE of that model and of GNN respectively. This experiment positively answers Q3 and shows that all tested GNN architectures significantly benefit from the proposed approach. For example, for House dataset the decrease in the mean squared error is $9 \%$ , $18 \%$ , $19 \%$ , and $17 \%$ for GAT, GCN, AGNN, and APPNP models respectively. Additionally, one can see that the end-to-end training of BGNN (red, squared) leads to larger improvements than a na¨ıve combination of CatBoost and GNN in Res-GNN (yellow, diagonal). Exact metrics and training time are in Appendix E.
|
| 159 |
+
|
| 160 |
+
# 4.4 TRAINING TIME
|
| 161 |
+
|
| 162 |
+
As the previous experiments demonstrated superior quality across various datasets and GNN models, it is important to understand if the additional GBDT part can become a bottleneck in terms of efficiency for training this model on real-world datasets. Hence, we ask:
|
| 163 |
+
|
| 164 |
+
To answer this question, we measure the clock time to train each model until convergence, considering early stopping. Table 4 presents training time for each model. We can see that both BGNN and Res-GNN run faster than GNN in most cases. In other words, BGNN and Res-GNN models do not incur an increase in training time but actually are more efficient than GNN. For example, for VK dataset BGNN and Res-GNN run $3 \mathbf { x }$ and $2 \mathbf { x }$ faster than GNN, respectively. Moreover, BGNN is consistently faster than another end-to-end implementation FCNN-GNN that uses FCNN instead of CatBoost to preprocess the original input features.
|
| 165 |
+
|
| 166 |
+
Table 4: Training time (s) in node regression task.
|
| 167 |
+
|
| 168 |
+
<table><tr><td>Method</td><td></td><td>House</td><td>County</td><td>VK</td><td>Wiki</td><td>Avazu</td></tr><tr><td rowspan="2">GETT</td><td>CatBoost</td><td>4±1</td><td>2±1</td><td>24±4</td><td>10±1</td><td>2±2</td></tr><tr><td>LightGBM</td><td>3±0</td><td>1±0</td><td>5±3</td><td>3±2</td><td>0±0</td></tr><tr><td rowspan="4"></td><td>GAT GCN</td><td>35±2</td><td>19±6</td><td>42±4</td><td>15±1</td><td>9±2</td></tr><tr><td></td><td>28±0</td><td>18±7</td><td>38±0</td><td>13±3</td><td>12±6</td></tr><tr><td>AGNN</td><td>38±5</td><td>28±3</td><td>48±3</td><td>19±5</td><td>14±8</td></tr><tr><td>APPNP</td><td>68±1</td><td>34±10</td><td>81±3</td><td>49± 26</td><td>24±15</td></tr><tr><td rowspan="2">M</td><td>FCNN FCNN-GNN</td><td>16±5</td><td>2±1</td><td>109 ± 35</td><td>12±2</td><td>2±0</td></tr><tr><td></td><td>39±1</td><td>21±6</td><td>48±2</td><td>16±1</td><td>14±3</td></tr><tr><td rowspan="2"></td><td>Res-GNN</td><td>36±7</td><td>7±3</td><td>41±7</td><td>31±9</td><td>7±2</td></tr><tr><td>BGNN</td><td>20±4</td><td>2±0</td><td>16±0</td><td>21±7</td><td>5±1</td></tr></table>
|
| 169 |
+
|
| 170 |
+
The reason for improved efficiency is that BGNN and Res-GNN converge with a much fewer number of iterations as demonstrated in Figure 3. We plot RMSE on the test set during training for all models (with winning hyperparameters). We can see that BGNN converges within the first ten iterations (for $k = 2 0$ ), leading to fast training. In contrast, Res-GNN is similar in terms of convergence to GNN for the first 100 epochs, but then it continues decreasing RMSE unlike GNN that requires much more epochs to converge. This behavior is similar for other datasets (see Appendix F).
|
| 171 |
+
|
| 172 |
+

|
| 173 |
+
Figure 3: RMSE on the test set during training for two node regression datasets.
|
| 174 |
+
|
| 175 |
+
# 4.5 VISUALIZING PREDICTIONS
|
| 176 |
+
|
| 177 |
+
To investigate the performance of BGNN, we plot the final predictions of trained models for observations in the training set. Our motivation is to scrutinize which points are correctly classified by different models. Figure 4 displays the predictions of GBDT, GNN, Res-GNN, and BGNN models as well as the true target value. To better understand the predictions of the BGNN model, in Figure 4(e) we show the values predicted by GBDT that was trained as a part of BGNN. This experiment is performed on House dataset, the plots for other datasets show similar trends and can be found in the supplementary materials.
|
| 178 |
+
|
| 179 |
+
Several observations can be drawn from these figures. First, the true target values change quite smoothly within local neighborhoods; however, there are a few outliers: single red points among many blue points and conversely. These points can mislead the model during the training, predicting the wrong target value for many observations in the outliers’ local neighborhoods. Hence, it is important for a model to make smoothed predictions in the local neighborhoods.
|
| 180 |
+
|
| 181 |
+

|
| 182 |
+
Figure 4: House dataset. True labels and predictions by trained GBDT, GNN, Res-GNN, and BGNN models (training points only). Point coordinates correspond to BGNN learned representations in the first hidden layer. Color represents the final predictions made by each model.
|
| 183 |
+
|
| 184 |
+
Second, comparing the prediction spaces of GBDT, GNN, Res-GNN, and BGNN models we can observe that predictions for GBDT are much more grainy with large variations in the neighborhoods of the vertices (high quality images can be found in the supplementary materials). Intuitively, because the GBDT model does not have access to the graph structure, it cannot propagate its predictions in the nodes’ vicinity. Alternatively, GNN, Res-GNN, and BGNN can extrapolate the outputs among local neighbors, smoothing out the final predictions as seen in Figures 4(c), 4(d), 4(f).
|
| 185 |
+
|
| 186 |
+
Third, focusing on the values of predictions (color bars on the right of each plot) of GBDT, GNN, and BGNN models we notice that the scale of final predictions for GBDT and BGNN models is closely aligned with the true predictions, while GNN’s predictions mismatch the true values by large margin. Our intuition is that the expressive power of GBDT to learn piecewise decision boundaries common in tabular datasets helps GBDT and BGNN to properly tune its final predictions with respect to the true range of values. In contrast, GNN relies solely on neural layers to learn complex decision rules.
|
| 187 |
+
|
| 188 |
+
Another observation comes from looking at the values predicted by GBDT trained as a part of BGNN (see Figure 4(e)). While this GBDT model is initialized using the true target labels, it was not forced to predict the target during the training. Interestingly, this model shows the same trend and clearly captures the regions on high/low target values. On the other hand, GBDT trained as a part of BGNN is much more conservative: on all datasets, the range of predicted values is significantly smaller than the true one. We hypothesize that GBDT is trained to scale its predictions to make them more suitable for further improvements by GNN.
|
| 189 |
+
|
| 190 |
+
# 5 CONCLUSION
|
| 191 |
+
|
| 192 |
+
We have presented BGNN, a novel architecture for learning on graphs with heterogeneous tabular node features. BGNN takes advantages of the GBDT model to build hyperplane decision boundaries that are common for heterogeneous data, and then utilizes GNN to refine the predictions using relational information. Our approach is end-to-end and can be incorporated with any message-passing neural network and gradient boosting method. Extensive experiments demonstrate that the proposed architecture is superior to strong existing competitors in terms of accuracy of predictions and training time. A possible direction for future research is to analyze whether this approach is profitable for graph-level predictions such as graph classification or subgraph detection.
|
| 193 |
+
|
| 194 |
+
# ACKNOWLEDGMENTS
|
| 195 |
+
|
| 196 |
+
The authors thank the Anonymous Reviewers for their reviews and Anton Tsitsulin for kindly sharing VK data. Liudmila Prokhorenkova also acknowledge the financial support from the Ministry of Education and Science of the Russian Federation in the framework of MegaGrant 075-15-2019-1926 and from the Russian President grant supporting leading scientific schools of the Russian Federation NSh-2540.2020.1.
|
| 197 |
+
|
| 198 |
+
# REFERENCES
|
| 199 |
+
|
| 200 |
+
Sercan O Arik and Tomas Pfister. Tabnet: Attentive interpretable tabular learning. arXiv preprint arXiv:1908.07442, 2020.
|
| 201 |
+
|
| 202 |
+
Sarkhan Badirli, Xuanqing Liu, Zhengming Xing, Avradeep Bhowmik, and Sathiya S Keerthi. Gradient boosting neural networks: Grownet. arXiv preprint arXiv:2002.07971, 2020.
|
| 203 |
+
|
| 204 |
+
Peter W Battaglia, Jessica B Hamrick, Victor Bapst, Alvaro Sanchez-Gonzalez, Vinicius Zambaldi, Mateusz Malinowski, Andrea Tacchetti, David Raposo, Adam Santoro, Ryan Faulkner, et al. Relational inductive biases, deep learning, and graph networks. arXiv preprint arXiv:1806.01261, 2018.
|
| 205 |
+
|
| 206 |
+
Candice Bentejac, Anna Cs ´ org ¨ o, and Gonzalo Mart ˝ ´ınez-Munoz. A comparative analysis of gradient ˜ boosting algorithms. Artificial Intelligence Review, pp. 1–31, 2020.
|
| 207 |
+
|
| 208 |
+
Sergio Casas, Cole Gulino, Renjie Liao, and Raquel Urtasun. Spatially-aware graph neural networks for relational behavior forecasting from sensor data. arXiv preprint arXiv:1910.08233, 2019.
|
| 209 |
+
|
| 210 |
+
Djork-Arne Clevert, Thomas Unterthiner, and Sepp Hochreiter. Fast and accurate deep network learning by exponential linear units (elus). In 4th International Conference on Learning Representations, 2016.
|
| 211 |
+
|
| 212 |
+
Ji Feng, Yang Yu, and Zhi-Hua Zhou. Multi-layered gradient boosting decision trees. In Advances in neural information processing systems, pp. 3551–3561, 2018.
|
| 213 |
+
|
| 214 |
+
Matthias Fey and Jan Eric Lenssen. Fast graph representation learning with pytorch geometric. arXiv preprint arXiv:1903.02428, 2019.
|
| 215 |
+
|
| 216 |
+
Matthias Fey, Jan E Lenssen, Christopher Morris, Jonathan Masci, and Nils M Kriege. Deep graph matching consensus. In International Conference on Learning Representations, 2019.
|
| 217 |
+
|
| 218 |
+
Jerome H Friedman. Greedy function approximation: a gradient boosting machine. Annals of statistics, pp. 1189–1232, 2001.
|
| 219 |
+
|
| 220 |
+
Hussein Hazimeh, Natalia Ponomareva, Petros Mol, Zhenyu Tan, and Rahul Mazumder. The tree ensemble layer: Differentiability meets conditional computation. In 37th International Conference on Machine Learning (ICML 2020), 2020.
|
| 221 |
+
|
| 222 |
+
Weihua Hu, Matthias Fey, Marinka Zitnik, Yuxiao Dong, Hongyu Ren, Bowen Liu, Michele Catasta, and Jure Leskovec. Open graph benchmark: Datasets for machine learning on graphs. In Conference on Neural Information Processing Systems, 2020a.
|
| 223 |
+
|
| 224 |
+
Weihua Hu, Bowen Liu, Joseph Gomes, Marinka Zitnik, Percy Liang, Vijay Pande, and Jure Leskovec. Strategies for pre-training graph neural networks. In International Conference on Learning Representations, 2020b.
|
| 225 |
+
|
| 226 |
+
Junteng Jia and Austin Benson. Outcome correlation in graph neural network regression. arXiv preprint arXiv:2002.08274, 2020.
|
| 227 |
+
|
| 228 |
+
Harmanpreet Kaur, Harsha Nori, Samuel Jenkins, Rich Caruana, Hanna Wallach, and Jennifer Wortman Vaughan. Interpreting interpretability: Understanding data scientists’ use of interpretability tools for machine learning. In Proceedings of the 2020 CHI Conference on Human Factors in Computing Systems, 2020.
|
| 229 |
+
|
| 230 |
+
Guolin Ke, Qi Meng, Thomas Finley, Taifeng Wang, Wei Chen, Weidong Ma, Qiwei Ye, and TieYan Liu. Lightgbm: A highly efficient gradient boosting decision tree. In Advances in Neural Information Processing Systems 30. 2017.
|
| 231 |
+
|
| 232 |
+
Nicolas Keriven and Gabriel Peyre. Universal invariant and equivariant graph neural networks. In ´ Advances in Neural Information Processing Systems, pp. 7092–7101, 2019.
|
| 233 |
+
|
| 234 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In International Conference on Learning Representations, 2017.
|
| 235 |
+
|
| 236 |
+
Johannes Klicpera, Aleksandar Bojchevski, and Stephan Gunnemann. Predict then propagate: ¨ Graph neural networks meet personalized pagerank. In International Conference on Learning Representations, 2019.
|
| 237 |
+
|
| 238 |
+
Pan Li, Zhen Qin, Xuanhui Wang, and Donald Metzler. Combining decision trees and neural networks for learning-to-rank in personal search. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 2032–2040, 2019.
|
| 239 |
+
|
| 240 |
+
Andreas Loukas. What graph neural networks cannot learn: depth vs width. In International Conference on Learning Representations, 2020.
|
| 241 |
+
|
| 242 |
+
Haggai Maron, Ethan Fetaya, Nimrod Segol, and Yaron Lipman. On the universality of invariant networks. In International conference on machine learning, pp. 4363–4371. PMLR, 2019.
|
| 243 |
+
|
| 244 |
+
Nina Mazyavkina, Sergey Sviridov, Sergei Ivanov, and Evgeny Burnaev. Reinforcement learning for combinatorial optimization: A survey. arXiv preprint arXiv:2003.03600, 2020.
|
| 245 |
+
|
| 246 |
+
R Kelley Pace and Ronald Barry. Sparse spatial autoregressions. Statistics & Probability Letters, 33 (3):291–297, 1997.
|
| 247 |
+
|
| 248 |
+
Ben Peters, Vlad Niculae, and Andre FT Martins. Sparse sequence-to-sequence models. In ´ Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 1504–1519, 2019.
|
| 249 |
+
|
| 250 |
+
Sergei Popov, Stanislav Morozov, and Artem Babenko. Neural oblivious decision ensembles for deep learning on tabular data. In International Conference on Learning Representations, 2019.
|
| 251 |
+
|
| 252 |
+
Liudmila Prokhorenkova, Gleb Gusev, Aleksandr Vorobev, Anna Veronika Dorogush, and Andrey Gulin. Catboost: unbiased boosting with categorical features. In Advances in neural information processing systems, pp. 6638–6648, 2018.
|
| 253 |
+
|
| 254 |
+
Yuxiang Ren, Bo Liu, Chao Huang, Peng Dai, Liefeng Bo, and Jiawei Zhang. Heterogeneous deep graph infomax. arXiv preprint arXiv:1911.08538, 2019.
|
| 255 |
+
|
| 256 |
+
Benedek Rozemberczki, Carl Allen, and Rik Sarkar. Multi-scale attributed node embedding. arXiv preprint arXiv:1909.13021, 2019.
|
| 257 |
+
|
| 258 |
+
Victor Garcia Satorras and Joan Bruna Estrach. Few-shot learning with graph neural networks. In International Conference on Learning Representations, 2018.
|
| 259 |
+
|
| 260 |
+
Weiping Song, Chence Shi, Zhiping Xiao, Zhijian Duan, Yewen Xu, Ming Zhang, and Jian Tang. Autoint: Automatic feature interaction learning via self-attentive neural networks. In Proceedings of the 28th ACM International Conference on Information and Knowledge Management, pp. 1161–1170, 2019.
|
| 261 |
+
|
| 262 |
+
Jonathan M Stokes, Kevin Yang, Kyle Swanson, Wengong Jin, Andres Cubillos-Ruiz, Nina M Donghia, Craig R MacNair, Shawn French, Lindsey A Carfrae, Zohar Bloom-Ackerman, et al. A deep learning approach to antibiotic discovery. Cell, 180(4):688–702, 2020.
|
| 263 |
+
|
| 264 |
+
Jianing Sun, Wei Guo, Dengcheng Zhang, Yingxue Zhang, Florence Regol, Yaochen Hu, Huifeng Guo, Ruiming Tang, Han Yuan, Xiuqiang He, and Mark Coates. A framework for recommending accurate and diverse items using bayesian graph convolutional neural networks. In Proceedings of the 26th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 2030–2039, 2020.
|
| 265 |
+
|
| 266 |
+
Ke Sun, Zhouchen Lin, and Zhanxing Zhu. Adagcn: Adaboosting graph convolutional networks into deep models. arXiv preprint arXiv:1908.05081, 2019.
|
| 267 |
+
|
| 268 |
+
Kiran K Thekumparampil, Chong Wang, Sewoong Oh, and Li-Jia Li. Attention-based graph neural network for semi-supervised learning. arXiv preprint arXiv:1803.03735, 2018.
|
| 269 |
+
|
| 270 |
+
Anton Tsitsulin, Davide Mottin, Panagiotis Karras, and Emmanuel Muller. Verse: Versatile graph ¨ embeddings from similarity measures. In Proceedings of the 2018 World Wide Web Conference, pp. 539–548, 2018.
|
| 271 |
+
|
| 272 |
+
Petar Velickovi ˇ c, Guillem Cucurull, Arantxa Casanova, Adriana Romero, Pietro Li ´ o, and Yoshua \` Bengio. Graph Attention Networks. International Conference on Learning Representations, 2018.
|
| 273 |
+
|
| 274 |
+
Duo Wang, Mateja Jamnik, and Pietro Lio. Abstract diagrammatic reasoning with multiplex graph networks. In International Conference on Learning Representations, 2020.
|
| 275 |
+
|
| 276 |
+
Man Wu, Shirui Pan, Chuan Zhou, Xiaojun Chang, and Xingquan Zhu. Unsupervised domain adaptive graph convolutional networks. In Proceedings of The Web Conference, 2020.
|
| 277 |
+
|
| 278 |
+
Yuxin Xiao, Zecheng Zhang, Carl Yang, and Chengxiang Zhai. Non-local attention learning on large heterogeneous information networks. In 2019 IEEE International Conference on Big Data (Big Data), pp. 978–987. IEEE, 2019.
|
| 279 |
+
|
| 280 |
+
Yongxin Yang, Irene Garcia Morillo, and Timothy M Hospedales. Deep neural decision trees. arXiv preprint arXiv:1806.06988, 2018.
|
| 281 |
+
|
| 282 |
+
Zhi-Hua Zhou and Ji Feng. Deep forest. National Science Review, 6(1):74–86, 2019.
|
| 283 |
+
|
| 284 |
+
# A FURTHER RELATED WORK
|
| 285 |
+
|
| 286 |
+
To the best of our knowledge, there are no approaches combining the benefits of GBDT and GNN models for representation learning on graphs with tabular data. However, there are many attempts to adapt non-graph neural networks for tabular data or to combine them with gradient boosting in different ways.
|
| 287 |
+
|
| 288 |
+
Several works (Popov et al., 2019; Yang et al., 2018; Zhou & Feng, 2019; Feng et al., 2018; Hazimeh et al., 2020) attempt to mitigate the non-differentiable nature of decision trees. For example, Popov et al. (2019) proposed to replace hard choices for tree splitting features and splitting thresholds with their continuous counterparts, using $\alpha$ -entmax transformation (Peters et al., 2019). While such an approach becomes suitable for a union of decision trees with GNN, the computational burden of training both end-to-end becomes a bottleneck for large graphs.
|
| 289 |
+
|
| 290 |
+
Another method (Badirli et al., 2020) uses neural networks as weak learners for the GBDT model. For graph representation problems such as node regression, one can replace standard neural networks with graph neural networks. However, training different GNN as weak classifiers at once would be exhaustive. Additionally, such a combination lacks some advantages of GBDT, like handling heterogeneous and categorical features and missing values. An approach called AdaGCN (Sun et al., 2019) incorporates AdaBoost ideas into the design of GNNs in order to construct deep models. Again, this method does not exploit the advantages of GBDT methods.
|
| 291 |
+
|
| 292 |
+
Finally, Li et al. (2019) investigated different ways of combining decision-tree-based models and neural networks. While the motivation is similar to ours — get the benefits of both types of models — the paper focuses specifically on learning-to-rank problems. Additionally, while some of their methods are similar in spirit to Res-GNN, they do not update GBDT in an end-to-end manner, which is a substantial contribution of the current research.
|
| 293 |
+
|
| 294 |
+
# B HYPERPARAMETERS
|
| 295 |
+
|
| 296 |
+
Parameters in brackets $\{ \}$ are selected by hyperparameter search on the validation set.
|
| 297 |
+
|
| 298 |
+
LightGBM: number of leaves is $\{ 1 5 , 6 3 \}$ , $| | \lambda | | _ { 2 } = 0$ , boosting type is gbdt, number of epochs is 1000, early stopping rounds is 100.
|
| 299 |
+
|
| 300 |
+
CatBoost: depth is $\{ 4 , 6 \} , \lvert \lvert \lambda \rvert \rvert _ { 2 } = 0$ , number of epochs is 1000, early stopping rounds is 100.
|
| 301 |
+
|
| 302 |
+
FCNN: number of layers is $\{ 2 , 3 \}$ , dropout is $\{ 0 . , 0 . 5 \}$ , hidden dimension is 64, number of epochs is 5000, early stopping rounds is 2000.
|
| 303 |
+
|
| 304 |
+
GNN: dropout rate is $\{ 0 . , 0 . 5 \}$ , hidden dimension is 64, number of epochs is 2000, early stopping rounds is 200. GAT, GCN, and AGNN models have two convolutional layers with dropout and ELU activation function (Clevert et al., 2016). APPNP has a two-layer fully-connected neural network with dropout and ELU activation followed by a convolutional layer with $k = 1 0$ and $\alpha = 0 . 1$ . We use eight heads with eight hidden neurons for GAT model.
|
| 305 |
+
|
| 306 |
+
Res-GNN: dropout rate is $\{ 0 . , 0 . 5 \}$ , hidden dimension is 64, number of epochs is 1000, early stopping rounds is 100. We also tune whether to use solely predictions of CatBoost model or append them to the input features. CatBoost model is trained for 1000 epochs.
|
| 307 |
+
|
| 308 |
+
BGNN: dropout rate is $\{ 0 . , 0 . 5 \}$ , hidden dimension is 64, number of epochs is 200, early stopping rounds is 10, number of trees and backward passes per epoch is $\{ 1 0 , 2 0 \}$ , depth of the tree is 6. We also tune whether to use solely predictions of CatBoost model or append them to the input features.
|
| 309 |
+
|
| 310 |
+
For all models, we also perform a hyperparameter search on learning rate in $\{ 0 . 1 , 0 . 0 1 \}$ . Every hyperparameter setting is evaluated three times and an average is taken. We use five random splits for train/validation/test with $0 . 6 / 0 . 2 / 0 . 2$ ratio. The average across five seeds is reported in the tables.
|
| 311 |
+
|
| 312 |
+
# C REGRESSION DATASETS
|
| 313 |
+
|
| 314 |
+
In House dataset (Pace & Barry, 1997), nodes are the properties, edges connect the proximal nodes, and the target is the property’s price. We use the publicly available dataset (Pace & Barry, 1997) of all the block groups in California collected from the 1990 Census. We connect each block with at most five of its nearest neighbors if they lie within a ball of a certain radius, as measured by latitude and longitude. We keep the following node features: MedInc, HouseAge, AveRooms, AveBedrms, Population, AveOccup.
|
| 315 |
+
|
| 316 |
+
County dataset (Jia & Benson, 2020) is a county-level election map network. Each node is a county, and two nodes are connected if they share a border. We consider node features coming from the 2016 year. These features include DEM, GOP, MedianIncome, MigraRate, BirthRate, DeathRate, BachelorRate, UnemploymentRate. We follow the setup of the original paper and select UnemploymentRate as the target label. We filter out all nodes in the original data if they do not have features.
|
| 317 |
+
|
| 318 |
+
VK dataset (Tsitsulin et al., 2018) comes from a popular social network where people are mutually connected based on friendships, and the regression problem is to predict the age of a person. We use an open-access subsample of the VK social network of the first 1M users.3 Then, the dataset has been preprocessed to keep only the users who opt in to share their demographic information and preferences: country, city, has mobile, last seen platform, political, religion id, alcohol, smoking, relation, sex, university.
|
| 319 |
+
|
| 320 |
+
Wiki dataset (Rozemberczki et al., 2019) represents a page-page network on a specific topic (squirrels) with the task of predicting average monthly traffic. The features are bag-of-words for informative nouns (3148 in total) that appeared in the main text of the Wikipedia article. The target is the average monthly traffic between October 2017 and November 2018 for each article.
|
| 321 |
+
|
| 322 |
+
Avazu dataset (Song et al., 2019) represents a device-device network, with two devices being connected if they appear on the same site within the same application. For this dataset, the goal is to predict click-through-rate (CTR) for each device. We take the first 10M rows from the publicly available train log of user clicks.4 We compute CTR for each device id and filter those ids that do not have at least 10 ad displays. We connect two devices if they had ad displays on the same site id from the same application id. The node features are anonymized categories: C1, C14, C15, C16, C17, C18, C19, C20, C21.
|
| 323 |
+
|
| 324 |
+
# D CLASSIFICATION DATASETS
|
| 325 |
+
|
| 326 |
+
For node classification, we consider three types of node features: heterogeneous (VK and House), sparse (Slap and DBLP), and homogeneous (OGB-ArXiv).
|
| 327 |
+
|
| 328 |
+
For House and VK, we transform the original numerical target value with respect to the bin it falls to. More specifically, for VK we consider the classes $< 2 0$ , $2 0 - 2 5 $ , $2 5 - 3 0 , \dots , 4 5 - 5 0 , > 5 0$ for the age attribute. Similarly, for House dataset we replace the target value with the bin it falls to in the range [1, 1.5, 2, 2.5]. Hence, there are 7 and 5 classes for VK and House, respectively.
|
| 329 |
+
|
| 330 |
+
Table 5: Summary of classification datasets.
|
| 331 |
+
|
| 332 |
+
<table><tr><td></td><td>SLAP</td><td>DBLP</td><td>OGB-ArXiv</td></tr><tr><td># Nodes</td><td>20419</td><td>14475</td><td>169343</td></tr><tr><td>#Edges</td><td>172248</td><td>40269</td><td>1166243</td></tr><tr><td>#Features</td><td>2701</td><td>5002</td><td>128</td></tr><tr><td>Classes</td><td>15</td><td>4</td><td>40</td></tr><tr><td>Min Class</td><td>103</td><td>745</td><td>29</td></tr><tr><td>Max Class</td><td>534</td><td>1197</td><td>27321</td></tr></table>
|
| 333 |
+
|
| 334 |
+
For datasets with sparse features, we consider two datasets coming from heterogeneous information networks (HIN), where nodes have a few different types. A common way to represent HIN is through meta-paths, i.e., a collection of all possible paths between nodes of a particular type. For example, for a citation network, one may specify paths of the type paper-author-paper (PAP) and the type papersubject-paper (PSP). Then the original graph is approximated as several adjacency matrices for different types.
|
| 335 |
+
|
| 336 |
+
DBLP dataset (Ren et al., 2019) is a network with three node types (authors, papers, conferences) and four target classes of the authors (database, data mining, information retrieval, and machine learning). To obtain a single graph, we use the adjacency matrix for the relation APA, which closely reflects the relationships between authors. Each author has a bag-of-words representation (300 words) of all the abstracts published by the author. Furthermore, for every node, we compute the degrees for all types of relations and append them as additional node features. Namely, we have two additional node features corresponding to degrees for paper nodes in APA and APCPA adjacency matrices.
|
| 337 |
+
|
| 338 |
+
SLAP dataset (Xiao et al., 2019) is a multiple-hub network in bioinformatics that contains node types such as chemical compound, gene, disease, pathway, etc. The goal is to predict one of 15 gene types. To obtain a single graph, we use the adjacency matrix for the relation GG between genes. Each gene has 3000 features that correspond to the extracted gene ontology terms (GO terms). As for DBLP, we compute the degrees for all types of relations and append them as additional node features.
|
| 339 |
+
|
| 340 |
+
As a dataset with homogeneous node features we consider OGB-ArXiv (Hu et al., 2020a). The node features correspond to a 128-dimensional feature vector obtained by averaging the embeddings of words in the title and abstract. Note that for this particular dataset we used the implementation of $\mathrm { G A T } ^ { 5 }$ as a backbone architecture for GNN, Res-GNN, and BGNN models. This model scored the top place on the leaderboard.6 A summary of statistics for all datasets is outlined in Table 5.
|
| 341 |
+
|
| 342 |
+
# E COMPARISON OF GNN MODELS
|
| 343 |
+
|
| 344 |
+
In this section, we show the exact RMSE values and time for all tested GNN models on all regression datasets. We consider several state-of-the-art GNN models that include GAT (Velickovi ˇ c et al., 2018), ´ GCN (Kipf & Welling, 2017), AGNN (Thekumparampil et al., 2018), and APPNP (Klicpera et al., 2019).
|
| 345 |
+
|
| 346 |
+
Table 6 demonstrates that for all considered models BGNN and Res-GNN achieve significant increase in performance compared to vanilla GNN. Additionally, end-to-end training of BGNN achieves typically better results than a straightforward implementation of Res-GNN.
|
| 347 |
+
|
| 348 |
+
Table 6: Summary of our results for different GNN architectures for node regression.
|
| 349 |
+
|
| 350 |
+
<table><tr><td rowspan="2"></td><td rowspan="2">Method</td><td colspan="2">House</td><td colspan="2">County</td><td colspan="2">VK</td><td colspan="2">Wiki</td><td colspan="2">Avazu</td></tr><tr><td>RMSE</td><td>Time (s)</td><td>RMSE</td><td>Time (s)</td><td>RMSE</td><td>Time (s)</td><td>RMSE</td><td>Time (s)</td><td>RMSE</td><td>Time (s)</td></tr><tr><td rowspan="2">5</td><td>GNN</td><td>0.54± 0.01</td><td>35±2</td><td>1.45 ± 0.06</td><td>19±6</td><td>7.22 ± 0.19</td><td>42±4</td><td>45916±4527</td><td>15±1</td><td>0.113 ± 0.01</td><td>9±2</td></tr><tr><td>Res-GNN</td><td>0.51 ± 0.01</td><td>36±7</td><td>1.33 ± 0.08</td><td>7±3</td><td>7.07 ± 0.20</td><td>41±7</td><td>46747 ± 4639</td><td>31±9</td><td>0.109 ± 0.01</td><td>7±2</td></tr><tr><td rowspan="3"></td><td>BGNN</td><td>0.5±0.01</td><td>20±4</td><td>1.26 ± 0.08</td><td>2±0</td><td>6.95 ± 0.21</td><td>16±0</td><td>49222 ± 3743</td><td>21±7</td><td>0.109 ± 0.01</td><td>5±1</td></tr><tr><td>GNN</td><td>0.63 ± 0.01</td><td>28±0</td><td>1.48 ± 0.08</td><td>18±7</td><td>7.25 ± 0.19</td><td>38±0</td><td>44936 ± 4083</td><td>13±3</td><td>0.114 ± 0.02</td><td>12±6</td></tr><tr><td>Res-GNN</td><td>0.59 ± 0.01</td><td>25±2</td><td>1.35 ± 0.09</td><td>11 ±5</td><td>7.03±0.20</td><td>52±6</td><td>44876± 3777</td><td>21±5</td><td>0.111 ± 0.02</td><td>9±6</td></tr><tr><td rowspan="3"></td><td>BGNN</td><td>0.54 ± 0.01</td><td>41 ±15</td><td>1.33 ± 0.13</td><td>12 ±8</td><td>7.12 ±0.21</td><td>76±6</td><td>47426 ± 4112</td><td>22±11</td><td>0.107 ± 0.01</td><td>4±1</td></tr><tr><td>GNN</td><td>0.59 ± 0.01</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>Res-GNN</td><td>0.52 ±0.01</td><td>38±5 33±4</td><td>1.45 ± 0.08 1.3 ± 0.07</td><td>28±3 16±4</td><td>7.26±0.20 7.08±0.20</td><td>48±3 51±15</td><td>45982 ± 3058 46010 ± 2355</td><td>19±5 24±3</td><td>0.113 ± 0.02 0.111 ± 0.02</td><td>14±8 7±2</td></tr><tr><td rowspan="2">ANNN</td><td>BGNN</td><td>0.49 ± 0.01</td><td>34±4</td><td>1.28 ± 0.08</td><td>3±1</td><td>6.89 ± 0.21</td><td>25±4</td><td>53080 ± 5117</td><td>47±37</td><td>0.108 ± 0.02</td><td>5±1</td></tr><tr><td>GNN</td><td>0.69 ± 0.01</td><td>68±1</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td rowspan="2">JNPPA</td><td>Res-GNN</td><td>0.67 ± 0.01</td><td>58±12</td><td>1.5 ± 0.11 1.41 ± 0.12</td><td>34±10 19 ±10</td><td>13.23 ± 0.12</td><td>81±3 76±11</td><td>53426±4159</td><td>49±26</td><td>0.113 ± 0.01</td><td>24±15</td></tr><tr><td>BGNN</td><td>0.59 ± 0.01</td><td>21±7</td><td>1.33 ± 0.10</td><td>17±6</td><td>13.06 ± 0.17 12.36 ± 0.14</td><td>50±6</td><td>53206±4593 54359±4734</td><td>66±27 30±13</td><td>0.110 ± 0.01 0.108 ± 0.01</td><td>15±10 6±1</td></tr></table>
|
| 351 |
+
|
| 352 |
+
# F LOSS CONVERGENCE
|
| 353 |
+
|
| 354 |
+
In Figure 5, we plot RMSE on the test set during training for the remaining datasets — County, Wiki, and Avazu. These results confirm that BGNN converges to its optimal value within the first ten iterations (for $k = 2 0$ ). Note that on the Wiki dataset, similarly to Figure 3, Res-GNN convergence is similar to GNN for the first 100 iterations and then the loss of Res-GNN decreases faster than of GNN.
|
| 355 |
+
|
| 356 |
+

|
| 357 |
+
Figure 5: Summary of RMSE of test set during training for node regression datasets.
|
md/train/hu2aMLzOxC/hu2aMLzOxC.md
ADDED
|
@@ -0,0 +1,270 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# ASYMMETRIC SELF-PLAY FOR AUTOMATIC GOAL DIS-COVERY IN ROBOTIC MANIPULATION
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
We train a single, goal-conditioned policy that can solve many robotic manipulation tasks, including tasks with previously unseen goals and objects. We rely on asymmetric self-play for goal discovery, where two agents, Alice and Bob, play a game. Alice is asked to propose challenging goals and Bob aims to solve them. We show that this method can discover highly diverse and complex goals without any human priors. Bob can be trained with only sparse rewards, because the interaction between Alice and Bob results in a natural curriculum and Bob can learn from Alice’s trajectory when relabeled as a goal-conditioned demonstration. Finally, our method scales, resulting in a single policy that can generalize to many unseen tasks such as setting a table, stacking blocks, and solving simple puzzles. Videos of a learned policy is available at https://robotics-self-play.github.io.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
We are motivated to train a single goal-conditioned policy $( \mathbf { | K a e l b l i n g right| } , \mathbf { | 9 9 3 | } )$ that can solve any robotic manipulation task that a human may request in a given environment. In this work, we make progress towards this goal by solving a robotic manipulation problem in a table-top setting where the robot’s task is to change the initial configuration of a variable number of objects on a table to match a given goal configuration. This problem is simple in its formulation but likely to challenge a wide variety of cognitive abilities of a robot as objects become diverse and goals become complex.
|
| 12 |
+
|
| 13 |
+
Motivated by the recent success of deep reinforcement learning for robotics (Levine et al., 2016; Gu et al., 2017; Hwangbo et al., 2019; OpenAI et al., 2019a), we tackle this problem using deep reinforcement learning on a very large training distribution. An open question in this approach is how we can build a training distribution rich enough to achieve generalization to many unseen manipulation tasks. This involves defining both an environment’s initial state distribution and a goal distribution. The initial state distribution determines how we sample a set of objects and their configuration at the beginning of an episode, and the goal distribution defines how we sample target states given an initial state. In this work, we focus on a scalable way to define a rich goal distribution.
|
| 14 |
+
|
| 15 |
+
The research community has started to explore automated ways of defining goal distributions. For example, previous works have explored learning a generative model of goal distributions (Florensa et al., 2018; Nair et al., 2018b; Racaniere et al., 2020) and collecting teleoperated robot trajectories to identify goals (Lynch et al., 2020; Gupta et al., 2020) In this paper, we extend an alternative approach called asymmetric self-play (Sukhbaatar et al., $\mathbf { \widehat { 2 0 1 8 b } } _ { \mathbf { \widehat { a } } }$ for automated goal generation. Asymmetric self-play trains two RL agents named Alice and Bob. Alice learns to propose goals that Bob is likely to fail at, and Bob, a goal-conditioned policy, learns to solve the proposed goals. Alice proposes a goal by manipulating objects and Bob has to solve the goal starting from the same initial state as Alice’s. By embodying these two agents into the same robotic hardware, this setup ensures that all proposed goals are provided with at least one solution: Alice’s trajectory.
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
(a) Table-top setting with a robot arm (b) Example initial state for training (c) Example holdout tasks
|
| 19 |
+
Figure 1: (a) We train a policy that controls a robot arm operating in a table-top setting. (b) Randomly placed ShapeNet (Chang et al., 2015) objects constitute an initial state distribution for training. (c) We use multiple manually designed holdout tasks to evaluate the learned policy.
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 2: (a) We train a goal-conditioned policy on a single training distribution and evaluate its performance on many unseen holdout tasks. (b) To construct a training distribution, we sample an initial state from a predefined distribution, and run a goal setting policy (Alice) to generate a goal. In one episode, Alice is asked to generate 5 goals and Bob solves them in sequence until it fails.
|
| 23 |
+
|
| 24 |
+
There are two main reasons why we consider asymmetric self-play to be a promising goal generation and learning method. First, any proposed goal is achievable, meaning that there exists at least one solution trajectory that Bob can follow to achieve the goal. Because of this property, we can exploit Alice’s trajectory to provide additional learning signal to Bob via behavioral cloning. This additional learning signal alleviates the overhead of heuristically designing a curriculum or reward shaping for learning. Second, this approach does not require labor intensive data collection.
|
| 25 |
+
|
| 26 |
+
In this paper, we show that asymmetric self-play can be used to train a goal-conditioned policy for complex object manipulation tasks, and the learned policy can zero-shot generalize to many manually designed holdout tasks, which consist of either previously unseen goals, previously unseen objects, or both. To the best of our knowledge, this is the first work that presents zero-shot generalization to many previously unseen tasks by training purely with asymmetric self-play.
|
| 27 |
+
|
| 28 |
+
# 2 PROBLEM FORMULATION
|
| 29 |
+
|
| 30 |
+
Our training environment for robotic manipulation consists of a robot arm with a gripper attached and a wide range of objects placed on a table surface (Figure $\boxed { 1 \mathrm { a } } \boxed { 1 \mathrm { b } }$ . The goal-conditioned policy learns to control the robot to rearrange randomly placed objects (the initial state) into a specified goal configuration (Figure 1c). We aim to train a policy on a single training distribution and to evaluate its performance over a suite of holdout tasks which are independently designed and not explicitly present during training $\mathbb { ( F i g u r e 2 a ) }$ . In this work, we construct the training distribution via asymmetric self-play (Figure 2b) to achieve generalization to many unseen holdout tasks (Figure 1c)
|
| 31 |
+
|
| 32 |
+
Mathematical formulation Formally, we model the interaction between an environment and a goal-conditioned policy as a goal-augmented Markov decision process $\mathcal { M } = \langle \boldsymbol { S } , \mathcal { A } , \mathcal { P } , \mathcal { R } , \boldsymbol { \mathcal { G } } \rangle$ , where $s$ is the state space, $\mathcal { A }$ is the action space, $\mathcal { P } : \mathcal { S } \times \mathcal { A } \times \mathcal { S } \mapsto \mathbb { R }$ denotes the transition probability, ${ \mathcal { G } } \subseteq S$ specifies the goal space and $\mathcal { R } : \mathcal { S } \times \mathcal { G } \mapsto \mathbb { R }$ is a goal-specific reward function. A goalaugmented trajectory sequence is $\left\{ \left( s _ { 0 } , g , a _ { 0 } , r _ { 0 } \right) , \ldots , \left( s _ { t } , g , a _ { t } , r _ { t } \right) \right\}$ , where the goal is provided to the policy as part of the observation at every step. We say a goal is achieved if $s _ { t }$ is sufficiently close to $g$ (Appendix $\mathbf { A } . 2 )$ . With a slightly overloaded notation, we define the goal distribution $\mathcal { G } ( \boldsymbol { g } | \boldsymbol { s } _ { 0 } )$ as the probability of a goal state $g \in { \mathcal { G } }$ conditioned on an initial state $s _ { 0 } \in S$ .
|
| 33 |
+
|
| 34 |
+
Training goal distribution A naive design of the goal distribution $\mathcal { G } ( \boldsymbol { g } | \boldsymbol { s } _ { 0 } )$ is to randomly place objects uniformly on the table, but it is unlikely to generate interesting goals, such as an object picked up and held above the table surface by a robot gripper. Another possible approach, collecting tasks and goals manually, is expensive and hard to scale. We instead sidestep these issues and automatically generate goals via training based on asymmetric self-play (Sukhbaatar et al., $\textcircled { 2 0 1 8 6 } \textcircled { 2 }$ . Asymmetric self-play involves using a policy named Alice $\pi _ { A } ( a | s )$ to set goals and a goal-conditioned policy Bob $\pi _ { B } ( a | s , g )$ to solve goals proposed by Alice, as illustrated in ${ \overline { { \mathbb { F } \mathrm { i g u r e ~ } 2 \mathrm { b } } } } .$ We run $\pi _ { A }$ to generate a trajectory $\dot { \tau } _ { A } = \{ ( s _ { 0 } , \bar { a } _ { 0 } , \bar { r _ { 0 } } ) , \dot { \mathrm { ~ . ~ . ~ } } , ( s _ { T } , a _ { T } , r _ { T } ) \}$ and the last state is labelled as a goal $g$ for $\pi _ { B }$ to solve. The goal distribution $\mathcal { G } ( s _ { T } = g | s _ { 0 } )$ is fully determined by $\pi _ { A }$ and we train Bob only on this goal distribution. We therefore say zero-shot generalization when Bob generalizes to a holdout task which is not explicitly encoded into the training distribution.
|
| 35 |
+
|
| 36 |
+
Evaluation on holdout tasks To assess zero-shot generalization of $\pi _ { B } ( a | s , g )$ from our training setup, we hand-designed a suite of holdout tasks with goals that are never directly incorporated into the training distribution. Some holdout tasks also feature previously unseen objects. The holdout tasks are designed to either test whether a specific skill has been learned, such as the ability to pick up objects $\overbrace { ( \mathrm { F i g u r e } 3 ) }$ , or represent a semantically interesting task, such as setting a table $( { \mathrm { f i g u r e } } \ { \mathrm { l c } } )$ Appendix $\overline { { \mathbb { B } . 6 } }$ describes the list of holdout tasks that we use in our experiments. Note that none of the holdout tasks are used for training $\pi _ { B } ( a | s , g )$ .
|
| 37 |
+
|
| 38 |
+
# 3 ASYMMETRIC SELF-PLAY
|
| 39 |
+
|
| 40 |
+
To train Alice policy $\pi _ { A } ( a | s )$ and Bob policy $\pi _ { B } ( a | s , g )$ , we run the following multi-goal game within one episode, as illustrated in Figure 2b:
|
| 41 |
+
|
| 42 |
+
1. An initial state $s _ { 0 }$ is sampled from an initial state distribution. Alice and Bob are instantiated into their own copies of the environment. Alice and Bob alternate turns as follows.
|
| 43 |
+
2. Alice’s turn. Alice interacts with its environment for a fixed number of $T$ steps and may rearrange the objects. The state at the end of Alice’s turn $s _ { T }$ will be used as a goal $g$ for Bob. If the proposed goal is invalid (e.g. if Alice has not moved any objects, or if an object has fallen off the table), the episode terminates.
|
| 44 |
+
3. Bob’s turn. Bob receives reward if it successfully achieves the goal $g$ in its environment. Bob’s turn ends when it succeeds at achieving the goal or reaches a timeout. If Bob’s turn ends in a failure, its remaining turns are skipped and treated as failures, while we let Alice to keep generating goals.
|
| 45 |
+
4. Alice receives reward if Bob fails to solve the goal that Alice proposed. Steps 2–3 are repeated until 5 goals are set by Alice or Alice proposes an invalid goal, and then the episode terminates.
|
| 46 |
+
|
| 47 |
+
The competition created by this game encourages Alice to propose goals that are increasingly challenging to Bob, while Bob is forced to solve increasingly complex goals. The multi-goal setup was chosen to allow Bob to take advantage of environmental information discovered earlier in the episode to solve its remaining goals, which OpenAI et al. (2019a) found to be important for transfer to physical systems. Note however that in this work we focus on solving goals in simulation only. To improve stability and avoid forgetting, we have Alice and Bob play against past versions of their respective opponent in $2 0 \%$ of games. More details about the game structure and pseudocode for training with asymmetric self-play are available in Appendix A.
|
| 48 |
+
|
| 49 |
+
# 3.1 REWARD STRUCTURE
|
| 50 |
+
|
| 51 |
+
For Bob, we assign sparse goal-conditioned rewards. We measure the positional and rotational distance between an object and its goal state as the Euclidean distance and the Euler angle rotational distance, respectively. Whenever both distance metrics are below a small error (the success threshold), this object is deemed to be placed close enough to the goal state and Bob receives 1 reward immediately. But if this object is moved away from the goal state that it has arrived at in past steps, Bob obtains -1 reward such that the sum of per-object reward is at most 1 during a given turn. When all of the objects are in their goal state, Bob receives 5 additional reward and its turn is over.
|
| 52 |
+
|
| 53 |
+
For Alice, we assign a reward after Bob has attempted to solve the goal: 5 reward if Bob failed at solving the goal, and 0 if Bob succeeded. We shape Alice’s reward slightly by adding 1 reward if it has set a valid goal, defined to be when no object has fallen off the table and any object has been moved more than the success threshold. An additional penalty of $- 3$ reward is introduced when Alice sets a goal with objects outside of the placement area, defined to be a fixed 3D volume within the view of the robot’s camera. More details are discussed in Appendix A.2.
|
| 54 |
+
|
| 55 |
+
# 3.2 ALICE BEHAVIORAL CLONING (ABC)
|
| 56 |
+
|
| 57 |
+
One of the main benefits of using asymmetric self-play is that the generated goals come with at least one solution to achieve it: Alice’s trajectory. Similarly to Sukhbaatar et al. $\overline { { ( 2 0 1 8 \mathrm { a } ) } }$ , we exploit this property by training Bob with Behavioral Cloning (BC) from Alice’s trajectory, in addition to the reinforcement learning (RL) objective. We call this learning mechanism Alice Behavioral Cloning (ABC). We propose several improvements over the original formulation in Sukhbaatar et al. (2018a).
|
| 58 |
+
|
| 59 |
+
Demonstration trajectory filtering Compared to BC from expert demonstrations, using Alice’s trajectory needs extra care. Alice’s trajectory is likely to be suboptimal for solving the goal, as Alice might arrive at the final state merely by accident. Therefore, we only consider trajectories with goals that Bob failed to solve as demonstrations, to avoid distracting Bob with suboptimal examples. Whenever Bob fails, we relabel Alice’s trajectory $\tau _ { A }$ to be a goal-augmented version $\tau _ { \mathrm { B C } } = \{ ( s _ { 0 } , s _ { T } , a _ { 0 } , r _ { 0 } ) , \dots , ( s _ { T } , s _ { T } , a _ { T } , r _ { T } ) \}$ as a demonstration for BC, where $s _ { T }$ is the goal.
|
| 60 |
+
|
| 61 |
+
PPO-style BC loss clipping The objective for training Bob is $\mathcal { L } = \mathcal { L } _ { \mathrm { R L } } + \beta \mathcal { L } _ { \mathrm { a b c } }$ , where ${ \mathcal { L } } _ { \mathrm { R L } }$ is an RL objective and $\mathcal { L } _ { \mathrm { a b c } }$ is the ABC loss. $\beta$ is a hyperparameter controlling the relative importance of the BC loss. We set $\beta = 0 . 5$ throughout the whole experiment. A naive BC loss is to minimize the negative log-likelihood of demonstrated actions, $- \mathbb { E } _ { ( s _ { t } , g _ { t } , a _ { t } ) \in \mathcal { D } _ { \mathrm { B C } } } \left[ \log \pi _ { B } ( a _ { t } | s _ { t } , g _ { t } ; \theta ) \right]$ where $\mathcal { D } _ { \mathrm { B C } }$ is a mini-batch of demonstration data and $\pi _ { B }$ is parameterized by $\theta$ . We found that overly-aggressive policy changes triggered by BC sometimes led to learning instabilities. To prevent the policy from changing too drastically, we introduce PPO-style loss clipping (Schulman et al., $\bar { 2 0 1 7 } \dot { ) }$ on the BC loss by setting the advantage $\hat { A } = 1$ in the clipped surrogate objective:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\mathcal { L } _ { \mathrm { a b c } } = - \mathbb { E } _ { ( s _ { t } , g _ { t } , a _ { t } ) \in \mathcal { D } _ { \mathrm { B C } } } \left[ \mathrm { c l i p } \Big ( \frac { \pi _ { B } \big ( a _ { t } \big | s _ { t } , g _ { t } ; \theta \big ) } { \pi _ { B } \big ( a _ { t } \big | s _ { t } , g _ { t } ; \theta _ { \mathrm { o l d } } \big ) } , 1 - \epsilon , 1 + \epsilon \Big ) \right]
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
where $\pi _ { B } ( a _ { t } | s _ { t } , g _ { t } ; \theta )$ is Bob’s likelihood on a demonstration based on the parameters that we are optimizing, and $\pi _ { B } \big ( \dot { a } _ { t } | s _ { t } , g _ { t } ; \theta _ { \mathrm { o l d } } \big )$ is the likelihood based on Bob’s behavior policy (at the time of demonstration collection) evaluated on a demonstration. This behavior policy is identical to the policy that we use to collect RL trajectories. By setting $\hat { A } = 1$ , this objective optimizes the naive BC loss, but clips the loss whenever $\frac { \pi _ { B } \left( a _ { t } | s _ { t } , g _ { t } ; \theta \right) } { \pi _ { B } \left( a _ { t } | s _ { t } , g _ { t } ; \theta _ { \mathrm { o l d } } \right) }$ is bigger than $1 + \epsilon$ , to prevent the policy from changing too much. $\epsilon$ is a clipping threshold and we use $\epsilon = 0 . 2$ in all the experiments.
|
| 68 |
+
|
| 69 |
+
# 4 RELATED WORK
|
| 70 |
+
|
| 71 |
+
Training distribution for RL In the context of multi-task RL (Beattie et al., 2016; Hausman et al., 2018; Yu et al., 2020), multi-goal RL (Kaelbling, 1993; Andrychowicz et al., $\overline { { \mathbb { Z } 0 1 7 } }$ , and meta RL (Wang et al., 2016; Duan et al., 2016), previous works manually designed a distribution of tasks or goals to see better generalization of a policy to a new task or goal. Domain randomization (Sadeghi & Levine, 2017b; Tobin et al., 2017; OpenAI et al., 2020) manually defines a distribution of simulated environments, but in service of generalizing to the same task in the real world.
|
| 72 |
+
|
| 73 |
+
There are approaches to grow the training distribution automatically (Srivastava et al., 2013). Selfplay (Tesauro, 1995; Silver et al., 2016; 2017; Bansal et al., 2018; OpenAI et al., 2019b; Vinyals et al., 2019) constructs an ever-growing training distribution where multiple agents learn by competing with each other, so that the resulting agent shows strong performance on a single game. OpenAI et al. $\textcircled { 1 2 0 1 9 2 }$ automatically grew a distribution of domain randomization parameters to accomplish better generalization in the task of solving a Rubik’s cube on the physical robot. Wang et al. (2019;
|
| 74 |
+
|
| 75 |
+
$\boxed { 2 0 2 0 }$ studied an automated way to keep discovering challenging 2D terrains and locomotion policies that can solve them in a 2D bipedal walking environment.
|
| 76 |
+
|
| 77 |
+
We employ asymmetric self-play to construct a training distribution for learning a goal-conditioned policy and to achieve generalization to unseen tasks. Florensa et al. (2018); Nair et al. (2018b); Racaniere et al. $\underline { { ( 2 0 2 0 ) } }$ had the same motivation as ours, but trained a generative model instead of a goal setting policy. Thus, the difficulties of training a generative model were inherited by these methods: difficulty of modeling a high dimensional space and generation of unrealistic samples. Lynch et al. $\underline { { \widehat { ( 2 0 2 0 ) } } }$ ; Gupta et al. $\underline { { \widehat { ( 2 0 2 0 ) } } }$ used teleoperation to collect arbitrary robot trajectories, and defined a goal distribution from the states in the collected trajectories. This approach likely requires a large number of robot trajectories for each environment configuration (e.g. various types of objects on a table), and randomization of objects was not studied in this context.
|
| 78 |
+
|
| 79 |
+
Asymmetric self-play Asymmetric self-play was proposed by Sukhbaatar et al. (2018b) as a way to supplement RL training. Sukhbaatar et al. $\underline { { \dot { \left( 2 0 1 8 \dot { 6 } \right) } } }$ mixed asymmetric self-play training with standard RL training on the target task and measured the performance on the target task. Sukhbaatar et al. $\textcircled { 2 0 1 8 \mathrm { a } }$ used asymmetric self-play to pre-train a hierarchical policy and evaluated the policy after fine-tuning it on a target task. $\boxed { \mathrm { L i u ~ e t ~ a l . } } \dot { \textcircled { 1 2 0 1 9 } }$ adopted self-play to encourage efficient learning with sparse reward in the context of an exploration competition between a pair of agents. As far as we know, no previous work has trained a goal-conditioned policy purely based on asymmetric selfplay and evaluated generalization to unseen holdout tasks.
|
| 80 |
+
|
| 81 |
+
Curriculum learning Many previous works showed the difficulty of RL and proposed an automated curriculum (Andrychowicz et al., 2017; Florensa et al., 2017; Salimans & Chen, 2018; Matiisen et al., 2019; Zhang et al., 2020) or auxiliary exploration objectives (Oudeyer et al., 2007; Baranes & Oudeyer, 2013; Pathak et al., 2017; Burda et al., 2019; Ecoffet et al., 2019; 2020) to learn predefined tasks. When training goal-conditioned policies, relabeling or reversing trajectories (Andrychowicz et al., 2017; Florensa et al., 2017; Salimans & Chen, 2018) or imitating successful demonstrations (Oh et al., 2018; Ecoffet et al., 2019; 2020) naturally reduces the task complexity. Our work shares a similarity in that asymmetric self-play alleviates the difficulty of learning a goal-conditioned policy via an intrinsic curriculum and imitation from the goal setter’s trajectory, but our work does not assume any predefined task or goal distribution.
|
| 82 |
+
|
| 83 |
+
Hierarchical reinforcement learning (HRL) Some HRL methods jointly trained a goal setting policy (high-level or manager policy) and a goal solving policy (low-level or worker policy) $\ " { \mathbb { V } } ^ { \mathrm { e z h - } }$ nevets et al., 2017; Levy et al., 2019; Nachum et al., 2018). However, the motivation for learning a goal setting policy in HRL is not to challenge the goal solving policy, but to cooperate to tackle a task that can be decomposed into a sequence of sub-goals. Hence, this goal setting policy is trained to optimize task reward for the target task, unlike asymmetric self-play where the goal setter is rewarded upon the other agent’s failure.
|
| 84 |
+
|
| 85 |
+
Robot learning for object manipulation. It has been reported that training a policy for multiobject manipulation is very challenging with sparse rewards (Riedmiller et al., 2018; Vecerik et al., $\dot { \textcircled { 2 0 1 8 } }$ One example is block stacking, which has been studied for a long time in robotics as it involves complex contact reasoning and long horizon motion planning (Deisenroth et al., $\textcircled { 2 0 1 1 }$ . Learning block stacking often requires a hand-designed curriculum (Li et al., 2019), meticulous reward shaping $( \mathrm { \overline { { P o p o v \ e t { a l . } } } } , \mathrm { \overline { { 2 0 1 7 } } } )$ , fine-tuning (Rusu et al., 2017), or human demonstrations (Nair et al., $\underline { { 2 0 1 8 \mathrm { a } } } ,$ Duan et al., 2017). In this work, we use block stacking as one of the holdout tasks to test zero-shot generalization, but without training on it.
|
| 86 |
+
|
| 87 |
+
# 5 EXPERIMENTS
|
| 88 |
+
|
| 89 |
+
In this section, we first show that asymmetric self-play generates an effective training curriculum that enables generalization to unseen hold-out tasks. Then, the experiment is scaled up to train in an environment containing multiple random complex objects and evaluate it with a set of holdout tasks containing unseen objects and unseen goal configurations. Finally, we demonstrate how critical ABC is for Bob to make progress in a set of ablation studies.
|
| 90 |
+
|
| 91 |
+

|
| 92 |
+
Figure 3: Holdout tasks in the environment using 1 or 2 blocks. The transparent blocks denote the desired goal state, while opaque blocks are the current state. (a) push: The blocks must be moved to their goal locations and orientations. There is no differentiation between the six block faces. (b) flip: Each side of the block is labelled with a unique letter. The blocks must be moved to make every face correctly positioned as what the goal specifies. (c) pick-and-place: One goal block is in the air. (d) stack: Two blocks must be stacked in the right order at the right location.
|
| 93 |
+
|
| 94 |
+

|
| 95 |
+
Figure 4: Generalization to unseen holdout tasks for blocks. Baselines are trained over a mixture of all holdout tasks. The solid lines represent 2-blocks, while the dashed lines are for 1-block. The $\mathbf { X }$ -axis denotes the number of training steps via asymmetric self-play. The y-axis is the zero-shot generalization performance of Bob policy at corresponding training checkpoints. Note that success rate curves of completely failed baselines are occluded by others.
|
| 96 |
+
|
| 97 |
+
# 5.1 EXPERIMENTAL SETUP
|
| 98 |
+
|
| 99 |
+
We implement the training environment2 described in Sec. 2 with randomly placed ShapeNet objects (Chang et al., 2015) as an initial state distribution. In addition, we set up another simpler environment using one or two blocks of fixed size, used for small-scale comparisons and ablation studies. Figure 3 visualizes four holdout tasks for this environment. Each task is designed to evaluate whether the robot has acquired certain manipulation skills: pushing, flipping, picking up and stacking blocks. Experiments in Sec. 5.2, 5.3 and 5.5 focus on blocks and experimental results based on ShapeNet objects are present on Sec. 5.4. More details on our training setups are in Appendix B.
|
| 100 |
+
|
| 101 |
+
We implement Alice and Bob as two independent policies of the same network architecture with memory (Appendix B.4), except that Alice has no observation on goal state. The policies take state observations (“state policy”) for experiments with blocks (Sec. $\underline { { \breve { 5 . 2 } } } \mathrm { , } \underline { { \breve { 5 . 3 } } } \mathrm { , }$ and $\underline { { \vec { \left. 5 . 5 \right. } } }$ , and take both vision and state observations (“hybrid policy”) for experiments with ShapeNet objects (Sec. 5.4). Both policies are trained with Proximal Policy Optimization (PPO) (Schulman et al., 2017).
|
| 102 |
+
|
| 103 |
+
# 5.2 GENERALIZATION TO UNSEEN GOALS WITHOUT MANUAL CURRICULA
|
| 104 |
+
|
| 105 |
+
One way to train a single policy to acquire all the skills in Figure 3 is to train a goal-conditioned policy directly over a mixture of these tasks. However, training directly over these tasks without a curriculum turns out to be very challenging, as the policy completely fails to make any progress.3 In contrast, Bob is able to solve all these holdout tasks quickly when learning via asymmetric self-play, without explicitly encoding any prior knowledge of the holdout tasks into the training distribution.
|
| 106 |
+
|
| 107 |
+
To gauge the effect of an intrinsic curriculum introduced by self-play, we carefully designed a set of non-self-play baselines using explicit curricula controlled by Automatic Domain Randomization (OpenAI et al., 2019a). All baselines are trained over a mixture of block holdout tasks as the goal distribution. We measure the effectiveness of a training setup by tracking the success rate for each holdout task, as shown in Figure 4. The no curriculum baseline fails drastically. The curriculum:distance baseline expands the distance between the initial and goal states gradually as training progresses, but only learns to push and flip a single block. The curriculum:distribution baseline, which slowly increases the proportion of pick-and-place and stacking goals in the training distribution, fails to acquire any skill. The curriculum:full baseline incorporates all hand-designed curricula yet still cannot learn how to pick up or stack blocks. We have spent a decent amount of time iterating and improving these baselines but found it especially difficult to develop a scheme good enough to compete with asymmetric self-play. See Appendix C.1 for more details of our baselines.
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
Figure 5: Goals discovered by asymmetric self-play. Alice discovers many goals that are not covered by our manually designed holdout tasks on blocks.
|
| 111 |
+
|
| 112 |
+

|
| 113 |
+
Figure 6: The empirical payoff matrix between Alice and Bob. Average success rate over multiple self-play episode is visualized. Alice with more training steps generates more challenging goals that Bob cannot solve yet. Bob with more training steps can achieve more goals against the same Alice.
|
| 114 |
+
|
| 115 |
+
# 5.3 DISCOVERY OF NOVEL GOALS AND SOLUTIONS
|
| 116 |
+
|
| 117 |
+
Asymmetric self-play discovers novel goals and solutions that are not covered by our holdout tasks. As illustrated in Figure 5, Alice can lift multiple blocks at the same time, build a tower and then keep it balanced using an arm joint. Although it is a tricky strategy for Bob to learn on its own, with ABC, Bob eventually acquires the skills for solving such complex tasks proposed by Alice. Videos are available at https://robotics-self-play.github.io.
|
| 118 |
+
|
| 119 |
+
Figure 6 summarizes Alice and Bob’s learning progress against each other. For every pair of Alice and Bob, we ran multiple self-play episodes and measured the success rate. We observe an interesting trend with 2 blocks. As training proceeds, Alice tends to generate more challenging goals, where Bob shows lower success rate. With past sampling, Bob continues to make progress against versions of Alices from earlier optimization steps. This visualization suggests a desired dynamic of asymmetric self-play that could potentially lead to unbounded complexity: Alice continuously generates goals to challenge Bob, and Bob keeps making progress on learning to solve new goals.
|
| 120 |
+
|
| 121 |
+
# 5.4 GENERALIZATION TO UNSEEN OBJECTS AND GOALS
|
| 122 |
+
|
| 123 |
+
The experiments above show strong evidence that efficient curricula and novel goals can autonomously emerge in asymmetric self-play. To further challenge our approach, we scale it up to work with many more complex objects using more computational resources for training. We train a hybrid policy in an environment containing up to 10 random ShapeNet $\mathtt { ( F h a n g ~ e t ~ a l . ) } \overline { { \mathbb { P } \mathrm { 2 0 1 5 } } } \mathrm { ) }$ objects. During training, we randomize the number of objects and the object sizes via Automatic Domain Randomization (OpenAI et al., $\textcircled { 2 0 1 9 9 }$ . The hybrid policy uses vision observations to extract information about object geometry and size. We evaluate the Bob policy on a more diverse set of manipulation tasks, including semantically interesting ones. Many tasks contain unseen objects and complex goals, as illustrated in Figure 7.
|
| 124 |
+
|
| 125 |
+
The learned Bob policy achieves decent zero-shot generalization performance for many tasks. Success rates are reported in Figure 8. Several tasks are still challenging. For example, ball-capture requires delicate handling of rolling objects and lifting skills. The rainbow tasks call for an understanding of concave shapes. Understanding the ordering of placement actions is crucial for stacking more than 3 blocks in the desired order. The Bob policy learns such an ordering to some degree, but fails to fully generalize to an arbitrary number of stacked blocks.
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
Figure 7: Example holdout tasks involving unseen objects and complex goal states. The goal states are illustrated here, and the initial states have randomly placed objects.
|
| 129 |
+
|
| 130 |
+

|
| 131 |
+
Figure 8: Success rates of a single goal-conditioned policy solving a variety of holdout tasks, averaged over 100 trials. The error bars indicate the $9 9 \%$ confidence intervals. Yellow, orange and blue bars correspond to success rates of manipulation tasks with blocks, YCB4objects and other uniquely built objects, respectively. Videos are available at https://robotics-self-play.github.io.
|
| 132 |
+
|
| 133 |
+
# 5.5 ABLATION STUDIES
|
| 134 |
+
|
| 135 |
+
We present a series of ablation studies designed for measuring the importance of each component in our asymmetric self-play framework, including Alice behavioral cloning (ABC), BC loss clipping, demonstration filtering, and the multi-goal game setup. We disable a single ingredient in each ablation run and compare with the complete self-play baseline in Figure 9.
|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
Figure 9: The ablation studies compare four ablation runs each with one component disabled with the full baseline. Solid lines are for 2-blocks, dashed lines are for 1-block. The $\mathbf { X }$ -axis denotes the number of training steps via asymmetric self-play. The y-axis is the zero-shot generalization performance of Bob policy at corresponding training steps.
|
| 139 |
+
|
| 140 |
+
The no ABC baseline shows that Bob completely fails to solve any holdout task without ABC, indicating that ABC is a critical mechanism in asymmetric self-play. The no BC loss clipping baseline shows slightly slower learning on pick-and-place and stack, as well as some instabilities in the middle of training. Clipping in the BC loss is expected to help alleviate this instability by controlling the rate of policy change per optimizer iteration. The no demonstration filter baseline shows noticeable instability on flip, suggesting the importance of excluding suboptimal demonstrations from behavioral cloning. Finally, the single-goal baseline uses a single goal instead of 5 goals per episode during training. The evaluation tasks are also updated to require a single success per episode. Generalization of this baseline to holdout tasks turns out to be much slower and less stable. It signifies some advantages of using multiple goals per episode, perhaps due to the policy memory internalizing environmental information during multiple trials of goal solving.
|
| 141 |
+
|
| 142 |
+
The results of the ablation studies suggest that ABC with proper configuration and multi-goal gameplay are critical components of asymmetric self-play, alleviating the importance of manual curricula and facilitating efficient learning.
|
| 143 |
+
|
| 144 |
+
# 6 CONCLUSION
|
| 145 |
+
|
| 146 |
+
One limitation of our asymmetric self-play approach is that it depends on a resettable simulation environment as Bob needs to start from the same initial state as Alice’s. Therefore asymmetric self-play training has to happen in a simulator which can be easily updated to a desired state. In order to run the goal-solving policy on physical robots, we plan to adopt sim-to-real techniques in future work. Sim-to-real has been shown to achieve great performance on many robotic tasks in the real world (Sadeghi & Levine, 2017a; Tobin et al., 2017; James et al., 2019; OpenAI et al., 2020). One potential approach is to pre-train two agents via asymmetric self-play in simulation, and then fine-tune the Bob policy with domain randomization or data collected on physical robots.
|
| 147 |
+
|
| 148 |
+
In conclusion, we studied asymmetric self-play as a framework for defining a single training distribution to learn many arbitrary object manipulation tasks. Even without any prior knowledge about the target tasks, asymmetric self-play is able to train a strong goal-conditioned policy that can generalize to many unseen holdout tasks. We found that asymmetric self-play not only generates a wide range of interesting goals but also alleviates the necessity of designing manual curricula for learning such goals. We provided evidence that using the goal setting trajectory as a demonstration for training a goal solving policy is essential to enable efficient learning. We further scaled up our approach to work with various complex objects using more computation, and achieved zero-shot generalization to a collection of challenging manipulation tasks involving unseen objects and unseen goals.
|
| 149 |
+
|
| 150 |
+
# REFERENCES
|
| 151 |
+
|
| 152 |
+
Marcin Andrychowicz, Filip Wolski, Alex Ray, Jonas Schneider, Rachel Fong, Peter Welinder, Bob McGrew, Josh Tobin, Pieter Abbeel, and Wojciech Zaremba. Hindsight experience replay. In Advances in neural information processing systems, 2017.
|
| 153 |
+
|
| 154 |
+
Trapit Bansal, Jakub Pachocki, Szymon Sidor, Ilya Sutskever, and Igor Mordatch. Emergent complexity via multi-agent competition. In International Conference on Learning Representations, 2018.
|
| 155 |
+
|
| 156 |
+
Adrien Baranes and Pierre-Yves Oudeyer. Active learning of inverse models with intrinsically motivated goal exploration in robots. Robotics and Autonomous Systems, 61(1):49–73, 2013.
|
| 157 |
+
|
| 158 |
+
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.
|
| 159 |
+
|
| 160 |
+
Yuri Burda, Harrison Edwards, Amos Storkey, and Oleg Klimov. Exploration by random network distillation. In International Conference on Learning Representations, 2019.
|
| 161 |
+
|
| 162 |
+
Angel X Chang, Thomas Funkhouser, Leonidas Guibas, Pat Hanrahan, Qixing Huang, Zimo Li, Silvio Savarese, Manolis Savva, Shuran Song, Hao Su, et al. Shapenet: An information-rich 3d model repository. arXiv preprint arXiv:1512.03012, 2015.
|
| 163 |
+
|
| 164 |
+
Marc Peter Deisenroth, Carl Edward Rasmussen, and Dieter Fox. Learning to control a low-cost manipulator using data-efficient reinforcement learning. Robotics: Science and Systems VII, pp. 57–64, 2011.
|
| 165 |
+
|
| 166 |
+
Yan Duan, John Schulman, Xi Chen, Peter L Bartlett, Ilya Sutskever, and Pieter Abbeel. RL2: Fast reinforcement learning via slow reinforcement learning. arXiv preprint arXiv:1611.02779, 2016.
|
| 167 |
+
|
| 168 |
+
Yan Duan, Marcin Andrychowicz, Bradly Stadie, OpenAI Jonathan Ho, Jonas Schneider, Ilya Sutskever, Pieter Abbeel, and Wojciech Zaremba. One-shot imitation learning. In Advances in neural information processing systems, 2017.
|
| 169 |
+
|
| 170 |
+
Adrien Ecoffet, Joost Huizinga, Joel Lehman, Kenneth O Stanley, and Jeff Clune. Go-explore: a new approach for hard-exploration problems. arXiv preprint arXiv:1901.10995, 2019.
|
| 171 |
+
|
| 172 |
+
Adrien Ecoffet, Joost Huizinga, Joel Lehman, Kenneth O Stanley, and Jeff Clune. First return then explore. arXiv preprint arXiv:2004.12919, 2020.
|
| 173 |
+
|
| 174 |
+
Lasse Espeholt, Hubert Soyer, Remi Munos, Karen Simonyan, Vlad Mnih, Tom Ward, Yotam Doron, Vlad Firoiu, Tim Harley, Iain Dunning, et al. Impala: Scalable distributed deep-rl with importance weighted actor-learner architectures. In International Conference on Machine Learning, 2018.
|
| 175 |
+
|
| 176 |
+
Carlos Florensa, David Held, Markus Wulfmeier, Michael Zhang, and Pieter Abbeel. Reverse curriculum generation for reinforcement learning. In Conference on Robot Learning, 2017.
|
| 177 |
+
|
| 178 |
+
Carlos Florensa, David Held, Xinyang Geng, and Pieter Abbeel. Automatic goal generation for reinforcement learning agents. In International conference on machine learning, 2018.
|
| 179 |
+
|
| 180 |
+
Shixiang Gu, Ethan Holly, Timothy Lillicrap, and Sergey Levine. Deep reinforcement learning for robotic manipulation with asynchronous off-policy updates. In IEEE international conference on robotics and automation (ICRA), 2017.
|
| 181 |
+
|
| 182 |
+
Abhishek Gupta, Vikash Kumar, Corey Lynch, Sergey Levine, and Karol Hausman. Relay policy learning: Solving long-horizon tasks via imitation and reinforcement learning. In Conference on Robot Learning, 2020.
|
| 183 |
+
|
| 184 |
+
Karol Hausman, Jost Tobias Springenberg, Ziyu Wang, Nicolas Heess, and Martin Riedmiller. Learning an embedding space for transferable robot skills. In International Conference on Learning Representations, 2018.
|
| 185 |
+
|
| 186 |
+
Jemin Hwangbo, Joonho Lee, Alexey Dosovitskiy, Dario Bellicoso, Vassilios Tsounis, Vladlen Koltun, and Marco Hutter. Learning agile and dynamic motor skills for legged robots. Science Robotics, 4(26), 2019.
|
| 187 |
+
|
| 188 |
+
Stephen James, Paul Wohlhart, Mrinal Kalakrishnan, Dmitry Kalashnikov, Alex Irpan, Julian Ibarz, Sergey Levine, Raia Hadsell, and Konstantinos Bousmalis. Sim-to-real via sim-to-sim: Dataefficient robotic grasping via randomized-to-canonical adaptation networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2019.
|
| 189 |
+
|
| 190 |
+
Leslie Pack Kaelbling. Learning to achieve goals. In Proceedings of the 13th International Joint Conference on Artificial Intelligence, 1993.
|
| 191 |
+
|
| 192 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 193 |
+
|
| 194 |
+
Sergey Levine, Chelsea Finn, Trevor Darrell, and Pieter Abbeel. End-to-end training of deep visuomotor policies. The Journal of Machine Learning Research, 17(1):1334–1373, 2016.
|
| 195 |
+
|
| 196 |
+
Andrew Levy, George Konidaris, Robert Platt, and Kate Saenko. Learning multi-level hierarchies with hindsight. In International Conference on Learning Representations, 2019.
|
| 197 |
+
|
| 198 |
+
Richard Li, Allan Jabri, Trevor Darrell, and Pulkit Agrawal. Towards practical multi-object manipulation using relational reinforcement learning. arXiv preprint arXiv:1912.11032, 2019.
|
| 199 |
+
|
| 200 |
+
Hao Liu, Alexander Trott, Richard Socher, and Caiming Xiong. Competitive experience replay. In International Conference on Learning Representations, 2019.
|
| 201 |
+
|
| 202 |
+
Corey Lynch, Mohi Khansari, Ted Xiao, Vikash Kumar, Jonathan Tompson, Sergey Levine, and Pierre Sermanet. Learning latent plans from play. In Conference on Robot Learning, pp. 1113– 1132, 2020.
|
| 203 |
+
|
| 204 |
+
Tambet Matiisen, Avital Oliver, Taco Cohen, and John Schulman. Teacher-student curriculum learning. IEEE transactions on neural networks and learning systems, 2019.
|
| 205 |
+
|
| 206 |
+
Ofir Nachum, Shixiang Gu, Honglak Lee, and Sergey Levine. Data-efficient hierarchical reinforcement learning. In Advances in Neural Information Processing Systems, 2018.
|
| 207 |
+
|
| 208 |
+
Ashvin Nair, Bob McGrew, Marcin Andrychowicz, Wojciech Zaremba, and Pieter Abbeel. Overcoming exploration in reinforcement learning with demonstrations. In IEEE International Conference on Robotics and Automation (ICRA), 2018a.
|
| 209 |
+
|
| 210 |
+
Ashvin V Nair, Vitchyr Pong, Murtaza Dalal, Shikhar Bahl, Steven Lin, and Sergey Levine. Visual reinforcement learning with imagined goals. In Advances in Neural Information Processing Systems, 2018b.
|
| 211 |
+
|
| 212 |
+
Junhyuk Oh, Yijie Guo, Satinder Singh, and Honglak Lee. Self-imitation learning. arXiv preprint arXiv:1806.05635, 2018.
|
| 213 |
+
|
| 214 |
+
OpenAI, Ilge Akkaya, Marcin Andrychowicz, Maciek Chociej, Mateusz Litwin, Bob McGrew, Arthur Petron, Alex Paino, Matthias Plappert, Glenn Powell, Raphael Ribas, Jonas Schneider, Nikolas Tezak, Jerry Tworek, Peter Welinder, Lilian Weng, Qiming Yuan, Wojciech Zaremba, and Lei Zhang. Solving rubik’s cube with a robot hand. arXiv preprint arXiv:1910.07113, 2019a.
|
| 215 |
+
|
| 216 |
+
OpenAI, Christopher Berner, Greg Brockman, Brooke Chan, Vicki Cheung, Przemysław D˛ebiak, Christy Dennison, David Farhi, Quirin Fischer, Shariq Hashme, Chris Hesse, Rafal Józefowicz, Scott Gray, Catherine Olsson, Jakub Pachocki, Michael Petrov, Henrique Pondé de Oliveira Pinto, Jonathan Raiman, Tim Salimans, Jeremy Schlatter, Jonas Schneider, Szymon Sidor, Ilya Sutskever, Jie Tang, Filip Wolski, and Susan Zhang. Dota 2 with large scale deep reinforcement learning. arXiv preprint arXiv:1912.06680, 2019b.
|
| 217 |
+
|
| 218 |
+
OpenAI, Marcin Andrychowicz, Bowen Baker, Maciek Chociej, Rafal Jozefowicz, Bob McGrew, Jakub Pachocki, Arthur Petron, Matthias Plappert, Glenn Powell, Alex Ray, Jonas Schneider, Szymon Sidor, Josh Tobin, Peter Welinder, Lilian Weng, and Wojciech Zaremba. Learning dexterous in-hand manipulation. The International Journal of Robotics Research, 39(1):3–20, 2020.
|
| 219 |
+
|
| 220 |
+
Pierre-Yves Oudeyer, Frdric Kaplan, and Verena V Hafner. Intrinsic motivation systems for autonomous mental development. IEEE transactions on evolutionary computation, 11(2):265–286, 2007.
|
| 221 |
+
|
| 222 |
+
Deepak Pathak, Pulkit Agrawal, Alexei A Efros, and Trevor Darrell. Curiosity-driven exploration by self-supervised prediction. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, 2017.
|
| 223 |
+
|
| 224 |
+
Ivaylo Popov, Nicolas Heess, Timothy Lillicrap, Roland Hafner, Gabriel Barth-Maron, Matej Vecerik, Thomas Lampe, Yuval Tassa, Tom Erez, and Martin Riedmiller. Data-efficient deep reinforcement learning for dexterous manipulation. arXiv preprint arXiv:1704.03073, 2017.
|
| 225 |
+
|
| 226 |
+
Sebastien Racaniere, Andrew Lampinen, Adam Santoro, David Reichert, Vlad Firoiu, and Timothy Lillicrap. Automated curriculum generation through setter-solver interactions. In International Conference on Learning Representations, 2020.
|
| 227 |
+
|
| 228 |
+
Martin Riedmiller, Roland Hafner, Thomas Lampe, Michael Neunert, Jonas Degrave, Tom Van de Wiele, Volodymyr Mnih, Nicolas Heess, and Jost Tobias Springenberg. Learning by playing - solving sparse reward tasks from scratch, 2018.
|
| 229 |
+
|
| 230 |
+
Andrei A Rusu, Matej Vecerík, Thomas Rothörl, Nicolas Heess, Razvan Pascanu, and Raia Hadsell.ˇ Sim-to-real robot learning from pixels with progressive nets. In Conference on Robot Learning, 2017.
|
| 231 |
+
|
| 232 |
+
Fereshteh Sadeghi and Sergey Levine. CAD2RL: real single-image flight without a single real image. In Robotics: Science and Systems XIII, Massachusetts Institute of Technology, Cambridge, Massachusetts, USA, July 12-16, 2017, 2017a. URL http://www.roboticsproceedings.org/ rss13/p34.html.
|
| 233 |
+
|
| 234 |
+
Fereshteh Sadeghi and Sergey Levine. Cad2rl: Real single-image flight without a single real image. In Proceedings of Robotics: Science and Systems, 2017b.
|
| 235 |
+
|
| 236 |
+
Tim Salimans and Richard Chen. Learning montezuma’s revenge from a single demonstration. arXiv preprint arXiv:1812.03381, 2018.
|
| 237 |
+
|
| 238 |
+
John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017.
|
| 239 |
+
|
| 240 |
+
David Silver, Aja Huang, Chris J Maddison, Arthur Guez, Laurent Sifre, George Van Den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, et al. Mastering the game of go with deep neural networks and tree search. nature, 529(7587):484–489, 2016.
|
| 241 |
+
|
| 242 |
+
David Silver, Thomas Hubert, Julian Schrittwieser, Ioannis Antonoglou, Matthew Lai, Arthur Guez, Marc Lanctot, Laurent Sifre, Dharshan Kumaran, Thore Graepel, et al. Mastering chess and shogi by self-play with a general reinforcement learning algorithm. arXiv preprint arXiv:1712.01815, 2017.
|
| 243 |
+
|
| 244 |
+
Rupesh Kumar Srivastava, Bas R Steunebrink, and Jürgen Schmidhuber. First experiments with powerplay. Neural Networks, 41:130–136, 2013.
|
| 245 |
+
|
| 246 |
+
Sainbayar Sukhbaatar, Emily Denton, Arthur Szlam, and Rob Fergus. Learning goal embeddings via self-play for hierarchical reinforcement learning. arXiv preprint arXiv:1811.09083, 2018a.
|
| 247 |
+
|
| 248 |
+
Sainbayar Sukhbaatar, Zeming Lin, Ilya Kostrikov, Gabriel Synnaeve, Arthur Szlam, and Rob Fergus. Intrinsic motivation and automatic curricula via asymmetric self-play. In International Conference on Learning Representations, 2018b.
|
| 249 |
+
|
| 250 |
+
Gerald Tesauro. Temporal difference learning and td-gammon. Communications of the ACM, 38(3): 58–68, 1995.
|
| 251 |
+
|
| 252 |
+
Josh Tobin, Rachel Fong, Alex Ray, Jonas Schneider, Wojciech Zaremba, and Pieter Abbeel. Domain randomization for transferring deep neural networks from simulation to the real world. In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), 2017.
|
| 253 |
+
|
| 254 |
+
Emanuel Todorov, Tom Erez, and Yuval Tassa. MuJoCo: A physics engine for model-based control. In Intelligent Robots and Systems (IROS), 2012 IEEE/RSJ International Conference on, 2012.
|
| 255 |
+
|
| 256 |
+
Mel Vecerik, Todd Hester, Jonathan Scholz, Fumin Wang, Olivier Pietquin, Bilal Piot, Nicolas Heess, Thomas Rothörl, Thomas Lampe, and Martin Riedmiller. Leveraging demonstrations for deep reinforcement learning on robotics problems with sparse rewards, 2018.
|
| 257 |
+
|
| 258 |
+
Alexander Sasha Vezhnevets, Simon Osindero, Tom Schaul, Nicolas Heess, Max Jaderberg, David Silver, and Koray Kavukcuoglu. Feudal networks for hierarchical reinforcement learning. In International Conference on Machine Learning, 2017.
|
| 259 |
+
|
| 260 |
+
Oriol Vinyals, Igor Babuschkin, Wojciech M Czarnecki, Michaël Mathieu, Andrew Dudzik, Junyoung Chung, David H Choi, Richard Powell, Timo Ewalds, Petko Georgiev, et al. Grandmaster level in starcraft ii using multi-agent reinforcement learning. Nature, 575(7782):350–354, 2019.
|
| 261 |
+
|
| 262 |
+
Jane X Wang, Zeb Kurth-Nelson, Dhruva Tirumala, Hubert Soyer, Joel Z Leibo, Remi Munos, Charles Blundell, Dharshan Kumaran, and Matt Botvinick. Learning to reinforcement learn. arXiv preprint arXiv:1611.05763, 2016.
|
| 263 |
+
|
| 264 |
+
Rui Wang, Joel Lehman, Jeff Clune, and Kenneth O Stanley. Paired open-ended trailblazer (poet): Endlessly generating increasingly complex and diverse learning environments and their solutions. arXiv preprint arXiv:1901.01753, 2019.
|
| 265 |
+
|
| 266 |
+
Rui Wang, Joel Lehman, Aditya Rawal, Jiale Zhi, Yulun Li, Jeff Clune, and Kenneth O Stanley. Enhanced poet: Open-ended reinforcement learning through unbounded invention of learning challenges and their solutions. arXiv preprint arXiv:2003.08536, 2020.
|
| 267 |
+
|
| 268 |
+
Tianhe Yu, Deirdre Quillen, Zhanpeng He, Ryan Julian, Karol Hausman, Chelsea Finn, and Sergey Levine. Meta-world: A benchmark and evaluation for multi-task and meta reinforcement learning. In Conference on Robot Learning, 2020.
|
| 269 |
+
|
| 270 |
+
Yunzhi Zhang, Pieter Abbeel, and Lerrel Pinto. Automatic curriculum learning through value disagreement. arXiv preprint arXiv:2006.09641, 2020.
|
md/train/jh-rTtvkGeM/jh-rTtvkGeM.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/rh0vIXw6i33/rh0vIXw6i33.md
ADDED
|
@@ -0,0 +1,396 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Multiple Descent: Design Your Own Generalization Curve
|
| 2 |
+
|
| 3 |
+
Lin Chen Simons Institute for the Theory of Computing University of California, Berkeley CA 94720 lin.chen@berkeley.edu
|
| 4 |
+
|
| 5 |
+
Yifei Min Department of Statistics and Data Science Yale University CT 06511 yifei.min@yale.edu
|
| 6 |
+
|
| 7 |
+
# Mikhail Belkin
|
| 8 |
+
|
| 9 |
+
Halıcıoglu Data Science Institute˘
|
| 10 |
+
University of California, San Diego CA 92093 mbelkin@ucsd.edu
|
| 11 |
+
|
| 12 |
+
Amin Karbasi School of Engineering and Applied Science Yale University CT 06511 amin.karbasi@yale.edu
|
| 13 |
+
|
| 14 |
+
# Abstract
|
| 15 |
+
|
| 16 |
+
This paper explores the generalization loss of linear regression in variably parameterized families of models, both under-parameterized and over-parameterized. We show that the generalization curve can have an arbitrary number of peaks, and moreover, locations of those peaks can be explicitly controlled. Our results highlight the fact that both classical U-shaped generalization curve and the recently observed double descent curve are not intrinsic properties of the model family. Instead, their emergence is due to the interaction between the properties of the data and the inductive biases of learning algorithms.
|
| 17 |
+
|
| 18 |
+
# 1 Introduction
|
| 19 |
+
|
| 20 |
+
The main goal of machine learning methods is to provide an accurate out-of-sample prediction, known as generalization. For a fixed family of models, a common way to select a model from this family is through empirical risk minimization, i.e., algorithmically selecting models that minimize the risk on the training dataset. Given a variably parameterized family of models, the statistical learning theory aims to identify the dependence between model complexity and model performance. The empirical risk usually decreases monotonically as the model complexity increases, and achieves its minimum when the model is rich enough to interpolate the training data, resulting in zero (or near-zero) training error. In contrast, the behaviour of the test error as a function of model complexity is far more complicated. Indeed, in this paper we show how to construct a model family for which the generalization curve can be fully controlled (away from the interpolation threshold) in both under-parameterized and over-parameterized regimes. Classical statistical learning theory supports a U-shaped curve of generalization versus model complexity [31, 33]. Under such a framework, the best model is found at the bottom of the U-shaped curve, which corresponds to appropriately balancing under-fitting and over-fitting the training data. From the view of the bias-variance trade-off, a higher model complexity increases the variance while decreasing the bias. A model with an appropriate level of complexity achieves a relatively low bias while still keeping the variance under control. On the other hand, a model that interpolates the training data is deemed to over-fit and tends to worsen the generalization performance due to the soaring variance.
|
| 21 |
+
|
| 22 |
+
Although classical statistical theory suggests a pattern of behavior for the generalization curve up to the interpolation threshold, it does not describe what happens beyond the interpolation threshold, commonly referred to as the over-parameterized regime. This is the exact regime where many modern machine learning models, especially deep neural networks, achieved remarkable success. Indeed, neural networks generalize well even when the models are so complex that they have the potential to interpolate all the training data points [61, 10, 32, 34].
|
| 23 |
+
|
| 24 |
+
Modern practitioners commonly deploy deep neural networks with hundreds of millions or even billions of parameters. It has become widely accepted that large models achieve performance superior to small models that may be suggested by the classical U-shaped generalization curve [13, 38, 55, 35, 36]. This indicates that the test error decreases again once model complexity grows beyond the interpolation threshold, resulting in the so called double-descent phenomenon described in [9], which has been broadly supported by empirical evidence [49, 48, 29, 30] and confirmed empirically on modern neural architectures by Nakkiran et al. [46]. On the theoretical side, this phenomenon has been recently addressed by several works on various model settings. In particular, Belkin et al. [11] proved the existence of double-descent phenomenon for linear regression with random feature selection and analyzed the random Fourier feature model [50]. Mei and Montanari [44] also studied the Fourier model and computed the asymptotic test error which captures the double-descent phenomenon. Bartlett et al. [8], Tsigler and Bartlett [56] analyzed and gave explicit conditions for “benign overfitting” in linear and ridge regression, respectively. Caron and Chretien [16] provided a finite sample analysis of the nonlinear function estimation and showed that the parameter learned through empirical risk minimization converges to the true parameter with high probability as the model complexity tends to infinity, implying the existence of double descent. Liu et al. [42] studied the high dimensional kernel ridge regression in the under- and over-parameterized regimes and showed that the risk curve can be double descent, bell-shaped, and monotonically decreasing.
|
| 25 |
+
|
| 26 |
+
Among all the aforementioned efforts, one particularly interesting question is whether one can observe more than two descents in the generalization curve. d’Ascoli et al. [21] empirically showed a samplewise triple-descent phenomenon under the random Fourier feature model. Similar triple-descent was also observed for linear regression [47]. More rigorously, Liang et al. [41] presented an upper bound on the risk of the minimum-norm interpolation versus the data dimension in Reproducing Kernel Hilbert Spaces (RKHS), which exhibits multiple descent. However, a multiple-descent upper bound without a properly matching lower bound does not imply the existence of a multiple-descent generalization curve. In this work, we study the multiple descent phenomenon by addressing the following questions:
|
| 27 |
+
|
| 28 |
+
• Can the existence of a multiple descent generalization curve be rigorously proven? • Can an arbitrary number of descents occur? • Can the generalization curve and the locations of descents be designed?
|
| 29 |
+
|
| 30 |
+
In this paper, we show that the answer to all three of these questions is yes. Further related work is presented in Section 2.
|
| 31 |
+
|
| 32 |
+
Our Contribution. We consider the linear regression model and analyze how the risk changes as the dimension of the data grows. In the linear regression setting, the data dimension is equal to the dimension of the parameter space, which reflects the model complexity. We rigorously show that the multiple descent generalization curve exists under this setting. To our best knowledge, this is the first work proving a multiple descent phenomenon.
|
| 33 |
+
|
| 34 |
+
Our analysis considers both the underparametrized and overparametrized regimes. In the overparametrized regime, we show that one can control where a descent or an ascent occurs in the generalization curve. This is realized through our algorithmic construction of a feature-revealing process. To be more specific, we assume that the data is in $\mathbb { R } ^ { D }$ , where $D$ can be arbitrarily large or even essentially infinite. We view each dimension of the data as a feature. We consider a linear regression problem restricted on the first $d$ features, where $d < D$ . New features are revealed by increasing the dimension of the data. We then show that by specifying the distribution of the newly revealed feature to be either a standard Gaussian or a Gaussian mixture, one can determine where an ascent or a descent occurs. In order to create an ascent when a new feature is revealed, it is sufficient that the feature follows a Gaussian mixture distribution. In order to have a descent, it is sufficient that the new feature follows a standard Gaussian distribution. Therefore, in the overparametrized regime, we can fully control the occurrence of a descent and an ascent. As a comparison, in the underparametrized regime, the generalization loss always increases regardless of the feature distribution. Generally speaking, we show that we are able to design the generalization curve.
|
| 35 |
+
|
| 36 |
+
On the one hand, we show theoretically that the generalization curve is malleable and can be constructed in an arbitrary fashion. On the other hand, we rarely observe complex generalization curves in practice, besides carefully curated constructions. Putting these facts together, we arrive at the conclusion that realistic generalization curves arise from specific interactions between properties of typical data and the inductive biases of algorithms. We should highlight that the nature of these interactions is far from being understood and should be an area of further investigations.
|
| 37 |
+
|
| 38 |
+
# 2 Related Work
|
| 39 |
+
|
| 40 |
+
Our work is directly related to the recent line of research in the theoretical understanding of the double descent [11, 34, 60, 44] and the multiple descent phenomenon [41, 39]. Here we briefly discuss some other work that is closely related to this paper.
|
| 41 |
+
|
| 42 |
+
Least Square Regression. In this paper we focus on the least square linear regression with no regularization. For the regularized least square regression, De Vito et al. [22] proposed a selection procedure for the regularization parameter. Advani and Saxe [1] analyzed the generalization of neural networks with mean squared error under the asymptotic regime where both the sample size and model complexity tend to infinity. Richards et al. [52] proved for least square regression in the asymptotic regime that as the dimension-to-sample-size ratio $d / n$ grows, an additional peak can occur in both the variance and bias due to the covariance structure of the features. As a comparison, in this paper the sample size is fixed and the model complexity increases. Rudi and Rosasco [53] studied kernel ridge regression and gave an upper bound on the number of the random features to reach certain risk level. Our result shows that there exists a natural setting where by manipulating the random features one can control the risk curve.
|
| 43 |
+
|
| 44 |
+
Over-Parameterization and Interpolation. The double descent occurs when the model complexity reaches and increases beyond the interpolation threshold. Most previous works focused on proving an upper bound or optimal rate for the risk. Caponnetto and De Vito [15] gave the optimal rate for least square ridge regression via careful selection of the regularization parameter. Belkin et al. [12] showed that the optimal rate for risk can be achieved by a model that interpolates the training data. In a series of work on kernel regression with regularization parameter tending to zero (a.k.a. kernel ridgeless regression), Rakhlin and Zhai [51] showed that the risk is bounded away from zero when the data dimension is fixed with respect to the sample size. Liang and Rakhlin [40] then considered the case when $d \asymp n$ , showed empirically the multiple descent phenomenon and proved a risk upper bound that can be small given favorable data and kernel assumptions. Instead of giving a bound, our paper presents an exact computation of risk in the cases of underparametrized and overparametrized linear regression, and proves the existence of the multiple descent phenomenon. Wyner et al. [59] analyzed AdaBoost and Random Forest from the perspective of interpolation. There has also been a line of work on wide neural networks [4–6, 23, 3, 58, 14, 2, 18, 62, 54].
|
| 45 |
+
|
| 46 |
+
Sample-wise Double Descent and Non-monotonicity. There has also been recent development beyond the model-complexity double-descent phenomenon. For example, regarding sample-wise non-monotonicity, Nakkiran et al. [46] empirically observed the epoch-wise double-descent and sample-wise non-monotonicity for neural networks. Chen et al. [19] and Min et al. [45] identified and proved the sample-wise double descent under the adversarial training setting, and Javanmard et al. [37] discovered double-descent under adversarially robust linear regression. Loog et al. [43] showed that empirical risk minimization can lead to sample-wise non-monotonicity in the standard linear model setting under various loss functions including the absolute loss and the squared loss, which covers the range from classification to regression. We also refer the reader to their discussion of the earlier work on non-monotonicity of generalization curves. Dar et al. [20] demonstrated the double descent curve of the generalization errors of subspace fitting problems. Fei et al. [28] studied the risk-sample tradeoff in reinforcement learning.
|
| 47 |
+
|
| 48 |
+
# 3 Preliminaries and Problem Formulation
|
| 49 |
+
|
| 50 |
+
Notation. For $x \in \mathbb { R } ^ { D }$ and $d \leq D$ , we let $x [ 1 : d ] \in \mathbb { R } ^ { d }$ denote a $d$ -dimensional vector with $x [ 1 : d ] _ { i } = x _ { i }$ for all $1 \ \leq \ i \ \leq \ d$ . For a matrix $A \ \in \ \mathbb { R } ^ { n \times d }$ , we denote its Moore-Penrose pseudoinverse by $A ^ { + } \in \mathbb { R } ^ { d \times n }$ and denote its spectral norm by $\textstyle \| A \| \triangleq \operatorname* { s u p } _ { x \neq 0 } { \frac { \| A x \| _ { 2 } } { \| x \| _ { 2 } } }$ kAxk2 , where k · k2 is the Euclidean norm for vectors. If $v$ is a vector, its spectral norm $\lVert v \rVert$ agrees with the Euclidean norm $\lVert \boldsymbol { v } \rVert _ { 2 }$ . Therefore, we write $\lVert v \rVert$ for $\lVert \boldsymbol { v } \rVert _ { 2 }$ to simplify the notation. We use the big $\mathrm { o }$ notation $\mathcal { O }$ and write variables in the subscript of $\mathcal { O }$ if the implicit constant depends on them. For example, ${ \mathcal { O } } _ { n , d , \sigma } ( 1 )$ is a constant that only depends on $n , d ,$ , and $\sigma$ . If $f ( \sigma )$ and $g ( \sigma )$ are functions of $\sigma$ , write $f ( \sigma ) \sim g ( \sigma )$ if $\begin{array} { r } { \operatorname* { l i m } \frac { f ( \sigma ) } { g ( \sigma ) } = 1 } \end{array}$ . It will be given in the context how we take the limit.
|
| 51 |
+
|
| 52 |
+
Distributions. Let ${ \mathcal { N } } ( \mu , \sigma ^ { 2 } )$ $( \mu , \sigma \in \mathbb { R } )$ and $\mathcal { N } ( \boldsymbol { \mu } , \boldsymbol { \Sigma } )$ $\mathbf { \mathcal { \mu } } _ { \mathbf { \lambda } } ( \mathbf { \mathcal { \mu } } _ { \mathbf { \lambda } } \mathbf { \mathbb { R } } ^ { n }$ , $\Sigma \in \mathbb { R } ^ { n \times n }$ ) denote the univariate and multivariate Gaussian distributions, respectively, where $\boldsymbol { \mu } \in \mathbb { R } ^ { n }$ and $\boldsymbol { \Sigma } \in \mathbb { R } ^ { n \times n }$ is a positive semi-definite matrix. We define a family of trimodal Gaussian mixture distributions as follows
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\mathcal { N } _ { \sigma , \mu } ^ { \mathrm { m i x } } \triangleq \frac 1 3 { N ( 0 , \sigma ^ { 2 } ) + \frac { 1 } { 3 } } { N ( - \mu , \sigma ^ { 2 } ) + \frac { 1 } { 3 } } { N ( \mu , \sigma ^ { 2 } ) } .
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
For an illustration, please see Fig. 1.
|
| 59 |
+
|
| 60 |
+

|
| 61 |
+
Figure 1: Density functions of the $\mathcal { N } ( 0 , 1 )$ and $\mathcal { N } _ { \sigma , 1 } ^ { \mathrm { m i x } }$ feature. A new entry is independently sampled from the 1-dimensional distribution being either a standard Gaussian or trimodal Gaussian mixture. Smaller $\sigma$ leads to higher concentration around each modes.
|
| 62 |
+
|
| 63 |
+
Let $\chi ^ { 2 } ( k , \lambda )$ denote the noncentral chi-squared distribution with $k$ degrees of freedom and the non-centrality parameter $\lambda$ . For example, if $X _ { i } \sim \mathcal { N } ( \mu _ { i } , 1 )$ (for $i = 1 , 2 , \ldots , k )$ are independent Gaussian random variables, we have ${ \textstyle \sum _ { i = 1 } ^ { k } X _ { i } ^ { 2 } \sim \chi ^ { 2 } ( k , \lambda ) }$ , where $\begin{array} { r } { \lambda = \sum _ { i = 1 } ^ { k } \mu _ { i } ^ { 2 } } \end{array}$ . We also denote by $\chi ^ { 2 } ( k )$ the (central) chi-squared distribution with $k$ degrees and the $F$ -distribution by $F ( d _ { 1 } , d _ { 2 } )$ where $d _ { 1 }$ and $d _ { 2 }$ are the degrees of freedom.
|
| 64 |
+
|
| 65 |
+
Problem Setup. Let $x _ { 1 } , \ldots , x _ { n } \in \mathbb { R } ^ { D }$ be column vectors that represent the training data of size $n$ and let $\boldsymbol { x } _ { \mathrm { t e s t } } \boldsymbol { \bar { \in } } \mathbb { R } ^ { D }$ be a column vector that represents the test data. We assume that they are all independently drawn from a distribution
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
x _ { 1 } , \ldots , x _ { n } , x _ { \mathrm { t e s t } } \overset { i i d } { \sim } \mathcal { D } .
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
Let us consider a linear regression problem on the first $d$ features, where $d \leq D$ for some arbitrary large $D$ . Here, $d$ can be viewed as the number of features revealed. Then the feature vectors are $\tilde { x } _ { 1 } , \ldots , \tilde { x } _ { n }$ , where $\widetilde { x } _ { i } = x _ { i } [ 1 : d ] \in \mathbb { R } ^ { d }$ denotes the first $d$ entries of $x _ { i }$ . The corresponding response variable $y _ { i }$ satisfies
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
y _ { i } = \tilde { x } _ { i } ^ { \top } \beta + \varepsilon _ { i } , \quad i = 1 , \ldots , n ,
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
where the noise $\varepsilon _ { i } \sim \mathcal { N } ( 0 , \eta ^ { 2 } )$ . We use the same setup as in [34] (see Equations (1) and (2) in [34]). Moreover, in another closely related work [41], if the kernel is set to the linear kernel, it is equivalent to our setup.
|
| 78 |
+
|
| 79 |
+
Next, we introduce the estimate $\hat { \beta }$ of $\beta$ and its excess generalization loss. Let $\varepsilon = ( \varepsilon _ { 1 } , \ldots , \varepsilon _ { n } ) ^ { \top } \in \mathbb { R } ^ { n }$ denote the noise vector. The design matrix $A$ equals $[ \tilde { x } _ { 1 } , \ldots , \tilde { x } _ { n } ] ^ { \top } \in \mathbb { R } ^ { n \times d }$ . Let $x = x _ { \mathrm { t e s t } } [ 1 : d ]$ denote the first $d$ features of the test data. For the underparametrized regime where $d < n$ , the least square solution on the training data is $A ^ { + } ( A \beta + \varepsilon )$ . For the overparametrized regime where $d > n$ , $A ^ { + } ( A \beta + \varepsilon )$ is the minimum-norm solution. In both regimes we consider the solution ${ \hat { \boldsymbol { \beta } } } \triangleq A ^ { + } ( A \beta + \varepsilon )$ . The excess generalization loss on the test data is then given by
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\begin{array} { r l } & { L _ { d } \triangleq \mathbb { E } [ ( y - x ^ { \top } \hat { \beta } ) ^ { 2 } - ( y - x ^ { \top } \beta ) ^ { 2 } ] } \\ & { \quad = \mathbb { E } [ ( x ^ { \top } ( \hat { \beta } - \beta ) ) ^ { 2 } ] } \\ & { \quad = \mathbb { E } [ ( x ^ { \top } ( ( A ^ { + } A - I ) \beta + A ^ { + } \varepsilon ) ) ^ { 2 } ] } \\ & { \quad = \mathbb { E } [ ( x ^ { \top } ( A ^ { + } A - I ) \beta ) ^ { 2 } ] + \mathbb { E } [ ( x ^ { \top } A ^ { + } \varepsilon ) ^ { 2 } ] } \\ & { \quad = \mathbb { E } [ ( x ^ { \top } ( A ^ { + } A - I ) \beta ) ^ { 2 } ] + \eta ^ { 2 } \mathbb { E } ( A ^ { \top } ) ^ { + } x ^ { 2 } , } \end{array}
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where $y = x ^ { \top } \beta + \varepsilon _ { \mathrm { t e s t } }$ and $\varepsilon _ { \mathrm { t e s t } } \sim \mathcal { N } ( 0 , \eta ^ { 2 } )$ . We call the term $\mathbb { E } \left[ ( x ^ { \top } ( A ^ { + } A - I ) \beta ) ^ { 2 } \right]$ the bias and call the term $\eta ^ { 2 } \mathbb { E } \left\| ( A ^ { \top } ) ^ { + } x \right\| ^ { 2 }$ the variance.
|
| 86 |
+
|
| 87 |
+
The next remark shows that in the underparametrized regime, the bias vanishes. The vanishing bias in the underparametrized regime is also observed by Hastie et al. [34] and shown in their Proposition 2.
|
| 88 |
+
|
| 89 |
+
Remark 1. In the underparametrized regime, if $\mathcal { D }$ is a continous distribution (our construction presented later satisfies this condition), the matrix $A$ has independent column almost surely. In this case, we have $A ^ { + } A = I$ and therefore the bias $\mathbb { E } \left[ ( x ^ { \top } ( A ^ { + } A - I ) \beta ) ^ { 2 } \right]$ vanishes irrespective of $\beta$ . In other words, in the underparametrized regime, $L _ { d }$ equals $\eta ^ { 2 } \mathbb { E } \| ( A ^ { \top } ) ^ { + } x \| ^ { 2 }$ .
|
| 90 |
+
|
| 91 |
+
According to Remark 1, we have $L _ { d } = \eta ^ { 2 } \mathbb { E } \| ( A ^ { \top } ) ^ { + } x \| ^ { 2 }$ in the underparametrized regime. It also holds in the overparametrized regime when $\beta = 0$ . Without loss of generality, we assume $\eta = 1$ in the underparametrized regime (for all $\beta$ ). In the overparametrized regime, we also assume $\eta = 1$ for the $\beta = 0$ case. In this case, we have
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
L _ { d } = \mathbb { E } \| ( A ^ { \top } ) ^ { + } x \| ^ { 2 } .
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
We assume a general $\eta$ (i.e., not necessarily being 1) in the overparametrized regime when $\beta$ is non-zero.
|
| 98 |
+
|
| 99 |
+
We would like to study the change in the loss caused by the growth in the number of features revealed. Recall $L _ { d } = \mathbb { E } \| ( A ^ { \top } ) ^ { + } x \| ^ { 2 }$ . Once we reveal a new feature, which adds a new row $b ^ { \top }$ to $A ^ { \top }$ and a new component $a _ { 1 }$ to $x$ , we have $L _ { d + 1 } = \mathbb { E } { \left. \left[ \binom { A ^ { \top } } { b ^ { \top } } \right] ^ { + } \left[ \frac { x } { a _ { 1 } } \right] \right. } ^ { 2 } .$
|
| 100 |
+
|
| 101 |
+
Local Maximum and Multiple Descent. Throughout the paper, we say that a local maximum occurs at a dimension $d \geq 1$ if $L _ { d - 1 } < L _ { d }$ and $L _ { d } > L _ { d + 1 }$ . Intuitively, a local maximum occurs if there is an increasing stage of the generalization loss, followed by a decreasing stage, as the dimension $d$ grows. Additionally, we define $L _ { 0 } \triangleq - \infty$ . If the generalization loss exhibits a single descent, based on our definition, a unique local maximum occurs at $d = 1$ . For a double-descent generalization curve, a local maximum occurs at two different dimensions. In general, if we observe local maxima at multiple dimensions, we say there is a multiple descent.
|
| 102 |
+
|
| 103 |
+
# 4 Underparametrized Regime
|
| 104 |
+
|
| 105 |
+
First, we present our main theorem for the underparametrized regime below, whose proof is deferred to the end of Section 4. It states that the generalization loss $L _ { d }$ is always non-decreasing as $d$ grows. Moreover, it is possible to have an arbitrarily large ascent, i.e., $L _ { d + 1 } - L _ { d } > C$ for any $C > 0$ .
|
| 106 |
+
|
| 107 |
+
Theorem 1 (Proof in Section 4.1). If $d < n$ , we have $L _ { d + 1 } \ge L _ { d }$ irrespective of the data distribution Moreover, for any $C > 0$ , there exists a distribution $\mathcal { D }$ such that $L _ { d + 1 } - L _ { d } > C$ .
|
| 108 |
+
|
| 109 |
+
Remark 2 ( $\mathcal { D }$ can be a product distribution). The first part of Theorem 1 holds irrespective of the data distribution. For the second part of the theorem ( i.e., for any $C > 0$ there exists a distribution such that $L _ { d + 1 } - L _ { d } > C )$ to hold, one extremely simple and elegant choice of the distribution $\mathcal { D }$ is a product distribution $\mathcal { D } = \mathcal { D } _ { 1 } \times \cdot \cdot \cdot \times \mathcal { D } _ { D }$ such that $x _ { i , j } \stackrel { i i d } { \sim } \mathcal { D } _ { j }$ for all $1 \leq i \leq n$ , where $\mathcal { D } _ { j }$ is a Gaussian mixture $\mathcal { N } _ { \sigma _ { j } , 1 } ^ { \mathrm { m i x } }$ for some $\sigma _ { j } > 0$ . Since the second part of Theorem 1 is of independent interest, the result is summarized by Theorem 4.
|
| 110 |
+
|
| 111 |
+
Remark 3 (Kernel regression on Gaussian data). In light of Remark 2, $\mathcal { D }$ can be chosen to be a product distribution that consists $\mathcal { N } _ { \sigma _ { j } } ^ { \mathrm { m i x } }$ . Note that one can simulate $\mathcal { N } _ { \sigma , 1 } ^ { \mathrm { m i x } }$ with $\mathcal { N } ( 0 , 1 )$ through the inverse transform sampling. To see this, let $F _ { \mathcal { N } ( 0 , 1 ) }$ and $F _ { \mathrm { \mathcal { N } _ { \sigma , 1 } ^ { \mathrm { m i x } } } }$ be the cdf of $\mathcal { N } ( 0 , 1 )$ and $\mathcal { N } _ { \sigma , 1 } ^ { \mathrm { m i x } }$ , respectively. If $X \sim \mathcal { N } ( 0 , 1 )$ , we have $F _ { \mathcal { N } ( 0 , 1 ) } ( X ) \sim \mathrm { U n i f } ( ( 0 , 1 ) )$ and therefore $\varphi _ { \sigma } ( X ) \triangleq$ $F _ { \mathcal { N } _ { \sigma , 1 } ^ { \mathrm { m i x } } } ^ { - 1 } ( F _ { \mathcal { N } ( 0 , 1 ) } ( X ) ) \sim \mathcal { N } _ { \sigma , 1 } ^ { \mathrm { m i x } }$ . In fact, we can use a multivariate Gaussian $\mathcal { D } ^ { \prime } = \mathcal { N } ( 0 , I _ { D \times D } )$ and a sequence of non-linear kernels $k ^ { [ 1 : d ] } ( x , x ^ { \prime } )$ , $\langle \phi ^ { [ 1 : d ] } ( x ) , \phi ^ { [ 1 : d ] } ( x ^ { \prime } ) \rangle$ , where the feature map is $\phi ^ { [ 1 : d ] } ( x ) \ \triangleq \ [ \phi _ { 1 } ( x _ { 1 } ) , \phi _ { 2 } ( x _ { 2 } ) , \ldots , \phi _ { d } ( x _ { d } ) ] ^ { \top } \ \in \ \mathbb { R } ^ { d }$ . Here is a simple rule for defining $\phi _ { j }$ : if $\mathcal { D } _ { j } = \mathcal { N } _ { \sigma _ { j } } ^ { \mathrm { m i x } }$ , we set $\phi _ { j }$ to $\varphi _ { \sigma _ { j } }$ . Thus, the problem becomes a kernel regression problem on the standard Gaussian data.
|
| 112 |
+
|
| 113 |
+
The first part of Theorem 1, which says that $L _ { d }$ is increasing (or more precisely, non-decreasing), agrees with Figure 1 of [11] and Proposition 2 of [34]. In [34], they proved that the risk increases with $\gamma = d / n$ . Note that, at first glance, Theorem 1 may look counterintuitive since it does not obey the classical U-shaped generalization curve. However, we would like to emphasize that the U-shaped curve does not always occur. In Figure 1 and Proposition 2 of these two papers respectively, there is no U-shaped curve. The intuition behind Theorem 1 is that in the underparametrized setting, the bias is always zero and as $d$ approaches $n$ , the variance keeps increasing.
|
| 114 |
+
|
| 115 |
+
Coming to the second part of Theorem 1, we now discuss how we will construct such a distribution $\mathcal { D }$ inductively to satisfy $L _ { d + 1 } - L _ { d } > C$ . We fix $d$ . Again, denote the first $d$ features of $x _ { \mathrm { t e s t } }$ by $x \triangleq x _ { \mathrm { t e s t } } [ 1 : d ]$ . Let us add an additional component to the training data $x _ { 1 } [ 1 : d ] , \dotsc , x _ { n } [ 1 : d ]$ and test data $x$ so that the dimension $d$ is incremented by 1. Let $b _ { i } \in \mathbb { R }$ denote the additional component that we add to the vector $x _ { i }$ (so that the new vector is given as $[ x _ { i } [ 1 : d ] ^ { \top } , b _ { i } ] ^ { \top }$ . Similarly, let $a _ { 1 } \in \mathbb { R }$ denote the additional component that we add to the test vector $x$ . We form the column vector $b = [ b _ { 1 } , \ldots , b _ { n } ] ^ { \top } \in \mathbb { R } ^ { n }$ that collects all additional components that we add to the training data.
|
| 116 |
+
|
| 117 |
+
We consider the change in the generalization loss as follows
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
L _ { d + 1 } - L _ { d } = \mathbb { E } \left[ \left. \left[ \mathbf { \Sigma } _ { b } ^ { A } \right] ^ { + } \left[ \mathbf { \Sigma } _ { a _ { 1 } } ^ { x } \right] \right. ^ { 2 } - \left. ( A ^ { + } ) ^ { \top } x \right. ^ { 2 } \right] .
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
Note that the components $b _ { 1 } , \ldots , b _ { n } , a _ { 1 }$ are i.i.d. The proof of Theorem 1 starts with Lemma 2 which relates the pseudo-inverse of $[ A , b ] ^ { \top }$ to that of $A ^ { \top }$ . In this way, we can decompose $\left\| \left[ \binom { A ^ { \top } } { b ^ { \top } } \right] ^ { + } \left[ \binom { x } { a _ { 1 } } \right] \right\| ^ { 2 }$ into multiple terms for further careful analysis in the proofs hereinafter.
|
| 124 |
+
|
| 125 |
+
Lemma 2 (Proof in Appendix B.1). Let $A \in \mathbb { R } ^ { n \times d }$ and $0 \neq b \in \mathbb { R } ^ { n \times 1 }$ , where $n \geq d + 1$ Additionally, let $P = A A ^ { + }$ and $\begin{array} { r } { Q = b b ^ { + } = \frac { b b ^ { \top } } { \| b \| ^ { 2 } } } \end{array}$ bb>2 , and define z , b>(I−P )b2 . If $z \neq 0$ and the columnwise partitioned matrix $[ A , b ]$ has linearly independent columns, we have
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
\begin{array} { r l } & { \left[ \boldsymbol { A } ^ { \top } \right] ^ { + } = \left[ \left( I - \frac { b b ^ { \top } } { \| b \| ^ { 2 } } \right) \left( I + \frac { \boldsymbol { A } \boldsymbol { A } ^ { + } b \boldsymbol { b } ^ { \top } } { \| b \| ^ { 2 } - b ^ { \top } \boldsymbol { A } \boldsymbol { A } ^ { + } b } \right) ( \boldsymbol { A } ^ { + } ) ^ { \top } , \frac { ( I - \boldsymbol { A } \boldsymbol { A } ^ { + } ) \boldsymbol { b } } { \| b \| ^ { 2 } - b ^ { \top } \boldsymbol { A } \boldsymbol { A } ^ { + } \boldsymbol { b } } \right] } \\ & { = \left[ ( I - \boldsymbol { Q } ) ( I + \frac { P Q } { 1 - \mathrm { t r } ( P Q ) } ) ( \boldsymbol { A } ^ { + } ) ^ { \top } , \frac { ( I - P ) \boldsymbol { b } } { b ^ { \top } ( I - P ) \boldsymbol { b } } \right] } \\ & { = \left[ ( I - Q ) ( I + \frac { P Q } { z } ) ( \boldsymbol { A } ^ { + } ) ^ { \top } , \frac { ( I - P ) \boldsymbol { b } } { b ^ { \top } ( I - P ) \boldsymbol { b } } \right] . } \end{array}
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
In our construction of $\mathcal { D }$ , the components $\mathcal { D } _ { j }$ are all continuous distributions. The matrix $I - P$ is an orthogonal projection matrix and therefore $\operatorname { i r a n k } ( I - P ) = n - d .$ . As a result, it holds almost surely that $b \neq 0$ , $z \neq 0$ , and $[ A , b ]$ has linearly independent columns. Thus the assumptions of Lemma 2 are satisfied almost surely. In the sequel, we assume that these assumptions are always fulfilled.
|
| 132 |
+
|
| 133 |
+
Theorem 3 guarantees that if $L _ { d } = \mathbb { E } \left\| ( A ^ { + } ) ^ { \top } x \right\| ^ { 2 }$ is finite and the $( d + 1 )$ -th features $b _ { 1 } , \ldots , b _ { n } , a _ { 1 }$ are i.i.d. sampled from $\mathcal { N } ( 0 , 1 )$ or $\mathcal { N } _ { \sigma , 1 } ^ { \mathrm { m i x } }$ , $L _ { d + 1 } = \mathbb { E } \| [ { \binom { A ^ { \top } } { b ^ { \top } } } ^ { + } [ { \binom { x } { a _ { 1 } } } ] \| ^ { 2 }$ is also finite.
|
| 134 |
+
|
| 135 |
+
Theorem 3 (Proof in Appendix B.2). Let $z$ be as defined in Lemma 2. If $b _ { 1 } , \ldots , b _ { n } , a _ { 1 }$ are i.i.d. and follow a distribution with mean zero, conditioned on $A$ and $x$ , we have
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
\mathbb { E } _ { b , a _ { 1 } } \left[ \left. \left[ \boldsymbol { \mathsf { A } } ^ { \top } \right] ^ { + } \left[ \boldsymbol { \mathsf { x } } _ { 1 } \right] \right. ^ { 2 } \right] \leq \mathbb { E } _ { b , a _ { 1 } } \left[ \frac { 1 } { z } \left. ( \boldsymbol { A } ^ { + } ) ^ { \top } \boldsymbol { \mathsf { x } } \right. ^ { 2 } + \frac { a _ { 1 } ^ { 2 } } { b ^ { \top } ( I - P ) b } \right] .
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
In particular, if $d + 2 < n$ and $b _ { 1 } , \dots , b _ { n } , a _ { 1 } \overset { i i d } { \sim } \mathcal { N } ( 0 , 1 )$ , conditioned on $A$ and $x$ , we have
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
\begin{array} { r l } & { \mathbb { E } _ { b , a _ { 1 } } \left[ \left. \left[ \boldsymbol { \mathsf { A } } ^ { \top } \right] ^ { + } \left[ \boldsymbol { \mathsf { x } } _ { 1 } \right] \right. ^ { 2 } \right] \leq \frac { ( n - 2 ) \left. ( \boldsymbol { \mathsf { A } } ^ { + } ) ^ { \top } \boldsymbol { \mathsf { x } } \right. ^ { 2 } + 1 } { n - d - 2 } . } \end{array}
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
$d + 2 < n$ and $b _ { 1 } , \dots , b _ { n } , a _ { 1 } \overset { i i d } { \sim } \mathcal { N } _ { \sigma , 1 } ^ { \mathrm { m i x } }$ , conditioned on $A$ and $x$ , we have
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
\mathbb { E } _ { b , a _ { 1 } } \| [ \binom { A ^ { \top } } { b ^ { \top } } ^ { + } [ \frac { x } { a _ { 1 } } ] \| ^ { 2 } \leq \frac { ( n - 2 + \sqrt { d } ) \| ( A ^ { + } ) ^ { \top } x \| ^ { 2 } + 2 / ( 3 \sigma ^ { 2 } ) + 1 } { n - d - 2 } .
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
Using Theorem 3, we can show inductively (on $d$ ) that $L _ { d }$ is finite for every $d$ . Provided that we are able to guarantee finite $L _ { 1 }$ , Theorem 3 implies that $L _ { d }$ is finite for every $d$ if the components are always sampled from $\mathcal { N } ( 0 , 1 )$ or $\mathcal { N } _ { \sigma , 1 } ^ { \mathrm { m i x } }$ .
|
| 154 |
+
|
| 155 |
+
Making a large $L _ { d }$ can be achieved by adding an entry sampled from $\mathcal { N } _ { \sigma , 1 } ^ { \mathrm { m i x } }$ when the data dimension increases from $d - 1$ to $d$ in the previous step. Theorem 4 shows that adding a $\mathcal { N } _ { \sigma , 1 } ^ { \mathrm { m i x } }$ feature can increase the loss by arbitrary amount, which in turn implies the second part of Theorem 1.
|
| 156 |
+
|
| 157 |
+
Theorem 4 (Proof in Appendix B.4). For any $\sigma > 0$ such that if $\mathbf { \dot { \cdot } } b _ { 1 } , \dots , b _ { n } , a _ { 1 } \overset { i i d } { \sim } \mathcal { N } _ { \sigma , 1 } ^ { \operatorname* { m i x } }$ , we have $C > 0$ and $\mathbb { E } \left\| ( A ^ { + } ) ^ { \top } x \right\| ^ { 2 } < + \infty$ , there exists $a$
|
| 158 |
+
|
| 159 |
+
$$
|
| 160 |
+
\begin{array} { r } { \mathbb { E } \left[ \left. \left[ \boldsymbol { \mathsf { A } } ^ { \top } \right] ^ { + } \left[ \boldsymbol { \mathsf { x } } _ { 1 } \right] \right. ^ { 2 } - \left. ( \boldsymbol { \mathsf { A } } ^ { + } ) ^ { \top } \boldsymbol { \mathsf { x } } \right. ^ { 2 } \right] > C . } \end{array}
|
| 161 |
+
$$
|
| 162 |
+
|
| 163 |
+
We are now ready to prove Theorem 1.
|
| 164 |
+
|
| 165 |
+
# 4.1 Proof of Theorem 1
|
| 166 |
+
|
| 167 |
+
Proof. We follow the notation convention in (3):
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
\begin{array} { r } { L _ { d + 1 } - L _ { d } = \mathbb { E } \left[ \left. \left[ \boldsymbol { \mathsf { A } } ^ { \top } \right] ^ { + } \left[ \boldsymbol { \mathsf { a } } _ { 1 } \right] \right. ^ { 2 } - \left. ( \boldsymbol { A } ^ { \top } ) ^ { + } \boldsymbol { \mathsf { x } } \right. ^ { 2 } \right] . } \end{array}
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
Recall d < n and the matrix B0 , $B ^ { \prime } \triangleq { \left[ \begin{array} { l } { A ^ { \top } } \\ { b ^ { \top } } \end{array} \right] }$ is of size $( d + 1 ) \times n$ . Both matrices $B ^ { \prime }$ and $B \triangleq A ^ { \intercal }$ are fat matrices. As a result, if $x ^ { \prime } \triangleq { \left[ \begin{array} { l } { x } \\ { a _ { 1 } } \end{array} \right] }$ , we have
|
| 174 |
+
|
| 175 |
+
$$
|
| 176 |
+
\| B ^ { \prime + } x ^ { \prime } \| ^ { 2 } = \operatorname* { m i n } _ { z : B ^ { \prime } z = x ^ { \prime } } \| z \| ^ { 2 } , \quad \| B ^ { + } x \| ^ { 2 } = \operatorname* { m i n } _ { z : B z = x } \| z \| ^ { 2 } .
|
| 177 |
+
$$
|
| 178 |
+
|
| 179 |
+
Since $\{ z \mid B ^ { \prime } z = x ^ { \prime } \} \subseteq \{ z \mid B z = x \}$ , we get $\| B ^ { \prime + } x ^ { \prime } \| ^ { 2 } \geq \| B ^ { + } x \| ^ { 2 }$ . Therefore, we obtain $L _ { d + 1 } \ge L _ { d }$ . The second part follows from Theorem 4.
|
| 180 |
+
|
| 181 |
+
Remark 4. Remark 2 and the proof of Theorem 4 indicate that $\mathcal { D } = \mathcal { D } _ { 1 } \times \cdot \cdot \cdot \times \mathcal { D } _ { D }$ is a product distribution. The construction in the proof also shows that the generalization curve is determined by the specific choice of the $\mathcal { D } _ { i }$ ’s. Note that permuting the order of $\mathcal { D } _ { i }$ ’s is equivalent to changing the order by which the features are being revealed (i.e., permuting the entries of the data $x _ { i }$ ’s). Therefore, given the same data points $x _ { 1 } , \cdot \cdot \cdot , x _ { n } \in \mathbb { R } ^ { D }$ , one can create different generalization curves simply by changing the order of the feature-revealing process.
|
| 182 |
+
|
| 183 |
+

|
| 184 |
+
Figure 2: Illustration of the multiple descent phenomenon for the generalization loss $L _ { d }$ versus the dimension of data $d$ in the overparametrized regime starting from $d = n { + } 8$ . One can fully control the generalization curve to increase or decrease as specified by the sequence $\Delta = \{ \downarrow , \uparrow , \downarrow , \downarrow , \uparrow , \downarrow , . . . \}$ . Adding a new feature with Gaussian mixture distribution increases the loss, while adding one with Gaussian distribution decreases the loss.
|
| 185 |
+
|
| 186 |
+
# 5 Overparametrized Regime
|
| 187 |
+
|
| 188 |
+
In this section, we study the multiple decent phenomenon in the overparametrized regime. Note that as stated in Section 3, we consider the minimum-norm solution here. We first consider the case where the model $\beta = 0$ and $L _ { d }$ is as defined in (2). Then we discuss the setting $\beta \neq 0$ .
|
| 189 |
+
|
| 190 |
+
As stated in the following theorem, we require $d \ge n + 8$ . This is merely a technical requirement and we can still say that $d$ starts at roughly the same order as $n$ . In other words, the result covers almost the entire spectrum of the overparametrized regime.
|
| 191 |
+
|
| 192 |
+
Theorem 5 (Overparametrized regime, $\beta ~ = ~ 0 ,$ . Let $\begin{array} { l l l } { n } & { < } & { D ~ - ~ 9 } \end{array}$ . Given any sequence $\Delta _ { n + 8 } , \Delta _ { n + 9 } , . . . , \Delta _ { D - 1 }$ where $\Delta _ { d } \in \{ \uparrow , \downarrow \}$ , there exists a distribution $\mathcal { D }$ such that for every $n + 8 \leq d \leq D - 1$ , we have
|
| 193 |
+
|
| 194 |
+
$$
|
| 195 |
+
L _ { d + 1 } \left\{ \stackrel { > } { _ { < } } L _ { d } , \quad i f \Delta _ { d } = \uparrow \right.
|
| 196 |
+
$$
|
| 197 |
+
|
| 198 |
+
In Theorem 5, the sequence $\Delta _ { n + 8 } , \Delta _ { n + 9 } , \cdot \cdot \cdot , \Delta _ { D - 1 }$ is just used to specify the increasing/decreasing behavior of the $L _ { d }$ sequence for $d > n + 8$ . Compared to Theorem 1 for the underparametrized regime, where $L _ { d }$ always increases, Theorem 5 indicates that one is able to fully control both ascents and descents in the overparametrized regime. Fig. 2 is an illustration.
|
| 199 |
+
|
| 200 |
+
We now present tools for proving Theorem 5. Lemma 6 gives the pseudo-inverse of $A$ when $d > n$ . Lemma 6 (Proof in Appendix C.1). Let $A \in \mathbb { R } ^ { n \times d }$ and $b \in \mathbb { R } ^ { n \times 1 }$ , where $n \leq d$ . Assume that matrix $A$ and the columnwise partitioned matrix $B \triangleq [ A , b ]$ have linearly independent rows. Let $G \triangleq ( A A ^ { \top } ) ^ { - 1 } \in \mathbb { R } ^ { n \times n }$ and $\begin{array} { r } { u \triangleq \frac { b ^ { \intercal } G } { 1 + b ^ { \intercal } G b } \in \mathbb { R } ^ { 1 \times n } } \end{array}$ . We have
|
| 201 |
+
|
| 202 |
+
$$
|
| 203 |
+
\left[ \begin{array} { l } \boldsymbol { A } ^ { \top } \right] ^ { + } = \left[ ( \boldsymbol { I } - b \boldsymbol { u } ) ^ { \top } ( \boldsymbol { A } ^ { + } ) ^ { \top } , \boldsymbol { u } ^ { \top } \right] . \end{array}
|
| 204 |
+
$$
|
| 205 |
+
|
| 206 |
+
Lemma 7 establishes finite expectation for several random variables. These finite expectation results are necessary for Theorem 8 and Theorem 9 to hold. Technically, they are the dominating random variables needed in Lebesgue’s dominated convergence theorem. Lemma 7 indicates that to guarantee these finite expectations, it suffices to set the first $n + 8$ distributions to the standard normal distribution and then set $\mathcal { D } _ { n + 8 } , \ldots , \mathcal { D } _ { D }$ to either a Gaussian or a Gaussian mixture distribution. In fact, in Theorem 8 and Theorem 9, we always add a Gaussian distribution or a Gaussian mixture.
|
| 207 |
+
|
| 208 |
+
Lemma 7 (Proof in Appendix C.2). Let $\mathcal { D } = \mathcal { D } _ { 1 } \times \cdot \cdot \cdot \times \mathcal { D } _ { D }$ be a product distribution where
|
| 209 |
+
|
| 210 |
+
Let $\mathcal { D } _ { [ 1 : d ] }$ denote $\mathcal { D } _ { 1 } \times \cdots \times \mathcal { D } _ { d }$ . Assume that every row of $A \in \mathbb { R } ^ { n \times d }$ and $x \in \mathbb { R } ^ { d \times 1 }$ are i.i.d. and follow $\mathcal { D } _ { [ 1 : d ] }$ . For any $d$ such that $n + 8 \leq d \leq D$ , all of the followings hold:
|
| 211 |
+
|
| 212 |
+
$$
|
| 213 |
+
\begin{array} { r l r } & { \mathbb E [ \| ( A ^ { + } ) ^ { \top } x \| ^ { 2 } ] < + \infty , } & { \mathbb E [ \lambda _ { \operatorname* { m a x } } ^ { 2 } ( ( A A ^ { \top } ) ^ { - 1 } ) ] < + \infty , } \\ & { \mathbb E [ \lambda _ { \operatorname* { m a x } } ( ( A A ^ { \top } ) ^ { - 1 } ) \| ( A ^ { + } ) ^ { \top } x \| ^ { 2 } ] < + \infty , } & { \mathbb E [ \lambda _ { \operatorname* { m a x } } ^ { 2 } ( ( A A ^ { \top } ) ^ { - 1 } ) \| ( A ^ { + } ) ^ { \top } x \| ^ { 2 } ] < + \infty . } \end{array}
|
| 214 |
+
$$
|
| 215 |
+
|
| 216 |
+
Theorems 8 and 9 are the key technical results for constructing multiple descent in the overparametrized regime. One can create a descent $( L _ { d + 1 } < L _ { d } )$ by adding a Gaussian feature (Theorem 8) and create an ascent $( L _ { d + 1 } > L _ { d } )$ by adding a Gaussian mixture feature (Theorem 9).
|
| 217 |
+
|
| 218 |
+
Theorem 8 (Proof in Appendix C.3). If E $\bar { \mathsf { x } } [ \| ( A ^ { \top } A ) ^ { + } x \| ^ { 2 } ] > 0$ and all equations in (4) hold, there exists $\sigma > 0$ such that i $f a _ { 1 } , b _ { 1 } , \ldots , b _ { n } \stackrel { i i d } { \sim } { \mathcal { N } } ( 0 , \sigma ^ { 2 } )$ , we have
|
| 219 |
+
|
| 220 |
+
$$
|
| 221 |
+
L _ { d + 1 } - L _ { d } = \mathbb { E } \| [ { \binom { A ^ { \top } } { b ^ { \top } } } ^ { + } [ { \binom { x } { a _ { 1 } } } ] \| ^ { 2 } - \mathbb { E } \| ( A ^ { + } ) ^ { \top } x \| ^ { 2 } < 0 .
|
| 222 |
+
$$
|
| 223 |
+
|
| 224 |
+
Theorem 9 shows that adding a Gaussian mixture feature can make $L _ { d + 1 } > L _ { d }$ .
|
| 225 |
+
|
| 226 |
+
Theorem 9 (Proof in Appendix C.4). Assume $\sigma > 0$ such that $i f a _ { 1 } , b _ { 1 } , \ldots , b _ { n } \stackrel { i i d } { \sim } \mathcal { N } _ { \sigma , \mu } ^ { \mathrm { m i x } }$ , we have $\mathbb { E } \| ( A ^ { + } ) ^ { \top } x \| ^ { 2 } < + \infty$ . For any $C > 0$ , there exist $\mu$
|
| 227 |
+
|
| 228 |
+
$$
|
| 229 |
+
L _ { d + 1 } - L _ { d } = \mathbb { E } \| [ { \binom { A ^ { \top } } { b ^ { \top } } } ^ { + } [ { \binom { x } { a _ { 1 } } } ] \| ^ { 2 } - \mathbb { E } \| ( A ^ { + } ) ^ { \top } x \| ^ { 2 } > C .
|
| 230 |
+
$$
|
| 231 |
+
|
| 232 |
+
The proof of Theorem 5 immediately follows from Theorem 8 and Theorem 9.
|
| 233 |
+
|
| 234 |
+
Proof of Theorem 5. We construct the product distribution $\begin{array} { r } { \mathcal { D } = \prod _ { d = 1 } ^ { D } \mathcal { D } _ { d } } \end{array}$ . We set $\mathcal { D } _ { d } = \mathcal { N } ( 0 , 1 )$ for $d = 1 , \dotsc , n + 8$ . For $n + 8 < d \leq D$ , $\mathcal { D } _ { d }$ is either $\textstyle \mathcal { N } ( 0 , \sigma _ { d } ^ { 2 } )$ dor $\sqrt { \operatorname * { m i x } _ { \sigma _ { d } , \mu _ { d } } }$ depending on $\Delta _ { d }$ being either $\downarrow \mathrm { o r } \uparrow$ .
|
| 235 |
+
|
| 236 |
+
First we show that for each step $d$ , the assumption $\mathbb { E } [ \| ( A ^ { \top } A ) ^ { + } x \| ^ { 2 } ] > 0$ of Theorem 8 is satisfied. If $\mathbb { E } [ \| ( A ^ { \top } A ) ^ { + } x \| ^ { 2 } ] = 0$ , we know that $( A ^ { \top } A ) ^ { + } x = 0$ almost surely. Since $\mathcal { D }$ is a continuous distribution, the matrix $A$ has full row rank almost surely. Therefore, $\operatorname { r a n k } ( ( A ^ { \top } A ) ^ { + } ) = \operatorname { r a n k } ( A ^ { \top } A ) = n$ almost surely. Thus $\dim \ker ( A ^ { \top } A ) ^ { + } = d - n \leq d - 1$ almost surely, which implies $x \not \in \ker ( A ^ { \top } A ) ^ { + }$ . In other words, $( A ^ { \top } A ) ^ { + } x \neq 0$ almost surely. We reach a contradiction. Moreover, by Lemma 7, the assumption $\mathbb { E } \| ( A ^ { + } ) ^ { \top } x \| ^ { 2 } < + \infty$ of Theorem 9 is also satisfied.
|
| 237 |
+
|
| 238 |
+
If $\Delta _ { d - 1 } = \downarrow$ , by Theorem 8, there exists $\sigma _ { d } > 0$ such that if $\mathcal { D } _ { d } = \mathcal { N } ( 0 , \sigma _ { d } ^ { 2 } )$ , then $L _ { d } < L _ { d - 1 }$ . Similarly if $\Delta _ { d - 1 } = \uparrow$ , by Theorem 9, there exists $\sigma _ { d }$ and $\mu _ { d }$ such that $\mathcal { D } _ { d } = \mathcal { N } _ { \sigma _ { d } , \mu _ { d } } ^ { \mathrm { m i x } }$ N mixσd,µd guarantees $L _ { d } > L _ { d - 1 }$ .
|
| 239 |
+
|
| 240 |
+
Gaussian $\beta$ setting. In what follows, we study the case where the model $\beta$ is non-zero. In particular, we consider a setting where each entry of $\beta$ is i.i.d. $\mathcal { N } ( 0 , \rho ^ { 2 } )$ . Recalling (1), define the biases
|
| 241 |
+
|
| 242 |
+
$$
|
| 243 |
+
\begin{array} { r } { \mathcal { E } _ { d } \triangleq ( x ^ { \top } ( A ^ { + } A - I ) \beta ) ^ { 2 } , \quad \mathcal { E } _ { d + 1 } \triangleq \left( [ x ^ { \top } , a _ { 1 } ] ( [ A , b ] ^ { + } [ A , b ] - I ) \left[ \beta \right] \right) ^ { 2 } , } \end{array}
|
| 244 |
+
$$
|
| 245 |
+
|
| 246 |
+
and the expected risks
|
| 247 |
+
|
| 248 |
+
$$
|
| 249 |
+
\begin{array} { r } { L _ { d } ^ { \mathrm { e x p } } \triangleq \mathbb E [ \mathcal { E } _ { d } ] + \eta ^ { 2 } \mathbb E \| ( A ^ { \top } ) ^ { + } x \| ^ { 2 } , \quad L _ { d + 1 } ^ { \mathrm { e x p } } \triangleq \mathbb E [ \mathcal { E } _ { d + 1 } ] + \eta ^ { 2 } \mathbb E \| [ [ A ^ { \top } ] ^ { + } [ a _ { 1 } ] ] ^ { 2 } , } \end{array}
|
| 250 |
+
$$
|
| 251 |
+
|
| 252 |
+
where $\beta \sim \mathcal { N } ( 0 , \rho ^ { 2 } I _ { d } )$ and $\beta _ { 1 } \sim \mathcal { N } ( 0 , \rho ^ { 2 } )$ . The second term in $\boldsymbol { L } _ { d } ^ { \mathrm { e x p } }$ and $L _ { d + 1 } ^ { \mathrm { e x p } }$ is the variance term. Note that ${ \cal L } _ { d } ^ { \mathrm { e x p } }$ is the expected value of $L _ { d }$ in (1) and averages over $\beta$ . Theorem 10 shows that one d can add a Gaussian mixture feature in order to make $L _ { d + 1 } ^ { \mathrm { e x p } } > L _ { d } ^ { \mathrm { e x p } }$ , and add a Gaussian feature in order to make Lexpd+1 $L _ { d + 1 } ^ { \exp } < L _ { d } ^ { \exp }$ .
|
| 253 |
+
|
| 254 |
+
Theorem 10 (Proof in Appendix C.5). Let $a _ { 1 } , \beta _ { 1 } \in \mathbb { R } ,$ , $x \in \mathbb { R } ^ { d \times 1 }$ , $\beta \in \mathbb { R } ^ { d \times 1 }$ , $A \in \mathbb { R } ^ { n \times d }$ and $b \in \mathbb { R } ^ { n \times 1 }$ , where $n \leq d$ . Assume that $x , a _ { 1 } , \beta _ { 1 } , \beta , A , b$ are jointly independent, $[ \beta ^ { \top } , \beta _ { 1 } ] ^ { \top } \sim$ $\mathcal { N } ( 0 , \rho ^ { 2 } I _ { d + 1 } )$ . Moreover, assume that the matrix $[ A , b ]$ has linearly independent rows almost surely. The following statements hold:
|
| 255 |
+
|
| 256 |
+
$f a _ { 1 } , b _ { 1 } , \ldots , b _ { n } \stackrel { i i d } { \sim } \mathcal { N } _ { \sigma , \mu } ^ { \mathrm { m i x } } ,$ , for any $C > 0$ , there exist $\mu , \sigma$ such that $L _ { d + 1 } ^ { \mathrm { e x p } } - L _ { d } ^ { \mathrm { e x p } } > C$ (b) If $\cdot _ { a _ { 1 } , b _ { 1 } , . . . , b _ { n } } \stackrel { i i d } { \sim } \mathcal { N } ( 0 , \sigma ^ { 2 } )$ , there exists $\sigma > 0$ such that for all
|
| 257 |
+
|
| 258 |
+
$$
|
| 259 |
+
\rho \leq \eta \sqrt { \frac { \mathbb { E } [ \| ( A ^ { \top } A ) ^ { + } x \| ^ { 2 } ] } { \mathbb { E } \| A ^ { + \top } x \| ^ { 2 } + 1 } } ,
|
| 260 |
+
$$
|
| 261 |
+
|
| 262 |
+
we hav e $L _ { d + 1 } ^ { \exp } < L _ { d } ^ { \exp }$
|
| 263 |
+
|
| 264 |
+
Theorem 10 indicates that for $\beta$ obeying a normal distribution, one can still construct a generalization curve as desired by adding a Gaussian or Gaussian mixture feature properly. We make this construction explicit for any desired generalization curve in (the proof of) Theorem 11. Similar to the construction in the underparametrized regime (for all $\beta$ ) and overparametrization regime (for $\beta = 0$ ), the distribution $\mathcal { D }$ can be made a product distribution.
|
| 265 |
+
|
| 266 |
+
Theorem 11 (Overparametrized regime, $\beta$ being Gaussian). Let $n < D - 9$ . Given any sequence $\Delta _ { n + 8 } , \Delta _ { n + 9 } , . . . , \Delta _ { D - 1 }$ where $\Delta _ { d } \in \{ \uparrow , \downarrow \}$ , there exists $\rho > 0$ and a distribution $\mathcal { D }$ such that for $\beta \sim \mathcal { N } ( 0 , \rho ^ { 2 } )$ and every $n + 8 \leq d \leq D - 1$ , we have
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
\begin{array} { r } { L _ { d + 1 } ^ { \mathrm { e x p } } \left\{ { \stackrel { > } { \sim } } L _ { d } ^ { \mathrm { e x p } } , \quad i f \Delta _ { d } = \uparrow \right. } \\ { \left. < L _ { d } ^ { \mathrm { e x p } } , \quad i f \Delta _ { d } = \downarrow . \right. } \end{array}
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+
Proof of Theorem $I I$ . Define the design matrix $A _ { d } \triangleq [ x _ { 1 } [ 1 : d ] , \dots , x _ { n } [ 1 : d ] ] ^ { \intercal } \in \mathbb { R } ^ { n \times d }$ . Similar to the proof of Theorem 5, we construct the product distribution $\begin{array} { r } { \mathcal { D } = \prod _ { d = 1 } ^ { D } \mathcal { D } _ { d } } \end{array}$ . We set $\mathcal { D } _ { d } = \mathcal { N } ( 0 , 1 )$ for $d = 1 , \ldots , n + 8$ . For $n + 8 < d \leq D$ , $\mathcal { D } _ { d }$ is either $\textstyle \mathcal { N } ( 0 , \sigma _ { d } ^ { 2 } )$ or $\sqrt { \operatorname* { m i x } _ { \sigma _ { d } , \mu _ { d } } }$ depending on $\Delta _ { d }$ being either $\downarrow$ or $\uparrow$ .
|
| 273 |
+
|
| 274 |
+
If $\Delta _ { d - 1 } = \uparrow$ , by Theorem 10, there exists $\sigma _ { d }$ and $\mu _ { d }$ such that $\mathcal { D } _ { d } = \mathcal { N } _ { \sigma _ { d } , \mu _ { d } } ^ { \mathrm { m i x } }$ guarantees $L _ { d } ^ { \exp } > L _ { d - 1 } ^ { \exp }$ $\Delta _ { d - 1 } = \downarrow$
|
| 275 |
+
|
| 276 |
+
$$
|
| 277 |
+
\rho _ { d } \triangleq \eta \sqrt { \frac { \mathbb { E } [ \| ( A _ { d - 1 } ^ { \top } A _ { d - 1 } ) ^ { + } x _ { \mathrm { t e s t } } [ 1 : d - 1 ] \| ^ { 2 } ] } { \mathbb { E } \| A _ { d - 1 } ^ { + \top } x _ { \mathrm { t e s t } } [ 1 : d - 1 ] \| ^ { 2 } + 1 } } .
|
| 278 |
+
$$
|
| 279 |
+
|
| 280 |
+
By Theorem 10, there exists $\sigma _ { d } > 0$ such that if $\rho \leq \rho _ { d }$ and $\mathcal { D } _ { d } = \mathcal { N } ( 0 , \sigma _ { d } ^ { 2 } )$ , then $L _ { d } ^ { \exp } < L _ { d - 1 } ^ { \exp }$ . We
|
| 281 |
+
|
| 282 |
+
$$
|
| 283 |
+
\rho = \operatorname* { m i n } _ { \substack { d : \Delta _ { d - 1 } = \downarrow } } \rho _ { d } .
|
| 284 |
+
$$
|
| 285 |
+
|
| 286 |
+
# 6 Conclusion
|
| 287 |
+
|
| 288 |
+
Our work proves that the expected risk of linear regression can manifest multiple descents when the number of features increases and sample size is fixed. This is carried out through an algorithmic construction of a feature-revealing process where the newly revealed feature follows either a Gaussian distribution or a Gaussian mixture distribution. Notably, the construction also enables us to control local maxima in the underparametrized regime and control ascents/descents freely in the overparametrized regime. Overall, this allows us to design the generalization curve away from the interpolation threshold.
|
| 289 |
+
|
| 290 |
+
We believe that our analysis of linear regression in this paper is a good starting point for explaining non-monotonic generalization curves observed in machine learning studies. Extending these results to more complex problem setups would be a meaningful future direction.
|
| 291 |
+
|
| 292 |
+
# Funding Transparency Statement
|
| 293 |
+
|
| 294 |
+
LC: Funding in direct support of this work: postdoctoral research fellowship by the Simons Institute for the Theory of Computing, University of California, Berkeley, and Google PhD Fellowship by Google. Additional revenues related to this work: internships at Google.
|
| 295 |
+
|
| 296 |
+
MB acknowledges support from NSF IIS-1815697, and the support of the NSF and the Simons Foundation for the Collaboration on the Theoretical Foundations of Deep Learning through awards DMS-2031883 and #814639.
|
| 297 |
+
|
| 298 |
+
AK: Funding in direct support of this work: NSF (IIS-1845032) and ONR (N00014-19-1-2406).
|
| 299 |
+
|
| 300 |
+
# References
|
| 301 |
+
|
| 302 |
+
[1] M. S. Advani and A. M. Saxe. High-dimensional dynamics of generalization error in neural networks. arXiv preprint arXiv:1710.03667, 2017.
|
| 303 |
+
[2] M. S. Advani, A. M. Saxe, and H. Sompolinsky. High-dimensional dynamics of generalization error in neural networks. Neural Networks, 132:428–446, 2020.
|
| 304 |
+
[3] Z. Allen-Zhu, Y. Li, and Z. Song. A convergence theory for deep learning via overparameterization. In International Conference on Machine Learning, pages 242–252, 2019.
|
| 305 |
+
[4] S. Arora, S. S. Du, W. Hu, Z. Li, R. R. Salakhutdinov, and R. Wang. On exact computation with an infinitely wide neural net. In Advances in Neural Information Processing Systems, pages 8141–8150, 2019.
|
| 306 |
+
[5] S. Arora, S. S. Du, W. Hu, Z. Li, and R. Wang. Fine-grained analysis of optimization and generalization for overparameterized two-layer neural networks. In ICML, pages 477–502, 2019.
|
| 307 |
+
[6] S. Arora, S. S. Du, Z. Li, R. Salakhutdinov, R. Wang, and D. Yu. Harnessing the power of infinitely wide deep nets on small-data tasks. In International Conference on Learning Representations, 2019. [7] J. K. Baksalary and O. M. Baksalary. Particular formulae for the moore–penrose inverse of a columnwise partitioned matrix. Linear algebra and its applications, 421(1):16–23, 2007.
|
| 308 |
+
[8] P. L. Bartlett, P. M. Long, G. Lugosi, and A. Tsigler. Benign overfitting in linear regression. Proceedings of the National Academy of Sciences, 2020.
|
| 309 |
+
[9] M. Belkin, D. Hsu, S. Ma, and S. Mandal. Reconciling modern machine learning and the bias-variance trade-off. stat, 1050:28, 2018.
|
| 310 |
+
[10] M. Belkin, S. Ma, and S. Mandal. To understand deep learning we need to understand kernel learning. In International Conference on Machine Learning, pages 541–549, 2018.
|
| 311 |
+
[11] M. Belkin, D. Hsu, and J. Xu. Two models of double descent for weak features. arXiv preprint arXiv:1903.07571, 2019.
|
| 312 |
+
[12] M. Belkin, A. Rakhlin, and A. B. Tsybakov. Does data interpolation contradict statistical optimality? In The 22nd International Conference on Artificial Intelligence and Statistics, pages 1611–1619, 2019.
|
| 313 |
+
[13] Y. Bengio, R. Ducharme, P. Vincent, and C. Jauvin. A neural probabilistic language model. Journal of machine learning research, 3(Feb):1137–1155, 2003.
|
| 314 |
+
[14] Y. Cao and Q. Gu. Generalization bounds of stochastic gradient descent for wide and deep neural networks. In Advances in Neural Information Processing Systems, pages 10836–10846, 2019.
|
| 315 |
+
[15] A. Caponnetto and E. De Vito. Optimal rates for the regularized least-squares algorithm. Foundations of Computational Mathematics, 7(3):331–368, 2007.
|
| 316 |
+
[16] E. Caron and S. Chretien. A finite sample analysis of the double descent phenomenon for ridge function estimation. arXiv preprint arXiv:2007.12882, 2020.
|
| 317 |
+
[17] M. Caron, P. Bojanowski, A. Joulin, and M. Douze. Deep clustering for unsupervised learning of visual features. In Proceedings of the European Conference on Computer Vision (ECCV), pages 132–149, 2018.
|
| 318 |
+
[18] L. Chen and S. Xu. Deep neural tangent kernel and laplace kernel have the same rkhs. In ICLR, 2021.
|
| 319 |
+
[19] L. Chen, Y. Min, M. Zhang, and A. Karbasi. More data can expand the generalization gap between adversarially robust and standard models. In International Conference on Machine Learning, pages 1670–1680. PMLR, 2020.
|
| 320 |
+
[20] Y. Dar, P. Mayer, L. Luzi, and R. G. Baraniuk. Subspace fitting meets regression: The effects of supervision and orthonormality constraints on double descent of generalization errors. In ICML, 2020.
|
| 321 |
+
[21] S. d’Ascoli, L. Sagun, and G. Biroli. Triple descent and the two kinds of overfitting: Where & why do they appear? arXiv preprint arXiv:2006.03509, 2020.
|
| 322 |
+
[22] E. De Vito, A. Caponnetto, and L. Rosasco. Model selection for regularized least-squares algorithm in learning theory. Foundations of Computational Mathematics, 5(1):59–85, 2005.
|
| 323 |
+
[23] S. Du, J. Lee, H. Li, L. Wang, and X. Zhai. Gradient descent finds global minima of deep neural networks. In International Conference on Machine Learning, pages 1675–1685, 2019.
|
| 324 |
+
[24] Y. Fei and Y. Chen. Exponential error rates of sdp for block models: Beyond grothendieck’s inequality. IEEE Transactions on Information Theory, 65(1):551–571, 2018.
|
| 325 |
+
[25] Y. Fei and Y. Chen. Hidden integrality of sdp relaxations for sub-gaussian mixture models. In Conference On Learning Theory, pages 1931–1965. PMLR, 2018.
|
| 326 |
+
[26] Y. Fei and Y. Chen. Achieving the bayes error rate in stochastic block model by sdp, robustly. In Conference on Learning Theory, pages 1235–1269. PMLR, 2019.
|
| 327 |
+
[27] Y. Fei and Y. Chen. Achieving the bayes error rate in synchronization and block models by sdp, robustly. IEEE Transactions on Information Theory, 66(6):3929–3953, 2020.
|
| 328 |
+
[28] Y. Fei, Z. Yang, Y. Chen, Z. Wang, and Q. Xie. Risk-sensitive reinforcement learning: Nearoptimal risk-sample tradeoff in regret. arXiv preprint arXiv:2006.13827, 2020.
|
| 329 |
+
[29] M. Geiger, S. Spigler, S. d’Ascoli, L. Sagun, M. Baity-Jesi, G. Biroli, and M. Wyart. Jamming transition as a paradigm to understand the loss landscape of deep neural networks. Physical Review E, 100(1):012115, 2019.
|
| 330 |
+
[30] M. Geiger, A. Jacot, S. Spigler, F. Gabriel, L. Sagun, S. d’Ascoli, G. Biroli, C. Hongler, and M. Wyart. Scaling description of generalization with number of parameters in deep learning. Journal of Statistical Mechanics: Theory and Experiment, 2020(2):023401, 2020.
|
| 331 |
+
[31] S. Geman, E. Bienenstock, and R. Doursat. Neural networks and the bias/variance dilemma. Neural computation, 4(1):1–58, 1992.
|
| 332 |
+
[32] B. Ghorbani, S. Mei, T. Misiakiewicz, and A. Montanari. Linearized two-layers neural networks in high dimension. arXiv preprint arXiv:1904.12191, 2019.
|
| 333 |
+
[33] T. Hastie, R. Tibshirani, and J. Friedman. The elements of statistical learning: data mining, inference, and prediction. Springer Science & Business Media, 2009.
|
| 334 |
+
[34] T. Hastie, A. Montanari, S. Rosset, and R. J. Tibshirani. Surprises in high-dimensional ridgeless least squares interpolation. arXiv preprint arXiv:1903.08560, 2019.
|
| 335 |
+
[35] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 770– 778, 2016.
|
| 336 |
+
[36] Y. Huang, Y. Cheng, A. Bapna, O. Firat, D. Chen, M. Chen, H. Lee, J. Ngiam, Q. V. Le, Y. Wu, et al. Gpipe: Efficient training of giant neural networks using pipeline parallelism. In Advances in neural information processing systems, pages 103–112, 2019.
|
| 337 |
+
[37] A. Javanmard, M. Soltanolkotabi, and H. Hassani. Precise tradeoffs in adversarial training for linear regression. In Conference on Learning Theory, 2020.
|
| 338 |
+
[38] A. Krizhevsky, I. Sutskever, and G. E. Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pages 1097–1105, 2012.
|
| 339 |
+
[39] Y. Li and Y. Wei. Minimum $\ell _ { 1 }$ -norm interpolators: Precise asymptotics and multiple descent. arXiv preprint arXiv:2110.09502, 2021.
|
| 340 |
+
[40] T. Liang and A. Rakhlin. Just interpolate: Kernel “ridgeles” regression can generalize. Annals of Statistics, page to appear, 2019.
|
| 341 |
+
[41] T. Liang, A. Rakhlin, and X. Zhai. On the multiple descent of minimum-norm interpolants and restricted lower isometry of kernels. In COLT, 2020.
|
| 342 |
+
[42] F. Liu, Z. Liao, and J. Suykens. Kernel regression in high dimensions: Refined analysis beyond double descent. In International Conference on Artificial Intelligence and Statistics, pages 649–657. PMLR, 2021.
|
| 343 |
+
[43] M. Loog, T. Viering, and A. Mey. Minimizers of the empirical risk and risk monotonicity. In Advances in Neural Information Processing Systems, pages 7478–7487, 2019.
|
| 344 |
+
[44] S. Mei and A. Montanari. The generalization error of random features regression: Precise asymptotics and double descent curve. arXiv preprint arXiv:1908.05355, 2019.
|
| 345 |
+
[45] Y. Min, L. Chen, and A. Karbasi. The curious case of adversarially robust models: More data can help, double descend, or hurt generalization. arXiv preprint arXiv:2002.11080, 2020.
|
| 346 |
+
[46] P. Nakkiran, G. Kaplun, Y. Bansal, T. Yang, B. Barak, and I. Sutskever. Deep double descent: Where bigger models and more data hurt. arXiv preprint arXiv:1912.02292, 2019.
|
| 347 |
+
[47] P. Nakkiran, P. Venkat, S. Kakade, and T. Ma. Optimal regularization can mitigate double descent. arXiv preprint arXiv:2003.01897, 2020.
|
| 348 |
+
[48] B. Neal, S. Mittal, A. Baratin, V. Tantia, M. Scicluna, S. Lacoste-Julien, and I. Mitliagkas. A modern take on the bias-variance tradeoff in neural networks. arXiv preprint arXiv:1810.08591, 2018.
|
| 349 |
+
[49] B. Neyshabur, R. Tomioka, and N. Srebro. In search of the real inductive bias: On the role of implicit regularization in deep learning. In ICLR (Workshop), 2015.
|
| 350 |
+
[50] A. Rahimi and B. Recht. Random features for large-scale kernel machines. In Advances in neural information processing systems, pages 1177–1184, 2008.
|
| 351 |
+
[51] A. Rakhlin and X. Zhai. Consistency of interpolation with laplace kernels is a high-dimensional phenomenon. In Conference on Learning Theory, pages 2595–2623, 2019.
|
| 352 |
+
[52] D. Richards, J. Mourtada, and L. Rosasco. Asymptotics of ridge (less) regression under general source condition. arXiv preprint arXiv:2006.06386, 2020.
|
| 353 |
+
[53] A. Rudi and L. Rosasco. Generalization properties of learning with random features. In Advances in Neural Information Processing Systems, pages 3215–3225, 2017.
|
| 354 |
+
[54] G. Song, R. Xu, and J. Lafferty. Convergence and alignment of gradient descent with random back propagation weights. arXiv preprint arXiv:2106.06044, 2021.
|
| 355 |
+
[55] C. Szegedy, W. Liu, Y. Jia, P. Sermanet, S. Reed, D. Anguelov, D. Erhan, V. Vanhoucke, and A. Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1–9, 2015.
|
| 356 |
+
[56] A. Tsigler and P. L. Bartlett. Benign overfitting in ridge regression. arXiv preprint arXiv:2009.14286, 2020.
|
| 357 |
+
[57] D. von Rosen. Moments for the inverted wishart distribution. Scandinavian Journal of Statistics, pages 97–109, 1988.
|
| 358 |
+
[58] C. Wei, J. D. Lee, Q. Liu, and T. Ma. Regularization matters: Generalization and optimization of neural nets vs their induced kernel. In Advances in Neural Information Processing Systems, pages 9712–9724, 2019.
|
| 359 |
+
[59] A. J. Wyner, M. Olson, J. Bleich, and D. Mease. Explaining the success of adaboost and random forests as interpolating classifiers. The Journal of Machine Learning Research, 18(1): 1558–1590, 2017.
|
| 360 |
+
[60] J. Xu and D. J. Hsu. On the number of variables to use in principal component regression. In Advances in Neural Information Processing Systems, pages 5094–5103, 2019.
|
| 361 |
+
[61] C. Zhang, S. Bengio, M. Hardt, B. Recht, and O. Vinyals. Understanding deep learning requires rethinking generalization. In ICLR, 2017.
|
| 362 |
+
[62] D. Zou, Y. Cao, D. Zhou, and Q. Gu. Gradient descent optimizes over-parameterized deep relu networks. Machine Learning, 109(3):467–492, 2020.
|
| 363 |
+
|
| 364 |
+
# Checklist
|
| 365 |
+
|
| 366 |
+
1. For all authors...
|
| 367 |
+
|
| 368 |
+
(a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope? [Yes]
|
| 369 |
+
(b) Did you describe the limitations of your work? [Yes]
|
| 370 |
+
(c) Did you discuss any potential negative societal impacts of your work? [N/A]
|
| 371 |
+
(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
|
| 372 |
+
|
| 373 |
+
2. If you are including theoretical results...
|
| 374 |
+
|
| 375 |
+
(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]
|
| 376 |
+
|
| 377 |
+
3. If you ran experiments...
|
| 378 |
+
|
| 379 |
+
(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)? [N/A]
|
| 380 |
+
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [N/A]
|
| 381 |
+
(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [N/A]
|
| 382 |
+
(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)? [N/A]
|
| 383 |
+
|
| 384 |
+
4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
|
| 385 |
+
|
| 386 |
+
(a) If your work uses existing assets, did you cite the creators? [N/A]
|
| 387 |
+
(b) Did you mention the license of the assets? [N/A]
|
| 388 |
+
(c) Did you include any new assets either in the supplemental material or as a URL? [N/A]
|
| 389 |
+
(d) Did you discuss whether and how consent was obtained from people whose data you’re using/curating? [N/A]
|
| 390 |
+
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A]
|
| 391 |
+
|
| 392 |
+
5. If you used crowdsourcing or conducted research with human subjects...
|
| 393 |
+
|
| 394 |
+
(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
|
| 395 |
+
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
|
| 396 |
+
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
|
md/train/rkeZIJBYvr/rkeZIJBYvr.md
ADDED
|
@@ -0,0 +1,383 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LEARNING TO BALANCE: BAYESIAN META-LEARNING FOR IMBALANCED AND OUT-OF-DISTRIBUTION TASKS
|
| 2 |
+
|
| 3 |
+
Hae Beom $\mathbf { L e e ^ { 1 * } }$ , Hayeon $\mathbf { L e e ^ { 1 * } }$ , Donghyun $\mathbf { N a } ^ { 2 }$ ∗, Saehoon $\mathbf { K i m ^ { 3 } }$ , Minseop Park3, Eunho Yang1,3, Sung Ju Hwang1,3
|
| 4 |
+
|
| 5 |
+
KAIST1, TmaxData2, AITRICS3, South Korea {haebeom.lee, hayeon926, eunhoy, sjhwang82}@kaist.ac.kr donghyun_na@tmax.co.kr, {shkim, mike_seop}@aitrics.com
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
While tasks could come with varying the number of instances and classes in realistic settings, the existing meta-learning approaches for few-shot classification assume that the number of instances per task and class is fixed. Due to such restriction, they learn to equally utilize the meta-knowledge across all the tasks, even when the number of instances per task and class largely varies. Moreover, they do not consider distributional difference in unseen tasks, on which the meta-knowledge may have less usefulness depending on the task relatedness. To overcome these limitations, we propose a novel meta-learning model that adaptively balances the effect of the meta-learning and task-specific learning within each task. Through the learning of the balancing variables, we can decide whether to obtain a solution by relying on the meta-knowledge or task-specific learning. We formulate this objective into a Bayesian inference framework and tackle it using variational inference. We validate our Bayesian Task-Adaptive Meta-Learning (Bayesian TAML) on multiple realistic task- and class-imbalanced datasets, on which it significantly outperforms existing meta-learning approaches. Further ablation study confirms the effectiveness of each balancing component and the Bayesian learning framework.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Despite the success of deep learning in many real-world tasks such as visual recognition and machine translation, such good performances are achievable at the availability of large training data, and many fail to generalize well in small data regimes. To overcome this limitation of conventional deep learning, recently, researchers have explored meta-learning (Schmidhuber, 1987; Thrun & Pratt, 1998) approaches, whose goal is to learn a model that generalizes well over distribution of tasks, rather than instances from a single task, in order to utilize the obtained meta-knowledge across tasks to compensate for the lack of training data for each task.
|
| 14 |
+
|
| 15 |
+
However, so far, most existing meta-learning approaches (Santoro et al., 2016; Vinyals et al., 2016; Snell et al., 2017; Ravi & Larochelle, 2017; Finn et al., 2017; Li et al., 2017) have only targeted an artificial scenario where all tasks participating in the multi-class classification problem have equal number of training instances per class. Yet, this is a highly restrictive setting, as in real-world scenarios, tasks that arrive at the model may have different training instances (task imbalance), and within each task, the number of training instances per class may largely vary (class imbalance). Moreover, the new task may come from a distribution that is different from the task distribution the model has been trained on (out-of-distribution task) (See (a) of Figure 1).
|
| 16 |
+
|
| 17 |
+
Under such a realistic setting, the meta-knowledge may have a varying degree of utility to each task. Tasks with small number of training data, or close to the tasks trained in meta-training step may want to rely mostly on meta-knowledge obtained over other tasks, whereas tasks that are out-of-distribution or come with more number of training data may obtain better solutions when trained in a task-specific manner. Furthermore, for multi-class classification, we may want to treat the learning for each class differently to handle class imbalance. Thus, to optimally leverage meta-learning under various imbalances, it would be beneficial for the model to task- and class-adaptively decide how much to use from the meta-learner, and how much to learn specifically for each task and class.
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Concept. (a) To handle task imbalance, class imbalance and out-of-distribution (OOD) tasks, we introduce task-specific balancing variables $\gamma ^ { \tau }$ , $\omega ^ { \tau }$ , and $\mathbf { z } ^ { \tau }$ . (b) With those variables, we learn to balance between the meta-knowledge $\pmb { \theta }$ and task-specific update to handle imbalances and distributional shift.
|
| 21 |
+
|
| 22 |
+
To this end, we propose a novel Bayesian meta-learning framework, which we refer to as Bayesian Task-Adaptive Meta-Learning (Bayesian TAML), that learns variables to adaptively balance the effect of meta- and task-specific learning. Specifically, we first obtain set-representations for each task, which are learned to convey useful statistics about the task or class distribution, such as mean, variance, and cardinality (the number of elements in the set), and then learn the distribution of three balancing variables a function of the set: 1) task-dependent learning rate multiplier, which decides how far away to deviate from the meta-knowledge, when performing task-specific learning. Tasks with higher shots could benefit from taking gradient steps afar, while tasks with few shots may need to stay close to the initial parameter. 2) class-dependent learning rate, which decides how much information to use from each class, to automatically handle class imbalance where the number of instances per class can largely vary. 3) task-dependent modulator for initial model parameter, which modifies the shared initialization for each task, such that each task can decide how much and what to use from the shared initial model parameter and what to ignore based on its set representation. This is especially useful when handling out-of-distribution task, which may need to ignore some of the meta-knowledge.
|
| 23 |
+
|
| 24 |
+
We validate our model on CIFAR-FS and miniImageNet dataset, as well as a new dataset that consists of heterogeneous datasets, under a scenario where every class in each episode can have any number of shots, that leads to task and class imbalance, and where the dataset at meta-test time is different from that of meta-training time. The experimental results show that our Bayesian TAML significantly improves the performance over the existing approaches under these realistic scenarios. Further analysis of each component reveals that the improvement is due to the effectiveness of the balancing terms for handling task and class imbalance, and out-of-distribution tasks.
|
| 25 |
+
|
| 26 |
+
To summarize, our contribution in this work is threefold:
|
| 27 |
+
|
| 28 |
+
• We consider a novel problem of meta-learning under a realistic task distribution, where the number of instances across classes and tasks could largely vary, or the unseen task at the meta-test time is largely different from the seen tasks.
|
| 29 |
+
For effective meta-learning with such imbalances, we propose a Bayesian task-adaptive meta-learning (Bayesian TAML) framework that can adaptively adjust the effect of the meta-learner and the task-specific learner, differently for each task and class. We validate our model on realistic imbalanced few-shot classification tasks with a varying number of shots per task and class and show that it significantly outperforms existing meta-learning models.
|
| 30 |
+
|
| 31 |
+
# 2 RELATED WORK
|
| 32 |
+
|
| 33 |
+
Meta-learning Meta-learning (Schmidhuber, 1987; Thrun & Pratt, 1998) is an approach to learn a model to generalize over a distribution of task. The approaches in general can be categorized into either memory-based, metric-based, and optimization-based methods. A memory-based approach (Santoro et al., 2016) learns to store correct instance and label into the same memory slot and retrieve it later, in a task-generic manner. Metric-based approaches learn a shared metric space (Vinyals et al., 2016; Snell et al., 2017). Snell et al. (2017) defines the distance between the instance and the class prototype, such that the instances are closer to their correct prototypes than to others. As for optimization-based meta-learning, MAML (Finn et al., 2017) learns a shared initialization parameter that is optimal for any tasks within few gradient steps from the initial parameter. Meta-SGD (Li et al., 2017) improves upon MAML by learning the learning rate differently for each parameter. For effective learning of a meta-learner, meta-learning approaches adopt the episodic training strategy (Vinyals et al., 2016) which trains and evaluates a model over a large number of tasks, which are called meta-training and meta-test phase, respectively. However, existing approaches only consider an artificial scenario which samples the classification of classes with exactly the same number of training instances, both within each episode and across episodes. On the other hand, we consider a more challenging scenario where the number of shots per class and task could vary at each episode, and that the task given at meta-test time could be an out-of-distribution task.
|
| 34 |
+
|
| 35 |
+
Task-adaptive meta-learning The goal of learning a single meta-learner that works well for all tasks may be overly ambitious and leads to suboptimal performances for each task. Thus recent approaches adopt task-adaptively modified meta-learning models. Oreshkin et al. (2018) proposed to learn the temperature scaling parameter to work with the optimal similarity metric. Qiao et al. (2018) also suggested a model that generates task-specific parameters for the network layers, but it only trains with many-shot classes, and implicitly expects generalization to few-shot cases. Rusu et al. (2019) proposed a network type task-specific parameter producer, and Lee & Choi (2018) proposed to differentiate the network weights into task-shared and task-specific weights. Our model also aims to obtain task-specific parameter for each task, but is rather focused on learning how to balance between the meta-learning and task-/class-specific learning.
|
| 36 |
+
|
| 37 |
+
Probabilistic meta-learning Recently, a probabilistic version of MAML has been proposed (Finn et al., 2018), where they interpret a task-specific gradient update as a posterior inference process under variational inference framework. Kim et al. (2018) proposed Bayesian MAML with a similar motivation but with a stein variational inference framework and chaser loss. Gordon et al. (2019) proposed a probabilistic meta-learning framework where the parameter for a novel task is rapidly estimated under decision theoretic framework, given a set representation of a task. The motivation behind these works is to represent the inherent uncertainty in few-shot classification tasks. Our model also uses Bayesian modeling, but it focuses on leveraging the uncertainties of the meta-learner and the gradient-direction in order to balance between meta- and task- or class-specific learning.
|
| 38 |
+
|
| 39 |
+
# 3 LEARNING TO BALANCE
|
| 40 |
+
|
| 41 |
+
We first introduce notations and briefly recap the model-agnostic meta-learning (MAML) by Finn et al. (2017). Suppose a task distribution $p ( \tau )$ that randomly generates task $\tau$ consisting of a training set $\mathcal { D } ^ { \tau } = \{ \mathbf { X } ^ { \tau } , \mathbf { Y } ^ { \tau } \}$ and a test set $\tilde { \mathcal { D } } ^ { \tau } = \{ \tilde { \mathbf { X } } ^ { \tau } , \tilde { \mathbf { Y } } ^ { \tau } \}$ . Then, the goal of MAML is to meta-learn the initial model parameter $\pmb \theta$ as a meta-knowledge to generalize over the task distribution $p ( \tau )$ , such that we can easily obtain the task-specific predictor $\pmb { \theta } ^ { \tau }$ in a single (or a few) gradient step from the initial $\pmb \theta$ . Toward this goal, MAML optimizes the following gradient-based meta-learning objective:
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\operatorname* { m i n } _ { \pmb { \theta } } \sum _ { \tau \sim p ( \tau ) } \mathcal { L } ( \pmb { \theta } - \alpha \nabla _ { \pmb { \theta } } \mathcal { L } ( \pmb { \theta } ; \mathcal { D } ^ { \tau } ) ; \tilde { \mathcal { D } } ^ { \tau } )
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
where $\alpha$ denotes stepsize and $\mathcal { L }$ denotes empirical loss such as negative log-likelihood of observations. Note that by meta-learning the initial point $\pmb \theta$ , the task-specific predictor $\pmb { \theta } ^ { \tau } = \pmb { \theta } - \alpha \nabla _ { \pmb { \theta } } \mathcal { L } ( \pmb { \theta } ; \mathcal { D } ^ { \tau } )$ can minimize the test loss $\mathcal { L } ( \cdot ; \tilde { \mathcal { D } } ^ { \tau } )$ even with ${ \mathcal { D } } ^ { \tau }$ consisting of only a few samples. We can easily extend the Eq. (1), such that we obtain $\pmb { \theta } ^ { \tau }$ with more than one inner-gradient steps from the initial $\pmb \theta$ .
|
| 48 |
+
|
| 49 |
+
However, the existing MAML framework has the following limitations that prevent the model from efficiently solving real-world problems involving class/task imbalance and out-of-distribution tasks.
|
| 50 |
+
|
| 51 |
+
1. Class imbalance. MAML does not provide any framework to handle class imbalance within each task. Therefore, classes with large number of training instances (head classes) may dominate the task-specific learning during the inner-gradient steps, yielding low performance on classes with fewer shots (tail classes). 2. Task imbalance. The model has a fixed number of inner-gradient steps and stepsize $\alpha$ across all tasks, which prevents the model from adaptively deciding how much to resort to the meta-knowledge or how much to learn from the given dataset, depending on the number of the training examples per task.
|
| 52 |
+
|
| 53 |
+
3. Out-of-distribution tasks. The model assumes that the initial model parameter $\pmb \theta$ will be equally useful for the unseen tasks, but for unseen tasks that are significantly different from the previously seen tasks, the initial parameter may be less useful.
|
| 54 |
+
|
| 55 |
+
# 3.1 TASK-ADAPTIVE META-LEARNING (TAML)
|
| 56 |
+
|
| 57 |
+
As shown in Figure 1 for the concepts, we introduce three balancing variables $\omega ^ { \tau } , \gamma ^ { \tau } , \mathbf { z } ^ { \tau }$ to tackle each problem mentioned above. How to generate these variables will be described in Section 4. Also, see the experimental section for how to generate the realistic tasks with class and task imbalance.
|
| 58 |
+
|
| 59 |
+
Tackling class imbalance. To handle class imbalance, we vary the learning rate of class-specific gradient for each inner-optimization step. Specifically, for class $c = 1 , \ldots , C$ , we introduce a set of class-specific scalars $\omega ^ { \tau } \overset { \cdot } { = } ( \omega _ { 1 } ^ { \tau } , \ldots , \omega _ { C } ^ { \tau } ) \in \mathsf { \bar { \Gamma } } [ 0 , 1 ] ^ { C }$ , which are multiplied to each of the class-specific gradients $\nabla _ { \pmb { \theta } } \mathcal { L } ( \pmb { \theta } ; \mathcal { D } _ { 1 } ^ { \tau } ) , \dots , \nabla _ { \pmb { \theta } } \mathcal { L } ( \pmb { \theta } ; \mathcal { D } _ { C } ^ { \tau } )$ , where $\mathcal { D } _ { c } ^ { \tau }$ is the set of instances and labels for class $c$ . We expect $\omega _ { c } ^ { \tau }$ to be large for tail-classes with small number of training instances, such that they could be considered more in the inner-optimization steps. We generate $\omega ^ { \tau }$ with Softmax function, and denote the input to the function as $\tilde { \omega } ^ { \tau }$ .
|
| 60 |
+
|
| 61 |
+
Tackling task imbalance. To control whether the model parameter for the current task stays close to the initial parameter or deviate far from it, we introduce task-dependent learning-rate multipliers $\gamma ^ { \tau } = ( \gamma _ { 1 } ^ { \tau } , \cdot \cdot \cdot , \gamma _ { L } ^ { \tau } ) \in [ 0 , \infty ) ^ { L }$ , such that for each layer $l = 1 , \ldots , L$ , the learning rate becomes $\gamma _ { 1 } ^ { \tau } \alpha , \gamma _ { 2 } ^ { \tau } \alpha , \ldots , \gamma _ { L } ^ { \tau } \alpha$ . We expect $\gamma ^ { \tau }$ to be large for large tasks, such that they rely more on taskspecific updates, while small tasks use small $\gamma ^ { \tau }$ to benefit more from the meta-knowledge. To amplify the step-size difference between large and small tasks, we generate $\gamma ^ { \tau }$ with an exponential function, and denote the input to the function as $\tilde { \gamma } ^ { \tau }$ .
|
| 62 |
+
|
| 63 |
+
Tackling out-of-distribution tasks. Finally, we introduce $\mathbf { z } ^ { \tau }$ which modulates the initial parameter $\pmb \theta$ for each task. We expect $\mathbf { z } ^ { \tau }$ to learn to relocate the initial $\pmb \theta$ to a new starting point, such that out-of-distribution (OOD) tasks can deviate much from the shared initialization $\pmb \theta$ if the current initialization is suboptimal for the given task. Specifically, we use ${ \bf z } ^ { \tau } = { \bf 1 } + \tilde { { \bf z } } ^ { \tau }$ for the channel of the convolutional network weights and $\mathbf { z } ^ { \tau } = \tilde { \mathbf { z } } ^ { \tau }$ for the biases, which modify the initial parameter as follows: $\pmb { \theta } _ { 0 } \pmb { \theta } \circ \mathbf { z } ^ { \tau }$ for the weights and $\pmb \theta _ { 0 } \pmb \theta + \mathbf z ^ { \tau }$ for the biases, where $\pmb { \theta } _ { 0 }$ denotes the new initialization modulated by $\mathbf { z } ^ { \tau }$ . We denote this operation as ${ \pmb \theta } * { \bf z } ^ { \tau }$ , which is similar to task-dependent modulation of batch normalization parameters (Oreshkin et al., 2018; Requeima et al., 2019).
|
| 64 |
+
|
| 65 |
+
A unified framework. Finally, we assemble all these components together into a single unified framework. With a slight abuse of notations, the update rule can be written as follows:
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\begin{array} { l } { \displaystyle \theta _ { 0 } = \theta * \mathbf { z } ^ { \tau } , } \\ { \displaystyle \theta _ { k } = \theta _ { k - 1 } - \gamma ^ { \tau } \circ \alpha \circ \sum _ { c = 1 } ^ { C } \omega _ { c } ^ { \tau } \nabla \theta _ { k - 1 } \mathcal { L } ( \theta _ { k - 1 } ; \mathcal { D } _ { c } ^ { \tau } ) \quad \mathrm { f o r ~ } k = 1 , \dots , K } \end{array}
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
where $_ \alpha$ is a multi-dimensional global learning rate vector that is learned (Li et al., 2017), and the multiplication operator $\circ$ is appropriately defined. The last step $\pmb { \theta } _ { K }$ corresponds to the task-specific predictor $\pmb { \theta } ^ { \tau }$ .
|
| 72 |
+
|
| 73 |
+
# 3.2 BAYESIAN TASK-ADAPTIVE META-LEARNING
|
| 74 |
+
|
| 75 |
+
We now introduce the variational inference framework for the input of the three balancing variables, that we previously denote as $\tilde { \omega } ^ { \tau }$ , $\tilde { \gamma } ^ { \tau }$ , $\tilde { \mathbf { z } } ^ { \tau }$ . Bayesian modeling allows to incorporate randomness in the posterior of those variables. In MAML framework, such randomness generates the ensemble of diverse task-specific predictors, which allows to effectively exploit the information in the given dataset ${ \mathcal { D } } ^ { \tau }$ . Bayesian modeling also allows to find more robust latent structures of those balancing variables (See Figure 7).
|
| 76 |
+
|
| 77 |
+
Firstly, define $\mathbf { X } ^ { \tau } = \{ \mathbf { x } _ { n } ^ { \tau } \} _ { n = 1 } ^ { N _ { \tau } }$ and $\mathbf { Y } ^ { \tau } = \{ \mathbf { y } _ { n } ^ { \tau } \} _ { n = 1 } ^ { N _ { \tau } }$ for training, and $\tilde { \mathbf { X } } ^ { \tau } = \{ \tilde { \mathbf { x } } _ { m } ^ { \tau } \} _ { m = 1 } ^ { M _ { \tau } }$ and $\tilde { \mathbf { Y } } ^ { \tau } =$ $\{ \tilde { \mathbf { y } } _ { m } ^ { \tau } \} _ { m = 1 } ^ { M _ { \tau } }$ for test. Let $\phi ^ { \tau }$ n=1 n=denote the collection of $\tilde { \omega } ^ { \tau }$ , $\tilde { \gamma } ^ { \tau }$ and $\tilde { \mathbf { z } } ^ { \tau }$ m=1 for uncluttered notation. Then, inspired by Gordon et al. (2019) and Finn et al. (2018), we define the generative process for metalearning framework as follows for each task $\tau$ (See Figure 2):
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
p ( { \mathbf { Y } ^ { \tau } } , \tilde { { \mathbf { Y } ^ { \tau } } } , \phi ^ { \tau } | { \mathbf { X } ^ { \tau } } , \tilde { { \mathbf { X } ^ { \tau } } } ; \theta ) = p ( \phi ^ { \tau } ) \prod _ { n = 1 } ^ { N _ { \tau } } p ( { \mathbf { y } _ { n } ^ { \tau } } | \mathbf { x } _ { n } ^ { \tau } , \phi ^ { \tau } ; \theta ) \prod _ { m = 1 } ^ { M _ { \tau } } p ( \tilde { { \mathbf { y } _ { m } ^ { \tau } } } | \tilde { { \mathbf { x } } } _ { m } ^ { \tau } , \phi ^ { \tau } ; \theta )
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
for the complete data likelihood. Note that the deterministic $\pmb \theta$ is shared across all the tasks.
|
| 84 |
+
|
| 85 |
+
# 4 VARIATIONAL INFERENCE
|
| 86 |
+
|
| 87 |
+
The goal of learning for each task $\tau$ is to maximize the conditional loglikelihood of the joint dataset $\tilde { \mathcal { D } } ^ { \tau }$ and $\mathcal { D } ^ { \tau } \colon \log p ( \tilde { \mathbf { Y } } ^ { \tau } , \mathbf { Y } ^ { \tau } | \tilde { \mathbf { X } } ^ { \tau } , \mathbf { X } ^ { \tau } ; \pmb { \theta } )$ However, solving it involves the true posterior $p ( \phi ^ { \tau } | \mathcal { D } ^ { \tau } , \tilde { \mathcal { D } } ^ { \tau } )$ , which is intractable. Thus, we resort to amortized variational inference with a tractable form of approximate posterior $q ( \phi ^ { \tau } | \mathcal { D } ^ { \tau } , \tilde { \mathcal { D } } ^ { \tau } ; \psi )$ parameterized by $\psi$ . We let the three variables share the same inference network pipeline to minimize the computational cost. Further, similarly to Ravi & Beatson (2019), we drop the dependency on the test dataset $\tilde { \mathcal { D } } ^ { \tau }$ for the approximate posterior, in order to make the two different pipelines consistent; one for meta-training where we observe the whole test dataset, and the other for meta-testing where the test labels are unknown. The form of our approximate posterior is now $q ( \phi ^ { \tau } | \mathcal { D } ^ { \tau } ; \psi )$ . It greatly simplifies the inference framework, while ensuring to have a valid lower bound of the log evidence. Also, considering that performing the inner-gradient steps with the training dataset ${ \mathcal { D } } ^ { \tau }$ automatically maximizes the training log-likelihood in MAML framework, we slightly modify the objective so that the expected log-likelihood term only involves the test examples with the appropriate scaling factor. The resultant form of the approximated lower bound that suits for our meta-learning purpose is as follows:
|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
Figure 2: Graphical model. (a) Generative process. (b) Inference.
|
| 91 |
+
|
| 92 |
+
$$
|
| 93 |
+
L _ { \theta , \psi } ^ { \tau } = \frac { N _ { \tau } + M _ { \tau } } { M _ { \tau } } \sum _ { m = 1 } ^ { M _ { \tau } } \mathbb { E } _ { q ( \phi ^ { \tau } | \mathcal { D } ^ { \tau } ; \psi ) } \left[ \log p ( \tilde { \mathbf { y } } _ { m } ^ { \tau } | \tilde { \mathbf { x } } _ { m } ^ { \tau } , \phi ^ { \tau } ; \theta ) \right] - \mathrm { K L } [ q ( \phi ^ { \tau } | \mathcal { D } ^ { \tau } ; \psi ) \| p ( \phi ^ { \tau } ) ] .
|
| 94 |
+
$$
|
| 95 |
+
|
| 96 |
+
We assume $q ( \phi ^ { \tau } | \mathcal { D } ^ { \tau } ; \psi )$ fully factorizes for each variable and also for each dimension as well:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
q ( \phi ^ { \tau } | \mathcal { D } ^ { \tau } ; \psi ) = \prod _ { c } q ( \tilde { \omega } _ { c } ^ { \tau } | \mathcal { D } ^ { \tau } ; \psi ) \prod _ { l } q ( \tilde { \gamma } _ { l } ^ { \tau } | \mathcal { D } ^ { \tau } ; \psi ) \prod _ { i } q ( \tilde { z } _ { i } ^ { \tau } | \mathcal { D } ^ { \tau } ; \psi )
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
where we assume that each single dimension of $q ( \phi ^ { \tau } | \mathcal { D } ^ { \tau } ; \psi )$ follows univariate Gaussian having trainable mean and variance. We also let each dimension of prior $p ( \phi ^ { \tau } )$ factorize into $\mathcal { N } ( 0 , 1 )$ , such that the KL-divergence can have the especially simple closed form (Kingma $\&$ Welling, 2014).
|
| 103 |
+
|
| 104 |
+
The final form of the meta-training minimization objective with Monte-Carlo (MC) approximation for the expectation in Eq. (5) is as follows:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\operatorname* { m i n } _ { \theta , \psi } \frac { 1 } { M _ { \tau } } \sum _ { m = 1 } ^ { M _ { \tau } } \frac { 1 } { S } \sum _ { s = 1 } ^ { S } - \log p ( \tilde { \mathbf { y } } _ { m } ^ { \tau } | \tilde { \mathbf { x } } _ { m } ^ { \tau } , \phi _ { s } ^ { \tau } ; \mathbf { \theta } ) + \frac { 1 } { N _ { \tau } + M _ { \tau } } \operatorname { K L } [ q ( \phi ^ { \tau } | \mathcal { D } ^ { \tau } ; \psi ) \| p ( \phi ^ { \tau } ) ] .
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
where $\phi _ { s } ^ { \tau } \sim q ( \phi ^ { \tau } | D ^ { \tau } ; \psi )$ . We implicitly assume the reparameterization trick for $\phi ^ { \tau }$ to obtain stable and unbiased gradient estimate w.r.t. $\psi$ (Kingma $\&$ Welling, 2014). We set the MC sample size to $S = 1$ for meta-training for computational efficiency. When meta-testing, we perform MC approximation with sufficiently large sample size (e.g. $S = 1 0$ ):
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
p ( \tilde { \mathbf { y } } _ { * } ^ { \tau } | \tilde { \mathbf { x } } _ { * } ^ { \tau } ; \pmb { \theta } ) = \mathbb { E } _ { q } [ p ( \tilde { \mathbf { y } } _ { * } ^ { \tau } | \tilde { \mathbf { x } } _ { * } ^ { \tau } , \phi ^ { \tau } ; \pmb { \theta } ) ] \approx \frac { 1 } { S } \sum _ { s = 1 } ^ { S } p ( \tilde { \mathbf { y } } _ { * } ^ { \tau } | \tilde { \mathbf { x } } _ { * } ^ { \tau } , \phi _ { s } ^ { \tau } ; \pmb { \theta } ) , \quad \phi _ { s } ^ { \tau } \sim q ( \phi ^ { \tau } | \mathcal { D } ^ { \tau } ; \psi ) .
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
or we may naively approximate by taking the expectation inside for computational efficiency:
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\mathbb { E } _ { q } [ p ( \tilde { \mathbf { y } } _ { \ast } ^ { \tau } \vert \tilde { \mathbf { x } } _ { \ast } ^ { \tau } , \boldsymbol { \phi } ^ { \tau } ; \pmb { \theta } ) ] \approx p ( \tilde { \mathbf { y } } _ { \ast } ^ { \tau } \vert \tilde { \mathbf { x } } _ { \ast } ^ { \tau } , \mathbb { E } _ { q } [ \boldsymbol { \phi } ^ { \tau } ] ; \pmb { \theta } ) .
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
In the experimental section, we show that Eq. (8) largely outperforms Eq. (9).
|
| 123 |
+
|
| 124 |
+

|
| 125 |
+
Figure 3: Inference Network. The proposed dataset encoder captures the instance-wise and class-wise statistics hierarchically, from which we infer three different balancing variables.
|
| 126 |
+
|
| 127 |
+
# 4.1 DATASET ENCODING
|
| 128 |
+
|
| 129 |
+
The main challenge in modeling our variational distribution $q ( \phi ^ { \tau } | \mathcal { D } ^ { \tau } ; \psi )$ is to decide how to refine the training dataset ${ \mathcal { D } } ^ { \tau }$ into informative representation, which is not trivial. This inference network should capture all the necessary statistical information to recognize any imbalances in the dataset ${ \mathcal { D } } ^ { \tau }$ . Mean-pooling (Edwards & Storkey, 2017) or sum-pooling (Zaheer et al., 2017) is frequently used as a practical set-encoder, where each instance in the set is transformed by the shared nonlinearity, and then averaged or summed together to generate a single vector summarizing the set, followed by an additional nonlinearity. However, for the classification dataset ${ \mathcal { D } } ^ { \tau }$ which is the set of (class) sets, those non-hierarchical pooling methods will perform poorly as they ignore the label information. Therefore, we use a two-layer hierarchical set encoder which first encodes each class as a set of samples and then encodes the set as the set of classes (see the Appendix B for the justification).
|
| 130 |
+
|
| 131 |
+
However, there is an additional limitation of mean pooling when using it to describe a task: it does not recognize the number of elements in the set2. This could be a critical limitation in recognizing the imbalances in the given task. Therefore we explicitly input the number of elements into the set encoder. Yet, the set cardinality alone is insufficient in capturing the distribution of the dataset. Suppose that we have a set containing replications of a single instance. Then, although the set has only limited information, the set encoding cannot recognize it and will overestimate the information. To prevent this, we encode the variance of the set as well.
|
| 132 |
+
|
| 133 |
+
Based on this intuition, we define the set encoder StatisticsPooling $( \cdot )$ that generates the concatenation of the set statistics such as mean, variance, and cardinality. We use this encoder to first encode each class, and then the whole set of classes as follows:
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
\mathbf { v } ^ { \tau } = \mathrm { S t a t i s t i c s P o o l i n g } \left( \left\{ \operatorname { N N } _ { 2 } \left( \mathbf { s } _ { c } \right) \right\} _ { c = 1 } ^ { C } \right) , \quad \mathbf { s } _ { c } = \mathrm { S t a t i s t i c s P o o l i n g } \left( \left\{ \operatorname { N N } _ { 1 } ( \mathbf { x } ) \right\} _ { \mathbf { x } \in \mathbf { X } _ { c } ^ { \tau } } \right)
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
for classes $c = 1 , \ldots , C . \mathbf { X } _ { c } ^ { \tau }$ is the collection of class $c$ examples in task $\tau$ . $\mathrm { N N } _ { 1 }$ and $\mathrm { N N _ { 2 } }$ are some neural networks parameterized by $\psi$ . The vector $\mathbf { v } ^ { \tau }$ finally summarizes the entire dataset ${ \mathcal { D } } ^ { \tau }$ for few-shot classification. Note that the class-specific balancing variables $\tilde { \omega } _ { 1 } ^ { \tau } , \dots , \tilde { \omega } _ { C } ^ { \tau }$ are generated from $\mathbf { s } _ { 1 } , \ldots , \mathbf { s } _ { C }$ , and other task-specific balancing variables $\tilde { \gamma } ^ { \tau }$ and $\tilde { \mathbf { z } } ^ { \tau }$ are generated from $\mathbf { v } ^ { \tau }$ with a few additional layers (See Figure 3).
|
| 140 |
+
|
| 141 |
+
# 5 EXPERIMENTS
|
| 142 |
+
|
| 143 |
+
We next validate our method on multiple benchmark datasets with more realistic task distribution.
|
| 144 |
+
|
| 145 |
+
Datasets We validate our method on the following benchmark datasets. CIFAR-FS: This dataset (Bertinetto et al., 2019) is a variant of CIFAR-100 dataset that consists of 100 general object categories. Each class comes with 600 examples, each of which is a color image that contains $3 2 \times 3 2$ pixels. We split the dataset into $6 4 / 1 6 / 2 0$ classes for training/validation/test. SVHN: This dataset (Netzer et al., 2011) is frequently used as an OOD dataset for CIFAR-10 and CIFAR-100. It consists of 26, 032 color images of $3 2 \times 3 2$ pixels, from 10 digits classes. miniImageNet: This dataset (Vinyals et al., 2016) is a subset of the ImageNet dataset (Russakovsky et al., 2015). It consists of total 100 classes, each of which has 600 images resized into $8 4 \times 8 4$ . We split the dataset into subsets containing $6 4 / 1 6 / 2 0$ classes for training/validation/test. CUB: This dataset contains 11, 788 images of 200 bird species. We resize the images into $8 4 \times 8 4$ . We split the dataset into
|
| 146 |
+
|
| 147 |
+
Table 1: Any-shot classification results. For each model, we run 3 independent trials and jointly test them over total $9 , 0 0 0 = 3 \times 3 , 0 0 0$ episodes. We report mean accuracies and $9 5 \%$ confidence intervals.
|
| 148 |
+
|
| 149 |
+
<table><tr><td>Meta-training</td><td colspan="2">CIFAR-FS</td><td colspan="2">miniImageNet</td></tr><tr><td>Meta-test</td><td>CIFAR-FS</td><td>SVHN</td><td>miniImageNet</td><td>CUB</td></tr><tr><td>MAML (Finn et al., 2017)</td><td>71.55±0.23</td><td>45.17±0.22</td><td>66.64±0.22</td><td>65.77±0.24</td></tr><tr><td>Meta-SGD (Li et al., 2017)</td><td>72.71±0.21</td><td>46.45±0.24</td><td>69.95±0.20</td><td>65.94±0.22</td></tr><tr><td>MT-net (Lee& Choi,2018)</td><td>72.30±0.22</td><td>49.17±0.21</td><td>67.63±0.23</td><td>66.09±0.23</td></tr><tr><td>ABML (Ravi& Beatson, 2019)</td><td>67.24±0.24</td><td>36.52±0.17</td><td>56.91±0.19</td><td>57.88±0.20</td></tr><tr><td>Prototypical Networks (Snell et al., 2017)</td><td>73.24±0.20</td><td>42.91±0.18</td><td>69.11±0.19</td><td>60.80±0.19</td></tr><tr><td>Proto-MAML (Triantafillou et al.,2020)</td><td>71.80±0.21</td><td>40.16±0.17</td><td>68.96±0.18</td><td>61.77±0.19</td></tr><tr><td>Bayesian TAML</td><td>75.15±0.20</td><td>51.87±0.23</td><td>71.46±0.19</td><td>71.71±0.21</td></tr></table>
|
| 150 |
+
|
| 151 |
+
Table 2: Multi-dataset any-shot classification results.
|
| 152 |
+
|
| 153 |
+
<table><tr><td>Meta-training</td><td colspan="5">Aircraft, ,QuickDraw,and VGG-Flower</td></tr><tr><td>Meta-test</td><td>Aircraft</td><td>QuickDraw</td><td>VGG-Flower</td><td>Traffic Signs</td><td>Fashion-MNIST</td></tr><tr><td>MAML</td><td>48.60±0.17</td><td>69.02±0.18</td><td>60.38±0.16</td><td>51.96±0.22</td><td>63.10±0.15</td></tr><tr><td>Meta-SGD</td><td>49.71±0.17</td><td>70.26±0.16</td><td>59.41±0.27</td><td>52.07±0.35</td><td>62.71±0.25</td></tr><tr><td>MT-net</td><td>51.68±0.17</td><td>68.78±0.18</td><td>64.20±0.16</td><td>56.36±0.23</td><td>62.86±0.15</td></tr><tr><td>Prototypical Networks</td><td>50.63±0.16</td><td>72.31±0.17</td><td>65.52±0.15</td><td>49.93±0.18</td><td>64.26±0.13</td></tr><tr><td>Proto-MAML</td><td>51.15±0.17</td><td>69.84±0.18</td><td>65.24±0.17</td><td>53.93±0.20</td><td>63.72±0.15</td></tr><tr><td>Bayesian TAML</td><td>54.43±0.16</td><td>72.03±0.16</td><td>67.72±0.16</td><td>64.81±0.21</td><td>68.94±0.13</td></tr></table>
|
| 154 |
+
|
| 155 |
+
$1 0 0 / 5 0 / 5 0$ classes for training/validation/test. Since this dataset is fine-grained, we regard it as an out-of-distribution dataset of the coarse-grained miniImageNet dataset.
|
| 156 |
+
|
| 157 |
+
Realistic task distribution To define realistic task distribution $p ( \tau )$ , we first randomly sample $C = 5$ classes from the whole set of classes. Then with 0.5 probability, we sample the set size $N _ { c } \sim \mathrm { U n i f } ( 1 , 5 0 )$ independently for each class $c = 1 , \ldots , C$ , in order to simulate class imbalance. On the other hand, with the other 0.5 probability, we again sample the set size $N _ { c } \sim \mathrm { U n i f } ( 1 , 5 0 )$ but apply the same single sample to all the classes, in order to simulate task imbalance. We set the number of test (or query) examples to 15 for each class.
|
| 158 |
+
|
| 159 |
+
Experimental setup We use conventional 4-block convolutional neural networks with 32 channels (Finn et al., 2017). All the baselines and our model become transductive through batch normalization at meta-test time, following Finn et al. (2017). We perform early-stopping for all the baselines and our model with meta-validation set performance. We set the number of inner-gradient steps to 5 for meta-training and 10 for meta-testing, for all the models that take inner-gradient steps. See the Appendix A for more details about the experimental setup.
|
| 160 |
+
|
| 161 |
+
# 5.1 MAIN RESULTS
|
| 162 |
+
|
| 163 |
+
Any-shot classification Table 1 shows the results under the realistic task distribution with task and class imbalance. We first observe that Meta-SGD and MT-net outperforms MAML. They precondition the inner-gradients with diagonal or block-diagonal matrix (Flennerhag et al., 2020), which seems to provide extra flexibility to handle task and class imbalance. ABML, one of the recent Bayesian meta-learning models, largely underperforms MAML in this setting, mainly because each taskspecific predictor is excessively regularized by the prior distribution. However, our graphical model in Figure 2 does not directly impose a prior distribution on task-specific predictors, but only on the balancing variables $\phi$ . Prototypical Networks perform relatively well on in-distribution (ID) tasks but not on out-of-distribution (OOD) tasks. This is because metric-based models do not take the gradient steps for OOD tasks, such that the novel information in the dataset cannot be effectively incorporated into each task-specific predictor. Proto-MAML has been proposed to take the advantage of both metric-based and gradient-based approach (Triantafillou et al., 2020), but it does not outperform Prototypical Networks in our experiments. Finally, we observe that our Bayesian TAML significantly outperforms all the baselines on both ID and OOD datasets. Bayesian TAML performs especially well on OOD datasets, because when the given task largely differs from the meta-knowledge, the model is able to deviate far from the meta-knowledge; however this is difficult for the other baselines.
|
| 164 |
+
|
| 165 |
+
Multi-dataset any-shot classification We further test our model under a more challenging setting where tasks could come from a highly heterogeneous dataset (Triantafillou et al., 2020). We metatrain the models with Aircrafts, Quickdraw and VGG-Flower dataset, and meta-test with the three datasets plus two additional datasets for OOD tasks - Traffic Signs and Fashion-MNIST. We see from Table 2 that Bayesian TAML also largely outperforms baselines in this setting. rototypical Networks perform relatively well for this multi-dataset classification due to their ability of learning a flexible metric space. Proto-MAML brings only marginal improvements on Prototypical Networks since it takes additional gradient steps without considering task dependency. On the other hand, Bayesian TAML effectively combines the advantage of both metric-based and gradient-based approaches by task-dependently modulating the gradient steps to handle task and class imbalance as well. See the Appendix A for the detailed experimental setup.
|
| 166 |
+
|
| 167 |
+
# 5.2 EFFECTIVENESS OF THE BALANCING VARIABLES
|
| 168 |
+
|
| 169 |
+
We now validate the effectiveness of the three balancing variables to clearly show their effectiveness.
|
| 170 |
+
|
| 171 |
+
$\mathbf { z } ^ { \tau }$ for handling distributional shift. $\mathbf { z } ^ { \tau }$ modulates the initial model parameter $\pmb \theta$ , and decides what and how much to use from the meta-knowledge $\pmb \theta$ based on the relatedness between the initial $\pmb \theta$ and the task at hand. We validate the effectiveness of this balancing variable by examining the performance of the baseline methods and our models using the datasets (SVHN, CUB) that are highly heterogeneous from the meta-training datasets (CIFAR-FS, miniImageNet). The results in Table 3 show that our model with only $\mathbf { z } ^ { \tau }$ can effectively handle these out-of-distribution (OOD) tasks. We observe in Figure 4 that $\mathbf { z } ^ { \tau }$ actually relocates the initial $\pmb \theta$ far from the initial parameter for these OOD tasks given at meta-test time, with larger displacements for highly heterogeneous tasks (Figure 4, right). This allows the model to either stick to, or deviate from the meta-knowledge based on the similarity between the tasks given at the meta-training and meta-test time. Moreover, the last two rows of Table 3 show that the MC approximation in Eq. (8) largely outperforms the naive approximation in Eq. (9), which suggests that $\mathbf { z } ^ { \tau }$ learns very large variance. We conjecture that the role of such random initialization in MAML framework is to increase the effective learning rate for OOD tasks (See Appendix D for the discussion).
|
| 172 |
+
|
| 173 |
+
Table 3: Ablation study on distributional shift.
|
| 174 |
+
|
| 175 |
+
<table><tr><td>Meta-training</td><td>CIFAR-FS</td><td>miniImageNet</td></tr><tr><td>Meta-test</td><td>SVHN</td><td>CUB</td></tr><tr><td>MAML</td><td>45.17±0.22</td><td>65.77±0.24</td></tr><tr><td>Meta-SGD</td><td>46.45±0.24</td><td>65.94±0.22</td></tr><tr><td>B. z-TAML (naive approx.)</td><td>47.80±0.20</td><td>67.90±0.21</td></tr><tr><td>B.z-TAML (MC approx.)</td><td>52.29±0.24</td><td>69.11±0.22</td></tr></table>
|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
Figure 4: T-SNE visualization of $\pmb { \theta }$ and $\pmb { \theta } * \mathbb { E } [ \mathbf { z } ^ { \tau } ]$
|
| 179 |
+
|
| 180 |
+
$\gamma ^ { \tau }$ and $\mathbf { z } ^ { \tau }$ for handling task imbalance. We then examine how the two balancing variables, $\gamma ^ { \tau }$ and $\mathbf { z } ^ { \tau }$ handle inter-task imbalance where tasks used for meta-learning have largely different number of instances. Figure 5(a) shows the performance of the baseline models and our models with each of the balancing variables, when the number of instances per task varies from 5 to 2000. We observe that our Bayesian $\mathbf { z }$ -TAML and Bayesian $\gamma$ -TAML largely outperform Meta-SGD, especially by large degree when the number of instances per task is large. Figure 5(b) shows that the effectiveness of $\mathbf { z } ^ { \tau }$ largely depends on the number of MC samples used in Eq. (8), demonstrating the importance of incorporating uncertainties in random initializations for handling task imbalance. We further observe from Figure 5(c) that the task-dependent learning rate multiplier $\gamma ^ { \tau }$ rapidly grows as the number of instances per task increases. This agrees with our intuition that larger tasks should take larger inner-gradient steps, to learn more from the given task rather than resorting to meta-knowledge.
|
| 181 |
+
|
| 182 |
+

|
| 183 |
+
Figure 5: Ablation study on task imbalance (Meta-training: CIFAR-FS, Meta-test: SVHN).
|
| 184 |
+
|
| 185 |
+
$\omega ^ { \tau }$ for handling class imbalance. $\omega ^ { \tau }$ rescales the class-specific gradients to handle class imbalance where the number of instances per class (i.e. shot) largely varies. Table 4 shows the results under the varying degree of class imbalance across the task distribution. We observe that Bayesian $\omega$ -TAML outperforms Meta-SGD, especially by larger degree under higher class imbalance. Notably, Bayesian $\omega$ -TAML outperforms a heuristic balancing method which divides each class-specific gradient by the cardinality of each class set (Meta-SGD with $1 / N _ { ☉ }$ ). The accuracy improvements over Meta-SGD in Figure 6 demonstrate that this heuristic balancing method overly emphasizes the tail classes with few training instances, thereby deteriorating the performance on classes with sufficiently large number of instances. On the other hand, our Bayesian $\omega$ -TAML learns the appropriate balancing variables which allow to obtain large performance gains on all classes.
|
| 186 |
+
|
| 187 |
+
<table><tr><td>Meta-training /Meta-test CIFAR-FS /CIFAR-FS</td><td>Number of instances per class 10 5-25</td></tr><tr><td>MAML</td><td>1-50 73.60±0.19 71.15±0.19 67.43±0.22</td></tr><tr><td>Meta-SGD</td><td>73.25±0.19 72.68±0.19 71.61±0.19</td></tr><tr><td>Meta-SGD with 1/N</td><td>71.33±0.19 72.43±0.19 72.23±0.19</td></tr><tr><td>Bayesian ω-TAML</td><td>73.44±0.18 73.20±0.18 72.86±0.19</td></tr></table>
|
| 188 |
+
|
| 189 |
+
Table 4: Ablation study on class imbalance.
|
| 190 |
+
|
| 191 |
+

|
| 192 |
+
Figure 6: $\mathbb { E } [ \omega ^ { \tau } ]$ and accuracy improvements over Meta-SGD.
|
| 193 |
+
|
| 194 |
+
# 5.3 MORE ABLATION STUDIES
|
| 195 |
+
|
| 196 |
+
Effectiveness of Bayesian modeling We further demonstrate the effectiveness of Bayesian modeling by comparing it with the deterministic version of our model (Deterministic TAML), where three balancing variables are no longer stochastic. We apply $\ell _ { 2 }$ regularization on the variables with coefficients that are equivalent to the KL-divergence in Eq. (5). The results in Table 5 show that the Bayesian TAML significantly outperforms its deterministic counterpart, especially with larger gap on the OOD task (SVHN). We also see from the last two rows of the table that MC approximation in Eq. (8) is more beneficial for the OOD tasks than for the ID tasks (See Appendix D for the discussion). Figure 7 further shows that the balancing variable $\gamma ^ { \tau }$ for handling task imbalance, more sensitively reacts on Bayesian TAML than on Deterministic TAML, which suggests that Bayesian modeling amplifies the effect of the balancing variables.
|
| 197 |
+
|
| 198 |
+
<table><tr><td>Meta-training: CIFAR-FS</td><td>CIFAR-FS</td><td>SVHN</td></tr><tr><td>MAML</td><td>70.19±0.23</td><td>41.81±0.19</td></tr><tr><td>Meta-SGD</td><td>72.71±0.21</td><td>46.45±0.24</td></tr><tr><td>Deterministic TAML</td><td>73.82±0.21</td><td>46.78±0.24</td></tr><tr><td>Bayesian TAML (Naive approx.)</td><td>73.52±0.20</td><td>47.15±0.20</td></tr><tr><td>Bayesian TAML (MC approx.)</td><td>75.15±0.20</td><td>51.87±0.23</td></tr></table>
|
| 199 |
+
|
| 200 |
+
Table 5: Classification performance of Bayesian and Deterministic TAML on seen and unseen dataset.
|
| 201 |
+
|
| 202 |
+

|
| 203 |
+
Figure 7: $\mathbb { E } [ \gamma ^ { \tau } ]$ vs. Bayesianness.
|
| 204 |
+
|
| 205 |
+
Dataset encoding Finally, we perform an ablation study of the proposed task encoding network. The results in Table 6 show that the proposed hierarchical encoding scheme for classification dataset, with set cardinality and variance is significantly more effective than simple mean-pooling methods (Zaheer et al., 2017; Edwards & Storkey, 2017)4.
|
| 206 |
+
|
| 207 |
+
<table><tr><td>Meta-training/Meta-test CIFAR-FS/CIFAR-FS</td><td>Hierarchical encoding ×</td><td>√</td></tr><tr><td>Mean</td><td>73.84±0.21</td><td>73.69±0.21</td></tr><tr><td>Mean +N</td><td>73.17±0.21</td><td>74.88±0.20</td></tr><tr><td>Mean+Var.+N</td><td>73.93±0.21</td><td>75.15±0.20</td></tr></table>
|
| 208 |
+
|
| 209 |
+
Table 6: Ablation study on dataset encoding schemes. N: Set cardinality.
|
| 210 |
+
|
| 211 |
+
# 6 CONCLUSION
|
| 212 |
+
|
| 213 |
+
We propose Bayesian TAML that learns to balance the effect of meta-learning and task-adaptive learning, to consider meta-learning under a more realistic task distribution where each task and class can have varying number of instances. Specifically, we encode the dataset for each task into hierarchical representations, and use it to modulate the original parameter, learning rate, and the classspecific gradients. We use a Bayesian framework to infer the posterior of these balancing variables, and propose an effective variational inference framework to solve for them. Our model outperforms existing meta-learning methods when validated on imbalanced few-shot classification tasks. Further analysis of each balancing variable shows that each variable effectively handles task imbalance, class imbalance, and out-of-distribution tasks. We believe that our work makes a meaningful step toward application of meta-learning to real-world problems.
|
| 214 |
+
|
| 215 |
+
Acknowledgements This work was supported by Google AI Focused Research Award, Samsung Research Funding Center of Samsung Electronics (No. SRFC-IT1502-51), the Engineering Research Center Program through the National Research Foundation of Korea (NRF) funded by the Korean Government MSIT (NRF-2018R1A5A1059921), and the Institute of Information & communications Technology Planning & Evaluation (IITP) grant funded by the Korea government(MSIT) (No.2019- 0-00075, and Artificial Intelligence Graduate School Program (KAIST)).
|
| 216 |
+
|
| 217 |
+
# REFERENCES
|
| 218 |
+
|
| 219 |
+
Luca Bertinetto, Joao F Henriques, Philip HS Torr, and Andrea Vedaldi. Meta-learning with differentiable closed-form solvers. In ICLR, 2019.
|
| 220 |
+
|
| 221 |
+
Harrison Edwards and Amos Storkey. Towards a neural statistician. In ICLR, 2017.
|
| 222 |
+
|
| 223 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In ICML, 2017.
|
| 224 |
+
|
| 225 |
+
Chelsea Finn, Kelvin Xu, and Sergey Levine. Probabilistic model-agnostic meta-learning. In NeurIPS, 2018.
|
| 226 |
+
|
| 227 |
+
Sebastian Flennerhag, Andrei A. Rusu, Razvan Pascanu, Francesco Visin, Hujun Yin, and Raia Hadsell. Meta-learning with warped gradient descent. In ICLR, 2020.
|
| 228 |
+
|
| 229 |
+
Jonathan Gordon, John Bronskill, Matthias Bauer, Sebastian Nowozin, and Richard E Turner. Metalearning probabilistic inference for prediction. In ICLR, 2019.
|
| 230 |
+
|
| 231 |
+
Sebastian Houben, Johannes Stallkamp, Jan Salmen, Marc Schlipsing, and Christian Igel. Detection of traffic signs in real-world images: The german traffic sign detection benchmark. In The 2013 international joint conference on neural networks (IJCNN), pp. 1–8. IEEE, 2013.
|
| 232 |
+
|
| 233 |
+
Takashi Kawashima Jongmin Kim Jonas Jongejan, Henry Rowley and Nick Fox-Gieg. The quick, draw! – a.i. experiment. 2016. URL http://quickdraw.withgoogle.com.
|
| 234 |
+
|
| 235 |
+
Taesup Kim, Jaesik Yoon, Ousmane Dia, Sungwoong Kim, Yoshua Bengio, and Sungjin Ahn. Bayesian model-agnostic meta-learning. In NeurIPS, 2018.
|
| 236 |
+
|
| 237 |
+
Diederik P. Kingma and Max Welling. Auto encoding variational bayes. In ICLR, 2014.
|
| 238 |
+
|
| 239 |
+
Yoonho Lee and Seungjin Choi. Gradient-based meta-learning with learned layerwise metric and subspace. In ICML, 2018.
|
| 240 |
+
|
| 241 |
+
Zhenguo Li, Fengwei Zhou, Fei Chen, and Hang Li. Meta-sgd: Learning to learn quickly for few shot learning. arXiv preprint arXiv:1707.09835, 2017.
|
| 242 |
+
|
| 243 |
+
Subhransu Maji, Esa Rahtu, Juho Kannala, Matthew Blaschko, and Andrea Vedaldi. Fine-grained visual classification of aircraft. arXiv preprint arXiv:1306.5151, 2013.
|
| 244 |
+
|
| 245 |
+
Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. 2011.
|
| 246 |
+
|
| 247 |
+
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.
|
| 248 |
+
|
| 249 |
+
Boris Oreshkin, Pau Rodríguez López, and Alexandre Lacoste. Tadam: Task dependent adaptive metric for improved few-shot learning. In NeurIPS, 2018.
|
| 250 |
+
|
| 251 |
+
Siyuan Qiao, Chenxi Liu, Wei Shen, and Alan L Yuille. Few-shot image recognition by predicting parameters from activations. In CVPR, 2018.
|
| 252 |
+
|
| 253 |
+
Sachin Ravi and Alex Beatson. Amortized bayesian meta-learning. In ICLR, 2019.
|
| 254 |
+
|
| 255 |
+
Sachin Ravi and Hugo Larochelle. Optimization as a model for few-shot learning. In ICLR, 2017.
|
| 256 |
+
|
| 257 |
+
James Requeima, Jonathan Gordon, John Bronskill, Sebastian Nowozin, and Richard E Turner. Fast and flexible multi-task classification using conditional neural adaptive processes. In NeurIPS, 2019.
|
| 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 |
+
Andrei A Rusu, Dushyant Rao, Jakub Sygnowski, Oriol Vinyals, Razvan Pascanu, Simon Osindero, and Raia Hadsell. Meta-learning with latent embedding optimization. In ICLR, 2019.
|
| 262 |
+
|
| 263 |
+
Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lillicrap. Metalearning with memory-augmented neural networks. In ICML, 2016.
|
| 264 |
+
|
| 265 |
+
Jürgen Schmidhuber. Evolutionary principles in self-referential learning, or on learning how to learn: the meta-meta-... hook. PhD thesis, Technische Universität München, 1987.
|
| 266 |
+
|
| 267 |
+
Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In NIPS, 2017.
|
| 268 |
+
|
| 269 |
+
Sebastian Thrun and Lorien Pratt (eds.). Learning to Learn. Kluwer Academic Publishers, Norwell, MA, USA, 1998. ISBN 0-7923-8047-9.
|
| 270 |
+
|
| 271 |
+
Eleni Triantafillou, Tyler Zhu, Vincent Dumoulin, Pascal Lamblin, Kelvin Xu, Ross Goroshin, Carles Gelada, Kevin Swersky, Pierre-Antoine Manzagol, and Hugo Larochelle. Meta-dataset: A dataset of datasets for learning to learn from few examples. In ICLR, 2020.
|
| 272 |
+
|
| 273 |
+
Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In NIPS, 2016.
|
| 274 |
+
|
| 275 |
+
Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017.
|
| 276 |
+
|
| 277 |
+
Manzil Zaheer, Satwik Kottur, Siamak Ravanbakhsh, Barnabas Poczos, Ruslan R Salakhutdinov, and Alexander J Smola. Deep sets. In NIPS, 2017.
|
| 278 |
+
|
| 279 |
+
# A EXPERIMENTAL SETUP
|
| 280 |
+
|
| 281 |
+
# A.1 BASELINES
|
| 282 |
+
|
| 283 |
+
We describe the baseline models and our task-adaptive learning to balance model.
|
| 284 |
+
|
| 285 |
+
1) MAML. The Model-Agnostic Meta-Learning (MAML) model by Finn et al. (2017), which aims to learn the global initial model parameter, from which we can take a few gradient steps to get task-specific predictors.
|
| 286 |
+
|
| 287 |
+
2) ABML. This model interprets MAML under hierarchical Bayesian framework, but they propose to share and amortize the inference rules across both global initial parameters as well as the task-specific parameters.
|
| 288 |
+
|
| 289 |
+
3) MT-net. A gradient-based meta-learning model proposed by Lee & Choi (2018). The model obtains a task-specific parameter only w.r.t. a subset of the whole dimension (M-net), followed by a linear transformation to learn a metric space (T-net).
|
| 290 |
+
|
| 291 |
+
4) Meta-SGD. A base MAML with the learnable learning-rate vector (without any restriction on sign) element-wisely multiplied to each step inner-gradient (Li et al., 2017).
|
| 292 |
+
|
| 293 |
+
5) Prototypical Networks. A metric-based few-shot classification model proposed by Snell et al. (2017). The model learns a metric space based on Euclidean distance between class prototypes and query embeddings.
|
| 294 |
+
|
| 295 |
+
6) Proto-MAML. A variant of MAML (Triantafillou et al., 2020) that replaces the initialization of the final fully-connected layer matrix with the equivalent one of the Prototypical Networks (Snell et al., 2017). This model combines the advantage of both metric-based and gradient-based approach. We set $\alpha$ to 0.0005 for any-shot classification and 0.01 for multi-dataset experiments.
|
| 296 |
+
|
| 297 |
+
7) Bayesian TAML. Our model that can adaptively balance between meta- and task-specific learners for each task and class.
|
| 298 |
+
|
| 299 |
+
# A.2 ANY-SHOT CLASSIFICATION.
|
| 300 |
+
|
| 301 |
+
We describe more detailed experimental settings for any-shot classification. For MAML, ABML and MT-NET, we set the inner-gradient stepsize $\alpha$ to 0.5 for CIFAR-FS / SVHN, and 0.1 for miniImageNet / CUB, after searching the range $\alpha \in \{ 0 . 0 1 , 0 . 0 5 , 0 . 1 , 0 . 5 \}$ .
|
| 302 |
+
|
| 303 |
+
CIFAR-FS and SVHN: We meta-train all models for total $5 0 K$ iterations with meta-batch size set to 4. The outer learning rate is set to 0.001 for all the baselines and our models.
|
| 304 |
+
|
| 305 |
+
miniImageNet and CUB: We meta-train all models for total $8 0 K$ iterations with meta-batch size set to 1. The outer learning rate is set to 0.0001 for all the baselines and our models.
|
| 306 |
+
|
| 307 |
+
# A.3 MULTI-DATASET CLASSIFICATION
|
| 308 |
+
|
| 309 |
+
For multi-dataset classification, we construct a subset of the whole collection of the Meta-Dataset (Triantafillou et al., 2020). We resize the images into $3 2 \times 3 2$ pixels. For each task, We uniformly select one dataset among Aircrafts, Quickdraw and VGG-Flower and randomly sample 10 classes from the dataset. Then we sample instances from each class with the number of instances per class ranging from 1 to 50. The number of test instances is equally set to 15 for all classes. At meta-test time, we use the three datasets plus two more out-of-distribution datasets - Traffic Signs and Fashion-MNIST. For MAML, ABML and MT-NET, we set the inner-gradient stepsize $\alpha$ to 0.5. We set the number of classes for each task to 10, meta-batch size to 3, meta-training iterations to $6 0 K$ , and outer learning rate to 0.001 for all models.
|
| 310 |
+
|
| 311 |
+
Aircraft: We split this dataset (Maji et al., 2013) into 70/15/15 classes for meta- training/validation/test with 100 examples for each class.
|
| 312 |
+
|
| 313 |
+
Quick Draw: We split this dataset (Jonas Jongejan & Fox-Gieg, 2016) into $2 4 1 / 5 2 / 5 2$ classes for meta- training/validation/test with randomly sampled 200 examples for each class.
|
| 314 |
+
|
| 315 |
+
VGG Flower: This dataset (Nilsback & Zisserman, 2008) contains 40 between 258 images for each class and we split this dataset into 71/16/15 classes for meta- training/validation/test.
|
| 316 |
+
|
| 317 |
+
Traffic Signs: This dataset (Houben et al., 2013) has only test set consisting of 43 classes. Each class has 900 examples.
|
| 318 |
+
|
| 319 |
+
Fashion-MNIST: We use the test set of Fashion-MNIST (Xiao et al., 2017) for meta-testing. This dataset has 10 classes with 1000 examples per class.
|
| 320 |
+
|
| 321 |
+
# A.4 INFERENCE NETWORK ARCHITECTURE
|
| 322 |
+
|
| 323 |
+
We describe the network architecture of the inference network that takes a classification dataset as an input and generates three balancing variables as output.
|
| 324 |
+
|
| 325 |
+
Shared encoder $\mathbf { N N } _ { 1 } : \mathbf { X } _ { 1 } ^ { \tau } , \ldots , \mathbf { X } _ { C } ^ { \tau } \mathbf { s } _ { 1 } , \ldots , \mathbf { x } _ { C }$
|
| 326 |
+
|
| 327 |
+
3 × 3 Conv2d with 10-dim and ReLU
|
| 328 |
+
$2 \times 2$ Max pool
|
| 329 |
+
$3 \times 3$ Conv2d with 10-dim and ReLU
|
| 330 |
+
$2 \times 2$ Max pool
|
| 331 |
+
fc layer with 64-dim
|
| 332 |
+
Statistics Pooling for each class $c = 1 , \ldots , C$ . $f c$ layer with 4-dim (across the statistics) and ReLU
|
| 333 |
+
|
| 334 |
+
Shared encoder $\mathbf { N N } _ { 2 } : \mathbf { s } _ { 1 } , \ldots , \mathbf { s } _ { C } \to \mathbf { v } ^ { \tau }$ fc layer with 128-dim and ReLU $f c$ layer with 32-dim Statistics Pooling over all the class representations $f c$ layer with 4-dim (across the statistics) and ReLU $f c$ layer with 64-dim and ReLU $f c$ layer to generate $( \mu _ { \omega _ { c } } ^ { \tau } , \sigma _ { \omega _ { c } } ^ { \tau } )$ for each class $c = 1 , \ldots , C$ .
|
| 335 |
+
|
| 336 |
+
$f c$ layer with 64-dim and ReLU $f c$ layer to generate $( \mu _ { \gamma _ { l } } ^ { \tau } , \sigma _ { \gamma _ { l } } ^ { \tau } )$ for each layer $l = 1 , \ldots , L$ .
|
| 337 |
+
|
| 338 |
+
Generate $\mathbf { z } ^ { \tau } \colon \mathbf { v } ^ { \tau } \to \mu _ { \mathbf { z } } ^ { \tau } , \pmb { \sigma } _ { \mathbf { z } } ^ { \tau }$ $f c$ layer with 64-dim and ReLU $f c$ layer to generate $( \mu _ { \mathbf { z } } ^ { \tau } , \sigma _ { \mathbf { z } } ^ { \tau } )$ for the output channels
|
| 339 |
+
|
| 340 |
+
B JUSTIFICATION FOR SET-OF-SETS STRUCTURE.
|
| 341 |
+
|
| 342 |
+
Based on the previous justification of DeepSets (Zaheer et al., 2017), we can easily justify the Set-ofSets structure proposed in the main paper as well, in terms of the two-level permutation invariance properties required for any classification dataset. The main theorem of DeepSets is:
|
| 343 |
+
|
| 344 |
+
Theorem 1. A function $f$ operating on a set $\mathbf { X } \in { \mathcal { X } }$ is a valid set function (i.e. permutation invariant), iff it can be decomposed as $\begin{array} { r } { f ( \mathbf { X } ) \bar { \mathbf { \eta } } = \rho _ { 2 } ( \sum _ { \mathbf { x } \in \mathbf { X } } \rho _ { 1 } ( \mathbf { x } ) ) } \end{array}$ , where $\rho _ { 1 }$ and $\rho _ { 2 }$ are appropriate nonfcities.
|
| 345 |
+
|
| 346 |
+
See (Zaheer et al., 2017) for the proof. Here we apply the same argument twice as follows.
|
| 347 |
+
|
| 348 |
+
1. A function $f$ operating on a set of representations $\{ \mathbf { s } _ { 1 } , \dotsc , \mathbf { s } _ { C } \}$ (we assume each $\mathbf { s } _ { c }$ is an output from a shared function ) is a valid set function (i.e. permutation invariant w.r.t. the order of $\{ \mathbf { s } _ { 1 } , \dotsc , \mathbf { s } _ { C } \} )$ , iff it can be decomposed as $\begin{array} { r } { f ( \{ \mathbf { s } _ { 1 } , \ldots , \mathbf { s } _ { C } \} ) = \rho _ { 2 } ( \sum _ { c = 1 } ^ { C } \rho _ { 1 } ( \mathbf { s } _ { c } ) ) } \end{array}$ with appropriate nonfcities $\rho _ { 1 }$ and $\rho _ { 2 }$ .
|
| 349 |
+
|
| 350 |
+
2. A function $g$ operating on a set of examples $\left\{ \mathbf { x } _ { c , 1 } , \ldots , \mathbf { x } _ { c , N } \right\}$ is a valid set function (i.e. permutation invariant w.r.t. the order of $\left\{ \mathbf { x } _ { c , 1 } , \ldots , \mathbf { x } _ { c , N } \right\} ) \ i f f$ it can be decomposed as $\begin{array} { r } { g ( \{ \mathbf { x } _ { c , 1 } , . . . , \mathbf { x } _ { c , N } \} ) = \rho _ { 4 } ( \sum _ { i = 1 } ^ { N } \rho _ { 3 } ( \mathbf { x } _ { c , i } ) ) } \end{array}$ with appropriate nonfcities $\rho _ { 3 }$ and $\rho _ { 4 }$ .
|
| 351 |
+
|
| 352 |
+
Inserting $\mathbf { s } _ { c } = g ( \{ \mathbf { x } _ { c , 1 } , \ldots , \mathbf { x } _ { c , N } \} )$ into the expression of $f$ , we arrive at the following valid composite function operating on a set of sets:
|
| 353 |
+
|
| 354 |
+
$$
|
| 355 |
+
f \left( \left\{ g \left( \left\{ \mathbf { x } _ { c , 1 } , \ldots , \mathbf { x } _ { c , N } \right\} \right) \right\} _ { c = 1 } ^ { C } \right) = \rho _ { 2 } \left( \sum _ { c = 1 } ^ { C } \rho _ { 1 } \left( \rho _ { 4 } \left( \sum _ { i = 1 } ^ { N } \rho _ { 3 } \left( \mathbf { x } _ { c , i } \right) \right) \right) \right)
|
| 356 |
+
$$
|
| 357 |
+
|
| 358 |
+
Let $F$ denote the composite of $f$ and (multiple) $g$ and let $\mathrm { N N } _ { 2 }$ denote the composite of $\rho _ { 1 }$ and $\rho _ { 4 }$ Further define $\mathrm { N N _ { 1 } } : = \rho _ { 3 }$ and $\mathrm { N N } _ { 3 } : = \rho _ { 2 }$ . Then, we have
|
| 359 |
+
|
| 360 |
+
$$
|
| 361 |
+
F { \Big ( } { \big \{ } \{ \mathbf { x } _ { 1 , 1 } , \dotsc , \mathbf { x } _ { 1 , N } { \big \} } , \dotsc , \{ \mathbf { x } _ { C , 1 } , \dotsc , \mathbf { x } _ { C , N } { \big \} } { \Big \} } { \Big ) } = \mathrm { N N } _ { 3 } \left( \sum _ { c = 1 } ^ { C } \mathrm { N N } _ { 2 } \left( \sum _ { i = 1 } ^ { N } \mathrm { N N } _ { 1 } \left( \mathbf { x } _ { c , i } \right) \right) \right)
|
| 362 |
+
$$
|
| 363 |
+
|
| 364 |
+
where $C$ is the number of classes and $N$ is the number of examples per class. See Section A.4 for the actual encoder structure.
|
| 365 |
+
|
| 366 |
+
# C ABLATION STUDY ON HIGHER-ORDER STATISTICS
|
| 367 |
+
|
| 368 |
+
While our framework does not place any restriction on selecting the statistics for set encoding, we perform further ablation study on the effectiveness of higher-order statistics for our specific experimental setting. We see from Table 7 that the higherorder statistics such as element-wise sample skewness and kurtosis improve the performance given sample mean and diagonal covariance. However, the set cardinality seems more effective than those statistics as it could be the most direct and relevant criteria for detecting imbalances in a set.
|
| 369 |
+
|
| 370 |
+
<table><tr><td rowspan="2">Meta-training CIFAR-FS</td><td colspan="2">Meta-test</td></tr><tr><td>CIFAR-FS</td><td>SVHN</td></tr><tr><td>Mean+Var.</td><td>73.37±0.21</td><td>49.81±0.22</td></tr><tr><td>Mean + Var.+ Skew.</td><td>73.66±0.21</td><td>50.33±0.23</td></tr><tr><td>Mean+Var.+Kurt.</td><td>73.47±0.21</td><td>50.27±0.23</td></tr><tr><td>Mean +Var.+N</td><td>75.15±0.20</td><td>51.87±0.23</td></tr></table>
|
| 371 |
+
|
| 372 |
+
Table 7: Further ablation study on dataset encoding schemes. N: Set cardinality.
|
| 373 |
+
|
| 374 |
+
# D ANALYSIS ON RANDOM INITIALIZATION FOR SOLVING OUT-OF-DISTRIBUTION TASKS
|
| 375 |
+
|
| 376 |
+
In this section, we analyze the effect of the variance of $\mathbf { z } ^ { \tau }$ for solving OOD tasks, that randomizes the MAML initialization parameter $\pmb \theta$ . Define $\mathbb { E } _ { q ( \mathbf { z } ^ { \tau } | \mathcal { D } ^ { \tau } ; \psi ) } [ \pmb { \theta } _ { 0 } ] = \pmb { \theta } * \mathbb { E } _ { q } [ \mathbf { z } ^ { \tau } ]$ , the initialization parameter modulated by the posterior mean of $\mathbf { z } ^ { \tau }$ . Then, we measure the $\ell _ { 2 }$ distance from $\mathbb { E } _ { q } [ \pmb { \theta } _ { 0 } ]$ to the two different versions of the final task-specific parameter $\pmb { \theta } ^ { \tau }$ after taking 10 gradient steps, in order to see how the posterior variance of $\mathbf { z } ^ { \tau }$ affects the final task-specific parameter $\pmb { \theta } ^ { \tau }$ as a function of $\mathbf { z } ^ { \tau }$ :
|
| 377 |
+
|
| 378 |
+
• $\pmb { \theta } ^ { \tau } ( \mathbb { E } _ { q } [ \mathbf { z } ^ { \tau } ] ] )$ : Task-specific predictor $\pmb { \theta } ^ { \tau }$ obtained without the variance of $\mathbf { z } ^ { \tau }$ , such that the expectation is taken before the inner-gradient steps. • $\mathbb { E } _ { z } [ \pmb { \theta } ^ { \tau } ( { \mathbf z } ^ { \tau } ) ]$ : Task-specific predictor $\pmb { \theta } ^ { \tau }$ obtained with the variance in the random initialization, such that the expectation is taken outside of the gradient steps. We evaluate the expectation with MC approximation, having the ensemble of the diverse task-specific predictor samples $\pmb { \theta } _ { 1 } ^ { \tau } , \ldots , \pmb { \theta } _ { S } ^ { \tau }$ (we use $S = 5 0$ ).
|
| 379 |
+
|
| 380 |
+

|
| 381 |
+
Figure 8: $\ell _ { 2 }$ distance between the initialization and the task-specific parameters, under different treatment of the expectation over $q ( \mathbf { z } ^ { \tau } | \mathcal { D } ^ { \tau } ; \boldsymbol { \psi } )$ . We use Bayesian $\mathbf { z }$ -TAML and evaluate with CIFAR-FS / SVHN 50-shot tasks.
|
| 382 |
+
|
| 383 |
+
Figure 8 suggests that the role of the random initialization is to increase the effective learning rate for the OOD tasks. We see from the left bar graph that if we do not consider variance in the initialization $( \pmb { \theta } ^ { \tau } ( \mathbb { E } _ { q } [ \mathbf { z } ^ { \tau } ] ) )$ ), the OOD tasks deviate relatively less than the $\mathrm { I D }$ tasks (4.61 vs. 5.18), although it should deviate much considering the distributional discrepancy. On the other hand, if we incorporate the random initialization to obtain task-specific parameter $( \mathbb { E } _ { q } [ \pmb { \theta } ^ { \tau } ( \mathbf { z } ^ { \tau } ) ] )$ , OOD tasks can deviate further from the initialization $( 4 . 6 1 5 . 1 1 ^ { \circ }$ ). It directly results in the performance gain because the task-specific learner can exploit more of the information in the OOD tasks.
|
md/train/rkgPnhNFPB/rkgPnhNFPB.md
ADDED
|
@@ -0,0 +1,509 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RANDOM MATRIX THEORY PROVES THAT DEEP LEARNING REPRESENTATIONS OF GAN-DATA BEHAVE AS GAUSSIAN MIXTURES
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
This paper shows that deep learning (DL) representations of data produced by generative adversarial nets (GANs) are random vectors which fall within the class of so-called concentrated random vectors. Further exploiting the fact that Gram matrices, of the type $G = X ^ { \intercal } X$ with $\pmb { X } = [ \pmb { x } _ { 1 } , \ldots , \pmb { x } _ { n } ] \in \bar { \mathbb { R } } ^ { p \times n }$ and $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ independent concentrated random vectors from a mixture model, behave asymptotically (as $n , p \to \infty$ ) as if the $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ were drawn from a Gaussian mixture, suggests that DL representations of GAN-data can be fully described by their first two statistical moments for a wide range of standard classifiers. Our theoretical findings are validated by generating images with the BigGAN model and across different popular deep representation networks.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
The performance of machine learning methods depends strongly on the choice of the data representation (or features) on which they are applied. This data representation should ideally contain relevant information about the learning task in order to achieve learning with simple models and small amount of samples. Deep neural networks (Rumelhart et al., 1988) have particularly shown impressive results by automatically learning representations from raw data (e.g., images). However, due to the complex structure of deep learning models, the characterization of their hidden representations is still an open problem (Bengio et al., 2009).
|
| 12 |
+
|
| 13 |
+
Specifically, quantifying what makes a given deep learning representation better than another is a fundamental question in the field of Representation Learning (Bengio et al., 2013). Relying on (Montavon et al., 2011) a data representation is said to be good when it is possible to build simple models on top of it that are accurate for the given learning problem. Montavon et al. (2011) have notably quantified the layer-wise evolution of the representation in deep networks by computing the principal components of the Gram matrix $\pmb { G } _ { \ell } = \bar { \{ \phi _ { \ell } ( \pmb { x } _ { i } ) ^ { \top } \phi _ { \ell } ( \pmb { x } _ { j } ) \} _ { i , j = 1 } ^ { n ^ { - } } }$ at each layer for $n$ input data $\pmb { x } _ { 1 } , \ldots , \pmb { x } _ { n }$ , where $\phi _ { \ell } ( { \pmb x } )$ is the representation of $_ { \textbf { \em x } }$ at layer $\ell$ of the given DL model, and the number of components controls the model simplicity. In their study, the impact of the representation at each layer is quantified through the prediction error of a linear predictor trained on the principal subspace of $G _ { \ell }$ .
|
| 14 |
+
|
| 15 |
+
Pursuing on this idea, given a certain representation model ${ \pmb x } \mapsto \phi ( { \pmb x } )$ , we aim in this article at theoretically studying the large dimensional behavior, and in particular the spectral information (i.e., eigenvalues and dominant eigenvectors), of the corresponding Gram matrix ${ \textbf { \em G } } =$ $\{ \phi ( \pmb { x } _ { i } ) ^ { \top } \phi ( \pmb { x } _ { j } ) \} _ { i , j = 1 } ^ { \bar { n } }$ in order to determine the information encoded (i.e., the sufficient statistics) by the representation model on a set of real data $\pmb { x } _ { 1 } , \ldots , \pmb { x } _ { n }$ . Indeed, standard classification and regression algorithms –along with the last layer of a neural network (Yeh et al., 2018)– retrieve the data information directly from functionals or the eigenspectrum of $G ^ { 1 }$ . To this end, though, one needs a statistical model for the representations given the distribution of the raw data (e.g., images) which is generally unknown. Yet, due to recent advances in generative models since the advent of Generative Adversarial Nets (Goodfellow et al., 2014), it is now possible to generate complex data structures by applying successive Lipschitz operations to Gaussian random vectors. In particular, GAN-data are used in practice as substitutes of real data for data augmentation (Antoniou et al., 2017). On the other hand, the fundamental concentration of measure phenomenon (Ledoux, 2005) tells us that Lipschitz-ally transformed Gaussian vectors satisfy a concentration property. Precisely, defining the class of concentrated vectors $\textbf { \em x } \in \textbf { \em E }$ through concentration inequalities of $f ( { \pmb x } )$ , for any real Lipschitz observation $f : E \to \mathbb { R }$ , implies that deep learning representations of GAN-data fall within this class of random vectors, since the mapping ${ \pmb x } \mapsto \phi ( { \pmb x } )$ is Lipschitz. Thus, GAN-data are concentrated random vectors and thus an appropriate statistical model of realistic data.
|
| 16 |
+
|
| 17 |
+
Targeting classification applications by assuming a mixture of concentrated random vectors model, this article studies the spectral behavior of Gram matrices $G$ in the large $n , p$ regime. Precisely, we show that these matrices have asymptotically (as $n , p \to \infty$ with $p / n \to c < \infty )$ the same firstorder behavior as for a Gaussian Mixture Model (GMM). As a result, by generating images using the BigGAN model (Brock et al., 2018) and considering different commonly used deep representation models, we show that the spectral behavior of the Gram matrix computed on these representations is the same as on a GMM model with the same $p$ -dimensional means and covariances. A surprising consequence is that, for GAN data, the aforementioned sufficient statistics to characterize the quality of a given representation network are only the first and second order statistics of the representations. This behavior is shown by simulations to extend beyond random GAN-data to real images from the Imagenet dataset (Deng et al., 2009).
|
| 18 |
+
|
| 19 |
+
The rest of the paper is organized as follows. In Section 2, we introduce the notion of concentrated vectors and their main properties. Our main theoretical results are then provided in Section 3. In Section 4 we present experimental results. Section 5 concludes the article.
|
| 20 |
+
|
| 21 |
+
In the following,. Given a vector the n, the ation fro-norm of (Goodfellois given as $[ n ]$ denotes . Given a $\{ 1 , \ldots , n \}$ $\mathbf { x } \in \mathbb { R } ^ { n }$ $\ell _ { 2 }$ $_ { \textbf { \em x } }$ $\begin{array} { r } { \| \pmb { x } \| ^ { 2 } = \sum _ { i = 1 } ^ { n } \dot { \pmb { x } } _ { i } ^ { 2 } } \end{array}$ $p \times n$ matrix $M$ , its Frobenius norm is defined as $\begin{array} { r } { \| \boldsymbol { M } \| _ { F } ^ { 2 } = \sum _ { i = 1 } ^ { p } \sum _ { j = 1 } ^ { n } M _ { i j } ^ { 2 } } \end{array}$ i=1 iand its spectral norm as $\begin{array} { r } { \| M \| = \operatorname* { s u p } _ { \| \boldsymbol { x } \| = 1 } \| M \boldsymbol { x } \| } \end{array}$ . $\odot$ for the Hadamard product. An application $\mathcal { F } : E F$ is said to be $\| \mathcal { F } \| _ { l i p }$ -Lipschitz, if $\forall ( \pmb { x } , \pmb { y } ) \in E ^ { 2 }$ , $\Vert \mathcal { F } ( \pmb { x } ) - \mathcal { F } ( \pmb { y } ) \Vert _ { F } \leq \Vert \mathcal { F } \Vert _ { l i p } \cdot \Vert \pmb { x } - \pmb { y } \Vert _ { E }$ and $\| \mathcal F \| _ { l i p }$ is finite.
|
| 22 |
+
|
| 23 |
+
# 2 BASIC NOTIONS OF CONCENTRATED VECTORS
|
| 24 |
+
|
| 25 |
+
Being the central tool of our study, we start by introducing the notion of concentrated vectors. While advanced concentration notions have been recently developed in (Louart & Couillet, 2019) in order to specifically analyze the behavior of large dimensional sample covariance matrices, for simplicity, we restrict ourselves here to the sufficient so-called $q$ -exponentially concentrated random vectors.
|
| 26 |
+
|
| 27 |
+
Definition 2.1 $\dot { \boldsymbol { g } }$ -exponential concentration). Given a normed space $( E , \| \cdot \| _ { E } )$ and a real $q$ , a random vector $\mathbf x \in E$ is said to be $q$ -exponentially concentrated if for any 1-Lipschitz real function $f : E \to \mathbb { R }$ , there exists $C \geq 0$ independent of $\dim ( E )$ and $\sigma > 0$ such that for all $t \geq 0$
|
| 28 |
+
|
| 29 |
+
$$
|
| 30 |
+
\mathbb { P } \left\{ | f ( \pmb { x } ) - \mathbb { E } f ( \pmb { x } ) | > t \right\} \le C e ^ { - ( t / \sigma ) ^ { q } }
|
| 31 |
+
$$
|
| 32 |
+
|
| 33 |
+
which we denote $\pmb { x } \in \mathcal { E } _ { q } ( \sigma | E , \| \cdot \| _ { E } )$ . We simply write $\pmb { x } \in \mathcal { E } _ { q } ( 1 | E , \| \cdot \| _ { E } )$ if the tail parameter $\sigma$ does not depend on $\dim ( E )$ , and $x \in \mathcal { E } _ { q } ( 1 )$ for $x$ a scalar real random variable.
|
| 34 |
+
|
| 35 |
+
Therefore, concentrated vectors are defined through the concentration of any 1-Lipschitz real scalar “observation”. One of the most important examples of concentrated vectors are standard Gaussian vectors. Precisely, we have the following proposition. See (Ledoux, 2005)) for more examples such as uniform and Gamma distribution.
|
| 36 |
+
|
| 37 |
+
Proposition 2.2 (Gaussian vectors (Ledoux, 2005)). Let $d \in \mathbb { N }$ and $\pmb { x } \sim \mathcal { N } ( 0 , \pmb { I } _ { d } )$ . Then $_ { \textbf { \em x } }$ is $a$ 2-exponentially concentrated vector independently on the dimension $d$ , i.e. $\pmb { x } \in \mathcal { E } _ { 2 } ( 1 | \mathbb { R } ^ { d } , \| \cdot \| )$ .
|
| 38 |
+
|
| 39 |
+
Concentrated vectors have the interesting property of being stable by application of $\mathbb { R } ^ { d } \mathbb { R } ^ { p }$ vector-Lipschitz transformations. Indeed, Lipschitz-ally transformed concentrated vectors remain concentrated according to the following proposition.
|
| 40 |
+
|
| 41 |
+
Proposition 2.3 (Lipschitz stability (Louart & Couillet, 2019)). Let $x \in \mathcal { E } _ { q } ( 1 | E , \| \cdot \| _ { E } )$ and $\mathcal { G } : E F$ a Lipschitz application with Lipschitz constant $\| \mathcal G \| _ { l i p }$ which may depend on $\dim ( F )$ . Then the concentration property on $_ { \textbf { \em x } }$ is transferred to $\mathcal { G } ( \pmb { x } )$ , precisely
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\begin{array} { r } { \pmb { x } \in \mathcal { E } _ { q } ( 1 \vert E , \Vert \cdot \Vert _ { E } ) \Rightarrow \mathcal { G } ( \pmb { x } ) \in \mathcal { E } _ { q } ( \Vert \mathcal { G } \Vert _ { l i p } \vert F , \Vert \cdot \Vert _ { F } ) . } \end{array}
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
Note importantly for the following that the Lipschitz constant of the transformation $\mathcal { G }$ must be controlled, in order to constrain the tail parameter of the obtained concentration.
|
| 48 |
+
|
| 49 |
+
In particular, we have the coming corollary to Proposition 2.3 of central importance in the following.
|
| 50 |
+
|
| 51 |
+
Corollary 2.4. Let $\mathcal { G } _ { 1 } , \ldots , \mathcal { G } _ { n } : \mathbb { R } ^ { d } \ \to \ \mathbb { R } ^ { p }$ a set of $n$ Lipschitz applications with Lipschitz constants $\| \mathcal { G } _ { i } \| _ { l i p }$ . Let $\mathcal { G } ~ : ~ \mathbb { R } ^ { d \times n } ~ ~ \mathbb { R } ^ { p \times n }$ be defined for each $\bar { \pmb X } ^ { \mathrm { ~ ~ } } \in \mathbb { R } ^ { d \times n }$ as ${ \mathcal { G } } ( X ) ~ =$ $[ \mathcal { G } _ { 1 } ( X _ { : , 1 } ) , \dots , \bar { \mathcal { G } } _ { n } ( X _ { : , n } ) ]$ . Then,
|
| 52 |
+
|
| 53 |
+
$$
|
| 54 |
+
Z \in { \mathcal { E } } _ { q } ( 1 | \mathbb { R } ^ { d \times n } , \| \cdot \| _ { F } ) \ \Rightarrow \ { \mathcal { G } } ( Z ) \in { \mathcal { E } } _ { q } \left( \operatorname* { s u p } _ { i } \| { \mathcal { G } } _ { i } \| _ { l i p } \ | \ \mathbb { R } ^ { p \times n } , \| \cdot \| _ { F } \right) .
|
| 55 |
+
$$
|
| 56 |
+
|
| 57 |
+
Proof. This is a consequence of Proposition 2.3 since the map $\mathcal { G }$ is $\operatorname* { s u p } _ { i } \| \mathcal { G } _ { i } \| _ { l i p }$ -Lipschitz with respect to (w.r.t.) the Frobenius norm. Indeed, for ${ \pmb X } , { \pmb H } \in \mathbb { R } ^ { d \times n } : \| { \mathcal { G } } ( { \pmb X } + { \pmb H } ) - { \mathcal { G } } ( { \pmb X } ) \| _ { F } ^ { 2 } \le$ $\begin{array} { r } { \sum _ { i = 1 } ^ { \hat { n } } \| \mathcal { G } _ { i } \| _ { l i p } ^ { 2 } \cdot \| H _ { : , i } \| ^ { 2 } \leq \operatorname* { s u p } _ { i } \| \mathcal { G } _ { i } \| _ { l i p } ^ { 2 } \cdot \| H \| _ { F } ^ { 2 } . } \end{array}$ .
|
| 58 |
+
|
| 59 |
+
# 3 MAIN RESULTS
|
| 60 |
+
|
| 61 |
+
# 3.1 GAN DATA: AN EXAMPLE OF CONCENTRATED VECTORS
|
| 62 |
+
|
| 63 |
+
Concentrated random vectors are particularly interesting from a practical standpoint for real data modeling. In fact, unlike simple Gaussian vectors, the former do not suffer from the constraint of having independent entries which is quite a restrictive assumption when modeling real data such as images or their non-linear features (e.g., DL representations). The other modeling interest of concentrated vectors lies in their being already present in practice as alternatives to real data. Indeed, adversarial neural networks (GANs) have the ability nowadays to generate random realistic data (for instance realistic images) by applying successive Lipschitz operations to standard Gaussian vectors (Goodfellow et al., 2014).
|
| 64 |
+
|
| 65 |
+
A GAN architecture involves two networks, a generator model which maps random Gaussian noise to new plausible synthetic data and a discriminator model which classifies real data as real (from the dataset) or fake (for the generated data). The discriminator is updated directly through a binary classification problem, whereas the generator is updated through the discriminator. As such, the two models are trained alternatively in an adversarial manner, where the generator seeks to better deceive the discriminator and the former seeks to better identify the fake data (Goodfellow et al., 2014).
|
| 66 |
+
|
| 67 |
+
In particular, once both models are trained (when they reach a Nash equilibrium), DL representations of GAN-data –and GAN-data themselves– are schematically constructed in practice as follows:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\mathrm { R e a l \ D a t a } \approx \mathrm { G A N \ D a t a } = \mathcal { F } _ { N } \circ \cdot \cdot \cdot \circ \mathcal { F } _ { 1 } ( z ) , \mathrm { ~ w h e r e ~ } z \sim \mathcal { N } ( 0 , I _ { d } ) ,
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $d$ stands for the input dimension of the generator model, $N$ the number of layers, and the ${ \mathcal { F } } _ { i }$ ’s either Fully Connected Layers, Convolutional Layers, Pooling Layers, Up-sampling Layers and Activation Functions, Residual Layers or Batch Normalizations. All these operations happen to be Lipschitz applications. Precisely,
|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
Figure 1: Deep learning representations of GAN-data are constructed by applying successive Lipschitz operations to Gaussian vectors, therefore they are concentrated vectors by design, since Gaussian vectors are concentrated and thanks to the Lipschitz stability in Proposition 2.3.
|
| 77 |
+
|
| 78 |
+
• Fully Connected Layers and Convolutional Layers: These are affine operations which can be expressed as
|
| 79 |
+
|
| 80 |
+
${ \mathcal { F } } _ { i } ( { \pmb x } ) = W _ { i } { \pmb x } + { \pmb b } _ { i }$ , for $W _ { i }$ the weight matrix and $b _ { i }$ the bias vector.
|
| 81 |
+
|
| 82 |
+
Here the Lipschitz constant is the operator norm (the largest singular value) of the weight matrix Wi, that is kFiklip = supu6=0 $\begin{array} { r } { \| \mathcal { F } _ { i } \| _ { l i p } = \operatorname* { s u p } _ { u \neq 0 } \frac { \| W _ { i } \pmb { u } \| _ { 2 } } { \| \pmb { u } \| _ { 2 } } } \end{array}$
|
| 83 |
+
|
| 84 |
+
• Pooling Layers and Activation Functions: Most commonly used activation functions and pooling operations are
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
\mathrm { R e L U } ( { \boldsymbol { x } } ) = \operatorname* { m a x } ( 0 , { \boldsymbol { x } } ) , \ \mathrm { M a x P o o l i n g } ( { \boldsymbol { x } } ) = [ \operatorname* { m a x } ( \mathbf { x } _ { S _ { 1 } } ) , \dots , \operatorname* { m a x } ( \mathbf { x } _ { S _ { q } } ) ] ^ { \boldsymbol { \mathsf { T } } } ,
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
where $S _ { i }$ ’s are patches (i.e., subsets of $[ \dim ( { \pmb x } ) ] )$ ). These are at most 1-Lipschitz operations with respect to the Frobenius norm. Specifically, the maximum absolute sub-gradient of the ReLU activation function is 1, thus the ReLU operation has a Lipschitz constant of 1. Similarly, we can show that the Lipschitz constant of MaxPooling layers is also 1.
|
| 91 |
+
|
| 92 |
+
• Residual Connections: Residual layers act the following way
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\mathcal { F } _ { i } ( \pmb { x } ) = \pmb { x } + \mathcal { F } _ { i } ^ { ( 1 ) } \circ \cdots \circ \mathcal { F } _ { i } ^ { ( \ell ) } ( \pmb { x } ) ,
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
where the $\mathcal { F } _ { i } ^ { ( j ) }$ ’s are Fully Connected Layers or Convolutional Layers with Activation Functions, and which are Lipschitz operations. Thus ${ \mathcal { F } } _ { i }$ is a Lipschitz operation with Lipschitz constant bounded by $1 + \textstyle \bar { \prod _ { j = 1 } ^ { \ell } } \| \mathcal { F } _ { i } ^ { ( \bar { j } ) } \| _ { l i p }$ .
|
| 99 |
+
|
| 100 |
+
• Batch Normalization (BN) Layers: They consist in statistically standardizing (Ioffe & Szegedy, 2015) the vectors of a small batch $B = \{ \pmb { x } _ { i } \} _ { i = 1 } ^ { b } \subset \mathbb { R } ^ { d }$ as follows: for each $\pmb { x } _ { k } \in \mathcal Ḋ B Ḍ$
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\mathcal { F } _ { i } ( \pmb { x } _ { k } ) = \mathbf { d i a g } \left( \frac { \mathbf { a } } { \sqrt { \sigma _ { B } ^ { 2 } + \epsilon } } \right) ( \pmb { x } _ { k } - \mu _ { B } \pmb { 1 } _ { d } ) + \mathbf { b }
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where $\begin{array} { r } { \mu _ { B } = \frac { 1 } { d b } \sum _ { k = 1 } ^ { b } \sum _ { i = 1 } ^ { d } [ \pmb { x } _ { k } ] _ { i } } \end{array}$ , $\begin{array} { r } { \sigma _ { B } ^ { 2 } = \frac { 1 } { d b } \sum _ { k = 1 } ^ { b } \sum _ { i = 1 } ^ { d } ( [ { \pmb x } _ { k } ] _ { i } - \mu _ { B } ) ^ { 2 } } \end{array}$ , $a , b \in \mathbb { R } ^ { d }$ are parameters to be learned and $\mathbf { d i a g } ( v )$ transforms a vector $\textbf { { v } }$ to a diagonal matrix with its diagonal entries being those of $\textbf { { v } }$ . Thus BN is a Lipschitz transformation with Lipschitz constant $\begin{array} { r } { \| \mathcal { F } _ { i } \| _ { l i p } = \operatorname* { s u p } _ { i } | \frac { \mathbf { a } _ { i } } { \sqrt { \sigma _ { B } ^ { 2 } + \epsilon } } | } \end{array}$
|
| 107 |
+
|
| 108 |
+
Therefore, as illustrated in Figure 1, since standard Gaussian vectors are concentrated vectors as mentioned in Proposition 2.2 and since the notion of concentrated vectors is stable by Lipschitz transformations thanks to Proposition 2.3, GAN-data (and their DL representations) are concentrated vectors by design given the construction in Equation (4). Moreover, in order to generate data belonging to a specific class, Conditional GANs have been introduced (Mirza & Osindero, 2014); once again data generated by these models are concentrated vectors as a consequence of Corollary 2.4. Indeed, a generator of a Conditional GAN model can be seen as a set of multiple generators where each generates data of a specific class conditionally on the class label (e.g., BigGAN model (Brock et al., 2018)).
|
| 109 |
+
|
| 110 |
+
Yet, in order to ensure that the resulting Lipschitz constant of the combination of the above operations does not scale with the network or data size, so to maintain good concentration behaviors, a careful control of the learned network parameters is needed. This control happens to be already considered in practice in order to ensure the stability of GANs during the learning phase, notably to generate realistic and high-resolution images (Roth et al., 2017; Brock et al., 2018). The control of the Lipschitz constant of representation networks is also needed in practice in order to make them robust against adversarial examples (Szegedy et al., 2013; Gulrajani et al., 2017). This control is particularly ensured through spectral normalization of the affine layers (Brock et al., 2018), such as Fully Connected Layers, Convolutional Layers and Batch Normalization. Indeed, spectral normalization (Miyato et al., 2018) consists in applying the operation $W W / \sigma _ { 1 } ( W )$ to the affine layers at each backward iteration of the back-propagation algorithm, where $\sigma _ { 1 } ( W )$ stands for the largest singular value of the weight matrix $W$ . Brock et al. (2018), have notably observed that, without spectral constraints, a subset of the generator layers grow throughout their GAN training and explode at collapse. They thus suggested the following spectral normalization –which happens to be less restrictive than the standard spectral normalization $W W / \sigma _ { 1 } ( W )$ (Miyato et al., 2018)– to the affine layers:
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
W W - ( \sigma _ { 1 } ( W ) - \sigma _ { * } ) { \pmb u } _ { 1 } ( W ) { \pmb v } _ { 1 } ( W ) ^ { \top }
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 2: Behavior of the largest singular value of a weight matrix in terms of the iterations of a random walk (see proposition 3.1), without spectral normalization in (blue) and with spectral normalization in (red). The (black) lines correspond to the theoretical bound $\sqrt { \sigma _ { * } ^ { 2 } + \eta ^ { 2 } d _ { 1 } d _ { 0 } }$ for different $\sigma _ { * }$ ’s. We took $d _ { 0 } = d _ { 1 } = 1 0 0$ and $\eta = \bar { 1 } / d _ { 0 }$ .
|
| 118 |
+
|
| 119 |
+
where $\mathbf { \pmb { u } } _ { 1 } ( \mathbf { \pmb { W } } )$ and ${ \pmb v } _ { 1 } ( { \pmb W } )$ denote respectively the left and right largest singular vectors of $W$ , and $\sigma _ { * }$ is an hyper-parameter fixed during training.
|
| 120 |
+
|
| 121 |
+
To get an insight about the influence of this operation and to ensure that it controls the Lipschitz constant of the generator, the following proposition provides the dynamics of a random walk in the space of parameters along with the spectral normalization in Equation (5). Indeed, since stochastic gradient descent (SGD) consists in estimating the gradient of the loss function on randomly selected batches of data, it can be assimilated to a random walk in the space of parameters (Antognini & Sohl-Dickstein, 2018).
|
| 122 |
+
|
| 123 |
+
Proposition 3.1 (Lipschitz constant control). Let $\sigma _ { * } > 0$ and $\mathcal { G }$ be a neural network composed of $N$ affine layers, each one of input dimension $d _ { i - 1 }$ and output dimension $d _ { i }$ for $i \in [ N ]$ , with 1-Lipschitz activation functions. Assume that the weights of $\mathcal { G }$ at layer $i + 1$ are initialized as $\mathcal { U } \big ( \big [ - \frac { 1 } { \sqrt { d _ { i } } } , \frac { 1 } { \sqrt { d _ { i } } } \big ] \big )$ , and consider the following dynamics with learning rate $\eta$ :
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\begin{array} { r l } & { W \gets W - \eta E , \ w i t h \ E _ { i , j } \sim \mathcal { N } ( 0 , 1 ) } \\ & { W \gets W - \operatorname* { m a x } ( 0 , \sigma _ { 1 } ( W ) - \sigma _ { * } ) \mathbf { \boldsymbol { u } } _ { 1 } ( W ) \mathbf { \boldsymbol { v } } _ { 1 } ( W ) ^ { \top } . } \end{array}
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
Then, $\forall \varepsilon > 0 ,$ , the Lipschitz constant of $\mathcal { G }$ is bounded at convergence with high probability as:
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
\| \mathcal { G } \| _ { l i p } \leq \prod _ { i = 1 } ^ { N } \left( \varepsilon + \sqrt { \sigma _ { * } ^ { 2 } + \eta ^ { 2 } d _ { i } d _ { i - 1 } } \right) .
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
Proof. The proof is provided in Appendix B.
|
| 136 |
+
|
| 137 |
+
Proposition 3.1 shows that the Lipschitz constant of a neural network is controlled when trained with the spectral normalization in Equation (5). In particular, recalling the notations in Proposition 3.1, in the limit where $d _ { i } \to \infty$ with $\textstyle { \frac { d _ { i } } { d _ { i - 1 } } } \to \gamma _ { i } \in { \overline { { ( 0 , \infty ) } } }$ for all $i \in [ N ]$ and choosing the learning rate $\eta = \mathcal { O } ( d _ { 0 } ^ { - 1 } )$ , the Lipschitz constant of $\mathcal { G }$ is of order $\mathcal { O } ( 1 )$ if it has finitely many layers $N$ and $\sigma _ { * }$ is constant. Therefore, with this spectral normalization, it can be assumed that $\| \mathcal { G } \| _ { l i p } = \mathcal { O } ( 1 )$ when dimensions grow. Figure 2 depicts the behavior of the Lipschitz constant of a linear layer with and without spectral normalization in the setting of Proposition 3.1, which confirms the obtained bound.
|
| 138 |
+
|
| 139 |
+
# 3.2 MIXTURE OF CONCENTRATED VECTORS
|
| 140 |
+
|
| 141 |
+
In this section, we assume data to be a mixture of concentrated random vectors with controlled $\mathcal { O } ( 1 )$ Lipschitz constant (e.g., DL representations of GAN-data as we discussed in the previous section). Precisely, let $\pmb { x } _ { 1 } , \ldots , \pmb { x } _ { n }$ be a set of mutually independent random vectors in $\mathbb { R } ^ { p }$ . We suppose that these vectors are distributed as one of $k$ classes of distribution laws $\mu _ { 1 } , \ldots , \mu _ { k }$ with distinct means $\{ m _ { \ell } \} _ { \ell = 1 } ^ { k }$ and “covariances” $\{ C _ { \ell } \} _ { \ell = 1 } ^ { k }$ defined receptively as
|
| 142 |
+
|
| 143 |
+
$$
|
| 144 |
+
m _ { \ell } = \mathbb { E } _ { \pmb { x } _ { i } \sim \mu _ { \ell } } [ \pmb { x } _ { i } ] , \pmb { C } _ { \ell } = \mathbb { E } _ { \pmb { x } _ { i } \sim \mu _ { \ell } } [ \pmb { x } _ { i } \pmb { x } _ { i } ^ { \top } ] .
|
| 145 |
+
$$
|
| 146 |
+
|
| 147 |
+
For some $q > 0$ , we consider a $q$ -exponential concentration property on the laws $\mu _ { \ell }$ , in the sense that for any family of independent vectors $y _ { 1 } , \ldots , y _ { s }$ sampled from $\mu _ { \ell }$ , $[ \pmb { y } _ { 1 } , \dots , \pmb { y } _ { s } ] \in \mathcal { E } _ { q } ( 1 | \mathbb { R } ^ { p \times s } , \rVert \ \cdot$ $\left\| { } _ { F } \right)$ . Without loss of generality, we arrange the $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ ’s in a data matrix $\pmb { X } = [ \pmb { x } _ { 1 } , \dots , \pmb { x } _ { n } ]$ such that, for each $\ell \in [ k ]$ , $\begin{array} { r } { \pmb { x } _ { 1 + \sum _ { j = 1 } ^ { \ell - 1 } n _ { j } } , \dotsc , \pmb { x } _ { \sum _ { j = 1 } ^ { \ell } n _ { j } } \sim \mu _ { \ell } } \end{array}$ ∼ µ\`, where n\` stands for the number of xi’s sampled from $\mu _ { \ell }$ . In particular, we have the concentration of $\boldsymbol { X }$ as
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
X \in \mathcal { E } _ { q } ( 1 | \mathbb { R } ^ { p \times n } , \| \cdot \| _ { F } ) .
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
Such a data matrix $\boldsymbol { X }$ can be constructed through Lipschitz-ally transformed Gaussian vectors $( q =$ 2), with controlled Lipschitz constant, thanks to Corollary 2.4. In particular, DL representations of GAN-data are constructed as such, as shown in Section 3.1. We further introduce the following notations that will be used subsequently.
|
| 154 |
+
|
| 155 |
+
$M = [ m _ { 1 } , \dots , m _ { k } ] \in \mathbb { R } ^ { p \times k } , J = [ j _ { 1 } , \dots , j _ { k } ] \in \mathbb { R } ^ { n \times k }$ and $\pmb { Z } = [ z _ { 1 } , \dots , z _ { n } ] \in \mathbb { R } ^ { p \times n }$ , where $j _ { \ell } \in \mathbb { R } ^ { n }$ stands for the canonical vector selecting the $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ ’s of distribution $\mu _ { \ell }$ , defined by $( j _ { \ell } ) _ { i } = 1 _ { x _ { i } \sim \mu _ { \ell } }$ , and the $z _ { i }$ ’s are the centered versions of the $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ ’s, i.e. $z _ { i } = { \pmb x } _ { i } - m _ { \ell }$ for $\mathbf { \mathscr { x } } _ { i } \sim \mu _ { \ell }$ .
|
| 156 |
+
|
| 157 |
+
# 3.3 GRAM MATRICES OF CONCENTRATED VECTORS
|
| 158 |
+
|
| 159 |
+
Now we study the behavior of the Gram matrix $\begin{array} { r } { G = { \frac { 1 } { p } } X ^ { \intercal } X } \end{array}$ in the large $n , p$ limit and under the model of the previous section. Indeed, $G$ appears as a central component in many classification, regression and clustering methods. Precisely, a finer description of the behavior of $G$ provides access to the internal functioning and performance evaluation of a wide range of machine learning methods such as Least Squares SVMs (AK et al., 2002), Semi-supervised Learning (Chapelle et al., 2009) and Spectral Clustering $\mathrm { N g }$ et al., 2002). Indeed, the performance evaluation of these methods has already been studied under GMM models in (Liao & Couillet, 2017; Mai & Couillet, 2017; Couillet & Benaych-Georges, 2016) through RMT. On the other hand, analyzing the spectral behavior of $G$ for DL representations quantifies their quality –through its principal subspace (Montavon et al., 2011)– as we have discussed in the introduction. In particular, the Gram matrix decomposes as
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
G = \frac { 1 } { p } J M ^ { \intercal } M J ^ { \intercal } + \frac { 1 } { p } Z ^ { \intercal } Z + \frac { 1 } { p } ( J M ^ { \intercal } Z + Z ^ { \intercal } M J ^ { \intercal } ) .
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
Intuitively $G$ decomposes as a low-rank informative matrix containing the class canonical vectors through $\textbf { { J } }$ and a noise term represented by the other matrices and essentially $Z T Z$ . Given the form of this decomposition, RMT predicts –through an analysis of the spectrum of $G$ and under a GMM model (Benaych-Georges & Couillet, 2016)– the existence of a threshold $\xi$ function of the ratio $p / n$ and the data statistics for which the dominant eigenvectors of $G$ contain information about the classes only when $\| M ^ { \prime } M \| \geq \xi$ asymptotically (i.e., only when the means of the different classes are sufficiently distinct).
|
| 166 |
+
|
| 167 |
+
In order to characterize the spectral behavior (i.e., eigenvalues and leading eigenvectors) of $G$ under the concentration assumption in Equation (9) on $\boldsymbol { X }$ , we will be interested in determining the spectral distribution $\begin{array} { r } { L = \frac { 1 } { n } \sum _ { i = 1 } ^ { n ^ { \star } } \delta _ { \lambda _ { i } } } \end{array}$ of $G$ , with $\lambda _ { 1 } , \ldots , \lambda _ { n }$ the eigenvalues of $G$ , where $\delta _ { x }$ stands for the Dirac measure at point $x$ . Essentially, to determine the limiting eigenvalue distribution as $p , n \infty$ and $p / n \to c \in ( 0 , \infty )$ , a conventional approach in RMT consists in determining an estimate of the Stieltjes transform (Silverstein & Choi, 1995) $m _ { L }$ of $L$ , which is defined for some $z \in \mathbb { C } \setminus \operatorname { S u p p } ( L )$
|
| 168 |
+
|
| 169 |
+
$$
|
| 170 |
+
m _ { L } ( z ) = \int _ { \lambda } \frac { d L ( \lambda ) } { \lambda - z } = \frac { 1 } { n } \mathrm { t r } \left( ( G - z I _ { n } ) ^ { - 1 } \right) .
|
| 171 |
+
$$
|
| 172 |
+
|
| 173 |
+
Hence, quantifying the behavior of the resolvent of $G$ defined as $\pmb { R } ( z ) = ( \pmb { G } + z \pmb { I } _ { n } ) ^ { - 1 }$ determines the limiting measure of $L$ through $m _ { L } ( z )$ . Furthermore, since $R ( z )$ and $G$ share the same eigenvectors with associated eigenvalues $\frac { 1 } { \lambda _ { i } - z }$ , the projector matrix corresponding to the top $m$ eigenvectors $U = [ \pmb { u } _ { 1 } , \dots , \pmb { u } _ { m } ]$ of $G$ can be calculated through a Cauchy integral $\begin{array} { r } { U U ^ { \intercal } = \frac { 1 } { 2 \pi i } \oint _ { \gamma } R ( - z ) d z } \end{array}$ where $\gamma$ is an oriented complex contour surrounding the top $m$ eigenvalues of $G$ .
|
| 174 |
+
|
| 175 |
+
To study the behavior of $\scriptstyle R ( z )$ , we look for a so-called deterministic equivalent (Hachem et al., 2007) $\tilde { R } ( z )$ for $\scriptstyle R ( z )$ , which is a deterministic matrix that satisfies for all $\ b { A } \in \mathbb { R } ^ { n \times n }$ and all ${ \mathbf { } } u , v \in { \mathbf { \Gamma } }$ $\mathbb { R } ^ { n }$ of respectively bounded spectral and Eucildean norms, ${ \textstyle { \frac { 1 } { n } } } \operatorname { t r } ( A R ( z ) ) - { \textstyle { \frac { 1 } { n } } } \operatorname { t r } ( A { \tilde { R } } ( z ) ) \to 0$ and ${ \pmb u } ^ { \intercal } ( { \pmb R } ( z ) - \tilde { { \pmb R } } ( z ) ) { \pmb v } 0$ almost surely as $n \infty$ . In the following, we present our main result which gives such a deterministic equivalent under the concentration assumption on $\boldsymbol { X }$ in Equation (9) and under the following assumptions.
|
| 176 |
+
|
| 177 |
+
Assumption 3.2. As $p \infty$ ,
|
| 178 |
+
|
| 179 |
+
1. $p / n \to c \in ( 0 , \infty ) .$ , 2. The number of classes $k$ is bounded, 3. $\| \boldsymbol { m } _ { \ell } \| = \mathcal { O } ( \sqrt { p } )$ .
|
| 180 |
+
|
| 181 |
+
Theorem 3.3 (Deterministic Equivalent for $\begin{array} { r } { \pmb { R } ( z ) . } \end{array}$ ). Under the model described in Section 3.2 and Assumptions 3.2, we have $\pmb { R } ( z ) \in \mathcal { E } _ { q } ( p ^ { - 1 / 2 } | \mathbb { R } ^ { n \times n } , \| \cdot \| _ { F } )$ . Furthermore,
|
| 182 |
+
|
| 183 |
+
$$
|
| 184 |
+
\left. \mathbb { E } { \mathbf { R } } ( z ) - \tilde { \mathbf { R } } ( z ) \right. = \mathcal { O } \left( \sqrt { \frac { \log ( p ) } { p } } \right) , \tilde { \mathbf { R } } ( z ) = \frac { 1 } { z } { \mathbf { d i a g } } \left\{ \frac { I _ { n _ { \ell } } } { 1 + \delta _ { \ell } ^ { * } ( z ) } \right\} _ { \ell = 1 } ^ { k } + \frac { 1 } { p z } J \Omega _ { z } J ^ { \intercal } ( \mathbf { R } )
|
| 185 |
+
$$
|
| 186 |
+
|
| 187 |
+
$$
|
| 188 |
+
\begin{array} { r } { \Omega _ { z } = M ^ { \top } \tilde { Q } ( z ) M \odot \mathbf { d i a g } \left\{ \frac { \delta _ { \ell } ^ { * } ( z ) - 1 } { \delta _ { \ell } ^ { * } ( z ) + 1 } \right\} _ { \ell = 1 } ^ { k } a n d \tilde { Q } ( z ) = \Big ( \frac { 1 } { c k } \sum _ { \ell = 1 } ^ { k } \frac { C _ { \ell } } { 1 + \delta _ { \ell } ^ { * } ( z ) } + z I _ { p } \Big ) ^ { - 1 } , } \end{array}
|
| 189 |
+
$$
|
| 190 |
+
|
| 191 |
+
where $\delta ^ { * } ( z ) = [ \delta _ { 1 } ^ { * } ( z ) , \ldots , \delta _ { k } ^ { * } ( z ) ] ^ { \bar { \boldsymbol { \mathsf { T } } } }$ is the unique fixed point of the system of equations
|
| 192 |
+
|
| 193 |
+
$$
|
| 194 |
+
\delta _ { \ell } ( z ) = \frac { 1 } { p } \operatorname { t r } \left( C _ { \ell } \left( \frac { 1 } { c k } \sum _ { j = 1 } ^ { k } \frac { C _ { j } } { 1 + \delta _ { j } ( z ) } + z I _ { p } \right) ^ { - 1 } \right) f o r e a c h \ell \in [ k ] .
|
| 195 |
+
$$
|
| 196 |
+
|
| 197 |
+
Sketch of proof. The first step of the proof is to show the concentration of $\scriptstyle R ( z )$ . This comes from the fact that the application $\boldsymbol { X } \mapsto \boldsymbol { R } ( \boldsymbol { z } )$ is $2 z ^ { - 3 / 2 } p ^ { - 1 / 2 }$ -Lipschitz w.r.t. the Frobenius norm, thus we have by Proposition 2.3 that $\pmb { R } ( z ) \in \mathcal { E } _ { q } ( p ^ { - 1 / 2 } | \mathbb { R } ^ { n \times n } , \| \cdot \| _ { F } )$ . The second step consists in estimating $\mathbb { E } R ( z )$ through a deterministic matrix $\tilde { R } ( z )$ . Indeed, $\scriptstyle R ( z )$ can be expressed as a function of $Q ( z ) \stackrel { - } { = } ( \dot { X } \dot { X } { ^ \intercal } p \stackrel { - } { + } z I _ { p } ) ^ { - 1 }$ as $R ( z ) = z ^ { - 1 } ( I _ { n } - X ^ { \intercal } Q ( z ) X / p )$ , and exploiting the result of (Louart & Couillet, 2019) which shows that $\mathbb { E } Q ( z )$ can be estimated through $\tilde { Q } ( z )$ , we obtain the estimator $\tilde { R } ( z )$ for $\mathbb { E } R ( z )$ . A more detailed proof is provided in Section A.3 of the Appendix.
|
| 198 |
+
|
| 199 |
+
This result allows specifically to (i) describe the limiting eigenvalues distribution of $G$ , (ii) determine the spectral detectability threshold mentioned above, (iii) evaluate the asymptotic “content” of the leading eigenvectors of $G$ and, much more fundamentally, (iv) infer the asymptotic performances of machine learning algorithms that are based on simple functionals of $G$ (e.g., LS-SVM, spectral clustering etc.). Looking carefully at Theorem 3.3 we see that the spectral behavior of the Gram matrix $G$ computed on concentrated vectors only depends on the first and second order statistics of the laws $\mu _ { \ell }$ (their means $\mathbf { \nabla } m _ { \ell }$ and “covariances” $C _ { \ell }$ ). This suggests the surprising result that $G$ has the same behavior as when the data follow a GMM model with the same means and covariances. The asymptotic spectral behavior of $G$ is therefore universal with respect to the data distribution laws which satisfy the aforementioned concentration properties (for instance DL representations of GAN-data). We illustrate this universality result in the next section by considering data as CNN representations of GAN generated images.
|
| 200 |
+
|
| 201 |
+

|
| 202 |
+
Figure 3: (Top) GAN generated images using the BigGAN model Brock et al. (2018). (Bottom) Real images selected from the Imagenet dataset Deng et al. (2009). We considered $n = 1 5 0 0$ images from $k = 3$ classes which are Mushroom, Pizza and Hamburger.
|
| 203 |
+
|
| 204 |
+

|
| 205 |
+
Figure 4: (Top) Spectrum and leading eigenspace of the Gram matrix for CNN representations of GAN generated images using the BigGAN model Brock et al. (2018). (Bottom) Spectrum and leading eigenspace of the Gram matrix for CNN representations of real images selected from the Imagenet dataset Deng et al. (2009). Columns correspond to the three representation networks (Resnet50, VGG16 and Densenet201).
|
| 206 |
+
|
| 207 |
+
# 4 APPLICATION TO CNN REPRESENTATIONS OF GAN-GENERATED IMAGES
|
| 208 |
+
|
| 209 |
+
In this section, we consider $n \ = \ 1 5 0 0$ data $\pmb { x } _ { 1 } , \dotsc , \pmb { x } _ { n } \in \mathbb { R } ^ { p }$ as CNN representations –across popular CNN architectures of different sizes $p -$ of GAN-generated images using the generator of the Big-GAN model (Brock et al., 2018). We further use real images from the Imagenet dataset (Deng et al., 2009) for comparison. In particular, we empirically compare the spectrum of the Gram matrix of this data with the Gram matrix of a GMM model with the same means and covariances. We also consider the leading 2-dimensional eigenspace of the Gram matrix which contains clustering information as detailed in the previous section. Figure 3 depicts some images generated using the Big-GAN model (Top) and the corresponding real class images from the Imagenet dataset (Bottom). The Big-GAN model is visually able to generate highly realistic images which are by construction concentrated vectors, as discussed in Section 3.1.
|
| 210 |
+
|
| 211 |
+
Figure 4 depicts the spectrum and leading 2D eigenspace of the Gram matrix computed on CNN representations of GAN generated and real images (in gray), and the corresponding GMM model with same first and second order statistics (in green). The Gram matrix is seen to follow the same spectral behavior for GAN-data as for the GMM model which is a natural consequence of the universality result of Theorem 3.3 with respect to the data distribution. Besides, and perhaps no longer surprisingly, we further observe that the spectral properties of $G$ for real data (here CNN representations of real images) are conclusively matched by their Gaussian counterpart. This both theoretically and empirically confirms that the proposed random matrix framework is fully compliant with the theoretical analysis of real machine learning datasets.
|
| 212 |
+
|
| 213 |
+
# 5 CONCLUSION
|
| 214 |
+
|
| 215 |
+
Leveraging on random matrix theory (RMT) and the concentration of measure phenomenon, we have shown through this paper that DL representations of GAN-data behave as Gaussian mixtures for linear classifiers, a fundamental universal property which is only valid in high-dimension of data. To the best of our knowledge, this result constitutes a new approach towards the theoretical understanding of complex objects such as DL representations, as well as the understanding of the behavior of more elaborate machine learning algorithms for complex data structures. In addition, the article explicitly demonstrated our ability, through RMT, to anticipate the behavior of a wide range of standard classifiers for data as complex as DL representations of the realistic and surprising images generated by GANs. This opens the way to a more systematic analysis and improvement of machine learning algorithms on real datasets by means of large dimensional statistics.
|
| 216 |
+
|
| 217 |
+
# REFERENCES
|
| 218 |
+
|
| 219 |
+
Suykens Johan AK et al. Least squares support vector machines. World Scientific, 2002.
|
| 220 |
+
|
| 221 |
+
Joseph Antognini and Jascha Sohl-Dickstein. Pca of high dimensional random walks with comparison to neural network training. In Advances in Neural Information Processing Systems, pp. 10307–10316, 2018.
|
| 222 |
+
|
| 223 |
+
Antreas Antoniou, Amos Storkey, and Harrison Edwards. Data augmentation generative adversarial networks. arXiv preprint arXiv:1711.04340, 2017.
|
| 224 |
+
|
| 225 |
+
Florent Benaych-Georges and Romain Couillet. Spectral analysis of the gram matrix of mixture models. ESAIM: Probability and Statistics, 20:217–237, 2016.
|
| 226 |
+
|
| 227 |
+
Y. Bengio, A. Courville, and P. Vincent. Representation learning: A review and new perspectives. IEEE Transactions on Pattern Analysis and Machine Intelligence, 35(8):1798–1828, Aug 2013. ISSN 0162-8828. doi: 10.1109/TPAMI.2013.50.
|
| 228 |
+
|
| 229 |
+
Yoshua Bengio et al. Learning deep architectures for ai. Foundations and trends $\textsuperscript { \textregistered }$ in Machine Learning, 2(1):1–127, 2009.
|
| 230 |
+
|
| 231 |
+
Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale gan training for high fidelity natural image synthesis. arXiv preprint arXiv:1809.11096, 2018.
|
| 232 |
+
|
| 233 |
+
Olivier Chapelle, Bernhard Scholkopf, and Alexander Zien. Semi-supervised learning (chapelle, o. et al., eds.; 2006)[book reviews]. IEEE Transactions on Neural Networks, 20(3):542–542, 2009.
|
| 234 |
+
|
| 235 |
+
Romain Couillet and Florent Benaych-Georges. Kernel spectral clustering of large dimensional data. Electronic Journal of Statistics, 10(1):1393–1454, 2016.
|
| 236 |
+
|
| 237 |
+
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.
|
| 238 |
+
|
| 239 |
+
Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. In NIPS, pp. 2672–2680, 2014.
|
| 240 |
+
|
| 241 |
+
Ian Goodfellow, Yoshua Bengio, Aaron Courville, and Yoshua Bengio. Deep learning, volume 1. MIT Press, 2016.
|
| 242 |
+
|
| 243 |
+
Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of wasserstein gans. In Advances in Neural Information Processing Systems 30, pp. 5767–5777. 2017.
|
| 244 |
+
|
| 245 |
+
Walid Hachem, Philippe Loubaton, Jamal Najim, et al. Deterministic equivalents for certain functionals of large random matrices. The Annals of Applied Probability, 17(3):875–930, 2007.
|
| 246 |
+
|
| 247 |
+
Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. arXiv preprint arXiv:1502.03167, 2015.
|
| 248 |
+
|
| 249 |
+
Michel Ledoux. The concentration of measure phenomenon. Number 89. American Mathematical Soc., 2005.
|
| 250 |
+
|
| 251 |
+
Zhenyu Liao and Romain Couillet. Random matrices meet machine learning: A large dimensional analysis of ls-svm. In ICASSP, pp. 2397–2401. IEEE, 2017.
|
| 252 |
+
|
| 253 |
+
Cosme Louart and Romain Couillet. Concentration of measure and large random matrices with an application to sample covariance matrices. submitted, 2019.
|
| 254 |
+
|
| 255 |
+
Xiaoyi Mai and Romain Couillet. A random matrix analysis and improvement of semi-supervised learning for large dimensional data. arXiv preprint arXiv:1711.03404, 2017.
|
| 256 |
+
|
| 257 |
+
Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. arXiv preprint arXiv:1411.1784, 2014.
|
| 258 |
+
|
| 259 |
+
Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. arXiv preprint arXiv:1802.05957, 2018.
|
| 260 |
+
|
| 261 |
+
GrA˜ Sgoire Montavon, Mikio L Braun, and Klaus-Robert M ˇ Aller. Kernel analysis of deep networks. ˜ Journal of Machine Learning Research, 12(Sep):2563–2581, 2011.
|
| 262 |
+
|
| 263 |
+
Andrew Y Ng, Michael I Jordan, and Yair Weiss. On spectral clustering: Analysis and an algorithm. In Advances in neural information processing systems, pp. 849–856, 2002.
|
| 264 |
+
|
| 265 |
+
Kevin Roth, Aurelien Lucchi, Sebastian Nowozin, and Thomas Hofmann. Stabilizing training of generative adversarial networks through regularization. In Advances in Neural Information Processing Systems 30, pp. 2018–2028. 2017.
|
| 266 |
+
|
| 267 |
+
David E Rumelhart, Geoffrey E Hinton, Ronald J Williams, et al. Learning representations by back-propagating errors. Cognitive modeling, 5(3):1, 1988.
|
| 268 |
+
|
| 269 |
+
Jack W Silverstein and Sang-Il Choi. Analysis of the limiting spectral distribution of large dimensional random matrices. Journal of Multivariate Analysis, 54(2):295–309, 1995.
|
| 270 |
+
|
| 271 |
+
Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. arXiv preprint arXiv:1312.6199, 2013.
|
| 272 |
+
|
| 273 |
+
Chih-Kuan Yeh, Joon Kim, Ian En-Hsu Yen, and Pradeep K Ravikumar. Representer point selection for explaining deep neural networks. In Advances in Neural Information Processing Systems, pp. 9291–9301, 2018.
|
| 274 |
+
|
| 275 |
+
# A PROOF OF THEOREM 3.3
|
| 276 |
+
|
| 277 |
+
# A.1 SETTING OF THE PROOF
|
| 278 |
+
|
| 279 |
+
For simplicity, we will only suppose the case $k = 1$ and we consider the following notations that will be used subsequently.
|
| 280 |
+
|
| 281 |
+
$$
|
| 282 |
+
\bar { x } = \mathbb { E } { \mathbf { x } } _ { i } , \ C = \mathbb { E } [ { \mathbf { x } } _ { i } { \mathbf { x } } _ { i } ^ { \top } ] , \ X _ { 0 } = X - \bar { x } { \mathbf { 1 } } _ { n } ^ { \top } , \ C _ { 0 } = \mathbb { E } [ X _ { 0 } X _ { 0 } ^ { \top } / n ] .
|
| 283 |
+
$$
|
| 284 |
+
|
| 285 |
+
Let
|
| 286 |
+
|
| 287 |
+
$$
|
| 288 |
+
\pmb { X } _ { - i } = ( \pmb { x } _ { 1 } , \dots , \pmb { x } _ { i - 1 } , 0 , \pmb { x } _ { i } , \dots , \pmb { x } _ { n } )
|
| 289 |
+
$$
|
| 290 |
+
|
| 291 |
+
the matrix $X$ with a vector of zeros at its $i$ th column.
|
| 292 |
+
|
| 293 |
+
Denote the resolvents
|
| 294 |
+
|
| 295 |
+
$$
|
| 296 |
+
R = \left( { \frac { X ^ { \mathsf { T } } X } { p } } + z I _ { n } \right) ^ { - 1 } , \ Q = \left( { \frac { X X ^ { \mathsf { T } } } { p } } + z I _ { p } \right) ^ { - 1 } , \ Q _ { - i } = \left( { \frac { X X ^ { \mathsf { T } } } { p } } - { \frac { x _ { i } x _ { i } ^ { \mathsf { T } } } { p } } + z I _ { p } \right) ^ { - 1 }
|
| 297 |
+
$$
|
| 298 |
+
|
| 299 |
+
And let
|
| 300 |
+
|
| 301 |
+
$$
|
| 302 |
+
\tilde { \pmb { Q } } = \left( \frac { 1 } { c } \frac { \pmb { C } } { 1 + \delta } + z \pmb { I _ { p } } \right) ^ { - 1 } ,
|
| 303 |
+
$$
|
| 304 |
+
|
| 305 |
+
where $\delta$ is the solution to the fixed point equation
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
\delta = \frac { 1 } { p } \operatorname { t r } \left( C \left( \frac { 1 } { c } \frac { C } { 1 + \delta } + z I _ { p } \right) ^ { - 1 } \right) .
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
# A.2 BASIC TOOLS
|
| 312 |
+
|
| 313 |
+
Lemma A.1 ((Ledoux, 2005)). Let $z \in \mathcal { E } _ { q } ( 1 | \mathbb { R } ^ { p } , \| \cdot \| )$ and $M \in \mathcal { E } _ { q } ( 1 | \mathbb { R } ^ { p \times n } , \| \cdot \| _ { F } )$ . Then, for some numerical constant $C > 0$
|
| 314 |
+
|
| 315 |
+
$$
|
| 316 |
+
\begin{array} { r } { \bullet \mathbb { E } \left\| z \right\| \leq \left\| \mathbb { E } z \right\| + C \sqrt { p } , \ \mathbb { E } \left\| z \right\| _ { \infty } \leq \left\| \mathbb { E } z \right\| _ { \infty } + C \sqrt { \log p } . } \end{array}
|
| 317 |
+
$$
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
\bullet \mathbb { E } \left\| M \right\| \leq \left\| \mathbb { E } M \right\| + C \sqrt { p + n } , \ \mathbb { E } \left\| M \right\| _ { F } \leq \left\| \mathbb { E } M \right\| _ { F } + C \sqrt { p n } .
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
Lemma A.2. Denote $Q _ { \bar { x } } = ( \bar { x } \bar { x } ^ { \top } + z I _ { p } ) ^ { - 1 }$ , we have:
|
| 324 |
+
|
| 325 |
+
$$
|
| 326 |
+
Q _ { \bar { x } } \bar { x } = \frac { \bar { x } } { \| \bar { x } \| ^ { 2 } + z } \ a n d \ \| \tilde { Q } \bar { x } \| , \ \bar { x } \tilde { Q } \bar { x } = \mathcal { O } ( 1 ) .
|
| 327 |
+
$$
|
| 328 |
+
|
| 329 |
+
Moreover, $i f \left\| \bar { \pmb x } \right\| \ge \sqrt { p } , \| \tilde { \pmb Q } \bar { \pmb x } \| = \mathcal { O } ( p ^ { - 1 / 2 } ) .$
|
| 330 |
+
|
| 331 |
+
Proof. Since $z Q _ { \bar { x } } = I _ { p } - Q _ { \bar { x } } \bar { x } \bar { x } ^ { \intercal }$ :
|
| 332 |
+
|
| 333 |
+
$$
|
| 334 |
+
z Q _ { \bar { x } } \bar { x } = \bar { x } - \| \bar { x } \| ^ { 2 } Q _ { \bar { x } } \bar { x } ,
|
| 335 |
+
$$
|
| 336 |
+
|
| 337 |
+
and we recover the first identity of the Lemma.
|
| 338 |
+
|
| 339 |
+
And since the matrix $C _ { 0 }$ is nonnegative symmetric, we have :
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
\tilde { Q } \bar { \mathbf { \Xi } } \bar { \mathbf { \Xi } } = \left( \frac { 1 } { c } \frac { C _ { 0 } + \bar { \mathbf { x } } \bar { \mathbf { x } } ^ { \intercal } } { 1 + \delta } + z I _ { p } \right) ^ { - 1 } \bar { \mathbf { \Xi } } \bar { \mathbf { \Xi } } \bar { \mathbf { x } } \leq \frac { c ( 1 + \delta ) \bar { \mathbf { \Xi } } \bar { \mathbf { x } } } { \| \bar { \mathbf { x } } \| ^ { 2 } + z c ( 1 + \delta ) } .
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
Therefore, $\begin{array} { r } { \bar { \pmb { x } } \tilde { \pmb { Q } } \bar { \pmb { x } } = \frac { c ( 1 + \delta ) \| \bar { \pmb { x } } \| ^ { 2 } } { \| \bar { \pmb { x } } \| ^ { 2 } + z c ( 1 + \delta ) } = \mathcal { O } ( 1 ) } \end{array}$ and:
|
| 346 |
+
|
| 347 |
+
$$
|
| 348 |
+
\| \tilde { \pmb { Q } } \bar { \pmb { x } } \| = \frac { c ( 1 + \delta ) \| \bar { \pmb { x } } \| } { \| \bar { \pmb { x } } \| ^ { 2 } + z c ( 1 + \delta ) } \leq \left\{ \begin{array} { l l } { \displaystyle \frac { \| \bar { \pmb { x } } \| } { z } = \mathcal { O } ( 1 ) \mathrm { i f } \| \bar { \pmb { x } } \| \leq 1 , } \\ { \displaystyle \frac { c ( 1 + \delta ) } { \| \bar { \pmb { x } } \| } = \mathcal { O } ( 1 ) \mathrm { i f } \| \bar { \pmb { x } } \| \geq 1 . } \end{array} \right.
|
| 349 |
+
$$
|
| 350 |
+
|
| 351 |
+
Proposition A.3. $\begin{array} { r } { \bar { x } ^ { \intercal } \mathbb { E } [ Q ] \bar { x } = \bar { x } ^ { \intercal } \tilde { Q } \bar { x } + \mathcal { O } \left( \sqrt { \frac { \log p } { p } } \right) } \end{array}$
|
| 352 |
+
|
| 353 |
+
Proof. Let us bound:
|
| 354 |
+
|
| 355 |
+
$$
|
| 356 |
+
\left| { \bar { x } } ^ { \mathsf { T } } Q { \bar { x } } - { \bar { x } } ^ { \mathsf { T } } Q { \bar { x } } \right| \leq \frac { c ^ { - 1 } } { 1 + \delta } \left| \mathbb { E } \left[ { \bar { x } } Q x _ { i } x _ { i } ^ { \mathsf { T } } Q { \bar { x } } \left( \frac { 1 } { p } x _ { i } ^ { \mathsf { T } } Q _ { - i } x _ { i } - \delta \right) \right] + \frac { 1 } { p } \mathbb { E } \left[ { \bar { x } } ^ { \mathsf { T } } Q _ { - i } x _ { i } x _ { i } ^ { \mathsf { T } } Q C { \bar { Q } } { \bar { x } } \right] \right|
|
| 357 |
+
$$
|
| 358 |
+
|
| 359 |
+
Now let us consider a supplementary random vector ${ \pmb x } _ { n + 1 }$ following the same low as the $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ ’s and independent of $\boldsymbol { X }$ . We divide the set $\mathbb { I } = [ n + 1 ]$ into two sets $\mathbb { I } _ { \frac { 1 } { 2 } }$ and $\mathbb { I } _ { \frac { 2 } { 2 } }$ of same cardinality $\textstyle \left( { \frac { n + 1 } { 2 } } \right) \leq$ $\# \mathbb { I } _ { \frac { 1 } { 2 } } , \# \mathbb { I } _ { \frac { 2 } { 2 } } \leq \lceil \frac { n + 1 } { 2 } \rceil )$ , we note ${ \pmb X } _ { \frac { 1 } { 2 } } = ( { \pmb x } _ { i } | i \in \mathbb { I } _ { \frac { 1 } { 2 } } )$ , ${ X _ { \frac { 2 } { 2 } } } = ( \mathbf { x } _ { i } | i \in \mathbb { I } _ { \frac { 2 } { 2 } } )$ and we introduce the diagonal matrices $\begin{array} { r } { \pmb { \Delta } = \pmb { \mathrm { d i a g } } \left( \frac { 1 } { p } \pmb { x } _ { i } ^ { \top } \pmb { Q } _ { - i } \pmb { x } _ { i } - \delta \vert i \in \mathbb { I } _ { \frac { 1 } { 2 } } \right) } \end{array}$ , $\begin{array} { r } { D = \mathrm { d i a g } \left( 1 + \frac { 1 } { p + 1 } \pmb { x } _ { i } ^ { \intercal } \pmb { Q x } _ { i } \ : | \ : i \in \mathbb { I } _ { \frac { 2 } { 2 } } \right) } \end{array}$ .
|
| 360 |
+
|
| 361 |
+
We have the bound:
|
| 362 |
+
|
| 363 |
+
$$
|
| 364 |
+
\begin{array} { r l } & { \mathbb { E } [ \bar { x } Q x _ { i } x _ { i } ^ { \top } \bar { Q } \bar { \mathbf { z } } ^ { * } ( \frac { 1 } { p } x _ { i } ^ { \top } Q _ { - i } x _ { i } - \delta ) ] ] } \\ & { \qquad = | \mathbb { E } [ ( 1 + \frac { 1 } { p } x _ { n + 1 } ^ { \top } Q x _ { n + 1 } ) x _ { n + 1 } Q _ { + ( n + 1 ) } x _ { i } x _ { i } ^ { \top } \bar { Q } \bar { x } ( \frac { 1 } { p } x _ { i } ^ { \top } Q _ { - i } x _ { i } - \delta ) ] | } \\ & { \qquad = \frac { 1 } { p ^ { 2 } } | \mathbb { E } [ \mathbb { 1 } ^ { \top } D X _ { \frac { \tau } { 2 } } ^ { \top } Q _ { + ( n + 1 ) } X _ { \frac { 1 } { 2 } } \Delta X _ { \frac { 1 } { 2 } } ^ { \top } \bar { Q } \bar { x } ] | } \\ & { \qquad \leq \sqrt { | \mathbb { E } [ \frac { 1 } { p ^ { 3 } } \mathbb { 1 } ^ { \top } D X _ { \frac { \tau } { 2 } } ^ { \top } Q _ { + ( n + 1 ) } X _ { \frac { 1 } { 2 } } \Delta X _ { \frac { 1 } { 2 } } ^ { 2 } Z _ { + ( n + 1 ) } X _ { \frac { 2 } { 2 } } ^ { \top } D ] \mathbb { E } [ \frac { 1 } { p } x ^ { \top } \bar { Q } X _ { \frac { 1 } { 2 } } X _ { \frac { 1 } { 2 } } ^ { \top } \bar { Q } \bar { x } ] | } } \\ & { \qquad \leq \sqrt { | \mathbb { E } [ \| \frac { 1 } { p } X _ { \frac { \tau } { 2 } } ^ { \top } Q _ { + ( n + 1 ) } X _ { \frac { 1 } { 2 } } \| ^ { 2 } \| D \| ^ { 2 } \| \Delta \| ^ { 2 } ] \mathbb { E } [ \bar { x } \bar { Q } C \bar { Q } \bar { x } ] | } \leq \mathcal { O } ( \sqrt { \frac { \log p } { p } } ) , } \end{array}
|
| 365 |
+
$$
|
| 366 |
+
|
| 367 |
+
thanks to Lemma A.1 and Lemma A.2 (the spectral norm of $\Delta$ and $D$ is just an infinity norm if we see them as random vectors of $\mathbb { R } ^ { n }$ ). We can bound $\begin{array} { r } { \frac { 1 } { p } \left| \mathbb { E } \left[ \bar { \pmb { x } } ^ { \intercal } \pmb { Q } _ { - i } \pmb { x } _ { i } \pmb { x } _ { i } ^ { \intercal } \pmb { Q } \pmb { C } \tilde { \pmb { Q } } \bar { \pmb { x } } \right] \right| } \end{array}$ the same way to obtain the result of the proposition. □
|
| 368 |
+
|
| 369 |
+
Proposition A.4. $\begin{array} { r } { \| \mathbb { E } [ { \pmb x } _ { i } ^ { \top } { \pmb Q } _ { - i } { \pmb X } _ { - i } ] - \frac { \bar { { \pmb x } } ^ { \top } \tilde { Q } \bar { { \pmb x } } { \bf 1 } ^ { \top } } { 1 + \delta } \| = \mathcal { O } ( \sqrt { \log p } ) } \end{array}$
|
| 370 |
+
|
| 371 |
+
Proof. Considering $\mathbf { \pmb { u } } \in \mathbb { R } ^ { n }$ such that $\lVert \mathbf { \boldsymbol { u } } \rVert = 1$ :
|
| 372 |
+
|
| 373 |
+
$$
|
| 374 |
+
\begin{array} { r l } & { \mathbb { E } [ { \mathbf x } _ { i } ^ { \top } Q _ { - i } X _ { - i } u ] - \frac { \bar { x } ^ { \top } \bar { Q } \bar { x } \mathbf { 1 } ^ { \top } u } { 1 + \delta } } \\ & { \qquad = \left| \displaystyle \sum _ { j = \mathbf { i } } ^ { n } a _ { j } \mathbb { E } \left[ \frac { x _ { i } ^ { \top } Q _ { - i } ^ { - \bot } x _ { j } } { 1 + \frac { 1 } { p } x _ { j } ^ { \top } Q _ { - i } ^ { - \bot } x _ { j } } - \frac { x _ { i } ^ { \top } \bar { Q } { x } _ { j } } { 1 + \delta } \right] \right| } \\ & { \qquad \le \sqrt { n } \left| \mathbb { E } \left[ \frac { x _ { i } ^ { \top } Q _ { - i } ^ { - \bot } x _ { j } } { 1 + \frac { 1 } { p } x _ { j } ^ { \top } Q _ { - i } ^ { - \bot } x _ { j } } - \frac { x _ { i } ^ { \top } Q _ { - i } ^ { - \bot } x _ { j } } { 1 + \delta } \right] \right| + \left| \frac { 1 } { 1 + \delta } \mathbb { E } \left[ x _ { i } ^ { \top } Q _ { - i } ^ { \top } x _ { j } - x _ { i } ^ { \top } \bar { Q } { x } _ { j } \right] \right| \ ( \mathrm { w h e r e ~ } i \xrightarrow [ ] { } ) } \\ & { \qquad \le \sqrt { n } \left| \mathbb { E } \left[ \bar { x } ^ { \top } Q x _ { j } \left( \frac { 1 } { p } x _ { j } ^ { \top } Q _ { - i } ^ { - \bot } x _ { j } - \delta \right) \right] \right| + \sqrt { n } \left| \mathbb { E } \left[ \bar { x } ^ { \top } Q _ { - i } ^ { - \bot } \bar { x } - \bar { x } ^ { \top } \bar { Q } \bar { x } \right] \right| , } \end{array}
|
| 375 |
+
$$
|
| 376 |
+
|
| 377 |
+
where the first term is treated the same way as we did in the proof of Proposition A.3 and the second term is bounded thanks to Proposition A.3 □
|
| 378 |
+
|
| 379 |
+
# A.3 MAIN BODY OF THE PROOF
|
| 380 |
+
|
| 381 |
+
Proof of Theorem 3.3. Recall the definition of the resolvents $\pmb { R }$ and $Q$ in Equation (13). The first step of the proof is to show the concentration of $\pmb { R }$ . This comes from the fact that the application $\Phi : X \mapsto ( X ^ { \intercal } X + z I _ { n } ) ^ { - 1 }$ is $2 z ^ { - 3 / 2 }$ -Lipschitz w.r.t. the Frobenius norm. Indeed, by the matrix identity $A - B = A ( B ^ { - 1 } - A ^ { - 1 } ) B$ , we have
|
| 382 |
+
|
| 383 |
+
$$
|
| 384 |
+
\Phi ( X ) - \Phi ( X + H ) = \Phi ( X ) ( H ^ { \top } X + ( X + H ) ^ { \top } H ) \Phi ( X + H )
|
| 385 |
+
$$
|
| 386 |
+
|
| 387 |
+
And by the bounds $\| A B \| _ { F } \leq \| A \| \cdot \| B \| _ { F } , \| \Phi ( X ) X ^ { \intercal } \| \leq z ^ { - 1 / 2 }$ and $\| \Phi ( X ) \| \leq z ^ { - 1 }$ , we have
|
| 388 |
+
|
| 389 |
+
$$
|
| 390 |
+
\| \Phi ( { \pmb X } + { \pmb H } ) - \Phi ( { \pmb X } ) \| _ { F } \leq \frac { 2 } { z ^ { 3 / 2 } } \| { \pmb H } \| _ { F } .
|
| 391 |
+
$$
|
| 392 |
+
|
| 393 |
+
Therefore, given $\pmb { X } \in \mathcal { E } _ { q } ( 1 | \mathbb { R } ^ { p \times n } , \| \cdot \| _ { F } )$ and since the application $X \mapsto R = \Phi ( X / \sqrt { p } )$ is $2 z ^ { - 3 / 2 } p ^ { - 1 / 2 }$ -Lipschitz, we have by Proposition 2.3 that $\pmb { R } \in \mathcal { E } _ { q } ( p ^ { - 1 / 2 } | \mathbb { R } ^ { n \times n } , \| \cdot \| _ { F } )$ .
|
| 394 |
+
|
| 395 |
+
The second step consists in estimating $\mathbb { E } R ( z )$ through a deterministic matrix $\tilde { R }$ . Indeed, by the identity $( M ^ { \top } \bar { M } + z { \cal I } ) ^ { - 1 } M ^ { \top } = M ^ { \top } ( \bar { M } M ^ { \top } + z { \cal I } ) ^ { - \bar { 1 } }$ , the resolvent $\pmb { R }$ can be expressed in function
|
| 396 |
+
|
| 397 |
+
of $Q$ as follows
|
| 398 |
+
|
| 399 |
+
$$
|
| 400 |
+
R = \frac { 1 } { z } \left( I _ { n } - \frac { X ^ { \intercal } Q X } { p } \right) ,
|
| 401 |
+
$$
|
| 402 |
+
|
| 403 |
+
thus a deterministic equivalent for $\pmb { R }$ can therefore be obtained through a deterministic equivalent of the matrix $X ^ { \intercal } Q X$ . However, as demonstrated in Louart $\&$ Couillet (2019), the matrix $Q$ has as a deterministic equivalent the matrix $\tilde { Q }$ defined in equation 14. In the following, we aim at deriving a deterministic equivalent for $\scriptstyle { \frac { 1 } { p } } X ^ { \tau } Q X$ in function of $\tilde { Q }$ . Let $\textbf { \em u }$ and $\pmb { v }$ be two unitary vectors in $\mathbb { R } ^ { n }$ , and let us estimate
|
| 404 |
+
|
| 405 |
+
$$
|
| 406 |
+
\Delta \equiv \mathbb { E } \left[ u ^ { \mathsf { T } } \left( \frac { X ^ { \mathsf { T } } Q X } { p } - \frac { X ^ { \mathsf { T } } \tilde { Q } X } { p } \right) v \right] = \frac { 1 } { p } \mathbb { E } \left[ \frac { u ^ { \mathsf { T } } X ^ { \mathsf { T } } Q C \tilde { Q } X v } { 1 + \delta } - \frac { 1 } { p } u ^ { \mathsf { T } } X ^ { \mathsf { T } } Q X X ^ { \mathsf { T } } \tilde { Q } X v \right]
|
| 407 |
+
$$
|
| 408 |
+
|
| 409 |
+
With the following matrix identities (to explore the independence of the columns of $\boldsymbol { X }$ ):
|
| 410 |
+
|
| 411 |
+
$$
|
| 412 |
+
Q = Q _ { - i } - { \frac { 1 } { p } } Q _ { - i } x _ { i } x _ { i } ^ { \intercal } Q \ , \quad Q x _ { i } = { \frac { Q _ { - i } x _ { i } } { 1 + { \frac { 1 } { p } } x _ { i } ^ { \intercal } Q _ { - i } x _ { i } } } , \quad A - B = A ( B ^ { - 1 } - A ^ { - 1 } ) B
|
| 413 |
+
$$
|
| 414 |
+
|
| 415 |
+
and the decomposition $\textstyle Q X X ^ { \tau } = \sum _ { i = 1 } ^ { n } Q x _ { i } x _ { i } ^ { \intercal }$ , we obtain:
|
| 416 |
+
|
| 417 |
+
$$
|
| 418 |
+
\begin{array} { r l } { { \Delta = \frac { 1 } { p ^ { 2 } } \mathbb { E } [ \sum _ { i = 1 } ^ { n } \frac { u ^ { \tau } X ^ { \tau } Q _ { - i } C \hat { Q } X \boldsymbol { x } _ { \boldsymbol { \nu } } } { 1 + \delta } - \frac { u ^ { \tau } X ^ { \tau } Q _ { - i } x _ { i } ^ { \tau } \hat { Q } X \boldsymbol { x } _ { \boldsymbol { \nu } } } { 1 + \frac { 1 } { p } x _ { i } ^ { \tau } \hat { Q } _ { - i } x _ { i } } - \frac { 1 } { p } \frac { u ^ { \tau } X ^ { \tau } Q _ { - i } x _ { i } ^ { \tau } \hat { Q } C \hat { Q } X \boldsymbol { x } } { 1 + \delta } ] } } \\ & { = \frac { 1 } { p ^ { 2 } } \sum _ { i = 1 } ^ { n } \mathbb { E } [ \frac { u ^ { \tau } X _ { - i } ^ { \tau } Q _ { - i } C \hat { Q } X \boldsymbol { x } _ { - i } \boldsymbol { v } } { 1 + \delta } - \frac { u ^ { \tau } X _ { - i } ^ { \tau } Q _ { - i } x _ { i } x _ { i } ^ { \tau } \hat { Q } X _ { - i } \boldsymbol { v } } { 1 + \frac { 1 } { p } x _ { i } ^ { \tau } Q _ { - i } x _ { i } } } \\ & { \qquad + \frac { u _ { i } x _ { i } ^ { \tau } \hat { Q } _ { - i } C \hat { Q } X \boldsymbol { x } _ { - i } \boldsymbol { v } } { 1 + \delta } + \frac { v _ { i } u ^ { \tau } X _ { - i } ^ { \tau } Q _ { - i } C \hat { Q } X _ { i } } { 1 + \delta } + u _ { i } v _ { i } \frac { x _ { i } ^ { \tau } Q _ { - i } C \hat { Q } x _ { i } } { 1 + \delta } } \\ & \qquad - \frac { u _ { i } x _ { i } ^ { \tau } Q _ { - i } x _ { i } ^ { \tau } \hat { Q } X _ { - i } \boldsymbol { v } } { 1 + \frac { 1 } { p } x _ { i } ^ { \tau } Q _ { - i } x _ { i } } - \frac { v _ { i } u ^ { \tau } X _ { - i } ^ { \tau } Q _ { - i } x _ { i } ^ { \tau } \hat { Q } X _ { i } } { 1 + \frac { 1 } { p } x _ { i } ^ { \tau } Q _ { - i } x _ { i } } - u _ { i } v _ { i } ^ \end{array}
|
| 419 |
+
$$
|
| 420 |
+
|
| 421 |
+
We can show with Holder’s inequality and the concentration bounds (mainly the fact that $\scriptstyle { \frac { 1 } { p } } { \pmb x } _ { i } ^ { \mathsf { T } } { \pmb Q } _ { - i } { \pmb x } _ { i }$ concentrates around $\delta$ ) developed in (Louart & Couillet, 2019), that most of the above quantities vanish asymptotically. As a toy example, we consider the following term:
|
| 422 |
+
|
| 423 |
+
$$
|
| 424 |
+
\begin{array} { r l } & { \frac { 1 } { p ^ { 2 } } \displaystyle \sum _ { i = 1 } ^ { n } \mathbb { E } \left[ \frac { u ^ { \tau } X _ { i } ^ { \tau } , Q _ { i - i } \bar { Q } \bar { Q } X _ { - i } v } { 1 + \hat { Q } } - \frac { u ^ { \tau } X _ { i } ^ { \tau } , Q _ { i - i } \bar { Q } _ { - i } \bar { x } _ { i } ^ { \tau } \bar { Q } X _ { - i } v } { 1 + \frac { 1 } { p } x _ { i } ^ { \tau } Q _ { - i } \bar { Q } X _ { - i } } \right] \Big | } \\ & { \quad = \left| \frac { 1 } { p ^ { 2 } } \displaystyle \sum _ { i = 1 } ^ { n } \left[ u ^ { \tau } X _ { - i } ^ { \tau } Q _ { - i } x _ { i } \bar { \tau } \bar { Q } X _ { - i } v \frac { \hat { g } - \bar { \nu } _ { i } ^ { \tau } \bar { Q } _ { - i } \bar { x } _ { i } } { ( 1 + \delta ) ( 1 + \frac { 1 } { p } x _ { i } ^ { \tau } Q _ { - i } \bar { x } _ { i } ) } \right] \right| } \\ & { \quad \le \left| \frac { 1 } { p ^ { 2 } } \displaystyle \sum _ { i = 1 } ^ { n } \mathbb { E } \left[ ( u ^ { \tau } X _ { - i } ^ { \tau } Q _ { - i } x _ { i } ) ( x _ { i } ^ { \tau } \bar { Q } X _ { - i } v ) \left( \delta - \frac { 1 } { p } x _ { i } ^ { \tau } Q _ { - i } x _ { i } \right) \right] \right| } \\ & { \quad \le \left| \frac { 1 } { p } \displaystyle \sum _ { i = 1 } ^ { n } \left( \mathbb { E } \left[ \left( \frac { 1 } { \sqrt { p } } \eta ^ { \tau } X _ { - i } ^ { \tau } Q _ { - i } x _ { i } \right) ^ { a } \right] \right) \mathbb { E } \left[ \left( \frac { 1 } { \sqrt { p } } x _ { i } ^ { \tau } \bar { Q } X _ { - i } v \right) ^ { a } \right] \mathbb { E } \left[ \left( \delta - \frac { 1 } { p } x _ { i } ^ { \tau } Q _ { - i } x _ { i } \right) ^ { a } \right] \right| } \\ & { \quad \quad = \mathcal { O } \left( \frac { 1 } { \sqrt { p } } \right) } \end{array}
|
| 425 |
+
$$
|
| 426 |
+
|
| 427 |
+
Similarly, we can show that:
|
| 428 |
+
|
| 429 |
+
$$
|
| 430 |
+
\begin{array} { r l } & { \left| \frac { 1 } { p ^ { 2 } } \displaystyle \sum _ { i = 1 } ^ { n } \mathbb { E } \left[ \frac { u _ { i } x _ { i } ^ { \top } Q _ { - i } C \tilde { Q } X _ { - i } v } { 1 + \delta } + \frac { v _ { i } u ^ { \top } X _ { - i } ^ { \top } Q _ { - i } C \tilde { Q } x _ { i } } { 1 + \delta } \right. } \\ & { \qquad \left. + u _ { i } v _ { i } \frac { x _ { i } ^ { \top } Q _ { - i } C \tilde { Q } x _ { i } } { 1 + \delta } - \frac { 1 } { p } \frac { u ^ { \top } X ^ { \top } Q _ { - i } x _ { i } x _ { i } ^ { \top } Q C \tilde { Q } X v } { 1 + \delta } \right] \right| = \mathcal { O } \left( \frac { 1 } { \sqrt { p } } \right) } \end{array}
|
| 431 |
+
$$
|
| 432 |
+
|
| 433 |
+
Finally, the remaining terms in $\Delta$ can be estimated as follows:
|
| 434 |
+
|
| 435 |
+
$$
|
| 436 |
+
\begin{array} { r l } & { \Delta = \displaystyle \frac { 1 } { p ^ { 2 } } \sum _ { i = 1 } ^ { n } \mathbb { E } \left[ - \frac { u _ { i } x _ { i } ^ { \top } Q _ { - i } x _ { i } x _ { i } ^ { \top } \tilde { Q } X _ { - i } v } { 1 + \frac { 1 } { p } x _ { i } ^ { \top } Q _ { - i } x _ { i } } \right. } \\ & { \qquad \left. - \frac { v _ { i } u ^ { \top } X _ { - i } ^ { \top } Q _ { - i } x _ { i } x _ { i } ^ { \top } \tilde { Q } x _ { i } } { 1 + \frac { 1 } { p } x _ { i } ^ { \top } Q x _ { i } } - u _ { i } v _ { i } \frac { x _ { i } ^ { \top } Q _ { - i } x _ { i } x _ { i } ^ { \top } \tilde { Q } x _ { i } } { 1 + \frac { 1 } { p } x _ { i } ^ { \top } Q _ { - i } x _ { i } } \right] + \mathcal { O } \left( \frac { 1 } { \sqrt { p } } \right) } \\ & { = \displaystyle - \frac { 2 } { p } \frac { \delta u ^ { \top } \mathbf { 1 } \bar { x } ^ { \top } \tilde { Q } \bar { x } \mathbf { 1 } ^ { \top } v } { 1 + \delta } - \frac { \delta ^ { 2 } u ^ { \top } v } { 1 + \delta } + \mathcal { O } \left( \sqrt { \frac { \log p } { p } } \right) } \end{array}
|
| 437 |
+
$$
|
| 438 |
+
|
| 439 |
+
Where the last equality is obtained through the following estimation:
|
| 440 |
+
|
| 441 |
+
$$
|
| 442 |
+
\begin{array} { r l } & { \displaystyle \sum _ { = 1 } ^ { n } \mathbb { E } [ \frac { v _ { i } u ^ { \top } X _ { - i } ^ { \top } Q _ { - i } x _ { i } x _ { i } ^ { \top } \tilde { Q } x _ { i } } { 1 + \frac { 1 } { p } x _ { i } ^ { \top } Q _ { - i } x _ { i } } ] = \frac { 1 } { p } \sum _ { i = 1 } ^ { n } \mathbb { E } [ \frac { v _ { i } u ^ { \top } X _ { - i } ^ { \top } Q _ { - i } x _ { i } ( \frac { 1 } { p } x _ { i } ^ { \top } \tilde { Q } x _ { i } ( 1 + \delta ) - \delta ( 1 + \frac { 1 } { p } x _ { i } ^ { \top } \tilde { Q } x _ { i } ( 1 + \delta ) ) ) } { ( 1 + \frac { 1 } { p } x _ { i } ^ { \top } Q _ { - i } x _ { i } ) ( 1 + \delta ) } } \\ & { \quad \quad \quad \quad \quad \quad \quad \quad + \frac { 1 } { p } \sum _ { i = 1 } ^ { n } \frac { v _ { i } \delta \mathbb { E } [ u ^ { \top } X _ { - i } ^ { \top } Q _ { - i } x _ { i } ] } { ( 1 + \delta ) } } \end{array}
|
| 443 |
+
$$
|
| 444 |
+
|
| 445 |
+
With the following bound:
|
| 446 |
+
|
| 447 |
+
$$
|
| 448 |
+
\begin{array} { r l } & { \left| \frac { 1 } { p } x _ { i } ^ { \top } \tilde { Q } \mathbf { x } _ { i } ( 1 + \delta ) - \delta \left( 1 + \frac { 1 } { p } x _ { i } ^ { \top } \tilde { Q } \mathbf { x } _ { i } \right) \right| } \\ & { \qquad = \left| \frac { 1 } { p } x _ { i } ^ { \top } \tilde { Q } \mathbf { x } _ { i } ( 1 + \delta ) - \delta ( 1 + \delta ) + \delta ( 1 + \delta ) - \delta \left( 1 + \frac { 1 } { p } x _ { i } ^ { \top } \tilde { Q } \mathbf { x } _ { i } \right) \right| } \\ & { \qquad \leq \left| \frac { 1 } { p } x _ { i } ^ { \top } \tilde { Q } \mathbf { x } _ { i } - \delta \right| ( 1 + 2 \delta ) , } \end{array}
|
| 449 |
+
$$
|
| 450 |
+
|
| 451 |
+
we have again with Holder’s inequality and Proposition A.4:
|
| 452 |
+
|
| 453 |
+
$$
|
| 454 |
+
\frac { 1 } { p ^ { 2 } } \sum _ { i = 1 } ^ { n } \mathbb { E } \left[ \frac { v _ { i } u ^ { \top } X _ { - i } ^ { \top } Q _ { - i } x _ { i } x _ { i } ^ { \top } \tilde { Q } x _ { i } } { 1 + \frac { 1 } { p } x _ { i } ^ { \top } Q x _ { i } } \right] = \frac { 1 } { p } \sum _ { i = 1 } ^ { n } \frac { v _ { i } \delta u ^ { \top } \mathbf { 1 } \bar { x } ^ { \top } \tilde { Q } \bar { x } } { 1 + \delta } + \mathcal { O } \left( \sqrt { \frac { \log p } { p } } \right)
|
| 455 |
+
$$
|
| 456 |
+
|
| 457 |
+
Now that we estimated $\Delta$ , it remains to estimate $\mathbb { E } [ \frac { 1 } { p } X ^ { \tau } \tilde { Q } X ]$ . Indeed, given two unit norm vectors $u , v \in \mathbb { R } ^ { n }$ we have:
|
| 458 |
+
|
| 459 |
+
$$
|
| 460 |
+
\begin{array} { r } { \mathbb { \Sigma } \left[ \displaystyle \frac { 1 } { p } { \boldsymbol u } ^ { \top } \boldsymbol { X } ^ { \top } \tilde { \boldsymbol { Q } } \boldsymbol { X } \boldsymbol { v } \right] = \displaystyle \frac { 1 } { p } \sum _ { i , j = 1 } ^ { n } u _ { i } v _ { j } \mathbb { E } [ \mathbf { x } _ { i } ^ { \top } \tilde { \boldsymbol { Q } } \boldsymbol { x } _ { j } ] = \displaystyle \frac { 1 } { p } \sum _ { i = 1 } ^ { n } \sum _ { j = 1 } ^ { n } u _ { i } v _ { j } \bar { \boldsymbol { x } } ^ { \top } \tilde { \boldsymbol { Q } } \bar { \boldsymbol { x } } + \sum _ { i = 1 } ^ { n } u _ { i } v _ { i } \delta } \\ { = \displaystyle \frac { 1 } { p } \bar { \boldsymbol { x } } ^ { \top } \tilde { \boldsymbol { Q } } \bar { \boldsymbol { x } } \boldsymbol { u } ^ { \top } \mathbf { 1 } \mathbf { 1 } ^ { \top } \boldsymbol { v } + ( \delta - \frac { 1 } { p } \bar { \boldsymbol { x } } ^ { \top } \tilde { \boldsymbol { Q } } \bar { \boldsymbol { x } } ) \boldsymbol { u } ^ { \top } \boldsymbol { v } = \frac { 1 } { p } \bar { \boldsymbol { x } } ^ { \top } \tilde { \boldsymbol { Q } } \bar { \boldsymbol { x } } \boldsymbol { u } ^ { \top } M _ { 1 } \boldsymbol { v } ^ { \top } + \delta \boldsymbol { u } ^ { \top } \boldsymbol { v } + \mathcal { O } \left( \frac { 1 } { p } \right) , } \end{array}
|
| 461 |
+
$$
|
| 462 |
+
|
| 463 |
+
since we have $\bar { \pmb { x } } ^ { \top } \tilde { \pmb { Q } } \bar { \pmb { x } } = \mathcal { O } ( 1 )$ by Lemma A.2; we introduced the matrix $M _ { 1 } = { \bf 1 1 } ^ { \mathsf { T } }$ . Therefore we have the following estimation:
|
| 464 |
+
|
| 465 |
+
$$
|
| 466 |
+
\frac { 1 } { p } \mathbb { E } \left[ X ^ { \mathsf { T } } Q X \right] = \frac { \delta } { 1 + \delta } I _ { n } + \frac { 1 } { p } \left( \frac { 1 - \delta } { 1 + \delta } \right) \bar { x } ^ { \mathsf { T } } \tilde { Q } \bar { x } M _ { 1 } + { \mathcal O } _ { \parallel \cdot \parallel } \left( \sqrt { \frac { \log p } { p } } \right)
|
| 467 |
+
$$
|
| 468 |
+
|
| 469 |
+
where $\pmb { A } = \pmb { B } + \mathcal { O } _ { \parallel \cdot \parallel } ( \alpha ( p ) )$ means that $\| A - B \| = \mathcal { O } ( \alpha ( p ) )$ . Finally, since $\pmb { R }$ concentrates around its mean, we can then conclude:
|
| 470 |
+
|
| 471 |
+
$$
|
| 472 |
+
R = \frac { 1 } { z } \left( I _ { n } - \frac { 1 } { p } X ^ { \top } Q X \right) = \frac { 1 } { z } \frac { 1 } { 1 + \delta } I _ { n } + \frac { \delta - 1 } { p z ( \delta + 1 ) } \bar { x } ^ { \top } \tilde { Q } \bar { x } M _ { 1 } + { \mathcal O } _ { \parallel \cdot \parallel } \left( \sqrt { \frac { \log p } { p } } \right) .
|
| 473 |
+
$$
|
| 474 |
+
|
| 475 |
+
# B PROOF OF PROPOSITION 3.1
|
| 476 |
+
|
| 477 |
+
Proof. Since the Lipschitz constant of a composition of Lipschitz functions is bounded by the product of their Lipschitz constants, we consider the case $N = 1$ and a linear activation function. In this case, the Lipschitz constant corresponds to the largest singular value of the weight matrix. We consider the following notations for the proof
|
| 478 |
+
|
| 479 |
+
$$
|
| 480 |
+
\begin{array} { r l } & { \bar { { \cal W } } _ { t } = { \cal W } _ { t } - \eta { \cal E } _ { t } \mathrm { ~ w i t h ~ } [ { \cal E } _ { t } ] _ { i , j } \sim { \cal N } ( 0 , 1 ) } \\ & { { \cal W } _ { t + 1 } = \bar { { \cal W } } _ { t } - \operatorname* { m a x } ( 0 , \bar { \sigma } _ { 1 , t } - \sigma _ { * } ) \bar { u } _ { 1 , t } \bar { v } _ { 1 , t } ^ { \top } } \end{array}
|
| 481 |
+
$$
|
| 482 |
+
|
| 483 |
+
where $\bar { \sigma } _ { 1 , t } = \sigma _ { 1 } ( \bar { W } _ { t } )$ , $\bar { \mathbf { u } } _ { 1 , t } = \mathbf { u } _ { 1 } ( \bar { \mathbf { W } } _ { t } )$ and $\bar { \mathbf { v } } _ { 1 , t } = \mathbf { v } _ { 1 } ( \bar { \mathbf { W } } _ { t } )$ . The effect of spectral normalization is observed in the case where $\sigma _ { * } > \bar { \sigma } _ { 1 , t }$ , otherwise the Lipschitz constant is bounded by $\sigma _ { * }$ . We therefore have
|
| 484 |
+
|
| 485 |
+
$$
|
| 486 |
+
\begin{array} { r l } & { \| \bar { \mathbf { W } } _ { t } \| _ { F } ^ { 2 } \leq \| \mathbf { W } _ { t } \| _ { F } ^ { 2 } + \eta ^ { 2 } d _ { 1 } d _ { 0 } } \\ & { \| \mathbf { W } _ { t + 1 } \| _ { F } ^ { 2 } = \| \bar { \mathbf { W } } _ { t } \| _ { F } ^ { 2 } + \sigma _ { * } ^ { 2 } - \bar { \sigma } _ { 1 , t } ^ { 2 } } \end{array}
|
| 487 |
+
$$
|
| 488 |
+
|
| 489 |
+
• If $\| \pmb { W } _ { t + 1 } \| _ { F } \geq \| \pmb { W } _ { t } \| _ { F }$ , we have by equation 16 and equation 17
|
| 490 |
+
|
| 491 |
+
$$
|
| 492 |
+
\| \bar { W } _ { t } \| _ { F } ^ { 2 } \leq \| \bar { W } _ { t } \| _ { F } ^ { 2 } + \sigma _ { * } ^ { 2 } - \bar { \sigma } _ { 1 , t } ^ { 2 } + \eta ^ { 2 } d _ { 1 } d _ { 0 } \Rightarrow \| \bar { W } _ { t } \| = \bar { \sigma } _ { 1 , t } \leq \sqrt { \sigma _ { * } ^ { 2 } + \eta ^ { 2 } d _ { 1 } d _ { 0 } } = \delta
|
| 493 |
+
$$
|
| 494 |
+
|
| 495 |
+
And since $\| \mathbfcal { W } _ { t + 1 } \| \leq \| \bar { \mathbf { W } } _ { t } \|$ , we have $\| W _ { t + 1 } \| \leq \delta$ .
|
| 496 |
+
|
| 497 |
+
• Otherwise, if there exits $\tau$ such that $\| \pmb { W } _ { \tau + 1 } \| _ { F } < \| \pmb { W } _ { \tau } \| _ { F }$ , then for all $\varepsilon > 0$ there exists an iteration $\tau ^ { \prime } \geq \tau$ such that $\| W _ { \tau ^ { \prime } } \| \leq \delta + \varepsilon$ . Indeed, otherwise we denote $\varepsilon _ { t } = \lVert \mathbf { W } _ { t } \rVert ^ { 2 } - \delta ^ { 2 }$ and $\varepsilon _ { t } > 0$ for all $t \geq \tau$ . And if for all $t \geq \tau$ , $\| \boldsymbol { W } _ { t + 1 } \| _ { F } \leq \| \boldsymbol { W } _ { t } \| _ { F }$ , we have by equation 16 and equation 17
|
| 498 |
+
|
| 499 |
+
$$
|
| 500 |
+
\lVert \boldsymbol { W } _ { t } \rVert _ { F } ^ { 2 } - \lVert \boldsymbol { W } _ { t + 1 } \rVert _ { F } ^ { 2 } \geq \lVert \hat { \boldsymbol { W } } _ { t } \rVert ^ { 2 } - \delta ^ { 2 } \geq \lVert \boldsymbol { W } _ { t + 1 } \rVert ^ { 2 } - \delta ^ { 2 } = \varepsilon _ { t + 1 }
|
| 501 |
+
$$
|
| 502 |
+
|
| 503 |
+
Integrating the above expression from $\tau$ to $T - 1 \geq \tau$ , we end up with
|
| 504 |
+
|
| 505 |
+
$$
|
| 506 |
+
\| \boldsymbol { W } _ { T } \| _ { F } ^ { 2 } - \| \boldsymbol { W } _ { T } \| _ { F } ^ { 2 } \ge \sum _ { t = \tau } ^ { T - 1 } \varepsilon _ { t } \Rightarrow 0 \le \| \boldsymbol { W } _ { T } \| _ { F } ^ { 2 } \le \| \boldsymbol { W } _ { \tau } \| _ { F } ^ { 2 } - \sum _ { t = \tau } ^ { T - 1 } \varepsilon _ { t } ,
|
| 507 |
+
$$
|
| 508 |
+
|
| 509 |
+
therefore, when $T \to \infty$ , $\varepsilon _ { t }$ has to tend to 0 otherwise the right hand-side of the last inequality will tend to $- \infty$ which is absurd.
|
md/train/rylBK34FDS/rylBK34FDS.md
ADDED
|
@@ -0,0 +1,352 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# DEEPHOYER: LEARNING SPARSER NEURAL NETWORK WITH DIFFERENTIABLE SCALE-INVARIANT SPARSITY MEASURES
|
| 2 |
+
|
| 3 |
+
Huanrui Yang, Wei Wen, Hai Li
|
| 4 |
+
Department of Electrical and Computer Engineering, Duke University, Durham, NC 27708
|
| 5 |
+
{huanrui.yang, wei.wen, hai.li} $@$ duke.edu
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
In seeking for sparse and efficient neural network models, many previous works investigated on enforcing $\ell _ { 1 }$ or $\ell _ { 0 }$ regularizers to encourage weight sparsity during training. The $\ell _ { 0 }$ regularizer measures the parameter sparsity directly and is invariant to the scaling of parameter values. But it cannot provide useful gradients and therefore requires complex optimization techniques. The $\ell _ { 1 }$ regularizer is almost everywhere differentiable and can be easily optimized with gradient descent. Yet it is not scale-invariant and causes the same shrinking rate to all parameters, which is inefficient in increasing sparsity. Inspired by the Hoyer measure (the ratio between $\ell _ { 1 }$ and $\ell _ { 2 }$ norms) used in traditional compressed sensing problems, we present DeepHoyer, a set of sparsity-inducing regularizers that are both differentiable almost everywhere and scale-invariant. Our experiments show that enforcing DeepHoyer regularizers can produce even sparser neural network models than previous works, under the same accuracy level. We also show that DeepHoyer can be applied to both element-wise and structural pruning. The codes are available at https://github.com/yanghr/DeepHoyer.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
The use of deep neural network (DNN) models has been expanded from handwritten digit recognition (LeCun et al., 1998) to real-world applications, such as large-scale image classification (Simonyan & Zisserman, 2014), self driving (Makantasis et al., 2015) and complex control problems (Mnih et al., 2013). However, a modern DNN model like AlexNet (Krizhevsky et al., 2012) or ResNet (He et al., 2016) often introduces a large number of parameters and computation load, which makes the deployment and real-time processing on embedded and edge devices extremely difficult (Han et al., 2015b;a; Wen et al., 2016). Thus, model compression techniques, especially pruning methods that increase the sparsity of weight matrices, have been extensively studied to reduce the memory consumption and computation cost of DNNs (Han et al., 2015b;a; Wen et al., 2016; Guo et al., 2016; Louizos et al., 2017b; Luo et al., 2017; Zhang et al., 2018; Liu et al., 2015).
|
| 14 |
+
|
| 15 |
+
Most of the previous works utilize some form of sparsity-inducing regularizer in searching for sparse neural networks. The $\ell _ { 1 }$ regularizer, originally proposed by Tibshirani (1996), can be easily optimized through gradient descent for its convex and almost everywhere differentiable property. Therefore it is widely used in DNN pruning: Liu et al. (2015) directly apply $\ell _ { 1 }$ regularization to all the weights of a DNN to achieve element-wise sparsity; Wen et al. (2016; 2017) present structural sparsity via group lasso, which applies an $\ell _ { 1 }$ regularization over the $\ell _ { 2 }$ norms of different groups of parameters. However, it has been noted that the value of the $\ell _ { 1 }$ regularizer is proportional to the scaling of parameters (i.e. $\lVert \alpha W \rVert _ { 1 } = | \alpha | \cdot | | W | | _ { 1 } )$ , so it “scales down” all the elements in the weight matrices with the same speed. This is not efficient in finding sparsity and may sacrifice the flexibility of the trained model. On the other hand, the $\ell _ { 0 }$ regularizer directly reflects the real sparsity of weights and is scale invariant (i.e. $| | \alpha W | | _ { 0 } = | | W | | _ { 0 } , \forall \alpha \neq 0 )$ , yet the $\ell _ { 0 }$ norm cannot provide useful gradients. Han et al. (2015b) enforce an element-wise $\ell _ { 0 }$ constraint by iterative pruning a fixed percentage of smallest weight elements, which is a heuristic method and therefore can hardly achieve optimal compression rate. Some recent works mitigate the lack of gradient information by integrating $\ell _ { 0 }$ regularization with stochastic approximation (Louizos et al., 2017b) or more complex optimization methods (e.g.
|
| 16 |
+
|
| 17 |
+
ADMM) (Zhang et al., 2018). These additional measures brought overheads to the optimization process, making the use of these methods on larger networks difficult. To achieve even sparser neural networks, we argue to move beyond $\ell _ { 0 }$ and $\ell _ { 1 }$ regularizers and seek for a sparsity-inducing regularizer that is both almost everywhere differentiable (like $\ell _ { 1 }$ ) and scale-invariant (like $\ell _ { 0 }$ ).
|
| 18 |
+
|
| 19 |
+
Beyond the $\ell _ { 1 }$ regularizer, plenty of non-convex sparsity measurements have been used in the field of feature selection and compressed sensing (Hurley & Rickard, 2009; Wen et al., 2018). Some popular regularizers like SCAD (Fan & Li, 2001), MDP (Zhang et al., 2010) and Trimmed $\ell _ { 1 }$ (Yun et al., 2019) use a piece-wise formulation to mitigate the proportional scaling problem of $\ell _ { 1 }$ . The piece-wise formulation protects larger elements by having zero penalty to elements greater than a predefined threshold. However, it is extremely costly to manually seek for the optimal trimming threshold, so it is hard to obtain optimal result in DNN pruning by using these regularizers. The transformed \`1 regularizer formulated as PNi=1 (a+1)|wia+|wi| manages to smoothly interpolate between $\ell _ { 1 }$ and $\ell _ { 0 }$ by tuning the hyperparameter $a$ (Ma et al., 2019). However, such an approximation is close to $\ell _ { 0 }$ only when $a$ approaches infinity, so the practical formulation of the transformed $\ell _ { 1 }$ (i.e. $a = 1$ ) is still not scale-invariant.
|
| 20 |
+
|
| 21 |
+
Particularly, we are interested in the Hoyer regularizer (Hoyer, 2004), which estimates the sparsity of a vector with the ratio between its $\ell _ { 1 }$ and $\ell _ { 2 }$ norms. Comparing to other sparsity-inducing regularizers, Hoyer regularizer achieves superior performance in the fields of non-negative matrix factorization (Hoyer, 2004), sparse reconstruction (Esser et al., 2013; Tran et al., 2018) and blend deconvolution (Krishnan et al., 2011; Repetti et al., 2015). We note that Hoyer regularizer is both almost everywhere differentiable and scale invariant, satisfying the desired property of a sparsityinducing regularizer. We therefore propose DeepHoyer, which is the first Hoyer-inspired regularizers for DNN sparsification. Specifically, the contributions of this work include:
|
| 22 |
+
|
| 23 |
+
• Hoyer-Square (HS) regularizer for element-wise sparsity: We enhance the original Hoyer regularizer to the HS regularizer and achieve element-wise sparsity by applying it in the training of DNNs. The HS regularizer is both almost everywhere differentiable and scale invariant. It has the same range and minima structure as the $\ell _ { 0 }$ norm. Thus, the HS regularizer presents the ability of turning small weights to zero while protecting and maintaining those weights that are larger than an induced, gradually adaptive threshold; • Group-HS regularizer for structural sparsity, which is extended from the HS regularizer; Generating sparser DNN models: Our experiments show that the proposed regularizers beat state-of-the-arts in both element-wise and structural weight pruning of modern DNNs.
|
| 24 |
+
|
| 25 |
+
# 2 RELATED WORK ON DNN PRUNING
|
| 26 |
+
|
| 27 |
+
It is well known that high redundancy pervasively exists in DNNs. Consequently, pruning methods have been extensively investigated to identify and remove unimportant weights. Some heuristic pruning methods (Han et al., 2015b; Guo et al., 2016) simply remove weights in small values to generate sparse models. These methods usually require long training time without ensuring the optimality, due to the lack of theoretical understanding and well-formulated optimization (Zhang et al., 2018). Some works formulate the problem as a sparsity-inducing optimization problem, such as $\ell _ { 1 }$ regularization (Liu et al., 2015; Park et al., 2016) that can be optimized using standard gradientbased algorithms, or $\ell _ { 0 }$ regularization (Louizos et al., 2017b; Zhang et al., 2018) which requires stochastic approximation or special optimization techniques. We propose DeepHoyer regularizers in this work, which belong to the line of sparsity-inducing optimization research. More specific, the proposed Hoyer-Square regularizer for element-wise pruning is scale-invariant and can serve as an differentiable approximation to the $\ell _ { 0 }$ norm. Furthermore, it can be optimized by gradient-based optimization methods in the same way as the $\ell _ { 1 }$ regularization. With these properties, the HoyerSquare regularizer achieves a further $38 \%$ and $63 \%$ sparsity improvement on LeNet-300-100 model and LeNet-5 model respectively comparing to previous state-of-the-arts, and achieves the highest sparsity on AlexNet without accuracy loss.
|
| 28 |
+
|
| 29 |
+
Structurally sparse DNNs attempt to create regular sparse patterns that are friendly for hardware execution. To achieve the goal, Li et al. (2016) propose to remove filters with small norms; Wen et al. (2016) apply group Lasso regularization based methods to remove various structures (e.g., filters, channels, layers) in DNNs and the similar approaches are used to remove neurons (Alvarez &
|
| 30 |
+
|
| 31 |
+

|
| 32 |
+
Figure 1: Comparing the $\ell _ { 1 }$ and the Hoyer regularizer of a 2-D vector. Their contours are shown in the left 2 subplots (darker color corresponds to a lower value). The right 2 subplots compare their negative gradients.
|
| 33 |
+
|
| 34 |
+
Salzmann, 2016); Liu et al. (2017) and Gordon et al. (2018) (MorphNet) enforce sparsity-inducing regularization on the scaling parameters within Batch Normalization layers to remove the corresponding channels in DNNs; ThiNet (Luo et al., 2017) removes unimportant filters by minimizing the reconstruction error of feature maps; and He et al. (2017) incorporate both Lasso regression and reconstruction error into the optimization problem. Bayesian optimization methods have also been applied for neuron pruning (Louizos et al., 2017a; Neklyudov et al., 2017), yet these methods are not applicable in large-scale problems like ImageNet. We further advance the DeepHoyer to learn structured sparsity (such as reducing filters and channels) with the newly proposed “Group-HS” regularization. The Group-HS regularizer further improves the computation reduction of the LeNet-5 model by $8 . 8 \%$ from the $\ell _ { 1 }$ based method (Wen et al., 2016), and by $1 1 0 . 6 \%$ from the $\ell _ { 0 }$ based method (Louizos et al., 2017b). Experiments on ResNet models reveal that the accuracy-speedup tradeoff induced by Group-HS constantly stays above the Pareto frontier of previous methods. More detailed results can be found in Section 5.
|
| 35 |
+
|
| 36 |
+
# 3 MEASURING SPARSITY WITH THE HOYER MEASURE
|
| 37 |
+
|
| 38 |
+
Sparsity measures provide tractable sparsity constraints for enforcement during problem solving and therefore have been extensively studied in the compressed sensing society. In early non-negative matrix factorization (NMF) research, a consensus was that a sparsity measure should map a $n$ - dimensional vector $X$ to a real number $S \in [ 0 , 1 ]$ , such that the possible sparsest vectors with only one nonzero element has $S = 1$ , and a vector with all equal elements has $S = 0$ (Hoyer, 2004). Unders the assumption, the Hoyer measure was proposed as follows
|
| 39 |
+
|
| 40 |
+
$$
|
| 41 |
+
S ( X ) = \frac { \sqrt { n } - ( \sum _ { i } \lvert x _ { i } \rvert ) / \sqrt { \sum _ { i } x _ { i } ^ { 2 } } } { \sqrt { n } - 1 } .
|
| 42 |
+
$$
|
| 43 |
+
|
| 44 |
+
It can be seen that
|
| 45 |
+
|
| 46 |
+
$$
|
| 47 |
+
1 \leq \frac { \sum _ { i } \left| x _ { i } \right| } { \sqrt { \sum _ { i } x _ { i } ^ { 2 } } } \leq \sqrt { n } , \forall X \in \mathbb { R } ^ { n } .
|
| 48 |
+
$$
|
| 49 |
+
|
| 50 |
+
Thus, the normalization in Equation (1) fits the measure $S ( X )$ into the $[ 0 , 1 ]$ interval. According to the survey by Hurley & Rickard (2009), among the six desired heuristic criteria of sparsity measures, the Hoyer measure satisfies five, more than all other commonly applied sparsity measures. Given its success as a sparsity measure in NMF, the Hoyer measure has been applied as a sparsity-inducing regularizer in optimization problems such as blind deconvolution (Repetti et al., 2015) and image deblurring (Krishnan et al., 2011). Without the range constraint, the Hoyer regularizer in these works adopts the form $\begin{array} { r } { R ( X ) = \frac { \sum _ { i } | x _ { i } | } { \sqrt { \sum _ { i } x _ { i } ^ { 2 } } } } \end{array}$ directly, as the ratio of the $\ell _ { 1 }$ and $\ell _ { 2 }$ norms.
|
| 51 |
+
|
| 52 |
+
Figure 1 compares the Hoyer regularizer and the $\ell _ { 1 }$ regularizer. Unlike the the $\ell _ { 1 }$ norm with a single minimum at the origin, the Hoyer regularizer has minima along axes, the structure of which is very similar to the $\ell _ { 0 }$ norm’s. Moreover, the Hoyer regularizer is scale-invariant, i.e. $R ( \alpha X ) = R ( X )$ , because both the $\ell _ { 1 }$ norm and the $\ell _ { 2 }$ norm are proportional to the scale of $X$ . The gradients of the Hoyer regularizer are purely radial, leading to “rotations” towards the nearest axis. These features make the Hoyer regularizer outperform the $\ell _ { 1 }$ regularizer on various tasks (Esser et al., 2013; Tran et al., 2018; Krishnan et al., 2011; Repetti et al., 2015). The theoretical analysis by Yin et al. (2014) also proves that the Hoyer regularizer has a better guarantee than the $\ell _ { 1 }$ norm on recovering sparse solutions from coherent and redundant representations.
|
| 53 |
+
|
| 54 |
+
# 4 MODEL COMPRESSION WITH DEEPHOYER REGULARIZERS
|
| 55 |
+
|
| 56 |
+
Inspired by the Hoyer regularizer, we propose two types of DeepHoyer regularizers: the Hoyer-Square regularizer (HS) for element-wise pruning and the Group-HS regularizer for structural pruning.
|
| 57 |
+
|
| 58 |
+
# 4.1 HOYER-SQUARE REGULARIZER FOR ELEMENT-WISE PRUNING
|
| 59 |
+
|
| 60 |
+
Since the process of the element-wise pruning is equivalent to regularizing each layer’s weight with the $\ell _ { 0 }$ norm, it is intuitive to configure the sparsity-inducing regularizer to have a similar behavior as the $\ell _ { 0 }$ norm. As shown in Inequality (2), the value of the original Hoyer regularizer of a $N$ - dimensional nonzero vector lies between 1 and $\sqrt { N }$ , while its $\ell _ { 0 }$ norm is within the range of $[ 1 , N ]$ . Thus we propose to apply the square of Hoyer regularizer, namely Hoyer-Square (HS), to the weights $W$ of a layer, like
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
H _ { S } ( W ) = \frac { ( \sum _ { i } \lvert w _ { i } \rvert ) ^ { 2 } } { \sum _ { i } w _ { i } ^ { 2 } } .
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
The proposed HS regularizer behaves as a differentiable approximation to the $\ell _ { 0 }$ norm. First, both regularizers now have the same range of $[ 1 , N ]$ . Second, $H _ { S }$ is scale invariant as $H _ { S } ( \alpha W ) = H _ { S } ( W )$ holds for $\forall \alpha \neq 0$ , so as the √ $\ell _ { 0 }$ norm. Moreover, as the squaring operator monotonously increases in the range of $[ 1 , \sqrt { N } ]$ , the Hoyer-Square regularizer’s minima remain along the axes as the Hoyer regularizer’s do (see Figure 1). In other words, they have similar minima structure as the $\ell _ { 0 }$ norm. At last, the Hoyer-Square regularizer is also almost everywhere differentiable and Equation (4) formulates the gradient of $H _ { S }$ w.r.t. an element $w _ { j }$ in the weight matrix $W$ :
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\partial _ { w _ { j } } H _ { S } ( W ) = 2 s i g n ( w _ { j } ) \frac { \sum _ { i } \lvert w _ { i } \rvert } { ( \sum _ { i } w _ { i } ^ { 2 } ) ^ { 2 } } ( \sum _ { i } w _ { i } ^ { 2 } - \lvert w _ { j } \rvert \sum _ { i } \lvert w _ { i } \rvert ) .
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
Very importantly, this formulation induces a trimming effect: when $H _ { S } ( W )$ is being minimized through gradient descent, $w _ { j }$ moves towards 0 if $\begin{array} { r } { | w _ { j } | < \frac { \sum _ { i } w _ { i } ^ { 2 } } { \sum _ { i } | w _ { i } | } } \end{array}$ , otherwise moves away from 0. In other words, unlike the $\ell _ { 1 }$ regularizer which tends to shrink all elements, our Hoyer-Square regularizer will turn weights in small value to zero meanwhile protecting large weights. Traditional trimmed regularizers (Fan & Li, 2001; Zhang et al., 2010; Yun et al., 2019) usually define a trimming threshold as a fixed value or percentage. Instead, the HS regularizer can gradually extend the scope of pruning as more weights coming close to zero. This behavior can be observed in the gradient descent path shown in Figure 2.
|
| 73 |
+
|
| 74 |
+
# 4.2 GROUP-HS REGULARIZER FOR STRUCTURAL PRUNING
|
| 75 |
+
|
| 76 |
+
Beyond element-wise pruning, structural pruning is often more preferred because it can construct the sparsity in a structured way and therefore achieve higher computation speed-up on general computation platforms (Wen et al., 2016). The structural pruning is previously empowered by the group lasso (Yuan & Lin, 2006; Wen et al., 2016), which is the sum (i.e. $\ell _ { 1 }$ norm) of the $\ell _ { 2 }$ norms of all the groups within a weight matrix like
|
| 77 |
+
|
| 78 |
+
$$
|
| 79 |
+
R _ { G } ( W ) = \sum _ { g = 1 } ^ { G } \lvert | w ^ { ( g ) } \rvert | _ { 2 } ,
|
| 80 |
+
$$
|
| 81 |
+
|
| 82 |
+
where $\lvert | W \rvert | _ { 2 } = \textstyle { \sqrt { \sum _ { i } w _ { i } ^ { 2 } } }$ represents the $\ell _ { 2 }$ norm, $w ^ { ( g ) }$ is a group of elements in the weight matrix $W$ which consists of $G$ such groups.
|
| 83 |
+
|
| 84 |
+
Following the same approach in Section 4.1, we use the Hoyer-Square regularizer to replace the $\ell _ { 1 }$ regularizer in the group lasso formulation and define the Group-HS $( G _ { H } )$ regularizer in Equation (6):
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
G _ { H } ( W ) = \frac { ( \sum _ { g = 1 } ^ { G } \lvert \lvert w ^ { ( g ) } \rvert \rvert _ { 2 } ) ^ { 2 } } { \sum _ { g = 1 } ^ { G } \lvert \lvert w ^ { ( g ) } \rvert \rvert _ { 2 } ^ { 2 } } = \frac { ( \sum _ { g = 1 } ^ { G } \lvert \lvert w ^ { ( g ) } \rvert \rvert _ { 2 } ) ^ { 2 } } { \lvert \lvert W \rvert \rvert _ { 2 } ^ { 2 } } .
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+

|
| 91 |
+
Figure 2: Minimization path of Hoyer-Square regularizer during gradient descent, with $\bar { W } \in \mathbb { R } ^ { 2 0 }$ initialized as i.i.d. $\mathcal { N } ( 0 , 1 )$ . The figure shows the path of each element $w _ { i }$ during the minimization, with the black dash line showing the induced trimming threshold.
|
| 92 |
+
|
| 93 |
+
Note that the second equality holds when and only when the groups cover all the elements of $W$ without overlapping with each other. Our experiments in this paper satisfy this requirement. However, the Group-HS regularizer can always be used in the form of the first equality when overlapping exists across groups. The gradient and the descent path of the Group-HS regularizer are very similar to those of the Hoyer-Square regularizer, and therefore we omit the detailed discussion here. The derivation of the Group-HS regularizer’s gradient shall be found in Appendix A.
|
| 94 |
+
|
| 95 |
+
# 4.3 APPLY DEEPHOYER REGULARIZERS IN DNN TRAINING
|
| 96 |
+
|
| 97 |
+
The deployment of the DeepHoyer regularizers in DNN training follows the common layer-based regularization approach (Wen et al., 2016; Liu et al., 2015). For element-wise pruning, we apply the Hoyer-Square regularizer to layer weight matrix $W ^ { ( l ) }$ for all $L$ layers, and directly minimize it alongside the DNN’s original training objective $\mathcal { L } ( W ^ { ( 1 : L ) } )$ . The $\ell _ { 2 }$ regularizer can also be added to the objective if needed. Equation (7) presents the training objective with $H _ { S }$ defined in Equation (3). Here, $\alpha$ and $\beta$ are pre-selected weight decay parameters for the regularizers.
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\operatorname* { m i n } _ { W ^ { ( 1 : L ) } } \mathcal { L } ( W ^ { ( 1 : L ) } ) + \sum _ { l = 1 } ^ { L } ( \alpha H _ { S } ( W ^ { ( l ) } ) + \beta | | W ^ { ( l ) } | | _ { 2 } ) .
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
For structural pruning, we mainly focus on pruning the columns and rows of fully connected layers and the filters and channels of convolutional layers. More specific, we group a layer in filter-wise and channel-wise fashion as proposed by Wen et al. (2016) and then apply the Group-HS regularizer to the layer. The resulted optimization objective is formulated in Equation (8).
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\operatorname* { m i n } _ { W ^ { ( 1 : L ) } } \mathcal { L } ( W ^ { ( 1 : L ) } ) + \sum _ { l = 1 } ^ { L } ( \alpha _ { n } \frac { ( \sum _ { n _ { l } = 1 } ^ { N _ { l } } \lVert w _ { n _ { l } , : ; ; ; \cdot } ^ { ( l ) } \rVert _ { 2 } ) ^ { 2 } } { \lVert W ^ { ( l ) } \rVert _ { 2 } ^ { 2 } } + \alpha _ { c } \frac { ( \sum _ { c _ { l } = 1 } ^ { C _ { l } } \lVert w _ { : , c _ { l } , : ; \cdot } ^ { ( l ) } \rVert _ { 2 } ) ^ { 2 } } { \lVert W ^ { ( l ) } \rVert _ { 2 } ^ { 2 } } + \beta \lVert W ^ { ( l ) } \rVert _ { 2 } ) .
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
Here $N _ { l }$ is the number of filters and $C _ { l }$ is the number of channels in the $l ^ { t h }$ layer if it is a convolutional layer. If the ${ { l } ^ { t h } }$ layer is fully connected, then $N _ { l }$ and $C _ { l }$ is the number of rows and columns respectively. $\alpha _ { n } , \alpha _ { c }$ and $\beta$ are pre-selected weight decay parameters for the regularizers.
|
| 110 |
+
|
| 111 |
+
The recent advance in stochastic gradient descent (SGD) method provides satisfying results under large-scale non-convex settings (Sutskever et al., 2013; Kingma & Ba, 2014), including DNNs with non-convex objectives (Auer et al., 1996). So we can directly optimize the DeepHoyer regularizers with the same SGD optimizer used for the original DNN training objective, despite their nonconvex formulations. Our experiments show that the tiny-bit nonconvexity induced by DeepHoyer does not affect the performance of DNNs.
|
| 112 |
+
|
| 113 |
+
The pruning is conducted by following the common three-stage operations: (1) train the DNN with the DeepHoyer regularizer, (2) prune all the weight elements smaller than a predefined small threshold, and (3) finetune the model by fixing all the zero elements and removing the DeepHoyer regularizer.
|
| 114 |
+
|
| 115 |
+
Table 1: Element-wise pruning results on LeNet-300-100 model $@$ accuracy $9 8 . 4 \%$
|
| 116 |
+
|
| 117 |
+
<table><tr><td rowspan="2">Method</td><td colspan="4">Nonzero wights left after pruning</td></tr><tr><td>Total</td><td>FC1</td><td>FC2</td><td>FC3</td></tr><tr><td>Orig</td><td>266.2k</td><td>235.2k</td><td>30k</td><td>1k</td></tr><tr><td>(Han et al., 2015b)</td><td>21.8k (8%)</td><td>18.8k (8%)</td><td>2.7k (9%)</td><td>260 (26%)</td></tr><tr><td>(Zhang et al., 2018)</td><td>11.6k (4.37%)</td><td>9.4k (4%)</td><td>2.1k (7%)</td><td>120 (12%)</td></tr><tr><td>(Lee et al., 2019)</td><td>13.3k (5.0%)</td><td>Not reported in (</td><td> (Lee et al.,2019)</td><td></td></tr><tr><td>(Ma et al., 2019)1</td><td>6.4k (2.40%)</td><td>5.0k (2.11%)</td><td>1.2k (4.09%)</td><td>209 (20.90%)</td></tr><tr><td>Hoyer</td><td>6.0k (2.27%)</td><td>5.3k (2.25%)</td><td>672 (2.24%)</td><td>82 (8.20%)</td></tr><tr><td>Hoyer-Square</td><td>4.6k (1.74%)</td><td>3.7k (1.57%)</td><td>768 (2.56%)</td><td>159 (15.90%)</td></tr></table>
|
| 118 |
+
|
| 119 |
+
Table 2: Element-wise pruning results on LeNet-5 model $@$ accuracy $9 9 . 2 \%$
|
| 120 |
+
|
| 121 |
+
<table><tr><td rowspan="2"></td><td colspan="5">Nonzero wights left after pruning</td></tr><tr><td>Total</td><td>CONV1</td><td>CONV2</td><td>FC1</td><td>FC2</td></tr><tr><td>Orig</td><td>430.5k</td><td>500</td><td>25k</td><td>400k</td><td>5k</td></tr><tr><td>(Han et al., 2015b)</td><td>36k (8%)</td><td>330 (66%)</td><td>3k (12%)</td><td>32k (8%)</td><td>950 (19%)</td></tr><tr><td>(Zhang et al., 2018)</td><td>6.1k (1.4%)</td><td>100 (20%)</td><td>2k (8%)</td><td>3.6k (0.9%)</td><td>350 (7%)</td></tr><tr><td>(Lee et al., 2019)</td><td>8.6k (2.0%)</td><td></td><td>Not reported in (Lee et al., 2019)</td><td></td><td></td></tr><tr><td>(Ma et al., 2019)1</td><td>5.4k (1.3%)</td><td>100 (20%)</td><td>690 (2.8%)</td><td>4.4k (1.1%)</td><td>203 (4.1%)</td></tr><tr><td>Hoyer</td><td>4.0k (0.9%)</td><td>53 (10.6%)</td><td>613 (2.5%)</td><td>3.2k (0.8%)</td><td>136 (2.7%)</td></tr><tr><td>Hoyer-Square</td><td>3.5k (0.8%)</td><td>67 (13.4%)</td><td>848 (3.4%)</td><td>2.4k (0.6%)</td><td>234 (4.7%)</td></tr></table>
|
| 122 |
+
|
| 123 |
+
# 5 EXPERIMENT RESULT
|
| 124 |
+
|
| 125 |
+
The proposed DeepHoyer regularizers are first tested on the MNIST benchmark using the LeNet300-100 fully connected model and the LeNet-5 CNN model (LeCun et al., 1998). We also conduct tests on the CIFAR-10 dataset (Krizhevsky & Hinton, 2009) with ResNet models (He et al., 2016) in various depths, and on ImageNet ILSVRC-2012 benchmark (Russakovsky et al., 2015) with the AlexNet model (Krizhevsky et al., 2012) and the ResNet-50 model (He et al., 2016). All the models are implemented and trained in the PyTorch deep learning framework (Paszke et al., 2017), where we match the model structure and the benchmark performance with those of previous works for the fairness of comparison. The experiment results presented in the rest of this section show that the proposed DeepHoyer regularizers consistently outperform previous works in both element-wise and structural pruning. Detailed information on the experiment setups and the parameter choices of our reported results can be found in Appendix B.
|
| 126 |
+
|
| 127 |
+
# 5.1 ELEMENT-WISE PRUNING
|
| 128 |
+
|
| 129 |
+
Table 1 and Table 2 summarize the performance of the proposed Hoyer-square regularizer on the MNIST benchmark, with comparisons against state of the art (SOTA) element-wise pruning methods. Without losing the testing accuracy, training with the Hoyer-Square regularizer reduces the number of nonzero weights by $5 4 . 5 \times$ on the LeNet-300-100 model and by $1 2 2 \times$ on the LeNet-5 model. Among all the methods, ours achieves the highest sparsity: it is a $3 8 \%$ improvement on the LeNet-300-100 model and a $6 3 \%$ improvement on the LeNet-5 model comparing to the best available methods. Additional results in Appendix C.1 further illustrates the effect of the Hoyer-Square regularizer on each layer’s weight distribution during the training process.
|
| 130 |
+
|
| 131 |
+
The element-wise pruning performance on the AlexNet model testing on the ImageNet benchmark is presented in Table 3. Without losing the testing accuracy, the Hoyer-Square regularizer improves the compression rate by $2 1 . 3 \times$ . This result is the highest among all methods, even better than the ADMM method (Zhang et al., 2018) which requires two additional Lagrange multipliers and involves the optimization of two objectives. Considering that the optimization of the Hoyer-Square regularizer can be directly realized on a single objective without additional variables, we conclude that the Hoyer-Square regularizer can achieve a sparse DNN model with a much lower cost. A more detailed layer-by-layer sparsity comparison of the compressed model can be found in Appendix C.2.
|
| 132 |
+
|
| 133 |
+
Table 3: Element-wise pruning results on AlexNet model.
|
| 134 |
+
|
| 135 |
+
<table><tr><td>Method</td><td>Top-5 error increase</td><td>#Parameters</td><td>Percentage left</td></tr><tr><td>Orig</td><td>+0.0%</td><td>60.9M</td><td>100%</td></tr><tr><td>(Han et al., 2015b)</td><td>-0.1%</td><td>6.7M</td><td>11.0%</td></tr><tr><td>(Guo et al., 2016)</td><td>+0.2%</td><td>3.45M</td><td>5.67%</td></tr><tr><td>(Dai et al., 2017)</td><td>-0.1%</td><td>3.1M</td><td>6.40%</td></tr><tr><td>(Ma et al., 2019)1</td><td>+0.0%</td><td>3.05M</td><td>5.01%</td></tr><tr><td>(Zhang et al., 2018)</td><td>+0.0%</td><td>2.9M</td><td>4.76%</td></tr><tr><td>Hoyer</td><td>+0.0%</td><td>3.62M</td><td>5.94%</td></tr><tr><td>Hoyer-Square</td><td>+0.0%</td><td>2.85M</td><td>4.69%</td></tr></table>
|
| 136 |
+
|
| 137 |
+
Table 4: Structural pruning results on LeNet-300-100 model
|
| 138 |
+
|
| 139 |
+
<table><tr><td>Method</td><td>Accuracy</td><td>#FLOPs</td><td>Pruned structure</td></tr><tr><td>Orig</td><td>98.4%</td><td>266.2k</td><td>784-300-100</td></tr><tr><td>Sparse VD (Molchanov et al., 2017)</td><td>98.2%</td><td>67.3k (25.28%)</td><td>512-114-72</td></tr><tr><td>BC-GNJ (Louizos et al., 2017a)</td><td>98.2%</td><td>28.6k (10.76%)</td><td>278-98-13</td></tr><tr><td>BC-GHS (Louizos et al., 2017a)</td><td>98.2%</td><td>28.1k (10.55%)</td><td>311-86-14</td></tr><tr><td>lone (Louizos et al., 2017b)</td><td>98.2%</td><td>26.6k (10.01%)</td><td>266-88-33</td></tr><tr><td>Bayes ltrim (Yun et al., 2019)</td><td>98.3%</td><td>20.5k (7.70%)</td><td>245-75-25</td></tr><tr><td>Group-HS</td><td>98.2%</td><td>16.5k (6.19%)</td><td>353-45-11</td></tr></table>
|
| 140 |
+
|
| 141 |
+
We perform the ablation study for performance comparison between the Hoyer-Square regularizer and the original Hoyer regularizer. The results in Tables 1, 2 and 3 all show that the Hoyer-Square regularizer always achieves a higher compression rate than the original Hoyer regularizer. The layer-wise compression results show that the Hoyer-Square regularizer emphasizes more on the layers with more parameters (i.e. FC1 for the MNIST models). This corresponds to the fact that the value of the Hoyer-Square regularizer is proportional to the number of non-zero elements in the weight. These observations validate our choice to use the Hoyer-Square regularizer for DNN compression.
|
| 142 |
+
|
| 143 |
+
# 5.2 STRUCTURAL PRUNING
|
| 144 |
+
|
| 145 |
+
This section reports the effectiveness of the Group-HS regularizer in structural pruning tasks. Here we mainly focus on the number of remaining neurons (output channels for convolution layers and rows for fully connected layers) after removing the all-zero channels or rows in the weight matrices. The comparison is then made based on the required float-point operations (FLOPs) to inference with the remaining neurons, which indeed represents the potential inference speed of the pruned model. As shown in Table 4, training with the Group-HS regularizer can reduce the number of FLOPs by $1 6 . 2 \times$ for the LeNet-300-100 model with a slight accuracy drop. This is the highest speedup among all existing methods achieving the same testing accuracy. Table 5 shows that the Group-HS regularizer can reduce the number of FLOPs of the LeNet-5 model by $1 2 . 4 \times$ , which outperforms most of the existing work—an $8 . 8 \%$ increase from the $\ell _ { 1 }$ based method (Wen et al., 2016) and a $1 1 0 . 6 \%$ increase from the $\ell _ { 0 }$ based method (Louizos et al., 2017b). Only the Bayesian compression (BC) method with the group-horseshoe prior (BC-GHS) (Louizos et al., 2017a) achieves a slightly higher speedup on the LeNet-5 model. However, the complexity of high dimensional Bayesian inference limits BC’s capability. It is difficult to apply BC to ImageNet-level problems and large DNN models like ResNet.
|
| 146 |
+
|
| 147 |
+
Table 5: Structural pruning result on LeNet-5 model
|
| 148 |
+
|
| 149 |
+
<table><tr><td>Method</td><td>Accuracy</td><td>#FLOPs</td><td>Pruned structure</td></tr><tr><td>Orig</td><td>99.2%</td><td>2293k</td><td>20-50-800-500</td></tr><tr><td>Sparse VD (Molchanov et al., 2017)</td><td>99.0%</td><td>660.2k (28.79%)</td><td>14-19-242-131</td></tr><tr><td>GL (Wen et al., 2016)</td><td>99.0%</td><td>201.8k (8.80%)</td><td>3-12-192-500</td></tr><tr><td>SBP (Neklyudov et al.,2017)</td><td>99.1%</td><td>212.8k (9.28%)</td><td>3-18-284-283</td></tr><tr><td>BC-GNJ (Louizos et al., 2017a)</td><td>99.0%</td><td>282.9k (12.34%)</td><td>8-13-88-13</td></tr><tr><td>BC-GHS (Louizos et al., 2017a)</td><td>99.0%</td><td>153.4k (6.69 %)</td><td>5-10-76-16</td></tr><tr><td>lohc (Louizos et al., 2017b)</td><td>99.0%</td><td>390.7k (17.04%)</td><td>9-18-26-25</td></tr><tr><td>Bayes ltrim (Yun et al.,2019)</td><td>99.0%</td><td>334.0k (14.57%)</td><td>8-17-53-19</td></tr><tr><td>Group-HS</td><td>99.0%</td><td>169.9k (7.41%)</td><td>5-12-139-13</td></tr></table>
|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
Figure 3: Comparisons of accuracy-#FLOPs tradeoff on ImageNet and CIFAR-10, black dash lines mark the Pareto frontiers. The exact data for the points are listed in Appendix C.3.
|
| 153 |
+
|
| 154 |
+
In contrast, the effectiveness of the Group-HS regularizer can be easily extended to deeper models and larger datasets, which is demonstrated by our experiments. We apply the Group-HS regularizer to ResNet models (He et al., 2016) on the CIFAR-10 and the ImageNet datasets. Pruning ResNet has long been considered difficult due to the compact structure of the ResNet model. Since previous works usually report the compression rate at different accuracy, we use the “accuracy-#FLOPs” plot to represent the tradeoff. The tradeoff between the accuracy and the FLOPs are explored in this work by changing the strength of the Group-HS regularizer used in training. Figure 3 shows the performance of DeepHoyer constantly stays above the Pareto frontier of previous methods.
|
| 155 |
+
|
| 156 |
+
# 6 CONCLUSIONS
|
| 157 |
+
|
| 158 |
+
In this work, we propose DeepHoyer, a set of sparsity-inducing regularizers that are both scaleinvariant and almost everywhere differentiable. We show that the proposed regularizers have similar range and minima structure as the $\ell _ { 0 }$ norm, so it can effectively measure and regularize the sparsity of the weight matrices of DNN models. Meanwhile, the differentiable property enables the proposed regularizers to be simply optimized with standard gradient-based methods, in the same way as the $\ell _ { 1 }$ regularizer is. In the element-wise pruning experiment, the proposed Hoyer-Square regularizer achieves a $3 8 \%$ sparsity increase on the LeNet-300-100 model and a $6 3 \%$ sparsity increase on the LeNet-5 model without accuracy loss comparing to the state-of-the-art. A $2 1 . 3 \times$ model compression rate is achieved on AlexNet, which also surpass all previous methods. In the structural pruning experiment, the proposed Group-HS regularizer further reduces the computation load by $2 4 . 4 \%$ from the state-of-the-art on LeNet-300-100 model. It also achieves a $8 . 8 \%$ increase from the $\ell _ { 1 }$ based method and a $1 1 0 . 6 \%$ increase from the $\ell _ { 0 }$ based method of the computation reduction rate on the LeNet-5 model. For CIFAR-10 and ImageNet dataset, the accuracy-FLOPs tradeoff achieved by training ResNet models with various strengths of the Group-HS regularizer constantly stays above the Pareto frontier of previous methods. These results prove that the DeepHoyer regularizers are effective in achieving both element-wise and structural sparsity in deep neural networks, and can produce even sparser DNN models than previous works.
|
| 159 |
+
|
| 160 |
+
# ACKNOWLEDGMENTS
|
| 161 |
+
|
| 162 |
+
The authors would like to thank Feng Yan for his help on computation resources throughout this project. Our work was supported in part by NSF SPX-1725456 and NSF CNS-1822085.
|
| 163 |
+
|
| 164 |
+
# REFERENCES
|
| 165 |
+
|
| 166 |
+
Jose M Alvarez and Mathieu Salzmann. Learning the number of neurons in deep networks. In Advances in Neural Information Processing Systems, pp. 2270–2278, 2016.
|
| 167 |
+
|
| 168 |
+
Peter Auer, Mark Herbster, and Manfred K Warmuth. Exponentially many local minima for single neurons. In Advances in neural information processing systems, pp. 316–322, 1996.
|
| 169 |
+
|
| 170 |
+
Xiaoliang Dai, Hongxu Yin, and Niraj K. Jha. Nest: A neural network synthesis tool based on a grow-and-prune paradigm. CoRR, abs/1711.02017, 2017. URL http://arxiv.org/abs/ 1711.02017.
|
| 171 |
+
|
| 172 |
+
Xiaohan Ding, Guiguang Ding, Yuchen Guo, and Jungong Han. Centripetal sgd for pruning very deep convolutional networks with complicated structure. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4943–4953, 2019.
|
| 173 |
+
|
| 174 |
+
Ernie Esser, Yifei Lou, and Jack Xin. A method for finding structured sparse solutions to nonnegative least squares problems with applications. SIAM Journal on Imaging Sciences, 6(4):2010–2046, 2013.
|
| 175 |
+
|
| 176 |
+
Jianqing Fan and Runze Li. Variable selection via nonconcave penalized likelihood and its oracle properties. Journal of the American statistical Association, 96(456):1348–1360, 2001.
|
| 177 |
+
|
| 178 |
+
Ariel Gordon, Elad Eban, Ofir Nachum, Bo Chen, Hao Wu, Tien-Ju Yang, and Edward Choi. Morphnet: Fast & simple resource-constrained structure learning of deep networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1586–1595, 2018.
|
| 179 |
+
|
| 180 |
+
Yiwen Guo, Anbang Yao, and Yurong Chen. Dynamic network surgery for efficient dnns. In Advances In Neural Information Processing Systems, pp. 1379–1387, 2016.
|
| 181 |
+
|
| 182 |
+
Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015a.
|
| 183 |
+
|
| 184 |
+
Song Han, Jeff Pool, John Tran, and William Dally. Learning both weights and connections for efficient neural network. In Advances in neural information processing systems, pp. 1135–1143, 2015b.
|
| 185 |
+
|
| 186 |
+
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.
|
| 187 |
+
|
| 188 |
+
Yang He, Guoliang Kang, Xuanyi Dong, Yanwei Fu, and Yi Yang. Soft filter pruning for accelerating deep convolutional neural networks. arXiv preprint arXiv:1808.06866, 2018a.
|
| 189 |
+
|
| 190 |
+
Yihui He, Xiangyu Zhang, and Jian Sun. Channel pruning for accelerating very deep neural networks. In Proceedings of the IEEE International Conference on Computer Vision, pp. 1389–1397, 2017.
|
| 191 |
+
|
| 192 |
+
Yihui He, Ji Lin, Zhijian Liu, Hanrui Wang, Li-Jia Li, and Song Han. Amc: Automl for model compression and acceleration on mobile devices. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 784–800, 2018b.
|
| 193 |
+
|
| 194 |
+
Patrik O Hoyer. Non-negative matrix factorization with sparseness constraints. Journal of machine learning research, 5(Nov):1457–1469, 2004.
|
| 195 |
+
|
| 196 |
+
Zehao Huang and Naiyan Wang. Data-driven sparse structure selection for deep neural networks. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 304–320, 2018.
|
| 197 |
+
|
| 198 |
+
Niall Hurley and Scott Rickard. Comparing measures of sparsity. IEEE Transactions on Information Theory, 55(10):4723–4741, 2009.
|
| 199 |
+
|
| 200 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 201 |
+
|
| 202 |
+
Dilip Krishnan, Terence Tay, and Rob Fergus. Blind deconvolution using a normalized sparsity measure. In CVPR 2011, pp. 233–240. IEEE, 2011.
|
| 203 |
+
|
| 204 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 205 |
+
|
| 206 |
+
Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pp. 1097–1105, 2012.
|
| 207 |
+
|
| 208 |
+
Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 209 |
+
|
| 210 |
+
Namhoon Lee, Thalaiyasingam Ajanthan, and Philip Torr. SNIP: SINGLE-SHOT NETWORK PRUNING BASED ON CONNECTION SENSITIVITY. In International Conference on Learning Representations, 2019. URL https://openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ B1VZqjAcYX.
|
| 211 |
+
|
| 212 |
+
Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. arXiv preprint arXiv:1608.08710, 2016.
|
| 213 |
+
|
| 214 |
+
Tuanhui Li, Baoyuan Wu, Yujiu Yang, Yanbo Fan, Yong Zhang, and Wei Liu. Compressing convolutional neural networks via factorized convolutional filters. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 3977–3986, 2019.
|
| 215 |
+
|
| 216 |
+
Shaohui Lin, Rongrong Ji, Yuchao Li, Yongjian Wu, Feiyue Huang, and Baochang Zhang. Accelerating convolutional networks via global & dynamic filter pruning. In IJCAI, pp. 2425–2432, 2018.
|
| 217 |
+
|
| 218 |
+
Shaohui Lin, Rongrong Ji, Yuchao Li, Cheng Deng, and Xuelong Li. Toward compact convnets via structure-sparsity regularized filter pruning. IEEE transactions on neural networks and learning systems, 2019.
|
| 219 |
+
|
| 220 |
+
Baoyuan Liu, Min Wang, Hassan Foroosh, Marshall Tappen, and Marianna Pensky. Sparse convolutional neural networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 806–814, 2015.
|
| 221 |
+
|
| 222 |
+
Zhuang Liu, Jianguo Li, Zhiqiang Shen, Gao Huang, Shoumeng Yan, and Changshui Zhang. Learning efficient convolutional networks through network slimming. In Proceedings of the IEEE International Conference on Computer Vision, pp. 2736–2744, 2017.
|
| 223 |
+
|
| 224 |
+
Christos Louizos, Karen Ullrich, and Max Welling. Bayesian compression for deep learning. In Advances in Neural Information Processing Systems, pp. 3288–3298, 2017a.
|
| 225 |
+
|
| 226 |
+
Christos Louizos, Max Welling, and Diederik P Kingma. Learning sparse neural networks through l_0 regularization. arXiv preprint arXiv:1712.01312, 2017b.
|
| 227 |
+
|
| 228 |
+
Jian-Hao Luo and Jianxin Wu. Autopruner: An end-to-end trainable filter pruning method for efficient deep model inference. arXiv preprint arXiv:1805.08941, 2018.
|
| 229 |
+
|
| 230 |
+
Jian-Hao Luo, Jianxin Wu, and Weiyao Lin. Thinet: A filter level pruning method for deep neural network compression. In Proceedings of the IEEE international conference on computer vision, pp. 5058–5066, 2017.
|
| 231 |
+
|
| 232 |
+
Rongrong Ma, Jianyu Miao, Lingfeng Niu, and Peng Zhang. Transformed $\ell _ { 1 }$ regularization for learning sparse deep neural networks. Neural Networks, 2019.
|
| 233 |
+
|
| 234 |
+
Konstantinos Makantasis, Konstantinos Karantzalos, Anastasios Doulamis, and Nikolaos Doulamis. Deep supervised learning for hyperspectral data classification through convolutional neural networks. In 2015 IEEE International Geoscience and Remote Sensing Symposium (IGARSS), pp. 4959–4962. IEEE, 2015.
|
| 235 |
+
|
| 236 |
+
Volodymyr Mnih, Koray Kavukcuoglu, David Silver, Alex Graves, Ioannis Antonoglou, Daan Wierstra, and Martin Riedmiller. Playing atari with deep reinforcement learning. arXiv preprint arXiv:1312.5602, 2013.
|
| 237 |
+
|
| 238 |
+
Dmitry Molchanov, Arsenii Ashukha, and Dmitry Vetrov. Variational dropout sparsifies deep neural networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 2498–2507. JMLR. org, 2017.
|
| 239 |
+
|
| 240 |
+
Kirill Neklyudov, Dmitry Molchanov, Arsenii Ashukha, and Dmitry P Vetrov. Structured bayesian pruning via log-normal multiplicative noise. In Advances in Neural Information Processing Systems, pp. 6775–6784, 2017.
|
| 241 |
+
|
| 242 |
+
Jongsoo Park, Sheng Li, Wei Wen, Ping Tak Peter Tang, Hai Li, Yiran Chen, and Pradeep Dubey. Faster cnns with direct sparse convolutions and guided pruning. arXiv preprint arXiv:1608.01409, 2016.
|
| 243 |
+
|
| 244 |
+
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.
|
| 245 |
+
|
| 246 |
+
Audrey Repetti, Mai Quyen Pham, Laurent Duval, Emilie Chouzenoux, and Jean-Christophe Pesquet. Euclid in a taxicab: Sparse blind deconvolution with smoothed $\ell _ { 1 } / \ell _ { 2 }$ regularization. IEEE signal processing letters, 22(5):539–543, 2015.
|
| 247 |
+
|
| 248 |
+
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. International Journal of Computer Vision (IJCV), 115 (3):211–252, 2015. doi: 10.1007/s11263-015-0816-y.
|
| 249 |
+
|
| 250 |
+
Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
|
| 251 |
+
|
| 252 |
+
Pravendra Singh, Vinay Kumar Verma, Piyush Rai, and Vinay P Namboodiri. Leveraging filter correlations for deep model compression. arXiv preprint arXiv:1811.10559, 2018.
|
| 253 |
+
|
| 254 |
+
Ilya Sutskever, James Martens, George Dahl, and Geoffrey Hinton. On the importance of initialization and momentum in deep learning. In International conference on machine learning, pp. 1139–1147, 2013.
|
| 255 |
+
|
| 256 |
+
Robert Tibshirani. Regression shrinkage and selection via the lasso. Journal of the Royal Statistical Society: Series B (Methodological), 58(1):267–288, 1996.
|
| 257 |
+
|
| 258 |
+
Armenak Petrosyan Tran, Clayton Webster, et al. Reconstruction of jointly sparse vectors via manifold optimization. arXiv preprint arXiv:1811.08778, 2018.
|
| 259 |
+
|
| 260 |
+
Fei Wen, Lei Chu, Peilin Liu, and Robert C Qiu. A survey on nonconvex regularization-based sparse and low-rank recovery in signal processing, statistics, and machine learning. IEEE Access, 6: 69883–69906, 2018.
|
| 261 |
+
|
| 262 |
+
Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Learning structured sparsity in deep neural networks. In Advances in neural information processing systems, pp. 2074–2082, 2016.
|
| 263 |
+
|
| 264 |
+
Wei Wen, Yuxiong He, Samyam Rajbhandari, Minjia Zhang, Wenhan Wang, Fang Liu, Bin Hu, Yiran Chen, and Hai Li. Learning intrinsic sparse structures within long short-term memory. arXiv preprint arXiv:1709.05027, 2017.
|
| 265 |
+
|
| 266 |
+
Penghang Yin, Ernie Esser, and Jack Xin. Ratio and difference of l1 and l2 norms and sparse representation with coherent dictionaries. Commun. Inform. Systems, 14(2):87–109, 2014.
|
| 267 |
+
|
| 268 |
+
Ruichi Yu, Ang Li, Chun-Fu Chen, Jui-Hsin Lai, Vlad I Morariu, Xintong Han, Mingfei Gao, Ching-Yung Lin, and Larry S Davis. Nisp: Pruning networks using neuron importance score propagation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 9194–9203, 2018.
|
| 269 |
+
|
| 270 |
+
Ming Yuan and Yi Lin. Model selection and estimation in regression with grouped variables. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 68(1):49–67, 2006.
|
| 271 |
+
|
| 272 |
+
Jihun Yun, Peng Zheng, Eunho Yang, Aurelie Lozano, and Aleksandr Aravkin. Trimming the $\ell _ { 1 }$ regularizer: Statistical analysis, optimization, and applications to deep learning. In International Conference on Machine Learning, pp. 7242–7251, 2019.
|
| 273 |
+
|
| 274 |
+
Cun-Hui Zhang et al. Nearly unbiased variable selection under minimax concave penalty. The Annals of statistics, 38(2):894–942, 2010.
|
| 275 |
+
|
| 276 |
+
Tianyun Zhang, Shaokai Ye, Kaiqi Zhang, Jian Tang, Wujie Wen, Makan Fardad, and Yanzhi Wang. A systematic dnn weight pruning framework using alternating direction method of multipliers. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 184–199, 2018.
|
| 277 |
+
|
| 278 |
+
Zhuangwei Zhuang, Mingkui Tan, Bohan Zhuang, Jing Liu, Yong Guo, Qingyao Wu, Junzhou Huang, and Jinhui Zhu. Discrimination-aware channel pruning for deep neural networks. In Advances in Neural Information Processing Systems, pp. 875–886, 2018.
|
| 279 |
+
|
| 280 |
+
# A DERIVATION OF DEEPHOYER REGULARIZERS’ GRADIENTS
|
| 281 |
+
|
| 282 |
+
In this section we provide detailed derivation of the gradient of the Hoyer-Square regularizer and the Group-GS regularizer w.r.t. an element $w _ { j }$ in the weight matrix $W$ .
|
| 283 |
+
|
| 284 |
+
The gradient of the Hoyer-Square regularizer is shown in Equation (9). The formulation shown in Equation (4) is achieved at the end of the derivation.
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
\begin{array} { l } { \displaystyle \partial _ { w _ { j } } H _ { S } ( W ) = \frac { [ \partial _ { w _ { j } } ( ( \sum _ { i } | w _ { i } | ) ^ { 2 } ) ] \sum _ { i } w _ { i } ^ { 2 } - [ \partial _ { w _ { j } } ( \sum _ { i } w _ { i } ^ { 2 } ) ] ( \sum _ { i } | w _ { i } | ) ^ { 2 } } { ( \sum _ { i } w _ { i } ^ { 2 } ) ^ { 2 } } } \\ { \displaystyle = \frac { 2 [ \partial _ { w _ { j } } ( | w _ { j } | ) ] \sum _ { i } | w _ { i } | \sum _ { i } w _ { i } ^ { 2 } - 2 w _ { j } ( \sum _ { i } | w _ { i } | ) ^ { 2 } } { ( \sum _ { i } w _ { i } ^ { 2 } ) ^ { 2 } } } \\ { \displaystyle = 2 \frac { \sum _ { i } | w _ { i } | } { ( \sum _ { i } w _ { i } ^ { 2 } ) ^ { 2 } } ( s i g n ( w _ { j } ) \sum _ { i } w _ { i } ^ { 2 } - s i g n ( w _ { j } ) | w _ { j } | \sum _ { i } | w _ { i } | ) } \\ { \displaystyle = 2 s i g n ( w _ { j } ) \frac { \sum _ { i } | w _ { i } | } { ( \sum _ { i } w _ { i } ^ { 2 } ) ^ { 2 } } ( \sum _ { i } w _ { i } ^ { 2 } - | w _ { j } | \sum _ { i } | w _ { i } | ) . } \end{array}
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
The gradient of the Group-HS regularizer is shown in Equation (10). For simplicity we use the form shown in the second equality of Equation (6), where there is no overlapping between the groups. Here we assume that $w _ { j }$ belongs to group $w ^ { ( \hat { g } ) }$ .
|
| 291 |
+
|
| 292 |
+
$$
|
| 293 |
+
\begin{array} { r l } & { \partial _ { w _ { 2 } } G _ { H } ( W ) = \partial _ { w _ { 2 } } \frac { \langle \sum _ { g = 1 } ^ { G } | | w ^ { ( g ) } | | z \rangle ^ { 2 } } { \sum _ { i = 1 } ^ { G } w _ { i } ^ { 2 } } } \\ & { \qquad = \frac { \big [ \partial _ { w _ { 3 } } ( ( \sum _ { g = 1 } ^ { G } | | w ^ { ( g ) } | | z ) ^ { 2 } ) \big ] \sum _ { i = 1 } w _ { i } ^ { 2 } - \big [ \partial _ { w _ { 3 } } ( \sum _ { i = 1 } ^ { G } w _ { i } ^ { 2 } ) \big ] ( \sum _ { g = 1 } ^ { G } | | w ^ { ( g ) } | | z \rangle ^ { 2 } } { ( \sum _ { i = 1 } ^ { G } w _ { i } ^ { 2 } ) ^ { 2 } } } \\ & { \qquad = \frac { 2 \big [ \partial _ { w _ { 3 } } ( | | w ^ { ( g ) } | | z ) \big ] \sum _ { g = 1 } ^ { G } \big [ | w ^ { ( g ) } | | z \rangle \big ] \big [ 2 \sum _ { i = 1 } ^ { G } w _ { i } ^ { 2 } - 2 w _ { j } ( \sum _ { g = 1 } ^ { G } | | w ^ { ( g ) } | | z \rangle ^ { 2 } } { ( \sum _ { i = 1 } ^ { W } w _ { i } ^ { 2 } ) ^ { 2 } } } \\ & { \qquad = 2 \frac { \sum _ { g = 1 } ^ { G } | | w ^ { ( g ) } | | z | ^ { 2 } } { ( \sum _ { i = 1 } ^ { G } w _ { i } ^ { 2 } ) ^ { 2 } } \frac { w _ { j } } { ( | w ^ { ( g ) } | | z | ^ { 2 } , \sum _ { i } ^ { G } w _ { i } ^ { 2 } - w _ { j } ^ { 2 } ) } \frac { G } { \varepsilon - 1 } | w ^ { ( g ) } | | z \rangle } \\ & { \qquad = 2 \frac { w _ { j } } { | | w ^ { ( g ) } | | _ { 2 } } \frac { \sum _ { i = 1 } ^ { G } | w _ { i } ^ { 4 } } { ( \sum _ { i = 1 } ^ { G } w _ { i } ^ { 2 } ) ^ { 2 } } ( \frac { \sum _ { g = 2 } ^ { G } | w ^ { ( g ) } | | z \rangle ^ { 2 } } { ( \sum _ { i = 1 } ^ { G } w _ { i } ^ { 2 } ) ^ { 2 } } . } \end{array}
|
| 294 |
+
$$
|
| 295 |
+
|
| 296 |
+
# B DETAILED EXPERIMENT SETUP
|
| 297 |
+
|
| 298 |
+
# B.1 MNIST EXPERIMENTS
|
| 299 |
+
|
| 300 |
+
The MNIST dataset (LeCun et al., 1998) is a well known handwritten digit dataset consists of greyscale images with the size of $2 8 \times 2 8$ pixels. We use the dataset API provided in the “torchvision” python package to access the dataset. In our experiments we use the whole 60,000 training set images for the training and the whole 10,000 testing set images for the evaluation. All the accuracy results reported in the paper are evaluated on the testing set. Both the training set and the testing set are normalized to have zero mean and variance one. Adam optimizer (Kingma & Ba, 2014) with learning rate 0.001 is used throughout the training process. All the MNIST experiments are done with a single TITAN XP GPU.
|
| 301 |
+
|
| 302 |
+
Both the LeNet-300-100 model and the LeNet-5 model are firstly pretrained without the sparsityinducing regularizer, where they achieve the testing accuracy of $9 8 . 4 \%$ and $9 9 . 2 \%$ respectively. Then the models are further trained for 250 epochs with the DeepHoyer regularizers applied in the objective. The weight decay parameters (αs in Equation (7) and (8)) are picked by hand to reach the best result. In the last step, we prune the weight of each layer with threshold proportional to the standard derivation of each layer’s weight. The threshold/std ratio is chosen to achieve the highest sparsity without accuracy loss. All weight elements with a absolute value smaller than the threshold is set to zero and is fixed during the final finetuning. The pruned model is finetuned for another 100 steps without DeepHoyer regularizers and the best testing accuracy achieved is reported. Detailed parameter choices used in achieving the reported results are listed in Table 6.
|
| 303 |
+
|
| 304 |
+
Table 6: Hyper parameter used for MNIST benchmarks
|
| 305 |
+
|
| 306 |
+
<table><tr><td>Model</td><td colspan="2">LeNet-300-100</td><td colspan="2">LeNet-5</td></tr><tr><td>Regularizer</td><td>Decay</td><td>Threshold/std</td><td>Decay</td><td>Threshold/std</td></tr><tr><td>Hoyer</td><td>0.02</td><td>0.05</td><td>0.01</td><td>0.08</td></tr><tr><td>Hoyer-Square</td><td>0.0002</td><td>0.03</td><td>0.0001</td><td>0.03</td></tr><tr><td>Group-HS</td><td>0.002</td><td>0.8</td><td>0.1</td><td>0.008</td></tr><tr><td>Transformed l1</td><td>2e-5</td><td>0.3</td><td>2e-5</td><td>0.6</td></tr></table>
|
| 307 |
+
|
| 308 |
+
# B.2 IMAGENET AND CIFAR-10 EXPERIMENTS
|
| 309 |
+
|
| 310 |
+
The ImageNet dataset is a large-scale color-image dataset containing 1.2 million images of 1000 categories (Russakovsky et al., 2015), which has long been utilized as an important benchmark on image classification problems. In this paper, we use the “ILSVRC2012” version of the dataset, which can be found at http://www.image-net.org/challenges/LSVRC/ 2012/nonpub-downloads. We use all the data in the provided training set to train our model, and use the provided validation set to evaluate our model and report the testing accuracy. We follow the data reading and preprocessing pipeline suggested by the official PyTorch ImageNet example (https://github.com/pytorch/examples/tree/master/imagenet). For training images, we first randomly crop the training images to desired input size, then apply random horizontal flipping and finally normalize them before feeding them into the network. Validation images are first resized to $2 5 6 \times 2 5 6$ pixels, then center cropped to desired input size and normalized in the end. We use input size $2 2 7 \times 2 2 7$ pixels for experiments on the AlexNet, and input size $2 2 4 \times 2 2 4$ for experiments on the ResNet-50. All the models are optimized with the SGD optimizer Sutskever et al. (2013), and the batch size is chosen as 256 for all the experiments. Two TITAN XP GPUs are used in parallel for the AlexNet training and four are used for the ResNet-50 training.
|
| 311 |
+
|
| 312 |
+
One thing worth noticing is that the AlexNet model provided in the “torchvision” package is not the ordinary version used in previous works Han et al. (2015b); Wen et al. (2016); Zhang et al. (2018). Therefore we reimplement the AlexNet model in PyTorch for fair comparison. We pretrain the implemented model for 90 epochs and achieve $1 9 . 8 \%$ top-5 error, which is the same as reported in previous works. In the AlexNet experiment, the reported result in Table 3 is achieved by applying the Hoyer-Square regularizer with decay parameter 1e-6. Before the pruning, the model is firstly train from the pretrained model with the Hoyer-Square regularizer for 90 epochs, where an initial learning rate 0.001 is used. An $\ell _ { 2 }$ regularization with 1e-4 decay is also applied. We then prune the convolution layers with threshold 1e-4 and the FC layers with threshold equal to $0 . 4 \times$ of their standard derivations. The model is then finetuned until the best accuracy is reached. The learning rate is decayed by 0.1 for every 30 epochs of training. The training process with the Hoyer regularizer and the $T \ell _ { 1 }$ regularizer (Ma et al., 2019) is the same as the HS regularizer. For the reported result, we use decay 1e-3 and FC threshold $0 . 8 \times$ std for the Hoyer regularizer, and use decay 2e-5 and FC threshold $1 . 0 \times$ std for the $T \ell _ { 1 }$ regularizer.
|
| 313 |
+
|
| 314 |
+
For the ResNet-50 experiments on ImageNet, the model architecture and pretrained model provided in the “torchvision” package is directly utilized, which achieves $2 3 . 8 5 \%$ top-1 error and $7 . 1 3 \%$ top-5 error. All the reported results in Figure 3 and Table 8 are achieved with 90 epochs of training with the Group-HS regularizer from the pretrained model using initial learning rate 0.1. All the models are pruned with 1e-4 as threshold and finetuned to the best accuracy. We only tune the decay parameter of the Group-HS regularizer to explore the accuracy-FLOPs tradeoff. The exact decay parameter used for each result is specified in Table 8.
|
| 315 |
+
|
| 316 |
+
We also use the CIFAR-10 dataset (Krizhevsky & Hinton, 2009) to evaluate the structural pruning performance on ResNet-56 and ResNet-110 models. The CIFAR-10 dataset can be directly accessed through the dataset API provided in the “torchvision” python package. Standard preprocessing, including random crop, horizontal flip and normalization is used on the training set to train the model. We implemented the ResNet models for CIFAR-10 following the description in (He et al., 2016), and pretrain the models for 164 epochs. Learning rate is set to 0.1 initially, and decayed by 0.1 at epoch 81 and epoch 122. The pretrained ResNet-56 model reaches the testing accuracy of $9 3 . 1 4 \%$ , while the ResNet-110 model reaches $9 3 . 6 2 \%$ . Similar to the ResNet-50 experiment, we start with the pretrained models and train with the Group-HS regularizer. Same learning rate scheduling is used for both pretraining and training with Group-HS. All the models are pruned with 1e-4 as threshold and finetuned to the best accuracy. The decay parameters of the Group-HS regularizer used to get the result in Figure 3 is specified in Table 9 and Table 10.
|
| 317 |
+
|
| 318 |
+

|
| 319 |
+
Figure 4: Histogram of nonzero weight elements of each layer in the LeNet-300-100 model. From top to bottom corresponds to layer FC1, FC2, FC3 respectively. The original pretrained model is shown in column 1, column 2 shows the model achieved after $H _ { S }$ regularization, column 3 shows the final model after pruning and finetuning.
|
| 320 |
+
|
| 321 |
+
# C ADDITIONAL EXPERIMENT RESULTS
|
| 322 |
+
|
| 323 |
+
# C.1 WEIGHT DISTRIBUTION AT DIFFERENT STAGES
|
| 324 |
+
|
| 325 |
+
Here we demonstrate how will the weight distribution change in each layer at different stages of our element-wise pruning process. Since most of the weight elements will be zero in the end, we only plot the histogram of nonzero weight elements for better observation. The histogram of each layer of the LeNet-300-100 model and the LeNet-5 model are visualized in Figure 4 and Figure 5 respectively. It can be seen that majority of the weights will be concentrated near zero after applying the $H _ { S }$ regularizer during training, while rest of the weight elements will spread out in a wide range. The weights close to zero are then set to be exactly zero, and the model is finetuned with zero weights fixed. The resulted histogram shows that most of the weights are pruned away, only a small amount of nonzero weights are remaining in the model.
|
| 326 |
+
|
| 327 |
+

|
| 328 |
+
Figure 5: Histogram of nonzero weight elements of each layer in the LeNet-5 model. From top to bottom corresponds to layer CONV1, CONV2, FC1, FC2 respectively. The original pretrained model is shown in column 1, column 2 shows the model achieved after $H _ { S }$ regularization, column 3 shows the final model after pruning and finetuning.
|
| 329 |
+
|
| 330 |
+
# C.2 LAYER-BY-LAYER COMPARISON OF ELEMENT-WISE PRUNING RESULT OF ALEXNET
|
| 331 |
+
|
| 332 |
+
Table 7 compares the element-wise pruning result of the Hoyer-Square regularizer on AlexNet with other methods in a layer-by-layer fashion. It can be seen that the Hoyer-Square regularizer achieves high pruning rates on the largest layers (i.e. FC1-3). This observation is consistent with the observation made on the element-wise pruning performance of models on the MNIST dataset.
|
| 333 |
+
|
| 334 |
+
# C.3 DETAILED RESULTS OF THE RESNET EXPERIMENTS
|
| 335 |
+
|
| 336 |
+
In this section we list the data used to plot Figure 3. Table 8 shows the result of pruning ResNet-50 model on ImageNet, Table 9 shows the result of pruning ResNet-56 model on CIFAR-10 and Table 10 shows the result of pruning ResNet-110 model on CIFAR-10. For all the tables, the results of previous works are listed on the top, and are ordered based on publication year. Results achieved with the Group-HS regularizer are listed below, marked with the regularization strength used for the training.
|
| 337 |
+
|
| 338 |
+
Table 7: Element-wise pruning results on AlexNet without accuracy loss. Refer to Table 3 for the full reference of the mentined methods.
|
| 339 |
+
|
| 340 |
+
<table><tr><td rowspan="2">Layer</td><td colspan="6">Nonzero wights left after pruning</td></tr><tr><td>Baseline</td><td>Han et al.</td><td>Zhang e et al.</td><td>Ma et al.</td><td>Hoyer</td><td>HS</td></tr><tr><td>CONV1</td><td>34.8K</td><td>29.3K</td><td>28.2K</td><td>24.2K</td><td>21.3K</td><td>31.6K</td></tr><tr><td>CONV2</td><td>307.2K</td><td>116.7K</td><td>61.4K</td><td>109.9K</td><td>77.2K</td><td>148.4K</td></tr><tr><td>CONV3</td><td>884.7K</td><td>309.7K</td><td>168.1K</td><td>241.2K</td><td>192.0K</td><td>299.3K</td></tr><tr><td>CONV4</td><td>663.5K</td><td>245.5K</td><td>132.7K</td><td>207.4K</td><td>182.6K</td><td>275.6K</td></tr><tr><td>CONV5</td><td>442.2K</td><td>163.7K</td><td>88.5K</td><td>134.7K</td><td>116.6K</td><td>197.1K</td></tr><tr><td>FC1</td><td>37.7M</td><td>3.40M</td><td>1.06M</td><td>0.763M</td><td>1.566M</td><td>0.781M</td></tr><tr><td>FC2</td><td>16.8M</td><td>1.51M</td><td>0.99M</td><td>1.070M</td><td>0.974M</td><td>0.650M</td></tr><tr><td>FC3</td><td>4.10M</td><td>1.02M</td><td>0.38M</td><td>0.505M</td><td>0.490M</td><td>0.472M</td></tr><tr><td>Total</td><td>60.9M</td><td>6.8M</td><td>2.9M</td><td>3.05M</td><td>3.62M</td><td>2.85M</td></tr></table>
|
| 341 |
+
|
| 342 |
+
Table 8: Structural pruning result of the ResNet-50 model on imageNet.
|
| 343 |
+
|
| 344 |
+
<table><tr><td>Model</td><td>Top-1 acc</td><td>Top-5 acc</td><td>#FLOPsreduction</td></tr><tr><td>Orig</td><td>76.15%</td><td>92.87%</td><td>1.00×</td></tr><tr><td>Channel pruning (He et al.,2017)</td><td>N/A</td><td>90.80%</td><td>2.00×</td></tr><tr><td>ThiNet-70 (Luo et al., 2017)</td><td>72.04%</td><td>90.67%</td><td>1.58×</td></tr><tr><td>ThiNet-50 (Luo et al.,2017)</td><td>71.01%</td><td>90.02%</td><td>2.26×</td></tr><tr><td>ThiNet-30 (Luo et al., 2017)</td><td>68.42%</td><td>88.30%</td><td>3.51×</td></tr><tr><td>SSS (Huang & Wang,2018)</td><td>74.18%</td><td>91.91%</td><td>1.45×</td></tr><tr><td>SFP (He et al., 2018a)</td><td>74.61%</td><td>92.06%</td><td>1.72×</td></tr><tr><td>CFP (Singh et al., 2018)</td><td>73.4%</td><td>91.4%</td><td>1.98×</td></tr><tr><td>Autopruner (Luo & Wu,2018)</td><td>74.76%</td><td>92.15%</td><td>2.05×</td></tr><tr><td>GDP (Lin et al., 2018)</td><td>71.89%</td><td>90.71%</td><td>2.05×</td></tr><tr><td>DCP (Zhuang et al., 2018)</td><td>74.95%</td><td>92.32%</td><td>2.26×</td></tr><tr><td>SSR-L2 (Lin et al., 2019)</td><td>71.47%</td><td>90.19%</td><td>2.26×</td></tr><tr><td>C-SGD-70 (Ding et al., 2019)</td><td>75.27%</td><td>92.46%</td><td>1.58×</td></tr><tr><td>C-SGD-50 (Ding et al., 2019) C-SGD-30 (Ding et al., 2019)</td><td>74.93%</td><td>92.27%</td><td>1.86×</td></tr><tr><td></td><td>74.54%</td><td>92.09%</td><td>2.26×</td></tr><tr><td>CNN-FCF-A (Li et al., 2019)</td><td>76.50%</td><td>93.13%</td><td>1.41×</td></tr><tr><td>CNN-FCF-B (Li et al., 2019)</td><td>75.68%</td><td>92.68%</td><td>1.85×</td></tr><tr><td>CNN-FCF-C (Li et al., 2019)</td><td>74.55%</td><td>92.18%</td><td>2.33×</td></tr><tr><td>CNN-FCF-D (Li et al., 2019)</td><td>73.54%</td><td>91.50%</td><td>2.96×</td></tr><tr><td>Group-HS 1e-5</td><td>76.43%</td><td>93.07%</td><td>1.89×</td></tr><tr><td>Group-HS 2e-5</td><td>75.20%</td><td>92.52%</td><td>3.09×</td></tr><tr><td>Group-HS 3e-5</td><td>73.19%</td><td>91.36%</td><td>4.68×</td></tr><tr><td>Group-HS 4e-5</td><td>71.08%</td><td>90.21%</td><td>5.48×</td></tr></table>
|
| 345 |
+
|
| 346 |
+
Table 9: Structural pruning result of the ResNet-56 model on CIFAR-10.
|
| 347 |
+
|
| 348 |
+
<table><tr><td>Model</td><td>Base acc</td><td>Acc gain</td><td>#FLOPs reduction</td></tr><tr><td>Pruning-A (Li et al., 2016)</td><td>93.04%</td><td>+0.06%</td><td>1.12×</td></tr><tr><td>Pruning-B (Li et al., 2016)</td><td>93.04%</td><td>+0.02%</td><td>1.38×</td></tr><tr><td>Channel pruning (He et al., 2017)</td><td>92.8%</td><td>-1.0%</td><td>2.00×</td></tr><tr><td>NISP-56 (Yu et al., 2018)</td><td>N/A</td><td>-0.03%</td><td>1.77×</td></tr><tr><td>SFP (He et al., 2018a)</td><td>93.59%</td><td>+0.19%</td><td>1.70×</td></tr><tr><td>AMC (He et al., 2018b)</td><td>92.8%</td><td>-0.9%</td><td>2.00×</td></tr><tr><td>C-SGD-5/8 (Ding et al., 2019)</td><td>93.39%</td><td>+0.23%</td><td>2.55×</td></tr><tr><td>CNN-FCF-A (Li et al., 2019)</td><td>93.14%</td><td>+0.24%</td><td>1.75×</td></tr><tr><td>CNN-FCF-B (Li et al., 2019)</td><td>93.14%</td><td>-1.22%</td><td>3.44×</td></tr><tr><td>Group-HS 2e-4</td><td>93.14%</td><td>+0.44%</td><td>2.38×</td></tr><tr><td>Group-HS 2.5e-4</td><td>93.14%</td><td>+0.31%</td><td>3.07×</td></tr><tr><td>Group-HS 3e-4</td><td>93.14%</td><td>-0.24%</td><td>3.52×</td></tr><tr><td>Group-HS 5e-4</td><td>93.14%</td><td>-0.91%</td><td>5.63×</td></tr></table>
|
| 349 |
+
|
| 350 |
+
Table 10: Structural pruning result of the ResNet-110 model on CIFAR-10.
|
| 351 |
+
|
| 352 |
+
<table><tr><td>Model</td><td>Base acc</td><td>Acc gain</td><td>#FLOPs reduction</td></tr><tr><td>Pruning-A (Li et al.,2016)</td><td>93.53%</td><td>-0.02%</td><td>1.19×</td></tr><tr><td>Pruning-B (Li et al., 2016)</td><td>93.53%</td><td>-0.23%</td><td>1.62×</td></tr><tr><td>NISP-110 (Yu et al., 2018)</td><td>N/A</td><td>-0.18%</td><td>1.78×</td></tr><tr><td>SFP (He et al., 2018a)</td><td>93.68%</td><td>+0.18%</td><td>1.69×</td></tr><tr><td>C-SGD-5/8 (Ding et al., 2019)</td><td>94.38%</td><td>+0.03%</td><td>2.56×</td></tr><tr><td>CNN-FCF-A (Li et al., 2019)</td><td>93.58%</td><td>+0.09%</td><td>1.76×</td></tr><tr><td>CNN-FCF-B (Li et al., 2019)</td><td>93.58%</td><td>-0.62%</td><td>3.42×</td></tr><tr><td>Group-HS 7e-5</td><td>93.62%</td><td>+0.44%</td><td>2.30×</td></tr><tr><td>Group-HS 1e-4</td><td>93.62%</td><td>+0.18%</td><td>3.09×</td></tr><tr><td>Group-HS 1.5e-4</td><td>93.62%</td><td>-0.08%</td><td>4.38×</td></tr><tr><td>Group-HS 2e-4</td><td>93.62%</td><td>-0.65%</td><td>5.84×</td></tr></table>
|
md/train/rylejExC-/rylejExC-.md
ADDED
|
@@ -0,0 +1,581 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# STOCHASTIC TRAINING OF GRAPH CONVOLUTIONAL NETWORKS
|
| 2 |
+
|
| 3 |
+
Anonymous authors Paper under double-blind review
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
Graph convolutional networks (GCNs) are powerful deep neural networks for graph-structured data. However, GCN computes nodes’ representation recursively from their neighbors, making the receptive field size grow exponentially with the number of layers. Previous attempts on reducing the receptive field size by subsampling neighbors do not have any convergence guarantee, and their receptive field size per node is still in the order of hundreds. In this paper, we develop a preprocessing strategy and two control variate based algorithms to further reduce the receptive field size. Our algorithms are guaranteed to converge to GCN’s local optimum regardless of the neighbor sampling size. Empirical results show that our algorithms have a similar convergence speed per epoch with the exact algorithm even using only two neighbors per node. The time consumption of our algorithm on the Reddit dataset is only one fifth of previous neighbor sampling algorithms.
|
| 8 |
+
|
| 9 |
+
# 1 INTRODUCTION
|
| 10 |
+
|
| 11 |
+
Graph convolution networks (GCNs) (Kipf & Welling, 2017) generalize convolutional neural networks (CNNs) (LeCun et al., 1995) to graph structured data. The “graph convolution” operation applies same linear transformation to all the neighbors of a node, followed by mean pooling. By stacking multiple graph convolution layers, GCNs can learn nodes’ representation by utilizing information from distant neighbors. GCNs have been applied to semi-supervised node classification (Kipf & Welling, 2017), inductive node embedding (Hamilton et al., 2017a), link prediction (Kipf & Welling, 2016; Berg et al., 2017) and knowledge graphs (Schlichtkrull et al., 2017), outperforming multi-layer perceptron (MLP) models that do not use the graph structure and graph embedding approaches (Perozzi et al., 2014; Tang et al., 2015; Grover & Leskovec, 2016) that do not use node features.
|
| 12 |
+
|
| 13 |
+
However, the graph convolution operation makes it difficult to train GCN efficiently. A node’s representation at layer $L$ is computed recursively by all its neighbors’ representations at layer $L - 1$ . Therefore, the receptive field of a single node grows exponentially with respect to the number of layers, as illustrated in Fig. 1(a). Due to the large receptive field size, Kipf & Welling (2017) proposed training GCN by a batch algorithm, which computes the representation for all the nodes altogether. However, batch algorithms cannot handle large scale datasets because of their slow convergence and the requirement to fit the entire dataset in GPU memory.
|
| 14 |
+
|
| 15 |
+
Hamilton et al. (2017a) made an initial attempt on developing stochastic algorithms to train GCNs, which is referred as neighbor sampling (NS) in this paper. Instead of considering all the neighbors, they randomly subsample $D ^ { ( l ) }$ neighbors at the $l$ -th layer. Therefore, they reduce the receptive field size to $\Pi _ { l } \boldsymbol { D } ^ { ( l ) }$ , as shown in Fig. 1(b). They found that for two layer GCNs, keeping $D ^ { ( 1 ) } = 1 0$ and $D ^ { ( 2 ) } = 2 \dot { 5 }$ neighbors can achieve comparable performance with the original model. However, there is no theoretical guarantee on the predictive performance of the model learnt by NS comparing with the original algorithm. Moreover, the time complexity of NS is still $D ^ { ( 1 ) } D ^ { ( 2 ) } = 2 5 0$ times larger than training an MLP, which is unsatisfactory.
|
| 16 |
+
|
| 17 |
+
In this paper, we develop novel stochastic training algorithms for GCNs such that $D ^ { ( l ) }$ can be as low as two, so that the time complexity of training GCN is comparable with training MLPs. Our methods are built on two techniques. First, we propose a strategy which preprocesses the first graph convolution layer, so that we only need to consider all neighbors within $L - 1$ hops instead of $L$ hops. This is significant because most GCNs only have $L = 2$ layers (Kipf & Welling, 2017; Hamilton et al., 2017a). Second, we develop two control variate (CV) based stochastic training algorithms. We show that our CV-based algorithms have lower variance than NS, and for GCNs without dropout, our algorithm provably converges to a local optimum of the model regardless of $D ^ { ( l ) }$ .
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
Figure 1: Two-layer graph convolutional networks, and the receptive field of a single vertex.
|
| 21 |
+
|
| 22 |
+
We empirically test on six graph datasets, and show that our techniques significantly reduce the bias and variance of the gradient from NS with the same receptive field size. Our algorithm with $D ^ { ( l ) } = 2$ achieves the same predictive performance with the exact algorithm in comparable number of epochs on all the datasets, while the training time is 5 times shorter on our largest dataset.
|
| 23 |
+
|
| 24 |
+
# 2 BACKGROUNDS
|
| 25 |
+
|
| 26 |
+
We now briefly review graph convolutional networks (GCNs) (Kipf & Welling, 2017) and the neighbor sampling (NS) algorithm (Hamilton et al., 2017a).
|
| 27 |
+
|
| 28 |
+
# 2.1 GRAPH CONVOLUTIONAL NETWORKS
|
| 29 |
+
|
| 30 |
+
The original GCN was presented in a semi-supervised node classification task (Kipf & Welling, 2017). We follow this setting throughout this paper. Generalization of GCN to other tasks can be found in Kipf & Welling (2016); Berg et al. (2017); Schlichtkrull et al. (2017) and Hamilton et al. (2017b). In the node classification task, we have an undirected graph $\mathcal { G } = ( \nu , \mathcal { E } )$ with $V = | \nu |$ vertices and $E = | \mathcal { E } |$ edges, where each vertex $v$ consists of a feature vector $x _ { v }$ and a label $y _ { v }$ . The label is only observed for some vertices $\gamma _ { L }$ and we want to predict the label for the rest vertices $\mathcal { V } _ { U } : = \mathcal { V } \backslash \dot { \mathcal { V } } _ { L }$ . The edges are represented as a symmetric $V \times V$ adjacency matrix $A$ , where $A _ { v , v ^ { \prime } }$ is the weight of the edge between $v$ and $v ^ { \prime }$ , and the propagation matrix $P$ is a normalized version of $4 \colon \tilde { A } = A + I$ , $\begin{array} { r } { \tilde { D } _ { v v } = \sum _ { v ^ { \prime } } \tilde { A } _ { v v ^ { \prime } } } \end{array}$ , and $P = \tilde { D } ^ { - \frac { 1 } { 2 } } \tilde { A } \tilde { D } ^ { - \frac { 1 } { 2 } }$ . A graph convolution layer is defined as
|
| 31 |
+
|
| 32 |
+
$$
|
| 33 |
+
\tilde { H } ^ { ( l ) } = \mathrm { D r o p o u t } _ { p } ( H ^ { ( l ) } ) , \quad Z ^ { ( l + 1 ) } = P \tilde { H } ^ { ( l ) } W ^ { ( l ) } , \quad H ^ { ( l + 1 ) } = \sigma ( Z ^ { l + 1 } ) ,
|
| 34 |
+
$$
|
| 35 |
+
|
| 36 |
+
where $H ^ { ( l ) }$ is the activation matrix in the $l$ -th layer, whose each row is the activation of a graph node. $H ^ { ( 0 ) } = X$ is the input feature matrix, $W ^ { ( l ) }$ is a trainable weight matrix, $\sigma ( \cdot )$ is an activation function, and Dropou $_ p ( \cdot )$ is the dropout operation (Srivastava et al., 2014) with keep probability $p$ . Finally, the loss is defined as $\begin{array} { r } { \mathcal { L } = \frac { 1 } { | \mathcal { V } _ { L } | } \sum _ { v \in \mathcal { V } _ { L } } f ( y _ { v } , Z _ { v } ^ { ( L ) } ) } \end{array}$ , where $f ( \cdot , \cdot )$ can be the square loss, cross entropy loss, etc., depending on the type of the label.
|
| 37 |
+
|
| 38 |
+
When $P = I$ , GCN reduces to a multi-layer perceptron (MLP) model which does not use the graph structure. Comparing with MLP, GCN is able to utilize neighbor information for node classification. We define $\mathbf { n } ( v , L )$ as the set of all the $L$ -neighbors of node $v$ , i.e., the nodes that are reachable from $v$ within $L$ hops. It is easy to see from Fig. 1(a) that in an $L$ -layer GCN, a node uses the information from all its $L$ -neighbors. This makes GCN more powerful than MLP, but also complicates the stochastic training, which utilizes an approximated gradient $\begin{array} { r } { \nabla \mathcal { L } \approx \frac { 1 } { | \mathcal { V } _ { B } | } \sum _ { v \in \mathcal { V } _ { B } } \nabla f ( y _ { v } , Z _ { v } ^ { ( L ) } ) } \end{array}$ where $\gamma _ { B } \subset \gamma _ { L }$ is a minibatch of training data. The large receptive field size $| \cup _ { v \in \mathcal { V } _ { B } } \mathbf { n } ( v , L ) |$ per minibatch leads to high time complexity, space complexity and amount of IO. See Table 1 for the average number of 1- and 2-neighbors of our datasets.
|
| 39 |
+
|
| 40 |
+
# 2.2 ALTERNATIVE NOTATION
|
| 41 |
+
|
| 42 |
+
We introduce alternative notations to help compare different algorithms. Let $U ^ { ( l ) } = { \cal P } \tilde { \cal H } ^ { ( l ) }$ , or $\begin{array} { r } { u _ { v } ^ { ( l ) } = \sum _ { v ^ { \prime } \in { \bf n } ( v , 1 ) } P _ { v , v ^ { \prime } } \tilde { h } _ { v ^ { \prime } } ^ { ( l ) } } \end{array}$ , we focus on studying how $u _ { v }$ is computed based on node $v$ ’s neighbors. To keep notations simple, we omit all the subscripts and tildes, and exchange the $\mathrm { I D }$ of nodes such
|
| 43 |
+
|
| 44 |
+
<table><tr><td>Dataset</td><td>V</td><td>E</td><td>Degree</td><td>Degree 2</td><td>Type</td></tr><tr><td>Citeseer</td><td>3,327</td><td>12,431</td><td>4</td><td>15</td><td>Document network</td></tr><tr><td>Cora</td><td>2,708</td><td>13,264</td><td>5</td><td>37</td><td>Document network</td></tr><tr><td>PubMed</td><td>19,717</td><td>108,365</td><td>6</td><td>60</td><td>Document network</td></tr><tr><td>NELL</td><td>65,755</td><td>318,135</td><td>5</td><td>1,597</td><td>Knowledge graph</td></tr><tr><td>PPI</td><td>14,755</td><td>458,973</td><td>31</td><td>970</td><td>Protein-protein interaction</td></tr><tr><td>Reddit</td><td>232,965</td><td>23,446,803</td><td>101</td><td>10,858</td><td>Document network</td></tr></table>
|
| 45 |
+
|
| 46 |
+
Table 1: Number of vertexes, edges, average number of 1- and 2-neighbors per node for each dataset. Undirected edges are counted twice and self-loops are counted once. Reddit is already subsampled to have a max degree of 128 following Hamilton et al. (2017a).
|
| 47 |
+
|
| 48 |
+
that $\mathbf { n } ( v , 1 ) = [ D ] _ { + }$ , 1 where $D = | \mathbf n ( v , 1 ) |$ is the number of neighbors. We get the propagation rule $\begin{array} { r } { u = \sum _ { v = 1 } ^ { D } p _ { v } h _ { v } } \end{array}$ , which is used interchangeably with the matrix form $U ^ { ( l ) } = P \tilde { H } ^ { ( l ) }$ .
|
| 49 |
+
|
| 50 |
+
# 2.3 NEIGHBOR SAMPLING
|
| 51 |
+
|
| 52 |
+
To reduce the receptive field size, Hamilton et al. (2017a) propose a neighbor sampling (NS) algorithm. On the $l$ -th layer, they randomly choose $D ^ { ( l ) }$ neighbors for each node, and develop an estimator $u _ { N S }$ of $u$ based on Monte-Carlo approximation $\begin{array} { r } { \dot { \boldsymbol { u } } \approx \boldsymbol { u } _ { N S } = \frac { D } { D ^ { ( l ) } } \sum _ { \boldsymbol { v } \in \mathbf { D } ^ { ( l ) } } p _ { \boldsymbol { v } } \boldsymbol { h } _ { \boldsymbol { v } } } \end{array}$ , where $\mathbf { D } ^ { ( l ) } \subset [ D ] _ { + }$ is a subset of $D ^ { ( l ) }$ neighbors. In this way, they reduce the receptive field size from $| \cup _ { v \in \mathcal { V } _ { B } } \mathbf { n } ( v , L ) |$ to $O ( | \mathcal { V } _ { B } | \prod _ { l = 1 } ^ { L } D ^ { ( l ) } )$ . Neighbor sampling can also be written in a matrix form as
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\tilde { H } _ { N S } ^ { ( l ) } = \mathrm { D r o p o u t } _ { p } ( H _ { N S } ^ { ( l ) } ) , \quad Z _ { N S } ^ { ( l + 1 ) } = \hat { P } ^ { ( l ) } \tilde { H } _ { N S } ^ { ( l ) } W ^ { ( l ) } , \quad H _ { N S } ^ { ( l + 1 ) } = \sigma ( Z _ { N S } ^ { ( l + 1 ) } ) ,
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where ${ \hat { P } } ^ { ( l ) }$ is a sparser unbiased estimator of $P$ , i.e., $\mathbb { E } \hat { P } ^ { ( l ) } = P$ . The approximate prediction $Z _ { N S } ^ { ( L ) }$ used for testing and for computing stochastic gradient $\begin{array} { r } { \frac { 1 } { | \mathcal { V } _ { B } | } \sum _ { v \in \mathcal { V } _ { B } } \nabla f ( y _ { v } , Z _ { C V , v } ^ { ( L ) } ) } \end{array}$ during training.
|
| 59 |
+
|
| 60 |
+
The NS estimator $u _ { N S }$ is unbiased. However it has a large variance, which leads to biased prediction and gradients after the non-linearity in subsequent layers. Due to the biased gradients, training with NS does not converge to the local optimum of GCN. When $D ^ { ( l ) }$ is moderate, NS may has some regularization effect like dropout (Srivastava et al., 2014), where it drops neighbors instead of features. However, for the extreme ease $D ^ { ( l ) } = 2$ , the neighbor dropout rate is too high to reach high predictive performance, as we will see in Sec. 5.4. Intuitively, making prediction solely depends on one neighbor is inferior to using all the neighbors. To keep comparable prediction performance with the original GCN, Hamilton et al. (2017a) use relatively large $D ^ { ( 1 ) } = 1 0$ and $\bar { D } ^ { ( 2 ) } = 2 5$ . Their receptive field size $D ^ { ( 1 ) } \times D ^ { ( 2 ) } = 2 5 0$ is still much larger than MLP, which is 1.
|
| 61 |
+
|
| 62 |
+
# 3 PREPROCESSING FIRST LAYER
|
| 63 |
+
|
| 64 |
+
We first present a technique to preprocess the first graph convolution layer, by approximating $A { \mathrm { D r o p o u t } } _ { p } ( X )$ with Dropout $_ p ( A X )$ . The model becomes
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
Z ^ { ( l + 1 ) } = \mathrm { D r o p o u t } _ { p } ( P H ^ { ( l ) } ) W ^ { ( l ) } , \quad H ^ { ( l + 1 ) } = \sigma ( Z ^ { l + 1 } ) .
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
This approximation does not change the expectation because $\begin{array} { r l } { \mathbb { E } \left[ A \mathrm { D r o p o u t } _ { p } ( X ) \right] } & { { } = } \end{array}$ $\mathbb { E } \left[ \operatorname { D r o p o u t } _ { p } ( A X ) \right]$ , and it does not affect the predictive performance, as we shall see in Sec. 5.1.
|
| 71 |
+
|
| 72 |
+
The advantage of this modification is that we can preprocess $U ^ { ( 0 ) } = { \cal P } H ^ { ( 0 ) } = { \cal P } X$ and takes $U ^ { ( 0 ) }$ as the new input. In this way, the actual number of graph convolution layers is reduced by one — the first layer is merely a fully connected layer instead of a graph convolution one. Since most GCNs only have two graph convolution layers (Kipf & Welling, 2017; Hamilton et al., 2017a), this gives a significant reduction of the receptive field size from the number of $L$ -neighbors $| \cup _ { v \in \mathcal { V } _ { B } } \mathbf { n } ( v , L ) |$ to the number of $L - 1$ -neighbors $\vert \cup _ { v \in \mathcal { V } _ { B } } \mathbf { n } ( v , L - 1 ) \vert$ . The numbers are reported in Table 1.
|
| 73 |
+
|
| 74 |
+
# 4 CONTROL VARIATE BASED STOCHASTIC APPROXIMATION
|
| 75 |
+
|
| 76 |
+
We now present two novel control variate based estimators that have smaller variance as well as stronger theoretical guarantees than NS.
|
| 77 |
+
|
| 78 |
+
We assume that the model does not have dropout for now and will address dropout in Sec. 4.2. The idea is that we can approximate $\begin{array} { r } { u = \sum _ { v = 1 } ^ { D } p _ { v } h _ { v } } \end{array}$ better if we know the latest historical activations $\bar { h } _ { v }$ of the neighbors, where we expect $\bar { h } _ { v }$ and $h _ { v }$ are similar if the model weights do not change too fast during the training. With the historical activations, we approximate
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
u = \sum _ { v = 1 } ^ { D } p _ { v } h _ { v } = \sum _ { v = 1 } ^ { D } p _ { v } ( h _ { v } - \bar { h } _ { v } ) + \sum _ { v = 1 } ^ { D } p _ { v } \bar { h } _ { v } \approx D p _ { v ^ { \prime } } \Delta h _ { v ^ { \prime } } + \sum _ { v = 1 } ^ { D } p _ { v } \bar { h } _ { v } : = u _ { C V } ,
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
where $v ^ { \prime }$ is a random neighbor, and $\Delta h _ { v ^ { \prime } } = h _ { v ^ { \prime } } - \bar { h } _ { v ^ { \prime } }$ . For the ease of presentation, we assume that we only use the latest activation of one neighbor, while the implementation also include the node itself besides the random neighbor, so $D ^ { ( l ) } = 2$ . Using historical activations is cheap because they need not to be computed recursively using their neighbors’ activations, as shown in Fig. 1(c). Unlike NS, we apply Monte-Carlo approximation on $\begin{array} { r } { \sum _ { v } p _ { v } \Delta h _ { v } } \end{array}$ instead of $\sum _ { v } p _ { v } h _ { v }$ . Since we expect $h _ { v }$ and $\bar { h } _ { v }$ to be close, $\Delta h _ { v }$ will be small and $u _ { C V }$ should have a smaller variance than $u _ { N S }$ . Particularly, if the model weight is kept fixed, $\bar { h } _ { v }$ should be eventually equal with $h _ { v }$ , so that $\begin{array} { r } { u _ { C V } = 0 + \sum _ { v = 1 } ^ { D } p _ { v } \bar { h } _ { v } = \sum _ { v = 1 } ^ { D } p _ { v } h _ { v } = u } \end{array}$ , i.e., the estimator has zero variance. The term ontrol variate (Ripley, 2009, Chapter 5), which h $C V =$ $u _ { C V } - u _ { N S } = - D p _ { v ^ { \prime } } \bar { h } _ { v ^ { \prime } } + \sum _ { v = 1 } ^ { D } p _ { v } \bar { h } _ { v }$
|
| 85 |
+
$u _ { N S }$
|
| 86 |
+
algorithm as CV, and we will formally analyze the variance and prove the convergence of the training algorithm using CV for stochastic gradient in subsequent sections.
|
| 87 |
+
|
| 88 |
+
In matrix form, CV computes the approximate predictions as follows, where we explicitly write down the iteration number $_ i$ and add the subscript $C V$ to the approximate activations 2
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\begin{array} { r l } & { Z _ { C V , i } ^ { ( l + 1 ) } \gets \left( \hat { P } _ { i } ^ { ( l ) } ( H _ { C V , i } ^ { ( l ) } - \bar { H } _ { C V , i } ^ { ( l ) } ) + P \bar { H } _ { C V , i } ^ { ( l ) } \right) W _ { i } ^ { ( l ) } , } \\ & { H _ { C V , i } ^ { ( l + 1 ) } \gets \sigma ( Z _ { C V , i } ^ { ( l + 1 ) } ) , \quad \bar { H } _ { C V , i + 1 } ^ { ( l ) } \gets \mathbf { m } _ { i } ^ { ( l ) } H _ { C V , i } ^ { ( l ) } + ( 1 - \mathbf { m } _ { i } ^ { ( l ) } ) \bar { H } _ { C V , i } ^ { ( l ) } , } \end{array}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where h¯(l)CV,i,v s tores the latest activation of node $v$ on layer $l$ computed before time $i$ . Formally, let $\mathbf { m } _ { i } ^ { ( l ) } \in \mathbb { R } ^ { V \times V }$ be a diagonal matrix, and $( m _ { i } ^ { ( l ) } ) _ { v v } = 1$ if $( \hat { P } _ { i } ^ { ( l ) } ) _ { v ^ { \prime } v } > 0$ for any $v ^ { \prime }$ . After finishing one iteration we update history $\bar { H }$ with the activations computed in that iteration as Eq. (6).
|
| 95 |
+
|
| 96 |
+
# 4.2 CONTROL VARIATE FOR DROPOUT
|
| 97 |
+
|
| 98 |
+
With dropout, the activations $H$ are no longer deterministic. They become random variables whose randomness come from different dropout configurations. Therefore, $\Delta h _ { v } = h _ { v } - \bar { h } _ { v }$ is not necessarily small even if $h _ { v }$ and $\bar { h } _ { v }$ have the same distribution. We develop another stochastic approximation algorithm, control variate for dropout (CVD), that works well with dropout.
|
| 99 |
+
|
| 100 |
+
Our method is based on the weight scaling procedure (Srivastava et al., 2014) to approximately compute the mean $\mu _ { v } : = \mathbb { E } \left[ h _ { v } \right]$ . That is, along with the dropout model, we can run a copy of the model with no dropout to obtain the mean $\mu _ { v }$ , as illustrated in Fig. 1(d). With the mean, we can obtain a better stochastic approximation by separating the mean and variance
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\iota = \sum _ { v = 1 } ^ { D } p _ { v } \left[ \left( h _ { v } - \mu _ { v } \right) + \left( \mu _ { v } - \bar { \mu } _ { v } \right) + \bar { \mu } _ { v } \right] \approx \sqrt { D } p _ { v ^ { \prime } } \left( h _ { v ^ { \prime } } - \mu _ { v ^ { \prime } } \right) + D p _ { v ^ { \prime } } \Delta \mu _ { v ^ { \prime } } + \sum _ { v = 1 } ^ { D } p _ { v } \bar { \mu } _ { v } : = u _ { C V D } ,
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where $\bar { \mu } _ { v }$ is the historical mean activation, obtained by storing√ $\mu _ { v }$ instead of $h _ { v }$ , and $\Delta \mu = \mu _ { v } - \bar { \mu } _ { v }$ . $u _ { C V D }$ an unbiased estimator of $u$ because the term $\sqrt { D } p _ { v ^ { \prime } } ( h _ { v ^ { \prime } } - \mu _ { v ^ { \prime } } )$ has zero mean, and the Monte-Carlo approximation $\begin{array} { r } { \sum _ { v = 1 } ^ { D } p _ { v } ( \mu _ { v } - \bar { \mu } _ { v } ) \approx D p _ { v ^ { \prime } } \Delta \mu _ { v ^ { \prime } } } \end{array}$ does not change the mean. The approximation $\begin{array} { r } { \sum _ { v = 1 } ^ { D } p _ { v } ( h _ { v } - \mu _ { v } ) \approx \sqrt { D } p _ { v ^ { \prime } } ( h _ { v ^ { \prime } } - \mu _ { v ^ { \prime } } ) } \end{array}$ is made by assuming $h _ { v }$ ’s to be independent Gaussians, which we will soon clarify. The pseudocodes for CV and CVD are in Appendix E.
|
| 107 |
+
|
| 108 |
+
# 4.3 VARIANCE ANALYSIS
|
| 109 |
+
|
| 110 |
+
NS, CV and CVD are all unbiased estimators of $\begin{array} { r } { u = \sum _ { v } p _ { v } h _ { v } } \end{array}$ . We analyze their variance in a simple independent Gaussian case, where we assume that activations are Gaussian random variables $h _ { v } \sim \mathcal N ( \mu _ { v } , s _ { v } ^ { 2 } )$ following Wang & Manning (2013). Without loss of generality, we assume that all the activations $h _ { v }$ are one dimensional. We also assume that all the activations $h _ { 1 } , \ldots , h _ { D }$ and historical activations $\bar { h } _ { 1 } , \dotsc , \bar { h } _ { D }$ are independent, where the historical activations $\bar { h } _ { v } \sim \mathcal N ( \bar { \mu } _ { v } , \bar { s } _ { v } ^ { 2 } )$ .
|
| 111 |
+
|
| 112 |
+
<table><tr><td>Alg.</td><td>Estimator</td><td>Var. from MC.approx.</td><td>Var. from dropout</td></tr><tr><td>Exact</td><td>u=∑puhu</td><td>0</td><td>s2</td></tr><tr><td>NS</td><td>uNs = Dpu'hv'</td><td>∑u,v(Puμv - Pu'μ)²</td><td>Ds²</td></tr><tr><td>CV</td><td>ucv =Dpu△hv'+∑,Pvhv</td><td>∑v,v(Pu△μu-Pu△μ')²</td><td>Ds² +(D -1)s²</td></tr><tr><td>CVD</td><td>uCvD = √Dpu'(hv'-μu') +Dpu△μu'+∑,Pup</td><td>1∑u,v'(Pu△μu - Pu△μ')²</td><td>s2</td></tr></table>
|
| 113 |
+
|
| 114 |
+
Table 2: Variance of different algorithms in the independent Gaussian case.
|
| 115 |
+
|
| 116 |
+
We introduce a few more notations. $\Delta \mu _ { v }$ and $\Delta s _ { v } ^ { 2 }$ are the mean and variance of $\Delta h _ { v } = h _ { v } - \bar { h } _ { v }$ , where $\Delta \mu _ { v } = \mu _ { v } - \bar { \mu } _ { v }$ and $\Delta s _ { v } ^ { 2 } = s _ { v } ^ { 2 } + \bar { s } _ { v } ^ { 2 }$ . $\mu$ and $s ^ { 2 }$ are the mean and variance of $\textstyle \sum _ { v } p _ { v } h _ { v }$ , where $\begin{array} { r } { \mu = \sum _ { v } p _ { v } \mu _ { v } } \end{array}$ and $\begin{array} { r } { s ^ { 2 } = \sum _ { v } p _ { v } ^ { 2 } s _ { v } ^ { 2 } } \end{array}$ . Similarly, $\Delta \mu , \Delta s ^ { 2 }$ , $\bar { \mu }$ and $\bar { s } ^ { 2 }$ are the mean and variance of $\begin{array} { r } { \sum _ { v } p _ { v } \Delta h _ { v } } \end{array}$ and $\begin{array} { r } { \sum _ { v } p _ { v } \bar { h } _ { v } } \end{array}$ , respectively.
|
| 117 |
+
|
| 118 |
+
With these assumptions and notations, we list the estimators and variances in Table 2, where the derivations can be found in Appendix C. We decompose the variance as two terms: variance from Monte-Carlo approximation (VMCA) and variance from dropout (VD).
|
| 119 |
+
|
| 120 |
+
If the model has no dropout, the activations have zero variance, i.e., $s _ { v } = \bar { s } _ { v } = 0$ , and the only source of variance is VMCA. We want VMCA to be small. As in Table 2, the VMCA for the exact estimator is 0. For the NS estimator, VMCA is $\begin{array} { r } { \frac { 1 } { 2 } \sum _ { v , v ^ { \prime } } ( p _ { v } \mu _ { v } - p _ { v ^ { \prime } } \mu _ { v ^ { \prime } } ) ^ { 2 } } \end{array}$ , whose magnitude depends on the pairwise difference $( p _ { v } \mu _ { v } - p _ { v ^ { \prime } } \mu _ { v ^ { \prime } } ) ^ { 2 }$ , and VMCA is zero if and only if $p _ { v } \mu _ { v } = p _ { v ^ { \prime } } \mu _ { v ^ { \prime } }$ for all $v , v ^ { \prime }$ . Similarly, VMCA for both CV and CVD estimators is $\begin{array} { r } { \frac { 1 } { 2 } \sum _ { v , v ^ { \prime } } ( p _ { v } \Delta \mu _ { v } - p _ { v ^ { \prime } } \Delta \bar { \mu } _ { v ^ { \prime } } ) ^ { 2 } } \end{array}$ , which should be smaller than NS estimator’s VMCA if $( p _ { v } \Delta \mu _ { v } - p _ { v ^ { \prime } } \Delta \mu _ { v ^ { \prime } } ) ^ { 2 } < ( p _ { v } \mu _ { v } - p _ { v ^ { \prime } } \mu _ { v ^ { \prime } } ) ^ { 2 }$ , which is likely because $\Delta \mu _ { v }$ should be smaller than $\mu _ { v }$ . Since CV and CVD estimators have the same VMCA, we adopt the CV estimator for models without dropout, due to its simplicity.
|
| 121 |
+
|
| 122 |
+
The VD of the exact estimator is $s ^ { 2 }$ , which is overestimated by both NS and CV. NS overestimates VD by $D$ times, and CV has even larger VD. Meanwhile, the VD of the CVD estimator is the same as the exact estimator, indicating CVD to be the best estimator for models with dropout.
|
| 123 |
+
|
| 124 |
+
# 4.4 EXACT TESTING
|
| 125 |
+
|
| 126 |
+
Besides smaller variance, CV also has stronger theoretical guarantees than NS. We can show that during testing, CV’s prediction becomes exact after a few testing epochs. For models without dropout, we can further show that training using the stochastic gradients obtained by CV converges to GCN’s local optimum. We present these results in this section and Sec. 4.5. Note that the analysis does not need the independent Gaussian assumption.
|
| 127 |
+
|
| 128 |
+
Given a model $W$ , we compare the exact predictions (Eq. 1) and CV’s approximate predictions (Eq. 5,6) during testing, which uses the deterministic weight scaling procedure. To make predictions, we run forward propagation by epochs. In each epoch, we randomly partition the vertex set $\nu$ as $I$ minibatches $\mathcal { V } _ { 1 } , \ldots , \mathcal { V } _ { I }$ and in the $i$ -th iteration, we run a forward pass to compute the prediction for nodes in $\nu _ { i }$ . Note that in each epoch we scan all the nodes instead of just testing nodes, to ensure that the activation of each node is computed at least once per epoch. The following theorem reveals the connection of the exact predictions and gradients, and their approximate versions by CV.
|
| 129 |
+
|
| 130 |
+
computed by CV are exact, i.e., (2) (Unbiased Gradient) The st Theorem 1. For a fixed $W$ and any $Z _ { C V , i } ^ { ( l ) } = Z ^ { ( l ) }$ $\textit { i } > \textit { L I }$ forient we have: $l \in [ L ]$ $( l )$ (Exact Prediction) The activations $H _ { C V , i } ^ { ( l ) } = H ^ { ( l ) }$ $l \in [ L - 1 ]$ $\begin{array} { r } { g _ { C V , i } ( W ) : = \frac { 1 } { | \mathcal V _ { B } | } \sum _ { v \in \mathcal V _ { B } } \nabla _ { W } f ( y _ { v } , z _ { C V , i , v } ^ { ( L ) } ) } \end{array}$ unbiased estimator of GCN’s gradient, i.e., $\begin{array} { r } { \mathbb E _ { \hat { P } , \mathcal V _ { B } } g _ { C V , i } ( W ) = \nabla _ { W } \frac 1 { | V | } \sum _ { v \in \mathcal V } f ( y _ { v } , z _ { v } ^ { ( L ) } ) } \end{array}$ .
|
| 131 |
+
|
| 132 |
+
Theorem 1 shows that at testing time, we can run forward propagation with CV for $L$ epoches and get the exact prediction. This outperforms NS, which cannot recover the exact prediction. Comparing with directly making exact predictions by a batch algorithm, CV is more scalable because it does not need to load the entire graph into memory. The proof can be found in Appendix A.
|
| 133 |
+
|
| 134 |
+
# 4.5 CONVERGENCE GUARANTEE
|
| 135 |
+
|
| 136 |
+
The following theorem shows that for a model without dropout, training using CV’s approximated gradients converges to a local optimum of GCN, regardless of the neighbor sampling size $D ^ { ( l ) }$ . Therefore, we can choose arbitrarily small $D ^ { ( l ) }$ without worrying about the convergence.
|
| 137 |
+
|
| 138 |
+
Theorem 2. Assume that $( l )$ all the activations are $\rho$ -Lipschitz, (2) the gradient of the cost function $\nabla _ { z } f ( y , z )$ is $\rho$ -Lipschitz and bounded, (3) $\| g _ { C V } ( W ) \| _ { \infty }$ and $\| g ( W ) \| _ { \infty } = \| \nabla \mathcal { L } ( W ) \| _ { \infty }$ are bounded by $G \ > \ 0$ for all $\hat { P } , \mathcal { V } _ { B }$ and $W$ . (4) The loss $\mathcal { L } ( W )$ is $\rho$ -smooth, i.e., $| { \mathcal { L } } ( W _ { 2 } ) ~ -$ $\begin{array} { r } { \mathcal L ( W _ { 1 } ) - \langle \nabla L ( W _ { 1 } ) , W _ { 2 } - W _ { 1 } \rangle | \leq \frac { \rho } { 2 } \left\| W _ { 2 } - W _ { 1 } \right\| ^ { 2 } \forall W _ { 1 } , W _ { 2 } } \end{array}$ , where $\langle A , B \rangle = t r ( A ^ { \top } B )$ is the inner product of matrix $A$ and matrix $B$ . We randomly run SGD for $R \leq N$ iterations, where $\begin{array} { r } { P _ { R } ( \bar { R \ } = \ i ) = \frac { 2 \gamma _ { i } - \rho \gamma _ { i } ^ { 2 } } { \sum _ { i = 1 } ^ { N } ( 2 \gamma _ { i } - \rho \gamma _ { i } ^ { 2 } ) } } \end{array}$ . Then, for the updates $W _ { i + 1 } = W _ { i } - \gamma _ { i } g _ { C V } ( W _ { i } )$ and step sizes $\begin{array} { r } { \gamma _ { i } = \operatorname* { m i n } \{ \frac { 1 } { \rho } , \frac { 1 } { \sqrt { N } } \} } \end{array}$ , there exists constants $K _ { 1 }$ and $K _ { 2 }$ which are irrelevant with $N$ , s.t. $\forall N > L I$ ,
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\mathbb { E } _ { R \sim P _ { R } } \mathbb { E } _ { \hat { P } , \nu _ { B } } \left\| \nabla \mathcal { L } ( W _ { R } ) \right\| ^ { 2 } \leq \frac { 2 \rho ( \mathcal { L } ( W _ { 1 } ) - \mathcal { L } ( W ^ { * } ) ) + K _ { 2 } } { N } + \frac { 2 ( \mathcal { L } ( W _ { 1 } ) - \mathcal { L } ( W ^ { * } ) ) + K _ { 1 } } { \sqrt { N } } .
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
The proof can be found in Appendix B. Particularly, $\begin{array} { r } { \operatorname* { l i m } _ { N \to \infty } \mathbb { E } _ { R \sim P _ { R } } \mathbb { E } _ { \hat { P } , \mathcal { V } _ { B } } \left\| \nabla \mathcal { L } ( W _ { R } ) \right\| ^ { 2 } = 0 . } \end{array}$ Therefore, our algorithm converges to a local optimum.
|
| 145 |
+
|
| 146 |
+
# 4.6 TIME COMPLEXITY AND IMPLEMENTATION DETAILS
|
| 147 |
+
|
| 148 |
+
Finally we discuss the time complexity of different algorithms. We decompose the time complexity as sparse time complexity for sparse-dense matrix multiplication such as $P \tilde { H } ^ { ( l ) }$ , and dense time complexity for dense-dense matrix multiplication such as $U ^ { ( l ) } W ^ { ( l ) }$ . Assume that the node feature is $K$ -dimensional and the first hidden layer is $A$ -dimensional, the batch GCN has $O ( E K )$ sparse and $O ( V K A )$ dense time complexity per epoch. NS has $O ( V \prod _ { l = 1 } ^ { L } D ^ { ( l ) } K )$ sparse and $O ( V \prod _ { l = 2 } ^ { L } D ^ { ( l ) } K A )$ dense time complexity per epoch. The dense time complexity of CV is the same as NS. The sparse time complexity depends on the cost of computing the sum $\sum _ { v } p _ { v } \bar { \mu } _ { v }$ . There are $V \prod _ { l = 2 } ^ { L } D ^ { ( l ) }$ such sums to compute on the first graph convolution layer, and overall cost is not larger than ${ \mathrm { \bar { \cal O } } } ( V D \prod _ { l = 2 } ^ { L } D ^ { ( l ) } K )$ , if we subsample the graph such that the max degree is $D$ , following Hamilton et al. (2017a). The sparse time complexity is $D / D ^ { ( 1 ) }$ times higher than NS.
|
| 149 |
+
|
| 150 |
+
Our implementation is similar as Kipf & Welling (2017). We store the node features in the main memory, without assuming that they fit in GPU memory as Hamilton et al. (2017a), which makes our implementation about 2 times slower than theirs. We keep the histories in GPU memory for efficiency since they are only $L H < K$ dimensional.
|
| 151 |
+
|
| 152 |
+
# 5 EXPERIMENTS
|
| 153 |
+
|
| 154 |
+
We examine the variance and convergence of our algorithms empirically on six datasets, including Citeseer, Cora, PubMed and NELL from Kipf & Welling (2017) and Reddit, PPI from Hamilton et al. (2017a), as summarized in Table 1. To measure the predictive performance, we report Micro-F1 for the multi-label PPI dataset, and accuracy for all the other multi-class datasets. We use the same model architectures with previous papers but slightly different hyperparameters (see Appendix D for the details). We repeat the convergence experiments 10 times on Citeseer, Cora, PubMed and NELL, and 5 times on Reddit and PPI. The experiments are done on a Titan X (Maxwell) GPU.
|
| 155 |
+
|
| 156 |
+
# 5.1 IMPACT OF PREPROCESSING
|
| 157 |
+
|
| 158 |
+
We first examine the approximation in Sec. 3 that switches the order of dropout and aggregating the neighbors. Let M0 be the original model (Eq. 1) and M1 be our approximated model (Eq. 3), we compare three settings: (1) M0, $D ^ { ( l ) } = \infty$ is the exact algorithm without any neighbor sampling. (2) $\mathbf { M } 1 { + } \mathbf { P } \mathbf { P } ,$ , $D ^ { ( l ) } = \infty$ changes the model from M0 to M1. Preprocessing does not affect the training for $D ^ { ( l ) } = \infty$ . (3) $\mathbf { M } 1 { + } \mathbf { P } \mathbf { P }$ , $\mathbf { \bar { \rho } } D ^ { ( l ) } = 2 0$ uses NS with a relatively large number of neighbors. In Table 3 we can see that all the three settings performs similarly, i.e., our approximation does not affect the predictive performance. Therefore, we use $\mathbf { M } 1 { + } \mathrm { P P }$ , $D ^ { ( l ) } = 2 0 $ as the exact baseline in following convergence experiments because it is the fastest among these three settings.
|
| 159 |
+
|
| 160 |
+
<table><tr><td>Algorithm Epochs</td><td>Citeseer 200</td><td>Cora 200</td><td>PubMed 200</td><td>NELL 200</td><td>PPI 500</td><td>Reddit 10</td></tr><tr><td>M0,D() =8</td><td>70.8±.1</td><td>81.7±.5</td><td>79.0±.4</td><td>-</td><td>97.9± .04</td><td>96.2± .04</td></tr><tr><td>M1+PP, D() =8</td><td>70.9 ± .2</td><td>82.0±.8</td><td>78.7± .3</td><td>64.9 ± 1.7</td><td>97.8± .05</td><td>96.3± .07</td></tr><tr><td>M1+PP,D() = 20</td><td>70.9 ± .2</td><td>81.9± .7</td><td>78.9± .5</td><td>64.2 ± 4.6</td><td>97.6± .09</td><td>96.3± .04</td></tr></table>
|
| 161 |
+
|
| 162 |
+
Table 3: Testing accuracy of different algorithms and models after fixed number of epochs. Our implementation does not support M0, $D ^ { ( l ) } = \infty$ on NELL so the result is not reported
|
| 163 |
+
|
| 164 |
+

|
| 165 |
+
Figure 2: Comparison of training loss with respect to number of epochs without dropout. The $\mathrm { C V + P P }$ curve overlaps with the Exact curve in the first four datasets.
|
| 166 |
+
|
| 167 |
+
# 5.2 CONVERGENCE WITH NO DROPOUT
|
| 168 |
+
|
| 169 |
+
We now study how fast our algorithms converge with a very small neighbor sampling size $D ^ { ( l ) } = 2$ . We compare the following algorithms: (1) Exact, which is $\mathbf { M } 1 { + } \mathrm { P P }$ , $D ^ { ( l ) } = \mathsf { \bar { 2 0 } }$ in Sec. 5.1 as a surrogate of the exact algorithm. (2) NS, which is the NS algorithm with no preprocessing and $D ^ { ( l ) } = 2$ . (3) ${ \mathrm { N S } } { \mathrm { + P P } }$ , which is same with NS but uses preprocessing. (4) $\mathrm { C V + P P } ,$ which replaces the NS estimator in ${ \mathrm { N S } } { \mathrm { + P P } }$ with the CV estimator. (5) $\mathrm { C V D + P P }$ which uses the CVD estimator.
|
| 170 |
+
|
| 171 |
+
We first validate Theorem 2, which states that $\mathrm { C V + P P }$ converges to a local optimum of Exact, for models without dropout, regardless of $D ^ { ( l ) }$ . We disable dropout and plot the training loss with respect to number of epochs as Fig. 2. We can see that $\mathrm { C V + P P }$ can always reach the same training loss with Exact, which matches the conclusion of Theorem 2. Meanwhile, NS and ${ \mathrm { N S } } { \mathrm { + P P } }$ have a higher training loss because their gradients are biased.
|
| 172 |
+
|
| 173 |
+
# 5.3 CONVERGENCE WITH DROPOUT
|
| 174 |
+
|
| 175 |
+
Next, we compare the predictive accuracy obtained by the model trained by different algorithms, with dropout turned on. We use different algorithms for training and the same Exact algorithm for testing, and report the validation accuracy at each training epoch. The result is shown in Fig. 3. We find that $\mathrm { C V D + P P }$ is the only algorithm that is able to reach comparable validation accuracy with Exact on all datasets. Furthermore, its convergence speed with respect to the number of epochs is comparable with Exact despite its $D ^ { ( l ) }$ is 10 times smaller. Note that $\mathrm { C V D + P P }$ performs much better than Exact on the PubMed dataset; we suspect it finds a better local optimum.
|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
Figure 3: Comparison of validation accuracy with respect to number of epochs. NS converges to 0.94 on the Reddit dataset and 0.6 on the PPI dataset.
|
| 179 |
+
|
| 180 |
+
Table 4: Time complexity comparison of different algorithms on the Reddit dataset.
|
| 181 |
+
|
| 182 |
+
<table><tr><td>Alg.</td><td>Valid. acc.</td><td>Epochs</td><td>Time (s)</td><td>Sparse GFLOP</td><td>Dense TFLOP</td></tr><tr><td>Exact</td><td>96.0</td><td>4.2</td><td>252</td><td>507</td><td>7.17</td></tr><tr><td>NS</td><td>94.4</td><td>102.0</td><td>577</td><td>76.5</td><td>21.4</td></tr><tr><td>NS+PP</td><td>96.0</td><td>35.0</td><td>195</td><td>2.53</td><td>7.36</td></tr><tr><td>CV+PP</td><td>96.0</td><td>7.8</td><td>56</td><td>40.6</td><td>1.64</td></tr><tr><td>CVD+PP</td><td>96.0</td><td>5.8</td><td>50</td><td>60.3</td><td>2.44</td></tr></table>
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 4: Comparison of the accuracy of different testing algorithms. The yaxis is Micro-F1 for PPI and accuracy otherwise.
|
| 186 |
+
|
| 187 |
+

|
| 188 |
+
Figure 5: Bias and standard deviation of the gradient for different algorithms during training.
|
| 189 |
+
|
| 190 |
+
Meanwhile, simper algorithms $\mathrm { C V + P P }$ and ${ \mathrm { N S } } { \mathrm { + P P } }$ work acceptably on most of the datasets. $\mathrm { C V + P P }$ reaches a comparable accuracy with Exact for all datasets except PPI. ${ \mathrm { N S } } { \mathrm { + P P } }$ works slightly worse but the final validation accuracy is still within $2 \%$ . These algorithms can be adopted if there is no strong need for predictive performance. We however emphasize that exact algorithms must be used for making predictions, as we will show in Sec. 5.4. Finally, the algorithm NS without preprocessing works much worse than others, indicating the significance of our preprocessing strategy.
|
| 191 |
+
|
| 192 |
+
# 5.4 FURTHER ANALYSIS ON TIME COMPLEXITY, TESTING ACCURACY AND VARIANCE
|
| 193 |
+
|
| 194 |
+
Table 4 reports the average number of epochs, time, and total number of floating point operations to reach a given $96 \%$ validation accuracy on the largest Reddit dataset. Sparse and dense computations are defined in Sec. 4.6. We found that $\mathrm { C V D + P P }$ is about 5 times faster than Exact due to the significantly reduced receptive field size. Meanwhile, simply setting $D ^ { ( l ) } = 2$ for NS does not converge to the given accuracy.
|
| 195 |
+
|
| 196 |
+
We compare the quality of the predictions made by different algorithms, using the same model trained by Exact in Fig. 4. As Thm. 1 states, CV reaches the same testing accuracy as Exact, while NS and ${ \mathrm { N S } } { \mathrm { + P P } }$ perform much worse. Testing using exact algorithms (CV or Exact) corresponds to the weight scaling algorithm for dropout (Srivastava et al., 2014).
|
| 197 |
+
|
| 198 |
+
Finally, we compare the average bias and variance of the gradients per dimension for first layer weights relative to the weights’ magnitude in Fig. 5. For models without dropout, the gradient of $\mathrm { C V + P P }$ is almost unbiased. For models with dropout, the bias and variance of $\mathrm { C V + P P }$ and $\mathrm { C V D + P P }$ are ususally smaller than NS and ${ \mathrm { N S } } { \mathrm { + P P } }$ as we analyzed in Sec. 4.3.
|
| 199 |
+
|
| 200 |
+
# 6 CONCLUSIONS
|
| 201 |
+
|
| 202 |
+
The large receptive field size of GCN hinders its fast stochastic training. In this paper, we present a preprocessing strategy and two control variate based algorithms to reduce the receptive field size. Our algorithms can achieve comparable convergence speed with the exact algorithm even the neighbor sampling size $D ^ { ( l ) } = 2$ , so that the per-epoch cost of training GCN is comparable with training MLPs. We also present strong theoretical guarantees, including exact prediction and convergence to GCN’s local optimum, for our control variate based algorithm.
|
| 203 |
+
|
| 204 |
+
# REFERENCES
|
| 205 |
+
|
| 206 |
+
Jimmy Lei Ba, Jamie Ryan Kiros, and Geoffrey E Hinton. Layer normalization. arXiv preprint arXiv:1607.06450, 2016.
|
| 207 |
+
|
| 208 |
+
Rianne van den Berg, Thomas N Kipf, and Max Welling. Graph convolutional matrix completion. arXiv preprint arXiv:1706.02263, 2017.
|
| 209 |
+
|
| 210 |
+
Saeed Ghadimi and Guanghui Lan. Stochastic first-and zeroth-order methods for nonconvex stochastic programming. SIAM Journal on Optimization, 23(4):2341–2368, 2013.
|
| 211 |
+
|
| 212 |
+
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, pp. 855–864. ACM, 2016.
|
| 213 |
+
|
| 214 |
+
William L Hamilton, Rex Ying, and Jure Leskovec. Inductive representation learning on large graphs. arXiv preprint arXiv:1706.02216, 2017a.
|
| 215 |
+
|
| 216 |
+
William L Hamilton, Rex Ying, and Jure Leskovec. Representation learning on graphs: Methods and applications. arXiv preprint arXiv:1709.05584, 2017b.
|
| 217 |
+
|
| 218 |
+
Diederik Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 219 |
+
|
| 220 |
+
Thomas N Kipf and Max Welling. Variational graph auto-encoders. arXiv preprint arXiv:1611.07308, 2016.
|
| 221 |
+
|
| 222 |
+
Thomas N Kipf and Max Welling. Semi-supervised classification with graph convolutional networks. In ICLR, 2017.
|
| 223 |
+
|
| 224 |
+
Yann LeCun, Yoshua Bengio, et al. Convolutional networks for images, speech, and time series. The handbook of brain theory and neural networks, 3361(10):1995, 1995.
|
| 225 |
+
|
| 226 |
+
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, pp. 701–710. ACM, 2014.
|
| 227 |
+
|
| 228 |
+
Brian D Ripley. Stochastic simulation, volume 316. John Wiley & Sons, 2009.
|
| 229 |
+
|
| 230 |
+
Michael Schlichtkrull, Thomas N Kipf, Peter Bloem, Rianne van den Berg, Ivan Titov, and Max Welling. Modeling relational data with graph convolutional networks. arXiv preprint arXiv:1703.06103, 2017.
|
| 231 |
+
|
| 232 |
+
Nitish Srivastava, Geoffrey E Hinton, Alex Krizhevsky, Ilya Sutskever, and Ruslan Salakhutdinov. Dropout: a simple way to prevent neural networks from overfitting. Journal of machine learning research, 15(1):1929–1958, 2014.
|
| 233 |
+
|
| 234 |
+
Jian Tang, Meng Qu, Mingzhe Wang, Ming Zhang, Jun Yan, and Qiaozhu Mei. Line: Largescale information network embedding. In Proceedings of the 24th International Conference on World Wide Web, pp. 1067–1077. International World Wide Web Conferences Steering Committee, 2015.
|
| 235 |
+
|
| 236 |
+
Sida Wang and Christopher Manning. Fast dropout training. In Proceedings of the 30th International Conference on Machine Learning (ICML-13), pp. 118–126, 2013.
|
| 237 |
+
|
| 238 |
+
# A PROOF OF THEOREM 1
|
| 239 |
+
|
| 240 |
+
f. 1. Weach node rove, so first epfor all e activation . Assume th $h _ { i , v } ^ { ( 0 ) }$ is at lee have $v$ $\bar { H } _ { C V , i } ^ { ( 0 ) } = H _ { C V , i } ^ { ( 0 ) } = H ^ { ( 0 ) }$ $i > I$ $\bar { H } _ { C V , i } ^ { ( l ) } = H _ { C V , i } ^ { ( l ) } =$ $H ^ { ( l ) }$ $i > ( l + 1 ) I$ . Then for all $i > ( l + 1 ) I$
|
| 241 |
+
|
| 242 |
+
$$
|
| 243 |
+
Z _ { C V , i } ^ { ( l + 1 ) } = \left( \hat { P } _ { i } ^ { ( l ) } ( H _ { C V , i } ^ { ( l ) } - \bar { H } _ { C V , i } ^ { ( l ) } ) + P \bar { H } _ { C V , i } ^ { ( l ) } \right) W ^ { ( l ) } = P \bar { H } _ { C V , i } ^ { ( l ) } W ^ { ( l ) } = P H ^ { ( l ) } W ^ { ( l ) } = Z ^ { ( l + 1 ) } .
|
| 244 |
+
$$
|
| 245 |
+
|
| 246 |
+
$$
|
| 247 |
+
H _ { C V , i } ^ { ( l + 1 ) } = \sigma ( Z _ { C V , i } ^ { ( l + 1 ) } ) = H ^ { ( l + 1 ) }
|
| 248 |
+
$$
|
| 249 |
+
|
| 250 |
+
After one more epoch, all the activations h(l+1)CV,i,v are computed at least once for each $v$ , so $\bar { H } _ { C V , i } ^ { ( l + 1 ) } =$ $H _ { C V , i } ^ { ( l + 1 ) } ~ = ~ H ^ { ( l + 1 ) }$ for all $i > ( l + 2 ) I$ . By induction, we know that after $L I$ steps, we have $\bar { H } _ { C V , i } ^ { ( L - 1 ) } = H _ { C V , i } ^ { ( L - 1 ) } = H ^ { ( L - 1 ) }$ . By Eq. 7 we have $\bar { Z } _ { C V , i } ^ { ( L ) } = Z ^ { ( L ) }$ .
|
| 251 |
+
|
| 252 |
+
2. We omit the time subscript $_ i$ and denote $f _ { C V , v } : = f ( y _ { v } , z _ { C V , v } ^ { ( L ) } )$ . By back propagation, the approximated gradients by CV can be computed as follows
|
| 253 |
+
|
| 254 |
+
$$
|
| 255 |
+
\begin{array} { r l } & { \nabla _ { H _ { C V } ^ { ( l ) } } f _ { C V , v } = \hat { P } ^ { ( l ) } \nabla _ { Z _ { C V } ^ { ( l + 1 ) } } f _ { C V , v } W ^ { ( l ) \top } \qquad l = 1 , \ldots , L - 1 } \\ & { \nabla _ { Z _ { C V } ^ { ( l ) } } f _ { C V , v } = \sigma ^ { \prime } ( Z _ { C V } ^ { ( l ) } ) \circ \nabla _ { H _ { C V } ^ { ( l ) } } f _ { C V , v } \qquad l = 1 , \ldots , L - 1 } \\ & { \nabla _ { W ^ { ( l ) } } f _ { C V , v } = ( \hat { P } ^ { ( l ) } H _ { C V } ^ { ( l ) } ) ^ { \top } \nabla _ { Z _ { C V } ^ { ( l + 1 ) } } f _ { C V , v } \qquad l = 0 , \ldots , L - 1 , } \\ & { \qquad g _ { C V } ( W ) = \displaystyle \frac { 1 } { | \mathcal { V } _ { B } | } \sum _ { v \in \mathcal { V } _ { B } } \nabla _ { W } f _ { C V , v } , } \end{array}
|
| 256 |
+
$$
|
| 257 |
+
|
| 258 |
+
where $\circ$ is the element wise product and $\sigma ^ { \prime } ( Z _ { C V } ^ { ( l ) } )$ is the element-wise derivative. Similarly, denote $f _ { v } : = f ( y _ { v } , Z _ { v } ^ { ( l ) } )$ , the exact gradients can be computed as follows
|
| 259 |
+
|
| 260 |
+
$$
|
| 261 |
+
\begin{array} { r l } { \nabla _ { H ^ { ( l ) } } f _ { v } = P ^ { \top } \nabla _ { Z ^ { ( l + 1 ) } } f _ { v } W ^ { ( l ) \top } } & { \qquad l = 1 , \ldots , L - 1 } \\ { \nabla _ { Z ^ { ( l ) } } f _ { v } = \sigma ^ { \prime } ( Z ^ { ( l ) } ) \circ \nabla _ { H ^ { ( l ) } } f _ { v } } & { \qquad l = 1 , \ldots , L - 1 } \\ { \nabla _ { W ^ { ( l ) } } f _ { v } = ( P H ^ { ( l ) } ) ^ { \top } \nabla _ { Z ^ { ( l + 1 ) } } f _ { v } } & { \qquad l = 0 , \ldots , L - 1 , } \\ { g ( W ) = \displaystyle \frac { 1 } { V } \sum _ { v \in \mathcal { V } } \nabla _ { W } f _ { v } . } & { } \end{array}
|
| 262 |
+
$$
|
| 263 |
+
|
| 264 |
+
Applying $\mathbb { E } _ { \hat { P } } = \mathbb { E } _ { \hat { P } ^ { ( 1 ) } , \dots , \hat { P } ^ { ( L ) } }$ to both sides of Eq. 8, and utilizing
|
| 265 |
+
|
| 266 |
+
• 1’s conclusion that after $L$ epoches, $Z _ { C V } ^ { ( l ) } = Z ^ { ( l ) }$ , so $\nabla _ { Z _ { C V } ^ { ( L ) } } f _ { C V , v }$ is also determinstic.
|
| 267 |
+
|
| 268 |
+
$$
|
| 269 |
+
\begin{array} { r l } & { \bullet \mathbb { E } _ { \hat { P } } \big [ \nabla _ { Z ^ { ( l ) } } f _ { C V , v } \big ] = \mathbb { E } _ { \hat { P } ^ { ( l ) } , \ldots , \hat { P } ^ { ( L ) } } \big [ \nabla _ { Z ^ { ( l ) } } f _ { C V , v } \big ] . } \\ & { \bullet \mathbb { E } _ { \hat { P } } \big [ \nabla _ { H ^ { ( l ) } } f _ { C V , v } \big ] = \mathbb { E } _ { \hat { P } ^ { ( l ) } , \ldots , \hat { P } ^ { ( L ) } } \big [ \nabla _ { H ^ { ( l ) } } f _ { C V , v } \big ] . } \end{array}
|
| 270 |
+
$$
|
| 271 |
+
|
| 272 |
+
we have
|
| 273 |
+
|
| 274 |
+
$$
|
| 275 |
+
\begin{array} { r l r l } & { \mathbb { E } _ { \hat { P } ^ { ( l ) } , \dots , \hat { P } ^ { ( L ) } } \nabla _ { H _ { C V } ^ { ( l ) } } f _ { C V , v } = \mathbb { E } _ { \hat { P } ^ { ( l ) } } \hat { P } ^ { ( l ) \top } \mathbb { E } _ { \hat { P } ^ { ( l + 1 ) } , \dots , \hat { P } ^ { ( L ) } } [ \nabla _ { Z _ { C V } ^ { ( l + 1 ) } } f _ { C V , v } ] W ^ { ( l ) \top } } & { l = 1 , \dots , L - 1 } \\ & { \mathbb { E } _ { \hat { P } ^ { ( l ) } , \dots , \hat { P } ^ { ( L ) } } \nabla _ { Z _ { C V } ^ { ( l ) } } f _ { C V , v } = \sigma ^ { \prime } ( Z _ { C V } ^ { ( l ) } ) \circ \mathbb { E } _ { \hat { P } ^ { ( l ) } , \dots , \hat { P } ^ { ( L ) } } \nabla _ { H _ { C V } ^ { ( l ) } } f _ { C V , v } } & { l = 1 , \dots , L - 1 } \\ & { \mathbb { E } _ { \hat { P } } \nabla _ { W ^ { ( l ) } } f _ { C V , v } = H ^ { ( l ) ^ { \top } } \mathbb { E } _ { \hat { P } ^ { ( l ) } } \hat { P } ^ { ( l ) \top } \mathbb { E } _ { \hat { P } ^ { ( l + 1 ) } , \dots , \hat { P } ^ { ( L ) } } \nabla _ { Z _ { C V } ^ { ( l + 1 ) } } f _ { C V , v } } & { l = 0 , \dots , L - 1 , } \\ & { \quad \quad \quad \quad g _ { C V } ( W ) = \displaystyle \frac { 1 } { | \mathcal { V } _ { B } | } \sum _ { v \in \mathcal { V } _ { B } } \mathbb { E } _ { \hat { P } } \nabla _ { W } f _ { C V , v } . } & { ( 1 0 , 1 ) ^ { ( 1 ) / 2 } } \end{array}
|
| 276 |
+
$$
|
| 277 |
+
|
| 278 |
+
Comparing Eq. 10 and Eq. 9 we get
|
| 279 |
+
|
| 280 |
+
$$
|
| 281 |
+
\mathbb { E } _ { \hat { P } } \nabla _ { W ^ { ( l ) } } f _ { C V , v } = \nabla _ { W ^ { ( l ) } } f _ { v } , l = 0 , \ldots , L - 1 ,
|
| 282 |
+
$$
|
| 283 |
+
|
| 284 |
+
so
|
| 285 |
+
|
| 286 |
+
$$
|
| 287 |
+
\mathbb { E } _ { \hat { P } , \mathcal { V } _ { B } } g _ { C V } ( W ) = \mathbb { E } _ { \mathcal { V } _ { B } } \frac { 1 } { | \mathcal { V } _ { B } | } \sum _ { v \in \mathcal { V } _ { B } } \mathbb { E } _ { \hat { P } } \nabla _ { W } f _ { C V , v } = \frac { 1 } { V } \sum _ { v \in \mathcal { V } } \nabla _ { W } f _ { v } .
|
| 288 |
+
$$
|
| 289 |
+
|
| 290 |
+
# B PROOF OF THEOREM 2
|
| 291 |
+
|
| 292 |
+
We proof Theorem 2 in 3 steps:
|
| 293 |
+
|
| 294 |
+
1. Lemma 1: For a sequence of weights $W ^ { ( 1 ) } , \ldots , W ^ { ( N ) }$ which are close to each other, CV’s approximate activations are close to the exact activations.
|
| 295 |
+
2. Lemma 2: For a sequence of weights $W ^ { ( 1 ) } , \ldots , W ^ { ( N ) }$ which are close to each other, CV’s gradients are close to be unbiased.
|
| 296 |
+
3. Theorem 2: An SGD algorithm generates the weights that changes slow enough for the gradient bias goes to zero, so the algorithm converges.
|
| 297 |
+
|
| 298 |
+
The following proposition is needed in our proof
|
| 299 |
+
|
| 300 |
+
Proposition 1. Let $\left\| A \right\| _ { \infty } = \operatorname* { m a x } _ { i j } \left| A _ { i j } \right|$ , then
|
| 301 |
+
|
| 302 |
+
• $\left\| A B \right\| _ { \infty } \leq c o l ( A ) \left\| A \right\| _ { \infty } \left\| B \right\| _ { \infty }$ , where $c o l ( A )$ is the number of columns of the matrix A. • $\left\| A \circ B \right\| _ { \infty } \leq \left\| A \right\| _ { \infty } \left\| B \right\| _ { \infty } .$ .
|
| 303 |
+
$\left. \| A + B \right\| _ { \infty } \leq \left\| A \right\| _ { \infty } + \left\| B \right\| _ { \infty } .$
|
| 304 |
+
|
| 305 |
+
Proof.
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
\begin{array} { l } { { \displaystyle \left\| A B \right\| _ { \infty } = \operatorname* { m a x } _ { i j } \left| \sum _ { k } A _ { i k } B _ { i k } \right| \le \operatorname* { m a x } _ { i j } \left| \sum _ { k } \left\| A \right\| _ { \infty } \left\| B \right\| _ { \infty } \right| = c o l ( A ) \left\| A \right\| _ { \infty } \left\| B \right\| _ { \infty } . } } \\ { { \displaystyle \left\| A \circ B \right\| _ { \infty } = \operatorname* { m a x } _ { i j } \left| A _ { i j } B _ { i j } \right| \le \operatorname* { m a x } _ { i j } \left\| A \right\| _ { \infty } \left\| B \right\| _ { \infty } = \left\| A \right\| _ { \infty } \left\| B \right\| _ { \infty } . } } \\ { { \displaystyle A + B \right\| _ { \infty } = \operatorname* { m a x } _ { i j } \left| A _ { i j } + B _ { i j } \right| \le \operatorname* { m a x } _ { i j } \left\{ \left| A _ { i j } \right| + | B _ { i j } | \right\} \le \operatorname* { m a x } _ { i j } \left| A _ { i j } | + \operatorname* { m a x } _ { i j } \left| B _ { i j } \right| = \left\| A \right\| _ { \infty } + \left\| B \right\| _ { \infty } } } \end{array}
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
We define $C : = \operatorname* { m a x } \{ c o l ( P ) , c o l ( H ^ { ( 0 ) } ) , \ldots , c o l ( H ^ { ( L ) } ) \} .$
|
| 312 |
+
|
| 313 |
+
# B.1 PROOF OF LEMMA 1
|
| 314 |
+
|
| 315 |
+
Proposition 2. There are a series of $T$ inputs $X _ { 1 } , \ldots , X _ { T }$ , $X _ { C V , 1 } , \ldots , X _ { C V , T }$ and weights $W _ { 1 } , \dots , W _ { T }$ feed to an one-layer GCN with CV
|
| 316 |
+
|
| 317 |
+
${ \cal Z } _ { C V , i } = \left( \hat { P } _ { i } \left( X _ { i } - \bar { X } _ { i } \right) + { \cal P } \bar { X } _ { i } \right) { \cal W } _ { i } , \quad { \cal H } _ { C V , i } = \sigma ( { \cal Z } _ { C V , i } ) , \quad \bar { H } _ { C V , i + 1 } = { \bf s } _ { i } H _ { C V , i } + ( 1 - { \bf s } _ { i } ) \bar { H } _ { C V , i } .$ and an one-layer exact GCN
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
Z _ { i } = P X _ { i } W _ { i } , \quad H _ { i } = \sigma ( Z _ { i } ) .
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
If
|
| 324 |
+
|
| 325 |
+
1. The activation $\sigma ( \cdot )$ is $\rho$ -Lipschitz;
|
| 326 |
+
|
| 327 |
+
Then there exists some $K > 0$ , s.t., $\| H _ { C V , i } - H _ { C V , j } \| _ { \infty } < K \epsilon$ and $\left\| H _ { C V , i } - H _ { i } \right\| _ { \infty } < K \epsilon$ for all $I < i , j \leq T$ , where $I$ is the number of iterations per epoch.
|
| 328 |
+
|
| 329 |
+
Proof. Because for all $i \ > \ I$ , the elements of $\bar { X } _ { C V , i }$ are all taken from previous epochs, i.e., $X _ { C V , 1 } , \dotsc , X _ { C V , i - 1 }$ , we know that
|
| 330 |
+
|
| 331 |
+
$$
|
| 332 |
+
\left\| { \bar { X } } _ { C V , i } - X _ { C V , i } \right\| _ { \infty } \leq \operatorname* { m a x } _ { j \leq i } \left\| X _ { C V , j } - X _ { C V , i } \right\| _ { \infty } \leq \epsilon \quad ( \forall i > I ) .
|
| 333 |
+
$$
|
| 334 |
+
|
| 335 |
+
By triangular inequality, we also know
|
| 336 |
+
|
| 337 |
+
$$
|
| 338 |
+
\begin{array} { r l } { \left\| { { \bar { X } } _ { C V , i } } - { { \bar { X } } _ { C V , j } } \right\| _ { \infty } < 3 \epsilon } & { ( \forall i , j > I ) . } \\ { \left\| { { \bar { X } } _ { C V , i } } - { { X } _ { i } } \right\| _ { \infty } < 2 \epsilon } & { ( \forall i > I ) . } \end{array}
|
| 339 |
+
$$
|
| 340 |
+
|
| 341 |
+
Since $\left\| X _ { C V , 1 } \right\| _ { \infty } , \ldots , \left\| X _ { C V , T } \right\| _ { \infty }$ are bounded, $\left\| { \bar { X } } _ { C V , i } \right\| _ { \infty }$ is also bounded for $i > I$ . Then,
|
| 342 |
+
|
| 343 |
+
$$
|
| 344 |
+
\begin{array} { r l } { | V _ { i ^ { - 1 } } - H _ { C V ^ { + 1 } } | | _ { \infty } \leq \rho | V _ { i ^ { - 1 } } - Z _ { C V ^ { + 1 } } | | _ { \infty } } & { } \\ & { \leq \rho \| ( \hat { P } _ { i ^ { + } } ( X _ { C V ^ { + 1 } } - \hat { X } _ { C V ^ { + 1 } } ) | _ { \infty } + P \hat { X } _ { C V ^ { + 1 } } ) W _ { i ^ { - 1 } } ( \hat { P } _ { i } ( X _ { C V ^ { + 1 } } - \hat { X } _ { C V ^ { + 1 } } ) + P \hat { X } _ { C V ^ { + 1 } } ) } \\ & { \leq \rho \| \hat { P } _ { i ^ { + } } ( X _ { C V ^ { + 1 } } - \hat { X } _ { C V ^ { + 1 } } ) | | _ { \infty } - \hat { P } _ { i } ( X _ { C V ^ { + 1 } } - \hat { X } _ { C V ^ { + 1 } } ) W _ { i ^ { + } } \| _ { \infty } + \rho \| P \hat { X } _ { C V ^ { + 1 } } W _ { i ^ { - } } - P \lambda } \\ & { \leq \rho e ^ { - 2 } \| | \hat { P } _ { i ^ { + } } \hat { \mathcal { P } } _ { i ^ { + } } } \\ & { + \hat { P } _ { i ^ { + } } \| _ { \infty } \| \| X _ { C V ^ { + 1 } } - \hat { X } _ { C V ^ { + 1 } } - X _ { C V ^ { + 1 } } \| _ { \infty } \| W _ { i ^ { + } } \| _ { \infty } } \\ & { + \| \hat { P } _ { i ^ { + } } \| _ { \infty } \| \| X _ { C V ^ { + 1 } } - \hat { X } _ { C V ^ { + 1 } } - X _ { C V ^ { + 1 } } \| _ { \infty } \| \| W _ { i ^ { + } } \| _ { \infty } } \\ & { + \| \hat { P } _ { i ^ { + } } \| \| X _ { C V ^ { + 1 } } - \hat { X } _ { C V ^ { + 1 } } \| _ { \infty } \| W _ { i ^ { - 1 } } - W _ { i ^ { + } } \| _ { \infty } } \\ & + \| P \| _ { \infty } \| \| \end{array}
|
| 345 |
+
$$
|
| 346 |
+
|
| 347 |
+
and
|
| 348 |
+
|
| 349 |
+
$$
|
| 350 |
+
\begin{array} { r l } & { \left\| H _ { C V , i } - H _ { i } \right\| _ { \infty } \leq \rho \left\| Z _ { C V , i } - Z _ { i } \right\| _ { \infty } } \\ & { \qquad \leq \rho \left\| \left( \hat { P } _ { i } ( X _ { C V , i } - \bar { X } _ { C V , i } ) + P ( \bar { X } _ { C V , i } - X _ { i } ) \right) \right\| _ { \infty } W _ { i } } \\ & { \qquad \leq \rho C ( \left\| \hat { P } _ { i } \right\| _ { \infty } \epsilon + 2 \left\| P \right\| _ { \infty } \epsilon ) \left\| W _ { i } \right\| _ { \infty } } \\ & { \qquad \leq K _ { 2 } \epsilon . } \end{array}
|
| 351 |
+
$$
|
| 352 |
+
|
| 353 |
+
The following lemma bounds CV’s approximation error of activations
|
| 354 |
+
|
| 355 |
+
Lemma 1. Given a sequence of model weights $W _ { 1 } , \dots , W _ { T }$ . If $\lVert W _ { i } - W _ { j } \rVert _ { \infty } < \epsilon , \forall i , j$ , and all the activations are $\rho$ -Lipschitz, there exists $K > 0$ , s.t.,
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
\begin{array} { l } { \bullet \left\| H _ { i } ^ { l } - H _ { C V , i } ^ { l } \right\| _ { \infty } < K \epsilon , \forall i > L I , l = 1 , \ldots , L - 1 , } \\ { \bullet \left\| Z _ { i } ^ { l } - Z _ { C V , i } ^ { l } \right\| _ { \infty } < K \epsilon , \forall i > L I , l = 1 , \ldots , L . } \end{array}
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
Proof. We prove by induction. Because $H ^ { 0 } = X$ is constant, $\bar { H } _ { C V , i } ^ { 0 } = H _ { i } ^ { 0 }$ after $I$ iterations. So $H _ { C V , i } ^ { 1 } = \sigma ( \left( \hat { P } _ { i } ( H _ { C V , i } ^ { 0 } - \bar { H } _ { C V , i } ^ { 0 } ) + P \bar { H } _ { C V , i } ^ { 0 } \right) W _ { i } ^ { 0 } = \sigma ( P X W _ { i } ^ { 0 } ) = H _ { i } ^ { 1 } ,$ and
|
| 362 |
+
|
| 363 |
+
$$
|
| 364 |
+
\begin{array} { r } { \left\| \boldsymbol H _ { C V , i } ^ { 1 } - \boldsymbol H _ { C V , j } ^ { 1 } \right\| _ { \infty } = \left\| \sigma ( P X W _ { i } ^ { 0 } ) - \sigma ( P X W _ { j } ^ { 0 } ) \right\| _ { \infty } \leq \rho C \left\| P \right\| _ { \infty } \left\| X \right\| _ { \infty } \epsilon . } \end{array}
|
| 365 |
+
$$
|
| 366 |
+
|
| 367 |
+
Repeatedly apply Proposition B.1 for $L - 1$ times, we get the intended results.
|
| 368 |
+
|
| 369 |
+
# B.2 PROOF OF LEMMA 2
|
| 370 |
+
|
| 371 |
+
The following lemma bounds the bias of CV’s approximate gradient
|
| 372 |
+
|
| 373 |
+
Lemma 2. Given a sequence of model weights $W _ { 1 } , \dots , W _ { T }$ , if
|
| 374 |
+
|
| 375 |
+
1. $\left\| \boldsymbol W _ { i } - \boldsymbol W _ { j } \right\| _ { \infty } < \epsilon , \forall i , j ,$ ,
|
| 376 |
+
|
| 377 |
+
2. all the activations are $\rho$ -Lipschitz,
|
| 378 |
+
|
| 379 |
+
3. the gradient of the cost function $\nabla _ { z } f ( y , z )$ is $\rho$ -Lipschitz and bounded,
|
| 380 |
+
|
| 381 |
+
then there exists $K > 0$ , s.t.,
|
| 382 |
+
|
| 383 |
+
$$
|
| 384 |
+
\begin{array} { r } { \left\| \mathbb E _ { \hat { P } , \mathcal V _ { B } } g _ { C V } ( W _ { i } ) - g ( W _ { i } ) \right\| _ { \infty } < K \epsilon , \forall i > L I . } \end{array}
|
| 385 |
+
$$
|
| 386 |
+
|
| 387 |
+
Proof. By Lipschitz continuity of $\nabla _ { z } f ( y , z )$ and Lemma 1, there exists $K > 0$ , s.t.,
|
| 388 |
+
|
| 389 |
+
$$
|
| 390 |
+
\left\| \nabla _ { Z _ { C V } ^ { ( l ) } } f _ { C V , v } - \nabla _ { Z ^ { ( l ) } } f _ { v } \right\| _ { \infty } \leq \rho \left\| Z _ { C V } ^ { ( l ) } - Z ^ { ( l ) } \right\| _ { \infty } \leq \rho K \epsilon .
|
| 391 |
+
$$
|
| 392 |
+
|
| 393 |
+
Assume that $\left\| \mathbb { E } _ { \hat { P } } \nabla _ { Z _ { C V } ^ { ( l + 1 ) } } f _ { C V , v } - \nabla _ { Z ^ { ( l + 1 ) } } f _ { v } \right\| _ { \infty } < K _ { 1 } \epsilon$ , we now prove that there exists $K > 0$ , s.t., $\left\| \mathbb { E } _ { \hat { P } } \nabla _ { Z _ { C V } ^ { ( l ) } } f _ { C V , v } - \nabla _ { Z ^ { ( l ) } } f _ { v } \right\| _ { \infty } < K \epsilon$ . By Eq. 9, Eq. 10 and Lemma 1, we have
|
| 394 |
+
|
| 395 |
+
$$
|
| 396 |
+
\begin{array} { r l } & { \quad \left\| \mathbb { E } _ { \hat { P } } \nabla _ { H _ { C V } ^ { ( l ) } } f _ { C V , v } - \nabla _ { H ^ { ( l ) } } f _ { v } \right\| _ { \infty } } \\ & { = \left\| P ^ { \top } \mathbb { E } _ { \hat { P } } [ \nabla _ { Z _ { C V } ^ { ( l + 1 ) } } f _ { C V , v } ] W ^ { ( l ) \top } - P ^ { \top } \nabla _ { Z ^ { ( l + 1 ) } } f _ { v } W ^ { ( l ) \top } \right\| _ { \infty } } \\ & { \leq \left\| P ^ { \top } \right\| _ { \infty } K _ { 1 } C ^ { 2 } \epsilon \left\| W ^ { ( l ) \top } \right\| _ { \infty } , } \end{array}
|
| 397 |
+
$$
|
| 398 |
+
|
| 399 |
+
and
|
| 400 |
+
|
| 401 |
+
$$
|
| 402 |
+
\begin{array} { r l } & { \quad \left\| \mathbb { E } _ { \hat { P } } \nabla _ { Z _ { C V } ^ { ( l ) } } f _ { C V , v } - \nabla _ { Z ^ { ( l ) } } f _ { v } \right\| _ { \infty } } \\ & { = \left\| \mathbb { E } _ { \hat { P } } \left[ \sigma ^ { \prime } ( Z _ { C V } ^ { ( l ) } ) \circ \nabla _ { H _ { C V } ^ { ( l ) } } f _ { C V , v } \right] - \sigma ^ { \prime } ( Z ^ { ( l ) } ) \circ \nabla _ { H ^ { ( l ) } } f _ { v } \right\| _ { \infty } } \\ & { \leq \left\| \mathbb { E } _ { \hat { P } } \left[ \left( \sigma ^ { \prime } ( Z _ { C V } ^ { ( l ) } ) - \sigma ^ { \prime } ( Z ^ { ( l ) } ) \right) \circ \nabla _ { H _ { C V } ^ { ( l ) } } f _ { C V , v } \right] \right\| _ { \infty } + \left\| \sigma ^ { \prime } ( Z ^ { ( l ) } ) ( \mathbb { E } _ { \hat { P } } [ \nabla _ { H _ { C V } ^ { ( l ) } } f _ { C V , v } ] - \nabla _ { H ^ { ( l ) } } f _ { v } ) \right\| _ { \infty } } \\ & { \leq \left\| \mathbb { E } _ { \hat { P } } \left[ \rho K C \epsilon \circ \nabla _ { H _ { C V } ^ { ( l ) } } f _ { C V , v } \right] \right\| _ { \infty } + \left\| \sigma ^ { \prime } ( Z ^ { ( l ) } ) \right\| _ { \infty } \left\| P ^ { \top } \right\| _ { \infty } K _ { 1 } C ^ { 3 } \epsilon \left\| W ^ { ( l ) \top } \right\| _ { \infty } } \\ & { \leq \rho K C ^ { 2 } \epsilon \left\| \mathbb { E } _ { \hat { P } } \nabla _ { H _ { C V } ^ { ( l ) } } f _ { C V , v } \right\| _ { \infty } + \left\| \sigma ^ { \prime } ( Z ^ { ( l ) } ) \right\| _ { \infty } \left\| P ^ { \top } \right\| _ { \infty } K _ { 1 } C ^ { 3 } \epsilon \left\| W ^ { ( l ) \top } \right\| _ { \infty } \leq K _ { 2 } \epsilon } \end{array}
|
| 403 |
+
$$
|
| 404 |
+
|
| 405 |
+
By induction we know that for $l = 1 , \ldots , L$ there exists $K$ , s.t.,
|
| 406 |
+
|
| 407 |
+
$$
|
| 408 |
+
\left\| \mathbb { E } _ { \hat { P } } \nabla _ { Z _ { C V } ^ { ( l ) } } f _ { C V , v } - \nabla _ { Z ^ { ( l ) } } f _ { v } \right\| _ { \infty } \leq K \epsilon .
|
| 409 |
+
$$
|
| 410 |
+
|
| 411 |
+
Again by Eq. 9, Eq. 10, and Lemma 1,
|
| 412 |
+
|
| 413 |
+
$$
|
| 414 |
+
\begin{array} { r l } & { \quad \left\| { \mathbb { E } } _ { \hat { P } } { \nabla } _ { W ^ { ( i ) } } f _ { C V , v } - { \nabla } _ { W ^ { ( i ) } } f _ { v } \right\| _ { \infty } } \\ & { = \left\| { \mathbb { E } } _ { \hat { P } } \left[ H _ { C V } ^ { ( l ) \top } P ^ { \top } { \nabla } _ { Z _ { C V } ^ { ( i ) } } f _ { C V , v } \right] - H ^ { ( l ) \top } P ^ { \top } { \nabla } _ { Z ^ { ( i ) } } f _ { v } \right\| _ { \infty } } \\ & { \leq \left\| { \mathbb { E } } _ { \hat { P } } \left[ \left( H _ { C V } ^ { ( l ) \top } - H ^ { ( l ) \top } \right) P ^ { \top } { \nabla } _ { Z _ { C V } ^ { ( i ) } } f _ { C V , v } \right] \right\| _ { \infty } + \left\| H ^ { ( l ) \top } P ^ { \top } \left( { \mathbb { E } } _ { \hat { P } } { \nabla } _ { Z _ { C V } ^ { ( l ) } } f _ { C V , v } - { \nabla } _ { Z ^ { ( i ) } } f _ { v } \right) \right\| _ { \infty } } \\ & { \leq \left\| { \mathbb { E } } _ { \hat { P } } \left[ K C e P ^ { \top } { \nabla } _ { Z _ { C V } ^ { ( i ) } } f _ { C V , v } \right] \right\| _ { \infty } + C ^ { 2 } \left\| H ^ { ( l ) \top } \right\| _ { \infty } \left\| P ^ { \top } \right\| _ { \infty } K \epsilon } \\ & { \leq K C ^ { 2 } \epsilon \left\| P \right\| _ { \infty } \left\| { \mathbb { E } } _ { \hat { P } } \left[ { \nabla } _ { Z _ { C V } ^ { ( i ) } } f _ { C V , v } \right] \right\| _ { \infty } + \left\| H ^ { ( l ) \top } \right\| _ { \infty } \left\| P ^ { \top } \right\| _ { \infty } K C ^ { 2 } \epsilon \leq K _ { 3 } \epsilon } \end{array}
|
| 415 |
+
$$
|
| 416 |
+
|
| 417 |
+
Finally,
|
| 418 |
+
|
| 419 |
+
$$
|
| 420 |
+
\begin{array} { r l } & { ~ \left\| \mathbb { E } _ { \hat { P } , \gamma _ { B } } g _ { C V } ( W _ { i } ) - g ( W _ { i } ) \right\| _ { \infty } } \\ & { = \left\| \mathbb { E } _ { \mathcal { V } _ { B } } \left( \frac { 1 } { | \mathcal { V } _ { B } | } \displaystyle \sum _ { v \in \mathcal { V } _ { B } } \mathbb { E } _ { \hat { P } } \left[ \nabla _ { W ^ { ( l ) } } f _ { C V , v } \right] - \frac { 1 } { V } \displaystyle \sum _ { v \in \mathcal { V } } \nabla _ { W ^ { ( l ) } } f _ { v } \right) \right\| _ { \infty } } \\ & { = \left\| \frac { 1 } { V } \displaystyle \sum _ { v \in \mathcal { V } } \left( \mathbb { E } _ { \hat { P } } \left[ \nabla _ { W ^ { ( l ) } } f _ { C V , v } \right] - \nabla _ { W ^ { ( l ) } } f _ { v } \right) \right\| _ { \infty } \leq K _ { 3 } \epsilon . } \end{array}
|
| 421 |
+
$$
|
| 422 |
+
|
| 423 |
+
# B.3 PROOF OF THEOREM 2
|
| 424 |
+
|
| 425 |
+
Proof. This proof is a modification of Ghadimi & Lan (2013), but using biased stochastic gradients instead. We assume the algorithm is already warmed-up for $L I$ steps with the initial weights $W _ { 0 }$ , so that Lemma 2 holds for step $i > 0$ . Denote $\delta _ { i } = g _ { C V } ( W _ { i } ) - \nabla \mathcal { L } ( W _ { i } )$ . By smoothness we have
|
| 426 |
+
|
| 427 |
+
$$
|
| 428 |
+
\begin{array} { l } { { \displaystyle \dot { \Sigma } ( W _ { i + 1 } ) \le \mathcal { L } ( W _ { i } ) + \langle \nabla \mathcal { L } ( W _ { i } ) , W _ { i + 1 } - W _ { i } \rangle + \frac { \rho } { 2 } \gamma _ { i } ^ { 2 } \left. g _ { C V } ( W _ { i } ) \right. ^ { 2 } } } \\ { { \displaystyle \qquad = \mathcal { L } ( W _ { i } ) - \gamma _ { i } \langle \nabla \mathcal { L } ( W _ { i } ) , g _ { C V } ( W _ { i } ) \rangle + \frac { \rho } { 2 } \gamma _ { i } ^ { 2 } \left. g _ { C V } ( W _ { i } ) \right. ^ { 2 } } } \\ { { \displaystyle \qquad = \mathcal { L } ( W _ { i } ) - \gamma _ { i } \langle \nabla \mathcal { L } ( W _ { i } ) , \delta _ { i } \rangle - \gamma _ { i } \left. \nabla \mathcal { L } ( W _ { i } ) \right. ^ { 2 } + \frac { \rho } { 2 } \gamma _ { i } ^ { 2 } \left[ \left. \delta _ { i } \right. ^ { 2 } + \left. \nabla \mathcal { L } ( W _ { i } ) \right. ^ { 2 } + 2 \langle \delta _ { i } , \nabla \mathcal { L } ( W _ { i } ) \rangle + \frac { \rho } { 2 } \gamma _ { i } ^ { 2 } \left. \delta _ { i } \right. ^ { 2 } \right] } } \\ { { \displaystyle \qquad = \mathcal { L } ( W _ { i } ) - ( \gamma _ { i } - \rho \gamma _ { i } ^ { 2 } ) \langle \nabla \mathcal { L } ( W _ { i } ) , \delta _ { i } \rangle - ( \gamma _ { i } - \frac { \rho \gamma _ { i } ^ { 2 } } { 2 } ) \left. \nabla \mathcal { L } ( W _ { i } ) \right. ^ { 2 } + \frac { \rho } { 2 } \gamma _ { i } ^ { 2 } \left. \delta _ { i } \right. ^ { 2 } } . } \end{array}
|
| 429 |
+
$$
|
| 430 |
+
|
| 431 |
+
Consider the sequence of $L I + 1$ weights $W _ { i - L I } , \ldots , W _ { i }$ .
|
| 432 |
+
|
| 433 |
+
$$
|
| 434 |
+
\begin{array} { r l } { \displaystyle } & { \underset { i - L I \leq j , k \leq i } { \operatorname* { m a x } } \| W _ { j } - W _ { k } \| _ { \infty } \leq \displaystyle \sum _ { j = i - L I } ^ { i - 1 } \| W _ { j } - W _ { j + 1 } \| _ { \infty } } \\ { \displaystyle } & { = \displaystyle \sum _ { j = i - L I } ^ { i - 1 } \gamma _ { j } \| g _ { C V } ( W _ { j } ) \| _ { \infty } \leq \displaystyle \sum _ { j = i - L I } ^ { i - 1 } \gamma _ { j } G \leq L I G \gamma _ { i - L I } . } \end{array}
|
| 435 |
+
$$
|
| 436 |
+
|
| 437 |
+
By Lemma 2, there exists $K > 0$ , s.t.
|
| 438 |
+
|
| 439 |
+
$$
|
| 440 |
+
\begin{array} { r } { \mathbb { E } _ { \hat { P } , \gamma _ { B } } \left\| \delta _ { i } \right\| _ { \infty } = \mathbb { E } _ { \hat { P } , \gamma _ { B } } \left\| g _ { C V } ( W _ { i } ) - \nabla \mathcal { L } ( W _ { i } ) \right\| _ { \infty } \le K L I G \gamma _ { i - L I } , \quad \forall i > 0 . } \end{array}
|
| 441 |
+
$$
|
| 442 |
+
|
| 443 |
+
Assume that $W$ is $D$ -dimensional,
|
| 444 |
+
|
| 445 |
+
$$
|
| 446 |
+
\begin{array} { r } { \mathbb { E } _ { \hat { P } , \gamma _ { B } } \langle \nabla \mathcal { L } ( W _ { i } ) , \delta _ { i } \rangle \geq - \mathbb { E } _ { \hat { P } , \gamma _ { B } } D \left\| \nabla \mathcal { L } ( W _ { i } ) \right\| _ { \infty } \left\| \delta _ { i } \right\| _ { \infty } \geq - K L I D G ^ { 2 } \gamma _ { i - L I } = K _ { 1 } \gamma _ { i - L I } , } \\ { \mathbb { E } _ { \hat { P } , \gamma _ { B } } \left\| \delta _ { i } \right\| ^ { 2 } \leq D \left( \mathbb { E } _ { \hat { P } , \gamma _ { B } } \left\| \delta _ { i } \right\| _ { \infty } \right) ^ { 2 } \leq D K ^ { 2 } L ^ { 2 } B ^ { 2 } G ^ { 2 } \gamma _ { i - L I } = K _ { 2 } \gamma _ { i - L I } , } \end{array}
|
| 447 |
+
$$
|
| 448 |
+
|
| 449 |
+
where $K _ { 1 } = K L I D G ^ { 2 }$ and $K _ { 2 } = D K ^ { 2 } L ^ { 2 } B ^ { 2 } G ^ { 2 }$ . Taking $\mathbb E _ { \hat { P } , \mathcal V _ { B } }$ to both sides of Eq. 14 we have
|
| 450 |
+
|
| 451 |
+
$$
|
| 452 |
+
\mathcal { L } ( W _ { i + 1 } ) \leq \mathcal { L } ( W _ { i } ) + ( \gamma _ { i } - \rho \gamma _ { i } ^ { 2 } ) K _ { 1 } \gamma _ { i - L I } - ( \gamma _ { i } - \frac { \rho \gamma _ { i } ^ { 2 } } { 2 } ) \mathbb { E } _ { \hat { P } , \nu _ { B } } \left\| \nabla \mathcal { L } ( W _ { i } ) \right\| ^ { 2 } + \frac { \rho } { 2 } \gamma _ { i } ^ { 2 } K _ { 2 } \gamma _ { i - L I } .
|
| 453 |
+
$$
|
| 454 |
+
|
| 455 |
+
Summing up the above inequalities and re-arranging the terms, we obtain,
|
| 456 |
+
|
| 457 |
+
$$
|
| 458 |
+
\begin{array} { r l } & { \displaystyle \sum _ { i = 1 } ^ { N } ( \gamma _ { i } - \frac { \rho \gamma _ { i } ^ { 2 } } { 2 } ) \mathbb { E } _ { \hat { P } , \gamma _ { B } } \left\| \nabla \mathcal { L } ( W _ { i } ) \right\| ^ { 2 } } \\ & { \displaystyle \leq \mathcal { L } ( W _ { 1 } ) - \mathcal { L } ( W ^ { * } ) + K _ { 1 } \sum _ { i = 1 } ^ { N } ( \gamma _ { i } - \rho \gamma _ { i } ^ { 2 } ) \gamma _ { i - L I } + \frac { \rho K _ { 2 } } { 2 } \sum _ { i = 1 } ^ { N } \gamma _ { i } ^ { 2 } \gamma _ { i - L I } . } \end{array}
|
| 459 |
+
$$
|
| 460 |
+
|
| 461 |
+
Dividing both sides by $\begin{array} { r } { \sum _ { i = 1 } ^ { N } ( \gamma _ { i } - \frac { \rho \gamma _ { i } ^ { 2 } } { 2 } ) } \end{array}$
|
| 462 |
+
|
| 463 |
+
$$
|
| 464 |
+
\begin{array} { r l } & { \quad \mathbb { E } _ { R \sim P _ { R } } \mathbb { E } _ { \hat { P } , \gamma _ { B } } \left\| \nabla \mathcal { L } ( W _ { R } ) \right\| ^ { 2 } } \\ & { \le 2 \frac { \mathcal { L } ( W _ { 1 } ) - \mathcal { L } ( W ^ { * } ) + K _ { 1 } \sum _ { i = 1 } ^ { N } ( \gamma _ { i } - \rho \gamma _ { i } ^ { 2 } ) \gamma _ { i - L I } + \frac { \rho K _ { 2 } } { 2 } \sum _ { i = 1 } ^ { N } \gamma _ { i } ^ { 2 } \gamma _ { i - L I } } { \sum _ { i = 1 } ^ { N } \gamma _ { i } ( 2 - \rho \gamma _ { i } ) } . } \end{array}
|
| 465 |
+
$$
|
| 466 |
+
|
| 467 |
+
Taking $\gamma _ { i } = \gamma : = \operatorname* { m i n } \{ \textstyle \frac { 1 } { \rho } , \frac { 1 } { \sqrt { N } } \}$ , for all $i = 1 , \ldots , N$ , we have
|
| 468 |
+
|
| 469 |
+
$$
|
| 470 |
+
\begin{array} { r l } & { \mathbb { E } _ { R \sim P _ { n } } \mathbb { E } _ { \hat { P } , \gamma _ { \mathcal { N } _ { \beta } } } \left\| \nabla \mathcal { L } ( W _ { R } ) \right\| ^ { 2 } } \\ & { \le 2 \frac { \mathcal { L } ( W _ { 1 } ) - \mathcal { L } ( W ^ { * } ) + K _ { 1 } N ( \gamma - \rho \gamma ^ { 2 } ) \gamma + \frac { \rho K _ { 2 } } { 2 } N \gamma ^ { 3 } } { N \gamma ( 2 - \rho \gamma ) } } \\ & { \le 2 \frac { \mathcal { L } ( W _ { 1 } ) - \mathcal { L } ( W ^ { * } ) + K _ { 1 } N ( \gamma - \rho \gamma ^ { 2 } ) \gamma + \frac { \rho K _ { 2 } } { 2 } N \gamma ^ { 3 } } { N \gamma } } \\ & { \le 2 \frac { \mathcal { L } ( W _ { 1 } ) - \mathcal { L } ( W ^ { * } ) } { N \gamma } + K _ { 1 } \gamma ( 1 - \rho \gamma ) + \rho K _ { 2 } \gamma ^ { 2 } } \\ & { \le 2 \frac { \mathcal { L } ( W _ { 1 } ) - \mathcal { L } ( W ^ { * } ) ) + K _ { 2 } } { N } + \frac { 2 ( \mathcal { L } ( W _ { 1 } ) - \mathcal { L } ( W ^ { * } ) ) + K _ { 1 } } { \sqrt { N } } . } \end{array}
|
| 471 |
+
$$
|
| 472 |
+
|
| 473 |
+
Particularly, when $N \infty$ , we have $\mathbb { E } _ { R \sim P _ { R } } \mathbb { E } _ { \hat { P } , \mathcal { V } _ { B } } \left. \nabla \mathcal { L } ( W _ { R } ) \right. ^ { 2 } = 0$ , which implies that the gradient is asymptotically unbiased.
|
| 474 |
+
|
| 475 |
+
# C DERIVATION OF THE VARIANCE
|
| 476 |
+
|
| 477 |
+
$$
|
| 478 |
+
\begin{array} { l } { { \displaystyle \mathrm { V a r } [ u ] = \mathbb { E } \left[ \sum _ { v } p _ { v } ( h _ { v } - \mu _ { v } ) \right] ^ { 2 } } } \\ { ~ = \sum _ { v } p _ { v } ^ { 2 } \mathbb { E } \left[ \left( h _ { v } - \mu _ { v } \right) \right] ^ { 2 } } \\ { ~ = \sum _ { v } p _ { v } ^ { 2 } s _ { v } ^ { 2 } } \\ { ~ = s ^ { 2 } . } \end{array}
|
| 479 |
+
$$
|
| 480 |
+
|
| 481 |
+
$$
|
| 482 |
+
\begin{array} { l } { \displaystyle \mathrm { V a r } [ u _ { N S } ] = \mathbb { E } \left[ D p _ { v ^ { \prime } } h _ { v ^ { \prime } } - \mu \right] ^ { 2 } } \\ { \displaystyle \quad = \mathbb { E } _ { v ^ { \prime } } \{ D ^ { 2 } p _ { v ^ { \prime } } ^ { 2 } ( \mu _ { v ^ { \prime } } ^ { 2 } + s _ { v ^ { \prime } } ^ { 2 } ) + \mu ^ { 2 } - D \mu p _ { v ^ { \prime } } \mu _ { v p } \} } \\ { \displaystyle \quad = D s ^ { 2 } + ( D \sum _ { v } p _ { v } ^ { 2 } \mu _ { v } ^ { 2 } - \mu ^ { 2 } ) } \\ { \displaystyle \quad = D s ^ { 2 } + \frac { 1 } { 2 } \sum _ { v , v ^ { \prime } } ( p _ { v } \mu _ { v } - p _ { v ^ { \prime } } \mu _ { v ^ { \prime } } ) ^ { 2 } . } \end{array}
|
| 483 |
+
$$
|
| 484 |
+
|
| 485 |
+
$$
|
| 486 |
+
\begin{array} { r l } { \operatorname { S u p } _ { \infty \leq t \leq \frac { 1 } { 2 } } \{ \operatorname* { S u p } _ { \infty } \Delta \mathbf { b } _ { t - 1 } , \ \sum _ { p \leq t } ^ { \infty } \hat { \mu } _ { \tilde { \nu } _ { t } } ( \hat { \mu } _ { t - \frac { 1 } { 2 } } , \mathbf { a } _ { t } ) \} ^ { 2 } } \\ & - \omega _ { \tilde { \nu } _ { t } } ( \operatorname* { S u p } _ { \infty , \Delta \mathbf { b } _ { t - 1 } , \ \sum _ { p \leq t } ^ { \infty } \hat { \mu } _ { t } ( \hat { \mu } _ { t - \frac { 1 } { 2 } } , \mathbf { a } _ { t } ) ) ^ { 2 } } \\ & { - \omega _ { \tilde { \nu } _ { t } } \{ \operatorname* { S u p } _ { t \leq t } ^ { t } , \ \hat { \mu } _ { \tilde { \nu } _ { t } } ( \hat { \mu } _ { t - \frac { 1 } { 2 } } , \mathbf { a } _ { t } ) \} ^ { 2 } } \\ & { - \omega _ { \tilde { \nu } _ { t } } \{ \operatorname* { S u p } _ { t \leq t } ^ { t } , \ \Delta \hat { \mu } _ { t - 1 } , \ \sum _ { p \leq t } ^ { \infty } \hat { \mu } _ { \tilde { \nu } _ { t } } ( \hat { \mu } _ { t - \frac { 1 } { 2 } } , \hat { \mu } _ { t } ^ { 2 } ) ^ { 2 } \} } \\ & { - \omega _ { \tilde { \nu } _ { t } } \{ 2 D _ { 0 } \gamma \Delta \mathbf { b } _ { t } \hat { \mu } _ { \Delta t - 1 } , \ 2 \Delta \hat { \mu } _ { 0 } , \ \sum _ { p \leq t } ^ { \infty } \hat { \mu } _ { \tilde { \nu } _ { t } } ( \hat { \mu } _ { t - \frac { 1 } { 2 } } , \hat { \mu } _ { t } ^ { 2 } ) \} } \\ & - \omega _ { \tilde { \nu } _ { t } } \{ \operatorname* { S u p } _ { t \leq t } \Delta \hat { \mu } _ { t - 1 } , \ 2 \Delta \hat { \mu } _ { 0 } , \ 2 \Delta \hat { \nu } _ { t } ( \hat { \mu } _ { t - \frac { 1 } { 2 } } , \Delta \hat { \mu } _ { t - 1 } , 2 \Delta \hat { \nu } _ { t } , 2 \Delta \hat { \mu } _ { t - 1 } , \end{array}
|
| 487 |
+
$$
|
| 488 |
+
|
| 489 |
+
$$
|
| 490 |
+
\begin{array} { r l } & { \mathrm { V a r } [ u _ { C V D } ] = \mathbb { E } \Bigg [ \sqrt { D } p _ { x } ( h _ { \nu ^ { \prime } } - \mu _ { \nu ^ { \prime } } ) + D p _ { \nu ^ { \prime } } \Delta \mu _ { \nu ^ { \prime } } + \sum _ { \nu } p _ { \nu } ( \bar { \mu } _ { \nu } - \mu _ { \nu } ) \Bigg ] ^ { 2 } } \\ & { \qquad \quad = \mathbb { E } \left[ \sqrt { D } p _ { \nu ^ { \prime } } ( h _ { \nu ^ { \prime } } - \mu _ { \nu ^ { \prime } } ) + D p _ { \nu ^ { \prime } } \Delta \mu _ { \nu ^ { \prime } } - \Delta \mu _ { \nu ^ { \prime } } ^ { 2 } \right] ^ { 2 } } \\ & { \qquad \quad = \mathrm { E } _ { \nu ^ { \prime } } \left\{ D p _ { \nu ^ { \prime } } ^ { 2 } \mathbb { E } ( h _ { \nu ^ { \prime } } - \mu _ { \nu ^ { \prime } } ) ^ { 2 } + D ^ { 2 } p _ { \nu ^ { \prime } } ^ { 2 } \Delta \mu _ { \nu ^ { \prime } } ^ { 2 } + \Delta \mu ^ { 2 } - 2 D p _ { \nu ^ { \prime } } \Delta \mu _ { \nu ^ { \prime } } \Delta \mu _ { \nu ^ { \prime } } ^ { 2 } \right\} } \\ & { \qquad \quad = \displaystyle \sum _ { \nu } p _ { \nu } ^ { 2 } s _ { \nu } ^ { 2 } + D \sum _ { \nu } p _ { \nu } ^ { 2 } \Delta \mu _ { \nu } ^ { 2 } + \Delta \mu ^ { 2 } - 2 \Delta \mu ^ { 2 } } \\ & { \qquad \quad = s ^ { 2 } + ( D \sum _ { \nu } p _ { \nu } ^ { 2 } \Delta \mu _ { \nu } ^ { 2 } - \Delta \mu ^ { 2 } ) } \\ & { \qquad \quad = s ^ { 2 } + \displaystyle \frac { 1 } { 2 } \sum _ { n , \nu ^ { \prime } } ( p _ { \nu } \Delta \mu _ { \nu } - p _ { \nu ^ { \prime } } \Delta \mu _ { \nu ^ { \prime } } ) ^ { 2 } . } \end{array}
|
| 491 |
+
$$
|
| 492 |
+
|
| 493 |
+
# D EXPERIMENT SETUP
|
| 494 |
+
|
| 495 |
+
In this sections we describe the details of our model architectures. We use the Adam optimizer Kingma & Ba (2014) with learning rate 0.01.
|
| 496 |
+
|
| 497 |
+
• Citeseer, Cora, PubMed and NELL: We use the same architecture as Kipf & Welling (2017): two graph convolution layers with one linear layer per graph convolution layer. We use 32 hidden units, $50 \%$ dropout rate and $5 \times 1 0 ^ { - 4 } \mathrm { L } \dot { 2 }$ weight decay for Citeseer, Cora and PubMed and 64 hidden units, $10 \%$ dropout rate and $1 0 ^ { - 5 } \dot { \mathrm { L } } 2$ weight decay for NELL. PPI and Reddit: We use the mean pooling architecture proposed by Hamilton et al. (2017a). We use two linear layers per graph convolution layer. We set weight decay to be zero, dropout rate to be $0 . 2 \%$ , and adopt layer normalization (Ba et al., 2016) after each linear layer. We use 512 hidden units for PPI and 128 hidden units for Reddit. We find that our architecture can reach $9 7 . 8 \%$ testing micro-F1 on the PPI dataset, which is significantly higher than $5 9 . 8 \%$ reported by Hamilton et al. (2017a). We find the improvement is from wider hidden layer, dropout and layer normalization.
|
| 498 |
+
|
| 499 |
+
# Algorithm 1 Training with the CV algorithm
|
| 500 |
+
|
| 501 |
+
for each minibatch $\mathcal { V } _ { B } \subset \mathcal { V } \mathbf { d o }$ Randomly sample propagation matrices Pˆ(0), . . . , Pˆ(L−1) Compute the receptive fields $\mathbf { m } ^ { ( 0 ) } , \ldots , \mathbf { m } ^ { ( L - 1 ) }$ (Forward propgation) for each layer $l 0$ to $L - 1$ do $\begin{array} { r l } & { \dot { Z } ^ { ( l + 1 ) } \dot { } ( \hat { P } ^ { ( l ) } ( H ^ { ( l ) } - \bar { H } ^ { ( l ) } + P \bar { H } ^ { ( l ) } ) W ^ { ( l ) } } \\ & { \dot { H } ^ { ( l + 1 ) } \sigma ( Z ^ { ( l + 1 ) } ) } \end{array}$ end for Compute the loss $\begin{array} { r } { \mathcal { L } = \frac { 1 } { | \mathcal { V } _ { B } | } \sum _ { v \in \mathcal { V } _ { B } } f ( y _ { v } , Z _ { v } ^ { ( L ) } ) } \end{array}$ (Backward propagation) $\boldsymbol { W } \boldsymbol { W } - \gamma _ { i } \nabla _ { \boldsymbol { W } } \mathcal { L }$ (Update historical activations) for each layer $l 0$ to $L - 1$ do $\bar { H } ^ { ( l ) } \gets \mathbf { m } ^ { ( l ) } H ^ { ( l ) } + ( 1 - \mathbf { m } ^ { ( l ) } ) \bar { H } ^ { ( l ) }$ end for
|
| 502 |
+
end for
|
| 503 |
+
|
| 504 |
+
# Algorithm 2 Training with the CVD algorithm
|
| 505 |
+
|
| 506 |
+
for each minibatch $\mathcal { V } _ { B } \subset \mathcal { V } \mathbf { d o }$ Randomly sample propagation matrices Pˆ(0), . . . , Pˆ(L−1) Compute the receptive fields m(0), $\mathbf { m } ^ { ( 0 ) } , \ldots , \mathbf { m } ^ { ( L - 1 ) }$ (Forward propgation) for each layer $l 0$ to $L - 1$ do $\begin{array} { r l } & { U \gets \Big ( \bar { P } ^ { ( l ) } ( H ^ { ( l ) } - \mu ^ { ( l ) } ) + \hat { P } ^ { ( l ) } ( \mu ^ { ( l ) } - \bar { \mu } ^ { ( l ) } ) + P \bar { H } ^ { ( l ) } \Big ) } \\ & { H ^ { ( l + 1 ) } \gets \sigma ( \mathrm { D r o p o u t } _ { p } ( U ) W ^ { ( l ) } ) } \\ & { \mu ^ { ( l + 1 ) } \gets \sigma ( U W ^ { ( l ) } ) } \end{array}$ end for Compute the loss $\begin{array} { r } { \mathcal { L } = \frac { 1 } { | \mathcal { V } _ { B } | } \sum _ { v \in \mathcal { V } _ { B } } f ( y _ { v } , H _ { v } ^ { ( L ) } ) } \end{array}$ (Backward propagation) $W W \overline { { - \gamma _ { i } } } \bar { \nabla } _ { W } \mathcal { L }$ (Update historical activations) for each layer $l 0$ to $L - 1$ do $\bar { \mu } ^ { ( l ) } \gets \mathbf { m } ^ { ( l ) } \mu ^ { ( l ) } + ( 1 - \mathbf { m } ^ { ( l ) } ) \bar { \mu } ^ { ( l ) }$ end for
|
| 507 |
+
end for
|
| 508 |
+
|
| 509 |
+
# E PSEUDOCODE
|
| 510 |
+
|
| 511 |
+
# E.1 TRAINING WITH THE CV ESTIMATOR
|
| 512 |
+
|
| 513 |
+
Alg. 1 depicts the training algorithm using the CV estimator in Sec. 4.1. We perform forward propagation according to Eq. (5,6), compute the stochastic gradient, and then update the historical activations $\bar { H } ^ { ( l ) }$ according to Eq. (6). We omit the subscripts $C V$ and the iteration number $i$ for concise. Let $W = ( W ^ { ( 0 ) } , \dots , W ^ { ( L - 1 ) } )$ be all the trainable parameters, the gradient $\nabla _ { W } \mathcal { L }$ is computed automatically by frameworks such as TensorFlow. The diagonal matrix $\mathbf { m } ^ { ( l ) }$ denotes the receptive field at layer $l$ , i.e., the nodes that need to be computed in order to approximate $z _ { v } ^ { ( l ) }$ for $v$ in the minibatch $\gamma _ { B }$ . We only need to compute and update the activations $\hat { H } ^ { ( l ) } , Z ^ { ( l ) } , \bar { H } ^ { ( l ) }$ for nodes in $\mathbf { m } ^ { ( l ) }$ .
|
| 514 |
+
|
| 515 |
+

|
| 516 |
+
Figure 6: Comparison of validation accuracy with respect to number of epochs for 3-layer GCNs.
|
| 517 |
+
|
| 518 |
+
Table 5: Time to reach 0.95 testing accuracy.
|
| 519 |
+
|
| 520 |
+
<table><tr><td>Alg.</td><td>Valid. acc.</td><td>Epochs</td><td>Time (s)</td><td>Sparse GFLOP</td><td>Dense TFLOP</td></tr><tr><td>Exact</td><td>0.940</td><td>3.0</td><td>199</td><td>306</td><td>11.7</td></tr><tr><td>NS</td><td>0.940</td><td>24.0</td><td>148</td><td>33.6</td><td>9.79</td></tr><tr><td>NS+PP</td><td>0.940</td><td>12.0</td><td>68</td><td>2.53</td><td>4.89</td></tr><tr><td>CV+PP</td><td>0.940</td><td>5.0</td><td>32</td><td>8.06</td><td>2.04</td></tr><tr><td>CVD+PP</td><td>0.940</td><td>5.0</td><td>36</td><td>16.1</td><td>4.08</td></tr></table>
|
| 521 |
+
|
| 522 |
+
# E.2 TRAINING WITH THE CVD ESTIMATOR
|
| 523 |
+
|
| 524 |
+
Training with the CVD estimator is similar with the CV estimator, except it runs two versions of the network, with and without dropout, to compute the samples $H$ and their mean $\mu$ of the activation. The matrix $\bar { P } _ { v , v ^ { \prime } } = \hat { P } _ { v , v ^ { \prime } } / \sqrt { | \mathbf { n } ( v , 1 ) | }$ , where $| \mathbf n ( v , 1 ) |$ is the degree of node $v$ .
|
| 525 |
+
|
| 526 |
+
# F EXPERIMENT FOR 3-LAYER GCNS
|
| 527 |
+
|
| 528 |
+
We test 3-layer GCNs on the Reddit dataset. The settings are the same with 2-layer GCNs in Sec. 5.3. To ensure the exact algorithm can run in a reasonable amount of time, we subsample the graph so that the maximum degree is 10. The convergence result is shown as Fig. 6, which is similar with the two-layer models. The time consumption to reach 0.94 testing accuracy is shown in Table 5.
|
| 529 |
+
|
| 530 |
+
# G JUSTIFICATION OF THE INDEPENDENT GAUSSIAN ASSUMPTION
|
| 531 |
+
|
| 532 |
+
# G.1 RESULTS FOR 2-LAYER GCNS
|
| 533 |
+
|
| 534 |
+
We justify the independent Gaussian assumption in Sec. 4.3 by showing that for a 2-layer GCN with the first layer pre-processed, the neighbor’s activations are independent. Without loss of generality, suppose that we want to compute $\bar { z } _ { 1 } ^ { ( 2 ) }$ , and the neighbors of node 1 are $1 , \ldots , D$ . By Eq. (1), $h _ { v } ^ { ( 1 ) } = \sigma \left( ( \phi _ { v } \circ u _ { v } ^ { ( 0 ) } ) W ^ { ( 0 ) } \right)$ is a random variable with respect to $\phi _ { v }$ , where $\phi _ { v } \sim \mathrm { B e r n o u l l i } ( p )$ is the dropout mask and $u _ { v } ^ { ( 0 ) } = ( P H ^ { ( 0 ) } ) _ { v }$ . The indepedent Gaussian assumption states that
|
| 535 |
+
|
| 536 |
+
1. $h _ { v } ^ { ( 1 ) }$ is a Gaussian random variable with diagonal covariance;
|
| 537 |
+
2. $h _ { v } ^ { ( 1 ) }$ ) and h(1)v0 are independent, for $v \neq v ^ { \prime }$ .
|
| 538 |
+
|
| 539 |
+
Assumption 1 is not GCN-specific and is discussed in Wang & Manning (2013), we now prove assumption 2 by the following lemma.
|
| 540 |
+
|
| 541 |
+
Lemma 3. If a and b are independent random variables, then their transformations $f _ { 1 } ( a )$ and $f _ { 2 } ( b )$ are independent.
|
| 542 |
+
|
| 543 |
+
Because for any event $A$ and $B$ , ${ \cal P } ( f _ { 1 } ( a ) \in f _ { 1 } ( A ) , f _ { 2 } ( b ) \in f _ { 2 } ( B ) ) = { \cal P } ( a \in A , b \in B ) =$ $P ( a \in A ) P ( b \in B ) = P ( f _ { 1 } ( a ) \in f _ { 1 } ( A ) ) P ( f _ { 2 } ( B ) \in f _ { 2 } ( B ) )$ , where $f _ { 1 } ( A ) = \{ f _ { 1 } ( a ) | a \in A \}$ and $f _ { 2 } ( B ) = \{ f _ { 2 } ( b ) | b \in B \}$ .
|
| 544 |
+
|
| 545 |
+

|
| 546 |
+
Figure 7: Average feature and neighbor correlations in a 10-layer GCN.
|
| 547 |
+
|
| 548 |
+
Let $h _ { v } ^ { ( 1 ) } = f _ { 1 } ( \phi _ { v } ) : = \sigma \left( ( \phi _ { v } \circ u _ { v } ^ { ( 0 ) } ) W ^ { ( 0 ) } \right)$ and $h _ { v ^ { \prime } } ^ { ( 1 ) } = f _ { 1 } ( \phi _ { v ^ { \prime } } ) : = \sigma \left( ( \phi _ { v ^ { \prime } } \circ u _ { v ^ { \prime } } ^ { ( 0 ) } ) W ^ { ( 0 ) } \right)$ , because $\phi _ { v }$ and $\phi _ { v ^ { \prime } }$ are independent Bernoulli random variables, $h _ { v } ^ { ( 1 ) }$ and $h _ { v ^ { \prime } } ^ { ( 1 ) }$ are independent.
|
| 549 |
+
|
| 550 |
+
The result can be further generalized to deeper models. If the receptive fields of two nodes does not overlap, they should be independent.
|
| 551 |
+
|
| 552 |
+
# G.2 EMPIRICAL RESULTS FOR DEEPER GCNS
|
| 553 |
+
|
| 554 |
+
Because we only sample two neighbors per node, the sampled subgraph is very close to a graph with all its nodes isolated, which reduces to the MLP case that Wang & Manning (2013) discuss.
|
| 555 |
+
|
| 556 |
+
We empirically study the correlation between feature dimensions and neighbors. The definition of the correlation between feature dimensions is the same with Wang & Manning (2013). For each node $v$ on layer $l$ , we compute the correlation between each feature dimension of $h _ { v } ^ { ( l ) }$
|
| 557 |
+
|
| 558 |
+
$$
|
| 559 |
+
\begin{array} { r l } & { \mathrm { C o v } _ { i j } ^ { ( l , v ) } : = \mathbb { C } [ h _ { v i } ^ { ( l ) } , h _ { v j } ^ { ( l ) } ] } \\ & { \mathrm { C o r r } _ { i j } ^ { ( l , v ) } : = \frac { \mathrm { C o v } _ { i j } ^ { ( l , v ) } } { \sqrt { \mathrm { C o v } _ { i i } ^ { ( l , v ) } } \sqrt { \mathrm { C o v } _ { j j } ^ { ( l , v ) } } } , } \end{array}
|
| 560 |
+
$$
|
| 561 |
+
|
| 562 |
+
where $i$ and $j$ are the indices for different hidden dimensions, and $\mathbb { C } [ X , Y ] = \mathbb { E } [ ( X - \mathbb { E } X ) ( Y -$
|
| 563 |
+
$\mathbb { E } Y ) _ { . }$ ] is the covariance between0 samples of the activations o ranand variables , by runnin $X$ and he fo $Y$ . We approximateard propagation 1,0 $\mathrm { C o v } _ { i j } ^ { ( l , v ) }$ with with $h _ { v i } ^ { ( l ) }$ $h _ { v j } ^ { ( l ) }$ ?,
|
| 564 |
+
different dropout masks. We define the average feature correlation on layer $l$ to be $\mathrm { C o v } _ { i j } ^ { ( l , v ) }$ averaged
|
| 565 |
+
by the nodes $v$ and dimension pairs $i \neq j$ .
|
| 566 |
+
|
| 567 |
+
To compute the correlation between neighbors, we treat each feature dimension separately. For $l + 1$ nt e at $v$ , and dimensre needed by $d$ we com, where trix of all the activations is the set of subsampled $\{ h _ { i d } ^ { ( l ) } | i \in \bar { \mathbf { n } } ^ { ( l ) } ( v ) \}$ $h _ { v d } ^ { ( l + 1 ) }$ $\bar { \mathbf { n } } ^ { ( l ) } ( v ) = \{ i \vert \hat { P } _ { v i } ^ { ( l ) } \neq 0 \}$ neighbors for node $v$
|
| 568 |
+
|
| 569 |
+
$$
|
| 570 |
+
\begin{array} { r l } & { \mathrm { C o v } _ { i j } ^ { ( l , v , d ) } : = \mathbb { C } [ h _ { i d } ^ { ( l ) } , h _ { j d } ^ { ( l ) } ] } \\ & { \mathrm { C o r r } _ { i j } ^ { ( l , v , d ) } : = \frac { \mathrm { C o v } _ { i j } ^ { ( l , v , d ) } } { \sqrt { \mathrm { C o v } _ { i i } ^ { ( l , v , d ) } } \sqrt { \mathrm { C o v } _ { j j } ^ { ( l , v , d ) } } } , } \end{array}
|
| 571 |
+
$$
|
| 572 |
+
|
| 573 |
+
where the indices $i , j \in \bar { \bf n } ^ { ( l ) } ( v )$ . Then, we compute the average correlation of all pairs of neighbors $i \neq j$ .
|
| 574 |
+
|
| 575 |
+
$$
|
| 576 |
+
\mathrm { A v g C o r r } ^ { ( l , v , d ) } : = \frac { 1 } { \left| \bar { \mathbf { n } } ^ { ( l ) } ( v ) \right| \left( \left| \bar { \mathbf { n } } ^ { ( l ) } ( v ) \right| - 1 \right) } \sum _ { i \neq j } \mathrm { C o r r } _ { i j } ^ { ( l , v , d ) } ,
|
| 577 |
+
$$
|
| 578 |
+
|
| 579 |
+
and define the average neighbor correlation on layer $l$ as $\mathbf { A v g C o r r } ^ { ( l , v , d ) }$ averaged over all the nodes $v$ and dimensions $d$ .
|
| 580 |
+
|
| 581 |
+
We report the average feature correlation and the average neighbor correlation per layer, on the Citeseer, Cora, PubMed and PPI datasets. These quantities are too expensive to compute for NELL and Reddit. On each dataset, we train a GCN with 10 graph convoluation layers until early stopping criteria is met, and compute the average feature correlation and the average neighbor correlation for layer 1 to 9. We are not interested in the correlation on layer 10 because there are no more graph convolutional layers after it. The result is shown as Fig. 7. As analyzed in Sec. G.1, the average neighbor correlation is close to zero on the first layer, but it is not exactly zero due to the finite sample size for computing the empirical covariance. There is no strong tendency of increased correlation as the number of layers increases, after the third layer. The average neighbor correlation and the average feature correlation remain on the same order of magnitude, so bringing correlated neighbors does not make the activations much more correlated than the MLP case (Wang & Manning, 2013). Finally, both correlations are much smaller than one.
|
md/train/sy4Kg_ZQmS7/sy4Kg_ZQmS7.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
md/train/zx_uX-BO7CH/zx_uX-BO7CH.md
ADDED
|
@@ -0,0 +1,487 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CONTEXTUAL TRANSFORMATION NETWORKS FOR ONLINE CONTINUAL LEARNING
|
| 2 |
+
|
| 3 |
+
Quang Pham1, Chenghao $\mathbf { L i u ^ { 2 } }$ , Doyen Sahoo2, Steven C.H. Hoi 1,2
|
| 4 |
+
|
| 5 |
+
1 Singapore Management University
|
| 6 |
+
hqpham.2017@smu.edu.sg
|
| 7 |
+
2 Salesforce Research Asia
|
| 8 |
+
{chenghao.liu, dsahoo, shoi}@salesforce.com
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
Continual learning methods with fixed architectures rely on a single network to learn models that can perform well on all tasks. As a result, they often only accommodate common features of those tasks but neglect each task’s specific features. On the other hand, dynamic architecture methods can have a separate network for each task, but they are too expensive to train and not scalable in practice, especially in online settings. To address this problem, we propose a novel online continual learning method named “Contextual Transformation Networks” (CTN) to efficiently model the task-specific features while enjoying neglectable complexity overhead compared to other fixed architecture methods. Moreover, inspired by the Complementary Learning Systems (CLS) theory, we propose a novel dual memory design and an objective to train CTN that can address both catastrophic forgetting and knowledge transfer simultaneously. Our extensive experiments show that CTN is competitive with a large scale dynamic architecture network and consistently outperforms other fixed architecture methods under the same standard backbone. Our implementation can be found at https://github. com/phquang/Contextual-Transformation-Network.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
Continual learning is a promising framework towards building AI models that can learn continuously through time, acquire new knowledge while being able to perform its already learned skills (French, 1999; 1992; Parisi et al., 2019; Ring, 1997). On top of that, online continual learning is particularly interesting because it resembles the real world and the model has to quickly obtain new knowledge on the fly by levering its learned skills. This problem is important for deep neural networks because optimizing them in the online setting has been shown to be challenging (Sahoo et al., 2018; Aljundi et al., 2019a). Moreover, while it is crucial to obtain new information, the model must be able to perform its acquired skills. Balancing between preventing catastrophic forgetting and facilitating knowledge transfer is imperative when learning on a stream of tasks, which is ubiquitous in realistic scenarios. Thus, in this work, we focus on the continual learning setting in an online learning fashion, where both tasks and data of each task arrive sequentially (Lopez-Paz & Ranzato, 2017).
|
| 17 |
+
|
| 18 |
+
In the literature, fixed architecture methods employ a shared feature extractor and a set of classifiers, one for each task (Lopez-Paz & Ranzato, 2017; Chaudhry et al., 2019a;b; Aljundi et al., 2019a). Although using a shared feature extractor has achieved promising results, the common and global features are rather generic and not well-tailored towards each specific task. This problem is even more severe when old data are limited while learning new tasks. As a result, the common feature extractor loses its ability to extract previous tasks’ features, resulting in catastrophic forgetting. On the other hand, while dynamic architecture methods such as Rusu et al. (2016); Li et al. (2019); Xu & Zhu (2018) alleviate this problem by having a separate network for each task, they suffer from the unbounded growth of the parameters. Moreover, the subnetworks’ design is not trivial and requires extensive resource usage (Rusu et al., 2016; Li et al., 2019), which is not practical in many applications. These limitations motivated us to develop a novel method that can facilitate continual learning with a fixed architecture by modeling the task-specific features.
|
| 19 |
+
|
| 20 |
+

|
| 21 |
+
Figure 1: Overview of the Contextual Transformation Networks (CTN). CTN consists of a controller $\pmb \theta$ that modifies the features of the base model $\phi$ . The base model is trained using experience replay on the episodic memory while the controller is trained to generalize to the semantic memory, which addresses both alleviating forgetting and facilitating knowledge transfer. Best viewed in colors.
|
| 22 |
+
|
| 23 |
+
To achieve this goal, we first revisit a popular result in learning multiple tasks that each task’s features are centered around a common vector (Evgeniou & Pontil, 2004; Aytar & Zisserman, 2011; Pentina & Lampert, 2014; Liu et al., 2019b). This result motivates us to develop a novel framework of Contextual Transformation Networks (CTN), which consists of a base network that learns the common features of a given input and a controller that efficiently transforms the common features to become task-specific, given a task identifier. While one can train CTN using experience replay, it does not explicitly aim at achieving a good trade-off between stability and plasticity. Therefore, we propose a novel dual memory system and a learning method that encapsulate alleviating forgetting and facilitating knowledge transfer simultaneously. Particularly, we propose two distinct memories: the episodic memory and the semantic memory associated with the base model and the controller, respectively. Then, the base model is trained by experience replay on the episodic memory while the controllers is trained to learn task-specific features that can generalize to the semantic memory. As a result, CTN achieves a good trade-off between preventing catastrophic forgetting and facilitating knowledge transfer because the task-specific features can generalize well to all past and current tasks. Figure 1 gives an overview of the proposed Contextual Transformation Network (CTN).
|
| 24 |
+
|
| 25 |
+
Interestingly, the designs of our CTN and dual memory are partially related to the Complementary Learning Systems (CLS) theory in neuroscience (McClelland et al., 1995; Kumaran et al., 2016). Particularly, the controller acts as a neocortex that learns the structured knowledge of each task. In contrast, the base model acts as a hippocampus that performs rapid learning to acquire new information from the current task’s training data. Following the naming convention of memory in neuroscience, our CTN is equipped with two replay memory types. (i) the episodic memory (associated with the hippocampus) caches a small amount of past tasks’ training data, which will be replayed when training the base networks. (ii) the semantic memory (associated with the neocortex) stores another distinct set of old data only used to train the controller such that the task-specific features can generalize well across tasks. Moreover, the CLS theory also suggests that the interplay between the neocortex and the hippocampus attributes to the ability to recall knowledge and generalize to novel experiences (Kumaran & McClelland, 2012). Our proposed learning approach closely characterizes such properties: the base model focuses on acquiring new knowledge from the current task while the controller uses the base model’s knowledge to generalize to novel samples.
|
| 26 |
+
|
| 27 |
+
In summary, our work makes the following contributions. First, we propose CTN, a novel continual learning method that can model task-specific features while enjoying neglectable complexity overhead compared to fixed architecture methods (please refer to Table 4). Second, we propose a novel objective that can improve the trade-off between alleviating forgetting and facilitating knowledge transfer to train CTN. Third, we conduct extensive experiments on continual learning benchmarks to demonstrate the efficacy of CTN compared to a suite of baselines. Finally, we provide a comprehensive analysis to investigate the complementarity of each CTN’s component.
|
| 28 |
+
|
| 29 |
+
# 2 METHOD
|
| 30 |
+
|
| 31 |
+
Notations. We denote $\phi$ as parameter of the base model that extracts global features from the input and $\pmb { \theta }$ as the parameter of the controller which modifies the features from $\phi$ given a task identifier $t$ . The task identifier can be a set of semantic attributes about objects of that task (Lampert et al., 2009) or simply an index of the task, which we use in this work as a one-hot vector. A prediction is given as $g _ { \varphi _ { t } } \bar { ( h _ { \phi , \theta } ( \pmb { x } , t ) ) }$ , where $g _ { \varphi _ { t } } ( \cdot )$ is the task $\tau _ { t }$ ’s classifier with parameter $\varphi _ { t }$ such as a fully connected layer with softmax activation. And $h _ { \phi , \theta } ( { \pmb x } , t )$ is the final feature after transformed by the controller. We denote $D _ { t } ^ { t r }$ as the training data of task $\mathcal { T } _ { t }$ , $\mathcal { M } _ { t } ^ { e m }$ and $\mathcal { M } _ { t } ^ { s m }$ as the episodic memory and the semantic memory of task $\mathcal { T } _ { t }$ respectively. The episodic memory and semantic memory maintains two distinct sets of data obtained from task $\mathcal { T } _ { t }$ . The episodic memory of task $\mathcal { T } _ { 1 } , \ldots , \mathcal { T } _ { t - 1 }$ is denoted as $\mathcal { M } _ { < t } ^ { e m }$ ; similarly, $\mathcal { M } _ { < t } ^ { s m }$ denotes the semantic memory of the first $t - 1$ tasks.
|
| 32 |
+
|
| 33 |
+
Remark. Both the $\mathcal { M } _ { t } ^ { e m }$ and $\mathcal { M } _ { t } ^ { s m }$ are obtained from $D _ { t } ^ { t r }$ through the learner’s internal memory management strategy and contains distinct samples from each other such that their combined sizes do not exceed a pre-defined budget.
|
| 34 |
+
|
| 35 |
+
# 2.1 LEARNING TASK-SPECIFIC FEATURES FOR CONTINUAL LEARNING
|
| 36 |
+
|
| 37 |
+
Given a backbone network, one can implement the task-specific features by employing a set of task-specific filters and applying them to the backbone’s output. However, this trivial approach is not scalable, even for small networks. In the worst case, it results in storing an additional network per task, which violates the fixed architecture constraint. Since we want to obtain task-specific features with minimal parameter overhead, we propose to use a feature-wise transformation (Perez et al., 2018) to efficiently extract the task-specific features $\tilde { h } ( { \boldsymbol x } , t )$ from the common features $\hat { h } ( { \pmb x } )$ as follows:
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\widetilde { h } ( \pmb { x } ; t ) = \frac { \gamma _ { t } } { \| \gamma _ { t } \| _ { 2 } } \otimes \hat { h } ( \pmb { x } ) + \frac { \beta _ { t } } { \| \beta _ { t } \| _ { 2 } } \mathrm { ~ a n d ~ } \left\{ \gamma _ { t } , \beta _ { t } \right\} = c _ { \pmb { \theta } } ( t ) ,
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
where $\otimes$ denotes the element-wise multiplication operator, and $c _ { \pmb \theta } ( t )$ is the controller implemented as a linear layer with parameter $\pmb { \theta }$ that predicts the transformation coefficients $\{ \gamma _ { t } , \beta _ { t } \}$ given the task identifier $t$ . Since the task identifiers are one-hot vectors, which are sparse and make training the controller difficult, we also introduce an embedding layer to map the task identifiers to dense, low dimensional vectors. For simplicity, we will use $\pmb \theta$ to refer to both the embedding and the linear layer parameters. In addition, instead of storing a set of coefficients $\{ \gamma _ { t } , \beta _ { t } \}$ for each task, we only need a fixed set of parameter $\pmb \theta$ to predict these coefficients, which results in the fixed parameters in the controller. The coefficients $\{ \gamma _ { t } , \beta _ { t } \}$ are $\ell _ { 2 }$ -normalized and then transforms the common features $\hat { h } ( { \pmb x } , t )$ to become task-specific features $\tilde { h } ( \boldsymbol { x } ; t )$ . Finally, both feature types are combined by a residual connection before passing to the corresponding classifier $g _ { t } ( \cdot )$ to make the final prediction:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
g _ { \varphi _ { t } } ( \sigma ( h ( \boldsymbol { x } , t ) ) ) , \ \mathrm { a n d } \ h ( \boldsymbol { x } , t ) = \hat { h } ( \boldsymbol { x } , t ) + \tilde { h } ( \boldsymbol { x } , t ) ,
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
where $\sigma ( \cdot )$ is a nonlinear activation function such as ReLU. Importantly, when the task-specific features are removed, i.e., $\tilde { h } ( { \boldsymbol x } , t ) = 0$ , Eq. 2 reduces to the traditional experience replay. Lastly, for each incoming task, CTN has to allocate a new classifier, which is the same for all continual learning methods, and a new embedding vector, which is usually low dimensional, e.g. 32 or 64. Therefore, CTN enjoys almost the same parameter growth as existing continual learning methods.
|
| 50 |
+
|
| 51 |
+
# 2.2 TRAINING THE CONTROLLER
|
| 52 |
+
|
| 53 |
+
While one can train CTN with experience replay (ER), it does not explicitly address the trade-off between facilitating knowledge transfer and alleviating catastrophic forgetting. This motivates us to develop a novel training method that can simultaneously address both problems by leveraging the controller’s task-specific features. First, we introduce a dual memory system consisting of the semantic memory $\mathcal { M } _ { t } ^ { s m }$ associated with the controller and the episodic memory $\mathcal { M } _ { t } ^ { e m }$ associated with the base model. We propose to train only the base model using experience replay with the episodic memory to obtain new knowledge from incoming tasks. The controller is also trained so that the task-specific features can generalize to unseen samples to the base model stored in the semantic memory. As a result, the task-specific features can generalize to both previous and current tasks, which simultaneously encapsulate both alleviating forgetting and facilitating knowledge transfer. Formally, given the current batch of data for task $\mathcal { T } _ { t }$ as $B _ { t }$ , the training of CTN can be formulated as the following bilevel optimization problem (Colson et al., 2007):
|
| 54 |
+
|
| 55 |
+
$$
|
| 56 |
+
\begin{array} { r l } { \mathrm { O u t e r ~ p r o b l e m : } } & { \operatorname* { m i n } _ { \theta } \mathcal { L } ^ { c t r l } ( \{ \phi ^ { * } , \theta \} ; \mathcal { M } _ { < t + 1 } ^ { s m } ) } \\ { \mathrm { I n n e r ~ p r o b l e m : } } & { \mathrm { s . t } \quad \phi ^ { * } = \arg \underset { \phi } { \operatorname* { m i n } } \mathcal { L } ^ { t r } ( \{ \phi , \theta \} , \mathcal { B } _ { t } \cup \mathcal { M } _ { < t } ^ { e m } ) , } \end{array}
|
| 57 |
+
$$
|
| 58 |
+
|
| 59 |
+
where $\phi ^ { * }$ denotes the optimal base model corresponding to the current controller $\pmb { \theta }$ . Since every CTN’s prediction always involves both the controller and the base model, we use $\mathcal { L } ^ { t r } ( \{ \phi , \pmb { \theta } \} , B _ { t } \cup \mathcal { M } _ { < t } ^ { e m } )$ to denote the training loss of the pair $\{ \phi , \theta \}$ on the data $B _ { t } \cup \mathcal { M } _ { < t } ^ { e m }$ . Similarly, $L ^ { c t r l } ( \cdot )$ denotes the controller’s loss. For simplicity, we omitted the dependency of the the loss on the classifiers’ parameters and imply that the classifiers are jointly updated with the base model. Since we do not know the optimal transformation coefficients of any task, the controller is trained to minimize the classification loss of the samples via $\phi$ . We implement both the training and controller’s losses as the cross-entropy loss. Notably, Eq. 3 characterizes two nested optimization problems: the outer problem, which trains the controller to generalize, and each controller parameter $\pmb \theta$ parameterizes an inner problem that trains the base model to acquire new knowledge via experience replay. Moreover, only $\phi$ is trained in the inner problem, while only $\pmb \theta$ is updated in the outer problem.
|
| 60 |
+
|
| 61 |
+
The bilevel optimization objective such as Eq. 3 has been successfully applied in other machine learning disciplines such as hyperparameter optimization, meta learning (Franceschi et al., 2018; Finn et al., 2017), and AutoML (Liu et al., 2019a). In this work, we extend this framework to continual learning to train the controller. However, unlike existing works (Franceschi et al., 2018; Finn et al., 2017; Liu et al., 2019a), our Eq. 3 has to be solved incrementally when a new data sample arrives. Therefore, we consider Eq. 3 as an online learning problem and optimize it using the follow the leader principle (Hannan, 1957). Particularly, we relax the optimal solutions of both the inner and outer problems to be solutions from a few gradient steps. When a new training data arrives, we first train the base model $\phi$ using experience replay for a few SGD steps with an inner learning rate $\alpha$ , each of which is implemented as:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\phi \phi - \alpha \nabla _ { \phi } \mathcal { L } ^ { t r } ( \{ \phi , \theta \} , \mathcal { B } _ { t } \cup \mathcal { M } _ { < t } ^ { e m } ) ,
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
Then, we optimize the controller $\pmb { \theta }$ such that it can improve $\phi$ ’s performance on the semantic memory:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\pmb { \theta } \gets \beta - \beta \nabla _ { \pmb { \theta } } \mathcal { L } ^ { c t r l } ( \{ \phi , \pmb { \theta } \} , \mathcal { M } _ { < t + 1 } ^ { s m } ) ,
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
where $\beta$ is the outer learning rate. As a result, Eq. 3 is implemented as an alternative update procedure involving several outer updates to train $\pmb \theta$ , each of which includes an inner update to train $\phi$ . Moreover, performing several updates per incoming sample does not violate the online assumption since we will not revisit that sample in the future, unless it is stored in the memories.
|
| 74 |
+
|
| 75 |
+
# 2.3 TRAINING THE BASE NETWORK
|
| 76 |
+
|
| 77 |
+
Despite using task-specific features, the base network may still forget previous tasks because of the small episodic memory. To further alleviate catastrophic forgetting in $\phi$ , we regularize the training loss $\mathcal { L } ^ { t \bar { r } } ( \cdot )$ with a behavioral cloning (BC) strategy based on knowledge distillation (Hinton et al., 2015; van de Ven & Tolias, 2018). Let $\hat { y }$ be the logits of the model’s prediction before the softmax layer $\pi ( \cdot )$ , we regularize the training loss on the episodic memory data in Eq. 4 as:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\mathcal { L } ^ { t r } ( \{ \phi , \theta \} , ( { \pmb x } , { y } , k ) ) = \mathcal { L } ( \pi ( \hat { y } ) , y ) + \lambda D _ { \mathrm { K L } } ( \pi ( \frac { \hat { y } } { \tau } ) | | \pi ( \frac { \hat { y } _ { k } } { \tau } ) ) ,
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where $\lambda$ is the trade-off parameter, $\tau$ is the softmax’s temperature, and $\hat { y } _ { k }$ is a snapshot of the model prediction on the sample $( { \pmb x } , k )$ at the end of task $\mathcal { T } _ { k }$ . While the behavioral cloning strategy requires storing $\hat { y } _ { k }$ , the memory increase is minimal since $\hat { y } _ { k }$ is a vector with dimension bounded by the total classes, which is much smaller than the image $_ { \textbf { \em x } }$ dimension. Importantly, the behavioural cloning strategy is used to alleviate catastrophic forgetting, which only happens in the base model, not the controller. Particularly, the controller’s inputs are task identifiers such as one-hot vectors, which are fully available during learning. In summary, our episodic memory stores the input image $_ { \textbf { \em x } }$ , its corresponding label $y$ and the soft label $\hat { y }$ , while the semantic memory stores the input-label pair $x , y$
|
| 84 |
+
|
| 85 |
+
# 3 RELATED WORK
|
| 86 |
+
|
| 87 |
+
# 3.1 CONTINUAL LEARNING
|
| 88 |
+
|
| 89 |
+
Prior works in continual learning can be grouped into three main categories: (1) regularization methods, (2) episodic memory based methods, and (3) dynamic architecture methods.
|
| 90 |
+
|
| 91 |
+
Regularization approaches (Kirkpatrick et al., 2017; Zenke et al., 2017; Aljundi et al., 2018; Ritter et al., 2018) penalize the changes of important parameters to previous tasks using a variant of knowledge distillation (Li & Hoiem, 2017) or via a quadratic constraints. However, such methods usually isolate parameters or find a common solution to all tasks, limiting the model’s capacity.
|
| 92 |
+
|
| 93 |
+
Episodic memory based approaches store a small amount of data from previous tasks and interleave it with data from the current task. Old data can be used as a constraint to optimize the model LopezPaz & Ranzato (2017); Chaudhry et al. (2018), representation learning Rebuffi et al. (2017b), or simply just perform experience replay (ER) Chaudhry et al. (2019b); Aljundi et al. (2019a); Rolnick et al. (2019); van de Ven & Tolias (2018). While regularization and episodic memory-based methods have achieved promising results, they only use a shared feature extractor. Moreover, they do not consider the goal of improving the generalizability across tasks, which CTN explicitly addresses via the proposed bi-level optimization with the dual memory design.
|
| 94 |
+
|
| 95 |
+
Dynamic architecture approaches address catastrophic forgetting by having a subnetwork for each task (Rusu et al., 2016; Serra et al., 2018; von Oswald et al., 2020) or being able to grow its structure over time (Yoon et al., 2018; Li et al., 2019; Xu & Zhu, 2018; Hung et al., 2019). Such methods approximate training a full, separate network per task by reducing the number of additional parameters. However, most of them require growing the backbone network during training (Rusu et al., 2016; Yoon et al., 2018; Xu & Zhu, 2018; Li et al., 2019) or extensive resource usage (Rusu et al., 2016; Li et al., 2019), which is not scalable and undesirable for many applications. Notably, the idea of conditioning on the task identifiers were explored in Serra et al. (2018); von Oswald et al. (2020). However, Serra et al. (2018) uses the task identifiers to gate the network’s activations, which limits the representation capability. On the other hand, von Oswald et al. (2020) employs a hypernetwork (Ha et al., 2017) to generate a whole prediction network for each task and catastrophic forgetting is avoided by performing experience replay in the hypernetwork’s output space. However, this approach requires storing the hypernetwork’s output for each task, which is equivalent to a prediction network’s parameter. Therefore, while Serra et al. (2018); von Oswald et al. (2020) have achieved promising results, they requires larger memory and might not be suitable for the online setting.
|
| 96 |
+
|
| 97 |
+
# 3.2 FEATURE-WISE TRANSFORMATION
|
| 98 |
+
|
| 99 |
+
Early works in Bertinetto et al. (2016); Rebuffi et al. (2017a) showed that instead of using a taskspecific network on the input, one can employ a set of $1 \times 1$ filters to extract the task-specific from the common features. However, such approaches still require a quadratic complexity overhead in the number of channels, which can be expensive. Another compelling solution is the featurewise transformation, FiLM (Perez et al., 2018), which only requires a linear complexity. Thanks to its efficiency, FiLM has been successfully applied in many problems, including meta learning (Requeima et al., 2019; Zintgraf et al., 2019), visual reasoning (Perez et al., 2018), and others fields (Dumoulin et al., 2018) with remarkable success. Notably, CNAPs (Requeima et al., 2019) proposed an adaptation network to generate the FiLM’s parameters and quickly adapt to new tasks. CNAPs has showed promising results when having access to a large amount of tasks to pre-train the common features. However, this setting is different from continual learning where the learner has to obtain new knowledge on the fly. Therefore, CNAPs are principally differs from CTN in that CNAPs assume having access to a well-pretrained knowledge source and uses FiLM to quickly adapt this knowledge to a new task. On the other hand, CTNs use FiLM to accelerate the knowledge acquisition when learning progressively. Lastly, we emphasize that the CTN’s design is general. If more budget is allowed, the proposed CTN is readily compatible with the aforementioned feature transformation methods such as Rebuffi et al. (2017a) by adjusting the controller’s output dimension.
|
| 100 |
+
|
| 101 |
+
# 3.3 META LEARNING
|
| 102 |
+
|
| 103 |
+
Meta learning (Schmidhuber, 1987), also learning to learn, refers to a learning paradigm where an algorithm learns to improve the performance of another algorithm. Our CTN design is related to such learning to learn architectures where the controller is trained to improve the base model’s performance. Importantly, we note that there exist other continual learning variants that intersect with meta learning, such as meta-continual learning (Javed & White, 2019) and continual-meta learning (He et al., 2019; Caccia et al., 2020). However, they consider different goals and problem settings, such as meta pre-training (Javed & White, 2019) or rapid recovering the performance at test time given a finetuning step before inference is allowed (He et al., 2019), which is not the conventional online continual learning problem (Lopez-Paz & Ranzato, 2017) we focus in this study.
|
| 104 |
+
|
| 105 |
+
Table 1: Evaluation metrics on continual learning benchmarks considered. All methods use the same backbone network and 50 memory slots per task, ∗ denotes a dynamic architecture method that has a separate network per task
|
| 106 |
+
|
| 107 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3">pMNIST</td><td colspan="3">CORe50</td></tr><tr><td>ACC(↑)</td><td>FM(↓)</td><td>LA(↑)</td><td>ACC(↑)</td><td>FM(↓)</td><td>LA(↑)</td></tr><tr><td>GEM</td><td>74.84±0.95</td><td>8.57±0.33</td><td>81.74±0.77</td><td>42.56±0.86</td><td>7.36±0.90</td><td>46.84±2.22</td></tr><tr><td>AGEM</td><td>68.67±0.71</td><td>13.98±0.68</td><td>81.54±0.25</td><td>40.28±3.15</td><td>11.08±4.01</td><td>48.68±1.51</td></tr><tr><td>MER</td><td>76.59±0.74</td><td>6.88±0.59</td><td>82.09±0.33</td><td>39.28±1.25</td><td>9.08±1.25</td><td>45.52±0.96</td></tr><tr><td>ER-Ring</td><td>76.02±0.59</td><td>8.57±0.33</td><td>83.69±0.44</td><td>41.72±1.30</td><td>9.10±0.80</td><td>48.18±0.81</td></tr><tr><td>MIR</td><td>76.58±0.10</td><td>8.34±0.11</td><td>83.57±0.07</td><td>43.50±1.92</td><td>6.14±0.91</td><td>45.98±1.14</td></tr><tr><td>CTN (ours)</td><td>79.01±0.65</td><td>6.69±0.51</td><td>85.11±0.45</td><td>54.17±0.85</td><td>5.50±1.01</td><td>55.32±0.34</td></tr><tr><td>Independent*</td><td>81.05±0.29</td><td>0.00</td><td>81.05±0.29</td><td>53.54±1.10</td><td>0.00</td><td>53.54±1.10</td></tr><tr><td>Offline</td><td>84.95±0.95</td><td>1</td><td>1</td><td>58.69±0.41</td><td>1</td><td></td></tr><tr><td rowspan="2">Method</td><td colspan="3">Split CIFAR</td><td colspan="3"> Split miniIMN</td></tr><tr><td>ACC(↑)</td><td>FM(↓)</td><td>LA(↑)</td><td>ACC(↑)</td><td>FM(↓)</td><td>LA(↑)</td></tr><tr><td>GEM</td><td>57.77±0.86</td><td>10.93±1.03</td><td>66.45±0.06</td><td>55.04±1.88</td><td>7.81±1.70</td><td>60.13±1.36</td></tr><tr><td>AGEM</td><td>58.27±0.86</td><td>8.76±0.67</td><td>66.12±1.17</td><td>51.14±2.16</td><td>6.99±1.96</td><td>55.11±0.76</td></tr><tr><td>MER</td><td>61.32±0.86</td><td>11.90±0.86</td><td>72.51±0.41</td><td>57.94±1.08</td><td>8.98±0.79</td><td>66.11±0.76</td></tr><tr><td>ER-Ring</td><td>61.36±1.01</td><td>7.20±0.72</td><td>67.05±1.08</td><td>53.43±1.18</td><td>11.21±1.35</td><td>63.46±1.05</td></tr><tr><td>MIR</td><td>63.37±1.99</td><td>10.53±1.63</td><td>73.27±0.77</td><td>51.97±1.58</td><td>10.37±2.72</td><td>60.63±3.43</td></tr><tr><td>CTN (ours)</td><td>67.65±0.43</td><td>6.33±0.70</td><td>73.43±0.45</td><td>65.82±0.59</td><td>3.02±1.13</td><td>67.43±1.37</td></tr><tr><td>Independent*</td><td></td><td></td><td>67.21±0.51</td><td></td><td></td><td></td></tr><tr><td>Offline</td><td>67.21±0.51 74.11±0.66</td><td>0.00 -</td><td>1</td><td>65.85±0.98 71.15±2.95</td><td>0.00 -</td><td>65.85±0.98 -</td></tr></table>
|
| 108 |
+
|
| 109 |
+
Meta learning has been an appealing solution to learn a good initialization from a large amount of tasks (Finn et al., 2017), even in an online manner: Online Meta Learning (OML) (Finn et al., 2019). However, we emphasize that OML fundamentally differs from our CTN in two aspects. First, OML requires all data of previous tasks and aims to improve the performance of future tasks, which is different from continual learning. Second, OML learns an initialization and requires finetuning at test time, which is not practical, especially when testing on learned tasks. In contrast, CTN is a continual learning method that maximizes the performance of the current task as well as all previous tasks. Moreover, CTN can make a prediction at any time without requiring an additional finetuning step.
|
| 110 |
+
|
| 111 |
+
# 4 EXPERIMENTS
|
| 112 |
+
|
| 113 |
+
# 4.1 BENCHMARK DATASETS AND BASELINES
|
| 114 |
+
|
| 115 |
+
We consider four continual learning benchmarks in our experiments. Permuted MNIST (pMNIST) (Lopez-Paz & Ranzato, 2017): each task is a random but fixed permutation of the original MNIST. We generate 23 tasks with 1,000 images for training and the testing set has the same amount of images as in the original MNIST data. Split CIFAR-100 (Split CIFAR) (Lopez-Paz & Ranzato, 2017) is constructed by splitting the CIFAR100 (Krizhevsky & Hinton, 2009) dataset into 20 tasks, each of which contains 5 different classes sampled without replacement from the total of 100 classes. Split Mini ImageNet (Split miniIMN) (Chaudhry et al., 2019a), similarly, we split the miniIMN dataset (Vinyals et al., 2016) into 20 disjoint tasks. Finally, we consider the CORe50 benchmark by constructing a sequence of 10 tasks using the original CORe50 dataset (Lomonaco & Maltoni, 2017).
|
| 116 |
+
|
| 117 |
+
Throughout the experiments, we compare CTN with a suite of baselines: GEM (Lopez-Paz & Ranzato, 2017), AGEM (Chaudhry et al., 2019a), MER (Riemer et al., 2019), ER-Ring (Chaudhry et al., 2019b), and MIR (Aljundi et al., 2019a). We also consider the independent model (Lopez-Paz & Ranzato, 2017), a dynamic architecture method that maintains a separate network for each task, and each has the same number of parameters as other baselines. While the independent model is unrealistic, it is highly competitive and was used as an upper bound of a state-of-the-art dynamic architecture method in Hung et al. (2019). Finally, we include the Offline model, which does not follow the continual learning setting and performs multitask training on all tasks’ data. Due to space constraints, we provide the results of less competitive methods in Appendix. C.2.
|
| 118 |
+
|
| 119 |
+

|
| 120 |
+
Figure 2: $\mathrm { \bf A C C } ( \uparrow )$ as a function of the episodic memory size on the Split CIFAR-100 and Split miniIMN benchmarks. Best viewed in colors.
|
| 121 |
+
|
| 122 |
+
We use a multilayer perceptron with two hidden layers of size 256 for pMNIST, a reduced ResNet18 with three times fewer filters (Lopez-Paz & Ranzato, 2017) for Split CIFAR and Split miniIMN, and a full ResNet18 on CORE50. Following (Lopez-Paz & Ranzato, 2017), we use a Ring buffer as the memory structure for all methods and random sampling to select data from memory, including the episodic and semantic memories of CTN. The exceptions are MER (Riemer et al., 2019), which uses reservoir sampling, and MIR (Aljundi et al., 2019a), which use their sampling strategies as proposed by the authors. For CTN, the episodic memory and semantic memory are implemented as two Ring buffers with sizes equal to $80 \%$ and $20 \%$ of the total budget. This configuration is also cross-validated from the validation tasks. For each incoming batch of data, we randomly push $80 \%$ samples to the current task’s episodic memory and the other $20 \%$ are for the current task’s semantic memory.
|
| 123 |
+
|
| 124 |
+
We follow the procedure proposed in Chaudhry et al. (2019a) to cross-validate all hyperparameters using the first three tasks. Then, the best configuration is selected to perform continual learning on the remaining tasks. During continual learning, the task identifier is given to all methods. We optimize all models using SGD with a mini-batch of size ten over one epoch. We run each experiment five times, each has the same task order but different initialization seed, and report the following metrics: Averaged Accuracy (Lopez-Paz & Ranzato, 2017): ACC(↑) (higher is better) , Forgetting Measure (Chaudhry et al., 2018): $\mathrm { F M } ( \downarrow )$ (lower is better), and Learning Accuracy (Riemer et al., 2019): LA(↑) (higher is better).
|
| 125 |
+
|
| 126 |
+
# 4.2 RESULTS OF CONTINUAL LEARNING BENCHMARKS
|
| 127 |
+
|
| 128 |
+
Table 1 reports the evaluation metrics of the models on four continual learning benchmarks considered with 50 samples per task. We observe that CTN is even comparable with the independent method and outperforms other baselines by a large margin. We remind that the independent method has $T$ times more parameters than the remaining methods, where $T$ is the total number of tasks. Moreover, CTN can exploit the relationship across tasks via the task identifiers to improve its performance. For example, learning to classify “man” and “woman” may be helpful to classify “boy” and “girl” because they belong to the same superclass “people”. Finally, CTN significantly outperforms the baselines by achieving a better trade-off between alleviating catastrophic forgetting and facilitating knowledge transfer, as shown by lower $\mathrm { F M ( \downarrow ) }$ and higher LA(↑) . Overall, CTN achieves state-of-the-art results, even comparable with arge scale dynamic architecture method, while enjoying neglectable model complexity overhead compared to fixed architecture methods.
|
| 129 |
+
|
| 130 |
+
# $\mathbf { A C C } ( \uparrow )$ as a function of the episodic memory size.
|
| 131 |
+
|
| 132 |
+
We study the models’ performances as the memory size increases. We consider the Split CIFAR 100 and Split miniIMN benchmarks and train the models of CTN, ER, MIR, and GEM with the total memory size per task increasing from 50 to 200. Fig. 2 plots the ACC(↑) curves as a function of the memory size. Generally, the performances of all methods increase with larger memory sizes. Overall, CTN consistently outperforms the competitors across all memory sizes. Notably, in both benchmarks, CTN can achieve comparable performances to the Offline model even when the memory size per task is only 175. The results show that CTN not only excels in the low memory regime but also scales remarkably well when more memory budget is allowed.
|
| 133 |
+
|
| 134 |
+
Table 2: Evaluation metrics on the Small Split CIFAR benchmarks, M denotes the memory per task
|
| 135 |
+
|
| 136 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3">Reduced Split CIFAR 25%, M= 50</td><td colspan="3">Reduced Split CIFAR 25%, M= 25</td></tr><tr><td>ACC(↑)</td><td>FM(↓)</td><td>LA(↑)</td><td>ACC(↑)</td><td>FM(↓)</td><td>LA(↑)</td></tr><tr><td>GEM</td><td>51.01±0.95</td><td>5.65±1.09</td><td>53.39±0.98</td><td>47.33±0.89</td><td>8.77±1.58</td><td>53.79±1.35</td></tr><tr><td>ER-Ring</td><td>52.02±0.90</td><td>4.31±0.94</td><td>53.97±0.65</td><td>48.15±0.87</td><td>8.22±1.17</td><td>53.88±0.93</td></tr><tr><td>MIR</td><td>50.82±0.83</td><td>5.22±0.68</td><td>53.27±1.05</td><td>47.19±0.54</td><td>8.41±0.94</td><td>53.51±0.74</td></tr><tr><td>CTN</td><td>61.27±0.93</td><td>4.19±0.78</td><td>61.92±1.15</td><td>56.17±1.63</td><td>7.71±1.22</td><td>61.40±0.64</td></tr><tr><td rowspan="2">Method</td><td>Reduced Split CIFAR 10%, M= 50</td><td></td><td></td><td></td><td>Reduced Split CIFAR 10%, M= 25</td><td></td></tr><tr><td>ACC(↑)</td><td>FM(↓)</td><td>LA(↑)</td><td>ACC(↑)</td><td>FM(↓)</td><td>LA(↑)</td></tr><tr><td>GEM</td><td>44.06±1.31</td><td>6.96±0.87</td><td>48.67±0.84</td><td>42.67±1.62</td><td>8.39±1.35</td><td>49.46±0.40</td></tr><tr><td>ER-Ring</td><td>44.60±1.65</td><td>6.07±1.77</td><td>48.36±0.46</td><td>43.09±1.22</td><td>7.68±1.94</td><td>49.40±1.40</td></tr><tr><td>MIR</td><td>46.63±0.56</td><td>4.38±0.45</td><td>48.35±0.52</td><td>44.12±0.94</td><td>6.84±1.05</td><td>48.48±0.76</td></tr><tr><td>CTN</td><td>56.61±0.74</td><td>4.33±0.48</td><td>58.77±0.99</td><td>52.64±0.63</td><td>6.74±0.73</td><td>57.27±1.02</td></tr></table>
|
| 137 |
+
|
| 138 |
+
Table 3: ACC(↑) of each component in CTN on Split CIFAR and Split mini Imagenet with 50 memory slots per task. BC: behavioral cloning (Eq. 6), C: controller, BO: Bilevel optimization (Eq. 3)
|
| 139 |
+
|
| 140 |
+
<table><tr><td rowspan="3"></td><td rowspan="3"></td><td rowspan="3">BC C</td><td rowspan="3">BO</td><td colspan="3">Split CIFAR</td><td colspan="3">Split miniIMN</td></tr><tr><td>ACC(↑)</td><td>FM(↓)</td><td>LA(↑)</td><td>ACC(↑)</td><td>FM(↓)</td><td>LA(↑)</td></tr><tr><td rowspan="4">CTN</td><td><</td><td></td><td>√</td><td>67.65±0.43</td><td>6.33±0.70</td><td>73.43±0.45</td><td>65.82±0.59</td><td>3.02±1.13</td><td>67.73±1.73</td></tr><tr><td>√</td><td>√</td><td></td><td>66.37±0.53</td><td>9.64±0.98</td><td>75.40±0.60</td><td>60.04±1.37</td><td>10.48±0.99</td><td>69.87±0.60</td></tr><tr><td></td><td>√</td><td>√</td><td>64.46±1.16</td><td>8.51±1.53</td><td>72.23±0.54</td><td>61.01±1.09</td><td>5.31±0.94</td><td>64.35±0.83</td></tr><tr><td></td><td>√</td><td></td><td>62.76±0.49</td><td>10.10±0.78</td><td>72.12±0.41</td><td>58.95±1.76</td><td>9.08±1.61</td><td>66.94±0.83</td></tr><tr><td colspan="2">ER</td><td></td><td></td><td>61.36±1.01</td><td>7.20±0.72</td><td>67.05±1.08</td><td>53.43±1.18</td><td>11.21±1.35</td><td>63.46±1.05</td></tr></table>
|
| 141 |
+
|
| 142 |
+
4.3 RESULTS ON LEARNING WITH LIMITED TRAINING DATA
|
| 143 |
+
|
| 144 |
+
One important goal of continual learning is to be able to learn with a limited amount of training data per task. This setting is much more challenging because it tests the learner’s ability to quickly acquire knowledge only with limited training samples by utilizing its past experiences. In this experiment, we explore how different memory-based methods perform with only limited training samples per task and memory size. We consider the Split CIFAR benchmark; however, we reduce the amount of training data per task significantly. Particularly, we only consider $2 5 \%$ and $10 \%$ of the original data per task while the test data remains the same. We name the new benchmarks Reduced Split CIFAR $2 5 \%$ and Reduced Split CIFAR $10 \%$ , respectively. Notably, the Reduced Split CIFAR $10 \%$ only has five samples per class, which is extremely challenging. We compare CTN with GEM, ER, and MIR on these benchmarks with the memory size of 50 and 25 samples per task.
|
| 145 |
+
|
| 146 |
+
Table 2 shows the results of this experiment. When the training data are scarce, the baselines performances drop significantly, even below $50 \%$ ACC(↑) in three settings. CTN, on the other hand, consistently outperforms the baselines by a large margin, from $8 \%$ to $10 \%$ across benchmarks, even in the challenging Reduced Split Cifar $10 \%$ . Moreover, the three baselines have similarly low LA, showing that they struggle in acquiring new knowledge when the training data of each task are limited. On the other hand, CTN can leverage information about the task-specific features to improve knowledge transfer and the learning outcomes. It is worth noting that even with $2 5 \%$ training data and 50 memory slots per task, CTN already outperforms several baselines that are trained with full data by cross-referencing the results with Table 1.
|
| 147 |
+
|
| 148 |
+
# 4.4 ABLATION STUDY
|
| 149 |
+
|
| 150 |
+
We study the contribution of each component in CTN in its overall performance and consider the Split CIFAR and Split miniIMN benchmarks with an episodic memory of 50 samples per task. Particularly, we are interested in how (1) the controller, (2) the bi-level optimization, and (3) the behavioral cloning strategy contribute to the base model. We implement variants of CTN with different combinations of these components and report the results in Table 3. Notably, CTN with only the controller (C) is equivalent to training the base network and the controller using the vanilla experience replay approach. Despite this, the controller can offer significant improvements over ER: over $5 \%$ $\operatorname { A C C } ( \uparrow )$ in Split miniIMN. When the controller is optimized by our proposed bilevel optimization $\left( \mathbf { C } + \mathbf { B } \mathbf { O } \right)$ , the performances are further improved, showing that our proposed bilevel objective achieves a better trade-off between alleviating forgetting and facilitating knowledge transfer. Lastly, the behavioral cloning strategy can help alleviate forgetting and further strengthen the results. Overall, each of the proposed components adds positive contributions to the base model, and they work collectively as a holistic method and achieved state-of-the-art results in continual learning.
|
| 151 |
+
|
| 152 |
+
Table 4: Model complexity of CTN with various backbone architectures
|
| 153 |
+
Table 5: Averaged running time (in seconds) of compared methods on the task-aware continual learning benchmarks. All methods use ${ \bf M } { = } 5 0$ memory slots per task, Ring buffer, and up to four gradient updates per samples
|
| 154 |
+
|
| 155 |
+
<table><tr><td colspan="2">Backbone</td><td colspan="2">Controller</td><td rowspan="2">Total</td><td rowspan="2">Increase</td></tr><tr><td> Structure</td><td>#Params</td><td> Structure</td><td>#Params</td></tr><tr><td>MLP[784-256-256-10]</td><td>269,322</td><td>Linear model</td><td>17,728</td><td>287,050</td><td>6.58%</td></tr><tr><td>ResNet18 (Lopez-Paz & Ranzato, 2017)</td><td>1,095,555</td><td>Linear model</td><td>20,992</td><td>1,116,547</td><td>1.92%</td></tr><tr><td>ResNet18 (He et al., 2016)</td><td>11,202,162</td><td>Linear model</td><td>59,200</td><td>11,261,362</td><td>0.53%</td></tr></table>
|
| 156 |
+
|
| 157 |
+
<table><tr><td>Benchmark\Method</td><td>ER-Ring</td><td>MIR</td><td>AGEM</td><td>CTN</td><td>GEM</td></tr><tr><td>pMNIST</td><td>61</td><td>92</td><td>90</td><td>110</td><td>103</td></tr><tr><td>Split CIFAR100</td><td>632</td><td>1030</td><td>680</td><td>910</td><td>1700</td></tr><tr><td>Split miniIMN</td><td>1320</td><td>2130</td><td>1700</td><td>1890</td><td>2850</td></tr></table>
|
| 158 |
+
|
| 159 |
+
# 4.5 COMPLEXITY ANALYSIS
|
| 160 |
+
|
| 161 |
+
In this section, we study the CTN’s complexity with the backbones used in our experiments and report the results in Table 4. In all cases, the controller only adds minimal additional parameters, almost neglectable in complex deep architectures such as ResNets (He et al., 2016; Lopez-Paz & Ranzato, 2017). Therefore, we can safely compare CTN with other fixed architecture methods using the same backbone because they have nearly the same number of parameters.
|
| 162 |
+
|
| 163 |
+
Table 5 reports the averaged running time (in seconds) of considered methods. All methods are implemented using Pytorch (Paszke et al., 2019) version 1.5 and CUDA 10.2. Experiments are conducted using a single K80 GPU and all methods are allowed up to four gradients steps per sample. Clearly, ER-Ring has the most efficient time complexity thanks to its simplicity. On the other hand, GEM has high computational costs because of its quadratic constraints. MIR also exhibits high running time because of its virtual update, which doubles the total gradient updates. CTN, in general, is slightly faster MIR and more efficient than GEM. Overall, CTN achieves a great trade-off between model/computational complexity and performance: CTN’s performances are significantly higher than considered baselines with only minimal memory and computational overhead.
|
| 164 |
+
|
| 165 |
+
# 5 CONCLUSION
|
| 166 |
+
|
| 167 |
+
In this work, we study the online continual learning problem and propose Contextual Transformation Networks (CTN), where a fixed architecture network can model both the common features and specific features of each task. CTN works by employing a controller that modifies features of the base network conditioning on the task identifiers. To optimize CTN, we further propose a novel dual memory system equipped with a bilevel optimization objective that can efficiently transfer knowledge and alleviate forgetting simultaneously. Moreover, we discuss the relationship of CTN to the Complementary Learning Systems theory in neuroscience and meta learning from different perspectives, showing that CTN is related to other disciplines. Through extensive experiments, our results demonstrate that CTN consistently outperforms fixed architecture methods and achieves state-of-the-art results. Moreover, CTN is even comparable with a large scale dynamic architecture network, while enjoying almost no additional model complexity.
|
| 168 |
+
|
| 169 |
+
# REFERENCES
|
| 170 |
+
|
| 171 |
+
Rahaf Aljundi, Francesca Babiloni, Mohamed Elhoseiny, Marcus Rohrbach, and Tinne Tuytelaars. Memory aware synapses: Learning what (not) to forget. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 139–154, 2018.
|
| 172 |
+
|
| 173 |
+
Rahaf Aljundi, Eugene Belilovsky, Tinne Tuytelaars, Laurent Charlin, Massimo Caccia, Min Lin, and Lucas Page-Caccia. Online continual learning with maximal interfered retrieval. In Advances in Neural Information Processing Systems, pp. 11849–11860, 2019a.
|
| 174 |
+
|
| 175 |
+
Rahaf Aljundi, Klaas Kelchtermans, and Tinne Tuytelaars. Task-free continual learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 11254–11263, 2019b.
|
| 176 |
+
|
| 177 |
+
Yusuf Aytar and Andrew Zisserman. Tabula rasa: Model transfer for object category detection. In 2011 international conference on computer vision, pp. 2252–2259. IEEE, 2011.
|
| 178 |
+
|
| 179 |
+
Luca Bertinetto, Joao F Henriques, Jack Valmadre, Philip Torr, and Andrea Vedaldi. Learning feed- ˜ forward one-shot learners. In Advances in neural information processing systems, pp. 523–531, 2016.
|
| 180 |
+
|
| 181 |
+
Massimo Caccia, Pau Rodriguez, Oleksiy Ostapenko, Fabrice Normandin, Min Lin, Lucas Caccia, Issam Laradji, Irina Rish, Alexande Lacoste, David Vazquez, et al. Online fast adaptation and knowledge accumulation: a new approach to continual learning. arXiv preprint arXiv:2003.05856, 2020.
|
| 182 |
+
|
| 183 |
+
Arslan Chaudhry, Puneet K Dokania, Thalaiyasingam Ajanthan, and Philip HS Torr. Riemannian walk for incremental learning: Understanding forgetting and intransigence. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 532–547, 2018.
|
| 184 |
+
|
| 185 |
+
Arslan Chaudhry, Marc’Aurelio Ranzato, Marcus Rohrbach, and Mohamed Elhoseiny. Efficient lifelong learning with a-gem. International Conference on Learning Representations (ICLR), 2019a.
|
| 186 |
+
|
| 187 |
+
Arslan Chaudhry, Marcus Rohrbach, Mohamed Elhoseiny, Thalaiyasingam Ajanthan, Puneet K Dokania, Philip HS Torr, and Marc’Aurelio Ranzato. On tiny episodic memories in continual learning. arXiv preprint arXiv:1902.10486, 2019b.
|
| 188 |
+
|
| 189 |
+
Benoˆıt Colson, Patrice Marcotte, and Gilles Savard. An overview of bilevel optimization. Annals of operations research, 153(1):235–256, 2007.
|
| 190 |
+
|
| 191 |
+
Vincent Dumoulin, Ethan Perez, Nathan Schucher, Florian Strub, Harm de Vries, Aaron Courville, and Yoshua Bengio. Feature-wise transformations. Distill, 2018. doi: 10.23915/distill.00011. https://distill.pub/2018/feature-wise-transformations.
|
| 192 |
+
|
| 193 |
+
Theodoros Evgeniou and Massimiliano Pontil. Regularized multi–task learning. In Proceedings of the tenth ACM SIGKDD international conference on Knowledge discovery and data mining, pp. 109–117, 2004.
|
| 194 |
+
|
| 195 |
+
Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 1126–1135. JMLR. org, 2017.
|
| 196 |
+
|
| 197 |
+
Chelsea Finn, Aravind Rajeswaran, Sham Kakade, and Sergey Levine. Online meta-learning. In Proceedings of the 36th International Conference on Machine Learning-Volume 97, pp. 1920–1930. JMLR. org, 2019.
|
| 198 |
+
|
| 199 |
+
Luca Franceschi, Paolo Frasconi, Saverio Salzo, Riccardo Grazzi, and Massimiliano Pontil. Bilevel programming for hyperparameter optimization and meta-learning. In International Conference on Machine Learning, pp. 1568–1577, 2018.
|
| 200 |
+
|
| 201 |
+
Robert M French. Semi-distributed representations and catastrophic forgetting in connectionist networks. Connection Science, 4(3-4):365–377, 1992.
|
| 202 |
+
|
| 203 |
+
Robert M French. Catastrophic forgetting in connectionist networks. Trends in cognitive sciences, 3 (4):128–135, 1999.
|
| 204 |
+
|
| 205 |
+
David Ha, Andrew Dai, and Quoc V Le. Hypernetworks. International Conference on Learning Representations (ICLR), 2017.
|
| 206 |
+
|
| 207 |
+
James Hannan. Approximation to bayes risk in repeated play. Contributions to the Theory of Games, 3:97–139, 1957.
|
| 208 |
+
|
| 209 |
+
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.
|
| 210 |
+
|
| 211 |
+
Xu He, Jakub Sygnowski, Alexandre Galashov, Andrei A Rusu, Yee Whye Teh, and Razvan Pascanu. Task agnostic continual learning via meta learning. arXiv preprint arXiv:1906.05201, 2019.
|
| 212 |
+
|
| 213 |
+
Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. In NIPS Deep Learning and Representation Learning Workshop, 2015. URL http://arxiv.org/ abs/1503.02531.
|
| 214 |
+
|
| 215 |
+
Saihui Hou, Xinyu Pan, Chen Change Loy, Zilei Wang, and Dahua Lin. Lifelong learning via progressive distillation and retrospection. In Proceedings of the European Conference on Computer Vision (ECCV), pp. 437–452, 2018.
|
| 216 |
+
|
| 217 |
+
Ching-Yi Hung, Cheng-Hao Tu, Cheng-En Wu, Chien-Hung Chen, Yi-Ming Chan, and Chu-Song Chen. Compacting, picking and growing for unforgetting continual learning. In Advances in Neural Information Processing Systems, pp. 13669–13679, 2019.
|
| 218 |
+
|
| 219 |
+
Khurram Javed and Martha White. Meta-learning representations for continual learning. In Advances in Neural Information Processing Systems, pp. 1818–1828, 2019.
|
| 220 |
+
|
| 221 |
+
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. Proceedings of the national academy of sciences, 2017.
|
| 222 |
+
|
| 223 |
+
Alex Krizhevsky and Geoffrey Hinton. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009.
|
| 224 |
+
|
| 225 |
+
Dharshan Kumaran and James L McClelland. Generalization through the recurrent interaction of episodic memories: a model of the hippocampal system. Psychological review, 119(3):573, 2012.
|
| 226 |
+
|
| 227 |
+
Dharshan Kumaran, Demis Hassabis, and James L McClelland. What learning systems do intelligent agents need? complementary learning systems theory updated. Trends in cognitive sciences, 20(7): 512–534, 2016.
|
| 228 |
+
|
| 229 |
+
Christoph H Lampert, Hannes Nickisch, and Stefan Harmeling. Learning to detect unseen object classes by between-class attribute transfer. In 2009 IEEE Conference on Computer Vision and Pattern Recognition, pp. 951–958. IEEE, 2009.
|
| 230 |
+
|
| 231 |
+
Yann LeCun, Leon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to ´ document recognition. Proceedings of the IEEE, 86(11):2278–2324, 1998.
|
| 232 |
+
|
| 233 |
+
Xilai Li, Yingbo Zhou, Tianfu Wu, Richard Socher, and Caiming Xiong. Learn to grow: A continual structure learning framework for overcoming catastrophic forgetting. In International Conference on Machine Learning, pp. 3925–3934, 2019.
|
| 234 |
+
|
| 235 |
+
Zhizhong Li and Derek Hoiem. Learning without forgetting. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017.
|
| 236 |
+
|
| 237 |
+
Hanxiao Liu, Karen Simonyan, and Yiming Yang. Darts: Differentiable architecture search. International Conference on Learning Representations (ICLR), 2019a.
|
| 238 |
+
|
| 239 |
+
Shikun Liu, Edward Johns, and Andrew J Davison. End-to-end multi-task learning with attention. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1871–1880, 2019b.
|
| 240 |
+
|
| 241 |
+
Vincenzo Lomonaco and Davide Maltoni. Core50: a new dataset and benchmark for continuous object recognition. Proceedings of Machine Learning Research, pp. 17–26. PMLR, 2017.
|
| 242 |
+
|
| 243 |
+
David Lopez-Paz and Marc’Aurelio Ranzato. Gradient episodic memory for continual learning. In Advances in Neural Information Processing Systems, pp. 6467–6476, 2017.
|
| 244 |
+
|
| 245 |
+
James L McClelland, Bruce L McNaughton, and Randall C O’Reilly. Why there are complementary learning systems in the hippocampus and neocortex: insights from the successes and failures of connectionist models of learning and memory. Psychological review, 102(3):419, 1995.
|
| 246 |
+
|
| 247 |
+
Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In Psychology of learning and motivation, volume 24, pp. 109–165. Elsevier, 1989.
|
| 248 |
+
|
| 249 |
+
Alex Nichol, Joshua Achiam, and John Schulman. On first-order meta-learning algorithms. arXiv preprint arXiv:1803.02999, 2018.
|
| 250 |
+
|
| 251 |
+
German I Parisi, Ronald Kemker, Jose L Part, Christopher Kanan, and Stefan Wermter. Continual lifelong learning with neural networks: A review. Neural Networks, 2019.
|
| 252 |
+
|
| 253 |
+
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high-performance deep learning library. In Advances in Neural Information Processing Systems, pp. 8024–8035, 2019.
|
| 254 |
+
|
| 255 |
+
Anastasia Pentina and Christoph Lampert. A pac-bayesian bound for lifelong learning. In International Conference on Machine Learning, pp. 991–999, 2014.
|
| 256 |
+
|
| 257 |
+
Ethan Perez, Florian Strub, Harm De Vries, Vincent Dumoulin, and Aaron Courville. Film: Visual reasoning with a general conditioning layer. In Thirty-Second AAAI Conference on Artificial Intelligence, 2018.
|
| 258 |
+
|
| 259 |
+
Quang Pham, Doyen Sahoo, Chenghao Liu, and Steven CH Hoi. Bilevel continual learning. arXiv preprint arXiv:2007.15553, 2020.
|
| 260 |
+
|
| 261 |
+
Sylvestre-Alvise Rebuffi, Hakan Bilen, and Andrea Vedaldi. Learning multiple visual domains with residual adapters. In Advances in Neural Information Processing Systems, pp. 506–516, 2017a.
|
| 262 |
+
|
| 263 |
+
Sylvestre-Alvise Rebuffi, Alexander Kolesnikov, Georg Sperl, and Christoph H Lampert. icarl: Incremental classifier and representation learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 2001–2010, 2017b.
|
| 264 |
+
|
| 265 |
+
James Requeima, Jonathan Gordon, John Bronskill, Sebastian Nowozin, and Richard E Turner. Fast and flexible multi-task classification using conditional neural adaptive processes. In Advances in Neural Information Processing Systems, pp. 7959–7970, 2019.
|
| 266 |
+
|
| 267 |
+
Matthew Riemer, Ignacio Cases, Robert Ajemian, Miao Liu, Irina Rish, Yuhai Tu, and Gerald Tesauro. Learning to learn without forgetting by maximizing transfer and minimizing interference. International Conference on Learning Representations (ICLR), 2019.
|
| 268 |
+
|
| 269 |
+
Mark B Ring. Child: A first step towards continual learning. Machine Learning, 28(1):77–104, 1997.
|
| 270 |
+
|
| 271 |
+
Hippolyt Ritter, Aleksandar Botev, and David Barber. Online structured laplace approximations for overcoming catastrophic forgetting. In Advances in Neural Information Processing Systems, pp. 3738–3748, 2018.
|
| 272 |
+
|
| 273 |
+
David Rolnick, Arun Ahuja, Jonathan Schwarz, Timothy Lillicrap, and Gregory Wayne. Experience replay for continual learning. In Advances in Neural Information Processing Systems, pp. 348–358, 2019.
|
| 274 |
+
|
| 275 |
+
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.
|
| 276 |
+
|
| 277 |
+
Doyen Sahoo, Quang Pham, Jing Lu, and Steven C. H. Hoi. Online deep learning: Learning deep neural networks on the fly. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI-18, 2018.
|
| 278 |
+
|
| 279 |
+
Jurgen Schmidhuber. ¨ Evolutionary principles in self-referential learning, or on learning how to learn: the meta-meta-... hook. PhD thesis, Technische Universitat M¨ unchen, 1987. ¨
|
| 280 |
+
|
| 281 |
+
Joan Serra, Didac Suris, Marius Miron, and Alexandros Karatzoglou. Overcoming catastrophic forgetting with hard attention to the task. In Proceedings of the 35th International Conference on Machine Learning-Volume 80, pp. 4548–4557. JMLR. org, 2018.
|
| 282 |
+
|
| 283 |
+
Sebastian Thrun and Tom M Mitchell. Lifelong robot learning. In The biology and technology of intelligent autonomous agents, pp. 165–196. Springer, 1995.
|
| 284 |
+
|
| 285 |
+
Gido M van de Ven and Andreas S Tolias. Generative replay with feedback connections as a general strategy for continual learning. arXiv preprint arXiv:1809.10635, 2018.
|
| 286 |
+
|
| 287 |
+
Oriol Vinyals, Charles Blundell, Timothy Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In Advances in neural information processing systems, pp. 3630–3638, 2016.
|
| 288 |
+
|
| 289 |
+
Johannes von Oswald, Christian Henning, Joao Sacramento, and Benjamin F Grewe. Continual ˜ learning with hypernetworks. International Conference on Learning Representations (ICLR), 2020.
|
| 290 |
+
|
| 291 |
+
Ju Xu and Zhanxing Zhu. Reinforced continual learning. In Advances in Neural Information Processing Systems, pp. 899–908, 2018.
|
| 292 |
+
|
| 293 |
+
Jaehong Yoon, Eunho Yang, Jeongtae Lee, and Sung Ju Hwang. Lifelong learning with dynamically expandable networks. International Conference on Learning Representations (ICLR), 2018.
|
| 294 |
+
|
| 295 |
+
Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pp. 3987– 3995. JMLR. org, 2017.
|
| 296 |
+
|
| 297 |
+
Luisa Zintgraf, Kyriacos Shiarli, Vitaly Kurin, Katja Hofmann, and Shimon Whiteson. Fast context adaptation via meta-learning. In International Conference on Machine Learning, pp. 7693–7702. PMLR, 2019.
|
| 298 |
+
|
| 299 |
+
# APPENDIX
|
| 300 |
+
|
| 301 |
+
This Appendix is organized as follows. In Appendix A, we provide the details of the continual learning protocol and evaluation metrics used in this work. Appendix B provides pseudo-code of CTN and its implementation on standard deep learning architectures such as MLP and Residual networks. Appendix C provides additional experiment details, including the summary of our benchmarks, results of additional baselines, model and computational complexity, and hyperparameter settings.
|
| 302 |
+
|
| 303 |
+
# A CONTINUAL LEARNING PROTOCOLS
|
| 304 |
+
|
| 305 |
+
Continual learning, a.k.a. lifelong learning, McCloskey & Cohen (1989); Thrun & Mitchell (1995); Ring (1997) has been extensive studied over the past decades. In this work, we consider the problem of online continual learning studied by (Lopez-Paz & Ranzato, 2017; Chaudhry et al., 2019a).
|
| 306 |
+
|
| 307 |
+
Specifically, at time step $t$ , a learner receives an input pair $( { \pmb x } , t )$ and makes a prediction $y = f ( x , t ; \pmb { w } )$ by a predictor $f ( \cdot )$ parameterized some parameter $\pmb { w }$ . Note that here the input $_ { \textbf { \em x } }$ belongs to an underlying task $\mathcal { T } _ { t }$ , which is also given to the learner. Each task $\mathcal { T } _ { t }$ comprises a training dataset $\mathcal { D } _ { t } ^ { t r }$ , whose data will be sequentially presented to a learner, and a separate testing set $\mathcal { D } _ { t } ^ { t e }$ . Following (Chaudhry et al., 2019a), we also assume having access to a small amount of tasks prior to learning for hyperparameter validation and an episodic memory $\mathcal { M }$ can be used. We assume that the stream of data $\{ ( \overline { { \mathbf { \Omega } } } _ { } \mathbf { \tilde { \Omega } } _ { i } , \mathbf { \bar { \Gamma } } _ { i } ) , y _ { i } \} _ { i = 1 } ^ { \infty }$ arrives sequentially and the goal is to optimize a model that can perform well on all observed tasks so far.
|
| 308 |
+
|
| 309 |
+
To measure the model performance, we adopt three standard metrics: Average Accuracy ACC(↑) (Lopez-Paz & Ranzato, 2017), Forgetting Measure $\mathrm { F M } ( \downarrow )$ Chaudhry et al. (2019a), and Learning Accuracy $\mathrm { L A } ( \uparrow )$ (Riemer et al., 2019). Denote $a _ { i , j }$ as the model’s accuracy evaluated on the test set $\mathcal { D } _ { j } ^ { t e }$ after it has been trained on the most recent sample in dataset $\mathcal { D } _ { i }$ of task $\mathcal { T } _ { i }$ . Then, the above metrics are defined as:
|
| 310 |
+
|
| 311 |
+
• Average Accuracy (higher is better): the average accuracy of all observed tasks:
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
\operatorname { A C C } ( \uparrow ) = \frac { 1 } { T } \sum _ { i = 1 } ^ { T } a _ { T , i } .
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
• Forgetting Measure (lower is better): the average forgetting of all previous tasks:
|
| 318 |
+
|
| 319 |
+
$$
|
| 320 |
+
\mathrm { F M } ( \downarrow ) = \frac { 1 } { T - 1 } \sum _ { j = 1 } ^ { T - 1 } \operatorname* { m a x } _ { l \in \{ 1 , \dots T - 1 \} } a _ { l , j } - a _ { T , j } .
|
| 321 |
+
$$
|
| 322 |
+
|
| 323 |
+
• Learning Accuracy (higher is better): measures the performance of a model on a task right after it finishes training that task:
|
| 324 |
+
|
| 325 |
+
$$
|
| 326 |
+
\operatorname { L A } ( \uparrow ) = \frac { 1 } { T } \sum _ { i = 1 } ^ { T } a _ { i , i } .
|
| 327 |
+
$$
|
| 328 |
+
|
| 329 |
+
In the literature, there exists several different continual learning protocols. Here we categorize them based on two questions: (i) Is information about the task of a sample given during training and testing? (ii) Does training within each task is performed online? For question (i), when we do not know which task does the sample belong to, evaluation is called “single-head” and there is a shared classifier for all tasks (Aljundi et al., 2019b). In question (ii), data of a task can either be fully available when task changes or can arrives sequentially. When all the task data is available, training within tasks can be done in an offline fashion with multiple epochs through data. Our protocol used is in this work is proposed in Lopez-Paz & Ranzato (2017) in which data of each task arrives sequentially and task identifier is also given. Moreover, hyperparameter cross-validation is also an important problem in continual learning, regardless of the protocol considered. Particularly, we must not use data of future tasks when searching for the hyperparameter. Here we follow Chaudhry et al. (2019a) and assume that we have access to a small amount of tasks prior to continual learning. Such tasks will not be encountered again during actual continual learning and only be used for cross-validation.
|
| 330 |
+
|
| 331 |
+
# B IMPLEMENTING CONTEXTUAL TRANSFORMATION NETWORKS
|
| 332 |
+
|
| 333 |
+
# B.1 PSEUDO-CODE
|
| 334 |
+
|
| 335 |
+
We provide the details algorithm of our CTN and its subroutines in Alg. 1. For simplicity, we drop the dependency of the losses on the parameters and use ${ \mathcal { L } } ^ { t r } ( B _ { n } )$ to denote $\mathcal { L } ^ { t r } ( \phi , \varphi , B _ { n } ; \mathbf { \bar { \theta } } )$ and $\mathcal { L } ( B _ { n } )$ to denote $\dot { \mathcal { L } } ( \phi , \varphi , B _ { n } ; \theta )$
|
| 336 |
+
|
| 337 |
+
# Algorithm 1: Contextual Transformation Networks (CTN)
|
| 338 |
+
|
| 339 |
+
<table><tr><td colspan="2">1 Algorithm TrainCTN(0,Φ,Dt:T)</td></tr><tr><td></td><td>Require: base model , controller 0,classifier Init:0,Φ,,Mem ← Ω,M$m ← α fort←1toTdo</td></tr><tr><td></td><td>for j ← 1 to nbatches do // Receive the dataset Dtr sequentially</td></tr><tr><td></td><td>Receive a mini batch of data Bj from Dtr</td></tr><tr><td></td><td>x*,y* ← Random sampling from Bj / Sampling for the semantic memory</td></tr><tr><td></td><td>Msm ← MemoryUpdate(Msm,{x*,y*})</td></tr><tr><td></td><td>Mem ← MemoryUpdate(Mem,Bj)</td></tr><tr><td>8</td><td></td></tr><tr><td>9</td><td>fori ← 1 to nouter do</td></tr><tr><td>10</td><td>for n ← 1 to ninner do Bem ← Sample(Mem)</td></tr><tr><td>11</td><td>Bn ← Bem U Bj</td></tr><tr><td>12</td><td>←Φ-∀Ltr(Bn)</td></tr><tr><td></td><td>↑-∀Ltr(Bn)</td></tr><tr><td>13</td><td></td></tr><tr><td>14</td><td>Bsm ← Sample (Msm) 0←0-VθL(Bsm)</td></tr><tr><td></td><td></td></tr><tr><td>15 16</td><td>Mem ← Mem U{π(g/t)}</td></tr><tr><td></td><td>Mem ← Mem UMem</td></tr><tr><td>17</td><td>return 0,</td></tr><tr><td></td><td>Procedure Forward(0,Φ,φ,x,t)</td></tr><tr><td></td><td>Yt,βt←cθ(t) // Calculate the transforming coefficients</td></tr><tr><td>3</td><td>h(x;t)← Yt h(xc)+ βt 1t1l2 // Calculate the task-specific features 1βt1l2</td></tr><tr><td></td><td>return gφt (h(x,t))</td></tr><tr><td></td><td>Procedure MemoryUpdate (M, B)</td></tr><tr><td></td><td>Require: Implement M as a queue (FIFO) data structure</td></tr><tr><td></td><td></td></tr><tr><td></td><td>for(x,y) in B do</td></tr><tr><td>3</td><td> M.append(x,y)</td></tr><tr><td></td><td></td></tr><tr><td>4</td><td>return M</td></tr></table>
|
| 340 |
+
|
| 341 |
+
# B.2 IMPLEMENTING CTN ON COMMON ARCHITECTURES
|
| 342 |
+
|
| 343 |
+
In this section, we provide the implementation details of CTN on two feedforward network bases that we use in our experiments. We implement the context model as a single regression layer. Moreover, we share the parameter of the scale and shift models $\gamma , \beta$ , resulting in one set of parameters that takes a task embedding as input and outputs both scale and shift values for a particular layer of the base network. Next, we will describe our implementation of CTN with the base network as MLP and ResNet (He et al., 2016). For CTN, we will use $\hat { h }$ as the original features, $\tilde { h }$ as the task-specific features, and $h$ as the combine features.
|
| 344 |
+
|
| 345 |
+
CTN with Multilayer Perceptron. Consider an $L -$ layers MLP with the form:
|
| 346 |
+
|
| 347 |
+
$$
|
| 348 |
+
\begin{array} { r l } & { h _ { 0 } = { \pmb x } } \\ & { ~ h _ { l } = \mathrm { R e L U } ( { \pmb W } _ { l } ^ { \top } h _ { l - 1 } ) , \forall l = 1 , \dots , L - 1 , } \\ & { h _ { L } = g _ { t } = \mathrm { S o f t m a x } ( { \pmb W } _ { L , t } ^ { \top } h _ { L - 1 } ) } \end{array}
|
| 349 |
+
$$
|
| 350 |
+
|
| 351 |
+
where the last layer is the softmax classifier $h _ { t }$ . Since the last classification layer is already conditioned on the task information, here we are interested in conditioning the intermediate layers $h _ { l < L }$ . The CTN with MLP is implemented as:
|
| 352 |
+
|
| 353 |
+
$$
|
| 354 |
+
\begin{array} { r l } & { \hat { h } _ { 0 } = { \pmb x } } \\ & { \hat { h } _ { l } = \mathrm { R e L U } ( { \pmb W } _ { l } ^ { \top } h _ { l - 1 } ) , \forall l = 1 , \dots , L - 1 , } \\ & { \tilde { h } _ { l } = \mathrm { R e L U } ( \gamma _ { t } \otimes { \pmb W } _ { l } ^ { \top } h _ { l - 1 } + \beta _ { t } ) , \forall l = 1 , \dots , L - 1 , } \\ & { h _ { l } = \hat { h } _ { l } + \tilde { h } _ { l } } \\ & { h _ { L } = g _ { t } = \mathrm { S o f t m a x } ( \pmb W _ { L , t } ^ { \top } h _ { L - 1 } ) } \end{array}
|
| 355 |
+
$$
|
| 356 |
+
|
| 357 |
+
We condition each hidden layer of a MLP by using one context network for each layer. Each context network does not share parameters, however, the scale and shift models for one layer is shared.
|
| 358 |
+
|
| 359 |
+
CTN with Deep Residual Network. Unlike MLP, we apply the task conditioning after the residual blocks instead of each convolution layer. Particularly, given a residual block defined as:
|
| 360 |
+
|
| 361 |
+
$$
|
| 362 |
+
\begin{array} { l l } { \hat { h } _ { 1 } = \mathrm { R e L U } ( \mathrm { B N } ( \mathrm { c o n v } ( { \pmb x } ) ) ) } & { \hat { h } _ { 2 } = \mathrm { B N } ( \mathrm { c o n v } ( h _ { 1 } ) ) } \\ { \hat { h } _ { 3 } = \mathrm { B N } ( \mathrm { c o n v } ( { \pmb x } ) ) } & { \hat { h } _ { 4 } = \mathrm { c o n v } ( { \pmb x } ) } \\ { \bar { h } = \hat { h } _ { 3 } + \hat { h } _ { 4 } } & \end{array}
|
| 363 |
+
$$
|
| 364 |
+
|
| 365 |
+
The task-conditioned residual block is computed as:
|
| 366 |
+
|
| 367 |
+
$$
|
| 368 |
+
\tilde { h } = \mathrm { R e L U } ( \bar { h } ) + \mathrm { R e L U } ( \gamma _ { t } \otimes \bar { h } + \beta _ { t } )
|
| 369 |
+
$$
|
| 370 |
+
|
| 371 |
+
While in principle, it is possible to have a context network for each of the residual block, we empirically found that this does not offer significant improvements over using only one controller on the last residual block. Therefore, we only use one controller on the last residual block in all experiments that use a ResNet.
|
| 372 |
+
|
| 373 |
+
# C EXPERIMENT DETAILS
|
| 374 |
+
|
| 375 |
+
# C.1 DATASET SUMMARY
|
| 376 |
+
|
| 377 |
+
We summary the datasets used in our experiments in Table 6.
|
| 378 |
+
|
| 379 |
+
Table 6: Summary of datasets used in our experiments
|
| 380 |
+
|
| 381 |
+
<table><tr><td>Dataset</td><td>Classes</td><td>Train</td><td>Test</td><td>Dimension</td></tr><tr><td>MNIST (LeCun et al., 1998)</td><td>10</td><td>1,000</td><td>10,00</td><td>28×28</td></tr><tr><td>CIFAR100 (Krizhevsky& Hinton, 2009)</td><td>100</td><td>50,000</td><td>10,000</td><td>3×32×32</td></tr><tr><td>miniIMN(Vinyals et al., 2016)</td><td>100</td><td>50,000</td><td>10,000</td><td>3×84×84</td></tr><tr><td>CORe50 (Lomonaco & Maltoni, 2017)</td><td>50</td><td>119,894</td><td>44,971</td><td>3×84×84</td></tr></table>
|
| 382 |
+
|
| 383 |
+
For each benchmark, we normalize the pixel values to [0, 1] by dividing their values by 255.0 as used in Lopez-Paz & Ranzato (2017), no other data preprocessing steps are performed.
|
| 384 |
+
|
| 385 |
+
# C.2 ADDITIONAL BASELINES
|
| 386 |
+
|
| 387 |
+
In Table 7, we provide a more comprehensive comparison with more baselines in the four benchmarks considered: Permuted MNIST, Split CIFAR100 and Split miniIMN, and CORe50. Some of these baselines are less competitive, thus, were not included in the main paper due to space constraints. We provide a brief descrption of each baselines in the following.
|
| 388 |
+
|
| 389 |
+
Table 7: Evaluation metrics on continual learning benchmarks considered. All methods use the same backbone network for all benchmarks, episodic memory size is ${ \bf M } { = } 5 0$ samples per task
|
| 390 |
+
|
| 391 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3">pMNIST</td><td colspan="3">CORe50</td></tr><tr><td>ACC(↑)</td><td>FM(↓)</td><td>LA(↑)</td><td>ACC(↑)</td><td>FM(↓)</td><td>LA(↑)</td></tr><tr><td>Finetune</td><td>61.66±1.50</td><td>20.67±1.64</td><td>80.89±0.45</td><td>4.38±0.10</td><td>49.66±1.14</td><td>49.08±1.20</td></tr><tr><td>LwF</td><td>63.31±3.56</td><td>14.29±3.05</td><td>75.76±1.43</td><td>31.20±0.66</td><td>20.44±1.37</td><td>49.20±1.10</td></tr><tr><td>EWC</td><td>67.34±3.00</td><td>11.00±2.36</td><td>76.59±1.49</td><td>31.86±3.90</td><td>14.34±3.08</td><td>42.98±2.50</td></tr><tr><td>GEM</td><td>74.84±0.95</td><td>8.57±0.33</td><td>81.74±0.77</td><td>42.56±0.86</td><td>7.36±0.90</td><td>46.84±2.22</td></tr><tr><td>KDR</td><td>72.97±0.58</td><td>9.20±0.44</td><td>81.40±0.41</td><td>OOM</td><td>OOM</td><td>OOM</td></tr><tr><td>AGEM</td><td>68.67±0.71</td><td>13.98±0.68</td><td>81.54±0.25</td><td>40.28±3.15</td><td>11.08±4.01</td><td>46.68±1.51</td></tr><tr><td>MER</td><td>76.59±0.74</td><td>6.88±0.59</td><td>82.09±0.33</td><td>39.28±1.25</td><td>9.08±1.25</td><td>45.52±0.96</td></tr><tr><td>ER-Ring</td><td>76.02±0.59</td><td>8.57±0.33</td><td>83.69±0.44</td><td>41.72±1.30</td><td>9.10±0.80</td><td>48.18±0.81</td></tr><tr><td>MIR</td><td>76.58±0.10</td><td>8.34±0.11</td><td>83.57±0.07</td><td>43.50±1.92</td><td>6.14±0.91</td><td>45.98±1.14</td></tr><tr><td>BCL</td><td>7.91±0.34</td><td>6.23±0.14</td><td>83.75±0.28</td><td>44.72±1.31</td><td>5.97±0.88</td><td>47.68±0.87</td></tr><tr><td>CTN (ours)</td><td>79.01±0.65</td><td>6.69±0.51</td><td>85.11±0.45</td><td>54.17±0.85</td><td>5.50±1.01</td><td>55.32±0.34</td></tr><tr><td>Independent*</td><td>81.05±0.29</td><td>0.00</td><td>81.05±0.29</td><td>53.54±1.10</td><td>0.00</td><td>53.54±1.10</td></tr><tr><td>Offline</td><td>84.95±0.95</td><td>1</td><td></td><td>89.73±0.91</td><td>1</td><td>=</td></tr><tr><td rowspan="2">Method</td><td colspan="3">Split CIFAR</td><td colspan="3">Split miniIMN</td></tr><tr><td>ACC(↑)</td><td>FM(↓)</td><td>LA(↑)</td><td>ACC(↑)</td><td>FM(↓)</td><td>LA(↑)</td></tr><tr><td>Finetune</td><td>33.52±3.13</td><td>33.88±2.78</td><td>65.15±1.18</td><td>31.51±2.00</td><td>26.00±2.12</td><td>55.83±1.42</td></tr><tr><td>EWC</td><td>39.46±3.75</td><td>24.69±3.84</td><td>64.54±1.20</td><td>32.52±0.53</td><td>25.74±2.78</td><td>56.39±2.45</td></tr><tr><td>ICARL</td><td>50.27±0.84</td><td>16.55±0.82</td><td>65.83±1.53</td><td>44.95±0.08</td><td>17.59±0.40</td><td>61.46±0.50</td></tr><tr><td>GEM</td><td>57.77±0.86</td><td>10.93±1.03</td><td>66.45±0.06</td><td>55.04±1.88</td><td>7.81±1.70</td><td>60.13±1.36</td></tr><tr><td>KDR</td><td>62.75±0.80</td><td>5.01±0.79</td><td>66.11±0.70</td><td>56.89±2.45</td><td>4.83±1.23</td><td>59.29±1.31</td></tr><tr><td>AGEM</td><td>58.27±0.86</td><td>8.76±0.67</td><td>66.12±1.17</td><td>51.14±2.16</td><td>6.99±1.96</td><td>55.11±0.76</td></tr><tr><td>MER</td><td>61.32±0.86</td><td>11.90±0.86</td><td>72.51±0.41</td><td>57.94±1.08</td><td>8.98±0.79</td><td>66.11±0.76</td></tr><tr><td>ER-Ring</td><td>61.36±1.01</td><td>7.20±0.72</td><td>67.05±1.08</td><td>53.43±1.18</td><td>11.21±1.35</td><td>63.46±1.05</td></tr><tr><td>MIR</td><td>63.37±1.99</td><td>10.53±1.63</td><td>73.27±0.77</td><td>51.97±1.58</td><td>10.37±2.72</td><td>60.63±3.43</td></tr><tr><td>BCL</td><td>63.87±2.27</td><td>4.93±0.75</td><td>67.73±1.99</td><td>62.20±0.43</td><td>4.85±0.95</td><td>65.23±1.10</td></tr><tr><td>CTN (ours)</td><td>67.65±0.43</td><td>6.33±0.70</td><td>73.43±0.45</td><td>65.82±0.59</td><td>3.02±1.13</td><td>67.43±1.37</td></tr><tr><td>Independent*</td><td>67.21±0.51</td><td>0.00</td><td>67.21±0.51</td><td>65.85±0.98</td><td>0.00</td><td>65.85±0.98</td></tr><tr><td>Offline</td><td>74.11±0.66</td><td>1</td><td>1</td><td>71.15±2.95</td><td>1</td><td>=</td></tr></table>
|
| 392 |
+
|
| 393 |
+
• Finetune: a naive method that learns sequentially without any regularization.
|
| 394 |
+
|
| 395 |
+
• LwF (Li & Hoiem, 2017): prevents forgetting by a distillation loss of the previous model on current data.
|
| 396 |
+
|
| 397 |
+
• EWC (Kirkpatrick et al., 2017): penalizes the changes of important parameters to previous tasks to prevent forgetting.
|
| 398 |
+
|
| 399 |
+
• GEM (Lopez-Paz & Ranzato, 2017): uses an episodic memory to store some data and prevents the losses of old tasks from increasing during learning new tasks.
|
| 400 |
+
|
| 401 |
+
• KDR (Hou et al., 2018): uses knowledge distillation and task-specific experts to balance between learning new tasks and alleviating forgetting.
|
| 402 |
+
|
| 403 |
+
• AGEM (Chaudhry et al., 2019a): an efficient version of GEM by averaging the constraints in GEM.
|
| 404 |
+
|
| 405 |
+
• MER: (Riemer et al., 2019) maximizes the gradient inner product between every sample pair in the memory by a variant of the Reptile algorithm. We use MERAlg6 with mini batch of size 10 for consistency with remaining methods.
|
| 406 |
+
|
| 407 |
+
• ER-Ring (Chaudhry et al., 2019b): simply mixes data of previous and current tasks during training and optimizes a multitask loss.
|
| 408 |
+
|
| 409 |
+
• MIR (Aljundi et al., 2019a): is a variant of ER which selects the samples in the episodic memory that maximizes the model’s forgetting to replay.
|
| 410 |
+
|
| 411 |
+

|
| 412 |
+
Figure 3: Effect of memory size on CTN’s performance. For every semantic memory size $m \times 5 0$ , the corresponding episodic memory size is $( 1 - m ) \times 5 0$ .
|
| 413 |
+
|
| 414 |
+
• BCL (Pham et al., 2020): a bilevel-optimization method using Reptile update (Nichol et al., 2018) such that the base model can generalize to a separate memory units. Unlike BCL, our CTN can model the task-specific features and does not need approximations to solve the bilevel optimization problem.
|
| 415 |
+
|
| 416 |
+
• Independent∗ (Lopez-Paz & Ranzato, 2017): maintains a separate model for each task, each has the same number of parameters as other methods. While being unrealistic, this model was used as the upper bound model in Hung et al. (2019) thanks to its impressive performance.
|
| 417 |
+
|
| 418 |
+
• Offline: an upper bound model that performs multitask training on all data. Note that this model does not follow the continual learning setting. We implement the offline model by training the network three epochs over all data of all tasks.
|
| 419 |
+
|
| 420 |
+
# C.3 CTN MODEL COMPLEXITY AND COMPUTATION COST
|
| 421 |
+
|
| 422 |
+
Model complexity. Recall the interaction between the controller and the base model is described as:
|
| 423 |
+
|
| 424 |
+
$$
|
| 425 |
+
\widetilde { h } ( \pmb { x } ; t ) = \frac { \gamma _ { t } } { \| \gamma _ { t } \| _ { 2 } } \otimes h ( \pmb { x } ) + \frac { \beta _ { t } } { \| \beta _ { t } \| _ { 2 } } \mathrm { a n d } \{ \gamma _ { t } , \beta _ { t } \} = c _ { \pmb { \theta } } ( e ( t ) ) ,
|
| 426 |
+
$$
|
| 427 |
+
|
| 428 |
+
where $h ( { \pmb x } )$ is a feature map with dimension $( C \times H \times W )$ where $C$ is the number of channels, $H$ and $W$ are the spatial dimension of this feature map. A feature-wise affine transformation $\gamma _ { t } , \beta _ { t }$ is only required to have dimension $( C \times 1 \times 1 )$ for each $\gamma _ { t }$ and $\beta _ { t }$ . In our implementation, we predict both $\gamma _ { t }$ and $\beta _ { t }$ from the task embedding ${ \dot { e } } ( t )$ by a parameter $\pmb \theta$ . As a result, let $e$ be the task embedding dimension, the embedding layer will cost $( T \times e )$ and the controller (linear regression model) will cost $( 2 C \times e )$ , resulting in the total $( T \times e + 2 C \times e )$ parameters in the controller for all tasks. In practice, this term is dominated by $C \times e$ because $T$ and $e$ are the number of tasks and the embedding dimension, which are quite small. When a new task arrives, we only need to allocate $e$ parameters in the embedding matrix.
|
| 429 |
+
|
| 430 |
+
Overall, CTN offers significantly performance improvements with only minimal memory overhead.
|
| 431 |
+
|
| 432 |
+
# C.4 EFFECT OF THE SEMANTIC MEMORY SIZE
|
| 433 |
+
|
| 434 |
+
We study how the semantic memory size effects CTN performance. For this experiment, we consider the validation tasks in the Split CIFAR-100 benchmark (the first three tasks) and vary the semantic memory size and episodic memory size such that their total sizes equals to 50 samples per task.
|
| 435 |
+
|
| 436 |
+
Fig. 3 reports the results of this experiment. We can see that when the semantic memory size is 10 $20 \%$ of the total memory), CTN achieves the highest ACC, FM(↓) and lowest $\mathrm { F M ( \downarrow ) }$ and these evaluation metrics degrades when the semantic memory sizes increases. Generally, we have to balance the amount of memory for controller and the base network. Since the controller is only a simple model, it only requires a small amount of data in the semantic memory.
|
| 437 |
+
|
| 438 |
+
We provide the hyper-parameters values of methods considered in our task-aware experiments. For brevity, we use MNIST to denote both the Permuted MNIST and Rotated MNIST benchmarks. The Small Split CIFAR experiments use the same hyper-parameter settings as the original Split CIFAR100. For each method, we use the same hyper-parameter notation and description as provided in the corresponding original papers.
|
| 439 |
+
|
| 440 |
+
• GEM - Learning rate: 0.03 (MNNIST, Split CIFAR100), 0.05 (Split miniIMN) - Gradient noise $\gamma \colon 0 . 5$ (all experiments) - Number of gradient updates: 1 (all experiments)
|
| 441 |
+
|
| 442 |
+
• AGEM
|
| 443 |
+
|
| 444 |
+
- Learning rate: 0.03 (MNNIST), 0.1 (Split CIFAR100), 0.3 (Split miniIMN)
|
| 445 |
+
- Number of to estimate gradient constraints: 1000 (MNIST), 850 (Splti CIFAR100, Split
|
| 446 |
+
miniIMN) - Number of gradient updates: 1 (all experiments)
|
| 447 |
+
|
| 448 |
+
• MER
|
| 449 |
+
|
| 450 |
+
- Learning rate: 0.03 (MNIST), 0.05 (Split miniIMN), 0.1 (Split CIFAR100) - Replay batch size: 64 (Permuted MNIST, Split CIFAR), 128 (Split miniIMN) - Number of gradient updates: 3 (all experiments)
|
| 451 |
+
- Across batch leanring rate $\gamma \colon 0 . 3$ (all experiments)
|
| 452 |
+
|
| 453 |
+
# • ER
|
| 454 |
+
|
| 455 |
+
- Learning rate: 0.03 (MNIST, Split CIFAR100, Split mini Imagenet) - Replay batch size: 10 (all benchmarks) - Number of gradient updates: 3 (all experiments)
|
| 456 |
+
|
| 457 |
+
• MIR
|
| 458 |
+
|
| 459 |
+
- Learning rate: 0.03 (MNIST, Split CIFAR100, Split mini Imagenet) - Replay batch size: 10 (all benchmarks) - Number of gradient updates: 3 (all experiments)
|
| 460 |
+
|
| 461 |
+
• CTN
|
| 462 |
+
|
| 463 |
+
- Inner learning rate $\alpha \colon 0 . 0 1$ (all benchmarks)
|
| 464 |
+
- Outer learning rate $\beta$ : 0.05 (all benchmarks)
|
| 465 |
+
- Regularization strength λ: 100 (all benchmarks)
|
| 466 |
+
- Temperature $\tau \colon 5$ (all benchmarks)
|
| 467 |
+
- Replay batch size: 64 (all benchmarks)
|
| 468 |
+
- Number of inner and outer updates: 2 (all benchmarks)
|
| 469 |
+
- Semantic memory size in percentage of total memory: $2 0 \%$ (all benchmarks)
|
| 470 |
+
|
| 471 |
+
Each hyper-parameter is cross-validated using grid search on the three validation tasks, which will not be encountered during continual learning. The grid for each hyper-parameter is provided below.
|
| 472 |
+
|
| 473 |
+
• Learning rate, including inner, outer (CTN) and across batch (MER) learning rates: [0.01, 0.03, 0.05, 0.1, 0.3]
|
| 474 |
+
• Number of gradient updates, including inner and outer updates (CTN): [1, 2, 3, 4]
|
| 475 |
+
• Replay batch size: [10, 32, 64, 128]
|
| 476 |
+
• Temperature $\tau$ : [1, 2, 5, 10]
|
| 477 |
+
• Regularization strength $\lambda$ (CTN):
|
| 478 |
+
|
| 479 |
+
Table 8: Alternative strategies to reduce forgetting in CTN’s inner optimization. BC: behavioural cloning strategy in Eq. 6
|
| 480 |
+
|
| 481 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3"> Split CIFAR</td><td colspan="3">Split miniIMN</td></tr><tr><td>ACC(↑)</td><td>FM(↓)</td><td>LA(↑)</td><td>ACC(↑)</td><td>FM(↓)</td><td>LA(↑)</td></tr><tr><td>CTN-BC</td><td>67.65±0.43</td><td>6.33±0.70</td><td>73.43±0.45</td><td>65.82±0.59</td><td>3.02±1.13</td><td>67.73±1.73</td></tr><tr><td>CTN-EWC</td><td>60.33±1.44</td><td>9.33±1.55</td><td>68.78±0.24</td><td>57.69±0.96</td><td>5.59±0.45</td><td>61.53±1.38</td></tr><tr><td>CTN-GEM</td><td>64.40±2.52</td><td>8.06±1.92</td><td>71.49±0.46</td><td>60.65±0.80</td><td>5.83±0.84</td><td>64.42±0.46</td></tr></table>
|
| 482 |
+
|
| 483 |
+
- λ (CTN): [1, 10, 25, 50, 100] - γ (GEM): [0, 0.5, 1] • Semantic memory size in percentage of total memory (CTN): $[ 1 0 \%$ , $2 0 \%$ , $3 0 \%$ , $4 0 \%$
|
| 484 |
+
|
| 485 |
+
# D VARIANTS OF CTN
|
| 486 |
+
|
| 487 |
+
In this section, we explored alternative strategies for alleviating catastrophic forgetting in CTN’s inner optimization problem, which is experience replay (ER) to train the base model $\phi$ . Particularly, instead of the behavioural cloning strategy in Eq. 6, we consider two strategy to alleviate forgetting in ER by combining ER with EWC (Kirkpatrick et al., 2017) and GEM (Lopez-Paz & Ranzato, 2017). Table 8 show the results of this experiment on the Split CIFAR100 and Split miniIMN benchmarks. We can see that the behavioural cloning strategy significantly outperforms its competitors, EWC and GEM. Notably, using CTN with EWC requires larger episodic memory to store the previous tasks’ parameters and their importance. Moreover, using CTN with GEM results in slower running time since GEM has the slowest training time as shown in Table 5. The results show that the behavioural cloning strategy is more suitable for alleviating forgetting in ER, while enjoying less memory overhead or faster running time compared to other alternatives.
|